diff --git a/src/BRepToIGES/BRepToIGES_BREntity.cxx b/src/BRepToIGES/BRepToIGES_BREntity.cxx index 2487684fa8..be5ecdfdae 100644 --- a/src/BRepToIGES/BRepToIGES_BREntity.cxx +++ b/src/BRepToIGES/BRepToIGES_BREntity.cxx @@ -370,6 +370,18 @@ Standard_Boolean BRepToIGES_BREntity::GetPCurveMode () const { return myPCurveMode; } + +void BRepToIGES_BREntity::SetConvertSurfaceMode(const Standard_Boolean theVal) +{ + Interface_Static::SetIVal("write.convertsurface.mode", theVal); + myConvSurface = theVal; +} + +Standard_EXPORT void BRepToIGES_BREntity::SetPCurveMode(const Standard_Boolean theVal) +{ + Interface_Static::SetIVal("write.surfacecurve.mode", theVal); + myPCurveMode = theVal; +} //======================================================================= //function : ~BRepToIGES_BREntity diff --git a/src/BRepToIGES/BRepToIGES_BREntity.hxx b/src/BRepToIGES/BRepToIGES_BREntity.hxx index 18247ccf67..aa2577cedc 100644 --- a/src/BRepToIGES/BRepToIGES_BREntity.hxx +++ b/src/BRepToIGES/BRepToIGES_BREntity.hxx @@ -109,15 +109,24 @@ public: //! Returns mode for writing pcurves //! (value of parameter write.surfacecurve.mode) Standard_EXPORT Standard_Boolean GetPCurveMode() const; + + Standard_EXPORT void SetConvertSurfaceMode(const Standard_Boolean theVal); + + Standard_EXPORT void SetPCurveMode(const Standard_Boolean theVal); Standard_EXPORT virtual ~BRepToIGES_BREntity(); -private: - Handle(IGESData_IGESModel) TheModel; - Standard_Real TheUnitFactor; +protected: + Standard_Boolean myConvSurface; Standard_Boolean myPCurveMode; + +private: + + Handle(IGESData_IGESModel) TheModel; + Standard_Real TheUnitFactor; Handle(Transfer_FinderProcess) TheMap; + }; #endif // _BRepToIGES_BREntity_HeaderFile diff --git a/src/BRepToIGESBRep/BRepToIGESBRep_Entity.cxx b/src/BRepToIGESBRep/BRepToIGESBRep_Entity.cxx index 19264ed464..d3dc985037 100644 --- a/src/BRepToIGESBRep/BRepToIGESBRep_Entity.cxx +++ b/src/BRepToIGESBRep/BRepToIGESBRep_Entity.cxx @@ -494,7 +494,7 @@ Handle(IGESSolid_Face) BRepToIGESBRep_Entity ::TransferFace(const TopoDS_Face& s GeomToIGES_GeomSurface GS; //S4181 pdn 17.04.99 Boolean flags in order to define write of elementary surfaces added. GS.SetBRepMode(Standard_True); - GS.SetAnalyticMode ( Interface_Static::IVal("write.convertsurface.mode") ==0 ); + GS.SetAnalyticMode (myConvSurface == 0 ); GS.SetModel(GetModel()); Handle(Geom_Surface) st; diff --git a/src/BRepToIGESBRep/BRepToIGESBRep_Entity.hxx b/src/BRepToIGESBRep/BRepToIGESBRep_Entity.hxx index 60332515c3..bf31556a95 100644 --- a/src/BRepToIGESBRep/BRepToIGESBRep_Entity.hxx +++ b/src/BRepToIGESBRep/BRepToIGESBRep_Entity.hxx @@ -140,7 +140,6 @@ private: Handle(IGESSolid_EdgeList) myEdgeList; Handle(IGESSolid_VertexList) myVertexList; - }; diff --git a/src/GeomToIGES/GeomToIGES_GeomCurve.cxx b/src/GeomToIGES/GeomToIGES_GeomCurve.cxx index 423ceed56d..1f398234bb 100644 --- a/src/GeomToIGES/GeomToIGES_GeomCurve.cxx +++ b/src/GeomToIGES/GeomToIGES_GeomCurve.cxx @@ -87,6 +87,7 @@ GeomToIGES_GeomCurve::GeomToIGES_GeomCurve() :GeomToIGES_GeomEntity() { + myOffsetModeIVal = Interface_Static::IVal("write.iges.offset.mode"); } @@ -98,6 +99,7 @@ GeomToIGES_GeomCurve::GeomToIGES_GeomCurve (const GeomToIGES_GeomEntity& GE) :GeomToIGES_GeomEntity(GE) { + myOffsetModeIVal = Interface_Static::IVal("write.iges.offset.mode"); } @@ -815,7 +817,7 @@ Handle(IGESData_IGESEntity) GeomToIGES_GeomCurve::TransferCurve if (Precision::IsNegativeInfinite(Udeb)) U1 = -Precision::Infinite(); if (Precision::IsPositiveInfinite(Ufin)) U2 = Precision::Infinite(); - if (Interface_Static::IVal("write.iges.offset.mode") == 0) + if (myOffsetModeIVal == 0) { res = TransferCurve(GeomConvert::CurveToBSplineCurve(start),U1,U2); return res; @@ -853,3 +855,14 @@ Handle(IGESData_IGESEntity) GeomToIGES_GeomCurve::TransferCurve res = OffsetC; return res; } + +void GeomToIGES_GeomCurve::SetOffsetModeIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("write.iges.offset.mode", theVal); + myOffsetModeIVal = theVal; +} + +Standard_Integer GeomToIGES_GeomCurve::GetOffsetModeIVal() const +{ + return myOffsetModeIVal; +} diff --git a/src/GeomToIGES/GeomToIGES_GeomCurve.hxx b/src/GeomToIGES/GeomToIGES_GeomCurve.hxx index 6eebea1dab..75fa28ba24 100644 --- a/src/GeomToIGES/GeomToIGES_GeomCurve.hxx +++ b/src/GeomToIGES/GeomToIGES_GeomCurve.hxx @@ -92,7 +92,9 @@ public: Standard_EXPORT Handle(IGESData_IGESEntity) TransferCurve (const Handle(Geom_OffsetCurve)& start, const Standard_Real Udeb, const Standard_Real Ufin); + Standard_EXPORT void SetOffsetModeIVal(const Standard_Integer theVal); + Standard_EXPORT Standard_Integer GetOffsetModeIVal() const; protected: @@ -104,7 +106,7 @@ protected: private: - + Standard_Integer myOffsetModeIVal; }; diff --git a/src/GeomToIGES/GeomToIGES_GeomSurface.cxx b/src/GeomToIGES/GeomToIGES_GeomSurface.cxx index 7ca12a35a8..a1831122db 100644 --- a/src/GeomToIGES/GeomToIGES_GeomSurface.cxx +++ b/src/GeomToIGES/GeomToIGES_GeomSurface.cxx @@ -100,6 +100,7 @@ GeomToIGES_GeomSurface::GeomToIGES_GeomSurface() { myBRepMode = Standard_False; myAnalytic = Standard_False; + myPlaneModeIVal = Interface_Static::IVal("write.iges.plane.mode"); } @@ -112,6 +113,7 @@ GeomToIGES_GeomSurface::GeomToIGES_GeomSurface(const GeomToIGES_GeomEntity& GE) { myBRepMode = Standard_False; myAnalytic = Standard_False; + myPlaneModeIVal = Interface_Static::IVal("write.iges.plane.mode"); } @@ -537,7 +539,7 @@ Handle(IGESData_IGESEntity) GeomToIGES_GeomSurface::TransferSurface(const Handle if (start.IsNull()) { return res; } - if (Interface_Static::IVal("write.iges.plane.mode") == 0){ + if (myPlaneModeIVal == 0){ Handle(IGESGeom_Plane) aPlane = new IGESGeom_Plane; Standard_Real A,B,C,D; start->Coefficients(A,B,C,D); @@ -1347,3 +1349,13 @@ void GeomToIGES_GeomSurface::SetAnalyticMode(const Standard_Boolean flag) myAnalytic = flag; } +void GeomToIGES_GeomSurface::SetPlaneModeIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("write.iges.plane.mode", theVal); + myPlaneModeIVal = theVal; +} + +Standard_Integer GeomToIGES_GeomSurface::GetPlaneModeIVal() const +{ + return myPlaneModeIVal; +} diff --git a/src/GeomToIGES/GeomToIGES_GeomSurface.hxx b/src/GeomToIGES/GeomToIGES_GeomSurface.hxx index 28e7da67dc..38e289e5ee 100644 --- a/src/GeomToIGES/GeomToIGES_GeomSurface.hxx +++ b/src/GeomToIGES/GeomToIGES_GeomSurface.hxx @@ -129,7 +129,9 @@ public: //! Setst flag for writing elementary surfaces Standard_EXPORT void SetAnalyticMode (const Standard_Boolean flag); + Standard_EXPORT void SetPlaneModeIVal(const Standard_Integer theVal); + Standard_EXPORT Standard_Integer GetPlaneModeIVal() const; protected: @@ -145,6 +147,7 @@ private: Standard_Real TheLength; Standard_Boolean myBRepMode; Standard_Boolean myAnalytic; + Standard_Integer myPlaneModeIVal; }; diff --git a/src/IGESControl/IGESControl_ActorWrite.cxx b/src/IGESControl/IGESControl_ActorWrite.cxx index 836803c232..f42e9ec984 100644 --- a/src/IGESControl/IGESControl_ActorWrite.cxx +++ b/src/IGESControl/IGESControl_ActorWrite.cxx @@ -35,7 +35,12 @@ IMPLEMENT_STANDARD_RTTIEXT(IGESControl_ActorWrite,Transfer_ActorOfFinderProcess) -IGESControl_ActorWrite::IGESControl_ActorWrite () { ModeTrans() = 0; } +IGESControl_ActorWrite::IGESControl_ActorWrite () +{ + ModeTrans() = 0; + myPrecRVal = Interface_Static::RVal("write.precision.val"); + myMaxPrecRVal = Interface_Static::RVal("read.maxprecision.val"); +} Standard_Boolean IGESControl_ActorWrite::Recognize (const Handle(Transfer_Finder)& start) @@ -70,8 +75,8 @@ Handle(Transfer_Binder) IGESControl_ActorWrite::Transfer if (shape.IsNull()) return NullResult(); // modified by NIZHNY-EAP Tue Aug 29 11:16:54 2000 ___BEGIN___ Handle(Standard_Transient) info; - Standard_Real Tol = Interface_Static::RVal("write.precision.val"); - Standard_Real maxTol = Interface_Static::RVal("read.maxprecision.val"); + Standard_Real Tol = myPrecRVal; + Standard_Real maxTol = myMaxPrecRVal; shape = XSAlgo::AlgoContainer()->ProcessShape( shape, Tol, maxTol, "write.iges.resource.name", "write.iges.sequence", info, @@ -113,3 +118,25 @@ Handle(Transfer_Binder) IGESControl_ActorWrite::Transfer return NullResult(); } + +void IGESControl_ActorWrite::SetPrecRVal(const Standard_Real theVal) +{ + Interface_Static::SetRVal("write.precision.val", theVal); + myPrecRVal = theVal; +} + +void IGESControl_ActorWrite::SetMaxPrecRVal(const Standard_Real theVal) +{ + Interface_Static::SetRVal("read.maxprecision.val", theVal); + myMaxPrecRVal = theVal; +} + +Standard_Real IGESControl_ActorWrite::GetPrecRVal() const +{ + return myPrecRVal; +} + +Standard_Real IGESControl_ActorWrite::GetMaxPrecRVal() const +{ + return myMaxPrecRVal; +} diff --git a/src/IGESControl/IGESControl_ActorWrite.hxx b/src/IGESControl/IGESControl_ActorWrite.hxx index e6a17a8ea8..52b3be562e 100644 --- a/src/IGESControl/IGESControl_ActorWrite.hxx +++ b/src/IGESControl/IGESControl_ActorWrite.hxx @@ -51,8 +51,13 @@ public: const Handle(Transfer_FinderProcess)& FP, const Message_ProgressRange& theProgress = Message_ProgressRange()) Standard_OVERRIDE; + Standard_EXPORT void SetPrecRVal(const Standard_Real theVal); + Standard_EXPORT void SetMaxPrecRVal(const Standard_Real theVal); + Standard_EXPORT Standard_Real GetPrecRVal() const; + + Standard_EXPORT Standard_Real GetMaxPrecRVal() const; DEFINE_STANDARD_RTTIEXT(IGESControl_ActorWrite,Transfer_ActorOfFinderProcess) @@ -63,7 +68,8 @@ protected: private: - + Standard_Real myPrecRVal; + Standard_Real myMaxPrecRVal; }; diff --git a/src/IGESControl/IGESControl_IGESBoundary.cxx b/src/IGESControl/IGESControl_IGESBoundary.cxx index 3169a9a38a..7fee16d768 100644 --- a/src/IGESControl/IGESControl_IGESBoundary.cxx +++ b/src/IGESControl/IGESControl_IGESBoundary.cxx @@ -52,6 +52,7 @@ IMPLEMENT_STANDARD_RTTIEXT(IGESControl_IGESBoundary,IGESToBRep_IGESBoundary) //======================================================================= IGESControl_IGESBoundary::IGESControl_IGESBoundary() : IGESToBRep_IGESBoundary() { + myParModeIVal = Interface_Static::IVal("read.stdsameparameter.mode"); } //======================================================================= @@ -62,6 +63,7 @@ IGESControl_IGESBoundary::IGESControl_IGESBoundary() : IGESToBRep_IGESBoundary() IGESControl_IGESBoundary::IGESControl_IGESBoundary(const IGESToBRep_CurveAndSurface& CS) : IGESToBRep_IGESBoundary (CS) { + myParModeIVal = Interface_Static::IVal("read.stdsameparameter.mode"); } //======================================================================= @@ -302,7 +304,7 @@ static Standard_Boolean Connect (const Handle(ShapeAnalysis_Wire)& theSAW, #endif } //#74 rln 10.03.99 S4135: handling use of BRepLib::SameParameter by new static parameter - if (Interface_Static::IVal ("read.stdsameparameter.mode")) { + if (myParModeIVal) { Standard_Real first, last; BRep_Tool::Range(edge3d,first,last); // pdn 08.04.99 S4135 optimizing in computation of SPTol @@ -405,3 +407,13 @@ static Standard_Boolean Connect (const Handle(ShapeAnalysis_Wire)& theSAW, return okCurve; } +void IGESControl_IGESBoundary::SetParModeIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("read.stdsameparameter.mode", theVal); + myParModeIVal = theVal; +} + +Standard_Integer IGESControl_IGESBoundary::GetParModeIVal() const +{ + return myParModeIVal; +} \ No newline at end of file diff --git a/src/IGESControl/IGESControl_IGESBoundary.hxx b/src/IGESControl/IGESControl_IGESBoundary.hxx index 838508b2d7..658c6509d0 100644 --- a/src/IGESControl/IGESControl_IGESBoundary.hxx +++ b/src/IGESControl/IGESControl_IGESBoundary.hxx @@ -54,12 +54,20 @@ public: //! wire to contain only closed representation. Standard_EXPORT virtual void Check (const Standard_Boolean result, const Standard_Boolean checkclosure, const Standard_Boolean okCurve3d, const Standard_Boolean okCurve2d) Standard_OVERRIDE; + Standard_EXPORT void SetParModeIVal(const Standard_Integer theVal); + + Standard_EXPORT Standard_Integer GetParModeIVal() const; + DEFINE_STANDARD_RTTIEXT(IGESControl_IGESBoundary,IGESToBRep_IGESBoundary) protected: Standard_EXPORT virtual Standard_Boolean Transfer (Standard_Boolean& okCurve, Standard_Boolean& okCurve3d, Standard_Boolean& okCurve2d, const Handle(IGESData_IGESEntity)& icurve3d, const Handle(ShapeExtend_WireData)& scurve3d, const Standard_Boolean usescurve, const Standard_Boolean toreverse3d, const Handle(IGESData_HArray1OfIGESEntity)& curves2d, const Standard_Boolean toreverse2d, const Standard_Integer number, Handle(ShapeExtend_WireData)& lsewd) Standard_OVERRIDE; +private: + + Standard_Integer myParModeIVal; + }; #endif // _IGESControl_IGESBoundary_HeaderFile diff --git a/src/IGESControl/IGESControl_Reader.cxx b/src/IGESControl/IGESControl_Reader.cxx index 8d4142b79d..0e6637e0b7 100644 --- a/src/IGESControl/IGESControl_Reader.cxx +++ b/src/IGESControl/IGESControl_Reader.cxx @@ -61,7 +61,7 @@ IGESControl_Reader::IGESControl_Reader () SetWS (new XSControl_WorkSession); SetNorm("IGES"); Standard_Integer onlyvisible = Interface_Static::IVal("read.iges.onlyvisible"); - theReadOnlyVisible = (onlyvisible == 1); + myOnlyVisIVal = (onlyvisible == 1); } @@ -77,7 +77,7 @@ IGESControl_Reader::IGESControl_Reader SetWS (WS,scratch); SetNorm ("IGES"); Standard_Integer onlyvisible = Interface_Static::IVal("read.iges.onlyvisible"); - theReadOnlyVisible = (onlyvisible == 1); + myOnlyVisIVal = (onlyvisible == 1); } @@ -114,14 +114,14 @@ Standard_Integer IGESControl_Reader::NbRootsForTransfer() Interface_ShareFlags SH (model,protocol); // sln 11.06.2002 OCC448 - Interface_Static::SetIVal("read.iges.onlyvisible",theReadOnlyVisible); + Interface_Static::SetIVal("read.iges.onlyvisible",myOnlyVisIVal); Standard_Integer nb = model->NbEntities(); for (Standard_Integer i = 1; i <= nb; i ++) { Handle(IGESData_IGESEntity) ent = model->Entity(i); if ( SH.IsShared(ent) || ! actor->Recognize (ent) ) continue; // on ajoute un traitement pour ne prendre que les entites visibles - if ( ! theReadOnlyVisible || ent->BlankStatus() == 0 ) { + if ( ! myOnlyVisIVal || ent->BlankStatus() == 0 ) { theroots.Append(ent); } } @@ -320,3 +320,14 @@ void IGESControl_Reader::PrintTransferInfo } } } + +void IGESControl_Reader::SetOnlyVisibleIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("read.iges.onlyvisible", theVal); + myOnlyVisIVal = theVal; +} + +Standard_Integer IGESControl_Reader::GetOnlyVisibleIVal() const +{ + return myOnlyVisIVal; +} diff --git a/src/IGESControl/IGESControl_Reader.hxx b/src/IGESControl/IGESControl_Reader.hxx index 8914615936..b6646809ac 100644 --- a/src/IGESControl/IGESControl_Reader.hxx +++ b/src/IGESControl/IGESControl_Reader.hxx @@ -97,7 +97,9 @@ public: //! Prints Statistics and check list for Transfer Standard_EXPORT void PrintTransferInfo (const IFSelect_PrintFail failwarn, const IFSelect_PrintCount mode) const; + Standard_EXPORT void SetOnlyVisibleIVal(const Standard_Integer theVal); + Standard_EXPORT Standard_Integer GetOnlyVisibleIVal() const; protected: @@ -110,7 +112,7 @@ private: - Standard_Boolean theReadOnlyVisible; + Standard_Boolean myOnlyVisIVal; }; diff --git a/src/IGESControl/IGESControl_Reader.lxx b/src/IGESControl/IGESControl_Reader.lxx index 3116f1db60..c09389ff50 100644 --- a/src/IGESControl/IGESControl_Reader.lxx +++ b/src/IGESControl/IGESControl_Reader.lxx @@ -18,7 +18,7 @@ inline void IGESControl_Reader::SetReadVisible (const Standard_Boolean ReadRoot) { - theReadOnlyVisible = ReadRoot; + myOnlyVisIVal = ReadRoot; } @@ -29,5 +29,5 @@ inline void IGESControl_Reader::SetReadVisible (const Standard_Boolean ReadRoot) inline Standard_Boolean IGESControl_Reader::GetReadVisible ()const { - return theReadOnlyVisible; + return myOnlyVisIVal; } diff --git a/src/IGESControl/IGESControl_Writer.cxx b/src/IGESControl/IGESControl_Writer.cxx index 735f49ac06..1a4518a114 100644 --- a/src/IGESControl/IGESControl_Writer.cxx +++ b/src/IGESControl/IGESControl_Writer.cxx @@ -54,20 +54,29 @@ IGESControl_Writer::IGESControl_Writer () myIsComputed (Standard_False) { // faudrait aussi (?) prendre les parametres par defaut ... ? + myUnitCVal = Interface_Static::CVal("write.iges.unit"); + myBRepModeIVal = Interface_Static::IVal("write.iges.brep.mode"); + myPrecRVal = Interface_Static::RVal("write.precision.val"); + myMaxPrecRVal = Interface_Static::RVal("read.maxprecision.val"); + myPrecModeIVal = Interface_Static::IVal("write.precision.mode"); IGESControl_Controller::Init(); myEditor.Init(IGESSelect_WorkLibrary::DefineProtocol()); - myEditor.SetUnitName(Interface_Static::CVal ("write.iges.unit")); + myEditor.SetUnitName(myUnitCVal); myEditor.ApplyUnit(); - myWriteMode = Interface_Static::IVal ("write.iges.brep.mode"); myModel = myEditor.Model(); } IGESControl_Writer::IGESControl_Writer (const Standard_CString unit, const Standard_Integer modecr) : myTP (new Transfer_FinderProcess(10000)) , - myWriteMode (modecr) , myIsComputed (Standard_False) + myBRepModeIVal (modecr) , myIsComputed (Standard_False) { // faudrait aussi (?) prendre les parametres par defaut ... ? + myUnitCVal = Interface_Static::CVal("write.iges.unit"); + myBRepModeIVal = Interface_Static::IVal("write.iges.brep.mode"); + myPrecRVal = Interface_Static::RVal("write.precision.val"); + myMaxPrecRVal = Interface_Static::RVal("read.maxprecision.val"); + myPrecModeIVal = Interface_Static::IVal("write.precision.mode"); IGESControl_Controller::Init(); myEditor.Init(IGESSelect_WorkLibrary::DefineProtocol()); myEditor.SetUnitName(unit); @@ -80,7 +89,14 @@ IGESControl_Writer::IGESControl_Writer : myTP (new Transfer_FinderProcess(10000)) , myModel (model) , myEditor (model,IGESSelect_WorkLibrary::DefineProtocol()) , - myWriteMode (modecr) , myIsComputed (Standard_False) { } + myBRepModeIVal (modecr) , myIsComputed (Standard_False) +{ + myUnitCVal = Interface_Static::CVal("write.iges.unit"); + myBRepModeIVal = Interface_Static::IVal("write.iges.brep.mode"); + myPrecRVal = Interface_Static::RVal("write.precision.val"); + myMaxPrecRVal = Interface_Static::RVal("read.maxprecision.val"); + myPrecModeIVal = Interface_Static::IVal("write.precision.mode"); +} Standard_Boolean IGESControl_Writer::AddShape (const TopoDS_Shape& theShape, const Message_ProgressRange& theProgress) @@ -92,8 +108,8 @@ Standard_Boolean IGESControl_Writer::AddShape (const TopoDS_Shape& theShape, Message_ProgressScope aPS(theProgress, NULL, 2); // modified by NIZHNY-EAP Tue Aug 29 11:16:54 2000 ___BEGIN___ Handle(Standard_Transient) info; - Standard_Real Tol = Interface_Static::RVal("write.precision.val"); - Standard_Real maxTol = Interface_Static::RVal("read.maxprecision.val"); + Standard_Real Tol = myPrecRVal; + Standard_Real maxTol = myMaxPrecRVal; TopoDS_Shape Shape = XSAlgo::AlgoContainer()->ProcessShape( theShape, Tol, maxTol, "write.iges.resource.name", "write.iges.sequence", info, @@ -104,7 +120,7 @@ Standard_Boolean IGESControl_Writer::AddShape (const TopoDS_Shape& theShape, // modified by NIZHNY-EAP Tue Aug 29 11:17:01 2000 ___END___ BRepToIGES_BREntity B0; B0.SetTransferProcess(myTP); B0.SetModel(myModel); BRepToIGESBRep_Entity B1; B1.SetTransferProcess(myTP); B1.SetModel(myModel); - Handle(IGESData_IGESEntity) ent = myWriteMode? + Handle(IGESData_IGESEntity) ent = myBRepModeIVal? B1.TransferShape (Shape, aPS.Next()) : B0.TransferShape(Shape, aPS.Next()); if (!aPS.More()) return Standard_False; @@ -123,9 +139,9 @@ Standard_Boolean IGESControl_Writer::AddShape (const TopoDS_Shape& theShape, Standard_Real oldtol = myModel->GlobalSection().Resolution(), newtol; - Standard_Integer tolmod = Interface_Static::IVal("write.precision.mode"); + Standard_Integer tolmod = myPrecModeIVal; if (tolmod == 2) - newtol = Interface_Static::RVal("write.precision.val"); + newtol = myPrecRVal; else { ShapeAnalysis_ShapeTolerance stu; Standard_Real Tolv = stu.Tolerance (Shape, tolmod, TopAbs_VERTEX); @@ -271,3 +287,57 @@ Standard_Boolean IGESControl_Writer::Write return res; } + +void IGESControl_Writer::SetUnitCVal(const Standard_CString& theVal) +{ + Interface_Static::SetCVal("write.iges.unit", theVal); + myUnitCVal = theVal; +} + +void IGESControl_Writer::SetBRepModeIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("write.iges.brep.mode", theVal); + myBRepModeIVal = theVal; +} + +void IGESControl_Writer::SetPrecRVal(const Standard_Real theVal) +{ + Interface_Static::SetRVal("write.precision.val", theVal); + myPrecRVal = theVal; +} + +void IGESControl_Writer::SetMaxPrecRVal(const Standard_Real theVal) +{ + Interface_Static::SetRVal("read.maxprecision.val", theVal); + myMaxPrecRVal = theVal; +} + +void IGESControl_Writer::SetPrecModeIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("write.precision.mode", theVal); + myPrecModeIVal = theVal; +} + +Standard_CString IGESControl_Writer::GetUnitCVal() const +{ + return myUnitCVal; +} + +Standard_Integer IGESControl_Writer::GetBRepModeIVal() const +{ + return myBRepModeIVal; +} + +Standard_Real IGESControl_Writer::GetPrecRVal() const +{ + return myPrecRVal; +} + +Standard_Real IGESControl_Writer::GetMaxPrecRVal() const +{ + return myMaxPrecRVal; +} +Standard_Integer IGESControl_Writer::GetPrecModeIVal() const +{ + return myPrecModeIVal; +} diff --git a/src/IGESControl/IGESControl_Writer.hxx b/src/IGESControl/IGESControl_Writer.hxx index 5f74b9696b..453ec61492 100644 --- a/src/IGESControl/IGESControl_Writer.hxx +++ b/src/IGESControl/IGESControl_Writer.hxx @@ -115,12 +115,36 @@ public: //! if the processor could not create the file). Standard_EXPORT Standard_Boolean Write (const Standard_CString file, const Standard_Boolean fnes = Standard_False); + Standard_EXPORT void SetUnitCVal(const Standard_CString& theVal); + + Standard_EXPORT void SetBRepModeIVal(const Standard_Integer theVal); + + Standard_EXPORT void SetPrecRVal(const Standard_Real theVal); + + Standard_EXPORT void SetMaxPrecRVal(const Standard_Real theVal); + + Standard_EXPORT void SetPrecModeIVal(const Standard_Integer theVal); + + Standard_EXPORT Standard_CString GetUnitCVal() const; + + Standard_EXPORT Standard_Integer GetBRepModeIVal() const; + + Standard_EXPORT Standard_Real GetPrecRVal() const; + + Standard_EXPORT Standard_Real GetMaxPrecRVal() const; + + Standard_EXPORT Standard_Integer GetPrecModeIVal() const; + private: Handle(Transfer_FinderProcess) myTP; Handle(IGESData_IGESModel) myModel; IGESData_BasicEditor myEditor; - Standard_Integer myWriteMode; + Standard_CString myUnitCVal; + Standard_Integer myBRepModeIVal; + Standard_Real myPrecRVal; + Standard_Real myMaxPrecRVal; + Standard_Integer myPrecModeIVal; Standard_Boolean myIsComputed; }; diff --git a/src/IGESData/IGESData_IGESModel.cxx b/src/IGESData/IGESData_IGESModel.cxx index 1856b5ba72..36efb34d63 100644 --- a/src/IGESData/IGESData_IGESModel.cxx +++ b/src/IGESData/IGESData_IGESModel.cxx @@ -256,21 +256,20 @@ Standard_Boolean IGESData_IGESModel::ApplyStatic return Standard_True; } - Standard_CString val; if (param[0] == 'r') { - val = Interface_Static::CVal("write.iges.header.receiver"); - if (!val || val[0] == '\0') return Standard_False; - theheader.SetReceiveName (new TCollection_HAsciiString(val)); + myHeadRecCVal = Interface_Static::CVal("write.iges.header.receiver"); + if (!myHeadRecCVal || myHeadRecCVal[0] == '\0') return Standard_False; + theheader.SetReceiveName (new TCollection_HAsciiString(myHeadRecCVal)); } if (param[0] == 'a') { - val = Interface_Static::CVal("write.iges.header.author"); - if (!val || val[0] == '\0') return Standard_False; - theheader.SetAuthorName (new TCollection_HAsciiString(val)); + myHeadAuthorCVal = Interface_Static::CVal("write.iges.header.author"); + if (!myHeadAuthorCVal || myHeadAuthorCVal[0] == '\0') return Standard_False; + theheader.SetAuthorName (new TCollection_HAsciiString(myHeadAuthorCVal)); } if (param[0] == 'c') { - val = Interface_Static::CVal("write.iges.header.company"); - if (!val || val[0] == '\0') return Standard_False; - theheader.SetCompanyName (new TCollection_HAsciiString(val)); + myHeadCompCVal = Interface_Static::CVal("write.iges.header.company"); + if (!myHeadCompCVal || myHeadCompCVal[0] == '\0') return Standard_False; + theheader.SetCompanyName (new TCollection_HAsciiString(myHeadCompCVal)); } return Standard_True; } @@ -624,3 +623,36 @@ Handle(TCollection_HAsciiString) IGESData_IGESModel::StringLabel(const Handle(St } return label; } + +void IGESData_IGESModel::SetHeaderReciever(const Standard_CString& theVal) +{ + Interface_Static::SetCVal("write.iges.header.receiver", theVal); + myHeadRecCVal = theVal; +} + +void IGESData_IGESModel::SetHeaderAuthor(const Standard_CString& theVal) +{ + Interface_Static::SetCVal("write.iges.header.author", theVal); + myHeadRecCVal = theVal; +} + +void IGESData_IGESModel::SetHeaderCompany(const Standard_CString& theVal) +{ + Interface_Static::SetCVal("write.iges.header.company", theVal); + myHeadRecCVal = theVal; +} + +Standard_CString IGESData_IGESModel::GetHeaderReciever() const +{ + return myHeadRecCVal; +} + +Standard_CString IGESData_IGESModel::GetHeaderAuthor() const +{ + return myHeadAuthorCVal; +} + +Standard_CString IGESData_IGESModel::GetHeaderCompany() const +{ + return myHeadCompCVal; +} diff --git a/src/IGESData/IGESData_IGESModel.hxx b/src/IGESData/IGESData_IGESModel.hxx index c3224269cb..36ca4c3daf 100644 --- a/src/IGESData/IGESData_IGESModel.hxx +++ b/src/IGESData/IGESData_IGESModel.hxx @@ -152,7 +152,17 @@ public: //! i.e. a string "Dnn" with nn = directory entry number (2*N-1) Standard_EXPORT Handle(TCollection_HAsciiString) StringLabel (const Handle(Standard_Transient)& ent) const Standard_OVERRIDE; + Standard_EXPORT void SetHeaderReciever(const Standard_CString& theVal); + Standard_EXPORT void SetHeaderAuthor(const Standard_CString& theVal); + + Standard_EXPORT void SetHeaderCompany(const Standard_CString& theVal); + + Standard_EXPORT Standard_CString GetHeaderReciever() const; + + Standard_EXPORT Standard_CString GetHeaderAuthor() const; + + Standard_EXPORT Standard_CString GetHeaderCompany() const; DEFINE_STANDARD_RTTIEXT(IGESData_IGESModel,Interface_InterfaceModel) @@ -167,6 +177,10 @@ private: Handle(TColStd_HSequenceOfHAsciiString) thestart; IGESData_GlobalSection theheader; + Standard_CString myHeadRecCVal; + Standard_CString myHeadAuthorCVal; + Standard_CString myHeadCompCVal; + }; diff --git a/src/IGESToBRep/IGESToBRep_Actor.cxx b/src/IGESToBRep/IGESToBRep_Actor.cxx index 79b0de79c2..f170b87ee3 100644 --- a/src/IGESToBRep/IGESToBRep_Actor.cxx +++ b/src/IGESToBRep/IGESToBRep_Actor.cxx @@ -44,7 +44,10 @@ IMPLEMENT_STANDARD_RTTIEXT(IGESToBRep_Actor,Transfer_ActorOfTransientProcess) //purpose : //======================================================================= IGESToBRep_Actor::IGESToBRep_Actor () -{ thecontinuity = 0; theeps = 0.0001; } +{ + thecontinuity = 0; + theeps = 0.0001; +} //======================================================================= @@ -55,6 +58,11 @@ void IGESToBRep_Actor::SetModel (const Handle(Interface_InterfaceModel)& model) { themodel = model; theeps = Handle(IGESData_IGESModel)::DownCast(themodel)->GlobalSection().Resolution(); + myApproxd1IVal = Interface_Static::IVal("read.iges.bspline.approxd1.mode"); + myFaultyEntIVal = Interface_Static::IVal("read.iges.faulty.entities"); + myPrecModeIVal = Interface_Static::IVal("read.precision.mode"); + myPrecRVal = Interface_Static::RVal("read.precision.val");; + mySurfaceCurIVal = Interface_Static::IVal("read.surfacecurve.mode"); } @@ -149,7 +157,7 @@ Handle(Transfer_Binder) IGESToBRep_Actor::Transfer if (mymodel.IsNull() || ent.IsNull()) return NullResult(); Standard_Integer anum = mymodel->Number(start); - if (Interface_Static::IVal("read.iges.faulty.entities") == 0 && mymodel->IsErrorEntity(anum)) + if (myFaultyEntIVal == 0 && mymodel->IsErrorEntity(anum)) return NullResult(); TopoDS_Shape shape; @@ -170,15 +178,15 @@ Handle(Transfer_Binder) IGESToBRep_Actor::Transfer CAS.SetModel(mymodel); CAS.SetContinuity(thecontinuity); CAS.SetTransferProcess(TP); - Standard_Integer Ival = Interface_Static::IVal("read.precision.mode"); + Standard_Integer Ival = myPrecModeIVal; if ( Ival == 0) eps = mymodel->GlobalSection().Resolution(); else - eps = Interface_Static::RVal("read.precision.val"); //:10 ABV 11 Nov 97 + eps = myPrecRVal; //:10 ABV 11 Nov 97 //:10 eps = BRepAPI::Precision(); - Ival = Interface_Static::IVal("read.iges.bspline.approxd1.mode"); + Ival = myApproxd1IVal; CAS.SetModeApprox ( (Ival > 0) ); - Ival = Interface_Static::IVal("read.surfacecurve.mode"); + Ival = mySurfaceCurIVal; CAS.SetSurfaceCurve (Ival); if (eps > 1.E-08) { @@ -221,5 +229,62 @@ Handle(Transfer_Binder) IGESToBRep_Actor::Transfer } - Standard_Real IGESToBRep_Actor::UsedTolerance () const - { return theeps; } +Standard_Real IGESToBRep_Actor::UsedTolerance () const +{ + return theeps; +} + +void IGESToBRep_Actor::SetApproxd1IVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("read.iges.bspline.approxd1.mode", theVal); + myApproxd1IVal = theVal; +} + +void IGESToBRep_Actor::SetFaultyEntIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("read.iges.faulty.entities", theVal); + myFaultyEntIVal = myFaultyEntIVal; +} + +void IGESToBRep_Actor::SetPrecModeIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("read.precision.mode", theVal); + myPrecModeIVal = theVal; +} + +void IGESToBRep_Actor::SetPrecRVal(const Standard_Real theVal) +{ + Interface_Static::SetRVal("read.precision.val", theVal); + myPrecRVal = theVal; +} + +void IGESToBRep_Actor::SetSurfaceCurIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("read.surfacecurve.mode", theVal); + mySurfaceCurIVal = theVal; +} + +Standard_Integer IGESToBRep_Actor::GetApproxd1IVal() const +{ + return myApproxd1IVal; +} + +Standard_Integer IGESToBRep_Actor::GetFaultyEntIVal() const +{ + return myFaultyEntIVal; +} + +Standard_Integer IGESToBRep_Actor::GetPrecModeIVal() const +{ + return myPrecModeIVal; +} + +Standard_Real IGESToBRep_Actor::GetPrecRVal() const +{ + return myPrecRVal; +} + +Standard_Integer IGESToBRep_Actor::GetSurfaceCurIVal() const +{ + return mySurfaceCurIVal; +} diff --git a/src/IGESToBRep/IGESToBRep_Actor.hxx b/src/IGESToBRep/IGESToBRep_Actor.hxx index 2ad39d0df8..3b2c7f6021 100644 --- a/src/IGESToBRep/IGESToBRep_Actor.hxx +++ b/src/IGESToBRep/IGESToBRep_Actor.hxx @@ -68,7 +68,25 @@ public: //! the file or from statics Standard_EXPORT Standard_Real UsedTolerance() const; + Standard_EXPORT void SetApproxd1IVal(const Standard_Integer theVal); + Standard_EXPORT void SetFaultyEntIVal(const Standard_Integer theVal); + + Standard_EXPORT void SetPrecModeIVal(const Standard_Integer theVal); + + Standard_EXPORT void SetPrecRVal(const Standard_Real theVal); + + Standard_EXPORT void SetSurfaceCurIVal(const Standard_Integer theVal); + + Standard_EXPORT Standard_Integer GetApproxd1IVal() const; + + Standard_EXPORT Standard_Integer GetFaultyEntIVal() const; + + Standard_EXPORT Standard_Integer GetPrecModeIVal() const; + + Standard_EXPORT Standard_Real GetPrecRVal() const; + + Standard_EXPORT Standard_Integer GetSurfaceCurIVal() const; DEFINE_STANDARD_RTTIEXT(IGESToBRep_Actor,Transfer_ActorOfTransientProcess) @@ -84,6 +102,11 @@ private: Handle(Interface_InterfaceModel) themodel; Standard_Integer thecontinuity; Standard_Real theeps; + Standard_Integer myApproxd1IVal; + Standard_Integer myFaultyEntIVal; + Standard_Integer myPrecModeIVal; + Standard_Real myPrecRVal; + Standard_Integer mySurfaceCurIVal; }; diff --git a/src/IGESToBRep/IGESToBRep_CurveAndSurface.cxx b/src/IGESToBRep/IGESToBRep_CurveAndSurface.cxx index 70a41e7f51..37f440966d 100644 --- a/src/IGESToBRep/IGESToBRep_CurveAndSurface.cxx +++ b/src/IGESToBRep/IGESToBRep_CurveAndSurface.cxx @@ -74,6 +74,8 @@ IGESToBRep_CurveAndSurface::IGESToBRep_CurveAndSurface() myIsResolCom (Standard_False), myTP (new Transfer_TransientProcess()) { + myOnlyVisibleIVal = Interface_Static::IVal("read.iges.onlyvisible"); + myMaxPrecRVal = Interface_Static::RVal("read.maxprecision.val"); UpdateMinMaxTol(); } @@ -104,6 +106,8 @@ IGESToBRep_CurveAndSurface::IGESToBRep_CurveAndSurface myIsResolCom (Standard_False), myTP (new Transfer_TransientProcess()) { + myOnlyVisibleIVal = Interface_Static::IVal("read.iges.onlyvisible"); + myMaxPrecRVal = Interface_Static::RVal("read.maxprecision.val"); UpdateMinMaxTol(); } @@ -128,6 +132,8 @@ void IGESToBRep_CurveAndSurface::Init() mySurface.Nullify(); myIsResolCom = Standard_False; myUVResolution = 0.; + myOnlyVisibleIVal = Interface_Static::IVal("read.iges.onlyvisible"); + myMaxPrecRVal = Interface_Static::RVal("read.maxprecision.val"); UpdateMinMaxTol(); } @@ -151,8 +157,9 @@ void IGESToBRep_CurveAndSurface::UpdateMinMaxTol() { //#74 rln 11.03.99 S4135: Setting maximum tolerances according to //static parameter - myMaxTol = Max (Interface_Static::RVal ("read.maxprecision.val"), myEpsGeom * myUnitFactor); + myMaxTol = Max (myMaxPrecRVal, myEpsGeom * myUnitFactor); myMinTol = Precision::Confusion(); + } //======================================================================= @@ -258,7 +265,7 @@ TopoDS_Shape IGESToBRep_CurveAndSurface::TransferGeometry // sln 13.06.2002 OCC448: Avoid transferring invisible sub entities which // logically depend on the one - Standard_Integer onlyvisible = Interface_Static::IVal("read.iges.onlyvisible"); + Standard_Integer onlyvisible = myOnlyVisibleIVal; if (IGESToBRep::IsCurveAndSurface(start)) { if(onlyvisible && start->BlankStatus() == 1) @@ -653,7 +660,27 @@ Standard_Real IGESToBRep_CurveAndSurface::GetUVResolution() return myUVResolution; } - +void IGESToBRep_CurveAndSurface::SetOnlyVisibleIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("read.iges.onlyvisible", theVal); + myOnlyVisibleIVal = theVal; +} + +void IGESToBRep_CurveAndSurface::SetMaxPrecRVal(const Standard_Real theVal) +{ + Interface_Static::SetRVal("read.maxprecision.val", theVal); + myMaxPrecRVal = theVal; +} + +Standard_Integer IGESToBRep_CurveAndSurface::GetOnlyVisibleIVal() const +{ + return myOnlyVisibleIVal; +} + +Standard_Real IGESToBRep_CurveAndSurface::GetMaxPrecRVal() const +{ + return myMaxPrecRVal; +} diff --git a/src/IGESToBRep/IGESToBRep_CurveAndSurface.hxx b/src/IGESToBRep/IGESToBRep_CurveAndSurface.hxx index 7d5db96d5e..b2f4340b6f 100644 --- a/src/IGESToBRep/IGESToBRep_CurveAndSurface.hxx +++ b/src/IGESToBRep/IGESToBRep_CurveAndSurface.hxx @@ -191,7 +191,13 @@ public: Standard_EXPORT Standard_Real GetUVResolution(); + Standard_EXPORT void SetOnlyVisibleIVal(const Standard_Integer theVal); + Standard_EXPORT void SetMaxPrecRVal(const Standard_Real theVal); + + Standard_EXPORT Standard_Integer GetOnlyVisibleIVal() const; + + Standard_EXPORT Standard_Real GetMaxPrecRVal() const; protected: @@ -220,6 +226,8 @@ private: Standard_Boolean myIsResolCom; Handle(IGESData_IGESModel) myModel; Handle(Transfer_TransientProcess) myTP; + Standard_Integer myOnlyVisibleIVal; + Standard_Real myMaxPrecRVal; }; diff --git a/src/IGESToBRep/IGESToBRep_Reader.cxx b/src/IGESToBRep/IGESToBRep_Reader.cxx index ed156074ea..883a90ec4d 100644 --- a/src/IGESToBRep/IGESToBRep_Reader.cxx +++ b/src/IGESToBRep/IGESToBRep_Reader.cxx @@ -210,6 +210,12 @@ Standard_Integer IGESToBRep_Reader::LoadFile (const Standard_CString filename) theModel = model; theDone = Standard_False; theShapes.Clear(); + myApproxd1IVal = Interface_Static::IVal("read.iges.bspline.approxd1.mode"); + myBSContinuityIVal = Interface_Static::IVal("read.iges.bspline.continuity"); + myOnlyVisIVal = Interface_Static::IVal("read.iges.onlyvisible"); + myPrecModeIVal = Interface_Static::IVal("read.precision.mode"); + myPrecRVal = Interface_Static::RVal("read.precision.val"); + mySurfaceCurIVal = Interface_Static::IVal("read.surfacecurve.mode"); if ( theProc.IsNull() ) theProc = new Transfer_TransientProcess (theModel->NbEntities()); else @@ -368,7 +374,7 @@ static void TrimTolerances (const TopoDS_Shape& shape, //function : TransferRoots //purpose : Transfers all Roots Entities //======================================================================= -void IGESToBRep_Reader::TransferRoots (const Standard_Boolean onlyvisible, +void IGESToBRep_Reader::TransferRoots (const Standard_Boolean theOnlyVisible, const Message_ProgressRange& theProgress) { if (theModel.IsNull() || theProc.IsNull()) return; @@ -387,7 +393,7 @@ void IGESToBRep_Reader::TransferRoots (const Standard_Boolean onlyvisible, theProc->SetRootManagement(Standard_True); // PrepareTransfer(); -> protocol, actor theActor->SetModel(theModel); - Standard_Integer continuity = Interface_Static::IVal("read.iges.bspline.continuity"); + Standard_Integer continuity = myBSContinuityIVal; theActor->SetContinuity (continuity); theProc->SetModel (theModel); theProc->SetActor (theActor); @@ -399,24 +405,24 @@ void IGESToBRep_Reader::TransferRoots (const Standard_Boolean onlyvisible, ShapeExtend_Explorer SBE; - Standard_Integer precisionMode = Interface_Static::IVal("read.precision.mode"); + Standard_Integer precisionMode = myPrecModeIVal; Message_Msg msg2035("IGES_2035"); msg2035.Arg(precisionMode); TF->Send (msg2035, Message_Info); if (precisionMode==1) { Message_Msg msg2040("IGES_2040"); - msg2040.Arg(Interface_Static::RVal("read.precision.val"));//#70 rln 03.03.99 + msg2040.Arg(myPrecRVal);//#70 rln 03.03.99 TF->Send (msg2040, Message_Info); } Message_Msg msg2045("IGES_2045"); msg2045.Arg(continuity); TF->Send (msg2045, Message_Info); Message_Msg msg2050("IGES_2050"); - msg2050.Arg(Interface_Static::IVal("read.surfacecurve.mode")); + msg2050.Arg(mySurfaceCurIVal); TF->Send (msg2050, Message_Info); // sln 11.06.2002 OCC448 - Interface_Static::SetIVal("read.iges.onlyvisible",onlyvisible); + SetOnlyVisIVal(theOnlyVisible); Message_ProgressScope PS (theProgress, "Root", nb); for (Standard_Integer i = 1; i <= nb && PS.More(); i++) @@ -431,7 +437,7 @@ void IGESToBRep_Reader::TransferRoots (const Standard_Boolean onlyvisible, TF->Send (msg2070, Message_Info); } // on ajoute un traitement pour ne prendre que les entites visibles - if ( ! onlyvisible || ent->BlankStatus() == 0 ) { + if ( ! theOnlyVisible || ent->BlankStatus() == 0 ) { TopoDS_Shape shape; theDone = Standard_True; try { @@ -511,7 +517,7 @@ Standard_Boolean IGESToBRep_Reader::Transfer(const Standard_Integer num, IGESToBRep_CurveAndSurface CAS; CAS.SetModel(theModel); Standard_Real eps; - Standard_Integer Ival = Interface_Static::IVal("read.precision.mode"); + Standard_Integer Ival = myPrecModeIVal; Message_Msg msg2035("IGES_2035"); msg2035.Arg(Ival); TF->Send (msg2035, Message_Info); @@ -519,21 +525,21 @@ Standard_Boolean IGESToBRep_Reader::Transfer(const Standard_Integer num, eps = theModel->GlobalSection().Resolution(); else { //mjm : modif du 19/12/97 pour prise en compte effective du parametre - eps = Interface_Static::RVal("read.precision.val"); + eps = myPrecRVal; Message_Msg msg2040("IGES_2040"); msg2040.Arg(eps);//#70 rln 03.03.99 TF->Send (msg2040, Message_Info); } - Ival = Interface_Static::IVal("read.iges.bspline.approxd1.mode"); + Ival = myApproxd1IVal; CAS.SetModeApprox ( (Ival > 0) ); Message_Msg msg2045("IGES_2045"); - Ival = Interface_Static::IVal("read.iges.bspline.continuity"); + Ival = myBSContinuityIVal; msg2045.Arg(Ival); TF->Send (msg2045, Message_Info); CAS.SetContinuity(Ival); Message_Msg msg2050("IGES_2050"); - Ival = Interface_Static::IVal("read.surfacecurve.mode"); + Ival = mySurfaceCurIVal; msg2050.Arg(Ival); TF->Send (msg2050, Message_Info); CAS.SetSurfaceCurve (Ival); @@ -648,3 +654,69 @@ Standard_Boolean IGESToBRep_Reader::Transfer(const Standard_Integer num, return C; } } + +void IGESToBRep_Reader::SetBSContinuityIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("read.iges.bspline.continuity", theVal); + myBSContinuityIVal = theVal; +} + +void IGESToBRep_Reader::SetPrecModeIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("read.precision.mode", theVal); + myPrecModeIVal = theVal; +} + +void IGESToBRep_Reader::SetPrecRVal(const Standard_Real theVal) +{ + Interface_Static::SetRVal("read.precision.val", theVal); + myPrecRVal = theVal; +} + +void IGESToBRep_Reader::SetSurfaceCurIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("read.surfacecurve.mode", theVal); + mySurfaceCurIVal = theVal; +} + +void IGESToBRep_Reader::SetOnlyVisIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("read.iges.onlyvisible", theVal); + myOnlyVisIVal = theVal; +} + +void IGESToBRep_Reader::SetApproxd1IVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("read.iges.bspline.approxd1.mode", theVal); + myApproxd1IVal = theVal; +} + +Standard_Integer IGESToBRep_Reader::GetBSContinuityIVal() const +{ + return myBSContinuityIVal; +} + +Standard_Integer IGESToBRep_Reader::GetPrecModeIVal() const +{ + return myPrecModeIVal; +} + +Standard_Real IGESToBRep_Reader::GetPrecRVal() const +{ + return myPrecRVal; +} + +Standard_Integer IGESToBRep_Reader::GetSurfaceCurIVal() const +{ + return mySurfaceCurIVal; +} + +Standard_Integer IGESToBRep_Reader::GetOnlyVisIVal() const +{ + return myOnlyVisIVal; +} + +Standard_Integer IGESToBRep_Reader::GetApproxd1IVal() const +{ + return myApproxd1IVal; +} diff --git a/src/IGESToBRep/IGESToBRep_Reader.hxx b/src/IGESToBRep/IGESToBRep_Reader.hxx index 63d61942eb..cae6bf6070 100644 --- a/src/IGESToBRep/IGESToBRep_Reader.hxx +++ b/src/IGESToBRep/IGESToBRep_Reader.hxx @@ -110,7 +110,29 @@ public: //! - a compound containing the resulting shapes if there are several. Standard_EXPORT TopoDS_Shape OneShape() const; + Standard_EXPORT void SetBSContinuityIVal(const Standard_Integer theVal); + Standard_EXPORT void SetPrecModeIVal(const Standard_Integer theVal); + + Standard_EXPORT void SetPrecRVal(const Standard_Real theVal); + + Standard_EXPORT void SetSurfaceCurIVal(const Standard_Integer theVal); + + Standard_EXPORT void SetOnlyVisIVal(const Standard_Integer theVal); + + Standard_EXPORT void SetApproxd1IVal(const Standard_Integer theVal); + + Standard_EXPORT Standard_Integer GetBSContinuityIVal() const; + + Standard_EXPORT Standard_Integer GetPrecModeIVal() const; + + Standard_EXPORT Standard_Real GetPrecRVal() const; + + Standard_EXPORT Standard_Integer GetSurfaceCurIVal() const; + + Standard_EXPORT Standard_Integer GetOnlyVisIVal() const; + + Standard_EXPORT Standard_Integer GetApproxd1IVal() const; protected: @@ -128,6 +150,12 @@ private: TopTools_SequenceOfShape theShapes; Handle(IGESToBRep_Actor) theActor; Handle(Transfer_TransientProcess) theProc; + Standard_Integer myBSContinuityIVal; + Standard_Integer myPrecModeIVal; + Standard_Real myPrecRVal; + Standard_Integer mySurfaceCurIVal; + Standard_Integer myOnlyVisIVal; // setter + Standard_Integer myApproxd1IVal; }; diff --git a/src/STEPCAFControl/STEPCAFControl_Reader.cxx b/src/STEPCAFControl/STEPCAFControl_Reader.cxx index 753531b91a..6a8452c242 100644 --- a/src/STEPCAFControl/STEPCAFControl_Reader.cxx +++ b/src/STEPCAFControl/STEPCAFControl_Reader.cxx @@ -331,6 +331,7 @@ STEPCAFControl_Reader::STEPCAFControl_Reader() myMatMode(Standard_True), myViewMode(Standard_True) { + mySubshapesIVal = Interface_Static::IVal("read.stepcaf.subshapes.name"); STEPCAFControl_Controller::Init(); } @@ -376,6 +377,7 @@ void STEPCAFControl_Reader::Init(const Handle(XSControl_WorkSession)& WS, myReader.SetWS(WS, scratch); myFiles.Clear(); myMap.Clear(); + mySubshapesIVal = Interface_Static::IVal("read.stepcaf.subshapes.name"); } //======================================================================= @@ -4582,7 +4584,7 @@ void STEPCAFControl_Reader::ExpandSubShapes(const Handle(XCAFDoc_ShapeTool)& Sha TColStd_MapOfTransient aRepItems; // Read translation control variables - Standard_Boolean doReadSNames = (Interface_Static::IVal("read.stepcaf.subshapes.name") > 0); + Standard_Boolean doReadSNames = (mySubshapesIVal > 0); if (!doReadSNames) return; @@ -4942,3 +4944,14 @@ Standard_Boolean STEPCAFControl_Reader::GetViewMode() const { return myViewMode; } + +void STEPCAFControl_Reader::SetSubshapesIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("read.stepcaf.subshapes.name", theVal); + mySubshapesIVal = theVal; +} + +Standard_Integer STEPCAFControl_Reader::GetSubshapesIVal() const +{ + return mySubshapesIVal; +} diff --git a/src/STEPCAFControl/STEPCAFControl_Reader.hxx b/src/STEPCAFControl/STEPCAFControl_Reader.hxx index 139df9cdab..4da639523d 100644 --- a/src/STEPCAFControl/STEPCAFControl_Reader.hxx +++ b/src/STEPCAFControl/STEPCAFControl_Reader.hxx @@ -263,6 +263,10 @@ protected: //! Convert name into UNICODE text. Standard_EXPORT virtual TCollection_ExtendedString convertName (const TCollection_AsciiString& theName) const; + Standard_EXPORT void SetSubshapesIVal(const Standard_Integer theVal); + + Standard_EXPORT Standard_Integer GetSubshapesIVal() const; + private: //! Internal method. Import all Datum attributes and set them to XCAF object. Set connection of Datum to GeomTolerance (theGDTL). @@ -290,6 +294,7 @@ private: void prepareUnits(const Handle(StepData_StepModel)& theModel, const Handle(TDocStd_Document)& theDoc) const; + private: STEPControl_Reader myReader; @@ -304,6 +309,7 @@ private: Standard_Boolean myMatMode; Standard_Boolean myViewMode; NCollection_DataMap myGDTMap; + Standard_Integer mySubshapesIVal; }; diff --git a/src/STEPCAFControl/STEPCAFControl_Writer.cxx b/src/STEPCAFControl/STEPCAFControl_Writer.cxx index aadce19df2..9f0d445dce 100644 --- a/src/STEPCAFControl/STEPCAFControl_Writer.cxx +++ b/src/STEPCAFControl/STEPCAFControl_Writer.cxx @@ -326,6 +326,10 @@ void STEPCAFControl_Writer::Init (const Handle(XSControl_WorkSession)& WS, myLabels.Clear(); myGDTPresentationDM = new StepVisual_DraughtingModel(); myGDTPrsCurveStyle = new StepVisual_HArray1OfPresentationStyleAssignment(1, 1); + myAssemblyModeCVal = Interface_Static::CVal("write.step.assembly"); + myAssemblyModeIVal = Interface_Static::IVal("write.step.assembly"); + mySchemaIVal = Interface_Static::IVal("write.step.schema"); + mySubshapesIVal = Interface_Static::IVal("write.stepcaf.subshapes.name"); } @@ -542,7 +546,7 @@ Standard_Boolean STEPCAFControl_Writer::Transfer (STEPControl_Writer &writer, const Handle(StepData_StepModel) aModel = Handle(StepData_StepModel)::DownCast(writer.WS()->Model()); prepareUnit(labels.First(), aModel); // set local length unit to the model // translate free top-level shapes of the DECAF document - Standard_Integer ap = Interface_Static::IVal ("write.step.schema"); + Standard_Integer anAp = mySchemaIVal; TDF_LabelSequence sublabels; Message_ProgressScope aPS(theProgress, "Labels", labels.Length()); for ( Standard_Integer i=1; i <= labels.Length() && aPS.More(); i++) @@ -638,11 +642,11 @@ Standard_Boolean STEPCAFControl_Writer::Transfer (STEPControl_Writer &writer, } } */ - Standard_Integer assemblymode = Interface_Static::IVal ("write.step.assembly"); - Interface_Static::SetCVal ("write.step.assembly", "On"); + Standard_Integer anAssemblyMode = myAssemblyMode; + SetAssemblyCVal("On"); writer.Transfer ( Sass, STEPControl_AsIs, Standard_True, aPS1.Next()); - Interface_Static::SetIVal ("write.step.assembly", assemblymode); - Interface_Static::SetIVal ("write.step.schema", ap); + SetAssemblyIVal(anAssemblyMode); + SetSchemaIVal(anAp); } } if (aPS.UserBreak()) @@ -671,7 +675,7 @@ Standard_Boolean STEPCAFControl_Writer::Transfer (STEPControl_Writer &writer, // write G&DTs if(GetDimTolMode()) { - if (ap == 5) { + if (anAp == 5) { WriteDGTsAP242(writer.WS(), sublabels); } else { @@ -700,7 +704,7 @@ Standard_Boolean STEPCAFControl_Writer::Transfer (STEPControl_Writer &writer, if ( GetPropsMode() ) WriteValProps ( writer.WS(), sublabels, multi ); - Interface_Static::SetIVal ("write.step.schema", ap); + SetSchemaIVal(anAp); // refresh graph writer.WS()->ComputeGraph ( Standard_True ); @@ -709,7 +713,7 @@ Standard_Boolean STEPCAFControl_Writer::Transfer (STEPControl_Writer &writer, * Write names for the sub-shapes * ================================ */ - if (Interface_Static::IVal("write.stepcaf.subshapes.name") != 0) + if (mySubshapesIVal != 0) { const Handle(XSControl_TransferWriter) &TW = this->ChangeWriter().WS()->TransferWriter(); const Handle(Transfer_FinderProcess) &FP = TW->FinderProcess(); @@ -799,11 +803,11 @@ TopoDS_Shape STEPCAFControl_Writer::TransferExternFiles (const TDF_Label &L, EF->SetWS ( newWS ); EF->SetName ( name ); EF->SetLabel ( L ); - Standard_Integer assemblymode = Interface_Static::IVal ("write.step.assembly"); - Interface_Static::SetCVal ("write.step.assembly", "Off"); + Standard_Integer anAssemblyMode = myAssemblyMode; + SetAssemblyCVal("Off"); const Standard_CString multi = 0; EF->SetTransferStatus ( Transfer ( sw, Lseq, mode, multi, Standard_True, theProgress) ); - Interface_Static::SetIVal ("write.step.assembly", assemblymode); + SetAssemblyIVal(anAssemblyMode); myLabEF.Bind ( L, EF ); myFiles.Bind ( name->ToCString(), EF ); @@ -853,7 +857,7 @@ Standard_Boolean STEPCAFControl_Writer::WriteExternRefs (const Handle(XSControl_ const Handle(XSControl_TransferWriter) &TW = WS->TransferWriter(); const Handle(Transfer_FinderProcess) &FP = TW->FinderProcess(); STEPConstruct_ExternRefs EFTool ( WS ); - Standard_Integer schema = Interface_Static::IVal("write.step.schema"); + Standard_Integer aSchema = mySchemaIVal; for ( Standard_Integer k=1; k <= labels.Length(); k++ ) { TDF_Label lab = labels(k); if ( XCAFDoc_ShapeTool::IsAssembly ( lab ) ) continue; // skip assemblies @@ -876,7 +880,7 @@ Standard_Boolean STEPCAFControl_Writer::WriteExternRefs (const Handle(XSControl_ } // add extern ref - const char* format = (schema == 3 ? "STEP AP203" : "STEP AP214"); + const char* format = (aSchema == 3 ? "STEP AP203" : "STEP AP214"); // try to get PD from SDR StepRepr_RepresentedDefinition RD = SDR->Definition(); Handle(StepRepr_PropertyDefinition) aPropDef = RD.PropertyDefinition(); @@ -896,7 +900,7 @@ Standard_Boolean STEPCAFControl_Writer::WriteExternRefs (const Handle(XSControl_ } EFTool.AddExternRef ( EF->GetName()->ToCString(), PD, format ); } - EFTool.WriteExternRefs(schema); + EFTool.WriteExternRefs(aSchema); return Standard_True; } @@ -4367,3 +4371,47 @@ Standard_Boolean STEPCAFControl_Writer::GetMaterialMode() const { return myMatMode; } + +void STEPCAFControl_Writer::SetAssemblyCVal(const Standard_CString& theVal) +{ + Interface_Static::SetCVal("write.step.assembly", theVal); + myAssemblyModeCVal = theVal; +} + +void STEPCAFControl_Writer::SetAssemblyIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("write.step.assembly", theVal); + myAssemblyModeIVal = theVal; +} + +void STEPCAFControl_Writer::SetSchemaIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("write.step.schema", theVal); + mySchemaIVal = theVal; +} + +void STEPCAFControl_Writer::SetSubshapesIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("write.stepcaf.subshapes.name", theVal); + mySubshapesIVal = theVal; +} + +Standard_CString STEPCAFControl_Writer::GetAssemblyCVal() const +{ + return myAssemblyModeCVal; +} + +Standard_Integer STEPCAFControl_Writer::GetAssemblyIVal() const +{ + return myAssemblyModeIVal; +} + +Standard_Integer STEPCAFControl_Writer::GetSchemaIVal() const +{ + return mySchemaIVal; +} + +Standard_Integer STEPCAFControl_Writer::GetSubshapesIVal() const +{ + return mySubshapesIVal; +} diff --git a/src/STEPCAFControl/STEPCAFControl_Writer.hxx b/src/STEPCAFControl/STEPCAFControl_Writer.hxx index b021e05af1..164b5f90f0 100644 --- a/src/STEPCAFControl/STEPCAFControl_Writer.hxx +++ b/src/STEPCAFControl/STEPCAFControl_Writer.hxx @@ -218,6 +218,22 @@ protected: Standard_EXPORT void prepareUnit(const TDF_Label& theLabel, const Handle(StepData_StepModel)& theModel); + Standard_EXPORT void SetAssemblyCVal(const Standard_CString& theVal); + + Standard_EXPORT void SetAssemblyIVal(const Standard_Integer theVal); + + Standard_EXPORT void SetSchemaIVal(const Standard_Integer theVal); + + Standard_EXPORT void SetSubshapesIVal(const Standard_Integer theVal); + + Standard_EXPORT Standard_CString GetAssemblyCVal() const; + + Standard_EXPORT Standard_Integer GetAssemblyIVal() const; + + Standard_EXPORT Standard_Integer GetSchemaIVal() const; + + Standard_EXPORT Standard_Integer GetSubshapesIVal() const; + private: Standard_EXPORT Handle(StepRepr_ShapeAspect) WriteShapeAspect(const Handle(XSControl_WorkSession) &WS, @@ -240,7 +256,6 @@ private: private: - STEPControl_Writer myWriter; NCollection_DataMap myFiles; STEPCAFControl_DataMapOfLabelShape myLabels; @@ -257,6 +272,10 @@ private: Handle(StepVisual_DraughtingModel) myGDTPresentationDM; Handle(StepVisual_HArray1OfPresentationStyleAssignment) myGDTPrsCurveStyle; Handle(StepRepr_ProductDefinitionShape) myGDTCommonPDS; + Standard_Integer myAssemblyModeIVal; + Standard_CString myAssemblyModeCVal; + Standard_Integer mySchemaIVal; + Standard_Integer mySubshapesIVal; }; diff --git a/src/STEPConstruct/STEPConstruct_ContextTool.cxx b/src/STEPConstruct/STEPConstruct_ContextTool.cxx index 0b93e40b9e..2a015564f2 100644 --- a/src/STEPConstruct/STEPConstruct_ContextTool.cxx +++ b/src/STEPConstruct/STEPConstruct_ContextTool.cxx @@ -89,6 +89,8 @@ void STEPConstruct_ContextTool::SetModel (const Handle(StepData_StepModel)& aSte // if (thePRPC.IsNull()) thePRPC = GetCasted(StepBasic_ProductRelatedProductCategory, ent); //} } + myProductNameCVal = Interface_Static::CVal("write.step.product.name"); + mySchemaIVal = Interface_Static::IVal("write.step.schema"); } //======================================================================= @@ -111,7 +113,7 @@ void STEPConstruct_ContextTool::AddAPD (const Standard_Boolean enforce) Standard_Boolean noapd = theAPD.IsNull(); if (noapd || enforce) theAPD = new StepBasic_ApplicationProtocolDefinition; - switch (Interface_Static::IVal("write.step.schema")) { //j4 + switch (mySchemaIVal) { //j4 default: case 1: theAPD->SetApplicationProtocolYear (1997); @@ -147,7 +149,7 @@ void STEPConstruct_ContextTool::AddAPD (const Standard_Boolean enforce) if (theAPD->Application().IsNull()) theAPD->SetApplication (new StepBasic_ApplicationContext); Handle(TCollection_HAsciiString) appl; - switch (Interface_Static::IVal("write.step.schema")) { //j4 + switch (mySchemaIVal) { //j4 default: case 1: case 2: appl = new TCollection_HAsciiString ( "core data for automotive mechanical design processes" ); @@ -356,7 +358,7 @@ void STEPConstruct_ContextTool::AddPRPC (const Standard_Boolean enforce) Standard_Boolean noprpc = thePRPC.IsNull(); if (noprpc || enforce) { //:i3 abv 1 Sep 98: ProSTEP TR9: generate PRODUCT_TYPE (derived) instead of PRPC - switch (Interface_Static::IVal("write.step.schema")) { //j4 + switch (mySchemaIVal) { //j4 default: case 1: thePRPC = new StepBasic_ProductType; @@ -566,19 +568,24 @@ void STEPConstruct_ContextTool::SetIndex (const Standard_Integer ind) Handle(TCollection_HAsciiString) STEPConstruct_ContextTool::GetProductName () const { - Handle(TCollection_HAsciiString) PdtName; - if (Interface_Static::IsSet("write.step.product.name")) - PdtName = new TCollection_HAsciiString(Interface_Static::CVal("write.step.product.name")); - else PdtName = new TCollection_HAsciiString("Product"); - - for ( Standard_Integer i=1; i <= myLevel.Length(); i++ ) { - PdtName->AssignCat ((char*)( i >1 ? "." : " " )); + Handle(TCollection_HAsciiString) aPdtName; + if (!myProductNameCVal.IsEmpty()) + { + aPdtName = new TCollection_HAsciiString(myProductNameCVal); + } + else + { + aPdtName = new TCollection_HAsciiString("Product"); + } + for ( Standard_Integer i=1; i <= myLevel.Length(); i++ ) + { + aPdtName->AssignCat ((char*)( i >1 ? "." : " " )); char buf[100]; sprintf ( buf, "%d", myLevel.Value(i) ); - PdtName->AssignCat ( buf ); + aPdtName->AssignCat ( buf ); } - return PdtName; + return aPdtName; } //======================================================================= @@ -596,7 +603,8 @@ Handle(TColStd_HSequenceOfTransient) STEPConstruct_ContextTool::GetRootsForPart if ( ! SDRTool.PRPC().IsNull() ) seq->Append ( SDRTool.PRPC() ); // for AP203, add required product management data - if ( Interface_Static::IVal("write.step.schema") == 3 ) { + if (mySchemaIVal == 3 ) + { theAP203.Init ( SDRTool ); seq->Append (theAP203.GetProductCategoryRelationship()); seq->Append (theAP203.GetCreator()); @@ -626,7 +634,8 @@ Handle(TColStd_HSequenceOfTransient) STEPConstruct_ContextTool::GetRootsForAssem seq->Append ( assembly.ItemValue() ); // for AP203, write required product management data - if ( Interface_Static::IVal("write.step.schema") == 3 ) { + if (mySchemaIVal == 3 ) + { theAP203.Init ( assembly.GetNAUO() ); seq->Append (theAP203.GetSecurity()); seq->Append (theAP203.GetClassificationOfficer()); @@ -639,7 +648,24 @@ Handle(TColStd_HSequenceOfTransient) STEPConstruct_ContextTool::GetRootsForAssem return seq; } +void STEPConstruct_ContextTool::SetProductNameCVal(const Standard_CString& theVal) +{ + Interface_Static::SetCVal("write.step.product.name", theVal); + myProductNameCVal = theVal; +} +void STEPConstruct_ContextTool::SetSchemaIVal(Standard_Integer theVal) +{ + Interface_Static::SetIVal("write.step.schema", theVal); + mySchemaIVal = theVal; +} +Standard_CString STEPConstruct_ContextTool::GetProductNameCVal() const +{ + return myProductNameCVal; +} - +Standard_Integer STEPConstruct_ContextTool::GetSchemaIVal() const +{ + return mySchemaIVal; +} diff --git a/src/STEPConstruct/STEPConstruct_ContextTool.hxx b/src/STEPConstruct/STEPConstruct_ContextTool.hxx index 3f5da89e97..62c9340d9e 100644 --- a/src/STEPConstruct/STEPConstruct_ContextTool.hxx +++ b/src/STEPConstruct/STEPConstruct_ContextTool.hxx @@ -123,7 +123,15 @@ public: //! for assembly link identified by assembly (including NAUO and CDSR) Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetRootsForAssemblyLink (const STEPConstruct_Assembly& assembly); + Standard_EXPORT TCollection_HAsciiString GetWriteStepProductName() const; + Standard_EXPORT void SetProductNameCVal(const Standard_CString& theVal); + + Standard_EXPORT void SetSchemaIVal(Standard_Integer theVal); + + Standard_EXPORT Standard_Integer GetSchemaIVal() const; + + Standard_EXPORT Standard_CString GetProductNameCVal() const; protected: @@ -140,7 +148,8 @@ private: Handle(StepBasic_ApplicationProtocolDefinition) theAPD; STEPConstruct_AP203Context theAP203; Handle(StepGeom_Axis2Placement3d) myAxis; - + Standard_CString myProductNameCVal; + Standard_Integer mySchemaIVal; }; diff --git a/src/STEPConstruct/STEPConstruct_Part.cxx b/src/STEPConstruct/STEPConstruct_Part.cxx index 18b9ee1a42..510a8d5952 100644 --- a/src/STEPConstruct/STEPConstruct_Part.cxx +++ b/src/STEPConstruct/STEPConstruct_Part.cxx @@ -52,6 +52,7 @@ STEPConstruct_Part::STEPConstruct_Part() { myDone = Standard_False; + mySchemaIVal = Interface_Static::IVal("write.step.schema"); } //======================================================================= @@ -64,11 +65,11 @@ void STEPConstruct_Part::MakeSDR(const Handle(StepShape_ShapeRepresentation)& SR const Handle(StepBasic_ApplicationContext)& AC) { // get current schema - Standard_Integer schema = Interface_Static::IVal("write.step.schema"); + mySchemaIVal = Interface_Static::IVal("write.step.schema"); // create PC Handle(StepBasic_ProductContext) PC; - switch (schema) { + switch (mySchemaIVal) { default : case 1: PC = new StepBasic_MechanicalContext; break; @@ -93,7 +94,7 @@ void STEPConstruct_Part::MakeSDR(const Handle(StepShape_ShapeRepresentation)& SR // create PDF Handle(StepBasic_ProductDefinitionFormation) PDF; - switch (schema) { + switch (mySchemaIVal) { default: case 1: case 2: @@ -111,7 +112,7 @@ void STEPConstruct_Part::MakeSDR(const Handle(StepShape_ShapeRepresentation)& SR // create PDC, depending on current schema Handle(StepBasic_ProductDefinitionContext) PDC; Handle(TCollection_HAsciiString) PDCname; - switch (schema) { + switch (mySchemaIVal) { default: case 1: case 2: @@ -147,7 +148,7 @@ void STEPConstruct_Part::MakeSDR(const Handle(StepShape_ShapeRepresentation)& SR // and an associated PRPC Handle(TCollection_HAsciiString) PRPCName; - switch (Interface_Static::IVal("write.step.schema")) { + switch (mySchemaIVal) { default: case 1: myPRPC = new StepBasic_ProductType; @@ -168,6 +169,7 @@ void STEPConstruct_Part::MakeSDR(const Handle(StepShape_ShapeRepresentation)& SR PRPCproducts->SetValue(1,P); myPRPC->Init ( PRPCName, Standard_False, 0, PRPCproducts ); + myDone = Standard_True; } @@ -698,3 +700,13 @@ void STEPConstruct_Part::SetPRPCdescription (const Handle(TCollection_HAsciiStri myPRPC->SetDescription ( text ); } +void STEPConstruct_Part::SetSchemaIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("write.step.schema", theVal); + mySchemaIVal = theVal; +} + +Standard_Integer STEPConstruct_Part::GetSchemaIVal() const +{ + return mySchemaIVal; +} diff --git a/src/STEPConstruct/STEPConstruct_Part.hxx b/src/STEPConstruct/STEPConstruct_Part.hxx index bf2cee7afa..4cd48fd0c0 100644 --- a/src/STEPConstruct/STEPConstruct_Part.hxx +++ b/src/STEPConstruct/STEPConstruct_Part.hxx @@ -136,7 +136,9 @@ public: Standard_EXPORT void SetPRPCdescription (const Handle(TCollection_HAsciiString)& text); + Standard_EXPORT void SetSchemaIVal(const Standard_Integer theVal); + Standard_EXPORT Standard_Integer GetSchemaIVal() const; protected: @@ -152,6 +154,7 @@ private: Standard_Boolean myDone; Handle(StepShape_ShapeDefinitionRepresentation) mySDR; Handle(StepBasic_ProductRelatedProductCategory) myPRPC; + Standard_Integer mySchemaIVal; }; diff --git a/src/STEPConstruct/STEPConstruct_Styles.cxx b/src/STEPConstruct/STEPConstruct_Styles.cxx index b57aa6e87e..37cfe2303b 100644 --- a/src/STEPConstruct/STEPConstruct_Styles.cxx +++ b/src/STEPConstruct/STEPConstruct_Styles.cxx @@ -87,6 +87,7 @@ //======================================================================= STEPConstruct_Styles::STEPConstruct_Styles () { + mySchemaIVal = Interface_Static::IVal("write.step.schema") } @@ -98,6 +99,7 @@ STEPConstruct_Styles::STEPConstruct_Styles () STEPConstruct_Styles::STEPConstruct_Styles (const Handle(XSControl_WorkSession) &WS) : STEPConstruct_Tool ( WS ) { + mySchemaIVal = Interface_Static::IVal("write.step.schema") } @@ -111,6 +113,7 @@ Standard_Boolean STEPConstruct_Styles::Init (const Handle(XSControl_WorkSession) myMapOfStyles.Clear(); myStyles.Clear(); myPSA.Clear(); + mySchemaIVal = Interface_Static::IVal("write.step.schema") return SetWS ( WS ); } @@ -235,7 +238,8 @@ Standard_Boolean STEPConstruct_Styles::CreateMDGPR (const Handle(StepRepr_Repres // Model()->AddWithRefs ( Repr ); add into the model upper // for AP203, add subschema name - if ( Interface_Static::IVal("write.step.schema") ==3 ) { + if (mySchemaIVal == 3) + { APIHeaderSection_MakeHeader mkHdr ( Handle(StepData_StepModel)::DownCast ( Model() ) ); Handle(TCollection_HAsciiString) subSchema = new TCollection_HAsciiString ( "SHAPE_APPEARANCE_LAYER_MIM" ); @@ -788,3 +792,13 @@ Standard_Boolean STEPConstruct_Styles::DecodeColor (const Handle(StepVisual_Colo return Standard_False; } +void STEPConstruct_Styles::SetSchemaIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("write.step.schema", theVal); + mySchemaIVal = theVal; +} + +Standard_Integer STEPConstruct_Styles::GetSchemaIVal() const +{ + return mySchemaIVal; +} diff --git a/src/STEPConstruct/STEPConstruct_Styles.hxx b/src/STEPConstruct/STEPConstruct_Styles.hxx index bb2ed58671..5aaa825578 100644 --- a/src/STEPConstruct/STEPConstruct_Styles.hxx +++ b/src/STEPConstruct/STEPConstruct_Styles.hxx @@ -147,7 +147,9 @@ public: //! Returns True if OK or False if color is not recognized Standard_EXPORT static Standard_Boolean DecodeColor (const Handle(StepVisual_Colour)& Colour, Quantity_Color& Col); + Standard_EXPORT void SetSchemaIVal(const Standard_Integer theVal); + Standard_EXPORT Standard_Integer GetSchemaIVal() const; protected: @@ -163,6 +165,7 @@ private: TColStd_IndexedDataMapOfTransientTransient myMapOfStyles; TColStd_IndexedMapOfTransient myStyles; TColStd_SequenceOfTransient myPSA; + Standard_Integer mySchemaIVal; }; diff --git a/src/STEPConstruct/STEPConstruct_UnitContext.cxx b/src/STEPConstruct/STEPConstruct_UnitContext.cxx index cefb2f6f5b..bd1afa83b7 100644 --- a/src/STEPConstruct/STEPConstruct_UnitContext.cxx +++ b/src/STEPConstruct/STEPConstruct_UnitContext.cxx @@ -67,6 +67,7 @@ STEPConstruct_UnitContext::STEPConstruct_UnitContext() areaDone = volumeDone = Standard_False; //pdn file r_47-sd.stp initialize field. theUncertainty = RealLast(); + myWriteUnitIVal = Interface_Static::IVal("write.step.unit"); } //======================================================================= @@ -92,7 +93,8 @@ void STEPConstruct_UnitContext::Init(const Standard_Real Tol3d) Standard_Boolean hasPref = Standard_True; StepBasic_SiPrefix siPref = StepBasic_spMilli; Standard_Real aScale = 1.; - switch (Interface_Static::IVal("write.step.unit")) + myWriteUnitIVal = Interface_Static::IVal("write.step.unit"); + switch (myWriteUnitIVal) { case 1: uName = "INCH"; aScale = 25.4; break; default: @@ -603,3 +605,15 @@ Standard_Boolean STEPConstruct_UnitContext::VolumeDone() const { return volumeDone; } + +void STEPConstruct_UnitContext::SetWriteUnitIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("write.step.unit", theVal); + myWriteUnitIVal = theVal; +} + +Standard_Integer STEPConstruct_UnitContext::GetWriteUnitIVal() const +{ + return myWriteUnitIVal; +} + diff --git a/src/STEPConstruct/STEPConstruct_UnitContext.hxx b/src/STEPConstruct/STEPConstruct_UnitContext.hxx index e1faad8f60..ffbe3d2832 100644 --- a/src/STEPConstruct/STEPConstruct_UnitContext.hxx +++ b/src/STEPConstruct/STEPConstruct_UnitContext.hxx @@ -112,7 +112,9 @@ public: //! real factor (e.g. 1e6 for mega) Standard_EXPORT static Standard_Real ConvertSiPrefix (const StepBasic_SiPrefix aPrefix); + Standard_EXPORT void SetWriteUnitIVal(const Standard_Integer theVal); + Standard_EXPORT Standard_Integer GetWriteUnitIVal() const; protected: @@ -143,7 +145,7 @@ private: Standard_Boolean planeAngleDone; Standard_Boolean solidAngleDone; Standard_Boolean hasUncertainty; - + Standard_Integer myWriteUnitIVal; }; diff --git a/src/STEPConstruct/STEPConstruct_ValidationProps.cxx b/src/STEPConstruct/STEPConstruct_ValidationProps.cxx index 2676a871e5..4322f79968 100644 --- a/src/STEPConstruct/STEPConstruct_ValidationProps.cxx +++ b/src/STEPConstruct/STEPConstruct_ValidationProps.cxx @@ -73,6 +73,7 @@ //======================================================================= STEPConstruct_ValidationProps::STEPConstruct_ValidationProps () { + mySchemaIVal = Interface_Static::IVal("write.step.schema"); } //======================================================================= @@ -83,6 +84,7 @@ STEPConstruct_ValidationProps::STEPConstruct_ValidationProps () STEPConstruct_ValidationProps::STEPConstruct_ValidationProps (const Handle(XSControl_WorkSession) &WS) : STEPConstruct_Tool(WS) { + mySchemaIVal = Interface_Static::IVal("write.step.schema"); } //======================================================================= @@ -92,6 +94,7 @@ STEPConstruct_ValidationProps::STEPConstruct_ValidationProps (const Handle(XSCon Standard_Boolean STEPConstruct_ValidationProps::Init (const Handle(XSControl_WorkSession) &WS) { + mySchemaIVal = Interface_Static::IVal("write.step.schema"); return SetWS ( WS ); } @@ -359,7 +362,8 @@ Standard_Boolean STEPConstruct_ValidationProps::AddProp (const StepRepr_Characte Model()->AddWithRefs ( PrDR ); // for AP203, add subschema name - if ( Interface_Static::IVal("write.step.schema") ==3 ) { + if ( mySchemaIVal == 3 ) + { APIHeaderSection_MakeHeader mkHdr ( Handle(StepData_StepModel)::DownCast ( Model() ) ); Handle(TCollection_HAsciiString) subSchema = new TCollection_HAsciiString ( "GEOMETRIC_VALIDATION_PROPERTIES_MIM" ); @@ -746,3 +750,14 @@ void STEPConstruct_ValidationProps::SetAssemblyShape (const TopoDS_Shape& shape) Handle(TransferBRep_ShapeMapper) mapper = TransferBRep::ShapeMapper(FinderProcess(),shape); FinderProcess()->FindTypedTransient(mapper,STANDARD_TYPE(StepBasic_ProductDefinition),myAssemblyPD); } + +void STEPConstruct_ValidationProps::SetSchemaIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("write.step.schema", theVal); + mySchemaIVal = theVal; +} + +Standard_Integer STEPConstruct_ValidationProps::GetSchemaIVal() const +{ + return mySchemaIVal; +} diff --git a/src/STEPConstruct/STEPConstruct_ValidationProps.hxx b/src/STEPConstruct/STEPConstruct_ValidationProps.hxx index 691a9dbd1b..f686964932 100644 --- a/src/STEPConstruct/STEPConstruct_ValidationProps.hxx +++ b/src/STEPConstruct/STEPConstruct_ValidationProps.hxx @@ -121,7 +121,9 @@ public: //! Sets current assembly shape SDR (for FindCDSR calls) Standard_EXPORT void SetAssemblyShape (const TopoDS_Shape& shape); + Standard_EXPORT void SetSchemaIVal(const Standard_Integer theVal); + Standard_EXPORT Standard_Integer GetSchemaIVal() const; protected: @@ -137,6 +139,7 @@ private: StepBasic_Unit areaUnit; StepBasic_Unit volUnit; Handle(StepBasic_ProductDefinition) myAssemblyPD; + Standard_Integer mySchemaIVal; }; diff --git a/src/STEPControl/STEPControl_ActorRead.cxx b/src/STEPControl/STEPControl_ActorRead.cxx index 0ce99cd8c6..b857f66b1b 100644 --- a/src/STEPControl/STEPControl_ActorRead.cxx +++ b/src/STEPControl/STEPControl_ActorRead.cxx @@ -208,6 +208,19 @@ STEPControl_ActorRead::STEPControl_ActorRead() : myPrecision(0.0), myMaxTol(0.0) { + myAngleUnitIVal = Interface_Static::IVal("step.angleunit.mode"); + myStepShapeReprIVal = Interface_Static::IVal("read.step.shape.repr"); + myRelationshipIVal = Interface_Static::IVal("read.step.shape.relationship"); + myShapeAspectIVal = Interface_Static::IVal("read.step.shape.aspect"); + myProductCVal = Interface_Static::CVal("read.step.product.mode"); + myReadAssemblyIVal = Interface_Static::IVal("read.step.assembly.level"); + myNonmanifoldIVal = Interface_Static::IVal("read.step.nonmanifold"); + myIdeasModeIVal = Interface_Static::IVal("read.step.ideas"); + myConstructiveGeomIVal = Interface_Static::IVal("read.step.constructivegeom.relationship"); + myRootTransformationIVal = Interface_Static::IVal("read.step.root.transformation"); + myPrecisionModeIVal = Interface_Static::IVal("read.precision.mode"); + myPrecisionRVal = Interface_Static::RVal("read.precision.val"); + myMaxPrecisionRVal = Interface_Static::RVal("read.maxprecision.val"); } // ============================================================================ // Method : STEPControl_ActorRead::Recognize @@ -223,7 +236,7 @@ Standard_Boolean STEPControl_ActorRead::Recognize if (start->IsKind(STANDARD_TYPE(StepRepr_NextAssemblyUsageOccurrence))) return Standard_True; - TCollection_AsciiString aProdMode = Interface_Static::CVal("read.step.product.mode"); + TCollection_AsciiString aProdMode = myProductCVal; if(!aProdMode.IsEqual("ON")) if(start->IsKind(STANDARD_TYPE(StepShape_ShapeDefinitionRepresentation))) return Standard_True; @@ -309,7 +322,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); + Standard_Boolean aTrsfUse = (myRootTransformationIVal == 1); return TransferShape(start, TP, Standard_True, aTrsfUse, theProgress); } @@ -519,14 +532,14 @@ static void getSDR(const Handle(StepRepr_ProductDefinitionShape)& PDS, // Flag indicating whether SDRs associated with the product`s main SDR // by SRRs (which correspond to hybrid model representation in AP203 since 1998) // should be taken into account - Standard_Integer readSRR = Interface_Static::IVal("read.step.shape.relationship"); + Standard_Integer readSRR = myRelationshipIVal; - Standard_Integer readConstructiveGeomRR = Interface_Static::IVal("read.step.constructivegeom.relationship"); + Standard_Integer aReadConstructiveGeomRR = myConstructiveGeomIVal; // Flag indicating whether SDRs associated with the product`s main SDR // by SAs (which correspond to hybrid model representation in AP203 before 1998) // should be taken into account - Standard_Integer readSA = Interface_Static::IVal("read.step.shape.aspect"); - if ( ! readSA ) + Standard_Integer aReadSA = myShapeAspectIVal; + if ( ! aReadSA ) listSDRAspect->Clear(); // remember number of normal SDRs (not those found via ShapeAspect) @@ -539,10 +552,10 @@ static void getSDR(const Handle(StepRepr_ProductDefinitionShape)& PDS, // possibly attached directly to intermediate assemblies (1) // Special mode (4) is used to translate shape attached to this product only, // ignoring sub-assemblies if any - Standard_Integer readAssembly = Interface_Static::IVal("read.step.assembly.level"); - if ( readAssembly ==3 || ( readAssembly ==2 && listNAUO->Length() >0 ) ) + Standard_Integer aReadAssembly = myReadAssemblyIVal; + if ( aReadAssembly ==3 || ( aReadAssembly ==2 && listNAUO->Length() >0 ) ) listSDR->Clear(); - else if ( readAssembly == 4 ) + else if ( aReadAssembly == 4 ) listNAUO->Clear(); Standard_Integer nbEnt = listSDR->Length() + listNAUO->Length(); @@ -663,7 +676,7 @@ static void getSDR(const Handle(StepRepr_ProductDefinitionShape)& PDS, nbShapes++; } } - else if(readConstructiveGeomRR && anitem->IsKind(STANDARD_TYPE(StepRepr_ConstructiveGeometryRepresentationRelationship))) + else if(aReadConstructiveGeomRR && anitem->IsKind(STANDARD_TYPE(StepRepr_ConstructiveGeometryRepresentationRelationship))) { Handle(StepRepr_ConstructiveGeometryRepresentationRelationship) aCSRR = Handle(StepRepr_ConstructiveGeometryRepresentationRelationship)::DownCast(anitem); @@ -826,7 +839,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity( Standard_Integer nsh = 0; // [BEGIN] Proceed with non-manifold topology (ssv; 12.11.2010) - Standard_Boolean isNMMode = Interface_Static::IVal("read.step.nonmanifold") != 0; + Standard_Boolean isNMMode = myNonmanifoldIVal != 0; Standard_Boolean isManifold = Standard_True; if ( isNMMode && sr->IsKind(STANDARD_TYPE(StepShape_NonManifoldSurfaceShapeRepresentation)) ) { isManifold = Standard_False; @@ -838,8 +851,8 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity( } // Special processing for I-DEAS STP case (ssv; 15.11.2010) else { - Standard_Integer isIDeasMode = Interface_Static::IVal("read.step.ideas"); - if (isNMMode && myNMTool.IsIDEASCase() && isIDeasMode) { + Standard_Integer anIsIdeasMode = myIdeasModeIVal; + if (isNMMode && myNMTool.IsIDEASCase() && anIsIdeasMode) { isManifold = Standard_False; NM_DETECTED = Standard_True; #ifdef OCCT_DEBUG @@ -1355,6 +1368,149 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::OldWay return shbinder; } +void STEPControl_ActorRead::SetAngleUnitIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("step.angleunit.mode", theVal); + myAngleUnitIVal = theVal; +} + +void STEPControl_ActorRead::SetStepShapeReprIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("read.step.shape.repr", theVal); + myStepShapeReprIVal = theVal; +} + +void STEPControl_ActorRead::SetRelationshipIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("read.step.shape.relationship", theVal); + myRelationshipIVal = theVal; +} + +void STEPControl_ActorRead::SetShapeAspectIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("read.step.shape.aspect", theVal); + myShapeAspectIVal = theVal; +} + +void STEPControl_ActorRead::SetProductCVal(const Standard_CString& theVal) +{ + Interface_Static::SetCVal("read.step.product.mode", theVal); + myProductCVal = theVal; +} + +void STEPControl_ActorRead::SetReadAssemblyIValconst(Standard_Integer theVal) +{ + Interface_Static::SetIVal("read.step.assembly.level", theVal); + myReadAssemblyIVal = theVal; +} + +void STEPControl_ActorRead::SetNonmanifoldIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("read.step.nonmanifold", theVal); + myNonmanifoldIVal = theVal; +} + +void STEPControl_ActorRead::SetIdeasModeIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("read.step.ideas", theVal); + myIdeasModeIVal = theVal; +} + +void STEPControl_ActorRead::SetConstructiveGeomIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("read.step.constructivegeom.relationship", theVal); + myStepShapeReprIVal = theVal; +} + +void STEPControl_ActorRead::SetRootTransformationIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("read.step.root.transformation", theVal); + myRootTransformationIVal = theVal; +} + +void STEPControl_ActorRead::SetPrecisionModeIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("read.precision.mode", theVal); + myPrecisionModeIVal = theVal; +} + +void STEPControl_ActorRead::SetPrecisionRVal(const Standard_Real theVal) +{ + Interface_Static::SetRVal("read.precision.val", theVal); + myPrecisionRVal = theVal; +} + +void STEPControl_ActorRead::SetMaxPrecisionRVal(const Standard_Real theVal) +{ + Interface_Static::SetRVal("read.maxprecision.val", theVal); + myMaxPrecisionRVal = theVal; +} + +Standard_Integer STEPControl_ActorRead::GetAngleUnitIVal() const +{ + return myAngleUnitIVal; +} + +Standard_Integer STEPControl_ActorRead::GetStepShapeReprIVal() const +{ + return myStepShapeReprIVal; +} + +Standard_Integer STEPControl_ActorRead::GetRelationshipIVal() const +{ + return myRelationshipIVal; +} + +Standard_Integer STEPControl_ActorRead::GetShapeAspectIVal() const +{ + return myShapeAspectIVal; +} + +Standard_CString STEPControl_ActorRead::GetProductCVal() const +{ + return myProductCVal; +} + +Standard_Integer STEPControl_ActorRead::GetReadAssemblyIVal() const +{ + return myReadAssemblyIVal; +} + +Standard_Integer STEPControl_ActorRead::GetNonmanifoldIVal() const +{ + return myNonmanifoldIVal; +} + +Standard_Integer STEPControl_ActorRead::GetIdeasModeIVal() const +{ + return myIdeasModeIVal; +} + +Standard_Integer STEPControl_ActorRead::GetConstructiveGeomIVal() const +{ + return myConstructiveGeomIVal; +} + +Standard_Integer STEPControl_ActorRead::GetRootTransformationIVal() const +{ + return myRootTransformationIVal; +} + +Standard_Integer STEPControl_ActorRead::GetPrecisionModeIVal() const +{ + return myPrecisionModeIVal; +} + +Standard_Real STEPControl_ActorRead::GetPrecisionRVal() const +{ + return myPrecisionRVal; +} + +Standard_Real STEPControl_ActorRead::GetMaxPrecisionRVal() const +{ + return myMaxPrecisionRVal; +} + //======================================================================= //function : TransferEntity //purpose : @@ -1633,7 +1789,7 @@ Handle(Transfer_Binder) STEPControl_ActorRead::TransferShape( // Product Definition Entities // They should be treated with Design Manager // case ShapeDefinitionRepresentation if ProductMode != ON - TCollection_AsciiString aProdMode = Interface_Static::CVal("read.step.product.mode"); + TCollection_AsciiString aProdMode = myProductCVal; if(!aProdMode.IsEqual("ON") && start->IsKind(STANDARD_TYPE(StepShape_ShapeDefinitionRepresentation))) shbinder = OldWay(start,TP, theProgress); @@ -1754,7 +1910,7 @@ void STEPControl_ActorRead::PrepareUnits(const Handle(StepRepr_Representation)& if (!theGUAC.IsNull()) { stat1 = myUnit.ComputeFactors(theGUAC); - Standard_Integer anglemode = Interface_Static::IVal("step.angleunit.mode"); + Standard_Integer anglemode = myAngleUnitIVal; Standard_Real angleFactor = ( anglemode == 0 ? myUnit.PlaneAngleFactor() : anglemode == 1 ? 1. : M_PI/180. ); StepData_GlobalFactors::Intance().InitializeFactors(myUnit.LengthFactor(), @@ -1769,15 +1925,15 @@ void STEPControl_ActorRead::PrepareUnits(const Handle(StepRepr_Representation)& } // myPrecision = Precision::Confusion(); - if (Interface_Static::IVal("read.precision.mode") == 1) //:i1 gka S4136 05.04.99 - myPrecision = Interface_Static::RVal("read.precision.val"); + if (myPrecisionModeIVal == 1) //:i1 gka S4136 05.04.99 + myPrecision = myPrecisionRVal; else if (myUnit.HasUncertainty()) myPrecision = myUnit.Uncertainty() * myUnit.LengthFactor(); else { TP->AddWarning(theRepCont,"No Length Uncertainty, value of read.precision.val is taken"); - myPrecision = Interface_Static::RVal("read.precision.val"); + myPrecision = myPrecisionRVal; } - myMaxTol = Max ( myPrecision, Interface_Static::RVal("read.maxprecision.val") ); + myMaxTol = Max ( myPrecision, myMaxPrecisionRVal ); // Assign uncertainty #ifdef TRANSLOG if (TP->TraceLevel() > 1) @@ -1793,8 +1949,8 @@ void STEPControl_ActorRead::PrepareUnits(const Handle(StepRepr_Representation)& void STEPControl_ActorRead::ResetUnits () { StepData_GlobalFactors::Intance().InitializeFactors ( 1, 1, 1 ); - myPrecision = Interface_Static::RVal("read.precision.val"); - myMaxTol = Max ( myPrecision, Interface_Static::RVal("read.maxprecision.val") ); + myPrecision = myPrecisionRVal; + myMaxTol = Max (myPrecision, myMaxPrecisionRVal); } //======================================================================= diff --git a/src/STEPControl/STEPControl_ActorRead.hxx b/src/STEPControl/STEPControl_ActorRead.hxx index cebac50190..ce0ad0ecb8 100644 --- a/src/STEPControl/STEPControl_ActorRead.hxx +++ b/src/STEPControl/STEPControl_ActorRead.hxx @@ -172,6 +172,57 @@ protected: const Handle(Transfer_TransientProcess)& TP, const Message_ProgressRange& theProgress); + Standard_EXPORT void SetAngleUnitIVal(const Standard_Integer theVal); + + Standard_EXPORT void SetStepShapeReprIVal(const Standard_Integer theVal); + + Standard_EXPORT void SetRelationshipIVal(const Standard_Integer theVal); + + Standard_EXPORT void SetShapeAspectIVal(const Standard_Integer theVal); + + Standard_EXPORT void SetProductCVal(const Standard_CString& theVal); + + Standard_EXPORT void SetReadAssemblyIValconst(Standard_Integer theVal); + + Standard_EXPORT void SetNonmanifoldIVal(const Standard_Integer theVal); + + Standard_EXPORT void SetIdeasModeIVal(const Standard_Integer theVal); + + Standard_EXPORT void SetConstructiveGeomIVal(const Standard_Integer theVal); + + Standard_EXPORT void SetRootTransformationIVal(const Standard_Integer theVal); + + Standard_EXPORT void SetPrecisionModeIVal(const Standard_Integer theVal); + + Standard_EXPORT void SetPrecisionRVal(const Standard_Real theVal); + + Standard_EXPORT void SetMaxPrecisionRVal(const Standard_Real theVal); + + Standard_EXPORT Standard_Integer GetAngleUnitIVal() const; + + Standard_EXPORT Standard_Integer GetStepShapeReprIVal() const; + + Standard_EXPORT Standard_Integer GetRelationshipIVal() const; + + Standard_EXPORT Standard_Integer GetShapeAspectIVal() const; + + Standard_EXPORT Standard_CString GetProductCVal() const; + + Standard_EXPORT Standard_Integer GetReadAssemblyIVal() const; + + Standard_EXPORT Standard_Integer GetNonmanifoldIVal() const; + + Standard_EXPORT Standard_Integer GetIdeasModeIVal() const; + + Standard_EXPORT Standard_Integer GetConstructiveGeomIVal() const; + + Standard_EXPORT Standard_Integer GetRootTransformationIVal() const; + + Standard_EXPORT Standard_Integer GetPrecisionModeIVal() const; + + Standard_EXPORT Standard_Real GetPrecisionRVal() const; + + Standard_EXPORT Standard_Real GetMaxPrecisionRVal() const; private: @@ -185,7 +236,19 @@ private: Standard_Real myPrecision; Standard_Real myMaxTol; Handle(StepRepr_Representation) mySRContext; - + Standard_Integer myAngleUnitIVal; + Standard_Integer myStepShapeReprIVal; + Standard_Integer myRelationshipIVal; + Standard_Integer myShapeAspectIVal; + Standard_CString myProductCVal; + Standard_Integer myReadAssemblyIVal; + Standard_Integer myNonmanifoldIVal; + Standard_Boolean myIdeasModeIVal; + Standard_Integer myConstructiveGeomIVal; + Standard_Integer myRootTransformationIVal; + Standard_Integer myPrecisionModeIVal; + Standard_Real myPrecisionRVal; + Standard_Real myMaxPrecisionRVal; }; diff --git a/src/STEPControl/STEPControl_ActorWrite.cxx b/src/STEPControl/STEPControl_ActorWrite.cxx index e83fd17279..9f73cd0dbe 100644 --- a/src/STEPControl/STEPControl_ActorWrite.cxx +++ b/src/STEPControl/STEPControl_ActorWrite.cxx @@ -232,6 +232,13 @@ static Standard_Boolean IsManifoldShape(const TopoDS_Shape& theShape) { STEPControl_ActorWrite::STEPControl_ActorWrite () : mygroup (0) , mytoler (-1.) { + myAngleUnitIVal = Interface_Static::IVal("step.angleunit.mode"); + mySchemaIVal = Interface_Static::IVal("write.step.schema"); + myPrecisionModeIVal = Interface_Static::IVal("write.precision.mode"); + myVertexModeIVal = Interface_Static::IVal("write.step.vertex.mode"); + myNonmanifoldIVal = Interface_Static::IVal("write.step.nonmanifold"); + myPrecisionRVal = Interface_Static::RVal("write.precision.val"); + myMaxPrecisionRVal = Interface_Static::RVal("read.maxprecision.val"); SetMode(STEPControl_ShellBasedSurfaceModel); } @@ -468,7 +475,7 @@ 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"); + Standard_Integer anglemode = myAngleUnitIVal; StepData_GlobalFactors::Intance().InitializeFactors (aLFactor, ( anglemode <= 1 ? 1. : M_PI/180. ), 1. ); // create SDR @@ -532,7 +539,7 @@ Standard_Boolean STEPControl_ActorWrite::IsAssembly (TopoDS_Shape &S) const { if ( ! GroupMode() || S.ShapeType() != TopAbs_COMPOUND ) return Standard_False; // PTV 16.09.2002 OCC725 for storing compound of vertices - if (Interface_Static::IVal("write.step.vertex.mode") == 0) {//bug 23950 + if (myVertexModeIVal == 0) {//bug 23950 if (S.ShapeType() == TopAbs_COMPOUND ) { Standard_Boolean IsOnlyVertices = Standard_True; TopoDS_Iterator anItr( S ); @@ -556,6 +563,83 @@ Standard_Boolean STEPControl_ActorWrite::IsAssembly (TopoDS_Shape &S) const return IsAssembly ( S ); } +void STEPControl_ActorWrite::SetGetAngleUnitIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("step.angleunit.mode", theVal); + myAngleUnitIVal = theVal; +} + +void STEPControl_ActorWrite::SetSchemaIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("write.step.schema", theVal); + mySchemaIVal = theVal; +} + +void STEPControl_ActorWrite::SetPrecisionModeIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("write.precision.mode", theVal); + myPrecisionModeIVal = theVal; +} + +void STEPControl_ActorWrite::SetVertexModeIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("write.step.vertex.mode", theVal); + myVertexModeIVal = theVal; +} + +void STEPControl_ActorWrite::SetNonmanifoldIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("write.step.nonmanifold", theVal); + myNonmanifoldIVal = theVal; +} + +void STEPControl_ActorWrite::SetPrecisionRVal(const Standard_Real theVal) +{ + Interface_Static::SetRVal("write.precision.val", theVal); + myPrecisionRVal = theVal; +} + +void STEPControl_ActorWrite::SetMaxPrecisionRVal(const Standard_Real theVal) +{ + Interface_Static::SetRVal("read.maxprecision.val", theVal); + myMaxPrecisionRVal = theVal; +} + +Standard_Integer STEPControl_ActorWrite::GetAngleUnitIVal() const +{ + return myAngleUnitIVal; +} + +Standard_Integer STEPControl_ActorWrite::GetSchemaIVal() const +{ + return mySchemaIVal; +} + +Standard_Integer STEPControl_ActorWrite::GetPrecisionModeIVal() const +{ + return myPrecisionModeIVal; +} + +Standard_Integer STEPControl_ActorWrite::GetVertexModeIVal() const +{ + return myVertexModeIVal; +} + +Standard_Integer STEPControl_ActorWrite::GetNonmanifoldIVal() const +{ + return myNonmanifoldIVal; +} + +Standard_Real STEPControl_ActorWrite::GetPrecisionRVal() const +{ + return myPrecisionRVal; +} + +Standard_Real STEPControl_ActorWrite::GetMaxPrecisionRVal() const +{ + return myMaxPrecisionRVal; +} + //======================================================================= //function : TransferShape //purpose : @@ -651,7 +735,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape Message_ProgressScope aPSRoot(theProgress, NULL, 2); // [BEGIN] Separate manifold topology from non-manifold in group mode 0 (ssv; 18.11.2010) - Standard_Boolean isNMMode = Interface_Static::IVal("write.step.nonmanifold") != 0; + Standard_Boolean isNMMode = myNonmanifoldIVal != 0; Handle(Transfer_Binder) aNMBinder; if (isNMMode && !GroupMode() && theShape.ShapeType() == TopAbs_COMPOUND) { TopoDS_Compound aNMCompound; @@ -774,8 +858,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape // create a list of items to translate Handle(TopTools_HSequenceOfShape) RepItemSeq = new TopTools_HSequenceOfShape(); - Standard_Boolean isSeparateVertices = - Interface_Static::IVal("write.step.vertex.mode") == 0;//bug 23950 + Standard_Boolean isSeparateVertices = myVertexModeIVal;//bug 23950 // PTV 16.09.2002 OCC725 separate shape from solo vertices. Standard_Boolean isOnlyVertices = Standard_False; if (theShape.ShapeType() == TopAbs_COMPOUND) { @@ -907,7 +990,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape // if ( DMT.IsDone() ) aShape = DMT.ModifiedShape ( aShape ); //// aShape = TopoDSToStep::DirectFaces(xShape); Handle(Standard_Transient) info; - Standard_Real maxTol = Interface_Static::RVal("read.maxprecision.val"); + Standard_Real maxTol = myMaxPrecisionRVal; Message_ProgressScope aPS1 (aPS.Next(), NULL, 2); @@ -1191,7 +1274,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferShape GetCasted(StepRepr_RepresentationItem, ItemSeq->Value(rep)); items->SetValue(rep,repit); } - Standard_Integer ap = Interface_Static::IVal("write.step.schema"); + Standard_Integer ap = mySchemaIVal; Transfer_SequenceOfBinder aSeqBindRelation; if(ap == 3 && nbs > 1) { Standard_Integer j = 1; @@ -1298,7 +1381,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferCompound TopoDS_Shape theShape = mapper->Value(); // Inspect non-manifold topology case (ssv; 10.11.2010) - Standard_Boolean isNMMode = Interface_Static::IVal("write.step.nonmanifold") != 0; + Standard_Boolean isNMMode = myNonmanifoldIVal != 0; Standard_Boolean isManifold; if (isNMMode) isManifold = IsManifoldShape(theShape); @@ -1309,8 +1392,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferCompound Handle(TopTools_HSequenceOfShape) RepItemSeq = new TopTools_HSequenceOfShape(); // Prepare a collection for non-manifold group of shapes Handle(TopTools_HSequenceOfShape) NonManifoldGroup = new TopTools_HSequenceOfShape(); - Standard_Boolean isSeparateVertices = - (Interface_Static::IVal("write.step.vertex.mode") == 0);//bug 23950 + Standard_Boolean isSeparateVertices = myVertexModeIVal == 0;//bug 23950 // PTV OCC725 17.09.2002 -- begin -- Standard_Integer nbFreeVrtx = 0; TopoDS_Compound aCompOfVrtx; diff --git a/src/STEPControl/STEPControl_ActorWrite.hxx b/src/STEPControl/STEPControl_ActorWrite.hxx index 513e2eab43..acfd83cbe9 100644 --- a/src/STEPControl/STEPControl_ActorWrite.hxx +++ b/src/STEPControl/STEPControl_ActorWrite.hxx @@ -96,8 +96,33 @@ public: //! NOTE: this method can modify shape Standard_EXPORT virtual Standard_Boolean IsAssembly (TopoDS_Shape& S) const; + Standard_EXPORT void SetGetAngleUnitIVal(const Standard_Integer theVal); + Standard_EXPORT void SetSchemaIVal(const Standard_Integer theVal); + Standard_EXPORT void SetPrecisionModeIVal(const Standard_Integer theVal); + + Standard_EXPORT void SetVertexModeIVal(const Standard_Integer theVal); + + Standard_EXPORT void SetNonmanifoldIVal(const Standard_Integer theVal); + + Standard_EXPORT void SetPrecisionRVal(const Standard_Real theVal); + + Standard_EXPORT void SetMaxPrecisionRVal(const Standard_Real theVal); + + Standard_EXPORT Standard_Integer GetAngleUnitIVal() const; + + Standard_EXPORT Standard_Integer GetSchemaIVal() const; + + Standard_EXPORT Standard_Integer GetPrecisionModeIVal() const; + + Standard_EXPORT Standard_Integer GetVertexModeIVal() const; + + Standard_EXPORT Standard_Integer GetNonmanifoldIVal() const; + + Standard_EXPORT Standard_Real GetPrecisionRVal() const; + + Standard_EXPORT Standard_Real GetMaxPrecisionRVal() const; DEFINE_STANDARD_RTTIEXT(STEPControl_ActorWrite,Transfer_ActorOfFinderProcess) @@ -122,7 +147,13 @@ private: Standard_Integer mygroup; Standard_Real mytoler; STEPConstruct_ContextTool myContext; - + Standard_Integer myAngleUnitIVal; + Standard_Integer mySchemaIVal; + Standard_Integer myPrecisionModeIVal; + Standard_Integer myVertexModeIVal; + Standard_Integer myNonmanifoldIVal; + Standard_Real myPrecisionRVal; + Standard_Real myMaxPrecisionRVal; }; diff --git a/src/STEPControl/STEPControl_Controller.cxx b/src/STEPControl/STEPControl_Controller.cxx index ceb1d99b81..c6fcda38b9 100644 --- a/src/STEPControl/STEPControl_Controller.cxx +++ b/src/STEPControl/STEPControl_Controller.cxx @@ -63,6 +63,8 @@ STEPControl_Controller::STEPControl_Controller () RWHeaderSection::Init(); RWStepAP214::Init(); Interface_Static::Init ("step","write.step.product.name",'t',"Open CASCADE STEP translator " OCC_VERSION_STRING); + Interface_Static::SetCVal("write.step.product.name", ""); + Interface_Static::Init ("step","write.step.assembly",'e',""); Interface_Static::Init ("step","write.step.assembly",'&',"enum 0"); Interface_Static::Init ("step","write.step.assembly",'&',"eval Off"); diff --git a/src/STEPControl/STEPControl_Reader.cxx b/src/STEPControl/STEPControl_Reader.cxx index b7c003bc14..e3d40eee24 100644 --- a/src/STEPControl/STEPControl_Reader.cxx +++ b/src/STEPControl/STEPControl_Reader.cxx @@ -75,6 +75,10 @@ STEPControl_Reader::STEPControl_Reader () { STEPControl_Controller::Init(); + myAllShapeIVal = Interface_Static::IVal("read.step.all.shapes"); + myProductContextCVal = Interface_Static::CVal("read.step.product.context"); + myProductContextIVal = Interface_Static::IVal("read.step.product.context"); + myProductModeCVal = Interface_Static::CVal("read.step.product.mode"); SetNorm ("STEP"); } @@ -88,6 +92,10 @@ STEPControl_Reader::STEPControl_Reader { STEPControl_Controller::Init(); SetWS (WS,scratch); + myAllShapeIVal = Interface_Static::IVal("read.step.all.shapes"); + myProductContextCVal = Interface_Static::CVal("read.step.product.context"); + myProductContextIVal = Interface_Static::IVal("read.step.product.context"); + myProductModeCVal = Interface_Static::CVal("read.step.product.mode"); SetNorm ("STEP"); } @@ -126,7 +134,7 @@ Standard_Integer STEPControl_Reader::NbRootsForTransfer() Standard_Integer nb = Model()->NbEntities(); for (Standard_Integer i = 1; i <= nb; i ++) { Handle(Standard_Transient) ent = Model()->Value(i); - if (Interface_Static::IVal("read.step.all.shapes") == 1) { + if (myAllShapeIVal == 1) { // Special case to read invalid shape_representation without links to shapes. if (ent->IsKind(STANDARD_TYPE(StepShape_ManifoldSolidBrep))) { Interface_EntityIterator aShareds = WS()->Graph().Sharings(ent); @@ -186,9 +194,9 @@ Standard_Integer STEPControl_Reader::NbRootsForTransfer() } // determinate roots used ProductDefinitionContext if(IsRoot) { - const char *str1 = Interface_Static::CVal("read.step.product.context"); - Standard_Integer ICS = Interface_Static::IVal("read.step.product.context"); - if(ICS>1) { + const char *aStr1 = myProductContextCVal; + Standard_Integer anICS = myProductContextIVal; + if(anICS>1) { subs = graph.Shareds(PD); for(subs.Start(); subs.More(); subs.Next()) { Handle(StepBasic_ProductDefinitionContext) PDC = @@ -196,7 +204,7 @@ Standard_Integer STEPControl_Reader::NbRootsForTransfer() if (PDC.IsNull()) continue; const char *str2 = PDC->LifeCycleStage()->String().ToCString(); const char *str3 = PDC->Name()->String().ToCString(); - if( !( strcasecmp(str1,str2)==0 || strcasecmp(str1,str3)==0 ) ) + if( !( strcasecmp(aStr1,str2)==0 || strcasecmp(aStr1,str3)==0 ) ) IsRoot=Standard_False; } } @@ -220,7 +228,7 @@ Standard_Integer STEPControl_Reader::NbRootsForTransfer() WS()->TransferReader()->TransientProcess()->RootsForTransfer()->Append(ent); } } - TCollection_AsciiString aProdMode = Interface_Static::CVal("read.step.product.mode"); + TCollection_AsciiString aProdMode = myProductModeCVal; if(!aProdMode.IsEqual("ON")) { if(ent->IsKind(STANDARD_TYPE(StepShape_ShapeDefinitionRepresentation))) { Standard_Boolean IsRoot = Standard_True; @@ -588,3 +596,47 @@ Standard_Boolean STEPControl_Reader::findUnits( return nbFind != 0; } + +void STEPControl_Reader::SetAllShapeIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("read.step.all.shapes", theVal); + myAllShapeIVal = theVal; +} + +void STEPControl_Reader::SetProductContextCVal(const Standard_CString theVal) +{ + Interface_Static::SetCVal("read.step.product.context", theVal); + myProductContextCVal = theVal; +} + +void STEPControl_Reader::SetProductContextIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("read.step.product.context", theVal); + myProductContextIVal = theVal; +} + +void STEPControl_Reader::SetProductModeCVal(const Standard_CString theVal) +{ + Interface_Static::SetCVal("read.step.product.mode", theVal); + myProductModeCVal = theVal; +} + +Standard_Integer STEPControl_Reader::GetAllShapeIVal() const +{ + return myAllShapeIVal; +} + +Standard_CString STEPControl_Reader::GetProductContextCVal() const +{ + return myProductContextCVal; +} + +Standard_Integer STEPControl_Reader::GetProductContextIVal() const +{ + return myProductContextIVal; +} + +Standard_CString STEPControl_Reader::GetProductModeCVal() const +{ + return myProductModeCVal; +} \ No newline at end of file diff --git a/src/STEPControl/STEPControl_Reader.hxx b/src/STEPControl/STEPControl_Reader.hxx index 1619174474..ba1690c4ae 100644 --- a/src/STEPControl/STEPControl_Reader.hxx +++ b/src/STEPControl/STEPControl_Reader.hxx @@ -106,6 +106,22 @@ public: //! Returns system length unit used by transfer process Standard_EXPORT Standard_Real SystemLengthUnit() const; + Standard_EXPORT void SetAllShapeIVal(const Standard_Integer theVal); + + Standard_EXPORT void SetProductContextCVal(const Standard_CString theVal); + + Standard_EXPORT void SetProductContextIVal(const Standard_Integer theVal); + + Standard_EXPORT void SetProductModeCVal(const Standard_CString theVal); + + Standard_EXPORT Standard_Integer GetAllShapeIVal() const; + + Standard_EXPORT Standard_CString GetProductContextCVal() const; + + Standard_EXPORT Standard_Integer GetProductContextIVal() const; + + Standard_EXPORT Standard_CString GetProductModeCVal() const; + protected: @@ -118,8 +134,10 @@ private: //! Returns units for length , angle and solidangle for shape representations Standard_EXPORT Standard_Boolean findUnits (const Handle(StepRepr_RepresentationContext)& theReprContext, TColStd_Array1OfAsciiString& theNameUnits, TColStd_Array1OfReal& theFactorUnits); - - + Standard_Integer myAllShapeIVal; + Standard_CString myProductContextCVal; + Standard_Integer myProductContextIVal; + Standard_CString myProductModeCVal; }; diff --git a/src/StepAP214/StepAP214_Protocol.cxx b/src/StepAP214/StepAP214_Protocol.cxx index d4c4e3d074..118eda087d 100644 --- a/src/StepAP214/StepAP214_Protocol.cxx +++ b/src/StepAP214/StepAP214_Protocol.cxx @@ -1630,6 +1630,7 @@ StepAP214_Protocol::StepAP214_Protocol () types.Bind(STANDARD_TYPE(StepKinematics_MechanismStateRepresentation), 801); types.Bind(STANDARD_TYPE(StepVisual_RepositionedTessellatedGeometricSet), 802); types.Bind(STANDARD_TYPE(StepVisual_RepositionedTessellatedItem), 803); + mySchemaIVal = Interface_Static::IVal("write.step.schema"); } @@ -1654,7 +1655,7 @@ Handle(Standard_Type)& atype) const Standard_CString StepAP214_Protocol::SchemaName() const { - switch (Interface_Static::IVal("write.step.schema")) { //:j4 + switch (mySchemaIVal) { //:j4 default: case 1 : return schemaAP214CD; break; case 2 : return schemaAP214DIS; break; @@ -1687,3 +1688,13 @@ Handle(Interface_Protocol) StepAP214_Protocol::Resource return HeaderSection::Protocol(); } +void StepAP214_Protocol::SetSchemaIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("write.step.schema", theVal); + mySchemaIVal = theVal; +} + +Standard_Integer StepAP214_Protocol::GetSchemaIVal() const +{ + return mySchemaIVal; +} diff --git a/src/StepAP214/StepAP214_Protocol.hxx b/src/StepAP214/StepAP214_Protocol.hxx index ab13ff90e8..e4b5d1a5ab 100644 --- a/src/StepAP214/StepAP214_Protocol.hxx +++ b/src/StepAP214/StepAP214_Protocol.hxx @@ -51,7 +51,9 @@ public: //! Returns a Resource, given its rank (between 1 and NbResources) Standard_EXPORT virtual Handle(Interface_Protocol) Resource (const Standard_Integer num) const Standard_OVERRIDE; + Standard_EXPORT void SetSchemaIVal(const Standard_Integer theVal); + Standard_EXPORT Standard_Integer GetSchemaIVal() const; DEFINE_STANDARD_RTTIEXT(StepAP214_Protocol,StepData_Protocol) @@ -63,7 +65,7 @@ protected: private: - + Standard_Integer mySchemaIVal; }; diff --git a/src/StepData/StepData_StepModel.cxx b/src/StepData/StepData_StepModel.cxx index 2768a85d19..8f3dffddce 100644 --- a/src/StepData/StepData_StepModel.cxx +++ b/src/StepData/StepData_StepModel.cxx @@ -38,7 +38,8 @@ IMPLEMENT_STANDARD_RTTIEXT(StepData_StepModel,Interface_InterfaceModel) StepData_StepModel::StepData_StepModel () :mySourceCodePage((Resource_FormatType)Interface_Static::IVal("read.step.codepage")), myReadUnitIsInitialized(Standard_False), myWriteUnit (1.) { - switch (Interface_Static::IVal("write.step.unit")) + myWriteUnitIVal = Interface_Static::IVal("write.step.unit"); + switch (myWriteUnitIVal) { case 1: myWriteUnit = 25.4; break; case 2: myWriteUnit = 1.; break; @@ -247,4 +248,15 @@ void StepData_StepModel::SetWriteLengthUnit(const Standard_Real theUnit) Standard_Real StepData_StepModel::WriteLengthUnit() const { return myWriteUnit; -} \ No newline at end of file +} + +void StepData_StepModel::SetWriteUnitIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("write.step.unit", theVal); + myWriteUnitIVal = theVal; +} + +Standard_Integer StepData_StepModel::GetWriteUnitIVal() const +{ + return myWriteUnitIVal; +} diff --git a/src/StepData/StepData_StepModel.hxx b/src/StepData/StepData_StepModel.hxx index dce1d5beb0..a3b2ba2bed 100644 --- a/src/StepData/StepData_StepModel.hxx +++ b/src/StepData/StepData_StepModel.hxx @@ -120,6 +120,10 @@ public: //! False - the unit value was not initialized, the default value is used Standard_Boolean IsInitializedUnit() const { return myReadUnitIsInitialized; } + Standard_EXPORT void SetWriteUnitIVal(const Standard_Integer theVal); + + Standard_EXPORT Standard_Integer GetWriteUnitIVal() const; + DEFINE_STANDARD_RTTIEXT(StepData_StepModel,Interface_InterfaceModel) protected: @@ -135,6 +139,7 @@ private: Resource_FormatType mySourceCodePage; Standard_Boolean myReadUnitIsInitialized; Standard_Real myWriteUnit; + Standard_Integer myWriteUnitIVal; }; diff --git a/src/StepToTopoDS/StepToTopoDS_TranslateCompositeCurve.cxx b/src/StepToTopoDS/StepToTopoDS_TranslateCompositeCurve.cxx index f3660ea1f3..0c1c25ae23 100644 --- a/src/StepToTopoDS/StepToTopoDS_TranslateCompositeCurve.cxx +++ b/src/StepToTopoDS/StepToTopoDS_TranslateCompositeCurve.cxx @@ -107,10 +107,11 @@ Standard_Boolean StepToTopoDS_TranslateCompositeCurve::Init (const Handle(StepGe Standard_Boolean SurfMode = ( ! S.IsNull() && ! Surf.IsNull() ); Standard_Boolean isClosed = Standard_False; + mySurCurModeIVal = Interface_Static::IVal("read.surfacecurve.mode"); - if ( SurfMode ) { - Standard_Integer modepcurve = Interface_Static::IVal("read.surfacecurve.mode"); - if ( modepcurve ==-3 ) SurfMode = Standard_False; + if (SurfMode && mySurCurModeIVal == -3) + { + SurfMode = Standard_False; } Handle(ShapeExtend_WireData) sbwd = new ShapeExtend_WireData; @@ -286,3 +287,14 @@ const TopoDS_Wire& StepToTopoDS_TranslateCompositeCurve::Value () const { return myWire; } + +void StepToTopoDS_TranslateCompositeCurve::SetSurCurModeIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("read.surfacecurve.mode", theVal); + mySurCurModeIVal = theVal; +} + +Standard_Integer StepToTopoDS_TranslateCompositeCurve::GetSurCurModeIVal() const +{ + return mySurCurModeIVal; +} diff --git a/src/StepToTopoDS/StepToTopoDS_TranslateCompositeCurve.hxx b/src/StepToTopoDS/StepToTopoDS_TranslateCompositeCurve.hxx index 36d4d6c062..fe73051c8b 100644 --- a/src/StepToTopoDS/StepToTopoDS_TranslateCompositeCurve.hxx +++ b/src/StepToTopoDS/StepToTopoDS_TranslateCompositeCurve.hxx @@ -63,9 +63,11 @@ public: Standard_EXPORT const TopoDS_Wire& Value() const; //! Returns True if composite_curve contains a segment with infinite parameters. - Standard_Boolean IsInfiniteSegment() const; + Standard_Boolean IsInfiniteSegment() const; + Standard_EXPORT void SetSurCurModeIVal(const Standard_Integer theVal); + Standard_EXPORT Standard_Integer GetSurCurModeIVal() const; protected: @@ -80,6 +82,7 @@ private: TopoDS_Wire myWire; Standard_Boolean myInfiniteSegment; + Standard_Integer mySurCurModeIVal }; diff --git a/src/StepToTopoDS/StepToTopoDS_TranslateEdgeLoop.cxx b/src/StepToTopoDS/StepToTopoDS_TranslateEdgeLoop.cxx index 9de5910cf6..31d14e0697 100644 --- a/src/StepToTopoDS/StepToTopoDS_TranslateEdgeLoop.cxx +++ b/src/StepToTopoDS/StepToTopoDS_TranslateEdgeLoop.cxx @@ -226,7 +226,7 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac done = Standard_True; return; } - Standard_Integer modepcurve = Interface_Static::IVal("read.surfacecurve.mode"); + mySurCurModeIVal = Interface_Static::IVal("read.surfacecurve.mode"); // 0,1 : suivre le code, 2 : ne prendre que pcurve, 3 : ne prendre que C3D BRep_Builder B; @@ -498,7 +498,7 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac // If modepcurve = 3, PCurve are ignored here // ----------------------------------------- - else if (modepcurve == 3) { + else if (mySurCurModeIVal == 3) { aTool.ComputePCurve(Standard_True); hasPcurve = Standard_False; } @@ -745,3 +745,13 @@ StepToTopoDS_TranslateEdgeLoopError StepToTopoDS_TranslateEdgeLoop::Error() cons return myError; } +void StepToTopoDS_TranslateEdgeLoop::SetSurCurModeIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("read.surfacecurve.mode", theVal); + mySurCurModeIVal = theVal; +} + +Standard_Integer StepToTopoDS_TranslateEdgeLoop::GetSurCurModeIVal() const +{ + return mySurCurModeIVal; +} diff --git a/src/StepToTopoDS/StepToTopoDS_TranslateEdgeLoop.hxx b/src/StepToTopoDS/StepToTopoDS_TranslateEdgeLoop.hxx index 878a065f58..afdf9253d3 100644 --- a/src/StepToTopoDS/StepToTopoDS_TranslateEdgeLoop.hxx +++ b/src/StepToTopoDS/StepToTopoDS_TranslateEdgeLoop.hxx @@ -51,7 +51,9 @@ public: Standard_EXPORT StepToTopoDS_TranslateEdgeLoopError Error() const; + Standard_EXPORT void SetSurCurModeIVal(const Standard_Integer theVal); + Standard_EXPORT Standard_Integer GetSurCurModeIVal() const; protected: @@ -66,6 +68,7 @@ private: StepToTopoDS_TranslateEdgeLoopError myError; TopoDS_Shape myResult; + Standard_Integer mySurCurModeIVal; }; diff --git a/src/TopoDSToStep/TopoDSToStep_MakeStepEdge.cxx b/src/TopoDSToStep/TopoDSToStep_MakeStepEdge.cxx index e6d4c0cd90..c3254ce29f 100644 --- a/src/TopoDSToStep/TopoDSToStep_MakeStepEdge.cxx +++ b/src/TopoDSToStep/TopoDSToStep_MakeStepEdge.cxx @@ -91,7 +91,8 @@ void TopoDSToStep_MakeStepEdge::Init(const TopoDS_Edge& aEdge, aTool.SetCurrentEdge(aEdge); // [BEGIN] Processing non-manifold topology (ssv; 11.11.2010) - Standard_Boolean isNMMode = Interface_Static::IVal("write.step.nonmanifold") != 0; + myNonmanifoldIVal = Interface_Static::IVal("write.step.nonmanifold"); + Standard_Boolean isNMMode = myNonmanifoldIVal != 0; if (isNMMode) { Handle(StepShape_EdgeCurve) anEC; Handle(TransferBRep_ShapeMapper) aSTEPMapper = TransferBRep::ShapeMapper(FP, aEdge); @@ -356,3 +357,15 @@ TopoDSToStep_MakeEdgeError TopoDSToStep_MakeStepEdge::Error() const { return myError; } + +void TopoDSToStep_MakeStepEdge::SetNonmanifoldIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("write.step.nonmanifold", theVal); + myNonmanifoldIVal = theVal; +} + +Standard_Integer TopoDSToStep_MakeStepEdge::GetNonmanifoldIVal() const +{ + return myNonmanifoldIVal; +} + diff --git a/src/TopoDSToStep/TopoDSToStep_MakeStepEdge.hxx b/src/TopoDSToStep/TopoDSToStep_MakeStepEdge.hxx index a9a30f25d7..02eacba90f 100644 --- a/src/TopoDSToStep/TopoDSToStep_MakeStepEdge.hxx +++ b/src/TopoDSToStep/TopoDSToStep_MakeStepEdge.hxx @@ -49,7 +49,9 @@ public: Standard_EXPORT TopoDSToStep_MakeEdgeError Error() const; + Standard_EXPORT void SetNonmanifoldIVal(const Standard_Integer theVal); + Standard_EXPORT Standard_Integer GetNonmanifoldIVal() const; protected: @@ -64,6 +66,7 @@ private: Handle(StepShape_TopologicalRepresentationItem) myResult; TopoDSToStep_MakeEdgeError myError; + Standard_Integer myNonmanifoldIVal; }; diff --git a/src/TopoDSToStep/TopoDSToStep_MakeStepFace.cxx b/src/TopoDSToStep/TopoDSToStep_MakeStepFace.cxx index 5cf564b01f..1a13cb019a 100644 --- a/src/TopoDSToStep/TopoDSToStep_MakeStepFace.cxx +++ b/src/TopoDSToStep/TopoDSToStep_MakeStepFace.cxx @@ -120,6 +120,7 @@ void TopoDSToStep_MakeStepFace::Init(const TopoDS_Face& aFace, // -------------------------------------------------------------- //szv#4:S4163:12Mar99 SGI warns + myNonmanifoldIVal = Interface_Static::IVal("write.step.nonmanifold"); TopoDS_Shape sh = aFace.Oriented(TopAbs_FORWARD); const TopoDS_Face ForwardFace = TopoDS::Face(sh); aTool.SetCurrentFace(ForwardFace); @@ -127,7 +128,7 @@ void TopoDSToStep_MakeStepFace::Init(const TopoDS_Face& aFace, new TransferBRep_ShapeMapper(aFace); // on ne sait jamais // [BEGIN] Processing non-manifold topology (another approach) (ssv; 10.11.2010) - Standard_Boolean isNMMode = Interface_Static::IVal("write.step.nonmanifold") != 0; + Standard_Boolean isNMMode = myNonmanifoldIVal != 0; if (isNMMode) { Handle(StepShape_AdvancedFace) anAF; Handle(TransferBRep_ShapeMapper) aSTEPMapper = TransferBRep::ShapeMapper(FP, aFace); @@ -524,3 +525,14 @@ TopoDSToStep_MakeFaceError TopoDSToStep_MakeStepFace::Error() const { return myError; } + +void TopoDSToStep_MakeStepFace::SetNonmanifoldIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("write.step.nonmanifold", theVal); + myNonmanifoldIVal = theVal; +} + +Standard_Integer TopoDSToStep_MakeStepFace::GetNonmanifoldIVal() const +{ + return myNonmanifoldIVal; +} diff --git a/src/TopoDSToStep/TopoDSToStep_MakeStepFace.hxx b/src/TopoDSToStep/TopoDSToStep_MakeStepFace.hxx index a0612f329b..bf2bff67cc 100644 --- a/src/TopoDSToStep/TopoDSToStep_MakeStepFace.hxx +++ b/src/TopoDSToStep/TopoDSToStep_MakeStepFace.hxx @@ -49,7 +49,9 @@ public: Standard_EXPORT TopoDSToStep_MakeFaceError Error() const; + Standard_EXPORT void SetNonmanifoldIVal(const Standard_Integer theVal); + Standard_EXPORT Standard_Integer GetNonmanifoldIVal() const; protected: @@ -64,6 +66,7 @@ private: Handle(StepShape_TopologicalRepresentationItem) myResult; TopoDSToStep_MakeFaceError myError; + Standard_Integer myNonmanifoldIVal; }; diff --git a/src/TopoDSToStep/TopoDSToStep_MakeStepVertex.cxx b/src/TopoDSToStep/TopoDSToStep_MakeStepVertex.cxx index 24896e4fff..31befce3ed 100644 --- a/src/TopoDSToStep/TopoDSToStep_MakeStepVertex.cxx +++ b/src/TopoDSToStep/TopoDSToStep_MakeStepVertex.cxx @@ -59,11 +59,11 @@ void TopoDSToStep_MakeStepVertex::Init(const TopoDS_Vertex& aVertex, TopoDSToStep_Tool& aTool, const Handle(Transfer_FinderProcess)& FP) { - + myNonmanifoldIVal = Interface_Static::IVal("write.step.nonmanifold"); aTool.SetCurrentVertex(aVertex); // [BEGIN] Processing non-manifold topology (ssv; 11.11.2010) - Standard_Boolean isNMMode = Interface_Static::IVal("write.step.nonmanifold") != 0; + Standard_Boolean isNMMode = myNonmanifoldIVal != 0; if (isNMMode) { Handle(StepShape_VertexPoint) aVP; Handle(TransferBRep_ShapeMapper) aSTEPMapper = TransferBRep::ShapeMapper(FP, aVertex); @@ -124,3 +124,13 @@ TopoDSToStep_MakeVertexError TopoDSToStep_MakeStepVertex::Error() const return myError; } +void TopoDSToStep_MakeStepVertex::SetNonmanifoldIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("write.step.nonmanifold", theVal); + myNonmanifoldIVal = theVal; +} + +Standard_Integer TopoDSToStep_MakeStepVertex::GetNonmanifoldIVal() const +{ + return myNonmanifoldIVal; +} diff --git a/src/TopoDSToStep/TopoDSToStep_MakeStepVertex.hxx b/src/TopoDSToStep/TopoDSToStep_MakeStepVertex.hxx index 1105da6309..8bbacd47a9 100644 --- a/src/TopoDSToStep/TopoDSToStep_MakeStepVertex.hxx +++ b/src/TopoDSToStep/TopoDSToStep_MakeStepVertex.hxx @@ -49,7 +49,9 @@ public: Standard_EXPORT TopoDSToStep_MakeVertexError Error() const; + Standard_EXPORT void SetNonmanifoldIVal(const Standard_Integer theVal); + Standard_EXPORT Standard_Integer GetNonmanifoldIVal() const; protected: @@ -64,6 +66,7 @@ private: Handle(StepShape_TopologicalRepresentationItem) myResult; TopoDSToStep_MakeVertexError myError; + Standard_Integer myNonmanifoldIVal; }; diff --git a/src/TopoDSToStep/TopoDSToStep_Tool.cxx b/src/TopoDSToStep/TopoDSToStep_Tool.cxx index 8158038100..9f67571381 100644 --- a/src/TopoDSToStep/TopoDSToStep_Tool.cxx +++ b/src/TopoDSToStep/TopoDSToStep_Tool.cxx @@ -338,3 +338,9 @@ Standard_Integer TopoDSToStep_Tool::PCurveMode () const { return myPCurveMode; } + +void TopoDSToStep_Tool::SetPCurveMode(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("write.surfacecurve.mode", theVal); + myPCurveMode = theVal; +} diff --git a/src/TopoDSToStep/TopoDSToStep_Tool.hxx b/src/TopoDSToStep/TopoDSToStep_Tool.hxx index 2ea4c294a6..9e1cb057a3 100644 --- a/src/TopoDSToStep/TopoDSToStep_Tool.hxx +++ b/src/TopoDSToStep/TopoDSToStep_Tool.hxx @@ -89,7 +89,7 @@ public: //! (initialized by parameter write.surfacecurve.mode) Standard_EXPORT Standard_Integer PCurveMode() const; - + Standard_EXPORT void SetPCurveMode(const Standard_Integer theVal); protected: diff --git a/src/XSAlgo/XSAlgo_AlgoContainer.cxx b/src/XSAlgo/XSAlgo_AlgoContainer.cxx index 60da82932b..ea66d6b878 100644 --- a/src/XSAlgo/XSAlgo_AlgoContainer.cxx +++ b/src/XSAlgo/XSAlgo_AlgoContainer.cxx @@ -72,6 +72,8 @@ IMPLEMENT_STANDARD_RTTIEXT(XSAlgo_AlgoContainer,Standard_Transient) //======================================================================= XSAlgo_AlgoContainer::XSAlgo_AlgoContainer() { + myParModeIVal = Interface_Static::IVal("read.stdsameparameter.mode"); + myUnitIVal = Interface_Static::IVal("xstep.cascade.unit"); myTC = new XSAlgo_ToolContainer; } @@ -82,7 +84,7 @@ XSAlgo_AlgoContainer::XSAlgo_AlgoContainer() void XSAlgo_AlgoContainer::PrepareForTransfer() const { - UnitsMethods::SetCasCadeLengthUnit(Interface_Static::IVal("xstep.cascade.unit")); + UnitsMethods::SetCasCadeLengthUnit(myUnitIVal); } //======================================================================= @@ -357,7 +359,7 @@ Standard_Boolean XSAlgo_AlgoContainer::CheckPCurve (const TopoDS_Edge& E, B.Range(edge,face,w1,w2); B.SameRange(edge, Standard_False ); //:S4136 - Standard_Integer SPmode = Interface_Static::IVal("read.stdsameparameter.mode"); + Standard_Integer SPmode = myParModeIVal; if ( SPmode ) B.SameParameter (edge, Standard_False ); @@ -566,3 +568,25 @@ void XSAlgo_AlgoContainer::MergeTransferInfo(const Handle(Transfer_FinderProcess } } } + +void XSAlgo_AlgoContainer::SetParModeIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("read.stdsameparameter.mode", theVal); + myParModeIVal = theVal; +} + +void XSAlgo_AlgoContainer::SetUnitIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("xstep.cascade.unit", theVal); + myUnitIVal = theVal; +} + +Standard_Integer XSAlgo_AlgoContainer::GetParModeIVal() const +{ + return myParModeIVal; +} + +Standard_EXPORT Standard_Integer XSAlgo_AlgoContainer::GetUnitIVal() const +{ + return myUnitIVal; +} diff --git a/src/XSAlgo/XSAlgo_AlgoContainer.hxx b/src/XSAlgo/XSAlgo_AlgoContainer.hxx index c83dbae22f..b86510279b 100644 --- a/src/XSAlgo/XSAlgo_AlgoContainer.hxx +++ b/src/XSAlgo/XSAlgo_AlgoContainer.hxx @@ -82,7 +82,13 @@ public: //! from item startTPitem Standard_EXPORT virtual void MergeTransferInfo (const Handle(Transfer_FinderProcess)& FP, const Handle(Standard_Transient)& info) const; + Standard_EXPORT void SetParModeIVal(const Standard_Integer theVal); + Standard_EXPORT void SetUnitIVal(const Standard_Integer theVal); + + Standard_EXPORT Standard_Integer GetParModeIVal() const; + + Standard_EXPORT Standard_Integer GetUnitIVal() const; DEFINE_STANDARD_RTTIEXT(XSAlgo_AlgoContainer,Standard_Transient) @@ -96,6 +102,8 @@ private: Handle(XSAlgo_ToolContainer) myTC; + Standard_Integer myParModeIVal; + Standard_Integer myUnitIVal; }; diff --git a/src/XSAlgo/XSAlgo_AlgoContainer.lxx b/src/XSAlgo/XSAlgo_AlgoContainer.lxx index c8bcd8b353..d94a9dae90 100644 --- a/src/XSAlgo/XSAlgo_AlgoContainer.lxx +++ b/src/XSAlgo/XSAlgo_AlgoContainer.lxx @@ -22,6 +22,8 @@ inline void XSAlgo_AlgoContainer::SetToolContainer(const Handle(XSAlgo_ToolContainer)& TC) { + myParModeIVal = Interface_Static::IVal("read.stdsameparameter.mode"); + myUnitIVal = Interface_Static::IVal("xstep.cascade.unit"); myTC = TC; } diff --git a/src/XSControl/XSControl_TransferWriter.cxx b/src/XSControl/XSControl_TransferWriter.cxx index 35347e0b71..7dda904340 100644 --- a/src/XSControl/XSControl_TransferWriter.cxx +++ b/src/XSControl/XSControl_TransferWriter.cxx @@ -145,7 +145,7 @@ IFSelect_ReturnStatus XSControl_TransferWriter::TransferWriteShape if (theModel.IsNull()) return IFSelect_RetVoid; TopoDS_Shape aShape = theShape; - Standard_Boolean isNMMode = Interface_Static::IVal("write.step.nonmanifold") != 0; + Standard_Boolean isNMMode = myNonmanifoldIVal != 0; if (isNMMode) { ShapeUpgrade_RemoveLocations aRemLoc; @@ -222,3 +222,14 @@ Interface_CheckIterator XSControl_TransferWriter::ResultCheckList } return chl; } + +void XSControl_TransferWriter::SetNonmanifoldIVal(const Standard_Integer theVal) +{ + Interface_Static::SetIVal("write.step.nonmanifold", theVal); + myNonmanifoldIVal = theVal; +} + +Standard_Integer XSControl_TransferWriter::GetNonmanifoldIVal() const +{ + return myNonmanifoldIVal; +} diff --git a/src/XSControl/XSControl_TransferWriter.hxx b/src/XSControl/XSControl_TransferWriter.hxx index ba1394e112..3cbbed42b5 100644 --- a/src/XSControl/XSControl_TransferWriter.hxx +++ b/src/XSControl/XSControl_TransferWriter.hxx @@ -22,6 +22,7 @@ #include #include +#include #include class XSControl_Controller; class Interface_InterfaceModel; @@ -65,6 +66,7 @@ class XSControl_TransferWriter : public Standard_Transient void SetController (const Handle(XSControl_Controller)& theCtl) { myController = theCtl; + myNonmanifoldIVal = Interface_Static::IVal("write.step.nonmanifold"); Clear(-1); } @@ -127,6 +129,10 @@ class XSControl_TransferWriter : public Standard_Transient //! instead of keeping the original Mapper, whenever known Standard_EXPORT Interface_CheckIterator ResultCheckList (const Handle(Interface_InterfaceModel)& theModel) const; + Standard_EXPORT void SetNonmanifoldIVal(const Standard_Integer theVal); + + Standard_EXPORT Standard_Integer GetNonmanifoldIVal() const; + DEFINE_STANDARD_RTTIEXT(XSControl_TransferWriter,Standard_Transient) private: @@ -134,6 +140,7 @@ class XSControl_TransferWriter : public Standard_Transient Handle(XSControl_Controller) myController; Handle(Transfer_FinderProcess) myTransferWriter; Standard_Integer myTransferMode; + Standard_Integer myNonmanifoldIVal; }; #endif // _XSControl_TransferWriter_HeaderFile