0026106: BRepMesh - revision of data model
[occt.git] / src / BRepMesh / BRepMesh.hxx
1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
13
14 #ifndef _BRepMesh_HeaderFile
15 #define _BRepMesh_HeaderFile
16
17 #include <gp_Pnt.hxx>
18 #include <gp_XYZ.hxx>
19 #include <gp_XY.hxx>
20 #include <Bnd_B2d.hxx>
21 #include <Bnd_Box2d.hxx>
22 #include <Standard.hxx>
23 #include <NCollection_List.hxx>
24 #include <NCollection_Map.hxx>
25 #include <NCollection_Vector.hxx>
26 #include <NCollection_Handle.hxx>
27 #include <NCollection_DataMap.hxx>
28 #include <NCollection_IndexedMap.hxx>
29 #include <NCollection_IndexedDataMap.hxx>
30 #include <NCollection_Array1.hxx>
31 #include <NCollection_Sequence.hxx>
32 #include <NCollection_CellFilter.hxx>
33 #include <NCollection_IncAllocator.hxx>
34 #include <NCollection_EBTree.hxx>
35 #include <NCollection_UBTreeFiller.hxx>
36 #include <BRepMesh_Edge.hxx>
37 #include <BRepMesh_Triangle.hxx>
38 #include <BRepMesh_PairOfPolygon.hxx>
39 #include <BRepMesh_PairOfIndex.hxx>
40 #include <BRepMesh_Circle.hxx>
41 #include <TopTools_ShapeMapHasher.hxx>
42 #include <TopoDS_Face.hxx>
43 #include <TopoDS_Shape.hxx>
44
45 #include <vector>
46
47 class BRepMesh_Vertex;
48 class TopoDS_Edge;
49 class TopoDS_Vertex;
50 class BRepMesh_FaceAttribute;
51 class BRepMesh_VertexInspector;
52 class BRepMesh_CircleInspector;
53 class BRepMesh_Classifier;
54 class Poly_Triangulation;
55 class BRepMesh_VertexTool;
56
57 namespace BRepMesh
58 {
59   //! Default size for memory block allocated by IncAllocator. 
60   /**
61    * The idea here is that blocks of the given size are returned to the system
62    * rather than retained in the malloc heap, at least on WIN32 and WIN64 platforms.
63    */
64 #ifdef _WIN64
65   const size_t MEMORY_BLOCK_SIZE_HUGE = 1024 * 1024;
66 #else
67   const size_t MEMORY_BLOCK_SIZE_HUGE = 512 * 1024;
68 #endif
69
70   //! Structure keeping parameters of segment.
71   struct Segment
72   {
73     gp_XY StartPnt;
74     gp_XY EndPnt;
75   };
76
77   //! Sequences
78   typedef NCollection_Sequence<Bnd_B2d>                                                             SequenceOfBndB2d;
79   typedef NCollection_Sequence<Standard_Integer>                                                    SequenceOfInteger;
80   typedef NCollection_Sequence<Standard_Real>                                                       SequenceOfReal;
81
82   //! Vectors
83   typedef NCollection_Vector<BRepMesh_Vertex>                                                       VectorOfVertex;
84   typedef NCollection_Vector<Standard_Integer>                                                      VectorOfInteger;
85   typedef NCollection_Vector<BRepMesh_Circle>                                                       VectorOfCircle;
86
87   //! Trees
88   typedef NCollection_EBTree<Standard_Integer, Bnd_Box2d>                                           BndBox2dTree;
89   typedef NCollection_UBTreeFiller<Standard_Integer, Bnd_Box2d>                                     BndBox2dTreeFiller;
90
91   //! Arrays
92   typedef NCollection_Array1<BRepMesh_Vertex>                                                       Array1OfVertexOfDelaun;
93   typedef NCollection_Array1<Standard_Integer>                                                      Array1OfInteger;
94   typedef NCollection_Array1<Standard_Real>                                                         Array1OfReal;
95   typedef NCollection_Array1<Segment>                                                               Array1OfSegments;
96
97   //! Lists
98   typedef NCollection_List<gp_XY>                                                                   ListOfXY;
99   typedef NCollection_List<BRepMesh_Vertex>                                                         ListOfVertex;
100   typedef NCollection_List<Standard_Integer>                                                        ListOfInteger;
101
102   //! Maps
103   typedef NCollection_Map<Standard_Real>                                                            MapOfReal;
104   typedef NCollection_Map<Standard_Integer>                                                         MapOfInteger;
105   typedef NCollection_DataMap<Handle(Poly_Triangulation), Standard_Boolean>                         DMapOfTriangulationBool;
106   typedef NCollection_Map<TopoDS_Shape, TopTools_ShapeMapHasher>                                    MapOfShape;
107
108   typedef NCollection_DataMap<Standard_Integer, Standard_Integer>                                   MapOfIntegerInteger;
109   typedef NCollection_DataMap<TopoDS_Vertex, Standard_Integer, TopTools_ShapeMapHasher>             DMapOfVertexInteger;
110   typedef NCollection_DataMap<TopoDS_Face, Handle(BRepMesh_FaceAttribute), TopTools_ShapeMapHasher>  DMapOfFaceAttribute;
111   typedef NCollection_DataMap<TopoDS_Shape, BRepMesh_PairOfPolygon, TopTools_ShapeMapHasher>        DMapOfShapePairOfPolygon;
112   typedef NCollection_DataMap<Standard_Integer, gp_Pnt>                                             DMapOfIntegerPnt;
113   typedef NCollection_DataMap<Standard_Integer, ListOfXY>                                           DMapOfIntegerListOfXY;
114   typedef NCollection_DataMap<Standard_Integer, ListOfInteger>                                      DMapOfIntegerListOfInteger;
115   typedef NCollection_DataMap<TopoDS_Edge, DMapOfTriangulationBool, TopTools_ShapeMapHasher>        DMapOfEdgeListOfTriangulationBool;
116
117   typedef NCollection_IndexedMap<Standard_Integer>                                                  IMapOfInteger;
118   typedef NCollection_IndexedMap<Standard_Real>                                                     IMapOfReal;
119   typedef NCollection_IndexedMap<BRepMesh_Triangle>                                                 IMapOfElement;
120   typedef NCollection_IndexedDataMap<BRepMesh_Edge, BRepMesh_PairOfIndex>                           IDMapOfLink;
121
122   //! CellFilters
123   typedef NCollection_CellFilter<BRepMesh_CircleInspector>                                          CircleCellFilter;
124   typedef NCollection_CellFilter<BRepMesh_VertexInspector>                                          VertexCellFilter;
125
126   //! Handles
127   typedef NCollection_Handle<VectorOfVertex>                                                        HVectorOfVertex;
128   typedef NCollection_Handle<MapOfInteger>                                                          HMapOfInteger;
129   typedef NCollection_Handle<IMapOfInteger>                                                         HIMapOfInteger;
130   typedef NCollection_Handle<DMapOfShapePairOfPolygon>                                              HDMapOfShapePairOfPolygon;
131   typedef NCollection_Handle<DMapOfIntegerPnt>                                                      HDMapOfIntegerPnt;
132   typedef NCollection_Handle<BRepMesh_Classifier>                                                   HClassifier;
133   typedef NCollection_Handle<BndBox2dTree>                                                          HBndBox2dTree;
134   typedef NCollection_Handle<Array1OfSegments>                                                      HArray1OfSegments;
135   typedef NCollection_Handle<DMapOfVertexInteger>                                                   HDMapOfVertexInteger;
136   typedef NCollection_Handle<DMapOfIntegerListOfXY>                                                 HDMapOfIntegerListOfXY;
137   typedef NCollection_Handle<BRepMesh_VertexTool>                                                   HVertexTool;
138   typedef NCollection_Handle<SequenceOfBndB2d>                                                      HSequenceOfBndB2d;
139   typedef NCollection_Handle<SequenceOfInteger>                                                     HSequenceOfInteger;
140
141   //! Other data structures
142   typedef std::pair<HArray1OfSegments, HBndBox2dTree>                                               SegmentsTree;
143   typedef NCollection_Array1<SegmentsTree>                                                          Array1OfSegmentsTree;
144
145 } // namespace BRepMesh
146
147 #endif