6077aeb6fd2488e2e983a958e778af88dc574473
[occt.git] / src / StepToTopoDS / StepToTopoDS_TranslateEdge.cxx
1 // Created on: 1995-01-03
2 // Created by: Frederic MAUPAS
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 //:o0 abv 16.02.99: POLYLINE allowed as 3d curve of edge
18 //gka,abv 05.04.99: S4136: improving tolerance management, eliminate BRepAPI::Precision()
19
20 #include <BRep_Builder.hxx>
21 #include <BRep_Tool.hxx>
22 #include <BRepLib.hxx>
23 #include <BRepLib_MakeEdge.hxx>
24 #include <GCPnts_AbscissaPoint.hxx>
25 #include <Geom2d_Curve.hxx>
26 #include <Geom_CartesianPoint.hxx>
27 #include <Geom_Curve.hxx>
28 #include <Geom_Line.hxx>
29 #include <Geom_Surface.hxx>
30 #include <GeomAbs_Shape.hxx>
31 #include <GeomAdaptor_Curve.hxx>
32 #include <gp_Dir.hxx>
33 #include <gp_Lin.hxx>
34 #include <gp_Vec.hxx>
35 #include <Precision.hxx>
36 #include <ShapeAnalysis_Curve.hxx>
37 #include <ShapeConstruct_Curve.hxx>
38 #include <StdFail_NotDone.hxx>
39 #include <StepGeom_CartesianPoint.hxx>
40 #include <StepGeom_Curve.hxx>
41 #include <StepGeom_Pcurve.hxx>
42 #include <StepGeom_Polyline.hxx>
43 #include <StepGeom_SurfaceCurve.hxx>
44 #include <StepRepr_DefinitionalRepresentation.hxx>
45 #include <StepShape_Edge.hxx>
46 #include <StepShape_EdgeCurve.hxx>
47 #include <StepShape_OrientedEdge.hxx>
48 #include <StepShape_Vertex.hxx>
49 #include <StepShape_VertexPoint.hxx>
50 #include <StepToGeom.hxx>
51 #include <StepToTopoDS.hxx>
52 #include <StepToTopoDS_GeometricTool.hxx>
53 #include <StepToTopoDS_NMTool.hxx>
54 #include <StepToTopoDS_Tool.hxx>
55 #include <StepToTopoDS_TranslateEdge.hxx>
56 #include <StepToTopoDS_TranslateVertex.hxx>
57 #include <TCollection_HAsciiString.hxx>
58 #include <TopoDS.hxx>
59 #include <TopoDS_Edge.hxx>
60 #include <TopoDS_Shape.hxx>
61 #include <TopoDS_Vertex.hxx>
62 #include <Transfer_TransientProcess.hxx>
63 #include <UnitsMethods.hxx>
64
65 //#include <StepGeom_Polyline.hxx>
66 //#include <TransferBRep.hxx>
67 //:d8
68 // Used in I-DEAS-like STP processing (ssv; 15.11.2010)
69 //#define DEBUG
70 // ============================================================================
71 // Method  : DecodeMakeEdgeError
72 // Purpose : 
73 // ============================================================================
74 static void DecodeMakeEdgeError(const BRepLib_MakeEdge&   ME,
75                                 const Handle(Standard_Transient)& orig,
76                                 const Handle(Geom_Curve)& myCurve,
77                                 const TopoDS_Vertex&      V1,
78                                 const TopoDS_Vertex&      V2,
79                                 const Standard_Real&      U1,
80                                 const Standard_Real&      U2,
81                                 StepToTopoDS_Tool&   aTool,
82                                 const Handle(StepShape_TopologicalRepresentationItem)& /*tobind*/)
83 {
84   (void)U1, (void)U2; // avoid compiler warning
85
86   Handle(Transfer_TransientProcess) TP = aTool.TransientProcess();
87 //  if (!myCurve.IsNull() && !tobind.IsNull()) {
88 //    TransferBRep::SetShapeResult
89 //      (TP,tobind, MakeEdge(myCurve,V1,V2,U1,U2,BRepAPI::Precision()) );
90 //    aTool.Bind (tobind,E);  SURTOUT PAS : noter pour debug/erreur
91 //  }
92 #ifdef OCCT_DEBUG
93   cout << "------------------------------------" << endl;
94   cout << "MakeEdge Error  : " << ME.Error()<<" - ";
95 #endif
96   switch(ME.Error())
97     {
98     case (BRepLib_EdgeDone): return;
99     case (BRepLib_PointProjectionFailed):
100       TP->AddFail(orig," Point Projection failed");
101       break;
102     case (BRepLib_ParameterOutOfRange):
103       TP->AddFail(orig," Parameter Out Of Range");
104       break;
105     case (BRepLib_DifferentPointsOnClosedCurve):
106       TP->AddFail(orig," Different Points on Closed Curve");
107       break;
108     case (BRepLib_PointWithInfiniteParameter):
109       TP->AddFail(orig," Point with infinite Parameter");
110       break;
111     case (BRepLib_DifferentsPointAndParameter):
112       if (!ShapeConstruct_Curve().AdjustCurve
113           (myCurve,BRep_Tool::Pnt(V1),BRep_Tool::Pnt(V2),Standard_True,Standard_True))
114         TP->AddFail(orig," Different Points and Parameters");
115        else TP->AddWarning(orig,"Different Points and Parameters, adjusted");
116       break;
117     case (BRepLib_LineThroughIdenticPoints):
118       TP->AddFail(orig," Line through identic Points");
119       break;
120     }
121 #ifdef OCCT_DEBUG
122   cout << "Original Type   : " << orig->DynamicType() << endl;
123   cout << "3D Curve Type   : " << myCurve->DynamicType() << endl;
124   cout << "First Parameter : " << U1 << endl;
125   gp_Pnt p1 = BRep_Tool::Pnt(V1);
126 //  cout << "First Point     : ";
127   cout << "First Vertex    : "<<p1.X()<<"  "<<p1.Y()<<"  "<<p1.Z()<<"  ";
128   cout << "Distance Point - Vertex : ";
129   Standard_Real d1 = p1.Distance(myCurve->Value(U1)); 
130   cout << d1 << endl;
131   cout << "Last  Parameter : " << U2 << endl;
132   gp_Pnt p2 = BRep_Tool::Pnt(V2);
133 //  cout << "Last  Point     : ";
134   cout << "Last  Vertex    : "<<p2.X()<<"  "<<p2.Y()<<"  "<<p2.Z()<<"  ";
135   cout << "Distance Point - Vertex : ";
136   Standard_Real d2 = BRep_Tool::Pnt(V2).Distance(myCurve->Value(U2)); 
137   cout << d2 << endl;
138 #endif
139 }
140
141 // ============================================================================
142 // Method  : StepToTopoDS_TranslateEdge::StepToTopoDS_TranslateEdge
143 // Purpose : Empty Constructor
144 // ============================================================================
145
146 static Handle(Geom_Curve) MakeCurve
147   (const Handle(StepGeom_Curve)& C1, const Handle(Transfer_TransientProcess) TP)
148 {
149   Handle(Geom_Curve) C2 = Handle(Geom_Curve)::DownCast (TP->FindTransient(C1));
150   if (!C2.IsNull()) return C2;
151   C2 = StepToGeom::MakeCurve (C1);
152   if (! C2.IsNull())
153     TP->BindTransient (C1,C2);
154   return C2;
155 }
156
157 static TopoDS_Edge  MakeEdge
158   (const Handle(Geom_Curve)& C3D,
159    const TopoDS_Vertex& V1, const TopoDS_Vertex& V2,
160    const Standard_Real U1, const Standard_Real U2) //, const Standard_Real preci)
161 {
162 //  fait son edge quoi qu il arrive
163   BRep_Builder B;
164   TopoDS_Edge E;
165   B.MakeEdge (E,C3D,Precision::Confusion());//preci);
166   B.Add (E,V1);  B.Add (E,V2);
167   B.UpdateVertex(V1, U1, E, 0.);//preci);
168   B.UpdateVertex(V2, U2, E, 0.);//preci);
169   return E;
170 }
171
172 StepToTopoDS_TranslateEdge::StepToTopoDS_TranslateEdge()
173 {
174   done = Standard_False;
175 }
176
177 // ============================================================================
178 // Method  : StepToTopoDS_TranslateEdge::StepToTopoDS_TranslateEdge()
179 // Purpose : Constructor with an Edge and a Tool
180 // ============================================================================
181
182 StepToTopoDS_TranslateEdge::StepToTopoDS_TranslateEdge(const Handle(StepShape_Edge)& E, 
183                                                        StepToTopoDS_Tool& T, 
184                                                        StepToTopoDS_NMTool& NMTool)
185 {
186   Init(E, T, NMTool);
187 }
188
189 // ============================================================================
190 // Method  : Init
191 // Purpose : Init with an Edge and a Tool.
192 //           This method builds an Edge With 2 Vertices and 2 Parameters.
193 //           The Edge is always build like FORWARD (BRepLib_MakeEdge)
194 // ============================================================================
195
196 void StepToTopoDS_TranslateEdge::Init(const Handle(StepShape_Edge)& aEdge, 
197                                       StepToTopoDS_Tool& aTool,
198                                       StepToTopoDS_NMTool& NMTool)
199 {
200   Handle(Transfer_TransientProcess) TP = aTool.TransientProcess();
201
202   Handle(StepShape_OrientedEdge) OE = 
203     Handle(StepShape_OrientedEdge)::DownCast(aEdge);
204   Handle(StepShape_Edge) wEdge = aEdge;
205   if ( ! OE.IsNull() ) wEdge = OE->EdgeElement();
206   Handle(StepShape_EdgeCurve) EC = Handle(StepShape_EdgeCurve)::DownCast(wEdge);
207   
208   if (aTool.IsBound(EC)) {
209     myResult = aTool.Find(EC);
210     if (BRep_Tool::Degenerated(TopoDS::Edge(myResult))) {
211       TP->AddWarning(EC,"Degenerated Edge in several faces : transferred for each face");
212     }
213     else {
214       myError  = StepToTopoDS_TranslateEdgeDone;
215       done     = Standard_True;
216 //      BRep_Builder B;
217 //:S4136      B.SameRange(TopoDS::Edge(myResult), Standard_False);    //:a5 abv 11 Feb 98
218 //:S4136      B.SameParameter(TopoDS::Edge(myResult), Standard_False);//:a5
219       return;
220     }
221   }
222
223   // [BEGIN] Proceed with non-manifold cases (ssv; 12.11.2010)
224   if ( NMTool.IsActive() && NMTool.IsBound(EC) ) {
225     TopoDS_Shape existingShape = NMTool.Find(EC);
226     // Reverse shape's orientation if needed
227     if ( !OE->Orientation() )
228       existingShape.Reverse();
229     myResult = existingShape;
230     myError = StepToTopoDS_TranslateEdgeDone;
231     done = Standard_True;
232     return;
233   }
234   // [END] Proceed with non-manifold cases (ssv; 12.11.2010)
235
236   // [BEGIN] Proceed with I-DEAS-like STP (ssv; 15.11.2010)
237   const Handle(TCollection_HAsciiString) anECName = EC->Name();
238   if ( NMTool.IsIDEASCase() && !anECName.IsNull() && !anECName->IsEmpty() &&
239        NMTool.IsBound(anECName->String()) ) {
240     TopoDS_Shape existingShape = NMTool.Find(anECName->String());
241     // Reverse shape's orientation if needed
242     if ( !OE->Orientation() )
243       existingShape.Reverse();
244     // Register Edge for final processing (I-DEAS case)
245     NMTool.RegisterNMEdge(existingShape);
246     myResult = existingShape;
247     myError = StepToTopoDS_TranslateEdgeDone;
248     done = Standard_True;
249     return;
250   }
251   // [END] Proceed with I-DEAS-like STP (ssv; 15.11.2010)
252
253   BRep_Builder B;
254
255 //  Standard_Real preci = BRepAPI::Precision();
256
257 //  Standard_Real precision = BRepAPI::Precision();
258
259   Handle(StepGeom_Curve) C = EC->EdgeGeometry();
260   if( C.IsNull())
261   {
262     TP->AddFail(EC," Geom Curve in EdgeCurve is equal to 0");
263     myError = StepToTopoDS_TranslateEdgeOther;
264     done = Standard_False;
265     return;
266   }
267   TopoDS_Edge E;
268   Handle(StepShape_Vertex) Vstart, Vend;
269
270   // -----------------------------------------------------------
271   // Extract the start and end Vertices corresponding to FORWARD
272   // (following the geometrical sense)
273   // -----------------------------------------------------------
274
275 //  Standard_Boolean OrientedEdgeOrientation = OE->Orientation();
276   Standard_Boolean EdgeCurveSameSense      = EC->SameSense();
277   
278   if (EdgeCurveSameSense) {
279     Vstart = EC->EdgeStart();
280     Vend   = EC->EdgeEnd();
281   }
282   else {
283     Vend   = EC->EdgeStart();
284     Vstart = EC->EdgeEnd();
285   }
286
287   TopoDS_Vertex V1, V2;
288
289   StepToTopoDS_TranslateVertex myTranVertex1(Vstart, aTool, NMTool);
290   StepToTopoDS_TranslateVertex myTranVertex2(Vend, aTool, NMTool);
291
292   if (myTranVertex1.IsDone()) {
293     V1 = TopoDS::Vertex(myTranVertex1.Value());
294     V1.Orientation(TopAbs_FORWARD);
295   }
296   if (Vend == Vstart) {
297     V2 = V1;
298     V2.Orientation(TopAbs_REVERSED);
299   }
300   else if (myTranVertex2.IsDone()) {
301     V2 = TopoDS::Vertex(myTranVertex2.Value());
302     V2.Orientation(TopAbs_REVERSED);
303   }
304   done = Standard_True;
305   
306   // ----------------------------------------------------------
307   // --- The EdgeCurve Geometry is of StepGeom_Curve Type
308   // --- It can be : * a Pcurve : no 3D curve is constructed
309   // ---             * a Surface Curve, Intersection Curve
310   // ---               or a Seam Curve
311   // ---             * a 3D Curve
312   // ----------------------------------------------------------
313   
314   if ( C->IsKind(STANDARD_TYPE(StepGeom_Pcurve))) {
315     B.MakeEdge(E);
316 //:S4136    B.UpdateEdge (E,preci);
317     B.Add(E, V1);    // ?? en fin de TranslateEdgeLoop
318     B.Add(E, V2);
319   }
320   else if (C->IsKind(STANDARD_TYPE(StepGeom_SurfaceCurve)) ) {
321     // qui reprend les types SeamCurve et IntersectionCurve
322     // --- The Edge Geometry is a Surface Curve ---
323     // ---     (3d + 2 Pcurve Or Surface)       ---
324     Handle(StepGeom_SurfaceCurve) Sc =
325       Handle(StepGeom_SurfaceCurve)::DownCast(C);
326     Handle(StepGeom_Curve) C1 = Sc->Curve3d();
327 //    if (C1->IsKind(STANDARD_TYPE(StepGeom_Polyline))) {
328 //    B.MakeEdge(E);
329 //      B.UpdateEdge (E,preci);
330 //      B.Add(E, V1);    // ?? en fin de TranslateEdgeLoop
331 //      B.Add(E, V2);
332 //    }
333 //    else {
334       MakeFromCurve3D (C1,EC,Vend,Precision(), E,V1,V2 , aTool);
335 //    }
336   }
337 //  else if (C->IsKind(STANDARD_TYPE(StepGeom_Polyline))) {
338 //    B.MakeEdge(E);
339 //    B.UpdateEdge (E,preci);
340 //    B.Add(E, V1);    // ?? en fin de TranslateEdgeLoop
341 //    B.Add(E, V2);
342 //  }
343   else {
344     // --- The Edge Geometry is a Single 3d Curve ---
345     MakeFromCurve3D (C,EC,Vend,Precision(), E,V1,V2 , aTool);
346   }
347   // On force les flags SameRange et SameParameter a Standard_False
348   if (done) {
349 //:S4136    B.SameRange(E, Standard_False);
350 //:S4136    B.SameParameter(E, Standard_False);
351     aTool.Bind(EC,E);
352
353     // Bind Edge in NM tool (ssv; 15.11.2010)
354     if ( NMTool.IsActive() ) {
355       NMTool.Bind(EC, E);
356       if ( NMTool.IsIDEASCase() && !anECName.IsNull() && !anECName->IsEmpty() )
357         NMTool.Bind(anECName->String(), E);
358     }
359
360     myResult = E;
361     myError = StepToTopoDS_TranslateEdgeDone;
362   }
363 }
364
365
366 // ============================================================================
367 // Method  : MakeFromCurve3D
368 // Purpose : case of a Curve 3D (alone or in SurfaceCurve)
369 // ============================================================================
370
371 // auxiliary function
372 //:e6 abv 16 Apr 98: ProSTEP TR8, r0601_sy.stp, #14907
373 static void GetCartesianPoints ( const Handle(StepShape_EdgeCurve)& EC, 
374                                  gp_Pnt &P1, gp_Pnt &P2)
375 {
376   for ( Standard_Integer i=1; i<=2; i++ ) {
377     const Handle(StepShape_Vertex) V = ( (Standard_Boolean)(i==1) == EC->SameSense() ? EC->EdgeStart() : EC->EdgeEnd() );
378     const Handle(StepShape_VertexPoint) VP = Handle(StepShape_VertexPoint)::DownCast(V);
379     if ( VP.IsNull() ) continue;
380     const Handle(StepGeom_CartesianPoint) P = Handle(StepGeom_CartesianPoint)::DownCast(VP->VertexGeometry());
381     Handle(Geom_CartesianPoint) CP = StepToGeom::MakeCartesianPoint (P);
382     ( i==1 ? P1 : P2 ) = CP->Pnt();
383   }
384 }
385
386 void  StepToTopoDS_TranslateEdge::MakeFromCurve3D
387   (const Handle(StepGeom_Curve)& C3D, const Handle(StepShape_EdgeCurve)& EC,
388    const Handle(StepShape_Vertex)&  Vend,
389    const Standard_Real preci, TopoDS_Edge& E,
390    TopoDS_Vertex& V1, TopoDS_Vertex& V2,
391    StepToTopoDS_Tool&   aTool)
392 {
393   Handle(Transfer_TransientProcess) TP = aTool.TransientProcess();
394   Handle(Geom_Curve) C1 = MakeCurve(C3D,TP);
395   if (C1.IsNull()) {
396     TP->AddFail(C3D," Make Geom_Curve (3D) failed");
397     myError = StepToTopoDS_TranslateEdgeOther;
398     done = Standard_False;
399     return;
400   }
401     // -- Statistics -- -> No Warning message
402   aTool.AddContinuity (C1);
403   BRep_Builder B;
404   Standard_Real temp1,temp2, U1,U2;
405   gp_Pnt pproj;
406   gp_Pnt pv1 = BRep_Tool::Pnt(V1);
407   gp_Pnt pv2 = BRep_Tool::Pnt(V2);
408
409   //:e6 abv
410   gp_Pnt pnt1 = pv1, pnt2 = pv2;
411   if ( V1.IsSame ( V2 ) ) GetCartesianPoints ( EC, pnt1, pnt2 );
412   ShapeAnalysis_Curve sac;
413   temp1 = sac.Project (C1,pnt1,preci,pproj,U1,Standard_False);
414   temp2 = sac.Project (C1,pnt2,preci,pproj,U2,Standard_False);
415
416   if (!StepToTopoDS_GeometricTool::UpdateParam3d(C1, U1, U2, preci))
417     TP->AddWarning(C3D,"Update of 3D-Parameters has failed");
418
419   //:d5: instead of AdjustCurve above which is incorrect if U1 and U2 are not ends
420   GeomAdaptor_Curve aCA(C1);
421   gp_Pnt pU1 = aCA.Value ( U1 ), pU2 = aCA.Value ( U2 );
422   temp1 = pU1.Distance ( pv1 );
423   temp2 = pU2.Distance ( pv2 );
424   if ( temp1 > preci || temp2 > preci ) {
425     TP->AddWarning (C3D,"Poor result from projection vertex / curve 3d");
426   }
427   B.UpdateVertex ( V1, 1.000001*temp1 ); //:h6 abv 14 Jul 98: PRO8845 #2746: *=1.0001
428   B.UpdateVertex ( V2, 1.000001*temp2 ); //:h6
429   
430   BRepLib_MakeEdge ME(C1, V1, V2, U1, U2);
431   if (ME.IsDone()) {
432     E = ME.Edge();
433     B.Range ( E, U1, U2 ); // abv 14 Mar 00: trj3_pm1-ug.stp #91739, edge 2
434   }
435   else {
436     if (ME.Error() == BRepLib_DifferentPointsOnClosedCurve) {
437       // The Edge could be closed and trimmed by 2 Differents
438       // Vertices
439       if (C1->IsClosed()) {
440         // Attention : il faudra mettre a jour la topologie des
441         // vertex pour avoir des edges cul a cul ...... Good Luck!
442         aTool.Bind (Vend,V1);
443         TopoDS_Shape aLocalShape = V1.Reversed();
444         V2 = TopoDS::Vertex(aLocalShape);
445         ME.Init(C1, V1, V2, U1, U2);
446         if (ME.IsDone()) {
447           TP->AddWarning(EC, "Wrong topology corrected : Closed Edge with TWO different Vertices");
448           E = ME.Edge();
449         }
450         else {
451           DecodeMakeEdgeError(ME, C3D, C1, V1, V2, U1, U2, aTool, EC);
452           E = MakeEdge (C1,V1,V2,U1,U2);//preci
453           myError = StepToTopoDS_TranslateEdgeDone; // ????
454           done = Standard_True;
455           //            return;               
456         }
457       }
458       else {
459         // Then, this is should be coded as degenerated
460         // To be performed later !!!
461 //         DecodeMakeEdgeError(ME, C3D, C1, V1, V2, U1, U2, aTool, EC);
462         myError = StepToTopoDS_TranslateEdgeDone; // ????
463         //  Bon, on la fait cette petite edge, mais faudra repasser
464         //  pour l enlever ET FUSIONNER LES VERTEX, pour tout le shell !
465         //  courbe trop petite pour etre mise -> fait planter
466         done = Standard_True;
467         if (!V1.IsSame(V2)) {
468           TP->AddFail(EC, "This edge has null arc length");
469           gp_Pnt P1 = BRep_Tool::Pnt(V1);
470           gp_Pnt P2 = BRep_Tool::Pnt(V2);
471           gp_Vec avec (P1,P2);  gp_Dir adir (avec);  gp_Lin alin (P1,adir);
472           C1 = new Geom_Line (alin);
473           U1 = 0.;  U2 = P1.Distance(P2);
474           E = MakeEdge (C1,V1,V2,U1,U2);//,preci
475         } 
476         else {
477           TP->AddFail(EC,"NULL EDGE, SKIPPED");
478           myResult.Nullify();
479           return;         
480         }
481       }
482     }
483     else {
484       DecodeMakeEdgeError(ME, C3D, C1, V1, V2, U1, U2, aTool, EC);
485       E = MakeEdge (C1,V1,V2,U1,U2);//,preci
486       myError = StepToTopoDS_TranslateEdgeDone; // ????
487       done = Standard_True;
488     }
489   }
490 }
491
492
493 // ============================================================================
494 // Method  : MakePCurve
495 // Purpose : Computes an individual pcurve (i.e. curve 2d)
496 // ============================================================================
497 Handle(Geom2d_Curve)  StepToTopoDS_TranslateEdge::MakePCurve
498   (const Handle(StepGeom_Pcurve)& PCU, const Handle(Geom_Surface)& ConvSurf) const
499 {
500   Handle(Geom2d_Curve) C2d;
501   const Handle(StepRepr_DefinitionalRepresentation) DRI = PCU->ReferenceToCurve();
502   if( DRI.IsNull()) return C2d;
503   const Handle(StepGeom_Curve) StepCurve = Handle(StepGeom_Curve)::DownCast(DRI->ItemsValue(1));
504   C2d = StepToGeom::MakeCurve2d (StepCurve);
505   if (! C2d.IsNull()) {
506     // -- if the surface is a RectangularTrimmedSurface, 
507     // -- send the BasisSurface.
508     C2d = UnitsMethods::DegreeToRadian(C2d, ConvSurf);
509   }
510   return C2d;
511 }
512
513
514 // ============================================================================
515 // Method  : Value
516 // Purpose : Returns the mapped edge
517 // ============================================================================
518
519 const TopoDS_Shape& StepToTopoDS_TranslateEdge::Value() const 
520 {
521   StdFail_NotDone_Raise_if(!done,"");
522   return myResult;
523 }
524
525 // ============================================================================
526 // Method  : Error
527 // Purpose : Returns the error code
528 // ============================================================================
529
530 StepToTopoDS_TranslateEdgeError StepToTopoDS_TranslateEdge::Error() const
531 {
532   return myError;
533 }