1 // Created on: 1995-01-03
2 // Created by: Frederic MAUPAS/Dieter THIEMANN
3 // Copyright (c) 1995-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 //: gka 09.04.99: S4136: eliminate BRepAPI::Precision()
19 #include <BRep_Builder.hxx>
20 #include <StdFail_NotDone.hxx>
21 #include <StepShape_Vertex.hxx>
22 #include <StepShape_VertexLoop.hxx>
23 #include <StepToTopoDS_NMTool.hxx>
24 #include <StepToTopoDS_Tool.hxx>
25 #include <StepToTopoDS_TranslateVertex.hxx>
26 #include <StepToTopoDS_TranslateVertexLoop.hxx>
28 #include <TopoDS_Edge.hxx>
29 #include <TopoDS_Shape.hxx>
30 #include <TopoDS_Vertex.hxx>
31 #include <TopoDS_Wire.hxx>
32 #include <Transfer_TransientProcess.hxx>
34 //#include <BRepAPI.hxx>
35 // ============================================================================
36 // Method : StepToTopoDS_TranslateVertexLoop::StepToTopoDS_TranslateVertexLoop
37 // Purpose : Empty Constructor
38 // ============================================================================
39 StepToTopoDS_TranslateVertexLoop::StepToTopoDS_TranslateVertexLoop()
43 // ============================================================================
44 // Method : StepToTopoDS_TranslateVertexLoop::StepToTopoDS_TranslateVertexLoop
45 // Purpose : Constructor with a VertexLoop and a Tool
46 // ============================================================================
48 StepToTopoDS_TranslateVertexLoop::StepToTopoDS_TranslateVertexLoop(const Handle(StepShape_VertexLoop)& VL,
50 StepToTopoDS_NMTool& NMTool)
55 // ============================================================================
57 // Purpose : Init with a VertexLoop and a Tool
58 // ============================================================================
60 void StepToTopoDS_TranslateVertexLoop::Init(const Handle(StepShape_VertexLoop)& VL,
61 StepToTopoDS_Tool& aTool,
62 StepToTopoDS_NMTool& NMTool)
64 // A Vertex Loop shall be mapped onto a Vertex + Edge + Wire;
65 if (!aTool.IsBound(VL)) {
67 Handle(Transfer_TransientProcess) TP = aTool.TransientProcess();
69 //:S4136 Standard_Real preci = BRepAPI::Precision();
70 Handle(StepShape_Vertex) Vtx;
74 Vtx = VL->LoopVertex();
75 StepToTopoDS_TranslateVertex myTranVtx(Vtx, aTool, NMTool);
76 if (myTranVtx.IsDone()) {
77 V1 = TopoDS::Vertex(myTranVtx.Value());
78 V2 = TopoDS::Vertex(myTranVtx.Value());
81 TP->AddWarning(VL,"VertexLoop not mapped to TopoDS ");
82 myError = StepToTopoDS_TranslateVertexLoopOther;
83 done = Standard_False;
86 V1.Orientation(TopAbs_FORWARD);
87 V2.Orientation(TopAbs_REVERSED);
91 B.Degenerated(E, Standard_True);
94 W.Closed (Standard_True);
98 myError = StepToTopoDS_TranslateVertexLoopDone;
102 myResult = TopoDS::Wire(aTool.Find(VL));
103 myError = StepToTopoDS_TranslateVertexLoopDone;
104 done = Standard_True;
108 // ============================================================================
110 // Purpose : Return the mapped Shape
111 // ============================================================================
113 const TopoDS_Shape& StepToTopoDS_TranslateVertexLoop::Value() const
115 StdFail_NotDone_Raise_if(!done,"");
119 // ============================================================================
121 // Purpose : Return the TranslateVertexLoop Error code
122 // ============================================================================
124 StepToTopoDS_TranslateVertexLoopError StepToTopoDS_TranslateVertexLoop::Error() const