Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:04

0001 // Created by: Peter KURNEV
0002 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0003 //
0004 // This file is part of Open CASCADE Technology software library.
0005 //
0006 // This library is free software; you can redistribute it and/or modify it under
0007 // the terms of the GNU Lesser General Public License version 2.1 as published
0008 // by the Free Software Foundation, with special exception defined in the file
0009 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0010 // distribution for complete text of the license and disclaimer of any warranty.
0011 //
0012 // Alternatively, this file may be used under the terms of Open CASCADE
0013 // commercial license or contractual agreement.
0014 
0015 #ifndef _BOPDS_ShapeInfo_HeaderFile
0016 #define _BOPDS_ShapeInfo_HeaderFile
0017 
0018 #include <Standard.hxx>
0019 #include <Standard_DefineAlloc.hxx>
0020 #include <Standard_Handle.hxx>
0021 
0022 #include <Bnd_Box.hxx>
0023 #include <NCollection_BaseAllocator.hxx>
0024 #include <Standard_Integer.hxx>
0025 #include <Standard_Boolean.hxx>
0026 #include <TColStd_ListOfInteger.hxx>
0027 #include <TopoDS_Shape.hxx>
0028 
0029 
0030 //! The class BOPDS_ShapeInfo is to store
0031 //! handy information about shape
0032 class BOPDS_ShapeInfo 
0033 {
0034 public:
0035 
0036   DEFINE_STANDARD_ALLOC
0037 
0038   //! Empty constructor
0039   BOPDS_ShapeInfo();
0040 
0041   virtual ~BOPDS_ShapeInfo();
0042 
0043   //! Constructor
0044   //! @param theAllocator the allocator to manage the memory
0045   BOPDS_ShapeInfo(const Handle(NCollection_BaseAllocator)& theAllocator);
0046   
0047 
0048   //! Modifier
0049   //! Sets the shape <theS>
0050     void SetShape (const TopoDS_Shape& theS);
0051   
0052 
0053   //! Selector
0054   //! Returns the shape
0055     const TopoDS_Shape& Shape() const;
0056   
0057 
0058   //! Modifier
0059   //! Sets the type of shape theType
0060     void SetShapeType (const TopAbs_ShapeEnum theType);
0061   
0062 
0063   //! Selector
0064   //! Returns the type of shape
0065     TopAbs_ShapeEnum ShapeType() const;
0066   
0067 
0068   //! Modifier
0069   //! Sets the boundung box of the shape theBox
0070     void SetBox (const Bnd_Box& theBox);
0071   
0072 
0073   //! Selector
0074   //! Returns the boundung box of the shape
0075     const Bnd_Box& Box() const;
0076   
0077 
0078   //! Selector/Modifier
0079   //! Returns the boundung box of the shape
0080     Bnd_Box& ChangeBox();
0081   
0082 
0083   //! Selector
0084   //! Returns the list of indices of sub-shapes
0085     const TColStd_ListOfInteger& SubShapes() const;
0086   
0087 
0088   //! Selector/ Modifier
0089   //! Returns the list of indices of sub-shapes
0090     TColStd_ListOfInteger& ChangeSubShapes();
0091   
0092 
0093   //! Query
0094   //! Returns true if the shape has sub-shape with
0095   //! index theI
0096     Standard_Boolean HasSubShape (const Standard_Integer theI) const;
0097   
0098     Standard_Boolean HasReference() const;
0099   
0100 
0101   //! Modifier
0102   //! Sets the index of a reference information
0103     void SetReference (const Standard_Integer theI);
0104   
0105 
0106   //! Selector
0107   //! Returns the index of a reference information
0108     Standard_Integer Reference() const;
0109   
0110 
0111   //! Query
0112   //! Returns true if the shape has boundary representation
0113     Standard_Boolean HasBRep() const;
0114   
0115 
0116   //! Returns true if the shape can be participant of
0117   //! an interference
0118   //!
0119   //! Flag
0120     Standard_Boolean IsInterfering() const;
0121   
0122 
0123   //! Query
0124   //! Returns true if there is flag.
0125     Standard_Boolean HasFlag() const;
0126   
0127 
0128   //! Query
0129   //! Returns true if there is flag.
0130   //! Returns the flag theFlag
0131     Standard_Boolean HasFlag (Standard_Integer& theFlag) const;
0132   
0133 
0134   //! Modifier
0135   //! Sets the flag
0136     void SetFlag (const Standard_Integer theI);
0137   
0138 
0139   //! Returns the flag
0140     Standard_Integer Flag() const;
0141   
0142   Standard_EXPORT void Dump() const;
0143 
0144 
0145 
0146 
0147 protected:
0148 
0149 
0150 
0151   TopoDS_Shape myShape;
0152   TopAbs_ShapeEnum myType;
0153   Bnd_Box myBox;
0154   TColStd_ListOfInteger mySubShapes;
0155   Standard_Integer myReference;
0156   Standard_Integer myFlag;
0157 
0158 
0159 private:
0160 
0161 
0162 
0163 
0164 
0165 };
0166 
0167 
0168 #include <BOPDS_ShapeInfo.lxx>
0169 
0170 
0171 
0172 
0173 
0174 #endif // _BOPDS_ShapeInfo_HeaderFile