1 // File: TopoDSToStep.cxx
2 // Created: Tue Dec 13 14:03:54 1994
3 // Author: Frederic MAUPAS
6 #include <TopoDSToStep.ixx>
7 #include <BRepTools_Modifier.hxx>
8 //#include <TopoDSToStep_DirectModification.hxx>
9 //#include <TopoDSToStep_ConicalSurfModif.hxx>
11 #include <TColStd_MapOfTransient.hxx>
12 #include <TopExp_Explorer.hxx>
14 #include <TopoDS_Face.hxx>
15 #include <TopLoc_Location.hxx>
16 #include <Geom_Surface.hxx>
17 #include <BRep_Tool.hxx>
18 #include <Transfer_SimpleBinderOfTransient.hxx>
19 #include <TransferBRep_ShapeMapper.hxx>
20 #include <TransferBRep.hxx>
21 #include <Transfer_Binder.hxx>
22 #include <MoniTool_DataMapOfShapeTransient.hxx>
23 #include <TopoDSToStep_Tool.hxx>
24 #include <MoniTool_DataMapIteratorOfDataMapOfShapeTransient.hxx>
27 Handle(TCollection_HAsciiString)
28 TopoDSToStep::DecodeBuilderError(const TopoDSToStep_BuilderError E)
30 Handle(TCollection_HAsciiString) mess;
33 case TopoDSToStep_BuilderDone:
35 mess = new TCollection_HAsciiString("Builder Done");
38 case TopoDSToStep_NoFaceMapped:
40 mess = new TCollection_HAsciiString("None of the Shell Faces has been mapped");
43 case TopoDSToStep_BuilderOther:
45 mess = new TCollection_HAsciiString("Other Error in Builder");
52 Handle(TCollection_HAsciiString)
53 TopoDSToStep::DecodeFaceError(const TopoDSToStep_MakeFaceError E)
55 Handle(TCollection_HAsciiString) mess;
58 case TopoDSToStep_FaceDone:
60 mess = new TCollection_HAsciiString("Face Done");
63 case TopoDSToStep_FaceOther:
65 mess = new TCollection_HAsciiString("Other Error in Make STEP face");
68 case TopoDSToStep_InfiniteFace:
70 mess = new TCollection_HAsciiString("The Face has no Outer Wire");
73 case TopoDSToStep_NonManifoldFace:
75 mess = new TCollection_HAsciiString("The Face is Internal or External");
78 case TopoDSToStep_NoWireMapped:
80 mess = new TCollection_HAsciiString("None of the Face Wires has been mapped");
87 Handle(TCollection_HAsciiString)
88 TopoDSToStep::DecodeWireError(const TopoDSToStep_MakeWireError E)
90 Handle(TCollection_HAsciiString) mess;
93 case TopoDSToStep_WireDone:
95 mess = new TCollection_HAsciiString("Wire Done");
98 case TopoDSToStep_WireOther:
100 mess = new TCollection_HAsciiString("Other Error in Make STEP wire");
103 case TopoDSToStep_NonManifoldWire:
105 mess = new TCollection_HAsciiString("The Wire is Internal or External");
112 Handle(TCollection_HAsciiString)
113 TopoDSToStep::DecodeEdgeError(const TopoDSToStep_MakeEdgeError E)
115 Handle(TCollection_HAsciiString) mess;
118 case TopoDSToStep_EdgeDone:
120 mess = new TCollection_HAsciiString("Edge Done");
123 case TopoDSToStep_EdgeOther:
125 mess = new TCollection_HAsciiString("Other Error in Make STEP Edge");
128 case TopoDSToStep_NonManifoldEdge:
130 mess = new TCollection_HAsciiString("The Edge is Internal or External");
137 Handle(TCollection_HAsciiString)
138 TopoDSToStep::DecodeVertexError(const TopoDSToStep_MakeVertexError E)
140 Handle(TCollection_HAsciiString) mess;
143 case TopoDSToStep_VertexDone:
145 mess = new TCollection_HAsciiString("Vertex Done");
148 case TopoDSToStep_VertexOther:
150 mess = new TCollection_HAsciiString("Other Error in Make STEP Vertex");
157 //=======================================================================
158 //function : AddResult
160 //=======================================================================
162 void TopoDSToStep::AddResult (const Handle(Transfer_FinderProcess)& FP,
163 const TopoDS_Shape &Shape,
164 const Handle(Standard_Transient) &ent)
166 Handle(Transfer_SimpleBinderOfTransient) result = new Transfer_SimpleBinderOfTransient;
167 result->SetResult (ent);
169 Handle(TransferBRep_ShapeMapper) mapper = TransferBRep::ShapeMapper (FP,Shape);
170 Handle(Transfer_Binder) binder = FP->Find ( mapper );
172 if ( binder.IsNull() ) FP->Bind ( mapper, result );
173 else binder->AddResult ( result );
176 //=======================================================================
177 //function : AddResult
179 //=======================================================================
181 void TopoDSToStep::AddResult (const Handle(Transfer_FinderProcess)& FP,
182 const TopoDSToStep_Tool &Tool)
184 const MoniTool_DataMapOfShapeTransient &Map = Tool.Map();
185 MoniTool_DataMapIteratorOfDataMapOfShapeTransient it ( Map );
186 for ( ; it.More(); it.Next() )
187 TopoDSToStep::AddResult ( FP, it.Key(), it.Value() );