42cf5bc1 |
1 | // Created on: 1995-04-25 |
2 | // Created by: Marie Jose MARTZ |
3 | // Copyright (c) 1995-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
10 | // by the Free Software Foundation, with special exception defined in the file |
11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | // distribution for complete text of the license and disclaimer of any warranty. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _BRepToIGESBRep_Entity_HeaderFile |
18 | #define _BRepToIGESBRep_Entity_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <TopTools_IndexedMapOfShape.hxx> |
25 | #include <TColStd_IndexedMapOfTransient.hxx> |
26 | #include <BRepToIGES_BREntity.hxx> |
27 | #include <Standard_Integer.hxx> |
7e785937 |
28 | #include <Message_ProgressRange.hxx> |
29 | |
42cf5bc1 |
30 | class IGESSolid_EdgeList; |
31 | class IGESSolid_VertexList; |
32 | class TopoDS_Vertex; |
33 | class TopoDS_Edge; |
34 | class IGESData_IGESEntity; |
35 | class TopoDS_Shape; |
36 | class TopoDS_Face; |
37 | class IGESSolid_Loop; |
38 | class TopoDS_Wire; |
39 | class IGESSolid_Face; |
40 | class IGESSolid_Shell; |
41 | class TopoDS_Shell; |
42 | class IGESSolid_ManifoldSolid; |
43 | class TopoDS_Solid; |
44 | class TopoDS_CompSolid; |
45 | class TopoDS_Compound; |
46 | |
42cf5bc1 |
47 | //! provides methods to transfer BRep entity from CASCADE to IGESBRep. |
48 | class BRepToIGESBRep_Entity : public BRepToIGES_BREntity |
49 | { |
50 | public: |
51 | |
52 | DEFINE_STANDARD_ALLOC |
53 | |
54 | |
55 | //! Creates a tool Entity |
56 | Standard_EXPORT BRepToIGESBRep_Entity(); |
57 | |
58 | //! Clears the contents of the fields |
59 | Standard_EXPORT void Clear(); |
60 | |
61 | //! Create the VertexList entity |
62 | Standard_EXPORT void TransferVertexList(); |
63 | |
64 | //! Returns the index of <myvertex> in "myVertices" |
65 | Standard_EXPORT Standard_Integer IndexVertex (const TopoDS_Vertex& myvertex) const; |
66 | |
67 | //! Stores <myvertex> in "myVertices" |
68 | //! Returns the index of <myvertex>. |
69 | Standard_EXPORT Standard_Integer AddVertex (const TopoDS_Vertex& myvertex); |
70 | |
71 | //! Transfert an Edge entity from TopoDS to IGES |
72 | Standard_EXPORT void TransferEdgeList(); |
73 | |
74 | //! Returns the index of <myedge> in "myEdges" |
75 | Standard_EXPORT Standard_Integer IndexEdge (const TopoDS_Edge& myedge) const; |
76 | |
77 | //! Stores <myedge> in "myEdges" and <mycurve3d> in "myCurves". |
78 | //! Returns the index of <myedge>. |
79 | Standard_EXPORT Standard_Integer AddEdge (const TopoDS_Edge& myedge, const Handle(IGESData_IGESEntity)& mycurve3d); |
80 | |
81 | //! Returns the result of the transfert of any Shape |
82 | //! If the transfer has failed, this member return a NullEntity. |
7e785937 |
83 | Standard_EXPORT virtual Handle(IGESData_IGESEntity) TransferShape |
84 | (const TopoDS_Shape& start, |
85 | const Message_ProgressRange& theProgress = Message_ProgressRange()) Standard_OVERRIDE; |
42cf5bc1 |
86 | |
87 | //! Transfert an Edge entity from TopoDS to IGES |
88 | //! If this Entity could not be converted, this member returns a NullEntity. |
89 | Standard_EXPORT Handle(IGESData_IGESEntity) TransferEdge (const TopoDS_Edge& myedge); |
90 | |
91 | //! Transfert an Edge entity from TopoDS to IGES |
92 | //! If this Entity could not be converted, this member returns a NullEntity. |
93 | Standard_EXPORT Handle(IGESData_IGESEntity) TransferEdge (const TopoDS_Edge& myedge, const TopoDS_Face& myface, const Standard_Real length); |
94 | |
95 | //! Transfert a Wire entity from TopoDS to IGES. |
96 | //! Returns the curve associated to mywire in the parametric space of myface. |
97 | //! If this Entity could not be converted, this member returns a NullEntity. |
98 | Standard_EXPORT Handle(IGESSolid_Loop) TransferWire (const TopoDS_Wire& mywire, const TopoDS_Face& myface, const Standard_Real length); |
99 | |
100 | //! Transfert a Face entity from TopoDS to IGES |
101 | //! If this Entity could not be converted, this member returns a NullEntity. |
102 | Standard_EXPORT Handle(IGESSolid_Face) TransferFace (const TopoDS_Face& start); |
103 | |
104 | //! Transfert an Shell entity from TopoDS to IGES |
105 | //! If this Entity could not be converted, this member returns a NullEntity. |
7e785937 |
106 | Standard_EXPORT Handle(IGESSolid_Shell) TransferShell (const TopoDS_Shell& start, |
107 | const Message_ProgressRange& theProgress = Message_ProgressRange()); |
42cf5bc1 |
108 | |
109 | //! Transfert a Solid entity from TopoDS to IGES |
110 | //! If this Entity could not be converted, this member returns a NullEntity. |
7e785937 |
111 | Standard_EXPORT Handle(IGESSolid_ManifoldSolid) TransferSolid (const TopoDS_Solid& start, |
112 | const Message_ProgressRange& theProgress = Message_ProgressRange()); |
42cf5bc1 |
113 | |
114 | //! Transfert an CompSolid entity from TopoDS to IGES |
115 | //! If this Entity could not be converted, this member returns a NullEntity. |
7e785937 |
116 | Standard_EXPORT Handle(IGESData_IGESEntity) TransferCompSolid (const TopoDS_CompSolid& start, |
117 | const Message_ProgressRange& theProgress = Message_ProgressRange()); |
42cf5bc1 |
118 | |
119 | //! Transfert a Compound entity from TopoDS to IGES |
120 | //! If this Entity could not be converted, this member returns a NullEntity. |
7e785937 |
121 | Standard_EXPORT Handle(IGESData_IGESEntity) TransferCompound (const TopoDS_Compound& start, |
122 | const Message_ProgressRange& theProgress = Message_ProgressRange()); |
42cf5bc1 |
123 | |
124 | |
125 | |
126 | |
127 | protected: |
128 | |
129 | |
130 | |
131 | |
132 | |
133 | private: |
134 | |
135 | |
136 | |
137 | TopTools_IndexedMapOfShape myVertices; |
138 | TopTools_IndexedMapOfShape myEdges; |
139 | TColStd_IndexedMapOfTransient myCurves; |
140 | Handle(IGESSolid_EdgeList) myEdgeList; |
141 | Handle(IGESSolid_VertexList) myVertexList; |
142 | |
143 | |
144 | }; |
145 | |
146 | |
147 | |
148 | |
149 | |
150 | |
151 | |
152 | #endif // _BRepToIGESBRep_Entity_HeaderFile |