]> OCCT Git - occt.git/commitdiff
0032681: Data Exchange - Missed dimension after STEP export
authorichesnok <ichesnok@opencascade.com>
Thu, 23 Mar 2023 09:54:10 +0000 (09:54 +0000)
committerichesnok <ichesnok@opencascade.com>
Wed, 2 Aug 2023 09:24:47 +0000 (10:24 +0100)
Changed level of detalisation (TopAbs_EDGE -> TopAbs_VERTEX by default)

src/IGESControl/IGESControl_ActorWrite.cxx
src/IGESControl/IGESControl_Writer.cxx
src/IGESToBRep/IGESToBRep_Actor.cxx
src/IGESToBRep/IGESToBRep_Reader.cxx
src/XSAlgo/XSAlgo_AlgoContainer.cxx
src/XSAlgo/XSAlgo_AlgoContainer.hxx
tests/bugs/step/bug32681 [new file with mode: 0644]

index 98a187746a551d784db0ed283dc2e534d05c7e9a..de6ca78fcb255042a6897ecbae62a5d4a513d4d1 100644 (file)
@@ -73,7 +73,7 @@ Handle(Transfer_Binder)  IGESControl_ActorWrite::Transfer
     shape = XSAlgo::AlgoContainer()->ProcessShape( shape, Tol, maxTol, 
                                                    "write.iges.resource.name", 
                                                    "write.iges.sequence", info,
-                                                   theProgress );
+                                                   theProgress, false, TopAbs_EDGE);
 //  modified by NIZHNY-EAP Tue Aug 29 11:17:01 2000 ___END___
 
     BRepToIGES_BREntity   BR0; BR0.SetModel(modl);  BR0.SetTransferProcess(FP);
index b22ec97e11f714ec855d8bc6e94e450468f96446..f1608adededc11975318fb23da6203f830e3565c 100644 (file)
@@ -92,7 +92,7 @@ Standard_Boolean IGESControl_Writer::AddShape (const TopoDS_Shape& theShape,
   TopoDS_Shape Shape = XSAlgo::AlgoContainer()->ProcessShape( theShape, Tol, maxTol, 
                                                               "write.iges.resource.name", 
                                                               "write.iges.sequence", info,
-                                                              aPS.Next());
+                                                              aPS.Next(), false, TopAbs_EDGE);
   if (!aPS.More())
     return Standard_False;
 
index 0304ddec5ba0f75fcd784d3c646e81faa09c7010..12638809c50b9cd516daac22173659c374fe682c 100644 (file)
@@ -198,7 +198,7 @@ Handle(Transfer_Binder) IGESToBRep_Actor::Transfer
                                                   "read.iges.resource.name",
                                                   "read.iges.sequence",
                                                   info, mymodel->ReShape(),
-                                                  aPS.Next());
+                                                  aPS.Next(), false, TopAbs_EDGE);
     XSAlgo::AlgoContainer()->MergeTransferInfo(TP, info, nbTPitems);
   }
 
index e1f2a409db0354ab28497f9d36ca236f1a39ea7b..0230ca403fdc538aac1edde19eb94a84a86534ee 100644 (file)
@@ -552,7 +552,7 @@ Standard_Boolean  IGESToBRep_Reader::Transfer(const Standard_Integer num,
     shape = XSAlgo::AlgoContainer()->ProcessShape( shape, eps*CAS.GetUnitFactor(), CAS.GetMaxTol(),
                                                    "read.iges.resource.name", 
                                                    "read.iges.sequence", info,
-                                                   aPS.Next() );
+                                                   aPS.Next(), false, TopAbs_EDGE);
     if (aPS.UserBreak())
       return Standard_False;
 
index 332a392be520090bd0e81a854efdb21581addc1c..9f639cbd687db2f46647d6bce832ab8fcd0d7616 100644 (file)
@@ -92,7 +92,8 @@ TopoDS_Shape XSAlgo_AlgoContainer::ProcessShape(const TopoDS_Shape& theShape,
                                                 Handle(Standard_Transient)& theInfo,
                                                 const Handle(ShapeBuild_ReShape)& theReShape,
                                                 const Message_ProgressRange& theProgress,
-                                                const Standard_Boolean theNonManifold) const
+                                                const Standard_Boolean theNonManifold,
+                                                const TopAbs_ShapeEnum theDetalisationLevel) const
 {
   if (theShape.IsNull())
   {
@@ -114,7 +115,7 @@ TopoDS_Shape XSAlgo_AlgoContainer::ProcessShape(const TopoDS_Shape& theShape,
         aRscfile = thePrscfile;
       aContext = new ShapeProcess_ShapeContext(theShape, aRscfile);
     }
-    aContext->SetDetalisation(TopAbs_EDGE);
+    aContext->SetDetalisation(theDetalisationLevel);
   }
   aContext->SetNonManifold(theNonManifold);
   theInfo = aContext;
@@ -199,12 +200,13 @@ TopoDS_Shape XSAlgo_AlgoContainer::ProcessShape(const TopoDS_Shape& theShape,
                                                 const Standard_CString thePseq,
                                                 Handle(Standard_Transient)& theInfo,
                                                 const Message_ProgressRange& theProgress,
-                                                const Standard_Boolean theNonManifold) const
+                                                const Standard_Boolean theNonManifold,
+                                                const TopAbs_ShapeEnum theDetalisationLevel) const
 {
   Handle(ShapeBuild_ReShape) aReShape = new ShapeBuild_ReShape();
   return ProcessShape(theShape, thePrec, theMaxTol, thePrscfile,
                       thePseq, theInfo, aReShape, theProgress, 
-                      theNonManifold);
+                      theNonManifold, theDetalisationLevel);
 }
 
 //=======================================================================
index 122051e42b8ea2ef7947fdafc46cad483e8a7723..c4f33071c099757ed4000eb898e3cd2e7d553ecb 100644 (file)
 #include <Standard.hxx>
 #include <Standard_Type.hxx>
 
-#include <Standard_Transient.hxx>
-#include <Standard_Integer.hxx>
 #include <Message_ProgressRange.hxx>
+#include <Standard_Integer.hxx>
+#include <Standard_Transient.hxx>
+#include <TopAbs_ShapeEnum.hxx>
 
 class ShapeBuild_ReShape;
 class XSAlgo_ToolContainer;
@@ -71,7 +72,8 @@ public:
                                                      const Standard_CString       thePseq,
                                                      Handle(Standard_Transient)&  theInfo,
                                                      const Message_ProgressRange& theProgress = Message_ProgressRange(),
-                                                     const Standard_Boolean       theNonManifold = Standard_False) const;
+                                                     const Standard_Boolean       theNonManifold = Standard_False,
+                                                     const TopAbs_ShapeEnum theDetalisationLevel = TopAbs_VERTEX) const;
 
   //! Does shape processing with specified tolerances
   //! @param[in] theShape shape to process
@@ -92,7 +94,8 @@ public:
                                                     Handle(Standard_Transient)&       theInfo,
                                                     const Handle(ShapeBuild_ReShape)& theReShape,
                                                     const Message_ProgressRange&      theProgress = Message_ProgressRange(),
-                                                    const Standard_Boolean            theNonManifold = Standard_False) const;
+                                                    const Standard_Boolean            theNonManifold = Standard_False,
+                                                    const TopAbs_ShapeEnum theDetalisationLevel = TopAbs_VERTEX) const;
   
   //! Checks quality of pcurve of the edge on the given face,
   //! and corrects it if necessary.
diff --git a/tests/bugs/step/bug32681 b/tests/bugs/step/bug32681
new file mode 100644 (file)
index 0000000..2f3e7a8
--- /dev/null
@@ -0,0 +1,27 @@
+puts "=================================="
+puts "0032681: Data Exchange - Missed dimension after STEP export"
+puts "Check adding of dimension"
+puts "=================================="
+
+pload DCAF
+
+ReadStep D [locate_data_file bug32681.stp]
+XGetOneShape s D
+explode s V
+XAddSubShape D s_1 0:1:1:1
+XAddSubShape D s_84 0:1:1:1
+XAddDimension D 0:1:1:1:57 0:1:1:1:58
+param write.step.schema 5
+param write.surfacecurve.mode 0
+set tmpFile ${imagedir}/tmpFile.stp
+WriteStep D $tmpFile
+Close D
+ReadStep D1 $tmpFile
+set str [XDumpDGTs D1 all]
+if {[string first "0:1:1:1:57" $str] == -1 || [string first "0:1:1:1:58" $str] == -1} {
+  puts "Error: don't find subshape"
+}
+Close D1
+file delete $tmpFile
+param write.step.schema 4
+param write.surfacecurve.mode 1