]> OCCT Git - occt.git/commitdiff
0033351: Data Exchange, Step - Improvement for thread safety of the STEP translator CR0-WEEK-36 IR-2023-09-08
authorichesnok <ichesnok@opencascade.com>
Tue, 28 Mar 2023 12:29:44 +0000 (13:29 +0100)
committervglukhik <vglukhik@opencascade.com>
Fri, 8 Sep 2023 10:28:53 +0000 (11:28 +0100)
Local StepData_Factors object usage for each session
Static variables isolated

146 files changed:
src/GeomToStep/GeomToStep_MakeAxis1Placement.cxx
src/GeomToStep/GeomToStep_MakeAxis1Placement.hxx
src/GeomToStep/GeomToStep_MakeAxis1Placement_gen.pxx
src/GeomToStep/GeomToStep_MakeAxis2Placement2d.cxx
src/GeomToStep/GeomToStep_MakeAxis2Placement2d.hxx
src/GeomToStep/GeomToStep_MakeAxis2Placement3d.cxx
src/GeomToStep/GeomToStep_MakeAxis2Placement3d.hxx
src/GeomToStep/GeomToStep_MakeBSplineCurveWithKnots.cxx
src/GeomToStep/GeomToStep_MakeBSplineCurveWithKnots.hxx
src/GeomToStep/GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve.cxx
src/GeomToStep/GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve.hxx
src/GeomToStep/GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve_gen.pxx
src/GeomToStep/GeomToStep_MakeBSplineCurveWithKnots_gen.pxx
src/GeomToStep/GeomToStep_MakeBSplineSurfaceWithKnots.cxx
src/GeomToStep/GeomToStep_MakeBSplineSurfaceWithKnots.hxx
src/GeomToStep/GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface.cxx
src/GeomToStep/GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface.hxx
src/GeomToStep/GeomToStep_MakeBoundedCurve.cxx
src/GeomToStep/GeomToStep_MakeBoundedCurve.hxx
src/GeomToStep/GeomToStep_MakeBoundedSurface.cxx
src/GeomToStep/GeomToStep_MakeBoundedSurface.hxx
src/GeomToStep/GeomToStep_MakeCartesianPoint.cxx
src/GeomToStep/GeomToStep_MakeCartesianPoint.hxx
src/GeomToStep/GeomToStep_MakeCircle.cxx
src/GeomToStep/GeomToStep_MakeCircle.hxx
src/GeomToStep/GeomToStep_MakeCircle_gen.pxx
src/GeomToStep/GeomToStep_MakeConic.cxx
src/GeomToStep/GeomToStep_MakeConic.hxx
src/GeomToStep/GeomToStep_MakeConicalSurface.cxx
src/GeomToStep/GeomToStep_MakeConicalSurface.hxx
src/GeomToStep/GeomToStep_MakeCurve.cxx
src/GeomToStep/GeomToStep_MakeCurve.hxx
src/GeomToStep/GeomToStep_MakeCylindricalSurface.cxx
src/GeomToStep/GeomToStep_MakeCylindricalSurface.hxx
src/GeomToStep/GeomToStep_MakeElementarySurface.cxx
src/GeomToStep/GeomToStep_MakeElementarySurface.hxx
src/GeomToStep/GeomToStep_MakeEllipse.cxx
src/GeomToStep/GeomToStep_MakeEllipse.hxx
src/GeomToStep/GeomToStep_MakeEllipse_gen.pxx
src/GeomToStep/GeomToStep_MakeHyperbola.cxx
src/GeomToStep/GeomToStep_MakeHyperbola.hxx
src/GeomToStep/GeomToStep_MakeLine.cxx
src/GeomToStep/GeomToStep_MakeLine.hxx
src/GeomToStep/GeomToStep_MakeLine_gen.pxx
src/GeomToStep/GeomToStep_MakeParabola.cxx
src/GeomToStep/GeomToStep_MakeParabola.hxx
src/GeomToStep/GeomToStep_MakePlane.cxx
src/GeomToStep/GeomToStep_MakePlane.hxx
src/GeomToStep/GeomToStep_MakePolyline.cxx
src/GeomToStep/GeomToStep_MakePolyline.hxx
src/GeomToStep/GeomToStep_MakePolyline_gen.pxx
src/GeomToStep/GeomToStep_MakeRectangularTrimmedSurface.cxx
src/GeomToStep/GeomToStep_MakeRectangularTrimmedSurface.hxx
src/GeomToStep/GeomToStep_MakeSphericalSurface.cxx
src/GeomToStep/GeomToStep_MakeSphericalSurface.hxx
src/GeomToStep/GeomToStep_MakeSurface.cxx
src/GeomToStep/GeomToStep_MakeSurface.hxx
src/GeomToStep/GeomToStep_MakeSurfaceOfLinearExtrusion.cxx
src/GeomToStep/GeomToStep_MakeSurfaceOfLinearExtrusion.hxx
src/GeomToStep/GeomToStep_MakeSurfaceOfRevolution.cxx
src/GeomToStep/GeomToStep_MakeSurfaceOfRevolution.hxx
src/GeomToStep/GeomToStep_MakeSweptSurface.cxx
src/GeomToStep/GeomToStep_MakeSweptSurface.hxx
src/GeomToStep/GeomToStep_MakeToroidalSurface.cxx
src/GeomToStep/GeomToStep_MakeToroidalSurface.hxx
src/GeomToStep/GeomToStep_MakeVector.cxx
src/GeomToStep/GeomToStep_MakeVector.hxx
src/STEPCAFControl/STEPCAFControl_Controller.cxx
src/STEPCAFControl/STEPCAFControl_Reader.cxx
src/STEPCAFControl/STEPCAFControl_Reader.hxx
src/STEPCAFControl/STEPCAFControl_Writer.cxx
src/STEPCAFControl/STEPCAFControl_Writer.hxx
src/STEPConstruct/STEPConstruct_ContextTool.cxx
src/STEPConstruct/STEPConstruct_ContextTool.hxx
src/STEPConstruct/STEPConstruct_UnitContext.cxx
src/STEPConstruct/STEPConstruct_UnitContext.hxx
src/STEPConstruct/STEPConstruct_ValidationProps.cxx
src/STEPConstruct/STEPConstruct_ValidationProps.hxx
src/STEPControl/STEPControl_ActorRead.cxx
src/STEPControl/STEPControl_ActorRead.hxx
src/STEPControl/STEPControl_ActorWrite.cxx
src/STEPControl/STEPControl_ActorWrite.hxx
src/STEPControl/STEPControl_Controller.cxx
src/STEPEdit/STEPEdit.cxx
src/STEPEdit/STEPEdit_EditContext.cxx
src/STEPSelections/STEPSelections_SelectGSCurves.cxx
src/STEPSelections/STEPSelections_SelectInstances.cxx
src/StepData/FILES
src/StepData/StepData_Factors.cxx [new file with mode: 0644]
src/StepData/StepData_Factors.hxx [new file with mode: 0644]
src/StepData/StepData_GlobalFactors.cxx [deleted file]
src/StepData/StepData_GlobalFactors.hxx [deleted file]
src/StepData/StepData_StepModel.cxx
src/StepData/StepData_StepModel.hxx
src/StepSelect/StepSelect_StepType.cxx
src/StepToGeom/StepToGeom.cxx
src/StepToGeom/StepToGeom.hxx
src/StepToTopoDS/StepToTopoDS_Builder.cxx
src/StepToTopoDS/StepToTopoDS_Builder.hxx
src/StepToTopoDS/StepToTopoDS_MakeTransformed.cxx
src/StepToTopoDS/StepToTopoDS_MakeTransformed.hxx
src/StepToTopoDS/StepToTopoDS_TranslateCompositeCurve.cxx
src/StepToTopoDS/StepToTopoDS_TranslateCompositeCurve.hxx
src/StepToTopoDS/StepToTopoDS_TranslateCurveBoundedSurface.cxx
src/StepToTopoDS/StepToTopoDS_TranslateCurveBoundedSurface.hxx
src/StepToTopoDS/StepToTopoDS_TranslateEdge.cxx
src/StepToTopoDS/StepToTopoDS_TranslateEdge.hxx
src/StepToTopoDS/StepToTopoDS_TranslateEdgeLoop.cxx
src/StepToTopoDS/StepToTopoDS_TranslateEdgeLoop.hxx
src/StepToTopoDS/StepToTopoDS_TranslateFace.cxx
src/StepToTopoDS/StepToTopoDS_TranslateFace.hxx
src/StepToTopoDS/StepToTopoDS_TranslatePolyLoop.cxx
src/StepToTopoDS/StepToTopoDS_TranslatePolyLoop.hxx
src/StepToTopoDS/StepToTopoDS_TranslateShell.cxx
src/StepToTopoDS/StepToTopoDS_TranslateShell.hxx
src/StepToTopoDS/StepToTopoDS_TranslateSolid.cxx
src/StepToTopoDS/StepToTopoDS_TranslateSolid.hxx
src/StepToTopoDS/StepToTopoDS_TranslateVertex.cxx
src/StepToTopoDS/StepToTopoDS_TranslateVertex.hxx
src/StepToTopoDS/StepToTopoDS_TranslateVertexLoop.cxx
src/StepToTopoDS/StepToTopoDS_TranslateVertexLoop.hxx
src/TopoDSToStep/TopoDSToStep_Builder.cxx
src/TopoDSToStep/TopoDSToStep_Builder.hxx
src/TopoDSToStep/TopoDSToStep_MakeBrepWithVoids.cxx
src/TopoDSToStep/TopoDSToStep_MakeBrepWithVoids.hxx
src/TopoDSToStep/TopoDSToStep_MakeFacetedBrep.cxx
src/TopoDSToStep/TopoDSToStep_MakeFacetedBrep.hxx
src/TopoDSToStep/TopoDSToStep_MakeFacetedBrepAndBrepWithVoids.cxx
src/TopoDSToStep/TopoDSToStep_MakeFacetedBrepAndBrepWithVoids.hxx
src/TopoDSToStep/TopoDSToStep_MakeGeometricCurveSet.cxx
src/TopoDSToStep/TopoDSToStep_MakeGeometricCurveSet.hxx
src/TopoDSToStep/TopoDSToStep_MakeManifoldSolidBrep.cxx
src/TopoDSToStep/TopoDSToStep_MakeManifoldSolidBrep.hxx
src/TopoDSToStep/TopoDSToStep_MakeShellBasedSurfaceModel.cxx
src/TopoDSToStep/TopoDSToStep_MakeShellBasedSurfaceModel.hxx
src/TopoDSToStep/TopoDSToStep_MakeStepEdge.cxx
src/TopoDSToStep/TopoDSToStep_MakeStepEdge.hxx
src/TopoDSToStep/TopoDSToStep_MakeStepFace.cxx
src/TopoDSToStep/TopoDSToStep_MakeStepFace.hxx
src/TopoDSToStep/TopoDSToStep_MakeStepVertex.cxx
src/TopoDSToStep/TopoDSToStep_MakeStepVertex.hxx
src/TopoDSToStep/TopoDSToStep_MakeStepWire.cxx
src/TopoDSToStep/TopoDSToStep_MakeStepWire.hxx
src/TopoDSToStep/TopoDSToStep_WireframeBuilder.cxx
src/TopoDSToStep/TopoDSToStep_WireframeBuilder.hxx
src/XSDRAWSTEP/XSDRAWSTEP.cxx

index b248f2ae77fc72e7eb64e7c2b059f1d9c10969da..f1e47dd2199f50cafa42ad77b31156d4e1a06182 100644 (file)
@@ -23,6 +23,7 @@
 #include <gp_Ax1.hxx>
 #include <gp_Ax2d.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_Axis1Placement.hxx>
 #include <StepGeom_CartesianPoint.hxx>
 #include <StepGeom_Direction.hxx>
@@ -31,7 +32,9 @@
 //=============================================================================
 // Creation d' un axis1_placement de prostep a partir d' un Ax1 de gp
 //=============================================================================
-GeomToStep_MakeAxis1Placement::GeomToStep_MakeAxis1Placement( const gp_Ax1& A)
+GeomToStep_MakeAxis1Placement::GeomToStep_MakeAxis1Placement
+( const gp_Ax1& A,
+  const StepData_Factors& theLocalFactors)
 {
 #include "GeomToStep_MakeAxis1Placement_gen.pxx"
 }
@@ -39,7 +42,9 @@ GeomToStep_MakeAxis1Placement::GeomToStep_MakeAxis1Placement( const gp_Ax1& A)
 // Creation d' un axis1_placement de prostep a partir d' un Ax2d de gp
 //=============================================================================
 
-GeomToStep_MakeAxis1Placement::GeomToStep_MakeAxis1Placement( const gp_Ax2d& A)
+GeomToStep_MakeAxis1Placement::GeomToStep_MakeAxis1Placement
+( const gp_Ax2d& A,
+  const StepData_Factors& theLocalFactors)
 {
 #include "GeomToStep_MakeAxis1Placement_gen.pxx"
 }
@@ -50,7 +55,8 @@ GeomToStep_MakeAxis1Placement::GeomToStep_MakeAxis1Placement( const gp_Ax2d& A)
 //=============================================================================
 
 GeomToStep_MakeAxis1Placement::GeomToStep_MakeAxis1Placement
-  ( const Handle(Geom_Axis1Placement)& Axis1)
+( const Handle(Geom_Axis1Placement)& Axis1,
+  const StepData_Factors& theLocalFactors)
 {
   gp_Ax1 A;
   A = Axis1->Ax1();
@@ -63,7 +69,8 @@ GeomToStep_MakeAxis1Placement::GeomToStep_MakeAxis1Placement
 //=============================================================================
 
 GeomToStep_MakeAxis1Placement::GeomToStep_MakeAxis1Placement
-  ( const Handle(Geom2d_AxisPlacement)& Axis1)
+( const Handle(Geom2d_AxisPlacement)& Axis1,
+  const StepData_Factors& theLocalFactors)
 {
   gp_Ax2d A;
   A = Axis1->Ax2d();
index 08ecc30f3ae2b29db6497809aaf28dc0a922dbf1..4e3baad9da2d834b8d39e2e3dff84c6d097851bb 100644 (file)
@@ -22,6 +22,8 @@
 #include <Standard_Handle.hxx>
 
 #include <GeomToStep_Root.hxx>
+
+class StepData_Factors;
 class StepGeom_Axis1Placement;
 class gp_Ax1;
 class gp_Ax2d;
@@ -40,13 +42,17 @@ public:
   DEFINE_STANDARD_ALLOC
 
   
-  Standard_EXPORT GeomToStep_MakeAxis1Placement(const gp_Ax1& A);
+  Standard_EXPORT GeomToStep_MakeAxis1Placement(const gp_Ax1& A,
+                                                const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT GeomToStep_MakeAxis1Placement(const gp_Ax2d& A);
+  Standard_EXPORT GeomToStep_MakeAxis1Placement(const gp_Ax2d& A,
+                                                const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT GeomToStep_MakeAxis1Placement(const Handle(Geom_Axis1Placement)& A);
+  Standard_EXPORT GeomToStep_MakeAxis1Placement(const Handle(Geom_Axis1Placement)& A,
+                                                const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT GeomToStep_MakeAxis1Placement(const Handle(Geom2d_AxisPlacement)& A);
+  Standard_EXPORT GeomToStep_MakeAxis1Placement(const Handle(Geom2d_AxisPlacement)& A,
+                                                const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const Handle(StepGeom_Axis1Placement)& Value() const;
 
index 1d4ea5fb01e395c0f9c2175c53d57cca2679ebcf..746f44d51a192b6a823cce4ae2818bd0a3915b12 100644 (file)
@@ -18,7 +18,7 @@ Handle(StepGeom_Axis1Placement) Axe = new StepGeom_Axis1Placement;
   Handle(StepGeom_CartesianPoint) P;
   Handle(StepGeom_Direction) D;
 
-  GeomToStep_MakeCartesianPoint MkPoint(A.Location());
+  GeomToStep_MakeCartesianPoint MkPoint(A.Location(), theLocalFactors.LengthFactor());
   GeomToStep_MakeDirection      MkDir(A.Direction());
 
   P = MkPoint.Value();
index f988c9fdef8a1c1a5c779059ff2345d808371dd7..4d4b0338f009c1ca91d8ad7931c1c6f111d12bf1 100644 (file)
@@ -21,6 +21,7 @@
 #include <gp_Ax2.hxx>
 #include <gp_Ax22d.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_Axis2Placement2d.hxx>
 #include <StepGeom_CartesianPoint.hxx>
 #include <StepGeom_Direction.hxx>
 // Creation d' un axis2_placement_2d de prostep a partir d' un Ax2 de gp
 //=============================================================================
 GeomToStep_MakeAxis2Placement2d::GeomToStep_MakeAxis2Placement2d
-( const gp_Ax2& A)
+( const gp_Ax2& A,
+  const StepData_Factors& theLocalFactors)
 {
   Handle(StepGeom_Axis2Placement2d) Axe;
   Handle(StepGeom_CartesianPoint) P;
   Handle(StepGeom_Direction) D;
 
-  GeomToStep_MakeCartesianPoint MkPoint(A.Location());
+  GeomToStep_MakeCartesianPoint MkPoint(A.Location(), theLocalFactors.LengthFactor());
   GeomToStep_MakeDirection      MkDir(A.Direction());
 
   P = MkPoint.Value();
@@ -56,13 +58,14 @@ GeomToStep_MakeAxis2Placement2d::GeomToStep_MakeAxis2Placement2d
 //=============================================================================
 
 GeomToStep_MakeAxis2Placement2d::GeomToStep_MakeAxis2Placement2d
-( const gp_Ax22d& A)
+( const gp_Ax22d& A,
+  const StepData_Factors& theLocalFactors)
 {
   Handle(StepGeom_Axis2Placement2d) Axe;
   Handle(StepGeom_CartesianPoint) P;
   Handle(StepGeom_Direction) D1;
 
-  GeomToStep_MakeCartesianPoint MkPoint(A.Location());
+  GeomToStep_MakeCartesianPoint MkPoint(A.Location(), theLocalFactors.LengthFactor());
   GeomToStep_MakeDirection      MkDir(A.XDirection());
 
   P  = MkPoint.Value();
index 13e7a9f37a885b46be168375bc57e9bd92706076..e2ceb4c5d3ceb4a1ef3ec873e36ecec1de284f1a 100644 (file)
@@ -22,6 +22,8 @@
 #include <Standard_Handle.hxx>
 
 #include <GeomToStep_Root.hxx>
+
+class StepData_Factors;
 class StepGeom_Axis2Placement2d;
 class gp_Ax2;
 class gp_Ax22d;
@@ -38,9 +40,11 @@ public:
   DEFINE_STANDARD_ALLOC
 
   
-  Standard_EXPORT GeomToStep_MakeAxis2Placement2d(const gp_Ax2& A);
+  Standard_EXPORT GeomToStep_MakeAxis2Placement2d(const gp_Ax2& A,
+                                                  const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT GeomToStep_MakeAxis2Placement2d(const gp_Ax22d& A);
+  Standard_EXPORT GeomToStep_MakeAxis2Placement2d(const gp_Ax22d& A,
+                                                  const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const Handle(StepGeom_Axis2Placement2d)& Value() const;
 
index f0675809a5a34bf09e3f278babcecdd913c10fcc..a4d6dd55923d9fc6e977c77cd4d77a842e9db6c0 100644 (file)
 #include <gp_Ax3.hxx>
 #include <gp_Trsf.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_Axis2Placement3d.hxx>
 #include <StepGeom_CartesianPoint.hxx>
 #include <StepGeom_Direction.hxx>
 #include <TCollection_HAsciiString.hxx>
 
 static Handle(StepGeom_Axis2Placement3d)  MakeAxis2Placement3d
-  (const gp_Pnt& O, const gp_Dir& D, const gp_Dir& X, const Standard_CString nom)
+  (const gp_Pnt& O, const gp_Dir& D, const gp_Dir& X, const Standard_CString nom, Standard_Real aFactor)
 {
   Handle(StepGeom_Axis2Placement3d) Axe;
   Handle(StepGeom_CartesianPoint) P;
   Handle(StepGeom_Direction) D1, D2;
 
-  GeomToStep_MakeCartesianPoint MkPoint(O);
+  GeomToStep_MakeCartesianPoint MkPoint(O, aFactor);
   GeomToStep_MakeDirection      MkDir1(D);
   GeomToStep_MakeDirection      MkDir2(X);
   
@@ -55,13 +56,14 @@ static Handle(StepGeom_Axis2Placement3d)  MakeAxis2Placement3d
 // Creation d' un axis2_placement_3d a l origine
 //=============================================================================
 
-GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d ( )
+GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d (
+  const StepData_Factors& theLocalFactors)
 {
   gp_Ax2 A (gp_Pnt(0.,0.,0.), gp_Dir (0.,0.,1.), gp_Dir (1.,0.,0.));
 //   le reste inchange
 
   Handle(StepGeom_Axis2Placement3d) Axe = MakeAxis2Placement3d
-    (A.Location(), A.Direction(), A.XDirection(), "");
+    (A.Location(), A.Direction(), A.XDirection(), "", theLocalFactors.LengthFactor());
   theAxis2Placement3d = Axe;
   done = Standard_True;
 }
@@ -70,11 +72,12 @@ GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d ( )
 // Creation d' un axis2_placement_3d de prostep a partir d' un Ax2 de gp
 //=============================================================================
 
-GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d( const gp_Ax2&
-                                                              A)
+GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d(
+  const gp_Ax2& A,
+  const StepData_Factors& theLocalFactors)
 {
   Handle(StepGeom_Axis2Placement3d) Axe = MakeAxis2Placement3d
-    (A.Location(), A.Direction(), A.XDirection(), "");
+    (A.Location(), A.Direction(), A.XDirection(), "", theLocalFactors.LengthFactor());
   theAxis2Placement3d = Axe;
   done = Standard_True;
 }
@@ -83,11 +86,12 @@ GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d( const gp_Ax2&
 // Creation d' un axis2_placement_3d de prostep a partir d' un Ax3 de gp
 //=============================================================================
 
-GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d
-( const gp_Ax3&         A)
+GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d(
+  const gp_Ax3& A,
+  const StepData_Factors& theLocalFactors)
 {
   Handle(StepGeom_Axis2Placement3d) Axe = MakeAxis2Placement3d
-    (A.Location(), A.Direction(), A.XDirection(), "");
+    (A.Location(), A.Direction(), A.XDirection(), "", theLocalFactors.LengthFactor());
   theAxis2Placement3d = Axe;
   done = Standard_True;
 }
@@ -96,15 +100,16 @@ GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d
 // Creation d' un axis2_placement_3d de prostep a partir d' un Trsf de gp
 //=============================================================================
 
-GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d
-  ( const gp_Trsf& T)
+GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d(
+  const gp_Trsf& T, 
+  const StepData_Factors& theLocalFactors)
 {
   gp_Ax2 A (gp_Pnt(0.,0.,0.), gp_Dir (0.,0.,1.), gp_Dir (1.,0.,0.));
   A.Transform (T);
 //   le reste inchange
 
   Handle(StepGeom_Axis2Placement3d) Axe = MakeAxis2Placement3d
-    (A.Location(), A.Direction(), A.XDirection(), "");
+    (A.Location(), A.Direction(), A.XDirection(), "", theLocalFactors.LengthFactor());
   theAxis2Placement3d = Axe;
   done = Standard_True;
 }
@@ -114,14 +119,15 @@ GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d
 // de Geom
 //=============================================================================
 
-GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d
-  ( const Handle(Geom_Axis2Placement)& Axis2)
+GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d(
+  const Handle(Geom_Axis2Placement)& Axis2,
+  const StepData_Factors& theLocalFactors)
 {
   gp_Ax2 A;
   A = Axis2->Ax2();
 
   Handle(StepGeom_Axis2Placement3d) Axe = MakeAxis2Placement3d
-    (A.Location(), A.Direction(), A.XDirection(), "");
+    (A.Location(), A.Direction(), A.XDirection(), "", theLocalFactors.LengthFactor());
   theAxis2Placement3d = Axe;
   done = Standard_True;
 }
index 89c0c3b1def9073311d465449d5c444974947e1f..b11e8221297ac7f02bf1d5e799ed54e78cdbfccb 100644 (file)
@@ -22,6 +22,8 @@
 #include <Standard_Handle.hxx>
 
 #include <GeomToStep_Root.hxx>
+#include <StepData_StepModel.hxx>
+class StepData_Factors;
 class StepGeom_Axis2Placement3d;
 class gp_Ax2;
 class gp_Ax3;
@@ -40,15 +42,19 @@ public:
   DEFINE_STANDARD_ALLOC
 
   
-  Standard_EXPORT GeomToStep_MakeAxis2Placement3d();
+  Standard_EXPORT GeomToStep_MakeAxis2Placement3d(const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT GeomToStep_MakeAxis2Placement3d(const gp_Ax2& A);
+  Standard_EXPORT GeomToStep_MakeAxis2Placement3d(const gp_Ax2& A,
+                                                  const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT GeomToStep_MakeAxis2Placement3d(const gp_Ax3& A);
+  Standard_EXPORT GeomToStep_MakeAxis2Placement3d(const gp_Ax3& A,
+                                                  const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT GeomToStep_MakeAxis2Placement3d(const gp_Trsf& T);
+  Standard_EXPORT GeomToStep_MakeAxis2Placement3d(const gp_Trsf& T,
+                                                  const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT GeomToStep_MakeAxis2Placement3d(const Handle(Geom_Axis2Placement)& A);
+  Standard_EXPORT GeomToStep_MakeAxis2Placement3d(const Handle(Geom_Axis2Placement)& A,
+                                                  const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const Handle(StepGeom_Axis2Placement3d)& Value() const;
 
index 37973471c99c95134439faff68dfed8d12c696bf..4cd0b56b73e42926be3211c43993d1660cb612cd 100644 (file)
@@ -21,6 +21,7 @@
 #include <GeomToStep_MakeBSplineCurveWithKnots.hxx>
 #include <GeomToStep_MakeCartesianPoint.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_BSplineCurveWithKnots.hxx>
 #include <StepGeom_CartesianPoint.hxx>
 #include <StepGeom_HArray1OfCartesianPoint.hxx>
 // Creation d' une bspline_curve_with_knots de
 // prostep a partir d' une BSplineCurve de Geom
 //=============================================================================
-GeomToStep_MakeBSplineCurveWithKnots::
-  GeomToStep_MakeBSplineCurveWithKnots( const
-    Handle(Geom_BSplineCurve)& BS )
-                                                                     
+GeomToStep_MakeBSplineCurveWithKnots::GeomToStep_MakeBSplineCurveWithKnots
+( const Handle(Geom_BSplineCurve)& BS,
+  const StepData_Factors& theLocalFactors)
 {
 #define Array1OfPnt_gen TColgp_Array1OfPnt
 #include "GeomToStep_MakeBSplineCurveWithKnots_gen.pxx"
@@ -49,10 +49,9 @@ GeomToStep_MakeBSplineCurveWithKnots::
 // prostep a partir d' une BSplineCurve de Geom2d
 //=============================================================================
 
-GeomToStep_MakeBSplineCurveWithKnots::
-  GeomToStep_MakeBSplineCurveWithKnots( const
-    Handle(Geom2d_BSplineCurve)& BS )
-                                                                     
+GeomToStep_MakeBSplineCurveWithKnots::GeomToStep_MakeBSplineCurveWithKnots
+( const Handle(Geom2d_BSplineCurve)& BS,
+  const StepData_Factors& theLocalFactors)
 {
 #define Array1OfPnt_gen TColgp_Array1OfPnt2d
 #include "GeomToStep_MakeBSplineCurveWithKnots_gen.pxx"
index 3d56eb9046114b2d06dc24bda638387644c31bc7..ea7f140874b769120dad24b93c731f846f3c2292 100644 (file)
 #include <Standard_Handle.hxx>
 
 #include <GeomToStep_Root.hxx>
-class StepGeom_BSplineCurveWithKnots;
 class Geom_BSplineCurve;
 class Geom2d_BSplineCurve;
+class StepData_Factors;
+class StepGeom_BSplineCurveWithKnots;
 
 
 //! This class implements the mapping between classes
@@ -39,9 +40,11 @@ public:
   DEFINE_STANDARD_ALLOC
 
   
-  Standard_EXPORT GeomToStep_MakeBSplineCurveWithKnots(const Handle(Geom_BSplineCurve)& Bsplin);
+  Standard_EXPORT GeomToStep_MakeBSplineCurveWithKnots(const Handle(Geom_BSplineCurve)& Bsplin,
+                                                       const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT GeomToStep_MakeBSplineCurveWithKnots(const Handle(Geom2d_BSplineCurve)& Bsplin);
+  Standard_EXPORT GeomToStep_MakeBSplineCurveWithKnots(const Handle(Geom2d_BSplineCurve)& Bsplin,
+                                                       const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const Handle(StepGeom_BSplineCurveWithKnots)& Value() const;
 
index c04d867bbdfed6f22dcddd773245e9f9b7812a6c..5e21b57c1e67fcf263ecdc11d03b25529133d972 100644 (file)
@@ -21,6 +21,7 @@
 #include <GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve.hxx>
 #include <GeomToStep_MakeCartesianPoint.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve.hxx>
 #include <StepGeom_CartesianPoint.hxx>
 #include <StepGeom_HArray1OfCartesianPoint.hxx>
@@ -37,8 +38,7 @@
 //=============================================================================
 GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve::
   GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve( const
-    Handle(Geom_BSplineCurve)& BS )
-                                                                     
+    Handle(Geom_BSplineCurve)& BS, const StepData_Factors& theLocalFactors)
 {
 #define Array1OfPnt_gen TColgp_Array1OfPnt
 #include "GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve_gen.pxx"
@@ -51,7 +51,7 @@ GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve::
 
 GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve::
   GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve( const
-    Handle(Geom2d_BSplineCurve)& BS )
+    Handle(Geom2d_BSplineCurve)& BS, const StepData_Factors& theLocalFactors)
                                                                      
 {
 #define Array1OfPnt_gen TColgp_Array1OfPnt2d
index c427afd6fe160ea1eb6faf095c9705ff27201e77..9adf01acae61231bacbff3d7ae3fde9c75e8589a 100644 (file)
@@ -22,6 +22,8 @@
 #include <Standard_Handle.hxx>
 
 #include <GeomToStep_Root.hxx>
+
+class StepData_Factors;
 class StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve;
 class Geom_BSplineCurve;
 class Geom2d_BSplineCurve;
@@ -39,9 +41,11 @@ public:
   DEFINE_STANDARD_ALLOC
 
   
-  Standard_EXPORT GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve(const Handle(Geom_BSplineCurve)& Bsplin);
+  Standard_EXPORT GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve(const Handle(Geom_BSplineCurve)& Bsplin,
+                                                                              const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve(const Handle(Geom2d_BSplineCurve)& Bsplin);
+  Standard_EXPORT GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve(const Handle(Geom2d_BSplineCurve)& Bsplin,
+                                                                              const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve)& Value() const;
 
index 17dcf29123ae374d0c7b2feb4167a28d2ce60260..58c323919fa2d23b9e444ae2ef4f904ab74899f9 100644 (file)
@@ -33,7 +33,7 @@ Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve) BSWK;
   BS->Poles(P);
   Listpoints = new StepGeom_HArray1OfCartesianPoint(1,N);
   for ( i=P.Lower(); i<=P.Upper(); i++) { 
-    GeomToStep_MakeCartesianPoint MkPoint(P.Value(i));
+    GeomToStep_MakeCartesianPoint MkPoint(P.Value(i), theLocalFactors.LengthFactor());
     Pt = MkPoint.Value();
     Listpoints->SetValue(i, Pt);
   }
index b57ce7b5cf3c20eb2465df97efa1929f095400d9..1849b6141986f7f7702f077bf2c1c3f386782dfb 100644 (file)
@@ -33,7 +33,7 @@ Handle(StepGeom_BSplineCurveWithKnots) BSWK;
   BS->Poles(P);
   Listpoints = new StepGeom_HArray1OfCartesianPoint(1,N);
   for ( i=P.Lower(); i<=P.Upper(); i++) {
-    GeomToStep_MakeCartesianPoint MkPoint(P.Value(i));
+    GeomToStep_MakeCartesianPoint MkPoint(P.Value(i), theLocalFactors.LengthFactor());
     Pt = MkPoint.Value();
     Listpoints->SetValue(i, Pt);
   }
index 02cdc589a32c525c96e2ed28ad83f475dd3054b9..5d1b9bc5cf9ea8098945d2c54550aa1c0244b3c5 100644 (file)
@@ -20,6 +20,7 @@
 #include <GeomToStep_MakeBSplineSurfaceWithKnots.hxx>
 #include <GeomToStep_MakeCartesianPoint.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_BSplineSurfaceWithKnots.hxx>
 #include <StepGeom_CartesianPoint.hxx>
 #include <StepGeom_HArray2OfCartesianPoint.hxx>
 // Creation d' une bspline_Surface_with_knots_and_rational_bspline_Surface de
 // prostep a partir d' une BSplineSurface de Geom
 //=============================================================================
-GeomToStep_MakeBSplineSurfaceWithKnots::
-  GeomToStep_MakeBSplineSurfaceWithKnots( const
-    Handle(Geom_BSplineSurface)& BS )
-                                                                     
+GeomToStep_MakeBSplineSurfaceWithKnots::GeomToStep_MakeBSplineSurfaceWithKnots
+( const Handle(Geom_BSplineSurface)& BS,
+  const StepData_Factors& theLocalFactors)
 {
   Handle(StepGeom_BSplineSurfaceWithKnots) BSWK;
   Standard_Integer aUDegree, aVDegree, NU, NV, i, j, NUknots, NVknots, itampon;
@@ -62,7 +62,7 @@ GeomToStep_MakeBSplineSurfaceWithKnots::
   aControlPointsList = new StepGeom_HArray2OfCartesianPoint(1,NU,1,NV);
   for ( i=P.LowerRow(); i<=P.UpperRow(); i++) {
     for ( j=P.LowerCol(); j<=P.UpperCol(); j++) { 
-      GeomToStep_MakeCartesianPoint MkPoint(P.Value(i,j));
+      GeomToStep_MakeCartesianPoint MkPoint(P.Value(i,j), theLocalFactors.LengthFactor());
       Pt = MkPoint.Value();
       aControlPointsList->SetValue(i, j, Pt);
     }
index 3fe4b7895e48a206fa8921ff8be5b6f1b6d7950f..1fe271e450f87bcf90f5acfac70117dd99712e53 100644 (file)
@@ -22,6 +22,7 @@
 #include <Standard_Handle.hxx>
 
 #include <GeomToStep_Root.hxx>
+class StepData_Factors;
 class StepGeom_BSplineSurfaceWithKnots;
 class Geom_BSplineSurface;
 
@@ -38,7 +39,8 @@ public:
   DEFINE_STANDARD_ALLOC
 
   
-  Standard_EXPORT GeomToStep_MakeBSplineSurfaceWithKnots(const Handle(Geom_BSplineSurface)& Bsplin);
+  Standard_EXPORT GeomToStep_MakeBSplineSurfaceWithKnots(const Handle(Geom_BSplineSurface)& Bsplin,
+                                                         const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const Handle(StepGeom_BSplineSurfaceWithKnots)& Value() const;
 
index 1e302f7aa2c5aeba362009cd6e9976a4ebf01f26..9099993ba70d8c324264dd62f2b089335b9f694e 100644 (file)
@@ -21,6 +21,7 @@
 #include <GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface.hxx>
 #include <GeomToStep_MakeCartesianPoint.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface.hxx>
 #include <StepGeom_CartesianPoint.hxx>
 #include <StepGeom_HArray2OfCartesianPoint.hxx>
@@ -37,8 +38,7 @@
 //=============================================================================
 GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface::
   GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface( const
-    Handle(Geom_BSplineSurface)& BS )
-                                                                     
+    Handle(Geom_BSplineSurface)& BS, const StepData_Factors& theLocalFactors)
 {
   Handle(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface) BSWK;
   Standard_Integer aUDegree, aVDegree, NU, NV, i, j, NUknots, NVknots, itampon;
@@ -63,7 +63,7 @@ GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface::
   aControlPointsList = new StepGeom_HArray2OfCartesianPoint(1,NU,1,NV);
   for ( i=P.LowerRow(); i<=P.UpperRow(); i++) {
     for ( j=P.LowerCol(); j<=P.UpperCol(); j++) { 
-      GeomToStep_MakeCartesianPoint MkPoint(P.Value(i,j));
+      GeomToStep_MakeCartesianPoint MkPoint(P.Value(i,j), theLocalFactors.LengthFactor());
       Pt = MkPoint.Value();
       aControlPointsList->SetValue(i, j, Pt);
     }
index e049fbdab29a6b37f26d4717542ddb51805fb305..ca714b11aedd6d8779aebe1c2f5a984f04d22171 100644 (file)
@@ -22,6 +22,8 @@
 #include <Standard_Handle.hxx>
 
 #include <GeomToStep_Root.hxx>
+
+class StepData_Factors;
 class StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface;
 class Geom_BSplineSurface;
 
@@ -38,7 +40,8 @@ public:
   DEFINE_STANDARD_ALLOC
 
   
-  Standard_EXPORT GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface(const Handle(Geom_BSplineSurface)& Bsplin);
+  Standard_EXPORT GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface(const Handle(Geom_BSplineSurface)& Bsplin,
+                                                                                  const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const Handle(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface)& Value() const;
 
index 95f49b50a4188a48b93ef3cb2b73a65f01cd0c24..9e13d91f4ad0b13b6a743e825de60cbde550d389 100644 (file)
@@ -27,6 +27,7 @@
 #include <GeomToStep_MakeBSplineCurveWithKnots.hxx>
 #include <GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_BoundedCurve.hxx>
 #include <StepGeom_BSplineCurveWithKnots.hxx>
 #include <StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve.hxx>
@@ -34,7 +35,8 @@
 //=============================================================================
 // Creation d' une BoundedCurve de prostep a partir d' une BoundedCurve de Geom
 //=============================================================================
-GeomToStep_MakeBoundedCurve::GeomToStep_MakeBoundedCurve ( const Handle(Geom_BoundedCurve)& C)
+GeomToStep_MakeBoundedCurve::GeomToStep_MakeBoundedCurve ( const Handle(Geom_BoundedCurve)& C,
+                                                           const StepData_Factors& theLocalFactors)
 {
   done = Standard_True;
 
@@ -48,11 +50,11 @@ GeomToStep_MakeBoundedCurve::GeomToStep_MakeBoundedCurve ( const Handle(Geom_Bou
       Bspli = newBspli;
     }
     if ( Bspli->IsRational() ) {
-      GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve MkRatBSplineC(Bspli);
+      GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve MkRatBSplineC(Bspli, theLocalFactors);
       theBoundedCurve = MkRatBSplineC.Value();
     }
     else {
-      GeomToStep_MakeBSplineCurveWithKnots MkBSplineC(Bspli);
+      GeomToStep_MakeBSplineCurveWithKnots MkBSplineC(Bspli, theLocalFactors);
       theBoundedCurve = MkBSplineC.Value();
     }
   }
@@ -60,11 +62,11 @@ GeomToStep_MakeBoundedCurve::GeomToStep_MakeBoundedCurve ( const Handle(Geom_Bou
     Handle(Geom_BezierCurve) Cur = Handle(Geom_BezierCurve)::DownCast(C);
     Handle(Geom_BSplineCurve) Bspli = GeomConvert::CurveToBSplineCurve(Cur);
     if ( Bspli->IsRational() ) {
-      GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve MkRatBSplineC(Bspli);
+      GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve MkRatBSplineC(Bspli, theLocalFactors);
       theBoundedCurve = MkRatBSplineC.Value();
     }
     else {
-      GeomToStep_MakeBSplineCurveWithKnots MkBSplineC(Bspli);
+      GeomToStep_MakeBSplineCurveWithKnots MkBSplineC(Bspli, theLocalFactors);
       theBoundedCurve = MkBSplineC.Value();
     }
   }
@@ -81,7 +83,8 @@ GeomToStep_MakeBoundedCurve::GeomToStep_MakeBoundedCurve ( const Handle(Geom_Bou
 // Geom2d
 //=============================================================================
 
-GeomToStep_MakeBoundedCurve::GeomToStep_MakeBoundedCurve ( const Handle(Geom2d_BoundedCurve)& C)
+GeomToStep_MakeBoundedCurve::GeomToStep_MakeBoundedCurve ( const Handle(Geom2d_BoundedCurve)& C,
+                                                           const StepData_Factors& theLocalFactors)
 {
   done = Standard_True;
   if (C->IsKind(STANDARD_TYPE(Geom2d_BSplineCurve)))
@@ -96,11 +99,11 @@ GeomToStep_MakeBoundedCurve::GeomToStep_MakeBoundedCurve ( const Handle(Geom2d_B
        Bspli = newBspli;
       }
       if ( Bspli->IsRational() ) {
-       GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve MkRatBSplineC(Bspli);
+       GeomToStep_MakeBSplineCurveWithKnotsAndRationalBSplineCurve MkRatBSplineC(Bspli, theLocalFactors);
        theBoundedCurve = MkRatBSplineC.Value();
       }
       else {
-       GeomToStep_MakeBSplineCurveWithKnots MkBSplineC(Bspli);
+       GeomToStep_MakeBSplineCurveWithKnots MkBSplineC(Bspli, theLocalFactors);
        theBoundedCurve = MkBSplineC.Value();
       }
     }
@@ -108,7 +111,7 @@ GeomToStep_MakeBoundedCurve::GeomToStep_MakeBoundedCurve ( const Handle(Geom2d_B
     Handle(Geom2d_BezierCurve) Cur = Handle(Geom2d_BezierCurve)::DownCast(C);
     Handle(Geom2d_BSplineCurve) Bspli = 
       Geom2dConvert::CurveToBSplineCurve(Cur);
-    GeomToStep_MakeBSplineCurveWithKnots MkBSplineC(Bspli);
+    GeomToStep_MakeBSplineCurveWithKnots MkBSplineC(Bspli, theLocalFactors);
     theBoundedCurve = MkBSplineC.Value();
     }
   else
index d712a46948d36a600a791744af146da80518f92d..26c0df932719b5f2de40c7817263edfd41ad2608 100644 (file)
@@ -22,6 +22,8 @@
 #include <Standard_Handle.hxx>
 
 #include <GeomToStep_Root.hxx>
+
+class StepData_Factors;
 class StepGeom_BoundedCurve;
 class Geom_BoundedCurve;
 class Geom2d_BoundedCurve;
@@ -39,9 +41,11 @@ public:
   DEFINE_STANDARD_ALLOC
 
   
-  Standard_EXPORT GeomToStep_MakeBoundedCurve(const Handle(Geom_BoundedCurve)& C);
+  Standard_EXPORT GeomToStep_MakeBoundedCurve(const Handle(Geom_BoundedCurve)& C,
+                                              const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT GeomToStep_MakeBoundedCurve(const Handle(Geom2d_BoundedCurve)& C);
+  Standard_EXPORT GeomToStep_MakeBoundedCurve(const Handle(Geom2d_BoundedCurve)& C,
+                                              const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const Handle(StepGeom_BoundedCurve)& Value() const;
 
index 006b8d0f0e3e6371c1de3dc1fcaf8fd95003157e..046c9e182d96e946189a76d1bdf1796a5e56d300 100644 (file)
@@ -25,6 +25,7 @@
 #include <GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface.hxx>
 #include <GeomToStep_MakeRectangularTrimmedSurface.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_BoundedSurface.hxx>
 #include <StepGeom_BSplineSurfaceWithKnots.hxx>
 #include <StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface.hxx>
@@ -35,7 +36,8 @@
 // de Geom
 //=============================================================================
 GeomToStep_MakeBoundedSurface::GeomToStep_MakeBoundedSurface
-  ( const Handle(Geom_BoundedSurface)& S)
+  ( const Handle(Geom_BoundedSurface)& S,
+    const StepData_Factors& theLocalFactors)
 {
   done = Standard_True;
   if (S->IsKind(STANDARD_TYPE(Geom_BSplineSurface))) {
@@ -50,11 +52,11 @@ GeomToStep_MakeBoundedSurface::GeomToStep_MakeBoundedSurface
     }
     if ( BS->IsURational() || BS->IsVRational() ) {
       GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface 
-       MkRatBSplineS(BS);
+        MkRatBSplineS(BS, theLocalFactors);
       theBoundedSurface = MkRatBSplineS.Value();
     }
     else {
-      GeomToStep_MakeBSplineSurfaceWithKnots MkBSplineS(BS);
+      GeomToStep_MakeBSplineSurfaceWithKnots MkBSplineS(BS, theLocalFactors);
       theBoundedSurface = MkBSplineS.Value();
     }
   }
@@ -64,18 +66,18 @@ GeomToStep_MakeBoundedSurface::GeomToStep_MakeBoundedSurface
       GeomConvert::SurfaceToBSplineSurface(Sur);
     if ( BS->IsURational() || BS->IsVRational() ) {
       GeomToStep_MakeBSplineSurfaceWithKnotsAndRationalBSplineSurface 
-       MkRatBSplineS(BS);
+        MkRatBSplineS(BS, theLocalFactors);
       theBoundedSurface = MkRatBSplineS.Value();
     }
     else {
-      GeomToStep_MakeBSplineSurfaceWithKnots MkBSplineS(BS);
+      GeomToStep_MakeBSplineSurfaceWithKnots MkBSplineS(BS, theLocalFactors);
       theBoundedSurface = MkBSplineS.Value();
     }
   }
   else if (S->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) {
     Handle(Geom_RectangularTrimmedSurface) Sur = 
       Handle(Geom_RectangularTrimmedSurface)::DownCast(S);
-    GeomToStep_MakeRectangularTrimmedSurface MkRTSurf(Sur);
+    GeomToStep_MakeRectangularTrimmedSurface MkRTSurf(Sur, theLocalFactors);
     theBoundedSurface = MkRTSurf.Value();
   }
   else
index 6d299d7e7696907569aad323f7e811af3e8d5268..17df588b2f6aac42bf74255f53cbec4baf132d2b 100644 (file)
@@ -22,6 +22,8 @@
 #include <Standard_Handle.hxx>
 
 #include <GeomToStep_Root.hxx>
+
+class StepData_Factors;
 class StepGeom_BoundedSurface;
 class Geom_BoundedSurface;
 
@@ -38,7 +40,8 @@ public:
   DEFINE_STANDARD_ALLOC
 
   
-  Standard_EXPORT GeomToStep_MakeBoundedSurface(const Handle(Geom_BoundedSurface)& C);
+  Standard_EXPORT GeomToStep_MakeBoundedSurface(const Handle(Geom_BoundedSurface)& C,
+                                                const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const Handle(StepGeom_BoundedSurface)& Value() const;
 
index 10f3f949c63f93c540bd9136cf876e19dec55efc..0fcf08253b0f4145567232270be6f49f754ddba9 100644 (file)
@@ -21,7 +21,7 @@
 #include <gp_Pnt.hxx>
 #include <gp_Pnt2d.hxx>
 #include <StdFail_NotDone.hxx>
-#include <StepData_GlobalFactors.hxx>
+#include <StepData_StepModel.hxx>
 #include <StepGeom_CartesianPoint.hxx>
 #include <TCollection_HAsciiString.hxx>
 #include <TColStd_HArray1OfReal.hxx>
@@ -29,7 +29,8 @@
 //=============================================================================
 // Creation d' un cartesian_point de prostep a partir d' un point3d de gp
 //=============================================================================
-GeomToStep_MakeCartesianPoint::GeomToStep_MakeCartesianPoint( const gp_Pnt& P)
+GeomToStep_MakeCartesianPoint::GeomToStep_MakeCartesianPoint( const gp_Pnt& P,
+                                                              const Standard_Real aFactor)
 {
   Handle(StepGeom_CartesianPoint) Pstep = new StepGeom_CartesianPoint;
 //  Handle(TColStd_HArray1OfReal) Acoord = new TColStd_HArray1OfReal(1,3);
@@ -42,8 +43,7 @@ GeomToStep_MakeCartesianPoint::GeomToStep_MakeCartesianPoint( const gp_Pnt& P)
 //  Pstep->SetCoordinates(Acoord);
   Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
 //  Pstep->SetName(name);
-  Standard_Real fact = StepData_GlobalFactors::Intance().LengthFactor();
-  Pstep->Init3D (name,X/fact,Y/fact,Z/fact);
+  Pstep->Init3D (name,X/aFactor,Y/aFactor,Z/aFactor);
   theCartesianPoint = Pstep;
   done = Standard_True;
 }
@@ -51,8 +51,10 @@ GeomToStep_MakeCartesianPoint::GeomToStep_MakeCartesianPoint( const gp_Pnt& P)
 // Creation d' un cartesian_point de prostep a partir d' un point 2d de gp
 //=============================================================================
 
-GeomToStep_MakeCartesianPoint::GeomToStep_MakeCartesianPoint( const gp_Pnt2d& P)
+GeomToStep_MakeCartesianPoint::GeomToStep_MakeCartesianPoint( const gp_Pnt2d& P,
+                                                              const Standard_Real aFactor)
 {
+  (void)aFactor;
   Handle(StepGeom_CartesianPoint) Pstep = new StepGeom_CartesianPoint;
 //  Handle(TColStd_HArray1OfReal) Acoord = new TColStd_HArray1OfReal(1,2);
   Standard_Real X, Y;
@@ -73,7 +75,8 @@ GeomToStep_MakeCartesianPoint::GeomToStep_MakeCartesianPoint( const gp_Pnt2d& P)
 //=============================================================================
 
 GeomToStep_MakeCartesianPoint::
-  GeomToStep_MakeCartesianPoint( const Handle(Geom_CartesianPoint)& P)
+  GeomToStep_MakeCartesianPoint( const Handle(Geom_CartesianPoint)& P,
+                                 const Standard_Real aFactor)
 
 {
   Handle(StepGeom_CartesianPoint) Pstep = new StepGeom_CartesianPoint;
@@ -87,8 +90,7 @@ GeomToStep_MakeCartesianPoint::
 //  Pstep->SetCoordinates(Acoord);
   Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
 //  Pstep->SetName(name);
-  Standard_Real fact = StepData_GlobalFactors::Intance().LengthFactor();
-  Pstep->Init3D (name,X/fact,Y/fact,Z/fact);
+  Pstep->Init3D (name,X/aFactor,Y/aFactor,Z/aFactor);
   theCartesianPoint = Pstep;
   done = Standard_True;
 }
index a7387e0fc7c3102f099ed041cfd7b265a8dba4cc..c476a81ac1f3f0fa4b645d6c303de73b6284faca 100644 (file)
@@ -27,6 +27,7 @@ class gp_Pnt;
 class gp_Pnt2d;
 class Geom_CartesianPoint;
 class Geom2d_CartesianPoint;
+class StepData_StepModel;
 
 
 //! This class implements the mapping between classes
@@ -40,11 +41,14 @@ public:
   DEFINE_STANDARD_ALLOC
 
   
-  Standard_EXPORT GeomToStep_MakeCartesianPoint(const gp_Pnt& P);
+  Standard_EXPORT GeomToStep_MakeCartesianPoint(const gp_Pnt& P,
+                                                const Standard_Real aFactor);
   
-  Standard_EXPORT GeomToStep_MakeCartesianPoint(const gp_Pnt2d& P);
+  Standard_EXPORT GeomToStep_MakeCartesianPoint(const gp_Pnt2d& P,
+                                                const Standard_Real aFactor);
   
-  Standard_EXPORT GeomToStep_MakeCartesianPoint(const Handle(Geom_CartesianPoint)& P);
+  Standard_EXPORT GeomToStep_MakeCartesianPoint(const Handle(Geom_CartesianPoint)& P,
+                                                const Standard_Real aFactor);
   
   Standard_EXPORT GeomToStep_MakeCartesianPoint(const Handle(Geom2d_CartesianPoint)& P);
   
index d76adaf3a28971bd18219ee5b1612150234678b6..c26e5a3d6d49cd39d6dd7287067700e6f21a33b4 100644 (file)
@@ -23,7 +23,7 @@
 #include <gp_Circ.hxx>
 #include <gp_Circ2d.hxx>
 #include <StdFail_NotDone.hxx>
-#include <StepData_GlobalFactors.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_Axis2Placement2d.hxx>
 #include <StepGeom_Axis2Placement3d.hxx>
 #include <StepGeom_Circle.hxx>
@@ -32,7 +32,8 @@
 //=============================================================================
 // Creation d' un cercle de prostep a partir d' un cercle 3d de gp
 //=============================================================================
-GeomToStep_MakeCircle::GeomToStep_MakeCircle( const gp_Circ& C)
+GeomToStep_MakeCircle::GeomToStep_MakeCircle( const gp_Circ& C,
+                                              const StepData_Factors& theLocalFactors)
 {
 #include "GeomToStep_MakeCircle_gen.pxx"
 }
@@ -43,7 +44,8 @@ GeomToStep_MakeCircle::GeomToStep_MakeCircle( const gp_Circ& C)
 // Geom
 //=============================================================================
 
-GeomToStep_MakeCircle::GeomToStep_MakeCircle( const Handle(Geom_Circle)& Cer)
+GeomToStep_MakeCircle::GeomToStep_MakeCircle( const Handle(Geom_Circle)& Cer,
+                                              const StepData_Factors& theLocalFactors)
 {
   gp_Circ C;
   C = Cer->Circ();
@@ -56,7 +58,8 @@ GeomToStep_MakeCircle::GeomToStep_MakeCircle( const Handle(Geom_Circle)& Cer)
 // Geom2d
 //=============================================================================
 
-GeomToStep_MakeCircle::GeomToStep_MakeCircle( const Handle(Geom2d_Circle)& Cer)
+GeomToStep_MakeCircle::GeomToStep_MakeCircle( const Handle(Geom2d_Circle)& Cer,
+                                              const StepData_Factors& theLocalFactors)
 {
   gp_Circ2d C2d;
   C2d = Cer->Circ2d();
@@ -66,7 +69,7 @@ GeomToStep_MakeCircle::GeomToStep_MakeCircle( const Handle(Geom2d_Circle)& Cer)
   Handle(StepGeom_Axis2Placement2d) Ax2Step;
   Standard_Real Rayon;
   
-  GeomToStep_MakeAxis2Placement2d MkAxis2(C2d.Position());
+  GeomToStep_MakeAxis2Placement2d MkAxis2(C2d.Position(), theLocalFactors);
   Ax2Step = MkAxis2.Value();
   Rayon = C2d.Radius();
   Ax2.SetValue(Ax2Step);
index 38890848d313eb93c35ce2efc12bd964fe1b9f64..abd6360f2befaee086d4a241ea5cc789c6dc7257 100644 (file)
@@ -22,6 +22,8 @@
 #include <Standard_Handle.hxx>
 
 #include <GeomToStep_Root.hxx>
+
+class StepData_Factors;
 class StepGeom_Circle;
 class gp_Circ;
 class Geom_Circle;
@@ -39,11 +41,14 @@ public:
   DEFINE_STANDARD_ALLOC
 
   
-  Standard_EXPORT GeomToStep_MakeCircle(const gp_Circ& C);
+  Standard_EXPORT GeomToStep_MakeCircle(const gp_Circ& C,
+                                        const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT GeomToStep_MakeCircle(const Handle(Geom_Circle)& C);
+  Standard_EXPORT GeomToStep_MakeCircle(const Handle(Geom_Circle)& C,
+                                        const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT GeomToStep_MakeCircle(const Handle(Geom2d_Circle)& C);
+  Standard_EXPORT GeomToStep_MakeCircle(const Handle(Geom2d_Circle)& C,
+                                        const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const Handle(StepGeom_Circle)& Value() const;
 
index 5c22197f287b46a217310ebe41adf51cfaf0f83c..86a830508f7c2ab865c48482b76cd449fd7a9ac5 100644 (file)
@@ -19,12 +19,12 @@ Handle(StepGeom_Circle) CStep = new StepGeom_Circle;
   Handle(StepGeom_Axis2Placement3d) Ax2Step;
   Standard_Real Rayon;
   
-  GeomToStep_MakeAxis2Placement3d MkAxis2(C.Position());
+  GeomToStep_MakeAxis2Placement3d MkAxis2(C.Position(), theLocalFactors);
   Ax2Step = MkAxis2.Value();
   Rayon = C.Radius();
   Ax2.SetValue(Ax2Step);
   Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
-  CStep->Init(name, Ax2, Rayon / StepData_GlobalFactors::Intance().LengthFactor());
+  CStep->Init(name, Ax2, Rayon / theLocalFactors.LengthFactor());
   theCircle = CStep;
   done = Standard_True;
 
index 5db9c52b525ee8a317ca7a0f23a24f828dea1482..0d0eadd56c65bc5928aa3b3d70f74aaa05092211 100644 (file)
@@ -31,6 +31,7 @@
 #include <GeomToStep_MakeHyperbola.hxx>
 #include <GeomToStep_MakeParabola.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_Circle.hxx>
 #include <StepGeom_Conic.hxx>
 #include <StepGeom_Ellipse.hxx>
 //=============================================================================
 // Creation d' une Conic de prostep a partir d' une Conic de Geom
 //=============================================================================
-GeomToStep_MakeConic::GeomToStep_MakeConic ( const Handle(Geom_Conic)& C)
+GeomToStep_MakeConic::GeomToStep_MakeConic ( const Handle(Geom_Conic)& C,
+                                             const StepData_Factors& theLocalFactors)
 {
   done = Standard_True;
   if (C->IsKind(STANDARD_TYPE(Geom_Circle))) {
     Handle(Geom_Circle) Cer = Handle(Geom_Circle)::DownCast(C);
-    GeomToStep_MakeCircle MkCircle(Cer);
+    GeomToStep_MakeCircle MkCircle(Cer, theLocalFactors);
     theConic = MkCircle.Value();
   }
   else if (C->IsKind(STANDARD_TYPE(Geom_Ellipse))) {
     Handle(Geom_Ellipse) Ell = Handle(Geom_Ellipse)::DownCast(C);
-    GeomToStep_MakeEllipse MkEllipse(Ell);
+    GeomToStep_MakeEllipse MkEllipse(Ell, theLocalFactors);
     theConic = MkEllipse.Value();
   }
   else if (C->IsKind(STANDARD_TYPE(Geom_Hyperbola))) {
     Handle(Geom_Hyperbola) Hyp = Handle(Geom_Hyperbola)::DownCast(C);
-    GeomToStep_MakeHyperbola MkHyperbola(Hyp);
+    GeomToStep_MakeHyperbola MkHyperbola(Hyp, theLocalFactors);
     theConic = MkHyperbola.Value();
   }
   else if (C->IsKind(STANDARD_TYPE(Geom_Parabola))) {
     Handle(Geom_Parabola) Par = Handle(Geom_Parabola)::DownCast(C);
-    GeomToStep_MakeParabola MkParabola(Par);
+    GeomToStep_MakeParabola MkParabola(Par, theLocalFactors);
     theConic = MkParabola.Value();
   }
   else {
@@ -75,27 +77,28 @@ GeomToStep_MakeConic::GeomToStep_MakeConic ( const Handle(Geom_Conic)& C)
 // Creation d' une Conic2d de prostep a partir d' une Conic de Geom2d
 //=============================================================================
 
-GeomToStep_MakeConic::GeomToStep_MakeConic ( const Handle(Geom2d_Conic)& C)
+GeomToStep_MakeConic::GeomToStep_MakeConic ( const Handle(Geom2d_Conic)& C,
+                                             const StepData_Factors& theLocalFactors)
 {
   done = Standard_True;
   if (C->IsKind(STANDARD_TYPE(Geom2d_Circle))) {
     Handle(Geom2d_Circle) Cer = Handle(Geom2d_Circle)::DownCast(C);
-    GeomToStep_MakeCircle MkCircle(Cer);
+    GeomToStep_MakeCircle MkCircle(Cer, theLocalFactors);
     theConic = MkCircle.Value();
   }
   else if (C->IsKind(STANDARD_TYPE(Geom2d_Ellipse))) {
     Handle(Geom2d_Ellipse) Ell = Handle(Geom2d_Ellipse)::DownCast(C);
-    GeomToStep_MakeEllipse MkEllipse(Ell);
+    GeomToStep_MakeEllipse MkEllipse(Ell, theLocalFactors);
     theConic = MkEllipse.Value();
   }
   else if (C->IsKind(STANDARD_TYPE(Geom2d_Hyperbola))) {
     Handle(Geom2d_Hyperbola) Hyp = Handle(Geom2d_Hyperbola)::DownCast(C);
-    GeomToStep_MakeHyperbola MkHyperbola(Hyp);
+    GeomToStep_MakeHyperbola MkHyperbola(Hyp, theLocalFactors);
     theConic = MkHyperbola.Value();
   }
   else if (C->IsKind(STANDARD_TYPE(Geom2d_Parabola))) {
     Handle(Geom2d_Parabola) Par = Handle(Geom2d_Parabola)::DownCast(C);
-    GeomToStep_MakeParabola MkParabola(Par);
+    GeomToStep_MakeParabola MkParabola(Par, theLocalFactors);
     theConic = MkParabola.Value();
   }
   else {
index b2ff81ab0b07c930f6f2f6123e520b110d6979a6..dfdaa13e78ffdbe9c3c96731f5add0f0076bef43 100644 (file)
@@ -25,6 +25,7 @@
 class StepGeom_Conic;
 class Geom_Conic;
 class Geom2d_Conic;
+class StepData_Factors;
 
 
 //! This class implements the mapping between classes
@@ -38,9 +39,11 @@ public:
   DEFINE_STANDARD_ALLOC
 
   
-  Standard_EXPORT GeomToStep_MakeConic(const Handle(Geom_Conic)& C);
+  Standard_EXPORT GeomToStep_MakeConic(const Handle(Geom_Conic)& C,
+                                       const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT GeomToStep_MakeConic(const Handle(Geom2d_Conic)& C);
+  Standard_EXPORT GeomToStep_MakeConic(const Handle(Geom2d_Conic)& C,
+                                       const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const Handle(StepGeom_Conic)& Value() const;
 
index a8c42bffafbaccf72506a8da25e042768f14a368..bbe4df31ac269089cb39035ad20085d0fb736c51 100644 (file)
@@ -20,7 +20,7 @@
 #include <GeomToStep_MakeConicalSurface.hxx>
 #include <Standard_DomainError.hxx>
 #include <StdFail_NotDone.hxx>
-#include <StepData_GlobalFactors.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_Axis2Placement3d.hxx>
 #include <StepGeom_ConicalSurface.hxx>
 #include <TCollection_HAsciiString.hxx>
 // de Geom
 //=============================================================================
 GeomToStep_MakeConicalSurface::GeomToStep_MakeConicalSurface
-  ( const Handle(Geom_ConicalSurface)& CS )
+  ( const Handle(Geom_ConicalSurface)& CS, const StepData_Factors& theLocalFactors)
        
 {
   Handle(StepGeom_ConicalSurface) CSstep = new StepGeom_ConicalSurface;
   Handle(StepGeom_Axis2Placement3d) aPosition;
   Standard_Real aRadius, aSemiAngle;
   
-  GeomToStep_MakeAxis2Placement3d MkAxis(CS->Position());
+  GeomToStep_MakeAxis2Placement3d MkAxis(CS->Position(), theLocalFactors);
   aPosition = MkAxis.Value();
   aRadius = CS->RefRadius();
   aSemiAngle = CS->SemiAngle();
@@ -46,7 +46,7 @@ GeomToStep_MakeConicalSurface::GeomToStep_MakeConicalSurface
   }
   
   Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
-  CSstep->Init(name, aPosition, aRadius / StepData_GlobalFactors::Intance().LengthFactor(), aSemiAngle);
+  CSstep->Init(name, aPosition, aRadius / theLocalFactors.LengthFactor(), aSemiAngle);
   theConicalSurface = CSstep;
   done = Standard_True;
 }
index b8c8839c437400ed8e9869658e30c3e034acb799..31479c494a7a6b19f7bbe85e3dcb6dfbe5f29c2b 100644 (file)
@@ -24,6 +24,7 @@
 #include <GeomToStep_Root.hxx>
 class StepGeom_ConicalSurface;
 class Geom_ConicalSurface;
+class StepData_Factors;
 
 
 //! This class implements the mapping between class
@@ -37,7 +38,8 @@ public:
   DEFINE_STANDARD_ALLOC
 
   
-  Standard_EXPORT GeomToStep_MakeConicalSurface(const Handle(Geom_ConicalSurface)& CSurf);
+  Standard_EXPORT GeomToStep_MakeConicalSurface(const Handle(Geom_ConicalSurface)& CSurf,
+                                                const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const Handle(StepGeom_ConicalSurface)& Value() const;
 
index 6dfee4c0448fab3719580104ff84b350ea968bef..a552e28a57ed24596cbdb64d57502c96f5714b9c 100644 (file)
@@ -37,6 +37,7 @@
 #include <gp_Circ2d.hxx>
 #include <gp_Elips2d.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_Axis2Placement3d.hxx>
 #include <StepGeom_BoundedCurve.hxx>
 #include <StepGeom_Conic.hxx>
 //=============================================================================
 // Creation d' une Curve de prostep a partir d' une Curve de Geom
 //=============================================================================
-GeomToStep_MakeCurve::GeomToStep_MakeCurve ( const Handle(Geom_Curve)& C)
+GeomToStep_MakeCurve::GeomToStep_MakeCurve ( const Handle(Geom_Curve)& C,
+                                             const StepData_Factors& theLocalFactors)
 {
   done = Standard_True;
   if (C->IsKind(STANDARD_TYPE(Geom_Line))) {
     Handle(Geom_Line) L = Handle(Geom_Line)::DownCast(C);
-    GeomToStep_MakeLine MkLine(L);
+    GeomToStep_MakeLine MkLine(L, theLocalFactors);
     theCurve = MkLine.Value();
   }
   else if (C->IsKind(STANDARD_TYPE(Geom_Conic))) {
     Handle(Geom_Conic) L = Handle(Geom_Conic)::DownCast(C);
-    GeomToStep_MakeConic MkConic(L);
+    GeomToStep_MakeConic MkConic(L, theLocalFactors);
     theCurve = MkConic.Value();
   }
   else if (C->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) {
@@ -82,12 +84,12 @@ GeomToStep_MakeCurve::GeomToStep_MakeCurve ( const Handle(Geom_Curve)& C)
       std::cout<<"BasisCurve Type : "<<B->DynamicType()->Name()<<std::endl;
 #endif
     }
-    GeomToStep_MakeCurve MkBasisC(B);
+    GeomToStep_MakeCurve MkBasisC(B, theLocalFactors);
     theCurve = MkBasisC.Value();
   }
   else if (C->IsKind(STANDARD_TYPE(Geom_BoundedCurve))) {
     Handle(Geom_BoundedCurve) L = Handle(Geom_BoundedCurve)::DownCast(C);
-    GeomToStep_MakeBoundedCurve MkBoundedC(L);
+    GeomToStep_MakeBoundedCurve MkBoundedC(L, theLocalFactors);
     theCurve = MkBoundedC.Value();
   }
   else
@@ -98,12 +100,13 @@ GeomToStep_MakeCurve::GeomToStep_MakeCurve ( const Handle(Geom_Curve)& C)
 // Creation d'une Curve de prostep a partir d' une Curve de Geom2d
 //=============================================================================
 
-GeomToStep_MakeCurve::GeomToStep_MakeCurve ( const Handle(Geom2d_Curve)& C)
+GeomToStep_MakeCurve::GeomToStep_MakeCurve ( const Handle(Geom2d_Curve)& C,
+                                             const StepData_Factors& theLocalFactors)
 {
   done = Standard_True;
   if (C->IsKind(STANDARD_TYPE(Geom2d_Line))) {
     Handle(Geom2d_Line) L = Handle(Geom2d_Line)::DownCast(C);
-    GeomToStep_MakeLine MkLine(L);
+    GeomToStep_MakeLine MkLine(L, theLocalFactors);
     theCurve = MkLine.Value();
   }
   else if (C->IsKind(STANDARD_TYPE(Geom2d_Conic))) {
@@ -124,12 +127,12 @@ GeomToStep_MakeCurve::GeomToStep_MakeCurve ( const Handle(Geom2d_Curve)& C)
        Handle(Geom2d_BSplineCurve) aBSplineCurve2d = 
          Geom2dConvert::CurveToBSplineCurve(theC2d);
         const Handle(Geom2d_BoundedCurve)& aBC2d = aBSplineCurve2d; // to avoid ambiguity
-       GeomToStep_MakeBoundedCurve MkBoundedC(aBC2d);
+       GeomToStep_MakeBoundedCurve MkBoundedC(aBC2d, theLocalFactors);
        theCurve = MkBoundedC.Value();
       }
       else {
        Handle(Geom2d_Conic) L = Handle(Geom2d_Conic)::DownCast(C);
-       GeomToStep_MakeConic MkConic(L);
+       GeomToStep_MakeConic MkConic(L, theLocalFactors);
        theCurve = MkConic.Value();
       }
     }
@@ -143,28 +146,28 @@ GeomToStep_MakeCurve::GeomToStep_MakeCurve ( const Handle(Geom2d_Curve)& C)
        Handle(Geom2d_BSplineCurve) aBSplineCurve2d = 
          Geom2dConvert::CurveToBSplineCurve(theE2d);
         const Handle(Geom2d_BoundedCurve)& aBC2d = aBSplineCurve2d; // to avoid ambiguity
-       GeomToStep_MakeBoundedCurve MkBoundedC(aBC2d);
+       GeomToStep_MakeBoundedCurve MkBoundedC(aBC2d, theLocalFactors);
        theCurve = MkBoundedC.Value();
       }
       else {
        Handle(Geom2d_Conic) L = Handle(Geom2d_Conic)::DownCast(C);
-       GeomToStep_MakeConic MkConic(L);
+       GeomToStep_MakeConic MkConic(L, theLocalFactors);
        theCurve = MkConic.Value();
       }
     }
     else {
       Handle(Geom2d_Conic) L = Handle(Geom2d_Conic)::DownCast(C);
-      GeomToStep_MakeConic MkConic(L);
+      GeomToStep_MakeConic MkConic(L, theLocalFactors);
       theCurve = MkConic.Value();
     }
   }
   else if (C->IsKind(STANDARD_TYPE(Geom2d_BoundedCurve))) {
     Handle(Geom2d_BoundedCurve) L = Handle(Geom2d_BoundedCurve)::DownCast(C);
-    GeomToStep_MakeBoundedCurve MkBoundedC(L);
+    GeomToStep_MakeBoundedCurve MkBoundedC(L, theLocalFactors);
     theCurve = MkBoundedC.Value();
   }
   else if (C->IsKind(STANDARD_TYPE(Geom2d_TrimmedCurve))) {
-    GeomToStep_MakeCurve aMaker = (Handle(Geom2d_TrimmedCurve)::DownCast(C)->BasisCurve());
+    GeomToStep_MakeCurve aMaker(Handle(Geom2d_TrimmedCurve)::DownCast(C)->BasisCurve(), theLocalFactors);
     theCurve = aMaker.Value();
   }
   else
index a907c8fd6817020eb0b012ad9dceb9dbd6d46bbb..325143b1396ec0a26b0a787b04f8846cdc846e12 100644 (file)
@@ -22,6 +22,7 @@
 #include <Standard_Handle.hxx>
 
 #include <GeomToStep_Root.hxx>
+class StepData_Factors;
 class StepGeom_Curve;
 class Geom_Curve;
 class Geom2d_Curve;
@@ -38,9 +39,11 @@ public:
   DEFINE_STANDARD_ALLOC
 
   
-  Standard_EXPORT GeomToStep_MakeCurve(const Handle(Geom_Curve)& C);
+  Standard_EXPORT GeomToStep_MakeCurve(const Handle(Geom_Curve)& C,
+                                       const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT GeomToStep_MakeCurve(const Handle(Geom2d_Curve)& C);
+  Standard_EXPORT GeomToStep_MakeCurve(const Handle(Geom2d_Curve)& C,
+                                       const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const Handle(StepGeom_Curve)& Value() const;
 
index 08c4fb0b88227067b6819bcba078090add543482..d8fa66712b55a1f9bbdfa34376bed147219dba85 100644 (file)
@@ -19,7 +19,7 @@
 #include <GeomToStep_MakeAxis2Placement3d.hxx>
 #include <GeomToStep_MakeCylindricalSurface.hxx>
 #include <StdFail_NotDone.hxx>
-#include <StepData_GlobalFactors.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_Axis2Placement3d.hxx>
 #include <StepGeom_CylindricalSurface.hxx>
 #include <TCollection_HAsciiString.hxx>
 // CylindricalSurface de Geom
 //=============================================================================
 GeomToStep_MakeCylindricalSurface::GeomToStep_MakeCylindricalSurface
-  ( const Handle(Geom_CylindricalSurface)& CS )
-       
+  ( const Handle(Geom_CylindricalSurface)& CS,
+    const StepData_Factors& theLocalFactors)
 {
   Handle(StepGeom_CylindricalSurface) CSstep;
   Handle(StepGeom_Axis2Placement3d) aPosition;
   Standard_Real aRadius;
   
-  GeomToStep_MakeAxis2Placement3d MkAxis2(CS->Position());
+  GeomToStep_MakeAxis2Placement3d MkAxis2(CS->Position(), theLocalFactors);
   aPosition = MkAxis2.Value();
   aRadius = CS->Radius();
   CSstep = new StepGeom_CylindricalSurface;
   Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
-  CSstep->Init(name, aPosition, aRadius / StepData_GlobalFactors::Intance().LengthFactor());
+  CSstep->Init(name, aPosition, aRadius / theLocalFactors.LengthFactor());
   theCylindricalSurface = CSstep;
   done = Standard_True;
 }
index 77d46e666dcf342275e5c29c4ffe72ce6d1e8f19..6325002b5dd1d9ff690573a4236e8f5c73effaaa 100644 (file)
@@ -24,6 +24,7 @@
 #include <GeomToStep_Root.hxx>
 class StepGeom_CylindricalSurface;
 class Geom_CylindricalSurface;
+class StepData_Factors;
 
 
 //! This class implements the mapping between class
@@ -37,7 +38,8 @@ public:
   DEFINE_STANDARD_ALLOC
 
   
-  Standard_EXPORT GeomToStep_MakeCylindricalSurface(const Handle(Geom_CylindricalSurface)& CSurf);
+  Standard_EXPORT GeomToStep_MakeCylindricalSurface(const Handle(Geom_CylindricalSurface)& CSurf,
+                                                    const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const Handle(StepGeom_CylindricalSurface)& Value() const;
 
index bcfdfb90690cbea65fe6c87ff131c751705615c2..171cbb4ea754a1fe05966256525846b8b5df7e97 100644 (file)
@@ -28,6 +28,7 @@
 #include <GeomToStep_MakeSphericalSurface.hxx>
 #include <GeomToStep_MakeToroidalSurface.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_ConicalSurface.hxx>
 #include <StepGeom_CylindricalSurface.hxx>
 #include <StepGeom_ElementarySurface.hxx>
 // ElementarySurface de Geom
 //=============================================================================
 GeomToStep_MakeElementarySurface::GeomToStep_MakeElementarySurface
-  ( const Handle(Geom_ElementarySurface)& S)
+  ( const Handle(Geom_ElementarySurface)& S,
+    const StepData_Factors& theLocalFactors)
 {
   done = Standard_True;
   if (S->IsKind(STANDARD_TYPE(Geom_CylindricalSurface))) {
     Handle(Geom_CylindricalSurface) Sur = 
       Handle(Geom_CylindricalSurface)::DownCast(S);
-    GeomToStep_MakeCylindricalSurface MkCylindrical(Sur);
+    GeomToStep_MakeCylindricalSurface MkCylindrical(Sur, theLocalFactors);
     theElementarySurface = MkCylindrical.Value();
   }
   else if (S->IsKind(STANDARD_TYPE(Geom_ConicalSurface))) {
     Handle(Geom_ConicalSurface) Sur = 
       Handle(Geom_ConicalSurface)::DownCast(S);
-    GeomToStep_MakeConicalSurface MkConical(Sur);
+    GeomToStep_MakeConicalSurface MkConical(Sur, theLocalFactors);
     theElementarySurface = MkConical.Value();
   }
   else if (S->IsKind(STANDARD_TYPE(Geom_SphericalSurface))) {
     Handle(Geom_SphericalSurface) Sur = 
       Handle(Geom_SphericalSurface)::DownCast(S);
-    GeomToStep_MakeSphericalSurface MkSpherical(Sur);
+    GeomToStep_MakeSphericalSurface MkSpherical(Sur, theLocalFactors);
     theElementarySurface = MkSpherical.Value();
   }
   else if (S->IsKind(STANDARD_TYPE(Geom_ToroidalSurface))) {
     Handle(Geom_ToroidalSurface) Sur = 
       Handle(Geom_ToroidalSurface)::DownCast(S);
-    GeomToStep_MakeToroidalSurface MkToroidal(Sur);
+    GeomToStep_MakeToroidalSurface MkToroidal(Sur, theLocalFactors);
     theElementarySurface = MkToroidal.Value();
   }
   else if (S->IsKind(STANDARD_TYPE(Geom_Plane))) {
     Handle(Geom_Plane) Sur =   Handle(Geom_Plane)::DownCast(S); 
-    GeomToStep_MakePlane MkPlane(Sur);
+    GeomToStep_MakePlane MkPlane(Sur, theLocalFactors);
     theElementarySurface = MkPlane.Value();
   }
   else
index 80f4a09c30f7c77457b02700e08a61dce223bbc1..4ccdd301edfbec5dc0fe2634f177e39150c44006 100644 (file)
@@ -22,6 +22,8 @@
 #include <Standard_Handle.hxx>
 
 #include <GeomToStep_Root.hxx>
+
+class StepData_Factors;
 class StepGeom_ElementarySurface;
 class Geom_ElementarySurface;
 
@@ -38,7 +40,8 @@ public:
   DEFINE_STANDARD_ALLOC
 
   
-  Standard_EXPORT GeomToStep_MakeElementarySurface(const Handle(Geom_ElementarySurface)& S);
+  Standard_EXPORT GeomToStep_MakeElementarySurface(const Handle(Geom_ElementarySurface)& S,
+                                                   const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const Handle(StepGeom_ElementarySurface)& Value() const;
 
index 34794facf8de5458ca980458729a6c93d08a5ee5..50c2aaeca770486f79a29158328c50a4530b8c75 100644 (file)
@@ -23,7 +23,7 @@
 #include <gp_Elips.hxx>
 #include <gp_Elips2d.hxx>
 #include <StdFail_NotDone.hxx>
-#include <StepData_GlobalFactors.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_Axis2Placement2d.hxx>
 #include <StepGeom_Axis2Placement3d.hxx>
 #include <StepGeom_Ellipse.hxx>
@@ -32,7 +32,8 @@
 //=============================================================================
 // Creation d'une ellipse de prostep a partir d'une ellipse 3d de gp
 //=============================================================================
-GeomToStep_MakeEllipse::GeomToStep_MakeEllipse( const gp_Elips& E)
+GeomToStep_MakeEllipse::GeomToStep_MakeEllipse( const gp_Elips& E,
+                                                const StepData_Factors& theLocalFactors)
 {
 #include "GeomToStep_MakeEllipse_gen.pxx"
 }
@@ -43,7 +44,8 @@ GeomToStep_MakeEllipse::GeomToStep_MakeEllipse( const gp_Elips& E)
 // Geom
 //=============================================================================
 
-GeomToStep_MakeEllipse::GeomToStep_MakeEllipse( const Handle(Geom_Ellipse)& Cer)
+GeomToStep_MakeEllipse::GeomToStep_MakeEllipse( const Handle(Geom_Ellipse)& Cer,
+                                                const StepData_Factors& theLocalFactors)
 {
   gp_Elips E;
   E = Cer->Elips();
@@ -56,7 +58,8 @@ GeomToStep_MakeEllipse::GeomToStep_MakeEllipse( const Handle(Geom_Ellipse)& Cer)
 // Geom2d
 //=============================================================================
 
-GeomToStep_MakeEllipse::GeomToStep_MakeEllipse( const Handle(Geom2d_Ellipse)& Cer)
+GeomToStep_MakeEllipse::GeomToStep_MakeEllipse( const Handle(Geom2d_Ellipse)& Cer,
+                                                const StepData_Factors& theLocalFactors)
 {
   gp_Elips2d E2d;
   E2d = Cer->Elips2d();
@@ -66,7 +69,7 @@ GeomToStep_MakeEllipse::GeomToStep_MakeEllipse( const Handle(Geom2d_Ellipse)& Ce
   Handle(StepGeom_Axis2Placement2d) Ax2Step;
   Standard_Real majorR, minorR;
   
-  GeomToStep_MakeAxis2Placement2d MkAxis2(E2d.Axis());
+  GeomToStep_MakeAxis2Placement2d MkAxis2(E2d.Axis(), theLocalFactors);
   Ax2Step = MkAxis2.Value();
   majorR = E2d.MajorRadius();
   minorR = E2d.MinorRadius();
index 9fe86d8ce74a92966f5adc64b6797f114828bd6b..a9b4971eb9c5055a8bd80064e3c88833b4596e0e 100644 (file)
@@ -22,6 +22,8 @@
 #include <Standard_Handle.hxx>
 
 #include <GeomToStep_Root.hxx>
+
+class StepData_Factors;
 class StepGeom_Ellipse;
 class gp_Elips;
 class Geom_Ellipse;
@@ -39,11 +41,14 @@ public:
   DEFINE_STANDARD_ALLOC
 
   
-  Standard_EXPORT GeomToStep_MakeEllipse(const gp_Elips& C);
+  Standard_EXPORT GeomToStep_MakeEllipse(const gp_Elips& C,
+                                         const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT GeomToStep_MakeEllipse(const Handle(Geom_Ellipse)& C);
+  Standard_EXPORT GeomToStep_MakeEllipse(const Handle(Geom_Ellipse)& C,
+                                         const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT GeomToStep_MakeEllipse(const Handle(Geom2d_Ellipse)& C);
+  Standard_EXPORT GeomToStep_MakeEllipse(const Handle(Geom2d_Ellipse)& C,
+                                         const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const Handle(StepGeom_Ellipse)& Value() const;
 
index 38adf96e8a77a6bbf23a9b4a9d8f5aceccfceb14..70a402b902eb15fb5be9b6dacced7e09cb77a687 100644 (file)
@@ -19,13 +19,13 @@ Handle(StepGeom_Ellipse) EStep = new StepGeom_Ellipse;
   Handle(StepGeom_Axis2Placement3d) Ax2Step;
   Standard_Real majorR, minorR;
   
-  GeomToStep_MakeAxis2Placement3d MkAxis2(E.Position());
+  GeomToStep_MakeAxis2Placement3d MkAxis2(E.Position(), theLocalFactors);
   Ax2Step = MkAxis2.Value();
   majorR = E.MajorRadius();
   minorR = E.MinorRadius();
   Ax2.SetValue(Ax2Step);
   Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
-  Standard_Real fact = StepData_GlobalFactors::Intance().LengthFactor();
+  Standard_Real fact = theLocalFactors.LengthFactor();
   EStep->Init(name, Ax2,majorR/fact,minorR/fact);
   theEllipse = EStep;
   done = Standard_True;
index b0247d8a13cd31e06a1b7bdb5c063ef533e11946..d6f1e00b758117fad2bb4683d3250eebc8726ac8 100644 (file)
@@ -20,7 +20,7 @@
 #include <gp_Hypr.hxx>
 #include <gp_Hypr2d.hxx>
 #include <StdFail_NotDone.hxx>
-#include <StepData_GlobalFactors.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_Axis2Placement2d.hxx>
 #include <StepGeom_Axis2Placement3d.hxx>
 #include <StepGeom_Hyperbola.hxx>
@@ -30,7 +30,8 @@
 // Creation d'une hyperbola de prostep a partir d'une hyperbola de
 // Geom2d
 //=============================================================================
-GeomToStep_MakeHyperbola::GeomToStep_MakeHyperbola(const Handle(Geom2d_Hyperbola)& C)
+GeomToStep_MakeHyperbola::GeomToStep_MakeHyperbola(const Handle(Geom2d_Hyperbola)& C,
+                                                   const StepData_Factors& theLocalFactors)
 {
   gp_Hypr2d gpHyp;
   gpHyp = C->Hypr2d();
@@ -40,7 +41,7 @@ GeomToStep_MakeHyperbola::GeomToStep_MakeHyperbola(const Handle(Geom2d_Hyperbola
   Handle(StepGeom_Axis2Placement2d)  Ax2Step;
   Standard_Real                   majorR, minorR;
   
-  GeomToStep_MakeAxis2Placement2d MkAxis2(gpHyp.Axis());
+  GeomToStep_MakeAxis2Placement2d MkAxis2(gpHyp.Axis(), theLocalFactors);
   Ax2Step = MkAxis2.Value();
   majorR = gpHyp.MajorRadius();
   minorR = gpHyp.MinorRadius();
@@ -56,7 +57,8 @@ GeomToStep_MakeHyperbola::GeomToStep_MakeHyperbola(const Handle(Geom2d_Hyperbola
 // Geom
 //=============================================================================
 
- GeomToStep_MakeHyperbola::GeomToStep_MakeHyperbola(const Handle(Geom_Hyperbola)& C)
+ GeomToStep_MakeHyperbola::GeomToStep_MakeHyperbola(const Handle(Geom_Hyperbola)& C,
+                                                    const StepData_Factors& theLocalFactors)
 {
   gp_Hypr gpHyp;
   gpHyp = C->Hypr();
@@ -66,13 +68,13 @@ GeomToStep_MakeHyperbola::GeomToStep_MakeHyperbola(const Handle(Geom2d_Hyperbola
   Handle(StepGeom_Axis2Placement3d)  Ax2Step;
   Standard_Real                   majorR, minorR;
   
-  GeomToStep_MakeAxis2Placement3d MkAxis2(gpHyp.Position());
+  GeomToStep_MakeAxis2Placement3d MkAxis2(gpHyp.Position(), theLocalFactors);
   Ax2Step = MkAxis2.Value();
   majorR = gpHyp.MajorRadius();
   minorR = gpHyp.MinorRadius();
   Ax2.SetValue(Ax2Step);
   Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
-  Standard_Real fact = StepData_GlobalFactors::Intance().LengthFactor();
+  Standard_Real fact = theLocalFactors.LengthFactor();
   HStep->Init(name, Ax2,majorR/fact,minorR/fact);
   theHyperbola = HStep;
   done = Standard_True;
index 74bc53766d91ed43eef357139d3dcedd8ad82821..e42b4be8e46ce663b50073de6c1e10e1547f29c4 100644 (file)
@@ -37,9 +37,11 @@ public:
   DEFINE_STANDARD_ALLOC
 
   
-  Standard_EXPORT GeomToStep_MakeHyperbola(const Handle(Geom2d_Hyperbola)& C);
+  Standard_EXPORT GeomToStep_MakeHyperbola(const Handle(Geom2d_Hyperbola)& C,
+                                           const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT GeomToStep_MakeHyperbola(const Handle(Geom_Hyperbola)& C);
+  Standard_EXPORT GeomToStep_MakeHyperbola(const Handle(Geom_Hyperbola)& C,
+                                           const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const Handle(StepGeom_Hyperbola)& Value() const;
 
index f480b372d20dd853fa03c1d4071b1876f63b961c..aa47473ed8a143b430620798c5c9fc28709e70c6 100644 (file)
@@ -25,6 +25,7 @@
 #include <gp_Vec.hxx>
 #include <gp_Vec2d.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_CartesianPoint.hxx>
 #include <StepGeom_Line.hxx>
 #include <StepGeom_Vector.hxx>
@@ -33,7 +34,8 @@
 //=============================================================================
 // Creation d' une line de prostep a partir d' une Lin de gp
 //=============================================================================
-GeomToStep_MakeLine::GeomToStep_MakeLine( const gp_Lin& L)
+GeomToStep_MakeLine::GeomToStep_MakeLine( const gp_Lin& L,
+                                          const StepData_Factors& theLocalFactors)
 {
 #define Vec_gen gp_Vec
 #include "GeomToStep_MakeLine_gen.pxx"
@@ -44,7 +46,8 @@ GeomToStep_MakeLine::GeomToStep_MakeLine( const gp_Lin& L)
 // Creation d' une line de prostep a partir d' une Lin2d de gp
 //=============================================================================
 
-GeomToStep_MakeLine::GeomToStep_MakeLine( const gp_Lin2d& L)
+GeomToStep_MakeLine::GeomToStep_MakeLine( const gp_Lin2d& L,
+                                          const StepData_Factors& theLocalFactors)
 {
 #define Vec_gen gp_Vec2d
 #include "GeomToStep_MakeLine_gen.pxx"
@@ -55,7 +58,8 @@ GeomToStep_MakeLine::GeomToStep_MakeLine( const gp_Lin2d& L)
 // Creation d' une line de prostep a partir d' une Line de Geom
 //=============================================================================
 
-GeomToStep_MakeLine::GeomToStep_MakeLine ( const Handle(Geom_Line)& Gline)
+GeomToStep_MakeLine::GeomToStep_MakeLine ( const Handle(Geom_Line)& Gline,
+                                           const StepData_Factors& theLocalFactors)
 {
   gp_Lin L;
   L = Gline->Lin();
@@ -68,7 +72,8 @@ GeomToStep_MakeLine::GeomToStep_MakeLine ( const Handle(Geom_Line)& Gline)
 // Creation d' une line de prostep a partir d' une Line de Geom2d
 //=============================================================================
 
-GeomToStep_MakeLine::GeomToStep_MakeLine ( const Handle(Geom2d_Line)& Gline)
+GeomToStep_MakeLine::GeomToStep_MakeLine ( const Handle(Geom2d_Line)& Gline,
+                                           const StepData_Factors& theLocalFactors)
 {
   gp_Lin2d L;
   L = Gline->Lin2d();
index 4d22c04c62fdbe96a134bc2fc41c3ccfe92fabb8..d7e6991351b15784d7150b9358ef6718e1c620ed 100644 (file)
@@ -22,6 +22,7 @@
 #include <Standard_Handle.hxx>
 
 #include <GeomToStep_Root.hxx>
+class StepData_Factors;
 class StepGeom_Line;
 class gp_Lin;
 class gp_Lin2d;
@@ -40,13 +41,17 @@ public:
   DEFINE_STANDARD_ALLOC
 
   
-  Standard_EXPORT GeomToStep_MakeLine(const gp_Lin& L);
+  Standard_EXPORT GeomToStep_MakeLine(const gp_Lin& L,
+                                      const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT GeomToStep_MakeLine(const gp_Lin2d& L);
+  Standard_EXPORT GeomToStep_MakeLine(const gp_Lin2d& L,
+                                      const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT GeomToStep_MakeLine(const Handle(Geom_Line)& C);
+  Standard_EXPORT GeomToStep_MakeLine(const Handle(Geom_Line)& C,
+                                      const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT GeomToStep_MakeLine(const Handle(Geom2d_Line)& C);
+  Standard_EXPORT GeomToStep_MakeLine(const Handle(Geom2d_Line)& C,
+                                      const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const Handle(StepGeom_Line)& Value() const;
 
index ab592d3020374f8554f9ab4fd26544eeb37ffb3d..424b7d60afa31f6639a8e3b9c07a1e72ec9197d9 100644 (file)
@@ -18,8 +18,8 @@ Handle(StepGeom_Line) Lin = new StepGeom_Line;
   Handle(StepGeom_CartesianPoint) aPnt;
   Handle(StepGeom_Vector) aDir;
 
-  GeomToStep_MakeCartesianPoint MkPoint(L.Location());
-  GeomToStep_MakeVector         MkVector(Vec_gen(L.Direction()));
+  GeomToStep_MakeCartesianPoint MkPoint(L.Location(), theLocalFactors.LengthFactor());
+  GeomToStep_MakeVector         MkVector(Vec_gen(L.Direction()), theLocalFactors);
   aPnt = MkPoint.Value();
   aDir = MkVector.Value();
   Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
index 3650201603d0d6e4a2c1d3180334900a7741f4fc..38f5c90f6f7d500e926604714a255f9787465a22 100644 (file)
@@ -20,7 +20,7 @@
 #include <gp_Parab.hxx>
 #include <gp_Parab2d.hxx>
 #include <StdFail_NotDone.hxx>
-#include <StepData_GlobalFactors.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_Axis2Placement2d.hxx>
 #include <StepGeom_Axis2Placement3d.hxx>
 #include <StepGeom_Parabola.hxx>
@@ -30,7 +30,8 @@
 // Creation d'une Parabola de prostep a partir d'une Parabola de
 // Geom2d
 //=============================================================================
-GeomToStep_MakeParabola::GeomToStep_MakeParabola(const Handle(Geom2d_Parabola)& C)
+GeomToStep_MakeParabola::GeomToStep_MakeParabola(const Handle(Geom2d_Parabola)& C,
+                                                 const StepData_Factors& theLocalFactors)
 {
   gp_Parab2d gpPar;
   gpPar = C->Parab2d();
@@ -40,7 +41,7 @@ GeomToStep_MakeParabola::GeomToStep_MakeParabola(const Handle(Geom2d_Parabola)&
   Handle(StepGeom_Axis2Placement2d)  Ax2Step;
   Standard_Real                   focal;
   
-  GeomToStep_MakeAxis2Placement2d MkAxis2(gpPar.Axis());
+  GeomToStep_MakeAxis2Placement2d MkAxis2(gpPar.Axis(), theLocalFactors);
   Ax2Step = MkAxis2.Value();
   focal = gpPar.Focal();
   Ax2.SetValue(Ax2Step);
@@ -55,7 +56,8 @@ GeomToStep_MakeParabola::GeomToStep_MakeParabola(const Handle(Geom2d_Parabola)&
 // Geom
 //=============================================================================
 
- GeomToStep_MakeParabola::GeomToStep_MakeParabola(const Handle(Geom_Parabola)& C)
+ GeomToStep_MakeParabola::GeomToStep_MakeParabola(const Handle(Geom_Parabola)& C,
+                                                  const StepData_Factors& theLocalFactors)
 {
   gp_Parab gpPar;
   gpPar = C->Parab();
@@ -65,12 +67,12 @@ GeomToStep_MakeParabola::GeomToStep_MakeParabola(const Handle(Geom2d_Parabola)&
   Handle(StepGeom_Axis2Placement3d)  Ax2Step;
   Standard_Real                   focal;
   
-  GeomToStep_MakeAxis2Placement3d MkAxis2(gpPar.Position());
+  GeomToStep_MakeAxis2Placement3d MkAxis2(gpPar.Position(), theLocalFactors);
   Ax2Step = MkAxis2.Value();
   focal = gpPar.Focal();
   Ax2.SetValue(Ax2Step);
   Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
-  PStep->Init(name, Ax2, focal / StepData_GlobalFactors::Intance().LengthFactor());
+  PStep->Init(name, Ax2, focal / theLocalFactors.LengthFactor());
   theParabola = PStep;
   done = Standard_True;
 }
index d45e44adf80080fa122ab106a303ecc4bde7083b..78a39b51e43ef4177e465142d865b086342eff46 100644 (file)
@@ -25,6 +25,7 @@
 class StepGeom_Parabola;
 class Geom2d_Parabola;
 class Geom_Parabola;
+class StepData_Factors;
 
 
 //! This class implements the mapping between the class
@@ -37,9 +38,11 @@ public:
   DEFINE_STANDARD_ALLOC
 
   
-  Standard_EXPORT GeomToStep_MakeParabola(const Handle(Geom2d_Parabola)& C);
+  Standard_EXPORT GeomToStep_MakeParabola(const Handle(Geom2d_Parabola)& C,
+                                          const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT GeomToStep_MakeParabola(const Handle(Geom_Parabola)& C);
+  Standard_EXPORT GeomToStep_MakeParabola(const Handle(Geom_Parabola)& C,
+                                          const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const Handle(StepGeom_Parabola)& Value() const;
 
index 9f4aa34491329d13179cb0babb0d33fc42dfd720..1017336fadf5338173abbfb938c2ca4b3200bc6c 100644 (file)
 //=============================================================================
 // Creation d' un plane de prostep a partir d' un Pln de gp
 //=============================================================================
-GeomToStep_MakePlane::GeomToStep_MakePlane( const gp_Pln& P)
+GeomToStep_MakePlane::GeomToStep_MakePlane( const gp_Pln& P,
+                                            const StepData_Factors& theLocalFactors)
 {
   Handle(StepGeom_Plane) Plan = new StepGeom_Plane;
   Handle(StepGeom_Axis2Placement3d) aPosition;
 
-  GeomToStep_MakeAxis2Placement3d MkAxis2(P.Position());
+  GeomToStep_MakeAxis2Placement3d MkAxis2(P.Position(), theLocalFactors);
   aPosition = MkAxis2.Value();
   Plan->SetPosition(aPosition);
   Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
@@ -45,7 +46,8 @@ GeomToStep_MakePlane::GeomToStep_MakePlane( const gp_Pln& P)
 // Creation d' un plane de prostep a partir d' un Plane de Geom
 //=============================================================================
 
-GeomToStep_MakePlane::GeomToStep_MakePlane( const Handle(Geom_Plane)& Gpln)
+GeomToStep_MakePlane::GeomToStep_MakePlane( const Handle(Geom_Plane)& Gpln,
+                                            const StepData_Factors& theLocalFactors)
 {
   gp_Pln P;
   Handle(StepGeom_Plane) Plan = new StepGeom_Plane;
@@ -53,7 +55,7 @@ GeomToStep_MakePlane::GeomToStep_MakePlane( const Handle(Geom_Plane)& Gpln)
 
   P = Gpln->Pln();
   
-  GeomToStep_MakeAxis2Placement3d MkAxis2(P.Position());
+  GeomToStep_MakeAxis2Placement3d MkAxis2(P.Position(), theLocalFactors);
   aPosition = MkAxis2.Value();
   Plan->SetPosition(aPosition);
   Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
index ef42f846462fc73dcaf734012de2659f34a89cab..cc6a7723716228a03d59d24d73e54b98752661fd 100644 (file)
@@ -22,6 +22,7 @@
 #include <Standard_Handle.hxx>
 
 #include <GeomToStep_Root.hxx>
+class StepData_Factors;
 class StepGeom_Plane;
 class gp_Pln;
 class Geom_Plane;
@@ -38,9 +39,11 @@ public:
   DEFINE_STANDARD_ALLOC
 
   
-  Standard_EXPORT GeomToStep_MakePlane(const gp_Pln& P);
+  Standard_EXPORT GeomToStep_MakePlane(const gp_Pln& P,
+                                       const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT GeomToStep_MakePlane(const Handle(Geom_Plane)& P);
+  Standard_EXPORT GeomToStep_MakePlane(const Handle(Geom_Plane)& P,
+                                       const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const Handle(StepGeom_Plane)& Value() const;
 
index 48afe4d03036c13d5b8208a7cf4a9359ddf5d983..81069a7e509892cc34d18ac8b8342bd35405f4a1 100644 (file)
@@ -20,6 +20,7 @@
 #include <gp_Pnt.hxx>
 #include <gp_Pnt2d.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_Polyline.hxx>
 #include <TColgp_Array1OfPnt.hxx>
 #include <TColgp_Array1OfPnt2d.hxx>
@@ -28,7 +29,8 @@
 //=============================================================================
 // Creation d' une polyline Step a partir d' une Array1OfPnt 
 //=============================================================================
-GeomToStep_MakePolyline::GeomToStep_MakePolyline( const TColgp_Array1OfPnt& P)
+GeomToStep_MakePolyline::GeomToStep_MakePolyline( const TColgp_Array1OfPnt& P,
+                                                  const StepData_Factors& theLocalFactors)
 {
   gp_Pnt P1;
 #include "GeomToStep_MakePolyline_gen.pxx"
@@ -38,7 +40,8 @@ GeomToStep_MakePolyline::GeomToStep_MakePolyline( const TColgp_Array1OfPnt& P)
 // Creation d' une polyline Step a partir d' une Array1OfPnt2d
 //=============================================================================
 
-GeomToStep_MakePolyline::GeomToStep_MakePolyline( const TColgp_Array1OfPnt2d& P)
+GeomToStep_MakePolyline::GeomToStep_MakePolyline( const TColgp_Array1OfPnt2d& P,
+                                                  const StepData_Factors& theLocalFactors)
 {
   gp_Pnt2d P1;
 #include "GeomToStep_MakePolyline_gen.pxx"
index 594c75720bed36f69994a18f315c36874b623f44..80635bf7197abd0139139df29de9d5d9841d49a1 100644 (file)
@@ -24,6 +24,8 @@
 #include <GeomToStep_Root.hxx>
 #include <TColgp_Array1OfPnt.hxx>
 #include <TColgp_Array1OfPnt2d.hxx>
+
+class StepData_Factors;
 class StepGeom_Polyline;
 
 
@@ -36,9 +38,11 @@ public:
   DEFINE_STANDARD_ALLOC
 
   
-  Standard_EXPORT GeomToStep_MakePolyline(const TColgp_Array1OfPnt& P);
+  Standard_EXPORT GeomToStep_MakePolyline(const TColgp_Array1OfPnt& P,
+                                          const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT GeomToStep_MakePolyline(const TColgp_Array1OfPnt2d& P);
+  Standard_EXPORT GeomToStep_MakePolyline(const TColgp_Array1OfPnt2d& P,
+                                          const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const Handle(StepGeom_Polyline)& Value() const;
 
index 48b8d202054afe2120ac0ca49bd759d527f946ab..4b7639ee9584ae6c7a27d58b7b67eebc9b20bb4d 100644 (file)
@@ -22,7 +22,7 @@ Standard_Integer                             N, i;
   aPoints = new StepGeom_HArray1OfCartesianPoint(1,N);
   for (i=P.Lower(); i<=P.Upper(); i++) {
     P1 = P.Value(i);
-    GeomToStep_MakeCartesianPoint MkPoint(P1);
+    GeomToStep_MakeCartesianPoint MkPoint(P1, theLocalFactors.LengthFactor());
     P2 = MkPoint.Value();
     aPoints->SetValue(i,P2);
   }
index fa50eb6314fad90b8326bfc49ddb5a200f5fb480..9c9259f329307ec7a6b2df559929562eb3ae50f1 100644 (file)
@@ -25,7 +25,7 @@
 #include <GeomToStep_MakeRectangularTrimmedSurface.hxx>
 #include <GeomToStep_MakeSurface.hxx>
 #include <StdFail_NotDone.hxx>
-#include <StepData_GlobalFactors.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_RectangularTrimmedSurface.hxx>
 #include <StepGeom_Surface.hxx>
 #include <TCollection_HAsciiString.hxx>
 //=============================================================================
 GeomToStep_MakeRectangularTrimmedSurface::
   GeomToStep_MakeRectangularTrimmedSurface( const
-    Handle(Geom_RectangularTrimmedSurface)& RTSurf )
-                                                                     
+    Handle(Geom_RectangularTrimmedSurface)& RTSurf,
+    const StepData_Factors& theLocalFactors)
 {
 
   Handle(StepGeom_RectangularTrimmedSurface) StepRTS = new StepGeom_RectangularTrimmedSurface;
 
   Handle(TCollection_HAsciiString) aName = new TCollection_HAsciiString("");
 
-  GeomToStep_MakeSurface mkSurf(RTSurf->BasisSurface());
+  GeomToStep_MakeSurface mkSurf(RTSurf->BasisSurface(), theLocalFactors);
   if (!mkSurf.IsDone()) {
     done = Standard_False;
     return;
@@ -61,7 +61,7 @@ GeomToStep_MakeRectangularTrimmedSurface::
   Standard_Real AngleFact = 180./M_PI;
   Standard_Real uFact = 1.;
   Standard_Real vFact = 1.;
-  Standard_Real LengthFact  = StepData_GlobalFactors::Intance().LengthFactor();
+  Standard_Real LengthFact  = theLocalFactors.LengthFactor();
   Handle(Geom_Surface) theSurf = RTSurf->BasisSurface();
   if (theSurf->IsKind(STANDARD_TYPE(Geom_CylindricalSurface))) {
     uFact = AngleFact;
index 646023c5caee8a08927036a0d84d3932e3d51c3a..68832c62d5bfa627ebb41913a400855e27674d51 100644 (file)
@@ -22,6 +22,8 @@
 #include <Standard_Handle.hxx>
 
 #include <GeomToStep_Root.hxx>
+
+class StepData_Factors;
 class StepGeom_RectangularTrimmedSurface;
 class Geom_RectangularTrimmedSurface;
 
@@ -38,7 +40,8 @@ public:
   DEFINE_STANDARD_ALLOC
 
   
-  Standard_EXPORT GeomToStep_MakeRectangularTrimmedSurface(const Handle(Geom_RectangularTrimmedSurface)& RTSurf);
+  Standard_EXPORT GeomToStep_MakeRectangularTrimmedSurface(const Handle(Geom_RectangularTrimmedSurface)& RTSurf,
+                                                           const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const Handle(StepGeom_RectangularTrimmedSurface)& Value() const;
 
index 404b5e4b394e9d3ce15e2ef6a6c7c62e783df36c..73606ac5edb5b85386ae5a78717d9164dc8582ab 100644 (file)
 #include <GeomToStep_MakeAxis2Placement3d.hxx>
 #include <GeomToStep_MakeSphericalSurface.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_Axis2Placement3d.hxx>
 #include <StepGeom_SphericalSurface.hxx>
 #include <TCollection_HAsciiString.hxx>
-#include <StepData_GlobalFactors.hxx>
 
 //=============================================================================
 // Creation d' une conical_surface de prostep a partir d' une SphericalSurface
 // de Geom
 //=============================================================================
 GeomToStep_MakeSphericalSurface::GeomToStep_MakeSphericalSurface
-  ( const Handle(Geom_SphericalSurface)& S )
-       
+  ( const Handle(Geom_SphericalSurface)& S,
+    const StepData_Factors& theLocalFactors)
 {
   Handle(StepGeom_SphericalSurface) Surf;
   Handle(StepGeom_Axis2Placement3d) aPosition;
   Standard_Real aRadius;
   
-  GeomToStep_MakeAxis2Placement3d MkAxis2(S->Position());
+  GeomToStep_MakeAxis2Placement3d MkAxis2(S->Position(), theLocalFactors);
   aPosition = MkAxis2.Value();
   aRadius = S->Radius();
   Surf = new StepGeom_SphericalSurface;
   Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
-  Surf->Init(name, aPosition, aRadius/ StepData_GlobalFactors::Intance().LengthFactor());
+  Surf->Init(name, aPosition, aRadius/ theLocalFactors.LengthFactor());
   theSphericalSurface = Surf;
   done = Standard_True;
 }
index ed534d4b4aa54d0187badbf82a7d020568c95212..9f1697e0008129a0c6d050518399f9884a965616 100644 (file)
@@ -22,6 +22,8 @@
 #include <Standard_Handle.hxx>
 
 #include <GeomToStep_Root.hxx>
+
+class StepData_Factors;
 class StepGeom_SphericalSurface;
 class Geom_SphericalSurface;
 
@@ -37,7 +39,8 @@ public:
   DEFINE_STANDARD_ALLOC
 
   
-  Standard_EXPORT GeomToStep_MakeSphericalSurface(const Handle(Geom_SphericalSurface)& CSurf);
+  Standard_EXPORT GeomToStep_MakeSphericalSurface(const Handle(Geom_SphericalSurface)& CSurf,
+                                                  const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const Handle(StepGeom_SphericalSurface)& Value() const;
 
index 30477d77f6e69ad650170e787f0e70926989f563..63d923250807650b2ac4cf91f345c3bd13c84b32 100644 (file)
 #include <GeomToStep_MakeSweptSurface.hxx>
 #include <StdFail_NotDone.hxx>
 #include <StepData_Logical.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_BoundedSurface.hxx>
 #include <StepGeom_ElementarySurface.hxx>
 #include <StepGeom_OffsetSurface.hxx>
 #include <StepGeom_Surface.hxx>
 #include <StepGeom_SweptSurface.hxx>
 #include <TCollection_HAsciiString.hxx>
-#include <StepData_GlobalFactors.hxx>
 
 //=============================================================================
 // Creation d' une Surface de prostep a partir d' une Surface de Geom
 //=============================================================================
-GeomToStep_MakeSurface::GeomToStep_MakeSurface ( const Handle(Geom_Surface)& S)
+GeomToStep_MakeSurface::GeomToStep_MakeSurface ( const Handle(Geom_Surface)& S,
+                                                 const StepData_Factors& theLocalFactors)
 {
   done = Standard_True;
   if (S->IsKind(STANDARD_TYPE(Geom_BoundedSurface))) {
     Handle(Geom_BoundedSurface) S1 = 
       Handle(Geom_BoundedSurface)::DownCast(S);
-    GeomToStep_MakeBoundedSurface MkBoundedS(S1);
+    GeomToStep_MakeBoundedSurface MkBoundedS(S1, theLocalFactors);
     theSurface = MkBoundedS.Value();
   }
   else if (S->IsKind(STANDARD_TYPE(Geom_ElementarySurface))) {
     Handle(Geom_ElementarySurface) S1 = 
       Handle(Geom_ElementarySurface)::DownCast(S);
-    GeomToStep_MakeElementarySurface MkElementaryS(S1);
+    GeomToStep_MakeElementarySurface MkElementaryS(S1, theLocalFactors);
     theSurface = MkElementaryS.Value();
   }
   else if (S->IsKind(STANDARD_TYPE(Geom_SweptSurface))) {
     Handle(Geom_SweptSurface) S1 = 
       Handle(Geom_SweptSurface)::DownCast(S);
-    GeomToStep_MakeSweptSurface MkSwept(S1);
+    GeomToStep_MakeSweptSurface MkSwept(S1, theLocalFactors);
     theSurface = MkSwept.Value();
   }
   else if (S->IsKind(STANDARD_TYPE(Geom_OffsetSurface))) {
     Handle(Geom_OffsetSurface) S1 =
       Handle(Geom_OffsetSurface)::DownCast(S);
-    GeomToStep_MakeSurface MkBasis(S1->BasisSurface());
+    GeomToStep_MakeSurface MkBasis(S1->BasisSurface(), theLocalFactors);
     done = MkBasis.IsDone();
     if (!done) return;
     Handle(StepGeom_OffsetSurface) Surf = new StepGeom_OffsetSurface;
     Surf->Init (new TCollection_HAsciiString(""),
-                    MkBasis.Value(),S1->Offset()/ StepData_GlobalFactors::Intance().LengthFactor(),StepData_LFalse);
+                    MkBasis.Value(),S1->Offset()/ theLocalFactors.LengthFactor(),StepData_LFalse);
     theSurface = Surf;
   }
   else {
index 52b36eee6d28350e7e544117597f2ba1148cec24..7ff59b185863b94cdf64f560a4ac44c3b6564083 100644 (file)
@@ -22,6 +22,8 @@
 #include <Standard_Handle.hxx>
 
 #include <GeomToStep_Root.hxx>
+
+class StepData_Factors;
 class StepGeom_Surface;
 class Geom_Surface;
 
@@ -37,7 +39,8 @@ public:
   DEFINE_STANDARD_ALLOC
 
   
-  Standard_EXPORT GeomToStep_MakeSurface(const Handle(Geom_Surface)& C);
+  Standard_EXPORT GeomToStep_MakeSurface(const Handle(Geom_Surface)& C,
+                                         const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const Handle(StepGeom_Surface)& Value() const;
 
index 2a33ec167b5d270f33b4cd206953f4a815ca2ae9..f6fad7cdd7022e8253762faaa7de71e2d252310d 100644 (file)
@@ -21,6 +21,7 @@
 #include <GeomToStep_MakeVector.hxx>
 #include <gp_Vec.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_Curve.hxx>
 #include <StepGeom_SurfaceOfLinearExtrusion.hxx>
 #include <StepGeom_Vector.hxx>
 // SurfaceOfLinearExtrusion de Geom
 //=============================================================================
 GeomToStep_MakeSurfaceOfLinearExtrusion::GeomToStep_MakeSurfaceOfLinearExtrusion
-  ( const Handle(Geom_SurfaceOfLinearExtrusion)& S )
-       
+  ( const Handle(Geom_SurfaceOfLinearExtrusion)& S,
+    const StepData_Factors& theLocalFactors)
 {
   Handle(StepGeom_SurfaceOfLinearExtrusion) Surf;
   Handle(StepGeom_Curve) aSweptCurve;
   Handle(StepGeom_Vector) aExtrusionAxis;
   
-  GeomToStep_MakeCurve MkCurve(S->BasisCurve());
-  GeomToStep_MakeVector MkVector(gp_Vec(S->Direction()));
+  GeomToStep_MakeCurve MkCurve(S->BasisCurve(), theLocalFactors);
+  GeomToStep_MakeVector MkVector(gp_Vec(S->Direction()), theLocalFactors);
 
   aSweptCurve = MkCurve.Value();
   aExtrusionAxis = MkVector.Value();
index c2a7c9e8f7bafdef09ba7bf3c292a70d55a9e95b..85774c5032f0dfed9ff31b69506564d242a6a99a 100644 (file)
@@ -22,6 +22,8 @@
 #include <Standard_Handle.hxx>
 
 #include <GeomToStep_Root.hxx>
+
+class StepData_Factors;
 class StepGeom_SurfaceOfLinearExtrusion;
 class Geom_SurfaceOfLinearExtrusion;
 
@@ -37,7 +39,8 @@ public:
   DEFINE_STANDARD_ALLOC
 
   
-  Standard_EXPORT GeomToStep_MakeSurfaceOfLinearExtrusion(const Handle(Geom_SurfaceOfLinearExtrusion)& CSurf);
+  Standard_EXPORT GeomToStep_MakeSurfaceOfLinearExtrusion(const Handle(Geom_SurfaceOfLinearExtrusion)& CSurf,
+                                                          const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const Handle(StepGeom_SurfaceOfLinearExtrusion)& Value() const;
 
index 8f8bc1d59f08a036de9fd33ffd6f391102c47bd6..e8ab246328395679b40be9c2acfa992bb652c6f6 100644 (file)
@@ -20,6 +20,7 @@
 #include <GeomToStep_MakeCurve.hxx>
 #include <GeomToStep_MakeSurfaceOfRevolution.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_Axis1Placement.hxx>
 #include <StepGeom_Curve.hxx>
 #include <StepGeom_SurfaceOfRevolution.hxx>
 // SurfaceOfRevolution de Geom
 //=============================================================================
 GeomToStep_MakeSurfaceOfRevolution::GeomToStep_MakeSurfaceOfRevolution
-  ( const Handle(Geom_SurfaceOfRevolution)& S )
-       
+  ( const Handle(Geom_SurfaceOfRevolution)& S,
+    const StepData_Factors& theLocalFactors)
 {
   Handle(StepGeom_SurfaceOfRevolution) Surf;
   Handle(StepGeom_Curve) aSweptCurve;
   Handle(StepGeom_Axis1Placement) aAxisPosition;
   
-  GeomToStep_MakeCurve MkSwept(S->BasisCurve());
-  GeomToStep_MakeAxis1Placement MkAxis1(S->Axis());
+  GeomToStep_MakeCurve MkSwept(S->BasisCurve(), theLocalFactors);
+  GeomToStep_MakeAxis1Placement MkAxis1(S->Axis(), theLocalFactors);
   aSweptCurve = MkSwept.Value();
   aAxisPosition = MkAxis1.Value();
   Surf = new StepGeom_SurfaceOfRevolution;
index 4790ef0eb799ae51f7f7e8117e3b9a0fe65f4d89..2caa134addb1d87021fe1e264e1fdb2c6b80a5e9 100644 (file)
@@ -22,6 +22,8 @@
 #include <Standard_Handle.hxx>
 
 #include <GeomToStep_Root.hxx>
+
+class StepData_Factors;
 class StepGeom_SurfaceOfRevolution;
 class Geom_SurfaceOfRevolution;
 
@@ -37,7 +39,8 @@ public:
   DEFINE_STANDARD_ALLOC
 
   
-  Standard_EXPORT GeomToStep_MakeSurfaceOfRevolution(const Handle(Geom_SurfaceOfRevolution)& RevSurf);
+  Standard_EXPORT GeomToStep_MakeSurfaceOfRevolution(const Handle(Geom_SurfaceOfRevolution)& RevSurf,
+                                                     const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const Handle(StepGeom_SurfaceOfRevolution)& Value() const;
 
index 20207243059f5a4bb92b5dec16623441c9c87d61..f1fde84ce9c3c3652b741795c61d26459b5c30bf 100644 (file)
@@ -22,6 +22,7 @@
 #include <GeomToStep_MakeSurfaceOfRevolution.hxx>
 #include <GeomToStep_MakeSweptSurface.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_SurfaceOfLinearExtrusion.hxx>
 #include <StepGeom_SurfaceOfRevolution.hxx>
 #include <StepGeom_SweptSurface.hxx>
 // SweptSurface de Geom
 //=============================================================================
 GeomToStep_MakeSweptSurface::GeomToStep_MakeSweptSurface
-  ( const Handle(Geom_SweptSurface)& S)
+  ( const Handle(Geom_SweptSurface)& S,
+    const StepData_Factors& theLocalFactors)
 {
   done = Standard_True;
   if (S->IsKind(STANDARD_TYPE(Geom_SurfaceOfLinearExtrusion))) {
     Handle(Geom_SurfaceOfLinearExtrusion) Sur = 
       Handle(Geom_SurfaceOfLinearExtrusion)::DownCast(S);
-    GeomToStep_MakeSurfaceOfLinearExtrusion MkLinear(Sur);
+    GeomToStep_MakeSurfaceOfLinearExtrusion MkLinear(Sur, theLocalFactors);
     theSweptSurface = MkLinear.Value();
   }
   else if (S->IsKind(STANDARD_TYPE(Geom_SurfaceOfRevolution))) {
     Handle(Geom_SurfaceOfRevolution) Sur = 
       Handle(Geom_SurfaceOfRevolution)::DownCast(S);
-    GeomToStep_MakeSurfaceOfRevolution MkRevol(Sur);
+    GeomToStep_MakeSurfaceOfRevolution MkRevol(Sur, theLocalFactors);
     theSweptSurface = MkRevol.Value();
   }
   else
index c00d636f189269b1f14a7bee1bec4134cbd22595..4406e140f1350dfb820eab9f1621ce97ce76ffaf 100644 (file)
@@ -22,6 +22,8 @@
 #include <Standard_Handle.hxx>
 
 #include <GeomToStep_Root.hxx>
+
+class StepData_Factors;
 class StepGeom_SweptSurface;
 class Geom_SweptSurface;
 
@@ -38,7 +40,8 @@ public:
   DEFINE_STANDARD_ALLOC
 
   
-  Standard_EXPORT GeomToStep_MakeSweptSurface(const Handle(Geom_SweptSurface)& S);
+  Standard_EXPORT GeomToStep_MakeSweptSurface(const Handle(Geom_SweptSurface)& S,
+                                              const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const Handle(StepGeom_SweptSurface)& Value() const;
 
index 08d6466e9870202bb082eb19fe04131e7df70a97..37754db1ee62a5edb454a3dc2798382c8f630938 100644 (file)
 #include <GeomToStep_MakeAxis2Placement3d.hxx>
 #include <GeomToStep_MakeToroidalSurface.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_ToroidalSurface.hxx>
 #include <TCollection_HAsciiString.hxx>
-#include <StepData_GlobalFactors.hxx>
 
 //=============================================================================
 // Creation d' une toroidal_surface de prostep a partir d' une ToroidalSurface
 // de Geom
 //=============================================================================
 GeomToStep_MakeToroidalSurface::GeomToStep_MakeToroidalSurface
-  ( const Handle(Geom_ToroidalSurface)& S )
-       
+  ( const Handle(Geom_ToroidalSurface)& S,
+    const StepData_Factors& theLocalFactors)
 {
   Handle(StepGeom_ToroidalSurface) Surf;
   Handle(StepGeom_Axis2Placement3d) aPosition;
   Standard_Real aMajorRadius, aMinorRadius;
   
-  GeomToStep_MakeAxis2Placement3d MkAxis2(S->Position());
+  GeomToStep_MakeAxis2Placement3d MkAxis2(S->Position(), theLocalFactors);
   aPosition = MkAxis2.Value();
   aMajorRadius = S->MajorRadius();
   aMinorRadius = S->MinorRadius();
   Surf = new StepGeom_ToroidalSurface;
   Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("");
-  Standard_Real fact = StepData_GlobalFactors::Intance().LengthFactor();
+  Standard_Real fact = theLocalFactors.LengthFactor();
   Surf->Init(name, aPosition, aMajorRadius/fact, aMinorRadius/fact);
   theToroidalSurface = Surf;
   done = Standard_True;
index ff77f4315ebe570991320e90cd55edb43635a7a8..386ec139ef60b0e04815cd85cb84d664b6f92593 100644 (file)
@@ -22,6 +22,8 @@
 #include <Standard_Handle.hxx>
 
 #include <GeomToStep_Root.hxx>
+
+class StepData_Factors;
 class StepGeom_ToroidalSurface;
 class Geom_ToroidalSurface;
 
@@ -37,7 +39,8 @@ public:
   DEFINE_STANDARD_ALLOC
 
   
-  Standard_EXPORT GeomToStep_MakeToroidalSurface(const Handle(Geom_ToroidalSurface)& TorSurf);
+  Standard_EXPORT GeomToStep_MakeToroidalSurface(const Handle(Geom_ToroidalSurface)& TorSurf,
+                                                 const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const Handle(StepGeom_ToroidalSurface)& Value() const;
 
index 85729b167eae0e65974c784f21222b97fc79d370..db91850f6572a51d700126142f19f8a2444a8d9c 100644 (file)
 #include <gp_Vec.hxx>
 #include <gp_Vec2d.hxx>
 #include <StdFail_NotDone.hxx>
-#include <StepData_GlobalFactors.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_Vector.hxx>
 #include <TCollection_HAsciiString.hxx>
 
 //=============================================================================
 // Creation d' un vector de prostep a partir d' un Vec de gp
 //=============================================================================
-GeomToStep_MakeVector::GeomToStep_MakeVector( const gp_Vec& V)
+GeomToStep_MakeVector::GeomToStep_MakeVector( const gp_Vec& V,
+                                              const StepData_Factors& theLocalFactors)
 {
   gp_Dir D = gp_Dir(V);
-  Standard_Real lFactor = StepData_GlobalFactors::Intance().LengthFactor();
+  Standard_Real lFactor = theLocalFactors.LengthFactor();
 #include "GeomToStep_MakeVector_gen.pxx"
 }
 //=============================================================================
 // Creation d' un vector de prostep a partir d' un Vec2d de gp
 //=============================================================================
 
-GeomToStep_MakeVector::GeomToStep_MakeVector( const gp_Vec2d& V)
+GeomToStep_MakeVector::GeomToStep_MakeVector( const gp_Vec2d& V,
+                                              const StepData_Factors& theLocalFactors)
 {
+  (void)theLocalFactors;
   gp_Dir2d D = gp_Dir2d(V);
   Standard_Real lFactor = 1.;
 #include "GeomToStep_MakeVector_gen.pxx"
@@ -52,13 +55,13 @@ GeomToStep_MakeVector::GeomToStep_MakeVector( const gp_Vec2d& V)
 // Creation d' un vector de prostep a partir d' un Vector de Geom
 //=============================================================================
 
-GeomToStep_MakeVector::GeomToStep_MakeVector ( const Handle(Geom_Vector)&
-                                           GVector)
+GeomToStep_MakeVector::GeomToStep_MakeVector ( const Handle(Geom_Vector)& GVector,
+                                               const StepData_Factors& theLocalFactors)
 {
   gp_Vec V;
   V = GVector->Vec();
   gp_Dir D = gp_Dir(V);
-  Standard_Real lFactor = StepData_GlobalFactors::Intance().LengthFactor();
+  Standard_Real lFactor = theLocalFactors.LengthFactor();
 #include "GeomToStep_MakeVector_gen.pxx"
 }
 
@@ -66,9 +69,10 @@ GeomToStep_MakeVector::GeomToStep_MakeVector ( const Handle(Geom_Vector)&
 // Creation d' un vector de prostep a partir d' un Vector de Geom2d
 //=============================================================================
 
-GeomToStep_MakeVector::GeomToStep_MakeVector ( const Handle(Geom2d_Vector)&
-                                           GVector)
+GeomToStep_MakeVector::GeomToStep_MakeVector ( const Handle(Geom2d_Vector)& GVector,
+                                               const StepData_Factors& theLocalFactors)
 {
+  (void)theLocalFactors;
   gp_Vec2d V;
   V = GVector->Vec2d();
   gp_Dir2d D = gp_Dir2d(V);
index 52f09ad3f21578d605a8dc92826bfc540a63389c..286e0107cdd60ac6dec460cbd8bf378927ba2db8 100644 (file)
@@ -22,6 +22,8 @@
 #include <Standard_Handle.hxx>
 
 #include <GeomToStep_Root.hxx>
+
+class StepData_Factors;
 class StepGeom_Vector;
 class gp_Vec;
 class gp_Vec2d;
@@ -40,13 +42,17 @@ public:
   DEFINE_STANDARD_ALLOC
 
   
-  Standard_EXPORT GeomToStep_MakeVector(const gp_Vec& V);
+  Standard_EXPORT GeomToStep_MakeVector(const gp_Vec& V,
+                                        const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT GeomToStep_MakeVector(const gp_Vec2d& V);
+  Standard_EXPORT GeomToStep_MakeVector(const gp_Vec2d& V,
+                                        const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT GeomToStep_MakeVector(const Handle(Geom_Vector)& V);
+  Standard_EXPORT GeomToStep_MakeVector(const Handle(Geom_Vector)& V,
+                                        const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT GeomToStep_MakeVector(const Handle(Geom2d_Vector)& V);
+  Standard_EXPORT GeomToStep_MakeVector(const Handle(Geom2d_Vector)& V,
+                                        const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const Handle(StepGeom_Vector)& Value() const;
 
index 1b5d41463a4cf11e73d8ef59606e6c6003e43cad..094a1d014ff24f0d5badb90d02d46b2c0f6f644d 100644 (file)
@@ -39,9 +39,13 @@ STEPCAFControl_Controller::STEPCAFControl_Controller ()
 
 Standard_Boolean STEPCAFControl_Controller::Init ()
 {
-  static Standard_Boolean inic = Standard_False;
-  if (inic) return Standard_True;
-  inic = Standard_True;
+  static Standard_Mutex theMutex;
+  {
+    Standard_Mutex::Sentry aSentry(theMutex);
+    static Standard_Boolean inic = Standard_False;
+    if (inic) return Standard_True;
+    inic = Standard_True;
+  }
   // self-registering
   Handle(STEPCAFControl_Controller) STEPCTL = new STEPCAFControl_Controller;
   // do XSAlgo::Init, cause it does not called before.
index 1460a6a8d0ef51bed1563e5b2120a7f37e5d4514..3b843cb5066acf85ed67a0c7a59c4188adde86f6 100644 (file)
@@ -40,7 +40,6 @@
 #include <StepBasic_ProductDefinitionFormation.hxx>
 #include <StepBasic_ProductDefinitionWithAssociatedDocuments.hxx>
 #include <StepBasic_SiUnitAndLengthUnit.hxx>
-#include <StepData_GlobalFactors.hxx>
 #include <STEPCAFControl_Controller.hxx>
 #include <STEPCAFControl_DataMapOfPDExternFile.hxx>
 #include <STEPCAFControl_DataMapOfShapePD.hxx>
@@ -55,6 +54,7 @@
 #include <STEPControl_Reader.hxx>
 #include <StepGeom_Axis2Placement3d.hxx>
 #include <StepGeom_Direction.hxx>
+#include <StepData_Factors.hxx>
 #include <StepDimTol_AngularityTolerance.hxx>
 #include <StepDimTol_CircularRunoutTolerance.hxx>
 #include <StepDimTol_CoaxialityTolerance.hxx>
@@ -499,7 +499,8 @@ static void FillShapesMap(const TopoDS_Shape &S, TopTools_MapOfShape &map)
 //purpose  :
 //=======================================================================
 void STEPCAFControl_Reader::prepareUnits(const Handle(StepData_StepModel)& theModel,
-                                         const Handle(TDocStd_Document)& theDoc) const
+                                         const Handle(TDocStd_Document)& theDoc,
+                                         StepData_Factors& theLocalFactors) const
 {
   Standard_Real aScaleFactorMM = 1.;
   if (!XCAFDoc_DocumentTool::GetLengthUnit(theDoc, aScaleFactorMM, UnitsMethods_LengthUnit_Millimeter))
@@ -509,6 +510,7 @@ void STEPCAFControl_Reader::prepareUnits(const Handle(StepData_StepModel)& theMo
     // Sets length unit to the document
     XCAFDoc_DocumentTool::SetLengthUnit(theDoc, aScaleFactorMM, UnitsMethods_LengthUnit_Millimeter);
   }
+  theLocalFactors.SetCascadeUnit(aScaleFactorMM);
   theModel->SetLocalLengthUnit(aScaleFactorMM);
 }
 
@@ -526,7 +528,8 @@ Standard_Boolean STEPCAFControl_Reader::Transfer (STEPControl_Reader &reader,
 {
   reader.ClearShapes();
   Handle(StepData_StepModel) aModel = Handle(StepData_StepModel)::DownCast(reader.Model());
-  prepareUnits(aModel, doc);
+  StepData_Factors aLocalFactors;
+  prepareUnits(aModel, doc, aLocalFactors);
   Standard_Integer i;
 
   // Read all shapes
@@ -692,7 +695,7 @@ Standard_Boolean STEPCAFControl_Reader::Transfer (STEPControl_Reader &reader,
 
   // read colors
   if (GetColorMode())
-    ReadColors(reader.WS(), doc);
+    ReadColors(reader.WS(), doc, aLocalFactors);
 
   // read names
   if (GetNameMode())
@@ -700,7 +703,7 @@ Standard_Boolean STEPCAFControl_Reader::Transfer (STEPControl_Reader &reader,
 
   // read validation props
   if (GetPropsMode())
-    ReadValProps(reader.WS(), doc, PDFileMap);
+    ReadValProps(reader.WS(), doc, PDFileMap, aLocalFactors);
 
   // read layers
   if (GetLayerMode())
@@ -712,15 +715,15 @@ Standard_Boolean STEPCAFControl_Reader::Transfer (STEPControl_Reader &reader,
 
   // read GDT entities from STEP model
   if (GetGDTMode())
-    ReadGDTs(reader.WS(), doc);
+    ReadGDTs(reader.WS(), doc, aLocalFactors);
 
   // read Material entities from STEP model
   if (GetMatMode())
-    ReadMaterials(reader.WS(), doc, SeqPDS);
+    ReadMaterials(reader.WS(), doc, SeqPDS, aLocalFactors);
 
   // read View entities from STEP model
   if (GetViewMode())
-    ReadViews(reader.WS(), doc);
+    ReadViews(reader.WS(), doc, aLocalFactors);
 
   // Expand resulting CAF structure for sub-shapes (optionally with their
   // names) if requested
@@ -950,7 +953,8 @@ static void propagateColorToParts(const Handle(XCAFDoc_ShapeTool)& theSTool,
 static void SetAssemblyComponentStyle(const Handle(Transfer_TransientProcess) &theTP,
                                       const Handle(XCAFDoc_ColorTool)& theCTool, 
                                       const STEPConstruct_Styles& theStyles,
-                                      const Handle(StepVisual_ContextDependentOverRidingStyledItem)& theStyle)
+                                      const Handle(StepVisual_ContextDependentOverRidingStyledItem)& theStyle,
+                                      const StepData_Factors& theLocalFactors)
 {
   if (theStyle.IsNull()) return;
 
@@ -1004,8 +1008,8 @@ static void SetAssemblyComponentStyle(const Handle(Transfer_TransientProcess) &t
 
       if(!anAxp1.IsNull() && !anAxp2.IsNull())
       {
-        Handle(Geom_Axis2Placement) anOrig = StepToGeom::MakeAxis2Placement (anAxp1);
-        Handle(Geom_Axis2Placement) aTarg = StepToGeom::MakeAxis2Placement (anAxp2);
+        Handle(Geom_Axis2Placement) anOrig = StepToGeom::MakeAxis2Placement (anAxp1, theLocalFactors);
+        Handle(Geom_Axis2Placement) aTarg = StepToGeom::MakeAxis2Placement (anAxp2, theLocalFactors);
         gp_Ax3 anAx3Orig(anOrig->Ax2());
         gp_Ax3 anAx3Targ(aTarg->Ax2());
 
@@ -1056,17 +1060,18 @@ static void SetStyle(const Handle(XSControl_WorkSession) &theWS,
                      const Handle(XCAFDoc_ShapeTool)& theSTool, 
                      const STEPConstruct_Styles& theStyles, 
                      const Handle(TColStd_HSequenceOfTransient)& theHSeqOfInvisStyle, 
-                     const Handle(StepVisual_StyledItem)& theStyle)
+                     const Handle(StepVisual_StyledItem)& theStyle,
+                     const StepData_Factors& theLocalFactors)
 {
   if (theStyle.IsNull()) return;
 
   const Handle(Transfer_TransientProcess) &aTP = theWS->TransferReader()->TransientProcess();
   if (Handle(StepVisual_OverRidingStyledItem) anOverridingStyle = Handle(StepVisual_OverRidingStyledItem)::DownCast (theStyle))
   {
-    SetStyle (theWS, theMap, theCTool, theSTool, theStyles, theHSeqOfInvisStyle, anOverridingStyle->OverRiddenStyle ());
+    SetStyle (theWS, theMap, theCTool, theSTool, theStyles, theHSeqOfInvisStyle, anOverridingStyle->OverRiddenStyle (), theLocalFactors);
     if (Handle(StepVisual_ContextDependentOverRidingStyledItem) anAssemblyComponentStyle = Handle(StepVisual_ContextDependentOverRidingStyledItem)::DownCast (theStyle))
     {
-      SetAssemblyComponentStyle (aTP, theCTool, theStyles,anAssemblyComponentStyle);
+      SetAssemblyComponentStyle (aTP, theCTool, theStyles,anAssemblyComponentStyle, theLocalFactors);
       return;
     }
   }
@@ -1247,7 +1252,8 @@ static Standard_Boolean IsOverriden(const Interface_Graph& theGraph,
 //=======================================================================
 
 Standard_Boolean STEPCAFControl_Reader::ReadColors(const Handle(XSControl_WorkSession) &WS,
-  const Handle(TDocStd_Document)& Doc) const
+                                                   const Handle(TDocStd_Document)& Doc,
+                                                   const StepData_Factors& theLocalFactors) const
 {
   STEPConstruct_Styles Styles(WS);
   if (!Styles.LoadStyles()) {
@@ -1278,7 +1284,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadColors(const Handle(XSControl_WorkSe
     // check that style is overridden by other root style
     if (!IsOverriden (aGraph, Style, anIsRootStyle))
     {
-      SetStyle (WS, myMap, CTool, STool, Styles, aHSeqOfInvisStyle, Style);
+      SetStyle (WS, myMap, CTool, STool, Styles, aHSeqOfInvisStyle, Style, theLocalFactors);
     }
   }
 
@@ -1291,7 +1297,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadColors(const Handle(XSControl_WorkSe
     // check that style is overridden
     if (!IsOverriden (aGraph, Style, anIsRootStyle))
     {
-      SetStyle (WS, myMap, CTool, STool, Styles, aHSeqOfInvisStyle, Style);
+      SetStyle (WS, myMap, CTool, STool, Styles, aHSeqOfInvisStyle, Style, theLocalFactors);
     }
   }
   
@@ -1490,7 +1496,8 @@ static TDF_Label GetLabelFromPD(const Handle(StepBasic_ProductDefinition) &PD,
 
 Standard_Boolean STEPCAFControl_Reader::ReadValProps(const Handle(XSControl_WorkSession) &WS,
                                                      const Handle(TDocStd_Document)& Doc,
-                                                     const STEPCAFControl_DataMapOfPDExternFile& PDFileMap) const
+                                                     const STEPCAFControl_DataMapOfPDExternFile& PDFileMap,
+                                                     const StepData_Factors& theLocalFactors) const
 {
   // get starting data
   const Handle(XSControl_TransferReader) &TR = WS->TransferReader();
@@ -1603,11 +1610,11 @@ Standard_Boolean STEPCAFControl_Reader::ReadValProps(const Handle(XSControl_Work
       Standard_Boolean isArea;
       Standard_Real val;
       gp_Pnt pos;
-      if (Props.GetPropReal(ent, val, isArea)) {
+      if (Props.GetPropReal(ent, val, isArea, theLocalFactors)) {
         if (isArea) XCAFDoc_Area::Set(L, val);
         else XCAFDoc_Volume::Set(L, val);
       }
-      else if (Props.GetPropPnt(ent, rep->ContextOfItems(), pos)) {
+      else if (Props.GetPropPnt(ent, rep->ContextOfItems(), pos, theLocalFactors)) {
         XCAFDoc_Centroid::Set(L, pos);
       }
     }
@@ -1938,7 +1945,8 @@ Standard_Boolean readPMIPresentation(const Handle(Standard_Transient)& thePresen
   const Standard_Real theFact,
   TopoDS_Shape& thePresentation,
   Handle(TCollection_HAsciiString)& thePresentName,
-  Bnd_Box& theBox)
+  Bnd_Box& theBox,
+  const StepData_Factors& theLocalFactors)
 {
   if (thePresentEntity.IsNull())
     return Standard_False;
@@ -2014,7 +2022,7 @@ Standard_Boolean readPMIPresentation(const Handle(Standard_Transient)& thePresen
       {
         Handle(StepVisual_RepositionedTessellatedGeometricSet) aRTGS =
           Handle(StepVisual_RepositionedTessellatedGeometricSet)::DownCast(aTessSet);
-        Handle(Geom_Axis2Placement) aLocation = StepToGeom::MakeAxis2Placement(aRTGS->Location());
+        Handle(Geom_Axis2Placement) aLocation = StepToGeom::MakeAxis2Placement(aRTGS->Location(), theLocalFactors);
         if (!aLocation.IsNull())
         {
           const gp_Ax3 anAx3Orig = gp::XOY();
@@ -2094,7 +2102,8 @@ Standard_Boolean readPMIPresentation(const Handle(Standard_Transient)& thePresen
 //purpose  : read annotation plane
 //=======================================================================
 Standard_Boolean readAnnotationPlane(const Handle(StepVisual_AnnotationPlane)& theAnnotationPlane,
-  gp_Ax2& thePlane)
+                                     gp_Ax2& thePlane,
+                                     const StepData_Factors& theLocalFactors)
 {
   if (theAnnotationPlane.IsNull())
     return Standard_False;
@@ -2114,7 +2123,7 @@ Standard_Boolean readAnnotationPlane(const Handle(StepVisual_AnnotationPlane)& t
   if (aA2P3D.IsNull())
     return Standard_False;
 
-  Handle(Geom_Axis2Placement) anAxis = StepToGeom::MakeAxis2Placement(aA2P3D);
+  Handle(Geom_Axis2Placement) anAxis = StepToGeom::MakeAxis2Placement(aA2P3D, theLocalFactors);
   thePlane = anAxis->Ax2();
   return Standard_True;
 }
@@ -2126,7 +2135,8 @@ Standard_Boolean readAnnotationPlane(const Handle(StepVisual_AnnotationPlane)& t
 //=======================================================================
 void readAnnotation(const Handle(XSControl_TransferReader)& theTR,
   const Handle(Standard_Transient)& theGDT,
-  const Handle(Standard_Transient)& theDimObject)
+  const Handle(Standard_Transient)& theDimObject,
+  const StepData_Factors& theLocalFactors)
 {
   if (theGDT.IsNull() || theDimObject.IsNull())
     return;
@@ -2155,8 +2165,9 @@ void readAnnotation(const Handle(XSControl_TransferReader)& theTR,
     Handle(StepVisual_DraughtingModel)::DownCast(aDMIA->UsedRepresentation());
   XSAlgo::AlgoContainer()->PrepareForTransfer();
   STEPControl_ActorRead anActor;
-  anActor.PrepareUnits(aDModel, aTP);
-  Standard_Real aFact = StepData_GlobalFactors::Intance().LengthFactor();
+  StepData_Factors aLocalFactors = theLocalFactors;
+  anActor.PrepareUnits(aDModel, aTP, aLocalFactors);
+  Standard_Real aFact = aLocalFactors.LengthFactor();
 
   // retrieve AnnotationPlane
   Handle(StepRepr_RepresentationItem) aDMIAE = aDMIA->IdentifiedItemValue(1);
@@ -2168,7 +2179,7 @@ void readAnnotation(const Handle(XSControl_TransferReader)& theTR,
   for (subs.Start(); subs.More() && anAnPlane.IsNull(); subs.Next()) {
     anAnPlane = Handle(StepVisual_AnnotationPlane)::DownCast(subs.Value());
   }
-  Standard_Boolean isHasPlane = readAnnotationPlane(anAnPlane, aPlaneAxes);
+  Standard_Boolean isHasPlane = readAnnotationPlane(anAnPlane, aPlaneAxes, aLocalFactors);
 
   // set plane axes to XCAF
   if (isHasPlane) {
@@ -2192,7 +2203,7 @@ void readAnnotation(const Handle(XSControl_TransferReader)& theTR,
 
   // Retrieve presentation
   Bnd_Box aBox;
-  if (!readPMIPresentation(aDMIAE, theTR, aFact, aResAnnotation, aPresentName, aBox))
+  if (!readPMIPresentation(aDMIAE, theTR, aFact, aResAnnotation, aPresentName, aBox, aLocalFactors))
     return;
   gp_Pnt aPtext(0., 0., 0.);
   // if Annotation plane location inside bounding box set it to text position
@@ -2240,7 +2251,8 @@ void readAnnotation(const Handle(XSControl_TransferReader)& theTR,
 //=======================================================================
 void readConnectionPoints(const Handle(XSControl_TransferReader)& theTR,
   const Handle(Standard_Transient)& theGDT,
-  const Handle(XCAFDimTolObjects_DimensionObject)& theDimObject)
+  const Handle(XCAFDimTolObjects_DimensionObject)& theDimObject,
+  const StepData_Factors& theLocalFactors)
 {
   if (theGDT.IsNull() || theDimObject.IsNull())
     return;
@@ -2262,8 +2274,9 @@ void readConnectionPoints(const Handle(XSControl_TransferReader)& theTR,
   {
     XSAlgo::AlgoContainer()->PrepareForTransfer();
     STEPControl_ActorRead anActor;
-    anActor.PrepareUnits(aSDR, aTP);
-    aFact = StepData_GlobalFactors::Intance().LengthFactor();
+    StepData_Factors aLocalFactors = theLocalFactors;
+    anActor.PrepareUnits(aSDR, aTP, aLocalFactors);
+    aFact = aLocalFactors.LengthFactor();
   }
   
   if (theGDT->IsKind(STANDARD_TYPE(StepShape_DimensionalSize))) {
@@ -2518,7 +2531,8 @@ Standard_Boolean STEPCAFControl_Reader::setDatumToXCAF(const Handle(StepDimTol_D
   const XCAFDimTolObjects_DatumModifWithValue theXCAFModifWithVal,
   const Standard_Real theModifValue,
   const Handle(TDocStd_Document)& theDoc,
-  const Handle(XSControl_WorkSession)& theWS)
+  const Handle(XSControl_WorkSession)& theWS,
+  const StepData_Factors& theLocalFactors)
 {
   Handle(XCAFDoc_ShapeTool) aSTool = XCAFDoc_DocumentTool::ShapeTool(theDoc->Main());
   Handle(XCAFDoc_DimTolTool) aDGTTool = XCAFDoc_DocumentTool::DimTolTool(theDoc->Main());
@@ -2539,7 +2553,7 @@ Standard_Boolean STEPCAFControl_Reader::setDatumToXCAF(const Handle(StepDimTol_D
     collectShapeAspect(aSAR->RelatingShapeAspect(), theWS, aSAs);
     Handle(StepDimTol_DatumFeature) aDF = Handle(StepDimTol_DatumFeature)::DownCast(aSAR->RelatingShapeAspect());
     if (!aSAR->RelatingShapeAspect()->IsKind(STANDARD_TYPE(StepDimTol_DatumTarget)))
-      readAnnotation(aTR, aSAR->RelatingShapeAspect(), aDatObj);
+      readAnnotation(aTR, aSAR->RelatingShapeAspect(), aDatObj, theLocalFactors);
   }
 
   // Collect shape labels
@@ -2673,8 +2687,9 @@ Standard_Boolean STEPCAFControl_Reader::setDatumToXCAF(const Handle(StepDimTol_D
                   = Handle(StepGeom_Axis2Placement3d)::DownCast(aSRWP->ItemsValue(j));
                 XSAlgo::AlgoContainer()->PrepareForTransfer();
                 STEPControl_ActorRead anActor;
-                anActor.PrepareUnits(aSRWP, aTP);
-                Handle(Geom_Axis2Placement) anAxis = StepToGeom::MakeAxis2Placement(anAx);
+                StepData_Factors aLocalFactors = theLocalFactors;
+                anActor.PrepareUnits(aSRWP, aTP, aLocalFactors);
+                Handle(Geom_Axis2Placement) anAxis = StepToGeom::MakeAxis2Placement(anAx, aLocalFactors);
                 aDatTargetObj->SetDatumTargetAxis(anAxis->Ax2());
               }
               else if (aSRWP->ItemsValue(j)->IsKind(STANDARD_TYPE(StepRepr_ReprItemAndLengthMeasureWithUnit)))
@@ -2689,7 +2704,7 @@ Standard_Boolean STEPCAFControl_Reader::setDatumToXCAF(const Handle(StepDimTol_D
                 if (aNU.IsNull())
                   continue;
                 STEPConstruct_UnitContext anUnitCtx;
-                anUnitCtx.ComputeFactors(aNU);
+                anUnitCtx.ComputeFactors(aNU, theLocalFactors);
                 aVal = aVal * anUnitCtx.LengthFactor();
                 if (aM->Name()->String().IsEqual("target length") ||
                   aM->Name()->String().IsEqual("target diameter"))
@@ -2719,7 +2734,7 @@ Standard_Boolean STEPCAFControl_Reader::setDatumToXCAF(const Handle(StepDimTol_D
       aDGTTool->SetDatumToGeomTol(aDatL, theGDTL);
       aDatTargetObj->IsDatumTarget(Standard_True);
       aDatTargetObj->SetDatumTargetNumber(aDT->TargetId()->IntegerValue());
-      readAnnotation(aTR, aDT, aDatTargetObj);
+      readAnnotation(aTR, aDT, aDatTargetObj, theLocalFactors);
       aDat->SetObject(aDatTargetObj);
       isExistDatumTarget = Standard_True;
     }
@@ -2748,7 +2763,7 @@ Standard_Boolean STEPCAFControl_Reader::setDatumToXCAF(const Handle(StepDimTol_D
     aDGTTool->SetDatumToGeomTol(aDatL, theGDTL);
     if (aDatObj->GetPresentation().IsNull()) {
       // Try find annotation connected to datum entity (not right case, according recommended practices)
-      readAnnotation(aTR, theDat, aDatObj);
+      readAnnotation(aTR, theDat, aDatObj, theLocalFactors);
     }
     aDat->SetObject(aDatObj);
   }
@@ -2764,7 +2779,8 @@ Standard_Boolean STEPCAFControl_Reader::setDatumToXCAF(const Handle(StepDimTol_D
 Standard_Boolean STEPCAFControl_Reader::readDatumsAP242(const Handle(Standard_Transient)& theEnt,
   const TDF_Label theGDTL,
   const Handle(TDocStd_Document)& theDoc,
-  const Handle(XSControl_WorkSession)& theWS)
+  const Handle(XSControl_WorkSession)& theWS,
+  const StepData_Factors& theLocalFactors)
 {
   const Handle(XSControl_TransferReader) &aTR = theWS->TransferReader();
   const Handle(Transfer_TransientProcess) &aTP = aTR->TransientProcess();
@@ -2845,7 +2861,7 @@ Standard_Boolean STEPCAFControl_Reader::readDatumsAP242(const Handle(Standard_Tr
                   if (!(anUnit.CaseNum(anUnit.Value()) == 1)) continue;
                   Handle(StepBasic_NamedUnit) NU = anUnit.NamedUnit();
                   STEPConstruct_UnitContext anUnitCtx;
-                  anUnitCtx.ComputeFactors(NU);
+                  anUnitCtx.ComputeFactors(NU, theLocalFactors);
                   aModifValue = aVal * anUnitCtx.LengthFactor();
                 }
               }
@@ -2857,7 +2873,7 @@ Standard_Boolean STEPCAFControl_Reader::readDatumsAP242(const Handle(Standard_Tr
               if (anIterDRC.Value()->IsKind(STANDARD_TYPE(StepDimTol_Datum)))
               {
                 Handle(StepDimTol_Datum) aD = Handle(StepDimTol_Datum)::DownCast(anIterDRC.Value());
-                setDatumToXCAF(aD, theGDTL, aPositionCounter, aXCAFModifiers, aXCAFModifWithVal, aModifValue, theDoc, theWS);
+                setDatumToXCAF(aD, theGDTL, aPositionCounter, aXCAFModifiers, aXCAFModifWithVal, aModifValue, theDoc, theWS, theLocalFactors);
               }
               else if (anIterDRC.Value()->IsKind(STANDARD_TYPE(StepDimTol_DatumReferenceElement)))
               {
@@ -2882,7 +2898,7 @@ Standard_Boolean STEPCAFControl_Reader::readDatumsAP242(const Handle(Standard_Tr
                       if (!(anUnit.CaseNum(anUnit.Value()) == 1)) continue;
                       Handle(StepBasic_NamedUnit) NU = anUnit.NamedUnit();
                       STEPConstruct_UnitContext anUnitCtx;
-                      anUnitCtx.ComputeFactors(NU);
+                      anUnitCtx.ComputeFactors(NU, theLocalFactors);
                       aModifValue = aVal * anUnitCtx.LengthFactor();
                     }
                   }
@@ -2892,7 +2908,7 @@ Standard_Boolean STEPCAFControl_Reader::readDatumsAP242(const Handle(Standard_Tr
                   if (anIterDRE.Value()->IsKind(STANDARD_TYPE(StepDimTol_Datum)))
                   {
                     Handle(StepDimTol_Datum) aD = Handle(StepDimTol_Datum)::DownCast(anIterDRE.Value());
-                    setDatumToXCAF(aD, theGDTL, aPositionCounter, aXCAFModifiers, aXCAFModifWithVal, aModifValue, theDoc, theWS);
+                    setDatumToXCAF(aD, theGDTL, aPositionCounter, aXCAFModifiers, aXCAFModifWithVal, aModifValue, theDoc, theWS, theLocalFactors);
                   }
                 }
               }
@@ -2911,7 +2927,8 @@ Standard_Boolean STEPCAFControl_Reader::readDatumsAP242(const Handle(Standard_Tr
 //=======================================================================
 TDF_Label STEPCAFControl_Reader::createGDTObjectInXCAF(const Handle(Standard_Transient)& theEnt,
   const Handle(TDocStd_Document)& theDoc,
-  const Handle(XSControl_WorkSession)& theWS)
+  const Handle(XSControl_WorkSession)& theWS,
+  const StepData_Factors& theLocalFactors)
 {
   TDF_Label aGDTL;
   if (!theEnt->IsKind(STANDARD_TYPE(StepShape_DimensionalSize)) &&
@@ -3082,7 +3099,7 @@ TDF_Label STEPCAFControl_Reader::createGDTObjectInXCAF(const Handle(Standard_Tra
                         if (!(anUnit.CaseNum(anUnit.Value()) == 1)) continue;
                         Handle(StepBasic_NamedUnit) NU = anUnit.NamedUnit();
                         STEPConstruct_UnitContext anUnitCtx;
-                        anUnitCtx.ComputeFactors(NU);
+                        anUnitCtx.ComputeFactors(NU, theLocalFactors);
                         dim1 = dim1 * anUnitCtx.LengthFactor();
                       }
                     }
@@ -3098,7 +3115,7 @@ TDF_Label STEPCAFControl_Reader::createGDTObjectInXCAF(const Handle(Standard_Tra
                         if (!(anUnit.CaseNum(anUnit.Value()) == 1)) continue;
                         Handle(StepBasic_NamedUnit) NU = anUnit.NamedUnit();
                         STEPConstruct_UnitContext anUnitCtx;
-                        anUnitCtx.ComputeFactors(NU);
+                        anUnitCtx.ComputeFactors(NU, theLocalFactors);
                         dim2 = dim2 * anUnitCtx.LengthFactor();
                       }
                     }
@@ -3139,7 +3156,7 @@ TDF_Label STEPCAFControl_Reader::createGDTObjectInXCAF(const Handle(Standard_Tra
             if (!(anUnit.CaseNum(anUnit.Value()) == 1)) continue;
             Handle(StepBasic_NamedUnit) NU = anUnit.NamedUnit();
             STEPConstruct_UnitContext anUnitCtx;
-            anUnitCtx.ComputeFactors(NU);
+            anUnitCtx.ComputeFactors(NU, theLocalFactors);
             dim = dim * anUnitCtx.LengthFactor();
             //std::cout<<"GeometricTolerance: Magnitude = "<<dim<<std::endl;
             Handle(TColStd_HArray1OfReal) arr = new TColStd_HArray1OfReal(1, 1);
@@ -3359,7 +3376,7 @@ TDF_Label STEPCAFControl_Reader::createGDTObjectInXCAF(const Handle(Standard_Tra
       TDataStd_Name::Set(aGDTL, str);
     }
 
-    readDatumsAP242(theEnt, aGDTL, theDoc, theWS);
+    readDatumsAP242(theEnt, aGDTL, theDoc, theWS, theLocalFactors);
   }
   return aGDTL;
 }
@@ -3390,7 +3407,8 @@ void convertAngleValue(
 static void setDimObjectToXCAF(const Handle(Standard_Transient)& theEnt,
   const TDF_Label& aDimL,
   const Handle(TDocStd_Document)& theDoc,
-  const Handle(XSControl_WorkSession)& theWS)
+  const Handle(XSControl_WorkSession)& theWS,
+  const StepData_Factors& theLocalFactors)
 {
   Handle(XCAFDoc_ShapeTool) aSTool = XCAFDoc_DocumentTool::ShapeTool(theDoc->Main());
   Handle(XCAFDoc_DimTolTool) aDGTTool = XCAFDoc_DocumentTool::DimTolTool(theDoc->Main());
@@ -3455,7 +3473,7 @@ static void setDimObjectToXCAF(const Handle(Standard_Transient)& theEnt,
                 continue;
               Handle(StepBasic_NamedUnit) NU = anUnit.NamedUnit();
               STEPConstruct_UnitContext anUnitCtx;
-              anUnitCtx.ComputeFactors(NU);
+              anUnitCtx.ComputeFactors(NU, theLocalFactors);
               if (aMWU->IsKind(STANDARD_TYPE(StepRepr_ReprItemAndLengthMeasureWithUnit))) {
                 aVal = aVal * anUnitCtx.LengthFactor();
 
@@ -3482,7 +3500,7 @@ static void setDimObjectToXCAF(const Handle(Standard_Transient)& theEnt,
                 continue;
               Handle(StepBasic_NamedUnit) NU = anUnit.NamedUnit();
               STEPConstruct_UnitContext anUnitCtx;
-              anUnitCtx.ComputeFactors(NU);
+              anUnitCtx.ComputeFactors(NU, theLocalFactors);
               if (aMWU->IsKind(STANDARD_TYPE(StepRepr_ReprItemAndLengthMeasureWithUnitAndQRI))) {
                 aVal = aVal * anUnitCtx.LengthFactor();
               }
@@ -3562,7 +3580,7 @@ static void setDimObjectToXCAF(const Handle(Standard_Transient)& theEnt,
         if (!(anUnit.CaseNum(anUnit.Value()) == 1)) continue;
         Handle(StepBasic_NamedUnit) NU = anUnit.NamedUnit();
         STEPConstruct_UnitContext anUnitCtxUpperBound;
-        anUnitCtxUpperBound.ComputeFactors(NU);
+        anUnitCtxUpperBound.ComputeFactors(NU, theLocalFactors);
         if (aMWU->IsKind(STANDARD_TYPE(StepBasic_PlaneAngleMeasureWithUnit)) ||
           aMWU->IsKind(STANDARD_TYPE(StepRepr_ReprItemAndPlaneAngleMeasureWithUnitAndQRI)))
         {
@@ -3598,7 +3616,7 @@ static void setDimObjectToXCAF(const Handle(Standard_Transient)& theEnt,
         if (!(anUnit.CaseNum(anUnit.Value()) == 1)) continue;
         NU = anUnit.NamedUnit();
         STEPConstruct_UnitContext anUnitCtxLowerBound;
-        anUnitCtxLowerBound.ComputeFactors(NU);
+        anUnitCtxLowerBound.ComputeFactors(NU, theLocalFactors);
         if (aMWU->IsKind(STANDARD_TYPE(StepBasic_PlaneAngleMeasureWithUnit)) ||
           aMWU->IsKind(STANDARD_TYPE(StepRepr_ReprItemAndPlaneAngleMeasureWithUnitAndQRI)))
         {
@@ -3808,8 +3826,8 @@ static void setDimObjectToXCAF(const Handle(Standard_Transient)& theEnt,
 
     if (aDimL.FindAttribute(XCAFDoc_Dimension::GetID(), aDim))
     {
-      readAnnotation(aTR, theEnt, aDimObj);
-      readConnectionPoints(aTR, theEnt, aDimObj);
+      readAnnotation(aTR, theEnt, aDimObj, theLocalFactors);
+      readConnectionPoints(aTR, theEnt, aDimObj, theLocalFactors);
       aDim->SetObject(aDimObj);
     }
   }
@@ -3930,7 +3948,8 @@ static Standard_Boolean getTolType(const Handle(Standard_Transient)& theEnt,
 static void setGeomTolObjectToXCAF(const Handle(Standard_Transient)& theEnt,
   const TDF_Label& theTolL,
   const Handle(TDocStd_Document)& theDoc,
-  const Handle(XSControl_WorkSession)& theWS)
+  const Handle(XSControl_WorkSession)& theWS,
+  const StepData_Factors& theLocalFactors)
 {
   Handle(XCAFDoc_ShapeTool) aSTool = XCAFDoc_DocumentTool::ShapeTool(theDoc->Main());
   Handle(XCAFDoc_DimTolTool) aDGTTool = XCAFDoc_DocumentTool::DimTolTool(theDoc->Main());
@@ -3956,7 +3975,7 @@ static void setGeomTolObjectToXCAF(const Handle(Standard_Transient)& theEnt,
     if (!(anUnit.CaseNum(anUnit.Value()) == 1)) return;
     Handle(StepBasic_NamedUnit) NU = anUnit.NamedUnit();
     STEPConstruct_UnitContext anUnitCtx;
-    anUnitCtx.ComputeFactors(NU);
+    anUnitCtx.ComputeFactors(NU, theLocalFactors);
     aVal = aVal * anUnitCtx.LengthFactor();
     aTolObj->SetValue(aVal);
   }
@@ -3981,7 +4000,7 @@ static void setGeomTolObjectToXCAF(const Handle(Standard_Transient)& theEnt,
             if (!(anUnit.CaseNum(anUnit.Value()) == 1)) return;
             Handle(StepBasic_NamedUnit) NU = anUnit.NamedUnit();
             STEPConstruct_UnitContext anUnitCtx;
-            anUnitCtx.ComputeFactors(NU);
+            anUnitCtx.ComputeFactors(NU, theLocalFactors);
             aVal = aVal * anUnitCtx.LengthFactor();
             aTolObj->SetValueOfZoneModifier(aVal);
             aTolObj->SetZoneModifier(XCAFDimTolObjects_GeomToleranceZoneModif_Projected);
@@ -3999,7 +4018,7 @@ static void setGeomTolObjectToXCAF(const Handle(Standard_Transient)& theEnt,
             if (!(anUnit.CaseNum(anUnit.Value()) == 1)) continue;
             Handle(StepBasic_NamedUnit) NU = anUnit.NamedUnit();
             STEPConstruct_UnitContext anUnitCtx;
-            anUnitCtx.ComputeFactors(NU);
+            anUnitCtx.ComputeFactors(NU, theLocalFactors);
             convertAngleValue(anUnitCtx, aVal);
             aTolObj->SetValueOfZoneModifier(aVal);
             aTolObj->SetZoneModifier(XCAFDimTolObjects_GeomToleranceZoneModif_Runout);
@@ -4072,12 +4091,12 @@ static void setGeomTolObjectToXCAF(const Handle(Standard_Transient)& theEnt,
   {
     Handle(StepBasic_NamedUnit) NU = anUnit.NamedUnit();
     STEPConstruct_UnitContext anUnitCtx;
-    anUnitCtx.ComputeFactors(NU);
+    anUnitCtx.ComputeFactors(NU, theLocalFactors);
     convertAngleValue(anUnitCtx, aVal);
     aTolObj->SetMaxValueModifier(aVal);
   }
 
-  readAnnotation(aTR, theEnt, aTolObj);
+  readAnnotation(aTR, theEnt, aTolObj, theLocalFactors);
   aGTol->SetObject(aTolObj);
 }
 
@@ -4087,7 +4106,8 @@ static void setGeomTolObjectToXCAF(const Handle(Standard_Transient)& theEnt,
 //=======================================================================
 
 Standard_Boolean STEPCAFControl_Reader::ReadGDTs(const Handle(XSControl_WorkSession)& theWS,
-                                                 const Handle(TDocStd_Document)& theDoc)
+                                                 const Handle(TDocStd_Document)& theDoc,
+                                                 const StepData_Factors& theLocalFactors)
 {
   const Handle(Interface_InterfaceModel) &aModel = theWS->Model();
   const Interface_Graph& aGraph = theWS->Graph();
@@ -4107,13 +4127,13 @@ Standard_Boolean STEPCAFControl_Reader::ReadGDTs(const Handle(XSControl_WorkSess
     if (anEnt->IsKind(STANDARD_TYPE(StepShape_DimensionalSize)) ||
       anEnt->IsKind(STANDARD_TYPE(StepShape_DimensionalLocation)) ||
       anEnt->IsKind(STANDARD_TYPE(StepDimTol_GeometricTolerance))) {
-      TDF_Label aGDTL = createGDTObjectInXCAF(anEnt, theDoc, theWS);
+      TDF_Label aGDTL = createGDTObjectInXCAF(anEnt, theDoc, theWS, theLocalFactors);
       if (!aGDTL.IsNull()) {
         if (anEnt->IsKind(STANDARD_TYPE(StepDimTol_GeometricTolerance))) {
-          setGeomTolObjectToXCAF(anEnt, aGDTL, theDoc, theWS);
+          setGeomTolObjectToXCAF(anEnt, aGDTL, theDoc, theWS, theLocalFactors);
         }
         else {
-          setDimObjectToXCAF(anEnt, aGDTL, theDoc, theWS);
+          setDimObjectToXCAF(anEnt, aGDTL, theDoc, theWS, theLocalFactors);
         }
       }
     }
@@ -4200,20 +4220,21 @@ Standard_Boolean STEPCAFControl_Reader::ReadGDTs(const Handle(XSControl_WorkSess
 
       // Calculate unit
       Standard_Real aFact = 1.0;
+      StepData_Factors aLocalFactors = theLocalFactors;
       if (!aDMIA.IsNull())
       {
         XSAlgo::AlgoContainer()->PrepareForTransfer();
         STEPControl_ActorRead anActor;
         Handle(Transfer_TransientProcess) aTP = aTR->TransientProcess();
-        anActor.PrepareUnits(aDMIA->UsedRepresentation(), aTP);
-        aFact = StepData_GlobalFactors::Intance().LengthFactor();
+        anActor.PrepareUnits(aDMIA->UsedRepresentation(), aTP, aLocalFactors);
+        aFact = aLocalFactors.LengthFactor();
       }
 
       // Presentation
       TopoDS_Shape aPresentation;
       Handle(TCollection_HAsciiString) aPresentName;
       Bnd_Box aBox;
-      if (!readPMIPresentation(anEnt, aTR, aFact, aPresentation, aPresentName, aBox))
+      if (!readPMIPresentation(anEnt, aTR, aFact, aPresentation, aPresentName, aBox, aLocalFactors))
         continue;
       // Annotation plane
       Handle(StepVisual_AnnotationPlane) anAnPlane;
@@ -4240,7 +4261,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadGDTs(const Handle(XSControl_WorkSess
       aDGTTool->SetDimension(aShapesL, anEmptySeq2, aGDTL);
       gp_Ax2 aPlaneAxes;
       if (!anAnPlane.IsNull()) {
-        if (readAnnotationPlane(anAnPlane, aPlaneAxes))
+        if (readAnnotationPlane(anAnPlane, aPlaneAxes, aLocalFactors))
           aDimObj->SetPlane(aPlaneAxes);
       }
       aDimObj->SetPresentation(aPresentation, aPresentName);
@@ -4298,7 +4319,8 @@ static Handle(StepShape_SolidModel) FindSolidForPDS(const Handle(StepRepr_Produc
 
 Standard_Boolean STEPCAFControl_Reader::ReadMaterials(const Handle(XSControl_WorkSession) &WS,
                                                       const Handle(TDocStd_Document)& Doc,
-                                                      const Handle(TColStd_HSequenceOfTransient)& SeqPDS) const
+                                                      const Handle(TColStd_HSequenceOfTransient)& SeqPDS,
+                                                      const StepData_Factors& theLocalFactors) const
 {
   const Handle(XSControl_TransferReader) &TR = WS->TransferReader();
   const Handle(Transfer_TransientProcess) &TP = TR->TransientProcess();
@@ -4366,11 +4388,11 @@ Standard_Boolean STEPCAFControl_Reader::ReadMaterials(const Handle(XSControl_Wor
                   NU->IsKind(STANDARD_TYPE(StepBasic_SiUnitAndLengthUnit)))
                 {
                   STEPConstruct_UnitContext anUnitCtx;
-                  anUnitCtx.ComputeFactors(NU);
+                  anUnitCtx.ComputeFactors(NU, theLocalFactors);
                   aDensity = aDensity / (anUnitCtx.LengthFactor()*anUnitCtx.LengthFactor()*anUnitCtx.LengthFactor());
                   // transfer length value for Density from millimeter to santimeter
                   // in order to result density has dimension gram/(sm*sm*sm)
-                  const Standard_Real aCascadeUnit = StepData_GlobalFactors::Intance().CascadeUnit();
+                  const Standard_Real aCascadeUnit = theLocalFactors.CascadeUnit();
                   aDensity = aDensity*1000. / (aCascadeUnit * aCascadeUnit * aCascadeUnit);
                 }
                 if (NU->IsKind(STANDARD_TYPE(StepBasic_ConversionBasedUnitAndMassUnit))) {
@@ -4451,7 +4473,8 @@ void collectViewShapes(const Handle(XSControl_WorkSession)& theWS,
 //=======================================================================
 Handle(TCollection_HAsciiString) buildClippingPlanes(const Handle(StepGeom_GeometricRepresentationItem)& theClippingCameraModel,
   TDF_LabelSequence& theClippingPlanes,
-  const Handle(XCAFDoc_ClippingPlaneTool)& theTool)
+  const Handle(XCAFDoc_ClippingPlaneTool)& theTool,
+  const StepData_Factors& theLocalFactors)
 {
   Handle(TCollection_HAsciiString) anExpression = new TCollection_HAsciiString();
   NCollection_Sequence<Handle(StepGeom_GeometricRepresentationItem)> aPlanes;
@@ -4470,7 +4493,7 @@ Handle(TCollection_HAsciiString) buildClippingPlanes(const Handle(StepGeom_Geome
       Handle(StepVisual_CameraModelD3MultiClippingUnion) aCameraModelUnion =
         aCameraModel->ShapeClipping()->Value(1).CameraModelD3MultiClippingUnion();
       if (!aCameraModelUnion.IsNull())
-        return buildClippingPlanes(aCameraModelUnion, theClippingPlanes, theTool);
+        return buildClippingPlanes(aCameraModelUnion, theClippingPlanes, theTool, theLocalFactors);
     }
     for (Standard_Integer i = 1; i <= aCameraModel->ShapeClipping()->Length(); i++) {
       aPlanes.Append(Handle(StepGeom_GeometricRepresentationItem)::DownCast(aCameraModel->ShapeClipping()->Value(i).Value()));
@@ -4496,7 +4519,7 @@ Handle(TCollection_HAsciiString) buildClippingPlanes(const Handle(StepGeom_Geome
   for (Standard_Integer i = 1; i <= aPlanes.Length(); i++) {
     Handle(StepGeom_Plane) aPlaneEnt = Handle(StepGeom_Plane)::DownCast(aPlanes.Value(i));
     if (!aPlaneEnt.IsNull()) {
-      Handle(Geom_Plane) aPlane = StepToGeom::MakePlane(aPlaneEnt);
+      Handle(Geom_Plane) aPlane = StepToGeom::MakePlane(aPlaneEnt, theLocalFactors);
       if (!aPlane.IsNull()) {
         TDF_Label aPlaneL = theTool->AddClippingPlane(aPlane->Pln(), aPlaneEnt->Name());
         theClippingPlanes.Append(aPlaneL);
@@ -4506,7 +4529,7 @@ Handle(TCollection_HAsciiString) buildClippingPlanes(const Handle(StepGeom_Geome
       }
     }
     else {
-      anExpression->AssignCat(buildClippingPlanes(aPlanes.Value(i), theClippingPlanes, theTool));
+      anExpression->AssignCat(buildClippingPlanes(aPlanes.Value(i), theClippingPlanes, theTool, theLocalFactors));
     }
     anExpression->AssignCat(anOperation);
   }
@@ -4520,7 +4543,9 @@ Handle(TCollection_HAsciiString) buildClippingPlanes(const Handle(StepGeom_Geome
 //function : ReadViews
 //purpose  :
 //=======================================================================
-Standard_Boolean STEPCAFControl_Reader::ReadViews(const Handle(XSControl_WorkSession)& theWS, const Handle(TDocStd_Document)& theDoc) const
+Standard_Boolean STEPCAFControl_Reader::ReadViews(const Handle(XSControl_WorkSession)& theWS,
+                                                  const Handle(TDocStd_Document)& theDoc,
+                                                  const StepData_Factors& theLocalFactors) const
 {
   const Handle(Interface_InterfaceModel) &aModel = theWS->Model();
   Handle(XCAFDoc_ShapeTool) aSTool = XCAFDoc_DocumentTool::ShapeTool(theDoc->Main());
@@ -4551,15 +4576,16 @@ Standard_Boolean STEPCAFControl_Reader::ReadViews(const Handle(XSControl_WorkSes
       }
       aDModel = Handle(StepVisual_DraughtingModel)::DownCast(subs.Value());
     }
+    StepData_Factors aLocalFactors = theLocalFactors;
     if (!aDModel.IsNull())
     {
       XSAlgo::AlgoContainer()->PrepareForTransfer();
       STEPControl_ActorRead anActor;
-      anActor.PrepareUnits(aDModel, aTP);
+      anActor.PrepareUnits(aDModel, aTP, aLocalFactors);
     }
 
     anObj->SetName(aCameraModel->Name());
-    Handle(Geom_Axis2Placement) anAxis = StepToGeom::MakeAxis2Placement(aCameraModel->ViewReferenceSystem());
+    Handle(Geom_Axis2Placement) anAxis = StepToGeom::MakeAxis2Placement(aCameraModel->ViewReferenceSystem(), aLocalFactors);
     anObj->SetViewDirection(anAxis->Direction());
     anObj->SetUpDirection(anAxis->Direction() ^ anAxis->XDirection());
     Handle(StepVisual_ViewVolume) aViewVolume = aCameraModel->PerspectiveOfVolume();
@@ -4569,7 +4595,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadViews(const Handle(XSControl_WorkSes
     else if (aViewVolume->ProjectionType() == StepVisual_copParallel)
       aType = XCAFView_ProjectionType_Parallel;
     anObj->SetType(aType);
-    Handle(Geom_CartesianPoint) aPoint = StepToGeom::MakeCartesianPoint(aViewVolume->ProjectionPoint());
+    Handle(Geom_CartesianPoint) aPoint = StepToGeom::MakeCartesianPoint(aViewVolume->ProjectionPoint(), aLocalFactors);
     anObj->SetProjectionPoint(aPoint->Pnt());
     anObj->SetZoomFactor(aViewVolume->ViewPlaneDistance());
     anObj->SetWindowHorizontalSize(aViewVolume->ViewWindow()->SizeInX());
@@ -4586,7 +4612,7 @@ Standard_Boolean STEPCAFControl_Reader::ReadViews(const Handle(XSControl_WorkSes
     if (!aClippingCameraModel.IsNull()) {
       Handle(TCollection_HAsciiString) aClippingExpression;
       Handle(XCAFDoc_ClippingPlaneTool) aClippingPlaneTool = XCAFDoc_DocumentTool::ClippingPlaneTool(theDoc->Main());
-      aClippingExpression = buildClippingPlanes(aClippingCameraModel, aClippingPlanes, aClippingPlaneTool);
+      aClippingExpression = buildClippingPlanes(aClippingCameraModel, aClippingPlanes, aClippingPlaneTool, aLocalFactors);
       anObj->SetClippingExpression(aClippingExpression);
     }
 
index 1b1ac0c55a78ab05246aabc6c2ffe9aac3cdd795..efebd48bfa5b2f63826417becca6ce0706824c24 100644 (file)
@@ -38,6 +38,7 @@ class StepShape_ConnectedFaceSet;
 class StepRepr_NextAssemblyUsageOccurrence;
 class STEPConstruct_Tool;
 class StepDimTol_Datum;
+class StepData_Factors;
 
 
 //! Provides a tool to read STEP file and put it into
@@ -212,7 +213,8 @@ protected:
   //! corresponding color assignments in the DECAF document
   Standard_EXPORT Standard_Boolean ReadColors
                 (const Handle(XSControl_WorkSession)& WS,
-                 const Handle(TDocStd_Document)& doc) const;
+                 const Handle(TDocStd_Document)& doc,
+                 const StepData_Factors& theLocalFactors) const;
   
   //! Reads names of parts defined in the STEP model and
   //! assigns them to corresponding labels in the DECAF document
@@ -221,7 +223,10 @@ protected:
   //! Reads validation properties assigned to shapes in the STEP
   //! model and assigns them to corresponding labels in the DECAF
   //! document
-  Standard_EXPORT Standard_Boolean ReadValProps (const Handle(XSControl_WorkSession)& WS, const Handle(TDocStd_Document)& doc, const STEPCAFControl_DataMapOfPDExternFile& PDFileMap) const;
+  Standard_EXPORT Standard_Boolean ReadValProps (const Handle(XSControl_WorkSession)& WS,
+                                                 const Handle(TDocStd_Document)& doc,
+                                                 const STEPCAFControl_DataMapOfPDExternFile& PDFileMap,
+                                                 const StepData_Factors& theLocalFactors) const;
   
   //! Reads layers of parts defined in the STEP model and
   //! set reference between shape and layers in the DECAF document
@@ -233,14 +238,21 @@ protected:
   
   //! Reads D&GT for instances defined in the STEP model and
   //! set reference between shape instances from different assemblyes
-  Standard_EXPORT Standard_Boolean ReadGDTs (const Handle(XSControl_WorkSession)& WS, const Handle(TDocStd_Document)& doc);
+  Standard_EXPORT Standard_Boolean ReadGDTs (const Handle(XSControl_WorkSession)& WS,
+                                             const Handle(TDocStd_Document)& doc,
+                                             const StepData_Factors& theLocalFactors);
   
   //! Reads materials for instances defined in the STEP model and
   //! set reference between shape instances from different assemblyes
-  Standard_EXPORT Standard_Boolean ReadMaterials (const Handle(XSControl_WorkSession)& WS, const Handle(TDocStd_Document)& doc, const Handle(TColStd_HSequenceOfTransient)& SeqPDS) const;
+  Standard_EXPORT Standard_Boolean ReadMaterials (const Handle(XSControl_WorkSession)& WS,
+                                                  const Handle(TDocStd_Document)& doc,
+                                                  const Handle(TColStd_HSequenceOfTransient)& SeqPDS,
+                                                  const StepData_Factors& theLocalFactors) const;
   
   //! Reads Views for instances defined in the STEP model
-  Standard_EXPORT Standard_Boolean ReadViews(const Handle(XSControl_WorkSession)& theWS, const Handle(TDocStd_Document)& theDoc) const;
+  Standard_EXPORT Standard_Boolean ReadViews(const Handle(XSControl_WorkSession)& theWS,
+                                             const Handle(TDocStd_Document)& theDoc,
+                                             const StepData_Factors& theLocalFactors) const;
 
   //! Populates the sub-Label of the passed TDF Label with shape
   //! data associated with the given STEP Representation Item,
@@ -281,22 +293,26 @@ private:
     const XCAFDimTolObjects_DatumModifWithValue theXCAFModifWithVal,
     const Standard_Real theModifValue,
     const Handle(TDocStd_Document)& theDoc,
-    const Handle(XSControl_WorkSession)& theWS);
+    const Handle(XSControl_WorkSession)& theWS,
+    const StepData_Factors& theLocalFactors);
   
   //! Internal method. Read Datums, connected to GeomTolerance theGDTL.
   Standard_Boolean readDatumsAP242(const Handle(Standard_Transient)& theEnt,
     const TDF_Label theGDTL,
     const Handle(TDocStd_Document)& theDoc,
-    const Handle(XSControl_WorkSession)& theWS);
+    const Handle(XSControl_WorkSession)& theWS,
+    const StepData_Factors& theLocalFactors);
 
   //! Internal method. Read Dimension or GeomTolerance.
   TDF_Label createGDTObjectInXCAF(const Handle(Standard_Transient)& theEnt,
     const Handle(TDocStd_Document)& theDoc,
-    const Handle(XSControl_WorkSession)& theWS);
+    const Handle(XSControl_WorkSession)& theWS,
+    const StepData_Factors& theLocalFactors);
 
   //! Prepares units for transfer
   void prepareUnits(const Handle(StepData_StepModel)& theModel,
-                    const Handle(TDocStd_Document)& theDoc) const;
+                    const Handle(TDocStd_Document)& theDoc,
+                    StepData_Factors& theLocalFactors) const;
 
 private:
 
index 7dd761e5f5eae6846a757af01d80302d01e0d3e9..9d188e07e22bb0e24e4e3290395b17db6888218e 100644 (file)
@@ -56,6 +56,7 @@
 #include <STEPConstruct_Styles.hxx>
 #include <STEPConstruct_ValidationProps.hxx>
 #include <STEPControl_StepModelType.hxx>
+#include <StepData_Factors.hxx>
 #include <StepData_Logical.hxx>
 #include <StepData_StepModel.hxx>
 #include <StepDimTol_AngularityTolerance.hxx>
@@ -348,18 +349,21 @@ IFSelect_ReturnStatus STEPCAFControl_Writer::Write(const Standard_CString theFil
 //purpose  :
 //=======================================================================
 void STEPCAFControl_Writer::prepareUnit(const TDF_Label& theLabel,
-                                        const Handle(StepData_StepModel)& theModel)
+                                        const Handle(StepData_StepModel)& theModel,
+                                        StepData_Factors& theLocalFactors)
 {
   Handle(XCAFDoc_LengthUnit) aLengthAttr;
   if (!theLabel.IsNull() &&
       theLabel.Root().FindAttribute(XCAFDoc_LengthUnit::GetID(), aLengthAttr))
   {
     theModel->SetLocalLengthUnit(aLengthAttr->GetUnitValue() * 1000); // convert to mm
+    theLocalFactors.SetCascadeUnit(aLengthAttr->GetUnitValue() * 1000);
   }
   else
   {
     XSAlgo::AlgoContainer()->PrepareForTransfer(); // update unit info
     theModel->SetLocalLengthUnit(UnitsMethods::GetCasCadeLengthUnit());
+    theLocalFactors.SetCascadeUnit(UnitsMethods::GetCasCadeLengthUnit());
   }
 }
 
@@ -511,8 +515,9 @@ Standard_Boolean STEPCAFControl_Writer::transfer(STEPControl_Writer& theWriter,
   Handle(STEPCAFControl_ActorWrite) anActor =
     Handle(STEPCAFControl_ActorWrite)::DownCast(theWriter.WS()->NormAdaptor()->ActorWrite());
 
+  StepData_Factors aLocalFactors;
   const Handle(StepData_StepModel) aModel = Handle(StepData_StepModel)::DownCast(theWriter.WS()->Model());
-  prepareUnit(theLabels.First(), aModel); // set local length unit to the model
+  prepareUnit(theLabels.First(), aModel, aLocalFactors); // set local length unit to the model
   // translate free top-level shapes of the DECAF document
   const Standard_Integer aStepSchema = Interface_Static::IVal("write.step.schema");
   TDF_LabelSequence aSubLabels;
@@ -614,7 +619,7 @@ Standard_Boolean STEPCAFControl_Writer::transfer(STEPControl_Writer& theWriter,
     {
       // translate final solids
       Message_ProgressScope aPS1(aRange, NULL, 2);
-      TopoDS_Shape aSass = transferExternFiles(aCurL, theMode, aSubLabels, theIsMulti, aPS1.Next());
+      TopoDS_Shape aSass = transferExternFiles(aCurL, theMode, aSubLabels, aLocalFactors, theIsMulti, aPS1.Next());
       if (aPS1.UserBreak())
         return Standard_False;
 
@@ -653,7 +658,7 @@ Standard_Boolean STEPCAFControl_Writer::transfer(STEPControl_Writer& theWriter,
     {
       if (aStepSchema == 5)
       {
-        writeDGTsAP242(theWriter.WS(), aSubLabels);
+        writeDGTsAP242(theWriter.WS(), aSubLabels, aLocalFactors);
       }
       else
       {
@@ -733,6 +738,7 @@ Standard_Boolean STEPCAFControl_Writer::transfer(STEPControl_Writer& theWriter,
 TopoDS_Shape STEPCAFControl_Writer::transferExternFiles(const TDF_Label& theLabel,
                                                         const STEPControl_StepModelType theMode,
                                                         TDF_LabelSequence& theLabels,
+                                                        const StepData_Factors& theLocalFactors,
                                                         const Standard_CString thePrefix,
                                                         const Message_ProgressRange& theProgress)
 {
@@ -815,7 +821,7 @@ TopoDS_Shape STEPCAFControl_Writer::transferExternFiles(const TDF_Label& theLabe
     TDF_Label aRefL;
     if (!XCAFDoc_ShapeTool::GetReferredShape(aCurL, aRefL))
       continue;
-    TopoDS_Shape aShComp = transferExternFiles(aRefL, theMode, theLabels, thePrefix, aPS.Next());
+    TopoDS_Shape aShComp = transferExternFiles(aRefL, theMode, theLabels, theLocalFactors, thePrefix, aPS.Next());
     aShComp.Location(XCAFDoc_ShapeTool::GetLocation(aCurL));
     aBuilder.Add(aComp, aShComp);
   }
@@ -2457,7 +2463,8 @@ void STEPCAFControl_Writer::writePresentation(const Handle(XSControl_WorkSession
                                               const Standard_Boolean theHasPlane,
                                               const gp_Ax2& theAnnotationPlane,
                                               const gp_Pnt& theTextPosition,
-                                              const Handle(Standard_Transient)& theDimension)
+                                              const Handle(Standard_Transient)& theDimension,
+                                              const StepData_Factors& theLocalFactors)
 {
   if (thePresentation.IsNull())
     return;
@@ -2508,7 +2515,7 @@ void STEPCAFControl_Writer::writePresentation(const Handle(XSControl_WorkSession
   aPrsStyles->SetValue(1, aPrsStyle);
   // Plane
   Handle(StepGeom_Plane) aPlane = new StepGeom_Plane();
-  GeomToStep_MakeAxis2Placement3d anAxisMaker(theAnnotationPlane);
+  GeomToStep_MakeAxis2Placement3d anAxisMaker(theAnnotationPlane, theLocalFactors);
   const Handle(StepGeom_Axis2Placement3d)& anAxis = anAxisMaker.Value();
   // Set text position to plane origin
   Handle(StepGeom_CartesianPoint) aTextPos = new StepGeom_CartesianPoint();
@@ -2540,7 +2547,8 @@ Handle(StepDimTol_Datum) STEPCAFControl_Writer::writeDatumAP242(const Handle(XSC
                                                                 const TDF_LabelSequence& theShapeL,
                                                                 const TDF_Label& theDatumL,
                                                                 const Standard_Boolean theIsFirstDTarget,
-                                                                const Handle(StepDimTol_Datum)& theWrittenDatum)
+                                                                const Handle(StepDimTol_Datum)& theWrittenDatum,
+                                                                const StepData_Factors& theLocalFactors)
 {
   // Get working data
   const Handle(Interface_InterfaceModel)& aModel = theWS->Model();
@@ -2694,7 +2702,7 @@ Handle(StepDimTol_Datum) STEPCAFControl_Writer::writeDatumAP242(const Handle(XSC
         // Common for all datum targets
         StepBasic_Unit aUnit = GetUnit(aRC);
         gp_Ax2 aDTAxis = anObject->GetDatumTargetAxis();
-        GeomToStep_MakeAxis2Placement3d anAxisMaker(aDTAxis);
+        GeomToStep_MakeAxis2Placement3d anAxisMaker(aDTAxis, theLocalFactors);
         Handle(StepGeom_Axis2Placement3d) anA2P3D = anAxisMaker.Value();
         anA2P3D->SetName(new TCollection_HAsciiString("orientation"));
         Handle(StepRepr_HArray1OfRepresentationItem) anItems;
@@ -2788,7 +2796,7 @@ Handle(StepDimTol_Datum) STEPCAFControl_Writer::writeDatumAP242(const Handle(XSC
 
   //Annotation plane and Presentation
   writePresentation(theWS, anObject->GetPresentation(), anObject->GetPresentationName(), Standard_True, anObject->HasPlane(),
-                    anObject->GetPlane(), anObject->GetPointTextAttach(), aSA);
+                    anObject->GetPlane(), anObject->GetPointTextAttach(), aSA, theLocalFactors);
 
   return aDatum;
 }
@@ -2801,7 +2809,8 @@ Handle(StepDimTol_Datum) STEPCAFControl_Writer::writeDatumAP242(const Handle(XSC
 static void WriteDimValues(const Handle(XSControl_WorkSession)& theWS,
                            const Handle(XCAFDimTolObjects_DimensionObject)& theObject,
                            const Handle(StepRepr_RepresentationContext)& theRC,
-                           const StepShape_DimensionalCharacteristic& theDimension)
+                           const StepShape_DimensionalCharacteristic& theDimension,
+                           const StepData_Factors& theLocalFactors)
 {
   // Get working data
   const Handle(Interface_InterfaceModel)& aModel = theWS->Model();
@@ -2928,7 +2937,7 @@ static void WriteDimValues(const Handle(XSControl_WorkSession)& theWS,
     Handle(StepGeom_Axis2Placement3d) anOrientation = new StepGeom_Axis2Placement3d();
     gp_Dir aDir;
     theObject->GetDirection(aDir);
-    GeomToStep_MakeCartesianPoint MkPoint(gp_Pnt(0, 0, 0));
+    GeomToStep_MakeCartesianPoint MkPoint(gp_Pnt(0, 0, 0), theLocalFactors.LengthFactor());
     const Handle(StepGeom_CartesianPoint)& aLoc = MkPoint.Value();
     Handle(StepGeom_Direction) anAxis = new StepGeom_Direction();
     Handle(TColStd_HArray1OfReal) aCoords = new TColStd_HArray1OfReal(1, 3);
@@ -3025,13 +3034,14 @@ static void WriteDerivedGeometry(const Handle(XSControl_WorkSession)& theWS,
                                  const Handle(StepRepr_ConstructiveGeometryRepresentation)& theRepr,
                                  Handle(StepRepr_ShapeAspect)& theFirstSA,
                                  Handle(StepRepr_ShapeAspect)& theSecondSA,
-                                 NCollection_Vector<Handle(StepGeom_CartesianPoint)>& thePnts)
+                                 NCollection_Vector<Handle(StepGeom_CartesianPoint)>& thePnts,
+                                 const StepData_Factors& theLocalFactors)
 {
   const Handle(Interface_InterfaceModel)& aModel = theWS->Model();
   // First point
   if (theObject->HasPoint())
   {
-    GeomToStep_MakeCartesianPoint aPointMaker(theObject->GetPoint());
+    GeomToStep_MakeCartesianPoint aPointMaker(theObject->GetPoint(), theLocalFactors.LengthFactor());
     Handle(StepGeom_CartesianPoint) aPoint = aPointMaker.Value();
     thePnts.Append(aPoint);
     Handle(StepRepr_DerivedShapeAspect) aDSA = new StepRepr_DerivedShapeAspect();
@@ -3052,7 +3062,7 @@ static void WriteDerivedGeometry(const Handle(XSControl_WorkSession)& theWS,
   // Second point (for locations)
   if (theObject->HasPoint2())
   {
-    GeomToStep_MakeCartesianPoint aPointMaker(theObject->GetPoint2());
+    GeomToStep_MakeCartesianPoint aPointMaker(theObject->GetPoint2(), theLocalFactors.LengthFactor());
     Handle(StepGeom_CartesianPoint) aPoint = aPointMaker.Value();
     thePnts.Append(aPoint);
     Handle(StepRepr_DerivedShapeAspect) aDSA = new StepRepr_DerivedShapeAspect();
@@ -3080,7 +3090,8 @@ static Handle(StepDimTol_HArray1OfDatumSystemOrReference) WriteDatumSystem(const
                                                                            const TDF_Label theGeomTolL,
                                                                            const TDF_LabelSequence& theDatumSeq,
                                                                            const STEPConstruct_DataMapOfAsciiStringTransient& theDatumMap,
-                                                                           const Handle(StepRepr_RepresentationContext)& theRC)
+                                                                           const Handle(StepRepr_RepresentationContext)& theRC,
+                                                                           const StepData_Factors& theLocalFactors)
 {
   // Get working data
   const Handle(Interface_InterfaceModel)& aModel = theWS->Model();
@@ -3249,7 +3260,7 @@ static Handle(StepDimTol_HArray1OfDatumSystemOrReference) WriteDatumSystem(const
   // Axis
   if (anObject->HasAxis())
   {
-    GeomToStep_MakeAxis2Placement3d anAxisMaker(anObject->GetAxis());
+    GeomToStep_MakeAxis2Placement3d anAxisMaker(anObject->GetAxis(), theLocalFactors);
     Handle(StepGeom_Axis2Placement3d) anAxis = anAxisMaker.Value();
     anAxis->SetName(new TCollection_HAsciiString("orientation"));
     Handle(StepAP242_GeometricItemSpecificUsage) aGISU = new StepAP242_GeometricItemSpecificUsage();
@@ -3335,7 +3346,8 @@ void STEPCAFControl_Writer::writeGeomTolerance(const Handle(XSControl_WorkSessio
                                                const TDF_LabelSequence& theShapeSeqL,
                                                const TDF_Label& theGeomTolL,
                                                const Handle(StepDimTol_HArray1OfDatumSystemOrReference)& theDatumSystem,
-                                               const Handle(StepRepr_RepresentationContext)& theRC)
+                                               const Handle(StepRepr_RepresentationContext)& theRC,
+                                               const StepData_Factors& theLocalFactors)
 {
   // Get working data
   const Handle(Interface_InterfaceModel)& aModel = theWS->Model();
@@ -3532,7 +3544,7 @@ void STEPCAFControl_Writer::writeGeomTolerance(const Handle(XSControl_WorkSessio
   writeToleranceZone(theWS, anObject, aGeomTol, theRC);
   //Annotation plane and Presentation
   writePresentation(theWS, anObject->GetPresentation(), anObject->GetPresentationName(), Standard_True, anObject->HasPlane(),
-                    anObject->GetPlane(), anObject->GetPointTextAttach(), aGeomTol);
+                    anObject->GetPlane(), anObject->GetPointTextAttach(), aGeomTol, theLocalFactors);
 }
 
 //=======================================================================
@@ -3914,7 +3926,8 @@ Standard_Boolean STEPCAFControl_Writer::writeDGTs(const Handle(XSControl_WorkSes
 //purpose  :
 //=======================================================================
 Standard_Boolean STEPCAFControl_Writer::writeDGTsAP242(const Handle(XSControl_WorkSession)& theWS,
-                                                       const TDF_LabelSequence& theLabels)
+                                                       const TDF_LabelSequence& theLabels,
+                                                       const StepData_Factors& theLocalFactors)
 {
   (void)theLabels;
   // Get working data
@@ -3970,7 +3983,8 @@ Standard_Boolean STEPCAFControl_Writer::writeDGTsAP242(const Handle(XSControl_Wo
     Handle(Standard_Transient) aWrittenDatum;
     Standard_Boolean isFirstDT = !aDatumMap.Find(aDatumName, aWrittenDatum);
     Handle(StepDimTol_Datum) aDatum = writeDatumAP242(theWS, aShapeL, aDatumL, isFirstDT,
-                                                      Handle(StepDimTol_Datum)::DownCast(aWrittenDatum));
+                                                      Handle(StepDimTol_Datum)::DownCast(aWrittenDatum),
+                                                      theLocalFactors);
     // Add created Datum into Map
     aDatumMap.Bind(aDatumName, aDatum);
   }
@@ -4012,7 +4026,7 @@ Standard_Boolean STEPCAFControl_Writer::writeDGTsAP242(const Handle(XSControl_Wo
       aSA->Init(new TCollection_HAsciiString(), new TCollection_HAsciiString(), myGDTCommonPDS, StepData_LTrue);
       aModel->AddWithRefs(aSA);
       writePresentation(theWS, anObject->GetPresentation(), anObject->GetPresentationName(), anObject->HasPlane(),
-                        Standard_False, anObject->GetPlane(), anObject->GetPointTextAttach(), aSA);
+                        Standard_False, anObject->GetPlane(), anObject->GetPointTextAttach(), aSA, theLocalFactors);
     }
 
     if (!XCAFDoc_DimTolTool::GetRefShapeLabel(aDimensionL, aFirstShapeL, aSecondShapeL))
@@ -4084,14 +4098,14 @@ Standard_Boolean STEPCAFControl_Writer::writeDGTsAP242(const Handle(XSControl_Wo
     if (anObject->GetType() == XCAFDimTolObjects_DimensionType_DimensionPresentation)
     {
       writePresentation(theWS, anObject->GetPresentation(), anObject->GetPresentationName(), anObject->HasPlane(),
-                        Standard_False, anObject->GetPlane(), anObject->GetPointTextAttach(), aFirstSA);
+                        Standard_False, anObject->GetPlane(), anObject->GetPointTextAttach(), aFirstSA, theLocalFactors);
       continue;
     }
 
     // Write dimensions
     StepShape_DimensionalCharacteristic aDimension;
     if (anObject->HasPoint() || anObject->HasPoint2())
-      WriteDerivedGeometry(theWS, anObject, aCGRepr, aFirstSA, aSecondSA, aConnectionPnts);
+      WriteDerivedGeometry(theWS, anObject, aCGRepr, aFirstSA, aSecondSA, aConnectionPnts, theLocalFactors);
     XCAFDimTolObjects_DimensionType aDimType = anObject->GetType();
     if (STEPCAFControl_GDTProperty::IsDimensionalLocation(aDimType))
     {
@@ -4165,10 +4179,10 @@ Standard_Boolean STEPCAFControl_Writer::writeDGTsAP242(const Handle(XSControl_Wo
     }
 
     // Write values
-    WriteDimValues(theWS, anObject, aRC, aDimension);
+    WriteDimValues(theWS, anObject, aRC, aDimension, theLocalFactors);
     //Annotation plane and Presentation
     writePresentation(theWS, anObject->GetPresentation(), anObject->GetPresentationName(), Standard_True, anObject->HasPlane(),
-                      anObject->GetPlane(), anObject->GetPointTextAttach(), aDimension.Value());
+                      anObject->GetPlane(), anObject->GetPointTextAttach(), aDimension.Value(), theLocalFactors);
   }
   // Write Derived geometry
   if (aConnectionPnts.Length() > 0)
@@ -4203,8 +4217,8 @@ Standard_Boolean STEPCAFControl_Writer::writeDGTsAP242(const Handle(XSControl_Wo
     XCAFDoc_DimTolTool::GetDatumWithObjectOfTolerLabels(aGeomTolL, aDatumSeq);
     Handle(StepDimTol_HArray1OfDatumSystemOrReference) aDatumSystem;
     if (aDatumSeq.Length() > 0)
-      aDatumSystem = WriteDatumSystem(theWS, aGeomTolL, aDatumSeq, aDatumMap, aRC);
-    writeGeomTolerance(theWS, aFirstShapeL, aGeomTolL, aDatumSystem, aRC);
+      aDatumSystem = WriteDatumSystem(theWS, aGeomTolL, aDatumSeq, aDatumMap, aRC, theLocalFactors);
+    writeGeomTolerance(theWS, aFirstShapeL, aGeomTolL, aDatumSystem, aRC, theLocalFactors);
   }
 
   // Write Draughting model for Annotation Planes
index f35dafd28bb5237abe431139dc545431da742546..8261c03a0d1206344fa431bcd3f1c8c8284b8a90 100644 (file)
@@ -38,6 +38,7 @@ class XSControl_WorkSession;
 class TDocStd_Document;
 class STEPCAFControl_ExternFile;
 class TopoDS_Shape;
+class StepData_Factors;
 
 //! Provides a tool to write DECAF document to the
 //! STEP file. Besides transfer of shapes (including
@@ -188,6 +189,7 @@ protected:
   TopoDS_Shape transferExternFiles(const TDF_Label& theLabel,
                                    const STEPControl_StepModelType theMode,
                                    TDF_LabelSequence& theLabelSeq,
+                                   const StepData_Factors& theLocalFactors,
                                    const Standard_CString thePrefix = "",
                                    const Message_ProgressRange& theProgress = Message_ProgressRange());
 
@@ -209,7 +211,8 @@ protected:
 
   //! Write D&GTs assigned to specified labels, to STEP model, according AP242
   Standard_Boolean writeDGTsAP242(const Handle(XSControl_WorkSession)& theWS,
-                                  const TDF_LabelSequence& theLabels);
+                                  const TDF_LabelSequence& theLabels,
+                                  const StepData_Factors& theLocalFactors);
 
   //! Write materials assigned to specified labels, to STEP model
   Standard_Boolean writeMaterials(const Handle(XSControl_WorkSession)& theWS,
@@ -233,7 +236,8 @@ protected:
   //! If it exists, initializes local length unit from it
   //! Else initializes according to Cascade length unit
   void prepareUnit(const TDF_Label& theLabel,
-                   const Handle(StepData_StepModel)& theModel);
+                   const Handle(StepData_StepModel)& theModel,
+                   StepData_Factors& theLocalFactors);
 
   Handle(StepRepr_ShapeAspect) writeShapeAspect(const Handle(XSControl_WorkSession)& theWS,
                                                 const TDF_Label theLabel,
@@ -248,13 +252,15 @@ protected:
                          const Standard_Boolean theHasPlane,
                          const gp_Ax2& theAnnotationPlane,
                          const gp_Pnt& theTextPosition,
-                         const Handle(Standard_Transient)& theDimension);
+                         const Handle(Standard_Transient)& theDimension,
+                         const StepData_Factors& theLocalFactors);
 
   Handle(StepDimTol_Datum) writeDatumAP242(const Handle(XSControl_WorkSession)& theWS,
                                            const TDF_LabelSequence& theShapeL,
                                            const TDF_Label& theDatumL,
                                            const Standard_Boolean isFirstDTarget,
-                                           const Handle(StepDimTol_Datum)& theWrittenDatum);
+                                           const Handle(StepDimTol_Datum)& theWrittenDatum,
+                                           const StepData_Factors& theLocalFactors);
 
   void writeToleranceZone(const Handle(XSControl_WorkSession)& theWS,
                           const Handle(XCAFDimTolObjects_GeomToleranceObject)& theObject,
@@ -265,7 +271,8 @@ protected:
                           const TDF_LabelSequence& theShapeSeqL,
                           const TDF_Label& theGeomTolL,
                           const Handle(StepDimTol_HArray1OfDatumSystemOrReference)& theDatumSystem,
-                          const Handle(StepRepr_RepresentationContext)& theRC);
+                          const Handle(StepRepr_RepresentationContext)& theRC,
+                          const StepData_Factors& theLocalFactors);
 
 private:
 
index 873e91cf956251907e6fec650b165443b42ff0e4..3f15bf466d97ee2dddbd0b3cbd7324d9a498b2f7 100644 (file)
@@ -82,6 +82,15 @@ void STEPConstruct_ContextTool::SetModel (const Handle(StepData_StepModel)& aSte
   }
 }
 
+//=======================================================================
+//function : SetGlobalFactor
+//purpose  :
+//=======================================================================
+void STEPConstruct_ContextTool::SetGlobalFactor(const StepData_Factors& theGlobalFactor)
+{
+  myGlobalFactor = theGlobalFactor;
+}
+
 //=======================================================================
 //function : GetAPD
 //purpose  :
@@ -445,7 +454,7 @@ void STEPConstruct_ContextTool::SetSDR (const Handle(StepShape_ShapeDefinitionRe
 Handle(StepGeom_Axis2Placement3d) STEPConstruct_ContextTool::GetDefaultAxis ()
 {
   if ( myAxis.IsNull() ) {
-    GeomToStep_MakeAxis2Placement3d mkax;
+    GeomToStep_MakeAxis2Placement3d mkax(myGlobalFactor);
     myAxis = mkax.Value();
   }
   return myAxis;
index 732a88aa11ed227065c80342d7d86bbf03f4a43f..112aecc2600418cf49bed6f53145c568e07d44ca 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <TColStd_SequenceOfInteger.hxx>
 #include <STEPConstruct_AP203Context.hxx>
+#include <StepData_Factors.hxx>
 #include <Standard_Integer.hxx>
 #include <TColStd_HSequenceOfTransient.hxx>
 class StepBasic_ApplicationProtocolDefinition;
@@ -54,6 +55,8 @@ public:
   //! Initialize ApplicationProtocolDefinition by the first
   //! entity of that type found in the model
   Standard_EXPORT void SetModel (const Handle(StepData_StepModel)& aStepModel);
+
+  Standard_EXPORT void SetGlobalFactor(const StepData_Factors& theGlobalFactor);
   
   Standard_EXPORT Handle(StepBasic_ApplicationProtocolDefinition) GetAPD();
   
@@ -139,7 +142,7 @@ private:
   Handle(StepBasic_ApplicationProtocolDefinition) theAPD;
   STEPConstruct_AP203Context theAP203;
   Handle(StepGeom_Axis2Placement3d) myAxis;
-
+  StepData_Factors myGlobalFactor;
 
 };
 
index 665e80292ae9e3bc7915c48c50031ca75c331e91..57a5fb485c560bb5cd4454cfc02e13b5ab854daa 100644 (file)
@@ -33,8 +33,8 @@
 #include <StepBasic_SiUnitAndPlaneAngleUnit.hxx>
 #include <StepBasic_SiUnitAndSolidAngleUnit.hxx>
 #include <StepBasic_SiUnitAndVolumeUnit.hxx>
-#include <StepData_GlobalFactors.hxx>
 #include <STEPConstruct_UnitContext.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx.hxx>
 #include <StepRepr_GlobalUncertaintyAssignedContext.hxx>
 #include <StepRepr_GlobalUnitAssignedContext.hxx>
@@ -63,7 +63,8 @@ STEPConstruct_UnitContext::STEPConstruct_UnitContext()
 //purpose  : 
 //=======================================================================
 
-void STEPConstruct_UnitContext::Init(const Standard_Real Tol3d) 
+void STEPConstruct_UnitContext::Init(const Standard_Real Tol3d,
+                                     const StepData_Factors& theLocalFactors)
 {
   done = Standard_True;
 
@@ -155,7 +156,7 @@ void STEPConstruct_UnitContext::Init(const Standard_Real Tol3d)
   
   Handle(StepBasic_MeasureValueMember) mvs = new StepBasic_MeasureValueMember;
   mvs->SetName("LENGTH_MEASURE");
-  mvs->SetReal ( Tol3d / StepData_GlobalFactors::Intance().LengthFactor() );
+  mvs->SetReal ( Tol3d / theLocalFactors.LengthFactor() );
   StepBasic_Unit Unit;
   Unit.SetValue ( lengthUnit );
   theTol3d->Init(mvs, Unit, TolName, TolDesc);
@@ -242,7 +243,8 @@ Standard_Boolean STEPConstruct_UnitContext::SiUnitNameFactor(const Handle(StepBa
 // Purpose : 
 // ==========================================================================
 
-Standard_Integer STEPConstruct_UnitContext::ComputeFactors(const Handle(StepRepr_GlobalUnitAssignedContext)& aContext)
+Standard_Integer STEPConstruct_UnitContext::ComputeFactors(const Handle(StepRepr_GlobalUnitAssignedContext)& aContext,
+                                                           const StepData_Factors& theLocalFactors)
 {
   Standard_Integer status = 0;
 
@@ -268,7 +270,7 @@ Standard_Integer STEPConstruct_UnitContext::ComputeFactors(const Handle(StepRepr
   
   for (Standard_Integer i = 1; i <= nbU; i++) {
     Handle(StepBasic_NamedUnit) theNamedUnit = aContext->UnitsValue(i);
-    status = ComputeFactors(theNamedUnit);
+    status = ComputeFactors(theNamedUnit, theLocalFactors);
 #ifdef OCCT_DEBUG
     if(status == -1)
       std::cout << " -- STEPConstruct_UnitContext:ComputeFactor: Unit item no." << i << " is not recognized" << std::endl;
@@ -278,7 +280,8 @@ Standard_Integer STEPConstruct_UnitContext::ComputeFactors(const Handle(StepRepr
 } 
 
 
-Standard_Integer STEPConstruct_UnitContext::ComputeFactors(const Handle(StepBasic_NamedUnit)& aUnit)
+Standard_Integer STEPConstruct_UnitContext::ComputeFactors(const Handle(StepBasic_NamedUnit)& aUnit,
+                                                           const StepData_Factors& theLocalFactors)
 {
 
   //:f3 abv 8 Apr 98: ProSTEP TR8 tr8_as_sd_sw: the case of unrecognized entity
@@ -379,7 +382,7 @@ Standard_Integer STEPConstruct_UnitContext::ComputeFactors(const Handle(StepBasi
     return 0;
   }
   
-  const Standard_Real aCascadeUnit = StepData_GlobalFactors::Intance().CascadeUnit();
+  const Standard_Real aCascadeUnit = theLocalFactors.CascadeUnit();
   if (aUnit->IsKind(STANDARD_TYPE(StepBasic_ConversionBasedUnitAndLengthUnit))||
       aUnit->IsKind(STANDARD_TYPE(StepBasic_SiUnitAndLengthUnit))) {
 #ifdef METER
index a656e27a2a7c7995db1ed90e47b5c7eae6b620c5..40a1bd5e2e6b0de74632048b214592690521586c 100644 (file)
@@ -24,6 +24,7 @@
 #include <Standard_Integer.hxx>
 #include <Standard_CString.hxx>
 #include <StepBasic_SiPrefix.hxx>
+class StepData_Factors;
 class StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx;
 class StepRepr_GlobalUnitAssignedContext;
 class StepBasic_NamedUnit;
@@ -45,7 +46,8 @@ public:
   
   //! Creates new context (units are MM and radians,
   //! uncertainty equal to Tol3d)
-  Standard_EXPORT void Init (const Standard_Real Tol3d);
+  Standard_EXPORT void Init (const Standard_Real Tol3d,
+                             const StepData_Factors& theLocalFactors);
   
   //! Returns True if Init was called successfully
   Standard_EXPORT Standard_Boolean IsDone() const;
@@ -55,9 +57,11 @@ public:
   
   //! Computes the length, plane angle and solid angle conversion
   //! factor  .  Returns a status, 0 if OK
-  Standard_EXPORT Standard_Integer ComputeFactors (const Handle(StepRepr_GlobalUnitAssignedContext)& aContext);
+  Standard_EXPORT Standard_Integer ComputeFactors (const Handle(StepRepr_GlobalUnitAssignedContext)& aContext,
+                                                   const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT Standard_Integer ComputeFactors (const Handle(StepBasic_NamedUnit)& aUnit);
+  Standard_EXPORT Standard_Integer ComputeFactors (const Handle(StepBasic_NamedUnit)& aUnit,
+                                                   const StepData_Factors& theLocalFactors);
   
   //! Computes the uncertainty value (for length)
   Standard_EXPORT Standard_Integer ComputeTolerance (const Handle(StepRepr_GlobalUncertaintyAssignedContext)& aContext);
index 4b100b3a2ee92a9254a09ecbe24153e59be1351d..558b97dc637ad1d7bdaf4d9c98c827d04119d5c8 100644 (file)
@@ -29,6 +29,7 @@
 #include <StepBasic_SiUnitAndLengthUnit.hxx>
 #include <STEPConstruct_UnitContext.hxx>
 #include <STEPConstruct_ValidationProps.hxx>
+#include <StepData_Factors.hxx>
 #include <StepData_StepModel.hxx>
 #include <StepGeom_CartesianPoint.hxx>
 #include <StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext.hxx>
@@ -623,7 +624,9 @@ TopoDS_Shape STEPConstruct_ValidationProps::GetPropShape (const Handle(StepRepr_
 //=======================================================================
 
 Standard_Boolean STEPConstruct_ValidationProps::GetPropReal (const Handle(StepRepr_RepresentationItem) &item,
-                                                            Standard_Real &Val, Standard_Boolean &isArea) const
+                                                             Standard_Real &Val,
+                                                             Standard_Boolean &isArea,
+                                                             const StepData_Factors& theLocalFactors) const
 {
   // decode volume & area
   if ( ! item->IsKind(STANDARD_TYPE(StepRepr_MeasureRepresentationItem)) ) 
@@ -644,7 +647,7 @@ Standard_Boolean STEPConstruct_ValidationProps::GetPropReal (const Handle(StepRe
       Standard_Real exp = DUE->Exponent();
       Handle(StepBasic_NamedUnit) NU = DUE->Unit();
       STEPConstruct_UnitContext unit;
-      unit.ComputeFactors(NU);
+      unit.ComputeFactors(NU, theLocalFactors);
       if(unit.LengthDone()) {
        Standard_Real lengthFactor = unit.LengthFactor();
        scale *= pow(lengthFactor,exp);
@@ -655,7 +658,7 @@ Standard_Boolean STEPConstruct_ValidationProps::GetPropReal (const Handle(StepRe
     Handle(StepBasic_NamedUnit) NU = Unit.NamedUnit();
     if(!NU.IsNull()) {
       STEPConstruct_UnitContext unit;
-      unit.ComputeFactors(NU);
+      unit.ComputeFactors(NU, theLocalFactors);
       if(unit.AreaDone())
        scale =  unit.AreaFactor();
       if(unit.VolumeDone())
@@ -682,8 +685,9 @@ Standard_Boolean STEPConstruct_ValidationProps::GetPropReal (const Handle(StepRe
 //=======================================================================
 
 Standard_Boolean STEPConstruct_ValidationProps::GetPropPnt (const Handle(StepRepr_RepresentationItem) &item,
-                                                           const Handle(StepRepr_RepresentationContext) &Context,
-                                                           gp_Pnt &Pnt) const
+                                                            const Handle(StepRepr_RepresentationContext) &Context,
+                                                            gp_Pnt &Pnt,
+                                                            const StepData_Factors& theLocalFactors) const
 {
   // centroid
   if ( ! item->IsKind(STANDARD_TYPE(StepGeom_CartesianPoint)) ) 
@@ -713,7 +717,7 @@ Standard_Boolean STEPConstruct_ValidationProps::GetPropPnt (const Handle(StepRep
     }
     if ( ! theGUAC.IsNull() ) {
       STEPConstruct_UnitContext UnitTool;
-      UnitTool.ComputeFactors(theGUAC);
+      UnitTool.ComputeFactors(theGUAC, theLocalFactors);
       gp_Pnt zero(0,0,0);
       pos.Scale ( zero, UnitTool.LengthFactor() );
     }
index b25b35eb805aec166d682813e372e0e200393bd0..4a7bec3d51a21c4c86c515023602bc960e1e15a6 100644 (file)
@@ -26,6 +26,7 @@
 #include <Standard_CString.hxx>
 #include <TColStd_SequenceOfTransient.hxx>
 class StepBasic_ProductDefinition;
+class StepData_Factors;
 class XSControl_WorkSession;
 class TopoDS_Shape;
 class StepRepr_RepresentationItem;
@@ -111,10 +112,16 @@ public:
   //! If Property is neither Area nor Volume, returns False
   //! Else returns True and isArea indicates whether property
   //! is area or volume
-  Standard_EXPORT Standard_Boolean GetPropReal (const Handle(StepRepr_RepresentationItem)& item, Standard_Real& Val, Standard_Boolean& isArea) const;
+  Standard_EXPORT Standard_Boolean GetPropReal (const Handle(StepRepr_RepresentationItem)& item,
+                                                Standard_Real& Val,
+                                                Standard_Boolean& isArea,
+                                                const StepData_Factors& theLocalFactors) const;
   
   //! Returns value of Centriod property (or False if it is not)
-  Standard_EXPORT Standard_Boolean GetPropPnt (const Handle(StepRepr_RepresentationItem)& item, const Handle(StepRepr_RepresentationContext)& Context, gp_Pnt& Pnt) const;
+  Standard_EXPORT Standard_Boolean GetPropPnt (const Handle(StepRepr_RepresentationItem)& item,
+                                               const Handle(StepRepr_RepresentationContext)& Context,
+                                               gp_Pnt& Pnt,
+                                               const StepData_Factors& theLocalFactors) const;
   
   //! Sets current assembly shape SDR (for FindCDSR calls)
   Standard_EXPORT void SetAssemblyShape (const TopoDS_Shape& shape);
index a3f81219fbbb8712b76328eff16c0162a2cd80d1..fcdd8c7ab44786905bb3993d8f32c0a3f8610c6c 100644 (file)
@@ -41,8 +41,8 @@
 #include <STEPConstruct_Assembly.hxx>
 #include <STEPConstruct_UnitContext.hxx>
 #include <STEPControl_ActorRead.hxx>
+#include <StepData_Factors.hxx>
 #include <StepData_StepModel.hxx>
-#include <StepData_GlobalFactors.hxx>
 #include <StepDimTol_DatumFeature.hxx>
 #include <StepDimTol_GeometricTolerance.hxx>
 #include <StepDimTol_GeoTolAndGeoTolWthDatRefAndModGeoTolAndPosTol.hxx>
@@ -296,12 +296,15 @@ Handle(Transfer_Binder)  STEPControl_ActorRead::Transfer
  const Message_ProgressRange& theProgress)
 {  
   // [BEGIN] Get version of preprocessor (to detect I-Deas case) (ssv; 23.11.2010)
+  StepData_Factors aLocalFactors;
   Handle(StepData_StepModel) aStepModel = Handle(StepData_StepModel)::DownCast ( TP->Model() );
   if (!aStepModel->IsInitializedUnit())
   {
     XSAlgo::AlgoContainer()->PrepareForTransfer(); // update unit info
     aStepModel->SetLocalLengthUnit(UnitsMethods::GetCasCadeLengthUnit());
+    aLocalFactors.SetCascadeUnit(UnitsMethods::GetCasCadeLengthUnit());
   }
+  aLocalFactors.SetCascadeUnit(aStepModel->LocalLengthUnit());
   Interface_EntityIterator anEntIt = aStepModel->Header();
   for ( anEntIt.Start(); anEntIt.More(); anEntIt.Next() ) {
     DeclareAndCast( HeaderSection_FileName, aFileNameEntity, anEntIt.Value() );
@@ -323,7 +326,7 @@ Handle(Transfer_Binder)  STEPControl_ActorRead::Transfer
   }
   // [END] Get version of preprocessor (to detect I-Deas case) (ssv; 23.11.2010)
   Standard_Boolean aTrsfUse = (Interface_Static::IVal("read.step.root.transformation") == 1);
-  return TransferShape(start, TP, Standard_True, aTrsfUse, theProgress);
+  return TransferShape(start, TP, aLocalFactors, Standard_True, aTrsfUse, theProgress);
 }
 
 
@@ -492,6 +495,7 @@ static void getSDR(const Handle(StepRepr_ProductDefinitionShape)& PDS,
  Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity
                    (const Handle(StepBasic_ProductDefinition)& PD,
                     const Handle(Transfer_TransientProcess)& TP,
+                    const StepData_Factors& theLocalFactors,
                     const Standard_Boolean theUseTrsf,
                     const Message_ProgressRange& theProgress)
 
@@ -577,7 +581,7 @@ static void getSDR(const Handle(StepRepr_ProductDefinitionShape)& PDS,
 #endif
     Handle(Transfer_Binder) binder;
     Message_ProgressRange aRange = PS.Next();
-    if (!TP->IsBound(NAUO)) binder = TransferEntity(NAUO,TP, aRange);
+    if (!TP->IsBound(NAUO)) binder = TransferEntity(NAUO, TP, theLocalFactors, aRange);
     else                       binder = TP->Find(NAUO);
 
     TopoDS_Shape theResult = TransferBRep::ShapeResult (binder);
@@ -618,7 +622,7 @@ static void getSDR(const Handle(StepRepr_ProductDefinitionShape)& PDS,
     Standard_Boolean useTrsf = theUseTrsf && (i <= nbNotAspect);
     Handle(Transfer_Binder) binder = TP->Find(rep);
     if (binder.IsNull())
-      binder = TransferEntity(rep, TP, isBound, useTrsf, aPS1.Next());
+      binder = TransferEntity(rep, TP, theLocalFactors, isBound, useTrsf, aPS1.Next());
 
     // if SDR is obtained from ShapeAspect and representation items have already been tramnslated,
     // this means that that ShapeAspect is used to refer to sub-shape of the main shape
@@ -668,7 +672,7 @@ static void getSDR(const Handle(StepRepr_ProductDefinitionShape)& PDS,
           // SKL for bug 29068: parameter useTrsf is used because if root entity has connection with other
           // by ShapeRepresentationRelationship then result after such transferring need to transform also.
           // This case is from test "bugs modalg_7 bug30196"
-          binder = TransferEntity(SRR, TP, nbrep, useTrsf, aPS1.Next());
+          binder = TransferEntity(SRR, TP, theLocalFactors, nbrep, useTrsf, aPS1.Next());
           if (! binder.IsNull()) {
             theResult = TransferBRep::ShapeResult (binder);
             Result1 = theResult;
@@ -680,7 +684,7 @@ static void getSDR(const Handle(StepRepr_ProductDefinitionShape)& PDS,
         {
           Handle(StepRepr_ConstructiveGeometryRepresentationRelationship) aCSRR =
             Handle(StepRepr_ConstructiveGeometryRepresentationRelationship)::DownCast(anitem);
-           binder = TransferEntity(aCSRR, TP);
+           binder = TransferEntity(aCSRR, TP, theLocalFactors);
            if (! binder.IsNull())
            {
              Result1 = TransferBRep::ShapeResult (binder);
@@ -715,6 +719,7 @@ static void getSDR(const Handle(StepRepr_ProductDefinitionShape)& PDS,
 Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity
                    (const Handle(StepRepr_NextAssemblyUsageOccurrence)& NAUO,
                     const Handle(Transfer_TransientProcess)& TP,
+                    const StepData_Factors& theLocalFactors,
                     const Message_ProgressRange& theProgress)
 {
  Handle(TransferBRep_ShapeBinder) shbinder;
@@ -740,7 +745,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity
       Handle(StepRepr_Representation) rep = ( SRRReversed ? RR->Rep2() : RR->Rep1() );
       if(rep.IsNull())
         continue;
-      iatrsf = ComputeSRRWT ( RR, TP, Trsf );
+      iatrsf = ComputeSRRWT ( RR, TP, Trsf, theLocalFactors);
       // find real ProductDefinition used rep
       Interface_EntityIterator subs3 = TP->Graph().Sharings(rep);
       for (subs3.Start(); subs3.More(); subs3.Next()) {
@@ -776,7 +781,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity
 
     if(!PD.IsNull()) {
       binder = TP->Find(PD);
-      if (binder.IsNull()) binder = TransferEntity(PD, TP, Standard_False, aPS.Next());
+      if (binder.IsNull()) binder = TransferEntity(PD, TP, theLocalFactors, Standard_False, aPS.Next());
       theResult = TransferBRep::ShapeResult(binder);
       if (!theResult.IsNull()) {
         if (iatrsf) {
@@ -790,7 +795,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity
     if ( theResult.IsNull() && !SRR.IsNull() ) {
       binder = TP->Find(SRR);
       if ( binder.IsNull() ) {
-        binder = TransferEntity(SRR, TP, 0, Standard_False, aPS.Next());
+        binder = TransferEntity(SRR, TP, theLocalFactors, 0, Standard_False, aPS.Next());
         theResult = TransferBRep::ShapeResult (binder);
         if (!theResult.IsNull())
           shbinder = new TransferBRep_ShapeBinder (theResult);
@@ -810,6 +815,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity
 Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(
     const Handle(StepShape_ShapeRepresentation)& sr,
     const Handle(Transfer_TransientProcess)& TP,
+    const StepData_Factors& theLocalFactors,
     Standard_Boolean& isBound,
     const Standard_Boolean theUseTrsf,
     const Message_ProgressRange& theProgress)
@@ -830,7 +836,8 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(
   
     // Compute unit conversion factors and geometric Accuracy
   Handle(StepRepr_Representation) oldSRContext = mySRContext; //:S4136
-  PrepareUnits(sr,TP);
+  StepData_Factors aLocalFactors = theLocalFactors;
+  PrepareUnits(sr, TP, aLocalFactors);
   
   BRep_Builder B;
   TopoDS_Compound comp;
@@ -901,7 +908,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(
         if (!subs3.More())
         {
           Handle(StepGeom_Axis2Placement3d) aCS = Handle(StepGeom_Axis2Placement3d)::DownCast(anitem);
-          Handle(Geom_Axis2Placement) aTargAP = StepToGeom::MakeAxis2Placement(aCS);
+          Handle(Geom_Axis2Placement) aTargAP = StepToGeom::MakeAxis2Placement(aCS, aLocalFactors);
           if (!aTargAP.IsNull())
           {
             const gp_Ax3 ax3Orig(gp_Pnt(0., 0., 0), gp_Vec(0., 0., 1.), gp_Vec(1., 0., 0.));
@@ -920,7 +927,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(
     }
     Handle(Transfer_Binder) binder;
     if (!TP->IsBound(anitem)) {
-      binder = TransferShape(anitem, TP, isManifold, Standard_False, aRange);
+      binder = TransferShape(anitem, TP, aLocalFactors, isManifold, Standard_False, aRange);
     }
     else {
       isBound = Standard_True;
@@ -1043,7 +1050,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(
     shbinder = new TransferBRep_ShapeBinder(comp);
   }
 
-  PrepareUnits ( oldSRContext, TP ); //:S4136
+  PrepareUnits ( oldSRContext, TP, aLocalFactors); //:S4136
   TP->Bind(sr, shbinder);
 
   
@@ -1062,6 +1069,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(
 Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity
                    (const Handle(StepShape_ContextDependentShapeRepresentation)& CDSR,
                     const Handle(Transfer_TransientProcess)& TP,
+                    const StepData_Factors& theLocalFactors,
                     const Message_ProgressRange& theProgress)
 {
   Handle(TransferBRep_ShapeBinder) shbinder;
@@ -1079,11 +1087,11 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity
   TopoDS_Shape theResult;
   
   gp_Trsf Trsf;
-  Standard_Boolean iatrsf = ComputeSRRWT ( SRR, TP, Trsf );
+  Standard_Boolean iatrsf = ComputeSRRWT ( SRR, TP, Trsf, theLocalFactors);
 
   Handle(Transfer_Binder) binder;
   Standard_Boolean isBound = Standard_False;
-  if (!TP->IsBound(rep)) binder = TransferEntity(rep, TP, isBound, Standard_False, theProgress);
+  if (!TP->IsBound(rep)) binder = TransferEntity(rep, TP, theLocalFactors, isBound, Standard_False, theProgress);
   else binder = TP->Find(rep);
   theResult = TransferBRep::ShapeResult(binder);
       
@@ -1107,6 +1115,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity
 Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(
     const Handle(StepRepr_ShapeRepresentationRelationship)& und,
     const Handle(Transfer_TransientProcess)& TP,
+    const StepData_Factors& theLocalFactors,
     const Standard_Integer nbrep,
     const Standard_Boolean theUseTrsf,
     const Message_ProgressRange& theProgress)
@@ -1126,7 +1135,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(
   Standard_Integer nsh = 0;
   
   gp_Trsf Trsf;
-  Standard_Boolean iatrsf = ComputeSRRWT ( und, TP, Trsf );
+  Standard_Boolean iatrsf = ComputeSRRWT(und, TP, Trsf, theLocalFactors);
   
   //    Transfert : que faut-il prendre au juste ?
   Message_ProgressScope aPS(theProgress, NULL, 2);
@@ -1141,7 +1150,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(
     Handle(StepShape_ShapeRepresentation) anitem = Handle(StepShape_ShapeRepresentation)::DownCast(anitemt);
     Handle(Transfer_Binder) binder;
     Standard_Boolean isBound = Standard_False;
-    if (!TP->IsBound(anitem)) binder = TransferEntity(anitem, TP, isBound, theUseTrsf, aRange);
+    if (!TP->IsBound(anitem)) binder = TransferEntity(anitem, TP, theLocalFactors, isBound, theUseTrsf, aRange);
     else                     binder = TP->Find(anitem);
     TopoDS_Shape theResult = TransferBRep::ShapeResult (binder);
     if (!theResult.IsNull()) {
@@ -1175,7 +1184,8 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(
 
 Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(
     const Handle(StepRepr_ConstructiveGeometryRepresentationRelationship)& theCGRR,
-    const Handle(Transfer_TransientProcess)& theTP)
+    const Handle(Transfer_TransientProcess)& theTP,
+    const StepData_Factors& theLocalFactors)
 {
  
   Handle(TransferBRep_ShapeBinder) shbinder;
@@ -1183,6 +1193,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(
     return shbinder;
   Standard_Boolean resetUnits = Standard_False;
   Handle(StepRepr_Representation) oldSRContext = mySRContext;
+  StepData_Factors aLocalFactors = theLocalFactors;
   TopoDS_Compound aComp;
   BRep_Builder aB;
   aB.MakeCompound(aComp);
@@ -1194,7 +1205,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(
       continue;
     if(mySRContext.IsNull() || aCRepr->ContextOfItems() != mySRContext->ContextOfItems())
     {
-      PrepareUnits(aCRepr,theTP);
+      PrepareUnits(aCRepr,theTP, aLocalFactors);
       resetUnits = Standard_True;
     }
     Standard_Integer j =1;
@@ -1207,7 +1218,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(
         Handle(StepGeom_Axis2Placement3d)::DownCast(anItem);
       if( !aStepAxis.IsNull())
       {
-        Handle(Geom_Axis2Placement) anAxis = StepToGeom::MakeAxis2Placement (aStepAxis);
+        Handle(Geom_Axis2Placement) anAxis = StepToGeom::MakeAxis2Placement (aStepAxis, aLocalFactors);
         if(anAxis.IsNull())
           continue;
         Handle(Geom_Plane) aPlane = new Geom_Plane(gp_Ax3(anAxis->Ax2()));
@@ -1223,7 +1234,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity(
   shbinder = new TransferBRep_ShapeBinder (aComp);
   mySRContext = oldSRContext;
   if(oldSRContext.IsNull() || resetUnits)
-    PrepareUnits(oldSRContext,theTP);
+    PrepareUnits(oldSRContext, theTP, aLocalFactors);
 
   theTP->Bind(theCGRR, shbinder);
   
@@ -1382,6 +1393,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::OldWay
 Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity
                    (const Handle(StepGeom_GeometricRepresentationItem)& start,
                     const Handle(Transfer_TransientProcess)& TP,
+                    const StepData_Factors& theLocalFactors,
                     const Standard_Boolean isManifold,
                     const Message_ProgressRange& theProgress)
 {
@@ -1400,14 +1412,15 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity
 #endif
   
   //:S4136
+  StepData_Factors aLocalFactors = theLocalFactors;
   Handle(StepRepr_Representation) oldSRContext = mySRContext;
   if ( mySRContext.IsNull() ) { // if no context, try to find it (ex: r0701_ug.stp #4790)
     Handle(StepRepr_Representation) context = FindContext ( start, TP );
     if ( context.IsNull() ) {
       TP->AddWarning ( start, "Entity with no unit context; default units taken" );
-      ResetUnits();
+      ResetUnits(aLocalFactors);
     }
-    else PrepareUnits ( context, TP );
+    else PrepareUnits ( context, TP, aLocalFactors);
   }
   myShapeBuilder.SetPrecision(myPrecision);
   myShapeBuilder.SetMaxTol(myMaxTol);
@@ -1421,35 +1434,35 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity
     OCC_CATCH_SIGNALS
     Message_ProgressRange aRange = aPS.Next();
     if (start->IsKind(STANDARD_TYPE(StepShape_FacetedBrep))) {
-      myShapeBuilder.Init(GetCasted(StepShape_FacetedBrep, start), TP, aRange);
+      myShapeBuilder.Init(GetCasted(StepShape_FacetedBrep, start), TP, aLocalFactors, aRange);
       found = Standard_True;
     } 
     else if (start->IsKind(STANDARD_TYPE(StepShape_BrepWithVoids))) {
-      myShapeBuilder.Init(GetCasted(StepShape_BrepWithVoids, start), TP, aRange);
+      myShapeBuilder.Init(GetCasted(StepShape_BrepWithVoids, start), TP, aLocalFactors, aRange);
       found = Standard_True;
     } 
     else if (start->IsKind(STANDARD_TYPE(StepShape_ManifoldSolidBrep))) {
-      myShapeBuilder.Init(GetCasted(StepShape_ManifoldSolidBrep, start), TP, aRange);
+      myShapeBuilder.Init(GetCasted(StepShape_ManifoldSolidBrep, start), TP, aLocalFactors, aRange);
       found = Standard_True;
     } 
     else if (start->IsKind(STANDARD_TYPE(StepShape_ShellBasedSurfaceModel))) {
-      myShapeBuilder.Init(GetCasted(StepShape_ShellBasedSurfaceModel, start), TP, myNMTool, aRange);
+      myShapeBuilder.Init(GetCasted(StepShape_ShellBasedSurfaceModel, start), TP, myNMTool, aLocalFactors, aRange);
       found = Standard_True;
     } 
     else if (start->IsKind(STANDARD_TYPE(StepShape_FacetedBrepAndBrepWithVoids))) {
-      myShapeBuilder.Init(GetCasted(StepShape_FacetedBrepAndBrepWithVoids, start), TP, aRange);
+      myShapeBuilder.Init(GetCasted(StepShape_FacetedBrepAndBrepWithVoids, start), TP, aLocalFactors, aRange);
       found = Standard_True;
     } 
     else if (start->IsKind(STANDARD_TYPE(StepShape_GeometricSet))) {
-      myShapeBuilder.Init(GetCasted(StepShape_GeometricSet, start), TP, this, isManifold, aRange);
+      myShapeBuilder.Init(GetCasted(StepShape_GeometricSet, start), TP, aLocalFactors, this, isManifold, aRange);
       found = Standard_True;
     }
     else if (start->IsKind(STANDARD_TYPE(StepShape_EdgeBasedWireframeModel))) {
-      myShapeBuilder.Init(GetCasted(StepShape_EdgeBasedWireframeModel, start), TP);
+      myShapeBuilder.Init(GetCasted(StepShape_EdgeBasedWireframeModel, start), TP, aLocalFactors);
       found = Standard_True;
     }
     else if (start->IsKind(STANDARD_TYPE(StepShape_FaceBasedSurfaceModel))) {
-      myShapeBuilder.Init(GetCasted(StepShape_FaceBasedSurfaceModel, start), TP);
+      myShapeBuilder.Init(GetCasted(StepShape_FaceBasedSurfaceModel, start), TP, aLocalFactors);
       found = Standard_True;
     }
     // TODO: Normally, StepVisual_Tessellated* entities should be processed after
@@ -1457,20 +1470,20 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity
     //       Currently it is not guaranteed and might require changes in the processing order.
     else if (start->IsKind(STANDARD_TYPE(StepVisual_TessellatedSolid))) 
     {
-      myShapeBuilder.Init(GetCasted(StepVisual_TessellatedSolid, start), TP, 
-                          aReadTessellatedWhenNoBRepOnly, aHasGeom, aRange);
+      myShapeBuilder.Init(GetCasted(StepVisual_TessellatedSolid, start), TP,
+                          aReadTessellatedWhenNoBRepOnly, aHasGeom, aLocalFactors, aRange);
       found = Standard_True;
     }
     else if (start->IsKind(STANDARD_TYPE(StepVisual_TessellatedShell))) 
     {
       myShapeBuilder.Init(GetCasted(StepVisual_TessellatedShell, start), TP, 
-                          aReadTessellatedWhenNoBRepOnly, aHasGeom, aRange);
+                          aReadTessellatedWhenNoBRepOnly, aHasGeom, aLocalFactors, aRange);
       found = Standard_True;
     }
     else if (start->IsKind(STANDARD_TYPE(StepVisual_TessellatedFace))) 
     {
       myShapeBuilder.Init(GetCasted(StepVisual_TessellatedFace, start), TP, 
-                          aReadTessellatedWhenNoBRepOnly, aHasGeom);
+                          aReadTessellatedWhenNoBRepOnly, aHasGeom, aLocalFactors);
       found = Standard_True;
     }
   }
@@ -1507,7 +1520,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity
     chrono.Show();
 #endif
   if ( oldSRContext.IsNull() && ! mySRContext.IsNull() ) //:S4136
-    PrepareUnits ( oldSRContext, TP );
+    PrepareUnits ( oldSRContext, TP, aLocalFactors);
   TP->Bind(start, shbinder);
   return shbinder;
 }
@@ -1521,6 +1534,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity
 Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity
                    (const Handle(StepRepr_MappedItem)&  mapit,
                     const Handle(Transfer_TransientProcess)& TP,
+                    const StepData_Factors& theLocalFactors,
                     const Message_ProgressRange& theProgress)
 {
   Handle(TransferBRep_ShapeBinder) shbinder;
@@ -1538,7 +1552,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity
     DownCast(mapit->MappingSource()->MappedRepresentation());
   Standard_Boolean isBound = Standard_False; 
   Handle(Transfer_Binder) binder = TP->Find(maprep);
-  if (binder.IsNull())    binder = TransferEntity(maprep,TP,isBound, Standard_False, theProgress);
+  if (binder.IsNull())    binder = TransferEntity(maprep, TP, theLocalFactors, isBound, Standard_False, theProgress);
   shbinder = Handle(TransferBRep_ShapeBinder)::DownCast(binder);
   if (shbinder.IsNull()) TP->AddWarning(mapit,"No Shape Produced");
   else {
@@ -1555,7 +1569,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity
       Handle(StepGeom_CartesianTransformationOperator3d) CartOp =
         Handle(StepGeom_CartesianTransformationOperator3d)::DownCast(mapit->MappingTarget());
       if ( ! CartOp.IsNull() ) {
-        ok = StepToGeom::MakeTransformation3d (CartOp, Trsf);
+        ok = StepToGeom::MakeTransformation3d (CartOp, Trsf, theLocalFactors);
       }
       else {
         Handle(StepGeom_Axis2Placement3d) Origin = 
@@ -1565,7 +1579,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity
         if ( ! Origin.IsNull() && ! Target.IsNull() ) {
           ok = Standard_True;
           Handle(StepRepr_Representation) rep = mySRContext; // NOTE: copy of handle !
-          ComputeTransformation ( Origin, Target, maprep, rep, TP, Trsf );
+          ComputeTransformation ( Origin, Target, maprep, rep, TP, Trsf, theLocalFactors);
           ok = Standard_True;
         }
       }
@@ -1587,6 +1601,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity
 Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity
                    (const Handle(StepShape_FaceSurface)& fs,
                     const Handle(Transfer_TransientProcess)& TP,
+                    const StepData_Factors& theLocalFactors,
                     const Message_ProgressRange& theProgress)
 {
 
@@ -1606,15 +1621,16 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity
 
     // Non-manifold topology is not processed here (ssv; 15.11.2010)
     StepToTopoDS_NMTool dummyNMTool;
-    myTF.Init(fs, myTool, dummyNMTool);
+    myTF.Init(fs, myTool, dummyNMTool, theLocalFactors);
     Handle(StepRepr_Representation) oldSRContext = mySRContext;
+    StepData_Factors aLocalFactors = theLocalFactors;
     if (mySRContext.IsNull()) { // if no context, try to find it (ex: r0701_ug.stp #4790)
       Handle(StepRepr_Representation) context = FindContext(fs, TP);
       if (context.IsNull()) {
         TP->AddWarning(fs, "Entity with no unit context; default units taken");
-        ResetUnits();
+        ResetUnits(aLocalFactors);
       }
-      else PrepareUnits(context, TP);
+      else PrepareUnits(context, TP, aLocalFactors);
     }
 
     // Apply ShapeFix
@@ -1637,7 +1653,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity
 
 
     if (oldSRContext.IsNull() && !mySRContext.IsNull()) //:S4136
-      PrepareUnits(oldSRContext, TP);
+      PrepareUnits(oldSRContext, TP, aLocalFactors);
     TP->Bind(fs, sb);
     return sb; // TP->Find (start);
   }
@@ -1657,6 +1673,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity
 Handle(Transfer_Binder) STEPControl_ActorRead::TransferShape(
     const Handle(Standard_Transient)& start,
     const Handle(Transfer_TransientProcess)& TP,
+    const StepData_Factors& theLocalFactors,
     const Standard_Boolean isManifold,
     const Standard_Boolean theUseTrsf,
     const Message_ProgressRange& theProgress)
@@ -1685,14 +1702,14 @@ Handle(Transfer_Binder) STEPControl_ActorRead::TransferShape(
   else if (start->IsKind(STANDARD_TYPE(StepBasic_ProductDefinition))) {
     Handle(StepBasic_ProductDefinition) PD =
       Handle(StepBasic_ProductDefinition)::DownCast(start);
-    shbinder = TransferEntity(PD, TP, theUseTrsf, theProgress);
+    shbinder = TransferEntity(PD, TP, theLocalFactors, theUseTrsf, theProgress);
   }
   
   // NextAssemblyUsageOccurrence
   else if (start->IsKind(STANDARD_TYPE(StepRepr_NextAssemblyUsageOccurrence))) {
     Handle(StepRepr_NextAssemblyUsageOccurrence) NAUO =
       Handle(StepRepr_NextAssemblyUsageOccurrence)::DownCast(start);
-    shbinder = TransferEntity(NAUO, TP, theProgress);
+    shbinder = TransferEntity(NAUO, TP, theLocalFactors, theProgress);
   }
   //end skl
     
@@ -1700,7 +1717,7 @@ Handle(Transfer_Binder) STEPControl_ActorRead::TransferShape(
   else if (start->IsKind(STANDARD_TYPE(StepShape_ShapeRepresentation))) {
     DeclareAndCast(StepShape_ShapeRepresentation,sr,start);
     Standard_Boolean isBound = Standard_False;
-    shbinder = TransferEntity(sr,TP,isBound, Standard_False, theProgress);
+    shbinder = TransferEntity(sr, TP, theLocalFactors, isBound, Standard_False, theProgress);
   }
   
     // --------------------------------------------------------------
@@ -1710,29 +1727,29 @@ Handle(Transfer_Binder) STEPControl_ActorRead::TransferShape(
 
   else if (start->IsKind(STANDARD_TYPE(StepShape_ContextDependentShapeRepresentation))) {
     DeclareAndCast(StepShape_ContextDependentShapeRepresentation,CDSR,start);
-    shbinder =  TransferEntity(CDSR,TP, theProgress);
+    shbinder =  TransferEntity(CDSR, TP, theLocalFactors, theProgress);
   }
 
   else if (start->IsKind (STANDARD_TYPE(StepRepr_ShapeRepresentationRelationship)) ) {
     //  REPRESENTATION_RELATIONSHIP et la famille
 
     DeclareAndCast(StepRepr_ShapeRepresentationRelationship,und,start);
-    shbinder =  TransferEntity(und,TP, 0, Standard_False, theProgress);
+    shbinder =  TransferEntity(und, TP, theLocalFactors, 0, Standard_False, theProgress);
   }
 
   else if (start->IsKind (STANDARD_TYPE(StepGeom_GeometricRepresentationItem)) ) {
     // Here starts the entity to be treated : Shape Representation Subtype
   // It can be also other Root entities
     DeclareAndCast(StepGeom_GeometricRepresentationItem,git,start);
-    shbinder = TransferEntity(git, TP, isManifold, theProgress);
+    shbinder = TransferEntity(git, TP, theLocalFactors, isManifold, theProgress);
   }
   else if (start->IsKind(STANDARD_TYPE(StepRepr_MappedItem))) {
     DeclareAndCast(StepRepr_MappedItem,mapit,start);
-    shbinder=  TransferEntity(mapit,TP, theProgress);
+    shbinder=  TransferEntity(mapit, TP, theLocalFactors, theProgress);
   }
   else if (start->IsKind(STANDARD_TYPE(StepShape_FaceSurface))) {
     DeclareAndCast(StepShape_FaceSurface,fs,start);
-    shbinder =  TransferEntity(fs,TP, theProgress);
+    shbinder =  TransferEntity(fs, TP, theLocalFactors, theProgress);
   }
 
 //  if (!shbinder.IsNull()) TP->Bind(start,binder);
@@ -1745,13 +1762,14 @@ Handle(Transfer_Binder) STEPControl_ActorRead::TransferShape(
 // ============================================================================
 
 void STEPControl_ActorRead::PrepareUnits(const Handle(StepRepr_Representation)& rep,
-                                         const Handle(Transfer_TransientProcess)& TP)
+                                         const Handle(Transfer_TransientProcess)& TP,
+                                         StepData_Factors& theLocalFactors)
 {
   mySRContext = rep;
   
   Standard_Integer stat1, stat2 = 0;  // sera alimente par STEPControl_Unit
   if (rep.IsNull()) {
-    ResetUnits();
+    ResetUnits(theLocalFactors);
     return;
   }
   
@@ -1759,7 +1777,7 @@ void STEPControl_ActorRead::PrepareUnits(const Handle(StepRepr_Representation)&
   Handle(StepRepr_RepresentationContext) theRepCont = rep->ContextOfItems();
   if (theRepCont.IsNull()) {
     TP->AddWarning(rep,"Bad RepresentationContext, default unit taken");
-    ResetUnits();
+    ResetUnits(theLocalFactors);
     return;
   }
 
@@ -1794,13 +1812,12 @@ void STEPControl_ActorRead::PrepareUnits(const Handle(StepRepr_Representation)&
   // ----------------------------------------------------
   // Decoding and Setting the Values
   // ----------------------------------------------------
-
   if (!theGUAC.IsNull()) {
-    stat1 = myUnit.ComputeFactors(theGUAC);
+    stat1 = myUnit.ComputeFactors(theGUAC, theLocalFactors);
     Standard_Integer anglemode = Interface_Static::IVal("step.angleunit.mode");
     Standard_Real angleFactor = ( anglemode == 0 ? myUnit.PlaneAngleFactor() :
                                  anglemode == 1 ? 1. : M_PI/180. );
-    StepData_GlobalFactors::Intance().InitializeFactors(myUnit.LengthFactor(),
+    theLocalFactors.InitializeFactors(myUnit.LengthFactor(),
                                    angleFactor,
                                    myUnit.SolidAngleFactor());
     if (stat1 != 0) TP->AddWarning (theRepCont,myUnit.StatusMessage(stat1));
@@ -1833,9 +1850,9 @@ void STEPControl_ActorRead::PrepareUnits(const Handle(StepRepr_Representation)&
 //purpose  : 
 //=======================================================================
 
-void  STEPControl_ActorRead::ResetUnits ()
+void  STEPControl_ActorRead::ResetUnits (StepData_Factors& theLocalFactors)
 {
-  StepData_GlobalFactors::Intance().InitializeFactors ( 1, 1, 1 );
+  theLocalFactors.InitializeFactors ( 1, 1, 1 );
   myPrecision = Interface_Static::RVal("read.precision.val");
   myMaxTol = Max ( myPrecision, Interface_Static::RVal("read.maxprecision.val") );
 }
@@ -1851,7 +1868,8 @@ Standard_Boolean STEPControl_ActorRead::ComputeTransformation (const Handle(Step
                                                               const Handle(StepRepr_Representation) &OrigContext, 
                                                               const Handle(StepRepr_Representation) &TargContext,
                                                               const Handle(Transfer_TransientProcess) &TP,
-                                                              gp_Trsf &Trsf)
+                                                              gp_Trsf &Trsf,
+                     const StepData_Factors& theLocalFactors)
 {
   Trsf = gp_Trsf();  // reinit
   if ( Origin.IsNull() || Target.IsNull() ) return Standard_False;
@@ -1892,11 +1910,12 @@ Standard_Boolean STEPControl_ActorRead::ComputeTransformation (const Handle(Step
   
   // translate axis_placements taking units into account 
   Handle(StepRepr_Representation) oldSRContext = mySRContext;
-  if ( OrigContext  != oldSRContext ) PrepareUnits(OrigContext,TP);
-  Handle(Geom_Axis2Placement) theOrig = StepToGeom::MakeAxis2Placement (org);
-  if ( TargContext  != OrigContext  ) PrepareUnits(TargContext,TP);
-  Handle(Geom_Axis2Placement) theTarg = StepToGeom::MakeAxis2Placement (trg);
-  if ( oldSRContext != TargContext  ) PrepareUnits(oldSRContext,TP);
+  StepData_Factors aLocalFactors = theLocalFactors;
+  if ( OrigContext  != oldSRContext ) PrepareUnits(OrigContext, TP, aLocalFactors);
+  Handle(Geom_Axis2Placement) theOrig = StepToGeom::MakeAxis2Placement (org, aLocalFactors);
+  if ( TargContext  != OrigContext  ) PrepareUnits(TargContext, TP, aLocalFactors);
+  Handle(Geom_Axis2Placement) theTarg = StepToGeom::MakeAxis2Placement (trg, aLocalFactors);
+  if ( oldSRContext != TargContext  ) PrepareUnits(oldSRContext, TP, aLocalFactors);
 
   gp_Ax3 ax3Orig(theOrig->Ax2());
   gp_Ax3 ax3Targ(theTarg->Ax2());
@@ -1913,8 +1932,9 @@ Standard_Boolean STEPControl_ActorRead::ComputeTransformation (const Handle(Step
 
 //:j2 abv 22 Oct 98: auxiliary function: reading transformation from SRRWT
 Standard_Boolean STEPControl_ActorRead::ComputeSRRWT (const Handle(StepRepr_RepresentationRelationship) &SRR,
-                                                     const Handle(Transfer_TransientProcess) &TP,
-                                                     gp_Trsf &Trsf)
+                                                      const Handle(Transfer_TransientProcess) &TP,
+                                                      gp_Trsf &Trsf,
+                                                      const StepData_Factors& theLocalFactors)
 {
   Trsf = gp_Trsf(); // init
   
@@ -1922,16 +1942,16 @@ Standard_Boolean STEPControl_ActorRead::ComputeSRRWT (const Handle(StepRepr_Repr
   if ( srwt.IsNull() ) return Standard_False;
 
   StepRepr_Transformation SelectTrans = srwt->TransformationOperator();
-  
+  StepData_Factors aLocalFactors = theLocalFactors;
   // cartesian transformation
   Handle(StepGeom_CartesianTransformationOperator3d) CartOp = 
     Handle(StepGeom_CartesianTransformationOperator3d)::DownCast(SelectTrans.Value());
   if ( ! CartOp.IsNull() ) {
     // reset units (by Rep2 - ?)
     Handle(StepRepr_Representation) oldSRContext = mySRContext;
-    if ( SRR->Rep2() != oldSRContext ) PrepareUnits(SRR->Rep2(),TP);
-    StepToGeom::MakeTransformation3d (CartOp, Trsf);
-    if ( SRR->Rep2() != oldSRContext ) PrepareUnits(oldSRContext,TP);
+    if ( SRR->Rep2() != oldSRContext ) PrepareUnits(SRR->Rep2(), TP, aLocalFactors);
+    StepToGeom::MakeTransformation3d (CartOp, Trsf, aLocalFactors);
+    if ( SRR->Rep2() != oldSRContext ) PrepareUnits(oldSRContext, TP, aLocalFactors);
     return Trsf.Form() != gp_Identity;
   }
 
@@ -1945,7 +1965,7 @@ Standard_Boolean STEPControl_ActorRead::ComputeSRRWT (const Handle(StepRepr_Repr
   Handle(StepGeom_Axis2Placement3d) Ax2 =
     Handle(StepGeom_Axis2Placement3d)::DownCast(ItemDef->TransformItem2());
   if ( Ax1.IsNull() || Ax2.IsNull() ) return Standard_False;
-  return ComputeTransformation ( Ax1, Ax2, SRR->Rep1(), SRR->Rep2(), TP, Trsf);
+  return ComputeTransformation ( Ax1, Ax2, SRR->Rep1(), SRR->Rep2(), TP, Trsf, aLocalFactors);
 }
 
 //=======================================================================
index bdbf2d9433da82c7008943c75dbbc02629b44b4b..7ca5e805165515ec84b9016088720b7dcd15af0a 100644 (file)
@@ -46,6 +46,7 @@ class StepShape_FaceSurface;
 class TopoDS_Shell;
 class TopoDS_Compound;
 class StepRepr_ConstructiveGeometryRepresentationRelationship;
+class StepData_Factors;
 
 
 class STEPControl_ActorRead;
@@ -75,26 +76,38 @@ public:
   Standard_EXPORT Handle(Transfer_Binder) TransferShape (
       const Handle(Standard_Transient)& start,
       const Handle(Transfer_TransientProcess)& TP,
+      const StepData_Factors& theLocalFactors,
       const Standard_Boolean isManifold = Standard_True,
       const Standard_Boolean theUseTrsf = Standard_False,
       const Message_ProgressRange& theProgress = Message_ProgressRange());
 
   //! set units and tolerances context by given ShapeRepresentation
-  Standard_EXPORT void PrepareUnits (const Handle(StepRepr_Representation)& rep, const Handle(Transfer_TransientProcess)& TP);
+  Standard_EXPORT void PrepareUnits (const Handle(StepRepr_Representation)& rep,
+                                     const Handle(Transfer_TransientProcess)& TP,
+                                     StepData_Factors& theLocalFactors);
 
   //! reset units and tolerances context to default
   //! (mm, radians, read.precision.val, etc.)
-  Standard_EXPORT void ResetUnits();
+  Standard_EXPORT void ResetUnits(StepData_Factors& theLocalFactors);
 
   //! Computes transformation defined by two axis placements (in MAPPED_ITEM
   //! or ITEM_DEFINED_TRANSFORMATION) taking into account their
   //! representation contexts (i.e. units, which may be different)
   //! Returns True if transformation is computed and is not an identity.
-  Standard_EXPORT Standard_Boolean ComputeTransformation (const Handle(StepGeom_Axis2Placement3d)& Origin, const Handle(StepGeom_Axis2Placement3d)& Target, const Handle(StepRepr_Representation)& OrigContext, const Handle(StepRepr_Representation)& TargContext, const Handle(Transfer_TransientProcess)& TP, gp_Trsf& Trsf);
+  Standard_EXPORT Standard_Boolean ComputeTransformation (const Handle(StepGeom_Axis2Placement3d)& Origin,
+                                                          const Handle(StepGeom_Axis2Placement3d)& Target,
+                                                          const Handle(StepRepr_Representation)& OrigContext,
+                                                          const Handle(StepRepr_Representation)& TargContext,
+                                                          const Handle(Transfer_TransientProcess)& TP,
+                                                          gp_Trsf& Trsf,
+                                                          const StepData_Factors& theLocalFactors);
 
   //! Computes transformation defined by given
   //! REPRESENTATION_RELATIONSHIP_WITH_TRANSFORMATION
-  Standard_EXPORT Standard_Boolean ComputeSRRWT (const Handle(StepRepr_RepresentationRelationship)& SRR, const Handle(Transfer_TransientProcess)& TP, gp_Trsf& Trsf);
+  Standard_EXPORT Standard_Boolean ComputeSRRWT (const Handle(StepRepr_RepresentationRelationship)& SRR,
+                                                 const Handle(Transfer_TransientProcess)& TP,
+                                                 gp_Trsf& Trsf,
+                                                 const StepData_Factors& theLocalFactors);
 
 
 
@@ -109,6 +122,7 @@ protected:
     Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity (
       const Handle(StepBasic_ProductDefinition)& PD,
       const Handle(Transfer_TransientProcess)& TP,
+      const StepData_Factors& theLocalFactors,
       const Standard_Boolean theUseTrsf = Standard_False,
       const Message_ProgressRange& theProgress = Message_ProgressRange());
 
@@ -116,6 +130,7 @@ protected:
   Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity
                    (const Handle(StepRepr_NextAssemblyUsageOccurrence)& NAUO,
                     const Handle(Transfer_TransientProcess)& TP,
+                    const StepData_Factors& theLocalFactors,
                     const Message_ProgressRange& theProgress = Message_ProgressRange());
 
   //! Transfers shape representation entity
@@ -123,6 +138,7 @@ protected:
   Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity (
       const Handle(StepShape_ShapeRepresentation)& sr,
       const Handle(Transfer_TransientProcess)& TP,
+      const StepData_Factors& theLocalFactors,
       Standard_Boolean& isBound,
       const Standard_Boolean theUseTrsf = Standard_False,
       const Message_ProgressRange& theProgress = Message_ProgressRange());
@@ -131,6 +147,7 @@ protected:
   Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity
                    (const Handle(StepShape_ContextDependentShapeRepresentation)& CDSR,
                     const Handle(Transfer_TransientProcess)& TP,
+                    const StepData_Factors& theLocalFactors,
                     const Message_ProgressRange& theProgress = Message_ProgressRange());
 
   //! Transfers  shape representation relationship entity
@@ -138,6 +155,7 @@ protected:
   Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity (
       const Handle(StepRepr_ShapeRepresentationRelationship)& und,
       const Handle(Transfer_TransientProcess)& TP,
+      const StepData_Factors& theLocalFactors,
       const Standard_Integer nbrep = 0,
       const Standard_Boolean theUseTrsf = Standard_False,
       const Message_ProgressRange& theProgress = Message_ProgressRange());
@@ -146,6 +164,7 @@ protected:
   Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity
                    (const Handle(StepGeom_GeometricRepresentationItem)& git,
                     const Handle(Transfer_TransientProcess)& TP,
+                    const StepData_Factors& theLocalFactors,
                     const Standard_Boolean isManifold,
                     const Message_ProgressRange& theProgress);
 
@@ -153,16 +172,19 @@ protected:
   Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity
                    (const Handle(StepRepr_MappedItem)& mapit,
                     const Handle(Transfer_TransientProcess)& TP,
+                    const StepData_Factors& theLocalFactors,
                     const Message_ProgressRange& theProgress);
 
   //! Transfers  FaceSurface entity
   Standard_EXPORT Handle(TransferBRep_ShapeBinder) TransferEntity
                    (const Handle(StepShape_FaceSurface)& fs,
                     const Handle(Transfer_TransientProcess)& TP,
+                    const StepData_Factors& theLocalFactors,
                     const Message_ProgressRange& theProgress);
 
   Handle(TransferBRep_ShapeBinder) TransferEntity( const Handle(StepRepr_ConstructiveGeometryRepresentationRelationship)& theCGRR,
-    const Handle(Transfer_TransientProcess)& theTP);
+                                                   const Handle(Transfer_TransientProcess)& theTP,
+                                                   const StepData_Factors& theLocalFactors);
 
   //! Translates file by old way when CDSR are roots . Acts only if "read.step.product_mode" is equal Off.
   Standard_EXPORT Handle(TransferBRep_ShapeBinder) OldWay
index e7e576ba6406b9c1868a47208d3c7e9e4c30346a..b96d0d8e4268ac42dfe83b19fcc29f3869325026 100644 (file)
@@ -40,7 +40,6 @@
 #include <STEPConstruct_UnitContext.hxx>
 #include <STEPControl_ActorWrite.hxx>
 #include <STEPControl_StepModelType.hxx>
-#include <StepData_GlobalFactors.hxx>
 #include <StepData_StepModel.hxx>
 #include <StepGeom_Axis2Placement3d.hxx>
 #include <StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx.hxx>
@@ -547,15 +546,15 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::Transfer (const Handle(Transfer_
   Standard_Real aLFactor = model->WriteLengthUnit();
   aLFactor /= model->LocalLengthUnit();
   Standard_Integer anglemode = Interface_Static::IVal("step.angleunit.mode");
-  StepData_GlobalFactors::Intance().InitializeFactors (aLFactor, ( anglemode <= 1 ? 1. : M_PI/180. ), 1. );
-
+  StepData_Factors aLocalFactors;
+  aLocalFactors.InitializeFactors(aLFactor, (anglemode <= 1 ? 1. : M_PI / 180.), 1.);
   // create SDR
   STEPConstruct_Part SDRTool;
   SDRTool.MakeSDR ( 0, myContext.GetProductName(), myContext.GetAPD()->Application() );
   Handle(StepShape_ShapeDefinitionRepresentation) sdr = SDRTool.SDRValue();
   // transfer shape
 
-  Handle(Transfer_Binder) resbind = TransferShape (mapper,sdr,FP, 0L, Standard_True, theProgress);
+  Handle(Transfer_Binder) resbind = TransferShape (mapper,sdr, FP, aLocalFactors, 0L, Standard_True, theProgress);
 
 //  Handle(StepShape_ShapeRepresentation) resultat;
 //  FP->GetTypedTransient (resbind,STANDARD_TYPE(StepShape_ShapeRepresentation),resultat);
@@ -665,12 +664,13 @@ static void UpdateMap (const TopoDS_Shape &shape,
 static Standard_Boolean transferVertex (const Handle(Transfer_FinderProcess)& FP,
                                         Handle(StepShape_HArray1OfGeometricSetSelect)& aGSS,
                                         const TopoDS_Shape& aShVrtx,
-                                        const Standard_Integer theNum)
+                                        const Standard_Integer theNum,
+                                        const StepData_Factors& theLocalFactors)
 {
   Standard_Boolean IsDone = Standard_False;
   MoniTool_DataMapOfShapeTransient aMap;
   TopoDSToStep_Tool    aTool(aMap, Standard_True);
-  TopoDSToStep_MakeStepVertex aMkVrtx ( TopoDS::Vertex(aShVrtx), aTool, FP );
+  TopoDSToStep_MakeStepVertex aMkVrtx ( TopoDS::Vertex(aShVrtx), aTool, FP, theLocalFactors );
   
   if (!aMkVrtx.IsDone())
     return IsDone;
@@ -693,6 +693,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape
                    (const Handle(Transfer_Finder)& start,
                     const Handle(StepShape_ShapeDefinitionRepresentation)& SDR0,
                     const Handle(Transfer_FinderProcess)& FP,
+                    const StepData_Factors& theLocalFactors,
                     const Handle(TopTools_HSequenceOfShape)& shapeGroup,
                     const Standard_Boolean isManifold,
                     const Message_ProgressRange& theProgress)
@@ -724,7 +725,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape
 
   // MODE ASSEMBLY : if Compound, (sub-)assembly
   if ( IsAssembly(theShape) )
-    return TransferCompound(start, SDR0, FP, theProgress);
+    return TransferCompound(start, SDR0, FP, theLocalFactors, theProgress);
 
   Message_ProgressScope aPSRoot(theProgress, NULL, 2);
 
@@ -834,7 +835,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape
       Message_ProgressScope aPS (aPSRoot.Next(), NULL, aNMItemsNb);
       for (Standard_Integer i = 1; i <= aNMItemsNb && aPS.More(); i++) {
         Handle(TransferBRep_ShapeMapper) aMapper = TransferBRep::ShapeMapper( FP, RepItemSeq->Value(i) );
-        TransferShape(aMapper, sdr, FP, NonManifoldGroup, Standard_False, aPS.Next());
+        TransferShape(aMapper, sdr, FP, theLocalFactors, NonManifoldGroup, Standard_False, aPS.Next());
       }
 
       // Nothing else needed for pure non-manifold topology, return
@@ -937,7 +938,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape
   else if (theShape.ShapeType() == TopAbs_COMPSOLID) {
     FP->AddWarning(start,"NonManifold COMPSOLID was translated like a set of SOLIDs");
     if ( GroupMode() > 0)
-      return TransferCompound(start, SDR0, FP, aPSRoot.Next());
+      return TransferCompound(start, SDR0, FP, theLocalFactors, aPSRoot.Next());
     else {
       TopExp_Explorer SolidExp;
       for (SolidExp.Init(theShape, TopAbs_SOLID);
@@ -1028,7 +1029,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape
            for ( TopoDS_Iterator It ( aSolid ); It.More(); It.Next() ) 
               if (It.Value().ShapeType() == TopAbs_SHELL) nbShells++;
            if ( nbShells >1 ) {
-             TopoDSToStep_MakeBrepWithVoids MkBRepWithVoids(aSolid,FP, aPS1.Next());
+             TopoDSToStep_MakeBrepWithVoids MkBRepWithVoids(aSolid, FP, theLocalFactors, aPS1.Next());
              MkBRepWithVoids.Tolerance() = Tol;
              if (MkBRepWithVoids.IsDone()) 
               {
@@ -1038,7 +1039,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape
               else nbShells = 1; //smth went wrong; let it will be just Manifold
            }
            if ( nbShells ==1 ) {
-              TopoDSToStep_MakeManifoldSolidBrep MkManifoldSolidBrep(aSolid,FP, aPS1.Next());
+              TopoDSToStep_MakeManifoldSolidBrep MkManifoldSolidBrep(aSolid, FP, theLocalFactors, aPS1.Next());
              MkManifoldSolidBrep.Tolerance() = Tol;
              if (MkManifoldSolidBrep.IsDone()) 
               {
@@ -1049,7 +1050,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape
          }
          else if (aShape.ShapeType() == TopAbs_SHELL) {
            TopoDS_Shell aShell = TopoDS::Shell(aShape);
-           TopoDSToStep_MakeManifoldSolidBrep MkManifoldSolidBrep(aShell,FP, aPS1.Next());
+           TopoDSToStep_MakeManifoldSolidBrep MkManifoldSolidBrep(aShell, FP, theLocalFactors, aPS1.Next());
            MkManifoldSolidBrep.Tolerance() = Tol;
            if (MkManifoldSolidBrep.IsDone()) 
             {
@@ -1063,7 +1064,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape
        {
          if (aShape.ShapeType() == TopAbs_SOLID) {
            TopoDS_Solid aSolid = TopoDS::Solid(aShape);
-           TopoDSToStep_MakeBrepWithVoids MkBRepWithVoids(aSolid,FP, aPS1.Next());
+           TopoDSToStep_MakeBrepWithVoids MkBRepWithVoids(aSolid, FP, theLocalFactors, aPS1.Next());
            MkBRepWithVoids.Tolerance() = Tol;
            if (MkBRepWithVoids.IsDone()) 
             {
@@ -1088,7 +1089,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape
          }
          if (aShape.ShapeType() == TopAbs_SOLID) {
            TopoDS_Solid aSolid = TopoDS::Solid(aShape);
-           TopoDSToStep_MakeFacetedBrep MkFacetedBrep(aSolid,FP, aPS1.Next());
+           TopoDSToStep_MakeFacetedBrep MkFacetedBrep(aSolid, FP, theLocalFactors, aPS1.Next());
            MkFacetedBrep.Tolerance() = Tol;
            if (MkFacetedBrep.IsDone()) 
             {
@@ -1114,7 +1115,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape
          if (aShape.ShapeType() == TopAbs_SOLID) {
            TopoDS_Solid aSolid = TopoDS::Solid(aShape);
            TopoDSToStep_MakeFacetedBrepAndBrepWithVoids 
-             MkFacetedBrepAndBrepWithVoids(aSolid,FP, aPS1.Next());
+             MkFacetedBrepAndBrepWithVoids(aSolid, FP, theLocalFactors, aPS1.Next());
            MkFacetedBrepAndBrepWithVoids.Tolerance() = Tol;
            if (MkFacetedBrepAndBrepWithVoids.IsDone()) 
             {
@@ -1129,7 +1130,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape
          if (aShape.ShapeType() == TopAbs_SOLID) {
            TopoDS_Solid aSolid = TopoDS::Solid(aShape);
            TopoDSToStep_MakeShellBasedSurfaceModel
-             MkShellBasedSurfaceModel(aSolid, FP, aPS1.Next());
+             MkShellBasedSurfaceModel(aSolid, FP, theLocalFactors, aPS1.Next());
            MkShellBasedSurfaceModel.Tolerance() = Tol;
            if (MkShellBasedSurfaceModel.IsDone()) 
             {
@@ -1140,7 +1141,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape
          else if (aShape.ShapeType() == TopAbs_SHELL) {
             TopoDS_Shell aShell = TopoDS::Shell(aShape);
             // Non-manifold topology is stored via NMSSR containing series of SBSM (ssv; 13.11.2010)
-            TopoDSToStep_MakeShellBasedSurfaceModel MkShellBasedSurfaceModel(aShell, FP, aPS1.Next());
+            TopoDSToStep_MakeShellBasedSurfaceModel MkShellBasedSurfaceModel(aShell, FP, theLocalFactors, aPS1.Next());
             MkShellBasedSurfaceModel.Tolerance() = Tol;
             if (MkShellBasedSurfaceModel.IsDone()) 
             {
@@ -1151,7 +1152,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape
          else if (aShape.ShapeType() == TopAbs_FACE) {
            TopoDS_Face aFace = TopoDS::Face(aShape);
             TopoDSToStep_MakeShellBasedSurfaceModel
-             MkShellBasedSurfaceModel(aFace, FP, aPS1.Next());
+             MkShellBasedSurfaceModel(aFace, FP, theLocalFactors, aPS1.Next());
            MkShellBasedSurfaceModel.Tolerance() = Tol;
            if (MkShellBasedSurfaceModel.IsDone()) 
             {
@@ -1163,7 +1164,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape
        }
       case STEPControl_GeometricCurveSet:
        {
-         TopoDSToStep_MakeGeometricCurveSet MkGeometricCurveSet(aShape,FP);
+         TopoDSToStep_MakeGeometricCurveSet MkGeometricCurveSet(aShape, FP, theLocalFactors);
          MkGeometricCurveSet.Tolerance() = Tol;
          if (MkGeometricCurveSet.IsDone()) {
            item = MkGeometricCurveSet.Value();
@@ -1195,7 +1196,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape
                 if ( aVertex.ShapeType() != TopAbs_VERTEX )
                   continue;
                 curNb++;
-                transferVertex (FP, aGSS, aVertex, curNb);
+                transferVertex (FP, aGSS, aVertex, curNb, theLocalFactors);
               } // end of iteration on compound with vertices.
               aGCSet->SetElements(aGSS);
               item = aGCSet;
@@ -1352,7 +1353,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape
       repr1->SetValue(2,items->Value(j));
       ShapeRepr1->SetItems(repr1);
       STEPConstruct_UnitContext mk1;
-      mk1.Init(Tol);
+      mk1.Init(Tol, theLocalFactors);
       ShapeRepr1->SetContextOfItems(mk1.Value());  // la tolerance, voir au debut
       ShapeRepr1->SetName (new TCollection_HAsciiString(""));
       
@@ -1389,7 +1390,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape
       Handle(StepShape_ShapeRepresentation) shapeTessRepr = new StepVisual_TessellatedShapeRepresentation;
       shapeTessRepr->SetItems(itemsTess);
       STEPConstruct_UnitContext mk1;
-      mk1.Init(Tol);
+      mk1.Init(Tol, theLocalFactors);
       shapeTessRepr->SetContextOfItems(mk1.Value());
       shapeTessRepr->SetName(new TCollection_HAsciiString(""));
 
@@ -1412,7 +1413,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape
 
   // init representation
   STEPConstruct_UnitContext mk;
-  mk.Init(Tol);
+  mk.Init(Tol, theLocalFactors);
   shapeRep->SetContextOfItems(mk.Value());  // la tolerance, voir au debut
   shapeRep->SetName (new TCollection_HAsciiString(""));
 
@@ -1450,6 +1451,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferCompound
                    (const Handle(Transfer_Finder)& start,
                     const Handle(StepShape_ShapeDefinitionRepresentation)& SDR0,
                     const Handle(Transfer_FinderProcess)& FP,
+                    const StepData_Factors& theLocalFactors,
                     const Message_ProgressRange& theProgress)
 {
   Handle(TransferBRep_ShapeMapper) mapper = Handle(TransferBRep_ShapeMapper)::DownCast(start);
@@ -1535,7 +1537,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferCompound
     Handle(TransferBRep_ShapeMapper) subs = TransferBRep::ShapeMapper (FP,RepItemSeq->Value(i));
     Handle(StepGeom_Axis2Placement3d) AX1;
     
-    Handle(Transfer_Binder) bnd = TransferSubShape(subs, SDR0, AX1, FP, NonManifoldGroup, isManifold, aPS.Next());
+    Handle(Transfer_Binder) bnd = TransferSubShape(subs, SDR0, AX1, FP, theLocalFactors, NonManifoldGroup, isManifold, aPS.Next());
 
     if (!AX1.IsNull()) ItemSeq->Append (AX1);
     // copy binders so as to have all roots in upper binder, but do not conflict
@@ -1560,7 +1562,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferCompound
   shapeRep->SetItems(items);
   Standard_Real Tol = UsedTolerance (mytoler,theShape);
   STEPConstruct_UnitContext mk;
-  mk.Init(Tol);
+  mk.Init(Tol, theLocalFactors);
   shapeRep->SetContextOfItems(mk.Value());  // la tolerance, voir au debut
   shapeRep->SetName (new TCollection_HAsciiString(""));
 
@@ -1580,6 +1582,7 @@ Handle(Transfer_Binder)  STEPControl_ActorWrite::TransferSubShape
                     const Handle(StepShape_ShapeDefinitionRepresentation)& SDR0,
                     Handle(StepGeom_Axis2Placement3d)& AX1,
                     const Handle(Transfer_FinderProcess)& FP,
+                    const StepData_Factors& theLocalFactors,
                     const Handle(TopTools_HSequenceOfShape)& shapeGroup,
                     const Standard_Boolean isManifold,
                     const Message_ProgressRange& theProgress)
@@ -1626,7 +1629,7 @@ Handle(Transfer_Binder)  STEPControl_ActorWrite::TransferSubShape
   Handle(Transfer_Binder) resprod = TransientResult(sdr);  //KA - OCC7141(skl 10.11.2004)
   bool isJustTransferred = false;
   if ( ! iasdr || resbind.IsNull() ) {
-    Handle(Transfer_Binder) resbind1 = TransferShape(mapper, sdr, FP, shapeGroup, isManifold, theProgress);
+    Handle(Transfer_Binder) resbind1 = TransferShape(mapper, sdr, FP, theLocalFactors, shapeGroup, isManifold, theProgress);
     if (resbind1.IsNull() || sdr->UsedRepresentation().IsNull())
       return Handle(Transfer_Binder)();
     resbind = resbind1;
@@ -1642,7 +1645,7 @@ Handle(Transfer_Binder)  STEPControl_ActorWrite::TransferSubShape
 //  sdr->SetUsedRepresentation(resultat);  // to be used by MakeItem
 
   // make location for assembly placement
-  GeomToStep_MakeAxis2Placement3d mkax (aLoc);
+  GeomToStep_MakeAxis2Placement3d mkax (aLoc, theLocalFactors);
   const Handle(StepGeom_Axis2Placement3d)& AxLoc = mkax.Value();
   AX1 = AxLoc;
 
index d9d09b20d2410eacff49635a9b4c77125838924e..960abaadef49bc259f6e38897241d1d791668f3f 100644 (file)
@@ -28,6 +28,7 @@
 class Transfer_Finder;
 class Transfer_Binder;
 class Transfer_FinderProcess;
+class StepData_Factors;
 class StepShape_ShapeDefinitionRepresentation;
 class StepGeom_Axis2Placement3d;
 class TopoDS_Shape;
@@ -59,6 +60,7 @@ public:
                     const Handle(StepShape_ShapeDefinitionRepresentation)& SDR,
                     Handle(StepGeom_Axis2Placement3d)& AX1, 
                     const Handle(Transfer_FinderProcess)& FP,
+                    const StepData_Factors& theLocalFactors,
                     const Handle(TopTools_HSequenceOfShape)& shapeGroup = NULL, 
                     const Standard_Boolean isManifold = Standard_True,
                     const Message_ProgressRange& theProgress = Message_ProgressRange());
@@ -67,6 +69,7 @@ public:
                    (const Handle(Transfer_Finder)& start,
                     const Handle(StepShape_ShapeDefinitionRepresentation)& SDR,
                     const Handle(Transfer_FinderProcess)& FP,
+                    const StepData_Factors& theLocalFactors,
                     const Handle(TopTools_HSequenceOfShape)& shapeGroup = NULL,
                     const Standard_Boolean isManifold = Standard_True,
                     const Message_ProgressRange& theProgress = Message_ProgressRange());
@@ -75,6 +78,7 @@ public:
                    (const Handle(Transfer_Finder)& start,
                     const Handle(StepShape_ShapeDefinitionRepresentation)& SDR,
                     const Handle(Transfer_FinderProcess)& FP,
+                    const StepData_Factors& theLocalFactors,
                     const Message_ProgressRange& theProgress = Message_ProgressRange());
   
   Standard_EXPORT void SetMode (const STEPControl_StepModelType M);
index bdb17f8f88e90c2399dfdb60d1f54265349ea22c..87737b0aaf1aa1d9397d33f969cf7bab03e63192 100644 (file)
@@ -54,6 +54,8 @@ STEPControl_Controller::STEPControl_Controller ()
 : XSControl_Controller ("STEP", "step")
 {
   static Standard_Boolean init = Standard_False;
+  static Standard_Mutex aMutex;
+  aMutex.Lock();
   if (!init) {
     RWHeaderSection::Init();  RWStepAP214::Init();
 
@@ -318,6 +320,7 @@ STEPControl_Controller::STEPControl_Controller ()
 
     init = Standard_True;
   }
+  aMutex.Unlock();
 
   Handle(STEPControl_ActorWrite) ActWrite = new STEPControl_ActorWrite;
   ActWrite->SetGroupMode (Interface_Static::IVal("write.step.assembly"));
index 6b55fecb83698e94dec0a536cf168d930e5b614a..eaeb887fd94fa9355e50a6fb938de1309bd4d12f 100644 (file)
@@ -17,6 +17,7 @@
 #include <IFSelect_SelectModelEntities.hxx>
 #include <IFSelect_SelectModelRoots.hxx>
 #include <IFSelect_SelectSignature.hxx>
+#include <Standard_Mutex.hxx>
 #include <StepAP214.hxx>
 #include <StepAP214_Protocol.hxx>
 #include <StepData_StepModel.hxx>
@@ -43,6 +44,8 @@ Handle(StepData_StepModel)  STEPEdit::NewModel ()
 
 Handle(IFSelect_Signature)  STEPEdit::SignType ()
 {
+  static Standard_Mutex aMutex;
+  Standard_Mutex::Sentry aSentry(aMutex);
   static Handle(StepSelect_StepType) sty;
   if (!sty.IsNull()) return sty;
   sty = new StepSelect_StepType;
index a91692226ad71abf67fdf14004b3e85d4351806f..9f0816631f07014c22f64b19391bb883216db78f 100644 (file)
@@ -85,6 +85,8 @@ Standard_Boolean  STEPEdit_EditContext::Load
   if (modl.IsNull()) return Standard_False;
 
   STEPConstruct_ContextTool ctx (modl);
+  StepData_Factors aLocalFactors;
+  ctx.SetGlobalFactor(aLocalFactors);
 
   form->LoadValue (1, modl->StringLabel(ctx.GetAPD()) );
 
@@ -111,6 +113,8 @@ Standard_Boolean  STEPEdit_EditContext::Apply
   if (modl.IsNull()) return Standard_False;
 
   STEPConstruct_ContextTool ctx (modl);
+  StepData_Factors aLocalFactors;
+  ctx.SetGlobalFactor(aLocalFactors);
 
   ctx.AddAPD();  // on ne sait jamais
 //  ctx.AddPRPC();
index 024ddc4ea29314125c05fbbeeb648de8fd3983ca..75f837ab2bfa9be21279a44e99daefa1ec9273da 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <Interface_EntityIterator.hxx>
 #include <Interface_Graph.hxx>
+#include <Standard_Mutex.hxx>
 #include <Standard_Transient.hxx>
 #include <Standard_Type.hxx>
 #include <StepGeom_CompositeCurve.hxx>
@@ -45,10 +46,13 @@ Standard_Boolean STEPSelections_SelectGSCurves::Explore(const Standard_Integer /
       Standard_Boolean isInGeomSet = Standard_False;
       for (subs.Start(); subs.More()&&!isInGeomSet; subs.Next()) 
        if(subs.Value()->IsKind(STANDARD_TYPE(StepShape_GeometricSet))){
+    static Standard_Mutex aMutex;
+    aMutex.Lock();
          if(flag) {
            explored.AddItem (subs.Value());
            flag =0;
          }
+    aMutex.Unlock();
          isInGeomSet = Standard_True; 
        }
       if(isInGeomSet) {
index 2ce4764542b9c123f1fac3c351eaed191b03a5c2..b59ca6ea53de70ca585ebf6dc5ce7b9725ce3cf0 100644 (file)
@@ -18,6 +18,7 @@
 #include <Interface_EntityIterator.hxx>
 #include <Interface_HGraph.hxx>
 #include <Interface_Macros.hxx>
+#include <Standard_Mutex.hxx>
 #include <Standard_Transient.hxx>
 #include <Standard_Type.hxx>
 #include <STEPConstruct_Assembly.hxx>
@@ -137,15 +138,16 @@ static void AddInstances(const Handle(Standard_Transient)& start,
      
 Interface_EntityIterator STEPSelections_SelectInstances::RootResult(const Interface_Graph &G) const
 {
+  static Standard_Mutex aMutex;
+  Standard_Mutex::Sentry aSentry(aMutex);
   if(myGraph.IsNull()||(G.Model()!=myGraph->Graph().Model()))
-    {
-      
-      Interface_EntityIterator roots = G.RootEntities();
-      myGraph = new Interface_HGraph(G);
-      myEntities.Destroy();
-      for (roots.Start(); roots.More(); roots.Next())
-       AddInstances(roots.Value(), G, myEntities);
-    }
+  {
+    Interface_EntityIterator roots = G.RootEntities();
+    myGraph = new Interface_HGraph(G);
+    myEntities.Destroy();
+    for (roots.Start(); roots.More(); roots.Next())
+      AddInstances(roots.Value(), G, myEntities);
+  }
 
   if(HasInput()||HasAlternate()) {
     Interface_EntityIterator select = InputResult(G);
index a80a6ee10f924051733b923c1c917f6051b473d1..65edda095b4903513c577b64e240f07d0f21748d 100644 (file)
@@ -13,6 +13,8 @@ StepData_EnumTool.cxx
 StepData_EnumTool.hxx
 StepData_ESDescr.cxx
 StepData_ESDescr.hxx
+StepData_Factors.cxx
+StepData_Factors.hxx
 StepData_Field.cxx
 StepData_Field.hxx
 StepData_FieldList.cxx
@@ -31,8 +33,6 @@ StepData_FreeFormEntity.cxx
 StepData_FreeFormEntity.hxx
 StepData_GeneralModule.cxx
 StepData_GeneralModule.hxx
-StepData_GlobalFactors.cxx
-StepData_GlobalFactors.hxx
 StepData_GlobalNodeOfWriterLib.hxx
 StepData_GlobalNodeOfWriterLib_0.cxx
 StepData_HArray1OfField.hxx
diff --git a/src/StepData/StepData_Factors.cxx b/src/StepData/StepData_Factors.cxx
new file mode 100644 (file)
index 0000000..5d81f03
--- /dev/null
@@ -0,0 +1,103 @@
+// Copyright (c) 2021 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include <StepData_Factors.hxx>
+
+// ============================================================================
+// Method : Consturctor
+// Purpose:
+// ============================================================================
+StepData_Factors::StepData_Factors()
+  :myLengthFactor(1.), myPlaneAngleFactor(1.),
+   mySolidAngleFactor(1.), myFactRD(1.),
+   myFactDR(1.), myCascadeUnit(1.)
+{}
+
+// ============================================================================
+// Method : InitializeFactors
+// Purpose:
+// ============================================================================
+void StepData_Factors::InitializeFactors(
+  const Standard_Real theLengthFactor,
+  const Standard_Real thePlaneAngleFactor,
+  const Standard_Real theSolidAngleFactor)
+{
+  myLengthFactor = theLengthFactor;
+  myPlaneAngleFactor = thePlaneAngleFactor;
+  mySolidAngleFactor = theSolidAngleFactor;
+  myFactRD = 1. / thePlaneAngleFactor;
+  myFactDR = thePlaneAngleFactor;
+}
+
+// ============================================================================
+// Method : LengthFactor
+// Purpose:
+// ============================================================================
+Standard_Real StepData_Factors::LengthFactor() const
+{
+  return myLengthFactor;
+}
+
+// ============================================================================
+// Method : PlaneAngleFactor
+// Purpose:
+// ============================================================================
+Standard_Real StepData_Factors::PlaneAngleFactor() const
+{
+  return myPlaneAngleFactor;
+}
+
+// ============================================================================
+// Method : SolidAngleFactor
+// Purpose:
+// ============================================================================
+Standard_Real StepData_Factors::SolidAngleFactor() const
+{
+  return mySolidAngleFactor;
+}
+
+// ============================================================================
+// Method : FactorRadianDegree
+// Purpose:
+// ============================================================================
+Standard_Real StepData_Factors::FactorRadianDegree() const
+{
+  return myFactRD;
+}
+
+// ============================================================================
+// Method : FactorDegreeRadian
+// Purpose:
+// ============================================================================
+Standard_Real StepData_Factors::FactorDegreeRadian() const
+{
+  return myFactDR;
+}
+
+// ============================================================================
+// Method : SetCascadeUnit
+// Purpose:
+// ============================================================================
+void StepData_Factors::SetCascadeUnit(const Standard_Real theUnit)
+{
+  myCascadeUnit = theUnit;
+}
+
+// ============================================================================
+// Method : CascadeUnit
+// Purpose:
+// ============================================================================
+Standard_Real StepData_Factors::CascadeUnit() const
+{
+  return myCascadeUnit;
+}
diff --git a/src/StepData/StepData_Factors.hxx b/src/StepData/StepData_Factors.hxx
new file mode 100644 (file)
index 0000000..e0be87b
--- /dev/null
@@ -0,0 +1,75 @@
+// Copyright (c) 2021 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#ifndef _StepData_Factors_HeaderFile
+#define _StepData_Factors_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineAlloc.hxx>
+#include <Standard_Handle.hxx>
+#include <Standard_Real.hxx>
+#include <Standard_Boolean.hxx>
+
+//! Class for using units variables
+class StepData_Factors
+{
+public:
+
+  DEFINE_STANDARD_ALLOC
+  //! Constructor
+  Standard_EXPORT StepData_Factors();
+
+  //! Initializes the 3 factors for the conversion of units
+  Standard_EXPORT void InitializeFactors(
+    const Standard_Real theLengthFactor,
+    const Standard_Real thePlaneAngleFactor,
+    const Standard_Real theSolidAngleFactor);
+
+  //! Sets length unit for current transfer process
+  Standard_EXPORT void SetCascadeUnit(const Standard_Real theUnit);
+
+  //! Returns length unit for current transfer process (mm by default)
+  Standard_EXPORT Standard_Real CascadeUnit() const;
+
+  //! Returns transient length factor for scaling of shapes
+  //! at one stage of transfer process
+  Standard_EXPORT Standard_Real LengthFactor() const;
+
+  //! Returns transient plane angle factor for conversion of angles
+  //! at one stage of transfer process
+  Standard_EXPORT Standard_Real PlaneAngleFactor() const;
+
+  //! Returns transient solid angle factor for conversion of angles
+  //! at one stage of transfer process
+  Standard_EXPORT Standard_Real SolidAngleFactor() const;
+
+  //! Returns transient factor radian degree for conversion of angles
+  //! at one stage of transfer process
+  Standard_EXPORT Standard_Real FactorRadianDegree() const;
+
+  //! Returns transient factor degree radian for conversion of angles
+  //! at one stage of transfer process
+  Standard_EXPORT Standard_Real FactorDegreeRadian() const;
+
+private:
+
+  Standard_Real myLengthFactor;
+  Standard_Real myPlaneAngleFactor;
+  Standard_Real mySolidAngleFactor;
+  Standard_Real myFactRD;
+  Standard_Real myFactDR;
+  Standard_Real myCascadeUnit;
+};
+
+#endif // _StepData_Factors_HeaderFile
diff --git a/src/StepData/StepData_GlobalFactors.cxx b/src/StepData/StepData_GlobalFactors.cxx
deleted file mode 100644 (file)
index 37cff58..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-// Copyright (c) 2021 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#include <StepData_GlobalFactors.hxx>
-
-// ============================================================================
-// Method : Consturctor
-// Purpose:
-// ============================================================================
-StepData_GlobalFactors::StepData_GlobalFactors()
-  :myLengthFactor(1.), myPlaneAngleFactor(1.),
-   mySolidAngleFactor(1.), myFactRD(1.),
-   myFactDR(1.), myCascadeUnit(1.)
-{}
-
-// ============================================================================
-// Method : Intance
-// Purpose:
-// ============================================================================
-StepData_GlobalFactors& StepData_GlobalFactors::Intance()
-{
-  static StepData_GlobalFactors THE_FACTORS;
-  return THE_FACTORS;
-}
-
-// ============================================================================
-// Method : InitializeFactors
-// Purpose:
-// ============================================================================
-void StepData_GlobalFactors::InitializeFactors(
-  const Standard_Real theLengthFactor,
-  const Standard_Real thePlaneAngleFactor,
-  const Standard_Real theSolidAngleFactor)
-{
-  myLengthFactor = theLengthFactor;
-  myPlaneAngleFactor = thePlaneAngleFactor;
-  mySolidAngleFactor = theSolidAngleFactor;
-  myFactRD = 1. / thePlaneAngleFactor;
-  myFactDR = thePlaneAngleFactor;
-}
-
-// ============================================================================
-// Method : LengthFactor
-// Purpose:
-// ============================================================================
-Standard_Real StepData_GlobalFactors::LengthFactor()
-{
-  return myLengthFactor;
-}
-
-// ============================================================================
-// Method : PlaneAngleFactor
-// Purpose:
-// ============================================================================
-Standard_Real StepData_GlobalFactors::PlaneAngleFactor()
-{
-  return myPlaneAngleFactor;
-}
-
-// ============================================================================
-// Method : SolidAngleFactor
-// Purpose:
-// ============================================================================
-Standard_Real StepData_GlobalFactors::SolidAngleFactor()
-{
-  return mySolidAngleFactor;
-}
-
-// ============================================================================
-// Method : FactorRadianDegree
-// Purpose:
-// ============================================================================
-Standard_Real StepData_GlobalFactors::FactorRadianDegree()
-{
-  return myFactRD;
-}
-
-// ============================================================================
-// Method : FactorDegreeRadian
-// Purpose:
-// ============================================================================
-Standard_Real StepData_GlobalFactors::FactorDegreeRadian()
-{
-  return myFactDR;
-}
-
-// ============================================================================
-// Method : SetCascadeUnit
-// Purpose:
-// ============================================================================
-void StepData_GlobalFactors::SetCascadeUnit(const Standard_Real theUnit)
-{
-  myCascadeUnit = theUnit;
-}
-
-// ============================================================================
-// Method : CascadeUnit
-// Purpose:
-// ============================================================================
-Standard_Real StepData_GlobalFactors::CascadeUnit()
-{
-  return myCascadeUnit;
-}
diff --git a/src/StepData/StepData_GlobalFactors.hxx b/src/StepData/StepData_GlobalFactors.hxx
deleted file mode 100644 (file)
index fbad607..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright (c) 2021 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and/or modify it under
-// the terms of the GNU Lesser General Public License version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#ifndef _StepData_GlobalFactors_HeaderFile
-#define _StepData_GlobalFactors_HeaderFile
-
-#include <Standard.hxx>
-#include <Standard_DefineAlloc.hxx>
-#include <Standard_Handle.hxx>
-#include <Standard_Real.hxx>
-#include <Standard_Boolean.hxx>
-
-//! Class for using global units variables
-class StepData_GlobalFactors
-{
-
-private:
-
-  Standard_EXPORT StepData_GlobalFactors();
-
-public:
-
-  DEFINE_STANDARD_ALLOC
-  //! Returns a global static object
-  Standard_EXPORT static StepData_GlobalFactors& Intance();
-
-  //! Initializes the 3 factors for the conversion of units
-  Standard_EXPORT void InitializeFactors(
-    const Standard_Real theLengthFactor,
-    const Standard_Real thePlaneAngleFactor,
-    const Standard_Real theSolidAngleFactor);
-
-  //! Sets length unit for current transfer process
-  Standard_EXPORT void SetCascadeUnit(const Standard_Real theUnit);
-
-  //! Returns length unit for current transfer process (mm by default)
-  Standard_EXPORT Standard_Real CascadeUnit();
-
-  //! Returns transient length factor for scaling of shapes
-  //! at one stage of transfer process
-  Standard_EXPORT Standard_Real LengthFactor();
-
-  //! Returns transient plane angle factor for conversion of angles
-  //! at one stage of transfer process
-  Standard_EXPORT Standard_Real PlaneAngleFactor();
-
-  //! Returns transient solid angle factor for conversion of angles
-  //! at one stage of transfer process
-  Standard_EXPORT Standard_Real SolidAngleFactor();
-
-  //! Returns transient factor radian degree for conversion of angles
-  //! at one stage of transfer process
-  Standard_EXPORT Standard_Real FactorRadianDegree();
-
-  //! Returns transient factor degree radian for conversion of angles
-  //! at one stage of transfer process
-  Standard_EXPORT Standard_Real FactorDegreeRadian();
-
-private:
-
-  Standard_Real myLengthFactor;
-  Standard_Real myPlaneAngleFactor;
-  Standard_Real mySolidAngleFactor;
-  Standard_Real myFactRD;
-  Standard_Real myFactDR;
-  Standard_Real myCascadeUnit;
-};
-
-#endif // _StepData_GlobalFactors_HeaderFile
index f8941148aff1fbf43e63be756302c5a3bf5bd647..7a392dfce99003b512b53df956700313e025e816 100644 (file)
@@ -23,7 +23,6 @@
 #include <Standard_Type.hxx>
 #include <StepData.hxx>
 #include <StepData_Protocol.hxx>
-#include <StepData_GlobalFactors.hxx>
 #include <StepData_StepModel.hxx>
 #include <StepData_StepWriter.hxx>
 #include <TCollection_HAsciiString.hxx>
@@ -216,7 +215,7 @@ Handle(TCollection_HAsciiString) StepData_StepModel::StringLabel
 //=======================================================================
 void StepData_StepModel::SetLocalLengthUnit(const Standard_Real theUnit)
 {
-  StepData_GlobalFactors::Intance().SetCascadeUnit(theUnit);
+  myLocalLengthUnit = theUnit;
   myReadUnitIsInitialized = Standard_True;
 }
 
@@ -226,7 +225,7 @@ void StepData_StepModel::SetLocalLengthUnit(const Standard_Real theUnit)
 //=======================================================================
 Standard_Real StepData_StepModel::LocalLengthUnit() const
 {
-  return StepData_GlobalFactors::Intance().CascadeUnit();
+  return myLocalLengthUnit;
 }
 
 //=======================================================================
@@ -245,4 +244,4 @@ void StepData_StepModel::SetWriteLengthUnit(const Standard_Real theUnit)
 Standard_Real StepData_StepModel::WriteLengthUnit() const
 {
   return myWriteUnit;
-}
\ No newline at end of file
+}
index dce1d5beb0803e2aabbd75031f94b21b11aebec2..8c1dc28ac5744f00f06cb1eeb9e006ec67bed64f 100644 (file)
@@ -21,6 +21,7 @@
 #include <TColStd_HArray1OfInteger.hxx>
 #include <Interface_InterfaceModel.hxx>
 #include <Resource_FormatType.hxx>
+#include <StepData_Factors.hxx>
 
 class Standard_Transient;
 class Interface_EntityIterator;
@@ -135,8 +136,7 @@ private:
   Resource_FormatType mySourceCodePage;
   Standard_Boolean myReadUnitIsInitialized;
   Standard_Real myWriteUnit;
-
-
+  Standard_Real myLocalLengthUnit;
 };
 
 
index 69b5397606d4036e270ff25ab73fa69eb7b38e94..d7fdae70c53179662399d0591f19d409e93e75cb 100644 (file)
@@ -15,6 +15,7 @@
 #include <Interface_InterfaceError.hxx>
 #include <Interface_InterfaceModel.hxx>
 #include <Interface_Macros.hxx>
+#include <Standard_Mutex.hxx>
 #include <Standard_Transient.hxx>
 #include <Standard_Type.hxx>
 #include <StepData_Protocol.hxx>
@@ -49,6 +50,8 @@ static TCollection_AsciiString lastvalue;
   (const Handle(Standard_Transient)& ent,
    const Handle(Interface_InterfaceModel)& /*model*/) const
 {
+  static Standard_Mutex aMutex;
+  Standard_Mutex::Sentry aSentry(aMutex);
   lastvalue.Clear();
   Handle(StepData_ReadWriteModule) module;
   Standard_Integer CN;
index 1b365c150ef957173485964526437b85cf64835b..084531d8f08fcb3d70e385bcadb658dcd4b0c36e 100644 (file)
 #include <TopoDS.hxx>
 #include <TopoDS_Face.hxx>
 
-#include <StepData_GlobalFactors.hxx>
+#include <StepData_Factors.hxx>
 #include <StepBasic_ConversionBasedUnitAndPlaneAngleUnit.hxx>
 #include <StepBasic_SiUnitAndPlaneAngleUnit.hxx>
 #include <StepBasic_MeasureWithUnit.hxx>
 // Creation d' un Ax1Placement de Geom a partir d' un axis1_placement de Step
 //=============================================================================
 
-Handle(Geom_Axis1Placement) StepToGeom::MakeAxis1Placement (const Handle(StepGeom_Axis1Placement)& SA)
+Handle(Geom_Axis1Placement) StepToGeom::MakeAxis1Placement (const Handle(StepGeom_Axis1Placement)& SA,
+                                                            const StepData_Factors& theLocalFactors)
 {
-  Handle(Geom_CartesianPoint) P = MakeCartesianPoint (SA->Location());
+  Handle(Geom_CartesianPoint) P = MakeCartesianPoint (SA->Location(), theLocalFactors);
   if (! P.IsNull())
   {
     // sln 22.10.2001. CTS23496: If problems with creation of axis direction occur default direction is used
@@ -160,9 +161,10 @@ Handle(Geom_Axis1Placement) StepToGeom::MakeAxis1Placement (const Handle(StepGeo
 // Creation d' un Axis2Placement de Geom a partir d' un axis2_placement_3d de Step
 //=============================================================================
 
-Handle(Geom_Axis2Placement) StepToGeom::MakeAxis2Placement (const Handle(StepGeom_Axis2Placement3d)& SA)
+Handle(Geom_Axis2Placement) StepToGeom::MakeAxis2Placement (const Handle(StepGeom_Axis2Placement3d)& SA,
+                                                            const StepData_Factors& theLocalFactors)
 {
-  Handle(Geom_CartesianPoint) P = MakeCartesianPoint (SA->Location());
+  Handle(Geom_CartesianPoint) P = MakeCartesianPoint (SA->Location(), theLocalFactors);
   if (! P.IsNull())
   {
     const gp_Pnt Pgp = P->Pnt();
@@ -225,9 +227,10 @@ Handle(Geom_Axis2Placement) StepToGeom::MakeAxis2Placement(const Handle(StepGeom
 // Creation d' un AxisPlacement de Geom2d a partir d' un axis2_placement_3d de Step
 //=============================================================================
 
-Handle(Geom2d_AxisPlacement) StepToGeom::MakeAxisPlacement (const Handle(StepGeom_Axis2Placement2d)& SA)
+Handle(Geom2d_AxisPlacement) StepToGeom::MakeAxisPlacement (const Handle(StepGeom_Axis2Placement2d)& SA,
+                                                            const StepData_Factors& theLocalFactors)
 {
-  Handle(Geom2d_CartesianPoint) P = MakeCartesianPoint2d (SA->Location());
+  Handle(Geom2d_CartesianPoint) P = MakeCartesianPoint2d (SA->Location(), theLocalFactors);
   if (! P.IsNull())
   {
     // sln 23.10.2001. CTS23496: If problems with creation of direction occur default direction is used
@@ -247,19 +250,20 @@ Handle(Geom2d_AxisPlacement) StepToGeom::MakeAxisPlacement (const Handle(StepGeo
 // Creation d' une BoundedCurve de Geom a partir d' une BoundedCurve de Step
 //=============================================================================
 
-Handle(Geom_BoundedCurve) StepToGeom::MakeBoundedCurve (const Handle(StepGeom_BoundedCurve)& SC)
+Handle(Geom_BoundedCurve) StepToGeom::MakeBoundedCurve (const Handle(StepGeom_BoundedCurve)& SC,
+                                                        const StepData_Factors& theLocalFactors)
 {
   if (SC->IsKind(STANDARD_TYPE(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve)))
   {
-    return MakeBSplineCurve (Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve)::DownCast(SC));
+    return MakeBSplineCurve (Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve)::DownCast(SC), theLocalFactors);
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_BSplineCurveWithKnots)))
   {
-    return MakeBSplineCurve (Handle(StepGeom_BSplineCurveWithKnots)::DownCast(SC));
+    return MakeBSplineCurve (Handle(StepGeom_BSplineCurveWithKnots)::DownCast(SC), theLocalFactors);
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_TrimmedCurve)))
   {
-    return MakeTrimmedCurve (Handle(StepGeom_TrimmedCurve)::DownCast(SC));
+    return MakeTrimmedCurve (Handle(StepGeom_TrimmedCurve)::DownCast(SC), theLocalFactors);
   }
 
   // STEP BezierCurve, UniformCurve and QuasiUniformCurve are transformed into
@@ -286,7 +290,7 @@ Handle(Geom_BoundedCurve) StepToGeom::MakeBoundedCurve (const Handle(StepGeom_Bo
     BSPL->SetKnotMultiplicities(Kmult);
     BSPL->SetKnots(Knots);
 
-    return MakeBSplineCurve (BSPL);
+    return MakeBSplineCurve (BSPL, theLocalFactors);
   }
 
   if (SC->IsKind(STANDARD_TYPE(StepGeom_UniformCurve)))
@@ -313,7 +317,7 @@ Handle(Geom_BoundedCurve) StepToGeom::MakeBoundedCurve (const Handle(StepGeom_Bo
     BSPL->SetKnotMultiplicities(Kmult);
     BSPL->SetKnots(Knots);
 
-    return MakeBSplineCurve (BSPL);
+    return MakeBSplineCurve (BSPL, theLocalFactors);
   }
 
   if (SC->IsKind(STANDARD_TYPE(StepGeom_QuasiUniformCurve)))
@@ -343,7 +347,7 @@ Handle(Geom_BoundedCurve) StepToGeom::MakeBoundedCurve (const Handle(StepGeom_Bo
     BSPL->SetKnotMultiplicities(Kmult);
     BSPL->SetKnots(Knots);
 
-    return MakeBSplineCurve (BSPL);
+    return MakeBSplineCurve (BSPL, theLocalFactors);
   }
 
   if (SC->IsKind(STANDARD_TYPE(StepGeom_UniformCurveAndRationalBSplineCurve)))
@@ -370,7 +374,7 @@ Handle(Geom_BoundedCurve) StepToGeom::MakeBoundedCurve (const Handle(StepGeom_Bo
                RUC->ClosedCurve(), RUC->SelfIntersect(), Kmult, Knots, StepGeom_ktUnspecified,
                RUC->WeightsData());
 
-    return MakeBSplineCurve (RBSPL);
+    return MakeBSplineCurve (RBSPL, theLocalFactors);
   }
 
   if (SC->IsKind(STANDARD_TYPE(StepGeom_QuasiUniformCurveAndRationalBSplineCurve)))
@@ -398,12 +402,12 @@ Handle(Geom_BoundedCurve) StepToGeom::MakeBoundedCurve (const Handle(StepGeom_Bo
                RQUC->ClosedCurve(), RQUC->SelfIntersect(), Kmult, Knots, StepGeom_ktUnspecified,
                RQUC->WeightsData());
 
-    return MakeBSplineCurve (RBSPL);
+    return MakeBSplineCurve (RBSPL, theLocalFactors);
   }
 
   if (SC->IsKind(STANDARD_TYPE(StepGeom_Polyline)))
   { //:n6 abv 15 Feb 99
-    return MakePolyline (Handle(StepGeom_Polyline)::DownCast (SC));
+    return MakePolyline (Handle(StepGeom_Polyline)::DownCast (SC), theLocalFactors);
   }
 
   return 0;
@@ -413,23 +417,24 @@ Handle(Geom_BoundedCurve) StepToGeom::MakeBoundedCurve (const Handle(StepGeom_Bo
 // Creation d' une BoundedCurve de Geom a partir d' une BoundedCurve de Step
 //=============================================================================
 
-Handle(Geom2d_BoundedCurve) StepToGeom::MakeBoundedCurve2d (const Handle(StepGeom_BoundedCurve)& SC)
+Handle(Geom2d_BoundedCurve) StepToGeom::MakeBoundedCurve2d (const Handle(StepGeom_BoundedCurve)& SC,
+                                                            const StepData_Factors& theLocalFactors)
 {
   if (SC->IsKind(STANDARD_TYPE(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve)))
   {
-    return MakeBSplineCurve2d (Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve)::DownCast(SC));
+    return MakeBSplineCurve2d (Handle(StepGeom_BSplineCurveWithKnotsAndRationalBSplineCurve)::DownCast(SC), theLocalFactors);
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_BSplineCurveWithKnots)))
   {
-    return MakeBSplineCurve2d (Handle(StepGeom_BSplineCurveWithKnots)::DownCast(SC));
+    return MakeBSplineCurve2d (Handle(StepGeom_BSplineCurveWithKnots)::DownCast(SC), theLocalFactors);
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_TrimmedCurve)))
   {
-    return MakeTrimmedCurve2d (Handle(StepGeom_TrimmedCurve)::DownCast(SC));
+    return MakeTrimmedCurve2d (Handle(StepGeom_TrimmedCurve)::DownCast(SC), theLocalFactors);
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_Polyline)))
   { //:n6 abv 15 Feb 99
-    return MakePolyline2d (Handle(StepGeom_Polyline)::DownCast(SC));
+    return MakePolyline2d (Handle(StepGeom_Polyline)::DownCast(SC), theLocalFactors);
   }
   return Handle(Geom2d_BoundedCurve)();
 }
@@ -438,19 +443,20 @@ Handle(Geom2d_BoundedCurve) StepToGeom::MakeBoundedCurve2d (const Handle(StepGeo
 // Creation d' une BoundedSurface de Geom a partir d' une BoundedSurface de Step
 //=============================================================================
 
-Handle(Geom_BoundedSurface) StepToGeom::MakeBoundedSurface (const Handle(StepGeom_BoundedSurface)& SS)
+Handle(Geom_BoundedSurface) StepToGeom::MakeBoundedSurface (const Handle(StepGeom_BoundedSurface)& SS,
+                                                            const StepData_Factors& theLocalFactors)
 {
   if (SS->IsKind(STANDARD_TYPE(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface)))
   {
-    return MakeBSplineSurface (Handle(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface)::DownCast(SS));
+    return MakeBSplineSurface (Handle(StepGeom_BSplineSurfaceWithKnotsAndRationalBSplineSurface)::DownCast(SS), theLocalFactors);
   }
   if (SS->IsKind(STANDARD_TYPE(StepGeom_BSplineSurfaceWithKnots)))
   {
-    return MakeBSplineSurface (Handle(StepGeom_BSplineSurfaceWithKnots)::DownCast(SS));
+    return MakeBSplineSurface (Handle(StepGeom_BSplineSurfaceWithKnots)::DownCast(SS), theLocalFactors);
   }
   if (SS->IsKind(STANDARD_TYPE(StepGeom_RectangularTrimmedSurface)))
   {
-    return MakeRectangularTrimmedSurface (Handle(StepGeom_RectangularTrimmedSurface)::DownCast(SS));
+    return MakeRectangularTrimmedSurface (Handle(StepGeom_RectangularTrimmedSurface)::DownCast(SS), theLocalFactors);
   }
 
   // STEP BezierSurface, UniformSurface and QuasiUniformSurface are transformed
@@ -484,7 +490,7 @@ Handle(Geom_BoundedSurface) StepToGeom::MakeBoundedSurface (const Handle(StepGeo
     BSPL->SetUKnots(UKnots);
     BSPL->SetVKnots(VKnots);
 
-    return MakeBSplineSurface (BSPL);
+    return MakeBSplineSurface (BSPL, theLocalFactors);
   }
 
   if (SS->IsKind(STANDARD_TYPE(StepGeom_UniformSurface)))
@@ -521,7 +527,7 @@ Handle(Geom_BoundedSurface) StepToGeom::MakeBoundedSurface (const Handle(StepGeo
     BSPL->SetVMultiplicities(VKmult);
     BSPL->SetVKnots(VKnots);
 
-    return MakeBSplineSurface (BSPL);
+    return MakeBSplineSurface (BSPL, theLocalFactors);
   }
 
   if (SS->IsKind(STANDARD_TYPE(StepGeom_QuasiUniformSurface)))
@@ -563,7 +569,7 @@ Handle(Geom_BoundedSurface) StepToGeom::MakeBoundedSurface (const Handle(StepGeo
     BSPL->SetVMultiplicities(VKmult);
     BSPL->SetVKnots(VKnots);
 
-    return MakeBSplineSurface (BSPL);
+    return MakeBSplineSurface (BSPL, theLocalFactors);
   }
 
   if (SS->IsKind(STANDARD_TYPE(StepGeom_UniformSurfaceAndRationalBSplineSurface)))
@@ -598,7 +604,7 @@ Handle(Geom_BoundedSurface) StepToGeom::MakeBoundedSurface (const Handle(StepGeo
                UKmult, VKmult, UKnots, VKnots, StepGeom_ktUnspecified,
                RUS->WeightsData());
 
-    return MakeBSplineSurface (RBSPL);
+    return MakeBSplineSurface (RBSPL, theLocalFactors);
   }
 
   if (SS->IsKind(STANDARD_TYPE(StepGeom_QuasiUniformSurfaceAndRationalBSplineSurface)))
@@ -635,7 +641,7 @@ Handle(Geom_BoundedSurface) StepToGeom::MakeBoundedSurface (const Handle(StepGeo
                RQUS->SurfaceForm(), RQUS->UClosed(), RQUS->VClosed(),
                RQUS->SelfIntersect(), UKmult, VKmult, UKnots, VKnots, StepGeom_ktUnspecified,
                RQUS->WeightsData());
-    return MakeBSplineSurface (RBSPL);
+    return MakeBSplineSurface (RBSPL, theLocalFactors);
   }
 
   return 0;
@@ -655,8 +661,9 @@ template
 Handle(TBSplineCurve) MakeBSplineCurveCommon
 (
   const Handle(StepGeom_BSplineCurve)& theStepGeom_BSplineCurve,
+  const StepData_Factors& theLocalFactors,
   TGpPnt(TCartesianPoint::* thePntGetterFunction)() const,
-  Handle(TCartesianPoint) (*thePointMakerFunction)(const Handle(StepGeom_CartesianPoint)&)
+  Handle(TCartesianPoint) (*thePointMakerFunction)(const Handle(StepGeom_CartesianPoint)&, const StepData_Factors&)
 )
 {
   Handle(StepGeom_BSplineCurveWithKnots) aBSplineCurveWithKnots;
@@ -747,7 +754,7 @@ Handle(TBSplineCurve) MakeBSplineCurveCommon
 
   for (Standard_Integer i = 1 + aFirstMuultypisityDifference; i <= NbPoles - aLastMuultypisityDifference; ++i)
   {
-    Handle(TCartesianPoint) aPoint = (*thePointMakerFunction)(aControlPointsList->Value(i));
+    Handle(TCartesianPoint) aPoint = (*thePointMakerFunction)(aControlPointsList->Value(i), theLocalFactors);
     if (!aPoint.IsNull())
     {
       TCartesianPoint* pPoint = aPoint.get();
@@ -810,10 +817,11 @@ Handle(TBSplineCurve) MakeBSplineCurveCommon
 // Creation d' une BSplineCurve de Geom a partir d' une BSplineCurve de Step
 //=============================================================================
 
-Handle(Geom_BSplineCurve) StepToGeom::MakeBSplineCurve (const Handle(StepGeom_BSplineCurve)& theStepGeom_BSplineCurve)
+Handle(Geom_BSplineCurve) StepToGeom::MakeBSplineCurve (const Handle(StepGeom_BSplineCurve)& theStepGeom_BSplineCurve,
+                                                        const StepData_Factors& theLocalFactors)
 {
   return MakeBSplineCurveCommon<TColgp_Array1OfPnt, Geom_CartesianPoint, gp_Pnt, Geom_BSplineCurve>
-    (theStepGeom_BSplineCurve, &Geom_CartesianPoint::Pnt, &MakeCartesianPoint);
+    (theStepGeom_BSplineCurve, theLocalFactors, &Geom_CartesianPoint::Pnt, &MakeCartesianPoint);
 }
 
 //=============================================================================
@@ -821,10 +829,11 @@ Handle(Geom_BSplineCurve) StepToGeom::MakeBSplineCurve (const Handle(StepGeom_BS
 // BSplineCurveWithKnotsAndRationalBSplineCurve de Step
 //=============================================================================
 
-Handle(Geom2d_BSplineCurve) StepToGeom::MakeBSplineCurve2d (const Handle(StepGeom_BSplineCurve)& theStepGeom_BSplineCurve)
+Handle(Geom2d_BSplineCurve) StepToGeom::MakeBSplineCurve2d (const Handle(StepGeom_BSplineCurve)& theStepGeom_BSplineCurve,
+                                                            const StepData_Factors& theLocalFactors)
 {
   return MakeBSplineCurveCommon<TColgp_Array1OfPnt2d, Geom2d_CartesianPoint, gp_Pnt2d, Geom2d_BSplineCurve>
-    (theStepGeom_BSplineCurve, &Geom2d_CartesianPoint::Pnt2d, &MakeCartesianPoint2d);
+    (theStepGeom_BSplineCurve, theLocalFactors, &Geom2d_CartesianPoint::Pnt2d, &MakeCartesianPoint2d);
 }
 
 //=============================================================================
@@ -832,7 +841,8 @@ Handle(Geom2d_BSplineCurve) StepToGeom::MakeBSplineCurve2d (const Handle(StepGeo
 // BSplineSurface de Step
 //=============================================================================
 
-Handle(Geom_BSplineSurface) StepToGeom::MakeBSplineSurface (const Handle(StepGeom_BSplineSurface)& SS)
+Handle(Geom_BSplineSurface) StepToGeom::MakeBSplineSurface (const Handle(StepGeom_BSplineSurface)& SS,
+                                                            const StepData_Factors& theLocalFactors)
 {
   Standard_Integer                    i, j;
   Handle(StepGeom_BSplineSurfaceWithKnots) BS;
@@ -856,7 +866,7 @@ Handle(Geom_BSplineSurface) StepToGeom::MakeBSplineSurface (const Handle(StepGeo
   TColgp_Array2OfPnt Poles(1,NUPoles,1,NVPoles);
   for (i=1; i<=NUPoles; i++) {
     for (j=1; j<=NVPoles; j++) {
-      Handle(Geom_CartesianPoint) P = MakeCartesianPoint (aControlPointsList->Value(i,j));
+      Handle(Geom_CartesianPoint) P = MakeCartesianPoint (aControlPointsList->Value(i,j), theLocalFactors);
       if (! P.IsNull())
         Poles.SetValue(i,j,P->Pnt());
       else
@@ -995,11 +1005,12 @@ Handle(Geom_BSplineSurface) StepToGeom::MakeBSplineSurface (const Handle(StepGeo
 // Creation d' un CartesianPoint de Geom a partir d' un CartesianPoint de Step
 //=============================================================================
 
-Handle(Geom_CartesianPoint) StepToGeom::MakeCartesianPoint (const Handle(StepGeom_CartesianPoint)& SP)
+Handle(Geom_CartesianPoint) StepToGeom::MakeCartesianPoint (const Handle(StepGeom_CartesianPoint)& SP,
+                                                            const StepData_Factors& theLocalFactors)
 {
   if (SP->NbCoordinates() == 3)
   {
-    const Standard_Real LF = StepData_GlobalFactors::Intance().LengthFactor();
+    const Standard_Real LF = theLocalFactors.LengthFactor();
     const Standard_Real X = SP->CoordinatesValue(1) * LF;
     const Standard_Real Y = SP->CoordinatesValue(2) * LF;
     const Standard_Real Z = SP->CoordinatesValue(3) * LF;
@@ -1013,8 +1024,10 @@ Handle(Geom_CartesianPoint) StepToGeom::MakeCartesianPoint (const Handle(StepGeo
 // Step
 //=============================================================================
 
-Handle(Geom2d_CartesianPoint) StepToGeom::MakeCartesianPoint2d (const Handle(StepGeom_CartesianPoint)& SP)
+Handle(Geom2d_CartesianPoint) StepToGeom::MakeCartesianPoint2d (const Handle(StepGeom_CartesianPoint)& SP,
+                                                                const StepData_Factors& theLocalFactors)
 {
+  (void)theLocalFactors;
   if (SP->NbCoordinates() == 2)
   {
     const Standard_Real X = SP->CoordinatesValue(1);
@@ -1028,16 +1041,17 @@ Handle(Geom2d_CartesianPoint) StepToGeom::MakeCartesianPoint2d (const Handle(Ste
 // Creation d' un Circle de Geom a partir d' un Circle de Step
 //=============================================================================
 
-Handle(Geom_Circle) StepToGeom::MakeCircle (const Handle(StepGeom_Circle)& SC)
+Handle(Geom_Circle) StepToGeom::MakeCircle (const Handle(StepGeom_Circle)& SC,
+                                            const StepData_Factors& theLocalFactors)
 {
   const StepGeom_Axis2Placement AxisSelect = SC->Position();
   if (AxisSelect.CaseNum(AxisSelect.Value()) == 2)
   {
     Handle(Geom_Axis2Placement) A =
-      MakeAxis2Placement (Handle(StepGeom_Axis2Placement3d)::DownCast(AxisSelect.Value()));
+      MakeAxis2Placement (Handle(StepGeom_Axis2Placement3d)::DownCast(AxisSelect.Value()), theLocalFactors);
     if (! A.IsNull())
     {
-      return new Geom_Circle(A->Ax2(),SC->Radius() * StepData_GlobalFactors::Intance().LengthFactor());
+      return new Geom_Circle(A->Ax2(), SC->Radius() * theLocalFactors.LengthFactor());
     }
   }
   return 0;
@@ -1047,12 +1061,13 @@ Handle(Geom_Circle) StepToGeom::MakeCircle (const Handle(StepGeom_Circle)& SC)
 // Creation d' un Circle de Geom2d a partir d' un Circle de Step
 //=============================================================================
 
-Handle(Geom2d_Circle) StepToGeom::MakeCircle2d (const Handle(StepGeom_Circle)& SC)
+Handle(Geom2d_Circle) StepToGeom::MakeCircle2d (const Handle(StepGeom_Circle)& SC,
+                                                const StepData_Factors& theLocalFactors)
 {
   const StepGeom_Axis2Placement AxisSelect = SC->Position();
   if (AxisSelect.CaseNum(AxisSelect.Value()) == 1) {
     Handle(Geom2d_AxisPlacement) A1 =
-      MakeAxisPlacement (Handle(StepGeom_Axis2Placement2d)::DownCast(AxisSelect.Value()));
+      MakeAxisPlacement (Handle(StepGeom_Axis2Placement2d)::DownCast(AxisSelect.Value()), theLocalFactors);
     if (! A1.IsNull())
     {
       return new Geom2d_Circle (A1->Ax2d(), SC->Radius());
@@ -1065,19 +1080,20 @@ Handle(Geom2d_Circle) StepToGeom::MakeCircle2d (const Handle(StepGeom_Circle)& S
 // Creation d' une Conic de Geom a partir d' une Conic de Step
 //=============================================================================
 
-Handle(Geom_Conic) StepToGeom::MakeConic (const Handle(StepGeom_Conic)& SC)
+Handle(Geom_Conic) StepToGeom::MakeConic (const Handle(StepGeom_Conic)& SC,
+                                          const StepData_Factors& theLocalFactors)
 {
   if (SC->IsKind(STANDARD_TYPE(StepGeom_Circle))) {
-    return MakeCircle (Handle(StepGeom_Circle)::DownCast(SC));
+    return MakeCircle (Handle(StepGeom_Circle)::DownCast(SC), theLocalFactors);
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_Ellipse))) {
-    return MakeEllipse (Handle(StepGeom_Ellipse)::DownCast(SC));
+    return MakeEllipse (Handle(StepGeom_Ellipse)::DownCast(SC), theLocalFactors);
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_Hyperbola))) {
-    return MakeHyperbola (Handle(StepGeom_Hyperbola)::DownCast(SC));
+    return MakeHyperbola (Handle(StepGeom_Hyperbola)::DownCast(SC), theLocalFactors);
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_Parabola))) {
-    return MakeParabola (Handle(StepGeom_Parabola)::DownCast(SC));
+    return MakeParabola (Handle(StepGeom_Parabola)::DownCast(SC), theLocalFactors);
   }
   // Attention : Other conic shall be implemented !
   return 0;
@@ -1087,19 +1103,20 @@ Handle(Geom_Conic) StepToGeom::MakeConic (const Handle(StepGeom_Conic)& SC)
 // Creation d' une Conic de Geom2d a partir d' une Conic de Step
 //=============================================================================
 
-Handle(Geom2d_Conic) StepToGeom::MakeConic2d (const Handle(StepGeom_Conic)& SC)
+Handle(Geom2d_Conic) StepToGeom::MakeConic2d (const Handle(StepGeom_Conic)& SC,
+                                              const StepData_Factors& theLocalFactors)
 {
   if (SC->IsKind(STANDARD_TYPE(StepGeom_Circle))) {
-    return MakeCircle2d (Handle(StepGeom_Circle)::DownCast(SC));
+    return MakeCircle2d (Handle(StepGeom_Circle)::DownCast(SC), theLocalFactors);
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_Ellipse))) {
-    return MakeEllipse2d (Handle(StepGeom_Ellipse)::DownCast(SC));
+    return MakeEllipse2d (Handle(StepGeom_Ellipse)::DownCast(SC), theLocalFactors);
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_Hyperbola))) {
-    return MakeHyperbola2d (Handle(StepGeom_Hyperbola)::DownCast(SC));
+    return MakeHyperbola2d (Handle(StepGeom_Hyperbola)::DownCast(SC), theLocalFactors);
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_Parabola))) {
-    return MakeParabola2d (Handle(StepGeom_Parabola)::DownCast(SC));
+    return MakeParabola2d (Handle(StepGeom_Parabola)::DownCast(SC), theLocalFactors);
   }
   // Attention : Other conic shall be implemented !
   return Handle(Geom2d_Conic)();
@@ -1110,13 +1127,14 @@ Handle(Geom2d_Conic) StepToGeom::MakeConic2d (const Handle(StepGeom_Conic)& SC)
 // Step
 //=============================================================================
 
-Handle(Geom_ConicalSurface) StepToGeom::MakeConicalSurface (const Handle(StepGeom_ConicalSurface)& SS)
+Handle(Geom_ConicalSurface) StepToGeom::MakeConicalSurface (const Handle(StepGeom_ConicalSurface)& SS,
+                                                            const StepData_Factors& theLocalFactors)
 {
-  Handle(Geom_Axis2Placement) A = MakeAxis2Placement (SS->Position());
+  Handle(Geom_Axis2Placement) A = MakeAxis2Placement (SS->Position(), theLocalFactors);
   if (! A.IsNull())
   {
-    const Standard_Real R = SS->Radius() * StepData_GlobalFactors::Intance().LengthFactor();
-    const Standard_Real Ang = SS->SemiAngle() * StepData_GlobalFactors::Intance().PlaneAngleFactor();
+    const Standard_Real R = SS->Radius() * theLocalFactors.LengthFactor();
+    const Standard_Real Ang = SS->SemiAngle() * theLocalFactors.PlaneAngleFactor();
     //#2(K3-3) rln 12/02/98 ProSTEP ct_turbine-A.stp entity #518, #3571 (gp::Resolution() is too little)
     return new Geom_ConicalSurface(A->Ax2(), Max(Ang, Precision::Angular()), R);
   }
@@ -1127,22 +1145,23 @@ Handle(Geom_ConicalSurface) StepToGeom::MakeConicalSurface (const Handle(StepGeo
 // Creation d' une Curve de Geom a partir d' une Curve de Step
 //=============================================================================
 
-Handle(Geom_Curve) StepToGeom::MakeCurve (const Handle(StepGeom_Curve)& SC)
+Handle(Geom_Curve) StepToGeom::MakeCurve (const Handle(StepGeom_Curve)& SC,
+                                          const StepData_Factors& theLocalFactors)
 {
   if (SC.IsNull()){
     return Handle(Geom_Curve)();
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_Line))) {
-    return MakeLine (Handle(StepGeom_Line)::DownCast(SC));
+    return MakeLine (Handle(StepGeom_Line)::DownCast(SC), theLocalFactors);
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_TrimmedCurve))) {
-    return MakeTrimmedCurve (Handle(StepGeom_TrimmedCurve)::DownCast(SC));
+    return MakeTrimmedCurve (Handle(StepGeom_TrimmedCurve)::DownCast(SC), theLocalFactors);
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_Conic))) {
-    return MakeConic (Handle(StepGeom_Conic)::DownCast(SC));
+    return MakeConic (Handle(StepGeom_Conic)::DownCast(SC), theLocalFactors);
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_BoundedCurve))) {
-    return MakeBoundedCurve (Handle(StepGeom_BoundedCurve)::DownCast(SC));
+    return MakeBoundedCurve (Handle(StepGeom_BoundedCurve)::DownCast(SC), theLocalFactors);
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_CurveReplica))) { //:n7 abv 16 Feb 99
     const Handle(StepGeom_CurveReplica) CR = Handle(StepGeom_CurveReplica)::DownCast(SC);
@@ -1152,11 +1171,11 @@ Handle(Geom_Curve) StepToGeom::MakeCurve (const Handle(StepGeom_Curve)& SC)
     // protect against cyclic references and wrong type of cartop
     if ( !T.IsNull() && PC != SC )
     {
-      Handle(Geom_Curve) C1 = MakeCurve (PC);
+      Handle(Geom_Curve) C1 = MakeCurve (PC, theLocalFactors);
       if (! C1.IsNull())
       {
         gp_Trsf T1;
-        if (MakeTransformation3d(T,T1))
+        if (MakeTransformation3d(T, T1, theLocalFactors))
         {
           C1->Transform ( T1 );
           return C1;
@@ -1168,7 +1187,7 @@ Handle(Geom_Curve) StepToGeom::MakeCurve (const Handle(StepGeom_Curve)& SC)
     const Handle(StepGeom_OffsetCurve3d) OC = Handle(StepGeom_OffsetCurve3d)::DownCast(SC);
     const Handle(StepGeom_Curve) BC = OC->BasisCurve();
     if ( BC != SC ) { // protect against loop
-      Handle(Geom_Curve) C1 = MakeCurve (BC);
+      Handle(Geom_Curve) C1 = MakeCurve (BC, theLocalFactors);
       if (! C1.IsNull())
       {
         Handle(Geom_Direction) RD = MakeDirection(OC->RefDirection());
@@ -1181,7 +1200,7 @@ Handle(Geom_Curve) StepToGeom::MakeCurve (const Handle(StepGeom_Curve)& SC)
   }
   else if (SC->IsKind(STANDARD_TYPE(StepGeom_SurfaceCurve))) { //:o5 abv 17 Feb 99
     const Handle(StepGeom_SurfaceCurve) SurfC = Handle(StepGeom_SurfaceCurve)::DownCast(SC);
-    return MakeCurve (SurfC->Curve3d());
+    return MakeCurve (SurfC->Curve3d(), theLocalFactors);
   }
   return 0;
 }
@@ -1190,16 +1209,17 @@ Handle(Geom_Curve) StepToGeom::MakeCurve (const Handle(StepGeom_Curve)& SC)
 // Creation d' une Curve de Geom2d a partir d' une Curve de Step
 //=============================================================================
 
-Handle(Geom2d_Curve) StepToGeom::MakeCurve2d (const Handle(StepGeom_Curve)& SC)
+Handle(Geom2d_Curve) StepToGeom::MakeCurve2d (const Handle(StepGeom_Curve)& SC,
+                                              const StepData_Factors& theLocalFactors)
 {
   if (SC->IsKind(STANDARD_TYPE(StepGeom_Line))) {
-    return MakeLine2d (Handle(StepGeom_Line)::DownCast(SC));
+    return MakeLine2d (Handle(StepGeom_Line)::DownCast(SC), theLocalFactors);
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_Conic))) {
-    return MakeConic2d (Handle(StepGeom_Conic)::DownCast(SC));
+    return MakeConic2d (Handle(StepGeom_Conic)::DownCast(SC), theLocalFactors);
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_BoundedCurve))) {
-    return MakeBoundedCurve2d (Handle(StepGeom_BoundedCurve)::DownCast(SC));
+    return MakeBoundedCurve2d (Handle(StepGeom_BoundedCurve)::DownCast(SC), theLocalFactors);
   }
   if (SC->IsKind(STANDARD_TYPE(StepGeom_CurveReplica))) { //:n7 abv 16 Feb 99
     const Handle(StepGeom_CurveReplica) CR = Handle(StepGeom_CurveReplica)::DownCast(SC);
@@ -1209,11 +1229,11 @@ Handle(Geom2d_Curve) StepToGeom::MakeCurve2d (const Handle(StepGeom_Curve)& SC)
     // protect against cyclic references and wrong type of cartop
     if ( !T.IsNull() && PC != SC )
     {
-      Handle(Geom2d_Curve) C1 = MakeCurve2d (PC);
+      Handle(Geom2d_Curve) C1 = MakeCurve2d (PC, theLocalFactors);
       if (! C1.IsNull())
       {
         gp_Trsf2d T1;
-        if (MakeTransformation2d(T,T1))
+        if (MakeTransformation2d(T, T1, theLocalFactors))
         {
           C1->Transform ( T1 );
           return C1;
@@ -1229,12 +1249,13 @@ Handle(Geom2d_Curve) StepToGeom::MakeCurve2d (const Handle(StepGeom_Curve)& SC)
 // CylindricalSurface de Step
 //=============================================================================
 
-Handle(Geom_CylindricalSurface) StepToGeom::MakeCylindricalSurface (const Handle(StepGeom_CylindricalSurface)& SS)
+Handle(Geom_CylindricalSurface) StepToGeom::MakeCylindricalSurface (const Handle(StepGeom_CylindricalSurface)& SS,
+                                                                    const StepData_Factors& theLocalFactors)
 {
-  Handle(Geom_Axis2Placement) A = MakeAxis2Placement(SS->Position());
+  Handle(Geom_Axis2Placement) A = MakeAxis2Placement(SS->Position(), theLocalFactors);
   if (! A.IsNull())
   {
-    return new Geom_CylindricalSurface(A->Ax2(), SS->Radius() * StepData_GlobalFactors::Intance().LengthFactor());
+    return new Geom_CylindricalSurface(A->Ax2(), SS->Radius() * theLocalFactors.LengthFactor());
   }
   return 0;
 }
@@ -1288,22 +1309,23 @@ Handle(Geom2d_Direction) StepToGeom::MakeDirection2d (const Handle(StepGeom_Dire
 // ElementarySurface de Step
 //=============================================================================
 
-Handle(Geom_ElementarySurface) StepToGeom::MakeElementarySurface (const Handle(StepGeom_ElementarySurface)& SS)
+Handle(Geom_ElementarySurface) StepToGeom::MakeElementarySurface (const Handle(StepGeom_ElementarySurface)& SS,
+                                                                  const StepData_Factors& theLocalFactors)
 {
   if (SS->IsKind(STANDARD_TYPE(StepGeom_Plane))) {
-    return MakePlane (Handle(StepGeom_Plane)::DownCast(SS));
+    return MakePlane (Handle(StepGeom_Plane)::DownCast(SS), theLocalFactors);
   }
   if (SS->IsKind(STANDARD_TYPE(StepGeom_CylindricalSurface))) {
-    return MakeCylindricalSurface (Handle(StepGeom_CylindricalSurface)::DownCast(SS));
+    return MakeCylindricalSurface (Handle(StepGeom_CylindricalSurface)::DownCast(SS), theLocalFactors);
   }
   if (SS->IsKind(STANDARD_TYPE(StepGeom_ConicalSurface))) {
-    return MakeConicalSurface (Handle(StepGeom_ConicalSurface)::DownCast(SS));
+    return MakeConicalSurface (Handle(StepGeom_ConicalSurface)::DownCast(SS), theLocalFactors);
   }
   if (SS->IsKind(STANDARD_TYPE(StepGeom_SphericalSurface))) {
-    return MakeSphericalSurface (Handle(StepGeom_SphericalSurface)::DownCast(SS));
+    return MakeSphericalSurface (Handle(StepGeom_SphericalSurface)::DownCast(SS), theLocalFactors);
   }
   if (SS->IsKind(STANDARD_TYPE(StepGeom_ToroidalSurface))) {
-    return MakeToroidalSurface (Handle(StepGeom_ToroidalSurface)::DownCast(SS));
+    return MakeToroidalSurface (Handle(StepGeom_ToroidalSurface)::DownCast(SS), theLocalFactors);
   }
   return 0;
 }
@@ -1312,15 +1334,16 @@ Handle(Geom_ElementarySurface) StepToGeom::MakeElementarySurface (const Handle(S
 // Creation d' un Ellipse de Geom a partir d' un Ellipse de Step
 //=============================================================================
 
-Handle(Geom_Ellipse) StepToGeom::MakeEllipse (const Handle(StepGeom_Ellipse)& SC)
+Handle(Geom_Ellipse) StepToGeom::MakeEllipse (const Handle(StepGeom_Ellipse)& SC,
+                                              const StepData_Factors& theLocalFactors)
 {
   const StepGeom_Axis2Placement AxisSelect = SC->Position();
   if (AxisSelect.CaseNum(AxisSelect.Value()) == 2) {
-    Handle(Geom_Axis2Placement) A1 = MakeAxis2Placement (Handle(StepGeom_Axis2Placement3d)::DownCast(AxisSelect.Value()));
+    Handle(Geom_Axis2Placement) A1 = MakeAxis2Placement (Handle(StepGeom_Axis2Placement3d)::DownCast(AxisSelect.Value()), theLocalFactors);
     if (! A1.IsNull())
     {
       gp_Ax2 A( A1->Ax2() );
-      const Standard_Real LF = StepData_GlobalFactors::Intance().LengthFactor();
+      const Standard_Real LF = theLocalFactors.LengthFactor();
       const Standard_Real majorR = SC->SemiAxis1() * LF;
       const Standard_Real minorR = SC->SemiAxis2() * LF;
       if ( majorR - minorR >= 0. ) { //:o9 abv 19 Feb 99
@@ -1340,11 +1363,12 @@ Handle(Geom_Ellipse) StepToGeom::MakeEllipse (const Handle(StepGeom_Ellipse)& SC
 // Creation d' un Ellipse de Geom2d a partir d' un Ellipse de Step
 //=============================================================================
 
-Handle(Geom2d_Ellipse) StepToGeom::MakeEllipse2d (const Handle(StepGeom_Ellipse)& SC)
+Handle(Geom2d_Ellipse) StepToGeom::MakeEllipse2d (const Handle(StepGeom_Ellipse)& SC,
+                                                  const StepData_Factors& theLocalFactors)
 {
   const StepGeom_Axis2Placement AxisSelect = SC->Position();
   if (AxisSelect.CaseNum(AxisSelect.Value()) == 1) {
-    Handle(Geom2d_AxisPlacement) A1 = MakeAxisPlacement (Handle(StepGeom_Axis2Placement2d)::DownCast(AxisSelect.Value()));
+    Handle(Geom2d_AxisPlacement) A1 = MakeAxisPlacement (Handle(StepGeom_Axis2Placement2d)::DownCast(AxisSelect.Value()), theLocalFactors);
     if (! A1.IsNull())
     {
       gp_Ax22d A( A1->Ax2d() );
@@ -1367,16 +1391,17 @@ Handle(Geom2d_Ellipse) StepToGeom::MakeEllipse2d (const Handle(StepGeom_Ellipse)
 // Creation d' un Hyperbola de Geom a partir d' un Hyperbola de Step
 //=============================================================================
 
-Handle(Geom_Hyperbola) StepToGeom::MakeHyperbola (const Handle(StepGeom_Hyperbola)& SC)
+Handle(Geom_Hyperbola) StepToGeom::MakeHyperbola (const Handle(StepGeom_Hyperbola)& SC,
+                                                  const StepData_Factors& theLocalFactors)
 {
   const StepGeom_Axis2Placement AxisSelect = SC->Position();
   if (AxisSelect.CaseNum(AxisSelect.Value()) == 2)
   {
-    Handle(Geom_Axis2Placement) A1 = MakeAxis2Placement (Handle(StepGeom_Axis2Placement3d)::DownCast(AxisSelect.Value()));
+    Handle(Geom_Axis2Placement) A1 = MakeAxis2Placement (Handle(StepGeom_Axis2Placement3d)::DownCast(AxisSelect.Value()), theLocalFactors);
     if (! A1.IsNull())
     {
       const gp_Ax2 A( A1->Ax2() );
-      const Standard_Real LF = StepData_GlobalFactors::Intance().LengthFactor();
+      const Standard_Real LF = theLocalFactors.LengthFactor();
       return new Geom_Hyperbola(A, SC->SemiAxis() * LF, SC->SemiImagAxis() * LF);
     }
   }
@@ -1387,12 +1412,13 @@ Handle(Geom_Hyperbola) StepToGeom::MakeHyperbola (const Handle(StepGeom_Hyperbol
 // Creation d' un Hyperbola de Geom2d a partir d' un Hyperbola de Step
 //=============================================================================
 
-Handle(Geom2d_Hyperbola) StepToGeom::MakeHyperbola2d (const Handle(StepGeom_Hyperbola)& SC)
+Handle(Geom2d_Hyperbola) StepToGeom::MakeHyperbola2d (const Handle(StepGeom_Hyperbola)& SC,
+                                                      const StepData_Factors& theLocalFactors)
 {
   const StepGeom_Axis2Placement AxisSelect = SC->Position();
   if (AxisSelect.CaseNum(AxisSelect.Value()) == 1)
   {
-    Handle(Geom2d_AxisPlacement) A1 = MakeAxisPlacement (Handle(StepGeom_Axis2Placement2d)::DownCast(AxisSelect.Value()));
+    Handle(Geom2d_AxisPlacement) A1 = MakeAxisPlacement (Handle(StepGeom_Axis2Placement2d)::DownCast(AxisSelect.Value()), theLocalFactors);
     if (! A1.IsNull())
     {
       const gp_Ax22d A( A1->Ax2d() );
@@ -1406,13 +1432,14 @@ Handle(Geom2d_Hyperbola) StepToGeom::MakeHyperbola2d (const Handle(StepGeom_Hype
 // Creation d' une Line de Geom a partir d' une Line de Step
 //=============================================================================
 
-Handle(Geom_Line) StepToGeom::MakeLine (const Handle(StepGeom_Line)& SC)
+Handle(Geom_Line) StepToGeom::MakeLine (const Handle(StepGeom_Line)& SC,
+                                        const StepData_Factors& theLocalFactors)
 {
-  Handle(Geom_CartesianPoint) P = MakeCartesianPoint(SC->Pnt());
+  Handle(Geom_CartesianPoint) P = MakeCartesianPoint(SC->Pnt(), theLocalFactors);
   if (! P.IsNull())
   {
     // sln 22.10.2001. CTS23496: Line is not created if direction have not been successfully created
-    Handle(Geom_VectorWithMagnitude) D = MakeVectorWithMagnitude (SC->Dir());
+    Handle(Geom_VectorWithMagnitude) D = MakeVectorWithMagnitude (SC->Dir(), theLocalFactors);
     if (! D.IsNull())
     {
       if( D->Vec().SquareMagnitude() < Precision::Confusion() * Precision::Confusion())
@@ -1428,9 +1455,10 @@ Handle(Geom_Line) StepToGeom::MakeLine (const Handle(StepGeom_Line)& SC)
 // Creation d' une Line de Geom2d a partir d' une Line de Step
 //=============================================================================
 
-Handle(Geom2d_Line) StepToGeom::MakeLine2d (const Handle(StepGeom_Line)& SC)
+Handle(Geom2d_Line) StepToGeom::MakeLine2d (const Handle(StepGeom_Line)& SC,
+                                            const StepData_Factors& theLocalFactors)
 {
-  Handle(Geom2d_CartesianPoint) P = MakeCartesianPoint2d(SC->Pnt());
+  Handle(Geom2d_CartesianPoint) P = MakeCartesianPoint2d(SC->Pnt(), theLocalFactors);
   if (! P.IsNull())
   {
     // sln 23.10.2001. CTS23496: Line is not created if direction have not been successfully created
@@ -1448,15 +1476,16 @@ Handle(Geom2d_Line) StepToGeom::MakeLine2d (const Handle(StepGeom_Line)& SC)
 // Creation d' un Parabola de Geom a partir d' un Parabola de Step
 //=============================================================================
 
-Handle(Geom_Parabola) StepToGeom::MakeParabola (const Handle(StepGeom_Parabola)& SC)
+Handle(Geom_Parabola) StepToGeom::MakeParabola (const Handle(StepGeom_Parabola)& SC,
+                                                const StepData_Factors& theLocalFactors)
 {
   const StepGeom_Axis2Placement AxisSelect = SC->Position();
   if (AxisSelect.CaseNum(AxisSelect.Value()) == 2)
   {
-    Handle(Geom_Axis2Placement) A = MakeAxis2Placement (Handle(StepGeom_Axis2Placement3d)::DownCast(AxisSelect.Value()));
+    Handle(Geom_Axis2Placement) A = MakeAxis2Placement (Handle(StepGeom_Axis2Placement3d)::DownCast(AxisSelect.Value()), theLocalFactors);
     if (! A.IsNull())
     {
-      return new Geom_Parabola(A->Ax2(), SC->FocalDist() * StepData_GlobalFactors::Intance().LengthFactor());
+      return new Geom_Parabola(A->Ax2(), SC->FocalDist() * theLocalFactors.LengthFactor());
     }
   }
   return 0;
@@ -1466,11 +1495,12 @@ Handle(Geom_Parabola) StepToGeom::MakeParabola (const Handle(StepGeom_Parabola)&
 // Creation d' un Parabola de Geom2d a partir d' un Parabola de Step
 //=============================================================================
 
-Handle(Geom2d_Parabola) StepToGeom::MakeParabola2d (const Handle(StepGeom_Parabola)& SC)
+Handle(Geom2d_Parabola) StepToGeom::MakeParabola2d (const Handle(StepGeom_Parabola)& SC,
+                                                    const StepData_Factors& theLocalFactors)
 {
   const StepGeom_Axis2Placement AxisSelect = SC->Position();
   if (AxisSelect.CaseNum(AxisSelect.Value()) == 1) {
-    Handle(Geom2d_AxisPlacement) A1 = MakeAxisPlacement (Handle(StepGeom_Axis2Placement2d)::DownCast(AxisSelect.Value()));
+    Handle(Geom2d_AxisPlacement) A1 = MakeAxisPlacement (Handle(StepGeom_Axis2Placement2d)::DownCast(AxisSelect.Value()), theLocalFactors);
     if (! A1.IsNull())
     {
       const gp_Ax22d A( A1->Ax2d() );
@@ -1484,9 +1514,10 @@ Handle(Geom2d_Parabola) StepToGeom::MakeParabola2d (const Handle(StepGeom_Parabo
 // Creation d' un Plane de Geom a partir d' un plane de Step
 //=============================================================================
 
-Handle(Geom_Plane) StepToGeom::MakePlane (const Handle(StepGeom_Plane)& SP)
+Handle(Geom_Plane) StepToGeom::MakePlane (const Handle(StepGeom_Plane)& SP,
+                                          const StepData_Factors& theLocalFactors)
 {
-  Handle(Geom_Axis2Placement) A = MakeAxis2Placement (SP->Position());
+  Handle(Geom_Axis2Placement) A = MakeAxis2Placement (SP->Position(), theLocalFactors);
   if (! A.IsNull())
   {
     return new Geom_Plane(A->Ax2());
@@ -1499,7 +1530,8 @@ Handle(Geom_Plane) StepToGeom::MakePlane (const Handle(StepGeom_Plane)& SP)
 //purpose  :
 //=======================================================================
 
-Handle(Geom_BSplineCurve) StepToGeom::MakePolyline (const Handle(StepGeom_Polyline)& SPL)
+Handle(Geom_BSplineCurve) StepToGeom::MakePolyline (const Handle(StepGeom_Polyline)& SPL,
+                                                    const StepData_Factors& theLocalFactors)
 {
   if (SPL.IsNull())
     return Handle(Geom_BSplineCurve)();
@@ -1513,7 +1545,7 @@ Handle(Geom_BSplineCurve) StepToGeom::MakePolyline (const Handle(StepGeom_Polyli
 
     for ( Standard_Integer i=1; i <= nbp; i++ )
     {
-      Handle(Geom_CartesianPoint) P = MakeCartesianPoint (SPL->PointsValue(i));
+      Handle(Geom_CartesianPoint) P = MakeCartesianPoint (SPL->PointsValue(i), theLocalFactors);
       if (! P.IsNull())
         Poles.SetValue ( i, P->Pnt() );
       else
@@ -1534,7 +1566,8 @@ Handle(Geom_BSplineCurve) StepToGeom::MakePolyline (const Handle(StepGeom_Polyli
 //purpose  :
 //=======================================================================
 
-Handle(Geom2d_BSplineCurve) StepToGeom::MakePolyline2d (const Handle(StepGeom_Polyline)& SPL)
+Handle(Geom2d_BSplineCurve) StepToGeom::MakePolyline2d (const Handle(StepGeom_Polyline)& SPL,
+                                                        const StepData_Factors& theLocalFactors)
 {
   if (SPL.IsNull())
     return Handle(Geom2d_BSplineCurve)();
@@ -1548,7 +1581,7 @@ Handle(Geom2d_BSplineCurve) StepToGeom::MakePolyline2d (const Handle(StepGeom_Po
 
     for ( Standard_Integer i=1; i <= nbp; i++ )
     {
-    Handle(Geom2d_CartesianPoint) P = MakeCartesianPoint2d (SPL->PointsValue(i));
+      Handle(Geom2d_CartesianPoint) P = MakeCartesianPoint2d(SPL->PointsValue(i), theLocalFactors);
       if (! P.IsNull())
         Poles.SetValue ( i, P->Pnt2d() );
       else
@@ -1569,9 +1602,11 @@ Handle(Geom2d_BSplineCurve) StepToGeom::MakePolyline2d (const Handle(StepGeom_Po
 // RectangularTrimmedSurface de Step
 //=============================================================================
 
-Handle(Geom_RectangularTrimmedSurface) StepToGeom::MakeRectangularTrimmedSurface (const Handle(StepGeom_RectangularTrimmedSurface)& SS)
+Handle(Geom_RectangularTrimmedSurface)
+  StepToGeom::MakeRectangularTrimmedSurface (const Handle(StepGeom_RectangularTrimmedSurface)& SS,
+                                             const StepData_Factors& theLocalFactors)
 {
-  Handle(Geom_Surface) theBasis = MakeSurface (SS->BasisSurface());
+  Handle(Geom_Surface) theBasis = MakeSurface (SS->BasisSurface(), theLocalFactors);
   if (! theBasis.IsNull())
   {
     // -----------------------------------------
@@ -1580,8 +1615,8 @@ Handle(Geom_RectangularTrimmedSurface) StepToGeom::MakeRectangularTrimmedSurface
 
     Standard_Real uFact = 1.;
     Standard_Real vFact = 1.;
-    const Standard_Real LengthFact  = StepData_GlobalFactors::Intance().LengthFactor();
-    const Standard_Real AngleFact   = StepData_GlobalFactors::Intance().PlaneAngleFactor(); // abv 30.06.00 trj4_k1_geo-tc-214.stp #1477: PI/180.;
+    const Standard_Real LengthFact = theLocalFactors.LengthFactor();
+    const Standard_Real AngleFact = theLocalFactors.PlaneAngleFactor(); // abv 30.06.00 trj4_k1_geo-tc-214.stp #1477: PI/180.;
 
     if (theBasis->IsKind(STANDARD_TYPE(Geom_SphericalSurface)) ||
         theBasis->IsKind(STANDARD_TYPE(Geom_ToroidalSurface))) {
@@ -1618,12 +1653,13 @@ Handle(Geom_RectangularTrimmedSurface) StepToGeom::MakeRectangularTrimmedSurface
 // SphericalSurface de Step
 //=============================================================================
 
-Handle(Geom_SphericalSurface) StepToGeom::MakeSphericalSurface (const Handle(StepGeom_SphericalSurface)& SS)
+Handle(Geom_SphericalSurface) StepToGeom::MakeSphericalSurface (const Handle(StepGeom_SphericalSurface)& SS,
+                                                                const StepData_Factors& theLocalFactors)
 {
-  Handle(Geom_Axis2Placement) A = MakeAxis2Placement (SS->Position());
+  Handle(Geom_Axis2Placement) A = MakeAxis2Placement (SS->Position(), theLocalFactors);
   if (! A.IsNull())
   {
-    return new Geom_SphericalSurface(A->Ax2(), SS->Radius() * StepData_GlobalFactors::Intance().LengthFactor());
+    return new Geom_SphericalSurface(A->Ax2(), SS->Radius() * theLocalFactors.LengthFactor());
   }
   return 0;
 }
@@ -1632,7 +1668,8 @@ Handle(Geom_SphericalSurface) StepToGeom::MakeSphericalSurface (const Handle(Ste
 // Creation d' une Surface de Geom a partir d' une Surface de Step
 //=============================================================================
 
-Handle(Geom_Surface) StepToGeom::MakeSurface (const Handle(StepGeom_Surface)& SS)
+Handle(Geom_Surface) StepToGeom::MakeSurface (const Handle(StepGeom_Surface)& SS,
+                                              const StepData_Factors& theLocalFactors)
 {
    // sln 01.10.2001 BUC61003. If entry shell is NULL do nothing
   if(SS.IsNull()) {
@@ -1642,26 +1679,26 @@ Handle(Geom_Surface) StepToGeom::MakeSurface (const Handle(StepGeom_Surface)& SS
   try {
     OCC_CATCH_SIGNALS
     if (SS->IsKind(STANDARD_TYPE(StepGeom_BoundedSurface))) {
-      return MakeBoundedSurface (Handle(StepGeom_BoundedSurface)::DownCast(SS));
+      return MakeBoundedSurface (Handle(StepGeom_BoundedSurface)::DownCast(SS), theLocalFactors);
     }
     if (SS->IsKind(STANDARD_TYPE(StepGeom_ElementarySurface))) {
       const Handle(StepGeom_ElementarySurface) S1 = Handle(StepGeom_ElementarySurface)::DownCast(SS);
       if(S1->Position().IsNull())
         return Handle(Geom_Surface)();
 
-      return MakeElementarySurface (S1);
+      return MakeElementarySurface (S1, theLocalFactors);
     }
     if (SS->IsKind(STANDARD_TYPE(StepGeom_SweptSurface))) {
-      return MakeSweptSurface (Handle(StepGeom_SweptSurface)::DownCast(SS));
+      return MakeSweptSurface (Handle(StepGeom_SweptSurface)::DownCast(SS), theLocalFactors);
     }
     if (SS->IsKind(STANDARD_TYPE(StepGeom_OffsetSurface))) { //:d4 abv 12 Mar 98
       const Handle(StepGeom_OffsetSurface) OS = Handle(StepGeom_OffsetSurface)::DownCast(SS);
 
-      Handle(Geom_Surface) aBasisSurface = MakeSurface (OS->BasisSurface());
+      Handle(Geom_Surface) aBasisSurface = MakeSurface (OS->BasisSurface(), theLocalFactors);
       if (! aBasisSurface.IsNull())
       {
         // sln 03.10.01. BUC61003. creation of  offset surface is corrected
-        const Standard_Real anOffset = OS->Distance() * StepData_GlobalFactors::Intance().LengthFactor();
+        const Standard_Real anOffset = OS->Distance() * theLocalFactors.LengthFactor();
         if (aBasisSurface->Continuity() == GeomAbs_C0)
         {
           const BRepBuilderAPI_MakeFace aBFace(aBasisSurface, Precision::Confusion());
@@ -1686,11 +1723,11 @@ Handle(Geom_Surface) StepToGeom::MakeSurface (const Handle(StepGeom_Surface)& SS
       const Handle(StepGeom_CartesianTransformationOperator3d) T = SR->Transformation();
       // protect against cyclic references and wrong type of cartop
       if ( !T.IsNull() && PS != SS ) {
-        Handle(Geom_Surface) S1 = MakeSurface (PS);
+        Handle(Geom_Surface) S1 = MakeSurface (PS, theLocalFactors);
         if (! S1.IsNull())
         {
           gp_Trsf T1;
-          if (MakeTransformation3d(T,T1))
+          if (MakeTransformation3d(T, T1, theLocalFactors))
           {
             S1->Transform ( T1 );
             return S1;
@@ -1716,13 +1753,14 @@ Handle(Geom_Surface) StepToGeom::MakeSurface (const Handle(StepGeom_Surface)& SS
 // SurfaceOfLinearExtrusion de Step
 //=============================================================================
 
-Handle(Geom_SurfaceOfLinearExtrusion) StepToGeom::MakeSurfaceOfLinearExtrusion (const Handle(StepGeom_SurfaceOfLinearExtrusion)& SS)
+Handle(Geom_SurfaceOfLinearExtrusion) StepToGeom::MakeSurfaceOfLinearExtrusion (const Handle(StepGeom_SurfaceOfLinearExtrusion)& SS,
+                                                                                const StepData_Factors& theLocalFactors)
 {
-  Handle(Geom_Curve) C = MakeCurve (SS->SweptCurve());
+  Handle(Geom_Curve) C = MakeCurve (SS->SweptCurve(), theLocalFactors);
   if (! C.IsNull())
   {
     // sln 23.10.2001. CTS23496: Surface is not created if extrusion axis have not been successfully created
-    Handle(Geom_VectorWithMagnitude) V = MakeVectorWithMagnitude (SS->ExtrusionAxis());
+    Handle(Geom_VectorWithMagnitude) V = MakeVectorWithMagnitude (SS->ExtrusionAxis(), theLocalFactors);
     if (! V.IsNull())
     {
       const gp_Dir D(V->Vec());
@@ -1740,12 +1778,13 @@ Handle(Geom_SurfaceOfLinearExtrusion) StepToGeom::MakeSurfaceOfLinearExtrusion (
 // SurfaceOfRevolution de Step
 //=============================================================================
 
-Handle(Geom_SurfaceOfRevolution) StepToGeom::MakeSurfaceOfRevolution (const Handle(StepGeom_SurfaceOfRevolution)& SS)
+Handle(Geom_SurfaceOfRevolution) StepToGeom::MakeSurfaceOfRevolution (const Handle(StepGeom_SurfaceOfRevolution)& SS,
+                                                                      const StepData_Factors& theLocalFactors)
 {
-  Handle(Geom_Curve) C = MakeCurve (SS->SweptCurve());
+  Handle(Geom_Curve) C = MakeCurve (SS->SweptCurve(), theLocalFactors);
   if (! C.IsNull())
   {
-    Handle(Geom_Axis1Placement) A1 = MakeAxis1Placement (SS->AxisPosition());
+    Handle(Geom_Axis1Placement) A1 = MakeAxis1Placement (SS->AxisPosition(), theLocalFactors);
     if (! A1.IsNull())
     {
       const gp_Ax1 A( A1->Ax1() );
@@ -1779,13 +1818,14 @@ Handle(Geom_SurfaceOfRevolution) StepToGeom::MakeSurfaceOfRevolution (const Hand
 // SweptSurface de Geom
 //=============================================================================
 
-Handle(Geom_SweptSurface) StepToGeom::MakeSweptSurface (const Handle(StepGeom_SweptSurface)& SS)
+Handle(Geom_SweptSurface) StepToGeom::MakeSweptSurface (const Handle(StepGeom_SweptSurface)& SS,
+                                                        const StepData_Factors& theLocalFactors)
 {
   if (SS->IsKind(STANDARD_TYPE(StepGeom_SurfaceOfLinearExtrusion))) {
-    return MakeSurfaceOfLinearExtrusion (Handle(StepGeom_SurfaceOfLinearExtrusion)::DownCast(SS));
+    return MakeSurfaceOfLinearExtrusion (Handle(StepGeom_SurfaceOfLinearExtrusion)::DownCast(SS), theLocalFactors);
   }
   if (SS->IsKind(STANDARD_TYPE(StepGeom_SurfaceOfRevolution))) {
-    return MakeSurfaceOfRevolution (Handle(StepGeom_SurfaceOfRevolution)::DownCast(SS));
+    return MakeSurfaceOfRevolution (Handle(StepGeom_SurfaceOfRevolution)::DownCast(SS), theLocalFactors);
   }
   return Handle(Geom_SweptSurface)();
 }
@@ -1795,12 +1835,13 @@ Handle(Geom_SweptSurface) StepToGeom::MakeSweptSurface (const Handle(StepGeom_Sw
 // ToroidalSurface de Step
 //=============================================================================
 
-Handle(Geom_ToroidalSurface) StepToGeom::MakeToroidalSurface (const Handle(StepGeom_ToroidalSurface)& SS)
+Handle(Geom_ToroidalSurface) StepToGeom::MakeToroidalSurface (const Handle(StepGeom_ToroidalSurface)& SS,
+                                                              const StepData_Factors& theLocalFactors)
 {
-  Handle(Geom_Axis2Placement) A = MakeAxis2Placement (SS->Position());
+  Handle(Geom_Axis2Placement) A = MakeAxis2Placement (SS->Position(), theLocalFactors);
   if (! A.IsNull())
   {
-    const Standard_Real LF = StepData_GlobalFactors::Intance().LengthFactor();
+    const Standard_Real LF = theLocalFactors.LengthFactor();
     return new Geom_ToroidalSurface(A->Ax2(), Abs(SS->MajorRadius() * LF), Abs(SS->MinorRadius() * LF));
   }
   return 0;
@@ -1810,10 +1851,12 @@ Handle(Geom_ToroidalSurface) StepToGeom::MakeToroidalSurface (const Handle(StepG
 //function : MakeTransformation2d
 //purpose  :
 //=======================================================================
-Standard_Boolean StepToGeom::MakeTransformation2d (const Handle(StepGeom_CartesianTransformationOperator2d)& SCTO, gp_Trsf2d& CT)
+Standard_Boolean StepToGeom::MakeTransformation2d (const Handle(StepGeom_CartesianTransformationOperator2d)& SCTO,
+                                                   gp_Trsf2d& CT,
+                                                   const StepData_Factors& theLocalFactors)
 {
   //  NB : on ne s interesse ici qu au deplacement rigide
-  Handle(Geom2d_CartesianPoint) CP = MakeCartesianPoint2d (SCTO->LocalOrigin());
+  Handle(Geom2d_CartesianPoint) CP = MakeCartesianPoint2d (SCTO->LocalOrigin(), theLocalFactors);
   if (! CP.IsNull())
   {
     gp_Dir2d D1(1.,0.);
@@ -1838,9 +1881,11 @@ Standard_Boolean StepToGeom::MakeTransformation2d (const Handle(StepGeom_Cartesi
 //purpose  :
 //=======================================================================
 
-Standard_Boolean StepToGeom::MakeTransformation3d (const Handle(StepGeom_CartesianTransformationOperator3d)& SCTO, gp_Trsf& CT)
+Standard_Boolean StepToGeom::MakeTransformation3d (const Handle(StepGeom_CartesianTransformationOperator3d)& SCTO,
+                                                   gp_Trsf& CT,
+                                                   const StepData_Factors& theLocalFactors)
 {
-  Handle(Geom_CartesianPoint) CP = MakeCartesianPoint (SCTO->LocalOrigin());
+  Handle(Geom_CartesianPoint) CP = MakeCartesianPoint (SCTO->LocalOrigin(), theLocalFactors);
   if (! CP.IsNull())
   {
     const gp_Pnt Pgp = CP->Pnt();
@@ -1896,7 +1941,8 @@ static Standard_Boolean  ExtractParameter
  const Standard_Integer MasterRep,
  const Standard_Real Factor,
  const Standard_Real Shift,
- Standard_Real & aParam)
+ Standard_Real & aParam,
+ const StepData_Factors& theLocalFactors)
 {
   Handle(StepGeom_CartesianPoint) aPoint;
   Standard_Integer i;
@@ -1909,7 +1955,7 @@ static Standard_Boolean  ExtractParameter
     }
     else if (MasterRep == 1 && theSel.CaseNumber() > 0) {
       aPoint = theSel.CartesianPoint();
-      Handle(Geom_CartesianPoint) theGeomPnt = StepToGeom::MakeCartesianPoint (aPoint);
+      Handle(Geom_CartesianPoint) theGeomPnt = StepToGeom::MakeCartesianPoint (aPoint, theLocalFactors);
       gp_Pnt thegpPnt = theGeomPnt->Pnt();
 
       //:S4136: use advanced algorithm
@@ -1959,7 +2005,7 @@ static Standard_Boolean  ExtractParameter
     StepGeom_TrimmingSelect theSel = TS->Value(i);
     if (theSel.CaseNumber() > 0) {
       aPoint = theSel.CartesianPoint();
-      Handle(Geom_CartesianPoint) theGeomPnt = StepToGeom::MakeCartesianPoint (aPoint);
+      Handle(Geom_CartesianPoint) theGeomPnt = StepToGeom::MakeCartesianPoint (aPoint, theLocalFactors);
       gp_Pnt thegpPnt = theGeomPnt->Pnt();
       // Project Point On Curve
       ShapeAnalysis_Curve sac;
@@ -1983,10 +2029,11 @@ static Standard_Boolean  ExtractParameter
 // Creation d' une Trimmed Curve de Geom a partir d' une Trimmed Curve de Step
 //=============================================================================
 
-Handle(Geom_TrimmedCurve) StepToGeom::MakeTrimmedCurve (const Handle(StepGeom_TrimmedCurve)& SC)
+Handle(Geom_TrimmedCurve) StepToGeom::MakeTrimmedCurve (const Handle(StepGeom_TrimmedCurve)& SC,
+                                                        const StepData_Factors& theLocalFactors)
 {
   const Handle(StepGeom_Curve) theSTEPCurve = SC->BasisCurve();
-  Handle(Geom_Curve) theCurve = MakeCurve (theSTEPCurve);
+  Handle(Geom_Curve) theCurve = MakeCurve (theSTEPCurve, theLocalFactors);
   if (theCurve.IsNull())
     return Handle(Geom_TrimmedCurve)();
 
@@ -2030,12 +2077,12 @@ Handle(Geom_TrimmedCurve) StepToGeom::MakeTrimmedCurve (const Handle(StepGeom_Tr
   if (theSTEPCurve->IsKind(STANDARD_TYPE(StepGeom_Line))) {
     const Handle(StepGeom_Line) theLine =
       Handle(StepGeom_Line)::DownCast(theSTEPCurve);
-    fact = theLine->Dir()->Magnitude() * StepData_GlobalFactors::Intance().LengthFactor();
+    fact = theLine->Dir()->Magnitude() * theLocalFactors.LengthFactor();
   }
   else if (theSTEPCurve->IsKind(STANDARD_TYPE(StepGeom_Circle)) ||
            theSTEPCurve->IsKind(STANDARD_TYPE(StepGeom_Ellipse))) {
 //    if (trim1 > 2.1*M_PI || trim2 > 2.1*M_PI) fact = M_PI / 180.;
-    fact = StepData_GlobalFactors::Intance().PlaneAngleFactor();
+    fact = theLocalFactors.PlaneAngleFactor();
     //:p3 abv 23 Feb 99: shift on pi/2 on ellipse with R1 < R2
     const Handle(StepGeom_Ellipse) ellipse = Handle(StepGeom_Ellipse)::DownCast(theSTEPCurve);
     if ( !ellipse.IsNull() && ellipse->SemiAxis1() - ellipse->SemiAxis2() < 0. )
@@ -2068,8 +2115,8 @@ Handle(Geom_TrimmedCurve) StepToGeom::MakeTrimmedCurve (const Handle(StepGeom_Tr
   Standard_Real trim1 = 0.;
   Standard_Real trim2 = 0.;
   Handle(StepGeom_CartesianPoint) TrimCP1, TrimCP2;
-  const Standard_Boolean FoundParam1 = ExtractParameter(theCurve, theTrimSel1, nbSel1, MasterRep, fact, shift, trim1);
-  const Standard_Boolean FoundParam2 = ExtractParameter(theCurve, theTrimSel2, nbSel2, MasterRep, fact, shift, trim2);
+  const Standard_Boolean FoundParam1 = ExtractParameter(theCurve, theTrimSel1, nbSel1, MasterRep, fact, shift, trim1, theLocalFactors);
+  const Standard_Boolean FoundParam2 = ExtractParameter(theCurve, theTrimSel2, nbSel2, MasterRep, fact, shift, trim2, theLocalFactors);
 
   if (FoundParam1 && FoundParam2) {
     const Standard_Real cf = theCurve->FirstParameter();
@@ -2114,10 +2161,11 @@ Handle(Geom_TrimmedCurve) StepToGeom::MakeTrimmedCurve (const Handle(StepGeom_Tr
 //=============================================================================
 // Shall be completed to treat trimming with points
 
-Handle(Geom2d_BSplineCurve) StepToGeom::MakeTrimmedCurve2d (const Handle(StepGeom_TrimmedCurve)& SC)
+Handle(Geom2d_BSplineCurve) StepToGeom::MakeTrimmedCurve2d (const Handle(StepGeom_TrimmedCurve)& SC,
+                                                            const StepData_Factors& theLocalFactors)
 {
   const Handle(StepGeom_Curve) BasisCurve = SC->BasisCurve();
-  Handle(Geom2d_Curve) theGeomBasis = MakeCurve2d (BasisCurve);
+  Handle(Geom2d_Curve) theGeomBasis = MakeCurve2d (BasisCurve, theLocalFactors);
   if (theGeomBasis.IsNull())
     return Handle(Geom2d_BSplineCurve)();
 
@@ -2144,7 +2192,7 @@ Handle(Geom2d_BSplineCurve) StepToGeom::MakeTrimmedCurve2d (const Handle(StepGeo
     else if (BasisCurve->IsKind(STANDARD_TYPE(StepGeom_Circle)) ||
              BasisCurve->IsKind(STANDARD_TYPE(StepGeom_Ellipse))) {
 //      if (u1 > 2.1*M_PI || u2 > 2.1*M_PI) fact = M_PI / 180.;
-      fact = StepData_GlobalFactors::Intance().PlaneAngleFactor();
+      fact = theLocalFactors.PlaneAngleFactor();
       //:p3 abv 23 Feb 99: shift on pi/2 on ellipse with R1 < R2
       const Handle(StepGeom_Ellipse) ellipse = Handle(StepGeom_Ellipse)::DownCast(BasisCurve);
       if ( !ellipse.IsNull() && ellipse->SemiAxis1() - ellipse->SemiAxis2() < 0. )
@@ -2171,13 +2219,14 @@ Handle(Geom2d_BSplineCurve) StepToGeom::MakeTrimmedCurve2d (const Handle(StepGeo
 // Creation d' un VectorWithMagnitude de Geom a partir d' un Vector de Step
 //=============================================================================
 
-Handle(Geom_VectorWithMagnitude) StepToGeom::MakeVectorWithMagnitude (const Handle(StepGeom_Vector)& SV)
+Handle(Geom_VectorWithMagnitude) StepToGeom::MakeVectorWithMagnitude (const Handle(StepGeom_Vector)& SV,
+                                                                      const StepData_Factors& theLocalFactors)
 {
   // sln 22.10.2001. CTS23496: Vector is not created if direction have not been successfully created
   Handle(Geom_Direction) D = MakeDirection (SV->Orientation());
   if (! D.IsNull())
   {
-    const gp_Vec V(D->Dir().XYZ() * SV->Magnitude() * StepData_GlobalFactors::Intance().LengthFactor());
+    const gp_Vec V(D->Dir().XYZ() * SV->Magnitude() * theLocalFactors.LengthFactor());
     return new Geom_VectorWithMagnitude(V);
   }
   return 0;
index b708d25951ea67c8057e2242bd48e8ccba27d412..24c74d2595f47aa2825b26e9be39e027bab0b052 100644 (file)
@@ -67,6 +67,7 @@ class Geom2d_VectorWithMagnitude;
 class gp_Trsf;
 class gp_Trsf2d;
 
+class StepData_Factors;
 class StepGeom_Axis1Placement;
 class StepGeom_Axis2Placement2d;
 class StepGeom_Axis2Placement3d;
@@ -113,52 +114,95 @@ class StepToGeom
 {
 public:
 
-  Standard_EXPORT static Handle(Geom_Axis1Placement) MakeAxis1Placement (const Handle(StepGeom_Axis1Placement)& SA);
-  Standard_EXPORT static Handle(Geom_Axis2Placement) MakeAxis2Placement (const Handle(StepGeom_Axis2Placement3d)& SA);
+  Standard_EXPORT static Handle(Geom_Axis1Placement) MakeAxis1Placement (const Handle(StepGeom_Axis1Placement)& SA,
+                                                                         const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom_Axis2Placement) MakeAxis2Placement (const Handle(StepGeom_Axis2Placement3d)& SA,
+                                                                         const StepData_Factors& theLocalFactors);
   Standard_EXPORT static Handle(Geom_Axis2Placement) MakeAxis2Placement (const Handle(StepGeom_SuParameters)& SP);
-  Standard_EXPORT static Handle(Geom2d_AxisPlacement) MakeAxisPlacement (const Handle(StepGeom_Axis2Placement2d)& SA);
-  Standard_EXPORT static Handle(Geom_BoundedCurve) MakeBoundedCurve (const Handle(StepGeom_BoundedCurve)& SC);
-  Standard_EXPORT static Handle(Geom2d_BoundedCurve) MakeBoundedCurve2d (const Handle(StepGeom_BoundedCurve)& SC);
-  Standard_EXPORT static Handle(Geom_BoundedSurface) MakeBoundedSurface (const Handle(StepGeom_BoundedSurface)& SS);
-  Standard_EXPORT static Handle(Geom_BSplineCurve) MakeBSplineCurve (const Handle(StepGeom_BSplineCurve)& SC);
-  Standard_EXPORT static Handle(Geom2d_BSplineCurve) MakeBSplineCurve2d (const Handle(StepGeom_BSplineCurve)& SC);
-  Standard_EXPORT static Handle(Geom_BSplineSurface) MakeBSplineSurface (const Handle(StepGeom_BSplineSurface)& SS);
-  Standard_EXPORT static Handle(Geom_CartesianPoint) MakeCartesianPoint (const Handle(StepGeom_CartesianPoint)& SP);
-  Standard_EXPORT static Handle(Geom2d_CartesianPoint) MakeCartesianPoint2d (const Handle(StepGeom_CartesianPoint)& SP);
-  Standard_EXPORT static Handle(Geom_Circle) MakeCircle (const Handle(StepGeom_Circle)& SC);
-  Standard_EXPORT static Handle(Geom2d_Circle) MakeCircle2d (const Handle(StepGeom_Circle)& SC);
-  Standard_EXPORT static Handle(Geom_Conic) MakeConic (const Handle(StepGeom_Conic)& SC);
-  Standard_EXPORT static Handle(Geom2d_Conic) MakeConic2d (const Handle(StepGeom_Conic)& SC);
-  Standard_EXPORT static Handle(Geom_ConicalSurface) MakeConicalSurface (const Handle(StepGeom_ConicalSurface)& SS);
-  Standard_EXPORT static Handle(Geom_Curve) MakeCurve (const Handle(StepGeom_Curve)& SC);
-  Standard_EXPORT static Handle(Geom2d_Curve) MakeCurve2d (const Handle(StepGeom_Curve)& SC);
-  Standard_EXPORT static Handle(Geom_CylindricalSurface) MakeCylindricalSurface (const Handle(StepGeom_CylindricalSurface)& SS);
+  Standard_EXPORT static Handle(Geom2d_AxisPlacement) MakeAxisPlacement (const Handle(StepGeom_Axis2Placement2d)& SA,
+                                                                         const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom_BoundedCurve) MakeBoundedCurve (const Handle(StepGeom_BoundedCurve)& SC,
+                                                                     const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom2d_BoundedCurve) MakeBoundedCurve2d (const Handle(StepGeom_BoundedCurve)& SC,
+                                                                         const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom_BoundedSurface) MakeBoundedSurface (const Handle(StepGeom_BoundedSurface)& SS,
+                                                                         const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom_BSplineCurve) MakeBSplineCurve (const Handle(StepGeom_BSplineCurve)& SC,
+                                                                     const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom2d_BSplineCurve) MakeBSplineCurve2d (const Handle(StepGeom_BSplineCurve)& SC,
+                                                                         const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom_BSplineSurface) MakeBSplineSurface (const Handle(StepGeom_BSplineSurface)& SS,
+                                                                         const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom_CartesianPoint) MakeCartesianPoint (const Handle(StepGeom_CartesianPoint)& SP,
+                                                                         const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom2d_CartesianPoint) MakeCartesianPoint2d (const Handle(StepGeom_CartesianPoint)& SP,
+                                                                             const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom_Circle) MakeCircle (const Handle(StepGeom_Circle)& SC,
+                                                         const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom2d_Circle) MakeCircle2d (const Handle(StepGeom_Circle)& SC,
+                                                             const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom_Conic) MakeConic (const Handle(StepGeom_Conic)& SC,
+                                                       const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom2d_Conic) MakeConic2d (const Handle(StepGeom_Conic)& SC,
+                                                           const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom_ConicalSurface) MakeConicalSurface (const Handle(StepGeom_ConicalSurface)& SS,
+                                                                         const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom_Curve) MakeCurve (const Handle(StepGeom_Curve)& SC,
+                                                       const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom2d_Curve) MakeCurve2d (const Handle(StepGeom_Curve)& SC,
+                                                           const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom_CylindricalSurface) MakeCylindricalSurface (const Handle(StepGeom_CylindricalSurface)& SS,
+                                                                                 const StepData_Factors& theLocalFactors);
   Standard_EXPORT static Handle(Geom_Direction) MakeDirection (const Handle(StepGeom_Direction)& SD);
   Standard_EXPORT static Handle(Geom2d_Direction) MakeDirection2d (const Handle(StepGeom_Direction)& SD);
-  Standard_EXPORT static Handle(Geom_ElementarySurface) MakeElementarySurface (const Handle(StepGeom_ElementarySurface)& SS);
-  Standard_EXPORT static Handle(Geom_Ellipse) MakeEllipse (const Handle(StepGeom_Ellipse)& SC);
-  Standard_EXPORT static Handle(Geom2d_Ellipse) MakeEllipse2d (const Handle(StepGeom_Ellipse)& SC);
-  Standard_EXPORT static Handle(Geom_Hyperbola) MakeHyperbola (const Handle(StepGeom_Hyperbola)& SC);
-  Standard_EXPORT static Handle(Geom2d_Hyperbola) MakeHyperbola2d (const Handle(StepGeom_Hyperbola)& SC);
-  Standard_EXPORT static Handle(Geom_Line) MakeLine (const Handle(StepGeom_Line)& SC);
-  Standard_EXPORT static Handle(Geom2d_Line) MakeLine2d (const Handle(StepGeom_Line)& SC);
-  Standard_EXPORT static Handle(Geom_Parabola) MakeParabola (const Handle(StepGeom_Parabola)& SC);
-  Standard_EXPORT static Handle(Geom2d_Parabola) MakeParabola2d (const Handle(StepGeom_Parabola)& SC);
-  Standard_EXPORT static Handle(Geom_Plane) MakePlane (const Handle(StepGeom_Plane)& SP);
-  Standard_EXPORT static Handle(Geom_BSplineCurve) MakePolyline (const Handle(StepGeom_Polyline)& SPL);
-  Standard_EXPORT static Handle(Geom2d_BSplineCurve) MakePolyline2d (const Handle(StepGeom_Polyline)& SPL);
-  Standard_EXPORT static Handle(Geom_RectangularTrimmedSurface) MakeRectangularTrimmedSurface (const Handle(StepGeom_RectangularTrimmedSurface)& SS);
-  Standard_EXPORT static Handle(Geom_SphericalSurface) MakeSphericalSurface (const Handle(StepGeom_SphericalSurface)& SS);
-  Standard_EXPORT static Handle(Geom_Surface) MakeSurface (const Handle(StepGeom_Surface)& SS);
-  Standard_EXPORT static Handle(Geom_SurfaceOfLinearExtrusion) MakeSurfaceOfLinearExtrusion (const Handle(StepGeom_SurfaceOfLinearExtrusion)& SS);
-  Standard_EXPORT static Handle(Geom_SurfaceOfRevolution) MakeSurfaceOfRevolution (const Handle(StepGeom_SurfaceOfRevolution)& SS);
-  Standard_EXPORT static Handle(Geom_SweptSurface) MakeSweptSurface (const Handle(StepGeom_SweptSurface)& SS);
-  Standard_EXPORT static Handle(Geom_ToroidalSurface) MakeToroidalSurface (const Handle(StepGeom_ToroidalSurface)& SS);
-  Standard_EXPORT static Standard_Boolean MakeTransformation2d (const Handle(StepGeom_CartesianTransformationOperator2d)& SCTO, gp_Trsf2d& CT);
-  Standard_EXPORT static Standard_Boolean MakeTransformation3d (const Handle(StepGeom_CartesianTransformationOperator3d)& SCTO, gp_Trsf& CT);
-  Standard_EXPORT static Handle(Geom_TrimmedCurve) MakeTrimmedCurve (const Handle(StepGeom_TrimmedCurve)& SC);
-  Standard_EXPORT static Handle(Geom2d_BSplineCurve) MakeTrimmedCurve2d (const Handle(StepGeom_TrimmedCurve)& SC);
-  Standard_EXPORT static Handle(Geom_VectorWithMagnitude) MakeVectorWithMagnitude (const Handle(StepGeom_Vector)& SV);
+  Standard_EXPORT static Handle(Geom_ElementarySurface) MakeElementarySurface (const Handle(StepGeom_ElementarySurface)& SS,
+                                                                               const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom_Ellipse) MakeEllipse (const Handle(StepGeom_Ellipse)& SC,
+                                                           const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom2d_Ellipse) MakeEllipse2d (const Handle(StepGeom_Ellipse)& SC,
+                                                               const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom_Hyperbola) MakeHyperbola (const Handle(StepGeom_Hyperbola)& SC,
+                                                               const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom2d_Hyperbola) MakeHyperbola2d (const Handle(StepGeom_Hyperbola)& SC,
+                                                                   const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom_Line) MakeLine (const Handle(StepGeom_Line)& SC,
+                                                     const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom2d_Line) MakeLine2d (const Handle(StepGeom_Line)& SC,
+                                                         const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom_Parabola) MakeParabola (const Handle(StepGeom_Parabola)& SC,
+                                                             const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom2d_Parabola) MakeParabola2d (const Handle(StepGeom_Parabola)& SC,
+                                                                 const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom_Plane) MakePlane (const Handle(StepGeom_Plane)& SP,
+                                                       const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom_BSplineCurve) MakePolyline (const Handle(StepGeom_Polyline)& SPL,
+                                                                 const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom2d_BSplineCurve) MakePolyline2d (const Handle(StepGeom_Polyline)& SPL,
+                                                                     const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom_RectangularTrimmedSurface) MakeRectangularTrimmedSurface (const Handle(StepGeom_RectangularTrimmedSurface)& SS,
+                                                                                               const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom_SphericalSurface) MakeSphericalSurface (const Handle(StepGeom_SphericalSurface)& SS,
+                                                                             const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom_Surface) MakeSurface (const Handle(StepGeom_Surface)& SS,
+                                                           const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom_SurfaceOfLinearExtrusion) MakeSurfaceOfLinearExtrusion (const Handle(StepGeom_SurfaceOfLinearExtrusion)& SS,
+                                                                                             const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom_SurfaceOfRevolution) MakeSurfaceOfRevolution (const Handle(StepGeom_SurfaceOfRevolution)& SS,
+                                                                                   const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom_SweptSurface) MakeSweptSurface (const Handle(StepGeom_SweptSurface)& SS,
+                                                                     const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom_ToroidalSurface) MakeToroidalSurface (const Handle(StepGeom_ToroidalSurface)& SS,
+                                                                           const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Standard_Boolean MakeTransformation2d (const Handle(StepGeom_CartesianTransformationOperator2d)& SCTO, gp_Trsf2d& CT,
+                                                                const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Standard_Boolean MakeTransformation3d (const Handle(StepGeom_CartesianTransformationOperator3d)& SCTO, gp_Trsf& CT,
+                                                                const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom_TrimmedCurve) MakeTrimmedCurve (const Handle(StepGeom_TrimmedCurve)& SC,
+                                                                     const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom2d_BSplineCurve) MakeTrimmedCurve2d (const Handle(StepGeom_TrimmedCurve)& SC,
+                                                                         const StepData_Factors& theLocalFactors);
+  Standard_EXPORT static Handle(Geom_VectorWithMagnitude) MakeVectorWithMagnitude (const Handle(StepGeom_Vector)& SV,
+                                                                                   const StepData_Factors& theLocalFactors);
   Standard_EXPORT static Handle(Geom2d_VectorWithMagnitude) MakeVectorWithMagnitude2d (const Handle(StepGeom_Vector)& SV);
   Standard_EXPORT static Handle(TColStd_HArray1OfReal) MakeYprRotation(const StepKinematics_SpatialRotation& SR, const Handle(StepRepr_GlobalUnitAssignedContext)& theCntxt);
 };
index 1f431520a9d7fb010bd20685f37583d67788542c..82bbe14a983ee9df82dc9e3af95ecbcee3c2e6fd 100644 (file)
@@ -38,6 +38,7 @@
 #include <Standard_Failure.hxx>
 #include <StdFail_NotDone.hxx>
 #include <STEPControl_ActorRead.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_CompositeCurve.hxx>
 #include <StepGeom_Curve.hxx>
 #include <StepGeom_CurveBoundedSurface.hxx>
@@ -117,6 +118,7 @@ StepToTopoDS_Builder::StepToTopoDS_Builder()
 void StepToTopoDS_Builder::Init
 (const Handle(StepShape_ManifoldSolidBrep)& aManifoldSolid,
  const Handle(Transfer_TransientProcess)& TP,
+ const StepData_Factors& theLocalFactors,
  const Message_ProgressRange& theProgress)
 {
   Message_Messenger::StreamBuffer sout = TP->Messenger()->SendInfo();
@@ -137,7 +139,7 @@ void StepToTopoDS_Builder::Init
   myTranShell.SetMaxTol(MaxTol());
   // Non-manifold topology is not referenced by ManifoldSolidBrep (ssv; 14.11.2010)
   StepToTopoDS_NMTool dummyNMTool;
-  myTranShell.Init(aShell, myTool, dummyNMTool, theProgress);
+  myTranShell.Init(aShell, myTool, dummyNMTool, theLocalFactors, theProgress);
 
   if (myTranShell.IsDone()) {
     TopoDS_Shape Sh = myTranShell.Value();
@@ -185,6 +187,7 @@ void StepToTopoDS_Builder::Init
 void StepToTopoDS_Builder::Init
 (const Handle(StepShape_BrepWithVoids)& aBRepWithVoids,
  const Handle(Transfer_TransientProcess)& TP,
+ const StepData_Factors& theLocalFactors,
  const Message_ProgressRange& theProgress)
 {
   Message_Messenger::StreamBuffer sout = TP->Messenger()->SendInfo();
@@ -214,7 +217,7 @@ void StepToTopoDS_Builder::Init
   aCShell = Handle(StepShape_ClosedShell)::DownCast(aBRepWithVoids->Outer());
   // Non-manifold topology is not referenced by BrepWithVoids (ssv; 14.11.2010)
   StepToTopoDS_NMTool dummyNMTool;
-  myTranShell.Init(aCShell, myTool, dummyNMTool, PS.Next());
+  myTranShell.Init(aCShell, myTool, dummyNMTool, theLocalFactors, PS.Next());
 
   if (myTranShell.IsDone()) {
     Sh = myTranShell.Value();
@@ -238,7 +241,7 @@ void StepToTopoDS_Builder::Init
   for (Standard_Integer i=1; i<=Nb && PS.More(); i++) {
 
     aCShell = aBRepWithVoids->VoidsValue(i);
-    myTranShell.Init(aCShell, myTool, dummyNMTool, PS.Next());
+    myTranShell.Init(aCShell, myTool, dummyNMTool, theLocalFactors, PS.Next());
     if (myTranShell.IsDone()) {
       Sh = myTranShell.Value();
       Sh.Closed(Standard_True);
@@ -285,6 +288,7 @@ void StepToTopoDS_Builder::Init
 
 void StepToTopoDS_Builder::Init(const Handle(StepShape_FacetedBrep)& aFB,
                                 const Handle(Transfer_TransientProcess)& TP,
+                                const StepData_Factors& theLocalFactors,
                                 const Message_ProgressRange& theProgress)
 {
   // Initialisation of the Tool
@@ -305,7 +309,7 @@ void StepToTopoDS_Builder::Init(const Handle(StepShape_FacetedBrep)& aFB,
   myTranShell.SetMaxTol(MaxTol());  
   // Non-manifold topology is not referenced by FacetedBrep (ss; 14.11.2010)
   StepToTopoDS_NMTool dummyNMTool;
-  myTranShell.Init(aCShell, myTool, dummyNMTool, theProgress);
+  myTranShell.Init(aCShell, myTool, dummyNMTool, theLocalFactors, theProgress);
 
   if (myTranShell.IsDone()) {
     Sh = myTranShell.Value();
@@ -337,6 +341,7 @@ void StepToTopoDS_Builder::Init(const Handle(StepShape_FacetedBrep)& aFB,
 void StepToTopoDS_Builder::Init
 (const Handle(StepShape_FacetedBrepAndBrepWithVoids)& aFBABWV,
  const Handle(Transfer_TransientProcess)& TP,
+ const StepData_Factors& theLocalFactors,
  const Message_ProgressRange& theProgress)
 {
   // Initialisation of the Tool
@@ -359,7 +364,7 @@ void StepToTopoDS_Builder::Init
   myTranShell.SetMaxTol(MaxTol());
   // Non-manifold topology is not referenced by FacetedBrepAndBrepWithVoids (ss; 14.11.2010)
   StepToTopoDS_NMTool dummyNMTool;
-  myTranShell.Init(aCShell, myTool, dummyNMTool, aPSRoot.Next());
+  myTranShell.Init(aCShell, myTool, dummyNMTool, theLocalFactors, aPSRoot.Next());
 
   if (myTranShell.IsDone()) {
     Sh = myTranShell.Value();
@@ -374,7 +379,7 @@ void StepToTopoDS_Builder::Init
     Message_ProgressScope aPS (aPSRoot.Next(), NULL, Nb);
     for ( i=1; i<=Nb && aPS.More(); i++) {
       aCShell = aFBABWV->VoidsValue(i);
-      myTranShell.Init(aCShell, myTool, dummyNMTool, aPS.Next());
+      myTranShell.Init(aCShell, myTool, dummyNMTool, theLocalFactors, aPS.Next());
       if (myTranShell.IsDone()) {
         Sh = myTranShell.Value();
         Sh.Closed(Standard_True);
@@ -407,6 +412,7 @@ void StepToTopoDS_Builder::Init
 (const Handle(StepShape_ShellBasedSurfaceModel)& aSBSM,
  const Handle(Transfer_TransientProcess)& TP,
  StepToTopoDS_NMTool& NMTool,
+ const StepData_Factors& theLocalFactors,
  const Message_ProgressRange& theProgress)
 {
   Message_Messenger::StreamBuffer sout = TP->Messenger()->SendInfo();
@@ -442,7 +448,7 @@ void StepToTopoDS_Builder::Init
     aOpenShell = aShell.OpenShell();
     aClosedShell = aShell.ClosedShell();
     if (!aOpenShell.IsNull()) {
-      myTranShell.Init(aOpenShell, myTool, NMTool, aRange);
+      myTranShell.Init(aOpenShell, myTool, NMTool, theLocalFactors, aRange);
       if (myTranShell.IsDone()) {
         Shl = TopoDS::Shell(myTranShell.Value());
         Shl.Closed(Standard_False);
@@ -454,7 +460,7 @@ void StepToTopoDS_Builder::Init
       }
     }
     else if (!aClosedShell.IsNull()) {
-      myTranShell.Init(aClosedShell, myTool, NMTool, aRange);
+      myTranShell.Init(aClosedShell, myTool, NMTool, theLocalFactors, aRange);
       if (myTranShell.IsDone()) {
         Shl = TopoDS::Shell(myTranShell.Value());
         Shl.Closed(Standard_True);
@@ -500,7 +506,8 @@ void StepToTopoDS_Builder::Init
 // ============================================================================
 
 void StepToTopoDS_Builder::Init (const Handle(StepShape_EdgeBasedWireframeModel)& aEBWM,
-                                 const Handle(Transfer_TransientProcess)& TP)
+                                 const Handle(Transfer_TransientProcess)& TP,
+                                 const StepData_Factors& theLocalFactors)
 {
   myResult.Nullify();
   
@@ -534,7 +541,7 @@ void StepToTopoDS_Builder::Init (const Handle(StepShape_EdgeBasedWireframeModel)
     }
     TopoDS_Wire W;
     for ( Standard_Integer j=1; j <= edges->Length(); j++ ) {
-      myTranEdge.Init (edges->Value(j), myTool, dummyNMTool);
+      myTranEdge.Init (edges->Value(j), myTool, dummyNMTool, theLocalFactors);
       if ( ! myTranEdge.IsDone() ) continue;
       TopoDS_Edge E = TopoDS::Edge(myTranEdge.Value());
       if (E.IsNull()) continue;  // NULL, on saute
@@ -560,7 +567,8 @@ void StepToTopoDS_Builder::Init (const Handle(StepShape_EdgeBasedWireframeModel)
 // ============================================================================
 
 void StepToTopoDS_Builder::Init (const Handle(StepShape_FaceBasedSurfaceModel)& aFBSM,
-                                 const Handle(Transfer_TransientProcess)& TP)
+                                 const Handle(Transfer_TransientProcess)& TP,
+                                 const StepData_Factors& theLocalFactors)
 {
   myResult.Nullify();
   
@@ -596,7 +604,7 @@ void StepToTopoDS_Builder::Init (const Handle(StepShape_FaceBasedSurfaceModel)&
     TopoDS_Shell S;
     for ( Standard_Integer j=1; j <= faces->Length(); j++ ) {
       Handle(StepShape_FaceSurface) fs = Handle(StepShape_FaceSurface)::DownCast ( faces->Value(j) );
-      myTranFace.Init(fs, myTool, dummyNMTool);
+      myTranFace.Init(fs, myTool, dummyNMTool, theLocalFactors);
       if ( ! myTranFace.IsDone() ) continue;
       TopoDS_Face F = TopoDS::Face(myTranFace.Value());
       if (F.IsNull()) continue;  // NULL, on saute
@@ -625,11 +633,12 @@ void StepToTopoDS_Builder::Init (const Handle(StepShape_FaceBasedSurfaceModel)&
 //:i6 abv 17 Sep 98: ProSTEP TR9 r0601-ct.stp: to be able read GS: GeometricCurveSet -> GeometricSet
 
 static TopoDS_Face TranslateBoundedSurf (const Handle(StepGeom_Surface) &surf,
-                                         const Standard_Real TolDegen)
+                                         const Standard_Real TolDegen,
+                                         const StepData_Factors& theLocalFactors)
 {
   TopoDS_Face res;
 
-  Handle(Geom_Surface) theSurf = StepToGeom::MakeSurface (surf);
+  Handle(Geom_Surface) theSurf = StepToGeom::MakeSurface (surf, theLocalFactors);
   if (theSurf.IsNull() || //:i6: protection
       !theSurf->IsKind(STANDARD_TYPE(Geom_BoundedSurface))) return res;
 
@@ -655,6 +664,7 @@ static TopoDS_Face TranslateBoundedSurf (const Handle(StepGeom_Surface) &surf,
 void StepToTopoDS_Builder::Init
 (const Handle(StepShape_GeometricSet)& GCS,
  const Handle(Transfer_TransientProcess)& TP,
+ const StepData_Factors& theLocalFactors,
  const Handle(Transfer_ActorOfTransientProcess)& RA,
  const Standard_Boolean isManifold,
  const Message_ProgressRange& theProgress)
@@ -697,7 +707,7 @@ void StepToTopoDS_Builder::Init
         StepToTopoDS_TranslateCompositeCurve TrCC;
         TrCC.SetPrecision(preci);
         TrCC.SetMaxTol(maxtol);
-        TrCC.Init(CC, TP);
+        TrCC.Init(CC, TP, theLocalFactors);
         if (TrCC.IsDone())
         {
           if (TrCC.IsInfiniteSegment())
@@ -718,7 +728,7 @@ void StepToTopoDS_Builder::Init
         Handle(Geom_Curve) aGeomCrv;
         try {
           OCC_CATCH_SIGNALS
-            aGeomCrv = StepToGeom::MakeCurve(aCrv);
+            aGeomCrv = StepToGeom::MakeCurve(aCrv, theLocalFactors);
         }
         catch (Standard_Failure const& anException) {
           Message_Messenger::StreamBuffer sout = TP->Messenger()->SendInfo();
@@ -734,7 +744,7 @@ void StepToTopoDS_Builder::Init
     // try point
     else if ( ent->IsKind(STANDARD_TYPE(StepGeom_CartesianPoint)) ) {
       Handle(StepGeom_CartesianPoint) aPnt = Handle(StepGeom_CartesianPoint)::DownCast ( ent );
-      Handle(Geom_CartesianPoint) thePnt = StepToGeom::MakeCartesianPoint (aPnt);
+      Handle(Geom_CartesianPoint) thePnt = StepToGeom::MakeCartesianPoint (aPnt, theLocalFactors);
       if (! thePnt.IsNull()) {
         BRepBuilderAPI_MakeVertex myMkVtx(thePnt->Pnt());
         if ( myMkVtx.IsDone() ) res = myMkVtx.Vertex();
@@ -753,7 +763,7 @@ void StepToTopoDS_Builder::Init
         TrCBS.SetPrecision(preci);
         TrCBS.SetMaxTol(maxtol);
 
-        TrCBS.Init(CBS, TP);
+        TrCBS.Init(CBS, TP, theLocalFactors);
         if (TrCBS.IsDone()) res = TrCBS.Value();
       }
       // try RectangularCompositeSurface
@@ -767,13 +777,13 @@ void StepToTopoDS_Builder::Init
         for (Standard_Integer ii = 1; ii <= nbi; ii++)
           for (Standard_Integer j = 1; j <= nbj; j++) {
             Handle(StepGeom_SurfacePatch) patch = RCS->SegmentsValue(ii, j);
-            TopoDS_Face f = TranslateBoundedSurf(patch->ParentSurface(), preci);
+            TopoDS_Face f = TranslateBoundedSurf(patch->ParentSurface(), preci, theLocalFactors);
             if (!f.IsNull()) B.Add(C, f);
           }
         res = C;
       }
       // try other surfs
-      else res = TranslateBoundedSurf(aSurf, preci);
+      else res = TranslateBoundedSurf(aSurf, preci, theLocalFactors);
     }
     else if ( ent->IsKind(STANDARD_TYPE(StepGeom_GeometricRepresentationItem)) )
     {
@@ -784,7 +794,7 @@ void StepToTopoDS_Builder::Init
         Handle(STEPControl_ActorRead) anActor = Handle(STEPControl_ActorRead)::DownCast(RA);
         Handle(Transfer_Binder) binder;
         if( !anActor.IsNull())
-          binder = anActor->TransferShape(GRI, TP, isManifold, Standard_False, aRange);
+          binder = anActor->TransferShape(GRI, TP, theLocalFactors, isManifold, Standard_False, aRange);
         if (!binder.IsNull())
         {
           res = TransferBRep::ShapeResult(binder);
@@ -813,6 +823,7 @@ void StepToTopoDS_Builder::Init(const Handle(StepVisual_TessellatedSolid)& theTS
                                 const Handle(Transfer_TransientProcess)& theTP,
                                 const Standard_Boolean theReadTessellatedWhenNoBRepOnly,
                                 Standard_Boolean& theHasGeom,
+                                const StepData_Factors& theLocalFactors,
                                 const Message_ProgressRange& theProgress)
 {
   StepToTopoDS_TranslateSolid aTranSolid;
@@ -825,7 +836,7 @@ void StepToTopoDS_Builder::Init(const Handle(StepVisual_TessellatedSolid)& theTS
 
   StepToTopoDS_NMTool dummyNMTool;
   aTranSolid.Init(theTSo, theTP, aTool, dummyNMTool, theReadTessellatedWhenNoBRepOnly, 
-                  theHasGeom, theProgress);
+                  theHasGeom, theLocalFactors, theProgress);
 
   if (aTranSolid.IsDone()) 
   {
@@ -852,6 +863,7 @@ void StepToTopoDS_Builder::Init(const Handle(StepVisual_TessellatedShell)& theTS
                                 const Handle(Transfer_TransientProcess)& theTP,
                                 const Standard_Boolean theReadTessellatedWhenNoBRepOnly,
                                 Standard_Boolean& theHasGeom,
+                                const StepData_Factors& theLocalFactors,
                                 const Message_ProgressRange& theProgress)
 {
   StepToTopoDS_TranslateShell aTranShell;
@@ -864,7 +876,7 @@ void StepToTopoDS_Builder::Init(const Handle(StepVisual_TessellatedShell)& theTS
 
   StepToTopoDS_NMTool dummyNMTool;
   aTranShell.Init(theTSh, aTool, dummyNMTool, theReadTessellatedWhenNoBRepOnly, 
-                  theHasGeom, theProgress);
+                  theHasGeom, theLocalFactors, theProgress);
 
   if (aTranShell.IsDone()) 
   {
@@ -890,7 +902,8 @@ void StepToTopoDS_Builder::Init(const Handle(StepVisual_TessellatedShell)& theTS
 void StepToTopoDS_Builder::Init(const Handle(StepVisual_TessellatedFace)& theTF,
                                 const Handle(Transfer_TransientProcess)& theTP,
                                 const Standard_Boolean theReadTessellatedWhenNoBRepOnly,
-                                Standard_Boolean& theHasGeom)
+                                Standard_Boolean& theHasGeom,
+                                const StepData_Factors& theLocalFactors)
 {
   StepToTopoDS_TranslateFace aTranFace;
   aTranFace.SetPrecision(Precision());
@@ -901,7 +914,7 @@ void StepToTopoDS_Builder::Init(const Handle(StepVisual_TessellatedFace)& theTF,
   aTool.Init(aMap, theTP);
 
   StepToTopoDS_NMTool dummyNMTool;
-  aTranFace.Init(theTF, aTool, dummyNMTool, theReadTessellatedWhenNoBRepOnly, theHasGeom);
+  aTranFace.Init(theTF, aTool, dummyNMTool, theReadTessellatedWhenNoBRepOnly, theHasGeom, theLocalFactors);
 
   if (aTranFace.IsDone()) 
   {
index 759d1bc825047eb9e7e3903a66ae697c1b60eb52..1388fc47799b3a31a9b892261b3e06fdb7d6b991 100644 (file)
@@ -54,33 +54,41 @@ public:
   
   Standard_EXPORT void Init (const Handle(StepShape_ManifoldSolidBrep)& S,
                              const Handle(Transfer_TransientProcess)& TP,
+                             const StepData_Factors& theLocalFactors,
                              const Message_ProgressRange& theProgress = Message_ProgressRange());
   
   Standard_EXPORT void Init (const Handle(StepShape_BrepWithVoids)& S,
                              const Handle(Transfer_TransientProcess)& TP,
+                             const StepData_Factors& theLocalFactors,
                              const Message_ProgressRange& theProgress = Message_ProgressRange());
   
   Standard_EXPORT void Init (const Handle(StepShape_FacetedBrep)& S,
                              const Handle(Transfer_TransientProcess)& TP,
+                             const StepData_Factors& theLocalFactors,
                              const Message_ProgressRange& theProgress = Message_ProgressRange());
   
   Standard_EXPORT void Init (const Handle(StepShape_FacetedBrepAndBrepWithVoids)& S,
                              const Handle(Transfer_TransientProcess)& TP,
+                             const StepData_Factors& theLocalFactors,
                              const Message_ProgressRange& theProgress = Message_ProgressRange());
   
   Standard_EXPORT void Init (const Handle(StepShape_ShellBasedSurfaceModel)& S,
                              const Handle(Transfer_TransientProcess)& TP,
                              StepToTopoDS_NMTool& NMTool,
+                             const StepData_Factors& theLocalFactors,
                              const Message_ProgressRange& theProgress = Message_ProgressRange());
   
   Standard_EXPORT void Init (const Handle(StepShape_EdgeBasedWireframeModel)& S,
-                             const Handle(Transfer_TransientProcess)& TP);
+                             const Handle(Transfer_TransientProcess)& TP,
+                             const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT void Init (const Handle(StepShape_FaceBasedSurfaceModel)& S,
-                             const Handle(Transfer_TransientProcess)& TP);
+                             const Handle(Transfer_TransientProcess)& TP,
+                             const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT void Init (const Handle(StepShape_GeometricSet)& S,
                              const Handle(Transfer_TransientProcess)& TP,
+                             const StepData_Factors& theLocalFactors,
                              const Handle(Transfer_ActorOfTransientProcess)& RA = NULL,
                              const Standard_Boolean isManifold = Standard_False,
                              const Message_ProgressRange& theProgress = Message_ProgressRange());
@@ -89,18 +97,21 @@ public:
                              const Handle(Transfer_TransientProcess)& theTP,
                              const Standard_Boolean theReadTessellatedWhenNoBRepOnly,
                              Standard_Boolean& theHasGeom,
+                             const StepData_Factors& theLocalFactors,
                              const Message_ProgressRange& theProgress = Message_ProgressRange());
   
   Standard_EXPORT void Init (const Handle(StepVisual_TessellatedShell)& theTSh,
                              const Handle(Transfer_TransientProcess)& theTP,
                              const Standard_Boolean theReadTessellatedWhenNoBRepOnly,
                              Standard_Boolean& theHasGeom,
+                             const StepData_Factors& theLocalFactors,
                              const Message_ProgressRange& theProgress = Message_ProgressRange());
   
   Standard_EXPORT void Init (const Handle(StepVisual_TessellatedFace)& theTF,
                              const Handle(Transfer_TransientProcess)& theTP,
                              const Standard_Boolean theReadTessellatedWhenNoBRepOnly,
-                             Standard_Boolean& theHasGeom);
+                             Standard_Boolean& theHasGeom,
+                             const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const TopoDS_Shape& Value() const;
   
index bd98590ef318ab024ade0bd29d6faf73ad0e3095..00c52ecb2518190946c8a454b5377df95eceaf70 100644 (file)
@@ -19,6 +19,7 @@
 #include <gp_Ax3.hxx>
 #include <gp_Trsf.hxx>
 #include <gp_TrsfForm.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_Axis2Placement3d.hxx>
 #include <StepGeom_CartesianPoint.hxx>
 #include <StepGeom_CartesianTransformationOperator3d.hxx>
@@ -48,16 +49,17 @@ StepToTopoDS_MakeTransformed::StepToTopoDS_MakeTransformed ()
 
 Standard_Boolean  StepToTopoDS_MakeTransformed::Compute
   (const Handle(StepGeom_Axis2Placement3d)& Origin,
-   const Handle(StepGeom_Axis2Placement3d)& Target)
+   const Handle(StepGeom_Axis2Placement3d)& Target,
+   const StepData_Factors& theLocalFactors)
 {
   theTrsf = gp_Trsf();  // reinit
   if (Origin.IsNull() || Target.IsNull()) return Standard_False;
 
   // sln 23.10.2001 : If the directions have not been created do nothing.  
-  Handle(Geom_Axis2Placement) theOrig = StepToGeom::MakeAxis2Placement (Origin);
+  Handle(Geom_Axis2Placement) theOrig = StepToGeom::MakeAxis2Placement (Origin, theLocalFactors);
   if (theOrig.IsNull())
     return Standard_False;
-  Handle(Geom_Axis2Placement) theTarg = StepToGeom::MakeAxis2Placement (Target);
+  Handle(Geom_Axis2Placement) theTarg = StepToGeom::MakeAxis2Placement (Target, theLocalFactors);
   if (theTarg.IsNull())
     return Standard_False;
 
@@ -75,9 +77,10 @@ Standard_Boolean  StepToTopoDS_MakeTransformed::Compute
 //=======================================================================
 
 Standard_Boolean  StepToTopoDS_MakeTransformed::Compute
-  (const Handle(StepGeom_CartesianTransformationOperator3d)& Operator)
+  (const Handle(StepGeom_CartesianTransformationOperator3d)& Operator,
+   const StepData_Factors& theLocalFactors)
 {
-  return StepToGeom::MakeTransformation3d (Operator, theTrsf);
+  return StepToGeom::MakeTransformation3d (Operator, theTrsf, theLocalFactors);
 }
 
 //=======================================================================
@@ -112,6 +115,7 @@ Standard_Boolean  StepToTopoDS_MakeTransformed::Transform
 TopoDS_Shape  StepToTopoDS_MakeTransformed::TranslateMappedItem
 (const Handle(StepRepr_MappedItem)& mapit,
  const Handle(Transfer_TransientProcess)& TP,
+ const StepData_Factors& theLocalFactors,
  const Message_ProgressRange& theProgress)
 {
   TopoDS_Shape theResult;
@@ -130,8 +134,8 @@ TopoDS_Shape  StepToTopoDS_MakeTransformed::TranslateMappedItem
     Handle(StepGeom_CartesianTransformationOperator3d)::DownCast(mapit->MappingTarget());
 
   Standard_Boolean ok = Standard_False;
-  if (!Origin.IsNull() && !Target.IsNull()) ok = Compute (Origin,Target);
-  else if (!CartOp.IsNull()) ok = Compute (CartOp);
+  if (!Origin.IsNull() && !Target.IsNull()) ok = Compute (Origin, Target, theLocalFactors);
+  else if (!CartOp.IsNull()) ok = Compute (CartOp, theLocalFactors);
 
   if (!ok) TP->AddWarning (mapit,"Mapped Item, case not recognized, location ignored");
 
index 6df7b9b8146ac791109d411d212d241407858721..5d70185dde9c973a9415204d95bf14878134a620 100644 (file)
@@ -25,6 +25,7 @@
 #include <StepToTopoDS_Root.hxx>
 #include <Message_ProgressRange.hxx>
 
+class StepData_Factors;
 class StepGeom_Axis2Placement3d;
 class StepGeom_CartesianTransformationOperator3d;
 class TopoDS_Shape;
@@ -44,10 +45,13 @@ public:
   //! Computes a transformation to pass from an Origin placement to
   //! a Target placement. Returns True when done
   //! If not done, the transformation will by Identity
-  Standard_EXPORT Standard_Boolean Compute (const Handle(StepGeom_Axis2Placement3d)& Origin, const Handle(StepGeom_Axis2Placement3d)& Target);
+  Standard_EXPORT Standard_Boolean Compute (const Handle(StepGeom_Axis2Placement3d)& Origin,
+                                            const Handle(StepGeom_Axis2Placement3d)& Target,
+                                            const StepData_Factors& theLocalFactors);
   
   //! Computes a transformation defined by an operator 3D
-  Standard_EXPORT Standard_Boolean Compute (const Handle(StepGeom_CartesianTransformationOperator3d)& Operator);
+  Standard_EXPORT Standard_Boolean Compute (const Handle(StepGeom_CartesianTransformationOperator3d)& Operator,
+                                            const StepData_Factors& theLocalFactors);
   
   //! Returns the computed transformation (Identity if not yet or
   //! if failed)
@@ -69,6 +73,7 @@ public:
   //! transformed as an instance of this Shape
   Standard_EXPORT TopoDS_Shape TranslateMappedItem (const Handle(StepRepr_MappedItem)& mapit,
                                                     const Handle(Transfer_TransientProcess)& TP,
+                                                    const StepData_Factors& theLocalFactors,
                                                     const Message_ProgressRange& theProgress = Message_ProgressRange());
 
 
index 6b7ff8382d048bc63e59765cfca6f441079e7b87..cf44ab9f5a640e1078190be1dc4b0604fa697664 100644 (file)
@@ -27,6 +27,7 @@
 #include <ShapeFix_Wire.hxx>
 #include <Standard_ErrorHandler.hxx>
 #include <Standard_Failure.hxx>
+#include <StepData_StepModel.hxx>
 #include <StepGeom_CompositeCurve.hxx>
 #include <StepGeom_CompositeCurveSegment.hxx>
 #include <StepGeom_Pcurve.hxx>
@@ -56,10 +57,11 @@ StepToTopoDS_TranslateCompositeCurve::StepToTopoDS_TranslateCompositeCurve ()
 //=======================================================================
 
 StepToTopoDS_TranslateCompositeCurve::StepToTopoDS_TranslateCompositeCurve (
-                                     const Handle(StepGeom_CompositeCurve) &CC,
-                                     const Handle(Transfer_TransientProcess) &TP)
+                                    const Handle(StepGeom_CompositeCurve) &CC,
+                                    const Handle(Transfer_TransientProcess) &TP,
+                                    const StepData_Factors& theLocalFactors)
 {
-  Init ( CC, TP );
+  Init ( CC, TP, theLocalFactors );
 }
 
 //=======================================================================
@@ -71,9 +73,10 @@ StepToTopoDS_TranslateCompositeCurve::StepToTopoDS_TranslateCompositeCurve (
                                      const Handle(StepGeom_CompositeCurve) &CC,
                                      const Handle(Transfer_TransientProcess) &TP,
                                      const Handle(StepGeom_Surface) &S,
-                                     const Handle(Geom_Surface) &Surf)
+                                     const Handle(Geom_Surface) &Surf,
+              const StepData_Factors& theLocalFactors)
 {
-  Init ( CC, TP, S, Surf );
+  Init ( CC, TP, S, Surf, theLocalFactors );
 }
        
 //=======================================================================
@@ -82,11 +85,12 @@ StepToTopoDS_TranslateCompositeCurve::StepToTopoDS_TranslateCompositeCurve (
 //=======================================================================
 
 Standard_Boolean StepToTopoDS_TranslateCompositeCurve::Init (const Handle(StepGeom_CompositeCurve) &CC,
-                                                            const Handle(Transfer_TransientProcess) &TP)
+                                                             const Handle(Transfer_TransientProcess) &TP,
+                                                             const StepData_Factors& theLocalFactors)
 {
   Handle(StepGeom_Surface) S;
   Handle(Geom_Surface) Surf;
-  return Init ( CC, TP, S, Surf );
+  return Init ( CC, TP, S, Surf, theLocalFactors );
 }
 
 //=======================================================================
@@ -97,7 +101,8 @@ Standard_Boolean StepToTopoDS_TranslateCompositeCurve::Init (const Handle(StepGe
 Standard_Boolean StepToTopoDS_TranslateCompositeCurve::Init (const Handle(StepGeom_CompositeCurve) &CC,
                                                             const Handle(Transfer_TransientProcess) &TP,
                                                             const Handle(StepGeom_Surface) &S,
-                                                            const Handle(Geom_Surface) &Surf)
+                                                            const Handle(Geom_Surface) &Surf,
+                   const StepData_Factors& theLocalFactors)
 {
   myWire.Nullify();
   myInfiniteSegment = Standard_False;
@@ -133,7 +138,7 @@ Standard_Boolean StepToTopoDS_TranslateCompositeCurve::Init (const Handle(StepGe
         continue;
       }
       Handle(StepGeom_CompositeCurve) cc = Handle(StepGeom_CompositeCurve)::DownCast ( crv );
-      if ( ! Init ( cc, TP, S, Surf ) || myWire.IsNull() )
+      if ( ! Init ( cc, TP, S, Surf, theLocalFactors ) || myWire.IsNull() )
         continue;
       Standard_Integer nb = sbwd->NbEdges() + 1;
       for (TopoDS_Iterator it(myWire); it.More(); it.Next()) {
@@ -181,7 +186,7 @@ Standard_Boolean StepToTopoDS_TranslateCompositeCurve::Init (const Handle(StepGe
     if ( ! crv.IsNull() ) {
       try {
         OCC_CATCH_SIGNALS
-        Handle(Geom_Curve) c3d = StepToGeom::MakeCurve (crv);
+        Handle(Geom_Curve) c3d = StepToGeom::MakeCurve (crv, theLocalFactors);
         if (! c3d.IsNull()) {
           BRepBuilderAPI_MakeEdge MkEdge ( c3d, c3d->FirstParameter(), c3d->LastParameter() );
           if (MkEdge.IsDone())
@@ -209,7 +214,7 @@ Standard_Boolean StepToTopoDS_TranslateCompositeCurve::Init (const Handle(StepGe
       try {
         OCC_CATCH_SIGNALS
         StepToTopoDS_TranslateEdge TrE;
-        Handle(Geom2d_Curve) c2d = TrE.MakePCurve(pcurve, Surf);
+        Handle(Geom2d_Curve) c2d = TrE.MakePCurve(pcurve, Surf, theLocalFactors);
         if (!c2d.IsNull()) {
           if (edge.IsNull()) {
             BRepBuilderAPI_MakeEdge MkEdge(c2d, Surf, c2d->FirstParameter(), c2d->LastParameter());
index 74f25802f909686c314790692993456b1ef4ef84..d940a2fe87693b577f1e41b3b014edbcd593edb9 100644 (file)
@@ -47,16 +47,28 @@ public:
   Standard_EXPORT StepToTopoDS_TranslateCompositeCurve();
   
   //! Translates standalone composite_curve
-  Standard_EXPORT StepToTopoDS_TranslateCompositeCurve(const Handle(StepGeom_CompositeCurve)& CC, const Handle(Transfer_TransientProcess)& TP);
+  Standard_EXPORT StepToTopoDS_TranslateCompositeCurve(const Handle(StepGeom_CompositeCurve)& CC,
+                                                       const Handle(Transfer_TransientProcess)& TP,
+                                                       const StepData_Factors& theLocalFactors);
   
   //! Translates composite_curve lying on surface
-  Standard_EXPORT StepToTopoDS_TranslateCompositeCurve(const Handle(StepGeom_CompositeCurve)& CC, const Handle(Transfer_TransientProcess)& TP, const Handle(StepGeom_Surface)& S, const Handle(Geom_Surface)& Surf);
+  Standard_EXPORT StepToTopoDS_TranslateCompositeCurve(const Handle(StepGeom_CompositeCurve)& CC,
+                                                       const Handle(Transfer_TransientProcess)& TP,
+                                                       const Handle(StepGeom_Surface)& S,
+                                                       const Handle(Geom_Surface)& Surf,
+                                                       const StepData_Factors& theLocalFactors);
   
   //! Translates standalone composite_curve
-  Standard_EXPORT Standard_Boolean Init (const Handle(StepGeom_CompositeCurve)& CC, const Handle(Transfer_TransientProcess)& TP);
+  Standard_EXPORT Standard_Boolean Init (const Handle(StepGeom_CompositeCurve)& CC,
+                                         const Handle(Transfer_TransientProcess)& TP,
+                                         const StepData_Factors& theLocalFactors);
   
   //! Translates composite_curve lying on surface
-  Standard_EXPORT Standard_Boolean Init (const Handle(StepGeom_CompositeCurve)& CC, const Handle(Transfer_TransientProcess)& TP, const Handle(StepGeom_Surface)& S, const Handle(Geom_Surface)& Surf);
+  Standard_EXPORT Standard_Boolean Init (const Handle(StepGeom_CompositeCurve)& CC,
+                                         const Handle(Transfer_TransientProcess)& TP,
+                                         const Handle(StepGeom_Surface)& S,
+                                         const Handle(Geom_Surface)& Surf,
+                                         const StepData_Factors& theLocalFactors);
   
   //! Returns result of last translation or null wire if failed.
   Standard_EXPORT const TopoDS_Wire& Value() const;
index 4849dda6cad3c004dea25d5b0989c8089f10020b..669410d5fa60b5405439994d922acf8a6e51a9c7 100644 (file)
@@ -23,6 +23,7 @@
 #include <Precision.hxx>
 #include <ShapeAlgo.hxx>
 #include <ShapeAlgo_AlgoContainer.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_BoundaryCurve.hxx>
 #include <StepGeom_BSplineSurface.hxx>
 #include <StepGeom_CurveBoundedSurface.hxx>
@@ -49,9 +50,10 @@ StepToTopoDS_TranslateCurveBoundedSurface::StepToTopoDS_TranslateCurveBoundedSur
 
 StepToTopoDS_TranslateCurveBoundedSurface::StepToTopoDS_TranslateCurveBoundedSurface (
                                           const Handle(StepGeom_CurveBoundedSurface) &CBS, 
-                                          const Handle(Transfer_TransientProcess) &TP)
+                                          const Handle(Transfer_TransientProcess) &TP,
+             const StepData_Factors& theLocalFactors)
 {
-  Init ( CBS, TP );
+  Init ( CBS, TP, theLocalFactors );
 }
 
 //=======================================================================
@@ -61,14 +63,15 @@ StepToTopoDS_TranslateCurveBoundedSurface::StepToTopoDS_TranslateCurveBoundedSur
 
 Standard_Boolean StepToTopoDS_TranslateCurveBoundedSurface::Init (
                 const Handle(StepGeom_CurveBoundedSurface) &CBS, 
-                const Handle(Transfer_TransientProcess) &TP)
+                const Handle(Transfer_TransientProcess) &TP,
+     const StepData_Factors& theLocalFactors)
 {
   myFace.Nullify();
   if ( CBS.IsNull() ) return Standard_False;
   
   // translate basis surface 
   Handle(StepGeom_Surface) S = CBS->BasisSurface();
-  Handle(Geom_Surface) Surf = StepToGeom::MakeSurface (S);
+  Handle(Geom_Surface) Surf = StepToGeom::MakeSurface (S, theLocalFactors);
   if (Surf.IsNull())
   {
     TP->AddFail ( CBS, "Basis surface not translated" );
@@ -105,7 +108,7 @@ Standard_Boolean StepToTopoDS_TranslateCurveBoundedSurface::Init (
   for ( Standard_Integer i=1; i <= nb; i++ ) {
     Handle(StepGeom_CompositeCurve) cc = bnd->Value ( i ).BoundaryCurve();
     if ( cc.IsNull() ) continue;
-    StepToTopoDS_TranslateCompositeCurve TrCC ( cc, TP, S, Surf );
+    StepToTopoDS_TranslateCompositeCurve TrCC ( cc, TP, S, Surf, theLocalFactors );
     if ( ! TrCC.IsDone() ) {
       TP->AddWarning ( CBS, "Boundary not translated" );
       continue;
index 28bf8a26e2973389775404edc026c73a5c0f36f4..176177890cd52e730c7b842ac8ad86f30543de07 100644 (file)
@@ -39,10 +39,14 @@ public:
   Standard_EXPORT StepToTopoDS_TranslateCurveBoundedSurface();
   
   //! Translate surface
-  Standard_EXPORT StepToTopoDS_TranslateCurveBoundedSurface(const Handle(StepGeom_CurveBoundedSurface)& CBS, const Handle(Transfer_TransientProcess)& TP);
+  Standard_EXPORT StepToTopoDS_TranslateCurveBoundedSurface(const Handle(StepGeom_CurveBoundedSurface)& CBS,
+                                                            const Handle(Transfer_TransientProcess)& TP,
+                                                            const StepData_Factors& theLocalFactors);
   
   //! Translate surface
-  Standard_EXPORT Standard_Boolean Init (const Handle(StepGeom_CurveBoundedSurface)& CBS, const Handle(Transfer_TransientProcess)& TP);
+  Standard_EXPORT Standard_Boolean Init (const Handle(StepGeom_CurveBoundedSurface)& CBS,
+                                         const Handle(Transfer_TransientProcess)& TP,
+                                         const StepData_Factors& theLocalFactors);
   
   //! Returns result of last translation or null wire if failed.
   Standard_EXPORT const TopoDS_Face& Value() const;
index a005fc8aca7305584a2e3688412384d3bc4e290e..043e946b93967b89b7835b048b71c4f08fd1612d 100644 (file)
@@ -34,7 +34,7 @@
 #include <ShapeAnalysis_Curve.hxx>
 #include <ShapeConstruct_Curve.hxx>
 #include <StdFail_NotDone.hxx>
-#include <StepData_GlobalFactors.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_Pcurve.hxx>
 #include <StepGeom_SurfaceCurve.hxx>
 #include <StepRepr_DefinitionalRepresentation.hxx>
@@ -136,11 +136,12 @@ static void DecodeMakeEdgeError(const BRepLib_MakeEdge&   ME,
 // ============================================================================
 
 static Handle(Geom_Curve) MakeCurve
-  (const Handle(StepGeom_Curve)& C1, const Handle(Transfer_TransientProcess)& TP)
+  (const Handle(StepGeom_Curve)& C1, const Handle(Transfer_TransientProcess)& TP,
+   const StepData_Factors& theLocalFactors)
 {
   Handle(Geom_Curve) C2 = Handle(Geom_Curve)::DownCast (TP->FindTransient(C1));
   if (!C2.IsNull()) return C2;
-  C2 = StepToGeom::MakeCurve (C1);
+  C2 = StepToGeom::MakeCurve (C1, theLocalFactors);
   if (! C2.IsNull())
     TP->BindTransient (C1,C2);
   return C2;
@@ -178,9 +179,10 @@ StepToTopoDS_TranslateEdge::StepToTopoDS_TranslateEdge()
 
 StepToTopoDS_TranslateEdge::StepToTopoDS_TranslateEdge(const Handle(StepShape_Edge)& E, 
                                                        StepToTopoDS_Tool& T, 
-                                                       StepToTopoDS_NMTool& NMTool)
+                                                       StepToTopoDS_NMTool& NMTool,
+                                                       const StepData_Factors& theLocalFactors)
 {
-  Init(E, T, NMTool);
+  Init(E, T, NMTool, theLocalFactors);
 }
 
 // ============================================================================
@@ -192,7 +194,8 @@ StepToTopoDS_TranslateEdge::StepToTopoDS_TranslateEdge(const Handle(StepShape_Ed
 
 void StepToTopoDS_TranslateEdge::Init(const Handle(StepShape_Edge)& aEdge, 
                                       StepToTopoDS_Tool& aTool,
-                                      StepToTopoDS_NMTool& NMTool)
+                                      StepToTopoDS_NMTool& NMTool,
+                                      const StepData_Factors& theLocalFactors)
 {
   Handle(Transfer_TransientProcess) TP = aTool.TransientProcess();
 
@@ -277,8 +280,8 @@ void StepToTopoDS_TranslateEdge::Init(const Handle(StepShape_Edge)& aEdge,
 
   TopoDS_Vertex V1, V2;
 
-  StepToTopoDS_TranslateVertex myTranVertex1(Vstart, aTool, NMTool);
-  StepToTopoDS_TranslateVertex myTranVertex2(Vend, aTool, NMTool);
+  StepToTopoDS_TranslateVertex myTranVertex1(Vstart, aTool, NMTool, theLocalFactors);
+  StepToTopoDS_TranslateVertex myTranVertex2(Vend, aTool, NMTool, theLocalFactors);
 
   if (myTranVertex1.IsDone()) {
     V1 = TopoDS::Vertex(myTranVertex1.Value());
@@ -315,11 +318,11 @@ void StepToTopoDS_TranslateEdge::Init(const Handle(StepShape_Edge)& aEdge,
     Handle(StepGeom_SurfaceCurve) Sc =
       Handle(StepGeom_SurfaceCurve)::DownCast(C);
     Handle(StepGeom_Curve) C1 = Sc->Curve3d();
-      MakeFromCurve3D (C1,EC,Vend,Precision(), E,V1,V2 , aTool);
+      MakeFromCurve3D (C1,EC,Vend,Precision(), E,V1,V2 , aTool, theLocalFactors);
   }
   else {
     // --- The Edge Geometry is a Single 3d Curve ---
-    MakeFromCurve3D (C,EC,Vend,Precision(), E,V1,V2 , aTool);
+    MakeFromCurve3D (C,EC,Vend,Precision(), E,V1,V2 , aTool, theLocalFactors);
   }
   // Force set flags SameRange and SameParameter to Standard_False
   if (done) {
@@ -348,14 +351,14 @@ void StepToTopoDS_TranslateEdge::Init(const Handle(StepShape_Edge)& aEdge,
 // auxiliary function
 //:e6 abv 16 Apr 98: ProSTEP TR8, r0601_sy.stp, #14907
 static void GetCartesianPoints ( const Handle(StepShape_EdgeCurve)& EC, 
-                                gp_Pnt &P1, gp_Pnt &P2)
+                                gp_Pnt &P1, gp_Pnt &P2, const StepData_Factors& theLocalFactors)
 {
   for ( Standard_Integer i=1; i<=2; i++ ) {
     const Handle(StepShape_Vertex) V = ((i == 1) == EC->SameSense() ? EC->EdgeStart() : EC->EdgeEnd() );
     const Handle(StepShape_VertexPoint) VP = Handle(StepShape_VertexPoint)::DownCast(V);
     if ( VP.IsNull() ) continue;
     const Handle(StepGeom_CartesianPoint) P = Handle(StepGeom_CartesianPoint)::DownCast(VP->VertexGeometry());
-    Handle(Geom_CartesianPoint) CP = StepToGeom::MakeCartesianPoint (P);
+    Handle(Geom_CartesianPoint) CP = StepToGeom::MakeCartesianPoint (P, theLocalFactors);
     ( i==1 ? P1 : P2 ) = CP->Pnt();
   }
 }
@@ -370,10 +373,11 @@ void  StepToTopoDS_TranslateEdge::MakeFromCurve3D
    const Handle(StepShape_Vertex)&  Vend,
    const Standard_Real preci, TopoDS_Edge& E,
    TopoDS_Vertex& V1, TopoDS_Vertex& V2,
-   StepToTopoDS_Tool&   aTool)
+   StepToTopoDS_Tool&   aTool,
+   const StepData_Factors& theLocalFactors)
 {
   Handle(Transfer_TransientProcess) TP = aTool.TransientProcess();
-  Handle(Geom_Curve) C1 = MakeCurve(C3D,TP);
+  Handle(Geom_Curve) C1 = MakeCurve(C3D,TP, theLocalFactors);
   if (C1.IsNull()) {
     TP->AddFail(C3D," Make Geom_Curve (3D) failed");
     myError = StepToTopoDS_TranslateEdgeOther;
@@ -390,7 +394,7 @@ void  StepToTopoDS_TranslateEdge::MakeFromCurve3D
 
   //:e6 abv
   gp_Pnt pnt1 = pv1, pnt2 = pv2;
-  if ( V1.IsSame ( V2 ) ) GetCartesianPoints ( EC, pnt1, pnt2 );
+  if ( V1.IsSame ( V2 ) ) GetCartesianPoints ( EC, pnt1, pnt2, theLocalFactors);
   ShapeAnalysis_Curve sac;
   temp1 = sac.Project (C1,pnt1,preci,pproj,U1,Standard_False);
   temp2 = sac.Project (C1,pnt2,preci,pproj,U2,Standard_False);
@@ -474,7 +478,8 @@ void  StepToTopoDS_TranslateEdge::MakeFromCurve3D
 // Purpose : Computes an individual pcurve (i.e. curve 2d)
 // ============================================================================
 Handle(Geom2d_Curve)  StepToTopoDS_TranslateEdge::MakePCurve
-  (const Handle(StepGeom_Pcurve)& PCU, const Handle(Geom_Surface)& ConvSurf) const
+  (const Handle(StepGeom_Pcurve)& PCU, const Handle(Geom_Surface)& ConvSurf,
+   const StepData_Factors& theLocalFactors) const
 {
   Handle(Geom2d_Curve) C2d;
   const Handle(StepRepr_DefinitionalRepresentation) DRI = PCU->ReferenceToCurve();
@@ -482,12 +487,12 @@ Handle(Geom2d_Curve)  StepToTopoDS_TranslateEdge::MakePCurve
   const Handle(StepGeom_Curve) StepCurve = Handle(StepGeom_Curve)::DownCast(DRI->ItemsValue(1));
   try
   {
-    C2d = StepToGeom::MakeCurve2d (StepCurve);
+    C2d = StepToGeom::MakeCurve2d (StepCurve, theLocalFactors);
     if (! C2d.IsNull()) {
     // -- if the surface is a RectangularTrimmedSurface, 
     // -- send the BasisSurface.
      C2d = GeomConvert_Units::DegreeToRadian(C2d, ConvSurf,
-       StepData_GlobalFactors::Intance().LengthFactor(), StepData_GlobalFactors::Intance().FactorDegreeRadian());
+       theLocalFactors.LengthFactor(), theLocalFactors.FactorDegreeRadian());
     }
     
   }
index fc2c2ace63f6e23c8a815426c27ba0c2b8642951..108e255e4615a9a51111e20f042963dca6517b37 100644 (file)
@@ -24,6 +24,7 @@
 #include <StepToTopoDS_TranslateEdgeError.hxx>
 #include <TopoDS_Shape.hxx>
 #include <StepToTopoDS_Root.hxx>
+class StepData_Factors;
 class StepShape_Edge;
 class StepToTopoDS_Tool;
 class StepToTopoDS_NMTool;
@@ -47,15 +48,31 @@ public:
   
   Standard_EXPORT StepToTopoDS_TranslateEdge();
   
-  Standard_EXPORT StepToTopoDS_TranslateEdge(const Handle(StepShape_Edge)& E, StepToTopoDS_Tool& T, StepToTopoDS_NMTool& NMTool);
+  Standard_EXPORT StepToTopoDS_TranslateEdge(const Handle(StepShape_Edge)& E,
+                                             StepToTopoDS_Tool& T,
+                                             StepToTopoDS_NMTool& NMTool,
+                                             const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT void Init (const Handle(StepShape_Edge)& E, StepToTopoDS_Tool& T, StepToTopoDS_NMTool& NMTool);
+  Standard_EXPORT void Init (const Handle(StepShape_Edge)& E,
+                             StepToTopoDS_Tool& T,
+                             StepToTopoDS_NMTool& NMTool,
+                             const StepData_Factors& theLocalFactors);
   
   //! Warning! C3D is assumed to be a Curve 3D ...
   //! other cases to checked before calling this
-  Standard_EXPORT void MakeFromCurve3D (const Handle(StepGeom_Curve)& C3D, const Handle(StepShape_EdgeCurve)& EC, const Handle(StepShape_Vertex)& Vend, const Standard_Real preci, TopoDS_Edge& E, TopoDS_Vertex& V1, TopoDS_Vertex& V2, StepToTopoDS_Tool& T);
+  Standard_EXPORT void MakeFromCurve3D (const Handle(StepGeom_Curve)& C3D,
+                                        const Handle(StepShape_EdgeCurve)& EC,
+                                        const Handle(StepShape_Vertex)& Vend,
+                                        const Standard_Real preci,
+                                        TopoDS_Edge& E,
+                                        TopoDS_Vertex& V1,
+                                        TopoDS_Vertex& V2,
+                                        StepToTopoDS_Tool& T,
+                                        const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT Handle(Geom2d_Curve) MakePCurve (const Handle(StepGeom_Pcurve)& PCU, const Handle(Geom_Surface)& ConvSurf) const;
+  Standard_EXPORT Handle(Geom2d_Curve) MakePCurve (const Handle(StepGeom_Pcurve)& PCU,
+                                                   const Handle(Geom_Surface)& ConvSurf,
+                                                   const StepData_Factors& theLocalFactors) const;
   
   Standard_EXPORT const TopoDS_Shape& Value() const;
   
index 156197a60543ae68cef59a8e310be54de0dd530c..66c12dc8954d6a82c139941d17581bae7c85ed3c 100644 (file)
@@ -43,6 +43,7 @@
 #include <ShapeExtend_WireData.hxx>
 #include <ShapeFix_EdgeProjAux.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_Pcurve.hxx>
 #include <StepGeom_Surface.hxx>
 #include <StepGeom_SurfaceCurve.hxx>
@@ -188,8 +189,9 @@ StepToTopoDS_TranslateEdgeLoop::StepToTopoDS_TranslateEdgeLoop(const Handle(Step
   const Handle(StepGeom_Surface)& StepSurf,
   const Standard_Boolean sameSense,
   StepToTopoDS_Tool& T,
-  StepToTopoDS_NMTool& NMTool) {
-  Init(FB, Face, GeomSurf, StepSurf, sameSense, T, NMTool);
+  StepToTopoDS_NMTool& NMTool,
+  const StepData_Factors& theLocalFactors) {
+  Init(FB, Face, GeomSurf, StepSurf, sameSense, T, NMTool, theLocalFactors);
 }
 
 // ============================================================================
@@ -203,7 +205,8 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
   const Handle(StepGeom_Surface)& StepSurf,
   const Standard_Boolean sameSense,
   StepToTopoDS_Tool& aTool,
-  StepToTopoDS_NMTool& NMTool) {
+  StepToTopoDS_NMTool& NMTool,
+  const StepData_Factors& theLocalFactors) {
   done = Standard_True;
   Handle(StepShape_EdgeLoop) EL =
     Handle(StepShape_EdgeLoop)::DownCast(FaceBound->Bound());
@@ -304,7 +307,7 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
         OCC_CATCH_SIGNALS
           C1 = Handle(Geom_Curve)::DownCast (TP->FindTransient(C));
         if (C1.IsNull()) {
-          C1 = StepToGeom::MakeCurve (C);
+          C1 = StepToGeom::MakeCurve (C, theLocalFactors);
           if (! C1.IsNull())
             TP->BindTransient (C, C1);
           else
@@ -334,8 +337,8 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
     Standard_Boolean istV = aTool.IsBound(Vstart);
     Standard_Boolean iseV = aTool.IsBound(Vend);
     TopoDS_Vertex V1, V2;
-    StepToTopoDS_TranslateVertex myTranVertex1(Vstart, aTool, NMTool);
-    StepToTopoDS_TranslateVertex myTranVertex2(Vend, aTool, NMTool);
+    StepToTopoDS_TranslateVertex myTranVertex1(Vstart, aTool, NMTool, theLocalFactors);
+    StepToTopoDS_TranslateVertex myTranVertex2(Vend, aTool, NMTool, theLocalFactors);
 
     if (myTranVertex1.IsDone()) {
       V1 = TopoDS::Vertex(myTranVertex1.Value());
@@ -385,8 +388,8 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
 
     if ((Vs1 == Vs2) || (Vs1 == Vs22) || (Vs2 == Vs11) || (Vs22 == Vs11)) continue;
 
-    StepToTopoDS_TranslateVertex myTranVertex1 (Vs1, aTool, NMTool);
-    StepToTopoDS_TranslateVertex myTranVertex2 (Vs2, aTool, NMTool);
+    StepToTopoDS_TranslateVertex myTranVertex1 (Vs1, aTool, NMTool, theLocalFactors);
+    StepToTopoDS_TranslateVertex myTranVertex2 (Vs2, aTool, NMTool, theLocalFactors);
 
     TopoDS_Vertex V1, V2;
     if (myTranVertex1.IsDone())
@@ -443,7 +446,7 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
 
     myTranEdge.SetPrecision(preci);
     myTranEdge.SetMaxTol(MaxTol());
-    myTranEdge.Init(OrEdge1, aTool, NMTool);
+    myTranEdge.Init(OrEdge1, aTool, NMTool, theLocalFactors);
 
     if (myTranEdge.IsDone()) {
 
@@ -474,7 +477,7 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
       }
       else if (C->IsKind(STANDARD_TYPE(StepGeom_Pcurve))) {
         Handle(StepGeom_Pcurve) StepPCurve = Handle(StepGeom_Pcurve)::DownCast(C);
-        C2d = myTranEdge.MakePCurve(StepPCurve, ConvSurf);
+        C2d = myTranEdge.MakePCurve(StepPCurve, ConvSurf, theLocalFactors);
         // -- Statistics --
         aTool.AddContinuity(C2d);
       }
@@ -520,8 +523,8 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
           StepPCurve2 = SurfCurve->AssociatedGeometryValue(2).Pcurve();
           if (StepPCurve1.IsNull() || StepPCurve2.IsNull()) hasPcurve = Standard_False; //smh : BUC60810
           else {
-            C2d1 = myTranEdge.MakePCurve(StepPCurve1, ConvSurf);
-            C2d2 = myTranEdge.MakePCurve(StepPCurve2, ConvSurf);
+            C2d1 = myTranEdge.MakePCurve(StepPCurve1, ConvSurf, theLocalFactors);
+            C2d2 = myTranEdge.MakePCurve(StepPCurve2, ConvSurf, theLocalFactors);
             hasPcurve = (!C2d1.IsNull() && !C2d2.IsNull());
           }
 
@@ -534,7 +537,7 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
         else if (hasPcurve) {
           //  GeometricTool : Pcurve a retourne StepPCurve
           while (lastpcurve > 0) {
-            C2d1 = myTranEdge.MakePCurve(StepPCurve, ConvSurf);
+            C2d1 = myTranEdge.MakePCurve(StepPCurve, ConvSurf, theLocalFactors);
             if (C2d1.IsNull()) {
               TP->AddWarning(EC, "Incorrect pcurve is not translated. Pcurve definition is not correct");
               hasPcurve = Standard_False;
index bcf0891b678f88f12c6cdb3186b9667970262c42..d20769cede920359ea8d4b018603a30f9bc86f25 100644 (file)
@@ -42,9 +42,23 @@ public:
   
   Standard_EXPORT StepToTopoDS_TranslateEdgeLoop();
   
-  Standard_EXPORT StepToTopoDS_TranslateEdgeLoop(const Handle(StepShape_FaceBound)& FB, const TopoDS_Face& F, const Handle(Geom_Surface)& S, const Handle(StepGeom_Surface)& SS, const Standard_Boolean ss, StepToTopoDS_Tool& T, StepToTopoDS_NMTool& NMTool);
+  Standard_EXPORT StepToTopoDS_TranslateEdgeLoop(const Handle(StepShape_FaceBound)& FB,
+                                                 const TopoDS_Face& F,
+                                                 const Handle(Geom_Surface)& S,
+                                                 const Handle(StepGeom_Surface)& SS,
+                                                 const Standard_Boolean ss,
+                                                 StepToTopoDS_Tool& T,
+                                                 StepToTopoDS_NMTool& NMTool,
+                                                 const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT void Init (const Handle(StepShape_FaceBound)& FB, const TopoDS_Face& F, const Handle(Geom_Surface)& S, const Handle(StepGeom_Surface)& SS, const Standard_Boolean ss, StepToTopoDS_Tool& T, StepToTopoDS_NMTool& NMTool);
+  Standard_EXPORT void Init (const Handle(StepShape_FaceBound)& FB,
+                             const TopoDS_Face& F,
+                             const Handle(Geom_Surface)& S,
+                             const Handle(StepGeom_Surface)& SS,
+                             const Standard_Boolean ss,
+                             StepToTopoDS_Tool& T,
+                             StepToTopoDS_NMTool& NMTool,
+                             const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const TopoDS_Shape& Value() const;
   
index 209eb69338f4201e1173ec40078df31256015b0d..deb798e4277b6cac4fda7640fa0948cda5533413 100644 (file)
@@ -46,7 +46,7 @@
 #include <ShapeAlgo.hxx>
 #include <ShapeAlgo_AlgoContainer.hxx>
 #include <StdFail_NotDone.hxx>
-#include <StepData_GlobalFactors.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_BSplineSurface.hxx>
 #include <StepGeom_BSplineSurfaceForm.hxx>
 #include <StepGeom_OffsetSurface.hxx>
@@ -110,10 +110,12 @@ StepToTopoDS_TranslateFace::StepToTopoDS_TranslateFace()
 // Purpose : Constructor with a FaceSurface and a Tool
 // ============================================================================
 
-StepToTopoDS_TranslateFace::StepToTopoDS_TranslateFace
-(const Handle(StepShape_FaceSurface)& FS, StepToTopoDS_Tool& T, StepToTopoDS_NMTool& NMTool)
+StepToTopoDS_TranslateFace::StepToTopoDS_TranslateFace(const Handle(StepShape_FaceSurface)& FS,
+                                                       StepToTopoDS_Tool& T,
+                                                       StepToTopoDS_NMTool& NMTool,
+                                                       const StepData_Factors& theLocalFactors)
 {
-  Init(FS, T, NMTool);
+  Init(FS, T, NMTool, theLocalFactors);
 }
 
 // ============================================================================
@@ -126,9 +128,10 @@ StepToTopoDS_TranslateFace::StepToTopoDS_TranslateFace(const Handle(StepVisual_T
                                                        StepToTopoDS_Tool& theTool,
                                                        StepToTopoDS_NMTool& theNMTool,
                                                        const Standard_Boolean theReadTessellatedWhenNoBRepOnly,
-                                                       Standard_Boolean& theHasGeom)
+                                                       Standard_Boolean& theHasGeom,
+                                                       const StepData_Factors& theLocalFactors)
 {
-  Init(theTF, theTool, theNMTool, theReadTessellatedWhenNoBRepOnly, theHasGeom);
+  Init(theTF, theTool, theNMTool, theReadTessellatedWhenNoBRepOnly, theHasGeom, theLocalFactors);
 }
 
 // ============================================================================
@@ -153,8 +156,10 @@ static inline Standard_Boolean isReversed(const Handle(StepGeom_Surface)& theSte
 // Purpose : Init with a FaceSurface and a Tool
 // ============================================================================
 
-void StepToTopoDS_TranslateFace::Init
-(const Handle(StepShape_FaceSurface)& FS, StepToTopoDS_Tool& aTool, StepToTopoDS_NMTool& NMTool)
+void StepToTopoDS_TranslateFace::Init(const Handle(StepShape_FaceSurface)& FS,
+                                      StepToTopoDS_Tool& aTool,
+                                      StepToTopoDS_NMTool& NMTool,
+                                      const StepData_Factors& theLocalFactors)
 {
   done = Standard_True;
   if (aTool.IsBound(FS)) {
@@ -194,7 +199,7 @@ void StepToTopoDS_TranslateFace::Init
 
   if (StepSurf->IsKind(STANDARD_TYPE(StepGeom_OffsetSurface))) //:d4 abv 12 Mar 98
     TP->AddWarning(StepSurf," Type OffsetSurface is out of scope of AP 214");
-  Handle(Geom_Surface) GeomSurf = StepToGeom::MakeSurface (StepSurf);
+  Handle(Geom_Surface) GeomSurf = StepToGeom::MakeSurface (StepSurf, theLocalFactors);
   if (GeomSurf.IsNull())
   {
     TP->AddFail(StepSurf," Surface has not been created");
@@ -296,7 +301,7 @@ void StepToTopoDS_TranslateFace::Init
     }
     myTranVL.SetPrecision(Precision());//gka
     myTranVL.SetMaxTol(MaxTol());
-    myTranVL.Init(VL, aTool, NMTool);
+    myTranVL.Init(VL, aTool, NMTool, theLocalFactors);
     if (myTranVL.IsDone()) {
       B.Add(F, myTranVL.Value());
     }
@@ -315,7 +320,7 @@ void StepToTopoDS_TranslateFace::Init
       F.Orientation ( FS->SameSense() ? TopAbs_FORWARD : TopAbs_REVERSED);
       myTranPL.SetPrecision(Precision()); //gka
       myTranPL.SetMaxTol(MaxTol());
-      myTranPL.Init(PL, aTool, GeomSurf, F);
+      myTranPL.Init(PL, aTool, GeomSurf, F, theLocalFactors);
       if (myTranPL.IsDone()) {
         TopoDS_Wire W = TopoDS::Wire(myTranPL.Value());
         W.Orientation(FaceBound->Orientation() ? TopAbs_FORWARD : TopAbs_REVERSED);
@@ -340,7 +345,7 @@ void StepToTopoDS_TranslateFace::Init
     TopoDS_Wire   W;
     myTranEdgeLoop.SetPrecision(Precision());  //gka
     myTranEdgeLoop.SetMaxTol(MaxTol());
-    myTranEdgeLoop.Init(FaceBound, F, GeomSurf, StepSurf, sameSense, aTool, NMTool);
+    myTranEdgeLoop.Init(FaceBound, F, GeomSurf, StepSurf, sameSense, aTool, NMTool, theLocalFactors);
 
     if (myTranEdgeLoop.IsDone()) {
       W = TopoDS::Wire(myTranEdgeLoop.Value());
@@ -411,7 +416,8 @@ void StepToTopoDS_TranslateFace::Init(const Handle(StepVisual_TessellatedFace)&
                                       StepToTopoDS_Tool& theTool,
                                       StepToTopoDS_NMTool& theNMTool,
                                       const Standard_Boolean theReadTessellatedWhenNoBRepOnly,
-                                      Standard_Boolean& theHasGeom)
+                                      Standard_Boolean& theHasGeom,
+                                      const StepData_Factors& theLocalFactors)
 {
   if (theTF.IsNull())
     return;
@@ -446,11 +452,11 @@ void StepToTopoDS_TranslateFace::Init(const Handle(StepVisual_TessellatedFace)&
   Handle(Poly_Triangulation) aMesh;
   if (DeclareAndCast(StepVisual_TriangulatedFace, aTriaF, theTF))
   {
-    aMesh = createMesh(aTriaF);
+    aMesh = createMesh(aTriaF, theLocalFactors);
   }
   else if (DeclareAndCast(StepVisual_ComplexTriangulatedFace, aCompTriaF, theTF))
   {
-    aMesh = createMesh(aCompTriaF);
+    aMesh = createMesh(aCompTriaF, theLocalFactors);
   }
   else
   {
@@ -480,7 +486,8 @@ void StepToTopoDS_TranslateFace::Init(const Handle(StepVisual_TessellatedFace)&
 // ============================================================================
 
 Handle(Poly_Triangulation) 
-StepToTopoDS_TranslateFace::createMesh(const Handle(StepVisual_TriangulatedFace)& theTF) const
+StepToTopoDS_TranslateFace::createMesh(const Handle(StepVisual_TriangulatedFace)& theTF,
+                                       const StepData_Factors& theLocalFactors) const
 {
   Handle(StepVisual_CoordinatesList) aCoords = theTF->Coordinates();
   Handle(TColgp_HArray1OfXYZ) aNodes = aCoords->Points();
@@ -489,7 +496,7 @@ StepToTopoDS_TranslateFace::createMesh(const Handle(StepVisual_TriangulatedFace)
   const Standard_Boolean aHasNormals = (theTF->NbNormals() > 0);
   Handle(Poly_Triangulation) aMesh = new Poly_Triangulation(theTF->NbPnindex(), theTF->NbTriangles(), aHasUVNodes, aHasNormals);
 
-  const Standard_Real aLF = StepData_GlobalFactors::Intance().LengthFactor();
+  const Standard_Real aLF = theLocalFactors.LengthFactor();
   for (Standard_Integer j = 1; j <= theTF->NbPnindex(); ++j)
   {
     const gp_XYZ& aPoint = aNodes->Value(theTF->PnindexValue(j));
@@ -536,7 +543,8 @@ StepToTopoDS_TranslateFace::createMesh(const Handle(StepVisual_TriangulatedFace)
 // ============================================================================
 
 Handle(Poly_Triangulation) 
-StepToTopoDS_TranslateFace::createMesh(const Handle(StepVisual_ComplexTriangulatedFace)& theTF) const
+StepToTopoDS_TranslateFace::createMesh(const Handle(StepVisual_ComplexTriangulatedFace)& theTF,
+                                       const StepData_Factors& theLocalFactors) const
 {
   Handle(StepVisual_CoordinatesList) aCoords = theTF->Coordinates();
   Handle(TColgp_HArray1OfXYZ) aNodes = aCoords->Points();
@@ -576,7 +584,7 @@ StepToTopoDS_TranslateFace::createMesh(const Handle(StepVisual_ComplexTriangulat
   Handle(Poly_Triangulation) aMesh = new Poly_Triangulation(theTF->NbPnindex(), 
     aNbTriaStrips + aNbTriaFans, aHasUVNodes, aHasNormals);
 
-  const Standard_Real aLF = StepData_GlobalFactors::Intance().LengthFactor();
+  const Standard_Real aLF = theLocalFactors.LengthFactor();
   for (Standard_Integer j = 1; j <= theTF->NbPnindex(); ++j)
   {
     const gp_XYZ& aPoint = aNodes->Value(theTF->PnindexValue(j));
index 2f85e417bd0d872c9bd2018421f043b8885cb343..1fc01453c283e994081a815f84c1ecc62a57ff3e 100644 (file)
@@ -25,6 +25,7 @@
 #include <TopoDS_Shape.hxx>
 #include <StepToTopoDS_Root.hxx>
 class Poly_Triangulation;
+class StepData_Factors;
 class StepShape_FaceSurface;
 class StepToTopoDS_Tool;
 class StepToTopoDS_NMTool;
@@ -42,21 +43,29 @@ public:
   
   Standard_EXPORT StepToTopoDS_TranslateFace();
   
-  Standard_EXPORT StepToTopoDS_TranslateFace(const Handle(StepShape_FaceSurface)& FS, StepToTopoDS_Tool& T, StepToTopoDS_NMTool& NMTool);
+  Standard_EXPORT StepToTopoDS_TranslateFace(const Handle(StepShape_FaceSurface)& FS,
+                                             StepToTopoDS_Tool& T,
+                                             StepToTopoDS_NMTool& NMTool,
+                                             const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT StepToTopoDS_TranslateFace(const Handle(StepVisual_TessellatedFace)& theTF, 
                                              StepToTopoDS_Tool& theTool,
                                              StepToTopoDS_NMTool& theNMTool,
                                              const Standard_Boolean theReadTessellatedWhenNoBRepOnly,
-                                             Standard_Boolean& theHasGeom);
+                                             Standard_Boolean& theHasGeom,
+                                             const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT void Init (const Handle(StepShape_FaceSurface)& FS, StepToTopoDS_Tool& T, StepToTopoDS_NMTool& NMTool);
+  Standard_EXPORT void Init (const Handle(StepShape_FaceSurface)& FS,
+                             StepToTopoDS_Tool& T,
+                             StepToTopoDS_NMTool& NMTool,
+                             const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT void Init (const Handle(StepVisual_TessellatedFace)& theTF,
                              StepToTopoDS_Tool& theTool,
                              StepToTopoDS_NMTool& theNMTool,
                              const Standard_Boolean theReadTessellatedWhenNoBRepOnly,
-                             Standard_Boolean& theHasGeom);
+                             Standard_Boolean& theHasGeom,
+                             const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const TopoDS_Shape& Value() const;
   
@@ -73,8 +82,10 @@ protected:
 
 private:
 
-  Handle(Poly_Triangulation) createMesh(const Handle(StepVisual_TriangulatedFace)& theTF) const;
-  Handle(Poly_Triangulation) createMesh(const Handle(StepVisual_ComplexTriangulatedFace)& theTF) const;
+  Handle(Poly_Triangulation) createMesh(const Handle(StepVisual_TriangulatedFace)& theTF,
+                                        const StepData_Factors& theLocalFactors) const;
+  Handle(Poly_Triangulation) createMesh(const Handle(StepVisual_ComplexTriangulatedFace)& theTF,
+                                        const StepData_Factors& theLocalFactors) const;
 
 
   StepToTopoDS_TranslateFaceError myError;
index 2db5e71008e18bb4fb3ce057e5a84772d8ed90d5..cbff8bcc25e62ed4dcc0d9cd81bfbd99fa434ea5 100644 (file)
@@ -27,6 +27,7 @@
 #include <Precision.hxx>
 #include <ShapeAnalysis_Surface.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepShape_PolyLoop.hxx>
 #include <StepToGeom.hxx>
 #include <StepToTopoDS_Tool.hxx>
@@ -55,9 +56,13 @@ StepToTopoDS_TranslatePolyLoop::StepToTopoDS_TranslatePolyLoop()
 // Purpose :
 // ============================================================================
 
-StepToTopoDS_TranslatePolyLoop::StepToTopoDS_TranslatePolyLoop(const Handle(StepShape_PolyLoop)& PL, StepToTopoDS_Tool& T, const Handle(Geom_Surface)& S, const TopoDS_Face& F)
+StepToTopoDS_TranslatePolyLoop::StepToTopoDS_TranslatePolyLoop(const Handle(StepShape_PolyLoop)& PL,
+                                                               StepToTopoDS_Tool& T,
+                                                               const Handle(Geom_Surface)& S,
+                                                               const TopoDS_Face& F,
+                                                               const StepData_Factors& theLocalFactors)
 {
-  Init (PL, T, S, F);
+  Init (PL, T, S, F, theLocalFactors);
 }
 
 // ============================================================================
@@ -65,7 +70,11 @@ StepToTopoDS_TranslatePolyLoop::StepToTopoDS_TranslatePolyLoop(const Handle(Step
 // Purpose :
 // ============================================================================
 
-void StepToTopoDS_TranslatePolyLoop::Init(const Handle(StepShape_PolyLoop)& PL, StepToTopoDS_Tool& aTool, const Handle(Geom_Surface)& GeomSurf, const TopoDS_Face& TopoFace)
+void StepToTopoDS_TranslatePolyLoop::Init(const Handle(StepShape_PolyLoop)& PL,
+                                          StepToTopoDS_Tool& aTool,
+                                          const Handle(Geom_Surface)& GeomSurf,
+                                          const TopoDS_Face& TopoFace,
+                                          const StepData_Factors& theLocalFactors)
 {
   if (!aTool.IsBound(PL)) {
     BRep_Builder B;
@@ -96,7 +105,7 @@ void StepToTopoDS_TranslatePolyLoop::Init(const Handle(StepShape_PolyLoop)& PL,
     Nb++;
     Poly->SetValue(Nb, PL->PolygonValue(1));
     P1 = Poly->Value(1);
-    GP1 = StepToGeom::MakeCartesianPoint (P1);
+    GP1 = StepToGeom::MakeCartesianPoint (P1, theLocalFactors);
     if (aTool.IsVertexBound(P1)) {
       V1 = aTool.FindVertex(P1);
     }
@@ -109,7 +118,7 @@ void StepToTopoDS_TranslatePolyLoop::Init(const Handle(StepShape_PolyLoop)& PL,
       P2 = Poly->Value(i);
       if (P1 == P2) continue;  // peut arriver (KK)  CKY 9-DEC-1997
       StepToTopoDS_PointPair PP(P1, P2); 
-      GP2 = StepToGeom::MakeCartesianPoint (P2);
+      GP2 = StepToGeom::MakeCartesianPoint (P2, theLocalFactors);
       TopoDS_Shape aBoundEdge;
       Standard_Boolean isbound = aTool.IsEdgeBound(PP);
       if (!isbound) {
index 779525c6ff5b92dd98e7585d0f49143f2382890b..4e02ad30ad2d744b21eebcf1f2df05afeb96655f 100644 (file)
@@ -24,6 +24,7 @@
 #include <StepToTopoDS_TranslatePolyLoopError.hxx>
 #include <TopoDS_Shape.hxx>
 #include <StepToTopoDS_Root.hxx>
+class StepData_Factors;
 class StepShape_PolyLoop;
 class StepToTopoDS_Tool;
 class Geom_Surface;
@@ -40,9 +41,17 @@ public:
   
   Standard_EXPORT StepToTopoDS_TranslatePolyLoop();
   
-  Standard_EXPORT StepToTopoDS_TranslatePolyLoop(const Handle(StepShape_PolyLoop)& PL, StepToTopoDS_Tool& T, const Handle(Geom_Surface)& S, const TopoDS_Face& F);
+  Standard_EXPORT StepToTopoDS_TranslatePolyLoop(const Handle(StepShape_PolyLoop)& PL,
+                                                 StepToTopoDS_Tool& T,
+                                                 const Handle(Geom_Surface)& S,
+                                                 const TopoDS_Face& F,
+                                                 const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT void Init (const Handle(StepShape_PolyLoop)& PL, StepToTopoDS_Tool& T, const Handle(Geom_Surface)& S, const TopoDS_Face& F);
+  Standard_EXPORT void Init (const Handle(StepShape_PolyLoop)& PL,
+                             StepToTopoDS_Tool& T,
+                             const Handle(Geom_Surface)& S,
+                             const TopoDS_Face& F,
+                             const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const TopoDS_Shape& Value() const;
   
index 95da76d86a477a98e6b50dce9e2afe6228170cb3..2f94f536d3a3f685550707f79756ec6e8844e8b9 100644 (file)
@@ -19,6 +19,7 @@
 #include <BRep_Builder.hxx>
 #include <Message_ProgressScope.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepShape_ConnectedFaceSet.hxx>
 #include <StepShape_FaceSurface.hxx>
 #include <StepToTopoDS_NMTool.hxx>
@@ -53,6 +54,7 @@ void StepToTopoDS_TranslateShell::Init
 (const Handle(StepShape_ConnectedFaceSet)& CFS,
  StepToTopoDS_Tool& aTool,
  StepToTopoDS_NMTool& NMTool,
+ const StepData_Factors& theLocalFactors,
  const Message_ProgressRange& theProgress)
 {
   //bug15697
@@ -84,7 +86,7 @@ void StepToTopoDS_TranslateShell::Init
       Handle(StepShape_FaceSurface) theFS =
         Handle(StepShape_FaceSurface)::DownCast(StepFace);
       if (!theFS.IsNull()) {
-        myTranFace.Init(theFS, aTool, NMTool);
+        myTranFace.Init(theFS, aTool, NMTool, theLocalFactors);
         if (myTranFace.IsDone()) {
           S = myTranFace.Value();
           F = TopoDS::Face(S);
@@ -121,6 +123,7 @@ void StepToTopoDS_TranslateShell::Init(const Handle(StepVisual_TessellatedShell)
                                        StepToTopoDS_NMTool& theNMTool,
                                        const Standard_Boolean theReadTessellatedWhenNoBRepOnly,
                                        Standard_Boolean& theHasGeom,
+                                       const StepData_Factors& theLocalFactors,
                                        const Message_ProgressRange& theProgress)
 {
   if (theTSh.IsNull())
@@ -167,7 +170,7 @@ void StepToTopoDS_TranslateShell::Init(const Handle(StepVisual_TessellatedShell)
     {
       Handle(StepVisual_TessellatedFace) aTFace = Handle(StepVisual_TessellatedFace)::DownCast(anItem);
       Standard_Boolean aHasFaceGeom = Standard_False;
-      aTranTF.Init(aTFace, theTool, theNMTool, theReadTessellatedWhenNoBRepOnly, aHasFaceGeom);
+      aTranTF.Init(aTFace, theTool, theNMTool, theReadTessellatedWhenNoBRepOnly, aHasFaceGeom, theLocalFactors);
       if (aTranTF.IsDone()) 
       {
         if (aNewShell) 
index 53079fa18c91d423588c9d04d41be6cb5d7dcd29..f77232b6a169928ed81f590db6322237bbfbb682 100644 (file)
@@ -44,6 +44,7 @@ public:
   Standard_EXPORT void Init (const Handle(StepShape_ConnectedFaceSet)& CFS,
                              StepToTopoDS_Tool& T,
                              StepToTopoDS_NMTool& NMTool,
+                             const StepData_Factors& theLocalFactors,
                              const Message_ProgressRange& theProgress = Message_ProgressRange());
   
   Standard_EXPORT void Init (const Handle(StepVisual_TessellatedShell)& theTSh,
@@ -51,6 +52,7 @@ public:
                              StepToTopoDS_NMTool& theNMTool,
                              const Standard_Boolean theReadTessellatedWhenNoBRepOnly,
                              Standard_Boolean& theHasGeom,
+                             const StepData_Factors& theLocalFactors,
                              const Message_ProgressRange& theProgress = Message_ProgressRange());
   
   Standard_EXPORT const TopoDS_Shape& Value() const;
index 1007cc42e46b12b241ff0adefd265ca2659a7463..6686fb8408f9ae868a2638df307d7d3511334b3e 100644 (file)
@@ -14,6 +14,7 @@
 #include <BRep_Builder.hxx>
 #include <Message_ProgressScope.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepShape_ConnectedFaceSet.hxx>
 #include <StepShape_FaceSurface.hxx>
 #include <StepToTopoDS_NMTool.hxx>
@@ -50,6 +51,7 @@ void StepToTopoDS_TranslateSolid::Init(const Handle(StepVisual_TessellatedSolid)
                                        StepToTopoDS_NMTool& theNMTool,
                                        const Standard_Boolean theReadTessellatedWhenNoBRepOnly,
                                        Standard_Boolean& theHasGeom,
+                                       const StepData_Factors& theLocalFactors,
                                        const Message_ProgressRange& theProgress)
 {
   if (theTSo.IsNull())
@@ -95,7 +97,7 @@ void StepToTopoDS_TranslateSolid::Init(const Handle(StepVisual_TessellatedSolid)
     {
       Handle(StepVisual_TessellatedFace) aTFace = Handle(StepVisual_TessellatedFace)::DownCast(anItem);
       Standard_Boolean aHasFaceGeom = Standard_False;
-      aTranTF.Init(aTFace, theTool, theNMTool, theReadTessellatedWhenNoBRepOnly, aHasFaceGeom);
+      aTranTF.Init(aTFace, theTool, theNMTool, theReadTessellatedWhenNoBRepOnly, aHasFaceGeom, theLocalFactors);
       if (aTranTF.IsDone()) 
       {
         if (aNewSolid) 
index 9720d7ec4b4ff75d7c730a847aa75f81014b8e87..e4f648d475d571d4ae152f1e0f51cff28ecab8b5 100644 (file)
@@ -44,6 +44,7 @@ public:
                             StepToTopoDS_NMTool& theNMTool,
                             const Standard_Boolean theReadTessellatedWhenNoBRepOnly,
                             Standard_Boolean& theHasGeom,
+                            const StepData_Factors& theLocalFactors,
                             const Message_ProgressRange& theProgress = Message_ProgressRange());
 
   Standard_EXPORT const TopoDS_Shape& Value() const;
index 7d8a79aff3a4bd948f9e9b028229527085daefdc..b9ae793360f03f90c2f27645c3d48fede00de6e6 100644 (file)
@@ -20,6 +20,7 @@
 #include <Geom_CartesianPoint.hxx>
 #include <Precision.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepShape_VertexPoint.hxx>
 #include <StepToGeom.hxx>
 #include <StepToTopoDS_NMTool.hxx>
@@ -49,9 +50,10 @@ StepToTopoDS_TranslateVertex::StepToTopoDS_TranslateVertex()
 
 StepToTopoDS_TranslateVertex::StepToTopoDS_TranslateVertex(const Handle(StepShape_Vertex)& V, 
                                                            StepToTopoDS_Tool& T,
-                                                           StepToTopoDS_NMTool& NMTool)
+                                                           StepToTopoDS_NMTool& NMTool,
+                                                           const StepData_Factors& theLocalFactors)
 {
-  Init(V, T, NMTool);
+  Init(V, T, NMTool, theLocalFactors);
 }
 
 // ============================================================================
@@ -61,7 +63,8 @@ StepToTopoDS_TranslateVertex::StepToTopoDS_TranslateVertex(const Handle(StepShap
 
 void StepToTopoDS_TranslateVertex::Init(const Handle(StepShape_Vertex)& aVertex, 
                                                                StepToTopoDS_Tool& aTool,
-                                        StepToTopoDS_NMTool& NMTool)
+                                        StepToTopoDS_NMTool& NMTool,
+                                        const StepData_Factors& theLocalFactors)
 {
   if (aVertex.IsNull()) {
     myError = StepToTopoDS_TranslateVertexOther;
@@ -94,7 +97,7 @@ void StepToTopoDS_TranslateVertex::Init(const Handle(StepShape_Vertex)& aVertex,
     const Handle(StepShape_VertexPoint) VP = Handle(StepShape_VertexPoint)::DownCast(aVertex);
     const Handle(StepGeom_Point) P = VP->VertexGeometry();
     const Handle(StepGeom_CartesianPoint) P1 = Handle(StepGeom_CartesianPoint)::DownCast(P);
-    Handle(Geom_CartesianPoint) P2 = StepToGeom::MakeCartesianPoint (P1);
+    Handle(Geom_CartesianPoint) P2 = StepToGeom::MakeCartesianPoint (P1, theLocalFactors);
     BRep_Builder B;
     TopoDS_Vertex V;
     B.MakeVertex(V, P2->Pnt(), Precision::Confusion()); //:S4136: preci
index 46b16b625489a1f49aeb13a1a4f02c1dd8a3bfda..f14697c484e9492808a688861b7afcfad0621212 100644 (file)
@@ -24,6 +24,7 @@
 #include <StepToTopoDS_TranslateVertexError.hxx>
 #include <TopoDS_Shape.hxx>
 #include <StepToTopoDS_Root.hxx>
+class StepData_Factors;
 class StepShape_Vertex;
 class StepToTopoDS_Tool;
 class StepToTopoDS_NMTool;
@@ -39,9 +40,15 @@ public:
   
   Standard_EXPORT StepToTopoDS_TranslateVertex();
   
-  Standard_EXPORT StepToTopoDS_TranslateVertex(const Handle(StepShape_Vertex)& V, StepToTopoDS_Tool& T, StepToTopoDS_NMTool& NMTool);
+  Standard_EXPORT StepToTopoDS_TranslateVertex(const Handle(StepShape_Vertex)& V,
+                                               StepToTopoDS_Tool& T,
+                                               StepToTopoDS_NMTool& NMTool,
+                                               const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT void Init (const Handle(StepShape_Vertex)& V, StepToTopoDS_Tool& T, StepToTopoDS_NMTool& NMTool);
+  Standard_EXPORT void Init (const Handle(StepShape_Vertex)& V,
+                             StepToTopoDS_Tool& T,
+                             StepToTopoDS_NMTool& NMTool,
+                             const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const TopoDS_Shape& Value() const;
   
index d13eeea5d0a7fa1239dbb5421c8c954c4612ca6b..0a4a1f9a3d23c0b7129b349405d15a3d25ef036a 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <BRep_Builder.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepShape_Vertex.hxx>
 #include <StepShape_VertexLoop.hxx>
 #include <StepToTopoDS_NMTool.hxx>
@@ -48,9 +49,10 @@ StepToTopoDS_TranslateVertexLoop::StepToTopoDS_TranslateVertexLoop()
 
 StepToTopoDS_TranslateVertexLoop::StepToTopoDS_TranslateVertexLoop(const Handle(StepShape_VertexLoop)& VL, 
                                                                    StepToTopoDS_Tool& T,
-                                                                   StepToTopoDS_NMTool& NMTool)
+                                                                   StepToTopoDS_NMTool& NMTool,
+                                                                   const StepData_Factors& theLocalFactors)
 {
-  Init(VL, T, NMTool);
+  Init(VL, T, NMTool, theLocalFactors);
 }
 
 // ============================================================================
@@ -60,7 +62,8 @@ StepToTopoDS_TranslateVertexLoop::StepToTopoDS_TranslateVertexLoop(const Handle(
 
 void StepToTopoDS_TranslateVertexLoop::Init(const Handle(StepShape_VertexLoop)& VL,
                                             StepToTopoDS_Tool& aTool,
-                                            StepToTopoDS_NMTool& NMTool)
+                                            StepToTopoDS_NMTool& NMTool,
+                                            const StepData_Factors& theLocalFactors)
 {
   // A Vertex Loop shall be mapped onto a Vertex + Edge + Wire;
   if (!aTool.IsBound(VL)) {
@@ -73,7 +76,7 @@ void StepToTopoDS_TranslateVertexLoop::Init(const Handle(StepShape_VertexLoop)&
     TopoDS_Edge E;
     TopoDS_Wire W;
     Vtx = VL->LoopVertex();
-    StepToTopoDS_TranslateVertex myTranVtx(Vtx, aTool, NMTool);
+    StepToTopoDS_TranslateVertex myTranVtx(Vtx, aTool, NMTool, theLocalFactors);
     if (myTranVtx.IsDone()) {
       V1 = TopoDS::Vertex(myTranVtx.Value());
       V2 = TopoDS::Vertex(myTranVtx.Value());
index d630c33b5acca186411ebaee6adf9c82d83e1e5c..cd17991daca5250204b6e7dc388e8a280887b716 100644 (file)
@@ -24,6 +24,7 @@
 #include <StepToTopoDS_TranslateVertexLoopError.hxx>
 #include <TopoDS_Shape.hxx>
 #include <StepToTopoDS_Root.hxx>
+class StepData_Factors;
 class StepShape_VertexLoop;
 class StepToTopoDS_Tool;
 class StepToTopoDS_NMTool;
@@ -39,9 +40,15 @@ public:
   
   Standard_EXPORT StepToTopoDS_TranslateVertexLoop();
   
-  Standard_EXPORT StepToTopoDS_TranslateVertexLoop(const Handle(StepShape_VertexLoop)& VL, StepToTopoDS_Tool& T, StepToTopoDS_NMTool& NMTool);
+  Standard_EXPORT StepToTopoDS_TranslateVertexLoop(const Handle(StepShape_VertexLoop)& VL,
+                                                   StepToTopoDS_Tool& T,
+                                                   StepToTopoDS_NMTool& NMTool,
+                                                   const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT void Init (const Handle(StepShape_VertexLoop)& VL, StepToTopoDS_Tool& T, StepToTopoDS_NMTool& NMTool);
+  Standard_EXPORT void Init (const Handle(StepShape_VertexLoop)& VL,
+                             StepToTopoDS_Tool& T,
+                             StepToTopoDS_NMTool& NMTool,
+                             const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const TopoDS_Shape& Value() const;
   
index 9d189627e5651becaa2f593d5d95e5e5c1eb40f3..45fa6dbb4f6e9e6e6e576cbb1eb97a65af91cda9 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <Message_ProgressScope.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepShape_ClosedShell.hxx>
 #include <StepShape_ConnectedFaceSet.hxx>
 #include <StepShape_Face.hxx>
@@ -54,10 +55,11 @@ TopoDSToStep_Builder::TopoDSToStep_Builder
   TopoDSToStep_Tool& aTool,
   const Handle(Transfer_FinderProcess)& FP,
   const Standard_Integer theTessellatedGeomParam,
+  const StepData_Factors& theLocalFactors,
   const Message_ProgressRange& theProgress)
 {
   done = Standard_False;
-  Init(aShape, aTool, FP, theTessellatedGeomParam, theProgress);
+  Init(aShape, aTool, FP, theTessellatedGeomParam, theLocalFactors, theProgress);
 }
 
 // ============================================================================
@@ -69,6 +71,7 @@ void TopoDSToStep_Builder::Init(const TopoDS_Shape& aShape,
   TopoDSToStep_Tool& myTool,
   const Handle(Transfer_FinderProcess)& FP,
   const Standard_Integer theTessellatedGeomParam,
+  const StepData_Factors& theLocalFactors,
   const Message_ProgressRange& theProgress)
 {
 
@@ -121,7 +124,7 @@ void TopoDSToStep_Builder::Init(const TopoDS_Shape& aShape,
     {
       const TopoDS_Face Face = TopoDS::Face(anExp.Current());
 
-      MkFace.Init(Face, myTool, FP);
+      MkFace.Init(Face, myTool, FP, theLocalFactors);
 
       if (MkFace.IsDone()) {
         FS = Handle(StepShape_FaceSurface)::DownCast(MkFace.Value());
@@ -190,7 +193,7 @@ void TopoDSToStep_Builder::Init(const TopoDS_Shape& aShape,
     Handle(StepShape_FaceSurface)                   FS;
     Handle(StepShape_TopologicalRepresentationItem) Fpms;
 
-    TopoDSToStep_MakeStepFace MkFace(Face, myTool, FP);
+    TopoDSToStep_MakeStepFace MkFace(Face, myTool, FP, theLocalFactors);
 
     TopoDSToStep_MakeTessellatedItem MkTessFace;
     
index 07d61fa158b140eeb26ffc4453744cf71575d0c0..cd5123b16621f97cd1a47254db04fa36eafe9a51 100644 (file)
@@ -25,6 +25,7 @@
 #include <TopoDSToStep_Root.hxx>
 #include <Message_ProgressRange.hxx>
 
+class StepData_Factors;
 class StepShape_TopologicalRepresentationItem;
 class StepVisual_TessellatedItem;
 class TopoDS_Shape;
@@ -47,12 +48,14 @@ public:
                                        TopoDSToStep_Tool& T,
                                        const Handle(Transfer_FinderProcess)& FP,
                                        const Standard_Integer theTessellatedGeomParam,
+                                       const StepData_Factors& theLocalFactors,
                                        const Message_ProgressRange& theProgress = Message_ProgressRange());
   
   Standard_EXPORT void Init (const TopoDS_Shape& S,
                              TopoDSToStep_Tool& T,
                              const Handle(Transfer_FinderProcess)& FP,
                              const Standard_Integer theTessellatedGeomParam,
+                             const StepData_Factors& theLocalFactors,
                              const Message_ProgressRange& theProgress = Message_ProgressRange());
   
   Standard_EXPORT TopoDSToStep_BuilderError Error() const;
index fb12faef869530bc6574b20a3453953e84205319..cb4ae8c235ddae4d367c40e2aca73acaecee9996 100644 (file)
@@ -20,6 +20,7 @@
 #include <Message_ProgressScope.hxx>
 #include <MoniTool_DataMapOfShapeTransient.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepShape_BrepWithVoids.hxx>
 #include <StepShape_ClosedShell.hxx>
 #include <StepShape_HArray1OfOrientedClosedShell.hxx>
@@ -55,6 +56,7 @@
 TopoDSToStep_MakeBrepWithVoids::
   TopoDSToStep_MakeBrepWithVoids(const TopoDS_Solid& aSolid,
                                  const Handle(Transfer_FinderProcess)& FP,
+                                 const StepData_Factors& theLocalFactors,
                                  const Message_ProgressRange& theProgress)
 {
   done = Standard_False;
@@ -98,7 +100,7 @@ TopoDSToStep_MakeBrepWithVoids::
       //:d7 abv 16 Mar 98: try to treat 'open' shells as closed since flag 
       // IsClosed() is often incorrect (taken from MakeManifoldSolid(Solid))
       aTool.Init(aMap, Standard_False);
-      StepB.Init(CurrentShell, aTool, FP, aWriteTessGeom, aPS.Next());
+      StepB.Init(CurrentShell, aTool, FP, aWriteTessGeom, theLocalFactors, aPS.Next());
       TopoDSToStep::AddResult(FP, aTool);
       if (StepB.IsDone()) 
       {
index f448417e35d1e0dcbc9eab7025a98b4d72e802b5..bd317c740908e79f89f6e9eabd881d0b9b869154 100644 (file)
@@ -44,6 +44,7 @@ public:
   
   Standard_EXPORT TopoDSToStep_MakeBrepWithVoids(const TopoDS_Solid& S,
                                                  const Handle(Transfer_FinderProcess)& FP,
+                                                 const StepData_Factors& theLocalFactors,
                                                  const Message_ProgressRange& theProgress = Message_ProgressRange());
   
   Standard_EXPORT const Handle(StepShape_BrepWithVoids)& Value() const;
index 0315b45c4572578d8819629446314b5ab9295b10..a068be1546dcc484001f0e8e4def021ed27c1c27 100644 (file)
@@ -19,6 +19,7 @@
 #include <Interface_Static.hxx>
 #include <Message_ProgressScope.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepShape_ClosedShell.hxx>
 #include <StepShape_FacetedBrep.hxx>
 #include <StepShape_TopologicalRepresentationItem.hxx>
@@ -40,6 +41,7 @@
 TopoDSToStep_MakeFacetedBrep::
   TopoDSToStep_MakeFacetedBrep(const TopoDS_Shell& aShell,
                                const Handle(Transfer_FinderProcess)& FP,
+                               const StepData_Factors& theLocalFactors,
                                const Message_ProgressRange& theProgress)
 {
   done = Standard_False;
@@ -50,7 +52,7 @@ TopoDSToStep_MakeFacetedBrep::
     const Standard_Integer aWriteTessGeom = Interface_Static::IVal("write.step.tessellated");
 
     TopoDSToStep_Tool    aTool(aMap, Standard_True);
-    TopoDSToStep_Builder StepB(aShell, aTool, FP, aWriteTessGeom, theProgress);
+    TopoDSToStep_Builder StepB(aShell, aTool, FP, aWriteTessGeom, theLocalFactors, theProgress);
     if (theProgress.UserBreak())
       return;
     TopoDSToStep::AddResult ( FP, aTool );
@@ -89,6 +91,7 @@ TopoDSToStep_MakeFacetedBrep::
 TopoDSToStep_MakeFacetedBrep::
   TopoDSToStep_MakeFacetedBrep(const TopoDS_Solid& aSolid,
                                const Handle(Transfer_FinderProcess)& FP,
+                               const StepData_Factors& theLocalFactors,
                                const Message_ProgressRange& theProgress)
 {
   done = Standard_False;
@@ -104,7 +107,7 @@ TopoDSToStep_MakeFacetedBrep::
       const Standard_Integer aWriteTessGeom = Interface_Static::IVal("write.step.tessellated");
 
       TopoDSToStep_Tool    aTool(aMap, Standard_True);
-      TopoDSToStep_Builder StepB(aOuterShell, aTool, FP, aWriteTessGeom, theProgress);
+      TopoDSToStep_Builder StepB(aOuterShell, aTool, FP, aWriteTessGeom, theLocalFactors, theProgress);
       if (theProgress.UserBreak())
         return;
       TopoDSToStep::AddResult ( FP, aTool );
index be54dba226eb744a1b190f5746ece4dec87e3110..2391b5a55ecc2e1483b054f471ec1eab0f6b84be 100644 (file)
@@ -24,6 +24,7 @@
 #include <TopoDSToStep_Root.hxx>
 #include <Message_ProgressRange.hxx>
 
+class StepData_Factors;
 class StepShape_FacetedBrep;
 class StepVisual_TessellatedItem;
 class TopoDS_Shell;
@@ -45,10 +46,12 @@ public:
   
   Standard_EXPORT TopoDSToStep_MakeFacetedBrep(const TopoDS_Shell& S,
                                                const Handle(Transfer_FinderProcess)& FP,
+                                               const StepData_Factors& theLocalFactors,
                                                const Message_ProgressRange& theProgress = Message_ProgressRange());
   
   Standard_EXPORT TopoDSToStep_MakeFacetedBrep(const TopoDS_Solid& S,
                                                const Handle(Transfer_FinderProcess)& FP,
+                                               const StepData_Factors& theLocalFactors,
                                                const Message_ProgressRange& theProgress = Message_ProgressRange());
   
   Standard_EXPORT const Handle(StepShape_FacetedBrep)& Value() const;
index 14b030560776c0e556a3ca9a49fffd01f24377d1..837fb8e73216ec38035b1b345364a7d8af03d195 100644 (file)
@@ -19,6 +19,7 @@
 #include <Message_ProgressScope.hxx>
 #include <MoniTool_DataMapOfShapeTransient.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepShape_ClosedShell.hxx>
 #include <StepShape_FacetedBrepAndBrepWithVoids.hxx>
 #include <StepShape_HArray1OfOrientedClosedShell.hxx>
@@ -47,6 +48,7 @@
 TopoDSToStep_MakeFacetedBrepAndBrepWithVoids::
   TopoDSToStep_MakeFacetedBrepAndBrepWithVoids(const TopoDS_Solid& aSolid,
                                                const Handle(Transfer_FinderProcess)& FP,
+                                               const StepData_Factors& theLocalFactors,
                                                const Message_ProgressRange& theProgress)
 {
   done = Standard_False;
@@ -80,7 +82,7 @@ TopoDSToStep_MakeFacetedBrepAndBrepWithVoids::
         if (It.Value().Closed()) {
 
           aTool.Init(aMap, Standard_False);
-          StepB.Init(CurrentShell, aTool, FP, Standard_False, aRange);
+          StepB.Init(CurrentShell, aTool, FP, Standard_False, theLocalFactors, aRange);
           TopoDSToStep::AddResult(FP, aTool);
 
           if (StepB.IsDone()) {
index 6360bc0deeea94e2037ccb26c907dc98fc13cea2..e4c67e1dfe22e70eb9ad06af5152f8e2a6201c9e 100644 (file)
@@ -43,6 +43,7 @@ public:
   
   Standard_EXPORT TopoDSToStep_MakeFacetedBrepAndBrepWithVoids(const TopoDS_Solid& S,
                                                                const Handle(Transfer_FinderProcess)& FP,
+                                                               const StepData_Factors& theLocalFactors,
                                        const Message_ProgressRange& theProgress = Message_ProgressRange());
   
   Standard_EXPORT const Handle(StepShape_FacetedBrepAndBrepWithVoids)& Value() const;
index 9cde3288e5dbfe41937b3eeb5dea465fb9a82197..dd4a7f5b6c12d77a0c974f7dff42627da6a6da1d 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <MoniTool_DataMapOfShapeTransient.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepShape_GeometricCurveSet.hxx>
 #include <StepShape_GeometricSetSelect.hxx>
 #include <StepShape_HArray1OfGeometricSetSelect.hxx>
 //=============================================================================
 TopoDSToStep_MakeGeometricCurveSet::TopoDSToStep_MakeGeometricCurveSet(
                                     const TopoDS_Shape& aShape,
-                                   const Handle(Transfer_FinderProcess)& FP)
+                                    const Handle(Transfer_FinderProcess)& FP,
+                                    const StepData_Factors& theLocalFactors)
 {
   done = Standard_False;
   Handle(TColStd_HSequenceOfTransient)  itemList;
   MoniTool_DataMapOfShapeTransient      aMap;
   TopoDSToStep_Tool                aTool (aMap, Standard_False);
-  TopoDSToStep_WireframeBuilder    wirefB (aShape, aTool, FP);
+  TopoDSToStep_WireframeBuilder    wirefB (aShape, aTool, theLocalFactors);
   TopoDSToStep::AddResult ( FP, aTool );
 
   Handle(StepShape_GeometricCurveSet) aGCSet =
index cb52372f9e36e5f69f28a1808f71d12e2c775275..a204e82a454748f19cb5e75e51562651cf79f2a9 100644 (file)
@@ -37,7 +37,9 @@ public:
   DEFINE_STANDARD_ALLOC
 
   
-  Standard_EXPORT TopoDSToStep_MakeGeometricCurveSet(const TopoDS_Shape& SH, const Handle(Transfer_FinderProcess)& FP);
+  Standard_EXPORT TopoDSToStep_MakeGeometricCurveSet(const TopoDS_Shape& SH,
+                                                     const Handle(Transfer_FinderProcess)& FP,
+                                                     const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const Handle(StepShape_GeometricCurveSet)& Value() const;
 
index b165a9e06778c726e80cfeb62377966b04f5d18b..7a932e38a6fc0ed2405cf6bccacd8e5b02e206de 100644 (file)
@@ -19,6 +19,7 @@
 #include <Interface_Static.hxx>
 #include <Message_ProgressScope.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepShape_ClosedShell.hxx>
 #include <StepShape_HArray1OfFace.hxx>
 #include <StepShape_ManifoldSolidBrep.hxx>
@@ -38,6 +39,7 @@
 static std::pair<Handle(StepShape_ManifoldSolidBrep), Handle(StepVisual_TessellatedItem)>
 MakeManifoldSolidBrep(const TopoDS_Shell& aShell,
                       const Handle(Transfer_FinderProcess)& FP,
+                      const StepData_Factors& theLocalFactors,
                       const Message_ProgressRange& theProgress)
 {
   Handle(StepShape_ManifoldSolidBrep) theManifoldSolidBrep;
@@ -48,7 +50,7 @@ MakeManifoldSolidBrep(const TopoDS_Shell& aShell,
 
   const Standard_Integer aWriteTessGeom = Interface_Static::IVal("write.step.tessellated");
 
-  TopoDSToStep_Builder StepB(aShell, aTool, FP, aWriteTessGeom, theProgress);
+  TopoDSToStep_Builder StepB(aShell, aTool, FP, aWriteTessGeom, theLocalFactors, theProgress);
   if (theProgress.UserBreak())
     return std::make_pair(theManifoldSolidBrep, aTessItem);
 
@@ -81,10 +83,11 @@ MakeManifoldSolidBrep(const TopoDS_Shell& aShell,
 TopoDSToStep_MakeManifoldSolidBrep::
   TopoDSToStep_MakeManifoldSolidBrep(const TopoDS_Shell& aShell,
                                      const Handle(Transfer_FinderProcess)& FP,
+                                     const StepData_Factors& theLocalFactors,
                                      const Message_ProgressRange& theProgress)
 {
   std::pair<Handle(StepShape_ManifoldSolidBrep), Handle(StepVisual_TessellatedItem)>
-    aResult = MakeManifoldSolidBrep(aShell, FP, theProgress);
+    aResult = MakeManifoldSolidBrep(aShell, FP, theLocalFactors, theProgress);
   done = !aResult.first.IsNull() || !aResult.second.IsNull();
   if (done) 
   {
@@ -106,13 +109,14 @@ TopoDSToStep_MakeManifoldSolidBrep::
 TopoDSToStep_MakeManifoldSolidBrep::
   TopoDSToStep_MakeManifoldSolidBrep(const TopoDS_Solid& aSolid,
                                      const Handle(Transfer_FinderProcess)& FP,
+                                     const StepData_Factors& theLocalFactors,
                                      const Message_ProgressRange& theProgress)
 {
   TopoDS_Shell aOuterShell = BRepClass3d::OuterShell(aSolid);
   if (!aOuterShell.IsNull())
   {
     std::pair<Handle(StepShape_ManifoldSolidBrep), Handle(StepVisual_TessellatedItem)>
-      aResult = MakeManifoldSolidBrep(aOuterShell, FP, theProgress);
+      aResult = MakeManifoldSolidBrep(aOuterShell, FP, theLocalFactors, theProgress);
     done = !aResult.first.IsNull() || !aResult.second.IsNull();
     if (done) 
     {
index cffd949e7f63f4e1fc1ac382d6c28a885fec7fb6..9edb3c59b0651fb8dee556ca51e50686cdb5bf73 100644 (file)
@@ -24,6 +24,7 @@
 #include <TopoDSToStep_Root.hxx>
 #include <Message_ProgressRange.hxx>
 
+class StepData_Factors;
 class StepShape_ManifoldSolidBrep;
 class StepVisual_TessellatedItem;
 class TopoDS_Shell;
@@ -44,10 +45,12 @@ public:
   
   Standard_EXPORT TopoDSToStep_MakeManifoldSolidBrep(const TopoDS_Shell& S,
                                                      const Handle(Transfer_FinderProcess)& FP,
+                                                     const StepData_Factors& theLocalFactors,
                                                      const Message_ProgressRange& theProgress = Message_ProgressRange());
   
   Standard_EXPORT TopoDSToStep_MakeManifoldSolidBrep(const TopoDS_Solid& S,
                                                      const Handle(Transfer_FinderProcess)& FP,
+                                                     const StepData_Factors& theLocalFactors,
                                                      const Message_ProgressRange& theProgress = Message_ProgressRange());
   
   Standard_EXPORT const Handle(StepShape_ManifoldSolidBrep)& Value() const;
index e266905abd9ce8670d60d26768e6b06524ff6700..b0bbf78d5e45a52fe055d9989604a99e0e980a37 100644 (file)
@@ -19,6 +19,7 @@
 #include <MoniTool_DataMapOfShapeTransient.hxx>
 #include <Message_ProgressScope.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepShape_ClosedShell.hxx>
 #include <StepShape_ConnectedFaceSet.hxx>
 #include <StepShape_FaceSurface.hxx>
@@ -51,6 +52,7 @@
 TopoDSToStep_MakeShellBasedSurfaceModel::
   TopoDSToStep_MakeShellBasedSurfaceModel(const TopoDS_Face& aFace,
                                           const Handle(Transfer_FinderProcess)& FP,
+                                          const StepData_Factors& theLocalFactors,
                                           const Message_ProgressRange& theProgress)
 {
   done = Standard_False;
@@ -59,7 +61,7 @@ TopoDSToStep_MakeShellBasedSurfaceModel::
   const Standard_Integer aWriteTessGeom = Interface_Static::IVal("write.step.tessellated");
 
   TopoDSToStep_Tool    aTool(aMap, Standard_False);
-  TopoDSToStep_Builder StepB(aFace, aTool, FP, aWriteTessGeom, theProgress);
+  TopoDSToStep_Builder StepB(aFace, aTool, FP, aWriteTessGeom, theLocalFactors, theProgress);
   if (theProgress.UserBreak())
     return;
 
@@ -106,6 +108,7 @@ TopoDSToStep_MakeShellBasedSurfaceModel::
 TopoDSToStep_MakeShellBasedSurfaceModel::
   TopoDSToStep_MakeShellBasedSurfaceModel(const TopoDS_Shell& aShell,
                                           const Handle(Transfer_FinderProcess)& FP,
+                                          const StepData_Factors& theLocalFactors,
                                           const Message_ProgressRange& theProgress)
 {
   done = Standard_False;
@@ -118,7 +121,7 @@ TopoDSToStep_MakeShellBasedSurfaceModel::
   const Standard_Integer aWriteTessGeom = Interface_Static::IVal("write.step.tessellated");
 
   TopoDSToStep_Tool    aTool(aMap, Standard_False);
-  TopoDSToStep_Builder StepB(aShell, aTool, FP, aWriteTessGeom, theProgress);
+  TopoDSToStep_Builder StepB(aShell, aTool, FP, aWriteTessGeom, theLocalFactors, theProgress);
   if (theProgress.UserBreak())
     return;
   //TopoDSToStep::AddResult ( FP, aTool );
@@ -161,6 +164,7 @@ TopoDSToStep_MakeShellBasedSurfaceModel::
 TopoDSToStep_MakeShellBasedSurfaceModel::
   TopoDSToStep_MakeShellBasedSurfaceModel(const TopoDS_Solid& aSolid,
                                           const Handle(Transfer_FinderProcess)& FP,
+                                          const StepData_Factors& theLocalFactors,
                                           const Message_ProgressRange& theProgress)
 {
   done = Standard_False;
@@ -187,7 +191,7 @@ TopoDSToStep_MakeShellBasedSurfaceModel::
       aShell = TopoDS::Shell(It.Value());
 
       TopoDSToStep_Tool    aTool(aMap, Standard_False);
-      TopoDSToStep_Builder StepB(aShell, aTool, FP, aWriteTessGeom, aPS.Next());
+      TopoDSToStep_Builder StepB(aShell, aTool, FP, aWriteTessGeom, theLocalFactors, aPS.Next());
       TopoDSToStep::AddResult ( FP, aTool );
 
       if (StepB.IsDone()) {
index efbf85ee70d2a9b711028edd4dec3b663efe9a35..78971c5e76756e76993eeedac9e188d96189c221 100644 (file)
@@ -45,14 +45,17 @@ public:
   
   Standard_EXPORT TopoDSToStep_MakeShellBasedSurfaceModel(const TopoDS_Face& F,
                                                           const Handle(Transfer_FinderProcess)& FP,
+                                                          const StepData_Factors& theLocalFactors,
                                   const Message_ProgressRange& theProgress = Message_ProgressRange());
   
   Standard_EXPORT TopoDSToStep_MakeShellBasedSurfaceModel(const TopoDS_Shell& S,
                                                           const Handle(Transfer_FinderProcess)& FP,
+                                                          const StepData_Factors& theLocalFactors,
                                   const Message_ProgressRange& theProgress = Message_ProgressRange());
   
   Standard_EXPORT TopoDSToStep_MakeShellBasedSurfaceModel(const TopoDS_Solid& S,
                                                           const Handle(Transfer_FinderProcess)& FP,
+                                                          const StepData_Factors& theLocalFactors,
                                   const Message_ProgressRange& theProgress = Message_ProgressRange());
   
   Standard_EXPORT const Handle(StepShape_ShellBasedSurfaceModel)& Value() const;
index edf9f1b5f7eb1a243740f03c6592e9abeafc8300..d133dce90b4beef9124eaf7793997daf85c7366c 100644 (file)
@@ -29,6 +29,7 @@
 #include <gp_Vec.hxx>
 #include <Interface_Static.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_Line.hxx>
 #include <StepGeom_SeamCurve.hxx>
 #include <StepGeom_SurfaceCurve.hxx>
@@ -65,10 +66,11 @@ TopoDSToStep_MakeStepEdge::TopoDSToStep_MakeStepEdge()
 TopoDSToStep_MakeStepEdge::TopoDSToStep_MakeStepEdge
 (const TopoDS_Edge& E,
  TopoDSToStep_Tool& T,
- const Handle(Transfer_FinderProcess)& FP)
+ const Handle(Transfer_FinderProcess)& FP,
+ const StepData_Factors& theLocalFactors)
 {
   done = Standard_False;
-  Init(E, T, FP);
+  Init(E, T, FP, theLocalFactors);
 }
 
 // ----------------------------------------------------------------------------
@@ -78,7 +80,8 @@ TopoDSToStep_MakeStepEdge::TopoDSToStep_MakeStepEdge
 
 void TopoDSToStep_MakeStepEdge::Init(const TopoDS_Edge& aEdge, 
                                      TopoDSToStep_Tool& aTool,
-                                     const Handle(Transfer_FinderProcess)& FP)
+                                     const Handle(Transfer_FinderProcess)& FP,
+                                     const StepData_Factors& theLocalFactors)
 {
   // ------------------------------------------------------------------
   // The edge is given with its relative orientation (i.e. in the wire)
@@ -152,7 +155,7 @@ void TopoDSToStep_MakeStepEdge::Init(const TopoDS_Edge& aEdge,
 
   TopoDSToStep_MakeStepVertex MkVertex;
   
-  MkVertex.Init(Vfirst, aTool, FP);  
+  MkVertex.Init(Vfirst, aTool, FP, theLocalFactors);  
   if (MkVertex.IsDone())
     V1 = Handle(StepShape_Vertex)::DownCast(MkVertex.Value());
   else {
@@ -164,7 +167,7 @@ void TopoDSToStep_MakeStepEdge::Init(const TopoDS_Edge& aEdge,
     return;
   }
   
-  MkVertex.Init(Vlast, aTool, FP);
+  MkVertex.Init(Vlast, aTool, FP, theLocalFactors);
   if (MkVertex.IsDone())
     V2 = Handle(StepShape_Vertex)::DownCast(MkVertex.Value());
   else {
@@ -245,7 +248,7 @@ void TopoDSToStep_MakeStepEdge::Init(const TopoDS_Edge& aEdge,
     }
 
  
-    GeomToStep_MakeCurve MkCurve(C);
+    GeomToStep_MakeCurve MkCurve(C, theLocalFactors);
     Gpms = MkCurve.Value();
   }
   else {
@@ -264,7 +267,7 @@ void TopoDSToStep_MakeStepEdge::Init(const TopoDS_Edge& aEdge,
       gp_Vec V = gp_Vec( CA.Value(U1), CA.Value(U2) );
       Handle(Geom_Line) L = 
        new Geom_Line(CA.Value(U1), gp_Dir(V));
-      GeomToStep_MakeLine MkLine(L);
+      GeomToStep_MakeLine MkLine(L, theLocalFactors);
       Gpms = MkLine.Value();
     }
     else {
@@ -288,7 +291,7 @@ void TopoDSToStep_MakeStepEdge::Init(const TopoDS_Edge& aEdge,
       Mult.SetValue(Nbpt,2);
       Handle(Geom_Curve) Bs = 
        new Geom_BSplineCurve(Points, Knots, Mult, 1);
-      GeomToStep_MakeCurve MkCurve(Bs);
+      GeomToStep_MakeCurve MkCurve(Bs, theLocalFactors);
       Gpms = MkCurve.Value();
     }
   }
index a9a30f25d704e86464400eafb331ea6a245663be..5b8b2aadc35cf622a461f81fc6f5bf88d4f34ce0 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <TopoDSToStep_MakeEdgeError.hxx>
 #include <TopoDSToStep_Root.hxx>
+class StepData_Factors;
 class StepShape_TopologicalRepresentationItem;
 class TopoDS_Edge;
 class TopoDSToStep_Tool;
@@ -41,9 +42,15 @@ public:
   
   Standard_EXPORT TopoDSToStep_MakeStepEdge();
   
-  Standard_EXPORT TopoDSToStep_MakeStepEdge(const TopoDS_Edge& E, TopoDSToStep_Tool& T, const Handle(Transfer_FinderProcess)& FP);
+  Standard_EXPORT TopoDSToStep_MakeStepEdge(const TopoDS_Edge& E,
+                                            TopoDSToStep_Tool& T,
+                                            const Handle(Transfer_FinderProcess)& FP,
+                                            const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT void Init (const TopoDS_Edge& E, TopoDSToStep_Tool& T, const Handle(Transfer_FinderProcess)& FP);
+  Standard_EXPORT void Init (const TopoDS_Edge& E,
+                             TopoDSToStep_Tool& T,
+                             const Handle(Transfer_FinderProcess)& FP,
+                             const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const Handle(StepShape_TopologicalRepresentationItem)& Value() const;
   
index 00c4c5475d78d652c48992a22b44aa056b1bb4e9..a85b26016d2fa409d71b5fb09de49fbdca79078e 100644 (file)
@@ -47,7 +47,7 @@
 #include <ShapeAlgo.hxx>
 #include <ShapeAlgo_AlgoContainer.hxx>
 #include <StdFail_NotDone.hxx>
-#include <StepData_GlobalFactors.hxx>
+#include <StepData_StepModel.hxx>
 #include <StepGeom_GeometricRepresentationContextAndParametricRepresentationContext.hxx>
 #include <StepGeom_Pcurve.hxx>
 #include <StepGeom_SeamCurve.hxx>
@@ -87,10 +87,11 @@ TopoDSToStep_MakeStepFace::TopoDSToStep_MakeStepFace()
 TopoDSToStep_MakeStepFace::TopoDSToStep_MakeStepFace
 (const TopoDS_Face& F,
  TopoDSToStep_Tool& T,
- const Handle(Transfer_FinderProcess)& FP)
+ const Handle(Transfer_FinderProcess)& FP,
+ const StepData_Factors& theLocalFactors)
 {
   done = Standard_False;
-  Init(F, T, FP);
+  Init(F, T, FP, theLocalFactors);
 }
 
 // ----------------------------------------------------------------------------
@@ -98,9 +99,10 @@ TopoDSToStep_MakeStepFace::TopoDSToStep_MakeStepFace
 // Purpose :
 // ----------------------------------------------------------------------------
 
-void TopoDSToStep_MakeStepFace::Init(const TopoDS_Face& aFace, 
-                                    TopoDSToStep_Tool& aTool,
-                                    const Handle(Transfer_FinderProcess)& FP)
+void TopoDSToStep_MakeStepFace::Init(const TopoDS_Face& aFace,
+                                     TopoDSToStep_Tool& aTool,
+                                     const Handle(Transfer_FinderProcess)& FP,
+                                     const StepData_Factors& theLocalFactors)
 {
   // --------------------------------------------------------------
   // the face is given with its relative orientation (in the Shell)
@@ -205,7 +207,7 @@ void TopoDSToStep_MakeStepFace::Init(const TopoDS_Face& aFace,
   //Standard_Boolean ReverseSurfaceOrientation = Standard_False; //szv#4:S4163:12Mar99 unused
   aTool.SetSurfaceReversed(Standard_False);
 
-  GeomToStep_MakeSurface MkSurface(Su);
+  GeomToStep_MakeSurface MkSurface(Su, theLocalFactors);
   Handle(StepGeom_Surface) Spms =  MkSurface.Value();
 
   //%pdn 30 Nov 98: TestRally 9 issue on r1001_ec.stp: 
@@ -257,12 +259,12 @@ void TopoDSToStep_MakeStepFace::Init(const TopoDS_Face& aFace,
       if (aSurfaceIsOffset)
       {
         anOffsetSu->SetBasisSurface(Rev);
-        GeomToStep_MakeSurface MkRev(anOffsetSu);
+        GeomToStep_MakeSurface MkRev(anOffsetSu, theLocalFactors);
         Spms = MkRev.Value();
       }
       else
       {
-        GeomToStep_MakeSurface MkRev(Rev);
+        GeomToStep_MakeSurface MkRev(Rev, theLocalFactors);
         Spms = MkRev.Value();
       }
     }
@@ -292,7 +294,7 @@ void TopoDSToStep_MakeStepFace::Init(const TopoDS_Face& aFace,
       //const TopoDS_Wire ForwardWire = TopoDS::Wire(ssh);
 
       //MkWire.Init(ForwardWire, aTool, FP);
-      MkWire.Init(CurrentWire, aTool, FP);
+      MkWire.Init(CurrentWire, aTool, FP, theLocalFactors);
       if (MkWire.IsDone()) Loop = Handle(StepShape_Loop)::DownCast(MkWire.Value());
       else {
 #ifdef OCCT_DEBUG
@@ -402,15 +404,15 @@ void TopoDSToStep_MakeStepFace::Init(const TopoDS_Face& aFace,
          Handle(Geom_RectangularTrimmedSurface) alocalRTS =
            Handle(Geom_RectangularTrimmedSurface)::DownCast(Su);
          C2dMapped = GeomConvert_Units::RadianToDegree(C2d, alocalRTS->BasisSurface(),
-      StepData_GlobalFactors::Intance().LengthFactor(), StepData_GlobalFactors::Intance().FactorRadianDegree());
+      theLocalFactors.LengthFactor(), theLocalFactors.FactorRadianDegree());
        }
        else {
          C2dMapped = GeomConvert_Units::RadianToDegree(C2d, Su,
-      StepData_GlobalFactors::Intance().LengthFactor(), StepData_GlobalFactors::Intance().FactorRadianDegree());
+      theLocalFactors.LengthFactor(), theLocalFactors.FactorRadianDegree());
        }
 //
 //     C2dMapped = C2d;  // cky : en remplacement de ce qui precede
-       GeomToStep_MakeCurve MkCurve(C2dMapped);
+       GeomToStep_MakeCurve MkCurve(C2dMapped, theLocalFactors);
        
        // --------------------
        // Translate the Pcurve
index a0612f329bf2b4caceb33f69efc4469e860b183e..9a3a8c9e1752839a3ef0a1f0a6c58f2c57eb068e 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <TopoDSToStep_MakeFaceError.hxx>
 #include <TopoDSToStep_Root.hxx>
+class StepData_Factors;
 class StepShape_TopologicalRepresentationItem;
 class TopoDS_Face;
 class TopoDSToStep_Tool;
@@ -41,9 +42,15 @@ public:
   
   Standard_EXPORT TopoDSToStep_MakeStepFace();
   
-  Standard_EXPORT TopoDSToStep_MakeStepFace(const TopoDS_Face& F, TopoDSToStep_Tool& T, const Handle(Transfer_FinderProcess)& FP);
+  Standard_EXPORT TopoDSToStep_MakeStepFace(const TopoDS_Face& F,
+                                            TopoDSToStep_Tool& T,
+                                            const Handle(Transfer_FinderProcess)& FP,
+                                            const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT void Init (const TopoDS_Face& F, TopoDSToStep_Tool& T, const Handle(Transfer_FinderProcess)& FP);
+  Standard_EXPORT void Init (const TopoDS_Face& F,
+                             TopoDSToStep_Tool& T,
+                             const Handle(Transfer_FinderProcess)& FP,
+                             const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const Handle(StepShape_TopologicalRepresentationItem)& Value() const;
   
index 0acd883c3af6445cf229891449de40f45f94d16f..95fb9561de3b403377fa881217c0434d214cba25 100644 (file)
@@ -20,6 +20,7 @@
 #include <gp_Pnt.hxx>
 #include <Interface_Static.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_StepModel.hxx>
 #include <StepGeom_CartesianPoint.hxx>
 #include <StepShape_VertexPoint.hxx>
 #include <TCollection_HAsciiString.hxx>
@@ -42,10 +43,11 @@ TopoDSToStep_MakeStepVertex::TopoDSToStep_MakeStepVertex()
 TopoDSToStep_MakeStepVertex::TopoDSToStep_MakeStepVertex
 (const TopoDS_Vertex& V, 
  TopoDSToStep_Tool& T,
- const Handle(Transfer_FinderProcess)& FP)
+ const Handle(Transfer_FinderProcess)& FP,
+ const StepData_Factors& theLocalFactors)
 {
   done = Standard_False;
-  Init(V, T, FP);
+  Init(V, T, FP, theLocalFactors);
 }
 
 // ----------------------------------------------------------------------------
@@ -55,7 +57,8 @@ TopoDSToStep_MakeStepVertex::TopoDSToStep_MakeStepVertex
 
 void TopoDSToStep_MakeStepVertex::Init(const TopoDS_Vertex& aVertex, 
                                        TopoDSToStep_Tool& aTool,
-                                       const Handle(Transfer_FinderProcess)& FP)
+                                       const Handle(Transfer_FinderProcess)& FP,
+                                       const StepData_Factors& theLocalFactors)
 {
 
   aTool.SetCurrentVertex(aVertex);
@@ -85,7 +88,7 @@ void TopoDSToStep_MakeStepVertex::Init(const TopoDS_Vertex& aVertex,
   gp_Pnt P;
   
   P = BRep_Tool::Pnt(aVertex);
-  GeomToStep_MakeCartesianPoint MkPoint(P);
+  GeomToStep_MakeCartesianPoint MkPoint(P, theLocalFactors.LengthFactor());
   Handle(StepGeom_CartesianPoint) Gpms = MkPoint.Value();
   Handle(StepShape_VertexPoint) Vpms =
     new StepShape_VertexPoint();
index 1105da6309513e611c8ff93d01b37dbf13065946..08152b0f871b537b321d6f1ef9d41bbe6744a4ff 100644 (file)
@@ -41,9 +41,15 @@ public:
   
   Standard_EXPORT TopoDSToStep_MakeStepVertex();
   
-  Standard_EXPORT TopoDSToStep_MakeStepVertex(const TopoDS_Vertex& V, TopoDSToStep_Tool& T, const Handle(Transfer_FinderProcess)& FP);
+  Standard_EXPORT TopoDSToStep_MakeStepVertex(const TopoDS_Vertex& V,
+                                              TopoDSToStep_Tool& T,
+                                              const Handle(Transfer_FinderProcess)& FP,
+                                              const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT void Init (const TopoDS_Vertex& V, TopoDSToStep_Tool& T, const Handle(Transfer_FinderProcess)& FP);
+  Standard_EXPORT void Init (const TopoDS_Vertex& V,
+                             TopoDSToStep_Tool& T,
+                             const Handle(Transfer_FinderProcess)& FP,
+                             const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const Handle(StepShape_TopologicalRepresentationItem)& Value() const;
   
index 252fc3a0e435f0e0a29a235a24bb2a12a0aa2019..20a000c1750949b3883d00f97d4d6943c1cfe499 100644 (file)
@@ -23,6 +23,7 @@
 #include <ShapeAnalysis_Edge.hxx>
 #include <ShapeFix_Wire.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepShape_EdgeLoop.hxx>
 #include <StepShape_HArray1OfOrientedEdge.hxx>
 #include <StepShape_OrientedEdge.hxx>
@@ -54,10 +55,11 @@ TopoDSToStep_MakeStepWire::TopoDSToStep_MakeStepWire()
 TopoDSToStep_MakeStepWire::TopoDSToStep_MakeStepWire
 (const TopoDS_Wire& W, 
  TopoDSToStep_Tool& T,
- const Handle(Transfer_FinderProcess)& FP)
+ const Handle(Transfer_FinderProcess)& FP,
+ const StepData_Factors& theLocalFactors)
 {
   done = Standard_False;
-  Init(W, T, FP);
+  Init(W, T, FP, theLocalFactors);
 }
 
 
@@ -68,7 +70,8 @@ TopoDSToStep_MakeStepWire::TopoDSToStep_MakeStepWire
 
 void TopoDSToStep_MakeStepWire::Init (const TopoDS_Wire& aWire,
                                       TopoDSToStep_Tool& aTool,
-                                      const Handle(Transfer_FinderProcess)& FP)
+                                      const Handle(Transfer_FinderProcess)& FP,
+                                      const StepData_Factors& theLocalFactors)
 {
   // ----------------------------------------------------------------
   // The Wire is given in its relative orientation (i.e. in the face)
@@ -118,7 +121,7 @@ void TopoDSToStep_MakeStepWire::Init (const TopoDS_Wire& aWire,
         TopExp::Vertices (CurrentEdge, TopoDSVertex2, TopoDSVertex1);
       }
 
-      MkVertex.Init (TopoDSVertex1, aTool, FP);
+      MkVertex.Init (TopoDSVertex1, aTool, FP, theLocalFactors);
       if (MkVertex.IsDone())
       {
         VertexPoint = Handle(StepShape_VertexPoint)::DownCast (MkVertex.Value());
@@ -221,7 +224,7 @@ void TopoDSToStep_MakeStepWire::Init (const TopoDS_Wire& aWire,
           // make vertex_loop
           ShapeAnalysis_Edge sae;
           TopoDS_Vertex V = sae.FirstVertex (anExtWire2->Edge (1));
-          TopoDSToStep_MakeStepVertex mkV (V, aTool, FP);
+          TopoDSToStep_MakeStepVertex mkV (V, aTool, FP, theLocalFactors);
           Handle(StepShape_VertexLoop) vloop = new StepShape_VertexLoop;
           Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString ("");
           vloop->Init (name, Handle(StepShape_Vertex)::DownCast (mkV.Value()));
@@ -250,7 +253,7 @@ void TopoDSToStep_MakeStepWire::Init (const TopoDS_Wire& aWire,
       }
       else
       {
-        MkEdge.Init (anEdge, aTool, FP);
+        MkEdge.Init (anEdge, aTool, FP, theLocalFactors);
         if (MkEdge.IsDone())
         {
           OrientedEdge = new StepShape_OrientedEdge();
index 1f33cbaee7fe739bddbfa39e9ab1256cc9d91f02..2a59599b008e561a5756521393042cb6360ab4d4 100644 (file)
@@ -41,9 +41,15 @@ public:
   
   Standard_EXPORT TopoDSToStep_MakeStepWire();
   
-  Standard_EXPORT TopoDSToStep_MakeStepWire(const TopoDS_Wire& W, TopoDSToStep_Tool& T, const Handle(Transfer_FinderProcess)& FP);
+  Standard_EXPORT TopoDSToStep_MakeStepWire(const TopoDS_Wire& W,
+                                            TopoDSToStep_Tool& T,
+                                            const Handle(Transfer_FinderProcess)& FP,
+                                            const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT void Init (const TopoDS_Wire& W, TopoDSToStep_Tool& T, const Handle(Transfer_FinderProcess)& FP);
+  Standard_EXPORT void Init (const TopoDS_Wire& W,
+                             TopoDSToStep_Tool& T,
+                             const Handle(Transfer_FinderProcess)& FP,
+                             const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT const Handle(StepShape_TopologicalRepresentationItem)& Value() const;
   
index e21537d1d1ba030733e40b3879ff387d42e38d23..18741dcc9fb99a0f589eacd43e19495ad98d0270 100644 (file)
@@ -35,6 +35,7 @@
 #include <Standard_ErrorHandler.hxx>
 #include <Standard_NullObject.hxx>
 #include <StdFail_NotDone.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_CartesianPoint.hxx>
 #include <StepGeom_Line.hxx>
 #include <StepGeom_TrimmedCurve.hxx>
@@ -66,18 +67,22 @@ TopoDSToStep_WireframeBuilder::TopoDSToStep_WireframeBuilder()
 // Purpose :
 // ============================================================================
 
- TopoDSToStep_WireframeBuilder::TopoDSToStep_WireframeBuilder(const TopoDS_Shape& aShape, TopoDSToStep_Tool& aTool, const Handle(Transfer_FinderProcess)& FP)
+ TopoDSToStep_WireframeBuilder::TopoDSToStep_WireframeBuilder(const TopoDS_Shape& aShape,
+                                                              TopoDSToStep_Tool& aTool,
+                                                              const StepData_Factors& theLocalFactors)
 {
   done = Standard_False;
-  Init(aShape, aTool, FP);
+  Init(aShape, aTool, theLocalFactors);
 }
 
-void TopoDSToStep_WireframeBuilder::Init(const TopoDS_Shape& aShape, TopoDSToStep_Tool& /* T */, const Handle(Transfer_FinderProcess)& /* FP */)
+void TopoDSToStep_WireframeBuilder::Init(const TopoDS_Shape& aShape,
+                                         TopoDSToStep_Tool& /* T */,
+                                         const StepData_Factors& theLocalFactors)
 {
   Handle(TColStd_HSequenceOfTransient) itemList =
     new TColStd_HSequenceOfTransient();
   MoniTool_DataMapOfShapeTransient aPmsMap;
-  done = GetTrimmedCurveFromShape(aShape, aPmsMap, itemList);
+  done = GetTrimmedCurveFromShape(aShape, aPmsMap, itemList, theLocalFactors);
   myResult = itemList;
 }
 
@@ -141,7 +146,8 @@ Standard_Boolean TopoDSToStep_WireframeBuilder::
   GetTrimmedCurveFromEdge(const TopoDS_Edge& theEdge,
                           const TopoDS_Face& theFace,
                           MoniTool_DataMapOfShapeTransient& theMap,
-                          Handle(TColStd_HSequenceOfTransient)& theCurveList) const
+                          Handle(TColStd_HSequenceOfTransient)& theCurveList,
+                          const StepData_Factors& theLocalFactors) const
 {
   if (theEdge.Orientation() == TopAbs_INTERNAL ||
       theEdge.Orientation() == TopAbs_EXTERNAL )
@@ -183,14 +189,14 @@ Standard_Boolean TopoDSToStep_WireframeBuilder::
     {
       aVFirst = aVertex;
       // 1.point for trimming
-      GeomToStep_MakeCartesianPoint aGTSMCP(aGpP);
+      GeomToStep_MakeCartesianPoint aGTSMCP(aGpP, theLocalFactors.LengthFactor());
       aSGCP1 = aGTSMCP.Value();
     }
     if (aVertex.Orientation() == TopAbs_REVERSED)
     {
       aVLast = aVertex;
       // 2.point for trimming
-      GeomToStep_MakeCartesianPoint aGTSMCP(aGpP);
+      GeomToStep_MakeCartesianPoint aGTSMCP(aGpP, theLocalFactors.LengthFactor());
       aSGCP2 = aGTSMCP.Value();
     }
   }
@@ -204,7 +210,7 @@ Standard_Boolean TopoDSToStep_WireframeBuilder::
     {
       aC = Handle(Geom_TrimmedCurve)::DownCast(aC)->BasisCurve();
     }
-    GeomToStep_MakeCurve aGTSMC(aC);
+    GeomToStep_MakeCurve aGTSMC(aC, theLocalFactors);
     if (!aGTSMC.IsDone())
     {
       return Standard_False;
@@ -217,7 +223,7 @@ Standard_Boolean TopoDSToStep_WireframeBuilder::
 
     if (aVFirst.IsNull() && aVLast.IsNull() && Precision::IsInfinite(aFirst) && Precision::IsInfinite(aLast))
     {
-      GeomToStep_MakeCurve aCurveMaker(aC);
+      GeomToStep_MakeCurve aCurveMaker(aC, theLocalFactors);
       if (aCurveMaker.IsDone())
       {
         aSGC = aCurveMaker.Value();
@@ -228,12 +234,12 @@ Standard_Boolean TopoDSToStep_WireframeBuilder::
     }
     if (aVFirst.IsNull())
     {
-      GeomToStep_MakeCartesianPoint aGTSMCP(aCA.Value(aFirst));
+      GeomToStep_MakeCartesianPoint aGTSMCP(aCA.Value(aFirst), theLocalFactors.LengthFactor());
       aSGCP1 = aGTSMCP.Value();
     }
     if (aVLast.IsNull())
     {
-      GeomToStep_MakeCartesianPoint aGTSMCP(aCA.Value(aLast));
+      GeomToStep_MakeCartesianPoint aGTSMCP(aCA.Value(aLast), theLocalFactors.LengthFactor());
       aSGCP2 = aGTSMCP.Value();
     }
 
@@ -276,7 +282,7 @@ Standard_Boolean TopoDSToStep_WireframeBuilder::
       if (aLength >= Precision::Confusion())
       {
         Handle(Geom_Line) aL = new Geom_Line(aPnt1, gp_Dir(aV));
-        GeomToStep_MakeLine aGTSML(aL);
+        GeomToStep_MakeLine aGTSML(aL, theLocalFactors);
         aSGC = aGTSML.Value();
         aSGC = MakeTrimmedCurve(aGTSML.Value(), aSGCP1, aSGCP2, 0, aLength, Standard_True);
       }
@@ -304,7 +310,7 @@ Standard_Boolean TopoDSToStep_WireframeBuilder::
       aMult.SetValue(1, 2);
       aMult.SetValue(Nbpt, 2);
       Handle(Geom_Curve) aBSCurve = new Geom_BSplineCurve(aPoints, aKnots, aMult, 1);
-      GeomToStep_MakeCurve aGTSMC(aBSCurve);
+      GeomToStep_MakeCurve aGTSMC(aBSCurve, theLocalFactors);
       aSGC = aGTSMC.Value();
     }
   }
@@ -322,8 +328,9 @@ Standard_Boolean TopoDSToStep_WireframeBuilder::
 
 Standard_Boolean TopoDSToStep_WireframeBuilder::
   GetTrimmedCurveFromFace(const TopoDS_Face& aFace, 
-            MoniTool_DataMapOfShapeTransient& aMap, 
-            Handle(TColStd_HSequenceOfTransient)& aCurveList) const
+                          MoniTool_DataMapOfShapeTransient& aMap, 
+                          Handle(TColStd_HSequenceOfTransient)& aCurveList,
+                          const StepData_Factors& theLocalFactors) const
 {
   TopoDS_Shape curShape;
   TopoDS_Edge  curEdge;
@@ -333,15 +340,16 @@ Standard_Boolean TopoDSToStep_WireframeBuilder::
   for (exp.Init(aFace,TopAbs_EDGE); exp.More(); exp.Next()){
     curShape = exp.Current();
     curEdge  = TopoDS::Edge(curShape);
-    if (GetTrimmedCurveFromEdge(curEdge, aFace, aMap, aCurveList)) result = Standard_True;
+    if (GetTrimmedCurveFromEdge(curEdge, aFace, aMap, aCurveList, theLocalFactors)) result = Standard_True;
   }
   return result;
 }
 
 Standard_Boolean TopoDSToStep_WireframeBuilder::
   GetTrimmedCurveFromShape(const TopoDS_Shape& aShape, 
-                          MoniTool_DataMapOfShapeTransient& aMap,  
-                          Handle(TColStd_HSequenceOfTransient)& aCurveList) const
+                           MoniTool_DataMapOfShapeTransient& aMap,  
+                           Handle(TColStd_HSequenceOfTransient)& aCurveList,
+                           const StepData_Factors& theLocalFactors) const
 {
   TopoDS_Iterator  It;
   Standard_Boolean result = Standard_False; //szv#4:S4163:12Mar99 `done` hid one from this, initialisation needed
@@ -351,7 +359,7 @@ Standard_Boolean TopoDSToStep_WireframeBuilder::
     case TopAbs_EDGE : {
       const TopoDS_Edge& curEdge = TopoDS::Edge(aShape);
       TopoDS_Face nulFace;
-      result = GetTrimmedCurveFromEdge(curEdge, nulFace, aMap, aCurveList);
+      result = GetTrimmedCurveFromEdge(curEdge, nulFace, aMap, aCurveList, theLocalFactors);
       break;
     }
     case TopAbs_WIRE : {
@@ -363,13 +371,13 @@ Standard_Boolean TopoDSToStep_WireframeBuilder::
       for (exp.Init(aShape,TopAbs_EDGE); exp.More(); exp.Next()){
        curShape = exp.Current();
        curEdge  = TopoDS::Edge(curShape);
-       if (GetTrimmedCurveFromEdge(curEdge, nulFace, aMap, aCurveList)) result = Standard_True;
+       if (GetTrimmedCurveFromEdge(curEdge, nulFace, aMap, aCurveList, theLocalFactors)) result = Standard_True;
       }
       break;
     }
     case TopAbs_FACE : {
       const TopoDS_Face& curFace = TopoDS::Face(aShape);
-      result = GetTrimmedCurveFromFace(curFace, aMap, aCurveList);
+      result = GetTrimmedCurveFromFace(curFace, aMap, aCurveList, theLocalFactors);
       break;
     }
     case TopAbs_SHELL : {
@@ -377,7 +385,7 @@ Standard_Boolean TopoDSToStep_WireframeBuilder::
       It.Initialize(Sh);
       for (;It.More();It.Next()) {
        TopoDS_Face curFace = TopoDS::Face(It.Value());
-       if (GetTrimmedCurveFromFace(curFace, aMap, aCurveList)) result = Standard_True;
+       if (GetTrimmedCurveFromFace(curFace, aMap, aCurveList, theLocalFactors)) result = Standard_True;
 #ifdef OCCT_DEBUG
        if(!result) {
          std::cout << "ERROR extracting trimmedCurve from Face" << std::endl;
@@ -391,7 +399,7 @@ Standard_Boolean TopoDSToStep_WireframeBuilder::
       It.Initialize(aShape);
       for (;It.More();It.Next()) {
        if  (It.Value().ShapeType() == TopAbs_SHELL) {
-         if (GetTrimmedCurveFromShape(It.Value(), aMap, aCurveList)) result = Standard_True;
+         if (GetTrimmedCurveFromShape(It.Value(), aMap, aCurveList, theLocalFactors)) result = Standard_True;
        }
       } 
       break;
@@ -408,7 +416,7 @@ Standard_Boolean TopoDSToStep_WireframeBuilder::
            result = GetTrimmedCurveFromFace(TopoDS::Face(It.Value()), aMap, aCurveList);
            break;
          } */
-       if (GetTrimmedCurveFromShape(It.Value(), aMap, aCurveList)) result = Standard_True;
+       if (GetTrimmedCurveFromShape(It.Value(), aMap, aCurveList, theLocalFactors)) result = Standard_True;
       }
       break;
     }
index 8f3f0dbbc58cbfe944ebd240a860e07fa7fa0f25..16936a2ae1b7338551fff16fc40d596c549633af 100644 (file)
@@ -25,6 +25,7 @@
 #include <TopoDSToStep_BuilderError.hxx>
 #include <TopoDSToStep_Root.hxx>
 #include <MoniTool_DataMapOfShapeTransient.hxx>
+class StepData_Factors;
 class TopoDS_Shape;
 class TopoDSToStep_Tool;
 class Transfer_FinderProcess;
@@ -43,9 +44,13 @@ public:
   
   Standard_EXPORT TopoDSToStep_WireframeBuilder();
   
-  Standard_EXPORT TopoDSToStep_WireframeBuilder(const TopoDS_Shape& S, TopoDSToStep_Tool& T, const Handle(Transfer_FinderProcess)& FP);
+  Standard_EXPORT TopoDSToStep_WireframeBuilder(const TopoDS_Shape& S,
+                                                TopoDSToStep_Tool& T,
+                                                const StepData_Factors& theLocalFactors);
   
-  Standard_EXPORT void Init (const TopoDS_Shape& S, TopoDSToStep_Tool& T, const Handle(Transfer_FinderProcess)& FP);
+  Standard_EXPORT void Init (const TopoDS_Shape& S,
+                             TopoDSToStep_Tool& T,
+                             const StepData_Factors& theLocalFactors);
   
   Standard_EXPORT TopoDSToStep_BuilderError Error() const;
   
@@ -53,15 +58,25 @@ public:
   
   //! Extraction of Trimmed Curves from TopoDS_Edge for the
   //! Creation of a GeometricallyBoundedWireframeRepresentation
-  Standard_EXPORT Standard_Boolean GetTrimmedCurveFromEdge (const TopoDS_Edge& E, const TopoDS_Face& F, MoniTool_DataMapOfShapeTransient& M, Handle(TColStd_HSequenceOfTransient)& L) const;
+  Standard_EXPORT Standard_Boolean GetTrimmedCurveFromEdge (const TopoDS_Edge& E,
+                                                            const TopoDS_Face& F,
+                                                            MoniTool_DataMapOfShapeTransient& M,
+                                                            Handle(TColStd_HSequenceOfTransient)& L,
+                                                            const StepData_Factors& theLocalFactors) const;
   
   //! Extraction of Trimmed Curves from TopoDS_Face for the
   //! Creation of a GeometricallyBoundedWireframeRepresentation
-  Standard_EXPORT Standard_Boolean GetTrimmedCurveFromFace (const TopoDS_Face& F, MoniTool_DataMapOfShapeTransient& M, Handle(TColStd_HSequenceOfTransient)& L) const;
+  Standard_EXPORT Standard_Boolean GetTrimmedCurveFromFace (const TopoDS_Face& F,
+                                                            MoniTool_DataMapOfShapeTransient& M,
+                                                            Handle(TColStd_HSequenceOfTransient)& L,
+                                                            const StepData_Factors& theLocalFactors) const;
   
   //! Extraction of Trimmed Curves from any TopoDS_Shape for the
   //! Creation of a GeometricallyBoundedWireframeRepresentation
-  Standard_EXPORT Standard_Boolean GetTrimmedCurveFromShape (const TopoDS_Shape& S, MoniTool_DataMapOfShapeTransient& M, Handle(TColStd_HSequenceOfTransient)& L) const;
+  Standard_EXPORT Standard_Boolean GetTrimmedCurveFromShape (const TopoDS_Shape& S,
+                                                             MoniTool_DataMapOfShapeTransient& M,
+                                                             Handle(TColStd_HSequenceOfTransient)& L,
+                                                             const StepData_Factors& theLocalFactors) const;
 
 
 
index 7ceff7987b5b1faca2cdfd15673d668a35751b38..d03c76978408c235736d0bbd8940e3dee3c5e673 100644 (file)
@@ -30,6 +30,7 @@
 #include <STEPControl_StepModelType.hxx>
 #include <STEPControl_Writer.hxx>
 #include <StepData_StepModel.hxx>
+#include <StepData_Factors.hxx>
 #include <StepGeom_Axis2Placement3d.hxx>
 #include <StepSelect_Activator.hxx>
 #include <STEPSelections_AssemblyExplorer.hxx>
@@ -332,7 +333,8 @@ static Standard_Integer steptrans (Draw_Interpretor& di, Standard_Integer argc,
   if (n2 > 0) ax2 = Handle(StepGeom_Axis2Placement3d)::DownCast
     (XSDRAW::Entity(n2));
   StepToTopoDS_MakeTransformed mktrans;
-  if (mktrans.Compute (ax1,ax2)) {
+  StepData_Factors aLocalFactors;
+  if (mktrans.Compute (ax1,ax2, aLocalFactors)) {
     TopLoc_Location loc (mktrans.Transformation());
     shape.Move (loc);
 //    mktrans.Transform (shape);