From 6be3c72e8fa138bb7c0e524fe68796ad1ce726e9 Mon Sep 17 00:00:00 2001 From: szv Date: Wed, 5 Oct 2016 15:41:10 +0300 Subject: [PATCH] Selections are moved to Draw --- src/BRepToIGES/BRepToIGES_BREntity.cxx | 11 - src/HeaderSection/HeaderSection.cxx | 17 +- src/HeaderSection/HeaderSection.hxx | 43 +- src/IFGraph/FILES | 2 - src/IFGraph/IFGraph_AllShared.cxx | 26 +- src/IFGraph/IFGraph_AllShared.hxx | 36 +- src/IFGraph/IFGraph_Articulations.cxx | 82 -- src/IFGraph/IFGraph_Articulations.hxx | 94 -- src/IFGraph/IFGraph_Compare.cxx | 36 +- src/IFGraph/IFGraph_Compare.hxx | 43 +- src/IFGraph/IFGraph_ConnectedComponants.cxx | 5 +- src/IFGraph/IFGraph_ConnectedComponants.hxx | 29 +- src/IFGraph/IFGraph_Cumulate.cxx | 25 +- src/IFGraph/IFGraph_Cumulate.hxx | 37 +- src/IFGraph/IFGraph_ExternalSources.cxx | 20 +- src/IFGraph/IFGraph_ExternalSources.hxx | 45 +- src/IFGraph/IFGraph_SCRoots.cxx | 25 +- src/IFGraph/IFGraph_SCRoots.hxx | 36 +- src/IFGraph/IFGraph_StrongComponants.cxx | 10 +- src/IFGraph/IFGraph_StrongComponants.hxx | 32 +- src/IFGraph/IFGraph_SubPartsIterator.cxx | 51 +- src/IFGraph/IFGraph_SubPartsIterator.hxx | 35 +- src/IFSelect/FILES | 8 - src/IFSelect/IFSelect.cxx | 33 - src/IFSelect/IFSelect.hxx | 238 ---- src/IFSelect/IFSelect_Act.cxx | 65 -- src/IFSelect/IFSelect_ActFunc.hxx | 24 - src/IFSelect/IFSelect_FileModifier.gxx | 19 - src/IFSelect/IFSelect_GeneralModifier.hxx | 23 +- src/IFSelect/IFSelect_SelectCombine.cxx | 2 - src/IFSelect/IFSelect_SessionPilot.cxx | 78 -- src/IFSelect/IFSelect_SessionPilot.hxx | 49 +- src/IFSelect/IFSelect_ShareOutResult.cxx | 1 - src/IFSelect/IFSelect_WorkLibrary.cxx | 3 - src/IFSelect/IFSelect_WorkLibrary.hxx | 25 +- src/IFSelect/IFSelect_WorkSession.cxx | 87 -- src/IFSelect/IFSelect_WorkSession.hxx | 19 - src/IGESControl/FILES | 4 + src/IGESControl/IGESControl_ActorWrite.cxx | 47 +- src/IGESControl/IGESControl_ActorWrite.hxx | 4 +- src/IGESControl/IGESControl_Controller.cxx | 261 +---- src/IGESControl/IGESControl_Controller.hxx | 19 +- .../IGESControl_FloatFormat.cxx} | 37 +- .../IGESControl_FloatFormat.hxx} | 52 +- src/IGESControl/IGESControl_Reader.cxx | 5 +- .../IGESControl_WorkLibrary.cxx} | 51 +- .../IGESControl_WorkLibrary.hxx} | 48 +- src/IGESControl/IGESControl_Writer.cxx | 12 +- src/IGESData/IGESData.cxx | 78 +- src/IGESData/IGESData.hxx | 112 +- src/IGESData/IGESData_BasicEditor.cxx | 5 +- src/IGESSelect/FILES | 12 - src/IGESSelect/IGESSelect.cxx | 55 - src/IGESSelect/IGESSelect.hxx | 169 --- src/IGESSelect/IGESSelect_AddFileComment.cxx | 69 -- src/IGESSelect/IGESSelect_AddFileComment.hxx | 99 -- src/IGESSelect/IGESSelect_Dumper.cxx | 14 +- src/IGESSelect/IGESSelect_Dumper.hxx | 31 +- src/IGESSelect/IGESSelect_FileModifier.hxx | 75 -- src/IGESSelect/IGESSelect_FileModifier_0.cxx | 39 - src/IGESSolid/IGESSolid.cxx | 6 +- src/IGESSolid/IGESSolid.hxx | 137 +-- src/IGESToBRep/FILES | 1 - src/IGESToBRep/IGESToBRep_Actor.cxx | 2 +- src/IGESToBRep/IGESToBRep_Actor.hxx | 2 +- src/IGESToBRep/IGESToBRep_CurveAndSurface.hxx | 88 +- src/IGESToBRep/IGESToBRep_CurveAndSurface.lxx | 307 ----- src/IGESToBRep/IGESToBRep_Reader.cxx | 145 +-- src/IGESToBRep/IGESToBRep_Reader.hxx | 41 +- src/Interface/FILES | 1 - src/Interface/Interface_CheckTool.cxx | 288 +---- src/Interface/Interface_CheckTool.hxx | 78 +- src/Interface/Interface_EntityIterator.cxx | 99 +- src/Interface/Interface_EntityIterator.hxx | 40 +- src/Interface/Interface_FileReaderTool.cxx | 1 - src/Interface/Interface_Graph.cxx | 56 - src/Interface/Interface_Graph.hxx | 53 +- src/Interface/Interface_GraphContent.cxx | 28 +- src/Interface/Interface_GraphContent.hxx | 33 +- src/Interface/Interface_HGraph.cxx | 46 - src/Interface/Interface_HGraph.hxx | 57 +- src/Interface/Interface_InterfaceModel.cxx | 253 +--- src/Interface/Interface_InterfaceModel.hxx | 73 +- src/Interface/Interface_ShareTool.cxx | 144 +-- src/Interface/Interface_ShareTool.hxx | 95 +- src/Interface/Interface_Statics.hxx | 92 -- src/QABugs/QABugs_11.cxx | 4 +- src/QABugs/QABugs_16.cxx | 8 - src/RWHeaderSection/RWHeaderSection.cxx | 10 +- src/RWHeaderSection/RWHeaderSection.hxx | 44 +- src/RWStepAP214/RWStepAP214.cxx | 20 +- src/RWStepAP214/RWStepAP214.hxx | 88 +- src/RWStepShape/RWStepShape_RWEdgeCurve.cxx | 158 +-- src/RWStepShape/RWStepShape_RWFaceBound.cxx | 6 +- .../STEPCAFControl_Controller.cxx | 11 +- .../STEPCAFControl_Controller.hxx | 31 +- src/STEPControl/FILES | 4 + src/STEPControl/STEPControl_ActorRead.cxx | 3 +- src/STEPControl/STEPControl_ActorRead.hxx | 2 +- src/STEPControl/STEPControl_ActorWrite.cxx | 2 +- src/STEPControl/STEPControl_ActorWrite.hxx | 5 +- src/STEPControl/STEPControl_Controller.cxx | 191 +--- src/STEPControl/STEPControl_Controller.hxx | 36 +- .../STEPControl_FloatFormat.cxx} | 39 +- .../STEPControl_FloatFormat.hxx} | 52 +- .../STEPControl_WorkLibrary.cxx} | 27 +- .../STEPControl_WorkLibrary.hxx} | 41 +- src/STEPEdit/FILES | 2 - src/STEPEdit/STEPEdit.cxx | 78 -- src/STEPEdit/STEPEdit.hxx | 93 -- .../STEPSelections_SelectInstances.cxx | 2 +- src/StepAP214/StepAP214.cxx | 18 +- src/StepAP214/StepAP214.hxx | 122 +- src/StepAP214/StepAP214_Protocol.cxx | 13 +- src/StepAP214/StepAP214_Protocol.hxx | 24 +- src/StepData/FILES | 6 - src/StepData/StepData.cxx | 54 +- src/StepData/StepData.hxx | 123 +- src/StepData/StepData_DescrProtocol.cxx | 41 - src/StepData/StepData_DescrProtocol.hxx | 86 -- src/StepData/StepData_FileProtocol.cxx | 68 -- src/StepData/StepData_FileProtocol.hxx | 103 -- src/StepData/StepData_HeaderTool.cxx | 152 --- src/StepData/StepData_HeaderTool.hxx | 117 -- src/StepData/StepData_StepModel.cxx | 7 +- src/StepSelect/FILES | 10 - src/StepSelect/StepSelect_FileModifier.hxx | 75 -- src/StepSelect/StepSelect_FileModifier_0.cxx | 39 - src/StepSelect/StepSelect_ModelModifier.hxx | 87 -- src/StepSelect/StepSelect_ModelModifier_0.cxx | 47 - src/TKIGES/PACKAGES | 1 - src/TKSTEP/PACKAGES | 2 - src/TKXSBase/PACKAGES | 1 - src/TKXSDRAW/PACKAGES | 4 + src/Transfer/FILES | 14 +- src/Transfer/Transfer_Actor.hxx | 37 - .../Transfer_ActorOfFinderProcess.hxx | 4 +- .../Transfer_ActorOfTransientProcess.hxx | 4 +- src/Transfer/Transfer_DataInfo.hxx | 36 - src/Transfer/Transfer_FinderProcess.cxx | 2 +- src/Transfer/Transfer_FinderProcess.hxx | 8 +- src/Transfer/Transfer_HSequenceOfFinder.hxx | 27 - src/Transfer/Transfer_Iterator.cxx | 73 -- src/Transfer/Transfer_Iterator.hxx | 73 -- .../Transfer_IteratorOfProcessForFinder.hxx | 24 - ...Transfer_IteratorOfProcessForTransient.hxx | 24 - src/Transfer/Transfer_Process.cxx | 607 ++++++++++ src/Transfer/Transfer_Process.hxx | 525 +++++++++ src/Transfer/Transfer_ProcessForFinder.hxx | 26 - src/Transfer/Transfer_ProcessForTransient.hxx | 26 - src/Transfer/Transfer_ProcessGen.hxx | 1017 ----------------- ...Transfer_TransferMapOfProcessForFinder.hxx | 27 - ...nsfer_TransferMapOfProcessForTransient.hxx | 26 - src/Transfer/Transfer_TransientProcess.cxx | 2 +- src/Transfer/Transfer_TransientProcess.hxx | 20 +- src/TransferBRep/TransferBRep.cxx | 7 +- src/TransferBRep/TransferBRep.hxx | 4 +- src/XDEDRAW/XDEDRAW_Common.cxx | 25 +- src/XSAlgo/XSAlgo.cxx | 4 +- src/XSAlgo/XSAlgo.hxx | 36 +- src/XSControl/FILES | 8 - src/XSControl/XSControl.cxx | 20 - src/XSControl/XSControl.hxx | 37 - src/XSControl/XSControl_Controller.cxx | 4 +- src/XSControl/XSControl_Controller.hxx | 22 +- src/XSControl/XSControl_Reader.cxx | 2 - src/XSControl/XSControl_TransferReader.cxx | 37 +- src/XSControl/XSControl_TransferWriter.cxx | 1 - src/XSControl/XSControl_Utils.cxx | 603 ---------- src/XSControl/XSControl_Utils.hxx | 215 ---- src/XSControl/XSControl_Vars.hxx | 27 +- src/XSControl/XSControl_WorkSession.cxx | 46 - src/XSControl/XSControl_WorkSession.hxx | 38 +- src/XSDRAW/FILES | 8 + src/XSDRAW/XSDRAW.cxx | 63 +- src/XSDRAW/XSDRAW.hxx | 6 +- src/XSDRAW/XSDRAW_Activator.cxx | 39 + .../XSDRAW_Activator.hxx} | 61 +- .../XSDRAW_ControlFunctions.cxx} | 112 +- .../XSDRAW_ControlFunctions.hxx} | 14 +- src/XSDRAW/XSDRAW_Functions.cxx | 8 +- .../XSDRAW_SelectFunctions.cxx} | 284 ++--- .../XSDRAW_SelectFunctions.hxx} | 39 +- .../XSDRAW_ShapeFunctions.cxx} | 98 +- .../XSDRAW_ShapeFunctions.hxx} | 45 +- src/XSDRAW/XSDRAW_Vars.cxx | 36 +- src/XSDRAW/XSDRAW_Vars.hxx | 31 +- src/XSDRAWIGES/FILES | 2 + src/XSDRAWIGES/XSDRAWIGES.cxx | 264 ++++- .../XSDRAWIGES_Activator.cxx} | 29 +- .../XSDRAWIGES_Activator.hxx} | 47 +- src/XSDRAWSTEP/FILES | 2 + src/XSDRAWSTEP/XSDRAWSTEP.cxx | 208 +++- .../XSDRAWSTEP_Activator.cxx} | 18 +- .../XSDRAWSTEP_Activator.hxx} | 47 +- 195 files changed, 2847 insertions(+), 9387 deletions(-) delete mode 100644 src/IFGraph/IFGraph_Articulations.cxx delete mode 100644 src/IFGraph/IFGraph_Articulations.hxx delete mode 100644 src/IFSelect/IFSelect.cxx delete mode 100644 src/IFSelect/IFSelect.hxx delete mode 100644 src/IFSelect/IFSelect_Act.cxx delete mode 100644 src/IFSelect/IFSelect_ActFunc.hxx delete mode 100644 src/IFSelect/IFSelect_FileModifier.gxx rename src/{IGESSelect/IGESSelect_FloatFormat.cxx => IGESControl/IGESControl_FloatFormat.cxx} (74%) rename src/{IGESSelect/IGESSelect_FloatFormat.hxx => IGESControl/IGESControl_FloatFormat.hxx} (79%) rename src/{IGESSelect/IGESSelect_WorkLibrary.cxx => IGESControl/IGESControl_WorkLibrary.cxx} (78%) rename src/{IGESSelect/IGESSelect_WorkLibrary.hxx => IGESControl/IGESControl_WorkLibrary.hxx} (71%) delete mode 100644 src/IGESSelect/IGESSelect.cxx delete mode 100644 src/IGESSelect/IGESSelect.hxx delete mode 100644 src/IGESSelect/IGESSelect_AddFileComment.cxx delete mode 100644 src/IGESSelect/IGESSelect_AddFileComment.hxx delete mode 100644 src/IGESSelect/IGESSelect_FileModifier.hxx delete mode 100644 src/IGESSelect/IGESSelect_FileModifier_0.cxx delete mode 100644 src/IGESToBRep/IGESToBRep_CurveAndSurface.lxx delete mode 100644 src/Interface/Interface_Statics.hxx rename src/{StepSelect/StepSelect_FloatFormat.cxx => STEPControl/STEPControl_FloatFormat.cxx} (69%) rename src/{StepSelect/StepSelect_FloatFormat.hxx => STEPControl/STEPControl_FloatFormat.hxx} (79%) rename src/{StepSelect/StepSelect_WorkLibrary.cxx => STEPControl/STEPControl_WorkLibrary.cxx} (89%) rename src/{StepSelect/StepSelect_WorkLibrary.hxx => STEPControl/STEPControl_WorkLibrary.hxx} (84%) delete mode 100644 src/STEPEdit/STEPEdit.cxx delete mode 100644 src/STEPEdit/STEPEdit.hxx delete mode 100644 src/StepData/StepData_DescrProtocol.cxx delete mode 100644 src/StepData/StepData_DescrProtocol.hxx delete mode 100644 src/StepData/StepData_FileProtocol.cxx delete mode 100644 src/StepData/StepData_FileProtocol.hxx delete mode 100644 src/StepData/StepData_HeaderTool.cxx delete mode 100644 src/StepData/StepData_HeaderTool.hxx delete mode 100644 src/StepSelect/StepSelect_FileModifier.hxx delete mode 100644 src/StepSelect/StepSelect_FileModifier_0.cxx delete mode 100644 src/StepSelect/StepSelect_ModelModifier.hxx delete mode 100644 src/StepSelect/StepSelect_ModelModifier_0.cxx delete mode 100644 src/Transfer/Transfer_Actor.hxx delete mode 100644 src/Transfer/Transfer_DataInfo.hxx delete mode 100644 src/Transfer/Transfer_HSequenceOfFinder.hxx delete mode 100644 src/Transfer/Transfer_Iterator.cxx delete mode 100644 src/Transfer/Transfer_Iterator.hxx delete mode 100644 src/Transfer/Transfer_IteratorOfProcessForFinder.hxx delete mode 100644 src/Transfer/Transfer_IteratorOfProcessForTransient.hxx create mode 100644 src/Transfer/Transfer_Process.cxx create mode 100644 src/Transfer/Transfer_Process.hxx delete mode 100644 src/Transfer/Transfer_ProcessForFinder.hxx delete mode 100644 src/Transfer/Transfer_ProcessForTransient.hxx delete mode 100644 src/Transfer/Transfer_ProcessGen.hxx delete mode 100644 src/Transfer/Transfer_TransferMapOfProcessForFinder.hxx delete mode 100644 src/Transfer/Transfer_TransferMapOfProcessForTransient.hxx delete mode 100644 src/XSControl/XSControl.cxx delete mode 100644 src/XSControl/XSControl.hxx delete mode 100644 src/XSControl/XSControl_Utils.cxx delete mode 100644 src/XSControl/XSControl_Utils.hxx create mode 100644 src/XSDRAW/XSDRAW_Activator.cxx rename src/{IFSelect/IFSelect_Act.hxx => XSDRAW/XSDRAW_Activator.hxx} (70%) rename src/{XSControl/XSControl_Functions.cxx => XSDRAW/XSDRAW_ControlFunctions.cxx} (79%) rename src/{XSControl/XSControl_Functions.hxx => XSDRAW/XSDRAW_ControlFunctions.hxx} (74%) rename src/{IFSelect/IFSelect_Functions.cxx => XSDRAW/XSDRAW_SelectFunctions.cxx} (89%) rename src/{IFSelect/IFSelect_Functions.hxx => XSDRAW/XSDRAW_SelectFunctions.hxx} (90%) rename src/{XSControl/XSControl_FuncShape.cxx => XSDRAW/XSDRAW_ShapeFunctions.cxx} (87%) rename src/{XSControl/XSControl_FuncShape.hxx => XSDRAW/XSDRAW_ShapeFunctions.hxx} (85%) rename src/{IGESSelect/IGESSelect_Activator.cxx => XSDRAWIGES/XSDRAWIGES_Activator.cxx} (95%) rename src/{IGESSelect/IGESSelect_Activator.hxx => XSDRAWIGES/XSDRAWIGES_Activator.hxx} (67%) rename src/{StepSelect/StepSelect_Activator.cxx => XSDRAWSTEP/XSDRAWSTEP_Activator.cxx} (92%) rename src/{StepSelect/StepSelect_Activator.hxx => XSDRAWSTEP/XSDRAWSTEP_Activator.hxx} (67%) diff --git a/src/BRepToIGES/BRepToIGES_BREntity.cxx b/src/BRepToIGES/BRepToIGES_BREntity.cxx index 56d9d01317..fdd9d33f2e 100644 --- a/src/BRepToIGES/BRepToIGES_BREntity.cxx +++ b/src/BRepToIGES/BRepToIGES_BREntity.cxx @@ -42,7 +42,6 @@ #include #include #include -//szv_c1:#include #include char Name[100]; @@ -234,8 +233,6 @@ void BRepToIGES_BREntity::AddFail (const Handle(Standard_Transient)& start, const Standard_CString amess) { - /*szv_c1:Handle(Transfer_TransientMapper) Mapper = new Transfer_TransientMapper(start); - TheMap->AddFail(Mapper, amess);*/ TheMap->AddFail(start, amess); } @@ -249,8 +246,6 @@ void BRepToIGES_BREntity::AddWarning (const Handle(Standard_Transient)& start, const Standard_CString amess) { - /*szv_c1:Handle(Transfer_TransientMapper) Mapper = new Transfer_TransientMapper(start); - TheMap->AddWarning(Mapper, amess);*/ TheMap->AddWarning(start, amess); } @@ -312,8 +307,6 @@ void BRepToIGES_BREntity::SetShapeResult Standard_Boolean BRepToIGES_BREntity::HasShapeResult (const Handle(Standard_Transient)& start) const { - /*szv_c1:Handle(Transfer_TransientMapper) Mapper = new Transfer_TransientMapper(start); - DeclareAndCast(Transfer_SimpleBinderOfTransient, binder, TheMap->Find(Mapper));*/ DeclareAndCast(Transfer_SimpleBinderOfTransient, binder, TheMap->Find(start)); if (binder.IsNull()) return Standard_False; return binder->HasResult(); @@ -330,8 +323,6 @@ Handle(Standard_Transient) BRepToIGES_BREntity::GetShapeResult { Handle(Standard_Transient) res; - /*szv_c1:Handle(Transfer_TransientMapper) Mapper = new Transfer_TransientMapper(start); - DeclareAndCast(Transfer_SimpleBinderOfTransient, binder, TheMap->Find(Mapper));*/ DeclareAndCast(Transfer_SimpleBinderOfTransient, binder, TheMap->Find(start)); if (binder.IsNull()) return res; if (binder->HasResult()) @@ -350,8 +341,6 @@ void BRepToIGES_BREntity::SetShapeResult const Handle(Standard_Transient)& result) { Handle(Transfer_SimpleBinderOfTransient) binder = new Transfer_SimpleBinderOfTransient; - /*szv_c1:Handle(Transfer_TransientMapper) Mapper = new Transfer_TransientMapper(start); - TheMap->Bind(Mapper,binder);*/ TheMap->Bind(start,binder); binder->SetResult(result); } diff --git a/src/HeaderSection/HeaderSection.cxx b/src/HeaderSection/HeaderSection.cxx index c31429e501..4badc17f53 100644 --- a/src/HeaderSection/HeaderSection.cxx +++ b/src/HeaderSection/HeaderSection.cxx @@ -14,14 +14,13 @@ #include #include -#include -StaticHandle(HeaderSection_Protocol, proto); - -Handle(HeaderSection_Protocol) HeaderSection::Protocol() - - { - InitHandleVoid(HeaderSection_Protocol, proto); - return proto; - } +//szv_c1:StaticHandle(HeaderSection_Protocol, proto); +static Handle(HeaderSection_Protocol) proto; +const Handle(HeaderSection_Protocol) & HeaderSection::Protocol() +{ + //szv_c1:InitHandleVoid(HeaderSection_Protocol, proto) + if (proto.IsNull()) proto = new HeaderSection_Protocol; + return proto; +} diff --git a/src/HeaderSection/HeaderSection.hxx b/src/HeaderSection/HeaderSection.hxx index ac2cf18f05..20e20d6380 100644 --- a/src/HeaderSection/HeaderSection.hxx +++ b/src/HeaderSection/HeaderSection.hxx @@ -18,54 +18,15 @@ #define _HeaderSection_HeaderFile #include -#include #include - -class HeaderSection_Protocol; class HeaderSection_Protocol; -class HeaderSection_FileName; -class HeaderSection_FileDescription; -class HeaderSection_FileSchema; -class HeaderSection_HeaderRecognizer; - - class HeaderSection { -public: + public: - DEFINE_STANDARD_ALLOC - - //! creates a Protocol - Standard_EXPORT static Handle(HeaderSection_Protocol) Protocol(); - - - - -protected: - - - - - -private: - - - - -friend class HeaderSection_Protocol; -friend class HeaderSection_FileName; -friend class HeaderSection_FileDescription; -friend class HeaderSection_FileSchema; -friend class HeaderSection_HeaderRecognizer; - + Standard_EXPORT static const Handle(HeaderSection_Protocol) & Protocol(); }; - - - - - - #endif // _HeaderSection_HeaderFile diff --git a/src/IFGraph/FILES b/src/IFGraph/FILES index a205ace277..cbce9c7c54 100644 --- a/src/IFGraph/FILES +++ b/src/IFGraph/FILES @@ -2,8 +2,6 @@ IFGraph_AllConnected.cxx IFGraph_AllConnected.hxx IFGraph_AllShared.cxx IFGraph_AllShared.hxx -IFGraph_Articulations.cxx -IFGraph_Articulations.hxx IFGraph_Compare.cxx IFGraph_Compare.hxx IFGraph_ConnectedComponants.cxx diff --git a/src/IFGraph/IFGraph_AllShared.cxx b/src/IFGraph/IFGraph_AllShared.cxx index 02ea28c56d..fe92d6f139 100644 --- a/src/IFGraph/IFGraph_AllShared.cxx +++ b/src/IFGraph/IFGraph_AllShared.cxx @@ -14,34 +14,24 @@ #include #include -#include #include -#include -IFGraph_AllShared::IFGraph_AllShared (const Interface_Graph& agraph) - : thegraph (agraph) { } - - IFGraph_AllShared::IFGraph_AllShared - (const Interface_Graph& agraph, const Handle(Standard_Transient)& ent) - : thegraph (agraph) +IFGraph_AllShared::IFGraph_AllShared (const Interface_Graph& agraph, const Handle(Standard_Transient)& ent) +: thegraph (agraph) { if (!agraph.Model()->Contains(ent)) return; GetFromEntity(ent); } - void IFGraph_AllShared::GetFromEntity - (const Handle(Standard_Transient)& ent) - { thegraph.GetFromEntity(ent,Standard_True); } // le fait pour nous - - void IFGraph_AllShared::GetFromIter (const Interface_EntityIterator& iter) +void IFGraph_AllShared::GetFromIter (const Interface_EntityIterator& iter) { for (iter.Start(); iter.More(); iter.Next()) thegraph.GetFromEntity(iter.Value(),Standard_True); } - void IFGraph_AllShared::ResetData () - { Reset(); thegraph.Reset(); } - - void IFGraph_AllShared::Evaluate() - { Reset(); GetFromGraph(thegraph); } +void IFGraph_AllShared::Evaluate() +{ + Reset(); + GetFromGraph(thegraph); +} diff --git a/src/IFGraph/IFGraph_AllShared.hxx b/src/IFGraph/IFGraph_AllShared.hxx index 8c10dd07a8..e0fb6f777b 100644 --- a/src/IFGraph/IFGraph_AllShared.hxx +++ b/src/IFGraph/IFGraph_AllShared.hxx @@ -23,8 +23,6 @@ #include #include -class Interface_Graph; -class Standard_Transient; class Interface_EntityIterator; @@ -33,13 +31,14 @@ class Interface_EntityIterator; //! for instance) class IFGraph_AllShared : public Interface_GraphContent { -public: + public: DEFINE_STANDARD_ALLOC - //! creates an AllShared from a graph, empty ready to be filled - Standard_EXPORT IFGraph_AllShared(const Interface_Graph& agraph); + IFGraph_AllShared(const Interface_Graph& agraph) + : thegraph (agraph) + {} //! creates an AllShared which memrizes Entities shared by a given //! one, at any level, including itself @@ -47,40 +46,21 @@ public: //! adds an entity and its shared ones to the list (allows to //! cumulate all Entities shared by some ones) - Standard_EXPORT void GetFromEntity (const Handle(Standard_Transient)& ent); + void GetFromEntity (const Handle(Standard_Transient)& ent) { thegraph.GetFromEntity(ent,Standard_True); } //! Adds Entities from an EntityIterator and all their shared //! ones at any level Standard_EXPORT void GetFromIter (const Interface_EntityIterator& iter); //! Allows to restart on a new data set - Standard_EXPORT void ResetData(); - + void ResetData() { Reset(); thegraph.Reset(); } + //! does the specific evaluation (shared entities atall levels) Standard_EXPORT virtual void Evaluate() Standard_OVERRIDE; - - - -protected: - - - - - -private: - - + private: Interface_Graph thegraph; - - }; - - - - - - #endif // _IFGraph_AllShared_HeaderFile diff --git a/src/IFGraph/IFGraph_Articulations.cxx b/src/IFGraph/IFGraph_Articulations.cxx deleted file mode 100644 index f185c25b0f..0000000000 --- a/src/IFGraph/IFGraph_Articulations.cxx +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include -#include -#include - -// Points d'Articulation d'un Graphe : ce sont les "passages obliges" du graphe -// Algorithme tire du Sedgewick, p 392 -IFGraph_Articulations::IFGraph_Articulations - (const Interface_Graph& agraph, const Standard_Boolean whole) - : thegraph (agraph) - { if (whole) thegraph.GetFromModel(); } - - - void IFGraph_Articulations::GetFromEntity - (const Handle(Standard_Transient)& ent) - { thegraph.GetFromEntity(ent,Standard_True); } - - void IFGraph_Articulations::GetFromIter(const Interface_EntityIterator& iter) - { thegraph.GetFromIter(iter,0); } - - - void IFGraph_Articulations::ResetData () -{ Reset(); thegraph.Reset(); thelist = new TColStd_HSequenceOfInteger(); } - - void IFGraph_Articulations::Evaluate () -{ -// Algorithme, cf Sedgewick "Algorithms", p 392 - thelist = new TColStd_HSequenceOfInteger(); -// Utilisation de Visit - Standard_Integer nb = thegraph.Size(); - for (Standard_Integer i = 1; i <= nb; i ++) { - thenow = 0; - if (thegraph.IsPresent(i)) Visit(i); - } -// Resultat dans thelist - Reset(); - Standard_Integer nbres = thelist->Length(); - for (Standard_Integer ires = 1; ires <= nbres; ires ++) { - Standard_Integer num = thelist->Value(ires); - GetOneItem(thegraph.Model()->Value(num)); - } -} - - Standard_Integer IFGraph_Articulations::Visit (const Standard_Integer num) -{ - thenow ++; - thegraph.SetStatus(num,thenow); - Standard_Integer min = thenow; - - for (Interface_EntityIterator iter = thegraph.Shareds(thegraph.Entity(num)); - iter.More(); iter.Next()) { - Handle(Standard_Transient) ent = iter.Value(); - Standard_Integer nument = thegraph.EntityNumber(ent); - if (!thegraph.IsPresent(num)) { - thegraph.GetFromEntity(ent,Standard_False); - nument = thegraph.EntityNumber(ent); - } - Standard_Integer statent = thegraph.Status(nument); // pas reevalue - if (statent == 0) { - Standard_Integer mm = Visit(nument); - if (mm < min) min = mm; - if (mm > thegraph.Status(num)) thelist->Append(num); // ON EN A UN : num - } - else if (statent < min) min = statent; - } - return min; -} diff --git a/src/IFGraph/IFGraph_Articulations.hxx b/src/IFGraph/IFGraph_Articulations.hxx deleted file mode 100644 index c07b9f59f2..0000000000 --- a/src/IFGraph/IFGraph_Articulations.hxx +++ /dev/null @@ -1,94 +0,0 @@ -// Created on: 1992-09-23 -// Created by: Christian CAILLET -// Copyright (c) 1992-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IFGraph_Articulations_HeaderFile -#define _IFGraph_Articulations_HeaderFile - -#include -#include -#include - -#include -#include -#include -#include -#include -class Interface_Graph; -class Standard_Transient; -class Interface_EntityIterator; - - -//! this class gives entities which are Articulation points -//! in a whole Model or in a sub-part -//! An Articulation Point divides the graph in two (or more) -//! disconnected sub-graphs -//! Identifying Articulation Points allows improving -//! efficiency of spliting a set of Entities into sub-sets -class IFGraph_Articulations : public Interface_GraphContent -{ -public: - - DEFINE_STANDARD_ALLOC - - - //! creates Articulations to evaluate a Graph - //! whole True : works on the whole Model - //! whole False : remains empty, ready to work on a sub-part - Standard_EXPORT IFGraph_Articulations(const Interface_Graph& agraph, const Standard_Boolean whole); - - //! adds an entity and its shared ones to the list - Standard_EXPORT void GetFromEntity (const Handle(Standard_Transient)& ent); - - //! adds a list of entities (as an iterator) - Standard_EXPORT void GetFromIter (const Interface_EntityIterator& iter); - - //! Allows to restart on a new data set - Standard_EXPORT void ResetData(); - - //! Evaluates the list of Articulation points - Standard_EXPORT virtual void Evaluate() Standard_OVERRIDE; - - - - -protected: - - - - - -private: - - - //! basic routine of computation - //! (see book Sedgewick "Algorithms", p 392) - Standard_EXPORT Standard_Integer Visit (const Standard_Integer num); - - - Interface_Graph thegraph; - Standard_Integer thenow; - Handle(TColStd_HSequenceOfInteger) thelist; - - -}; - - - - - - - -#endif // _IFGraph_Articulations_HeaderFile diff --git a/src/IFGraph/IFGraph_Compare.cxx b/src/IFGraph/IFGraph_Compare.cxx index b23454959d..aeae4623cd 100644 --- a/src/IFGraph/IFGraph_Compare.cxx +++ b/src/IFGraph/IFGraph_Compare.cxx @@ -15,64 +15,40 @@ #include #include #include -#include -#include -// Comparateur de deux sous-ensembles d un Modele -// Au premier sous-ensemble, est attribue le Status 1 -// Au deuxieme sous-ensemble, est attribue le Status 2 -// La partie commune se voit attribuer le Status 3 -IFGraph_Compare::IFGraph_Compare (const Interface_Graph& agraph) - : thegraph (agraph) { } - - void IFGraph_Compare::GetFromEntity - (const Handle(Standard_Transient)& ent, const Standard_Boolean first) +void IFGraph_Compare::GetFromEntity (const Handle(Standard_Transient)& ent, const Standard_Boolean first) { IFGraph_AllShared iter(thegraph.Model(),ent); GetFromIter(iter,first); } - void IFGraph_Compare::GetFromIter - (const Interface_EntityIterator& iter, const Standard_Boolean first) +void IFGraph_Compare::GetFromIter (const Interface_EntityIterator& iter, const Standard_Boolean first) { Standard_Integer stat = 2; if (first) stat = 1; thegraph.GetFromIter(iter,stat,3,Standard_False); } - - void IFGraph_Compare::Merge () +void IFGraph_Compare::Merge () { thegraph.ChangeStatus (2,1); thegraph.ChangeStatus (3,1); } - void IFGraph_Compare::RemoveSecond () +void IFGraph_Compare::RemoveSecond () { thegraph.ChangeStatus (3,1); thegraph.RemoveStatus (2); } - void IFGraph_Compare::KeepCommon () +void IFGraph_Compare::KeepCommon () { thegraph.RemoveStatus (1); thegraph.RemoveStatus (2); thegraph.ChangeStatus (3,1); } - void IFGraph_Compare::ResetData () - { Reset(); thegraph.Reset(); } - - void IFGraph_Compare::Evaluate () +void IFGraph_Compare::Evaluate () { Reset(); GetFromGraph(thegraph); // Evaluation deja faite par le graphe } - - Interface_EntityIterator IFGraph_Compare::Common () const - { return Interface_GraphContent(thegraph,3); } - - Interface_EntityIterator IFGraph_Compare::FirstOnly () const - { return Interface_GraphContent(thegraph,1); } - - Interface_EntityIterator IFGraph_Compare::SecondOnly () const - { return Interface_GraphContent(thegraph,2); } diff --git a/src/IFGraph/IFGraph_Compare.hxx b/src/IFGraph/IFGraph_Compare.hxx index 3cfd311a80..54d18d8fc6 100644 --- a/src/IFGraph/IFGraph_Compare.hxx +++ b/src/IFGraph/IFGraph_Compare.hxx @@ -23,9 +23,6 @@ #include #include -#include -class Interface_Graph; -class Standard_Transient; class Interface_EntityIterator; @@ -36,13 +33,14 @@ class Interface_EntityIterator; //! Basic Iteration gives Cumulation (union) class IFGraph_Compare : public Interface_GraphContent { -public: + public: DEFINE_STANDARD_ALLOC - //! creates empty Compare, ready to work - Standard_EXPORT IFGraph_Compare(const Interface_Graph& agraph); + IFGraph_Compare(const Interface_Graph& agraph) + : thegraph (agraph) + {} //! adds an entity and its shared ones to the list : //! first True means adds to the first sub-list, else to the 2nd @@ -66,42 +64,23 @@ public: Standard_EXPORT void KeepCommon(); //! Allows to restart on a new data set - Standard_EXPORT void ResetData(); + void ResetData() { Reset(); thegraph.Reset(); } //! Recomputes result of comparing to sub-parts Standard_EXPORT virtual void Evaluate() Standard_OVERRIDE; //! returns entities common to the both parts - Standard_EXPORT Interface_EntityIterator Common() const; - - //! returns entities which are exclusively in the first list - Standard_EXPORT Interface_EntityIterator FirstOnly() const; - - //! returns entities which are exclusively in the second part - Standard_EXPORT Interface_EntityIterator SecondOnly() const; - - - - -protected: - - - + Interface_EntityIterator Common() const { return Interface_GraphContent(thegraph,3); } + //! returns entities which are exclusively in the first list + Interface_EntityIterator FirstOnly() const { return Interface_GraphContent(thegraph,1); } -private: - + //! returns entities which are exclusively in the second part + Interface_EntityIterator SecondOnly() const { return Interface_GraphContent(thegraph,2); } + private: Interface_Graph thegraph; - - }; - - - - - - #endif // _IFGraph_Compare_HeaderFile diff --git a/src/IFGraph/IFGraph_ConnectedComponants.cxx b/src/IFGraph/IFGraph_ConnectedComponants.cxx index b18925ab63..d21c64783e 100644 --- a/src/IFGraph/IFGraph_ConnectedComponants.cxx +++ b/src/IFGraph/IFGraph_ConnectedComponants.cxx @@ -23,11 +23,8 @@ // On recommence jusqu'a ce qu'il n'y ait plus de Vertex libre // Honnetement, si ca ne marche pas, cf classe ConnectedVerticesIterator // de GraphTools qui fait en principe la meme chose -IFGraph_ConnectedComponants::IFGraph_ConnectedComponants - (const Interface_Graph& agraph, const Standard_Boolean whole) - : IFGraph_SubPartsIterator (agraph, whole) { } - void IFGraph_ConnectedComponants::Evaluate() +void IFGraph_ConnectedComponants::Evaluate() { // On part des "loaded" // Pour chacun : s il est note dans le graphe, on passe diff --git a/src/IFGraph/IFGraph_ConnectedComponants.hxx b/src/IFGraph/IFGraph_ConnectedComponants.hxx index cb88726b1a..c592620663 100644 --- a/src/IFGraph/IFGraph_ConnectedComponants.hxx +++ b/src/IFGraph/IFGraph_ConnectedComponants.hxx @@ -22,10 +22,8 @@ #include #include -#include class Interface_Graph; - //! determines Connected Componants in a Graph. They define //! disjoined sets of Entities class IFGraph_ConnectedComponants : public IFGraph_SubPartsIterator @@ -33,37 +31,16 @@ class IFGraph_ConnectedComponants : public IFGraph_SubPartsIterator public: DEFINE_STANDARD_ALLOC - //! creates with a Graph, and will analyse : //! whole True : all the contents of the Model //! whole False : sub-parts which will be given later - Standard_EXPORT IFGraph_ConnectedComponants(const Interface_Graph& agraph, const Standard_Boolean whole); + IFGraph_ConnectedComponants(const Interface_Graph& agraph, const Standard_Boolean whole) + : IFGraph_SubPartsIterator (agraph, whole) + {} //! does the computation Standard_EXPORT virtual void Evaluate() Standard_OVERRIDE; - - - - -protected: - - - - - -private: - - - - - }; - - - - - - #endif // _IFGraph_ConnectedComponants_HeaderFile diff --git a/src/IFGraph/IFGraph_Cumulate.cxx b/src/IFGraph/IFGraph_Cumulate.cxx index 453ec33753..6f2e6d9455 100644 --- a/src/IFGraph/IFGraph_Cumulate.cxx +++ b/src/IFGraph/IFGraph_Cumulate.cxx @@ -26,31 +26,25 @@ // Les status demarrent a 2, ainsi a l ajout d une entite, on distingue bien // entre les entites nouvelles, liees a cet appel (statut temporaire 1) et les // autres (statut superieur ou egal a 2) -IFGraph_Cumulate::IFGraph_Cumulate (const Interface_Graph& agraph) - : thegraph (agraph) { } - void IFGraph_Cumulate::GetFromEntity - (const Handle(Standard_Transient)& ent) +void IFGraph_Cumulate::GetFromEntity (const Handle(Standard_Transient)& ent) { IFGraph_AllShared iter(thegraph.Model(),ent); GetFromIter (iter); } - void IFGraph_Cumulate::ResetData () - { Reset(); thegraph.Reset(); } - - void IFGraph_Cumulate::GetFromIter (const Interface_EntityIterator& iter) +void IFGraph_Cumulate::GetFromIter (const Interface_EntityIterator& iter) { thegraph.GetFromIter(iter,1,1,Standard_True); thegraph.ChangeStatus (1,2); // une fois le calcul fait } - void IFGraph_Cumulate::Evaluate () +void IFGraph_Cumulate::Evaluate () { Reset(); GetFromGraph(thegraph); // evaluation deja faite dans le graphe } - Interface_EntityIterator IFGraph_Cumulate::Overlapped () const +Interface_EntityIterator IFGraph_Cumulate::Overlapped () const { Interface_EntityIterator iter; Standard_Integer nb = thegraph.Size(); @@ -61,7 +55,7 @@ IFGraph_Cumulate::IFGraph_Cumulate (const Interface_Graph& agraph) return iter; } - Interface_EntityIterator IFGraph_Cumulate::Forgotten () const +Interface_EntityIterator IFGraph_Cumulate::Forgotten () const { Interface_EntityIterator iter; Standard_Integer nb = thegraph.Size(); @@ -72,8 +66,7 @@ IFGraph_Cumulate::IFGraph_Cumulate (const Interface_Graph& agraph) return iter; } - Interface_EntityIterator IFGraph_Cumulate::PerCount - (const Standard_Integer count) const +Interface_EntityIterator IFGraph_Cumulate::PerCount (const Standard_Integer count) const { Interface_EntityIterator iter; Standard_Integer nb = thegraph.Size(); @@ -84,9 +77,7 @@ IFGraph_Cumulate::IFGraph_Cumulate (const Interface_Graph& agraph) return iter; } - - Standard_Integer IFGraph_Cumulate::NbTimes - (const Handle(Standard_Transient)& ent) const +Standard_Integer IFGraph_Cumulate::NbTimes (const Handle(Standard_Transient)& ent) const { Standard_Integer num = thegraph.EntityNumber(ent); if (num == 0) return 0; @@ -94,7 +85,7 @@ IFGraph_Cumulate::IFGraph_Cumulate (const Interface_Graph& agraph) return stat-1; } - Standard_Integer IFGraph_Cumulate::HighestNbTimes () const +Standard_Integer IFGraph_Cumulate::HighestNbTimes () const { Standard_Integer max = 0; Standard_Integer nb = thegraph.Size(); diff --git a/src/IFGraph/IFGraph_Cumulate.hxx b/src/IFGraph/IFGraph_Cumulate.hxx index 1a78885ac5..96ca31536a 100644 --- a/src/IFGraph/IFGraph_Cumulate.hxx +++ b/src/IFGraph/IFGraph_Cumulate.hxx @@ -23,9 +23,6 @@ #include #include -#include -class Interface_Graph; -class Standard_Transient; class Interface_EntityIterator; @@ -35,14 +32,15 @@ class Interface_EntityIterator; //! Basic Iteration gives entities which are part of Cumulation class IFGraph_Cumulate : public Interface_GraphContent { -public: + public: DEFINE_STANDARD_ALLOC - //! creates empty Cumulate, ready to work - Standard_EXPORT IFGraph_Cumulate(const Interface_Graph& agraph); - + IFGraph_Cumulate(const Interface_Graph& agraph) + : thegraph (agraph) + {} + //! adds an entity and its shared ones to the list Standard_EXPORT void GetFromEntity (const Handle(Standard_Transient)& ent); @@ -51,8 +49,8 @@ public: Standard_EXPORT void GetFromIter (const Interface_EntityIterator& iter); //! Allows to restart on a new data set - Standard_EXPORT void ResetData(); - + void ResetData() { Reset(); thegraph.Reset(); } + //! Evaluates the result of cumulation Standard_EXPORT virtual void Evaluate() Standard_OVERRIDE; @@ -74,28 +72,9 @@ public: //! (0 means empty, 1 means no overlap) Standard_EXPORT Standard_Integer HighestNbTimes() const; - - - -protected: - - - - - -private: - - + private: Interface_Graph thegraph; - - }; - - - - - - #endif // _IFGraph_Cumulate_HeaderFile diff --git a/src/IFGraph/IFGraph_ExternalSources.cxx b/src/IFGraph/IFGraph_ExternalSources.cxx index 51be0657c0..62c714a9e0 100644 --- a/src/IFGraph/IFGraph_ExternalSources.cxx +++ b/src/IFGraph/IFGraph_ExternalSources.cxx @@ -23,24 +23,8 @@ // Les status : // - Les entites de depart sont au Status 0 // - Les entites Sharing NOUVELLES (ExternalSources) sont au Status 1 -IFGraph_ExternalSources::IFGraph_ExternalSources - (const Interface_Graph& agraph) - : thegraph (agraph) { } - - void IFGraph_ExternalSources::GetFromEntity - (const Handle(Standard_Transient)& ent) - { thegraph.GetFromEntity(ent,Standard_True); } - - void IFGraph_ExternalSources::GetFromIter - (const Interface_EntityIterator& iter) - { thegraph.GetFromIter(iter,0); } - - void IFGraph_ExternalSources::ResetData () - { Reset(); thegraph.Reset(); } - - - void IFGraph_ExternalSources::Evaluate () +void IFGraph_ExternalSources::Evaluate () { Reset(); thegraph.RemoveStatus(1); @@ -52,7 +36,7 @@ IFGraph_ExternalSources::IFGraph_ExternalSources GetFromGraph(thegraph,1); } - Standard_Boolean IFGraph_ExternalSources::IsEmpty () +Standard_Boolean IFGraph_ExternalSources::IsEmpty () { Evaluate(); Standard_Integer nb = thegraph.Size(); diff --git a/src/IFGraph/IFGraph_ExternalSources.hxx b/src/IFGraph/IFGraph_ExternalSources.hxx index 2afc5b5809..43a92e3f38 100644 --- a/src/IFGraph/IFGraph_ExternalSources.hxx +++ b/src/IFGraph/IFGraph_ExternalSources.hxx @@ -23,9 +23,6 @@ #include #include -#include -class Interface_Graph; -class Standard_Transient; class Interface_EntityIterator; @@ -33,23 +30,26 @@ class Interface_EntityIterator; //! a sub-part, but are not contained by this sub-part class IFGraph_ExternalSources : public Interface_GraphContent { -public: + public: DEFINE_STANDARD_ALLOC - //! creates empty ExternalSources, ready to work - Standard_EXPORT IFGraph_ExternalSources(const Interface_Graph& agraph); + IFGraph_ExternalSources(const Interface_Graph& agraph) + : thegraph (agraph) + {} //! adds an entity and its shared ones to the list - Standard_EXPORT void GetFromEntity (const Handle(Standard_Transient)& ent); - + void GetFromEntity (const Handle(Standard_Transient)& ent) + { thegraph.GetFromEntity(ent,Standard_True); } + //! adds a list of entities (as an iterator) with shared ones - Standard_EXPORT void GetFromIter (const Interface_EntityIterator& iter); - + void GetFromIter (const Interface_EntityIterator& iter) + { thegraph.GetFromIter(iter,0); } + //! Allows to restart on a new data set - Standard_EXPORT void ResetData(); - + void ResetData() { Reset(); thegraph.Reset(); } + //! Evaluates external sources of a set of entities Standard_EXPORT virtual void Evaluate() Standard_OVERRIDE; @@ -58,28 +58,9 @@ public: //! (performs an Evaluation as necessary) Standard_EXPORT Standard_Boolean IsEmpty(); - - - -protected: - - - - - -private: - - + private: Interface_Graph thegraph; - - }; - - - - - - #endif // _IFGraph_ExternalSources_HeaderFile diff --git a/src/IFGraph/IFGraph_SCRoots.cxx b/src/IFGraph/IFGraph_SCRoots.cxx index 6aab10ce10..46787f7b79 100644 --- a/src/IFGraph/IFGraph_SCRoots.cxx +++ b/src/IFGraph/IFGraph_SCRoots.cxx @@ -14,28 +14,17 @@ #include #include -#include #include -#include - -//#include -IFGraph_SCRoots::IFGraph_SCRoots - (const Interface_Graph& agraph, const Standard_Boolean whole) - : IFGraph_StrongComponants (agraph,whole) { } - - IFGraph_SCRoots::IFGraph_SCRoots (IFGraph_StrongComponants& subparts) - : IFGraph_StrongComponants (subparts) { } // StrongComponants racines d un ensemble donne // On ne tient pas compte du reste eventuel (c est un autre probleme) // On part du fait que StrongComponants donne les Composants dans l ordre de // dependance, le premier ne dependant de rien (les autres, on ne sait pas ...) - void IFGraph_SCRoots::Evaluate () +void IFGraph_SCRoots::Evaluate () { IFGraph_StrongComponants complist (Model(),Standard_False); complist.GetFromIter(Loaded()); -// Interface_Graph G(Model()); Interface_Graph G(thegraph); #ifdef OCCT_DEBUG cout<<" SCRoots:"< #include -#include class Interface_Graph; -class IFGraph_StrongComponants; //! determines strong componants in a graph which are Roots @@ -38,35 +36,17 @@ public: //! creates with a Graph, and will analyse : //! whole True : all the contents of the Model //! whole False : sub-parts which will be given later - Standard_EXPORT IFGraph_SCRoots(const Interface_Graph& agraph, const Standard_Boolean whole); - + IFGraph_SCRoots(const Interface_Graph& agraph, const Standard_Boolean whole) + : IFGraph_StrongComponants (agraph,whole) + {} + //! creates from a StrongComponants which was already computed - Standard_EXPORT IFGraph_SCRoots(IFGraph_StrongComponants& subparts); - + IFGraph_SCRoots(IFGraph_StrongComponants& subparts) + : IFGraph_StrongComponants (subparts) + {} + //! does the computation Standard_EXPORT virtual void Evaluate() Standard_OVERRIDE; - - - - -protected: - - - - - -private: - - - - - }; - - - - - - #endif // _IFGraph_SCRoots_HeaderFile diff --git a/src/IFGraph/IFGraph_StrongComponants.cxx b/src/IFGraph/IFGraph_StrongComponants.cxx index 3eeb8b7cf1..c81ca2a3e1 100644 --- a/src/IFGraph/IFGraph_StrongComponants.cxx +++ b/src/IFGraph/IFGraph_StrongComponants.cxx @@ -16,15 +16,9 @@ #include #include -//#include -IFGraph_StrongComponants::IFGraph_StrongComponants - (const Interface_Graph& agraph, const Standard_Boolean whole) - : IFGraph_SubPartsIterator (agraph, whole) { } - - void IFGraph_StrongComponants::Evaluate () +void IFGraph_StrongComponants::Evaluate () { - Interface_GraphContent iter = Loaded(); - Interface_Graph G(thegraph); G.GetFromIter(iter,0); + Interface_Graph G(thegraph); G.GetFromIter(Loaded(),0); Standard_Integer nb = G.Size(); for (Standard_Integer i = 1; i <= nb; i ++) { if (!G.IsPresent(i)) continue; diff --git a/src/IFGraph/IFGraph_StrongComponants.hxx b/src/IFGraph/IFGraph_StrongComponants.hxx index 94aebcb859..51e43c3f3a 100644 --- a/src/IFGraph/IFGraph_StrongComponants.hxx +++ b/src/IFGraph/IFGraph_StrongComponants.hxx @@ -22,7 +22,6 @@ #include #include -#include class Interface_Graph; @@ -30,40 +29,19 @@ class Interface_Graph; //! isolated entities (single componants) or loops class IFGraph_StrongComponants : public IFGraph_SubPartsIterator { -public: + public: DEFINE_STANDARD_ALLOC - //! creates with a Graph, and will analyse : //! whole True : all the contents of the Model //! whole False : sub-parts which will be given later - Standard_EXPORT IFGraph_StrongComponants(const Interface_Graph& agraph, const Standard_Boolean whole); - + IFGraph_StrongComponants(const Interface_Graph& agraph, const Standard_Boolean whole) + : IFGraph_SubPartsIterator (agraph, whole) + {} + //! does the computation Standard_EXPORT virtual void Evaluate() Standard_OVERRIDE; - - - - -protected: - - - - - -private: - - - - - }; - - - - - - #endif // _IFGraph_StrongComponants_HeaderFile diff --git a/src/IFGraph/IFGraph_SubPartsIterator.cxx b/src/IFGraph/IFGraph_SubPartsIterator.cxx index cf430b620c..6c37337637 100644 --- a/src/IFGraph/IFGraph_SubPartsIterator.cxx +++ b/src/IFGraph/IFGraph_SubPartsIterator.cxx @@ -26,9 +26,8 @@ // SubPartsIterator permet de regrouper les entites en plusieurs sous-parties // A chaque sous-partie est attache un Status : la 1re a 1, la 2e a 2, etc... // (consequence, les sous-parties sont necessairement disjointes) -IFGraph_SubPartsIterator::IFGraph_SubPartsIterator - (const Interface_Graph& agraph, const Standard_Boolean whole) - : thegraph (agraph) +IFGraph_SubPartsIterator::IFGraph_SubPartsIterator (const Interface_Graph& agraph, const Standard_Boolean whole) +: thegraph (agraph) { if (whole) thegraph.GetFromModel(); theparts = new TColStd_HSequenceOfInteger(); @@ -37,9 +36,8 @@ IFGraph_SubPartsIterator::IFGraph_SubPartsIterator thecurr = 0; } - IFGraph_SubPartsIterator::IFGraph_SubPartsIterator - (IFGraph_SubPartsIterator& other) - : thegraph (other.Graph()) +IFGraph_SubPartsIterator::IFGraph_SubPartsIterator (IFGraph_SubPartsIterator& other) +: thegraph (other.thegraph) { Standard_Integer nb = thegraph.Size(); theparts = new TColStd_HSequenceOfInteger(); @@ -57,8 +55,7 @@ IFGraph_SubPartsIterator::IFGraph_SubPartsIterator thecurr = 1; } - void IFGraph_SubPartsIterator::GetParts - (IFGraph_SubPartsIterator& other) +void IFGraph_SubPartsIterator::GetParts (IFGraph_SubPartsIterator& other) { if (Model() != other.Model()) Interface_InterfaceError::Raise ("SubPartsIterator : GetParts"); @@ -77,48 +74,44 @@ IFGraph_SubPartsIterator::IFGraph_SubPartsIterator } } - const Interface_Graph& IFGraph_SubPartsIterator::Graph () const - { return thegraph; } - // .... Gestion Interne (remplissage, etc...) .... // - Handle(Interface_InterfaceModel) IFGraph_SubPartsIterator::Model() const - { return thegraph.Model(); } +Handle(Interface_InterfaceModel) IFGraph_SubPartsIterator::Model() const +{ return thegraph.Model(); } - void IFGraph_SubPartsIterator::AddPart () +void IFGraph_SubPartsIterator::AddPart () { theparts->Append( Standard_Integer(0) ); thepart = theparts->Length(); } - Standard_Integer IFGraph_SubPartsIterator::NbParts () const - { return theparts->Length(); } +Standard_Integer IFGraph_SubPartsIterator::NbParts () const +{ return theparts->Length(); } - Standard_Integer IFGraph_SubPartsIterator::PartNum () const - { return thepart; } +Standard_Integer IFGraph_SubPartsIterator::PartNum () const +{ return thepart; } - void IFGraph_SubPartsIterator::SetLoad () - { thepart = 0; } +void IFGraph_SubPartsIterator::SetLoad () +{ thepart = 0; } - void IFGraph_SubPartsIterator::SetPartNum (const Standard_Integer num) +void IFGraph_SubPartsIterator::SetPartNum (const Standard_Integer num) { if (num <= 0 || num > theparts->Length()) Standard_OutOfRange::Raise ("IFGraph_SubPartsIterator : SetPartNum"); thepart = num; } - void IFGraph_SubPartsIterator::GetFromEntity - (const Handle(Standard_Transient)& ent, const Standard_Boolean shared) +void IFGraph_SubPartsIterator::GetFromEntity (const Handle(Standard_Transient)& ent, const Standard_Boolean shared) { thegraph.GetFromEntity(ent,shared, thepart,thepart,Standard_False); } - void IFGraph_SubPartsIterator::GetFromIter (const Interface_EntityIterator& iter) +void IFGraph_SubPartsIterator::GetFromIter (const Interface_EntityIterator& iter) { thegraph.GetFromIter(iter, thepart,thepart, Standard_False); } - void IFGraph_SubPartsIterator::Reset () +void IFGraph_SubPartsIterator::Reset () { thegraph.Reset(); theparts->Clear(); @@ -251,11 +244,3 @@ IFGraph_SubPartsIterator::IFGraph_SubPartsIterator } return iter; } - -//======================================================================= -//function : ~IFGraph_SubPartsIterator -//purpose : -//======================================================================= - -IFGraph_SubPartsIterator::~IFGraph_SubPartsIterator() -{} diff --git a/src/IFGraph/IFGraph_SubPartsIterator.hxx b/src/IFGraph/IFGraph_SubPartsIterator.hxx index cc4f243045..36e27dfacf 100644 --- a/src/IFGraph/IFGraph_SubPartsIterator.hxx +++ b/src/IFGraph/IFGraph_SubPartsIterator.hxx @@ -23,14 +23,8 @@ #include #include -#include -#include -class Standard_OutOfRange; -class Standard_NoSuchObject; -class Interface_InterfaceError; -class Interface_Graph; +class TColStd_HSequenceOfTransient; class Interface_InterfaceModel; -class Standard_Transient; class Interface_EntityIterator; class Interface_GraphContent; @@ -82,8 +76,8 @@ public: //! (0 at load time) Standard_EXPORT Standard_Integer PartNum() const; - //! Sets SubPartIterator to get Entities (by GetFromEntity & - //! GetFromIter) into load status, to be analysed later + //! Sets SubPartIterator to get Entities (by GetFromEntity & GetFromIter) + //! into load status, to be analysed later Standard_EXPORT void SetLoad(); //! Sets numero of receiving part to a new value @@ -150,35 +144,18 @@ public: //! Error : same as above (end of iteration) Standard_EXPORT Interface_EntityIterator Entities() const; - Standard_EXPORT virtual ~IFGraph_SubPartsIterator(); - -protected: - + Standard_EXPORT virtual ~IFGraph_SubPartsIterator() {} + protected: Interface_Graph thegraph; - -private: - - - //! Returns the Graph used by . Used to create another - //! SubPartsIterator from - Standard_EXPORT const Interface_Graph& Graph() const; - + private: Handle(TColStd_HSequenceOfInteger) theparts; Handle(TColStd_HSequenceOfInteger) thefirsts; Standard_Integer thepart; Standard_Integer thecurr; - - }; - - - - - - #endif // _IFGraph_SubPartsIterator_HeaderFile diff --git a/src/IFSelect/FILES b/src/IFSelect/FILES index 5cbd79df59..9007358569 100755 --- a/src/IFSelect/FILES +++ b/src/IFSelect/FILES @@ -1,8 +1,3 @@ -IFSelect.cxx -IFSelect.hxx -IFSelect_Act.cxx -IFSelect_Act.hxx -IFSelect_ActFunc.hxx IFSelect_Activator.cxx IFSelect_Activator.hxx IFSelect_AppliedModifiers.cxx @@ -32,9 +27,6 @@ IFSelect_EditForm.hxx IFSelect_Editor.cxx IFSelect_Editor.hxx IFSelect_EditValue.hxx -IFSelect_FileModifier.gxx -IFSelect_Functions.cxx -IFSelect_Functions.hxx IFSelect_GeneralModifier.cxx IFSelect_GeneralModifier.hxx IFSelect_GraphCounter.cxx diff --git a/src/IFSelect/IFSelect.cxx b/src/IFSelect/IFSelect.cxx deleted file mode 100644 index 5677e24b79..0000000000 --- a/src/IFSelect/IFSelect.cxx +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include - -// Methodes de confort, evitant de devoir connaitre SessionFile, qui est un -// Tool non destine a l export (en particulier, pas un Handle) -Standard_Boolean IFSelect::SaveSession - (const Handle(IFSelect_WorkSession)& WS, const Standard_CString file) -{ - IFSelect_SessionFile sesfile(WS,file); - return sesfile.IsDone(); -} - - Standard_Boolean IFSelect::RestoreSession - (const Handle(IFSelect_WorkSession)& WS, const Standard_CString file) -{ - IFSelect_SessionFile sesfile(WS); - return (sesfile.Read(file) == 0); -} diff --git a/src/IFSelect/IFSelect.hxx b/src/IFSelect/IFSelect.hxx deleted file mode 100644 index 81f916622d..0000000000 --- a/src/IFSelect/IFSelect.hxx +++ /dev/null @@ -1,238 +0,0 @@ -// Created on: 1992-09-21 -// Created by: Christian CAILLET -// Copyright (c) 1992-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IFSelect_HeaderFile -#define _IFSelect_HeaderFile - -#include -#include -#include - -#include -#include -class IFSelect_WorkSession; -class IFSelect_Signature; -class IFSelect_SignMultiple; -class IFSelect_SignType; -class IFSelect_SignCategory; -class IFSelect_SignValidity; -class IFSelect_SignAncestor; -class IFSelect_ShareOut; -class IFSelect_AppliedModifiers; -class IFSelect_ShareOutResult; -class IFSelect_PacketList; -class IFSelect_Dispatch; -class IFSelect_DispGlobal; -class IFSelect_DispPerOne; -class IFSelect_DispPerCount; -class IFSelect_DispPerSignature; -class IFSelect_DispPerFiles; -class IFSelect_SelectionIterator; -class IFSelect_Selection; -class IFSelect_SelectBase; -class IFSelect_SelectModelRoots; -class IFSelect_SelectModelEntities; -class IFSelect_SelectEntityNumber; -class IFSelect_SelectPointed; -class IFSelect_SelectCombine; -class IFSelect_SelectUnion; -class IFSelect_SelectIntersection; -class IFSelect_SelectControl; -class IFSelect_SelectDiff; -class IFSelect_SelectDeduct; -class IFSelect_SelectShared; -class IFSelect_SelectSharing; -class IFSelect_SelectAnyList; -class IFSelect_SelectInList; -class IFSelect_SelectSuite; -class IFSelect_SelectExtract; -class IFSelect_SelectUnknownEntities; -class IFSelect_SelectErrorEntities; -class IFSelect_SelectIncorrectEntities; -class IFSelect_SelectRoots; -class IFSelect_SelectRootComps; -class IFSelect_SelectRange; -class IFSelect_SelectAnyType; -class IFSelect_SelectType; -class IFSelect_SelectSignature; -class IFSelect_SelectFlag; -class IFSelect_SelectSent; -class IFSelect_SelectExplore; -class IFSelect_SelectSignedShared; -class IFSelect_SelectSignedSharing; -class IFSelect_IntParam; -class IFSelect_SignatureList; -class IFSelect_CheckCounter; -class IFSelect_SignCounter; -class IFSelect_GraphCounter; -class IFSelect_Editor; -class IFSelect_ParamEditor; -class IFSelect_EditForm; -class IFSelect_ListEditor; -class IFSelect_ContextModif; -class IFSelect_ContextWrite; -class IFSelect_Transformer; -class IFSelect_TransformStandard; -class IFSelect_ModelCopier; -class IFSelect_GeneralModifier; -class IFSelect_Modifier; -class IFSelect_ModifReorder; -class IFSelect_ModifEditForm; -class IFSelect_FileModifier; -class IFSelect_ModelModifier; -class IFSelect_WorkSession; -class IFSelect_WorkLibrary; -class IFSelect_SessionFile; -class IFSelect_SessionDumper; -class IFSelect_BasicDumper; -class IFSelect_Activator; -class IFSelect_SessionPilot; -class IFSelect_Act; -class IFSelect_Functions; - - -//! Gives tools to manage Selecting a group of Entities -//! processed by an Interface, for instance to divide up an -//! original Model (from a File) to several smaller ones -//! They use description of an Interface Model as a graph -//! -//! Remark that this corresponds to the description of a -//! "scenario" of sharing out a File. Parts of this Scenario -//! are intended to be permanently stored. IFSelect provides -//! the Transient, active counterparts (to run the Scenario). -//! But a permanent one (either as Persistent Objects or as -//! interpretable Text) must be provided elsewhere. -class IFSelect -{ -public: - - DEFINE_STANDARD_ALLOC - - - //! Saves the state of a WorkSession from IFSelect, by using a - //! SessionFile from IFSelect. Returns True if Done, False in - //! case of Error on Writing. gives the name of the File - //! to be produced (this avoids to export the class SessionFile). - Standard_EXPORT static Standard_Boolean SaveSession (const Handle(IFSelect_WorkSession)& WS, const Standard_CString file); - - //! Restore the state of a WorkSession from IFSelect, by using a - //! SessionFile from IFSelect. Returns True if Done, False in - //! case of Error on Writing. gives the name of the File - //! to be used (this avoids to export the class SessionFile). - Standard_EXPORT static Standard_Boolean RestoreSession (const Handle(IFSelect_WorkSession)& WS, const Standard_CString file); - - - - -protected: - - - - - -private: - - - - -friend class IFSelect_Signature; -friend class IFSelect_SignMultiple; -friend class IFSelect_SignType; -friend class IFSelect_SignCategory; -friend class IFSelect_SignValidity; -friend class IFSelect_SignAncestor; -friend class IFSelect_ShareOut; -friend class IFSelect_AppliedModifiers; -friend class IFSelect_ShareOutResult; -friend class IFSelect_PacketList; -friend class IFSelect_Dispatch; -friend class IFSelect_DispGlobal; -friend class IFSelect_DispPerOne; -friend class IFSelect_DispPerCount; -friend class IFSelect_DispPerSignature; -friend class IFSelect_DispPerFiles; -friend class IFSelect_SelectionIterator; -friend class IFSelect_Selection; -friend class IFSelect_SelectBase; -friend class IFSelect_SelectModelRoots; -friend class IFSelect_SelectModelEntities; -friend class IFSelect_SelectEntityNumber; -friend class IFSelect_SelectPointed; -friend class IFSelect_SelectCombine; -friend class IFSelect_SelectUnion; -friend class IFSelect_SelectIntersection; -friend class IFSelect_SelectControl; -friend class IFSelect_SelectDiff; -friend class IFSelect_SelectDeduct; -friend class IFSelect_SelectShared; -friend class IFSelect_SelectSharing; -friend class IFSelect_SelectAnyList; -friend class IFSelect_SelectInList; -friend class IFSelect_SelectSuite; -friend class IFSelect_SelectExtract; -friend class IFSelect_SelectUnknownEntities; -friend class IFSelect_SelectErrorEntities; -friend class IFSelect_SelectIncorrectEntities; -friend class IFSelect_SelectRoots; -friend class IFSelect_SelectRootComps; -friend class IFSelect_SelectRange; -friend class IFSelect_SelectAnyType; -friend class IFSelect_SelectType; -friend class IFSelect_SelectSignature; -friend class IFSelect_SelectFlag; -friend class IFSelect_SelectSent; -friend class IFSelect_SelectExplore; -friend class IFSelect_SelectSignedShared; -friend class IFSelect_SelectSignedSharing; -friend class IFSelect_IntParam; -friend class IFSelect_SignatureList; -friend class IFSelect_CheckCounter; -friend class IFSelect_SignCounter; -friend class IFSelect_GraphCounter; -friend class IFSelect_Editor; -friend class IFSelect_ParamEditor; -friend class IFSelect_EditForm; -friend class IFSelect_ListEditor; -friend class IFSelect_ContextModif; -friend class IFSelect_ContextWrite; -friend class IFSelect_Transformer; -friend class IFSelect_TransformStandard; -friend class IFSelect_ModelCopier; -friend class IFSelect_GeneralModifier; -friend class IFSelect_Modifier; -friend class IFSelect_ModifReorder; -friend class IFSelect_ModifEditForm; -friend class IFSelect_FileModifier; -friend class IFSelect_ModelModifier; -friend class IFSelect_WorkSession; -friend class IFSelect_WorkLibrary; -friend class IFSelect_SessionFile; -friend class IFSelect_SessionDumper; -friend class IFSelect_BasicDumper; -friend class IFSelect_Activator; -friend class IFSelect_SessionPilot; -friend class IFSelect_Act; -friend class IFSelect_Functions; - -}; - - - - - - - -#endif // _IFSelect_HeaderFile diff --git a/src/IFSelect/IFSelect_Act.cxx b/src/IFSelect/IFSelect_Act.cxx deleted file mode 100644 index aacb291d77..0000000000 --- a/src/IFSelect/IFSelect_Act.cxx +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include -#include -#include - -IMPLEMENT_STANDARD_RTTIEXT(IFSelect_Act,IFSelect_Activator) - -static TCollection_AsciiString thedefgr, thedefil; - - - - IFSelect_Act::IFSelect_Act - (const Standard_CString name, const Standard_CString help, - const IFSelect_ActFunc func) - : thename (name) , thehelp (help) , thefunc (func) { } - - IFSelect_ReturnStatus IFSelect_Act::Do - (const Standard_Integer, const Handle(IFSelect_SessionPilot)& pilot) -{ - if (!thefunc) return IFSelect_RetVoid; - return thefunc (pilot); -} - - Standard_CString IFSelect_Act::Help (const Standard_Integer) const - { return thehelp.ToCString(); } - - - void IFSelect_Act::SetGroup - (const Standard_CString group, const Standard_CString file) -{ thedefgr.Clear(); if (group[0] != '\0') thedefgr.AssignCat(group); - thedefil.Clear(); if (file [0] != '\0') thedefil.AssignCat(file); } - - void IFSelect_Act::AddFunc - (const Standard_CString name, const Standard_CString help, - const IFSelect_ActFunc func) -{ - Handle(IFSelect_Act) act = new IFSelect_Act (name,help,func); - if (thedefgr.Length() > 0) act->SetForGroup (thedefgr.ToCString()); - act->Add (1,name); -} - - void IFSelect_Act::AddFSet - (const Standard_CString name, const Standard_CString help, - const IFSelect_ActFunc func) -{ - Handle(IFSelect_Act) act = new IFSelect_Act (name,help,func); - if (thedefgr.Length() > 0) - act->SetForGroup (thedefgr.ToCString(),thedefil.ToCString()); - act->AddSet (1,name); -} diff --git a/src/IFSelect/IFSelect_ActFunc.hxx b/src/IFSelect/IFSelect_ActFunc.hxx deleted file mode 100644 index 250e98d7ec..0000000000 --- a/src/IFSelect/IFSelect_ActFunc.hxx +++ /dev/null @@ -1,24 +0,0 @@ -// Created on: 2000-02-29 -// Created by: data exchange team -// Copyright (c) 2000-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IFSelect_ActFunc_HeaderFile -#define _IFSelect_ActFunc_HeaderFile - -#include -#include - -typedef IFSelect_ReturnStatus (*IFSelect_ActFunc) (const Handle(IFSelect_SessionPilot)&); - -#endif diff --git a/src/IFSelect/IFSelect_FileModifier.gxx b/src/IFSelect/IFSelect_FileModifier.gxx deleted file mode 100644 index e87396ff39..0000000000 --- a/src/IFSelect/IFSelect_FileModifier.gxx +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//#include - - - -IFSelect_FileModifier::IFSelect_FileModifier () - : IFSelect_GeneralModifier (Standard_False) { } diff --git a/src/IFSelect/IFSelect_GeneralModifier.hxx b/src/IFSelect/IFSelect_GeneralModifier.hxx index 6b11e7fe29..8f2d760e51 100644 --- a/src/IFSelect/IFSelect_GeneralModifier.hxx +++ b/src/IFSelect/IFSelect_GeneralModifier.hxx @@ -63,10 +63,8 @@ DEFINE_STANDARD_HANDLE(IFSelect_GeneralModifier, MMgt_TShared) //! package IFAdapt, EntityModifier and EntityCopier class IFSelect_GeneralModifier : public MMgt_TShared { + public: -public: - - //! Returns True if this modifier may change the graph of //! dependences (aknowledged at creation time) Standard_EXPORT Standard_Boolean MayChangeGraph() const; @@ -99,14 +97,10 @@ public: //! Returns a short text which defines the operation performed Standard_EXPORT virtual TCollection_AsciiString Label() const = 0; - - - DEFINE_STANDARD_RTTIEXT(IFSelect_GeneralModifier,MMgt_TShared) -protected: + protected: - //! Sets the Modifier criteria to default Values //! (i.e. "always applies") //! must be provided at creation time, to : @@ -117,22 +111,11 @@ protected: //! dependencies when this modifier is applied Standard_EXPORT IFSelect_GeneralModifier(const Standard_Boolean maychangegraph); - - -private: - + private: Handle(IFSelect_Selection) thesel; Handle(IFSelect_Dispatch) thedisp; Standard_Boolean thechgr; - - }; - - - - - - #endif // _IFSelect_GeneralModifier_HeaderFile diff --git a/src/IFSelect/IFSelect_SelectCombine.cxx b/src/IFSelect/IFSelect_SelectCombine.cxx index f72253bfd2..d7c79780ee 100644 --- a/src/IFSelect/IFSelect_SelectCombine.cxx +++ b/src/IFSelect/IFSelect_SelectCombine.cxx @@ -12,7 +12,6 @@ // commercial license or contractual agreement. -#include #include #include #include @@ -21,7 +20,6 @@ IMPLEMENT_STANDARD_RTTIEXT(IFSelect_SelectCombine,IFSelect_Selection) IFSelect_SelectCombine::IFSelect_SelectCombine () { } -// { thelist = new IFSelect_SequenceOfSelection(); } Standard_Integer IFSelect_SelectCombine::NbInputs () const { return thelist.Length(); } diff --git a/src/IFSelect/IFSelect_SessionPilot.cxx b/src/IFSelect/IFSelect_SessionPilot.cxx index f0bbb20fbe..c34de21968 100644 --- a/src/IFSelect/IFSelect_SessionPilot.cxx +++ b/src/IFSelect/IFSelect_SessionPilot.cxx @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -60,27 +59,6 @@ static TCollection_AsciiString nulword; } - Handle(IFSelect_WorkSession) IFSelect_SessionPilot::Session () const - { return thesession; } - - Handle(IFSelect_WorkLibrary) IFSelect_SessionPilot::Library () const - { return thesession->WorkLibrary(); } - - Standard_Boolean IFSelect_SessionPilot::RecordMode () const - { return therecord; } - - void IFSelect_SessionPilot::SetSession - (const Handle(IFSelect_WorkSession)& WS) - { thesession = WS; } - - void IFSelect_SessionPilot::SetLibrary - (const Handle(IFSelect_WorkLibrary)& WL) - { if (!thesession.IsNull()) thesession->SetLibrary(WL); } - - void IFSelect_SessionPilot::SetRecordMode (const Standard_Boolean mode) - { therecord = mode; } - - void IFSelect_SessionPilot::SetCommandLine (const TCollection_AsciiString& command) { @@ -117,48 +95,10 @@ static TCollection_AsciiString nulword; #endif thenbwords ++; } -/* - aligner sur MAXWORDS - char l0[80],l1[80],l2[80],l3[80],l4[80],l5[80],l6[80],l7[80],l8[80],l9[80]; - char m0[80],m1[80],m2[80],m3[80],m4[80],m5[80],m6[80],m7[80],m8[80],m9[80]; - thenbwords = sscanf - (thecommand.ToCString(),"%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", - l0,l1,l2,l3,l4,l5,l6,l7,l8,l9,m0,m1,m2,m3,m4,m5,m6,m7,m8,m9); - if (thenbwords < 0) thenbwords = 0; - if (thenbwords > MAXWORDS) thenbwords = MAXWORDS; - Standard_Integer nb = thewords.Upper(); - for (i = 0; i <= nb; i ++) thewords(i).Clear(); - switch (thenbwords) { - case 20 : thewords(19).AssignCat(m9); - case 19 : thewords(18).AssignCat(m8); - case 18 : thewords(17).AssignCat(m7); - case 17 : thewords(16).AssignCat(m6); - case 16 : thewords(15).AssignCat(m5); - case 15 : thewords(14).AssignCat(m4); - case 14 : thewords(13).AssignCat(m3); - case 13 : thewords(12).AssignCat(m2); - case 12 : thewords(11).AssignCat(m1); - case 11 : thewords(10).AssignCat(m0); - case 10 : thewords(9).AssignCat(l9); - case 9 : thewords(8).AssignCat(l8); - case 8 : thewords(7).AssignCat(l7); - case 7 : thewords(6).AssignCat(l6); - case 6 : thewords(5).AssignCat(l5); - case 5 : thewords(4).AssignCat(l4); - case 4 : thewords(3).AssignCat(l3); - case 3 : thewords(2).AssignCat(l2); - case 2 : thewords(1).AssignCat(l1); - case 1 : thewords(0).AssignCat(l0); - default : break; - } -*/ thenumrec = 0; theobjrec.Nullify(); } - const TCollection_AsciiString& IFSelect_SessionPilot::CommandLine () const - { return thecommand; } - Standard_CString IFSelect_SessionPilot::CommandPart (const Standard_Integer numarg) const { @@ -167,9 +107,6 @@ static TCollection_AsciiString nulword; return &(thecommand.ToCString())[thewordeb(numarg)-1]; } - Standard_Integer IFSelect_SessionPilot::NbWords () const - { return thenbwords; } - const TCollection_AsciiString& IFSelect_SessionPilot::Word (const Standard_Integer num) const { if (num < thenbwords) return thewords(num); return nulword; } @@ -204,14 +141,6 @@ static TCollection_AsciiString nulword; return Standard_True; } - Standard_Integer IFSelect_SessionPilot::NbCommands () const - { return thecomlist.Length(); } - - const TCollection_AsciiString& IFSelect_SessionPilot::Command - (const Standard_Integer num) const - { return thecomlist(num); } - - IFSelect_ReturnStatus IFSelect_SessionPilot::RecordItem (const Handle(Standard_Transient)& item) { @@ -219,13 +148,6 @@ static TCollection_AsciiString nulword; return (item.IsNull() ? IFSelect_RetFail : IFSelect_RetDone); } - Handle(Standard_Transient) IFSelect_SessionPilot::RecordedItem () const - { return theobjrec; } - - void IFSelect_SessionPilot::Clear () - { thecomlist.Clear(); } - - // ####################################################################### // ######## CONTROLE D EXECUTION diff --git a/src/IFSelect/IFSelect_SessionPilot.hxx b/src/IFSelect/IFSelect_SessionPilot.hxx index 1d00b4477a..fd30fc0575 100644 --- a/src/IFSelect/IFSelect_SessionPilot.hxx +++ b/src/IFSelect/IFSelect_SessionPilot.hxx @@ -21,19 +21,13 @@ #include #include -#include #include #include -#include #include #include -#include #include #include class IFSelect_WorkSession; -class Standard_Transient; -class IFSelect_WorkLibrary; -class TCollection_AsciiString; class IFSelect_SignCounter; @@ -75,9 +69,7 @@ DEFINE_STANDARD_HANDLE(IFSelect_SessionPilot, IFSelect_Activator) //! are skipped (comment lines are display if read from file) class IFSelect_SessionPilot : public IFSelect_Activator { - -public: - + public: //! Creates an empty SessionPilot, with a prompt which will be //! displayed on querying commands. If not precised (""), this @@ -85,30 +77,23 @@ public: Standard_EXPORT IFSelect_SessionPilot(const Standard_CString prompt = ""); //! Returns the WorkSession which is worked on - Standard_EXPORT Handle(IFSelect_WorkSession) Session() const; - - //! Returns the WorKlibrary (Null if not set). WorkLibrary is used - //! to Read and Write Files, according to the Norm - Standard_EXPORT Handle(IFSelect_WorkLibrary) Library() const; + const Handle(IFSelect_WorkSession) & Session() const { return thesession; } //! Returns the Record Mode for Commands. Default is False. - Standard_EXPORT Standard_Boolean RecordMode() const; + Standard_Boolean RecordMode() const { return therecord; } //! Sets a WorkSession to be worked on - Standard_EXPORT void SetSession (const Handle(IFSelect_WorkSession)& WS); - - //! Sets a WorkLibrary - Standard_EXPORT void SetLibrary (const Handle(IFSelect_WorkLibrary)& WL); + void SetSession (const Handle(IFSelect_WorkSession)& WS) { thesession = WS; } //! Changes the RecordMode. - Standard_EXPORT void SetRecordMode (const Standard_Boolean mode); + void SetRecordMode (const Standard_Boolean mode) { therecord = mode; } //! Sets the value of the Command Line to be interpreted //! Also prepares the interpretation (splitting by blanks) Standard_EXPORT void SetCommandLine (const TCollection_AsciiString& command); //! Returns the Command Line to be interpreted - Standard_EXPORT const TCollection_AsciiString& CommandLine() const; + const TCollection_AsciiString& CommandLine() const { return thecommand; } //! Returns the part of the command line which begins at argument //! between 0 and NbWords-1 (by default, all the line) @@ -119,7 +104,7 @@ public: //! blanks : 0 if empty, one if a command without args, else it //! gives the count of args minus one. //! Warning : limited to 10 (command title + 9 args) - Standard_EXPORT Standard_Integer NbWords() const; + Standard_Integer NbWords() const { return thenbwords; } //! Returns a word given its rank in the Command Line. Begins at 0 //! which is the Command Title, 1 is the 1st arg., etc... @@ -134,10 +119,10 @@ public: Standard_EXPORT Standard_Boolean RemoveWord (const Standard_Integer num); //! Returns the count of recorded Commands - Standard_EXPORT Standard_Integer NbCommands() const; - + Standard_Integer NbCommands() const { return thecomlist.Length(); } + //! Returns a recorded Command, given its rank (from 1) - Standard_EXPORT const TCollection_AsciiString& Command (const Standard_Integer num) const; + const TCollection_AsciiString& Command (const Standard_Integer num) const { return thecomlist(num); } //! Allows to associate a Transient Value with the last execution //! as a partial result @@ -147,10 +132,10 @@ public: //! Returns the Transient Object which was recorded with the //! current Line Command. If none was, returns a Null Handle - Standard_EXPORT Handle(Standard_Transient) RecordedItem() const; - + const Handle(Standard_Transient) & RecordedItem() const { return theobjrec; } + //! Clears the recorded informations (commands, objects) - Standard_EXPORT void Clear(); + void Clear() { thecomlist.Clear(); } //! Reads commands from a Script File, named . By default //! (file = ""), reads from standard input with a prompt @@ -233,14 +218,6 @@ private: Standard_Integer thenumrec; Handle(Standard_Transient) theobjrec; TColStd_SequenceOfAsciiString thecomlist; - - }; - - - - - - #endif // _IFSelect_SessionPilot_HeaderFile diff --git a/src/IFSelect/IFSelect_ShareOutResult.cxx b/src/IFSelect/IFSelect_ShareOutResult.cxx index d55dfb0e8a..6c33655683 100644 --- a/src/IFSelect/IFSelect_ShareOutResult.cxx +++ b/src/IFSelect/IFSelect_ShareOutResult.cxx @@ -202,7 +202,6 @@ IFSelect_ShareOutResult::IFSelect_ShareOutResult Interface_EntityIterator IFSelect_ShareOutResult::PacketContent () { -// IFGraph_Cumulate G(thegraph); Interface_EntityIterator iter = thedispres.Entities(); Interface_Graph G(thegraph); // G.GetFromIter(thedispres.Entities(),0); diff --git a/src/IFSelect/IFSelect_WorkLibrary.cxx b/src/IFSelect/IFSelect_WorkLibrary.cxx index 49ed080769..0ea50ddb83 100644 --- a/src/IFSelect/IFSelect_WorkLibrary.cxx +++ b/src/IFSelect/IFSelect_WorkLibrary.cxx @@ -26,9 +26,6 @@ IMPLEMENT_STANDARD_RTTIEXT(IFSelect_WorkLibrary,Standard_Transient) -// all deferred but Copy (virtual default) -IFSelect_WorkLibrary::IFSelect_WorkLibrary () { thelevdef = 0; } - Standard_Boolean IFSelect_WorkLibrary::CopyModel (const Handle(Interface_InterfaceModel)& /*original*/, const Handle(Interface_InterfaceModel)& newmodel, diff --git a/src/IFSelect/IFSelect_WorkLibrary.hxx b/src/IFSelect/IFSelect_WorkLibrary.hxx index fa19ba190c..7ddc2f9f35 100644 --- a/src/IFSelect/IFSelect_WorkLibrary.hxx +++ b/src/IFSelect/IFSelect_WorkLibrary.hxx @@ -50,9 +50,7 @@ DEFINE_STANDARD_HANDLE(IFSelect_WorkLibrary, Standard_Transient) //! kind of informations relevant for the norm, class IFSelect_WorkLibrary : public Standard_Transient { - -public: - + public: //! Gives the way to Read a File and transfer it to a Model //! is the resulting Model, which has to be created by this @@ -118,32 +116,17 @@ public: //! Returns the help line recorded for , or an empty string Standard_EXPORT Standard_CString DumpHelp (const Standard_Integer level) const; - - - DEFINE_STANDARD_RTTIEXT(IFSelect_WorkLibrary,Standard_Transient) -protected: - + protected: //! Required to initialise fields - Standard_EXPORT IFSelect_WorkLibrary(); - - - -private: + IFSelect_WorkLibrary() : thelevdef(0) {} + private: Standard_Integer thelevdef; Handle(Interface_HArray1OfHAsciiString) thelevhlp; - - }; - - - - - - #endif // _IFSelect_WorkLibrary_HeaderFile diff --git a/src/IFSelect/IFSelect_WorkSession.cxx b/src/IFSelect/IFSelect_WorkSession.cxx index 6b7d986ccd..e5e8e29952 100644 --- a/src/IFSelect/IFSelect_WorkSession.cxx +++ b/src/IFSelect/IFSelect_WorkSession.cxx @@ -20,9 +20,6 @@ #include #include #include -#include -#include -#include #include #include #include @@ -1953,50 +1950,6 @@ Standard_Boolean IFSelect_WorkSession::SetFileRoot } -//======================================================================= -//function : -//purpose : -//======================================================================= - -Standard_CString IFSelect_WorkSession::GiveFileRoot - (const Standard_CString file) const -{ - OSD_Path path (file); - if (!path.IsValid(TCollection_AsciiString(file))) return file; // tant pis .. - bufstr = path.Name(); - return bufstr.ToCString(); -} - - -//======================================================================= -//function : -//purpose : -//======================================================================= - -Standard_CString IFSelect_WorkSession::GiveFileComplete - (const Standard_CString file) const -{ -// ajouter si besoin : Prefix; Extension - bufstr.Clear(); bufstr.AssignCat (file); - Standard_Integer i,j = 0,nb = bufstr.Length(); - Handle(TCollection_HAsciiString) ext = FileExtension (); - if (!ext.IsNull()) { - char val0 = '\0'; if (ext->Length() > 0) val0 = ext->Value(1); - for (i = nb; i > 0; i --) if (bufstr.Value(i) == val0) { j = 1; break; } - if (j == 0) bufstr.AssignCat (ext->ToCString()); - } - Handle(TCollection_HAsciiString) pre = FilePrefix (); - if (!pre.IsNull()) { - char val1 = '\0'; if (pre->Length() > 0) val1 = pre->Value(pre->Length()); - j = 0; - for (i = nb; i > 0; i --) if (bufstr.Value(i) == val1) { j = 1; break; } - if (j == 0) bufstr.Insert (1,pre->ToCString()); - } - - return bufstr.ToCString(); -} - - //======================================================================= //function : //purpose : @@ -2156,11 +2109,6 @@ Standard_Boolean IFSelect_WorkSession::SendSplit () if (NbFiles() > 0) checks = thecopier->SendCopied (thelibrary,theprotocol); else { - /* - IFSelect_ShareOutResult eval (ShareOut(), thegraph->Graph()); - checks = thecopier->Send (eval, thelibrary, theprotocol); - thecopier->SetRemaining (thegraph->CGraph()); - */ // Decomposer if (theshareout.IsNull()) return Standard_False; Standard_Integer i, nbd = theshareout->NbDispatches(); @@ -2610,41 +2558,6 @@ Standard_Boolean IFSelect_WorkSession::CombineRemove } -//======================================================================= -//function : -//purpose : -//======================================================================= - -Handle(IFSelect_Selection) IFSelect_WorkSession::NewSelectPointed - (const Handle(TColStd_HSequenceOfTransient)& list, - const Standard_CString name) -{ - Handle(IFSelect_SelectPointed) sel = new IFSelect_SelectPointed; - if (!list.IsNull()) sel->AddList (list); - if (AddNamedItem (name,sel) == 0) sel.Nullify(); - return sel; -} - - -//======================================================================= -//function : -//purpose : -//======================================================================= - -Standard_Boolean IFSelect_WorkSession::SetSelectPointed - (const Handle(IFSelect_Selection)& sel, - const Handle(TColStd_HSequenceOfTransient)& list, - const Standard_Integer mode) const -{ - DeclareAndCast(IFSelect_SelectPointed,sp,sel); - if (sp.IsNull() || list.IsNull()) return Standard_False; - if (mode == 0) sp->Clear(); - if (mode >= 0) sp->AddList(list); - else sp->RemoveList(list); - return Standard_True; -} - - // ########################################################################### // .... Analyse d un CheckIterator par rapport a un graphe .... diff --git a/src/IFSelect/IFSelect_WorkSession.hxx b/src/IFSelect/IFSelect_WorkSession.hxx index 5a9f3989c1..d9765b45c8 100644 --- a/src/IFSelect/IFSelect_WorkSession.hxx +++ b/src/IFSelect/IFSelect_WorkSession.hxx @@ -703,14 +703,6 @@ public: //! root name is already defined for it Standard_EXPORT Standard_Boolean SetFileRoot (const Handle(IFSelect_Dispatch)& disp, const Standard_CString name); - //! Extracts File Root Name from a given complete file name - //! (uses OSD_Path) - Standard_EXPORT Standard_CString GiveFileRoot (const Standard_CString file) const; - - //! Completes a file name as required, with Prefix and Extension - //! (if defined; for a non-defined item, completes nothing) - Standard_EXPORT Standard_CString GiveFileComplete (const Standard_CString file) const; - //! Erases all stored data from the File Evaluation //! (i.e. ALL former naming informations are lost) Standard_EXPORT void ClearFile(); @@ -886,17 +878,6 @@ public: //! kind of SelectCombine or is not source of Standard_EXPORT Standard_Boolean CombineRemove (const Handle(IFSelect_Selection)& selcomb, const Handle(IFSelect_Selection)& selrem); - //! Creates a new Selection, of type SelectPointed, its content - //! starts with . A name must be given (can be empty) - Standard_EXPORT Handle(IFSelect_Selection) NewSelectPointed (const Handle(TColStd_HSequenceOfTransient)& list, const Standard_CString name); - - //! Changes the content of a Selection of type SelectPointed - //! According : 0 set as new content (clear former) - //! 1 : adds to actual content - //! -1 : removes from actual content - //! Returns True if done, False if is not a SelectPointed - Standard_EXPORT Standard_Boolean SetSelectPointed (const Handle(IFSelect_Selection)& sel, const Handle(TColStd_HSequenceOfTransient)& list, const Standard_Integer mode) const; - //! Returns a Selection from a Name : //! - the name of a Selection : this Selection //! - the name of a Signature + criteria between (..) : a new diff --git a/src/IGESControl/FILES b/src/IGESControl/FILES index c07fbe90f5..9fbb6fa7e3 100644 --- a/src/IGESControl/FILES +++ b/src/IGESControl/FILES @@ -4,6 +4,8 @@ IGESControl_AlgoContainer.cxx IGESControl_AlgoContainer.hxx IGESControl_Controller.cxx IGESControl_Controller.hxx +IGESControl_FloatFormat.cxx +IGESControl_FloatFormat.hxx IGESControl_IGESBoundary.cxx IGESControl_IGESBoundary.hxx IGESControl_Reader.cxx @@ -11,5 +13,7 @@ IGESControl_Reader.hxx IGESControl_Reader.lxx IGESControl_ToolContainer.cxx IGESControl_ToolContainer.hxx +IGESControl_WorkLibrary.cxx +IGESControl_WorkLibrary.hxx IGESControl_Writer.cxx IGESControl_Writer.hxx diff --git a/src/IGESControl/IGESControl_ActorWrite.cxx b/src/IGESControl/IGESControl_ActorWrite.cxx index b918c5c257..c7f074f2f6 100644 --- a/src/IGESControl/IGESControl_ActorWrite.cxx +++ b/src/IGESControl/IGESControl_ActorWrite.cxx @@ -27,7 +27,7 @@ #include #include #include -//szv_c1:#include +#include #include #include #include @@ -38,19 +38,13 @@ Standard_Boolean IGESControl_ActorWrite::Recognize (const Handle(Standard_Transi { DeclareAndCast(TransferBRep_ShapeMapper,shmap,start); if (!shmap.IsNull()) return Standard_True; - /*szv_c1:DeclareAndCast(Transfer_TransientMapper,gemap,start); - if (!gemap.IsNull()) { - Handle(Standard_Transient) geom = gemap->Value(); - DeclareAndCast(Geom_Curve,Curve,geom); - DeclareAndCast(Geom_Surface,Surf,geom);*/ - DeclareAndCast(Geom_Curve,Curve,start); - DeclareAndCast(Geom_Surface,Surf,start); - if (!Curve.IsNull() || !Surf.IsNull()) return Standard_True; - //szv_c1:} + DeclareAndCast(Geom_Curve,Curve,start); + DeclareAndCast(Geom_Surface,Surf,start); + if (!Curve.IsNull() || !Surf.IsNull()) return Standard_True; return Standard_False; } -Handle(Transfer_Binder) IGESControl_ActorWrite::Transferring (const Handle(Standard_Transient)& start, const Handle(Transfer_ProcessForFinder)& TP) +Handle(Transfer_Binder) IGESControl_ActorWrite::Transferring (const Handle(Standard_Transient)& start, const Handle(Transfer_Process)& TP) { XSAlgo::AlgoContainer()->PrepareForTransfer(); @@ -81,28 +75,23 @@ Handle(Transfer_Binder) IGESControl_ActorWrite::Transferring (const Handle(Stand XSAlgo::AlgoContainer()->MergeTransferInfo(FP, info); if (!ent.IsNull()) return new Transfer_SimpleBinderOfTransient(ent); } - /*szv_c1:DeclareAndCast(Transfer_TransientMapper,gemap,start); - if (!gemap.IsNull()) { - Handle(Standard_Transient) geom = gemap->Value(); - DeclareAndCast(Geom_Curve,Curve,geom); - DeclareAndCast(Geom_Surface,Surf,geom);*/ - DeclareAndCast(Geom_Curve,Curve,start); - DeclareAndCast(Geom_Surface,Surf,start); + + DeclareAndCast(Geom_Curve,Curve,start); + DeclareAndCast(Geom_Surface,Surf,start); // On reconnait : Curve et Surface de Geom // quid de Point; Geom2d ? - GeomToIGES_GeomCurve GC; GC.SetModel(modl); - GeomToIGES_GeomSurface GS; GS.SetModel(modl); - if (!Curve.IsNull()) - ent = GC.TransferCurve(Curve,Curve->FirstParameter(),Curve->LastParameter()); - else if (!Surf.IsNull()) { - Standard_Real U1,U2,V1,V2; - Surf->Bounds(U1,U2,V1,V2); - ent = GS.TransferSurface(Surf,U1,U2,V1,V2); - } - if (!ent.IsNull()) return new Transfer_SimpleBinderOfTransient(ent); - //szv_c1:} + GeomToIGES_GeomCurve GC; GC.SetModel(modl); + GeomToIGES_GeomSurface GS; GS.SetModel(modl); + if (!Curve.IsNull()) + ent = GC.TransferCurve(Curve,Curve->FirstParameter(),Curve->LastParameter()); + else if (!Surf.IsNull()) { + Standard_Real U1,U2,V1,V2; + Surf->Bounds(U1,U2,V1,V2); + ent = GS.TransferSurface(Surf,U1,U2,V1,V2); + } + if (!ent.IsNull()) return new Transfer_SimpleBinderOfTransient(ent); return NULL; } diff --git a/src/IGESControl/IGESControl_ActorWrite.hxx b/src/IGESControl/IGESControl_ActorWrite.hxx index 10b8b4faa6..11be007a58 100644 --- a/src/IGESControl/IGESControl_ActorWrite.hxx +++ b/src/IGESControl/IGESControl_ActorWrite.hxx @@ -30,13 +30,13 @@ class IGESControl_ActorWrite : public Transfer_ActorOfFinderProcess IGESControl_ActorWrite() {} //! Recognizes a ShapeMapper - Standard_EXPORT virtual Standard_Boolean Recognize (const Handle(Standard_Transient)& start) Standard_OVERRIDE; + Standard_EXPORT Standard_Boolean Recognize (const Handle(Standard_Transient)& start) Standard_OVERRIDE; //! Transfers Shape to IGES Entities //! //! ModeTrans may be : 0 -> groups of Faces //! or 1 -> BRep - Standard_EXPORT virtual Handle(Transfer_Binder) Transferring (const Handle(Standard_Transient)& start, const Handle(Transfer_ProcessForFinder)& FP) Standard_OVERRIDE; + Standard_EXPORT Handle(Transfer_Binder) Transferring (const Handle(Standard_Transient)& start, const Handle(Transfer_Process)& FP) Standard_OVERRIDE; DEFINE_STANDARD_RTTIEXT(IGESControl_ActorWrite,Transfer_ActorOfFinderProcess) }; diff --git a/src/IGESControl/IGESControl_Controller.cxx b/src/IGESControl/IGESControl_Controller.cxx index 190334441f..23ccebe5c8 100644 --- a/src/IGESControl/IGESControl_Controller.cxx +++ b/src/IGESControl/IGESControl_Controller.cxx @@ -14,56 +14,25 @@ //#58 rln 28.12.98 changing default values for Global Section //sln 14.01.2002 OCC51 : verifying whether entry model of method ActorRead is IGESDatat_IGESModel -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include +#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include #include +#include #include #include -#include +#include #include #include -#include #include #include -#include -#include #include -#include #include IMPLEMENT_STANDARD_RTTIEXT(IGESControl_Controller,XSControl_Controller) @@ -79,51 +48,10 @@ IGESControl_Controller::IGESControl_Controller (const Standard_Boolean mod) { static Standard_Boolean init = Standard_False; if (!init) { + init = Standard_True; IGESSolid::Init(); IGESAppli::Init(); - init = Standard_True; } - AddSessionItem (new IGESSelect_RemoveCurves(Standard_True) ,"iges-remove-pcurves"); - AddSessionItem (new IGESSelect_RemoveCurves(Standard_False),"iges-remove-curves-3d"); - AddSessionItem (new IGESSelect_SetLabel (0,Standard_True) ,"iges-clear-label"); - AddSessionItem (new IGESSelect_SetLabel (1,Standard_False),"iges-set-label-dnum"); - - AddSessionItem (new IGESSelect_AutoCorrect,"iges-auto-correct",Standard_True); - AddSessionItem (new IGESSelect_ComputeStatus,"iges-compute-status",Standard_True); - - Handle(IGESSelect_FloatFormat) flf = new IGESSelect_FloatFormat; - flf->SetDefault (12); - AddSessionItem (flf,"iges-float-digits-12",Standard_True); - - // -- Sender Product Identification -- (pas un statique ...) - Handle(IGESSelect_SetGlobalParameter) set3 = new IGESSelect_SetGlobalParameter(3); - Handle(TCollection_HAsciiString) pa3 = Interface_Static::Static("write.iges.header.product")->HStringValue(); - set3->SetValue(pa3); - AddSessionItem (pa3, "iges-header-val-sender"); - AddSessionItem (set3,"iges-header-set-sender",Standard_True); - - AddSessionItem (new IGESSelect_UpdateFileName,"iges-update-file-name",Standard_True); - - // -- Receiver -- Acces par Static, ajustable - Handle(IGESSelect_SetGlobalParameter) set12 = new IGESSelect_SetGlobalParameter(12); - Handle(TCollection_HAsciiString) pa12 = Interface_Static::Static("write.iges.header.receiver")->HStringValue(); - set12->SetValue(pa12); - AddSessionItem (pa12, "iges-header-val-receiver"); - AddSessionItem (set12,"iges-header-set-receiver",Standard_True); - - // -- Auteur -- acces par Static (demarre par whoami), ajustable - Handle(IGESSelect_SetGlobalParameter) set21 = new IGESSelect_SetGlobalParameter(21); - Handle(TCollection_HAsciiString) pa21 = Interface_Static::Static("write.iges.header.author")->HStringValue(); - set21->SetValue(pa21); - AddSessionItem (pa21, "iges-header-val-author"); - AddSessionItem (set21,"iges-header-set-author",Standard_True); - - // -- Compagnie (de l auteur) -- acces par Static, ajustable - Handle(IGESSelect_SetGlobalParameter) set22 = new IGESSelect_SetGlobalParameter(22); - Handle(TCollection_HAsciiString) pa22 = Interface_Static::Static("write.iges.header.company")->HStringValue(); - set22->SetValue(pa22); - AddSessionItem (pa22, "iges-header-val-company"); - AddSessionItem (set22,"iges-header-set-company",Standard_True); // -- STATICS @@ -136,8 +64,8 @@ IGESControl_Controller::IGESControl_Controller (const Standard_Boolean mod) TraceStatic ("write.iges.unit",6); TraceStatic ("write.iges.brep.mode",6); - myAdaptorLibrary = new IGESSelect_WorkLibrary(themode); - myAdaptorProtocol = IGESSelect_WorkLibrary::DefineProtocol(); + myAdaptorLibrary = new IGESControl_WorkLibrary(themode); + myAdaptorProtocol = DefineProtocol(); Handle(IGESToBRep_Actor) anactiges = new IGESToBRep_Actor; anactiges->SetContinuity(0); @@ -150,150 +78,6 @@ IGESControl_Controller::IGESControl_Controller (const Standard_Boolean mod) SetModeWriteHelp (1,"BRep"); } -void IGESControl_Controller::Customise(Handle(XSControl_WorkSession)& WS) -{ - XSControl_Controller::Customise(WS); - - // --- SELECTIONS, SIGNATURES, COMPTEURS, EDITEURS - // -- BypassGroup / xst-model-roots - - // Should be already set by the above call to Customise - Handle(IFSelect_SelectModelEntities) xma; - Handle(Standard_Transient) xma1 = WS->NamedItem("xst-model-all"); - if (xma1.IsNull()) xma = new IFSelect_SelectModelEntities; - else { - xma = Handle(IFSelect_SelectModelEntities)::DownCast(xma1); - WS->AddNamedItem ("xst-model-all",xma); - } - - Handle(IFSelect_SelectModelRoots) xmr; - Handle(Standard_Transient) xmr1 = WS->NamedItem("xst-model-roots"); - if (!xmr1.IsNull()) - xmr = Handle(IFSelect_SelectModelRoots)::DownCast(xmr1); - else { - xmr = new IFSelect_SelectModelRoots; - WS->AddNamedItem ("xst-model-roots",xmr); - } - - Handle(XSControl_SelectForTransfer) xtr; - Handle(Standard_Transient) xtr1 = WS->NamedItem("xst-transferrable-roots"); - if (!xtr1.IsNull()) - xtr = Handle(XSControl_SelectForTransfer)::DownCast(xtr1); - else { - xtr = new XSControl_SelectForTransfer; - xtr->SetReader (WS->TransferReader()); - WS->AddNamedItem ("xst-transferrable-roots",xtr); - } - - if (!xmr.IsNull()) { - Handle(IGESSelect_SelectVisibleStatus) visa = new IGESSelect_SelectVisibleStatus; - visa->SetInput(xmr); - WS->AddNamedItem ("iges-visible-roots",visa); - Handle(IGESSelect_SelectVisibleStatus) vist = new IGESSelect_SelectVisibleStatus; - vist->SetInput(xtr); - WS->AddNamedItem ("iges-visible-transf-roots",vist); - Handle(IGESSelect_SelectVisibleStatus) blka = new IGESSelect_SelectVisibleStatus; - blka->SetDirect (Standard_False); - blka->SetInput(xmr); - WS->AddNamedItem ("iges-blanked-roots",blka); - Handle(IGESSelect_SelectVisibleStatus) blkt = new IGESSelect_SelectVisibleStatus; - blkt->SetDirect (Standard_False); - blkt->SetInput(xtr); - WS->AddNamedItem ("iges-blanked-transf-roots",blkt); - Handle(IGESSelect_SelectSubordinate) indp = new IGESSelect_SelectSubordinate (0); - indp->SetInput (xma); - WS->AddNamedItem ("iges-status-independant",indp); - - Handle(IGESSelect_SelectBypassGroup) sb = new IGESSelect_SelectBypassGroup; - sb->SetInput(xmr); - WS->AddNamedItem ("iges-bypass-group",sb); - Handle(IGESSelect_SelectBypassSubfigure) sfi = new IGESSelect_SelectBypassSubfigure; - sfi->SetInput(xmr); - WS->AddNamedItem ("iges-bypass-subfigure",sfi); - Handle(IGESSelect_SelectBypassGroup) sfb = new IGESSelect_SelectBypassGroup; - sfb->SetInput(sfi); - WS->AddNamedItem ("iges-bypass-group-subfigure",sfb); - Handle(IGESSelect_SelectBasicGeom) sc3d = new IGESSelect_SelectBasicGeom(1); - sc3d->SetInput(sfi); - WS->AddNamedItem ("iges-curves-3d",sc3d); - Handle(IGESSelect_SelectBasicGeom) sb3d = new IGESSelect_SelectBasicGeom(2); - sb3d->SetInput(sfi); - WS->AddNamedItem ("iges-basic-curves-3d",sb3d); - Handle(IGESSelect_SelectBasicGeom) sbg = new IGESSelect_SelectBasicGeom(0); - sbg->SetInput(sfi); - WS->AddNamedItem ("iges-basic-geom",sbg); - Handle(IGESSelect_SelectBasicGeom) srf = new IGESSelect_SelectBasicGeom(-1); - srf->SetInput(sfi); - WS->AddNamedItem ("iges-surfaces",srf); - Handle(IGESSelect_SelectFaces) sfa = new IGESSelect_SelectFaces; - sfa->SetInput(sfi); - WS->AddNamedItem ("iges-faces",sfa ); - Handle(IGESSelect_SelectPCurves) spc = new IGESSelect_SelectPCurves(Standard_True); - spc->SetInput(sfa); - WS->AddNamedItem ("iges-pcurves",spc); - - Handle(IFSelect_SelectType) snosub = new IFSelect_SelectType - (STANDARD_TYPE(IGESBasic_SubfigureDef)); - snosub->SetDirect(Standard_False); - snosub->SetInput(xmr); - WS->AddNamedItem ("iges-no-indep-subfigure-def",snosub); - - Handle(IGESSelect_IGESTypeForm) itf = new IGESSelect_IGESTypeForm(Standard_True); - WS->AddNamedItem ("iges-type",itf); - - Handle(IGESSelect_SignStatus) sigst = new IGESSelect_SignStatus; - Handle(IFSelect_SignMultiple) typsta = new IFSelect_SignMultiple - ("IGES Type Form Status"); - typsta->Add (itf,15); - typsta->Add (sigst); - WS->AddNamedItem ("iges-type-status",typsta); - - Handle(IFSelect_SignMultiple) typnam = new IFSelect_SignMultiple - ("IGES Type Form TypeName"); - typnam->Add (itf,4); - typnam->Add (new IFSelect_SignType(Standard_True)); - WS->AddNamedItem ("iges-type-name",typnam); - - Handle(IFSelect_SignCounter) itfs = new IFSelect_SignCounter - (itf,Standard_False,Standard_True); - WS->AddNamedItem ("iges-types",itfs); - Handle(IGESSelect_CounterOfLevelNumber) levs = - new IGESSelect_CounterOfLevelNumber; - WS->AddNamedItem ("iges-levels",levs); - - Handle(IGESSelect_SignLevelNumber) slev = new IGESSelect_SignLevelNumber(Standard_False); - WS->AddNamedItem ("iges-level-number",slev); - Handle(IGESSelect_IGESName) igna = new IGESSelect_IGESName; - WS->AddNamedItem ("iges-name",igna); - - Handle(IGESSelect_SignColor) scol1 = new IGESSelect_SignColor (1); - WS->AddNamedItem ("iges-color-number",scol1); - Handle(IGESSelect_SignColor) scol2 = new IGESSelect_SignColor (2); - WS->AddNamedItem ("iges-color-name",scol2); - Handle(IGESSelect_SignColor) scol3 = new IGESSelect_SignColor (3); - WS->AddNamedItem ("iges-color-rgb",scol3); - Handle(IGESSelect_SignColor) scol4 = new IGESSelect_SignColor (4); - WS->AddNamedItem ("iges-color-red",scol4); - Handle(IGESSelect_SignColor) scol5 = new IGESSelect_SignColor (5); - WS->AddNamedItem ("iges-color-green",scol5); - Handle(IGESSelect_SignColor) scol6 = new IGESSelect_SignColor (6); - WS->AddNamedItem ("iges-color-blue",scol6); - - Handle(IGESSelect_EditHeader) edhead = new IGESSelect_EditHeader; - WS->AddNamedItem ("iges-header-edit",edhead); - Handle(IFSelect_EditForm) edheadf = edhead->Form(Standard_False); - WS->AddNamedItem ("iges-header",edheadf); - - Handle(IGESSelect_EditDirPart) eddirp = new IGESSelect_EditDirPart; - WS->AddNamedItem ("iges-dir-part-edit",eddirp); - Handle(IFSelect_EditForm) eddirpf = eddirp->Form(Standard_False); - WS->AddNamedItem ("iges-dir-part",eddirpf); - - //szv:mySignType = typnam; - WS->SetSignType( typnam ); - } -} - //======================================================================= //function : NewModel @@ -303,7 +87,7 @@ void IGESControl_Controller::Customise(Handle(XSControl_WorkSession)& WS) Handle(Interface_InterfaceModel) IGESControl_Controller::NewModel () const { // On prend un modele qu on prepare avec les statiques enregistres - DeclareAndCast(IGESData_IGESModel,igm,Interface_InterfaceModel::Template("iges")); + Handle(IGESData_IGESModel) igm = IGESData::NewModel(); IGESData_GlobalSection GS = igm->GlobalSection(); GS.SetReceiveName (Interface_Static::Static("write.iges.header.receiver")->HStringValue()); @@ -338,16 +122,33 @@ Handle(Transfer_ActorOfTransientProcess) IGESControl_Controller::ActorRead (cons //purpose : //======================================================================= -Standard_Boolean IGESControl_Controller::Init () +void IGESControl_Controller::Init () { static Standard_Boolean inic = Standard_False; if (!inic) { + inic = Standard_True; Handle(IGESControl_Controller) ADIGES = new IGESControl_Controller(Standard_False); ADIGES->AutoRecord(); XSAlgo::Init(); IGESToBRep::Init(); IGESToBRep::SetAlgoContainer (new IGESControl_AlgoContainer()); - inic = Standard_True; } - return Standard_True; +} + +//======================================================================= +//function : Init +//purpose : +//======================================================================= + +const Handle(IGESData_Protocol) & IGESControl_Controller::DefineProtocol () +{ + static Handle(IGESData_FileProtocol) gIGESProto; + if (gIGESProto.IsNull()) { + Handle(IGESData_Protocol) aIGESProto1 = IGESSolid::Protocol(); + Handle(IGESData_Protocol) aIGESProto2 = IGESAppli::Protocol(); + gIGESProto = new IGESData_FileProtocol; + gIGESProto->Add(aIGESProto1); + gIGESProto->Add(aIGESProto2); + } + return gIGESProto; } diff --git a/src/IGESControl/IGESControl_Controller.hxx b/src/IGESControl/IGESControl_Controller.hxx index 9c2924d5c6..74f44e4d9b 100644 --- a/src/IGESControl/IGESControl_Controller.hxx +++ b/src/IGESControl/IGESControl_Controller.hxx @@ -27,6 +27,7 @@ class TopoDS_Shape; class Transfer_FinderProcess; class XSControl_WorkSession; +class IGESData_Protocol; class IGESControl_Controller; @@ -37,11 +38,6 @@ class IGESControl_Controller : public XSControl_Controller { public: - //! Initializes the use of IGES Norm (the first time) and returns - //! a Controller for IGES-5.1 - //! If is True, sets it to internal FNES format - Standard_EXPORT IGESControl_Controller(const Standard_Boolean modefnes = Standard_False); - //! Creates a new empty Model ready to receive data of the Norm. //! It is taken from IGES Template Model Standard_EXPORT Handle(Interface_InterfaceModel) NewModel() const Standard_OVERRIDE; @@ -55,13 +51,20 @@ class IGESControl_Controller : public XSControl_Controller //! records it to various names, available to select it later //! Returns True when done, False if could not be done //! Also, it creates and records an Adaptor for FNES - Standard_EXPORT static Standard_Boolean Init(); + Standard_EXPORT static void Init(); - Standard_EXPORT virtual void Customise (Handle(XSControl_WorkSession)& WS) Standard_OVERRIDE; + //! Defines a protocol to be adequate for IGES + //! (encompasses ALL the IGES norm including IGESSolid, IGESAppli) + Standard_EXPORT static const Handle(IGESData_Protocol) & DefineProtocol(); DEFINE_STANDARD_RTTIEXT(IGESControl_Controller,XSControl_Controller) - private: + protected: + + //! Initializes the use of IGES Norm (the first time) and returns + //! a Controller for IGES-5.1 + //! If is True, sets it to internal FNES format + Standard_EXPORT IGESControl_Controller(const Standard_Boolean modefnes = Standard_False); Standard_Boolean themode; }; diff --git a/src/IGESSelect/IGESSelect_FloatFormat.cxx b/src/IGESControl/IGESControl_FloatFormat.cxx similarity index 74% rename from src/IGESSelect/IGESSelect_FloatFormat.cxx rename to src/IGESControl/IGESControl_FloatFormat.cxx index ba3551db12..b942dea4dd 100644 --- a/src/IGESSelect/IGESSelect_FloatFormat.cxx +++ b/src/IGESControl/IGESControl_FloatFormat.cxx @@ -12,22 +12,20 @@ // commercial license or contractual agreement. -#include +#include #include -#include #include -#include -#include #include -IMPLEMENT_STANDARD_RTTIEXT(IGESSelect_FloatFormat,IGESSelect_FileModifier) +IMPLEMENT_STANDARD_RTTIEXT(IGESControl_FloatFormat,IFSelect_GeneralModifier) -IGESSelect_FloatFormat::IGESSelect_FloatFormat () - : thezerosup (Standard_True) , themainform ("%E") , - theformrange ("%f") , therangemin (0.1) , therangemax (1000.) - { } +IGESControl_FloatFormat::IGESControl_FloatFormat () +: IFSelect_GeneralModifier (Standard_False), + thezerosup (Standard_True) , themainform ("%E") , + theformrange ("%f") , therangemin (0.1) , therangemax (1000.) +{} - void IGESSelect_FloatFormat::SetDefault (const Standard_Integer digits) +void IGESControl_FloatFormat::SetDefault (const Standard_Integer digits) { themainform.Clear(); theformrange.Clear(); @@ -46,21 +44,17 @@ IGESSelect_FloatFormat::IGESSelect_FloatFormat () thezerosup = Standard_True; } - void IGESSelect_FloatFormat::SetZeroSuppress (const Standard_Boolean mode) - { thezerosup = mode; } +void IGESControl_FloatFormat::SetFormat (const Standard_CString format) +{ themainform.Clear(); themainform.AssignCat(format); } - void IGESSelect_FloatFormat::SetFormat (const Standard_CString format) - { themainform.Clear(); themainform.AssignCat(format); } - - - void IGESSelect_FloatFormat::SetFormatForRange +void IGESControl_FloatFormat::SetFormatForRange (const Standard_CString form, const Standard_Real R1, const Standard_Real R2) { theformrange.Clear(); theformrange.AssignCat(form); therangemin = R1; therangemax = R2; } - void IGESSelect_FloatFormat::Format +void IGESControl_FloatFormat::Format (Standard_Boolean& zerosup, TCollection_AsciiString& mainform, Standard_Boolean& hasrange, TCollection_AsciiString& formrange, Standard_Real& rangemin, Standard_Real& rangemax) const @@ -73,10 +67,7 @@ IGESSelect_FloatFormat::IGESSelect_FloatFormat () rangemax = therangemax; } - - void IGESSelect_FloatFormat::Perform - (IFSelect_ContextWrite& /*ctx*/, - IGESData_IGESWriter& writer) const +void IGESControl_FloatFormat::Perform (IGESData_IGESWriter& writer) const { writer.FloatWriter().SetFormat (themainform.ToCString()); writer.FloatWriter().SetZeroSuppress (thezerosup); @@ -84,7 +75,7 @@ IGESSelect_FloatFormat::IGESSelect_FloatFormat () (theformrange.ToCString(), therangemin, therangemax); } - TCollection_AsciiString IGESSelect_FloatFormat::Label () const +TCollection_AsciiString IGESControl_FloatFormat::Label () const { TCollection_AsciiString lab("Float Format "); if (thezerosup) lab.AssignCat(" ZeroSup "); diff --git a/src/IGESSelect/IGESSelect_FloatFormat.hxx b/src/IGESControl/IGESControl_FloatFormat.hxx similarity index 79% rename from src/IGESSelect/IGESSelect_FloatFormat.hxx rename to src/IGESControl/IGESControl_FloatFormat.hxx index 40e5d901f4..4c62f32d99 100644 --- a/src/IGESSelect/IGESSelect_FloatFormat.hxx +++ b/src/IGESControl/IGESControl_FloatFormat.hxx @@ -14,40 +14,31 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#ifndef _IGESSelect_FloatFormat_HeaderFile -#define _IGESSelect_FloatFormat_HeaderFile +#ifndef _IGESControl_FloatFormat_HeaderFile +#define _IGESControl_FloatFormat_HeaderFile #include #include -#include #include -#include -#include -#include -#include -class TCollection_AsciiString; -class IFSelect_ContextWrite; +#include class IGESData_IGESWriter; - -class IGESSelect_FloatFormat; -DEFINE_STANDARD_HANDLE(IGESSelect_FloatFormat, IGESSelect_FileModifier) +class IGESControl_FloatFormat; +DEFINE_STANDARD_HANDLE(IGESControl_FloatFormat, IFSelect_GeneralModifier) //! This class gives control out format for floatting values : //! ZeroSuppress or no, Main Format, Format in Range (for values //! around 1.), as IGESWriter allows to manage it. //! Formats are given under C-printf form -class IGESSelect_FloatFormat : public IGESSelect_FileModifier +class IGESControl_FloatFormat : public IFSelect_GeneralModifier { + public: -public: - - //! Creates a new FloatFormat, with standard options : //! ZeroSuppress, Main Format = %E, //! Format between 0.001 and 1000. = %f - Standard_EXPORT IGESSelect_FloatFormat(); + Standard_EXPORT IGESControl_FloatFormat(); //! Sets FloatFormat to default value (see Create) but if //! is given positive, it commands Formats (main and range) to @@ -55,7 +46,7 @@ public: Standard_EXPORT void SetDefault (const Standard_Integer digits = 0); //! Sets ZeroSuppress mode to a new value - Standard_EXPORT void SetZeroSuppress (const Standard_Boolean mode); + void SetZeroSuppress (const Standard_Boolean mode) { thezerosup = mode; } //! Sets Main Format to a new value //! Remark : SetFormat, SetZeroSuppress and SetFormatForRange are @@ -84,38 +75,21 @@ public: //! Sets the Floatting Formats of IGESWriter to the recorded //! parameters - Standard_EXPORT void Perform (IFSelect_ContextWrite& ctx, IGESData_IGESWriter& writer) const Standard_OVERRIDE; + Standard_EXPORT void Perform (IGESData_IGESWriter& writer) const; //! Returns specific Label : for instance, //! "Float Format [ZeroSuppress] %E [, in range R1-R2 %f]" Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE; + DEFINE_STANDARD_RTTIEXT(IGESControl_FloatFormat,IFSelect_GeneralModifier) - - - DEFINE_STANDARD_RTTIEXT(IGESSelect_FloatFormat,IGESSelect_FileModifier) - -protected: - - - - -private: - + private: Standard_Boolean thezerosup; TCollection_AsciiString themainform; TCollection_AsciiString theformrange; Standard_Real therangemin; Standard_Real therangemax; - - }; - - - - - - -#endif // _IGESSelect_FloatFormat_HeaderFile +#endif // _IGESControl_FloatFormat_HeaderFile diff --git a/src/IGESControl/IGESControl_Reader.cxx b/src/IGESControl/IGESControl_Reader.cxx index 35e134940c..1eac509560 100644 --- a/src/IGESControl/IGESControl_Reader.cxx +++ b/src/IGESControl/IGESControl_Reader.cxx @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -42,7 +41,6 @@ #include #include #include -#include #include #include #include @@ -56,6 +54,7 @@ //function : IGESControl_Reader //purpose : //======================================================================= + IGESControl_Reader::IGESControl_Reader () { IGESControl_Controller::Init(); @@ -147,7 +146,7 @@ void IGESControl_Reader::PrintTransferInfo if (! model.IsNull()) { nbEntities = model->NbEntities(); nbRoots = TP->NbRoots(); - Transfer_IteratorOfProcessForTransient iterTrans = TP->RootResult(Standard_True); + Transfer_TransientProcess::Iterator iterTrans = TP->RootResult(Standard_True); Handle(Dico_DictionaryOfInteger) dicoCountResult = new Dico_DictionaryOfInteger; Handle(Dico_DictionaryOfInteger) dicoCountMapping = new Dico_DictionaryOfInteger; for (iterTrans.Start(); iterTrans.More() ; iterTrans.Next() ) { diff --git a/src/IGESSelect/IGESSelect_WorkLibrary.cxx b/src/IGESControl/IGESControl_WorkLibrary.cxx similarity index 78% rename from src/IGESSelect/IGESSelect_WorkLibrary.cxx rename to src/IGESControl/IGESControl_WorkLibrary.cxx index 8cc1bb5de4..91235d026e 100644 --- a/src/IGESSelect/IGESSelect_WorkLibrary.cxx +++ b/src/IGESControl/IGESControl_WorkLibrary.cxx @@ -15,8 +15,6 @@ #include #include #include -#include -#include #include #include #include @@ -24,44 +22,30 @@ #include #include #include -#include -#include -#include +#include +#include #include -#include #include #include #include -#include #include #include #include #include #include #include -#include -#include #include #include -IMPLEMENT_STANDARD_RTTIEXT(IGESSelect_WorkLibrary,IFSelect_WorkLibrary) +IMPLEMENT_STANDARD_RTTIEXT(IGESControl_WorkLibrary,IFSelect_WorkLibrary) -static int deja = 0; -static Handle(IGESData_FileProtocol) IGESProto; - - - IGESSelect_WorkLibrary::IGESSelect_WorkLibrary - (const Standard_Boolean modefnes) - : themodefnes (modefnes) +IGESControl_WorkLibrary::IGESControl_WorkLibrary (const Standard_Boolean modefnes) +: themodefnes (modefnes) { IGESSolid::Init(); IGESAppli::Init(); IGESDefs::Init(); - if (!deja) { - Handle(IGESSelect_Dumper) sesdump = new IGESSelect_Dumper; // ainsi,cestfait - deja = 1; - } SetDumpLevels (4,6); SetDumpHelp (0,"Only DNum"); SetDumpHelp (1,"DNum, IGES Type & Form"); @@ -72,7 +56,7 @@ static Handle(IGESData_FileProtocol) IGESProto; SetDumpHelp (6,"Complete + Transformed data"); } - Standard_Integer IGESSelect_WorkLibrary::ReadFile +Standard_Integer IGESControl_WorkLibrary::ReadFile (const Standard_CString name, Handle(Interface_InterfaceModel)& model, const Handle(Interface_Protocol)& protocol) const @@ -91,8 +75,7 @@ static Handle(IGESData_FileProtocol) IGESProto; return status; } - - Standard_Boolean IGESSelect_WorkLibrary::WriteFile +Standard_Boolean IGESControl_WorkLibrary::WriteFile (IFSelect_ContextWrite& ctx) const { Handle(Message_Messenger) sout = Message::DefaultMessenger(); @@ -115,13 +98,12 @@ static Handle(IGESData_FileProtocol) IGESProto; Standard_Integer nbmod = ctx.NbModifiers(); for (Standard_Integer numod = 1; numod <= nbmod; numod ++) { ctx.SetModifier (numod); - DeclareAndCast(IGESSelect_FileModifier,filemod,ctx.FileModifier()); - if (!filemod.IsNull()) filemod->Perform(ctx,VW); + DeclareAndCast(IGESControl_FloatFormat,filemod,ctx.FileModifier()); + if (!filemod.IsNull()) filemod->Perform(VW); // (impressions de mise au point) sout << " .. FileMod." << numod <<" "<< filemod->Label(); if (ctx.IsForAll()) sout << " (all model)"; else sout << " (" << ctx.NbEntities() << " entities)"; -// sout << flush; } // Envoi @@ -139,20 +121,7 @@ static Handle(IGESData_FileProtocol) IGESProto; return status; } - Handle(IGESData_Protocol) IGESSelect_WorkLibrary::DefineProtocol () -{ - if (!IGESProto.IsNull()) return IGESProto; - Handle(IGESData_Protocol) IGESProto1 = IGESSolid::Protocol(); - Handle(IGESData_Protocol) IGESProto2 = IGESAppli::Protocol(); -// Handle(IGESData_FileProtocol) IGESProto = new IGESData_FileProtocol; - IGESProto = new IGESData_FileProtocol; - IGESProto->Add(IGESProto1); - IGESProto->Add(IGESProto2); - return IGESProto; -} - - - void IGESSelect_WorkLibrary::DumpEntity +void IGESControl_WorkLibrary::DumpEntity (const Handle(Interface_InterfaceModel)& model, const Handle(Interface_Protocol)& protocol, const Handle(Standard_Transient)& entity, diff --git a/src/IGESSelect/IGESSelect_WorkLibrary.hxx b/src/IGESControl/IGESControl_WorkLibrary.hxx similarity index 71% rename from src/IGESSelect/IGESSelect_WorkLibrary.hxx rename to src/IGESControl/IGESControl_WorkLibrary.hxx index 8021194ada..c482cc8118 100644 --- a/src/IGESSelect/IGESSelect_WorkLibrary.hxx +++ b/src/IGESControl/IGESControl_WorkLibrary.hxx @@ -14,37 +14,30 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#ifndef _IGESSelect_WorkLibrary_HeaderFile -#define _IGESSelect_WorkLibrary_HeaderFile +#ifndef _IGESControl_WorkLibrary_HeaderFile +#define _IGESControl_WorkLibrary_HeaderFile #include #include -#include #include -#include -#include class Interface_InterfaceModel; class Interface_Protocol; class IFSelect_ContextWrite; -class IGESData_Protocol; -class Standard_Transient; class Message_Messenger; -class IGESSelect_WorkLibrary; -DEFINE_STANDARD_HANDLE(IGESSelect_WorkLibrary, IFSelect_WorkLibrary) +class IGESControl_WorkLibrary; +DEFINE_STANDARD_HANDLE(IGESControl_WorkLibrary, IFSelect_WorkLibrary) //! Performs Read and Write an IGES File with an IGES Model -class IGESSelect_WorkLibrary : public IFSelect_WorkLibrary +class IGESControl_WorkLibrary : public IFSelect_WorkLibrary { + public: -public: - - //! Creates a IGES WorkLibrary //! If is given as True, it will work for FNES - Standard_EXPORT IGESSelect_WorkLibrary(const Standard_Boolean modefnes = Standard_False); + Standard_EXPORT IGESControl_WorkLibrary(const Standard_Boolean modefnes = Standard_False); //! Reads a IGES File and returns a IGES Model (into ), //! or lets "Null" in case of Error @@ -55,36 +48,15 @@ public: //! Returns False (and writes no file) if is not for IGES Standard_EXPORT Standard_Boolean WriteFile (IFSelect_ContextWrite& ctx) const Standard_OVERRIDE; - //! Defines a protocol to be adequate for IGES - //! (encompasses ALL the IGES norm including IGESSolid, IGESAppli) - Standard_EXPORT static Handle(IGESData_Protocol) DefineProtocol(); - //! Dumps an IGES Entity with an IGES Dumper. is the one //! used by IGESDumper. Standard_EXPORT void DumpEntity (const Handle(Interface_InterfaceModel)& model, const Handle(Interface_Protocol)& protocol, const Handle(Standard_Transient)& entity, const Handle(Message_Messenger)& S, const Standard_Integer level) const Standard_OVERRIDE; + DEFINE_STANDARD_RTTIEXT(IGESControl_WorkLibrary,IFSelect_WorkLibrary) - - - DEFINE_STANDARD_RTTIEXT(IGESSelect_WorkLibrary,IFSelect_WorkLibrary) - -protected: - - - - -private: - + private: Standard_Boolean themodefnes; - - }; - - - - - - -#endif // _IGESSelect_WorkLibrary_HeaderFile +#endif // _IGESControl_WorkLibrary_HeaderFile diff --git a/src/IGESControl/IGESControl_Writer.cxx b/src/IGESControl/IGESControl_Writer.cxx index a5f4f65d91..da4db26414 100644 --- a/src/IGESControl/IGESControl_Writer.cxx +++ b/src/IGESControl/IGESControl_Writer.cxx @@ -34,14 +34,12 @@ #include #include #include -#include #include #include #include #include #include #include -#include #include #include #include @@ -55,7 +53,7 @@ IGESControl_Writer::IGESControl_Writer () { // faudrait aussi (?) prendre les parametres par defaut ... ? IGESControl_Controller::Init(); - myEditor.Init(IGESSelect_WorkLibrary::DefineProtocol()); + myEditor.Init(IGESControl_Controller::DefineProtocol()); myEditor.SetUnitName(Interface_Static::CVal ("write.iges.unit")); myEditor.ApplyUnit(); myWriteMode = Interface_Static::IVal ("write.iges.brep.mode"); @@ -69,7 +67,7 @@ IGESControl_Writer::IGESControl_Writer { // faudrait aussi (?) prendre les parametres par defaut ... ? IGESControl_Controller::Init(); - myEditor.Init(IGESSelect_WorkLibrary::DefineProtocol()); + myEditor.Init(IGESControl_Controller::DefineProtocol()); myEditor.SetUnitName(unit); myEditor.ApplyUnit(); myModel = myEditor.Model(); @@ -79,7 +77,7 @@ IGESControl_Writer::IGESControl_Writer (const Handle(IGESData_IGESModel)& model, const Standard_Integer modecr) : myTP (new Transfer_FinderProcess(10000)) , myModel (model) , - myEditor (model,IGESSelect_WorkLibrary::DefineProtocol()) , + myEditor (model,IGESControl_Controller::DefineProtocol()) , myWriteMode (modecr) , myIsComputed (Standard_False) { } Standard_Boolean IGESControl_Writer::AddShape (const TopoDS_Shape& theShape) @@ -212,7 +210,7 @@ Standard_Boolean IGESControl_Writer::AddGeom (const Handle(Standard_Transient)& Standard_Boolean IGESControl_Writer::AddEntity (const Handle(IGESData_IGESEntity)& ent) { if (ent.IsNull()) return Standard_False; - myModel->AddWithRefs(ent,IGESSelect_WorkLibrary::DefineProtocol()); + myModel->AddWithRefs(ent,IGESControl_Controller::DefineProtocol()); myIsComputed = Standard_False; return Standard_True; } @@ -239,7 +237,7 @@ Standard_Boolean IGESControl_Writer::Write return Standard_False; IGESData_IGESWriter IW (myModel); // ne pas oublier le mode fnes ... a transmettre a IW - IW.SendModel (IGESSelect_WorkLibrary::DefineProtocol()); + IW.SendModel (IGESControl_Controller::DefineProtocol()); #ifdef OCCT_DEBUG cout<<" ... ecriture ..."< #include -static Handle(IGESData_Protocol) proto; + +static Handle(IGESData_Protocol) gIGESProto; +static Handle(IGESData_IGESModel) gIGESModel; static Handle(IGESData_DefaultGeneral) stmod; static Handle(IGESData_DefaultSpecific) speci; - - void IGESData::Init () +void IGESData::Init () { - if (proto.IsNull()) proto = new IGESData_Protocol; + if (gIGESProto.IsNull()) gIGESProto = new IGESData_Protocol; if (stmod.IsNull()) stmod = new IGESData_DefaultGeneral; if (speci.IsNull()) speci = new IGESData_DefaultSpecific; -// et modele template "iges" - if (Interface_InterfaceModel::HasTemplate("iges")) return; + + // et modele template "iges" + if (!gIGESModel.IsNull()) return; OSD_Process process; @@ -140,52 +142,17 @@ static Handle(IGESData_DefaultSpecific) speci; //---------------------------- IGESData_GlobalSection GS; + //#58 rln 28.12.98 changing default values for Global Section char procver[80]; sprintf (procver, XSTEP_PROCESSOR_VERSION, "IGES"); Handle(TCollection_HAsciiString) gsys = new TCollection_HAsciiString (procver); Interface_Static::Init ("XSTEP","write.iges.header.product" ,'t',procver); -/* Handle(TCollection_HAsciiString) gsys = new TCollection_HAsciiString - (XSTEP_VERSION); - gsys->AssignCat(" on "); - gsys->AssignCat -#ifdef HPUX - ("HP-UX"); - cout<<"-- OSD_Path::SystemVersion, does not work well on HP-UX"<AssignCat(" "); - lstat = sysinfo (SI_ARCHITECTURE,nomsys,99); - gsys->AssignCat(nomsys); - gsys->AssignCat("/"); - gsys->AssignCat(infosy.sysname); - gsys->AssignCat(" "); - gsys->AssignCat(infosy.release); -*/ - Standard_Integer year; //gka 19.01.99 OSD_Process system; Quantity_Date ladate = system.SystemDate(); - year = ladate.Year(); - Handle(TCollection_HAsciiString) datestr; - if( year < 2000 ) - //#65 rln 12.02.99 S4151 (explicitly force YYMMDD.HHMMSS before Y2000) - datestr = GS.NewDateString(0,0,0,0,0,0,0); - else - //#65 rln 12.02.99 S4151 (explicitly force YYYYMMDD.HHMMSS after Y2000) - datestr = GS.NewDateString(0,0,0,0,0,0,-1); + const Standard_Integer year = ladate.Year(); + Handle(TCollection_HAsciiString) datestr = GS.NewDateString(0,0,0,0,0,0,( year < 2000 ? 0 : -1 )); //#65 rln 12.02.99 S4151 (explicitly force YYYYMMDD.HHMMSS after Y2000) GS.SetSeparator (','); GS.SetEndMark (';'); GS.SetSendName (new TCollection_HAsciiString(Interface_Static::CVal("write.iges.header.product"))); @@ -198,7 +165,6 @@ static Handle(IGESData_DefaultSpecific) speci; GS.SetMaxPower10Double ( RealLast10Exp() ); GS.SetMaxDigitsDouble ( RealDigits() ); GS.SetReceiveName (Interface_Static::Static("write.iges.header.receiver")->HStringValue()); -// new TCollection_HAsciiString("Unknown"); GS.SetScale (1.0); GS.SetUnitFlag (Interface_Static::IVal("write.iges.unit")); GS.SetUnitName (new TCollection_HAsciiString(Interface_Static::CVal("write.iges.unit"))); @@ -208,26 +174,28 @@ static Handle(IGESData_DefaultSpecific) speci; GS.SetResolution (0.0001); GS.SetMaxCoord (0.0 /*1000.0*/);//22.10.98 rln BUC60081 GS.SetAuthorName (Interface_Static::Static("write.iges.header.author")->HStringValue()); -// new TCollection_HAsciiString (process.UserName()); GS.SetCompanyName (Interface_Static::Static("write.iges.header.company")->HStringValue()); -// new TCollection_HAsciiString("Matra Datavision"); GS.SetIGESVersion (11); // pour IGES-5.3 //gka 19.01.99 GS.SetDraftingStandard (0); GS.SetLastChangeDate (datestr); GS.SetApplicationProtocol(new TCollection_HAsciiString("")); //gka 19.01.99 -// Interface_Check check; -// GS.Init(params, check); - // Creating the Model //------------------- - Handle(IGESData_IGESModel) model = new IGESData_IGESModel; - model->SetGlobalSection(GS); - Interface_InterfaceModel::SetTemplate ("iges", model); + gIGESModel = new IGESData_IGESModel; + gIGESModel->SetGlobalSection(GS); +} + +const Handle(IGESData_Protocol) & IGESData::Protocol () +{ + return gIGESProto; } - Handle(IGESData_Protocol) IGESData::Protocol () +Handle(IGESData_IGESModel) IGESData::NewModel () { - return proto; + if (gIGESModel.IsNull()) return NULL; + Handle(Interface_InterfaceModel) newmod = gIGESModel->NewEmptyModel(); + newmod->GetFromAnother (gIGESModel); + return Handle(IGESData_IGESModel)::DownCast(newmod); } diff --git a/src/IGESData/IGESData.hxx b/src/IGESData/IGESData.hxx index 51466e4541..655c512d5a 100644 --- a/src/IGESData/IGESData.hxx +++ b/src/IGESData/IGESData.hxx @@ -18,126 +18,24 @@ #define _IGESData_HeaderFile #include -#include #include - -class IGESData_Protocol; class IGESData_Protocol; class IGESData_IGESModel; -class IGESData_IGESEntity; -class IGESData_LineFontEntity; -class IGESData_LevelListEntity; -class IGESData_TransfEntity; -class IGESData_ViewKindEntity; -class IGESData_LabelDisplayEntity; -class IGESData_ColorEntity; -class IGESData_NameEntity; -class IGESData_SingleParentEntity; -class IGESData_UndefinedEntity; -class IGESData_FreeFormatEntity; -class IGESData_GlobalSection; -class IGESData_DefSwitch; -class IGESData_DirChecker; -class IGESData_IGESReaderData; -class IGESData_IGESReaderTool; -class IGESData_ParamReader; -class IGESData_ParamCursor; -class IGESData_DirPart; -class IGESData_IGESType; -class IGESData_FileRecognizer; -class IGESData_IGESWriter; -class IGESData_IGESDumper; -class IGESData_BasicEditor; -class IGESData_ToolLocation; -class IGESData_GeneralModule; -class IGESData_DefaultGeneral; -class IGESData_ReadWriteModule; -class IGESData_SpecificModule; -class IGESData_DefaultSpecific; -class IGESData_FileProtocol; -class IGESData_WriterLib; -class IGESData_SpecificLib; -class IGESData_GlobalNodeOfWriterLib; -class IGESData_NodeOfWriterLib; -class IGESData_GlobalNodeOfSpecificLib; -class IGESData_NodeOfSpecificLib; - //! basic description of an IGES Interface class IGESData { -public: - - DEFINE_STANDARD_ALLOC + public: - //! Prepares General dynamic data used for IGESData specifically : //! Protocol and Modules, which treat UndefinedEntity Standard_EXPORT static void Init(); //! Returns a Protocol from IGESData (avoids to create it) - Standard_EXPORT static Handle(IGESData_Protocol) Protocol(); - - - - -protected: - - - - - -private: - - - - -friend class IGESData_Protocol; -friend class IGESData_IGESModel; -friend class IGESData_IGESEntity; -friend class IGESData_LineFontEntity; -friend class IGESData_LevelListEntity; -friend class IGESData_TransfEntity; -friend class IGESData_ViewKindEntity; -friend class IGESData_LabelDisplayEntity; -friend class IGESData_ColorEntity; -friend class IGESData_NameEntity; -friend class IGESData_SingleParentEntity; -friend class IGESData_UndefinedEntity; -friend class IGESData_FreeFormatEntity; -friend class IGESData_GlobalSection; -friend class IGESData_DefSwitch; -friend class IGESData_DirChecker; -friend class IGESData_IGESReaderData; -friend class IGESData_IGESReaderTool; -friend class IGESData_ParamReader; -friend class IGESData_ParamCursor; -friend class IGESData_DirPart; -friend class IGESData_IGESType; -friend class IGESData_FileRecognizer; -friend class IGESData_IGESWriter; -friend class IGESData_IGESDumper; -friend class IGESData_BasicEditor; -friend class IGESData_ToolLocation; -friend class IGESData_GeneralModule; -friend class IGESData_DefaultGeneral; -friend class IGESData_ReadWriteModule; -friend class IGESData_SpecificModule; -friend class IGESData_DefaultSpecific; -friend class IGESData_FileProtocol; -friend class IGESData_WriterLib; -friend class IGESData_SpecificLib; -friend class IGESData_GlobalNodeOfWriterLib; -friend class IGESData_NodeOfWriterLib; -friend class IGESData_GlobalNodeOfSpecificLib; -friend class IGESData_NodeOfSpecificLib; - + Standard_EXPORT static const Handle(IGESData_Protocol) & Protocol(); + + //! Returns a Protocol from IGESData (avoids to create it) + Standard_EXPORT static Handle(IGESData_IGESModel) NewModel (); }; - - - - - - #endif // _IGESData_HeaderFile diff --git a/src/IGESData/IGESData_BasicEditor.cxx b/src/IGESData/IGESData_BasicEditor.cxx index 067c34a425..82d22e6813 100644 --- a/src/IGESData/IGESData_BasicEditor.cxx +++ b/src/IGESData/IGESData_BasicEditor.cxx @@ -13,6 +13,7 @@ //#73 rln 10.03.99 S4135: "read.scale.unit" does not affect GlobalSection +#include #include #include #include @@ -53,7 +54,7 @@ void IGESData_BasicEditor::Init (const Handle(IGESData_Protocol)& protocol) { theunit = Standard_False; theproto = protocol; - themodel = GetCasted(IGESData_IGESModel,Interface_InterfaceModel::Template("iges")); + themodel = IGESData::NewModel(); theglib = Interface_GeneralLib (protocol); theslib = protocol; } @@ -154,7 +155,7 @@ Standard_Boolean IGESData_BasicEditor::SetUnitName (const Standard_CString name) Standard_Integer nb = themodel->NbEntities(); if (nb == 0) return; TColStd_Array1OfInteger subs (0,nb); subs.Init(0); // gere Subordinate Status - Interface_Graph G (themodel,theglib); // gere & memorise UseFlag + Interface_Graph G (themodel); // gere & memorise UseFlag G.ResetStatus(); // 2 phases : d abord on fait un calcul d ensemble. Ensuite on applique diff --git a/src/IGESSelect/FILES b/src/IGESSelect/FILES index 71be221396..b8879a4911 100644 --- a/src/IGESSelect/FILES +++ b/src/IGESSelect/FILES @@ -1,9 +1,3 @@ -IGESSelect.cxx -IGESSelect.hxx -IGESSelect_Activator.cxx -IGESSelect_Activator.hxx -IGESSelect_AddFileComment.cxx -IGESSelect_AddFileComment.hxx IGESSelect_AddGroup.cxx IGESSelect_AddGroup.hxx IGESSelect_AutoCorrect.cxx @@ -26,10 +20,6 @@ IGESSelect_EditDirPart.cxx IGESSelect_EditDirPart.hxx IGESSelect_EditHeader.cxx IGESSelect_EditHeader.hxx -IGESSelect_FileModifier.hxx -IGESSelect_FileModifier_0.cxx -IGESSelect_FloatFormat.cxx -IGESSelect_FloatFormat.hxx IGESSelect_IGESName.cxx IGESSelect_IGESName.hxx IGESSelect_IGESTypeForm.cxx @@ -90,5 +80,3 @@ IGESSelect_UpdateLastChange.cxx IGESSelect_UpdateLastChange.hxx IGESSelect_ViewSorter.cxx IGESSelect_ViewSorter.hxx -IGESSelect_WorkLibrary.cxx -IGESSelect_WorkLibrary.hxx diff --git a/src/IGESSelect/IGESSelect.cxx b/src/IGESSelect/IGESSelect.cxx deleted file mode 100644 index 6ce03026bf..0000000000 --- a/src/IGESSelect/IGESSelect.cxx +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -void IGESSelect::Run () -{ -// Handle(IFSelect_BasicActivator) Activator = new IFSelect_BasicActivator; - IFSelect_Functions::Init(); - Handle(IFSelect_SessionPilot) pilot = new IFSelect_SessionPilot("XSTEP-IGES>"); - Handle(IGESSelect_Activator) igesact = new IGESSelect_Activator; - pilot->SetSession (new IFSelect_WorkSession ( )); - pilot->SetLibrary (new IGESSelect_WorkLibrary); - - pilot->ReadScript(); -} - - -Standard_Integer IGESSelect::WhatIges - (const Handle(IGESData_IGESEntity)& ent, const Interface_Graph& G, - Handle(IGESData_IGESEntity)& /* sup */, Standard_Integer& /* index */) -{ - Handle(IGESData_IGESEntity) igesent = ent; - if (igesent.IsNull()) return Standard_False; -// Standard_Integer igt = igesent->TypeNumber(); - DeclareAndCast(IGESData_IGESModel,model,G.Model()); - if (igesent.IsNull() || model.IsNull()) return 0; - -// Plane : de View ? de SingleParent ? sinon cf TrimmedSurface & cie - - - - return 0; -} diff --git a/src/IGESSelect/IGESSelect.hxx b/src/IGESSelect/IGESSelect.hxx deleted file mode 100644 index 79ccf82cfc..0000000000 --- a/src/IGESSelect/IGESSelect.hxx +++ /dev/null @@ -1,169 +0,0 @@ -// Created on: 1994-05-31 -// Created by: Christian CAILLET -// Copyright (c) 1994-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESSelect_HeaderFile -#define _IGESSelect_HeaderFile - -#include -#include -#include - -#include -class IGESData_IGESEntity; -class Interface_Graph; -class IGESSelect_EditHeader; -class IGESSelect_EditDirPart; -class IGESSelect_IGESTypeForm; -class IGESSelect_IGESName; -class IGESSelect_SignStatus; -class IGESSelect_SignLevelNumber; -class IGESSelect_SignColor; -class IGESSelect_CounterOfLevelNumber; -class IGESSelect_ViewSorter; -class IGESSelect_DispPerSingleView; -class IGESSelect_DispPerDrawing; -class IGESSelect_SelectVisibleStatus; -class IGESSelect_SelectSubordinate; -class IGESSelect_SelectLevelNumber; -class IGESSelect_SelectName; -class IGESSelect_SelectFromSingleView; -class IGESSelect_SelectFromDrawing; -class IGESSelect_SelectSingleViewFrom; -class IGESSelect_SelectDrawingFrom; -class IGESSelect_SelectBypassGroup; -class IGESSelect_SelectBypassSubfigure; -class IGESSelect_SelectBasicGeom; -class IGESSelect_SelectFaces; -class IGESSelect_SelectPCurves; -class IGESSelect_ModelModifier; -class IGESSelect_FileModifier; -class IGESSelect_FloatFormat; -class IGESSelect_AddFileComment; -class IGESSelect_UpdateFileName; -class IGESSelect_UpdateCreationDate; -class IGESSelect_UpdateLastChange; -class IGESSelect_SetVersion5; -class IGESSelect_SetGlobalParameter; -class IGESSelect_AutoCorrect; -class IGESSelect_ComputeStatus; -class IGESSelect_RebuildDrawings; -class IGESSelect_RebuildGroups; -class IGESSelect_AddGroup; -class IGESSelect_ChangeLevelNumber; -class IGESSelect_ChangeLevelList; -class IGESSelect_SplineToBSpline; -class IGESSelect_RemoveCurves; -class IGESSelect_SetLabel; -class IGESSelect_WorkLibrary; -class IGESSelect_Activator; -class IGESSelect_Dumper; - - -//! This package defines the library of the most used tools for -//! IGES Files : Selections & Modifiers specific to the IGES norm, -//! and the most needed converters -class IGESSelect -{ -public: - - DEFINE_STANDARD_ALLOC - - - //! Simply gives a prompt for a conversational action on standard - //! input/output. Returns the status of a - Standard_EXPORT static void Run(); - - //! Gives a quick analysis of an IGES Entity in the context of a - //! model (i.e. a File) described by a Graph. - //! Returned values are : - //! : the most meaningfull super entity, if any (else Null) - //! : meaningfull index relating to super entity, if any - //! : a status which helps exploitation of , by - //! giving a case - //! (normally, types of and should suffice to - //! known the case) - Standard_EXPORT static Standard_Integer WhatIges (const Handle(IGESData_IGESEntity)& ent, const Interface_Graph& G, Handle(IGESData_IGESEntity)& sup, Standard_Integer& index); - - - - -protected: - - - - - -private: - - - - -friend class IGESSelect_EditHeader; -friend class IGESSelect_EditDirPart; -friend class IGESSelect_IGESTypeForm; -friend class IGESSelect_IGESName; -friend class IGESSelect_SignStatus; -friend class IGESSelect_SignLevelNumber; -friend class IGESSelect_SignColor; -friend class IGESSelect_CounterOfLevelNumber; -friend class IGESSelect_ViewSorter; -friend class IGESSelect_DispPerSingleView; -friend class IGESSelect_DispPerDrawing; -friend class IGESSelect_SelectVisibleStatus; -friend class IGESSelect_SelectSubordinate; -friend class IGESSelect_SelectLevelNumber; -friend class IGESSelect_SelectName; -friend class IGESSelect_SelectFromSingleView; -friend class IGESSelect_SelectFromDrawing; -friend class IGESSelect_SelectSingleViewFrom; -friend class IGESSelect_SelectDrawingFrom; -friend class IGESSelect_SelectBypassGroup; -friend class IGESSelect_SelectBypassSubfigure; -friend class IGESSelect_SelectBasicGeom; -friend class IGESSelect_SelectFaces; -friend class IGESSelect_SelectPCurves; -friend class IGESSelect_ModelModifier; -friend class IGESSelect_FileModifier; -friend class IGESSelect_FloatFormat; -friend class IGESSelect_AddFileComment; -friend class IGESSelect_UpdateFileName; -friend class IGESSelect_UpdateCreationDate; -friend class IGESSelect_UpdateLastChange; -friend class IGESSelect_SetVersion5; -friend class IGESSelect_SetGlobalParameter; -friend class IGESSelect_AutoCorrect; -friend class IGESSelect_ComputeStatus; -friend class IGESSelect_RebuildDrawings; -friend class IGESSelect_RebuildGroups; -friend class IGESSelect_AddGroup; -friend class IGESSelect_ChangeLevelNumber; -friend class IGESSelect_ChangeLevelList; -friend class IGESSelect_SplineToBSpline; -friend class IGESSelect_RemoveCurves; -friend class IGESSelect_SetLabel; -friend class IGESSelect_WorkLibrary; -friend class IGESSelect_Activator; -friend class IGESSelect_Dumper; - -}; - - - - - - - -#endif // _IGESSelect_HeaderFile diff --git a/src/IGESSelect/IGESSelect_AddFileComment.cxx b/src/IGESSelect/IGESSelect_AddFileComment.cxx deleted file mode 100644 index 835208820a..0000000000 --- a/src/IGESSelect/IGESSelect_AddFileComment.cxx +++ /dev/null @@ -1,69 +0,0 @@ -// Created on: 1994-08-26 -// Created by: Christian CAILLET -// Copyright (c) 1994-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include -#include -#include -#include - -#include -IMPLEMENT_STANDARD_RTTIEXT(IGESSelect_AddFileComment,IGESSelect_FileModifier) - -IGESSelect_AddFileComment::IGESSelect_AddFileComment () - { thelist = new TColStd_HSequenceOfHAsciiString(); } - - void IGESSelect_AddFileComment::Clear () - { thelist->Clear(); } - - - void IGESSelect_AddFileComment::AddLine (const Standard_CString line) - { thelist->Append (new TCollection_HAsciiString(line)); } - - void IGESSelect_AddFileComment::AddLines - (const Handle(TColStd_HSequenceOfHAsciiString)& lines) - { thelist->Append (lines); } - - Standard_Integer IGESSelect_AddFileComment::NbLines () const - { return thelist->Length(); } - - Standard_CString IGESSelect_AddFileComment::Line - (const Standard_Integer num) const - { return thelist->Value(num)->ToCString(); } - - Handle(TColStd_HSequenceOfHAsciiString) IGESSelect_AddFileComment::Lines - () const - { return thelist; } - - void IGESSelect_AddFileComment::Perform - (IFSelect_ContextWrite& , - IGESData_IGESWriter& writer) const -{ - Standard_Integer i, nb = NbLines(); - for (i = 1; i <= nb; i ++) { - writer.SendStartLine (Line(i)); - } -} - - TCollection_AsciiString IGESSelect_AddFileComment::Label () const -{ - Standard_Integer nb = NbLines(); - char labl[80]; - sprintf (labl, "Add %d Comment Lines (Start Section)",nb); - return TCollection_AsciiString (labl); -} diff --git a/src/IGESSelect/IGESSelect_AddFileComment.hxx b/src/IGESSelect/IGESSelect_AddFileComment.hxx deleted file mode 100644 index f829277e4d..0000000000 --- a/src/IGESSelect/IGESSelect_AddFileComment.hxx +++ /dev/null @@ -1,99 +0,0 @@ -// Created on: 1994-08-26 -// Created by: Christian CAILLET -// Copyright (c) 1994-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESSelect_AddFileComment_HeaderFile -#define _IGESSelect_AddFileComment_HeaderFile - -#include -#include - -#include -#include -#include -#include -class IFSelect_ContextWrite; -class IGESData_IGESWriter; -class TCollection_AsciiString; - - -class IGESSelect_AddFileComment; -DEFINE_STANDARD_HANDLE(IGESSelect_AddFileComment, IGESSelect_FileModifier) - -//! This class allows to add comment lines on writing an IGES File -//! These lines are added to Start Section, instead of the only -//! one blank line written by default. -class IGESSelect_AddFileComment : public IGESSelect_FileModifier -{ - -public: - - - //! Creates a new emoty AddFileComment. Use AddLine to complete it - Standard_EXPORT IGESSelect_AddFileComment(); - - //! Clears the list of file comment lines already stored - Standard_EXPORT void Clear(); - - //! Adds a line for file comment - //! Remark : Lines are limited to 72 useful char.s . A line of more than - //! 72 char.s will be splited into several ones of 72 max each. - Standard_EXPORT void AddLine (const Standard_CString line); - - //! Adds a list of lines for file comment - //! Each of them must comply with demand of AddLine - Standard_EXPORT void AddLines (const Handle(TColStd_HSequenceOfHAsciiString)& lines); - - //! Returns the count of stored lines - Standard_EXPORT Standard_Integer NbLines() const; - - //! Returns a stored line given its rank - Standard_EXPORT Standard_CString Line (const Standard_Integer num) const; - - //! Returns the complete list of lines in once - Standard_EXPORT Handle(TColStd_HSequenceOfHAsciiString) Lines() const; - - //! Sends the comment lines to the file (Start Section) - Standard_EXPORT void Perform (IFSelect_ContextWrite& ctx, IGESData_IGESWriter& writer) const Standard_OVERRIDE; - - //! Returns specific Label, which is - //! "Add Comment Lines (Start Section)" - Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(IGESSelect_AddFileComment,IGESSelect_FileModifier) - -protected: - - - - -private: - - - Handle(TColStd_HSequenceOfHAsciiString) thelist; - - -}; - - - - - - - -#endif // _IGESSelect_AddFileComment_HeaderFile diff --git a/src/IGESSelect/IGESSelect_Dumper.cxx b/src/IGESSelect/IGESSelect_Dumper.cxx index 8e8241fb19..5b7882bf5c 100644 --- a/src/IGESSelect/IGESSelect_Dumper.cxx +++ b/src/IGESSelect/IGESSelect_Dumper.cxx @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include @@ -46,10 +46,6 @@ #include IMPLEMENT_STANDARD_RTTIEXT(IGESSelect_Dumper,IFSelect_SessionDumper) -//#include -IGESSelect_Dumper::IGESSelect_Dumper () { } - - Standard_Boolean IGESSelect_Dumper::WriteOwn (IFSelect_SessionFile& file, const Handle(Standard_Transient)& item) const { @@ -85,8 +81,8 @@ IGESSelect_Dumper::IGESSelect_Dumper () { } if (type == STANDARD_TYPE(IGESSelect_SelectDrawingFrom)) return Standard_True; if (type == STANDARD_TYPE(IGESSelect_SelectBypassGroup)) return Standard_True; - if (type == STANDARD_TYPE(IGESSelect_FloatFormat)) { - DeclareAndCast(IGESSelect_FloatFormat,ff,item); + if (type == STANDARD_TYPE(IGESControl_FloatFormat)) { + DeclareAndCast(IGESControl_FloatFormat,ff,item); Standard_Boolean zerosup, hasrange; Standard_Real rangemin, rangemax; TCollection_AsciiString mainform,forminrange; @@ -197,9 +193,9 @@ IGESSelect_Dumper::IGESSelect_Dumper () { } if (type.IsEqual("IGESSelect_SelectBypassGroup")) { item = new IGESSelect_SelectBypassGroup; return Standard_True; } - if (type.IsEqual("IGESSelect_FloatFormat")) { + if (type.IsEqual("IGESControl_FloatFormat")) { if (file.NbParams() < 2) return Standard_False; - Handle(IGESSelect_FloatFormat) ff = new IGESSelect_FloatFormat; + Handle(IGESControl_FloatFormat) ff = new IGESControl_FloatFormat; Standard_Boolean zerosup; const TCollection_AsciiString zsup = file.ParamValue(1); if (zsup.Length() < 1) return Standard_False; diff --git a/src/IGESSelect/IGESSelect_Dumper.hxx b/src/IGESSelect/IGESSelect_Dumper.hxx index 3253bc5c1f..5d5c704f6f 100644 --- a/src/IGESSelect/IGESSelect_Dumper.hxx +++ b/src/IGESSelect/IGESSelect_Dumper.hxx @@ -21,12 +21,9 @@ #include #include -#include class IFSelect_SessionFile; -class Standard_Transient; class TCollection_AsciiString; - class IGESSelect_Dumper; DEFINE_STANDARD_HANDLE(IGESSelect_Dumper, IFSelect_SessionDumper) @@ -35,13 +32,11 @@ DEFINE_STANDARD_HANDLE(IGESSelect_Dumper, IFSelect_SessionDumper) //! Dispatches, Modifiers class IGESSelect_Dumper : public IFSelect_SessionDumper { + public: -public: - - //! Creates a Dumper and puts it into the Library of Dumper - Standard_EXPORT IGESSelect_Dumper(); - + IGESSelect_Dumper() {} + //! Write the Own Parameters of Types defined in package IGESSelect //! Returns True if has been processed, False else Standard_EXPORT Standard_Boolean WriteOwn (IFSelect_SessionFile& file, const Handle(Standard_Transient)& item) const Standard_OVERRIDE; @@ -50,27 +45,7 @@ public: //! IGESSelect. Returns True if done and created, False else Standard_EXPORT Standard_Boolean ReadOwn (IFSelect_SessionFile& file, const TCollection_AsciiString& type, Handle(Standard_Transient)& item) const Standard_OVERRIDE; - - - DEFINE_STANDARD_RTTIEXT(IGESSelect_Dumper,IFSelect_SessionDumper) - -protected: - - - - -private: - - - - }; - - - - - - #endif // _IGESSelect_Dumper_HeaderFile diff --git a/src/IGESSelect/IGESSelect_FileModifier.hxx b/src/IGESSelect/IGESSelect_FileModifier.hxx deleted file mode 100644 index 8b1040a952..0000000000 --- a/src/IGESSelect/IGESSelect_FileModifier.hxx +++ /dev/null @@ -1,75 +0,0 @@ -// Created on: 1994-05-31 -// Created by: Christian CAILLET -// Copyright (c) 1994-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _IGESSelect_FileModifier_HeaderFile -#define _IGESSelect_FileModifier_HeaderFile - -#include -#include - -#include -class IGESData_IGESWriter; -class IFSelect_ContextWrite; - - -class IGESSelect_FileModifier; -DEFINE_STANDARD_HANDLE(IGESSelect_FileModifier, IFSelect_GeneralModifier) - - -class IGESSelect_FileModifier : public IFSelect_GeneralModifier -{ - -public: - - - //! Perform the action specific to each class of File Modifier - //! is the ContextWrite, which brings : the model, the - //! protocol, the file name, plus the object AppliedModifiers - //! (not used here) and the CheckList - //! Remark that the model has to be casted for specific access - //! - //! is the Writer and is specific to each norm, on which - //! to act - Standard_EXPORT virtual void Perform (IFSelect_ContextWrite& ctx, IGESData_IGESWriter& writer) const = 0; - - - - - DEFINE_STANDARD_RTTI_INLINE(IGESSelect_FileModifier,IFSelect_GeneralModifier) - -protected: - - - //! Sets a File Modifier to keep the graph of dependences - //! unchanges (because it works on the model already produced) - Standard_EXPORT IGESSelect_FileModifier(); - - - -private: - - - - -}; - - - - - - - -#endif // _IGESSelect_FileModifier_HeaderFile diff --git a/src/IGESSelect/IGESSelect_FileModifier_0.cxx b/src/IGESSelect/IGESSelect_FileModifier_0.cxx deleted file mode 100644 index d14f35b4c4..0000000000 --- a/src/IGESSelect/IGESSelect_FileModifier_0.cxx +++ /dev/null @@ -1,39 +0,0 @@ -// Created on: 1994-05-31 -// Created by: Christian CAILLET -// Copyright (c) 1994-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#include - -#include - -#include -#include - - - - - - - - - - -#define Writer IGESData_IGESWriter -#define Writer_hxx -#define IFSelect_FileModifier IGESSelect_FileModifier -#define IFSelect_FileModifier_hxx -#define Handle_IFSelect_FileModifier Handle(IGESSelect_FileModifier) -#include - diff --git a/src/IGESSolid/IGESSolid.cxx b/src/IGESSolid/IGESSolid.cxx index ed5395c1b6..46de080422 100644 --- a/src/IGESSolid/IGESSolid.cxx +++ b/src/IGESSolid/IGESSolid.cxx @@ -27,9 +27,7 @@ // (Modules are created and loaded in appropriate libraries, once by Init) static Handle(IGESSolid_Protocol) protocol; - - - void IGESSolid::Init () +void IGESSolid::Init () { IGESGeom::Init(); if (protocol.IsNull()) { @@ -41,7 +39,7 @@ static Handle(IGESSolid_Protocol) protocol; } } - Handle(IGESSolid_Protocol) IGESSolid::Protocol () +const Handle(IGESSolid_Protocol) & IGESSolid::Protocol () { return protocol; } diff --git a/src/IGESSolid/IGESSolid.hxx b/src/IGESSolid/IGESSolid.hxx index b503d20a48..a8c7e4c25c 100644 --- a/src/IGESSolid/IGESSolid.hxx +++ b/src/IGESSolid/IGESSolid.hxx @@ -18,153 +18,20 @@ #define _IGESSolid_HeaderFile #include -#include #include - -class IGESSolid_Protocol; -class IGESSolid_Block; -class IGESSolid_RightAngularWedge; -class IGESSolid_Cylinder; -class IGESSolid_ConeFrustum; -class IGESSolid_Sphere; -class IGESSolid_Torus; -class IGESSolid_SolidOfRevolution; -class IGESSolid_SolidOfLinearExtrusion; -class IGESSolid_Ellipsoid; -class IGESSolid_BooleanTree; -class IGESSolid_SelectedComponent; -class IGESSolid_SolidAssembly; -class IGESSolid_ManifoldSolid; -class IGESSolid_PlaneSurface; -class IGESSolid_CylindricalSurface; -class IGESSolid_ConicalSurface; -class IGESSolid_SphericalSurface; -class IGESSolid_ToroidalSurface; -class IGESSolid_SolidInstance; -class IGESSolid_VertexList; -class IGESSolid_EdgeList; -class IGESSolid_Loop; -class IGESSolid_Face; -class IGESSolid_Shell; -class IGESSolid_ToolBlock; -class IGESSolid_ToolRightAngularWedge; -class IGESSolid_ToolCylinder; -class IGESSolid_ToolConeFrustum; -class IGESSolid_ToolSphere; -class IGESSolid_ToolTorus; -class IGESSolid_ToolSolidOfRevolution; -class IGESSolid_ToolSolidOfLinearExtrusion; -class IGESSolid_ToolEllipsoid; -class IGESSolid_ToolBooleanTree; -class IGESSolid_ToolSelectedComponent; -class IGESSolid_ToolSolidAssembly; -class IGESSolid_ToolManifoldSolid; -class IGESSolid_ToolPlaneSurface; -class IGESSolid_ToolCylindricalSurface; -class IGESSolid_ToolConicalSurface; -class IGESSolid_ToolSphericalSurface; -class IGESSolid_ToolToroidalSurface; -class IGESSolid_ToolSolidInstance; -class IGESSolid_ToolVertexList; -class IGESSolid_ToolEdgeList; -class IGESSolid_ToolLoop; -class IGESSolid_ToolFace; -class IGESSolid_ToolShell; class IGESSolid_Protocol; -class IGESSolid_ReadWriteModule; -class IGESSolid_GeneralModule; -class IGESSolid_SpecificModule; -class IGESSolid_TopoBuilder; //! This package consists of B-Rep and CSG Solid entities class IGESSolid { -public: - - DEFINE_STANDARD_ALLOC + public: - //! Prepares dynamic data (Protocol, Modules) for this package Standard_EXPORT static void Init(); //! Returns the Protocol for this Package - Standard_EXPORT static Handle(IGESSolid_Protocol) Protocol(); - - - - -protected: - - - - - -private: - - - - -friend class IGESSolid_Block; -friend class IGESSolid_RightAngularWedge; -friend class IGESSolid_Cylinder; -friend class IGESSolid_ConeFrustum; -friend class IGESSolid_Sphere; -friend class IGESSolid_Torus; -friend class IGESSolid_SolidOfRevolution; -friend class IGESSolid_SolidOfLinearExtrusion; -friend class IGESSolid_Ellipsoid; -friend class IGESSolid_BooleanTree; -friend class IGESSolid_SelectedComponent; -friend class IGESSolid_SolidAssembly; -friend class IGESSolid_ManifoldSolid; -friend class IGESSolid_PlaneSurface; -friend class IGESSolid_CylindricalSurface; -friend class IGESSolid_ConicalSurface; -friend class IGESSolid_SphericalSurface; -friend class IGESSolid_ToroidalSurface; -friend class IGESSolid_SolidInstance; -friend class IGESSolid_VertexList; -friend class IGESSolid_EdgeList; -friend class IGESSolid_Loop; -friend class IGESSolid_Face; -friend class IGESSolid_Shell; -friend class IGESSolid_ToolBlock; -friend class IGESSolid_ToolRightAngularWedge; -friend class IGESSolid_ToolCylinder; -friend class IGESSolid_ToolConeFrustum; -friend class IGESSolid_ToolSphere; -friend class IGESSolid_ToolTorus; -friend class IGESSolid_ToolSolidOfRevolution; -friend class IGESSolid_ToolSolidOfLinearExtrusion; -friend class IGESSolid_ToolEllipsoid; -friend class IGESSolid_ToolBooleanTree; -friend class IGESSolid_ToolSelectedComponent; -friend class IGESSolid_ToolSolidAssembly; -friend class IGESSolid_ToolManifoldSolid; -friend class IGESSolid_ToolPlaneSurface; -friend class IGESSolid_ToolCylindricalSurface; -friend class IGESSolid_ToolConicalSurface; -friend class IGESSolid_ToolSphericalSurface; -friend class IGESSolid_ToolToroidalSurface; -friend class IGESSolid_ToolSolidInstance; -friend class IGESSolid_ToolVertexList; -friend class IGESSolid_ToolEdgeList; -friend class IGESSolid_ToolLoop; -friend class IGESSolid_ToolFace; -friend class IGESSolid_ToolShell; -friend class IGESSolid_Protocol; -friend class IGESSolid_ReadWriteModule; -friend class IGESSolid_GeneralModule; -friend class IGESSolid_SpecificModule; -friend class IGESSolid_TopoBuilder; - + Standard_EXPORT static const Handle(IGESSolid_Protocol) & Protocol(); }; - - - - - - #endif // _IGESSolid_HeaderFile diff --git a/src/IGESToBRep/FILES b/src/IGESToBRep/FILES index a7021d0dc1..c5a5b14fcf 100644 --- a/src/IGESToBRep/FILES +++ b/src/IGESToBRep/FILES @@ -13,7 +13,6 @@ IGESToBRep_BRepEntity.cxx IGESToBRep_BRepEntity.hxx IGESToBRep_CurveAndSurface.cxx IGESToBRep_CurveAndSurface.hxx -IGESToBRep_CurveAndSurface.lxx IGESToBRep_IGESBoundary.cxx IGESToBRep_IGESBoundary.hxx IGESToBRep_IGESBoundary.lxx diff --git a/src/IGESToBRep/IGESToBRep_Actor.cxx b/src/IGESToBRep/IGESToBRep_Actor.cxx index 3677afe5b8..8c77c6865e 100644 --- a/src/IGESToBRep/IGESToBRep_Actor.cxx +++ b/src/IGESToBRep/IGESToBRep_Actor.cxx @@ -111,7 +111,7 @@ static void TrimTolerances (const TopoDS_Shape& shape, const Standard_Real tol) //purpose : //======================================================================= -Handle(Transfer_Binder) IGESToBRep_Actor::Transferring (const Handle(Standard_Transient)& start, const Handle(Transfer_ProcessForTransient)& PT) +Handle(Transfer_Binder) IGESToBRep_Actor::Transferring (const Handle(Standard_Transient)& start, const Handle(Transfer_Process)& PT) { DeclareAndCast(IGESData_IGESModel,mymodel,themodel); DeclareAndCast(IGESData_IGESEntity,ent,start); diff --git a/src/IGESToBRep/IGESToBRep_Actor.hxx b/src/IGESToBRep/IGESToBRep_Actor.hxx index 57c57c3438..43f46ada05 100644 --- a/src/IGESToBRep/IGESToBRep_Actor.hxx +++ b/src/IGESToBRep/IGESToBRep_Actor.hxx @@ -35,7 +35,7 @@ class IGESToBRep_Actor : public Transfer_ActorOfTransientProcess Standard_EXPORT virtual Standard_Boolean Recognize (const Handle(Standard_Transient)& start) Standard_OVERRIDE; - Standard_EXPORT virtual Handle(Transfer_Binder) Transferring (const Handle(Standard_Transient)& start, const Handle(Transfer_ProcessForTransient)& TP) Standard_OVERRIDE; + Standard_EXPORT virtual Handle(Transfer_Binder) Transferring (const Handle(Standard_Transient)& start, const Handle(Transfer_Process)& TP) Standard_OVERRIDE; Standard_EXPORT void SetModel (const Handle(Interface_InterfaceModel)& model); diff --git a/src/IGESToBRep/IGESToBRep_CurveAndSurface.hxx b/src/IGESToBRep/IGESToBRep_CurveAndSurface.hxx index e87022c89c..8681ce872b 100644 --- a/src/IGESToBRep/IGESToBRep_CurveAndSurface.hxx +++ b/src/IGESToBRep/IGESToBRep_CurveAndSurface.hxx @@ -21,12 +21,9 @@ #include #include -#include -#include -#include +#include class Geom_Surface; class IGESData_IGESModel; -class Transfer_TransientProcess; class TopoDS_Shape; class IGESData_IGESEntity; class Message_Msg; @@ -35,11 +32,10 @@ class Message_Msg; //! Provides methods to transfer CurveAndSurface from IGES to CASCADE. class IGESToBRep_CurveAndSurface { -public: + public: DEFINE_STANDARD_ALLOC - //! Creates a tool CurveAndSurface ready to run, with //! epsilons set to 1.E-04, myModeTopo to True, the //! optimization of the continuity to False. @@ -57,28 +53,28 @@ public: Standard_EXPORT void Init(); //! Changes the value of "myEps" - void SetEpsilon (const Standard_Real eps); + void SetEpsilon (const Standard_Real eps) { myEps = eps; } //! Returns the value of "myEps" - Standard_Real GetEpsilon() const; + Standard_Real GetEpsilon() const { return myEps; } //! Changes the value of "myEpsCoeff" - void SetEpsCoeff (const Standard_Real eps); + void SetEpsCoeff (const Standard_Real eps) { myEpsCoeff = eps; } //! Returns the value of "myEpsCoeff" - Standard_Real GetEpsCoeff() const; + Standard_Real GetEpsCoeff() const { return myEpsCoeff; } //! Changes the value of "myEpsGeom" Standard_EXPORT void SetEpsGeom (const Standard_Real eps); //! Returns the value of "myEpsGeom" - Standard_Real GetEpsGeom() const; + Standard_Real GetEpsGeom() const { return myEpsGeom; } //! Changes the value of "myMinTol" - void SetMinTol (const Standard_Real mintol); + void SetMinTol (const Standard_Real mintol) { myMinTol = mintol; } //! Changes the value of "myMaxTol" - void SetMaxTol (const Standard_Real maxtol); + void SetMaxTol (const Standard_Real maxtol) { myMaxTol = maxtol; } //! Sets values of "myMinTol" and "myMaxTol" as follows //! myMaxTol = Max ("read.maxprecision.val", myEpsGeom * myUnitFactor) @@ -88,60 +84,60 @@ public: Standard_EXPORT void UpdateMinMaxTol(); //! Returns the value of "myMinTol" - Standard_Real GetMinTol() const; + Standard_Real GetMinTol() const { return myMinTol; } //! Returns the value of "myMaxTol" - Standard_Real GetMaxTol() const; + Standard_Real GetMaxTol() const { return myMaxTol; } //! Changes the value of "myModeApprox" - void SetModeApprox (const Standard_Boolean mode); + void SetModeApprox (const Standard_Boolean mode) { myModeApprox = mode; } //! Returns the value of "myModeApprox" - Standard_Boolean GetModeApprox() const; + Standard_Boolean GetModeApprox() const { return myModeApprox; } //! Changes the value of "myModeIsTopo" - void SetModeTransfer (const Standard_Boolean mode); + void SetModeTransfer (const Standard_Boolean mode) { myModeIsTopo = mode; } //! Returns the value of "myModeIsTopo" - Standard_Boolean GetModeTransfer() const; + Standard_Boolean GetModeTransfer() const { return myModeIsTopo; } //! Changes the value of "myContIsOpti" - void SetOptimized (const Standard_Boolean optimized); + void SetOptimized (const Standard_Boolean optimized) { myContIsOpti = optimized; } //! Returns the value of "myContIsOpti" - Standard_Boolean GetOptimized() const; + Standard_Boolean GetOptimized() const { return myContIsOpti; } //! Returns the value of " myUnitFactor" - Standard_Real GetUnitFactor() const; + Standard_Real GetUnitFactor() const { return myUnitFactor; } //! Changes the value of "mySurfaceCurve" - void SetSurfaceCurve (const Standard_Integer ival); + void SetSurfaceCurve (const Standard_Integer ival) { mySurfaceCurve = ival; } //! Returns the value of " mySurfaceCurve" 0 = value in //! file , 2 = kepp 2d and compute 3d 3 = keep 3d and //! compute 2d - Standard_Integer GetSurfaceCurve() const; + Standard_Integer GetSurfaceCurve() const { return mySurfaceCurve; } //! Set the value of "myModel" Standard_EXPORT void SetModel (const Handle(IGESData_IGESModel)& model); //! Returns the value of "myModel" - Handle(IGESData_IGESModel) GetModel() const; + const Handle(IGESData_IGESModel) & GetModel() const { return myModel; } //! Changes the value of "myContinuity" //! if continuity = 0 do nothing else //! if continuity = 1 try C1 //! if continuity = 2 try C2 - void SetContinuity (const Standard_Integer continuity); + void SetContinuity (const Standard_Integer continuity) { myContinuity = continuity; } //! Returns the value of "myContinuity" - Standard_Integer GetContinuity() const; + Standard_Integer GetContinuity() const { return myContinuity; } //! Set the value of "myMsgReg" - void SetTransferProcess (const Handle(Transfer_TransientProcess)& TP); + void SetTransferProcess (const Handle(Transfer_TransientProcess)& TP) { myTP = TP; } //! Returns the value of "myMsgReg" - Handle(Transfer_TransientProcess) GetTransferProcess() const; + const Handle(Transfer_TransientProcess) & GetTransferProcess() const { return myTP; } //! Returns the result of the transfert of any IGES Curve //! or Surface Entity. If the transfer has failed, this @@ -154,15 +150,13 @@ public: Standard_EXPORT TopoDS_Shape TransferGeometry (const Handle(IGESData_IGESEntity)& start); //! Records a new Fail message - void SendFail (const Handle(IGESData_IGESEntity)& start, const Message_Msg& amsg); + void SendFail (const Handle(IGESData_IGESEntity)& start, const Message_Msg& amsg) + { myTP->SendFail(start,amsg); } //! Records a new Warning message - void SendWarning (const Handle(IGESData_IGESEntity)& start, const Message_Msg& amsg); - - //! Records a new Information message from the definition - //! of a Msg (Original+Value) - void SendMsg (const Handle(IGESData_IGESEntity)& start, const Message_Msg& amsg); - + void SendWarning (const Handle(IGESData_IGESEntity)& start, const Message_Msg& amsg) + { myTP->SendWarning(start,amsg); } + //! Returns True if start was already treated and has a result in "myMap" //! else returns False. Standard_EXPORT Standard_Boolean HasShapeResult (const Handle(IGESData_IGESEntity)& start) const; @@ -192,18 +186,7 @@ public: Standard_EXPORT Standard_Real GetUVResolution(); - - - -protected: - - - - - -private: - - + private: Standard_Real myEps; Standard_Real myEpsCoeff; @@ -221,15 +204,6 @@ private: Standard_Boolean myIsResolCom; Handle(IGESData_IGESModel) myModel; Handle(Transfer_TransientProcess) myTP; - - }; - -#include - - - - - #endif // _IGESToBRep_CurveAndSurface_HeaderFile diff --git a/src/IGESToBRep/IGESToBRep_CurveAndSurface.lxx b/src/IGESToBRep/IGESToBRep_CurveAndSurface.lxx deleted file mode 100644 index 608da83b3b..0000000000 --- a/src/IGESToBRep/IGESToBRep_CurveAndSurface.lxx +++ /dev/null @@ -1,307 +0,0 @@ -// Created on: 2000-01-31 -// Created by: data exchange team -// Copyright (c) 2000-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#include -#include - -//======================================================================= -//function : SetEpsilon -//purpose : -//======================================================================= - -inline void IGESToBRep_CurveAndSurface::SetEpsilon(const Standard_Real eps) -{ - myEps = eps; -} - - -//======================================================================= -//function : GetEpsilon -//purpose : -//======================================================================= - -inline Standard_Real IGESToBRep_CurveAndSurface::GetEpsilon() const -{ - return myEps; -} - - -//======================================================================= -//function : SetEpsCoeff -//purpose : -//======================================================================= - -inline void IGESToBRep_CurveAndSurface::SetEpsCoeff(const Standard_Real eps) -{ - myEpsCoeff = eps; -} - - -//======================================================================= -//function : GetEpsCoeff -//purpose : -//======================================================================= - -inline Standard_Real IGESToBRep_CurveAndSurface::GetEpsCoeff() const -{ - return myEpsCoeff; -} - - -//======================================================================= -//function : GetEpsGeom -//purpose : -//======================================================================= - -inline Standard_Real IGESToBRep_CurveAndSurface::GetEpsGeom() const -{ - return myEpsGeom; -} - - -//======================================================================= -//function : SetMinTol -//purpose : -//======================================================================= - -inline void IGESToBRep_CurveAndSurface::SetMinTol(const Standard_Real mintol) -{ - myMinTol = mintol; -} - - -//======================================================================= -//function : SetMaxTol -//purpose : -//======================================================================= - -inline void IGESToBRep_CurveAndSurface::SetMaxTol(const Standard_Real maxtol) -{ - myMaxTol = maxtol; -} - - -//======================================================================= -//function : GetMinTol -//purpose : -//======================================================================= - -inline Standard_Real IGESToBRep_CurveAndSurface::GetMinTol() const -{ - return myMinTol; -} - - -//======================================================================= -//function : GetMaxTol -//purpose : -//======================================================================= - -inline Standard_Real IGESToBRep_CurveAndSurface::GetMaxTol() const -{ - return myMaxTol; -} - - -//======================================================================= -//function : SetModeApprox -//purpose : -//======================================================================= - -inline void IGESToBRep_CurveAndSurface::SetModeApprox(const Standard_Boolean mode) -{ - myModeApprox = mode; -} - - -//======================================================================= -//function : GetModeApprox -//purpose : -//======================================================================= - -inline Standard_Boolean IGESToBRep_CurveAndSurface::GetModeApprox() const -{ - return myModeApprox; -} - - -//======================================================================= -//function : SetModeTransfer -//purpose : -//======================================================================= - -inline void IGESToBRep_CurveAndSurface::SetModeTransfer(const Standard_Boolean mode) -{ - myModeIsTopo = mode; -} - - -//======================================================================= -//function : GetModeTransfer -//purpose : -//======================================================================= - -inline Standard_Boolean IGESToBRep_CurveAndSurface::GetModeTransfer() const -{ - return myModeIsTopo; -} - - -//======================================================================= -//function : SetOptimized -//purpose : -//======================================================================= - -inline void IGESToBRep_CurveAndSurface::SetOptimized(const Standard_Boolean optimized) -{ - myContIsOpti = optimized; -} - - -//======================================================================= -//function : GetOptimized -//purpose : -//======================================================================= - -inline Standard_Boolean IGESToBRep_CurveAndSurface::GetOptimized() const -{ - return myContIsOpti; -} - - -//======================================================================= -//function : GetUnitFactor -//purpose : -//======================================================================= - -inline Standard_Real IGESToBRep_CurveAndSurface::GetUnitFactor() const -{ - return myUnitFactor; -} - - -//======================================================================= -//function : SetSurfaceCurve -//purpose : -//======================================================================= - -inline void IGESToBRep_CurveAndSurface::SetSurfaceCurve(const Standard_Integer ival) -{ - mySurfaceCurve = ival; -} - - -//======================================================================= -//function : GetSurfaceCurve -//purpose : -//======================================================================= - -inline Standard_Integer IGESToBRep_CurveAndSurface::GetSurfaceCurve() const -{ - return mySurfaceCurve; -} - - -//======================================================================= -//function : GetModel -//purpose : -//======================================================================= - -inline Handle(IGESData_IGESModel) IGESToBRep_CurveAndSurface::GetModel() const -{ - return myModel; -} - - -//======================================================================= -//function : SetContinuity -//purpose : -//======================================================================= - -inline void IGESToBRep_CurveAndSurface::SetContinuity(const Standard_Integer continuity) -{ - myContinuity = continuity; -} - - -//======================================================================= -//function : GetContinuity -//purpose : -//======================================================================= - -inline Standard_Integer IGESToBRep_CurveAndSurface::GetContinuity() const -{ - return myContinuity; -} - - -//======================================================================= -//function : SetTransferProcess -//purpose : -//======================================================================= - -inline void IGESToBRep_CurveAndSurface::SetTransferProcess(const Handle(Transfer_TransientProcess)& TP) -{ - myTP = TP; -} - - -//======================================================================= -//function : GetTransferProcess -//purpose : -//======================================================================= - -inline Handle(Transfer_TransientProcess) IGESToBRep_CurveAndSurface::GetTransferProcess() const -{ - return myTP; -} - - -//======================================================================= -//function : SendFail -//purpose : -//======================================================================= - -inline void IGESToBRep_CurveAndSurface::SendFail (const Handle(IGESData_IGESEntity)& start, - const Message_Msg& amsg) -{ - GetTransferProcess()->SendFail(start,amsg); -} - - -//======================================================================= -//function : SendWarning -//purpose : -//======================================================================= - -inline void IGESToBRep_CurveAndSurface::SendWarning (const Handle(IGESData_IGESEntity)& start, - const Message_Msg& amsg) -{ - GetTransferProcess()->SendWarning(start,amsg); -} - - -//======================================================================= -//function : SendMsg -//purpose : -//======================================================================= - -inline void IGESToBRep_CurveAndSurface::SendMsg (const Handle(IGESData_IGESEntity)& start, - const Message_Msg& amsg) -{ - GetTransferProcess()->SendMsg(start,amsg); -} - - diff --git a/src/IGESToBRep/IGESToBRep_Reader.cxx b/src/IGESToBRep/IGESToBRep_Reader.cxx index d696544b7a..0a38abc191 100644 --- a/src/IGESToBRep/IGESToBRep_Reader.cxx +++ b/src/IGESToBRep/IGESToBRep_Reader.cxx @@ -51,7 +51,6 @@ #include #include #include -#include #include #include #include @@ -60,7 +59,6 @@ #include #include -//#include #ifdef _MSC_VER #include #else @@ -75,7 +73,8 @@ static Handle(IGESData_FileProtocol) protocol; //function : IGESToBRep_Reader //purpose : //======================================================================= - IGESToBRep_Reader::IGESToBRep_Reader () + +IGESToBRep_Reader::IGESToBRep_Reader () { theDone = Standard_False; if (protocol.IsNull()) { @@ -88,7 +87,6 @@ static Handle(IGESData_FileProtocol) protocol; theProc = new Transfer_TransientProcess; } - //======================================================================= //function : LoadFile //purpose : loads a Model from a file @@ -98,13 +96,13 @@ Standard_Integer IGESToBRep_Reader::LoadFile (const Standard_CString filename) { if ( theProc.IsNull() ) theProc = new Transfer_TransientProcess; - Handle(Message_Messenger) TF = theProc->Messenger(); + + const Handle(Message_Messenger) &TF = theProc->Messenger(); // Message for Diagnostic file. Message_Msg msg2000("IGES_2000"); msg2000.Arg(filename); TF->Send (msg2000, Message_Info); - //Message_Msg msg2001("IGES_2001"); // Date Message_Msg msg2005("IGES_2005"); msg2005.Arg(theProc->TraceLevel()); TF->Send (msg2005, Message_Info); @@ -118,11 +116,6 @@ Standard_Integer IGESToBRep_Reader::LoadFile (const Standard_CString filename) // Sending of message : IGES file opening error Message_Msg Msg2("XSTEP_2"); TF->Send (Msg2, Message_Info); - //Message_Msg Msg3("XSTEP_3"); - //Message_Msg Msg4("XSTEP_4"); - //Message_Msg Msg5("XSTEP_5"); - //Message_Msg Msg6("XSTEP_6"); - //Message_Msg Msg7("XSTEP_7"); // Reasons of the file opening error switch(errno) { @@ -173,7 +166,6 @@ Standard_Integer IGESToBRep_Reader::LoadFile (const Standard_CString filename) nbWarn += ach->NbWarnings(); nbFail += ach->NbFails(); } -// Messages nbWarn and nbFail; Msg25.Arg(nbFail); Msg26.Arg(nbWarn); TF->Send (Msg25, Message_Info); @@ -199,12 +191,12 @@ Standard_Integer IGESToBRep_Reader::LoadFile (const Standard_CString filename) return StatusFile; } - //======================================================================= //function : SetModel //purpose : Specifies a Model to work on //======================================================================= - void IGESToBRep_Reader::SetModel (const Handle(IGESData_IGESModel)& model) + +void IGESToBRep_Reader::SetModel (const Handle(IGESData_IGESModel)& model) { theModel = model; theDone = Standard_False; @@ -215,72 +207,20 @@ Standard_Integer IGESToBRep_Reader::LoadFile (const Standard_CString filename) theProc->Clear(); } - -//======================================================================= -//function : Model -//purpose : returns the Model to be worked on -//======================================================================= - Handle(IGESData_IGESModel) IGESToBRep_Reader::Model () const - { return theModel; } - - -//======================================================================= -//function : SetTransientProcess -//purpose : Specifies a TransferProcess -//======================================================================= - void IGESToBRep_Reader::SetTransientProcess - (const Handle(Transfer_TransientProcess)& TP) - { theProc = TP; } - -//======================================================================= -//function : TransientProcess -//purpose : Returns the TransferProcess -//======================================================================= - Handle(Transfer_TransientProcess) IGESToBRep_Reader::TransientProcess () const - { return theProc; } - -//======================================================================= -//function : Actor -//purpose : returns theActor -//======================================================================= - Handle(IGESToBRep_Actor) IGESToBRep_Reader::Actor () const - { return theActor; } - - -//======================================================================= -//function : Clear -//purpose : Clears the result and Done status -//======================================================================= - void IGESToBRep_Reader::Clear () -{ - theDone = Standard_False; - theShapes.Clear(); -} - - //======================================================================= //function : Check //purpose : Checks the Model //======================================================================= - Standard_Boolean IGESToBRep_Reader::Check - (const Standard_Boolean withprint) const + +Standard_Boolean IGESToBRep_Reader::Check (const Standard_Boolean withprint) const { Interface_CheckTool cht (theModel,protocol); Interface_CheckIterator chl = cht.CompleteCheckList(); if (withprint && !theProc.IsNull()) - cht.Print(chl, theProc->Messenger()); + chl.Print(theProc->Messenger(),theModel,Standard_False); return chl.IsEmpty(Standard_True); } - -//======================================================================= -//function : IsDone -//purpose : returns True if the last transfert was a success -//======================================================================= - Standard_Boolean IGESToBRep_Reader::IsDone () const - { return theDone; } - - //======================================================================= //function : EncodeRegul //purpose : INTERNAL to encode regularity on edges @@ -301,56 +241,13 @@ static Standard_Boolean EncodeRegul (const TopoDS_Shape& sh) return Standard_True; } -//======================================================================= -//function : UpdateMap -//purpose : Updates the correspondence map (Transfer_TransientProcess), -// setting as translation results, the shapes received after -// modification by modifier (BRepTools_Modifier) -//warning : BRepTools_Modifier raises exception when it cannot find input -// shape in its internal list -//======================================================================= - -// coment as unused PTV 18.09.2000 -// static void UpdateMap (const Handle(Transfer_TransientProcess)& map, -// const BRepTools_Modifier& modifier) -// { -// Transfer_IteratorOfProcessForTransient iterator = map->CompleteResult(Standard_True); -// for (iterator.Start(); iterator.More(); iterator.Next()) { -// const Handle(Transfer_Binder) binder = iterator.Value(); -// try { //to avoid exception in BRepTools_Modifier -// OCC_CATCH_SIGNALS -// if (binder->IsKind (STANDARD_TYPE (TransferBRep_ShapeBinder))) { -// DeclareAndCast(TransferBRep_ShapeBinder, shapebinder, binder); -// if (shapebinder->HasResult()) { -// TopoDS_Shape result = shapebinder->Result(); -// TopoDS_Shape modified = modifier.ModifiedShape (result); -// if (shapebinder->Status() != Transfer_StatusUsed) //to avoid exception -// shapebinder->SetResult (modified); -// } -// } -// else if (binder->IsKind (STANDARD_TYPE (TransferBRep_ShapeListBinder))) { -// DeclareAndCast(TransferBRep_ShapeListBinder, shapelistbinder, binder); -// for (Standard_Integer i = 1; i <= shapelistbinder->NbShapes(); i++) { -// TopoDS_Shape result = shapelistbinder->Shape (i); -// TopoDS_Shape modified = modifier.ModifiedShape (result); -// shapelistbinder->SetResult (i, modified); -// } -// } -// } -// catch(Standard_Failure) { -// continue; -// } -// } -// } - //======================================================================= //function : TrimTolerances //purpose : Trims tolerances of the shape according to static parameters // //======================================================================= -static void TrimTolerances (const TopoDS_Shape& shape, - const Standard_Real tol) +static void TrimTolerances (const TopoDS_Shape& shape, const Standard_Real tol) { if( Interface_Static::IVal("read.maxprecision.mode")==1) { ShapeFix_ShapeTolerance SFST; @@ -362,6 +259,7 @@ static void TrimTolerances (const TopoDS_Shape& shape, //function : TransferRoots //purpose : Transfers all Roots Entities //======================================================================= + void IGESToBRep_Reader::TransferRoots (const Standard_Boolean onlyvisible) { if (theModel.IsNull() || theProc.IsNull()) return; @@ -467,11 +365,11 @@ void IGESToBRep_Reader::TransferRoots (const Standard_Boolean onlyvisible) TF->Send (msg2065, Message_Info); } - //======================================================================= //function : Transfer //purpose : Transfers an Entity given //======================================================================= + Standard_Boolean IGESToBRep_Reader::Transfer(const Standard_Integer num) { Handle(Message_Messenger) TF = theProc->Messenger(); @@ -589,39 +487,32 @@ Standard_Boolean IGESToBRep_Reader::Transfer(const Standard_Integer num) return Standard_True; } - //======================================================================= //function : UsedTolerance //purpose : Returns the used tolerance (input) //======================================================================= - Standard_Real IGESToBRep_Reader::UsedTolerance () const - { return theActor->UsedTolerance(); } - -//======================================================================= -//function : NbShapes -//purpose : Returns the count of produced Shapes -//======================================================================= - Standard_Integer IGESToBRep_Reader::NbShapes () const - { return theShapes.Length(); } +Standard_Real IGESToBRep_Reader::UsedTolerance () const +{ return theActor->UsedTolerance(); } //======================================================================= //function : Shape //purpose : Returns a Shape given its rank //======================================================================= - TopoDS_Shape IGESToBRep_Reader::Shape (const Standard_Integer num) const + +TopoDS_Shape IGESToBRep_Reader::Shape (const Standard_Integer num) const { TopoDS_Shape res; if (num > 0 && num <= theShapes.Length()) res = theShapes.Value(num); return res; } - //======================================================================= //function : OneShape //purpose : Returns a unique Shape //======================================================================= - TopoDS_Shape IGESToBRep_Reader::OneShape () const + +TopoDS_Shape IGESToBRep_Reader::OneShape () const { TopoDS_Shape res; Standard_Integer nb = theShapes.Length(); diff --git a/src/IGESToBRep/IGESToBRep_Reader.hxx b/src/IGESToBRep/IGESToBRep_Reader.hxx index db4fd05172..c2dff27684 100644 --- a/src/IGESToBRep/IGESToBRep_Reader.hxx +++ b/src/IGESToBRep/IGESToBRep_Reader.hxx @@ -54,21 +54,21 @@ public: Standard_EXPORT void SetModel (const Handle(IGESData_IGESModel)& model); //! Returns the Model to be worked on. - Standard_EXPORT Handle(IGESData_IGESModel) Model() const; + const Handle(IGESData_IGESModel) & Model() const { return theModel; } //! Allows to set an already defined TransientProcess //! (to be called after LoadFile or SetModel) - Standard_EXPORT void SetTransientProcess (const Handle(Transfer_TransientProcess)& TP); + void SetTransientProcess (const Handle(Transfer_TransientProcess)& TP) { theProc = TP; } //! Returns the TransientProcess - Standard_EXPORT Handle(Transfer_TransientProcess) TransientProcess() const; - + const Handle(Transfer_TransientProcess) & TransientProcess() const { return theProc; } + //! Returns "theActor" - Standard_EXPORT Handle(IGESToBRep_Actor) Actor() const; + const Handle(IGESToBRep_Actor) & Actor() const { return theActor; } //! Clears the results between two translation operations. - Standard_EXPORT void Clear(); - + void Clear() { theDone = Standard_False; theShapes.Clear(); } + //! Checks the IGES file that was //! loaded into memory. Displays error messages in the default //! message file if withprint is true. Returns True if no fail @@ -87,15 +87,15 @@ public: Standard_EXPORT Standard_Boolean Transfer (const Standard_Integer num); //! Returns True if the LAST Transfer/TransferRoots was a success - Standard_EXPORT Standard_Boolean IsDone() const; - + Standard_Boolean IsDone() const { return theDone; } + //! Returns the Tolerance which has been actually used, converted //! in millimeters //! (either that from File or that from Session, according the mode) Standard_EXPORT Standard_Real UsedTolerance() const; //! Returns the number of shapes produced by the translation. - Standard_EXPORT Standard_Integer NbShapes() const; + Standard_Integer NbShapes() const { return theShapes.Length(); } //! Returns the num the resulting shape in a translation operation. Standard_EXPORT TopoDS_Shape Shape (const Standard_Integer num = 1) const; @@ -107,32 +107,13 @@ public: //! - a compound containing the resulting shapes if there are several. Standard_EXPORT TopoDS_Shape OneShape() const; - - - -protected: - - - - - -private: - - + private: Handle(IGESData_IGESModel) theModel; Standard_Boolean theDone; TopTools_SequenceOfShape theShapes; Handle(IGESToBRep_Actor) theActor; Handle(Transfer_TransientProcess) theProc; - - }; - - - - - - #endif // _IGESToBRep_Reader_HeaderFile diff --git a/src/Interface/FILES b/src/Interface/FILES index 8b06bd2a9e..7059cb7887 100755 --- a/src/Interface/FILES +++ b/src/Interface/FILES @@ -102,7 +102,6 @@ Interface_STAT.cxx Interface_STAT.hxx Interface_Static.cxx Interface_Static.hxx -Interface_Statics.hxx Interface_StaticStandards.cxx Interface_Translates.hxx Interface_TypedValue.cxx diff --git a/src/Interface/Interface_CheckTool.cxx b/src/Interface/Interface_CheckTool.cxx index 47ad1d8cd2..1307147eeb 100644 --- a/src/Interface/Interface_CheckTool.cxx +++ b/src/Interface/Interface_CheckTool.cxx @@ -70,25 +70,10 @@ static void raisecheck (Handle(Interface_Check)& ach) Interface_CheckTool::Interface_CheckTool(const Handle(Interface_InterfaceModel)& model, const Handle(Interface_Protocol)& protocol) - : thegtool ( new Interface_GTool(protocol,model->NbEntities()) ) , - theshare (model,protocol) -{ - thestat = 0; -} - - -//======================================================================= -//function : Interface_CheckTool -//purpose : -//======================================================================= - -Interface_CheckTool::Interface_CheckTool(const Handle(Interface_InterfaceModel)& model) - : thegtool(model->GTool()) , theshare (model,model->GTool()) -{ - thestat = 0; - thegtool->Reservate(model->NbEntities()); -} - +: Interface_ShareTool (model), + thegtool (new Interface_GTool(protocol,model->NbEntities())), + thestat (0) +{} //======================================================================= //function : Interface_CheckTool @@ -96,10 +81,10 @@ Interface_CheckTool::Interface_CheckTool(const Handle(Interface_InterfaceModel)& //======================================================================= Interface_CheckTool::Interface_CheckTool(const Interface_Graph& graph) - : thegtool(graph.Model()->GTool()) , theshare (graph) -{ -} - +: Interface_ShareTool (graph), + thegtool (graph.Model()->GTool()), + thestat (0) +{} //======================================================================= //function : Interface_CheckTool @@ -107,152 +92,17 @@ Interface_CheckTool::Interface_CheckTool(const Interface_Graph& graph) //======================================================================= Interface_CheckTool::Interface_CheckTool(const Handle(Interface_HGraph)& hgraph) - : thegtool(hgraph->Graph().Model()->GTool()) , theshare (hgraph) -{ -} - - -//======================================================================= -//function : FillCheck -//purpose : -//======================================================================= - -void Interface_CheckTool::FillCheck(const Handle(Standard_Transient)& ent, - const Interface_ShareTool& sh, - Handle(Interface_Check)& ach) -{ - Handle(Interface_GeneralModule) module; - Standard_Integer CN; - if (thegtool->Select(ent,module,CN)) { -// Sans try/catch (fait par l appelant, evite try/catch en boucle) - if (!errh) { - module->CheckCase(CN,ent,sh,ach); - return; - } -// Avec try/catch - try { - OCC_CATCH_SIGNALS - module->CheckCase(CN,ent,sh,ach); - } - catch (Standard_Failure) { - raisecheck(ach); - } - } - else { - DeclareAndCast(Interface_ReportEntity,rep,ent); - if (rep.IsNull()) return; - ach = rep->Check(); - } - if (theshare.Graph().HasShareErrors(ent)) - ach->AddFail("** Shared Items unknown from the containing Model"); -} - - -//======================================================================= -//function : Print -//purpose : -//======================================================================= - -void Interface_CheckTool::Print(const Handle(Interface_Check)& ach, - const Handle(Message_Messenger)& S) const -{ - Standard_Integer i, nb; - nb = ach->NbFails(); - if (nb > 0) S << " Fail Messages : " << nb << " :\n"; - for (i = 1; i <= nb; i ++) { - S << ach->Fail(i) << "\n"; - } - nb = ach->NbWarnings(); - if (nb > 0) S << " Warning Messages : " << nb << " :\n"; - for (i = 1; i <= nb; i ++) { - S << ach->Warning(i) << "\n"; - } -} - - -//======================================================================= -//function : Print -//purpose : -//======================================================================= - -void Interface_CheckTool::Print(const Interface_CheckIterator& list, - const Handle(Message_Messenger)& S) const -{ - Handle(Interface_InterfaceModel) model = theshare.Model(); - list.Print(S,model,Standard_False); -} +: Interface_ShareTool (hgraph), + thegtool (hgraph->Graph().Model()->GTool()), + thestat (0) +{} // .... Check General sur un Modele .... - -// Check : Une Entite d un Modele, designee par son rang - - -//======================================================================= -//function : Check -//purpose : -//======================================================================= - -Handle(Interface_Check) Interface_CheckTool::Check(const Standard_Integer num) -{ - Handle(Interface_InterfaceModel) model = theshare.Model(); - Handle(Standard_Transient) ent = model->Value(num); - Handle(Interface_Check) ach = new Interface_Check(ent); // non filtre par "Warning" : tel quel - errh = 1; - FillCheck(ent,theshare,ach); - return ach; -} - - -// CheckSuccess : test passe-passe pas, sur CheckList(Fail) des Entites - - -//======================================================================= -//function : CheckSuccess -//purpose : -//======================================================================= - -void Interface_CheckTool::CheckSuccess (const Standard_Boolean reset) -{ - if (reset) thestat = 0; - if (thestat > 3) Interface_CheckFailure::Raise // deja teste avec erreur - ("Interface Model : Global Check"); - Handle(Interface_InterfaceModel) model = theshare.Model(); - if (model->GlobalCheck()->NbFails() > 0) Interface_CheckFailure::Raise - ("Interface Model : Global Check"); - Handle(Interface_Check) modchk = new Interface_Check; - model->VerifyCheck(modchk); - if (!model->Protocol().IsNull()) model->Protocol()->GlobalCheck (theshare.Graph(),modchk); - if (modchk->HasFailed()) Interface_CheckFailure::Raise - ("Interface Model : Verify Check"); - if (thestat == 3) return; // tout teste et ca passe - - errh = 0; // Pas de try/catch, car justement on raise - Standard_Integer nb = model->NbEntities(); - for (Standard_Integer i = 1; i <= nb; i ++) { - if (model->IsErrorEntity(i)) Interface_CheckFailure::Raise - ("Interface Model : an Entity is recorded as Erroneous"); - Handle(Standard_Transient) ent = model->Value(i); - if (thestat & 1) { - if (!model->IsErrorEntity(i)) continue; // deja verify, reste analyse - } - if (thestat & 2) { - if ( model->IsErrorEntity(i)) continue; // deja analyse, reste verify - } - - Handle(Interface_Check) ach = new Interface_Check(ent); - FillCheck(ent,theshare,ach); - if (ach->HasFailed()) Interface_CheckFailure::Raise - ("Interface Model : Check on an Entity has Failed"); - } -} - - // CompleteCheckList : Tous Tests : GlobalCheck, Analyse-Verify en Fail ou en // Warning; plus les Unknown Entities (par Check vide) - //======================================================================= //function : CompleteCheckList //purpose : @@ -261,11 +111,11 @@ void Interface_CheckTool::CheckSuccess (const Standard_Boolean reset) Interface_CheckIterator Interface_CheckTool::CompleteCheckList () { thestat = 3; - Handle(Interface_InterfaceModel) model = theshare.Model(); + const Handle(Interface_InterfaceModel) &model = Graph().Model(); Interface_CheckIterator res; res.SetModel(model); Handle(Interface_Check) globch = model->GlobalCheck(); // GlobalCheck Statique - if (!model->Protocol().IsNull()) model->Protocol()->GlobalCheck (theshare.Graph(),globch); + if (!model->Protocol().IsNull()) model->Protocol()->GlobalCheck (Graph(),globch); model->VerifyCheck(globch); // GlobalCheck Dynamique if (globch->HasFailed() || globch->HasWarnings()) res.Add(globch,0); if (globch->HasFailed()) thestat |= 12; @@ -286,7 +136,7 @@ Interface_CheckIterator Interface_CheckTool::CompleteCheckList () if (ach->HasFailed()) // FAIL : pas de Check semantique { res.Add(ach,i); ach = new Interface_Check; thestat |= 12; continue; } } - if (!model->HasSemanticChecks()) FillCheck(ent,theshare,ach); + if (!model->HasSemanticChecks()) FillCheck(ent,ach); else ach->GetMessages (model->Check (i,Standard_False)); if (ach->HasFailed() || ach->HasWarnings()) { res.Add(ach,i); ach = new Interface_Check; if (ach->HasFailed()) thestat |= 12; } @@ -305,7 +155,6 @@ Interface_CheckIterator Interface_CheckTool::CompleteCheckList () // CheckList : Check Fail sur Entites, en Analyse (Read time) ou Verify - //======================================================================= //function : CheckList //purpose : @@ -314,12 +163,12 @@ Interface_CheckIterator Interface_CheckTool::CompleteCheckList () Interface_CheckIterator Interface_CheckTool::CheckList () { thestat = 3; - Handle(Interface_InterfaceModel) model = theshare.Model(); + const Handle(Interface_InterfaceModel) &model = Graph().Model(); Interface_CheckIterator res; res.SetModel(model); Standard_Integer i=0, n0 = 1, nb = model->NbEntities(); Handle(Interface_Check) globch = model->GlobalCheck(); - if (!model->Protocol().IsNull()) model->Protocol()->GlobalCheck (theshare.Graph(),globch); + if (!model->Protocol().IsNull()) model->Protocol()->GlobalCheck (Graph(),globch); model->VerifyCheck(globch); if (globch->HasFailed()) { thestat |= 12; res.Add(globch,0); } @@ -338,7 +187,7 @@ Interface_CheckIterator Interface_CheckTool::CheckList () ent = model->Value(i); ach->Clear(); ach->SetEntity(ent); - if (!model->HasSemanticChecks()) FillCheck(ent,theshare,ach); + if (!model->HasSemanticChecks()) FillCheck(ent,ach); else ach = model->Check (i,Standard_False); if (ach->HasFailed()) { thestat |= 12; res.Add(ach,i); } } @@ -366,7 +215,7 @@ Interface_CheckIterator Interface_CheckTool::CheckList () Interface_CheckIterator Interface_CheckTool::AnalyseCheckList () { thestat = 2; - Handle(Interface_InterfaceModel) model = theshare.Model(); + const Handle(Interface_InterfaceModel) &model = Graph().Model(); Interface_CheckIterator res; res.SetModel(model); Standard_Integer i=0, n0 = 1, nb = model->NbEntities(); @@ -377,11 +226,10 @@ Interface_CheckIterator Interface_CheckTool::AnalyseCheckList () try { OCC_CATCH_SIGNALS for (i = n0; i <= nb; i ++) { - if (!model->IsReportEntity(i)) continue; - Handle(Interface_ReportEntity) rep = model->ReportEntity(i); - ach = rep->Check(); - if (ach->HasFailed() || ach->HasWarnings()) - { thestat |= 8; res.Add(ach,i); } + if (!model->IsReportEntity(i)) continue; + ach = model->ReportEntity(i)->Check(); + if (ach->HasFailed() || ach->HasWarnings()) + { thestat |= 8; res.Add(ach,i); } } n0 = nb+1; } @@ -406,7 +254,7 @@ Interface_CheckIterator Interface_CheckTool::AnalyseCheckList () Interface_CheckIterator Interface_CheckTool::VerifyCheckList () { thestat = 1; - Handle(Interface_InterfaceModel) model = theshare.Model(); + const Handle(Interface_InterfaceModel) &model = Graph().Model(); Interface_CheckIterator res; res.SetModel(model); Standard_Integer i=0, n0 = 1, nb = model->NbEntities(); @@ -418,14 +266,14 @@ Interface_CheckIterator Interface_CheckTool::VerifyCheckList () try { OCC_CATCH_SIGNALS for (i = n0; i <= nb; i ++) { - if (model->IsErrorEntity(i)) continue; - ent = model->Value(i); - ach->Clear(); - ach->SetEntity(ent); - if (!model->HasSemanticChecks()) FillCheck(ent,theshare,ach); - else ach = model->Check (i,Standard_False); - if (ach->HasFailed() || ach->HasWarnings()) - { thestat |= 4; res.Add(ach,i); } + if (model->IsErrorEntity(i)) continue; + ent = model->Value(i); + ach->Clear(); + ach->SetEntity(ent); + if (!model->HasSemanticChecks()) FillCheck(ent,ach); + else ach = model->Check (i,Standard_False); + if (ach->HasFailed() || ach->HasWarnings()) + { thestat |= 4; res.Add(ach,i); } } n0 = nb+1; } @@ -438,68 +286,36 @@ Interface_CheckIterator Interface_CheckTool::VerifyCheckList () return res; } - -// Warnings sur Entites (Read time ou apres) - - //======================================================================= -//function : WarningCheckList +//function : FillCheck //purpose : //======================================================================= -Interface_CheckIterator Interface_CheckTool::WarningCheckList () +void Interface_CheckTool::FillCheck(const Handle(Standard_Transient)& ent, + Handle(Interface_Check)& ach) { - thestat = 3; - Handle(Interface_InterfaceModel) model = theshare.Model(); - Interface_CheckIterator res; - res.SetModel(model); - Standard_Integer i=0, n0 = 1, nb = model->NbEntities(); - - errh = 0; - while (n0 <= nb) { - Handle(Interface_Check) ach = new Interface_Check; - Handle(Standard_Transient) ent; + Handle(Interface_GeneralModule) module; + Standard_Integer CN; + if (thegtool->Select(ent,module,CN)) { +// Sans try/catch (fait par l appelant, evite try/catch en boucle) + if (!errh) { + module->CheckCase(CN,ent,*this,ach); + return; + } +// Avec try/catch try { OCC_CATCH_SIGNALS - for (i = n0; i <= nb; i ++) { - ach->Clear(); - ach->SetEntity (ent); - if (model->IsReportEntity(i)) { - Handle(Interface_ReportEntity) rep = model->ReportEntity(i); - if (rep->IsError()) { thestat |= 12; continue; } - ach = rep->Check(); - } - ent = model->Value(i); - if (!model->HasSemanticChecks()) FillCheck(ent,theshare,ach); - else ach = model->Check (i,Standard_False); - if (ach->HasFailed()) thestat |= 12; - else if (ach->HasWarnings()) res.Add(ach,i); - } - n0 = nb+1; + module->CheckCase(CN,ent,*this,ach); } - catch(Standard_Failure) { - n0 = i+1; + catch (Standard_Failure) { raisecheck(ach); - res.Add(ach,i); thestat |= 12; } } - - return res; -} - - -//======================================================================= -//function : UnknownEntities -//purpose : -//======================================================================= - -Interface_EntityIterator Interface_CheckTool::UnknownEntities () -{ - Handle(Interface_InterfaceModel) model = theshare.Model(); - Interface_EntityIterator res; - Standard_Integer nb = model->NbEntities(); - for (Standard_Integer i = 1; i <= nb; i ++) { - if (model->IsUnknownEntity(i)) res.GetOneItem(model->Value(i)); + else { + DeclareAndCast(Interface_ReportEntity,rep,ent); + if (rep.IsNull()) return; + ach = rep->Check(); } - return res; + if (Graph().HasShareErrors(ent)) + ach->AddFail("** Shared Items unknown from the containing Model"); } diff --git a/src/Interface/Interface_CheckTool.hxx b/src/Interface/Interface_CheckTool.hxx index 663f628f08..294f81e3b5 100644 --- a/src/Interface/Interface_CheckTool.hxx +++ b/src/Interface/Interface_CheckTool.hxx @@ -22,72 +22,35 @@ #include #include -#include -#include class Interface_GTool; -class Interface_CheckFailure; class Interface_InterfaceModel; class Interface_Protocol; class Interface_Graph; class Interface_HGraph; -class Standard_Transient; -class Interface_ShareTool; class Interface_Check; class Message_Messenger; class Interface_CheckIterator; -class Interface_EntityIterator; //! Performs Checks on Entities, using General Service Library and //! Modules to work. Works on one Entity or on a complete Model -class Interface_CheckTool +class Interface_CheckTool : public Interface_ShareTool { -public: + public: DEFINE_STANDARD_ALLOC - //! Creates a CheckTool, by calling the General Service Library //! and Modules, selected through a Protocol, to work on a Model //! Moreover, Protocol recognizes Unknown Entities Standard_EXPORT Interface_CheckTool(const Handle(Interface_InterfaceModel)& model, const Handle(Interface_Protocol)& protocol); - //! Creates a CheckTool, by calling the General Service Library - //! and Modules, selected through a Protocol, to work on a Model - //! Protocol and so on are taken from the Model (its GTool) - Standard_EXPORT Interface_CheckTool(const Handle(Interface_InterfaceModel)& model); - //! Creates a CheckTool from a Graph. The Graph contains a Model //! which designates a Protocol: they are used to create ShareTool Standard_EXPORT Interface_CheckTool(const Interface_Graph& graph); Standard_EXPORT Interface_CheckTool(const Handle(Interface_HGraph)& hgraph); - //! Fills as required a Check with the Error and Warning messages - //! produced by Checking a given Entity. - //! For an Erroneous or Corrected Entity : Check build at Analyse - //! time; else, Check computed for Entity (Verify integrity), can - //! use a Graph as required to control context - Standard_EXPORT void FillCheck (const Handle(Standard_Transient)& ent, const Interface_ShareTool& sh, Handle(Interface_Check)& ach); - - //! Utility method which Prints the content of a Check - Standard_EXPORT void Print (const Handle(Interface_Check)& ach, const Handle(Message_Messenger)& S) const; - - //! Simply Lists all the Checks and the Content (messages) and the - //! Entity, if there is, of each Check - //! (if all Checks are OK, nothing is Printed) - Standard_EXPORT void Print (const Interface_CheckIterator& list, const Handle(Message_Messenger)& S) const; - - //! Returns the Check associated to an Entity identified by - //! its Number in a Model. - Standard_EXPORT Handle(Interface_Check) Check (const Standard_Integer num); - - //! Checks if any Error has been detected (CheckList not empty) - //! Returns normally if none, raises exception if some exists. - //! It reuses the last computations from other checking methods, - //! unless the argument is given True - Standard_EXPORT void CheckSuccess (const Standard_Boolean reset = Standard_False); - //! Returns list of all "remarkable" informations, which include : //! - GlobalCheck, if not empty //! - Error Checks, for all Errors (Verify + Analyse) @@ -110,39 +73,18 @@ public: //! Returns list of integrity constraints errors (semantic) //! (note that GlobalCheck is not in this list) Standard_EXPORT Interface_CheckIterator VerifyCheckList(); - - //! Returns list of Corrections (includes GlobalCheck if corrected) - Standard_EXPORT Interface_CheckIterator WarningCheckList(); - - //! Returns list of Unknown Entities - //! Note that Error and Erroneous Entities are not considered - //! as Unknown - Standard_EXPORT Interface_EntityIterator UnknownEntities(); - - - - -protected: - - - - - -private: - + private: + + //! Fills as required a Check with the Error and Warning messages + //! produced by Checking a given Entity. + //! For an Erroneous or Corrected Entity : Check build at Analyse + //! time; else, Check computed for Entity (Verify integrity), can + //! use a Graph as required to control context + Standard_EXPORT void FillCheck (const Handle(Standard_Transient)& ent, Handle(Interface_Check)& ach); Handle(Interface_GTool) thegtool; - Interface_ShareTool theshare; Standard_Integer thestat; - - }; - - - - - - #endif // _Interface_CheckTool_HeaderFile diff --git a/src/Interface/Interface_EntityIterator.cxx b/src/Interface/Interface_EntityIterator.cxx index 4bf98b4561..cf1bb3ae77 100644 --- a/src/Interface/Interface_EntityIterator.cxx +++ b/src/Interface/Interface_EntityIterator.cxx @@ -13,69 +13,42 @@ #include -#include #include #include -#include -// Iterateur pour ecriture for, ou while avec Next en fin : -// for (creer iterateur; iter.More(); iter.Next()) { val = iter.Value(); ... } -// .... Definitions initiales : en particulier celles requises pour -// les outils de graphe (construction avec le graphe, avec un vertex) -Interface_EntityIterator::Interface_EntityIterator () +Interface_EntityIterator::Interface_EntityIterator (const Handle(TColStd_HSequenceOfTransient)& list) { -// thecurr = new Interface_IntVal; -// thecurr->CValue() = 0; -// thelist = new TColStd_HSequenceOfTransient(); // constructeur vide -// thelist sera construit au premier Add (quelquefois, il nyena pas) -} - - Interface_EntityIterator::Interface_EntityIterator - (const Handle(TColStd_HSequenceOfTransient)& list) -{ - thecurr = new Interface_IntVal; - thecurr->CValue() = 0; + thecurr = 0; thelist = list; } - void Interface_EntityIterator::AddList - (const Handle(TColStd_HSequenceOfTransient)& list) +void Interface_EntityIterator::AddList (const Handle(TColStd_HSequenceOfTransient)& list) { if (thelist.IsNull()) thelist = new TColStd_HSequenceOfTransient(); - if (thecurr.IsNull()) thecurr = new Interface_IntVal; - thecurr->CValue() = 0; + thecurr = 0; thelist->Append(list); } - void Interface_EntityIterator::AddItem - (const Handle(Standard_Transient)& anentity) +void Interface_EntityIterator::AddItem (const Handle(Standard_Transient)& anentity) { if (anentity.IsNull()) return; - if (thecurr.IsNull()) thecurr = new Interface_IntVal; if (thelist.IsNull()) thelist = new TColStd_HSequenceOfTransient(); - thecurr->CValue() = 0; + thecurr = 0; thelist->Append(anentity); } - void Interface_EntityIterator::GetOneItem - (const Handle(Standard_Transient)& anentity) - { AddItem(anentity); } - - void Interface_EntityIterator::Reset () +void Interface_EntityIterator::Reset () { - if (thecurr.IsNull()) thecurr = new Interface_IntVal; - thecurr->CValue() = 0; + thecurr = 0; thelist = new TColStd_HSequenceOfTransient(); } - // .... Fonctionnalites de tri prealable a l'iteration .... // Facon "bete" : supprimer les termes qui ne conviennent pas : lent ! // Mieux vaut refaire une autre sequence a cote - void Interface_EntityIterator::SelectType - (const Handle(Standard_Type)& atype, const Standard_Boolean keep) +void Interface_EntityIterator::SelectType (const Handle(Standard_Type)& atype, const Standard_Boolean keep) { if (thelist.IsNull()) return; Standard_Integer i, n = thelist->Length(); @@ -88,15 +61,12 @@ Interface_EntityIterator::Interface_EntityIterator () // .... Iteration proprement dite .... - Standard_Integer Interface_EntityIterator::NbEntities () const +Standard_Integer Interface_EntityIterator::NbEntities () const { - if (thelist.IsNull()) return 0; - if (!thecurr.IsNull() && thecurr->Value() == 0) Start(); - return thelist->Length(); + return thelist.IsNull()? 0 : thelist->Length(); } - Standard_Integer Interface_EntityIterator::NbTyped - (const Handle(Standard_Type)& atype) const +Standard_Integer Interface_EntityIterator::NbTyped (const Handle(Standard_Type)& atype) const { Standard_Integer res = 0; if (thelist.IsNull()) return res; @@ -107,8 +77,7 @@ Interface_EntityIterator::Interface_EntityIterator () return res; } - Interface_EntityIterator Interface_EntityIterator::Typed - (const Handle(Standard_Type)& atype) const +Interface_EntityIterator Interface_EntityIterator::Typed (const Handle(Standard_Type)& atype) const { Interface_EntityIterator res; if (thelist.IsNull()) return res; @@ -119,42 +88,28 @@ Interface_EntityIterator::Interface_EntityIterator () return res; } - - void Interface_EntityIterator::Start () const - { if (!thecurr.IsNull()) thecurr->CValue() = 1 ; } // peut etre redefini ... - - Standard_Boolean Interface_EntityIterator::More () const +void Interface_EntityIterator::Start () const { - if (thecurr.IsNull()) return Standard_False; - if (thecurr->Value() == 0) Start(); // preparation de l iteration - if (thelist.IsNull()) return Standard_False; - return (thecurr->Value() <= thelist->Length()); + thecurr = 1; } - void Interface_EntityIterator::Next () const - { thecurr->CValue() ++; } // Next ne verifie rien : soin laisse a Value - - const Handle(Standard_Transient)& Interface_EntityIterator::Value () const +Standard_Boolean Interface_EntityIterator::More () const { -// NbEntity pas const (on ne sait pas comment il est implemente apres tout) - if (thelist.IsNull()) Standard_NoSuchObject::Raise("Interface_EntityIterator"); - if (thecurr->Value() < 1 || thecurr->Value() > thelist->Length()) - Standard_NoSuchObject::Raise("Interface_EntityIterator"); - return thelist->Value(thecurr->Value()); + if (thecurr == 0) Start(); // preparation de l iteration + return thelist.IsNull()? Standard_False : (thecurr <= thelist->Length()); } - Handle(TColStd_HSequenceOfTransient) Interface_EntityIterator::Content () const +const Handle(Standard_Transient)& Interface_EntityIterator::Value () const { - if (!thecurr.IsNull() && thecurr->Value() == 0) Start(); - if (thelist.IsNull()) return new TColStd_HSequenceOfTransient(); // vide - return thelist; + // NbEntity pas const (on ne sait pas comment il est implemente apres tout) + if (thelist.IsNull()) + Standard_NoSuchObject::Raise("Interface_EntityIterator"); + if (thecurr < 1 || thecurr > thelist->Length()) + Standard_NoSuchObject::Raise("Interface_EntityIterator"); + return thelist->Value(thecurr); } -void Interface_EntityIterator::Destroy () - { thecurr.Nullify(); } // redevient vide ! - -Interface_EntityIterator::~Interface_EntityIterator() +Handle(TColStd_HSequenceOfTransient) Interface_EntityIterator::Content () const { - Destroy(); + return (thelist.IsNull()? new TColStd_HSequenceOfTransient() : thelist); } - diff --git a/src/Interface/Interface_EntityIterator.hxx b/src/Interface/Interface_EntityIterator.hxx index 48beaf7ad3..2336d4e579 100644 --- a/src/Interface/Interface_EntityIterator.hxx +++ b/src/Interface/Interface_EntityIterator.hxx @@ -23,25 +23,18 @@ #include #include -#include -#include -class Interface_IntVal; -class Standard_NoMoreObject; -class Standard_NoSuchObject; -class Standard_Transient; //! Defines an Iterator on Entities. //! Allows considering of various criteria class Interface_EntityIterator { -public: + public: DEFINE_STANDARD_ALLOC - //! Defines an empty iterator (see AddList & AddItem) - Standard_EXPORT Interface_EntityIterator(); + Interface_EntityIterator() {} //! Defines an iterator on a list, directly i.e. without copying it Standard_EXPORT Interface_EntityIterator(const Handle(TColStd_HSequenceOfTransient)& list); @@ -53,7 +46,7 @@ public: Standard_EXPORT void AddItem (const Handle(Standard_Transient)& anentity); //! same as AddItem (kept for compatibility) - Standard_EXPORT void GetOneItem (const Handle(Standard_Transient)& anentity); + void GetOneItem (const Handle(Standard_Transient)& anentity) { AddItem(anentity); } //! Selects entities with are Kind of a given type, keep only //! them (is keep is True) or reject only them (if keep is False) @@ -77,7 +70,7 @@ public: Standard_EXPORT Standard_Boolean More() const; //! Sets iteration to the next entity (vertex) to give - Standard_EXPORT void Next() const; + void Next() const { thecurr++; } // Next ne verifie rien : soin laisse a Value //! Returns the current Entity iterated, to be used by Interface //! tools @@ -88,36 +81,19 @@ public: //! Returns an empty Sequence if the Iterator is empty //! Calls Start if not yet done Standard_EXPORT Handle(TColStd_HSequenceOfTransient) Content() const; - - //! Clears data of iteration - Standard_EXPORT void Destroy(); //! Destructor - Standard_EXPORT virtual ~Interface_EntityIterator(); - -protected: + Standard_EXPORT virtual ~Interface_EntityIterator() {} + protected: //! Allows subclasses of EntityIterator to reevaluate an iteration Standard_EXPORT void Reset(); + private: - - -private: - - - - Handle(Interface_IntVal) thecurr; + mutable Standard_Integer thecurr; Handle(TColStd_HSequenceOfTransient) thelist; - - }; - - - - - - #endif // _Interface_EntityIterator_HeaderFile diff --git a/src/Interface/Interface_FileReaderTool.cxx b/src/Interface/Interface_FileReaderTool.cxx index 1009559138..19ddbb97be 100644 --- a/src/Interface/Interface_FileReaderTool.cxx +++ b/src/Interface/Interface_FileReaderTool.cxx @@ -14,7 +14,6 @@ // dce 21/01/99 S3767 : Suppression of general messages #include -#include #include #include #include diff --git a/src/Interface/Interface_Graph.cxx b/src/Interface/Interface_Graph.cxx index 6506d2929e..f02a4e478c 100644 --- a/src/Interface/Interface_Graph.cxx +++ b/src/Interface/Interface_Graph.cxx @@ -38,53 +38,6 @@ // .... CONSTRUCTEURS .... -// .... Construction a partir de la connaissance des Entites .... - - -Interface_Graph::Interface_Graph -(const Handle(Interface_InterfaceModel)& amodel, - const Interface_GeneralLib& /*lib*/, - Standard_Boolean theModeStat) - : themodel (amodel), thepresents ("") -{ - if(theModeStat) - InitStats(); - Evaluate(); -} - -Interface_Graph::Interface_Graph -(const Handle(Interface_InterfaceModel)& amodel, - const Handle(Interface_Protocol)& /*protocol*/, - Standard_Boolean theModeStat) - : themodel (amodel) , thepresents ("") - -{ - if(theModeStat) - InitStats(); - Evaluate(); -} - -Interface_Graph::Interface_Graph -(const Handle(Interface_InterfaceModel)& amodel, - const Handle(Interface_GTool)& /*gtool*/, - Standard_Boolean theModeStat) - : themodel (amodel) , thepresents ("") -{ - if(theModeStat) - InitStats(); - Evaluate(); -} - -Interface_Graph::Interface_Graph -(const Handle(Interface_InterfaceModel)& amodel, - Standard_Boolean theModeStat) -: themodel (amodel) , thepresents ("") -{ - if(theModeStat) - InitStats(); - Evaluate (); -} - // .... Construction depuis un autre Graph .... Interface_Graph::Interface_Graph @@ -253,19 +206,10 @@ void Interface_Graph::RemoveStatus(const Standard_Integer stat) } } -const Interface_BitMap& Interface_Graph::BitMap () const -{ return theflags; } - -Interface_BitMap& Interface_Graph::CBitMap () -{ return theflags; } - // ########################################################################### // .... Chargements Elementaires avec Propagation de "Share" .... // -const Handle(Interface_InterfaceModel)& Interface_Graph::Model() const -{ return themodel; } - void Interface_Graph::GetFromModel () { if (themodel.IsNull() || thestats.IsNull()) diff --git a/src/Interface/Interface_Graph.hxx b/src/Interface/Interface_Graph.hxx index 6eaa95f01d..ea0c8f4c63 100644 --- a/src/Interface/Interface_Graph.hxx +++ b/src/Interface/Interface_Graph.hxx @@ -29,8 +29,6 @@ #include #include -class Interface_InterfaceModel; -class Standard_DomainError; class Interface_GeneralLib; class Interface_Protocol; class Interface_GTool; @@ -69,18 +67,13 @@ public: //! Creates an empty graph, ready to receive Entities from amodel //! Note that this way of Creation allows to verify that //! Entities to work with are contained in - //! Basic Shared and Sharing lists are obtained from a General - //! Services Library, given directly as an argument - Standard_EXPORT Interface_Graph(const Handle(Interface_InterfaceModel)& amodel, const Interface_GeneralLib& lib, const Standard_Boolean theModeStats = Standard_True); - - //! Same as above, but the Library is defined through a Protocol - Standard_EXPORT Interface_Graph(const Handle(Interface_InterfaceModel)& amodel, const Handle(Interface_Protocol)& protocol, const Standard_Boolean theModeStats = Standard_True); - - //! Same as above, but the Library is defined through a Protocol - Standard_EXPORT Interface_Graph(const Handle(Interface_InterfaceModel)& amodel, const Handle(Interface_GTool)& gtool, const Standard_Boolean theModeStats = Standard_True); - - //! Same a above but works with the Protocol recorded in the Model - Standard_EXPORT Interface_Graph(const Handle(Interface_InterfaceModel)& amodel, const Standard_Boolean theModeStats = Standard_True); + Interface_Graph(const Handle(Interface_InterfaceModel)& amodel, const Standard_Boolean theModeStats = Standard_True) + : themodel (amodel), thepresents ("") + { + if(theModeStats) + InitStats(); + Evaluate(); + } //! Creates a Graph from another one, getting all its data //! Remark that status are copied from , but the other @@ -136,14 +129,14 @@ public: Standard_EXPORT void RemoveStatus (const Standard_Integer stat); //! Returns the Bit Map in order to read or edit flag values - Standard_EXPORT const Interface_BitMap& BitMap() const; - + const Interface_BitMap& BitMap() const { return theflags; } + //! Returns the Bit Map in order to edit it (add new flags) - Standard_EXPORT Interface_BitMap& CBitMap(); - + Interface_BitMap& CBitMap() { return theflags; } + //! Returns the Model with which this Graph was created - Standard_EXPORT const Handle(Interface_InterfaceModel)& Model() const; - + const Handle(Interface_InterfaceModel)& Model() const { return themodel; } + //! Loads Graph with all Entities contained in the Model Standard_EXPORT void GetFromModel(); @@ -229,24 +222,17 @@ public: //! Returns mode resposible for computation of statuses; Standard_EXPORT Standard_Boolean ModeStat() const; - - - -protected: - + protected: //! Initialize statuses and flags Standard_EXPORT void InitStats(); - Handle(Interface_InterfaceModel) themodel; TCollection_AsciiString thepresents; Handle(TColStd_HArray1OfInteger) thestats; Handle(TColStd_HArray1OfListOfInteger) thesharings; - -private: - + private: //! Performs the Evaluation of the Graph, from an initial Library, //! either defined through a Protocol, or given dierctly @@ -257,16 +243,7 @@ private: //! If is defined, it has priority Standard_EXPORT void Evaluate(); - Interface_BitMap theflags; - - }; - - - - - - #endif // _Interface_Graph_HeaderFile diff --git a/src/Interface/Interface_GraphContent.cxx b/src/Interface/Interface_GraphContent.cxx index 22c17f21ff..3c7199468e 100644 --- a/src/Interface/Interface_GraphContent.cxx +++ b/src/Interface/Interface_GraphContent.cxx @@ -19,18 +19,7 @@ #include #include -Interface_GraphContent::Interface_GraphContent () { } - - Interface_GraphContent::Interface_GraphContent - (const Interface_Graph& agraph) - { GetFromGraph(agraph); } - - Interface_GraphContent::Interface_GraphContent - (const Interface_Graph& agraph, const Standard_Integer stat) - { GetFromGraph(agraph,stat); } - - Interface_GraphContent::Interface_GraphContent - (const Interface_Graph& agraph, const Handle(Standard_Transient)& ent) +Interface_GraphContent::Interface_GraphContent (const Interface_Graph& agraph, const Handle(Standard_Transient)& ent) { Interface_EntityIterator list = agraph.Shareds(ent); Standard_Integer nb = list.NbEntities(); @@ -42,8 +31,7 @@ Interface_GraphContent::Interface_GraphContent () { } } } - - void Interface_GraphContent::GetFromGraph (const Interface_Graph& agraph) +void Interface_GraphContent::GetFromGraph (const Interface_Graph& agraph) { Standard_Integer nb = agraph.Size(); for (Standard_Integer i = 1; i <= nb; i ++) { @@ -51,8 +39,7 @@ Interface_GraphContent::Interface_GraphContent () { } } } - void Interface_GraphContent::GetFromGraph - (const Interface_Graph& agraph, const Standard_Integer stat) +void Interface_GraphContent::GetFromGraph (const Interface_Graph& agraph, const Standard_Integer stat) { Standard_Integer nb = agraph.Size(); for (Standard_Integer i = 1; i <= nb; i ++) { @@ -61,19 +48,18 @@ Interface_GraphContent::Interface_GraphContent () { } } } - Interface_EntityIterator Interface_GraphContent::Result () +Interface_EntityIterator Interface_GraphContent::Result () { Interface_EntityIterator iter; // On transvase ... for (Begin(); More(); Next()) iter.GetOneItem(Value()); return iter; } - - void Interface_GraphContent::Begin () +void Interface_GraphContent::Begin () { Evaluate(); Interface_EntityIterator::Start(); } - void Interface_GraphContent::Evaluate () -{ } // par defaut, Evaluate ne fait rien +void Interface_GraphContent::Evaluate () +{} diff --git a/src/Interface/Interface_GraphContent.hxx b/src/Interface/Interface_GraphContent.hxx index 49c235305c..c3ad87ec7c 100644 --- a/src/Interface/Interface_GraphContent.hxx +++ b/src/Interface/Interface_GraphContent.hxx @@ -35,19 +35,20 @@ class Interface_EntityIterator; //! all being given under one unique form class Interface_GraphContent : public Interface_EntityIterator { -public: + public: DEFINE_STANDARD_ALLOC - //! Creates an empty GraphContent, ready to be filled - Standard_EXPORT Interface_GraphContent(); + Interface_GraphContent() {} //! Creates with all entities designated by a Graph - Standard_EXPORT Interface_GraphContent(const Interface_Graph& agraph); + Interface_GraphContent(const Interface_Graph& agraph) + { GetFromGraph(agraph); } //! Creates with entities having specific Status value in a Graph - Standard_EXPORT Interface_GraphContent(const Interface_Graph& agraph, const Standard_Integer stat); + Interface_GraphContent(const Interface_Graph& agraph, const Standard_Integer stat) + { GetFromGraph(agraph,stat); } //! Creates an Iterator with Shared entities of an entity //! (equivalente to EntityIterator but with a Graph) @@ -74,28 +75,6 @@ public: //! Default is set to doing nothing : intended to be redefined //! by each sub-class Standard_EXPORT virtual void Evaluate(); - - - - -protected: - - - - - -private: - - - - - }; - - - - - - #endif // _Interface_GraphContent_HeaderFile diff --git a/src/Interface/Interface_HGraph.cxx b/src/Interface/Interface_HGraph.cxx index 4c0e473b16..f3aceb32b4 100644 --- a/src/Interface/Interface_HGraph.cxx +++ b/src/Interface/Interface_HGraph.cxx @@ -11,52 +11,6 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. - -#include -#include -#include #include -#include -#include -#include -#include IMPLEMENT_STANDARD_RTTIEXT(Interface_HGraph,MMgt_TShared) - -Interface_HGraph::Interface_HGraph (const Interface_Graph& agraph) - : thegraph(agraph) { } - - - Interface_HGraph::Interface_HGraph - (const Handle(Interface_InterfaceModel)& amodel, - const Interface_GeneralLib& lib, - const Standard_Boolean theModeStat) - : thegraph (amodel,lib,theModeStat) { } - - - Interface_HGraph::Interface_HGraph - (const Handle(Interface_InterfaceModel)& amodel, - const Handle(Interface_Protocol)& protocol, - const Standard_Boolean theModeStat) - : thegraph (amodel,protocol,theModeStat) { } - - - Interface_HGraph::Interface_HGraph - (const Handle(Interface_InterfaceModel)& amodel, - const Handle(Interface_GTool)& gtool, - const Standard_Boolean theModeStat) - : thegraph (amodel,gtool,theModeStat) { } - - - Interface_HGraph::Interface_HGraph - (const Handle(Interface_InterfaceModel)& amodel, - const Standard_Boolean theModeStat) - : thegraph (amodel,theModeStat) { } - - - const Interface_Graph& Interface_HGraph::Graph () const - { return thegraph; } - - - Interface_Graph& Interface_HGraph::CGraph () - { return thegraph; } diff --git a/src/Interface/Interface_HGraph.hxx b/src/Interface/Interface_HGraph.hxx index 7a54b10ca3..b38a4fcb3f 100644 --- a/src/Interface/Interface_HGraph.hxx +++ b/src/Interface/Interface_HGraph.hxx @@ -19,17 +19,10 @@ #include #include +#include #include -#include -#include -class Standard_DomainError; -class Interface_Graph; class Interface_InterfaceModel; -class Interface_GeneralLib; -class Interface_Protocol; -class Interface_GTool; - class Interface_HGraph; DEFINE_STANDARD_HANDLE(Interface_HGraph, MMgt_TShared) @@ -39,60 +32,34 @@ DEFINE_STANDARD_HANDLE(Interface_HGraph, MMgt_TShared) //! Models, with the same general conditions) class Interface_HGraph : public MMgt_TShared { - -public: - + public: //! Creates an HGraph directly from a Graph. //! Remark that the starting Graph is duplicated - Standard_EXPORT Interface_HGraph(const Interface_Graph& agraph); - - //! Creates an HGraph with a Graph created from and - Standard_EXPORT Interface_HGraph(const Handle(Interface_InterfaceModel)& amodel, const Interface_GeneralLib& lib, const Standard_Boolean theModeStats = Standard_True); + Interface_HGraph(const Interface_Graph& agraph) + : thegraph (agraph) + {} - //! Creates an HGraph with a graph itself created from - //! and - Standard_EXPORT Interface_HGraph(const Handle(Interface_InterfaceModel)& amodel, const Handle(Interface_Protocol)& protocol, const Standard_Boolean theModeStats = Standard_True); - - //! Creates an HGraph with a graph itself created from - //! and - Standard_EXPORT Interface_HGraph(const Handle(Interface_InterfaceModel)& amodel, const Handle(Interface_GTool)& gtool, const Standard_Boolean theModeStats = Standard_True); - - //! Same a above, but works with the GTool in the model - Standard_EXPORT Interface_HGraph(const Handle(Interface_InterfaceModel)& amodel, const Standard_Boolean theModeStats = Standard_True); + //! Creates an HGraph with a Graph created from , works with the GTool in the model + Interface_HGraph(const Handle(Interface_InterfaceModel)& amodel, const Standard_Boolean theModeStats = Standard_True) + : thegraph (amodel,theModeStats) + {} //! Returns the Graph contained in , for Read Only Operations //! Remark that it is returns as "const &" //! Getting it in a new variable instead of a reference would be //! a pitty, because all the graph's content would be duplicated - Standard_EXPORT const Interface_Graph& Graph() const; + const Interface_Graph& Graph() const { return thegraph; } //! Same as above, but for Read-Write Operations //! Then, The Graph will be modified in the HGraph itself - Standard_EXPORT Interface_Graph& CGraph(); - - - + Interface_Graph& CGraph() { return thegraph; } DEFINE_STANDARD_RTTIEXT(Interface_HGraph,MMgt_TShared) -protected: - - - - -private: - + private: Interface_Graph thegraph; - - }; - - - - - - #endif // _Interface_HGraph_HeaderFile diff --git a/src/Interface/Interface_InterfaceModel.cxx b/src/Interface/Interface_InterfaceModel.cxx index 7f095ee161..445edea14d 100644 --- a/src/Interface/Interface_InterfaceModel.cxx +++ b/src/Interface/Interface_InterfaceModel.cxx @@ -41,27 +41,6 @@ IMPLEMENT_STANDARD_RTTIEXT(Interface_InterfaceModel,MMgt_TShared) -// Un Modele d`Interface est un ensemble ferme d`Entites d`interface : chacune -// est dans un seul modele a la fois; elle y a un numero (Number) qui permet de -// verifier qu`une entite est bien dans un seul modele, de definir des Map tres -// performantes, de fournir un identifieur numerique -// Il est a meme d`etre utilise dans des traitements de Graphe -// STATICS : les TEMPLATES -static const Handle(Dico_DictionaryOfTransient)& templates() -{ - static Handle(Dico_DictionaryOfTransient) atemp; - if (atemp.IsNull()) atemp = new Dico_DictionaryOfTransient; - return atemp; -} - - -static const Handle(Standard_Type)& typerep() -{ - static Handle(Standard_Type) tr = STANDARD_TYPE(Interface_ReportEntity); - return tr; -} - - static const Handle(Interface_Check)& nulch() { static Handle(Interface_Check) anulch = new Interface_Check; @@ -87,7 +66,7 @@ Interface_InterfaceModel::Interface_InterfaceModel () //purpose : //======================================================================= -void Interface_InterfaceModel::Destroy () // on fait un mimumum +Interface_InterfaceModel::~Interface_InterfaceModel () // on fait un mimumum { // Moins que Clear que, lui, est adapte a chaque norme ClearEntities(); @@ -121,28 +100,6 @@ Handle(Interface_Protocol) Interface_InterfaceModel::Protocol () const } -//======================================================================= -//function : SetGTool -//purpose : -//======================================================================= - -void Interface_InterfaceModel::SetGTool(const Handle(Interface_GTool)& gtool) -{ - thegtool = gtool; -} - - -//======================================================================= -//function : GTool -//purpose : -//======================================================================= - -Handle(Interface_GTool) Interface_InterfaceModel::GTool () const -{ - return thegtool; -} - - //======================================================================= //function : Clear //purpose : @@ -159,17 +116,6 @@ void Interface_InterfaceModel::Clear () } -//======================================================================= -//function : DispatchStatus -//purpose : -//======================================================================= - -Standard_Boolean& Interface_InterfaceModel::DispatchStatus () -{ - return isdispatch; -} - - //======================================================================= //function : ClearEntities //purpose : @@ -182,14 +128,6 @@ void Interface_InterfaceModel::ClearEntities () haschecksem = Standard_False; if (!thegtool.IsNull()) { -// WhenDeleteCase is not applicable -/* Handle(Interface_GeneralModule) module; Standard_Integer CN; - Standard_Integer nb = NbEntities(); - for (Standard_Integer i = 1; i <= nb ; i ++) { - Handle(Standard_Transient) anent = Value(i); - if (thegtool->Select (anent,module,CN)) - module->WhenDeleteCase (CN,anent,isdispatch); - }*/ thegtool->ClearEntities(); //smh#14 FRA62479 } isdispatch = Standard_False; @@ -200,24 +138,12 @@ void Interface_InterfaceModel::ClearEntities () // .... ACCES AUX ENTITES .... -//======================================================================= -//function : NbEntities -//purpose : -//======================================================================= - -Standard_Integer Interface_InterfaceModel::NbEntities () const -{ - return theentities.Extent(); -} - - //======================================================================= //function : Contains //purpose : //======================================================================= -Standard_Boolean Interface_InterfaceModel::Contains - (const Handle(Standard_Transient)& anentity) const +Standard_Boolean Interface_InterfaceModel::Contains (const Handle(Standard_Transient)& anentity) const { if (theentities.Contains(anentity)) return Standard_True; Handle(Interface_ReportEntity) rep = @@ -232,13 +158,12 @@ Standard_Boolean Interface_InterfaceModel::Contains //purpose : //======================================================================= -Standard_Integer Interface_InterfaceModel::Number - (const Handle(Standard_Transient)& anentity) const +Standard_Integer Interface_InterfaceModel::Number (const Handle(Standard_Transient)& anentity) const { if (anentity.IsNull()) return 0; Standard_Integer num = theentities.FindIndex(anentity); if (num > 0) return num; - if (anentity->IsKind(typerep())) { + if (anentity->IsKind(STANDARD_TYPE(Interface_ReportEntity))) { Handle(Interface_ReportEntity) rep = Handle(Interface_ReportEntity)::DownCast(anentity); if (!rep.IsNull()) return Number(rep->Concerned()); @@ -246,44 +171,15 @@ Standard_Integer Interface_InterfaceModel::Number return 0; } -/* -Standard_Integer Interface_InterfaceModel::DENumber - (const Handle(Standard_Transient)& anentity) const -{ - if (anentity.IsNull()) return 0; - Standard_Integer num = theentities.FindIndex(anentity); - if (num > 0) return (2*num-1); - if (anentity->IsKind(typerep())) { - Handle(Interface_ReportEntity) rep = - Handle(Interface_ReportEntity)::DownCast(anentity); - if (!rep.IsNull()) return (Number(rep->Concerned())*2-1); - } - return 0; -} -*/ - // .. Acces Speciaux (Report, etc...) .. -//======================================================================= -//function : Value -//purpose : -//======================================================================= - -const Handle(Standard_Transient)& Interface_InterfaceModel::Value - (const Standard_Integer num) const -{ - return theentities.FindKey(num); -} - - //======================================================================= //function : NbTypes //purpose : //======================================================================= -Standard_Integer Interface_InterfaceModel::NbTypes - (const Handle(Standard_Transient)& ent) const +Standard_Integer Interface_InterfaceModel::NbTypes (const Handle(Standard_Transient)& ent) const { if (Protocol().IsNull()) return 1; return Protocol()->NbTypes(ent); @@ -334,8 +230,7 @@ Standard_CString Interface_InterfaceModel::ClassName(const Standard_CString typn //purpose : //======================================================================= -Interface_DataState Interface_InterfaceModel::EntityState - (const Standard_Integer num) const +Interface_DataState Interface_InterfaceModel::EntityState (const Standard_Integer num) const { Handle(Interface_ReportEntity) rep; if (!thereports.IsBound(num)) { @@ -528,17 +423,6 @@ void Interface_InterfaceModel::FillSemanticChecks } -//======================================================================= -//function : HasSemanticChecks -//purpose : -//======================================================================= - -Standard_Boolean Interface_InterfaceModel::HasSemanticChecks () const -{ - return haschecksem; -} - - //======================================================================= //function : Check //purpose : @@ -584,8 +468,7 @@ void Interface_InterfaceModel::Reservate (const Standard_Integer nbent) void Interface_InterfaceModel::AddEntity(const Handle(Standard_Transient)& anentity) { - //Standard_Integer newnum; svv #2 - if (!anentity->IsKind(typerep())) theentities.Add(anentity); + if (!anentity->IsKind(STANDARD_TYPE(Interface_ReportEntity))) theentities.Add(anentity); // Report : Ajouter Concerned, mais noter presence Report et sa valeur else { Handle(Interface_ReportEntity) rep = @@ -669,17 +552,6 @@ void Interface_InterfaceModel::AddWithRefs(const Handle(Standard_Transient)& ane } -//======================================================================= -//function : ReplaceEntity -//purpose : -//======================================================================= - -void Interface_InterfaceModel::ReplaceEntity(const Standard_Integer nument, - const Handle(Standard_Transient)& anent) -{ - theentities.Substitute(nument,anent); -} - // ReverseOrders permet de mieux controler la numeration des Entites : // Souvent, les fichiers mettent les racines en fin, tandis que AddWithRefs // les met en tete. @@ -769,8 +641,7 @@ void Interface_InterfaceModel::ChangeOrder(const Standard_Integer oldnum, //purpose : //======================================================================= -void Interface_InterfaceModel::GetFromTransfer - (const Interface_EntityIterator& aniter) +void Interface_InterfaceModel::GetFromTransfer (const Interface_EntityIterator& aniter) { theentities.Clear(); theentities.ReSize (aniter.NbEntities()); for (aniter.Start(); aniter.More(); aniter.Next()) { @@ -787,8 +658,7 @@ void Interface_InterfaceModel::GetFromTransfer //purpose : //======================================================================= -Standard_Boolean Interface_InterfaceModel::SetCategoryNumber - (const Standard_Integer num, const Standard_Integer val) +Standard_Boolean Interface_InterfaceModel::SetCategoryNumber (const Standard_Integer num, const Standard_Integer val) { Standard_Integer i,nb = NbEntities(); if (num < 1 || num > nb) return Standard_False; @@ -810,8 +680,7 @@ Standard_Boolean Interface_InterfaceModel::SetCategoryNumber //purpose : //======================================================================= -Standard_Integer Interface_InterfaceModel::CategoryNumber - (const Standard_Integer num) const +Standard_Integer Interface_InterfaceModel::CategoryNumber (const Standard_Integer num) const { if (thecategory.IsNull()) return 0; if (num < 1 || num > thecategory->Length()) return 0; @@ -825,7 +694,7 @@ Standard_Integer Interface_InterfaceModel::CategoryNumber //purpose : //======================================================================= -void Interface_InterfaceModel::FillIterator(Interface_EntityIterator& iter) const +void Interface_InterfaceModel::FillIterator (Interface_EntityIterator& iter) const { Standard_Integer nb = NbEntities(); for (Standard_Integer i = 1; i <= nb; i ++) @@ -885,44 +754,6 @@ Interface_EntityIterator Interface_InterfaceModel::Redefineds () const return iter; } -//#include -//#include - - -//======================================================================= -//function : GlobalCheck -//purpose : -//======================================================================= - -const Handle(Interface_Check)& Interface_InterfaceModel::GlobalCheck - (const Standard_Boolean syntactic) const -{ - if (syntactic) return thecheckstx; - else return thechecksem; -} - - -//======================================================================= -//function : SetGlobalCheck -//purpose : -//======================================================================= - -void Interface_InterfaceModel::SetGlobalCheck(const Handle(Interface_Check)& ach) -{ - thecheckstx = ach; -} - - -//======================================================================= -//function : VerifyCheck -//purpose : -//======================================================================= - -void Interface_InterfaceModel::VerifyCheck (Handle(Interface_Check)& /*ach*/) const -{ -} - - //======================================================================= //function : Print //purpose : @@ -994,65 +825,3 @@ Standard_Integer Interface_InterfaceModel::NextNumberForLabel if (i <= 0 || i > n) i = 0; return i; } - - -//======================================================================= -//function : HasTemplate -//purpose : -//======================================================================= - -Standard_Boolean Interface_InterfaceModel::HasTemplate - (const Standard_CString name) -{ - return templates()->HasItem(name); -} - - -//======================================================================= -//function : Template -//purpose : -//======================================================================= - -Handle(Interface_InterfaceModel) Interface_InterfaceModel::Template - (const Standard_CString name) -{ - Handle(Interface_InterfaceModel) model,newmod; - if (!HasTemplate(name)) return model; - model = Handle(Interface_InterfaceModel)::DownCast(templates()->Item(name)); - newmod = model->NewEmptyModel(); - newmod->GetFromAnother (model); - return newmod; -} - - -//======================================================================= -//function : SetTemplate -//purpose : -//======================================================================= - -Standard_Boolean Interface_InterfaceModel::SetTemplate - (const Standard_CString name, const Handle(Interface_InterfaceModel)& model) -{ - Standard_Boolean deja; - Handle(Standard_Transient)& newmod = templates()->NewItem(name,deja); - newmod = model; - return deja; -} - - -//======================================================================= -//function : ListTemplates -//purpose : -//======================================================================= - -Handle(TColStd_HSequenceOfHAsciiString) Interface_InterfaceModel::ListTemplates () -{ - Handle(TColStd_HSequenceOfHAsciiString) list = new - TColStd_HSequenceOfHAsciiString(); - if (templates().IsNull()) return list; - for (Dico_IteratorOfDictionaryOfTransient iter(templates()); - iter.More(); iter.Next()) { - list->Append (new TCollection_HAsciiString (iter.Name()) ); - } - return list; -} diff --git a/src/Interface/Interface_InterfaceModel.hxx b/src/Interface/Interface_InterfaceModel.hxx index 90a8dfa61c..b949584b58 100644 --- a/src/Interface/Interface_InterfaceModel.hxx +++ b/src/Interface/Interface_InterfaceModel.hxx @@ -18,24 +18,16 @@ #include #include +#include #include #include -#include -#include -#include -#include -#include #include #include class Interface_Check; class TCollection_HAsciiString; class Interface_GTool; -class Standard_OutOfRange; -class Standard_NoSuchObject; -class Interface_InterfaceMismatch; class Interface_Protocol; -class Standard_Transient; class Interface_ReportEntity; class Interface_CheckIterator; class Interface_GeneralLib; @@ -74,16 +66,10 @@ DEFINE_STANDARD_HANDLE(Interface_InterfaceModel, MMgt_TShared) //! See also Graph, ShareTool, CheckTool for more class Interface_InterfaceModel : public MMgt_TShared { - -public: - + public: //! Clears the list of entities (service WhenDelete) - Standard_EXPORT void Destroy(); -~Interface_InterfaceModel() -{ - Destroy(); -} + Standard_EXPORT ~Interface_InterfaceModel(); //! Sets a Protocol for this Model //! It is also set by a call to AddWithRefs with Protocol @@ -95,16 +81,16 @@ public: Standard_EXPORT virtual Handle(Interface_Protocol) Protocol() const; //! Sets a GTool for this model, which already defines a Protocol - Standard_EXPORT void SetGTool (const Handle(Interface_GTool)& gtool); + void SetGTool (const Handle(Interface_GTool)& gtool) { thegtool = gtool; } //! Returns the GTool, set by SetProtocol or by SetGTool - Standard_EXPORT Handle(Interface_GTool) GTool() const; + const Handle(Interface_GTool) & GTool() const { return thegtool; } //! Returns the Dispatch Status, either for get or set //! A Model which is produced from Dispatch may share entities //! with the original (according to the Protocol), hence these //! non-copied entities should not be deleted - Standard_EXPORT Standard_Boolean& DispatchStatus(); + Standard_Boolean& DispatchStatus() { return isdispatch; } //! Erases contained data; used when a Model is copied to others : //! the new copied ones begin from clear @@ -123,7 +109,7 @@ public: Standard_EXPORT virtual void ClearHeader() = 0; //! Returns count of contained Entities - Standard_EXPORT Standard_Integer NbEntities() const; + Standard_Integer NbEntities() const { return theentities.Extent(); } //! Returns True if a Model contains an Entity (for a ReportEntity, //! looks for the ReportEntity itself AND its Concerned Entity) @@ -143,7 +129,7 @@ public: //! Remark : For a Reported Entity, (Erroneous, Corrected, Unknown), this //! method returns this Reported Entity. //! See ReportEntity for other questions. - Standard_EXPORT const Handle(Standard_Transient)& Value (const Standard_Integer num) const; + const Handle(Standard_Transient)& Value (const Standard_Integer num) const { return theentities.FindKey(num); } //! Returns the count of DISTINCT types under which an entity may //! be processed. Defined by the Protocol, which gives default as @@ -226,7 +212,7 @@ public: Standard_EXPORT void FillSemanticChecks (const Interface_CheckIterator& checks, const Standard_Boolean clear = Standard_True); //! Returns True if semantic checks have been filled - Standard_EXPORT Standard_Boolean HasSemanticChecks() const; + Standard_Boolean HasSemanticChecks() const { return haschecksem; } //! Returns the check attached to an entity, designated by its //! Number. 0 for global check @@ -270,7 +256,7 @@ public: Standard_EXPORT void AddWithRefs (const Handle(Standard_Transient)& anent, const Interface_GeneralLib& lib, const Standard_Integer level = 0, const Standard_Boolean listall = Standard_False); //! Replace Entity with Number=nument on other entity - "anent" - Standard_EXPORT void ReplaceEntity (const Standard_Integer nument, const Handle(Standard_Transient)& anent); + void ReplaceEntity (const Standard_Integer nument, const Handle(Standard_Transient)& anent) { theentities.Substitute(nument,anent); } //! Reverses the Numbers of the Entities, between and the //! total count of Entities. Thus, the entities : @@ -330,17 +316,17 @@ public: //! Returns the GlobalCheck, which memorizes messages global to //! the file (not specific to an Entity), especially Header - Standard_EXPORT const Handle(Interface_Check)& GlobalCheck (const Standard_Boolean syntactic = Standard_True) const; + const Handle(Interface_Check)& GlobalCheck (const Standard_Boolean syntactic = Standard_True) const { return (syntactic? thecheckstx : thechecksem); } //! Allows to modify GlobalCheck, after getting then completing it //! Remark : it is SYNTACTIC check. Semantics, see FillChecks - Standard_EXPORT void SetGlobalCheck (const Handle(Interface_Check)& ach); + void SetGlobalCheck (const Handle(Interface_Check)& ach) { thecheckstx = ach; } //! Minimum Semantic Global Check on data in model (header) //! Can only check basic Data. See also GlobalCheck from Protocol //! for a check which takes the Graph into account //! Default does nothing, can be redefined - Standard_EXPORT virtual void VerifyCheck (Handle(Interface_Check)& ach) const; + Standard_EXPORT virtual void VerifyCheck (Handle(Interface_Check)&) const {} //! Dumps Header in a short, easy to read, form, onto a Stream //! allows to print more or less parts of the header, @@ -382,36 +368,15 @@ public: //! This method is virtual, hence it can be redefined for a more //! efficient search (if exact is true). Standard_EXPORT virtual Standard_Integer NextNumberForLabel (const Standard_CString label, const Standard_Integer lastnum = 0, const Standard_Boolean exact = Standard_True) const; - - //! Returns true if a template is attached to a given name - Standard_EXPORT static Standard_Boolean HasTemplate (const Standard_CString name); - - //! Returns the template model attached to a name, or a Null Handle - Standard_EXPORT static Handle(Interface_InterfaceModel) Template (const Standard_CString name); - - //! Records a new template model with a name. If the name was - //! already recorded, the corresponding template is replaced by - //! the new one. Then, WARNING : test HasTemplate to avoid - //! surprises - Standard_EXPORT static Standard_Boolean SetTemplate (const Standard_CString name, const Handle(Interface_InterfaceModel)& model); - - //! Returns the complete list of names attached to template models - Standard_EXPORT static Handle(TColStd_HSequenceOfHAsciiString) ListTemplates(); - - DEFINE_STANDARD_RTTIEXT(Interface_InterfaceModel,MMgt_TShared) -protected: - + protected: //! Defines empty InterfaceModel, ready to be filled Standard_EXPORT Interface_InterfaceModel(); - - -private: - + private: TColStd_IndexedMapOfTransient theentities; TColStd_DataMapOfIntegerTransient thereports; @@ -422,14 +387,6 @@ private: Standard_Boolean isdispatch; Handle(TCollection_HAsciiString) thecategory; Handle(Interface_GTool) thegtool; - - }; - - - - - - #endif // _Interface_InterfaceModel_HeaderFile diff --git a/src/Interface/Interface_ShareTool.cxx b/src/Interface/Interface_ShareTool.cxx index bf86bd0f2b..ea4c58d7bc 100644 --- a/src/Interface/Interface_ShareTool.cxx +++ b/src/Interface/Interface_ShareTool.cxx @@ -25,150 +25,41 @@ #include #include #include -#include #include #include -Interface_ShareTool::Interface_ShareTool (const Handle(Interface_InterfaceModel)& amodel, - const Interface_GeneralLib& lib) +Standard_Boolean Interface_ShareTool::IsShared (const Handle(Standard_Transient)& ent) const { - theHGraph = new Interface_HGraph(amodel,lib); -} - -Interface_ShareTool::Interface_ShareTool (const Handle(Interface_InterfaceModel)& amodel, - const Handle(Interface_GTool)& gtool) -{ - theHGraph = new Interface_HGraph(amodel,gtool); -} - -Interface_ShareTool::Interface_ShareTool (const Handle(Interface_InterfaceModel)& amodel, - const Handle(Interface_Protocol)& protocol) -{ - theHGraph = new Interface_HGraph(amodel,protocol); -} - -Interface_ShareTool::Interface_ShareTool (const Handle(Interface_InterfaceModel)& amodel) -{ - theHGraph = new Interface_HGraph(amodel); -} - -Interface_ShareTool::Interface_ShareTool (const Interface_Graph& agraph) -{ - theHGraph = new Interface_HGraph(agraph.Model()); -} - -Interface_ShareTool::Interface_ShareTool (const Handle(Interface_HGraph)& ahgraph) -{ - theHGraph = ahgraph; -} - -// Ajout des "Implied" sur toutes les Entites du Graphe -/*void Interface_ShareTool::AddImplied (const Handle(Interface_GTool)& gtool) -{ - Interface_Graph& thegraph = theHGraph->CGraph(); - Standard_Integer nb = thegraph.Size(); - Standard_Boolean yena = Standard_False; - for (Standard_Integer i = 1; i <= nb; i ++) { - Handle(Standard_Transient) ent = thegraph.Entity(i); - if (ent.IsNull()) continue; - Handle(Interface_GeneralModule) module; Standard_Integer CN; - if (gtool->Select(ent,module,CN)) { - Interface_EntityIterator iter; - module->ListImpliedCase(CN,ent,iter); - if (iter.NbEntities() == 0) continue; - yena = Standard_True; - thegraph.SetShare(ent); - for (iter.Start(); iter.More(); iter.Next()) - thegraph.AddShared(ent,iter.Value()); - } - } - if (yena) thegraph.EvalSharings(); -}*/ - - - Handle(Interface_InterfaceModel) Interface_ShareTool::Model () const - { return theHGraph->Graph().Model(); } - - const Interface_Graph& Interface_ShareTool::Graph () const - { return theHGraph->Graph(); } - - Interface_EntityIterator Interface_ShareTool::RootEntities () const - { return theHGraph->Graph().RootEntities(); } - - Standard_Boolean Interface_ShareTool::IsShared - (const Handle(Standard_Transient)& ent) const -{ - const Interface_Graph& thegraph = theHGraph->Graph(); - Handle(TColStd_HSequenceOfTransient) list = - thegraph.GetShareds (ent); + Handle(TColStd_HSequenceOfTransient) list = Graph().GetShareds (ent); return (!list.IsNull() && list->Length() > 0); } - Interface_EntityIterator Interface_ShareTool::Shareds - (const Handle(Standard_Transient)& ent) const - { return theHGraph->Graph().Shareds(ent); } - - Interface_EntityIterator Interface_ShareTool::Sharings - (const Handle(Standard_Transient)& ent) const - { return theHGraph->Graph().Sharings(ent); } - - - Standard_Integer Interface_ShareTool::NbTypedSharings - (const Handle(Standard_Transient)& ent, - const Handle(Standard_Type)& atype) const +/*szv_c1:Standard_Integer Interface_ShareTool::NbTypedSharings (const Handle(Standard_Transient)& ent, const Handle(Standard_Type)& atype) const { - Interface_Graph& thegraph = theHGraph->CGraph(); - Handle(TColStd_HSequenceOfTransient) list = thegraph.GetSharings (ent); + Handle(TColStd_HSequenceOfTransient) list = Graph().GetSharings (ent); if(list.IsNull()) return 0; Standard_Integer result = 0; - Standard_Integer n = list->Length(); + const Standard_Integer n = list->Length(); for (Standard_Integer i = 1; i <= n; i ++) { - Handle(Standard_Transient) entsh = list->Value(i); + const Handle(Standard_Transient) &entsh = list->Value(i); if (entsh.IsNull()) continue; - if (entsh->IsKind(atype)) result ++; + if (entsh->IsKind(atype)) result++; } return result; -} - - Handle(Standard_Transient) Interface_ShareTool::TypedSharing - (const Handle(Standard_Transient)& ent, - const Handle(Standard_Type)& atype) const -{ - Interface_Graph& thegraph = theHGraph->CGraph(); - Handle(TColStd_HSequenceOfTransient) list = thegraph.GetSharings(ent); - if(list.IsNull()) - return 0; - Handle(Standard_Transient) entresult; - Standard_Integer result = 0; - Standard_Integer n = list->Length(); - for (Standard_Integer i = 1; i <= n; i ++) { - Handle(Standard_Transient) entsh = list->Value(i); - if (entsh.IsNull()) continue; - if (entsh->IsKind(atype)) { - entresult = entsh; - result ++; - if (result > 1) Interface_InterfaceError::Raise - ("Interface ShareTool : TypedSharing, more than one found"); - } - } - if (result == 0) Interface_InterfaceError::Raise - ("Interface ShareTool : TypedSharing, not found"); - return entresult; -} +}*/ - Interface_EntityIterator Interface_ShareTool::All -(const Handle(Standard_Transient)& ent, const Standard_Boolean rootlast) const +Interface_EntityIterator Interface_ShareTool::All (const Handle(Standard_Transient)& ent, const Standard_Boolean rootlast) const { - Handle(Interface_InterfaceModel) model = Model(); + const Handle(Interface_InterfaceModel) &model = Graph().Model(); Interface_EntityIterator list; Standard_Integer i, n0 = 0, nb = model->NbEntities(); Handle(TColStd_HArray1OfInteger) fl = new TColStd_HArray1OfInteger (0,nb); fl->Init(0); if (ent == model) { // On passe les racines en revue (l ordre de base est conserve) - Interface_EntityIterator roots = RootEntities(); + Interface_EntityIterator roots = Graph().RootEntities(); for (roots.Start(); roots.More(); roots.Next()) { Interface_EntityIterator subl = All(roots.Value(),rootlast); for (subl.Start(); subl.More(); subl.Next()) { @@ -189,7 +80,7 @@ Interface_ShareTool::Interface_ShareTool (const Handle(Interface_HGraph)& ahgrap Standard_Integer num = model->Number(en); if (fl->Value(num) != 0) continue; // deja vu n0 ++; fl->SetValue (num,n0); - Interface_EntityIterator sh = Shareds(en); + Interface_EntityIterator sh = Graph().Shareds(en); sq->Append (sh.Content()); } } @@ -204,14 +95,3 @@ Interface_ShareTool::Interface_ShareTool (const Handle(Interface_HGraph)& ahgrap return list; } - - void Interface_ShareTool::Print - (const Interface_EntityIterator& iter, const Handle(Message_Messenger)& S) const -{ - S << " Nb.Entities : " << iter.NbEntities() << " : "; - for (iter.Start(); iter.More(); iter.Next()) { - Handle(Standard_Transient) ent = iter.Value(); - S << " n0/id:"; Model()->Print(ent,S); - } - S< #include -#include -#include -#include -class Interface_HGraph; -class Standard_DomainError; -class Interface_InterfaceError; +#include class Interface_InterfaceModel; -class Interface_GeneralLib; -class Interface_GTool; -class Interface_Protocol; -class Interface_Graph; class Interface_EntityIterator; -class Standard_Transient; class Message_Messenger; @@ -45,62 +35,38 @@ class Message_Messenger; //! this can be usefull for Reference Checking class Interface_ShareTool { -public: + public: DEFINE_STANDARD_ALLOC - //! Creates a ShareTool from a Model and builds all required data, - //! by calling the General Service Library and Modules - //! (GeneralLib given as an argument) - Standard_EXPORT Interface_ShareTool(const Handle(Interface_InterfaceModel)& amodel, const Interface_GeneralLib& lib); - - //! Same a above, but GeneralLib is detained by a GTool - Standard_EXPORT Interface_ShareTool(const Handle(Interface_InterfaceModel)& amodel, const Handle(Interface_GTool)& gtool); - - //! Same a above, but GeneralLib is defined through a Protocol - //! Protocol is used to build the working library - Standard_EXPORT Interface_ShareTool(const Handle(Interface_InterfaceModel)& amodel, const Handle(Interface_Protocol)& protocol); - - //! Same as above, but works with the GTool of the Model - Standard_EXPORT Interface_ShareTool(const Handle(Interface_InterfaceModel)& amodel); - + //! works with the GTool of the Model + Interface_ShareTool(const Handle(Interface_InterfaceModel)& amodel) + : theHGraph(new Interface_HGraph(amodel)) + {} + //! Creates a ShareTool from an already defined Graph //! Remark that the data of the Graph are copied - Standard_EXPORT Interface_ShareTool(const Interface_Graph& agraph); - + Interface_ShareTool(const Interface_Graph& agraph) + : theHGraph(new Interface_HGraph(agraph.Model())) + {} + //! Completes the Graph by Adding Implied References. Hence, they //! are considered as Sharing References in all the other queries - Standard_EXPORT Interface_ShareTool(const Handle(Interface_HGraph)& ahgraph); - - //! Returns the Model used for Creation (directly or for Graph) - Standard_EXPORT Handle(Interface_InterfaceModel) Model() const; - + Interface_ShareTool(const Handle(Interface_HGraph)& ahgraph) + : theHGraph(ahgraph) + {} + //! Returns the data used by the ShareTool to work //! Can then be used directly (read only) - Standard_EXPORT const Interface_Graph& Graph() const; - - //! Returns the Entities which are not Shared (their Sharing List - //! is empty) in the Model - Standard_EXPORT Interface_EntityIterator RootEntities() const; - + const Interface_Graph& Graph() const { return theHGraph->Graph(); } + //! Returns True if is Shared by other Entities in the Model Standard_EXPORT Standard_Boolean IsShared (const Handle(Standard_Transient)& ent) const; - //! Returns the List of Entities Shared by a given Entity - Standard_EXPORT Interface_EntityIterator Shareds (const Handle(Standard_Transient)& ent) const; - - //! Returns the List of Entities Sharing a given Entity - Standard_EXPORT Interface_EntityIterator Sharings (const Handle(Standard_Transient)& ent) const; - //! Returns the count of Sharing Entities of an Entity, which //! are Kind of a given Type - Standard_EXPORT Standard_Integer NbTypedSharings (const Handle(Standard_Transient)& ent, const Handle(Standard_Type)& atype) const; - - //! Returns the Sharing Entity of an Entity, which is Kind of a - //! given Type. Allows to access a Sharing Entity of a given type - //! when there is one and only one (current case) - Standard_EXPORT Handle(Standard_Transient) TypedSharing (const Handle(Standard_Transient)& ent, const Handle(Standard_Type)& atype) const; + //szv_c1:Standard_EXPORT Standard_Integer NbTypedSharings (const Handle(Standard_Transient)& ent, const Handle(Standard_Type)& atype) const; //! Returns the complete list of entities shared by at any //! level, including itself @@ -110,33 +76,10 @@ public: //! entities and ends by the root. Else, the root is first and //! the lower level entities are at end Standard_EXPORT Interface_EntityIterator All (const Handle(Standard_Transient)& ent, const Standard_Boolean rootlast = Standard_True) const; - - //! Utility method which Prints the content of an iterator - //! (by their Numbers) - Standard_EXPORT void Print (const Interface_EntityIterator& iter, const Handle(Message_Messenger)& S) const; - - - - -protected: - - - - - -private: - + private: Handle(Interface_HGraph) theHGraph; - - }; - - - - - - #endif // _Interface_ShareTool_HeaderFile diff --git a/src/Interface/Interface_Statics.hxx b/src/Interface/Interface_Statics.hxx deleted file mode 100644 index 929c899748..0000000000 --- a/src/Interface/Interface_Statics.hxx +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -// Macros to help static Handles not to be "constructed" before main run -// In order to avoid it, the Handle to be statically reserved is encapsulated -// in a structure itself designated through a Null Pointer : -// Only the pointer is declared static, and initialized to NULL : then, -// there is no routine to call for static construction - -// Remember that the objet designated by a static Handle should not be created -// in the static declaration, but must anyway be created, during main run, -// once before its first use : this is the initialization step. - - -// This set of macros allows user to simply declare and use "static" Handles. -// It is available once having included this file : -// *************************************************** -// #include - -// Static construction is replaced by using the macro StaticHandle : -// *************************************************** -// Old statement : static Handle(pk_class) object; -// Is replaced by : StaticHandle(pk_class,object); -// which creates a null pointer called 'object_s' and typed 'pk_class_struc' - -// For first initialisation and use, several ways are available, all of them -// give an access to the Handle through a reference. -// It is required to initialize the static structure once, the macros Init* -// assume that it is created once and only once, even if they are called -// more than once. -// It is possible : to create the object at initialization time by a macro, -// or to create it after the macro call through its reference : - -// *************************************************** -// Old statement (in a routine, not static) : -// if (object.IsNull()) object = new pk_class (..args if any..); -// can be maintained, but preceeded by an initialization : -// InitHandle(pk_class,object); // -> Null Handle - -// *************************************************** -// or it can be replaced by a direct formula (creation called only once) : -// InitHandleVoid(pk_class,object); // for a void constructor -// or InitHandleArgs(pk_class,object,(..args..)); -// (the arglist between embedded parentheses) -// or InitHandleVal(pk_class,object,val); // i.e. object = val; - -// To simply use this pseudo-static object, consider -// either the static variable object_s->H -// *************************************************** -// or take it by the macro (which does not initialize it) -// UseHandle(pk_class,object); - - -// Declaration of a static Handle : first use for a given type -#define StaticHandle(type,var) static struct type##_struc { Handle(type) H; } *var##_s = NULL - -// Another declaration for an already declared type (with StaticHandle) -#define StaticHandleA(type,var) static struct type##_struc *var##_s = NULL - -// Using it (IT MUST HAVE BEEN FORMERLY INITIALIZED) -#define UseHandle(type,var) Handle(type)& var = var##_s->H - -// Initializing it (as Null Handle) -#define InitHandle(type,var) \ -if(!var##_s) { var##_s=new type##_struc; }\ -Handle(type)& var = var##_s->H; - -// Initializing it and Creating it by a Void Constructor -#define InitHandleVoid(type,var) \ -if(!var##_s) { var##_s=new type##_struc; var##_s->H=new type; }\ -Handle(type)& var = var##_s->H; - -// Initializing it and Creating it by a Constructor with Arguments -// (give them grouped in their parentheses) -#define InitHandleArgs(type,var,args) \ -if(!var##_s) { var##_s=new type##_struc; var##_s->H=new type args; }\ -Handle(type)& var = var##_s->H; - -// Initializing it from an already determined Value -#define InitHandleVal(type,var,value) \ -if(!var##_s) { var##_s=new type##_struc; var##_s->H=value; }\ -Handle(type)& var = var##_s->H; diff --git a/src/QABugs/QABugs_11.cxx b/src/QABugs/QABugs_11.cxx index a746d1ea5e..cf9f7b4dcf 100644 --- a/src/QABugs/QABugs_11.cxx +++ b/src/QABugs/QABugs_11.cxx @@ -4670,7 +4670,7 @@ static Standard_Integer OCC18612igesbrep (Draw_Interpretor& di, Standard_Integer di<<"spline_continuity (read) : "<ClearContext(); + thesession->TransferReader()->Context().Nullify(); XSDRAW::SetTransferProcess (thesession->TransferReader()->TransientProcess()); progress->NewScope ( 80, "Translation" ); progress->Show(); @@ -4771,7 +4771,7 @@ static Standard_Integer OCC18612igesbrep (Draw_Interpretor& di, Standard_Integer di<<"spline_continuity (read) : "<ClearContext(); + thesession->TransferReader()->Context().Nullify(); XSDRAW::SetTransferProcess (thesession->TransferReader()->TransientProcess()); progress->NewScope ( 80, "Translation" ); progress->Show(); diff --git a/src/QABugs/QABugs_16.cxx b/src/QABugs/QABugs_16.cxx index a4957a81d9..dfdc70e35a 100644 --- a/src/QABugs/QABugs_16.cxx +++ b/src/QABugs/QABugs_16.cxx @@ -587,8 +587,6 @@ static Standard_Integer OCC395 (Draw_Interpretor& di, Standard_Integer argc, con di << "Usage : " << argv[0] << " edge_result edge1 edge2\n"; return 1; } - //TCollection_AsciiString fnom(a[1]); - //Standard_Boolean modfic = XSDRAW::FileAndVar(a[1],a[2],a[3],"IGES",fnom,rnom,resnom); TopoDS_Shape Sh1 = DBRep::Get(argv[2]); TopoDS_Shape Sh2 = DBRep::Get(argv[3]); if(Sh1.IsNull() || Sh2.IsNull()) return 1; @@ -600,15 +598,9 @@ static Standard_Integer OCC395 (Draw_Interpretor& di, Standard_Integer argc, con Handle(Geom_Curve) ac1 = BRep_Tool::Curve(e1,f1,l1); Handle(Geom_Curve) ac2 = BRep_Tool::Curve(e2,f2,l2); if(e1.Orientation() == TopAbs_REVERSED) { - //Standard_Real cf = cf1; - //cf1 = ac1->ReversedParameter ( cl1 ); - //cl1 = ac1->ReversedParameter ( cf ); ac1 = ac1->Reversed(); } if(e2.Orientation() == TopAbs_REVERSED) { - //Standard_Real cf = cf2; - //ac2 = ac2->ReversedParameter ( cl2 ); - //ac2 = ac2->ReversedParameter ( cf ); ac2 = ac2->Reversed(); } Handle(Geom_BSplineCurve) bsplc1 = Handle(Geom_BSplineCurve)::DownCast(ac1); diff --git a/src/RWHeaderSection/RWHeaderSection.cxx b/src/RWHeaderSection/RWHeaderSection.cxx index b1d2f27262..f9e63df35b 100644 --- a/src/RWHeaderSection/RWHeaderSection.cxx +++ b/src/RWHeaderSection/RWHeaderSection.cxx @@ -12,25 +12,17 @@ // commercial license or contractual agreement. -#include -#include #include #include #include #include -/// #include static Handle(RWHeaderSection_ReadWriteModule) rwm; static Handle(RWHeaderSection_GeneralModule) rwg; - void RWHeaderSection::Init() { -/// EuclidStandard::Init(); - Handle(HeaderSection_Protocol) proto = HeaderSection::Protocol(); - StepData::AddHeaderProtocol(proto); + const Handle(StepData_Protocol) &hp = StepData::HeaderProtocol(); if (rwm.IsNull()) rwm = new RWHeaderSection_ReadWriteModule; if (rwg.IsNull()) rwg = new RWHeaderSection_GeneralModule; } - - diff --git a/src/RWHeaderSection/RWHeaderSection.hxx b/src/RWHeaderSection/RWHeaderSection.hxx index 2e92eeb9ab..e8a7d11179 100644 --- a/src/RWHeaderSection/RWHeaderSection.hxx +++ b/src/RWHeaderSection/RWHeaderSection.hxx @@ -18,53 +18,13 @@ #define _RWHeaderSection_HeaderFile #include -#include -#include -class RWHeaderSection_ReadWriteModule; -class RWHeaderSection_GeneralModule; -class RWHeaderSection_RWFileName; -class RWHeaderSection_RWFileDescription; -class RWHeaderSection_RWFileSchema; - - - -class RWHeaderSection +class RWHeaderSection { -public: + public: - DEFINE_STANDARD_ALLOC - - //! enforced the initialisation of the libraries Standard_EXPORT static void Init(); - - - - -protected: - - - - - -private: - - - - -friend class RWHeaderSection_ReadWriteModule; -friend class RWHeaderSection_GeneralModule; -friend class RWHeaderSection_RWFileName; -friend class RWHeaderSection_RWFileDescription; -friend class RWHeaderSection_RWFileSchema; - }; - - - - - - #endif // _RWHeaderSection_HeaderFile diff --git a/src/RWStepAP214/RWStepAP214.cxx b/src/RWStepAP214/RWStepAP214.cxx index af29097181..d25503fe49 100644 --- a/src/RWStepAP214/RWStepAP214.cxx +++ b/src/RWStepAP214/RWStepAP214.cxx @@ -22,14 +22,14 @@ #include #include -static int init = 0; - void RWStepAP214::Init() - { - if (init) return; init = 1; - RWHeaderSection::Init(); - Handle(StepAP214_Protocol) proto = StepAP214::Protocol(); - Interface_GeneralLib::SetGlobal (new RWStepAP214_GeneralModule,proto); - Interface_ReaderLib::SetGlobal (new RWStepAP214_ReadWriteModule,proto); - StepData_WriterLib::SetGlobal (new RWStepAP214_ReadWriteModule,proto); - } +{ + static int init = 0; + if (init) return; init = 1; + + RWHeaderSection::Init(); + const Handle(StepAP214_Protocol) &proto = StepAP214::Protocol(); + Interface_GeneralLib::SetGlobal (new RWStepAP214_GeneralModule,proto); + Interface_ReaderLib::SetGlobal (new RWStepAP214_ReadWriteModule,proto); + StepData_WriterLib::SetGlobal (new RWStepAP214_ReadWriteModule,proto); +} diff --git a/src/RWStepAP214/RWStepAP214.hxx b/src/RWStepAP214/RWStepAP214.hxx index af59444314..391e01876d 100644 --- a/src/RWStepAP214/RWStepAP214.hxx +++ b/src/RWStepAP214/RWStepAP214.hxx @@ -18,99 +18,13 @@ #define _RWStepAP214_HeaderFile #include -#include -#include - -class RWStepAP214_ReadWriteModule; -class RWStepAP214_GeneralModule; -class RWStepAP214_RWAutoDesignActualDateAndTimeAssignment; -class RWStepAP214_RWAutoDesignActualDateAssignment; -class RWStepAP214_RWAutoDesignApprovalAssignment; -class RWStepAP214_RWAutoDesignDateAndPersonAssignment; -class RWStepAP214_RWAutoDesignGroupAssignment; -class RWStepAP214_RWAutoDesignNominalDateAndTimeAssignment; -class RWStepAP214_RWAutoDesignNominalDateAssignment; -class RWStepAP214_RWAutoDesignOrganizationAssignment; -class RWStepAP214_RWAutoDesignPersonAndOrganizationAssignment; -class RWStepAP214_RWAutoDesignPresentedItem; -class RWStepAP214_RWAutoDesignSecurityClassificationAssignment; -class RWStepAP214_RWAutoDesignDocumentReference; -class RWStepAP214_RWAppliedDateAndTimeAssignment; -class RWStepAP214_RWAppliedDateAssignment; -class RWStepAP214_RWAppliedApprovalAssignment; -class RWStepAP214_RWAppliedGroupAssignment; -class RWStepAP214_RWAppliedOrganizationAssignment; -class RWStepAP214_RWAppliedPersonAndOrganizationAssignment; -class RWStepAP214_RWAppliedPresentedItem; -class RWStepAP214_RWAppliedSecurityClassificationAssignment; -class RWStepAP214_RWAppliedDocumentReference; -class RWStepAP214_RWAppliedExternalIdentificationAssignment; -class RWStepAP214_RWClass; -class RWStepAP214_RWExternallyDefinedClass; -class RWStepAP214_RWExternallyDefinedGeneralProperty; -class RWStepAP214_RWRepItemGroup; - - class RWStepAP214 { -public: + public: - DEFINE_STANDARD_ALLOC - - //! enforced the initialisation of the libraries Standard_EXPORT static void Init(); - - - - -protected: - - - - - -private: - - - - -friend class RWStepAP214_ReadWriteModule; -friend class RWStepAP214_GeneralModule; -friend class RWStepAP214_RWAutoDesignActualDateAndTimeAssignment; -friend class RWStepAP214_RWAutoDesignActualDateAssignment; -friend class RWStepAP214_RWAutoDesignApprovalAssignment; -friend class RWStepAP214_RWAutoDesignDateAndPersonAssignment; -friend class RWStepAP214_RWAutoDesignGroupAssignment; -friend class RWStepAP214_RWAutoDesignNominalDateAndTimeAssignment; -friend class RWStepAP214_RWAutoDesignNominalDateAssignment; -friend class RWStepAP214_RWAutoDesignOrganizationAssignment; -friend class RWStepAP214_RWAutoDesignPersonAndOrganizationAssignment; -friend class RWStepAP214_RWAutoDesignPresentedItem; -friend class RWStepAP214_RWAutoDesignSecurityClassificationAssignment; -friend class RWStepAP214_RWAutoDesignDocumentReference; -friend class RWStepAP214_RWAppliedDateAndTimeAssignment; -friend class RWStepAP214_RWAppliedDateAssignment; -friend class RWStepAP214_RWAppliedApprovalAssignment; -friend class RWStepAP214_RWAppliedGroupAssignment; -friend class RWStepAP214_RWAppliedOrganizationAssignment; -friend class RWStepAP214_RWAppliedPersonAndOrganizationAssignment; -friend class RWStepAP214_RWAppliedPresentedItem; -friend class RWStepAP214_RWAppliedSecurityClassificationAssignment; -friend class RWStepAP214_RWAppliedDocumentReference; -friend class RWStepAP214_RWAppliedExternalIdentificationAssignment; -friend class RWStepAP214_RWClass; -friend class RWStepAP214_RWExternallyDefinedClass; -friend class RWStepAP214_RWExternallyDefinedGeneralProperty; -friend class RWStepAP214_RWRepItemGroup; - }; - - - - - - #endif // _RWStepAP214_HeaderFile diff --git a/src/RWStepShape/RWStepShape_RWEdgeCurve.cxx b/src/RWStepShape/RWStepShape_RWEdgeCurve.cxx index 89c38a65ca..749b83d67f 100644 --- a/src/RWStepShape/RWStepShape_RWEdgeCurve.cxx +++ b/src/RWStepShape/RWStepShape_RWEdgeCurve.cxx @@ -36,8 +36,6 @@ void RWStepShape_RWEdgeCurve::ReadStep Handle(Interface_Check)& ach, const Handle(StepShape_EdgeCurve)& ent) const { - - // --- Number of Parameter Control --- if (!data->CheckNbParams(num,5,ach,"edge_curve")) return; @@ -120,18 +118,13 @@ void RWStepShape_RWEdgeCurve::Check const Interface_ShareTool& aShto, Handle(Interface_Check)& ach) const { -// cout << "------ calling CheckEdgeCurve ------" << endl; - Handle(StepShape_OrientedEdge) theOE1, theOE2; Handle(StepShape_FaceBound) theFOB1, theFOB2; - //Handle(StepShape_FaceSurface) theFS1, theFS2; Standard_Boolean theOEOri1 = Standard_True; Standard_Boolean theOEOri2 = Standard_True; Standard_Boolean theFBOri1 = Standard_True; Standard_Boolean theFBOri2 = Standard_True; - //Standard_Boolean theFSOri1 = Standard_True; - //Standard_Boolean theFSOri2 = Standard_True; Standard_Boolean Cumulated1, Cumulated2; // 1- First Vertex != LastVertex but First VertexPoint == Last VertexPoint @@ -155,15 +148,14 @@ void RWStepShape_RWEdgeCurve::Check if (!StartPoint.IsNull() && !EndPoint.IsNull()) { Standard_Real Dist = Sqrt - ((StartPoint->CoordinatesValue(1) - EndPoint->CoordinatesValue(1)) * - (StartPoint->CoordinatesValue(1) - EndPoint->CoordinatesValue(1)) + - (StartPoint->CoordinatesValue(2) - EndPoint->CoordinatesValue(2)) * - (StartPoint->CoordinatesValue(2) - EndPoint->CoordinatesValue(2)) + - (StartPoint->CoordinatesValue(3) - EndPoint->CoordinatesValue(3)) * - (StartPoint->CoordinatesValue(3) - EndPoint->CoordinatesValue(3))); - if (Dist < Precision::Confusion() ) { - ach->AddWarning("Two instances of Vertex have equal (within uncertainty) coordinates"); - } + ((StartPoint->CoordinatesValue(1) - EndPoint->CoordinatesValue(1)) * + (StartPoint->CoordinatesValue(1) - EndPoint->CoordinatesValue(1)) + + (StartPoint->CoordinatesValue(2) - EndPoint->CoordinatesValue(2)) * + (StartPoint->CoordinatesValue(2) - EndPoint->CoordinatesValue(2)) + + (StartPoint->CoordinatesValue(3) - EndPoint->CoordinatesValue(3)) * + (StartPoint->CoordinatesValue(3) - EndPoint->CoordinatesValue(3))); + if (Dist < Precision::Confusion() ) + ach->AddWarning("Two instances of Vertex have equal (within uncertainty) coordinates"); } } @@ -175,10 +167,10 @@ void RWStepShape_RWEdgeCurve::Check ach->AddFail("ERROR: EdgeCurve not referenced"); } else { - Interface_EntityIterator myShRef = aShto.Sharings(ent); + Interface_EntityIterator myShRef = aShto.Graph().Sharings(ent); myShRef.SelectType (STANDARD_TYPE(StepShape_OrientedEdge),Standard_True); nbRef = myShRef.NbEntities(); - if (nbRef ==2) { + if (nbRef == 2) { theOE1 = Handle(StepShape_OrientedEdge)::DownCast(myShRef.Value()); theOEOri1 = theOE1->Orientation(); myShRef.Next(); @@ -188,110 +180,84 @@ void RWStepShape_RWEdgeCurve::Check // get the FaceBound orientation for theOE1 Standard_Boolean sharOE1 = aShto.IsShared(theOE1); - if(!sharOE1){ -#ifdef OCCT_DEBUG - cout << "OrientedEdge1 not shared" <Orientation(); + } #ifdef OCCT_DEBUG - nbRef = + else cout << "EdgeLoop not referenced by FaceBound" << endl; #endif - myShRef.NbEntities(); - myShRef.Start(); - theFOB1 = Handle(StepShape_FaceBound)::DownCast(myShRef.Value()); - if (!theFOB1.IsNull()) { - theFBOri1 = theFOB1->Orientation(); - } - else { + } #ifdef OCCT_DEBUG - cout << "EdgeLoop not referenced by FaceBound" << endl; + else cout << "EdgeLoop1 not shared" < 1) + cout << "OrientedEdge referenced more than once" << endl;*/ + } #endif - } - else { - if (aShto.NbTypedSharings(theOE1, - STANDARD_TYPE(StepShape_EdgeLoop)) > 1) { + } #ifdef OCCT_DEBUG - cout << "OrientedEdge referenced more than once" << endl; + else cout << "OrientedEdge1 not shared" <Orientation(); #ifdef OCCT_DEBUG -// Standard_Integer nbRef = + else cout << "EdgeLoop not referenced by FaceBound" << endl; #endif -// unused myShRef.NbEntities(); - myShRef.Start(); - Handle(StepShape_EdgeLoop) theEL2 = - Handle(StepShape_EdgeLoop)::DownCast(myShRef.Value()); - Standard_Boolean sharEL2 = aShto.IsShared(theEL2); - if(!sharEL2){ + } #ifdef OCCT_DEBUG - cout << "EdgeLoop2 not shared" <Orientation(); - } - else { + } #ifdef OCCT_DEBUG - cout << "EdgeLoop not referenced by FaceBound" << endl; + else cout << "OrientedEdge2 not shared" <AddFail("ERROR: non 2-manifold topology"); - } + if (Cumulated1 == Cumulated2) + ach->AddFail("ERROR: non 2-manifold topology"); } } } diff --git a/src/RWStepShape/RWStepShape_RWFaceBound.cxx b/src/RWStepShape/RWStepShape_RWFaceBound.cxx index df6d20fbd5..70cc1635f6 100644 --- a/src/RWStepShape/RWStepShape_RWFaceBound.cxx +++ b/src/RWStepShape/RWStepShape_RWFaceBound.cxx @@ -104,7 +104,7 @@ void RWStepShape_RWFaceBound::Check for(Standard_Integer i=1; i<=nbEdg; i++) { Handle(StepShape_OrientedEdge) theOE1 = theEL1->EdgeListValue(i); Handle(StepShape_Edge) theEdg1 = theOE1->EdgeElement(); - Interface_EntityIterator myShRef = aShto.Sharings(theEdg1); + Interface_EntityIterator myShRef = aShto.Graph().Sharings(theEdg1); myShRef.SelectType (STANDARD_TYPE(StepShape_OrientedEdge),Standard_True); Standard_Integer nbRef = myShRef.NbEntities(); if(nbRef == 1) { @@ -129,7 +129,7 @@ void RWStepShape_RWFaceBound::Check #endif } else { - myShRef = aShto.Sharings(theOE2); + myShRef = aShto.Graph().Sharings(theOE2); myShRef.SelectType (STANDARD_TYPE(StepShape_EdgeLoop),Standard_True); myShRef.Start(); Handle(StepShape_EdgeLoop) theEL2 = @@ -141,7 +141,7 @@ void RWStepShape_RWFaceBound::Check #endif } else { - myShRef = aShto.Sharings(theEL2); + myShRef = aShto.Graph().Sharings(theEL2); myShRef.SelectType (STANDARD_TYPE(StepShape_FaceBound),Standard_True); myShRef.Start(); Handle(StepShape_FaceBound) theFB2 = diff --git a/src/STEPCAFControl/STEPCAFControl_Controller.cxx b/src/STEPCAFControl/STEPCAFControl_Controller.cxx index 1b5d41463a..889bf39f8f 100644 --- a/src/STEPCAFControl/STEPCAFControl_Controller.cxx +++ b/src/STEPCAFControl/STEPCAFControl_Controller.cxx @@ -15,7 +15,6 @@ #include -#include #include #include #include @@ -26,10 +25,10 @@ IMPLEMENT_STANDARD_RTTIEXT(STEPCAFControl_Controller,STEPControl_Controller) //function : STEPCAFControl_Controller //purpose : //======================================================================= + STEPCAFControl_Controller::STEPCAFControl_Controller () { - Handle(STEPCAFControl_ActorWrite) ActWrite = new STEPCAFControl_ActorWrite; - myAdaptorWrite = ActWrite; + myAdaptorWrite = new STEPCAFControl_ActorWrite; } //======================================================================= @@ -37,10 +36,10 @@ STEPCAFControl_Controller::STEPCAFControl_Controller () //purpose : //======================================================================= -Standard_Boolean STEPCAFControl_Controller::Init () +void STEPCAFControl_Controller::Init () { static Standard_Boolean inic = Standard_False; - if (inic) return Standard_True; + if (inic) return; inic = Standard_True; // self-registering Handle(STEPCAFControl_Controller) STEPCTL = new STEPCAFControl_Controller; @@ -68,6 +67,4 @@ Standard_Boolean STEPCAFControl_Controller::Init () Interface_Static::Init ("stepcaf", "read.stepcaf.subshapes.name", '&', "eval Off"); // 0 Interface_Static::Init ("stepcaf", "read.stepcaf.subshapes.name", '&', "eval On"); // 1 Interface_Static::SetIVal("read.stepcaf.subshapes.name", 0); // Disabled by default - - return Standard_True; } diff --git a/src/STEPCAFControl/STEPCAFControl_Controller.hxx b/src/STEPCAFControl/STEPCAFControl_Controller.hxx index bf5e782e6a..626eb3f253 100644 --- a/src/STEPCAFControl/STEPCAFControl_Controller.hxx +++ b/src/STEPCAFControl/STEPCAFControl_Controller.hxx @@ -20,7 +20,6 @@ #include #include -#include class STEPCAFControl_Controller; @@ -32,39 +31,19 @@ DEFINE_STANDARD_HANDLE(STEPCAFControl_Controller, STEPControl_Controller) //! (inherited automatically) class STEPCAFControl_Controller : public STEPControl_Controller { + public: -public: - - - //! Initializes the use of STEP Norm (the first time) - Standard_EXPORT STEPCAFControl_Controller(); - //! Standard Initialisation. It creates a Controller for STEP-XCAF //! and records it to various names, available to select it later //! Returns True when done, False if could not be done - Standard_EXPORT static Standard_Boolean Init(); - - - + Standard_EXPORT static void Init(); DEFINE_STANDARD_RTTIEXT(STEPCAFControl_Controller,STEPControl_Controller) -protected: - - - - -private: - - - + protected: + //! Initializes the use of STEP Norm (the first time) + Standard_EXPORT STEPCAFControl_Controller(); }; - - - - - - #endif // _STEPCAFControl_Controller_HeaderFile diff --git a/src/STEPControl/FILES b/src/STEPControl/FILES index 28e343dc60..5f81b40b1a 100644 --- a/src/STEPControl/FILES +++ b/src/STEPControl/FILES @@ -4,8 +4,12 @@ STEPControl_ActorWrite.cxx STEPControl_ActorWrite.hxx STEPControl_Controller.cxx STEPControl_Controller.hxx +STEPControl_FloatFormat.cxx +STEPControl_FloatFormat.hxx STEPControl_Reader.cxx STEPControl_Reader.hxx STEPControl_StepModelType.hxx +STEPControl_WorkLibrary.cxx +STEPControl_WorkLibrary.hxx STEPControl_Writer.cxx STEPControl_Writer.hxx diff --git a/src/STEPControl/STEPControl_ActorRead.cxx b/src/STEPControl/STEPControl_ActorRead.cxx index f78a843356..e7bdc91959 100644 --- a/src/STEPControl/STEPControl_ActorRead.cxx +++ b/src/STEPControl/STEPControl_ActorRead.cxx @@ -263,7 +263,7 @@ Standard_Boolean STEPControl_ActorRead::Recognize (const Handle(Standard_Transie // mapping // ============================================================================ -Handle(Transfer_Binder) STEPControl_ActorRead::Transferring (const Handle(Standard_Transient)& start, const Handle(Transfer_ProcessForTransient)& TP) +Handle(Transfer_Binder) STEPControl_ActorRead::Transferring (const Handle(Standard_Transient)& start, const Handle(Transfer_Process)& TP) { // [BEGIN] Get version of preprocessor (to detect I-Deas case) (ssv; 23.11.2010) Handle(StepData_StepModel) aStepModel = Handle(StepData_StepModel)::DownCast ( TP->Model() ); @@ -1426,7 +1426,6 @@ Handle(Transfer_Binder) STEPControl_ActorRead::TransferShape(const Handle(Standa Handle(Message_Messenger) sout = TP->Messenger(); #ifdef TRANSLOG // POUR MISE AU POINT, a supprimer ensuite -// sout<<"STEP->Shape, ent n0 "<Model()->Number(start)<<" Level="<NestingLevel()<TraceLevel() > 1) sout<<" -- Actor : Transfer Ent.n0 "<Model()->Number(start)<<" Type "<DynamicType()->Name()<PrepareForTransfer(); diff --git a/src/STEPControl/STEPControl_ActorWrite.hxx b/src/STEPControl/STEPControl_ActorWrite.hxx index 4e8ca23179..fb32e637ca 100644 --- a/src/STEPControl/STEPControl_ActorWrite.hxx +++ b/src/STEPControl/STEPControl_ActorWrite.hxx @@ -24,6 +24,7 @@ #include #include #include +class Transfer_Finder; class Transfer_FinderProcess; class StepShape_ShapeDefinitionRepresentation; class StepGeom_Axis2Placement3d; @@ -45,9 +46,9 @@ class STEPControl_ActorWrite : public Transfer_ActorOfFinderProcess SetMode(STEPControl_ShellBasedSurfaceModel); } - Standard_EXPORT virtual Standard_Boolean Recognize (const Handle(Standard_Transient)& start) Standard_OVERRIDE; + Standard_EXPORT Standard_Boolean Recognize (const Handle(Standard_Transient)& start) Standard_OVERRIDE; - Standard_EXPORT virtual Handle(Transfer_Binder) Transferring (const Handle(Standard_Transient)& start, const Handle(Transfer_ProcessForFinder)& FP) Standard_OVERRIDE; + Standard_EXPORT Handle(Transfer_Binder) Transferring (const Handle(Standard_Transient)& start, const Handle(Transfer_Process)& FP) Standard_OVERRIDE; Standard_EXPORT Handle(Transfer_Binder) TransferSubShape (const Handle(Transfer_Finder)& start, const Handle(StepShape_ShapeDefinitionRepresentation)& SDR, Handle(StepGeom_Axis2Placement3d)& AX1, const Handle(Transfer_FinderProcess)& FP, const Handle(TopTools_HSequenceOfShape)& shapeGroup = NULL, const Standard_Boolean isManifold = Standard_True); diff --git a/src/STEPControl/STEPControl_Controller.cxx b/src/STEPControl/STEPControl_Controller.cxx index dc3ec175a0..43172aaa32 100644 --- a/src/STEPControl/STEPControl_Controller.cxx +++ b/src/STEPControl/STEPControl_Controller.cxx @@ -14,43 +14,21 @@ //:j4 gka 16.03.99 S4134 // gka 05.04.99 S4136: parameters definitions changed -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include -#include +#include +#include #include -#include #include #include #include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include #include #include +#include IMPLEMENT_STANDARD_RTTIEXT(STEPControl_Controller,XSControl_Controller) @@ -60,7 +38,7 @@ STEPControl_Controller::STEPControl_Controller () { static Standard_Boolean init = Standard_False; if (!init) { - RWHeaderSection::Init(); RWStepAP214::Init(); + RWStepAP214::Init(); Interface_Static::Init ("step","write.step.product.name",'t',"Open CASCADE STEP translator " OCC_VERSION_STRING); Interface_Static::Init ("step","write.step.assembly",'e',""); @@ -206,10 +184,10 @@ STEPControl_Controller::STEPControl_Controller () ActWrite->SetGroupMode (Interface_Static::IVal("write.step.assembly")); myAdaptorWrite = ActWrite; - Handle(StepSelect_WorkLibrary) swl = new StepSelect_WorkLibrary; + Handle(STEPControl_WorkLibrary) swl = new STEPControl_WorkLibrary; swl->SetDumpLabel(1); myAdaptorLibrary = swl; - myAdaptorProtocol = STEPEdit::Protocol(); + myAdaptorProtocol = StepAP214::Protocol(); myAdaptorRead = new STEPControl_ActorRead; // par ex pour Recognize SetModeWrite (0,4); @@ -219,70 +197,12 @@ STEPControl_Controller::STEPControl_Controller () SetModeWriteHelp (3,"Manifold Solid"); SetModeWriteHelp (4,"Wireframe"); TraceStatic ("read.surfacecurve.mode",5); - - // --- SELECTIONS, SIGNATURES, COMPTEURS, EDITEURS - - DeclareAndCast(IFSelect_Selection,xmr,SessionItem("xst-model-roots")); - if (!xmr.IsNull()) { - Handle(IFSelect_Signature) sty = STEPEdit::SignType(); - AddSessionItem (sty,"step-type"); - Handle(IFSelect_SignCounter) tys = new IFSelect_SignCounter(sty,Standard_False,Standard_True); - AddSessionItem (tys,"step-types"); - - //szv:mySignType = sty; - - //pdn S4133 18.02.99 - AddSessionItem (new IFSelect_SignAncestor(),"xst-derived"); - - Handle(STEPSelections_SelectDerived) stdvar = new STEPSelections_SelectDerived(); - stdvar->SetProtocol(STEPEdit::Protocol()); - AddSessionItem (stdvar,"step-derived"); - - Handle(IFSelect_SelectSignature) selsdr = STEPEdit::NewSelectSDR(); - selsdr->SetInput (xmr); - AddSessionItem (selsdr,"step-shape-def-repr"); - - AddSessionItem (STEPEdit::NewSelectPlacedItem(),"step-placed-items"); - // input deja pret avec ModelAll - AddSessionItem (STEPEdit::NewSelectShapeRepr(),"step-shape-repr"); - } - - //pdn - Handle(STEPSelections_SelectFaces) stfaces = new STEPSelections_SelectFaces; - stfaces->SetInput (xmr); - AddSessionItem (stfaces,"step-faces"); - - Handle(STEPSelections_SelectInstances) stinst = new STEPSelections_SelectInstances; - AddSessionItem (stinst,"step-instances"); - - Handle(STEPSelections_SelectGSCurves) stcurves = new STEPSelections_SelectGSCurves; - stcurves->SetInput (xmr); - AddSessionItem (stcurves,"step-GS-curves"); - - Handle(STEPSelections_SelectAssembly) assembly = new STEPSelections_SelectAssembly; - assembly->SetInput (xmr); - AddSessionItem (assembly,"step-assembly"); - - Handle(APIHeaderSection_EditHeader) edhead = new APIHeaderSection_EditHeader; - Handle(IFSelect_EditForm) edheadf = new IFSelect_EditForm (edhead,Standard_False,Standard_True,"Step Header"); - AddSessionItem (edhead,"step-header-edit"); - AddSessionItem (edheadf,"step-header"); - - Handle(STEPEdit_EditContext) edctx = new STEPEdit_EditContext; - Handle(IFSelect_EditForm) edctxf = new IFSelect_EditForm (edctx,Standard_False,Standard_True,"STEP Product Definition Context"); - AddSessionItem (edctx,"step-context-edit"); - AddSessionItem (edctxf,"step-context"); - - - Handle(STEPEdit_EditSDR) edsdr = new STEPEdit_EditSDR; - Handle(IFSelect_EditForm) edsdrf = new IFSelect_EditForm (edsdr,Standard_False,Standard_True,"STEP Product Data (SDR)"); - AddSessionItem (edsdr,"step-SDR-edit"); - AddSessionItem (edsdrf,"step-SDR-data"); } Handle(Interface_InterfaceModel) STEPControl_Controller::NewModel () const { - return STEPEdit::NewModel(); + APIHeaderSection_MakeHeader head; + return head.NewModel(StepAP214::Protocol()); } // #### PROVISOIRE ??? #### @@ -303,97 +223,18 @@ IFSelect_ReturnStatus STEPControl_Controller::TransferWriteShape return XSControl_Controller::TransferWriteShape (shape,FP,model,modeshape); } -Standard_Boolean STEPControl_Controller::Init () +//======================================================================= +//function : Init +//purpose : +//======================================================================= + +void STEPControl_Controller::Init () { static Standard_Boolean inic = Standard_False; if (!inic) { + inic = Standard_True; Handle(STEPControl_Controller) STEPCTL = new STEPControl_Controller; STEPCTL->AutoRecord(); // avec les noms donnes a la construction XSAlgo::Init(); - inic = Standard_True; } - return Standard_True; -} -//======================================================================= -//function : Customise -//purpose : -//======================================================================= - -void STEPControl_Controller::Customise(Handle(XSControl_WorkSession)& WS) -{ - XSControl_Controller::Customise(WS); - - Handle(IFSelect_SelectModelRoots) slr; - Handle(Standard_Transient) slr1 = WS->NamedItem("xst-model-roots"); - if(!slr1.IsNull()) - slr = Handle(IFSelect_SelectModelRoots)::DownCast(slr1); - else { - slr = new IFSelect_SelectModelRoots; - WS->AddNamedItem ("xst-model-roots",slr); - } - - Handle(STEPSelections_SelectForTransfer) st1= new STEPSelections_SelectForTransfer; - st1->SetReader (WS->TransferReader()); - WS->AddNamedItem ("xst-transferrable-roots",st1); - - if (!slr.IsNull()) { - Handle(IFSelect_Signature) sty = STEPEdit::SignType(); - WS->AddNamedItem ("step-type",sty); - - Handle(IFSelect_SignCounter) tys = new IFSelect_SignCounter(sty,Standard_False,Standard_True); - WS->AddNamedItem ("step-types",tys); - - //szv:mySignType = sty; - WS->SetSignType( sty ); - - //pdn S4133 18.02.99 - WS->AddNamedItem ("xst-derived",new IFSelect_SignAncestor()); - Handle(STEPSelections_SelectDerived) stdvar = new STEPSelections_SelectDerived(); - stdvar->SetProtocol(STEPEdit::Protocol()); - WS->AddNamedItem ("step-derived",stdvar); - - Handle(IFSelect_SelectSignature) selsdr = STEPEdit::NewSelectSDR(); - selsdr->SetInput (slr); - WS->AddNamedItem ("step-shape-def-repr",selsdr); - Handle(IFSelect_SelectSignature) selrrs = STEPEdit::NewSelectPlacedItem(); - WS->AddNamedItem ("step-placed-items",selrrs); - Handle(IFSelect_SelectSignature) selsr = STEPEdit::NewSelectShapeRepr(); - // input deja pret avec ModelAll - WS->AddNamedItem ("step-shape-repr",selsr); - } - - //pdn - Handle(STEPSelections_SelectFaces) stfaces = new STEPSelections_SelectFaces; - stfaces->SetInput (slr); - WS->AddNamedItem ("step-faces",stfaces); - - Handle(STEPSelections_SelectInstances) stinst = new STEPSelections_SelectInstances; - WS->AddNamedItem ("step-instances",stinst); - - Handle(STEPSelections_SelectGSCurves) stcurves = new STEPSelections_SelectGSCurves; - stcurves->SetInput (slr); - WS->AddNamedItem ("step-GS-curves",stcurves); - - Handle(STEPSelections_SelectAssembly) assembly = new STEPSelections_SelectAssembly; - assembly->SetInput (slr); - WS->AddNamedItem ("step-assembly",assembly); - - Handle(APIHeaderSection_EditHeader) edhead = new APIHeaderSection_EditHeader; - Handle(IFSelect_EditForm) edheadf = new IFSelect_EditForm (edhead,Standard_False,Standard_True,"Step Header"); - WS->AddNamedItem ("step-header-edit",edhead); - WS->AddNamedItem ("step-header",edheadf); - - Handle(STEPEdit_EditContext) edctx = new STEPEdit_EditContext; - Handle(IFSelect_EditForm) edctxf = new IFSelect_EditForm (edctx,Standard_False,Standard_True,"STEP Product Definition Context"); - WS->AddNamedItem ("step-context-edit",edctx); - WS->AddNamedItem ("step-context",edctxf); - - - Handle(STEPEdit_EditSDR) edsdr = new STEPEdit_EditSDR; - Handle(IFSelect_EditForm) edsdrf = new IFSelect_EditForm (edsdr,Standard_False,Standard_True,"STEP Product Data (SDR)"); - WS->AddNamedItem ("step-SDR-edit",edsdr); - WS->AddNamedItem ("step-SDR-data",edsdrf); - - - } diff --git a/src/STEPControl/STEPControl_Controller.hxx b/src/STEPControl/STEPControl_Controller.hxx index 454a35987f..b3d68ae041 100644 --- a/src/STEPControl/STEPControl_Controller.hxx +++ b/src/STEPControl/STEPControl_Controller.hxx @@ -37,19 +37,11 @@ DEFINE_STANDARD_HANDLE(STEPControl_Controller, XSControl_Controller) //! defines basic controller for STEP processor class STEPControl_Controller : public XSControl_Controller { - -public: - - - //! Initializes the use of STEP Norm (the first time) and - //! returns a Controller - Standard_EXPORT STEPControl_Controller(); + public: //! Creates a new empty Model ready to receive data of the Norm. //! It is taken from STEP Template Model - Standard_EXPORT Handle(Interface_InterfaceModel) NewModel() const Standard_OVERRIDE; - - Standard_EXPORT virtual void Customise (Handle(XSControl_WorkSession)& WS) Standard_OVERRIDE; + Standard_EXPORT virtual Handle(Interface_InterfaceModel) NewModel() const Standard_OVERRIDE; //! Takes one Shape and transfers it to the InterfaceModel //! (already created by NewModel for instance) @@ -62,29 +54,15 @@ public: //! Standard Initialisation. It creates a Controller for STEP //! and records it to various names, available to select it later //! Returns True when done, False if could not be done - Standard_EXPORT static Standard_Boolean Init(); - - - + Standard_EXPORT static void Init(); DEFINE_STANDARD_RTTIEXT(STEPControl_Controller,XSControl_Controller) -protected: - - - - -private: - - - + protected: + //! Initializes the use of STEP Norm (the first time) and + //! returns a Controller + Standard_EXPORT STEPControl_Controller(); }; - - - - - - #endif // _STEPControl_Controller_HeaderFile diff --git a/src/StepSelect/StepSelect_FloatFormat.cxx b/src/STEPControl/STEPControl_FloatFormat.cxx similarity index 69% rename from src/StepSelect/StepSelect_FloatFormat.cxx rename to src/STEPControl/STEPControl_FloatFormat.cxx index 1971942f64..cef331634d 100644 --- a/src/StepSelect/StepSelect_FloatFormat.cxx +++ b/src/STEPControl/STEPControl_FloatFormat.cxx @@ -11,23 +11,20 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. - -#include -#include -#include +#include #include -#include -#include #include -IMPLEMENT_STANDARD_RTTIEXT(StepSelect_FloatFormat,StepSelect_FileModifier) +IMPLEMENT_STANDARD_RTTIEXT(STEPControl_FloatFormat,IFSelect_GeneralModifier) + +STEPControl_FloatFormat::STEPControl_FloatFormat () +: IFSelect_GeneralModifier (Standard_False), + thezerosup (Standard_True) , themainform ("%E") , + theformrange ("%f") , therangemin (0.1) , therangemax (1000.) +{} -StepSelect_FloatFormat::StepSelect_FloatFormat () - : thezerosup (Standard_True) , themainform ("%E") , - theformrange ("%f") , therangemin (0.1) , therangemax (1000.) - { } - void StepSelect_FloatFormat::SetDefault (const Standard_Integer digits) +void STEPControl_FloatFormat::SetDefault (const Standard_Integer digits) { themainform.Clear(); theformrange.Clear(); @@ -46,21 +43,20 @@ StepSelect_FloatFormat::StepSelect_FloatFormat () thezerosup = Standard_True; } - void StepSelect_FloatFormat::SetZeroSuppress (const Standard_Boolean mode) - { thezerosup = mode; } - void StepSelect_FloatFormat::SetFormat (const Standard_CString format) - { themainform.Clear(); themainform.AssignCat(format); } +void STEPControl_FloatFormat::SetFormat (const Standard_CString format) +{ themainform.Clear(); themainform.AssignCat(format); } - void StepSelect_FloatFormat::SetFormatForRange +void STEPControl_FloatFormat::SetFormatForRange (const Standard_CString form, const Standard_Real R1, const Standard_Real R2) { theformrange.Clear(); theformrange.AssignCat(form); therangemin = R1; therangemax = R2; } - void StepSelect_FloatFormat::Format + +void STEPControl_FloatFormat::Format (Standard_Boolean& zerosup, TCollection_AsciiString& mainform, Standard_Boolean& hasrange, TCollection_AsciiString& formrange, Standard_Real& rangemin, Standard_Real& rangemax) const @@ -74,9 +70,7 @@ StepSelect_FloatFormat::StepSelect_FloatFormat () } - void StepSelect_FloatFormat::Perform - (IFSelect_ContextWrite& /*ctx*/, - StepData_StepWriter& writer) const +void STEPControl_FloatFormat::Perform (StepData_StepWriter& writer) const { writer.FloatWriter().SetFormat (themainform.ToCString()); writer.FloatWriter().SetZeroSuppress (thezerosup); @@ -84,7 +78,8 @@ StepSelect_FloatFormat::StepSelect_FloatFormat () (theformrange.ToCString(), therangemin, therangemax); } - TCollection_AsciiString StepSelect_FloatFormat::Label () const + +TCollection_AsciiString STEPControl_FloatFormat::Label () const { TCollection_AsciiString lab("Float Format "); if (thezerosup) lab.AssignCat(" ZeroSuppress"); diff --git a/src/StepSelect/StepSelect_FloatFormat.hxx b/src/STEPControl/STEPControl_FloatFormat.hxx similarity index 79% rename from src/StepSelect/StepSelect_FloatFormat.hxx rename to src/STEPControl/STEPControl_FloatFormat.hxx index 0832978b11..49a39aa734 100644 --- a/src/StepSelect/StepSelect_FloatFormat.hxx +++ b/src/STEPControl/STEPControl_FloatFormat.hxx @@ -14,40 +14,31 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#ifndef _StepSelect_FloatFormat_HeaderFile -#define _StepSelect_FloatFormat_HeaderFile +#ifndef _STEPControl_FloatFormat_HeaderFile +#define _STEPControl_FloatFormat_HeaderFile #include #include -#include #include -#include -#include -#include -#include -class TCollection_AsciiString; -class IFSelect_ContextWrite; +#include class StepData_StepWriter; - -class StepSelect_FloatFormat; -DEFINE_STANDARD_HANDLE(StepSelect_FloatFormat, StepSelect_FileModifier) +class STEPControl_FloatFormat; +DEFINE_STANDARD_HANDLE(STEPControl_FloatFormat, IFSelect_GeneralModifier) //! This class gives control out format for floatting values : //! ZeroSuppress or no, Main Format, Format in Range (for values //! around 1.), as StepWriter allows to manage it. //! Formats are given under C-printf form -class StepSelect_FloatFormat : public StepSelect_FileModifier +class STEPControl_FloatFormat : public IFSelect_GeneralModifier { + public: -public: - - //! Creates a new FloatFormat, with standard options : //! ZeroSuppress, Main Format = %E, //! Format between 0.001 and 1000. = %f - Standard_EXPORT StepSelect_FloatFormat(); + Standard_EXPORT STEPControl_FloatFormat(); //! Sets FloatFormat to default value (see Create) but if //! is given positive, it commands Formats (main and range) to @@ -55,7 +46,7 @@ public: Standard_EXPORT void SetDefault (const Standard_Integer digits = 0); //! Sets ZeroSuppress mode to a new value - Standard_EXPORT void SetZeroSuppress (const Standard_Boolean mode); + void SetZeroSuppress (const Standard_Boolean mode) { thezerosup = mode; } //! Sets Main Format to a new value //! Remark : SetFormat, SetZeroSuppress and SetFormatForRange are @@ -84,38 +75,21 @@ public: //! Sets the Floatting Formats of StepWriter to the recorded //! parameters - Standard_EXPORT void Perform (IFSelect_ContextWrite& ctx, StepData_StepWriter& writer) const Standard_OVERRIDE; + Standard_EXPORT void Perform (StepData_StepWriter& writer) const; //! Returns specific Label : for instance, //! "Float Format [ZeroSuppress] %E [, in range R1-R2 %f]" Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE; + DEFINE_STANDARD_RTTIEXT(STEPControl_FloatFormat,IFSelect_GeneralModifier) - - - DEFINE_STANDARD_RTTIEXT(StepSelect_FloatFormat,StepSelect_FileModifier) - -protected: - - - - -private: - + private: Standard_Boolean thezerosup; TCollection_AsciiString themainform; TCollection_AsciiString theformrange; Standard_Real therangemin; Standard_Real therangemax; - - }; - - - - - - -#endif // _StepSelect_FloatFormat_HeaderFile +#endif // _STEPControl_FloatFormat_HeaderFile diff --git a/src/StepSelect/StepSelect_WorkLibrary.cxx b/src/STEPControl/STEPControl_WorkLibrary.cxx similarity index 89% rename from src/StepSelect/StepSelect_WorkLibrary.cxx rename to src/STEPControl/STEPControl_WorkLibrary.cxx index 272f079a0b..9c51b60656 100644 --- a/src/StepSelect/StepSelect_WorkLibrary.cxx +++ b/src/STEPControl/STEPControl_WorkLibrary.cxx @@ -35,16 +35,16 @@ #include #include #include -#include -#include +#include +#include #include #include #include #include -IMPLEMENT_STANDARD_RTTIEXT(StepSelect_WorkLibrary,IFSelect_WorkLibrary) +IMPLEMENT_STANDARD_RTTIEXT(STEPControl_WorkLibrary,IFSelect_WorkLibrary) -StepSelect_WorkLibrary::StepSelect_WorkLibrary +STEPControl_WorkLibrary::STEPControl_WorkLibrary (const Standard_Boolean copymode) : thecopymode (copymode) , thelabmode (0) { @@ -56,13 +56,7 @@ StepSelect_WorkLibrary::StepSelect_WorkLibrary // rq : les init sont faits par ailleurs, pas de souci a se faire -void StepSelect_WorkLibrary::SetDumpLabel (const Standard_Integer mode) -{ - thelabmode = mode; -} - - -Standard_Integer StepSelect_WorkLibrary::ReadFile +Standard_Integer STEPControl_WorkLibrary::ReadFile (const Standard_CString name, Handle(Interface_InterfaceModel)& model, const Handle(Interface_Protocol)& protocol) const @@ -79,7 +73,7 @@ Standard_Integer StepSelect_WorkLibrary::ReadFile } -Standard_Boolean StepSelect_WorkLibrary::WriteFile +Standard_Boolean STEPControl_WorkLibrary::WriteFile (IFSelect_ContextWrite& ctx) const { // Preparation @@ -103,13 +97,12 @@ Standard_Boolean StepSelect_WorkLibrary::WriteFile Standard_Integer nbmod = ctx.NbModifiers(); for (Standard_Integer numod = 1; numod <= nbmod; numod ++) { ctx.SetModifier (numod); - DeclareAndCast(StepSelect_FileModifier,filemod,ctx.FileModifier()); - if (!filemod.IsNull()) filemod->Perform(ctx,SW); + DeclareAndCast(STEPControl_FloatFormat,filemod,ctx.FileModifier()); + if (!filemod.IsNull()) filemod->Perform(SW); // (impressions de mise au point) sout << " .. FileMod." << numod << filemod->Label(); if (ctx.IsForAll()) sout << " (all model)"; else sout << " (" << ctx.NbEntities() << " entities)"; -// sout << flush; } // Envoi @@ -130,7 +123,7 @@ Standard_Boolean StepSelect_WorkLibrary::WriteFile } -Standard_Boolean StepSelect_WorkLibrary::CopyModel +Standard_Boolean STEPControl_WorkLibrary::CopyModel (const Handle(Interface_InterfaceModel)& original, const Handle(Interface_InterfaceModel)& newmodel, const Interface_EntityIterator& list, @@ -142,7 +135,7 @@ Standard_Boolean StepSelect_WorkLibrary::CopyModel } -void StepSelect_WorkLibrary::DumpEntity +void STEPControl_WorkLibrary::DumpEntity (const Handle(Interface_InterfaceModel)& model, const Handle(Interface_Protocol)& protocol, const Handle(Standard_Transient)& entity, diff --git a/src/StepSelect/StepSelect_WorkLibrary.hxx b/src/STEPControl/STEPControl_WorkLibrary.hxx similarity index 84% rename from src/StepSelect/StepSelect_WorkLibrary.hxx rename to src/STEPControl/STEPControl_WorkLibrary.hxx index 4f09ef3943..7795d1b82b 100644 --- a/src/StepSelect/StepSelect_WorkLibrary.hxx +++ b/src/STEPControl/STEPControl_WorkLibrary.hxx @@ -14,8 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#ifndef _StepSelect_WorkLibrary_HeaderFile -#define _StepSelect_WorkLibrary_HeaderFile +#ifndef _STEPControl_WorkLibrary_HeaderFile +#define _STEPControl_WorkLibrary_HeaderFile #include #include @@ -33,26 +33,24 @@ class Standard_Transient; class Message_Messenger; -class StepSelect_WorkLibrary; -DEFINE_STANDARD_HANDLE(StepSelect_WorkLibrary, IFSelect_WorkLibrary) +class STEPControl_WorkLibrary; +DEFINE_STANDARD_HANDLE(STEPControl_WorkLibrary, IFSelect_WorkLibrary) //! Performs Read and Write a STEP File with a STEP Model //! Following the protocols, Copy may be implemented or not -class StepSelect_WorkLibrary : public IFSelect_WorkLibrary +class STEPControl_WorkLibrary : public IFSelect_WorkLibrary { + public: -public: - - //! Creates a STEP WorkLibrary //! precises whether Copy is implemented or not - Standard_EXPORT StepSelect_WorkLibrary(const Standard_Boolean copymode = Standard_True); + Standard_EXPORT STEPControl_WorkLibrary(const Standard_Boolean copymode = Standard_True); //! Selects a mode to dump entities //! 0 (D) : prints numbers, then displays table number/label //! 1 : prints labels, then displays table label/number //! 2 : prints labels onky - Standard_EXPORT void SetDumpLabel (const Standard_Integer mode); + void SetDumpLabel (const Standard_Integer mode) { thelabmode = mode; } //! Reads a STEP File and returns a STEP Model (into ), //! or lets "Null" in case of Error @@ -77,29 +75,12 @@ public: //! sub-level : immediately shared entities) Standard_EXPORT void DumpEntity (const Handle(Interface_InterfaceModel)& model, const Handle(Interface_Protocol)& protocol, const Handle(Standard_Transient)& entity, const Handle(Message_Messenger)& S, const Standard_Integer level) const Standard_OVERRIDE; + DEFINE_STANDARD_RTTIEXT(STEPControl_WorkLibrary,IFSelect_WorkLibrary) - - - DEFINE_STANDARD_RTTIEXT(StepSelect_WorkLibrary,IFSelect_WorkLibrary) - -protected: - - - - -private: - + private: Standard_Boolean thecopymode; Standard_Integer thelabmode; - - }; - - - - - - -#endif // _StepSelect_WorkLibrary_HeaderFile +#endif // _STEPControl_WorkLibrary_HeaderFile diff --git a/src/STEPEdit/FILES b/src/STEPEdit/FILES index 7e99a43fba..fef053fb32 100644 --- a/src/STEPEdit/FILES +++ b/src/STEPEdit/FILES @@ -1,5 +1,3 @@ -STEPEdit.cxx -STEPEdit.hxx STEPEdit_EditContext.cxx STEPEdit_EditContext.hxx STEPEdit_EditSDR.cxx diff --git a/src/STEPEdit/STEPEdit.cxx b/src/STEPEdit/STEPEdit.cxx deleted file mode 100644 index 42e1295cf6..0000000000 --- a/src/STEPEdit/STEPEdit.cxx +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -Handle(Interface_Protocol) STEPEdit::Protocol () -{ -/* - static Handle(StepData_FileProtocol) proto; - if (!proto.IsNull()) return proto; - proto = new StepData_FileProtocol; - proto->Add (StepAP214::Protocol()); - proto->Add (HeaderSection::Protocol()); - return proto; -*/ - return StepAP214::Protocol(); -} - -Handle(StepData_StepModel) STEPEdit::NewModel () -{ - APIHeaderSection_MakeHeader head; - return head.NewModel(STEPEdit::Protocol()); -} - -Handle(IFSelect_Signature) STEPEdit::SignType () -{ - static Handle(StepSelect_StepType) sty; - if (!sty.IsNull()) return sty; - sty = new StepSelect_StepType; - sty->SetProtocol (STEPEdit::Protocol()); - return sty; -} - -Handle(IFSelect_SelectSignature) STEPEdit::NewSelectSDR () -{ - Handle(IFSelect_SelectSignature) sel = new IFSelect_SelectSignature - (STEPEdit::SignType(),"SHAPE_DEFINITION_REPRESENTATION"); - sel->SetInput (new IFSelect_SelectModelRoots); - return sel; -} - -Handle(IFSelect_SelectSignature) STEPEdit::NewSelectPlacedItem () -{ - Handle(IFSelect_SelectSignature) sel = new IFSelect_SelectSignature - (STEPEdit::SignType(),"MAPPED_ITEM|CONTEXT_DEPENDENT_SHAPE_REPRESENTATION",Standard_False); - sel->SetInput (new IFSelect_SelectModelEntities); - return sel; -} - -Handle(IFSelect_SelectSignature) STEPEdit::NewSelectShapeRepr () -{ - Handle(IFSelect_SelectSignature) sel = new IFSelect_SelectSignature - (STEPEdit::SignType(),"SHAPE_REPRESENTATION",Standard_False); -// REPRESENTATION_RELATIONSHIP passe par CONTEXT_DEPENDENT_SHAPE_REPRESENTATION - sel->SetInput (new IFSelect_SelectModelEntities); - return sel; -} diff --git a/src/STEPEdit/STEPEdit.hxx b/src/STEPEdit/STEPEdit.hxx deleted file mode 100644 index 5e323a6ba6..0000000000 --- a/src/STEPEdit/STEPEdit.hxx +++ /dev/null @@ -1,93 +0,0 @@ -// Created on: 1998-07-29 -// Created by: Christian CAILLET -// Copyright (c) 1998-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _STEPEdit_HeaderFile -#define _STEPEdit_HeaderFile - -#include -#include -#include - -class Interface_Protocol; -class StepData_StepModel; -class IFSelect_Signature; -class IFSelect_SelectSignature; -class STEPEdit_EditContext; -class STEPEdit_EditSDR; - - -//! Provides tools to exploit and edit a set of STEP data : -//! editors, selections .. -class STEPEdit -{ -public: - - DEFINE_STANDARD_ALLOC - - - //! Returns a Protocol fit for STEP (creates the first time) - Standard_EXPORT static Handle(Interface_Protocol) Protocol(); - - //! Returns a new empty StepModel fit for STEP - //! i.e. with its header determined from Protocol - Standard_EXPORT static Handle(StepData_StepModel) NewModel(); - - //! Returns a SignType fit for STEP (creates the first time) - Standard_EXPORT static Handle(IFSelect_Signature) SignType(); - - //! Creates a Selection for ShapeDefinitionRepresentation - //! By default searches among root entities - Standard_EXPORT static Handle(IFSelect_SelectSignature) NewSelectSDR(); - - //! Creates a Selection for Placed Items, i.e. MappedItem or - //! ContextDependentShapeRepresentation, which itself refers to a - //! RepresentationRelationship with possible subtypes (Shape... - //! and/or ...WithTransformation) - //! By default in the whole StepModel - Standard_EXPORT static Handle(IFSelect_SelectSignature) NewSelectPlacedItem(); - - //! Creates a Selection for ShapeRepresentation and its sub-types, - //! plus ContextDependentShapeRepresentation (which is not a - //! sub-type of ShapeRepresentation) - //! By default in the whole StepModel - Standard_EXPORT static Handle(IFSelect_SelectSignature) NewSelectShapeRepr(); - - - - -protected: - - - - - -private: - - - - -friend class STEPEdit_EditContext; -friend class STEPEdit_EditSDR; - -}; - - - - - - - -#endif // _STEPEdit_HeaderFile diff --git a/src/STEPSelections/STEPSelections_SelectInstances.cxx b/src/STEPSelections/STEPSelections_SelectInstances.cxx index bc4e8ea15a..763de43b24 100644 --- a/src/STEPSelections/STEPSelections_SelectInstances.cxx +++ b/src/STEPSelections/STEPSelections_SelectInstances.cxx @@ -143,7 +143,7 @@ Interface_EntityIterator STEPSelections_SelectInstances::RootResult(const Interf Interface_EntityIterator roots = G.RootEntities(); myGraph = new Interface_HGraph(G); - myEntities.Destroy(); + myEntities.Start(); for (roots.Start(); roots.More(); roots.Next()) AddInstances(roots.Value(), G, myEntities); } diff --git a/src/StepAP214/StepAP214.cxx b/src/StepAP214/StepAP214.cxx index 77702ead72..26fa200a0f 100644 --- a/src/StepAP214/StepAP214.cxx +++ b/src/StepAP214/StepAP214.cxx @@ -11,17 +11,15 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. - -#include #include #include -StaticHandle(StepAP214_Protocol, proto); - -Handle(StepAP214_Protocol) StepAP214::Protocol() - - { - InitHandleVoid(StepAP214_Protocol, proto); - return proto; - } +//szv_c1:StaticHandle(StepAP214_Protocol, proto); +static Handle(StepAP214_Protocol) proto; +const Handle(StepAP214_Protocol) & StepAP214::Protocol() +{ + //szv_c1:InitHandleVoid(StepAP214_Protocol, proto); + if (proto.IsNull()) proto = new StepAP214_Protocol; + return proto; +} diff --git a/src/StepAP214/StepAP214.hxx b/src/StepAP214/StepAP214.hxx index c603454984..372e40b1bb 100644 --- a/src/StepAP214/StepAP214.hxx +++ b/src/StepAP214/StepAP214.hxx @@ -18,136 +18,18 @@ #define _StepAP214_HeaderFile #include -#include #include - -class StepAP214_Protocol; -class StepAP214_AutoDesignDateAndPersonItem; -class StepAP214_AutoDesignDateAndTimeItem; -class StepAP214_AutoDesignDatedItem; -class StepAP214_AutoDesignGeneralOrgItem; -class StepAP214_AutoDesignOrganizationItem; -class StepAP214_AutoDesignGroupedItem; -class StepAP214_AutoDesignPresentedItemSelect; -class StepAP214_AutoDesignReferencingItem; -class StepAP214_DateAndTimeItem; -class StepAP214_DateItem; -class StepAP214_ApprovalItem; -class StepAP214_OrganizationItem; -class StepAP214_DocumentReferenceItem; -class StepAP214_GroupItem; -class StepAP214_PersonAndOrganizationItem; -class StepAP214_PresentedItemSelect; -class StepAP214_SecurityClassificationItem; class StepAP214_Protocol; -class StepAP214_AutoDesignApprovalAssignment; -class StepAP214_AutoDesignActualDateAndTimeAssignment; -class StepAP214_AutoDesignNominalDateAndTimeAssignment; -class StepAP214_AutoDesignActualDateAssignment; -class StepAP214_AutoDesignNominalDateAssignment; -class StepAP214_AutoDesignGroupAssignment; -class StepAP214_AutoDesignOrganizationAssignment; -class StepAP214_AutoDesignDateAndPersonAssignment; -class StepAP214_AutoDesignPersonAndOrganizationAssignment; -class StepAP214_AutoDesignPresentedItem; -class StepAP214_AutoDesignSecurityClassificationAssignment; -class StepAP214_AutoDesignDocumentReference; -class StepAP214_AppliedApprovalAssignment; -class StepAP214_AppliedDateAndTimeAssignment; -class StepAP214_AppliedDateAssignment; -class StepAP214_AppliedGroupAssignment; -class StepAP214_AppliedOrganizationAssignment; -class StepAP214_AppliedPersonAndOrganizationAssignment; -class StepAP214_AppliedPresentedItem; -class StepAP214_AppliedSecurityClassificationAssignment; -class StepAP214_AppliedDocumentReference; -class StepAP214_AppliedExternalIdentificationAssignment; -class StepAP214_Class; -class StepAP214_ExternalIdentificationItem; -class StepAP214_ExternallyDefinedClass; -class StepAP214_ExternallyDefinedGeneralProperty; -class StepAP214_RepItemGroup; - //! Complete AP214 CC1 , Revision 4 //! Upgrading from Revision 2 to Revision 4 : 26 Mar 1997 //! Splitting in sub-schemas : 5 Nov 1997 class StepAP214 { -public: + public: - DEFINE_STANDARD_ALLOC - - //! creates a Protocol - Standard_EXPORT static Handle(StepAP214_Protocol) Protocol(); - - - - -protected: - - - - - -private: - - - - -friend class StepAP214_AutoDesignDateAndPersonItem; -friend class StepAP214_AutoDesignDateAndTimeItem; -friend class StepAP214_AutoDesignDatedItem; -friend class StepAP214_AutoDesignGeneralOrgItem; -friend class StepAP214_AutoDesignOrganizationItem; -friend class StepAP214_AutoDesignGroupedItem; -friend class StepAP214_AutoDesignPresentedItemSelect; -friend class StepAP214_AutoDesignReferencingItem; -friend class StepAP214_DateAndTimeItem; -friend class StepAP214_DateItem; -friend class StepAP214_ApprovalItem; -friend class StepAP214_OrganizationItem; -friend class StepAP214_DocumentReferenceItem; -friend class StepAP214_GroupItem; -friend class StepAP214_PersonAndOrganizationItem; -friend class StepAP214_PresentedItemSelect; -friend class StepAP214_SecurityClassificationItem; -friend class StepAP214_Protocol; -friend class StepAP214_AutoDesignApprovalAssignment; -friend class StepAP214_AutoDesignActualDateAndTimeAssignment; -friend class StepAP214_AutoDesignNominalDateAndTimeAssignment; -friend class StepAP214_AutoDesignActualDateAssignment; -friend class StepAP214_AutoDesignNominalDateAssignment; -friend class StepAP214_AutoDesignGroupAssignment; -friend class StepAP214_AutoDesignOrganizationAssignment; -friend class StepAP214_AutoDesignDateAndPersonAssignment; -friend class StepAP214_AutoDesignPersonAndOrganizationAssignment; -friend class StepAP214_AutoDesignPresentedItem; -friend class StepAP214_AutoDesignSecurityClassificationAssignment; -friend class StepAP214_AutoDesignDocumentReference; -friend class StepAP214_AppliedApprovalAssignment; -friend class StepAP214_AppliedDateAndTimeAssignment; -friend class StepAP214_AppliedDateAssignment; -friend class StepAP214_AppliedGroupAssignment; -friend class StepAP214_AppliedOrganizationAssignment; -friend class StepAP214_AppliedPersonAndOrganizationAssignment; -friend class StepAP214_AppliedPresentedItem; -friend class StepAP214_AppliedSecurityClassificationAssignment; -friend class StepAP214_AppliedDocumentReference; -friend class StepAP214_AppliedExternalIdentificationAssignment; -friend class StepAP214_Class; -friend class StepAP214_ExternalIdentificationItem; -friend class StepAP214_ExternallyDefinedClass; -friend class StepAP214_ExternallyDefinedGeneralProperty; -friend class StepAP214_RepItemGroup; - + Standard_EXPORT static const Handle(StepAP214_Protocol) & Protocol(); }; - - - - - - #endif // _StepAP214_HeaderFile diff --git a/src/StepAP214/StepAP214_Protocol.cxx b/src/StepAP214/StepAP214_Protocol.cxx index da1074cac4..3abe21a021 100644 --- a/src/StepAP214/StepAP214_Protocol.cxx +++ b/src/StepAP214/StepAP214_Protocol.cxx @@ -744,7 +744,6 @@ static Standard_CString schemaAP242DIS = "AP242_MANAGED_MODEL_BASED_3D_ENGINEERI #include #include -static int init = 0; static Interface_DataMapOfTransientInteger types(800); @@ -755,6 +754,7 @@ static Interface_DataMapOfTransientInteger types(800); StepAP214_Protocol::StepAP214_Protocol () { + static int init = 0; if (init) return; init = 1; types.Bind (STANDARD_TYPE(StepBasic_Address), 1); @@ -1455,11 +1455,10 @@ StepAP214_Protocol::StepAP214_Protocol () //purpose : //======================================================================= -Standard_Integer StepAP214_Protocol::TypeNumber(const -Handle(Standard_Type)& atype) const +Standard_Integer StepAP214_Protocol::TypeNumber(const Handle(Standard_Type)& atype) const { - if (types.IsBound (atype)) return types.Find(atype); - else return 0; + const Standard_Integer *num = types.Seek(atype); + return (num? *num : 0); } @@ -1497,9 +1496,7 @@ Standard_Integer StepAP214_Protocol::NbResources () const //purpose : //======================================================================= -Handle(Interface_Protocol) StepAP214_Protocol::Resource - (const Standard_Integer /*num*/) const +Handle(Interface_Protocol) StepAP214_Protocol::Resource (const Standard_Integer /*num*/) const { return HeaderSection::Protocol(); } - diff --git a/src/StepAP214/StepAP214_Protocol.hxx b/src/StepAP214/StepAP214_Protocol.hxx index ab13ff90e8..993ff05085 100644 --- a/src/StepAP214/StepAP214_Protocol.hxx +++ b/src/StepAP214/StepAP214_Protocol.hxx @@ -34,9 +34,7 @@ DEFINE_STANDARD_HANDLE(StepAP214_Protocol, StepData_Protocol) //! It requires StepAP214 as a Resource class StepAP214_Protocol : public StepData_Protocol { - -public: - + public: Standard_EXPORT StepAP214_Protocol(); @@ -51,27 +49,7 @@ 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; - - - DEFINE_STANDARD_RTTIEXT(StepAP214_Protocol,StepData_Protocol) - -protected: - - - - -private: - - - - }; - - - - - - #endif // _StepAP214_Protocol_HeaderFile diff --git a/src/StepData/FILES b/src/StepData/FILES index 55ba8788c7..8f78376733 100644 --- a/src/StepData/FILES +++ b/src/StepData/FILES @@ -7,8 +7,6 @@ StepData_DescrGeneral.cxx StepData_DescrGeneral.hxx StepData_Described.cxx StepData_Described.hxx -StepData_DescrProtocol.cxx -StepData_DescrProtocol.hxx StepData_DescrReadWrite.cxx StepData_DescrReadWrite.hxx StepData_ECDescr.cxx @@ -29,8 +27,6 @@ StepData_FieldListD.cxx StepData_FieldListD.hxx StepData_FieldListN.cxx StepData_FieldListN.hxx -StepData_FileProtocol.cxx -StepData_FileProtocol.hxx StepData_FileRecognizer.hxx StepData_FileRecognizer_0.cxx StepData_FreeFormEntity.cxx @@ -40,8 +36,6 @@ StepData_GeneralModule.hxx StepData_GlobalNodeOfWriterLib.hxx StepData_GlobalNodeOfWriterLib_0.cxx StepData_HArray1OfField.hxx -StepData_HeaderTool.cxx -StepData_HeaderTool.hxx StepData_Logical.hxx StepData_NodeOfWriterLib.hxx StepData_NodeOfWriterLib_0.cxx diff --git a/src/StepData/StepData.cxx b/src/StepData/StepData.cxx index 79e848c48e..782bc60825 100644 --- a/src/StepData/StepData.cxx +++ b/src/StepData/StepData.cxx @@ -14,54 +14,28 @@ // abv 09.04.99 S4136: eliminate parameter step.readaccept.void // svv #2 23.02.00: porting on SIL -#include -#include -#include #include -#include -#include +#include +#include +#include #include -StaticHandle(StepData_Protocol,proto); -//svv #2: StaticHandle(StepData_DefaultGeneral,stmod); - -StaticHandleA(StepData_Protocol,theheader); +//szv_c1:StaticHandle(StepData_Protocol,proto); +static Handle(StepData_Protocol) proto; +//szv_c1:StaticHandleA(StepData_Protocol,theheader); +static Handle(StepData_Protocol) theheader; - void StepData::Init () -{ -// InitHandleVoid(StepData_Protocol,proto); -// InitHandleVoid(StepData_DefaultGeneral,stmod); -//:S4136 Interface_Static::Init("step","step.readaccept.void",'i',"1"); -// if (proto.IsNull()) proto = new StepData_Protocol; -// if (stmod.IsNull()) stmod = new StepData_DefaultGeneral; -} - - Handle(StepData_Protocol) StepData::Protocol () +const Handle(StepData_Protocol) & StepData::Protocol () { - InitHandleVoid(StepData_Protocol,proto);// svv #2 -// UseHandle(StepData_Protocol,proto); + //szv_c1:InitHandleVoid(StepData_Protocol,proto);// svv #2 + if (proto.IsNull()) proto = new StepData_Protocol; return proto; } - - void StepData::AddHeaderProtocol (const Handle(StepData_Protocol)& header) -{ - InitHandle(StepData_Protocol,theheader); - if (theheader.IsNull()) theheader = header; - else { - DeclareAndCast(StepData_FileProtocol,headmult,theheader); - if (headmult.IsNull()) { - headmult = new StepData_FileProtocol; - headmult->Add(theheader); - } - headmult->Add(header); - theheader = headmult; - } -} - - Handle(StepData_Protocol) StepData::HeaderProtocol () +const Handle(StepData_Protocol) & StepData::HeaderProtocol () { - UseHandle(StepData_Protocol,theheader); - return theheader; + /*szv_c1:UseHandle(StepData_Protocol,theheader); + return theheader;*/ + return HeaderSection::Protocol(); } diff --git a/src/StepData/StepData.hxx b/src/StepData/StepData.hxx index 0fdb5211ca..11c998f95e 100644 --- a/src/StepData/StepData.hxx +++ b/src/StepData/StepData.hxx @@ -18,137 +18,24 @@ #define _StepData_HeaderFile #include -#include #include - -class StepData_Protocol; -class StepData_StepModel; -class StepData_UndefinedEntity; -class StepData_SelectType; -class StepData_Field; -class StepData_SelectMember; -class StepData_SelectInt; -class StepData_SelectReal; -class StepData_SelectNamed; -class StepData_SelectArrReal; -class StepData_PDescr; -class StepData_FieldList; -class StepData_FieldList1; -class StepData_FieldListN; -class StepData_FieldListD; -class StepData_EDescr; -class StepData_ESDescr; -class StepData_ECDescr; -class StepData_Described; -class StepData_Simple; -class StepData_Plex; -class StepData_FreeFormEntity; class StepData_Protocol; -class StepData_GeneralModule; -class StepData_FileRecognizer; -class StepData_FileProtocol; -class StepData_HeaderTool; -class StepData_EnumTool; -class StepData_DescrProtocol; -class StepData_DescrGeneral; -class StepData_DescrReadWrite; -class StepData_StepReaderData; -class StepData_StepReaderTool; -class StepData_ReadWriteModule; -class StepData_StepWriter; -class StepData_StepDumper; -class StepData_WriterLib; -class StepData_DefaultGeneral; -class StepData_GlobalNodeOfWriterLib; -class StepData_NodeOfWriterLib; - //! Gives basic data definition for Step Interface. //! Any class of a data model described in EXPRESS Language //! is candidate to be managed by a Step Interface class StepData { -public: - - DEFINE_STANDARD_ALLOC - + public: + //! Returns a Protocol from StepData + Standard_EXPORT static const Handle(StepData_Protocol) & Protocol(); + //! Returns the recorded HeaderProtocol, which can be : //! - a Null Handle if no Header Protocol was yet defined //! - a simple Protocol if only one was defined //! - a FileProtocol if more than one Protocol was yet defined - Standard_EXPORT static Handle(StepData_Protocol) HeaderProtocol(); - - //! Adds a new Header Protocol to the Header Definition - Standard_EXPORT static void AddHeaderProtocol (const Handle(StepData_Protocol)& headerproto); - - //! Prepares General Data required to work with this package, - //! which are the Protocol and Modules to be loaded into Libraries - Standard_EXPORT static void Init(); - - //! Returns a Protocol from StepData (avoids to create it) - Standard_EXPORT static Handle(StepData_Protocol) Protocol(); - - - - -protected: - - - - - -private: - - - - -friend class StepData_StepModel; -friend class StepData_UndefinedEntity; -friend class StepData_SelectType; -friend class StepData_Field; -friend class StepData_SelectMember; -friend class StepData_SelectInt; -friend class StepData_SelectReal; -friend class StepData_SelectNamed; -friend class StepData_SelectArrReal; -friend class StepData_PDescr; -friend class StepData_FieldList; -friend class StepData_FieldList1; -friend class StepData_FieldListN; -friend class StepData_FieldListD; -friend class StepData_EDescr; -friend class StepData_ESDescr; -friend class StepData_ECDescr; -friend class StepData_Described; -friend class StepData_Simple; -friend class StepData_Plex; -friend class StepData_FreeFormEntity; -friend class StepData_Protocol; -friend class StepData_GeneralModule; -friend class StepData_FileRecognizer; -friend class StepData_FileProtocol; -friend class StepData_HeaderTool; -friend class StepData_EnumTool; -friend class StepData_DescrProtocol; -friend class StepData_DescrGeneral; -friend class StepData_DescrReadWrite; -friend class StepData_StepReaderData; -friend class StepData_StepReaderTool; -friend class StepData_ReadWriteModule; -friend class StepData_StepWriter; -friend class StepData_StepDumper; -friend class StepData_WriterLib; -friend class StepData_DefaultGeneral; -friend class StepData_GlobalNodeOfWriterLib; -friend class StepData_NodeOfWriterLib; - + Standard_EXPORT static const Handle(StepData_Protocol) & HeaderProtocol(); }; - - - - - - #endif // _StepData_HeaderFile diff --git a/src/StepData/StepData_DescrProtocol.cxx b/src/StepData/StepData_DescrProtocol.cxx deleted file mode 100644 index b69a82db12..0000000000 --- a/src/StepData/StepData_DescrProtocol.cxx +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include -#include -#include -#include -#include - -IMPLEMENT_STANDARD_RTTIEXT(StepData_DescrProtocol,StepData_FileProtocol) - -StepData_DescrProtocol::StepData_DescrProtocol () { } - - void StepData_DescrProtocol::SetSchemaName (const Standard_CString name) - { thename.Clear(); thename.AssignCat (name); } - - void StepData_DescrProtocol::LibRecord () const -{ - if (!HasDescr()) return; // rien a recorder dans la lib ? - Handle(StepData_DescrGeneral) gen = new StepData_DescrGeneral (this); - Handle(StepData_DescrReadWrite) rwm = new StepData_DescrReadWrite (this); - Interface_GeneralLib::SetGlobal (gen,this); - Interface_ReaderLib::SetGlobal (rwm,this); - StepData_WriterLib::SetGlobal (rwm,this); -} - - Standard_CString StepData_DescrProtocol::SchemaName () const - { return thename.ToCString(); } diff --git a/src/StepData/StepData_DescrProtocol.hxx b/src/StepData/StepData_DescrProtocol.hxx deleted file mode 100644 index 6005e09198..0000000000 --- a/src/StepData/StepData_DescrProtocol.hxx +++ /dev/null @@ -1,86 +0,0 @@ -// Created on: 1997-05-21 -// Created by: Christian CAILLET -// Copyright (c) 1997-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _StepData_DescrProtocol_HeaderFile -#define _StepData_DescrProtocol_HeaderFile - -#include -#include - -#include -#include -#include - - -class StepData_DescrProtocol; -DEFINE_STANDARD_HANDLE(StepData_DescrProtocol, StepData_FileProtocol) - -//! A DescrProtocol is a protocol dynamically (at execution time) -//! defined with : -//! - a list of resources (inherits FileProtocol) -//! - a list of entity descriptions -//! i.e. it can be defined with only C++ writing to initialize it -//! Its initialization must : -//! - set its schema name -//! - define its resources (which can also be other DescrProtocol) -//! - define its entity descriptions -//! - record it in the system by calling RecordLib -class StepData_DescrProtocol : public StepData_FileProtocol -{ - -public: - - - Standard_EXPORT StepData_DescrProtocol(); - - //! Defines a specific Schema Name for this Protocol - Standard_EXPORT void SetSchemaName (const Standard_CString name); - - //! Records this Protocol in the service libraries, with a - //! DescrGeneral and a DescrReadWrite - //! Does nothing if the Protocol brings no proper description - Standard_EXPORT void LibRecord() const; - - //! Returns the Schema Name attached to each class of Protocol - //! here, returns the SchemaName set by SetSchemaName - //! was C++ : return const - Standard_EXPORT virtual Standard_CString SchemaName() const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(StepData_DescrProtocol,StepData_FileProtocol) - -protected: - - - - -private: - - - TCollection_AsciiString thename; - - -}; - - - - - - - -#endif // _StepData_DescrProtocol_HeaderFile diff --git a/src/StepData/StepData_FileProtocol.cxx b/src/StepData/StepData_FileProtocol.cxx deleted file mode 100644 index 212ac03eee..0000000000 --- a/src/StepData/StepData_FileProtocol.cxx +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include -#include -#include -#include - -IMPLEMENT_STANDARD_RTTIEXT(StepData_FileProtocol,StepData_Protocol) - -//static TCollection_AsciiString thename(""); -static Standard_CString thename = ""; - -// Protocol fabrique a la demande avec d autres Protocoles - - - StepData_FileProtocol::StepData_FileProtocol () { } - - void StepData_FileProtocol::Add (const Handle(StepData_Protocol)& protocol) -{ - if (protocol.IsNull()) return; - Handle(Standard_Type) ptype = protocol->DynamicType(); - Standard_Integer nb = thecomps.Length(); - for (Standard_Integer i = 1; i <= nb; i ++) { - if (thecomps.Value(i)->IsInstance(ptype)) return; - } - thecomps.Append(protocol); -} - - - Standard_Integer StepData_FileProtocol::NbResources () const - { return thecomps.Length(); } - - Handle(Interface_Protocol) StepData_FileProtocol::Resource - (const Standard_Integer num) const - { return Handle(Interface_Protocol)::DownCast(thecomps.Value(num)); } - - - Standard_Integer StepData_FileProtocol::TypeNumber - (const Handle(Standard_Type)& /*atype*/) const - { return 0; } - - -Standard_Boolean StepData_FileProtocol::GlobalCheck(const Interface_Graph& G, - Handle(Interface_Check)& ach) const -{ - Standard_Boolean res = Standard_False; - Standard_Integer i,nb = NbResources(); - for (i = 1; i <= nb; i ++) res |= Resource(i)->GlobalCheck (G,ach); - return res; -} - - - Standard_CString StepData_FileProtocol::SchemaName () const - { return thename; } diff --git a/src/StepData/StepData_FileProtocol.hxx b/src/StepData/StepData_FileProtocol.hxx deleted file mode 100644 index 5f83066d24..0000000000 --- a/src/StepData/StepData_FileProtocol.hxx +++ /dev/null @@ -1,103 +0,0 @@ -// Created on: 1993-07-23 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _StepData_FileProtocol_HeaderFile -#define _StepData_FileProtocol_HeaderFile - -#include -#include - -#include -#include -#include -#include -#include -#include -class StepData_Protocol; -class Interface_Protocol; -class Interface_Graph; -class Interface_Check; - - -class StepData_FileProtocol; -DEFINE_STANDARD_HANDLE(StepData_FileProtocol, StepData_Protocol) - -//! A FileProtocol is defined as the addition of several already -//! existing Protocols. It corresponds to the definition of a -//! SchemaName with several Names, each one being attached to a -//! specific Protocol. Thus, a File defined with a compound Schema -//! is processed as any other one, once built the equivalent -//! compound Protocol, a FileProtocol -class StepData_FileProtocol : public StepData_Protocol -{ - -public: - - - //! Creates an empty FileProtocol - Standard_EXPORT StepData_FileProtocol(); - - //! Adds a Protocol to the definition list of the FileProtocol - //! But ensures that each class of Protocol is present only once - //! in this list - Standard_EXPORT void Add (const Handle(StepData_Protocol)& protocol); - - //! Gives the count of Protocols used as Resource (can be zero) - //! i.e. the count of Protocol recorded by calling the method Add - Standard_EXPORT virtual Standard_Integer NbResources() const Standard_OVERRIDE; - - //! Returns a Resource, given a rank. Here, rank of calling Add - Standard_EXPORT virtual Handle(Interface_Protocol) Resource (const Standard_Integer num) const Standard_OVERRIDE; - - //! Returns a Case Number, specific of each recognized Type - //! Here, NO Type at all is recognized properly : all Types are - //! recognized by the resources - Standard_EXPORT virtual Standard_Integer TypeNumber (const Handle(Standard_Type)& atype) const Standard_OVERRIDE; - - //! Calls GlobalCheck for each of its recorded ressources - Standard_EXPORT virtual Standard_Boolean GlobalCheck (const Interface_Graph& G, Handle(Interface_Check)& ach) const Standard_OVERRIDE; - - //! Returns the Schema Name attached to each class of Protocol - //! To be redefined by each sub-class - //! Here, SchemaName returns "" (empty String) - //! was C++ : return const - Standard_EXPORT virtual Standard_CString SchemaName() const Standard_OVERRIDE; - - - - - DEFINE_STANDARD_RTTIEXT(StepData_FileProtocol,StepData_Protocol) - -protected: - - - - -private: - - - TColStd_SequenceOfTransient thecomps; - - -}; - - - - - - - -#endif // _StepData_FileProtocol_HeaderFile diff --git a/src/StepData/StepData_HeaderTool.cxx b/src/StepData/StepData_HeaderTool.cxx deleted file mode 100644 index 5e95539c31..0000000000 --- a/src/StepData/StepData_HeaderTool.cxx +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include -#include -#include -#include -#include - -// HeaderTool prend en charge le Schema de Donnees utilise pour un Fichier -// Ce Schema peut etre compose de un ou plusieurs Protocoles, chacun etant -// designe par une String. Les Strings correspondent au type "SCHEMA_NAME" -// (typedef) et le Schema est une entite de Header de type "FILE_SCHEMA", -// il a cette forme dans le fichier : -static Interface_ReaderLib lib; - - - StepData_HeaderTool::StepData_HeaderTool - (const Handle(StepData_StepReaderData)& data) -{ - lib.SetComplete(); - thedone = Standard_False; - Standard_Integer num = 0; - while ( (num = data->FindNextRecord(num)) != 0) { - const TCollection_AsciiString& headertype = data->RecordType(num); - if (headertype == "FILE_SCHEMA") { - Standard_Integer numsub = data->SubListNumber(num,1,Standard_True); - Standard_Integer nb = data->NbParams(numsub); - for (Standard_Integer i = 1; i <= nb; i ++) { - TCollection_AsciiString unom = data->ParamCValue(numsub,i); - unom.Remove(unom.Length()); - unom.Remove(1); // quotes debut et fin - thenames.Append(unom); - } - } - } -} - - - StepData_HeaderTool::StepData_HeaderTool - (const TColStd_SequenceOfAsciiString& names) -{ - lib.SetComplete(); - thedone = Standard_False; - Standard_Integer nb = names.Length(); - for (Standard_Integer i = 1; i <= nb; i ++) thenames.Append(names.Value(i)); -} - - Standard_Integer StepData_HeaderTool::NbSchemaNames () const - { return thenames.Length(); } - - const TCollection_AsciiString& StepData_HeaderTool::SchemaName - (const Standard_Integer num) const - { return thenames.Value(num); } - - Handle(StepData_Protocol) StepData_HeaderTool::NamedProtocol - (const TCollection_AsciiString& name) const -{ - Handle(StepData_Protocol) proto; - for (lib.Start(); lib.More(); lib.Next()) { - proto = Handle(StepData_Protocol)::DownCast(lib.Protocol()); - if ( name.IsEqual(proto->SchemaName()) ) return proto; - } - return proto; -} - - - void StepData_HeaderTool::Build - (const Handle(StepData_FileProtocol)& proto) -{ - thedone = Standard_True; - theignored.Clear(); - Standard_Integer nb = thenames.Length(); - for (Standard_Integer i = 1; i <= nb; i ++) { - Handle(StepData_Protocol) unproto = NamedProtocol(thenames.Value(i)); - if (unproto.IsNull()) theignored.Append(thenames.Value(i)); - else proto->Add(unproto); - } -} - - Handle(StepData_Protocol) StepData_HeaderTool::Protocol () -{ - thedone = Standard_True; - theignored.Clear(); - Handle(StepData_Protocol) unproto; - if (thenames.IsEmpty()) return unproto; - if (thenames.Length() == 1) { - unproto = NamedProtocol (thenames.Value(1)); - if (unproto.IsNull()) theignored.Append (thenames.Value(1)); - return unproto; - } - Handle(StepData_FileProtocol) proto = new StepData_FileProtocol; - Build(proto); - return proto; -} - - - Standard_Boolean StepData_HeaderTool::IsDone () const - { return thedone; } - - - Standard_Integer StepData_HeaderTool::NbIgnoreds () const - { return theignored.Length(); } - - const TCollection_AsciiString& StepData_HeaderTool::Ignored - (const Standard_Integer num) const - { return theignored.Value(num); } - - - void StepData_HeaderTool::Print (Standard_OStream& S) const -{ - Standard_Integer nb = thenames.Length(); - Standard_Integer lng = 0; Standard_Integer ln1; - S << " --- StepData_HeaderTool : List of Protocol Names --- Count : " - << nb << endl; - Standard_Integer i; // svv Jan11 2000 : porting on DEC - for (i = 1; i <= nb; i ++) { - ln1 = thenames.Value(i).Length() + 8; lng += ln1; - if (lng > 80) { S << endl; lng = ln1; } - S << " " << i << " : " << thenames.Value(i); - } - if (lng == 0) S << endl; - - nb = theignored.Length(); - if (!thedone) { - S << " --- Evaluation of Protocol not Done ---" << endl; - } else if (nb == 0) { - S << " --- All Names correspond to a known Protocol ---" << endl; - } else { - lng = ln1 = 0; - S << " --- Among them, " << nb << " remain unrecognized ---" << endl; - for (i = 1; i <= nb; i ++) { - ln1 = theignored.Value(i).Length() + 3; lng += ln1; - if (lng > 80) { S << endl; lng = ln1; } - S << " : " << theignored.Value(i); - } - if (lng == 0) S << endl; - } -} diff --git a/src/StepData/StepData_HeaderTool.hxx b/src/StepData/StepData_HeaderTool.hxx deleted file mode 100644 index fc293c9ab5..0000000000 --- a/src/StepData/StepData_HeaderTool.hxx +++ /dev/null @@ -1,117 +0,0 @@ -// Created on: 1993-07-23 -// Created by: Christian CAILLET -// Copyright (c) 1993-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _StepData_HeaderTool_HeaderFile -#define _StepData_HeaderTool_HeaderFile - -#include -#include -#include - -#include -#include -#include -#include -class StepData_StepReaderData; -class TCollection_AsciiString; -class StepData_Protocol; -class StepData_FileProtocol; - - -//! HeaderTool exploits data from Header to build a Protocol : -//! it uses the Header Entity FileSchema to do this. -//! It builds a Protocol from the Global List of Protocols -//! stored in the Library ReaderLib -class StepData_HeaderTool -{ -public: - - DEFINE_STANDARD_ALLOC - - - //! Creates a HeaderTool from data read from a File. Computes the - //! list of Schema Names. The Protocol will be computed later - //! (because there are several options) - Standard_EXPORT StepData_HeaderTool(const Handle(StepData_StepReaderData)& data); - - //! Creates a HeaderTool directly from a list of Schema Names - Standard_EXPORT StepData_HeaderTool(const TColStd_SequenceOfAsciiString& names); - - //! Returns the count of SchemaNames - Standard_EXPORT Standard_Integer NbSchemaNames() const; - - //! Returns a SchemaName, given its rank - Standard_EXPORT const TCollection_AsciiString& SchemaName (const Standard_Integer num) const; - - //! Returns the Protocol which corresponds to a Schema Name - //! Returns a Null Handle if this Schema Name is attached to no - //! Protocol recorded in the Global List of ReaderLib - Standard_EXPORT Handle(StepData_Protocol) NamedProtocol (const TCollection_AsciiString& name) const; - - //! Fills a FileProtocol with the list of Protocols attached to - //! the list of Schema Names. It can remain empty ... - Standard_EXPORT void Build (const Handle(StepData_FileProtocol)& protocol); - - //! Returns a Protocol computed from the list of Schema Names : - //! - a Null Handle if no SchemaName has been recognized (or list - //! empty) - //! - a single Protocol if only one SchemaName has been recognized - //! - a FileProtocol with its componants if several SchemaNames - //! have been recognized - Standard_EXPORT Handle(StepData_Protocol) Protocol(); - - //! Returns True if either Build or Protocol has been called - //! If it is False, Ignored and NbIgnored should not be called - Standard_EXPORT Standard_Boolean IsDone() const; - - //! Returns the count of ignored SchemaNames (0 if all were OK) - Standard_EXPORT Standard_Integer NbIgnoreds() const; - - //! Returns an ignored SchemaName, given its rank in the list of - //! Ignored SchemaNames (not in the total list) - Standard_EXPORT const TCollection_AsciiString& Ignored (const Standard_Integer num) const; - - //! Sends the state of the HeaderTool in a comprehensive way, - //! to an output stream - Standard_EXPORT void Print (Standard_OStream& S) const; - - - - -protected: - - - - - -private: - - - - TColStd_SequenceOfAsciiString thenames; - Standard_Boolean thedone; - TColStd_SequenceOfAsciiString theignored; - - -}; - - - - - - - -#endif // _StepData_HeaderTool_HeaderFile diff --git a/src/StepData/StepData_StepModel.cxx b/src/StepData/StepData_StepModel.cxx index 306609cea8..7141e3f74c 100644 --- a/src/StepData/StepData_StepModel.cxx +++ b/src/StepData/StepData_StepModel.cxx @@ -91,9 +91,8 @@ void StepData_StepModel::AddHeaderEntity void StepData_StepModel::VerifyCheck(Handle(Interface_Check)& ach) const { Interface_GeneralLib lib(StepData::HeaderProtocol()); - Handle(StepData_StepModel) me (this); - Handle(Interface_Protocol) aHP = StepData::HeaderProtocol(); - Interface_ShareTool sh(me,aHP); + Handle(Interface_InterfaceModel) me (this); + Interface_ShareTool sh(me); Handle(Interface_GeneralModule) module; Standard_Integer CN; for (Interface_EntityIterator iter = Header(); iter.More(); iter.Next()) { Handle(Standard_Transient) head = iter.Value(); @@ -108,7 +107,7 @@ void StepData_StepModel::DumpHeader { // NB : level n est pas utilise - Handle(StepData_Protocol) stepro = StepData::HeaderProtocol(); + const Handle(StepData_Protocol) &stepro = StepData::HeaderProtocol(); Standard_Boolean iapro = !stepro.IsNull(); if (!iapro) S<<" -- WARNING : StepModel DumpHeader, Protocol not defined\n"; diff --git a/src/StepSelect/FILES b/src/StepSelect/FILES index aaba0653cc..4387da6371 100644 --- a/src/StepSelect/FILES +++ b/src/StepSelect/FILES @@ -1,12 +1,2 @@ -StepSelect_Activator.cxx -StepSelect_Activator.hxx -StepSelect_FileModifier.hxx -StepSelect_FileModifier_0.cxx -StepSelect_FloatFormat.cxx -StepSelect_FloatFormat.hxx -StepSelect_ModelModifier.hxx -StepSelect_ModelModifier_0.cxx StepSelect_StepType.cxx StepSelect_StepType.hxx -StepSelect_WorkLibrary.cxx -StepSelect_WorkLibrary.hxx diff --git a/src/StepSelect/StepSelect_FileModifier.hxx b/src/StepSelect/StepSelect_FileModifier.hxx deleted file mode 100644 index 0a3a26fd1f..0000000000 --- a/src/StepSelect/StepSelect_FileModifier.hxx +++ /dev/null @@ -1,75 +0,0 @@ -// Created on: 1994-12-22 -// Created by: Christian CAILLET -// Copyright (c) 1994-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _StepSelect_FileModifier_HeaderFile -#define _StepSelect_FileModifier_HeaderFile - -#include -#include - -#include -class StepData_StepWriter; -class IFSelect_ContextWrite; - - -class StepSelect_FileModifier; -DEFINE_STANDARD_HANDLE(StepSelect_FileModifier, IFSelect_GeneralModifier) - - -class StepSelect_FileModifier : public IFSelect_GeneralModifier -{ - -public: - - - //! Perform the action specific to each class of File Modifier - //! is the ContextWrite, which brings : the model, the - //! protocol, the file name, plus the object AppliedModifiers - //! (not used here) and the CheckList - //! Remark that the model has to be casted for specific access - //! - //! is the Writer and is specific to each norm, on which - //! to act - Standard_EXPORT virtual void Perform (IFSelect_ContextWrite& ctx, StepData_StepWriter& writer) const = 0; - - - - - DEFINE_STANDARD_RTTI_INLINE(StepSelect_FileModifier,IFSelect_GeneralModifier) - -protected: - - - //! Sets a File Modifier to keep the graph of dependences - //! unchanges (because it works on the model already produced) - Standard_EXPORT StepSelect_FileModifier(); - - - -private: - - - - -}; - - - - - - - -#endif // _StepSelect_FileModifier_HeaderFile diff --git a/src/StepSelect/StepSelect_FileModifier_0.cxx b/src/StepSelect/StepSelect_FileModifier_0.cxx deleted file mode 100644 index e287db3cbd..0000000000 --- a/src/StepSelect/StepSelect_FileModifier_0.cxx +++ /dev/null @@ -1,39 +0,0 @@ -// Created on: 1994-12-22 -// Created by: Christian CAILLET -// Copyright (c) 1994-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#include - -#include - -#include -#include - - - - - - - - - - -#define Writer StepData_StepWriter -#define Writer_hxx -#define IFSelect_FileModifier StepSelect_FileModifier -#define IFSelect_FileModifier_hxx -#define Handle_IFSelect_FileModifier Handle(StepSelect_FileModifier) -#include - diff --git a/src/StepSelect/StepSelect_ModelModifier.hxx b/src/StepSelect/StepSelect_ModelModifier.hxx deleted file mode 100644 index 173f77628a..0000000000 --- a/src/StepSelect/StepSelect_ModelModifier.hxx +++ /dev/null @@ -1,87 +0,0 @@ -// Created on: 1994-12-22 -// Created by: Christian CAILLET -// Copyright (c) 1994-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _StepSelect_ModelModifier_HeaderFile -#define _StepSelect_ModelModifier_HeaderFile - -#include -#include - -#include -#include -class StepData_StepModel; -class StepData_Protocol; -class IFSelect_ContextModif; -class Interface_InterfaceModel; -class Interface_Protocol; -class Interface_CopyTool; - - -class StepSelect_ModelModifier; -DEFINE_STANDARD_HANDLE(StepSelect_ModelModifier, IFSelect_Modifier) - - -class StepSelect_ModelModifier : public IFSelect_Modifier -{ - -public: - - - //! The inherited Perform does the required cast (and refuses to - //! go further if cast has failed) then calls the instantiated - //! Performing - Standard_EXPORT void Perform (IFSelect_ContextModif& ctx, const Handle(Interface_InterfaceModel)& target, const Handle(Interface_Protocol)& protocol, Interface_CopyTool& TC) const Standard_OVERRIDE; - - //! Specific Perform with Protocol. It is defined to let the - //! Protocol unused and to call Performing without Protocol - //! (most current case). It can be redefined if specific action - //! requires Protocol. - Standard_EXPORT virtual void PerformProtocol (IFSelect_ContextModif& ctx, const Handle(StepData_StepModel)& target, const Handle(StepData_Protocol)& proto, Interface_CopyTool& TC) const; - - //! Specific Perform, without Protocol. If Performing with - //! Protocol is redefined, Performing without Protocol must - //! though be defined to do nothing (not called, but demanded - //! by the linker) - Standard_EXPORT virtual void Performing (IFSelect_ContextModif& ctx, const Handle(StepData_StepModel)& target, Interface_CopyTool& TC) const = 0; - - - - - DEFINE_STANDARD_RTTI_INLINE(StepSelect_ModelModifier,IFSelect_Modifier) - -protected: - - - //! Calls inherited Initialize, transmits to it the information - //! - Standard_EXPORT StepSelect_ModelModifier(const Standard_Boolean maychangegraph); - - - -private: - - - - -}; - - - - - - - -#endif // _StepSelect_ModelModifier_HeaderFile diff --git a/src/StepSelect/StepSelect_ModelModifier_0.cxx b/src/StepSelect/StepSelect_ModelModifier_0.cxx deleted file mode 100644 index 916472a260..0000000000 --- a/src/StepSelect/StepSelect_ModelModifier_0.cxx +++ /dev/null @@ -1,47 +0,0 @@ -// Created on: 1994-12-22 -// Created by: Christian CAILLET -// Copyright (c) 1994-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#include - -#include - -#include -#include -#include -#include -#include -#include - - - - - - - - - - -#define Handle_Model Handle(StepData_StepModel) -#define Model StepData_StepModel -#define Model_hxx -#define Handle_Proto Handle(StepData_Protocol) -#define Proto StepData_Protocol -#define Proto_hxx -#define IFSelect_ModelModifier StepSelect_ModelModifier -#define IFSelect_ModelModifier_hxx -#define Handle_IFSelect_ModelModifier Handle(StepSelect_ModelModifier) -#include - diff --git a/src/TKIGES/PACKAGES b/src/TKIGES/PACKAGES index b121c19125..dbd9721b8e 100755 --- a/src/TKIGES/PACKAGES +++ b/src/TKIGES/PACKAGES @@ -9,7 +9,6 @@ IGESSolid IGESDefs IGESAppli IGESConvGeom -IGESSelect IGESToBRep GeomToIGES Geom2dToIGES diff --git a/src/TKSTEP/PACKAGES b/src/TKSTEP/PACKAGES index 70879153d1..8d0386d7da 100755 --- a/src/TKSTEP/PACKAGES +++ b/src/TKSTEP/PACKAGES @@ -3,13 +3,11 @@ RWStepAP214 StepAP203 RWStepAP203 STEPConstruct -STEPEdit GeomToStep StepToGeom StepToTopoDS TopoDSToStep STEPControl -STEPSelections StepAP209 RWStepAP242 StepAP242 diff --git a/src/TKXSBase/PACKAGES b/src/TKXSBase/PACKAGES index b05fbfdb49..5ebd3e81e6 100755 --- a/src/TKXSBase/PACKAGES +++ b/src/TKXSBase/PACKAGES @@ -9,7 +9,6 @@ StepFile HeaderSection RWHeaderSection APIHeaderSection -StepSelect UnitsMethods XSAlgo LibCtl diff --git a/src/TKXSDRAW/PACKAGES b/src/TKXSDRAW/PACKAGES index da48d7c48c..8eded28c5a 100755 --- a/src/TKXSDRAW/PACKAGES +++ b/src/TKXSDRAW/PACKAGES @@ -1,3 +1,7 @@ +IGESSelect +StepSelect +STEPEdit +STEPSelections XSDRAW XSDRAWIGES XSDRAWSTEP diff --git a/src/Transfer/FILES b/src/Transfer/FILES index 870e8c1fad..2584b46ef6 100644 --- a/src/Transfer/FILES +++ b/src/Transfer/FILES @@ -1,9 +1,7 @@ -Transfer_Actor.hxx Transfer_ActorOfFinderProcess.hxx Transfer_ActorOfTransientProcess.hxx Transfer_Binder.cxx Transfer_Binder.hxx -Transfer_DataInfo.hxx Transfer_Finder.cxx Transfer_Finder.hxx Transfer_FinderProcess.cxx @@ -11,13 +9,10 @@ Transfer_FinderProcess.hxx Transfer_Hasher.cxx Transfer_Hasher.hxx Transfer_HSequenceOfBinder.hxx -Transfer_HSequenceOfFinder.hxx -Transfer_IteratorOfProcessForFinder.hxx -Transfer_IteratorOfProcessForTransient.hxx Transfer_MapContainer.cxx Transfer_MapContainer.hxx -Transfer_ProcessForFinder.hxx -Transfer_ProcessForTransient.hxx +Transfer_Process.cxx +Transfer_Process.hxx Transfer_ResultFromModel.cxx Transfer_ResultFromModel.hxx Transfer_ResultFromTransient.cxx @@ -30,11 +25,6 @@ Transfer_StatusExec.hxx Transfer_StatusResult.hxx Transfer_TransferDeadLoop.hxx Transfer_TransferFailure.hxx -Transfer_Iterator.cxx -Transfer_Iterator.hxx -Transfer_TransferMapOfProcessForFinder.hxx -Transfer_TransferMapOfProcessForTransient.hxx -Transfer_ProcessGen.hxx Transfer_TransientListBinder.cxx Transfer_TransientListBinder.hxx Transfer_TransientProcess.cxx diff --git a/src/Transfer/Transfer_Actor.hxx b/src/Transfer/Transfer_Actor.hxx deleted file mode 100644 index ce1644b786..0000000000 --- a/src/Transfer/Transfer_Actor.hxx +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _Transfer_Actor_HeaderFile -#define _Transfer_Actor_HeaderFile - -#include -#include -#include - -class Transfer_Actor : public MMgt_TShared -{ - public: - - Transfer_Actor() : themodetrans(0) {} - - //! Set a specific transfer mode - void SetTransferMode (const Standard_Integer theMode) { themodetrans = theMode; } - - DEFINE_STANDARD_RTTI_INLINE(Transfer_Actor,MMgt_TShared) - - protected: - - Standard_Integer themodetrans; -}; - -#endif // _Transfer_Actor_HeaderFile diff --git a/src/Transfer/Transfer_ActorOfFinderProcess.hxx b/src/Transfer/Transfer_ActorOfFinderProcess.hxx index 73609c4cc0..d780ca5daa 100644 --- a/src/Transfer/Transfer_ActorOfFinderProcess.hxx +++ b/src/Transfer/Transfer_ActorOfFinderProcess.hxx @@ -17,8 +17,8 @@ #ifndef _Transfer_ActorOfFinderProcess_HeaderFile #define _Transfer_ActorOfFinderProcess_HeaderFile -#include +#include -#define Transfer_ActorOfFinderProcess Transfer_ProcessForFinder::Actor +#define Transfer_ActorOfFinderProcess Transfer_Process::Actor #endif // _Transfer_ActorOfFinderProcess_HeaderFile diff --git a/src/Transfer/Transfer_ActorOfTransientProcess.hxx b/src/Transfer/Transfer_ActorOfTransientProcess.hxx index 8ad3392fe6..92d7b8f2dd 100644 --- a/src/Transfer/Transfer_ActorOfTransientProcess.hxx +++ b/src/Transfer/Transfer_ActorOfTransientProcess.hxx @@ -17,8 +17,8 @@ #ifndef _Transfer_ActorOfTransientProcess_HeaderFile #define _Transfer_ActorOfTransientProcess_HeaderFile -#include +#include -#define Transfer_ActorOfTransientProcess Transfer_ProcessForTransient::Actor +#define Transfer_ActorOfTransientProcess Transfer_Process::Actor #endif // _Transfer_ActorOfTransientProcess_HeaderFile diff --git a/src/Transfer/Transfer_DataInfo.hxx b/src/Transfer/Transfer_DataInfo.hxx deleted file mode 100644 index 11c5af164f..0000000000 --- a/src/Transfer/Transfer_DataInfo.hxx +++ /dev/null @@ -1,36 +0,0 @@ -// Created on: 1996-09-04 -// Created by: Christian CAILLET -// Copyright (c) 1996-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _Transfer_DataInfo_HeaderFile -#define _Transfer_DataInfo_HeaderFile - -#include -#include -#include - -//! Gives informations on an object -//! Used as template to instantiate Mapper and SimpleBinder -//! This class is for Transient -class Transfer_DataInfo -{ - public: - - //! Returns Type Name (string) - //! Allows to name type of non-handled objects - static Standard_CString TypeName (const Handle(Standard_Transient)& ent) { return ent->DynamicType()->Name(); } -}; - -#endif // _Transfer_DataInfo_HeaderFile diff --git a/src/Transfer/Transfer_FinderProcess.cxx b/src/Transfer/Transfer_FinderProcess.cxx index abbfffc9ef..12d835fb51 100644 --- a/src/Transfer/Transfer_FinderProcess.cxx +++ b/src/Transfer/Transfer_FinderProcess.cxx @@ -13,4 +13,4 @@ #include -IMPLEMENT_STANDARD_RTTIEXT(Transfer_FinderProcess,Transfer_ProcessForFinder) +IMPLEMENT_STANDARD_RTTIEXT(Transfer_FinderProcess,Transfer_Process) diff --git a/src/Transfer/Transfer_FinderProcess.hxx b/src/Transfer/Transfer_FinderProcess.hxx index 0f62dfbbaa..3447661e93 100644 --- a/src/Transfer/Transfer_FinderProcess.hxx +++ b/src/Transfer/Transfer_FinderProcess.hxx @@ -17,18 +17,18 @@ #ifndef _Transfer_FinderProcess_HeaderFile #define _Transfer_FinderProcess_HeaderFile -#include +#include -class Transfer_FinderProcess : public Transfer_ProcessForFinder +class Transfer_FinderProcess : public Transfer_Process { public: //! Sets FinderProcess at initial state, with an initial size Transfer_FinderProcess(const Standard_Integer nb = 10000) - : Transfer_ProcessForFinder (nb) + : Transfer_Process (nb) {} - DEFINE_STANDARD_RTTIEXT(Transfer_FinderProcess,Transfer_ProcessForFinder) + DEFINE_STANDARD_RTTIEXT(Transfer_FinderProcess,Transfer_Process) }; #endif // _Transfer_FinderProcess_HeaderFile diff --git a/src/Transfer/Transfer_HSequenceOfFinder.hxx b/src/Transfer/Transfer_HSequenceOfFinder.hxx deleted file mode 100644 index 4aed02f9e4..0000000000 --- a/src/Transfer/Transfer_HSequenceOfFinder.hxx +++ /dev/null @@ -1,27 +0,0 @@ -// Created on: 1992-02-03 -// Created by: Christian CAILLET -// Copyright (c) 1992-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef Transfer_HSequenceOfFinder_HeaderFile -#define Transfer_HSequenceOfFinder_HeaderFile - -#include -#include -#include - -DEFINE_HSEQUENCE(Transfer_HSequenceOfFinder, Transfer_SequenceOfFinder) - - -#endif diff --git a/src/Transfer/Transfer_Iterator.cxx b/src/Transfer/Transfer_Iterator.cxx deleted file mode 100644 index ba48dfcc77..0000000000 --- a/src/Transfer/Transfer_Iterator.cxx +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include -#include -#include - -Transfer_Iterator::Transfer_Iterator () -{ - theitems = new Transfer_HSequenceOfBinder; - theselect = new TColStd_HSequenceOfInteger; - thecurr = 1; -} - -void Transfer_Iterator::AddItem (const Handle(Transfer_Binder)& atr) -{ - theitems->Append(atr); - theselect->Append(1); -} - -void Transfer_Iterator::SelectItem (const Standard_Integer num, const Standard_Boolean keep) -{ - if (num < 1 || num > theselect->Length()) return; - theselect->SetValue (num,(keep? 1 : 0)); -} - -// .... Iteration-Interrogations .... - -Standard_Integer Transfer_Iterator::Number () const -{ - Standard_Integer i, n = theselect->Length(), numb = 0; - for (i = 1; i <= n; i ++) { - if (theselect->Value(i) != 0) numb++; - } - return numb; -} - -Standard_Boolean Transfer_Iterator::More () -{ - if (thecurr > theselect->Length()) return Standard_False; - if (theselect->Value(thecurr) == 0) Next(); - if (thecurr > theselect->Length()) return Standard_False; - return (theselect->Value(thecurr) > 0); -} - -void Transfer_Iterator::Next () -{ - thecurr++; - if (thecurr > theselect->Length()) return; - if (theselect->Value(thecurr) == 0) Next(); -} - -const Handle(Transfer_Binder)& Transfer_Iterator::Value () const -{ - if (thecurr == 0 || thecurr > theselect->Length()) - Standard_NoSuchObject::Raise ("Transfer_Iterator::Value"); - if (theselect->Value(thecurr) == 0) - Standard_NoSuchObject::Raise ("Transfer_Iterator::Value"); - return theitems->Value(thecurr); -} diff --git a/src/Transfer/Transfer_Iterator.hxx b/src/Transfer/Transfer_Iterator.hxx deleted file mode 100644 index 61bedca6db..0000000000 --- a/src/Transfer/Transfer_Iterator.hxx +++ /dev/null @@ -1,73 +0,0 @@ -// Created on: 1992-10-28 -// Created by: Christian CAILLET -// Copyright (c) 1992-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _Transfer_Iterator_HeaderFile -#define _Transfer_Iterator_HeaderFile - -#include -#include -#include - -class Transfer_HSequenceOfBinder; -class TColStd_HSequenceOfInteger; - -//! Defines an Iterator on the result of a Transfer -//! Available for Normal Results or not (Erroneous Transfer) -//! It gives several kinds of Informations, and allows to consider -//! various criteria (criteria are cumulative) -class Transfer_Iterator -{ -public: - - DEFINE_STANDARD_ALLOC - - //! Creates an empty Iterator - Standard_EXPORT Transfer_Iterator(); - - //! Returns count of Binders to be iterated - Standard_EXPORT Standard_Integer Number() const; - - //! Clears Iteration in progress, to allow it to be restarted - void Start() { thecurr = 0; Next(); } - - //! Returns True if there are other Items to iterate - Standard_EXPORT Standard_Boolean More(); - - //! Sets Iteration to the next Item - Standard_EXPORT void Next(); - - //! Returns the current Binder - Standard_EXPORT const Handle(Transfer_Binder)& Value() const; - - protected: - - //! Adds a Binder to the iteration list (construction) - Standard_EXPORT void AddItem (const Handle(Transfer_Binder)& atr); - - //! Selects/Unselect (according to an item designated by - //! its rank in the list - //! Used by sub-classes which have specific criteria - Standard_EXPORT void SelectItem (const Standard_Integer num, const Standard_Boolean keep); - - Standard_Integer thecurr; - - private: - - Handle(Transfer_HSequenceOfBinder) theitems; - Handle(TColStd_HSequenceOfInteger) theselect; -}; - -#endif // _Transfer_Iterator_HeaderFile diff --git a/src/Transfer/Transfer_IteratorOfProcessForFinder.hxx b/src/Transfer/Transfer_IteratorOfProcessForFinder.hxx deleted file mode 100644 index cd0297d544..0000000000 --- a/src/Transfer/Transfer_IteratorOfProcessForFinder.hxx +++ /dev/null @@ -1,24 +0,0 @@ -// Created on: 1992-02-03 -// Created by: Christian CAILLET -// Copyright (c) 1992-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _Transfer_IteratorOfProcessForFinder_HeaderFile -#define _Transfer_IteratorOfProcessForFinder_HeaderFile - -#include - -typedef Transfer_ProcessForFinder::Iterator Transfer_IteratorOfProcessForFinder; - -#endif // _Transfer_IteratorOfProcessForFinder_HeaderFile diff --git a/src/Transfer/Transfer_IteratorOfProcessForTransient.hxx b/src/Transfer/Transfer_IteratorOfProcessForTransient.hxx deleted file mode 100644 index 0b0e2694df..0000000000 --- a/src/Transfer/Transfer_IteratorOfProcessForTransient.hxx +++ /dev/null @@ -1,24 +0,0 @@ -// Created on: 1992-02-03 -// Created by: Christian CAILLET -// Copyright (c) 1992-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _Transfer_IteratorOfProcessForTransient_HeaderFile -#define _Transfer_IteratorOfProcessForTransient_HeaderFile - -#include - -typedef Transfer_ProcessForTransient::Iterator Transfer_IteratorOfProcessForTransient; - -#endif // _Transfer_IteratorOfProcessForTransient_HeaderFile diff --git a/src/Transfer/Transfer_Process.cxx b/src/Transfer/Transfer_Process.cxx new file mode 100644 index 0000000000..7d2ab9c0a6 --- /dev/null +++ b/src/Transfer/Transfer_Process.cxx @@ -0,0 +1,607 @@ +// Copyright (c) 1999-2014 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +IMPLEMENT_STANDARD_RTTIEXT(Transfer_Process,MMgt_TShared) + +//======================================================================= +// Methods of Transfer_Process::Iterator +//======================================================================= + +Transfer_Process::Iterator::Iterator (const Standard_Boolean WithSource) +: myCurrent(1), + myBinders(new Transfer_HSequenceOfBinder), + mySelected(new TColStd_HSequenceOfInteger) +{ + if (WithSource) + mySourceObjects = new TColStd_HSequenceOfTransient(); +} + +void Transfer_Process::Iterator::Add (const Handle(Transfer_Binder)& theBinder) +{ + if (!mySourceObjects.IsNull()) + Standard_NoSuchObject::Raise("Transfer_Process::Iterator::Add, Source Object required but not provided"); + AddItem(theBinder); +} + +void Transfer_Process::Iterator::Add (const Handle(Transfer_Binder)& theBinder, const Handle(Standard_Transient)& theSource) +{ + AddItem(theBinder); + if (!mySourceObjects.IsNull()) mySourceObjects->Append(theSource); +} + +void Transfer_Process::Iterator::Filter (const Handle(TColStd_HSequenceOfTransient)& theList) +{ + if (theList.IsNull() || mySourceObjects.IsNull()) return; + Standard_Integer i, j, nb = mySourceObjects->Length(); + if (nb == 0) return; + Handle(Transfer_Binder) factice; + Transfer_MapOfProcess amap (nb); + for (i = 1; i <= nb; i ++) { + j = amap.Add (mySourceObjects->Value(i),factice); + mySelected->SetValue (j,0); + } + + // Comparaison + nb = theList->Length(); + for (i = 1; i <= nb; i ++) { + j = amap.FindIndex (theList->Value(i)); + if (j > 0) mySelected->SetValue (j,1); + } +} + +Standard_Integer Transfer_Process::Iterator::Number () const +{ + Standard_Integer i, n = mySelected->Length(), numb = 0; + for (i = 1; i <= n; i ++) { + if (mySelected->Value(i) != 0) numb++; + } + return numb; +} + +Standard_Boolean Transfer_Process::Iterator::More () +{ + if (myCurrent > mySelected->Length()) return Standard_False; + if (mySelected->Value(myCurrent) == 0) Next(); + if (myCurrent > mySelected->Length()) return Standard_False; + return (mySelected->Value(myCurrent) > 0); +} + +void Transfer_Process::Iterator::Next () +{ + myCurrent++; + if (myCurrent > mySelected->Length()) return; + if (mySelected->Value(myCurrent) == 0) Next(); +} + +const Handle(Transfer_Binder)& Transfer_Process::Iterator::Value () const +{ + if (myCurrent == 0 || myCurrent > mySelected->Length()) + Standard_NoSuchObject::Raise ("Transfer_Process::Iterator::Value"); + if (mySelected->Value(myCurrent) == 0) + Standard_NoSuchObject::Raise ("Transfer_Process::Iterator::Value"); + return myBinders->Value(myCurrent); +} + +const Handle(Standard_Transient) & Transfer_Process::Iterator::SourceObject() const +{ + if (mySourceObjects.IsNull()) + Standard_NoSuchObject::Raise("Transfer_Process::Iterator : No Source Objects defined at all"); + return mySourceObjects->Value(myCurrent); +} + +void Transfer_Process::Iterator::AddItem (const Handle(Transfer_Binder)& atr) +{ + myBinders->Append(atr); + mySelected->Append(1); +} + +//======================================================================= +// Methods of Transfer_Process +//======================================================================= + +void Transfer_Process::Clean () +{ + Standard_Integer i, nb = NbMapped(); + Standard_Integer j,unb = 0; + for (i = 1; i <= nb; i ++) { + if (themap(i).IsNull()) unb ++; + } + if (unb == 0) return; + + // Refaire la map -> decalages + TColStd_Array1OfInteger unbs (1,nb); unbs.Init(0); + Transfer_MapOfProcess newmap (nb*2); + for (i = 1; i <= nb; i ++) { + Handle(Standard_Transient) ent = Mapped(i); + Handle(Transfer_Binder) bnd = MapItem(i); + if (bnd.IsNull()) continue; + j = newmap.Add (ent,bnd); + unbs.SetValue (i,j); + } + themap.Assign (newmap); + + // Update the map of roots + TColStd_IndexedMapOfInteger aNewRoots; + for( i=1; i<= theroots.Extent(); i++ ) { + j = theroots.FindKey(i); + Standard_Integer k = unbs.Value(j); + if ( k ) aNewRoots.Add ( k ); + } + theroots.Clear(); + theroots = aNewRoots; + + // Le reste : nettoyage + thelastobj.Nullify(); + thelastbnd.Nullify(); + theindex = 0; +} + +Handle(Transfer_Binder) Transfer_Process::Find (const Handle(Standard_Transient) &start) const +{ + if (thelastobj == start && theindex > 0) return thelastbnd; + const Standard_Integer index = themap.FindIndex (start); + return (index > 0)? themap.FindFromIndex(index) : NULL; +} + +Standard_Boolean Transfer_Process::IsBound (const Handle(Standard_Transient) &start) const +{ + Handle(Transfer_Binder) binder = Find(start); + return (binder.IsNull()? Standard_False : binder->HasResult()); +} + +void Transfer_Process::Bind (const Handle(Standard_Transient) &start, const Handle(Transfer_Binder)& binder) +{ + if (binder.IsNull()) return; + Handle(Transfer_Binder) former = FindAndMask(start); + if (!former.IsNull()) { + // On admet VoidBinder : alors on reprend son Check + if (former->DynamicType() == STANDARD_TYPE(Transfer_VoidBinder)) { + binder->Merge(former); + themap(theindex) = binder; // Substitution + } + else if (former->Status() == Transfer_StatusUsed) { + StartTrace (former,start,thelevel,4); + Transfer_TransferFailure::Raise ("TransferProcess : Bind, already Bound"); + } + else { + if (thetrace > 2) StartTrace (former,start,thelevel,5); + binder->CCheck()->GetMessages (former->Check()); + } + } + if (theindex == 0 || thelastbnd.IsNull()) { + if (theindex == 0) theindex = themap.Add(start,binder); // Nouveau + else themap(theindex) = binder; // idem en fait + thelastbnd = binder; + } + else { + thelastbnd = binder; + themap(theindex) = binder; + } +} + +Standard_Boolean Transfer_Process::Unbind (const Handle(Standard_Transient) &start) +{ + Handle(Transfer_Binder) former = FindAndMask(start); + if (theindex == 0) return Standard_False; + if (former.IsNull()) return Standard_False; + if (former->DynamicType() == STANDARD_TYPE(Transfer_VoidBinder)) return Standard_True; + themap(theindex) = thelastbnd; + if(theroots.Contains(theindex)) { + TColStd_IndexedMapOfInteger aNewRoots; + for(Standard_Integer i = 1; i <= theroots.Extent(); i++) + if(theindex!= theroots.FindKey(i)) + aNewRoots.Add(theroots.FindKey(i)); + + theroots.Clear(); + theroots = aNewRoots; + } + + thelastobj.Nullify(); + thelastbnd.Nullify(); + theindex = 0; + return Standard_True; +} + +void Transfer_Process::SendMsg (const Handle(Standard_Transient) &start, const Message_Msg& amsg) +{ + Handle(Transfer_Binder) binder = FindAndMask(start); + if (binder.IsNull()) { + binder = new Transfer_VoidBinder; + Bind (start,binder); + } + // Alimente la trace : Regle causant (user messages) + if (thetrace > 0) { + StartTrace (binder,start,thelevel,6); + themessenger << amsg.Value(); + if (amsg.IsEdited()&&thetrace>2) + themessenger << " [from: " << amsg.Original() << "]"; + themessenger << endl; + } +} + +void Transfer_Process::AddFail (const Handle(Standard_Transient) &start, const Standard_CString mess, const Standard_CString orig) +{ + Handle(Transfer_Binder) binder = FindAndMask(start); + if (binder.IsNull()) { + binder = new Transfer_VoidBinder; + Bind (start,binder); + } + binder->AddFail (mess,orig); + if (thetrace > 0) { + StartTrace (binder,start,thelevel,1); + themessenger << " --> Fail : " << mess; + if (orig[0] != '\0'&&thetrace>2) themessenger << " [from: " << orig << "]"; + themessenger << endl; + } +} + +void Transfer_Process::AddFail (const Handle(Standard_Transient) &start, const Message_Msg& amsg) +{ + if (amsg.IsEdited()) AddFail (start,TCollection_AsciiString(amsg.Value()).ToCString(), TCollection_AsciiString(amsg.Original()).ToCString()); + else AddFail (start,TCollection_AsciiString(amsg.Value()).ToCString()); +} + +void Transfer_Process::AddWarning (const Handle(Standard_Transient) &start, const Standard_CString mess, const Standard_CString orig) +{ + Handle(Transfer_Binder) binder = FindAndMask(start); + if (binder.IsNull()) { + binder = new Transfer_VoidBinder; + Bind (start,binder); + } + binder->AddWarning(mess,orig); + if (thetrace > 1) { + StartTrace (binder,start,thelevel,2); + themessenger << " --> Warning : " << mess; + if (orig[0] != '\0'&&thetrace>2) themessenger << " [from: " << orig << "]"; + themessenger << endl; + } +} + +void Transfer_Process::AddWarning (const Handle(Standard_Transient) &start, const Message_Msg& amsg) +{ + if (amsg.IsEdited()) AddWarning (start,TCollection_AsciiString(amsg.Value()).ToCString(), TCollection_AsciiString(amsg.Original()).ToCString()); + else AddWarning (start,TCollection_AsciiString(amsg.Value()).ToCString()); +} + +Handle(Interface_Check) Transfer_Process::Check (const Handle(Standard_Transient) &start) const +{ + const Handle(Transfer_Binder)& binder = Find(start); + return (binder.IsNull()? NULL : binder->Check()); +} + +void Transfer_Process::BindTransient (const Handle(Standard_Transient) &start, const Handle(Standard_Transient)& res) +{ + if (res.IsNull()) return; + Handle(Transfer_SimpleBinderOfTransient) binder = Handle(Transfer_SimpleBinderOfTransient)::DownCast(Find(start)); + // Binding sur place ? + if (!binder.IsNull() && binder->Status() == Transfer_StatusVoid) { + binder->SetResult(res); return; + } + // Sinon, refaire + binder = new Transfer_SimpleBinderOfTransient(res); + Bind(start,binder); +} + +Handle(Standard_Transient) Transfer_Process::FindTransient (const Handle(Standard_Transient) &start) const +{ + Handle(Transfer_SimpleBinderOfTransient) binder = Handle(Transfer_SimpleBinderOfTransient)::DownCast(Find(start)); + if (binder.IsNull()) return NULL; + if (!binder->HasResult()) return NULL; + return binder->Result(); +} + +Standard_Boolean Transfer_Process::GetTypedTransient (const Handle(Transfer_Binder)& binder, const Handle(Standard_Type)& atype, Handle(Standard_Transient)& val) const +{ + return Transfer_SimpleBinderOfTransient::GetTypedResult(binder,atype,val); +} + +Handle(Transfer_Binder) Transfer_Process::Transferring (const Handle(Standard_Transient) &theSource) +{ + // Map deja alimentee ? + Handle(Transfer_Binder) former = FindAndMask(theSource); + + // .... Transfert deja effectue avec Resultat ? .... + + // On considere que cette nouvelle demande de Transfert correspond donc a une + // utilisation en plus : noter "AlreadyUsed", donc resultat non modifiable + if (!former.IsNull()) { + if (former->HasResult()) { + former->SetAlreadyUsed(); + return former; + } + + // .... Etat Initial : peut-etre deja fait ... ou infaisable ! + Transfer_StatusExec statex = former->StatusExec(); + switch (statex) { + case Transfer_StatusInitial : // Transfert prepare a faire + break; + case Transfer_StatusDone : // Transfert deja fait + themessenger << " .. and Transfer done" << endl; + return former; + case Transfer_StatusRun : // ca y est, on boucle + former->SetStatusExec(Transfer_StatusLoop); + return former; + case Transfer_StatusError : // pas propre, ca ... + if (thetrace) { + themessenger << " *** Transfer in Error Status :" << endl; + StartTrace (former, theSource, thelevel,0); + } + else StartTrace (former,theSource,thelevel,4); + Transfer_TransferFailure::Raise("TransferProcess : Transfer in Error Status"); + case Transfer_StatusLoop : // la boucle est bouclee ... + if (thetrace) { + themessenger << " *** Transfer Head of Dead Loop :" << endl; + StartTrace (former,theSource,thelevel,0); + } + else StartTrace (former,theSource,thelevel,4); + Transfer_TransferDeadLoop::Raise("TransferProcess : Transfer at Head of a Dead Loop"); + } + + // .... OK, on peut lancer l Execution + former->SetStatusExec(Transfer_StatusRun); + } + + Handle(Transfer_Binder) binder; + Standard_Boolean newbind = Standard_False; + + // Transfert sous protection pour les exceptions (pour notification en fait) + const Standard_Integer oldlev = thelevel; + try { + OCC_CATCH_SIGNALS + //! Invokes the Actor to work (set by SetActor), and tries its Nexts if no result is produced, + //! until a Non Null Binder is produced. + //! But keep in mind that a Null Binder can allways be returned + //! if a Starting Entity has not been recognized at all. + thelevel++; // si decremente et == 0, transfert racine + + Handle(Actor) actor = theactor; + // On balaie les Next jusqu a avoir un Resultat + while (!actor.IsNull()) { + if (actor->Recognize (theSource)) binder = actor->Transferring(theSource,this); + else binder.Nullify(); + if (!binder.IsNull()) break; + actor = actor->Next(); + } + + if (!binder.IsNull()) { + // Gestion du niveau racine (.. a regarder de pres ..) + if (therootl == 0 && binder->StatusExec() == Transfer_StatusDone) + therootl = thelevel - 1; + } + + if (thelevel > 0) thelevel--; + } + + // ... Exceptions a Rattraper : elles ne se ressemblent pas toutes ... ! + catch (Transfer_TransferDeadLoop) { + if (binder.IsNull()) { + themessenger << " *** Dead Loop with no Result" << endl; + if (thetrace) StartTrace (binder,theSource,thelevel-1,0); + binder = new Transfer_VoidBinder; + Bind (theSource,binder); newbind = Standard_True; + } else if (binder->StatusExec() == Transfer_StatusLoop) { + if (thetrace) { + themessenger << " *** Dead Loop : Finding head of Loop :" << endl; + StartTrace (binder,theSource,thelevel-1,0); + } + else StartTrace (binder,theSource,thelevel-1,4); + Transfer_TransferFailure::Raise("TransferProcess : Head of Dead Loop"); + // Autrement dit, on change d exception (on est sorti de la boucle) + } else { + if (thetrace) { + themessenger << " *** Dead Loop : Actor in Loop :" << endl; + StartTrace (binder,theSource,thelevel-1,0); + } + } + binder->AddFail("Transfer in dead Loop"); + thelevel = oldlev; + } + catch (Standard_Failure) { + if (binder.IsNull()) { + themessenger << " *** Exception Raised with no Result" << endl; + binder = new Transfer_VoidBinder; + Bind (theSource,binder); newbind = Standard_True; + } + binder->AddFail("Transfer stopped by exception raising"); + if (thetrace) { + themessenger << " *** Raised : " << Standard_Failure::Caught()->GetMessageString() << endl; + StartTrace (binder,theSource,thelevel-1,4); + } + thelevel = oldlev; + } + + // .... Conclusion : Noter dans la Map .... + if (!newbind && !binder.IsNull()) { + Bind(theSource,binder); + } + else { + //= by ABV: 5 Oct 97: nothing generated, but former can be in run state - drop it + //= ASK: may be set it to StatusInitial ? + if ( !former.IsNull() ) former->SetStatusExec ( Transfer_StatusDone ); //+ + return NULL; // Binder Null ... que faire d autre ? + } + + // .... Gerer les Racines (si prevu) .... + if (therootl >= thelevel) { + therootl = 0; + if (therootm && binder->Status() != Transfer_StatusVoid) { + SetRoot (theSource); + } + } + return thelastbnd; +} + +void Transfer_Process::StartTrace (const Handle(Transfer_Binder)& binder, const Handle(Standard_Transient) &start, const Standard_Integer level, const Standard_Integer mode) const +{ + // ### Fail (Roots:50) -- Start start->DynamicType() + // ### Fail (Roots:50) -- Start id:#label.. Type:start->DynamicType() + if (thetrace > 3) { // Internal to be switch when searching bug (trace >= 4) + if (mode == 1) themessenger << " ### Fail"; + if (mode == 2) themessenger << " ### Warning"; + if (mode == 3) themessenger << " ### New Root n0 " << theroots.Extent(); + if (mode == 4) themessenger << " ### Exception"; + if (mode == 5) themessenger << " ### Substitution"; + if (mode == 6) themessenger << " ### Information"; + if (level > 1) + themessenger << " (nested)"; // " at nesting Level:"<= 0 && mode != 3) + themessenger << " at " << theroots.Extent() << " Roots"; + } + if (!start.IsNull()) PrintTrace (start,themessenger); + + if (!binder.IsNull()) { + Handle(Transfer_Binder) bnd = binder; + Standard_Boolean hasres = Standard_False; + while (!bnd.IsNull()) { + if (bnd->Status() != Transfer_StatusVoid) { + // --- Result Type: binder->ResultType() --- Binder : binder->DynamicType(); + if (!hasres) + themessenger << "\n --- Result Type : "; + else + themessenger << " , "; + themessenger << bnd->ResultTypeName(); + hasres = Standard_True; + } + bnd = bnd->NextResult(); + } + if (!hasres && mode > 2) { + themessenger << "\n --- No Result recorded"; + } + } + themessenger << endl; +} + +void Transfer_Process::PrintTrace (const Handle(Standard_Transient) &theSource, const Handle(Message_Messenger)& S) const +{ + if (!theSource.IsNull()) { + Handle(Transfer_Finder) aFinder = Handle(Transfer_Finder)::DownCast(theSource); + S << " Type:" << (aFinder.IsNull()? theSource->DynamicType()->Name() : aFinder->ValueTypeName()); + } +} + +void Transfer_Process::PrintStats(const Handle(Message_Messenger)& S) const +{ + S<<"\n*******************************************************************\n"; + S << "******** Basic Statistics ********"<NbEntities()<Check(); + Transfer_StatusExec stat = binder->StatusExec(); + if (stat != Transfer_StatusInitial && stat != Transfer_StatusDone) + nbe ++; + else { + if (ach->NbWarnings() > 0) nbw++; + if (binder->HasResult()) nbr++; + } + } + if (nbr > nbroots) + S<<"**** ( Itermediate Results : "< 0) + S<<"**** Errors on : "< 0) + S<<"**** Warnings on : "<StatusExec(); + if (statex != Transfer_StatusInitial && statex != Transfer_StatusDone) + iter.Add (binder,Mapped(i)); // on note les cas "pas normaux" + } + return iter; +} + +Interface_CheckIterator Transfer_Process::CheckList (const Standard_Boolean erronly) const +{ + Interface_CheckIterator list; + Standard_Integer num, max = NbMapped(); + for (Standard_Integer i = 1; i <= max; i ++) { + Handle(Transfer_Binder) binder = MapItem(i); + if (binder.IsNull()) continue; + Transfer_StatusExec statex = binder->StatusExec(); + Handle(Interface_Check) check = binder->Check(); + if (statex != Transfer_StatusInitial && statex != Transfer_StatusDone && !check->HasFailed()) + check->AddFail("Transfer in Abnormal Status (!= Initial or Done)"); + if (!check->HasFailed() && (erronly || check->NbWarnings() == 0)) continue; + const Handle(Standard_Transient) &ent = Mapped(i); + num = CheckNum(ent); + if (num == 0) num = i; + check->SetEntity(ent); + list.Add(check,num); + } + return list; +} diff --git a/src/Transfer/Transfer_Process.hxx b/src/Transfer/Transfer_Process.hxx new file mode 100644 index 0000000000..12974b81b7 --- /dev/null +++ b/src/Transfer/Transfer_Process.hxx @@ -0,0 +1,525 @@ +// Copyright (c) 1999-2014 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +// TheSourceType is assumed Handle(Standard_Transient) or Handle(Transfer_Finder) +// It should provide : "==" , .IsNull() , ->DynamicType() + +#ifndef _Transfer_Process_HeaderFile +#define _Transfer_Process_HeaderFile + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +class TColStd_HSequenceOfInteger; +class TColStd_HSequenceOfTransient; +class Message_Msg; +class Message_Messenger; +class Interface_Check; +class Interface_CheckIterator; +class Interface_InterfaceModel; +class Transfer_HSequenceOfBinder; +class Transfer_Binder; + + +class Transfer_Process : public MMgt_TShared +{ + public: + + typedef NCollection_IndexedDataMap Transfer_MapOfProcess; + + class Actor : public MMgt_TShared + { + public: + + Actor() : themodetrans(0) {} + + //! Prerequesite for Transfer : the method Transfer is called on a starting object only if Recognize has returned True on it. + //! This allows to define a list of Actors, each one processing a definite kind of data + //! Transfer_Process calls Recognize on each one before calling Transfer. + //! But even if Recognize has returned True, Transfer can reject by returning a Null Binder (afterwards rejection), + //! the next actor is then invoked + //! + //! The provided default returns True, can be redefined + Standard_EXPORT virtual Standard_Boolean Recognize (const Handle(Standard_Transient)& /*start*/) { return Standard_True; } + + //! Specific action of Transfer. The Result is stored in + //! the returned Binder, or a Null Handle for "No result" + //! (Default defined as doing nothing; should be deffered) + //! "mutable" allows the Actor to record intermediate + //! information, in addition to those of TransferProcess + Standard_EXPORT virtual Handle(Transfer_Binder) Transferring (const Handle(Standard_Transient)& /*start*/, const Handle(Transfer_Process)& /*TP*/) { return NULL; } + + //! Defines a Next Actor : it can then be asked to work if + //! produces no result for a given type of Object. + //! If Next is already set and is not "Last", calls + //! SetNext on it. If Next defined and "Last", the new + //! actor is added before it in the list + Standard_EXPORT void SetNext (const Handle(Actor)& next) + { + if (thenext == next) return; + if (thenext.IsNull()) thenext = next; + else thenext->SetNext(next); + } + + //! Returns the Actor defined as Next, or a Null Handle + const Handle(Actor) & Next() const { return thenext; } + + //! Set a specific transfer mode + void SetTransferMode (const Standard_Integer theMode) { themodetrans = theMode; } + + DEFINE_STANDARD_RTTI_INLINE(Actor,MMgt_TShared) + + protected: + + Handle(Actor) thenext; + Standard_Integer themodetrans; + }; + + class Iterator + { + public: + + DEFINE_STANDARD_ALLOC + + //! Creates an empty Iterator + //! If WithSource is True, each Binder to be iterated will + //! be associated to its corresponding Source Object + Standard_EXPORT Iterator(const Standard_Boolean WithSource); + + //! Adds a Binder to the iteration list (construction) + //! with no corresponding Starting Object + //! (note that Result is brought by Binder) + Standard_EXPORT void Add (const Handle(Transfer_Binder)& theBinder); + + //! Adds a Binder to the iteration list, associated with + //! its corresponding Starting Object "start" + //! Starting Object is ignored if not required at + //! Creation time + Standard_EXPORT void Add (const Handle(Transfer_Binder)& theBinder, const Handle(Standard_Transient)& theSource); + + //! After having added all items, keeps or rejects items + //! which are attached to starting data given by + //! = True (D) : keeps. = False : rejects + //! Does nothing if was False + Standard_EXPORT void Filter (const Handle(TColStd_HSequenceOfTransient)& theList); + + //! Returns count of Binders to be iterated + Standard_EXPORT Standard_Integer Number() const; + + //! Clears Iteration in progress, to allow it to be restarted + void Start() { myCurrent = 0; Next(); } + + //! Returns True if there are other Items to iterate + Standard_EXPORT Standard_Boolean More(); + + //! Sets Iteration to the next Item + Standard_EXPORT void Next(); + + //! Returns the current Binder + Standard_EXPORT const Handle(Transfer_Binder)& Value() const; + + //! Returns corresponding Source Object + Standard_EXPORT const Handle(Standard_Transient) & SourceObject() const; + + private: + + //! Adds a Binder to the iteration list (construction) + Standard_EXPORT void AddItem (const Handle(Transfer_Binder)& atr); + + Standard_Integer myCurrent; + Handle(Transfer_HSequenceOfBinder) myBinders; + Handle(TColStd_HSequenceOfInteger) mySelected; + Handle(TColStd_HSequenceOfTransient) mySourceObjects; + }; + + public: + + //! Sets TransferProcess at initial state. Gives an Initial size + //! (indicative) for the Map when known (default is 10000). + //! Sets default trace file as a printer and default trace level + //! (see Message_TraceFile). + Transfer_Process(const Standard_Integer nb = 10000) + : themessenger(Message::DefaultMessenger()), + thetrace(0), + thelevel(0), therootl(0), + therootm(Standard_False), + theindex(0), + themap(nb) + {} + + //! Sets TransferProcess at initial state. Gives an Initial size + //! (indicative) for the Map when known (default is 10000). + //! Sets a specified printer. + Transfer_Process(const Handle(Message_Messenger)& messenger, const Standard_Integer nb = 10000) + : themessenger(messenger.IsNull()? Message::DefaultMessenger() : messenger), + thetrace(1), + thelevel(0), therootl(0), + therootm(Standard_False), + theindex(0), + themap(nb) + {} + + //! Sets an InterfaceModel, which can be used during transfer + //! for instance if a context must be managed, it is in the Model + void SetModel (const Handle(Interface_InterfaceModel)& model) { themodel = model; } + + //! Returns the Model which can be used for context + const Handle(Interface_InterfaceModel)& Model() const { return themodel; } + + //! Resets a TransferProcess as ready for a completely new work. + //! Clears general data (roots) and the Map + void Clear() + { + thelevel = 0; therootl = 0; + theroots.Clear(); + themap.Clear(); + theindex = 0; thelastobj.Nullify(); thelastbnd.Nullify(); + } + + //! Rebuilds the Map and the roots to really remove Unbound items + //! Because Unbind keeps the entity in place, even if not bound + //! Hence, working by checking new items is meaningless if a + //! formerly unbound item is rebound + Standard_EXPORT void Clean(); + + //! Resizes the Map as required (if a new reliable value has been + //! determined). Acts only if is greater than actual NbMapped + void Resize (const Standard_Integer nb) { if (nb > themap.NbBuckets()) themap.ReSize(nb); } + + //! Defines an Actor, which is used for automatic Transfer + //! If already defined, the new Actor is cumulated + //! (see SetNext from Actor) + void SetActor (const Handle(Actor)& actor) + { + if (theactor == actor) return; + if (theactor.IsNull()) theactor = actor; + else if (actor.IsNull()) theactor = actor; + else theactor->SetNext(actor); + } + + //! Returns the Binder which is linked with a starting Object + //! It can either bring a Result (Transfer done) or none (for a + //! pre-binding). + //! If no Binder is linked with , returns a Null Handle + //! Considers a category number, by default 0 + Standard_EXPORT Handle(Transfer_Binder) Find (const Handle(Standard_Transient) &start) const; + + //! Returns True if a Result (whatever its form) is Bound with a starting Object. + //! I.e., if a Binder with a Result set, is linked with it + Standard_EXPORT Standard_Boolean IsBound (const Handle(Standard_Transient) &start) const; + + //! Creates a Link a starting Object with a Binder. This Binder + //! can either bring a Result (effective Binding) or none (it can + //! be set later : pre-binding). + //! Considers a category number, by default 0 + Standard_EXPORT void Bind (const Handle(Standard_Transient) &start, const Handle(Transfer_Binder)& binder); + + //! Removes the Binder linked with a starting object + //! If this Binder brings a non-empty Check, it is replaced by + //! a VoidBinder. Also removes from the list of Roots as required. + //! Returns True if done, False if was not bound + //! Considers a category number, by default 0 + Standard_EXPORT Standard_Boolean Unbind (const Handle(Standard_Transient) &start); + + //! Sets Messenger used for outputting messages. + void SetMessenger (const Handle(Message_Messenger)& messenger) + { themessenger = messenger.IsNull()? Message::DefaultMessenger() : messenger; } + + //! Returns Messenger used for outputting messages. + //! The returned object is guaranteed to be non-null; + //! default is Message::Messenger(). + const Handle(Message_Messenger) & Messenger() const { return themessenger; } + + //! Sets trace level used for outputting messages: + //! = 0 : no trace at all + //! = 1 : handled exceptions and calls to AddError + //! = 2 : also calls to AddWarning + //! = 3 : also traces new Roots + //! (uses method ErrorTrace). + //! Default is 1 : Errors traced + void SetTraceLevel (const Standard_Integer tracelev) { thetrace = tracelev; } + + //! Returns trace level used for outputting messages. + Standard_Integer TraceLevel() const { return thetrace; } + + //! New name for AddFail (Msg) + void SendFail (const Handle(Standard_Transient) &start, const Message_Msg& amsg) { AddFail(start,amsg); } + + //! New name for AddWarning (Msg) + void SendWarning (const Handle(Standard_Transient) &start, const Message_Msg& amsg) { AddWarning(start,amsg); } + + //! Adds an Error message to a starting entity (to the check of + //! its Binder of category 0, as a Fail) + Standard_EXPORT void AddFail (const Handle(Standard_Transient) &start, const Standard_CString mess, const Standard_CString orig = ""); + + //! (other name of AddFail, maintained for compatibility) + void AddError (const Handle(Standard_Transient) &start, const Standard_CString mess, const Standard_CString orig = "") + { AddFail (start,mess,orig); } + + //! Adds an Error Message to a starting entity from the definition + //! of a Msg (Original+Value) + Standard_EXPORT void AddFail (const Handle(Standard_Transient) &start, const Message_Msg& amsg); + + //! Adds a Warning message to a starting entity (to the check of + //! its Binder of category 0) + Standard_EXPORT void AddWarning (const Handle(Standard_Transient) &start, const Standard_CString mess, const Standard_CString orig = ""); + + //! Adds a Warning Message to a starting entity from the definition + //! of a Msg (Original+Value) + Standard_EXPORT void AddWarning (const Handle(Standard_Transient) &start, const Message_Msg& amsg); + + //! Returns the Check attached to a starting entity. If + //! is unknown, returns an empty Check + //! Adds a case name to a starting entity + //! Adds a case value to a starting entity + //! Returns the complete case list for an entity. Null Handle if empty + //! In the list of mapped items (between 1 and NbMapped), + //! searches for the first item which follows (not included) + //! and which has an attribute named + //! Attributes are brought by Binders + //! Hence, allows such an iteration + //! + //! for (num = TP->NextItemWithAttribute(name,0); + //! num > 0; + //! num = TP->NextItemWithAttribute(name,num) { + //! .. process mapped item + //! } + //! Returns the type of an Attribute attached to binders + //! If this name gives no Attribute, returns ParamVoid + //! If this name gives several different types, returns ParamMisc + //! Else, returns the effective type (ParamInteger, ParamReal, + //! ParamIdent, or ParamText) + //! Returns the list of recorded Attribute Names, as a Dictionary + //! of Integer : each value gives the count of items which bring + //! this attribute name + //! By default, considers all the attribute names + //! If is given, considers only the attribute names + //! which begin by + Standard_EXPORT Handle(Interface_Check) Check (const Handle(Standard_Transient) &start) const; + + //! Binds a starting object with a Transient Result. + //! Uses a SimpleBinderOfTransient to work. If there is already + //! one but with no Result set, sets its Result. + //! Considers a category number, by default 0 + Standard_EXPORT void BindTransient (const Handle(Standard_Transient) &start, const Handle(Standard_Transient)& res); + + //! Returns the Result of the Transfer of an object as a + //! Transient Result. + //! Returns a Null Handle if there is no Transient Result + //! Considers a category number, by default 0 + //! Warning : Supposes that Binding is done with a SimpleBinderOfTransient + Standard_EXPORT Handle(Standard_Transient) FindTransient (const Handle(Standard_Transient) &start) const; + + //! Searches for a transient result attached to a starting object, + //! according to its type, by criterium IsKind(atype) + //! + //! In case of multiple result, explores the list and gives in + //! the first transient result IsKind(atype) + //! Returns True and fills if found + //! Else, returns False ( is not touched, not even nullified) + //! + //! This syntactic form avoids to do DownCast : if a result is + //! found with the good type, it is loaded in and can be + //! immediately used, well initialised + Standard_Boolean FindTypedTransient (const Handle(Standard_Transient) &start, const Handle(Standard_Type)& atype, Handle(Standard_Transient)& val) const + { return GetTypedTransient (Find(start),atype,val); } + + //! Safe variant for arbitrary type of argument + template + Standard_Boolean FindTypedTransient (const Handle(Standard_Transient) &start, const Handle(Standard_Type)& atype, Handle(T)& val) const + { + Handle(Standard_Transient) aVal = val; + return FindTypedTransient (start, atype, aVal) && ! (val = Handle(T)::DownCast(aVal)).IsNull(); + } + + //! Searches for a transient result recorded in a Binder, whatever + //! this Binder is recorded or not in + //! + //! This is strictly equivalent to the class method GetTypedResult + //! from class SimpleBinderOfTransient, but is just lighter to call + //! + //! Apart from this, works as FindTypedTransient + Standard_EXPORT Standard_Boolean GetTypedTransient (const Handle(Transfer_Binder)& binder, const Handle(Standard_Type)& atype, Handle(Standard_Transient)& val) const; + + //! Safe variant for arbitrary type of argument + template + Standard_Boolean GetTypedTransient (const Handle(Transfer_Binder)& start, const Handle(Standard_Type)& atype, Handle(T)& val) const + { + Handle(Standard_Transient) aVal = val; + return GetTypedTransient (start, atype, aVal) && ! (val = Handle(T)::DownCast(aVal)).IsNull(); + } + + //! Returns the maximum possible value for Map Index + //! (no result can be bound with a value greater than it) + Standard_Integer NbMapped() const { return themap.Extent(); } + + //! Returns the Starting Object bound to an Index, + const Handle(Standard_Transient) & Mapped (const Standard_Integer num) const { return themap.FindKey(num); } + + //! Returns the Index value bound to a Starting Object, 0 if none + Standard_Integer MapIndex (const Handle(Standard_Transient) &start) const { return themap.FindIndex(start); } + + //! Returns the Binder bound to an Index + //! Considers a category number, by default 0 + Handle(Transfer_Binder) MapItem (const Standard_Integer num) const { return themap.FindFromIndex(num); } + + //! Declares (and its Result) as Root. This status will be + //! later exploited by RootResult, see below (Result can be + //! produced at any time) + void SetRoot (const Handle(Standard_Transient) &start) + { + Standard_Integer index = MapIndex(start); + if (index == 0) + return; + theroots.Add(index); + if (thetrace > 2) StartTrace (MapItem(index),start,thelevel,3); + } + + //! Enable (if True) or Disables (if False) Root + //! Management. If it is set, Transfers are considered as stacked + //! (a first Transfer commands other Transfers, and so on) and + //! the Transfers commanded by an external caller are "Root". + //! Remark : SetRoot can be called whatever this status, on every + //! object. + //! Default is set to True. + void SetRootManagement (const Standard_Boolean stat) { therootm = stat; } + + //! Returns the count of recorded Roots + Standard_Integer NbRoots() const { return theroots.Extent(); } + + //! Returns a Root Entity given its number in the list (1-NbRoots) + Standard_EXPORT const Handle(Standard_Transient) & Root (const Standard_Integer num) const + { + Standard_Integer ind = 0; + if (num > 0 && num <= theroots.Extent()) ind = theroots.FindKey(num); + return themap.FindKey (ind); + } + + //! Returns the index in the list of roots for a starting item, + //! or 0 if it is not recorded as a root + Standard_EXPORT Standard_Integer RootIndex (const Handle(Standard_Transient) &start) const + { + Standard_Integer index = MapIndex(start); + if (index == 0) return 0; + return theroots.FindIndex(index); + } + + //! Performs the Transfer of a Source Object. + //! Mapping and Roots are managed : nothing is done if a Result is + //! already Bound, an exception is raised in case of error. + Standard_EXPORT Handle(Transfer_Binder) Transferring (const Handle(Standard_Transient) &theSource); + + //! Same as Transferring but does not return the Binder. + //! Simply returns True in case of success (for user call) + Standard_Boolean Transfer (const Handle(Standard_Transient) &theSource) + { + Handle(Transfer_Binder) binder = Transferring(theSource); + return (!binder.IsNull()); + } + + //! Method called when trace is asked + //! Calls PrintTrace to display information relevant for starting + //! objects (which can be redefined) + //! is Nesting Level of Transfer (0 = root) + //! controls the way the trace is done : + //! 0 neutral, 1 for Error, 2 for Warning message, 3 for new Root + Standard_EXPORT void StartTrace (const Handle(Transfer_Binder)& binder, const Handle(Standard_Transient) &start, const Standard_Integer level, const Standard_Integer mode) const; + + //! Prints statistics on transfer + Standard_EXPORT void PrintStats(const Handle(Message_Messenger)& S) const; + + //! Returns, as an iterator, the log of root transfer, i.e. the + //! created objects and Binders bound to starting roots + //! If withstart is given True, Starting Objets are also returned + Standard_EXPORT Iterator RootResult (const Standard_Boolean withstart = Standard_False) const; + + //! Returns, as an Iterator, the entire log of transfer (list of + //! created objects and Binders which can bring errors) + //! If withstart is given True, Starting Objets are also returned + Standard_EXPORT Iterator CompleteResult (const Standard_Boolean withstart = Standard_False) const; + + //! Returns Binders which are neither "Done" nor "Initial", + //! that is Error,Loop or Run (abnormal states at end of Transfer) + //! Starting Objects are given in correspondance in the iterator + Standard_EXPORT Iterator AbnormalResult() const; + + //! Returns a CheckList as a list of Check : each one is for a + //! starting entity which have either check (warning or fail) + //! messages are attached, or are in abnormal state : that case + //! gives a specific message + //! If is True, checks with Warnings only are ignored + Standard_EXPORT Interface_CheckIterator CheckList (const Standard_Boolean erronly) const; + + //! Sets Progress indicator + void SetProgress (const Handle(Message_ProgressIndicator)& theProgress) { myProgress = theProgress; } + + //! Gets Progress indicator + const Handle(Message_ProgressIndicator) & GetProgress() const { return myProgress; } + + DEFINE_STANDARD_RTTIEXT(Transfer_Process,MMgt_TShared) + + protected: + + //! Adds an information message + //! Trace is filled if trace level is at least 3 + Standard_EXPORT void SendMsg (const Handle(Standard_Transient) &start, const Message_Msg& amsg); + + //! Computes a number to be associated to a starting object in + //! a check or a check-list + //! By default, returns 0; can be redefined + Standard_EXPORT virtual Standard_Integer CheckNum (const Handle(Standard_Transient) &) const { return 0; } + + //! Prints a short information on a source object. + Standard_EXPORT virtual void PrintTrace (const Handle(Standard_Transient) &theSource, const Handle(Message_Messenger)& S) const; + + Handle(Interface_InterfaceModel) themodel; + + private: + + //! Same as Find but stores the last access to the map, for a + //! faster access on next calls (as Bind does too) + const Handle(Transfer_Binder) & FindAndMask (const Handle(Standard_Transient) &start) + { + if (thelastobj == start) { + if (theindex > 0) return thelastbnd; + } + thelastobj = start; + theindex = themap.FindIndex (start); + if (theindex > 0) thelastbnd = themap.FindFromIndex(theindex); + else thelastbnd.Nullify(); + return thelastbnd; + } + + Handle(Message_Messenger) themessenger; + Standard_Integer thetrace; + Standard_Integer thelevel; + Standard_Integer therootl; + Standard_Boolean therootm; + TColStd_IndexedMapOfInteger theroots; + Handle(Standard_Transient) thelastobj; + Handle(Transfer_Binder) thelastbnd; + Standard_Integer theindex; + Handle(Actor) theactor; + Transfer_MapOfProcess themap; + Handle(Message_ProgressIndicator) myProgress; +}; + +#endif // _Transfer_Process_HeaderFile diff --git a/src/Transfer/Transfer_ProcessForFinder.hxx b/src/Transfer/Transfer_ProcessForFinder.hxx deleted file mode 100644 index a20e0e5e7a..0000000000 --- a/src/Transfer/Transfer_ProcessForFinder.hxx +++ /dev/null @@ -1,26 +0,0 @@ -// Created on: 1992-02-03 -// Created by: Christian CAILLET -// Copyright (c) 1992-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _Transfer_ProcessForFinder_HeaderFile -#define _Transfer_ProcessForFinder_HeaderFile - -#include - -#include - -typedef Transfer_ProcessGen Transfer_ProcessForFinder; - -#endif // _Transfer_ProcessForFinder_HeaderFile diff --git a/src/Transfer/Transfer_ProcessForTransient.hxx b/src/Transfer/Transfer_ProcessForTransient.hxx deleted file mode 100644 index dbc67c566a..0000000000 --- a/src/Transfer/Transfer_ProcessForTransient.hxx +++ /dev/null @@ -1,26 +0,0 @@ -// Created on: 1992-02-03 -// Created by: Christian CAILLET -// Copyright (c) 1992-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _Transfer_ProcessForTransient_HeaderFile -#define _Transfer_ProcessForTransient_HeaderFile - -#include - -#include - -typedef Transfer_ProcessGen Transfer_ProcessForTransient; - -#endif // _Transfer_ProcessForTransient_HeaderFile diff --git a/src/Transfer/Transfer_ProcessGen.hxx b/src/Transfer/Transfer_ProcessGen.hxx deleted file mode 100644 index 2942636559..0000000000 --- a/src/Transfer/Transfer_ProcessGen.hxx +++ /dev/null @@ -1,1017 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -// TheSourceType is assumed Handle(Standard_Transient) or Handle(Transfer_Finder) -// It should provide : "==" , .IsNull() , ->DynamicType() - -#ifndef _Transfer_ProcessGen_HeaderFile -#define _Transfer_ProcessGen_HeaderFile - -#include - -#include -#include - -#include -#include -#include - -class Interface_InterfaceModel; -#include -#include - -class Transfer_Binder; -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - -#include - - -template < class TheKeyType, - class TheListType > -class Transfer_ProcessGen : public MMgt_TShared -{ - public: - - typedef NCollection_IndexedDataMap Transfer_MapOfProcess; - - class Actor : public Transfer_Actor - { - public: - - Standard_EXPORT Actor() {} - - //! Prerequesite for Transfer : the method Transfer is - //! called on a starting object only if Recognize has - //! returned True on it - //! This allows to define a list of Actors, each one - //! processing a definite kind of data - //! TransferProcess calls Recognize on each one before - //! calling Transfer. But even if Recognize has returned - //! True, Transfer can reject by returning a Null Binder - //! (afterwards rejection), the next actor is then invoked - //! - //! The provided default returns True, can be redefined - Standard_EXPORT virtual Standard_Boolean Recognize (const TheKeyType& /*start*/) { return Standard_True; } - - //! Specific action of Transfer. The Result is stored in - //! the returned Binder, or a Null Handle for "No result" - //! (Default defined as doing nothing; should be deffered) - //! "mutable" allows the Actor to record intermediate - //! information, in addition to those of TransferProcess - Standard_EXPORT virtual Handle(Transfer_Binder) Transferring (const TheKeyType& /*start*/, const Handle(Transfer_ProcessGen)& /*TP*/) { return NULL; } - - //! Defines a Next Actor : it can then be asked to work if - //! produces no result for a given type of Object. - //! If Next is already set and is not "Last", calls - //! SetNext on it. If Next defined and "Last", the new - //! actor is added before it in the list - Standard_EXPORT void SetNext (const Handle(Actor)& next) - { - if (thenext == next) return; - if (thenext.IsNull()) thenext = next; - else thenext->SetNext(next); - } - - //! Returns the Actor defined as Next, or a Null Handle - const Handle(Actor) & Next() const { return thenext; } - - DEFINE_STANDARD_RTTI_INLINE(Actor,Transfer_Actor) - - protected: - - Handle(Actor) thenext; - }; - - class Iterator : public Transfer_Iterator - { - public: - - DEFINE_STANDARD_ALLOC - - //! Creates an empty Iterator - //! If WithSource is True, each Binder to be iterated will - //! be associated to its corresponding Source Object - Standard_EXPORT Iterator(const Standard_Boolean WithSource) - { if (WithSource) mySourceObjects = new TheListType(); } - - //! Adds a Binder to the iteration list (construction) - //! with no corresponding Starting Object - //! (note that Result is brought by Binder) - Standard_EXPORT void Add (const Handle(Transfer_Binder)& theBinder) - { - if (!mySourceObjects.IsNull()) - Standard_NoSuchObject::Raise("Transfer_ProcessGen::Iterator::Add, Source Object required but not provided"); - AddItem(theBinder); - } - - //! Adds a Binder to the iteration list, associated with - //! its corresponding Starting Object "start" - //! Starting Object is ignored if not required at - //! Creation time - Standard_EXPORT void Add (const Handle(Transfer_Binder)& theBinder, const TheKeyType& theSource) - { - AddItem(theBinder); - if (!mySourceObjects.IsNull()) mySourceObjects->Append(theSource); - } - - //! After having added all items, keeps or rejects items - //! which are attached to starting data given by - //! = True (D) : keeps. = False : rejects - //! Does nothing if was False - Standard_EXPORT void Filter (const Handle(TheListType)& theList) - { - if (theList.IsNull() || mySourceObjects.IsNull()) return; - Standard_Integer i, j, nb = mySourceObjects->Length(); - if (nb == 0) return; - Handle(Transfer_Binder) factice; - Transfer_MapOfProcess amap (nb); - for (i = 1; i <= nb; i ++) { - j = amap.Add (mySourceObjects->Value(i),factice); - SelectItem (j,Standard_False); - } - - // Comparaison - nb = theList->Length(); - for (i = 1; i <= nb; i ++) { - j = amap.FindIndex (theList->Value(i)); - if (j > 0) SelectItem (j,Standard_True); - } - } - - //! Returns corresponding Source Object - Standard_EXPORT const TheKeyType& SourceObject() const - { - if (mySourceObjects.IsNull()) - Standard_NoSuchObject::Raise("Transfer_ProcessGen::Iterator : No Source Objects defined at all"); - return mySourceObjects->Value(thecurr); - } - - private: - - Handle(TheListType) mySourceObjects; - }; - - public: - - //! Sets TransferProcess at initial state. Gives an Initial size - //! (indicative) for the Map when known (default is 10000). - //! Sets default trace file as a printer and default trace level - //! (see Message_TraceFile). - Standard_EXPORT Transfer_ProcessGen(const Standard_Integer nb = 10000) - : themap (nb) - { - therootm = Standard_False; - thelevel = 0; therootl = 0; - themessenger = Message::DefaultMessenger(); - thetrace = 0; - theindex = 0; - } - - //! Sets TransferProcess at initial state. Gives an Initial size - //! (indicative) for the Map when known (default is 10000). - //! Sets a specified printer. - Standard_EXPORT Transfer_ProcessGen(const Handle(Message_Messenger)& messenger, const Standard_Integer nb = 10000) - : themap (nb) - { - therootm = Standard_False; - thelevel = 0; therootl = 0; - SetMessenger (messenger); - thetrace = 1; - theindex = 0; - } - - //! Sets an InterfaceModel, which can be used during transfer - //! for instance if a context must be managed, it is in the Model - void SetModel (const Handle(Interface_InterfaceModel)& model) { themodel = model; } - - //! Returns the Model which can be used for context - const Handle(Interface_InterfaceModel)& Model() const { return themodel; } - - //! Resets a TransferProcess as ready for a completely new work. - //! Clears general data (roots) and the Map - Standard_EXPORT void Clear() - { - thelevel = 0; therootl = 0; - theroots.Clear(); - themap.Clear(); - theindex = 0; thelastobj.Nullify(); thelastbnd.Nullify(); - } - - //! Rebuilds the Map and the roots to really remove Unbound items - //! Because Unbind keeps the entity in place, even if not bound - //! Hence, working by checking new items is meaningless if a - //! formerly unbound item is rebound - Standard_EXPORT void Clean() - { - Standard_Integer i, nb = NbMapped(); - Standard_Integer j,unb = 0; - for (i = 1; i <= nb; i ++) { - if (themap(i).IsNull()) unb ++; - } - if (unb == 0) return; - - // Refaire la map -> decalages - TColStd_Array1OfInteger unbs (1,nb); unbs.Init(0); - Transfer_TransferMap newmap (nb*2); - for (i = 1; i <= nb; i ++) { - TheKeyType ent = Mapped(i); - Handle(Transfer_Binder) bnd = MapItem(i); - if (bnd.IsNull()) continue; - j = newmap.Add (ent,bnd); - unbs.SetValue (i,j); - } - themap.Assign (newmap); - - // Update the map of roots - TColStd_IndexedMapOfInteger aNewRoots; - for( i=1; i<= theroots.Extent(); i++ ) { - j = theroots.FindKey(i); - Standard_Integer k = unbs.Value(j); - if ( k ) aNewRoots.Add ( k ); - } - theroots.Clear(); - theroots = aNewRoots; - - // Le reste : nettoyage - thelastobj.Nullify(); - thelastbnd.Nullify(); - theindex = 0; - } - - //! Resizes the Map as required (if a new reliable value has been - //! determined). Acts only if is greater than actual NbMapped - Standard_EXPORT void Resize (const Standard_Integer nb) { if (nb > themap.NbBuckets()) themap.ReSize(nb); } - - //! Defines an Actor, which is used for automatic Transfer - //! If already defined, the new Actor is cumulated - //! (see SetNext from Actor) - Standard_EXPORT void SetActor (const Handle(Actor)& actor) - { - if (theactor == actor) return; - if (theactor.IsNull()) theactor = actor; - else if (actor.IsNull()) theactor = actor; // declenche RAZ - else theactor->SetNext(actor); - } - - //! Returns the Binder which is linked with a starting Object - //! It can either bring a Result (Transfer done) or none (for a - //! pre-binding). - //! If no Binder is linked with , returns a Null Handle - //! Considers a category number, by default 0 - Standard_EXPORT Handle(Transfer_Binder) Find (const TheKeyType& start) const - { - if (thelastobj == start) { - if (theindex > 0) return thelastbnd; - } - const Standard_Integer index = themap.FindIndex (start); - if (index > 0) { - return themap.FindFromIndex(index); - } - return NULL; - } - - //! Returns True if a Result (whatever its form) is Bound with a starting Object. - //! I.e., if a Binder with a Result set, is linked with it - Standard_EXPORT Standard_Boolean IsBound (const TheKeyType& start) const - { - Handle(Transfer_Binder) binder = Find(start); - return (binder.IsNull()? Standard_False : binder->HasResult()); - } - - //! Creates a Link a starting Object with a Binder. This Binder - //! can either bring a Result (effective Binding) or none (it can - //! be set later : pre-binding). - //! Considers a category number, by default 0 - Standard_EXPORT void Bind (const TheKeyType& start, const Handle(Transfer_Binder)& binder) - { - if (binder.IsNull()) return; - Handle(Transfer_Binder) former = FindAndMask(start); - if (!former.IsNull()) { - // On admet VoidBinder : alors on reprend son Check - if (former->DynamicType() == STANDARD_TYPE(Transfer_VoidBinder)) { - binder->Merge(former); - themap(theindex) = binder; // Substitution - } - else if (former->Status() == Transfer_StatusUsed) { - StartTrace (former,start,thelevel,4); - Transfer_TransferFailure::Raise ("TransferProcess : Bind, already Bound"); - } - else { - if (thetrace > 2) StartTrace (former,start,thelevel,5); - binder->CCheck()->GetMessages (former->Check()); - } - } - if (theindex == 0 || thelastbnd.IsNull()) { - if (theindex == 0) theindex = themap.Add(start,binder); // Nouveau - else themap(theindex) = binder; // idem en fait - thelastbnd = binder; - } - else { - thelastbnd = binder; - themap(theindex) = binder; - } - } - - //! Removes the Binder linked with a starting object - //! If this Binder brings a non-empty Check, it is replaced by - //! a VoidBinder. Also removes from the list of Roots as required. - //! Returns True if done, False if was not bound - //! Considers a category number, by default 0 - Standard_EXPORT Standard_Boolean Unbind (const TheKeyType& start) - { - Handle(Transfer_Binder) former = FindAndMask(start); - if (theindex == 0) return Standard_False; - if (former.IsNull()) return Standard_False; - if (former->DynamicType() == STANDARD_TYPE(Transfer_VoidBinder)) return Standard_True; - themap(theindex) = thelastbnd; - if(theroots.Contains(theindex)) { - TColStd_IndexedMapOfInteger aNewRoots; - for(Standard_Integer i = 1; i <= theroots.Extent(); i++) - if(theindex!= theroots.FindKey(i)) - aNewRoots.Add(theroots.FindKey(i)); - - theroots.Clear(); - theroots = aNewRoots; - } - - thelastobj.Nullify(); - thelastbnd.Nullify(); - theindex = 0; - return Standard_True; - } - - //! Sets Messenger used for outputting messages. - Standard_EXPORT void SetMessenger (const Handle(Message_Messenger)& messenger) - { themessenger = messenger.IsNull()? Message::DefaultMessenger() : messenger; } - - //! Returns Messenger used for outputting messages. - //! The returned object is guaranteed to be non-null; - //! default is Message::Messenger(). - Standard_EXPORT const Handle(Message_Messenger) & Messenger() const { return themessenger; } - - //! Sets trace level used for outputting messages: - //! = 0 : no trace at all - //! = 1 : handled exceptions and calls to AddError - //! = 2 : also calls to AddWarning - //! = 3 : also traces new Roots - //! (uses method ErrorTrace). - //! Default is 1 : Errors traced - Standard_EXPORT void SetTraceLevel (const Standard_Integer tracelev) { thetrace = tracelev; } - - //! Returns trace level used for outputting messages. - Standard_EXPORT Standard_Integer TraceLevel() const { return thetrace; } - - //! New name for AddFail (Msg) - Standard_EXPORT void SendFail (const TheKeyType& start, const Message_Msg& amsg) { AddFail(start,amsg); } - - //! New name for AddWarning (Msg) - Standard_EXPORT void SendWarning (const TheKeyType& start, const Message_Msg& amsg) { AddWarning(start,amsg); } - - //! Adds an information message - //! Trace is filled if trace level is at least 3 - Standard_EXPORT void SendMsg (const TheKeyType& start, const Message_Msg& amsg) - { - Handle(Transfer_Binder) binder = FindAndMask(start); - if (binder.IsNull()) { - binder = new Transfer_VoidBinder; - Bind (start,binder); - } - // Alimente la trace : Regle causant (user messages) - if (thetrace > 0) { - StartTrace (binder,start,thelevel,6); - themessenger << amsg.Value(); - if (amsg.IsEdited()&&thetrace>2) - themessenger << " [from: " << amsg.Original() << "]"; - themessenger << endl; - } - } - - //! Adds an Error message to a starting entity (to the check of - //! its Binder of category 0, as a Fail) - Standard_EXPORT void AddFail (const TheKeyType& start, const Standard_CString mess, const Standard_CString orig = "") - { - Handle(Transfer_Binder) binder = FindAndMask(start); - if (binder.IsNull()) { - binder = new Transfer_VoidBinder; - Bind (start,binder); - } - binder->AddFail (mess,orig); - if (thetrace > 0) { - StartTrace (binder,start,thelevel,1); - themessenger << " --> Fail : " << mess; - if (orig[0] != '\0'&&thetrace>2) themessenger << " [from: " << orig << "]"; - themessenger << endl; - } - } - - //! (other name of AddFail, maintained for compatibility) - Standard_EXPORT void AddError (const TheKeyType& start, const Standard_CString mess, const Standard_CString orig = "") - { AddFail (start,mess,orig); } - - //! Adds an Error Message to a starting entity from the definition - //! of a Msg (Original+Value) - Standard_EXPORT void AddFail (const TheKeyType& start, const Message_Msg& amsg) - { - if (amsg.IsEdited()) AddFail (start,TCollection_AsciiString(amsg.Value()).ToCString(), TCollection_AsciiString(amsg.Original()).ToCString()); - else AddFail (start,TCollection_AsciiString(amsg.Value()).ToCString()); - } - - //! Adds a Warning message to a starting entity (to the check of - //! its Binder of category 0) - Standard_EXPORT void AddWarning (const TheKeyType& start, const Standard_CString mess, const Standard_CString orig = "") - { - Handle(Transfer_Binder) binder = FindAndMask(start); - if (binder.IsNull()) { - binder = new Transfer_VoidBinder; - Bind (start,binder); - } - binder->AddWarning(mess,orig); - if (thetrace > 1) { - StartTrace (binder,start,thelevel,2); - themessenger << " --> Warning : " << mess; - if (orig[0] != '\0'&&thetrace>2) themessenger << " [from: " << orig << "]"; - themessenger << endl; - } - } - - //! Adds a Warning Message to a starting entity from the definition - //! of a Msg (Original+Value) - Standard_EXPORT void AddWarning (const TheKeyType& start, const Message_Msg& amsg) - { - if (amsg.IsEdited()) AddWarning (start,TCollection_AsciiString(amsg.Value()).ToCString(), TCollection_AsciiString(amsg.Original()).ToCString()); - else AddWarning (start,TCollection_AsciiString(amsg.Value()).ToCString()); - } - - //! Returns the Check attached to a starting entity. If - //! is unknown, returns an empty Check - //! Adds a case name to a starting entity - //! Adds a case value to a starting entity - //! Returns the complete case list for an entity. Null Handle if empty - //! In the list of mapped items (between 1 and NbMapped), - //! searches for the first item which follows (not included) - //! and which has an attribute named - //! Attributes are brought by Binders - //! Hence, allows such an iteration - //! - //! for (num = TP->NextItemWithAttribute(name,0); - //! num > 0; - //! num = TP->NextItemWithAttribute(name,num) { - //! .. process mapped item - //! } - //! Returns the type of an Attribute attached to binders - //! If this name gives no Attribute, returns ParamVoid - //! If this name gives several different types, returns ParamMisc - //! Else, returns the effective type (ParamInteger, ParamReal, - //! ParamIdent, or ParamText) - //! Returns the list of recorded Attribute Names, as a Dictionary - //! of Integer : each value gives the count of items which bring - //! this attribute name - //! By default, considers all the attribute names - //! If is given, considers only the attribute names - //! which begin by - Standard_EXPORT Handle(Interface_Check) Check (const TheKeyType& start) const - { - const Handle(Transfer_Binder)& binder = Find(start); - return (binder.IsNull()? NULL : binder->Check()); - } - - //! Binds a starting object with a Transient Result. - //! Uses a SimpleBinderOfTransient to work. If there is already - //! one but with no Result set, sets its Result. - //! Considers a category number, by default 0 - Standard_EXPORT void BindTransient (const TheKeyType& start, const Handle(Standard_Transient)& res) - { - if (res.IsNull()) return; - Handle(Transfer_SimpleBinderOfTransient) binder = Handle(Transfer_SimpleBinderOfTransient)::DownCast(Find(start)); - // Binding sur place ? - if (!binder.IsNull() && binder->Status() == Transfer_StatusVoid) { - binder->SetResult(res); return; - } - // Sinon, refaire - binder = new Transfer_SimpleBinderOfTransient(res); - Bind(start,binder); - } - - //! Returns the Result of the Transfer of an object as a - //! Transient Result. - //! Returns a Null Handle if there is no Transient Result - //! Considers a category number, by default 0 - //! Warning : Supposes that Binding is done with a SimpleBinderOfTransient - Standard_EXPORT Handle(Standard_Transient) FindTransient (const TheKeyType& start) const - { - Handle(Transfer_SimpleBinderOfTransient) binder = Handle(Transfer_SimpleBinderOfTransient)::DownCast(Find(start)); - if (binder.IsNull()) return NULL; - if (!binder->HasResult()) return NULL; - return binder->Result(); - } - - //! Searches for a transient result attached to a starting object, - //! according to its type, by criterium IsKind(atype) - //! - //! In case of multiple result, explores the list and gives in - //! the first transient result IsKind(atype) - //! Returns True and fills if found - //! Else, returns False ( is not touched, not even nullified) - //! - //! This syntactic form avoids to do DownCast : if a result is - //! found with the good type, it is loaded in and can be - //! immediately used, well initialised - Standard_EXPORT Standard_Boolean FindTypedTransient (const TheKeyType& start, const Handle(Standard_Type)& atype, Handle(Standard_Transient)& val) const - { return GetTypedTransient (Find(start),atype,val); } - - //! Safe variant for arbitrary type of argument - template - Standard_Boolean FindTypedTransient (const TheKeyType& start, const Handle(Standard_Type)& atype, Handle(T)& val) const - { - Handle(Standard_Transient) aVal = val; - return FindTypedTransient (start, atype, aVal) && ! (val = Handle(T)::DownCast(aVal)).IsNull(); - } - - //! Searches for a transient result recorded in a Binder, whatever - //! this Binder is recorded or not in - //! - //! This is strictly equivalent to the class method GetTypedResult - //! from class SimpleBinderOfTransient, but is just lighter to call - //! - //! Apart from this, works as FindTypedTransient - Standard_EXPORT Standard_Boolean GetTypedTransient (const Handle(Transfer_Binder)& binder, const Handle(Standard_Type)& atype, Handle(Standard_Transient)& val) const - { return Transfer_SimpleBinderOfTransient::GetTypedResult(binder,atype,val); } - - //! Safe variant for arbitrary type of argument - template - Standard_Boolean GetTypedTransient (const Handle(Transfer_Binder)& start, const Handle(Standard_Type)& atype, Handle(T)& val) const - { - Handle(Standard_Transient) aVal = val; - return GetTypedTransient (start, atype, aVal) && ! (val = Handle(T)::DownCast(aVal)).IsNull(); - } - - //! Returns the maximum possible value for Map Index - //! (no result can be bound with a value greater than it) - Standard_EXPORT Standard_Integer NbMapped() const { return themap.Extent(); } - - //! Returns the Starting Object bound to an Index, - Standard_EXPORT const TheKeyType& Mapped (const Standard_Integer num) const { return themap.FindKey(num); } - - //! Returns the Index value bound to a Starting Object, 0 if none - Standard_EXPORT Standard_Integer MapIndex (const TheKeyType& start) const { return themap.FindIndex(start); } - - //! Returns the Binder bound to an Index - //! Considers a category number, by default 0 - Standard_EXPORT Handle(Transfer_Binder) MapItem (const Standard_Integer num) const { return themap.FindFromIndex(num); } - - //! Declares (and its Result) as Root. This status will be - //! later exploited by RootResult, see below (Result can be - //! produced at any time) - Standard_EXPORT void SetRoot (const TheKeyType& start) - { - Standard_Integer index = MapIndex(start); - if (index == 0) - return; - theroots.Add(index); - if (thetrace > 2) StartTrace (MapItem(index),start,thelevel,3); - } - - //! Enable (if True) or Disables (if False) Root - //! Management. If it is set, Transfers are considered as stacked - //! (a first Transfer commands other Transfers, and so on) and - //! the Transfers commanded by an external caller are "Root". - //! Remark : SetRoot can be called whatever this status, on every - //! object. - //! Default is set to True. - Standard_EXPORT void SetRootManagement (const Standard_Boolean stat) { therootm = stat; } - - //! Returns the count of recorded Roots - Standard_EXPORT Standard_Integer NbRoots() const { return theroots.Extent(); } - - //! Returns a Root Entity given its number in the list (1-NbRoots) - Standard_EXPORT const TheKeyType& Root (const Standard_Integer num) const - { - Standard_Integer ind = 0; - if (num > 0 && num <= theroots.Extent()) ind = theroots.FindKey(num); - return themap.FindKey (ind); - } - - //! Returns the Binder bound with a Root Entity given its number - //! Considers a category number, by default 0 - Standard_EXPORT Handle(Transfer_Binder) RootItem (const Standard_Integer num) const - { - Standard_Integer ind = 0; - if (num > 0 && num <= theroots.Extent()) ind = theroots.FindKey(num); - return themap.FindFromIndex(ind); - } - - //! Returns the index in the list of roots for a starting item, - //! or 0 if it is not recorded as a root - Standard_EXPORT Standard_Integer RootIndex (const TheKeyType& start) const - { - Standard_Integer index = MapIndex(start); - if (index == 0) return 0; - return theroots.FindIndex(index); - } - - //! Returns Nesting Level of Transfers (managed by methods - //! TranscriptWith & Co). Starts to zero. If no automatic Transfer - //! is used, it remains to zero. Zero means Root Level. - Standard_EXPORT Standard_Integer NestingLevel() const { return thelevel; } - - //! Resets Nesting Level of Transfers to Zero (Root Level), - //! whatever its current value. - Standard_EXPORT void ResetNestingLevel() { thelevel = 0; } - - //! Tells if has been recognized as good candidate for - //! Transfer. i.e. queries the Actor and its Nexts - Standard_EXPORT Standard_Boolean Recognize (const TheKeyType& start) const - { - Handle(Actor) actor = theactor; - // On balaie les Next jusqu a avoir un Resultat - while (!actor.IsNull()) { - if (actor->Recognize (start)) return Standard_True; - actor = actor->Next(); - } - return Standard_False; - } - - //! Performs the Transfer of a Source Object. - //! Mapping and Roots are managed : nothing is done if a Result is - //! already Bound, an exception is raised in case of error. - Standard_EXPORT Handle(Transfer_Binder) Transferring (const TheKeyType& theSource) - { - // Map deja alimentee ? - Handle(Transfer_Binder) former = FindAndMask(theSource); - - // .... Transfert deja effectue avec Resultat ? .... - - // On considere que cette nouvelle demande de Transfert correspond donc a une - // utilisation en plus : noter "AlreadyUsed", donc resultat non modifiable - if (!former.IsNull()) { - if (former->HasResult()) { - former->SetAlreadyUsed(); - return former; - } - - // .... Etat Initial : peut-etre deja fait ... ou infaisable ! - Transfer_StatusExec statex = former->StatusExec(); - switch (statex) { - case Transfer_StatusInitial : // Transfert prepare a faire - break; - case Transfer_StatusDone : // Transfert deja fait - themessenger << " .. and Transfer done" << endl; - return former; - case Transfer_StatusRun : // ca y est, on boucle - former->SetStatusExec(Transfer_StatusLoop); - return former; - case Transfer_StatusError : // pas propre, ca ... - if (thetrace) { - themessenger << " *** Transfer in Error Status :" << endl; - StartTrace (former, theSource, thelevel,0); - } - else StartTrace (former,theSource,thelevel,4); - Transfer_TransferFailure::Raise("TransferProcess : Transfer in Error Status"); - case Transfer_StatusLoop : // la boucle est bouclee ... - if (thetrace) { - themessenger << " *** Transfer Head of Dead Loop :" << endl; - StartTrace (former,theSource,thelevel,0); - } - else StartTrace (former,theSource,thelevel,4); - Transfer_TransferDeadLoop::Raise("TransferProcess : Transfer at Head of a Dead Loop"); - } - - // .... OK, on peut lancer l Execution - former->SetStatusExec(Transfer_StatusRun); - } - - Handle(Transfer_Binder) binder; - Standard_Boolean newbind = Standard_False; - - // Transfert sous protection pour les exceptions (pour notification en fait) - const Standard_Integer oldlev = thelevel; - try { - OCC_CATCH_SIGNALS - //! Invokes the Actor to work (set by SetActor), and tries its Nexts if no result is produced, - //! until a Non Null Binder is produced. - //! But keep in mind that a Null Binder can allways be returned - //! if a Starting Entity has not been recognized at all. - thelevel ++; // si decremente et == 0, transfert racine - - Handle(Actor) actor = theactor; - // On balaie les Next jusqu a avoir un Resultat - while (!actor.IsNull()) { - if (actor->Recognize (theSource)) binder = actor->Transferring(theSource,this); - else binder.Nullify(); - if (!binder.IsNull()) break; - actor = actor->Next(); - } - - if (!binder.IsNull()) { - // Gestion du niveau racine (.. a regarder de pres ..) - if (therootl == 0 && binder->StatusExec() == Transfer_StatusDone) - therootl = thelevel - 1; - } - - if (thelevel > 0) thelevel --; - } - - // ... Exceptions a Rattraper : elles ne se ressemblent pas toutes ... ! - catch (Transfer_TransferDeadLoop) { - if (binder.IsNull()) { - themessenger << " *** Dead Loop with no Result" << endl; - if (thetrace) StartTrace (binder,theSource,thelevel-1,0); - binder = new Transfer_VoidBinder; - Bind (theSource,binder); newbind = Standard_True; - } else if (binder->StatusExec() == Transfer_StatusLoop) { - if (thetrace) { - themessenger << " *** Dead Loop : Finding head of Loop :" << endl; - StartTrace (binder,theSource,thelevel-1,0); - } - else StartTrace (binder,theSource,thelevel-1,4); - Transfer_TransferFailure::Raise("TransferProcess : Head of Dead Loop"); - // Autrement dit, on change d exception (on est sorti de la boucle) - } else { - if (thetrace) { - themessenger << " *** Dead Loop : Actor in Loop :" << endl; - StartTrace (binder,theSource,thelevel-1,0); - } - } - binder->AddFail("Transfer in dead Loop"); - thelevel = oldlev; - } - catch (Standard_Failure) { - if (binder.IsNull()) { - themessenger << " *** Exception Raised with no Result" << endl; - binder = new Transfer_VoidBinder; - Bind (theSource,binder); newbind = Standard_True; - } - binder->AddFail("Transfer stopped by exception raising"); - if (thetrace) { - themessenger << " *** Raised : " << Standard_Failure::Caught()->GetMessageString() << endl; - StartTrace (binder,theSource,thelevel-1,4); - } - thelevel = oldlev; - } - - // .... Conclusion : Noter dans la Map .... - if (!newbind && !binder.IsNull()) { - Bind(theSource,binder); - } - else { - //= by ABV: 5 Oct 97: nothing generated, but former can be in run state - drop it - //= ASK: may be set it to StatusInitial ? - if ( !former.IsNull() ) former->SetStatusExec ( Transfer_StatusDone ); //+ - return NULL; // Binder Null ... que faire d autre ? - } - - // .... Gerer les Racines (si prevu) .... - if (therootl >= thelevel) { - therootl = 0; - if (therootm && binder->Status() != Transfer_StatusVoid) { - SetRoot (theSource); - } - } - return thelastbnd; - } - - //! Same as Transferring but does not return the Binder. - //! Simply returns True in case of success (for user call) - Standard_EXPORT Standard_Boolean Transfer (const TheKeyType& theSource) - { - Handle(Transfer_Binder) binder = Transferring(theSource); - return (!binder.IsNull()); - } - - //! Method called when trace is asked - //! Calls PrintTrace to display information relevant for starting - //! objects (which can be redefined) - //! is Nesting Level of Transfer (0 = root) - //! controls the way the trace is done : - //! 0 neutral, 1 for Error, 2 for Warning message, 3 for new Root - Standard_EXPORT void StartTrace (const Handle(Transfer_Binder)& binder, const TheKeyType& start, const Standard_Integer level, const Standard_Integer mode) const - { - // ### Fail (Roots:50) -- Start start->DynamicType() - // ### Fail (Roots:50) -- Start id:#label.. Type:start->DynamicType() - if (thetrace > 3) { // Internal to be switch when searching bug (trace >= 4) - if (mode == 1) themessenger << " ### Fail"; - if (mode == 2) themessenger << " ### Warning"; - if (mode == 3) themessenger << " ### New Root n0 " << theroots.Extent(); - if (mode == 4) themessenger << " ### Exception"; - if (mode == 5) themessenger << " ### Substitution"; - if (mode == 6) themessenger << " ### Information"; - if (level > 1) - themessenger << " (nested)"; // " at nesting Level:"<= 0 && mode != 3) - themessenger << " at " << theroots.Extent() << " Roots"; - } - if (!start.IsNull()) PrintTrace (start,themessenger); - - if (!binder.IsNull()) { - Handle(Transfer_Binder) bnd = binder; - Standard_Boolean hasres = Standard_False; - while (!bnd.IsNull()) { - if (bnd->Status() != Transfer_StatusVoid) { - // --- Result Type: binder->ResultType() --- Binder : binder->DynamicType(); - if (!hasres) - themessenger << "\n --- Result Type : "; - else - themessenger << " , "; - themessenger << bnd->ResultTypeName(); - hasres = Standard_True; - } - bnd = bnd->NextResult(); - } - if (!hasres && mode > 2) { - themessenger << "\n --- No Result recorded"; - } - } - themessenger << endl; - } - - //! Prints a short information on a source object. - Standard_EXPORT virtual void PrintTrace (const TheKeyType& theSource, const Handle(Message_Messenger)& S) const - { - if (!theSource.IsNull()) { - Handle(Transfer_Finder) aFinder = Handle(Transfer_Finder)::DownCast(theSource); - S << " Type:" << (aFinder.IsNull()? theSource->DynamicType()->Name() : aFinder->ValueTypeName()); - } - } - - //! Prints statistics on transfer - void PrintStats(const Handle(Message_Messenger)& S) const - { - S<<"\n*******************************************************************\n"; - S << "******** Basic Statistics ********"<NbEntities()<Check(); - Transfer_StatusExec stat = binder->StatusExec(); - if (stat != Transfer_StatusInitial && stat != Transfer_StatusDone) - nbe ++; - else { - if (ach->NbWarnings() > 0) nbw++; - if (binder->HasResult()) nbr++; - } - } - if (nbr > nbroots) - S<<"**** ( Itermediate Results : "< 0) - S<<"**** Errors on : "< 0) - S<<"**** Warnings on : "<StatusExec(); - if (statex != Transfer_StatusInitial && statex != Transfer_StatusDone) - iter.Add (binder,Mapped(i)); // on note les cas "pas normaux" - } - return iter; - } - - //! Returns a CheckList as a list of Check : each one is for a - //! starting entity which have either check (warning or fail) - //! messages are attached, or are in abnormal state : that case - //! gives a specific message - //! If is True, checks with Warnings only are ignored - Standard_EXPORT Interface_CheckIterator CheckList (const Standard_Boolean erronly) const - { - Interface_CheckIterator list; - Standard_Integer num, max = NbMapped(); - for (Standard_Integer i = 1; i <= max; i ++) { - Handle(Transfer_Binder) binder = MapItem(i); - if (binder.IsNull()) continue; - Transfer_StatusExec statex = binder->StatusExec(); - Handle(Interface_Check) check = binder->Check(); - if (statex != Transfer_StatusInitial && statex != Transfer_StatusDone && !check->HasFailed()) - check->AddFail("Transfer in Abnormal Status (!= Initial or Done)"); - if (!check->HasFailed() && (erronly || check->NbWarnings() == 0)) continue; - const TheKeyType& ent = Mapped(i); - num = CheckNum(ent); - if (num == 0) num = i; - check->SetEntity(ent); - list.Add(check,num); - } - return list; - } - - //! Sets Progress indicator - void SetProgress (const Handle(Message_ProgressIndicator)& theProgress) { myProgress = theProgress; } - - //! Gets Progress indicator - const Handle(Message_ProgressIndicator) & GetProgress() const { return myProgress; } - - DEFINE_STANDARD_RTTI_INLINE(Transfer_ProcessGen,MMgt_TShared) - - protected: - - //! Computes a number to be associated to a starting object in - //! a check or a check-list - //! By default, returns 0; can be redefined - Standard_EXPORT virtual Standard_Integer CheckNum (const TheKeyType&) const { return 0; } - - Handle(Interface_InterfaceModel) themodel; - - private: - - //! Same as Find but stores the last access to the map, for a - //! faster access on next calls (as Bind does too) - Standard_EXPORT const Handle(Transfer_Binder) & FindAndMask (const TheKeyType& start) - { - if (thelastobj == start) { - if (theindex > 0) return thelastbnd; - } - thelastobj = start; - theindex = themap.FindIndex (start); - if (theindex > 0) thelastbnd = themap.FindFromIndex(theindex); - else thelastbnd.Nullify(); - return thelastbnd; - } - - Standard_Integer thetrace; - Handle(Message_Messenger) themessenger; - Standard_Integer thelevel; - Standard_Integer therootl; - Standard_Boolean therootm; - TColStd_IndexedMapOfInteger theroots; - TheKeyType thelastobj; - Handle(Transfer_Binder) thelastbnd; - Standard_Integer theindex; - Handle(Actor) theactor; - Transfer_MapOfProcess themap; - Handle(Message_ProgressIndicator) myProgress; -}; - -#endif // _Transfer_ProcessGen_HeaderFile diff --git a/src/Transfer/Transfer_TransferMapOfProcessForFinder.hxx b/src/Transfer/Transfer_TransferMapOfProcessForFinder.hxx deleted file mode 100644 index aa37a50b85..0000000000 --- a/src/Transfer/Transfer_TransferMapOfProcessForFinder.hxx +++ /dev/null @@ -1,27 +0,0 @@ -// Created on: 1992-02-03 -// Created by: Christian CAILLET -// Copyright (c) 1992-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _Transfer_TransferMapOfProcessForFinder_HeaderFile -#define _Transfer_TransferMapOfProcessForFinder_HeaderFile - -#include -#include -#include -#include - -typedef NCollection_IndexedDataMap Transfer_TransferMapOfProcessForFinder; - -#endif // _Transfer_TransferMapOfProcessForFinder_HeaderFile diff --git a/src/Transfer/Transfer_TransferMapOfProcessForTransient.hxx b/src/Transfer/Transfer_TransferMapOfProcessForTransient.hxx deleted file mode 100644 index 94128b57cc..0000000000 --- a/src/Transfer/Transfer_TransferMapOfProcessForTransient.hxx +++ /dev/null @@ -1,26 +0,0 @@ -// Created on: 1992-02-03 -// Created by: Christian CAILLET -// Copyright (c) 1992-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _Transfer_TransferMapOfProcessForTransient_HeaderFile -#define _Transfer_TransferMapOfProcessForTransient_HeaderFile - -#include -#include -#include - -typedef NCollection_IndexedDataMap Transfer_TransferMapOfProcessForTransient; - -#endif // _Transfer_TransferMapOfProcessForTransient_HeaderFile diff --git a/src/Transfer/Transfer_TransientProcess.cxx b/src/Transfer/Transfer_TransientProcess.cxx index 4cae84c26b..f930191120 100644 --- a/src/Transfer/Transfer_TransientProcess.cxx +++ b/src/Transfer/Transfer_TransientProcess.cxx @@ -24,7 +24,7 @@ #include #include -IMPLEMENT_STANDARD_RTTIEXT(Transfer_TransientProcess,Transfer_ProcessForTransient) +IMPLEMENT_STANDARD_RTTIEXT(Transfer_TransientProcess,Transfer_Process) //======================================================================= //function : SetGraph diff --git a/src/Transfer/Transfer_TransientProcess.hxx b/src/Transfer/Transfer_TransientProcess.hxx index f0c4d8083f..539e2a840f 100644 --- a/src/Transfer/Transfer_TransientProcess.hxx +++ b/src/Transfer/Transfer_TransientProcess.hxx @@ -21,14 +21,14 @@ #include #include -#include +#include class Dico_DictionaryOfTransient; class Message_Messenger; class Interface_HGraph; class Interface_EntityIterator; class Transfer_TransientProcess; -DEFINE_STANDARD_HANDLE(Transfer_TransientProcess, Transfer_ProcessForTransient) +DEFINE_STANDARD_HANDLE(Transfer_TransientProcess, Transfer_Process) //! Adds specific features to the generic definition : //! TransientProcess is intended to work from an InterfaceModel @@ -36,13 +36,13 @@ DEFINE_STANDARD_HANDLE(Transfer_TransientProcess, Transfer_ProcessForTransient) //! //! Hence, some informations about starting entities can be gotten //! from the model : for Trace, CheckList, Integrity Status -class Transfer_TransientProcess : public Transfer_ProcessForTransient +class Transfer_TransientProcess : public Transfer_Process { public: //! Sets TransientProcess at initial state, with an initial size Transfer_TransientProcess(const Standard_Integer nb = 10000) - : Transfer_ProcessForTransient (nb) + : Transfer_Process (nb) {} //! Sets a Graph : superseedes SetModel if already done @@ -65,18 +65,18 @@ class Transfer_TransientProcess : public Transfer_ProcessForTransient //! Rather for internal use (ex.: preparing and setting in once) Handle(Dico_DictionaryOfTransient)& Context() { return thectx; } - //! Specific printing to trace an entity : prints label and type - //! (if model is set) - Standard_EXPORT virtual void PrintTrace (const Handle(Standard_Transient)& start, const Handle(Message_Messenger)& S) const Standard_OVERRIDE; - TColStd_SequenceOfTransient & RootsForTransfer() { return thetrroots; } - DEFINE_STANDARD_RTTIEXT(Transfer_TransientProcess,Transfer_ProcessForTransient) + DEFINE_STANDARD_RTTIEXT(Transfer_TransientProcess,Transfer_Process) protected: //! Specific number of a source object for check-list : Number in model - Standard_EXPORT virtual Standard_Integer CheckNum (const Handle(Standard_Transient)& ent) const Standard_OVERRIDE; + Standard_EXPORT Standard_Integer CheckNum (const Handle(Standard_Transient)& ent) const Standard_OVERRIDE; + + //! Specific printing to trace an entity : prints label and type + //! (if model is set) + Standard_EXPORT void PrintTrace (const Handle(Standard_Transient)& start, const Handle(Message_Messenger)& S) const Standard_OVERRIDE; private: diff --git a/src/TransferBRep/TransferBRep.cxx b/src/TransferBRep/TransferBRep.cxx index b102f236f2..2b7b2a683d 100644 --- a/src/TransferBRep/TransferBRep.cxx +++ b/src/TransferBRep/TransferBRep.cxx @@ -16,8 +16,7 @@ #include #include #include -#include -#include +#include #include #include @@ -90,7 +89,7 @@ Handle(TopTools_HSequenceOfShape) TransferBRep::Shapes (const Handle(Transfer_Tr if (TP.IsNull()) return shapes; shapes = new TopTools_HSequenceOfShape(); - Transfer_IteratorOfProcessForTransient list = (roots ? TP->RootResult() : TP->CompleteResult()); + Transfer_TransientProcess::Iterator list = (roots ? TP->RootResult() : TP->CompleteResult()); for (list.Start(); list.More(); list.Next()) { const Handle(Transfer_Binder) &binder = list.Value(); ShapeAppend (binder,shapes); @@ -112,7 +111,7 @@ Handle(TopTools_HSequenceOfShape) TransferBRep::Shapes (const Handle(Transfer_Tr return shapes; } -Handle(TransferBRep_ShapeMapper) TransferBRep::ShapeMapper (const Handle(Transfer_ProcessForFinder)& FP, const TopoDS_Shape& theShape) +Handle(TransferBRep_ShapeMapper) TransferBRep::ShapeMapper (const Handle(Transfer_Process)& FP, const TopoDS_Shape& theShape) { Handle(TransferBRep_ShapeMapper) mapper = new TransferBRep_ShapeMapper(theShape); const Standard_Integer index = FP->MapIndex (mapper); diff --git a/src/TransferBRep/TransferBRep.hxx b/src/TransferBRep/TransferBRep.hxx index 26d4e922c5..14ad633ff5 100644 --- a/src/TransferBRep/TransferBRep.hxx +++ b/src/TransferBRep/TransferBRep.hxx @@ -23,9 +23,9 @@ #include #include #include -#include class TopoDS_Shape; class Transfer_Binder; +class Transfer_Process; class Transfer_TransientProcess; class TransferBRep_ShapeMapper; @@ -64,7 +64,7 @@ class TransferBRep //! Either is already mapped, then its Mapper is returned //! Or it is not, then a new one is created then returned, BUT //! it is not mapped here (use Bind to do this) - Standard_EXPORT static Handle(TransferBRep_ShapeMapper) ShapeMapper (const Handle(Transfer_ProcessForFinder)& FP, const TopoDS_Shape& theShape); + Standard_EXPORT static Handle(TransferBRep_ShapeMapper) ShapeMapper (const Handle(Transfer_Process)& FP, const TopoDS_Shape& theShape); //! Returns Type Name (string) //! Here, the true name of the Type of a Shape diff --git a/src/XDEDRAW/XDEDRAW_Common.cxx b/src/XDEDRAW/XDEDRAW_Common.cxx index 5c1a5f8f83..b59bc43b7c 100644 --- a/src/XDEDRAW/XDEDRAW_Common.cxx +++ b/src/XDEDRAW/XDEDRAW_Common.cxx @@ -53,17 +53,12 @@ #include #include + //============================================================ // Support for several models in DRAW //============================================================ static Handle(Dico_DictionaryOfTransient) thedictws = new Dico_DictionaryOfTransient; -static Standard_Boolean ClearDicWS() -{ - thedictws->Clear(); - return Standard_True; -} - static void AddWS(TCollection_AsciiString filename, const Handle(XSControl_WorkSession)& WS) { @@ -74,7 +69,7 @@ static void AddWS(TCollection_AsciiString filename, static Standard_Boolean FillDicWS(Handle(STEPCAFControl_DictionaryOfExternFile)& dicFile) { - ClearDicWS(); + thedictws->Clear(); if ( dicFile->IsEmpty() ) { return Standard_False; } @@ -88,16 +83,6 @@ static Standard_Boolean FillDicWS(Handle(STEPCAFControl_DictionaryOfExternFile)& return Standard_True; } -static Standard_Boolean SetCurrentWS (TCollection_AsciiString filename) -{ - if ( !thedictws->HasItem(filename) ) return Standard_False; - Handle(XSControl_WorkSession) CurrentWS = - Handle(XSControl_WorkSession)::DownCast( thedictws->Item(filename) ); - XSDRAW::Pilot()->SetSession( CurrentWS ); - - return Standard_True; -} - //======================================================================= //function : SetCurWS @@ -111,7 +96,11 @@ static Standard_Integer SetCurWS (Draw_Interpretor& di , Standard_Integer argc, return 1; } TCollection_AsciiString filename (argv[1]); - SetCurrentWS( filename ); + if ( thedictws->HasItem(filename) ) { + Handle(XSControl_WorkSession) CurrentWS = + Handle(XSControl_WorkSession)::DownCast( thedictws->Item(filename) ); + XSDRAW::Pilot()->SetSession( CurrentWS ); + } return 0; } diff --git a/src/XSAlgo/XSAlgo.cxx b/src/XSAlgo/XSAlgo.cxx index a1c20cebec..d61f8bc7ed 100644 --- a/src/XSAlgo/XSAlgo.cxx +++ b/src/XSAlgo/XSAlgo.cxx @@ -70,7 +70,7 @@ static Handle(XSAlgo_AlgoContainer) theContainer; //purpose : //======================================================================= - void XSAlgo::SetAlgoContainer(const Handle(XSAlgo_AlgoContainer)& aContainer) +void XSAlgo::SetAlgoContainer(const Handle(XSAlgo_AlgoContainer)& aContainer) { theContainer = aContainer; } @@ -80,7 +80,7 @@ static Handle(XSAlgo_AlgoContainer) theContainer; //purpose : //======================================================================= - Handle(XSAlgo_AlgoContainer) XSAlgo::AlgoContainer() +const Handle(XSAlgo_AlgoContainer) & XSAlgo::AlgoContainer() { return theContainer; } diff --git a/src/XSAlgo/XSAlgo.hxx b/src/XSAlgo/XSAlgo.hxx index 62ce731c25..807821cb23 100644 --- a/src/XSAlgo/XSAlgo.hxx +++ b/src/XSAlgo/XSAlgo.hxx @@ -17,22 +17,14 @@ #define _XSAlgo_HeaderFile #include -#include #include class XSAlgo_AlgoContainer; -class XSAlgo_ToolContainer; -class XSAlgo_AlgoContainer; - - class XSAlgo { -public: - - DEFINE_STANDARD_ALLOC + public: - //! Provides initerface to the algorithms from Shape Healing //! and others for XSTEP processors. //! Creates and initializes default AlgoContainer. @@ -42,31 +34,7 @@ public: Standard_EXPORT static void SetAlgoContainer (const Handle(XSAlgo_AlgoContainer)& aContainer); //! Returns default AlgoContainer - Standard_EXPORT static Handle(XSAlgo_AlgoContainer) AlgoContainer(); - - - - -protected: - - - - - -private: - - - - -friend class XSAlgo_ToolContainer; -friend class XSAlgo_AlgoContainer; - + Standard_EXPORT static const Handle(XSAlgo_AlgoContainer) & AlgoContainer(); }; - - - - - - #endif // _XSAlgo_HeaderFile diff --git a/src/XSControl/FILES b/src/XSControl/FILES index 034d830ee8..449abb18d9 100644 --- a/src/XSControl/FILES +++ b/src/XSControl/FILES @@ -1,13 +1,7 @@ -XSControl.cxx -XSControl.hxx XSControl_ConnectedShapes.cxx XSControl_ConnectedShapes.hxx XSControl_Controller.cxx XSControl_Controller.hxx -XSControl_FuncShape.cxx -XSControl_FuncShape.hxx -XSControl_Functions.cxx -XSControl_Functions.hxx XSControl_Reader.cxx XSControl_Reader.hxx XSControl_SelectForTransfer.cxx @@ -18,8 +12,6 @@ XSControl_TransferReader.cxx XSControl_TransferReader.hxx XSControl_TransferWriter.cxx XSControl_TransferWriter.hxx -XSControl_Utils.cxx -XSControl_Utils.hxx XSControl_Vars.cxx XSControl_Vars.hxx XSControl_WorkSession.cxx diff --git a/src/XSControl/XSControl.cxx b/src/XSControl/XSControl.cxx deleted file mode 100644 index dbd13050d1..0000000000 --- a/src/XSControl/XSControl.cxx +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include - -Handle(XSControl_WorkSession) XSControl::Session (const Handle(IFSelect_SessionPilot)& pilot) -{ return Handle(XSControl_WorkSession)::DownCast(pilot->Session()); } diff --git a/src/XSControl/XSControl.hxx b/src/XSControl/XSControl.hxx deleted file mode 100644 index b77d81723d..0000000000 --- a/src/XSControl/XSControl.hxx +++ /dev/null @@ -1,37 +0,0 @@ -// Created on: 1995-03-13 -// Created by: Christian CAILLET -// Copyright (c) 1995-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _XSControl_HeaderFile -#define _XSControl_HeaderFile - -#include -#include - -class XSControl_WorkSession; -class IFSelect_SessionPilot; - -//! This package provides complements to IFSelect & Co for -//! control of a session -class XSControl -{ - public: - - //! Returns the WorkSession of a SessionPilot, but casts it as - //! from XSControl : it then gives access to Control & Transfers - Standard_EXPORT static Handle(XSControl_WorkSession) Session (const Handle(IFSelect_SessionPilot)& pilot); -}; - -#endif // _XSControl_HeaderFile diff --git a/src/XSControl/XSControl_Controller.cxx b/src/XSControl/XSControl_Controller.cxx index 74f3f5b29d..9d863471e5 100644 --- a/src/XSControl/XSControl_Controller.cxx +++ b/src/XSControl/XSControl_Controller.cxx @@ -275,9 +275,8 @@ IFSelect_ReturnStatus XSControl_Controller::TransferWriteShape IFSelect_ReturnStatus stat = IFSelect_RetFail; Handle(Transfer_Binder) binder = FP->Find (aMapper); - Handle(Transfer_SimpleBinderOfTransient) bindtr; while (!binder.IsNull()) { - bindtr = Handle(Transfer_SimpleBinderOfTransient)::DownCast (binder); + Handle(Transfer_SimpleBinderOfTransient) bindtr = Handle(Transfer_SimpleBinderOfTransient)::DownCast (binder); if (!bindtr.IsNull()) { Handle(Standard_Transient) ent = bindtr->Result(); if (!ent.IsNull()) { @@ -408,7 +407,6 @@ void XSControl_Controller::Customise (Handle(XSControl_WorkSession)& WS) WS->AddNamedItem ("xst-shared",new IFSelect_SelectShared); WS->AddNamedItem ("xst-nb-selected",new IFSelect_GraphCounter); - //szv:mySignType = stp; WS->SetSignType( stp ); } diff --git a/src/XSControl/XSControl_Controller.hxx b/src/XSControl/XSControl_Controller.hxx index 95d8d5df00..c0502b6428 100644 --- a/src/XSControl/XSControl_Controller.hxx +++ b/src/XSControl/XSControl_Controller.hxx @@ -74,14 +74,10 @@ class XSControl_Controller : public MMgt_TShared //! Names (see method Name) void AutoRecord() const { - Record (Name(Standard_True)); - Record (Name(Standard_False)); + Record (myShortName.ToCString()); + Record (myLongName.ToCString()); } - //! Records in a general dictionary under a name - //! Error if already used for another one - Standard_EXPORT void Record (const Standard_CString name) const; - //! Returns the Controller attached to a given name //! Returns a Null Handle if is unknown Standard_EXPORT static Handle(XSControl_Controller) Recorded (const Standard_CString name); @@ -93,12 +89,7 @@ class XSControl_Controller : public MMgt_TShared { return (rsc ? myShortName.ToCString() : myLongName.ToCString()); } //! Returns the Protocol attached to the Norm (from field) - const Handle(Interface_Protocol) & Protocol () const - { return myAdaptorProtocol; } - - //! Returns the SignType attached to the norm (from field) - //szv:const Handle(IFSelect_Signature) & SignType1() const - //szv:{ return mySignType; } + const Handle(Interface_Protocol) & Protocol () const { return myAdaptorProtocol; } //! Returns the WorkLibrary attached to the Norm. Remark that it //! has to be in phase with the Protocol (read from field) @@ -165,8 +156,7 @@ class XSControl_Controller : public MMgt_TShared //! Customises a WorkSession, by adding to it the recorded items (by AddSessionItem) Standard_EXPORT virtual void Customise (Handle(XSControl_WorkSession)& WS); - const Handle(Dico_DictionaryOfTransient) & AdaptorSession() const - { return myAdaptorSession; } + const Handle(Dico_DictionaryOfTransient) & AdaptorSession() const { return myAdaptorSession; } DEFINE_STANDARD_RTTIEXT(XSControl_Controller,MMgt_TShared) @@ -176,6 +166,10 @@ class XSControl_Controller : public MMgt_TShared //! is for the complete, official, long name //! is for the short name used for resources Standard_EXPORT XSControl_Controller(const Standard_CString theLongName, const Standard_CString theShortName); + + //! Records in a general dictionary under a name + //! Error if already used for another one + Standard_EXPORT void Record (const Standard_CString name) const; //! Records the name of a Static to be traced for a given use Standard_EXPORT void TraceStatic (const Standard_CString theName, const Standard_Integer theUse); diff --git a/src/XSControl/XSControl_Reader.cxx b/src/XSControl/XSControl_Reader.cxx index 5bb4de2b50..fb4810f8c7 100644 --- a/src/XSControl/XSControl_Reader.cxx +++ b/src/XSControl/XSControl_Reader.cxx @@ -15,7 +15,6 @@ //: gka 14.04.99: S4136: apply scaling #include -#include #include #include #include @@ -26,7 +25,6 @@ #include #include #include -#include #include #include #include diff --git a/src/XSControl/XSControl_TransferReader.cxx b/src/XSControl/XSControl_TransferReader.cxx index 760143a91f..ec8b033a6f 100644 --- a/src/XSControl/XSControl_TransferReader.cxx +++ b/src/XSControl/XSControl_TransferReader.cxx @@ -38,20 +38,37 @@ #include #include #include -#include #include #include #include #include #include #include +#include #include #include -#include #include + IMPLEMENT_STANDARD_RTTIEXT(XSControl_TransferReader,MMgt_TShared) +//======================================================================= +//function : BinderShape +//purpose : +//======================================================================= + +static TopoDS_Shape BinderShape (const Handle(Standard_Transient)& tr) +{ + TopoDS_Shape sh; + DeclareAndCast(Transfer_Binder,sb,tr); + if (!sb.IsNull()) return TransferBRep::ShapeResult(sb); + DeclareAndCast(TransferBRep_ShapeMapper,sm,tr); + if (!sm.IsNull()) return sm->Shape(); + DeclareAndCast(TopoDS_HShape,hs,tr); + if (!hs.IsNull()) return hs->Shape(); + return sh; +} + //======================================================================= //function : SetController //purpose : @@ -396,8 +413,7 @@ TopoDS_Shape XSControl_TransferReader::ShapeResult if (res.IsNull()) return tres; Handle(Transfer_ResultFromTransient) mres = res->MainResult(); if (mres.IsNull()) return tres; - XSControl_Utils xu; - TopoDS_Shape sh = xu.BinderShape (mres->Binder()); + TopoDS_Shape sh = BinderShape (mres->Binder()); // Ouh la vilaine verrue Standard_Real tolang = Interface_Static::RVal("read.encoderegularity.angle"); @@ -445,8 +461,7 @@ Handle(Standard_Transient) XSControl_TransferReader::EntityFromResult { Handle(Standard_Transient) nulh; // cas de la shape - XSControl_Utils xu; - TopoDS_Shape sh = xu.BinderShape (res); + TopoDS_Shape sh = BinderShape (res); if (!sh.IsNull()) return EntityFromShapeResult (sh,mode); Handle(Transfer_Binder) abinder; @@ -512,7 +527,6 @@ Handle(Standard_Transient) XSControl_TransferReader::EntityFromShapeResult if (res.IsNull()) return nulh; Standard_Integer i,j,nb; - XSControl_Utils xu; if (mode == 0 || mode == 1 || mode == -1) { // on regarde dans le TransientProcess if (!myTP.IsNull()) { @@ -549,7 +563,7 @@ Handle(Standard_Transient) XSControl_TransferReader::EntityFromShapeResult for (ir = 1; ir <= nr; ir ++) { DeclareAndCast(Transfer_ResultFromTransient,rft,list->Value(ir)); if (rft.IsNull()) continue; - TopoDS_Shape sh = xu.BinderShape (rft->Binder()); + TopoDS_Shape sh = BinderShape (rft->Binder()); if (!sh.IsNull() && sh == res) return rft->Start(); } @@ -580,7 +594,6 @@ Handle(TColStd_HSequenceOfTransient) XSControl_TransferReader::EntitiesFromShape // A present, recherche et enregistrement - XSControl_Utils xu; if (mode == 0 || mode == 1) { // on regarde dans le TransientProcess if (!myTP.IsNull()) { @@ -588,7 +601,7 @@ Handle(TColStd_HSequenceOfTransient) XSControl_TransferReader::EntitiesFromShape for (j = 1; j <= nb; j ++) { i = (mode == 0 ? myModel->Number (myTP->Root(j)) : j); if (i == 0) continue; - TopoDS_Shape sh = xu.BinderShape (myTP->MapItem(i)); + TopoDS_Shape sh = BinderShape (myTP->MapItem(i)); if (!sh.IsNull() && shapes.Contains(sh)) { lt->Append (myTP->Mapped(i)); j=nb; //skl (for looking for entities in checkbrep) @@ -610,7 +623,7 @@ Handle(TColStd_HSequenceOfTransient) XSControl_TransferReader::EntitiesFromShape for (ir = 1; ir <= nr; ir ++) { DeclareAndCast(Transfer_ResultFromTransient,rft,list->Value(i)); if (rft.IsNull()) continue; - TopoDS_Shape sh = xu.BinderShape (rft->Binder()); + TopoDS_Shape sh = BinderShape (rft->Binder()); if (!sh.IsNull() && shapes.Contains(sh)) lt->Append (rft->Start()); } @@ -1156,7 +1169,7 @@ void XSControl_TransferReader::PrintStatsOnList(const Handle(Transfer_TransientP Standard_Integer stat; Standard_Integer nbv = 0, nbw = 0, nbf = 0, nbr = 0, nbrw = 0, nbrf = 0, nbnr = 0, nbi = 0; - Transfer_IteratorOfProcessForTransient itrp(Standard_True); + Transfer_TransientProcess::Iterator itrp(Standard_True); if (what == 1) itrp = TP->RootResult(Standard_True); if (what == 2) itrp = TP->CompleteResult(Standard_True); if (what == 3) itrp = TP->AbnormalResult(); diff --git a/src/XSControl/XSControl_TransferWriter.cxx b/src/XSControl/XSControl_TransferWriter.cxx index d8606952c3..5c8abb4422 100644 --- a/src/XSControl/XSControl_TransferWriter.cxx +++ b/src/XSControl/XSControl_TransferWriter.cxx @@ -23,7 +23,6 @@ #include #include #include -#include IMPLEMENT_STANDARD_RTTIEXT(XSControl_TransferWriter,MMgt_TShared) diff --git a/src/XSControl/XSControl_Utils.cxx b/src/XSControl/XSControl_Utils.cxx deleted file mode 100644 index 65b9209810..0000000000 --- a/src/XSControl/XSControl_Utils.cxx +++ /dev/null @@ -1,603 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static TCollection_AsciiString bufasc; -static TCollection_ExtendedString bufext; -static const Standard_ExtString voidext = { 0 }; - - - XSControl_Utils::XSControl_Utils () { } - -// ######################################################### -// ####### Fonctions de TRACE ####### - - void XSControl_Utils::TraceLine (const Standard_CString line) const -{ - Handle(Message_Messenger) sout = Message::DefaultMessenger(); - sout<Length(); - for (i = 1; i <= nb; i ++) - if (!linha->Value(i).IsNull()) sout<Value(i)->ToCString()<Length(); - for (i = 1; i <= nb; i ++) - sout<Value(i).ToCString()<Length(); - for (i = 1; i <= nb; i ++) - if (!linhe->Value(i).IsNull()) - sout << linhe->Value(i) << endl; - return; - } - DeclareAndCast(TColStd_HSequenceOfExtendedString,linee,lines); - if (!linee.IsNull()) { - nb = linee->Length(); - for (i = 1; i <= nb; i ++) - sout << linee->Value(i) << endl; - return; - } - DeclareAndCast(TCollection_HAsciiString,lin1a,lines); - if (!lin1a.IsNull()) sout<IsKind(what); -} - - Standard_CString XSControl_Utils::TypeName - (const Handle(Standard_Transient)& item, const Standard_Boolean nopk) const -{ - if (item.IsNull()) return ""; - DeclareAndCast(Standard_Type,atype,item); - if (atype.IsNull()) atype = item->DynamicType(); - Standard_CString tn = atype->Name(); - if (!nopk) return tn; - for (int i = 0; tn[i] != '\0'; i ++) { - if (tn[i] == '_') return &tn[i+1]; - } - return tn; -} - - -// ####### TRANSIENT : Fonctions de liste ####### - - Handle(Standard_Transient) XSControl_Utils::TraValue - (const Handle(Standard_Transient)& seqval, const Standard_Integer num) const -{ - Handle(Standard_Transient) val; - if (num < 1) return val; - if (seqval.IsNull()) return val; - DeclareAndCast(TColStd_HSequenceOfHAsciiString,seqs,seqval); - if (!seqs.IsNull()) - { if (num <= seqs->Length()) val = seqs->Value(num); return val; } - DeclareAndCast(TColStd_HSequenceOfTransient,seqt,seqval); - if (!seqt.IsNull()) - { if (num <= seqt->Length()) val = seqt->Value(num); return val; } -// Standard_TypeMismatch::Raise("XSControl_Utils::SeqTraValue"); - return val; -} - - Handle(TColStd_HSequenceOfTransient) XSControl_Utils::NewSeqTra () const - { return new TColStd_HSequenceOfTransient(); } - - void XSControl_Utils::AppendTra - (const Handle(TColStd_HSequenceOfTransient)& seqval, - const Handle(Standard_Transient)& traval) const - { seqval->Append (traval); } - - -// ####### DATES ####### - - Standard_CString XSControl_Utils::DateString - (const Standard_Integer yy, const Standard_Integer mm, - const Standard_Integer dd, const Standard_Integer hh, - const Standard_Integer mn, const Standard_Integer ss) const -{ - char ladate[50]; - Interface_MSG::TDate (ladate, yy,mm,dd,hh,mn,ss); - bufasc.Clear(); bufasc.AssignCat(ladate); - return bufasc.ToCString(); -} - - void XSControl_Utils::DateValues - (const Standard_CString text, - Standard_Integer& yy, Standard_Integer& mm, Standard_Integer& dd, - Standard_Integer& hh, Standard_Integer& mn, Standard_Integer& ss) const - { Interface_MSG::NDate (text, yy,mm,dd,hh,mn,ss); } - - -// ########################################################## -// ####### STRING : Ascii de base ####### - - Standard_CString XSControl_Utils::ToCString - (const Handle(TCollection_HAsciiString)& strval) const - { -//JR/Hp - Standard_CString astr = (Standard_CString ) (strval.IsNull() ? "" : strval->ToCString()); - return astr ; -// return (strval.IsNull() ? "" : strval->ToCString()); - } - - Standard_CString XSControl_Utils::ToCString - (const TCollection_AsciiString& strval) const - { return strval.ToCString(); } - - Handle(TCollection_HAsciiString) XSControl_Utils::ToHString - (const Standard_CString strcon) const - { return new TCollection_HAsciiString(strcon); } - - TCollection_AsciiString XSControl_Utils::ToAString - (const Standard_CString strcon) const - { return TCollection_AsciiString(strcon); } - -// ####### STRING : Extended de base ####### - - Standard_ExtString XSControl_Utils::ToEString - (const Handle(TCollection_HExtendedString)& strval) const - { return (strval.IsNull() ? voidext : strval->ToExtString()); } - - Standard_ExtString XSControl_Utils::ToEString - (const TCollection_ExtendedString& strval) const - { return strval.ToExtString(); } - - Handle(TCollection_HExtendedString) XSControl_Utils::ToHString - (const Standard_ExtString strcon) const - { return new TCollection_HExtendedString(strcon); } - - TCollection_ExtendedString XSControl_Utils::ToXString - (const Standard_ExtString strcon) const - { return TCollection_ExtendedString(strcon); } - -// ####### STRING : Ascii <-> Extended ####### - - Standard_ExtString XSControl_Utils::AsciiToExtended (const Standard_CString str) const -{ - bufext.Clear(); bufext = TCollection_ExtendedString (str); - return bufext.ToExtString(); -} - - Standard_Boolean XSControl_Utils::IsAscii (const Standard_ExtString str) const -{ - bufext.Clear(); bufext.AssignCat (str); - return bufext.IsAscii(); -} - - Standard_CString XSControl_Utils::ExtendedToAscii (const Standard_ExtString str) const -{ - bufext.Clear(); bufext.AssignCat (str); bufasc.Clear(); - Standard_Integer i, nb = bufext.Length(); - for (i = 1; i <= nb; i ++) { - int unext = bufext.Value(i); - unext = unext & 127; - char uncar = char(unext); - bufasc.AssignCat (uncar); - } - return bufasc.ToCString(); -} - -// ####### STRING : LISTES ####### - - Standard_CString XSControl_Utils::CStrValue - (const Handle(Standard_Transient)& list, const Standard_Integer num) const -{ - DeclareAndCast(TColStd_HSequenceOfHAsciiString,linha,list); - if (!linha.IsNull()) { -//JR/Hp - Standard_CString astr = (Standard_CString ) - (num > linha->Length() ? "" : linha->Value(num)->ToCString()); - return astr ; -// return (num > linha->Length() ? "" : linha->Value(num)->ToCString()); - } - - DeclareAndCast(TColStd_HSequenceOfAsciiString,lina,list); - if (!lina.IsNull()) { -//JR/Hp - Standard_CString astr = (Standard_CString ) - (num > lina->Length() ? "" : lina->Value(num).ToCString()); - return astr ; -// return (num > lina->Length() ? "" : lina->Value(num).ToCString()); - } - - DeclareAndCast(TColStd_HSequenceOfHExtendedString,linhe,list); - if (!linhe.IsNull()) { -//JR/Hp - Standard_CString astr = (Standard_CString ) - (num > linhe->Length() ? "" : ExtendedToAscii(linhe->Value(num)->ToExtString())); - return astr ; -// return (num > linhe->Length() ? "" : ExtendedToAscii(linhe->Value(num)->ToExtString())); - } - - DeclareAndCast(TColStd_HSequenceOfExtendedString,linee,list); - if (!linee.IsNull()) { -//JR/Hp - Standard_CString astr = (Standard_CString ) - (num > linee->Length() ? "" : ExtendedToAscii(linee->Value(num).ToExtString())); - return astr ; -// return (num > linee->Length() ? "" : ExtendedToAscii(linee->Value(num).T - } - - DeclareAndCast(TCollection_HAsciiString,lin1a,list); - if (!lin1a.IsNull()) return lin1a->ToCString(); - DeclareAndCast(TCollection_HExtendedString,lin1e,list); - if (!lin1e.IsNull()) return ExtendedToAscii(lin1e->ToExtString()); - return ""; -} - - - Standard_ExtString XSControl_Utils::EStrValue - (const Handle(Standard_Transient)& list, const Standard_Integer num) const -{ - DeclareAndCast(TColStd_HSequenceOfHAsciiString,linha,list); - if (!linha.IsNull()) return - (num > linha->Length() ? voidext : AsciiToExtended(linha->Value(num)->ToCString())); - - DeclareAndCast(TColStd_HSequenceOfAsciiString,lina,list); - if (!lina.IsNull()) - (num > lina->Length() ? voidext : AsciiToExtended(lina->Value(num).ToCString())); - - DeclareAndCast(TColStd_HSequenceOfHExtendedString,linhe,list); - if (!linhe.IsNull()) return - (num > linhe->Length() ? voidext : linhe->Value(num)->ToExtString()); - - DeclareAndCast(TColStd_HSequenceOfExtendedString,linee,list); - if (!linee.IsNull()) return - (num > linee->Length() ? voidext : linee->Value(num).ToExtString()); - - DeclareAndCast(TCollection_HAsciiString,lin1a,list); - if (!lin1a.IsNull()) return AsciiToExtended(lin1a->ToCString()); - DeclareAndCast(TCollection_HExtendedString,lin1e,list); - if (!lin1e.IsNull()) return lin1e->ToExtString(); - return voidext; -} - - Handle(TColStd_HSequenceOfHAsciiString) XSControl_Utils::NewSeqCStr () const - { return new TColStd_HSequenceOfHAsciiString(); } - - void XSControl_Utils::AppendCStr - (const Handle(TColStd_HSequenceOfHAsciiString)& seqval, - const Standard_CString strval) const - { seqval->Append (new TCollection_HAsciiString(strval)); } - - Handle(TColStd_HSequenceOfHExtendedString) XSControl_Utils::NewSeqEStr () const - { return new TColStd_HSequenceOfHExtendedString(); } - - void XSControl_Utils::AppendEStr - (const Handle(TColStd_HSequenceOfHExtendedString)& seqval, - const Standard_ExtString strval) const - { seqval->Append (new TCollection_HExtendedString(strval)); } - - -// ########################################################## -// ####### SHAPES : Acces de base ####### - - Standard_Boolean XSControl_Utils::WriteShape - (const TopoDS_Shape& shape, - const Standard_CString filename) const - { return BRepTools::Write (shape,filename); } - - TopoDS_Shape XSControl_Utils::NewShape () const - { TopoDS_Shape shape; return shape; } - - Standard_Boolean XSControl_Utils::ReadShape - (TopoDS_Shape& shape, - const Standard_CString filename) const -{ - BRep_Builder B; - return BRepTools::Read (shape,filename,B); -} - - Standard_Boolean XSControl_Utils::IsNullShape (const TopoDS_Shape& shape) const - { return shape.IsNull(); } - - - TopoDS_Shape XSControl_Utils::CompoundFromSeq - (const Handle(TopTools_HSequenceOfShape)& seqval) const -{ - BRep_Builder B; - TopoDS_Compound C; - B.MakeCompound(C); - Standard_Integer i,n = seqval->Length(); - for (i = 1; i <= n ; i ++) B.Add(C,seqval->Value(i)); - return C; -} - - TopAbs_ShapeEnum XSControl_Utils::ShapeType - (const TopoDS_Shape& shape, const Standard_Boolean compound) const -{ - if (shape.IsNull()) return TopAbs_SHAPE; - TopAbs_ShapeEnum res = shape.ShapeType(); - if (!compound || res != TopAbs_COMPOUND) return res; - res = TopAbs_SHAPE; - for (TopoDS_Iterator iter(shape); iter.More(); iter.Next()) { - TopoDS_Shape sh = iter.Value(); - if (sh.IsNull()) continue; - TopAbs_ShapeEnum typ = sh.ShapeType(); - if (typ == TopAbs_COMPOUND) typ = ShapeType (sh,compound); - if (res == TopAbs_SHAPE) res = typ; -// Egalite : OK; Pseudo-Egalite : EDGE/WIRE ou FACE/SHELL - else if (res == TopAbs_EDGE && typ == TopAbs_WIRE) res = typ; - else if (res == TopAbs_WIRE && typ == TopAbs_EDGE) continue; - else if (res == TopAbs_FACE && typ == TopAbs_SHELL) res = typ; - else if (res == TopAbs_SHELL && typ == TopAbs_FACE) continue; - else if (res != typ) return TopAbs_COMPOUND; - } - return res; -} - - TopoDS_Shape XSControl_Utils::SortedCompound - (const TopoDS_Shape& shape, const TopAbs_ShapeEnum type, - const Standard_Boolean explore, const Standard_Boolean compound) const -{ - if (shape.IsNull()) return shape; - TopAbs_ShapeEnum typ = shape.ShapeType(); - TopoDS_Shape sh, sh0; - Standard_Integer nb = 0; - -// Compound : on le prend, soit tel quel, soit son contenu - if (typ == TopAbs_COMPOUND || typ == TopAbs_COMPSOLID) { - TopoDS_Compound C; - BRep_Builder B; - B.MakeCompound (C); - for (TopoDS_Iterator it(shape); it.More(); it.Next()) { - sh0 = SortedCompound (it.Value(),type,explore,compound); - if (sh0.IsNull()) continue; - sh = sh0; - typ = sh.ShapeType(); - if (typ == TopAbs_COMPOUND && !compound) { - for (TopoDS_Iterator it2 (sh); it2.More(); it2.Next()) - { nb ++; sh = it2.Value(); B.Add (C, sh); } - } - else { nb ++; B.Add (C,sh); } - } - if (nb == 0) C.Nullify(); - else if (nb == 1) return sh; - return C; - } - -// Egalite : OK; Pseudo-Egalite : EDGE/WIRE ou FACE/SHELL - if (typ == type) return shape; - if (typ == TopAbs_EDGE && type == TopAbs_WIRE) { - BRep_Builder B; - TopoDS_Wire W; - B.MakeWire (W); - B.Add (W,shape); // ne passe pas ! : TopoDS::Edge(shape) - return W; - } - if (typ == TopAbs_FACE && type == TopAbs_SHELL) { - BRep_Builder B; - TopoDS_Shell S; - B.MakeShell (S); - B.Add (S,shape); // ne passe pas ! : TopoDS::Face(shape)); - S.Closed (BRep_Tool::IsClosed (S)); - return S; - } - -// Le reste : selon exploration - if (!explore) { - TopoDS_Shape nulsh; - return nulsh; - } - -// Ici, on doit explorer -// SOLID + mode COMPOUND : reconduire les SHELLs - if (typ == TopAbs_SOLID && compound) { - TopoDS_Compound C; - BRep_Builder B; - B.MakeCompound (C); - for (TopoDS_Iterator it(shape); it.More(); it.Next()) { - sh0 = SortedCompound (it.Value(),type,explore,compound); - if (sh0.IsNull()) continue; - sh = sh0; - nb ++; B.Add (C,sh); - } - if (nb == 0) C.Nullify(); - else if (nb == 1) return sh; - return C; - } - -// Exploration classique - TopoDS_Compound CC; - BRep_Builder BB; - BB.MakeCompound(CC); - for (TopExp_Explorer expl (shape,type); expl.More(); expl.Next()) { - nb ++; sh = expl.Current(); - BB.Add (CC,sh); - } - if (nb == 0) CC.Nullify(); - else if (nb == 1) return sh; - return CC; -} - - -// ####### SHAPES : Liste ####### - - TopoDS_Shape XSControl_Utils::ShapeValue - (const Handle(TopTools_HSequenceOfShape)& seqval, const Standard_Integer num) const -{ - TopoDS_Shape shape; - if (seqval.IsNull()) return shape; - if (num > 0 && num <= seqval->Length()) shape = seqval->Value(num); - return shape; -} - - Handle(TopTools_HSequenceOfShape) XSControl_Utils::NewSeqShape () const - { return new TopTools_HSequenceOfShape(); } - - void XSControl_Utils::AppendShape - (const Handle(TopTools_HSequenceOfShape)& seqval, const TopoDS_Shape& shape) const - { seqval->Append (shape); } - -// ####### SHAPES <-> Transient ####### - - Handle(Standard_Transient) XSControl_Utils::ShapeBinder - (const TopoDS_Shape& shape, const Standard_Boolean hs) const - { if (hs) return new TopoDS_HShape (shape); - else return new TransferBRep_ShapeBinder (shape); } - - TopoDS_Shape XSControl_Utils::BinderShape - (const Handle(Standard_Transient)& tr) const -{ - TopoDS_Shape sh; - DeclareAndCast(Transfer_Binder,sb,tr); - if (!sb.IsNull()) return TransferBRep::ShapeResult(sb); - DeclareAndCast(TransferBRep_ShapeMapper,sm,tr); - if (!sm.IsNull()) return sm->Shape(); - DeclareAndCast(TopoDS_HShape,hs,tr); - if (!hs.IsNull()) return hs->Shape(); - return sh; -} - - -// ########################################################## -// ####### LISTES : Fonctions Generales ####### - - Standard_Integer XSControl_Utils::SeqLength - (const Handle(Standard_Transient)& seqval) const -{ - if (seqval.IsNull()) return 0; - DeclareAndCast(TColStd_HSequenceOfHAsciiString,seqs,seqval); - if (!seqs.IsNull()) return seqs->Length(); - DeclareAndCast(TColStd_HSequenceOfAsciiString,seqa,seqval); - if (!seqa.IsNull()) return seqa->Length(); - DeclareAndCast(TColStd_HSequenceOfHExtendedString,seqe,seqval); - if (!seqe.IsNull()) return seqe->Length(); - DeclareAndCast(TColStd_HSequenceOfHExtendedString,seqx,seqval); - if (!seqx.IsNull()) return seqx->Length(); - - DeclareAndCast(TColStd_HSequenceOfTransient,seqt,seqval); - if (!seqt.IsNull()) return seqt->Length(); - DeclareAndCast(TopTools_HSequenceOfShape,seqh,seqval); - if (!seqh.IsNull()) return seqh->Length(); - DeclareAndCast(TColStd_HSequenceOfInteger,seqi,seqval); - if (!seqi.IsNull()) return seqi->Length(); -// Standard_TypeMismatch::Raise("XSControl_Utils::SeqLength"); - return 0; -} - - Handle(Standard_Transient) XSControl_Utils::SeqToArr - (const Handle(Standard_Transient)& seqval, const Standard_Integer first) const -{ - Standard_Integer i,lng; - Handle(Standard_Transient) val; - if (seqval.IsNull()) return val; - DeclareAndCast(TColStd_HSequenceOfHAsciiString,seqs,seqval); - if (!seqs.IsNull()) { - lng = seqs->Length(); - Handle(Interface_HArray1OfHAsciiString) arrs = - new Interface_HArray1OfHAsciiString(first,lng-first+1); - for (i = 1; i <= lng; i ++) arrs->SetValue (i-first+1,seqs->Value(i)); - return arrs; - } - DeclareAndCast(TColStd_HSequenceOfTransient,seqt,seqval); - if (!seqt.IsNull()) { - lng = seqt->Length(); - Handle(TColStd_HArray1OfTransient) arrt = - new TColStd_HArray1OfTransient(first,lng-first+1); - for (i = 1; i <= lng; i ++) arrt->SetValue (i-first+1,seqt->Value(i)); - return arrt; - } - Standard_TypeMismatch::Raise("XSControl_Utils::SeqToArr"); - return val; -} - - - Handle(Standard_Transient) XSControl_Utils::ArrToSeq - (const Handle(Standard_Transient)& arrval) const -{ - Standard_Integer i,first,last; - Handle(Standard_Transient) val; - if (arrval.IsNull()) return val; - DeclareAndCast(Interface_HArray1OfHAsciiString,arrs,arrval); - if (!arrs.IsNull()) { - first = arrs->Lower(); - last = arrs->Upper(); - Handle(TColStd_HSequenceOfHAsciiString) seqs = - new TColStd_HSequenceOfHAsciiString(); - for (i = first; i <= last; i ++) seqs->Append (arrs->Value(i)); - return seqs; - } - DeclareAndCast(TColStd_HArray1OfTransient,arrt,arrval); - if (!arrt.IsNull()) { - first = arrt->Lower(); - last = arrt->Upper(); - Handle(TColStd_HSequenceOfTransient) seqt = - new TColStd_HSequenceOfTransient(); - for (i = first; i <= last; i ++) seqt->Append (arrt->Value(i)); - return seqt; - } - Standard_TypeMismatch::Raise("XSControl_Utils::ArrToSeq"); - return val; -} - - - Standard_Integer XSControl_Utils::SeqIntValue - (const Handle(TColStd_HSequenceOfInteger)& seqval, - const Standard_Integer num) const -{ - if (seqval.IsNull()) return 0; - return seqval->Value(num); -} diff --git a/src/XSControl/XSControl_Utils.hxx b/src/XSControl/XSControl_Utils.hxx deleted file mode 100644 index 7392030e84..0000000000 --- a/src/XSControl/XSControl_Utils.hxx +++ /dev/null @@ -1,215 +0,0 @@ -// Created on: 1995-12-04 -// Created by: Christian CAILLET -// Copyright (c) 1995-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _XSControl_Utils_HeaderFile -#define _XSControl_Utils_HeaderFile - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -class Standard_TypeMismatch; -class Standard_Transient; -class TCollection_HAsciiString; -class TCollection_AsciiString; -class TCollection_HExtendedString; -class TCollection_ExtendedString; -class TopoDS_Shape; - - -//! This class provides various useful utility routines, to -//! facilitate handling of most common data structures : -//! transients (type, type name ...), -//! strings (ascii or extended, pointed or handled or ...), -//! shapes (reading, writing, testing ...), -//! sequences & arrays (of strings, of transients, of shapes ...), -//! ... -//! -//! Also it gives some helps on some data structures from XSTEP, -//! such as printing on standard trace file, recignizing most -//! currently used auxiliary types (Binder,Mapper ...) -class XSControl_Utils -{ -public: - - DEFINE_STANDARD_ALLOC - - - //! the only use of this, is to allow a frontal to get one - //! distinct "Utils" set per separate engine - Standard_EXPORT XSControl_Utils(); - - //! Just prints a line into the current Trace File. This allows to - //! better characterise the various trace outputs, as desired. - Standard_EXPORT void TraceLine (const Standard_CString line) const; - - //! Just prints a line or a set of lines into the current Trace - //! File. can be a HAscii/ExtendedString (produces a print - //! without ending line) or a HSequence or HArray1 Of .. - //! (one new line per item) - Standard_EXPORT void TraceLines (const Handle(Standard_Transient)& lines) const; - - Standard_EXPORT Standard_Boolean IsKind (const Handle(Standard_Transient)& item, const Handle(Standard_Type)& what) const; - - //! Returns the name of the dynamic type of an object, i.e. : - //! If it is a Type, its Name - //! If it is a object not a type, the Name of its DynamicType - //! If it is Null, an empty string - //! If is False (D), gives complete name - //! If is True, returns class name without package - Standard_EXPORT Standard_CString TypeName (const Handle(Standard_Transient)& item, const Standard_Boolean nopk = Standard_False) const; - - Standard_EXPORT Handle(Standard_Transient) TraValue (const Handle(Standard_Transient)& list, const Standard_Integer num) const; - - Standard_EXPORT Handle(TColStd_HSequenceOfTransient) NewSeqTra() const; - - Standard_EXPORT void AppendTra (const Handle(TColStd_HSequenceOfTransient)& seqval, const Handle(Standard_Transient)& traval) const; - - Standard_EXPORT Standard_CString DateString (const Standard_Integer yy, const Standard_Integer mm, const Standard_Integer dd, const Standard_Integer hh, const Standard_Integer mn, const Standard_Integer ss) const; - - Standard_EXPORT void DateValues (const Standard_CString text, Standard_Integer& yy, Standard_Integer& mm, Standard_Integer& dd, Standard_Integer& hh, Standard_Integer& mn, Standard_Integer& ss) const; - - Standard_EXPORT Standard_CString ToCString (const Handle(TCollection_HAsciiString)& strval) const; - - Standard_EXPORT Standard_CString ToCString (const TCollection_AsciiString& strval) const; - - Standard_EXPORT Handle(TCollection_HAsciiString) ToHString (const Standard_CString strcon) const; - - Standard_EXPORT TCollection_AsciiString ToAString (const Standard_CString strcon) const; - - Standard_EXPORT Standard_ExtString ToEString (const Handle(TCollection_HExtendedString)& strval) const; - - Standard_EXPORT Standard_ExtString ToEString (const TCollection_ExtendedString& strval) const; - - Standard_EXPORT Handle(TCollection_HExtendedString) ToHString (const Standard_ExtString strcon) const; - - Standard_EXPORT TCollection_ExtendedString ToXString (const Standard_ExtString strcon) const; - - Standard_EXPORT Standard_ExtString AsciiToExtended (const Standard_CString str) const; - - Standard_EXPORT Standard_Boolean IsAscii (const Standard_ExtString str) const; - - Standard_EXPORT Standard_CString ExtendedToAscii (const Standard_ExtString str) const; - - Standard_EXPORT Standard_CString CStrValue (const Handle(Standard_Transient)& list, const Standard_Integer num) const; - - Standard_EXPORT Standard_ExtString EStrValue (const Handle(Standard_Transient)& list, const Standard_Integer num) const; - - Standard_EXPORT Handle(TColStd_HSequenceOfHAsciiString) NewSeqCStr() const; - - Standard_EXPORT void AppendCStr (const Handle(TColStd_HSequenceOfHAsciiString)& seqval, const Standard_CString strval) const; - - Standard_EXPORT Handle(TColStd_HSequenceOfHExtendedString) NewSeqEStr() const; - - Standard_EXPORT void AppendEStr (const Handle(TColStd_HSequenceOfHExtendedString)& seqval, const Standard_ExtString strval) const; - - //! Writes a Shape under the internal BRepTools form - //! (an internal help utility) - //! Returns True if writing has succeeded, False else - Standard_EXPORT Standard_Boolean WriteShape (const TopoDS_Shape& shape, const Standard_CString filename) const; - - //! Returns a new empty, undefined Shape, which can then be filled - //! by ReadShape - Standard_EXPORT TopoDS_Shape NewShape() const; - - //! Reads a Shape from the internal BRepTools form and returns it - //! (an internal help utility) - //! Returns True if reading has succeeded, False else - Standard_EXPORT Standard_Boolean ReadShape (TopoDS_Shape& shape, const Standard_CString filename) const; - - //! Returns True if a Shape is Null - Standard_EXPORT Standard_Boolean IsNullShape (const TopoDS_Shape& shape) const; - - //! Converts a list of Shapes to a Compound (a kind of Shape) - Standard_EXPORT TopoDS_Shape CompoundFromSeq (const Handle(TopTools_HSequenceOfShape)& seqval) const; - - //! Returns the type of a Shape : true type if is False - //! If is True and is a Compound, iterates on - //! its items. If all are of the same type, returns this type. - //! Else, returns COMPOUND. If it is empty, returns SHAPE - //! For a Null Shape, returns SHAPE - Standard_EXPORT TopAbs_ShapeEnum ShapeType (const TopoDS_Shape& shape, const Standard_Boolean compound) const; - - //! From a Shape, builds a Compound as follows : - //! explores it level by level - //! If is False, only COMPOUND items. Else, all items - //! Adds to the result, shapes which comply to - //! + if is WIRE, considers free edges (and makes wires) - //! + if is SHELL, considers free faces (and makes shells) - //! If is True, gathers items in compounds which - //! correspond to starting COMPOUND,SOLID or SHELL containers, or - //! items directly contained in a Compound - Standard_EXPORT TopoDS_Shape SortedCompound (const TopoDS_Shape& shape, const TopAbs_ShapeEnum type, const Standard_Boolean explore, const Standard_Boolean compound) const; - - Standard_EXPORT TopoDS_Shape ShapeValue (const Handle(TopTools_HSequenceOfShape)& seqv, const Standard_Integer num) const; - - Standard_EXPORT Handle(TopTools_HSequenceOfShape) NewSeqShape() const; - - Standard_EXPORT void AppendShape (const Handle(TopTools_HSequenceOfShape)& seqv, const TopoDS_Shape& shape) const; - - //! Creates a Transient Object from a Shape : it is either a Binder - //! (used by functions which require a Transient but can process - //! a Shape, such as viewing functions) or a HShape (according to hs) - //! Default is a HShape - Standard_EXPORT Handle(Standard_Transient) ShapeBinder (const TopoDS_Shape& shape, const Standard_Boolean hs = Standard_True) const; - - //! From a Transient, returns a Shape. - //! In fact, recognizes ShapeBinder ShapeMapper and HShape - Standard_EXPORT TopoDS_Shape BinderShape (const Handle(Standard_Transient)& tr) const; - - Standard_EXPORT Standard_Integer SeqLength (const Handle(Standard_Transient)& list) const; - - Standard_EXPORT Handle(Standard_Transient) SeqToArr (const Handle(Standard_Transient)& seq, const Standard_Integer first = 1) const; - - Standard_EXPORT Handle(Standard_Transient) ArrToSeq (const Handle(Standard_Transient)& arr) const; - - Standard_EXPORT Standard_Integer SeqIntValue (const Handle(TColStd_HSequenceOfInteger)& list, const Standard_Integer num) const; - - - - -protected: - - - - - -private: - - - - - -}; - - - - - - - -#endif // _XSControl_Utils_HeaderFile diff --git a/src/XSControl/XSControl_Vars.hxx b/src/XSControl/XSControl_Vars.hxx index 2568f5123c..413e3b1f57 100644 --- a/src/XSControl/XSControl_Vars.hxx +++ b/src/XSControl/XSControl_Vars.hxx @@ -49,16 +49,12 @@ DEFINE_STANDARD_HANDLE(XSControl_Vars, MMgt_TShared) //! dictionary), but which is aimed to be redefined class XSControl_Vars : public MMgt_TShared { - -public: - + public: Standard_EXPORT XSControl_Vars(); Standard_EXPORT virtual void Set (const Standard_CString name, const Handle(Standard_Transient)& val); - Standard_EXPORT virtual Handle(Standard_Transient) Get (Standard_CString& name) const; - Standard_EXPORT virtual Handle(Geom_Geometry) GetGeom (Standard_CString& name) const; Standard_EXPORT virtual Handle(Geom2d_Curve) GetCurve2d (Standard_CString& name) const; @@ -79,28 +75,13 @@ public: Standard_EXPORT virtual TopoDS_Shape GetShape (Standard_CString& name) const; - - - DEFINE_STANDARD_RTTIEXT(XSControl_Vars,MMgt_TShared) -protected: - - - - -private: - + protected: + + Standard_EXPORT virtual Handle(Standard_Transient) Get (Standard_CString& name) const; Handle(Dico_DictionaryOfTransient) thevars; - - }; - - - - - - #endif // _XSControl_Vars_HeaderFile diff --git a/src/XSControl/XSControl_WorkSession.cxx b/src/XSControl/XSControl_WorkSession.cxx index e4fdb1be76..4021e8836a 100644 --- a/src/XSControl/XSControl_WorkSession.cxx +++ b/src/XSControl/XSControl_WorkSession.cxx @@ -13,9 +13,6 @@ //:i1 pdn 03.04.99 BUC60301 -#include -#include -#include #include #include #include @@ -138,35 +135,6 @@ Standard_CString XSControl_WorkSession::SelectedNorm(const Standard_Boolean rsc) } -// ########################################## -// ############ Contexte de Transfert ###### -// ########################################## - - -//======================================================================= -//function : SetAllContext -//purpose : -//======================================================================= - -void XSControl_WorkSession::SetAllContext(const Handle(Dico_DictionaryOfTransient)& context) -{ - myContext = context; - myTransferReader->Context() = context; -} - - -//======================================================================= -//function : ClearContext -//purpose : -//======================================================================= - -void XSControl_WorkSession::ClearContext () -{ - myContext.Nullify(); - myTransferReader->Context().Nullify(); -} - - // ########################################## // ############ RESULTATS FORCES ###### // ########################################## @@ -321,16 +289,6 @@ void XSControl_WorkSession::SetTransferReader(const Handle(XSControl_TransferRea TR->SetTransientProcess(TP); } -//======================================================================= -//function : MapReader -//purpose : -//======================================================================= - -Handle(Transfer_TransientProcess) XSControl_WorkSession::MapReader() const -{ - return myTransferReader->TransientProcess(); -} - //======================================================================= //function : SetMapReader //purpose : @@ -342,12 +300,8 @@ Standard_Boolean XSControl_WorkSession::SetMapReader (const Handle(Transfer_Tran if (TP->Model().IsNull()) TP->SetModel (Model()); TP->SetGraph (HGraph()); if (TP->Model() != Model()) return Standard_False; -// TR ne doit pas bouger, c est un "crochet" pour signatures, selections ... -// En revanche, mieux vaut le RAZ -// Handle(XSControl_TransferReader) TR = new XSControl_TransferReader; Handle(XSControl_TransferReader) TR = myTransferReader; TR->Clear(-1); - SetTransferReader (TR); // avec le meme mais le reinitialise TR->SetTransientProcess (TP); // et prend le nouveau TP return Standard_True; diff --git a/src/XSControl/XSControl_WorkSession.hxx b/src/XSControl/XSControl_WorkSession.hxx index 7a284638de..3d3af132bb 100644 --- a/src/XSControl/XSControl_WorkSession.hxx +++ b/src/XSControl/XSControl_WorkSession.hxx @@ -25,7 +25,6 @@ #include class XSControl_Controller; class XSControl_TransferReader; -class Dico_DictionaryOfTransient; class XSControl_Vars; class Message_Messenger; class Transfer_TransientProcess; @@ -80,20 +79,7 @@ class XSControl_WorkSession : public IFSelect_WorkSession Standard_EXPORT Standard_CString SelectedNorm (const Standard_Boolean theRsc = Standard_False) const; //! Returns the norm controller itself - const Handle(XSControl_Controller) & NormAdaptor() const - { return myController; } - - //! Returns the current Context List, Null if not defined - //! The Context is given to the TransientProcess for TransferRead - const Handle(Dico_DictionaryOfTransient) & Context() const - { return myContext; } - - //! Sets the current Context List, as a whole - //! Sets it to the TransferReader - Standard_EXPORT void SetAllContext (const Handle(Dico_DictionaryOfTransient)& theContext); - - //! Clears the whole current Context (nullifies it) - Standard_EXPORT void ClearContext(); + const Handle(XSControl_Controller) & NormAdaptor() const { return myController; } //! Prints the transfer status of a transferred item, as beeing //! the Mapped n0 , from MapWriter if is True, or @@ -109,15 +95,8 @@ class XSControl_WorkSession : public IFSelect_WorkSession //! 5 recreates TransferReader then begins a new transfer Standard_EXPORT void InitTransferReader (const Standard_Integer theMode); - //! Sets a Transfer Reader, which manages transfers on reading - Standard_EXPORT void SetTransferReader (const Handle(XSControl_TransferReader)& theTR); - //! Returns the Transfer Reader, Null if not set - const Handle(XSControl_TransferReader) & TransferReader () const - { return myTransferReader; } - - //! Returns the TransientProcess(internal data for TransferReader) - Standard_EXPORT Handle(Transfer_TransientProcess) MapReader() const; + const Handle(XSControl_TransferReader) & TransferReader () const { return myTransferReader; } //! Changes the Map Reader, i.e. considers that the new one //! defines the relevant read results (forgets the former ones) @@ -157,8 +136,7 @@ class XSControl_WorkSession : public IFSelect_WorkSession Standard_EXPORT Handle(Interface_InterfaceModel) NewModel(); //! Returns the Transfer Reader, Null if not set - const Handle(XSControl_TransferWriter) & TransferWriter() const - { return myTransferWriter; } + const Handle(XSControl_TransferWriter) & TransferWriter() const { return myTransferWriter; } //! Changes the Map Reader, i.e. considers that the new one //! defines the relevant read results (forgets the former ones) @@ -176,23 +154,23 @@ class XSControl_WorkSession : public IFSelect_WorkSession //! Error if transfer badly initialised Standard_EXPORT IFSelect_ReturnStatus TransferWriteShape (const TopoDS_Shape& theShape, const Standard_Boolean theCompGraph = Standard_True); - const Handle(XSControl_Vars) & Vars() const - { return myVars; } + const Handle(XSControl_Vars) & Vars() const { return myVars; } - void SetVars (const Handle(XSControl_Vars)& theVars) - { myVars = theVars; } + void SetVars (const Handle(XSControl_Vars)& theVars) { myVars = theVars; } DEFINE_STANDARD_RTTIEXT(XSControl_WorkSession,IFSelect_WorkSession) private: + //! Sets a Transfer Reader, which manages transfers on reading + Standard_EXPORT void SetTransferReader (const Handle(XSControl_TransferReader)& theTR); + //! Clears binders Standard_EXPORT void ClearBinders(); Handle(XSControl_Controller) myController; Handle(XSControl_TransferReader) myTransferReader; Handle(XSControl_TransferWriter) myTransferWriter; - Handle(Dico_DictionaryOfTransient) myContext; Handle(XSControl_Vars) myVars; }; diff --git a/src/XSDRAW/FILES b/src/XSDRAW/FILES index 5f443e2f1d..4ad6d21ced 100755 --- a/src/XSDRAW/FILES +++ b/src/XSDRAW/FILES @@ -1,7 +1,15 @@ XSDRAW.cxx XSDRAW.hxx +XSDRAW_Activator.cxx +XSDRAW_Activator.hxx XSDRAW_Commands.hxx +XSDRAW_ControlFunctions.cxx +XSDRAW_ControlFunctions.hxx XSDRAW_Functions.cxx XSDRAW_Functions.hxx +XSDRAW_SelectFunctions.cxx +XSDRAW_SelectFunctions.hxx +XSDRAW_ShapeFunctions.cxx +XSDRAW_ShapeFunctions.hxx XSDRAW_Vars.cxx XSDRAW_Vars.hxx diff --git a/src/XSDRAW/XSDRAW.cxx b/src/XSDRAW/XSDRAW.cxx index 735954bb15..7f56499968 100644 --- a/src/XSDRAW/XSDRAW.cxx +++ b/src/XSDRAW/XSDRAW.cxx @@ -15,12 +15,12 @@ #include #include #include -#include #include #include #include #include #include +#include #include #include #include @@ -28,20 +28,17 @@ #include #include #include -#include #include -#include -#include #include #include #include #include +#include +#include +#include #include -//#include static int deja = 0, dejald = 0; -//unused variable -//static int okxset = 0; static Handle(Dico_DictionaryOfInteger) theolds; static Handle(TColStd_HSequenceOfAsciiString) thenews; @@ -74,13 +71,12 @@ static Standard_Integer XSTEPDRAWRUN (Draw_Interpretor& , Standard_Integer argc, theolds->SetItem (oldname,num); } - void XSDRAW::RemoveCommand - (const Standard_CString oldname) +void XSDRAW::RemoveCommand (const Standard_CString oldname) { ChangeCommand (oldname,""); } - Standard_Boolean XSDRAW::LoadSession () +Standard_Boolean XSDRAW::LoadSession () { if (deja) return Standard_False; deja = 1; @@ -89,10 +85,7 @@ static Standard_Integer XSTEPDRAWRUN (Draw_Interpretor& , Standard_Integer argc, WS->SetVars (new XSDRAW_Vars); thepilot->SetSession (WS); - IFSelect_Functions::Init(); - XSControl_Functions::Init(); - XSControl_FuncShape::Init(); -// XSDRAW_Shape::Init(); passe a present par theCommands + XSDRAW_Functions::Init(); return Standard_True; } @@ -102,14 +95,12 @@ void XSDRAW::LoadDraw (Draw_Interpretor& theCommands) // Pour tout faire d un coup : BRepTest & cie: LoadSession(); - //skl: we make remove commands "x" and "exit" in order to this commands are + //skl: we remove commands "x" and "exit" in order to this commands are // performed not in IFSelect_SessionPilot but in standard Tcl interpretor XSDRAW::RemoveCommand("x"); XSDRAW::RemoveCommand("exit"); -// if (!getenv("WBHOSTTOP")) XSDRAW::RemoveCommand("xsnew"); - Handle(TColStd_HSequenceOfAsciiString) list = - IFSelect_Activator::Commands(0); + Handle(TColStd_HSequenceOfAsciiString) list = IFSelect_Activator::Commands(0); TCollection_AsciiString com; Standard_Integer i, nb = list->Length(); for (i = 1; i <= nb; i ++) { @@ -128,8 +119,7 @@ void XSDRAW::LoadDraw (Draw_Interpretor& theCommands) } } - Standard_Integer XSDRAW::Execute - (const Standard_CString command, const Standard_CString varname) +Standard_Integer XSDRAW::Execute (const Standard_CString command, const Standard_CString varname) { char mess[100]; Sprintf (mess,command,varname); @@ -137,13 +127,13 @@ void XSDRAW::LoadDraw (Draw_Interpretor& theCommands) return 1; // stat ? } - Handle(IFSelect_SessionPilot) XSDRAW::Pilot () - { return thepilot; } +const Handle(IFSelect_SessionPilot) & XSDRAW::Pilot () +{ return thepilot; } - Handle(XSControl_WorkSession) XSDRAW::Session () - { return XSControl::Session(thepilot); } +Handle(XSControl_WorkSession) XSDRAW::Session (const Handle(IFSelect_SessionPilot) &thePilot) +{ return Handle(XSControl_WorkSession)::DownCast((thePilot.IsNull()? thepilot : thePilot)->Session()); } - void XSDRAW::SetController (const Handle(XSControl_Controller)& control) +void XSDRAW::SetController (const Handle(XSControl_Controller)& control) { if (thepilot.IsNull()) XSDRAW::LoadSession(); if (control.IsNull()) cout<<"XSTEP Controller not defined"<> ligne; Standard_Size ln = strlen(ligne); char *ff = &ligne[0], *ss = NULL; cin.get(truc); if (truc != '\n') { cin>>&ligne[ln+1]; ss = &ligne[ln+1]; } return XSDRAW::GetList (ff,ss); } -// return IFSelect_Functions::GiveList (Session(),first,second); - return IFSelect_Functions::GiveList (Session(),first,second); + return XSDRAW_SelectFunctions::GiveList (Session(),first,second); } - Standard_Boolean XSDRAW::FileAndVar +Standard_Boolean XSDRAW::FileAndVar (const Standard_CString file, const Standard_CString var, const Standard_CString def, TCollection_AsciiString& resfile, TCollection_AsciiString& resvar) -{ return XSControl_FuncShape::FileAndVar - (XSDRAW::Session(),file,var,def,resfile,resvar); } - - Standard_Integer XSDRAW::MoreShapes - (Handle(TopTools_HSequenceOfShape)& list, const Standard_CString name) -{ return XSControl_FuncShape::MoreShapes (XSDRAW::Session(),list,name); } +{ + return XSDRAW_ShapeFunctions::FileAndVar(Session(),file,var,def,resfile,resvar); +} +Standard_Integer XSDRAW::MoreShapes (Handle(TopTools_HSequenceOfShape)& list, const Standard_CString name) +{ + return XSDRAW_ShapeFunctions::MoreShapes(Session(),list,name); +} // FONCTION POUR LE DEBUG diff --git a/src/XSDRAW/XSDRAW.hxx b/src/XSDRAW/XSDRAW.hxx index f309f6a487..67315a81f8 100644 --- a/src/XSDRAW/XSDRAW.hxx +++ b/src/XSDRAW/XSDRAW.hxx @@ -23,7 +23,7 @@ #include #include #include -class IFSelect_SessionPilot; +#include class XSControl_WorkSession; class XSControl_Controller; class Interface_Protocol; @@ -97,11 +97,11 @@ class XSDRAW Standard_EXPORT static Standard_Integer Execute (const Standard_CString command, const Standard_CString var = ""); //! Returns the SessionPilot (can be used for direct call) - Standard_EXPORT static Handle(IFSelect_SessionPilot) Pilot(); + Standard_EXPORT static const Handle(IFSelect_SessionPilot) & Pilot(); //! Returns the WorkSession defined in AddDraw (through Pilot) //! It is from XSControl, it brings functionnalities for Transfers - Standard_EXPORT static Handle(XSControl_WorkSession) Session(); + Standard_EXPORT static Handle(XSControl_WorkSession) Session(const Handle(IFSelect_SessionPilot) &thePilot = NULL); //! Defines a Controller for the command "xinit" and applies it //! (i.e. calls its method Customise) diff --git a/src/XSDRAW/XSDRAW_Activator.cxx b/src/XSDRAW/XSDRAW_Activator.cxx new file mode 100644 index 0000000000..4cfd237b32 --- /dev/null +++ b/src/XSDRAW/XSDRAW_Activator.cxx @@ -0,0 +1,39 @@ +// Copyright (c) 1999-2014 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +#include + +IMPLEMENT_STANDARD_RTTIEXT(XSDRAW_Activator,IFSelect_Activator) + +static TCollection_AsciiString thedefgr, thedefil; + +void XSDRAW_Activator::SetGroup (const Standard_CString group, const Standard_CString file) +{ + thedefgr.Clear(); if (group[0] != '\0') thedefgr.AssignCat(group); + thedefil.Clear(); if (file [0] != '\0') thedefil.AssignCat(file); +} + +void XSDRAW_Activator::AddFunc (const Standard_CString name, const Standard_CString help, const XSDRAW_ActFunc func) +{ + Handle(XSDRAW_Activator) act = new XSDRAW_Activator (name,help,func); + if (thedefgr.Length() > 0) act->SetForGroup (thedefgr.ToCString()); + act->Add (1,name); +} + +void XSDRAW_Activator::AddFSet (const Standard_CString name, const Standard_CString help, const XSDRAW_ActFunc func) +{ + Handle(XSDRAW_Activator) act = new XSDRAW_Activator (name,help,func); + if (thedefgr.Length() > 0) + act->SetForGroup (thedefgr.ToCString(),thedefil.ToCString()); + act->AddSet (1,name); +} diff --git a/src/IFSelect/IFSelect_Act.hxx b/src/XSDRAW/XSDRAW_Activator.hxx similarity index 70% rename from src/IFSelect/IFSelect_Act.hxx rename to src/XSDRAW/XSDRAW_Activator.hxx index af2705c2d9..6ec19c9466 100644 --- a/src/IFSelect/IFSelect_Act.hxx +++ b/src/XSDRAW/XSDRAW_Activator.hxx @@ -14,24 +14,18 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#ifndef _IFSelect_Act_HeaderFile -#define _IFSelect_Act_HeaderFile +#ifndef _XSDRAW_Activator_HeaderFile +#define _XSDRAW_Activator_HeaderFile #include #include #include -#include #include -#include #include -#include -class Standard_DomainError; class IFSelect_SessionPilot; - -class IFSelect_Act; -DEFINE_STANDARD_HANDLE(IFSelect_Act, IFSelect_Activator) +typedef IFSelect_ReturnStatus (*XSDRAW_ActFunc) (const Handle(IFSelect_SessionPilot)&); //! Act gives a simple way to define and add functions to be ran //! from a SessionPilot, as follows : @@ -45,29 +39,31 @@ DEFINE_STANDARD_HANDLE(IFSelect_Act, IFSelect_Activator) //! function, and the SessionPilot which brings other infos //! //! Add it by -//! IFSelect_Act::AddFunc (name,help,myfunc); +//! XSDRAW_Activator::AddFunc (name,help,myfunc); //! for a normal function, or -//! IFSelect_Act::AddFSet (name,help,myfunc); +//! XSDRAW_Activator::AddFSet (name,help,myfunc); //! for a function which is intended to create a control item //! name and help are given as CString //! //! Then, it is available for run -class IFSelect_Act : public IFSelect_Activator +class XSDRAW_Activator : public IFSelect_Activator { - -public: - + public: //! Creates an Act with a name, help and a function //! mode (Add or AddSet) is given when recording - Standard_EXPORT IFSelect_Act(const Standard_CString name, const Standard_CString help, const IFSelect_ActFunc func); + XSDRAW_Activator(const Standard_CString name, const Standard_CString help, const XSDRAW_ActFunc func) + : thename (name) , thehelp (help) , thefunc (func) + {} //! Execution of Command Line. remark that is senseless //! because each Act brings one and only one function - Standard_EXPORT IFSelect_ReturnStatus Do (const Standard_Integer number, const Handle(IFSelect_SessionPilot)& pilot) Standard_OVERRIDE; + IFSelect_ReturnStatus Do (const Standard_Integer, const Handle(IFSelect_SessionPilot)& pilot) Standard_OVERRIDE + { return (thefunc? thefunc(pilot) : IFSelect_RetVoid); } //! Short Help for commands : returns the help given to create - Standard_EXPORT Standard_CString Help (const Standard_Integer number) const Standard_OVERRIDE; + Standard_CString Help (const Standard_Integer) const Standard_OVERRIDE + { return thehelp.ToCString(); } //! Changes the default group name for the following Acts //! group empty means to come back to default from Activator @@ -76,36 +72,19 @@ public: //! Adds a function with its name and help : creates an Act then //! records it as normal function - Standard_EXPORT static void AddFunc (const Standard_CString name, const Standard_CString help, const IFSelect_ActFunc func); + Standard_EXPORT static void AddFunc (const Standard_CString name, const Standard_CString help, const XSDRAW_ActFunc func); //! Adds a function with its name and help : creates an Act then //! records it as function for XSET (i.e. to create control item) - Standard_EXPORT static void AddFSet (const Standard_CString name, const Standard_CString help, const IFSelect_ActFunc func); - - - - - DEFINE_STANDARD_RTTIEXT(IFSelect_Act,IFSelect_Activator) - -protected: - - + Standard_EXPORT static void AddFSet (const Standard_CString name, const Standard_CString help, const XSDRAW_ActFunc func); + DEFINE_STANDARD_RTTIEXT(XSDRAW_Activator,IFSelect_Activator) -private: - + private: TCollection_AsciiString thename; TCollection_AsciiString thehelp; - IFSelect_ActFunc thefunc; - - + XSDRAW_ActFunc thefunc; }; - - - - - - -#endif // _IFSelect_Act_HeaderFile +#endif // _XSDRAW_Activator_HeaderFile diff --git a/src/XSControl/XSControl_Functions.cxx b/src/XSDRAW/XSDRAW_ControlFunctions.cxx similarity index 79% rename from src/XSControl/XSControl_Functions.cxx rename to src/XSDRAW/XSDRAW_ControlFunctions.cxx index f6a61c0afe..565f05d83c 100644 --- a/src/XSControl/XSControl_Functions.cxx +++ b/src/XSDRAW/XSDRAW_ControlFunctions.cxx @@ -12,10 +12,7 @@ // commercial license or contractual agreement. -#include -#include #include -#include #include #include #include @@ -27,16 +24,17 @@ #include #include #include -#include #include #include -#include #include -#include #include #include #include #include +#include +#include +#include +#include // ####################################################################### // ## ## @@ -53,10 +51,10 @@ static IFSelect_ReturnStatus XSControl_xinit(const Handle(IFSelect_SessionPilot) Standard_Integer argc = pilot->NbWords(); const Standard_CString arg1 = pilot->Arg(1); // **** xinit **** - if (argc > 1) return (XSControl::Session(pilot)->SelectNorm(arg1) ? + if (argc > 1) return (XSDRAW::Session(pilot)->SelectNorm(arg1) ? IFSelect_RetDone : IFSelect_RetFail); Handle(Message_Messenger) sout = Message::DefaultMessenger(); - sout<<"Selected Norm:"<SelectedNorm()<SelectedNorm()<NbWords(); const Standard_CString arg1 = pilot->Arg(1); // **** xnorm **** - Handle(XSControl_WorkSession) WS = XSControl::Session(pilot); + Handle(XSControl_WorkSession) WS = XSDRAW::Session(pilot); Handle(XSControl_Controller) control = WS->NormAdaptor(); Handle(Message_Messenger) sout = Message::DefaultMessenger(); if (argc == 1) @@ -99,7 +97,7 @@ static IFSelect_ReturnStatus XSControl_xnorm(const Handle(IFSelect_SessionPilot) static IFSelect_ReturnStatus XSControl_newmodel(const Handle(IFSelect_SessionPilot)& pilot) { // **** newmodel **** - if (!XSControl::Session(pilot)->NewModel().IsNull()) return IFSelect_RetDone; + if (!XSDRAW::Session(pilot)->NewModel().IsNull()) return IFSelect_RetDone; Handle(Message_Messenger) sout = Message::DefaultMessenger(); sout<<"No new Model produced"<Word(0).Value(2) == 'w'); - const Handle(Transfer_FinderProcess) &FP = XSControl::Session(pilot)->TransferWriter()->FinderProcess(); - const Handle(Transfer_TransientProcess) &TP = XSControl::Session(pilot)->TransferReader()->TransientProcess(); + const Handle(Transfer_FinderProcess) &FP = XSDRAW::Session(pilot)->TransferWriter()->FinderProcess(); + const Handle(Transfer_TransientProcess) &TP = XSDRAW::Session(pilot)->TransferReader()->TransientProcess(); Handle(Message_Messenger) sout = Message::DefaultMessenger(); if (modew) { if(!FP.IsNull()) FP->Clear(); else sout<<"No Transfer Write"<Clear(); else sout<<"No Transfer Read"<NbWords(); const Standard_CString arg1 = pilot->Arg(1); //const Standard_CString arg2 = pilot->Arg(2); - const Handle(Transfer_TransientProcess) &TP = XSControl::Session(pilot)->TransferReader()->TransientProcess(); + const Handle(Transfer_TransientProcess) &TP = XSDRAW::Session(pilot)->TransferReader()->TransientProcess(); Handle(Message_Messenger) sout = Message::DefaultMessenger(); if (TP.IsNull()) { sout<<"No Transfer Read"<Model() != pilot->Session()->Model()) sout<<"Model differs from the session"; Handle(TColStd_HSequenceOfTransient) list = - IFSelect_Functions::GiveList(pilot->Session(),pilot->CommandPart(2)); + XSDRAW_SelectFunctions::GiveList(pilot->Session(),pilot->CommandPart(2)); XSControl_TransferReader::PrintStatsOnList (TP,list,mod1,mod2); } else sout<<"TransferRead : not defined"<NbWords(); const Standard_CString arg1 = pilot->Arg(1); - const Handle(Transfer_TransientProcess) &TP = XSControl::Session(pilot)->TransferReader()->TransientProcess(); + const Handle(Transfer_TransientProcess) &TP = XSDRAW::Session(pilot)->TransferReader()->TransientProcess(); // **** tpent **** Handle(Message_Messenger) sout = Message::DefaultMessenger(); if (TP.IsNull()) { sout<<"No Transfer Read"<Value(num); Standard_Integer index = TP->MapIndex (ent); if (index == 0) sout<<"Entity "<PrintTransferStatus (index,Standard_False,sout); + else XSDRAW::Session(pilot)->PrintTransferStatus (index,Standard_False,sout); return IFSelect_RetVoid; } @@ -241,9 +239,8 @@ static IFSelect_ReturnStatus XSControl_tpitem(const Handle(IFSelect_SessionPilot Standard_Boolean modew = Standard_False; if (pilot->Word(0).Value(2) == 'w') modew = Standard_True; Handle(Transfer_Binder) binder; - Handle(Transfer_Finder) finder; Handle(Standard_Transient) ent; - if (!XSControl::Session(pilot)->PrintTransferStatus(num,modew,sout)) + if (!XSDRAW::Session(pilot)->PrintTransferStatus(num,modew,sout)) sout<<" - Num="<NbWords(); const Standard_CString arg1 = pilot->Arg(1); - const Handle(Transfer_TransientProcess) &TP = XSControl::Session(pilot)->TransferReader()->TransientProcess(); + const Handle(Transfer_TransientProcess) &TP = XSDRAW::Session(pilot)->TransferReader()->TransientProcess(); // **** trecord : TransferReader **** Standard_Boolean tous = (argc == 1); Standard_Integer num = -1; - const Handle(Interface_InterfaceModel) &mdl = XSControl::Session(pilot)->Model(); - const Handle(XSControl_TransferReader) &TR = XSControl::Session(pilot)->TransferReader(); + const Handle(Interface_InterfaceModel) &mdl = XSDRAW::Session(pilot)->Model(); + const Handle(XSControl_TransferReader) &TR = XSDRAW::Session(pilot)->TransferReader(); Handle(Standard_Transient) ent; Handle(Message_Messenger) sout = Message::DefaultMessenger(); if (mdl.IsNull() || TR.IsNull() || TP.IsNull()) @@ -294,7 +291,7 @@ static IFSelect_ReturnStatus XSControl_trstat(const Handle(IFSelect_SessionPilot const Standard_CString arg1 = pilot->Arg(1); Handle(Message_Messenger) sout = Message::DefaultMessenger(); // **** trstat : TransferReader **** - const Handle(XSControl_TransferReader) &TR = XSControl::Session(pilot)->TransferReader(); + const Handle(XSControl_TransferReader) &TR = XSDRAW::Session(pilot)->TransferReader(); if (TR.IsNull()) { sout<<" init not done"<Model(); if (mdl.IsNull()) { sout<<" No model"<TransferReader(); + Handle(XSControl_TransferReader) TR = XSDRAW::Session(pilot)->TransferReader(); Standard_Boolean init = TR.IsNull(); if (pilot->NbWords() > 1) { if (pilot->Arg(1)[0] == 'i') init = Standard_True; } if (init) { - XSControl::Session(pilot)->InitTransferReader (0); - TR = XSControl::Session(pilot)->TransferReader(); + XSDRAW::Session(pilot)->InitTransferReader (0); + TR = XSDRAW::Session(pilot)->TransferReader(); if (TR.IsNull()) { Handle(Message_Messenger) sout = Message::DefaultMessenger(); sout<<" init not done or failed"<Arg(1); // **** tread : TransferReader **** Handle(Message_Messenger) sout = Message::DefaultMessenger(); - const Handle(XSControl_TransferReader) &TR = XSControl::Session(pilot)->TransferReader(); + const Handle(XSControl_TransferReader) &TR = XSDRAW::Session(pilot)->TransferReader(); if (TR.IsNull()) { sout<<" init not done"<Model(); if (mdl.IsNull()) { sout<<" No model"<TransferList(list)<Session(),pilot->CommandPart(1)); + XSDRAW_SelectFunctions::GiveList(pilot->Session(),pilot->CommandPart(1)); sout<<" Transfer of "<Length()<<" entities"<TransferList(list); sout<<" Gives "< TProcess **** - const Handle(XSControl_TransferReader) &TR = XSControl::Session(pilot)->TransferReader(); + const Handle(XSControl_TransferReader) &TR = XSDRAW::Session(pilot)->TransferReader(); Handle(Message_Messenger) sout = Message::DefaultMessenger(); if (TR.IsNull()) sout<<" No TransferReader"<TransientProcess().IsNull()) sout<<" Transfer Reader without Process"< TReader **** - XSControl::Session(pilot)->InitTransferReader (3); + XSDRAW::Session(pilot)->InitTransferReader (3); return IFSelect_RetDone; } @@ -408,8 +405,8 @@ static IFSelect_ReturnStatus XSControl_twmode(const Handle(IFSelect_SessionPilot Standard_Integer argc = pilot->NbWords(); const Standard_CString arg1 = pilot->Arg(1); // **** twmode **** - Handle(XSControl_TransferWriter) TW = XSControl::Session(pilot)->TransferWriter(); - Handle(XSControl_Controller) control = XSControl::Session(pilot)->NormAdaptor(); + Handle(XSControl_TransferWriter) TW = XSDRAW::Session(pilot)->TransferWriter(); + Handle(XSControl_Controller) control = XSDRAW::Session(pilot)->NormAdaptor(); Standard_Integer modemin,modemax; Handle(Message_Messenger) sout = Message::DefaultMessenger(); if (control->ModeWriteBounds (modemin,modemax)) { @@ -433,7 +430,7 @@ static IFSelect_ReturnStatus XSControl_twmode(const Handle(IFSelect_SessionPilot //======================================================================= static IFSelect_ReturnStatus XSControl_twstat(const Handle(IFSelect_SessionPilot)& pilot) { - const Handle(Transfer_FinderProcess) &FP = XSControl::Session(pilot)->TransferWriter()->FinderProcess(); + const Handle(Transfer_FinderProcess) &FP = XSDRAW::Session(pilot)->TransferWriter()->FinderProcess(); // **** twstat **** // Pour Write Handle(Message_Messenger) sout = Message::DefaultMessenger(); @@ -452,50 +449,49 @@ static IFSelect_ReturnStatus XSControl_twstat(const Handle(IFSelect_SessionPilot static IFSelect_ReturnStatus XSControl_settransfert(const Handle(IFSelect_SessionPilot)& pilot) { // **** SelectForTransfer **** - return pilot->RecordItem(new XSControl_SelectForTransfer(XSControl::Session(pilot)->TransferReader())); + return pilot->RecordItem(new XSControl_SelectForTransfer(XSDRAW::Session(pilot)->TransferReader())); } - -static int initactor = 0; - //======================================================================= //function : Init //purpose : //======================================================================= -void XSControl_Functions::Init () +void XSDRAW_ControlFunctions::Init () { + static int initactor = 0; if (initactor) return; initactor = 1; - IFSelect_Act::SetGroup("DE: General"); - IFSelect_Act::AddFunc ("xinit","[norm:string to change norme] reinitialises according to the norm",XSControl_xinit); - IFSelect_Act::AddFunc ("xnorm","displays current norm +norm : changes it",XSControl_xnorm); + XSDRAW_Activator::SetGroup("DE: General"); + + XSDRAW_Activator::AddFunc ("xinit","[norm:string to change norme] reinitialises according to the norm",XSControl_xinit); + XSDRAW_Activator::AddFunc ("xnorm","displays current norm +norm : changes it",XSControl_xnorm); - IFSelect_Act::AddFunc ("newmodel","produces a new empty model, for the session",XSControl_newmodel); + XSDRAW_Activator::AddFunc ("newmodel","produces a new empty model, for the session",XSControl_newmodel); - IFSelect_Act::AddFunc ("tpclear","Clears TransferProcess (READ)",XSControl_tpclear); - IFSelect_Act::AddFunc ("twclear","Clears TransferProcess (WRITE)",XSControl_tpclear); + XSDRAW_Activator::AddFunc ("tpclear","Clears TransferProcess (READ)",XSControl_tpclear); + XSDRAW_Activator::AddFunc ("twclear","Clears TransferProcess (WRITE)",XSControl_tpclear); - IFSelect_Act::AddFunc ("tpstat","Statistics on TransferProcess (READ)",XSControl_tpstat); + XSDRAW_Activator::AddFunc ("tpstat","Statistics on TransferProcess (READ)",XSControl_tpstat); - IFSelect_Act::AddFunc ("tpent","[num:integer] Statistics on an entity of the model (READ)",XSControl_tpent); + XSDRAW_Activator::AddFunc ("tpent","[num:integer] Statistics on an entity of the model (READ)",XSControl_tpent); - IFSelect_Act::AddFunc ("tpitem","[num:integer] Statistics on ITEM of transfer (READ)" ,XSControl_tpitem); - IFSelect_Act::AddFunc ("tproot","[num:integer] Statistics on a ROOT of transfert (READ)" ,XSControl_tpitem); - IFSelect_Act::AddFunc ("twitem","[num:integer] Statistics on an ITEM of transfer (WRITE)" ,XSControl_tpitem); - IFSelect_Act::AddFunc ("twroot","[num:integer] Statistics on a ROOT of transfer (WRITE)",XSControl_tpitem); + XSDRAW_Activator::AddFunc ("tpitem","[num:integer] Statistics on ITEM of transfer (READ)" ,XSControl_tpitem); + XSDRAW_Activator::AddFunc ("tproot","[num:integer] Statistics on a ROOT of transfert (READ)" ,XSControl_tpitem); + XSDRAW_Activator::AddFunc ("twitem","[num:integer] Statistics on an ITEM of transfer (WRITE)" ,XSControl_tpitem); + XSDRAW_Activator::AddFunc ("twroot","[num:integer] Statistics on a ROOT of transfer (WRITE)",XSControl_tpitem); - IFSelect_Act::AddFunc ("trecord","record : all root results; or num : for entity n0.num",XSControl_trecord); - IFSelect_Act::AddFunc ("trstat","general statistics; or num : stats on entity n0 num",XSControl_trstat); - IFSelect_Act::AddFunc ("trbegin","begin-transfer-reader [init]",XSControl_trbegin); - IFSelect_Act::AddFunc ("tread","transfers all roots, or num|sel|sel num : entity list, by transfer-reader",XSControl_tread); + XSDRAW_Activator::AddFunc ("trecord","record : all root results; or num : for entity n0.num",XSControl_trecord); + XSDRAW_Activator::AddFunc ("trstat","general statistics; or num : stats on entity n0 num",XSControl_trstat); + XSDRAW_Activator::AddFunc ("trbegin","begin-transfer-reader [init]",XSControl_trbegin); + XSDRAW_Activator::AddFunc ("tread","transfers all roots, or num|sel|sel num : entity list, by transfer-reader",XSControl_tread); - IFSelect_Act::AddFunc ("trtp","feeds commands tp... with results from tr...",XSControl_trtp); - IFSelect_Act::AddFunc ("tptr","feeds tr... from tp... (may be incomplete)",XSControl_tptr); + XSDRAW_Activator::AddFunc ("trtp","feeds commands tp... with results from tr...",XSControl_trtp); + XSDRAW_Activator::AddFunc ("tptr","feeds tr... from tp... (may be incomplete)",XSControl_tptr); - IFSelect_Act::AddFunc ("twmode","displays mode transfer write, + num changes it",XSControl_twmode); - IFSelect_Act::AddFunc ("twstat","Statistics on TransferProcess (WRITE)",XSControl_twstat); + XSDRAW_Activator::AddFunc ("twmode","displays mode transfer write, + num changes it",XSControl_twmode); + XSDRAW_Activator::AddFunc ("twstat","Statistics on TransferProcess (WRITE)",XSControl_twstat); - IFSelect_Act::AddFSet ("selecttransfer","selection (recognize from transfer actor)",XSControl_settransfert); + XSDRAW_Activator::AddFSet ("selecttransfer","selection (recognize from transfer actor)",XSControl_settransfert); } diff --git a/src/XSControl/XSControl_Functions.hxx b/src/XSDRAW/XSDRAW_ControlFunctions.hxx similarity index 74% rename from src/XSControl/XSControl_Functions.hxx rename to src/XSDRAW/XSDRAW_ControlFunctions.hxx index f2d1f074f9..a607821082 100644 --- a/src/XSControl/XSControl_Functions.hxx +++ b/src/XSDRAW/XSDRAW_ControlFunctions.hxx @@ -14,17 +14,17 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#ifndef _XSControl_Functions_HeaderFile -#define _XSControl_Functions_HeaderFile +#ifndef _XSDRAW_ControlFunctions_HeaderFile +#define _XSDRAW_ControlFunctions_HeaderFile #include -//! Functions from XSControl gives access to actions which can be -//! commanded with the resources provided by XSControl: especially -//! Controller and Transfer +//! Functions from XSDRAW give access to actions which can be +//! commanded with the resources provided by XSControl: +//! especially Controller and Transfer //! //! It works by adding functions by method Init -class XSControl_Functions +class XSDRAW_ControlFunctions { public: @@ -32,4 +32,4 @@ class XSControl_Functions Standard_EXPORT static void Init(); }; -#endif // _XSControl_Functions_HeaderFile +#endif // _XSDRAW_ControlFunctions_HeaderFile diff --git a/src/XSDRAW/XSDRAW_Functions.cxx b/src/XSDRAW/XSDRAW_Functions.cxx index 0f7e96950a..bcc89c9c0a 100644 --- a/src/XSDRAW/XSDRAW_Functions.cxx +++ b/src/XSDRAW/XSDRAW_Functions.cxx @@ -12,10 +12,14 @@ // commercial license or contractual agreement. -#include #include +#include +#include +#include void XSDRAW_Functions::Init () { - XSControl_FuncShape::Init (); + XSDRAW_SelectFunctions::Init(); + XSDRAW_ControlFunctions::Init(); + XSDRAW_ShapeFunctions::Init (); } diff --git a/src/IFSelect/IFSelect_Functions.cxx b/src/XSDRAW/XSDRAW_SelectFunctions.cxx similarity index 89% rename from src/IFSelect/IFSelect_Functions.cxx rename to src/XSDRAW/XSDRAW_SelectFunctions.cxx index 73591b819a..f007a7997e 100644 --- a/src/IFSelect/IFSelect_Functions.cxx +++ b/src/XSDRAW/XSDRAW_SelectFunctions.cxx @@ -13,7 +13,6 @@ //#58 rln 28.12.98 Versioning -#include #include #include #include @@ -23,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -75,6 +73,9 @@ #include #include #include +#include +#include + #include // Decomposition of a file name in its parts : prefix, root, suffix @@ -184,7 +185,7 @@ static IFSelect_ReturnStatus fun5 Handle(Message_Messenger) sout = Message::DefaultMessenger(); if (argc < 3) { sout<<"Write Selected : give file name + givelist !"<CommandPart( 2)); + XSDRAW_SelectFunctions::GiveList (WS,pilot->CommandPart( 2)); if (result.IsNull()) { sout<<"No entity selected"<Length()<CommandPart( (mode == 'm' ? 2 : 1) )); + XSDRAW_SelectFunctions::GiveList (WS,pilot->CommandPart( (mode == 'm' ? 2 : 1) )); if (result.IsNull()) return IFSelect_RetError; Interface_EntityIterator iter (result); sout<CommandPart( (mode == 'm' ? 2 : 1) )<<" : "; @@ -713,7 +714,7 @@ static IFSelect_ReturnStatus fun20c if (argc < 2) { sout<<"Give Entity ID, or Selection Name [+ optional other selection or entity]"<EvaluateSelection(GetCasted(IFSelect_Selection,WS->NamedItem(arg1))); Handle(TColStd_HSequenceOfTransient) result = - IFSelect_Functions::GiveList (WS,pilot->CommandPart(1)); + XSDRAW_SelectFunctions::GiveList (WS,pilot->CommandPart(1)); if (result.IsNull()) return IFSelect_RetError; sout<CommandPart(1)<<" : List of "<Length()<<" Entities"<NamedItem(pilot->Arg(2))); - Handle(IFSelect_Dispatch) disp = IFSelect_Functions::GiveDispatch (WS,pilot->Arg(2),Standard_True); + Handle(IFSelect_Dispatch) disp = XSDRAW_SelectFunctions::GiveDispatch (WS,pilot->Arg(2),Standard_True); if (disp.IsNull()) { sout<<"Not a dispatch:"<Arg(2)<FinalSelection(); Handle(IFSelect_Selection) sel; if (argc > 3) { Handle(IFSelect_SelectPointed) sp = new IFSelect_SelectPointed; - Handle(TColStd_HSequenceOfTransient) list = IFSelect_Functions::GiveList + Handle(TColStd_HSequenceOfTransient) list = XSDRAW_SelectFunctions::GiveList (pilot->Session(),pilot->CommandPart(3)); Standard_Integer nb = (list.IsNull() ? 0 : list->Length()); if (nb > 0) { sp->AddList (list); sel = sp; } @@ -1485,14 +1486,14 @@ static IFSelect_ReturnStatus fun_writedisp } // DeclareAndCast(IFSelect_Dispatch,disp,WS->NamedItem(pilot->Arg(2))); - Handle(IFSelect_Dispatch) disp = IFSelect_Functions::GiveDispatch (WS,pilot->Arg(2),Standard_True); + Handle(IFSelect_Dispatch) disp = XSDRAW_SelectFunctions::GiveDispatch (WS,pilot->Arg(2),Standard_True); if (disp.IsNull()) { sout<<"Not a dispatch:"<Arg(2)<FinalSelection(); Handle(IFSelect_Selection) sel; if (argc > 3) { Handle(IFSelect_SelectPointed) sp = new IFSelect_SelectPointed; - Handle(TColStd_HSequenceOfTransient) list = IFSelect_Functions::GiveList + Handle(TColStd_HSequenceOfTransient) list = XSDRAW_SelectFunctions::GiveList (pilot->Session(),pilot->CommandPart(3)); Standard_Integer nb = (list.IsNull() ? 0 : list->Length()); if (nb > 0) { sp->AddList (list); sel = sp; } @@ -1617,7 +1618,7 @@ static IFSelect_ReturnStatus fun6465 Handle(TColStd_HSequenceOfTransient) list; Handle(IFSelect_SelectPointed) sp; if (argc > 2) { - list = IFSelect_Functions::GiveList (WS,pilot->CommandPart(2)); + list = XSDRAW_SelectFunctions::GiveList (WS,pilot->CommandPart(2)); sp = new IFSelect_SelectPointed; sp->SetList (list); } @@ -1947,7 +1948,7 @@ static IFSelect_ReturnStatus fun90 // **** SelPointed **** Handle(IFSelect_SelectPointed) sp = new IFSelect_SelectPointed; if (pilot->NbWords() > 1) { - Handle(TColStd_HSequenceOfTransient) list = IFSelect_Functions::GiveList + Handle(TColStd_HSequenceOfTransient) list = XSDRAW_SelectFunctions::GiveList (pilot->Session(),pilot->CommandPart(1)); if (list.IsNull()) return IFSelect_RetFail; Handle(Message_Messenger) sout = Message::DefaultMessenger(); @@ -2329,7 +2330,7 @@ static IFSelect_ReturnStatus fun_editload // #### FONCTIONS COMPLEMENTAIRES #### // ######################################### - Handle(Standard_Transient) IFSelect_Functions::GiveEntity + Handle(Standard_Transient) XSDRAW_SelectFunctions::GiveEntity (const Handle(IFSelect_WorkSession)& WS, const Standard_CString name) { @@ -2339,7 +2340,7 @@ static IFSelect_ReturnStatus fun_editload return ent; } - Standard_Integer IFSelect_Functions::GiveEntityNumber + Standard_Integer XSDRAW_SelectFunctions::GiveEntityNumber (const Handle(IFSelect_WorkSession)& WS, const Standard_CString name) { @@ -2355,7 +2356,7 @@ static IFSelect_ReturnStatus fun_editload return num; } - Handle(TColStd_HSequenceOfTransient) IFSelect_Functions::GiveList + Handle(TColStd_HSequenceOfTransient) XSDRAW_SelectFunctions::GiveList (const Handle(IFSelect_WorkSession)& WS, const Standard_CString first, const Standard_CString second) { @@ -2370,7 +2371,7 @@ static IFSelect_ReturnStatus fun_editload // Or a name of dispatch + a parameter : dispatch-name(param-value) // According to type of Dispatch : integer , signature name -Handle(IFSelect_Dispatch) IFSelect_Functions::GiveDispatch +Handle(IFSelect_Dispatch) XSDRAW_SelectFunctions::GiveDispatch (const Handle(IFSelect_WorkSession)& WS, const Standard_CString name, const Standard_Boolean mode) { @@ -2438,133 +2439,132 @@ Handle(IFSelect_Dispatch) IFSelect_Functions::GiveDispatch // #### INITIALISATIONS #### // ######################################### -static int initactor = 0; - - - void IFSelect_Functions::Init () +void XSDRAW_SelectFunctions::Init () { + static int initactor = 0; if (initactor) return; initactor = 1; - IFSelect_Act::SetGroup("DE: General"); - IFSelect_Act::AddFunc("xstatus","Lists XSTEP Status : Version, System Name ...",funstatus); - IFSelect_Act::AddFunc("handler","Toggle status catch Handler Error of the session",fun1); - IFSelect_Act::AddFunc("xload","file:string : Read File -> Load Model",fun3); - IFSelect_Act::AddFunc("xread","file:string : Read File -> Load Model",fun3); - IFSelect_Act::AddFunc("writeall","file:string : Write all model (no split)",fun4); - IFSelect_Act::AddFunc("writesel","file:string sel:Selection : Write Selected (no split)",fun5); - IFSelect_Act::AddFunc("writeent","file:string n1ent n2ent...:integer : Write Entite(s) (no split)",fun6); - IFSelect_Act::AddFunc("writent", "file:string n1ent n2ent...:integer : Write Entite(s) (no split)",fun6); - IFSelect_Act::AddFunc("elabel","nument:integer : Displays Label Model of an entity",fun7); - IFSelect_Act::AddFunc("enum","label:string : Displays entities n0.s of which Label Model ends by..",fun8); - - IFSelect_Act::AddFunc("listtypes","List nb entities per type. Optional selection name else all model",fun9); - IFSelect_Act::AddFunc("count","Count : counter [selection]",funcount); - IFSelect_Act::AddFunc("listcount","List Counted : counter [selection [nument]]",funcount); - IFSelect_Act::AddFunc("sumcount","Summary Counted : counter [selection [nument]]",funcount); - IFSelect_Act::AddFunc("signtype","Sign Type [newone]",funsigntype); - IFSelect_Act::AddFunc("signcase","signature : displays possible cases",funsigncase); - - IFSelect_Act::AddFunc("estatus","ent/nument : displays status of an entity",fun10); - IFSelect_Act::AddFunc("data","Data (DumpModel); whole help : data tout court",fun11); - IFSelect_Act::AddFunc("entity","give n0 ou id of entity [+ level]",fundumpent); - IFSelect_Act::AddFunc("signature","signature name + n0/ident entity",funsign); - IFSelect_Act::AddFunc("queryparent"," give 2 n0s/labels of entities : dad son",funqp); - - IFSelect_Act::AddFunc("dumpshare","Dump Share (dispatches, IntParams)",fun12); - IFSelect_Act::AddFunc("listitems","List Items [label else all] ->Type,Label[,Name]",fun13); - IFSelect_Act::AddFSet("integer","value:integer : cree un IntParam",fun14); - IFSelect_Act::AddFunc("setint","name:IntParam newValue:integer : Change valeur IntParam",fun15); - IFSelect_Act::AddFSet("text","value:string : cree un TextParam",fun16); - IFSelect_Act::AddFunc("settext","Name:TextParam newValue:string : Change valeur TextParam",fun17); - IFSelect_Act::AddFunc("dumpsel","Dump Selection suivi du Nom de la Selection a dumper",fun19); - IFSelect_Act::AddFunc("evalsel","name:Selection [num/sel] : Evalue une Selection",fun20); - IFSelect_Act::AddFunc("givelist","num/sel [num/sel ...] : Evaluates GiveList",fun20); - IFSelect_Act::AddFunc("giveshort","num/sel [num/sel ...] : GiveList in short form",fun20); - IFSelect_Act::AddFunc("givepointed","num/sel [num/sel ...] : GiveList to fill a SelectPointed",fun20); - IFSelect_Act::AddFunc("makelist","listname [givelist] : Makes a List(SelectPointed) from GiveList",fun20); - IFSelect_Act::AddFunc("givecount","num/sel [num/sel ...] : Counts GiveList",fun20c); - IFSelect_Act::AddFSet("selsuite","sel sel ... : Creates a SelectSuite",funselsuite); - IFSelect_Act::AddFunc("clearitems","Clears all items (selections, dispatches, etc)",fun21); - IFSelect_Act::AddFunc("cleardata","mode:a-g-c-p : Clears all or some data (model, check...)",fun22); - - IFSelect_Act::AddFunc("itemlabel","xxx xxx : liste items having this label",fun24); - IFSelect_Act::AddFunc("xsave","filename:string : sauve items-session",fun25); - IFSelect_Act::AddFunc("xrestore","filename:string : restaure items-session",fun26); - IFSelect_Act::AddFunc("param","nompar:string : displays parameter value; + nompar val : changes it",fun27); - IFSelect_Act::AddFunc("defparam","nompar:string : display def. param; also : nompar edit, nompar init",fun28); - - IFSelect_Act::AddFunc("sentfiles","Lists files sent from last Load",fun29); - IFSelect_Act::AddFunc("fileprefix","prefix:string : definit File Prefix",fun30); - IFSelect_Act::AddFunc("fileext","extent:string : definit File Extension",fun31); - IFSelect_Act::AddFunc("fileroot","disp:Dispatch root:string : definit File Root sur un Dispatch",fun32); - IFSelect_Act::AddFunc("filedef","defroot:string : definit File DefaultRoot",fun33); - IFSelect_Act::AddFunc("evalfile","Evaluation du FileNaming et memorisation",fun34); - IFSelect_Act::AddFunc("clearfile","Efface la liste d'EvalFile",fun35); - IFSelect_Act::AddFunc("xsplit","[disp:Dispatch sinon tout] : Split, la grande affaire !",fun36); - IFSelect_Act::AddFunc("remaining","options... : Remaining Entities, help complet par remaining ?",fun37); - IFSelect_Act::AddFunc("setcontent","sel:Selection mode:k ou r : Restreint contenu du modele",fun38); - - IFSelect_Act::AddFunc("listmodif","List Final Modifiers",fun40); - IFSelect_Act::AddFunc("dumpmodif","modif:Modifier : Affiche le Statut d'un Modifier",fun41); - IFSelect_Act::AddFunc("modifsel","modif:Modifier [sel:Selection] : Change/Annule Selection de Modifier",fun42); - IFSelect_Act::AddFunc("setapplied","modif:Modifier [name:un item sinon sortie fichier] : Applique un Modifier",fun43); - IFSelect_Act::AddFunc("resetapplied","modif:Modifier : Enleve un Modifier de la sortie fichier",fun44); - IFSelect_Act::AddFunc("modifmove","modif:Modifier M(model)/F(file) avant,apres:integer : Deplace un Modifier (sortie fichier)",fun45); - - IFSelect_Act::AddFunc("dispsel","disp:Dispatch sel:Selection -> Selection Finale de Dispatch",fun51); - IFSelect_Act::AddFSet("dispone","cree DispPerOne",fun_dispone); - IFSelect_Act::AddFSet("dispglob","cree DispGlobal",fun_dispglob); - IFSelect_Act::AddFSet("dispcount","count:IntParam : cree DispPerCount",fun_dispcount); - IFSelect_Act::AddFSet("dispfile","files:IntParam : cree DispPerFiles",fun_dispfiles); - IFSelect_Act::AddFSet("dispsign","sign:Signature : cree DispPerSignature",fun_dispsign); - IFSelect_Act::AddFunc("dumpdisp","disp:Dispatch : Affiche le Statut d'un Dispatch",fun56); - - IFSelect_Act::AddFunc("xremove","nom : Remove a Control Item de la Session",fun57); - IFSelect_Act::AddFunc("evaldisp","mode=[0-3] disp:Dispatch : Evaluates one or more Dispatch(es)",fun58); - IFSelect_Act::AddFunc("evaladisp","mode=[0-3] disp:Dispatch [givelist] : Evaluates a Dispatch (on a GiveList)",fun_evaladisp); - IFSelect_Act::AddFunc("writedisp","filepattern disp:Dispatch [givelist] : Writes Entities by Splitting by a Dispatch",fun_writedisp); - IFSelect_Act::AddFunc("evalcomplete","Evaluation Complete de la Repartition",fun59); - - IFSelect_Act::AddFunc("runcheck","affiche LastRunCheckList (write,modif)",fun60); - IFSelect_Act::AddFunc("runtranformer","transf:Transformer : Applique un Transformer",fun61); - IFSelect_Act::AddFSet("copy","cree TransformStandard, option Copy, vide",fun62); - IFSelect_Act::AddFSet("onthespot","cree TransformStandard, option OntheSpot, vide",fun63); - IFSelect_Act::AddFunc("runcopy","modif:ModelModifier [givelist] : Run via TransformStandard option Copy",fun6465); - IFSelect_Act::AddFunc("runonthespot","modif:ModelModifier [givelist] : Run via TransformStandard option OnTheSpot",fun6465); - IFSelect_Act::AddFSet("reorder","[f ou t] reordonne le modele",fun66); - - IFSelect_Act::AddFunc("toggle","sel:Selection genre Extract : Toggle Direct/Reverse",fun70); - IFSelect_Act::AddFunc("input","sel:Selection genre Deduct ou Extract input:Selection : Set Input",fun71); - IFSelect_Act::AddFSet("modelroots","cree SelectModelRoots",fun72); - IFSelect_Act::AddFSet("range","options... : cree SelectRange ...; tout court pour help",fun73); - IFSelect_Act::AddFSet("roots","cree SelectRoots (local roots)",fun74); - IFSelect_Act::AddFSet("shared","cree SelectShared",fun75); - IFSelect_Act::AddFSet("diff","[main:Selection diff:Selection] : cree SelectDiff",fun76); - IFSelect_Act::AddFunc("selmain","sel:Selection genre Control main:Selection : Set Main Input",fun77); - IFSelect_Act::AddFunc("selsecond","sel:Selection genre Control sec:Selection : Set Second Input",fun78); - IFSelect_Act::AddFSet("modelall","cree SelectModelAll",fun79); - IFSelect_Act::AddFunc("seladd","sel:Selection genre Combine input:Selection : Add Selection",fun80); - IFSelect_Act::AddFunc("selrem","sel:Selection genre Combine input:Selection : Remove Selection",fun81); - IFSelect_Act::AddFSet("number","num:IntParam : Cree SelectEntityNumber",fun82); - - IFSelect_Act::AddFSet("union","cree SelectUnion (vide), cf aussi combadd, combrem",fun83); - IFSelect_Act::AddFSet("intersect","cree SelectIntersection (vide), cf aussi combadd, combrem",fun84); - IFSelect_Act::AddFSet("typexact","type:string : cree SelectTextType Exact",fun85); - IFSelect_Act::AddFSet("errors","cree SelectErrorEntities (from file)",fun86); - IFSelect_Act::AddFSet("unknown","cree SelectUnknownEntities",fun87); - IFSelect_Act::AddFSet("sharing","cree SelectSharing",fun88); - IFSelect_Act::AddFSet("typecontain","type:string : cree SelectTextType Contains",fun89); - IFSelect_Act::AddFSet("pointed","cree SelectPointed [num/sel num/sel]",fun90); - IFSelect_Act::AddFunc("setpointed","sel:SelectPointed : edition SelectPointed. tout court pour help",fun91); - IFSelect_Act::AddFunc("setlist","sel:SelectPointed : edition SelectPointed. tout court pour help",fun91); - IFSelect_Act::AddFSet("incorrect","cree SelectIncorrectEntities (computed)",fun92); - - IFSelect_Act::AddFSet("signsel","sign:Signature|cnt:Counter text:string [e(D)|c] : cree SelectSignature",fun93); - IFSelect_Act::AddFSet("signcounter","sign:Signature : cree SignCounter",fun94); - IFSelect_Act::AddFSet("nbselected","applied:Selection : cree GraphCounter(=NbSelected)",funbselected); - - IFSelect_Act::AddFunc("editlist","editor or editform : lists defs + values",fun_editlist); - IFSelect_Act::AddFunc("editvalue","editform paramname [newval or .] : lists-changes a value",fun_editvalue); - IFSelect_Act::AddFunc("editclear","editform [paramname] : clears edition on all or one param",fun_editclear); - IFSelect_Act::AddFunc("editload","editform [entity-id] : loads from model or an entity",fun_editload); - IFSelect_Act::AddFunc("editapply","editform [keep] : applies on loaded data",fun_editapply); + + XSDRAW_Activator::SetGroup("DE: General"); + XSDRAW_Activator::AddFunc("xstatus","Lists XSTEP Status : Version, System Name ...",funstatus); + XSDRAW_Activator::AddFunc("handler","Toggle status catch Handler Error of the session",fun1); + XSDRAW_Activator::AddFunc("xload","file:string : Read File -> Load Model",fun3); + XSDRAW_Activator::AddFunc("xread","file:string : Read File -> Load Model",fun3); + XSDRAW_Activator::AddFunc("writeall","file:string : Write all model (no split)",fun4); + XSDRAW_Activator::AddFunc("writesel","file:string sel:Selection : Write Selected (no split)",fun5); + XSDRAW_Activator::AddFunc("writeent","file:string n1ent n2ent...:integer : Write Entite(s) (no split)",fun6); + XSDRAW_Activator::AddFunc("writent", "file:string n1ent n2ent...:integer : Write Entite(s) (no split)",fun6); + XSDRAW_Activator::AddFunc("elabel","nument:integer : Displays Label Model of an entity",fun7); + XSDRAW_Activator::AddFunc("enum","label:string : Displays entities n0.s of which Label Model ends by..",fun8); + + XSDRAW_Activator::AddFunc("listtypes","List nb entities per type. Optional selection name else all model",fun9); + XSDRAW_Activator::AddFunc("count","Count : counter [selection]",funcount); + XSDRAW_Activator::AddFunc("listcount","List Counted : counter [selection [nument]]",funcount); + XSDRAW_Activator::AddFunc("sumcount","Summary Counted : counter [selection [nument]]",funcount); + XSDRAW_Activator::AddFunc("signtype","Sign Type [newone]",funsigntype); + XSDRAW_Activator::AddFunc("signcase","signature : displays possible cases",funsigncase); + + XSDRAW_Activator::AddFunc("estatus","ent/nument : displays status of an entity",fun10); + XSDRAW_Activator::AddFunc("data","Data (DumpModel); whole help : data tout court",fun11); + XSDRAW_Activator::AddFunc("entity","give n0 ou id of entity [+ level]",fundumpent); + XSDRAW_Activator::AddFunc("signature","signature name + n0/ident entity",funsign); + XSDRAW_Activator::AddFunc("queryparent"," give 2 n0s/labels of entities : dad son",funqp); + + XSDRAW_Activator::AddFunc("dumpshare","Dump Share (dispatches, IntParams)",fun12); + XSDRAW_Activator::AddFunc("listitems","List Items [label else all] ->Type,Label[,Name]",fun13); + XSDRAW_Activator::AddFSet("integer","value:integer : cree un IntParam",fun14); + XSDRAW_Activator::AddFunc("setint","name:IntParam newValue:integer : Change valeur IntParam",fun15); + XSDRAW_Activator::AddFSet("text","value:string : cree un TextParam",fun16); + XSDRAW_Activator::AddFunc("settext","Name:TextParam newValue:string : Change valeur TextParam",fun17); + XSDRAW_Activator::AddFunc("dumpsel","Dump Selection suivi du Nom de la Selection a dumper",fun19); + XSDRAW_Activator::AddFunc("evalsel","name:Selection [num/sel] : Evalue une Selection",fun20); + XSDRAW_Activator::AddFunc("givelist","num/sel [num/sel ...] : Evaluates GiveList",fun20); + XSDRAW_Activator::AddFunc("giveshort","num/sel [num/sel ...] : GiveList in short form",fun20); + XSDRAW_Activator::AddFunc("givepointed","num/sel [num/sel ...] : GiveList to fill a SelectPointed",fun20); + XSDRAW_Activator::AddFunc("makelist","listname [givelist] : Makes a List(SelectPointed) from GiveList",fun20); + XSDRAW_Activator::AddFunc("givecount","num/sel [num/sel ...] : Counts GiveList",fun20c); + XSDRAW_Activator::AddFSet("selsuite","sel sel ... : Creates a SelectSuite",funselsuite); + XSDRAW_Activator::AddFunc("clearitems","Clears all items (selections, dispatches, etc)",fun21); + XSDRAW_Activator::AddFunc("cleardata","mode:a-g-c-p : Clears all or some data (model, check...)",fun22); + + XSDRAW_Activator::AddFunc("itemlabel","xxx xxx : liste items having this label",fun24); + XSDRAW_Activator::AddFunc("xsave","filename:string : sauve items-session",fun25); + XSDRAW_Activator::AddFunc("xrestore","filename:string : restaure items-session",fun26); + XSDRAW_Activator::AddFunc("param","nompar:string : displays parameter value; + nompar val : changes it",fun27); + XSDRAW_Activator::AddFunc("defparam","nompar:string : display def. param; also : nompar edit, nompar init",fun28); + + XSDRAW_Activator::AddFunc("sentfiles","Lists files sent from last Load",fun29); + XSDRAW_Activator::AddFunc("fileprefix","prefix:string : definit File Prefix",fun30); + XSDRAW_Activator::AddFunc("fileext","extent:string : definit File Extension",fun31); + XSDRAW_Activator::AddFunc("fileroot","disp:Dispatch root:string : definit File Root sur un Dispatch",fun32); + XSDRAW_Activator::AddFunc("filedef","defroot:string : definit File DefaultRoot",fun33); + XSDRAW_Activator::AddFunc("evalfile","Evaluation du FileNaming et memorisation",fun34); + XSDRAW_Activator::AddFunc("clearfile","Efface la liste d'EvalFile",fun35); + XSDRAW_Activator::AddFunc("xsplit","[disp:Dispatch sinon tout] : Split, la grande affaire !",fun36); + XSDRAW_Activator::AddFunc("remaining","options... : Remaining Entities, help complet par remaining ?",fun37); + XSDRAW_Activator::AddFunc("setcontent","sel:Selection mode:k ou r : Restreint contenu du modele",fun38); + + XSDRAW_Activator::AddFunc("listmodif","List Final Modifiers",fun40); + XSDRAW_Activator::AddFunc("dumpmodif","modif:Modifier : Affiche le Statut d'un Modifier",fun41); + XSDRAW_Activator::AddFunc("modifsel","modif:Modifier [sel:Selection] : Change/Annule Selection de Modifier",fun42); + XSDRAW_Activator::AddFunc("setapplied","modif:Modifier [name:un item sinon sortie fichier] : Applique un Modifier",fun43); + XSDRAW_Activator::AddFunc("resetapplied","modif:Modifier : Enleve un Modifier de la sortie fichier",fun44); + XSDRAW_Activator::AddFunc("modifmove","modif:Modifier M(model)/F(file) avant,apres:integer : Deplace un Modifier (sortie fichier)",fun45); + + XSDRAW_Activator::AddFunc("dispsel","disp:Dispatch sel:Selection -> Selection Finale de Dispatch",fun51); + XSDRAW_Activator::AddFSet("dispone","cree DispPerOne",fun_dispone); + XSDRAW_Activator::AddFSet("dispglob","cree DispGlobal",fun_dispglob); + XSDRAW_Activator::AddFSet("dispcount","count:IntParam : cree DispPerCount",fun_dispcount); + XSDRAW_Activator::AddFSet("dispfile","files:IntParam : cree DispPerFiles",fun_dispfiles); + XSDRAW_Activator::AddFSet("dispsign","sign:Signature : cree DispPerSignature",fun_dispsign); + XSDRAW_Activator::AddFunc("dumpdisp","disp:Dispatch : Affiche le Statut d'un Dispatch",fun56); + + XSDRAW_Activator::AddFunc("xremove","nom : Remove a Control Item de la Session",fun57); + XSDRAW_Activator::AddFunc("evaldisp","mode=[0-3] disp:Dispatch : Evaluates one or more Dispatch(es)",fun58); + XSDRAW_Activator::AddFunc("evaladisp","mode=[0-3] disp:Dispatch [givelist] : Evaluates a Dispatch (on a GiveList)",fun_evaladisp); + XSDRAW_Activator::AddFunc("writedisp","filepattern disp:Dispatch [givelist] : Writes Entities by Splitting by a Dispatch",fun_writedisp); + XSDRAW_Activator::AddFunc("evalcomplete","Evaluation Complete de la Repartition",fun59); + + XSDRAW_Activator::AddFunc("runcheck","affiche LastRunCheckList (write,modif)",fun60); + XSDRAW_Activator::AddFunc("runtranformer","transf:Transformer : Applique un Transformer",fun61); + XSDRAW_Activator::AddFSet("copy","cree TransformStandard, option Copy, vide",fun62); + XSDRAW_Activator::AddFSet("onthespot","cree TransformStandard, option OntheSpot, vide",fun63); + XSDRAW_Activator::AddFunc("runcopy","modif:ModelModifier [givelist] : Run via TransformStandard option Copy",fun6465); + XSDRAW_Activator::AddFunc("runonthespot","modif:ModelModifier [givelist] : Run via TransformStandard option OnTheSpot",fun6465); + XSDRAW_Activator::AddFSet("reorder","[f ou t] reordonne le modele",fun66); + + XSDRAW_Activator::AddFunc("toggle","sel:Selection genre Extract : Toggle Direct/Reverse",fun70); + XSDRAW_Activator::AddFunc("input","sel:Selection genre Deduct ou Extract input:Selection : Set Input",fun71); + XSDRAW_Activator::AddFSet("modelroots","cree SelectModelRoots",fun72); + XSDRAW_Activator::AddFSet("range","options... : cree SelectRange ...; tout court pour help",fun73); + XSDRAW_Activator::AddFSet("roots","cree SelectRoots (local roots)",fun74); + XSDRAW_Activator::AddFSet("shared","cree SelectShared",fun75); + XSDRAW_Activator::AddFSet("diff","[main:Selection diff:Selection] : cree SelectDiff",fun76); + XSDRAW_Activator::AddFunc("selmain","sel:Selection genre Control main:Selection : Set Main Input",fun77); + XSDRAW_Activator::AddFunc("selsecond","sel:Selection genre Control sec:Selection : Set Second Input",fun78); + XSDRAW_Activator::AddFSet("modelall","cree SelectModelAll",fun79); + XSDRAW_Activator::AddFunc("seladd","sel:Selection genre Combine input:Selection : Add Selection",fun80); + XSDRAW_Activator::AddFunc("selrem","sel:Selection genre Combine input:Selection : Remove Selection",fun81); + XSDRAW_Activator::AddFSet("number","num:IntParam : Cree SelectEntityNumber",fun82); + + XSDRAW_Activator::AddFSet("union","cree SelectUnion (vide), cf aussi combadd, combrem",fun83); + XSDRAW_Activator::AddFSet("intersect","cree SelectIntersection (vide), cf aussi combadd, combrem",fun84); + XSDRAW_Activator::AddFSet("typexact","type:string : cree SelectTextType Exact",fun85); + XSDRAW_Activator::AddFSet("errors","cree SelectErrorEntities (from file)",fun86); + XSDRAW_Activator::AddFSet("unknown","cree SelectUnknownEntities",fun87); + XSDRAW_Activator::AddFSet("sharing","cree SelectSharing",fun88); + XSDRAW_Activator::AddFSet("typecontain","type:string : cree SelectTextType Contains",fun89); + XSDRAW_Activator::AddFSet("pointed","cree SelectPointed [num/sel num/sel]",fun90); + XSDRAW_Activator::AddFunc("setpointed","sel:SelectPointed : edition SelectPointed. tout court pour help",fun91); + XSDRAW_Activator::AddFunc("setlist","sel:SelectPointed : edition SelectPointed. tout court pour help",fun91); + XSDRAW_Activator::AddFSet("incorrect","cree SelectIncorrectEntities (computed)",fun92); + + XSDRAW_Activator::AddFSet("signsel","sign:Signature|cnt:Counter text:string [e(D)|c] : cree SelectSignature",fun93); + XSDRAW_Activator::AddFSet("signcounter","sign:Signature : cree SignCounter",fun94); + XSDRAW_Activator::AddFSet("nbselected","applied:Selection : cree GraphCounter(=NbSelected)",funbselected); + + XSDRAW_Activator::AddFunc("editlist","editor or editform : lists defs + values",fun_editlist); + XSDRAW_Activator::AddFunc("editvalue","editform paramname [newval or .] : lists-changes a value",fun_editvalue); + XSDRAW_Activator::AddFunc("editclear","editform [paramname] : clears edition on all or one param",fun_editclear); + XSDRAW_Activator::AddFunc("editload","editform [entity-id] : loads from model or an entity",fun_editload); + XSDRAW_Activator::AddFunc("editapply","editform [keep] : applies on loaded data",fun_editapply); } diff --git a/src/IFSelect/IFSelect_Functions.hxx b/src/XSDRAW/XSDRAW_SelectFunctions.hxx similarity index 90% rename from src/IFSelect/IFSelect_Functions.hxx rename to src/XSDRAW/XSDRAW_SelectFunctions.hxx index 12c57a20fa..dc73e673e9 100644 --- a/src/IFSelect/IFSelect_Functions.hxx +++ b/src/XSDRAW/XSDRAW_SelectFunctions.hxx @@ -14,18 +14,14 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#ifndef _IFSelect_Functions_HeaderFile -#define _IFSelect_Functions_HeaderFile +#ifndef _XSDRAW_SelectFunctions_HeaderFile +#define _XSDRAW_SelectFunctions_HeaderFile #include #include #include -#include -#include #include -#include -class Standard_Transient; class IFSelect_WorkSession; class IFSelect_Dispatch; @@ -35,13 +31,10 @@ class IFSelect_Dispatch; //! WorkSession and various types of Selections and Dispatches //! //! It works by adding functions by method Init -class IFSelect_Functions +class XSDRAW_SelectFunctions { -public: + public: - DEFINE_STANDARD_ALLOC - - //! Takes the name of an entity, either as argument, or (if //! is empty) on keybord, and returns the entity //! name can be a label or a number (in alphanumeric), it is @@ -75,28 +68,6 @@ public: //! Defines and loads all basic functions (as ActFunc) Standard_EXPORT static void Init(); - - - - -protected: - - - - - -private: - - - - - }; - - - - - - -#endif // _IFSelect_Functions_HeaderFile +#endif // _XSDRAW_SelectFunctions_HeaderFile diff --git a/src/XSControl/XSControl_FuncShape.cxx b/src/XSDRAW/XSDRAW_ShapeFunctions.cxx similarity index 87% rename from src/XSControl/XSControl_FuncShape.cxx rename to src/XSDRAW/XSDRAW_ShapeFunctions.cxx index f0e9d98987..96adcaad1b 100644 --- a/src/XSControl/XSControl_FuncShape.cxx +++ b/src/XSDRAW/XSDRAW_ShapeFunctions.cxx @@ -14,11 +14,8 @@ #include #include -#include #include -#include #include -#include #include #include #include @@ -46,14 +43,17 @@ #include #include #include -#include #include #include -#include + #include #include #include #include +#include +#include +#include +#include #include @@ -64,7 +64,7 @@ static Handle(XSControl_Vars) GetXSControlVars (const Handle(IFSelect_SessionPilot)& pilot) { static const Handle(XSControl_Vars) avars; - Handle(XSControl_WorkSession) WS = XSControl::Session(pilot); + Handle(XSControl_WorkSession) WS = XSDRAW::Session(pilot); return (WS.IsNull()? avars : WS->Vars()); } @@ -85,7 +85,7 @@ static IFSelect_ReturnStatus XSControl_tpdraw const Standard_CString arg1 = pilot->Arg(1); const Standard_CString arg2 = pilot->Arg(2); const Standard_CString arg3 = pilot->Arg(3); - const Handle(Transfer_TransientProcess) &TP = XSControl::Session(pilot)->TransferReader()->TransientProcess(); + const Handle(Transfer_TransientProcess) &TP = XSDRAW::Session(pilot)->TransferReader()->TransientProcess(); Handle(Message_Messenger) sout = Message::DefaultMessenger(); if (TP.IsNull()) { sout<<"No Transfer Read"<NbWords(); const Standard_CString arg1 = pilot->Arg(1); - const Handle(Transfer_TransientProcess) &TP = XSControl::Session(pilot)->TransferReader()->TransientProcess(); + const Handle(Transfer_TransientProcess) &TP = XSDRAW::Session(pilot)->TransferReader()->TransientProcess(); Handle(Message_Messenger) sout = Message::DefaultMessenger(); if (TP.IsNull()) { sout<<"No Transfer Read"<Session(),pilot->CommandPart(2)); + Handle(TColStd_HSequenceOfTransient) lise = XSDRAW_SelectFunctions::GiveList(pilot->Session(),pilot->CommandPart(2)); if (lise.IsNull()) { sout<<"Not a valid entity list : "<CommandPart(2)<Length()<<" Entities, "; @@ -294,12 +294,12 @@ static IFSelect_ReturnStatus XSControl_traccess Standard_Boolean cascomp = (pilot->Word(0).Location(1,'o',1,5) > 0); Standard_Boolean cassave = (pilot->Word(0).Location(1,'s',1,5) > 0); char nomsh[100], noms[100]; - const Handle(XSControl_TransferReader) &TR = XSControl::Session(pilot)->TransferReader(); + const Handle(XSControl_TransferReader) &TR = XSDRAW::Session(pilot)->TransferReader(); Handle(Message_Messenger) sout = Message::DefaultMessenger(); if (TR.IsNull()) { sout<<" manque init"<Model(); if (mdl.IsNull()) { sout<<" modele absent"< 1 ? IFSelect_Functions::GiveEntityNumber(XSControl::Session(pilot),arg1) : 0); + Standard_Integer num = (argc > 1 ? XSDRAW_SelectFunctions::GiveEntityNumber(XSDRAW::Session(pilot),arg1) : 0); if (argc > 1) strcpy (nomsh,arg1); else strcpy (nomsh,(cascomp ? "TREAD_COMP" : "TREAD_LIST")); @@ -393,7 +393,7 @@ static IFSelect_ReturnStatus XSControl_fromshape } // IMPORT - const Handle(XSControl_TransferReader) &TR = XSControl::Session(pilot)->TransferReader(); + const Handle(XSControl_TransferReader) &TR = XSDRAW::Session(pilot)->TransferReader(); if (TR.IsNull()) { } // sout<<"No read transfer (import) recorded"<EntityFromShapeResult(subsh,submodrec); } if (!subent.IsNull()) { - sout<<" "<Model()->Number(subent); + sout<<" "<Model()->Number(subent); } } } } else { sout<<"imported from entity "; - XSControl::Session(pilot)->Model()->Print(ent,sout); - if ( silent ) sout << " in file " << XSControl::Session(pilot)->LoadedFile() << endl; + XSDRAW::Session(pilot)->Model()->Print(ent,sout); + if ( silent ) sout << " in file " << XSDRAW::Session(pilot)->LoadedFile() << endl; } if ( ! silent ) sout<TransferWriter()->FinderProcess(); + const Handle(Transfer_FinderProcess) &FP = XSDRAW::Session(pilot)->TransferWriter()->FinderProcess(); if (FP.IsNull()) { } else { yena = Standard_True; @@ -479,8 +479,8 @@ static IFSelect_ReturnStatus XSControl_fromshape if (!fnd.IsNull()) ent = FP->FindTransient (fnd); if (!ent.IsNull()) { sout<<"Shape "<Model()->Print(ent,sout); - if ( silent ) sout << " in file " << XSControl::Session(pilot)->LoadedFile(); + XSDRAW::Session(pilot)->Model()->Print(ent,sout); + if ( silent ) sout << " in file " << XSDRAW::Session(pilot)->LoadedFile(); sout<Result().Length(); if (nb > 0) sout<<"Shape "<Model()->Print( TransientListBinder->Result().Value(i), sout ); + XSDRAW::Session(pilot)->Model()->Print( TransientListBinder->Result().Value(i), sout ); if (i < nb) sout<<", "; } if (nb > 0) { - if ( silent ) sout << " in file " << XSControl::Session(pilot)->LoadedFile(); + if ( silent ) sout << " in file " << XSDRAW::Session(pilot)->LoadedFile(); sout<NbWords(); const Standard_CString arg1 = pilot->Arg(1); // **** connected entities (last transfer) **** - const Handle(XSControl_TransferReader) &TR = XSControl::Session(pilot)->TransferReader(); + const Handle(XSControl_TransferReader) &TR = XSDRAW::Session(pilot)->TransferReader(); Handle(Transfer_TransientProcess) TP; if (!TR.IsNull()) TP = TR->TransientProcess(); Handle(Message_Messenger) sout = Message::DefaultMessenger(); @@ -538,7 +538,7 @@ static IFSelect_ReturnStatus XSControl_trconnexentities XSControl_ConnectedShapes::AdjacentEntities (Shape,TP,TopAbs_FACE); Standard_Integer i, nb = list->Length(); sout<Model(); + const Handle(Interface_InterfaceModel) &model = XSDRAW::Session(pilot)->Model(); sout<<"("; for (i = 1; i <= nb; i ++) { if (i > 1) sout<<","; @@ -557,7 +557,7 @@ static IFSelect_ReturnStatus XSControl_trimport { // FileName ou . (pour courant) VarName GiveList (obligatoire) // GiveList : * pour xst-transferrable-roots - Handle(XSControl_WorkSession) WS = XSControl::Session(pilot); + Handle(XSControl_WorkSession) WS = XSDRAW::Session(pilot); Standard_Integer argc = pilot->NbWords(); Handle(Message_Messenger) sout = Message::DefaultMessenger(); @@ -572,7 +572,7 @@ static IFSelect_ReturnStatus XSControl_trimport // File Name and Variable (root) Name TCollection_AsciiString fnom,rnom; - Standard_Boolean modfic = XSControl_FuncShape::FileAndVar + Standard_Boolean modfic = XSDRAW_ShapeFunctions::FileAndVar (WS,arg1,arg2,"IMPORT",fnom,rnom); if (modfic) sout<<" File to read : "<Arg(1); // **** twrite **** Handle(Message_Messenger) sout = Message::DefaultMessenger(); - Handle(XSControl_TransferWriter) TW = XSControl::Session(pilot)->TransferWriter(); + Handle(XSControl_TransferWriter) TW = XSDRAW::Session(pilot)->TransferWriter(); if (argc < 2) { sout<<" donner nom de shape draw"<GetShape(ai); if (Shape.IsNull()) { sout<<"pas un nom de shape draw:"<TransferWriteShape (XSControl::Session(pilot)->Model(),Shape); + Standard_Integer stat = TW->TransferWriteShape (XSDRAW::Session(pilot)->Model(),Shape); sout<<" Transfer Write Status = "<Session()->ComputeGraph(); @@ -683,50 +683,40 @@ static IFSelect_ReturnStatus XSControl_twrite return IFSelect_RetDone; } -// ###################################################################### -// #### TIMERS #### -// ###################################################################### - - // ###################################################################### // #### #### // #### Initialising Commands #### // #### #### // ###################################################################### -static int initactor = 0; - - //======================================================================= //function : Init //purpose : //======================================================================= -void XSControl_FuncShape::Init () +void XSDRAW_ShapeFunctions::Init () { + static int initactor = 0; if (initactor) return; initactor = 1; - IFSelect_Act::SetGroup("DE: General"); - - IFSelect_Act::AddFunc ("tpdraw","[mode:item or root] num|* [nomvar] Passes an ITEM to Shape Draw (Start or Result)",XSControl_tpdraw); + XSDRAW_Activator::SetGroup("DE: General"); - IFSelect_Act::AddFunc ("tpcompound","name:cstring [givelist] : -> compound with Shapes Root or from givelist",XSControl_tpcompound); + XSDRAW_Activator::AddFunc ("tpdraw","[mode:item or root] num|* [nomvar] Passes an ITEM to Shape Draw (Start or Result)",XSControl_tpdraw); - IFSelect_Act::AddFunc ("trdraw","results ->DRAW : all; or num [name] : from ent.num -> DRAW [name/tread_num]",XSControl_traccess); - IFSelect_Act::AddFunc ("trsave","results ->files : all; or num [name] : from ent.num -> DRAW [name/tread_num]",XSControl_traccess); - IFSelect_Act::AddFunc ("trcomp","results -> 1 compound -> DRAW + name optional",XSControl_traccess); - IFSelect_Act::AddFunc ("trscomp","results -> 1 compound -> file + name optional",XSControl_traccess); + XSDRAW_Activator::AddFunc ("tpcompound","name:cstring [givelist] : -> compound with Shapes Root or from givelist",XSControl_tpcompound); - IFSelect_Act::AddFunc ("fromshape","shape [level=1]: imported/exported entity (when known)",XSControl_fromshape); - IFSelect_Act::AddFunc ("trconnexent","name of draw shape : entities -> connected shapes (when known)",XSControl_trconnexentities); + XSDRAW_Activator::AddFunc ("trdraw","results ->DRAW : all; or num [name] : from ent.num -> DRAW [name/tread_num]",XSControl_traccess); + XSDRAW_Activator::AddFunc ("trsave","results ->files : all; or num [name] : from ent.num -> DRAW [name/tread_num]",XSControl_traccess); + XSDRAW_Activator::AddFunc ("trcomp","results -> 1 compound -> DRAW + name optional",XSControl_traccess); + XSDRAW_Activator::AddFunc ("trscomp","results -> 1 compound -> file + name optional",XSControl_traccess); - IFSelect_Act::AddFunc ("trimport","filename or . varname givelist -> 1 shape per entity",XSControl_trimport); - IFSelect_Act::AddFunc ("trimpcomp","filename or . varname givelist -> one xcompound",XSControl_trimport); + XSDRAW_Activator::AddFunc ("fromshape","shape [level=1]: imported/exported entity (when known)",XSControl_fromshape); + XSDRAW_Activator::AddFunc ("trconnexent","name of draw shape : entities -> connected shapes (when known)",XSControl_trconnexentities); - IFSelect_Act::AddFunc ("twrite","shape : transfer write for this shape, AFTER newmodel !",XSControl_twrite); + XSDRAW_Activator::AddFunc ("trimport","filename or . varname givelist -> 1 shape per entity",XSControl_trimport); + XSDRAW_Activator::AddFunc ("trimpcomp","filename or . varname givelist -> one xcompound",XSControl_trimport); - //skl IFSelect_Act::AddFunc ("checkbrep","shapename or * [+ rootname for expurged and faulties [+ mode f-s]]",XSHAPE_checkbrep); - //skl IFSelect_Act::AddFunc ("dblist","option : clear nb index set n1 data n1 n2",XSHAPE_dblist); + XSDRAW_Activator::AddFunc ("twrite","shape : transfer write for this shape, AFTER newmodel !",XSControl_twrite); } // ###################################################################### @@ -741,7 +731,7 @@ void XSControl_FuncShape::Init () //purpose : //======================================================================= -Standard_Integer XSControl_FuncShape::MoreShapes +Standard_Integer XSDRAW_ShapeFunctions::MoreShapes (const Handle(XSControl_WorkSession)& session, Handle(TopTools_HSequenceOfShape)& list, const Standard_CString name) { @@ -799,7 +789,7 @@ Standard_Integer XSControl_FuncShape::MoreShapes //purpose : //======================================================================= -Standard_Boolean XSControl_FuncShape::FileAndVar +Standard_Boolean XSDRAW_ShapeFunctions::FileAndVar (const Handle(XSControl_WorkSession)& session, const Standard_CString file, const Standard_CString var, const Standard_CString def, diff --git a/src/XSControl/XSControl_FuncShape.hxx b/src/XSDRAW/XSDRAW_ShapeFunctions.hxx similarity index 85% rename from src/XSControl/XSControl_FuncShape.hxx rename to src/XSDRAW/XSDRAW_ShapeFunctions.hxx index 92ff8ee4fc..fb046ebfcd 100644 --- a/src/XSControl/XSControl_FuncShape.hxx +++ b/src/XSDRAW/XSDRAW_ShapeFunctions.hxx @@ -14,22 +14,18 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#ifndef _XSControl_FuncShape_HeaderFile -#define _XSControl_FuncShape_HeaderFile +#ifndef _XSDRAW_ShapeFunctions_HeaderFile +#define _XSDRAW_ShapeFunctions_HeaderFile #include -#include #include -#include #include -#include -#include class XSControl_WorkSession; class TCollection_AsciiString; -//! Defines additionnal commands for XSControl to : +//! Defines additionnal commands for XSDRAW to : //! - control of initialisation (xinit, xnorm, newmodel) //! - analyse of the result of a transfer (recorded in a //! TransientProcess for Read, FinderProcess for Write) : @@ -37,16 +33,13 @@ class TCollection_AsciiString; //! about one specific entity, producing a model with the //! abnormal result //! -//! This appendix of XSControl is compiled separately to distinguish +//! This appendix of XSDRAW is compiled separately to distinguish //! basic features from user callable forms -class XSControl_FuncShape +class XSDRAW_ShapeFunctions { -public: + public: - DEFINE_STANDARD_ALLOC - - - //! Defines and loads all functions which work on shapes for XSControl (as ActFunc) + //! Defines and loads all functions which work on shapes for XSDRAW (as ActFunc) Standard_EXPORT static void Init(); //! Analyses a name as designating Shapes from a Vars or from @@ -73,28 +66,6 @@ public: //! Else, the root part of is considered, if defined //! Else, is taken Standard_EXPORT static Standard_Boolean FileAndVar (const Handle(XSControl_WorkSession)& session, const Standard_CString file, const Standard_CString var, const Standard_CString def, TCollection_AsciiString& resfile, TCollection_AsciiString& resvar); - - - - -protected: - - - - - -private: - - - - - }; - - - - - - -#endif // _XSControl_FuncShape_HeaderFile +#endif // _XSDRAW_ShapeFunctions_HeaderFile diff --git a/src/XSDRAW/XSDRAW_Vars.cxx b/src/XSDRAW/XSDRAW_Vars.cxx index ebe95e22ac..7e2a6466d2 100644 --- a/src/XSDRAW/XSDRAW_Vars.cxx +++ b/src/XSDRAW/XSDRAW_Vars.cxx @@ -28,14 +28,10 @@ IMPLEMENT_STANDARD_RTTIEXT(XSDRAW_Vars,XSControl_Vars) -XSDRAW_Vars::XSDRAW_Vars () { } - -void XSDRAW_Vars::Set +void XSDRAW_Vars::Set (const Standard_CString name, const Handle(Standard_Transient)& val) { - //char* nam = name; -// selon type DeclareAndCast(Geom_Geometry,geom,val); if (!geom.IsNull()) { DrawTrSurf::Set(name,geom); @@ -46,61 +42,50 @@ void XSDRAW_Vars::Set DrawTrSurf::Set(name,geom); return; } -// ?? -} - -/* -Handle(Standard_Transient) XSDRAW_Vars::Get (const Standard_CString name) const -{ - Handle(Standard_Transient) val; - if (!thevars->GetItem (name,val)) val.Nullify(); - return val; } -*/ Handle(Geom_Geometry) XSDRAW_Vars::GetGeom (Standard_CString& name) const -{ //char* nam = name; +{ return DrawTrSurf::Get(name); } Handle(Geom2d_Curve) XSDRAW_Vars::GetCurve2d (Standard_CString& name) const -{ //char* nam = name; +{ return DrawTrSurf::GetCurve2d(name); } Handle(Geom_Curve) XSDRAW_Vars::GetCurve (Standard_CString& name) const -{ //char* nam = name; +{ return DrawTrSurf::GetCurve(name); } Handle(Geom_Surface) XSDRAW_Vars::GetSurface (Standard_CString& name) const -{ //char* nam = name; +{ return DrawTrSurf::GetSurface(name); } void XSDRAW_Vars::SetPoint (const Standard_CString name, const gp_Pnt& val) { - //char* nam = name; DrawTrSurf::Set (name, val); } Standard_Boolean XSDRAW_Vars::GetPoint (Standard_CString& name, gp_Pnt& pnt) const -{ //char* nam = name; - return DrawTrSurf::GetPoint (name,pnt); } +{ + return DrawTrSurf::GetPoint (name,pnt); +} void XSDRAW_Vars::SetPoint2d (const Standard_CString name, const gp_Pnt2d& val) { - //char* nam = name; DrawTrSurf::Set (name, val); } Standard_Boolean XSDRAW_Vars::GetPoint2d (Standard_CString& name, gp_Pnt2d& pnt) const { - //char* nam = name; - return DrawTrSurf::GetPoint2d (name,pnt); } + return DrawTrSurf::GetPoint2d (name,pnt); +} void XSDRAW_Vars::SetShape (const Standard_CString name, const TopoDS_Shape& val) @@ -110,6 +95,5 @@ void XSDRAW_Vars::SetShape (const Standard_CString name, const TopoDS_Shape& va TopoDS_Shape XSDRAW_Vars::GetShape (Standard_CString& name) const { - //char* nam = name; return DBRep::Get (name); } diff --git a/src/XSDRAW/XSDRAW_Vars.hxx b/src/XSDRAW/XSDRAW_Vars.hxx index c1a694745e..0b6908598d 100644 --- a/src/XSDRAW/XSDRAW_Vars.hxx +++ b/src/XSDRAW/XSDRAW_Vars.hxx @@ -21,9 +21,6 @@ #include #include -#include -#include -class Standard_Transient; class Geom_Geometry; class Geom2d_Curve; class Geom_Curve; @@ -39,12 +36,10 @@ DEFINE_STANDARD_HANDLE(XSDRAW_Vars, XSControl_Vars) //! Vars for DRAW session (i.e. DBRep and DrawTrSurf) class XSDRAW_Vars : public XSControl_Vars { - -public: - - - Standard_EXPORT XSDRAW_Vars(); + public: + XSDRAW_Vars() {} + Standard_EXPORT virtual void Set (const Standard_CString name, const Handle(Standard_Transient)& val) Standard_OVERRIDE; Standard_EXPORT virtual Handle(Geom_Geometry) GetGeom (Standard_CString& name) const Standard_OVERRIDE; @@ -67,27 +62,7 @@ public: Standard_EXPORT virtual TopoDS_Shape GetShape (Standard_CString& name) const Standard_OVERRIDE; - - - DEFINE_STANDARD_RTTIEXT(XSDRAW_Vars,XSControl_Vars) - -protected: - - - - -private: - - - - }; - - - - - - #endif // _XSDRAW_Vars_HeaderFile diff --git a/src/XSDRAWIGES/FILES b/src/XSDRAWIGES/FILES index 3b6316582a..cc35c4e801 100644 --- a/src/XSDRAWIGES/FILES +++ b/src/XSDRAWIGES/FILES @@ -1,2 +1,4 @@ XSDRAWIGES.cxx XSDRAWIGES.hxx +XSDRAWIGES_Activator.cxx +XSDRAWIGES_Activator.hxx diff --git a/src/XSDRAWIGES/XSDRAWIGES.cxx b/src/XSDRAWIGES/XSDRAWIGES.cxx index d4137a6013..055b3f8e09 100644 --- a/src/XSDRAWIGES/XSDRAWIGES.cxx +++ b/src/XSDRAWIGES/XSDRAWIGES.cxx @@ -20,8 +20,6 @@ #include #include #include -#include -#include #include #include #include @@ -30,13 +28,11 @@ #include #include #include -#include #include #include #include #include #include -#include #include #include #include @@ -54,14 +50,14 @@ #include #include #include -#include #include -#include #include #include #include #include +#include #include +#include #include // #include @@ -149,7 +145,7 @@ static Standard_Integer igesbrep (Draw_Interpretor& di, Standard_Integer argc, c di<<"spline_continuity (read) : "<ClearContext(); + thesession->TransferReader()->Context().Nullify(); XSDRAW::SetTransferProcess (thesession->TransferReader()->TransientProcess()); progress->NewScope ( 80, "Translation" ); progress->Show(); @@ -250,7 +246,7 @@ static Standard_Integer igesbrep (Draw_Interpretor& di, Standard_Integer argc, c di<<"spline_continuity (read) : "<ClearContext(); + thesession->TransferReader()->Context().Nullify(); XSDRAW::SetTransferProcess (thesession->TransferReader()->TransientProcess()); progress->NewScope ( 80, "Translation" ); progress->Show(); @@ -515,11 +511,11 @@ static Standard_Integer igesparam (Draw_Interpretor& di, Standard_Integer , cons static Standard_Integer XSDRAWIGES_tplosttrim (Draw_Interpretor& di, Standard_Integer n, const char** a) { - Handle(IFSelect_SessionPilot) pilot = XSDRAW::Pilot(); - Standard_Integer narg = n; - const Handle(Transfer_TransientProcess) &TP = XSControl::Session(pilot)->TransferReader()->TransientProcess(); + Handle(XSControl_WorkSession) WS = XSDRAW::Session(); + const Handle(Transfer_TransientProcess) &TP = WS->TransferReader()->TransientProcess(); + TColStd_Array1OfAsciiString strarg(1, 3); TColStd_Array1OfAsciiString typarg(1, 3); strarg.SetValue(1,"xst-type(CurveOnSurface)"); @@ -530,8 +526,7 @@ static Standard_Integer XSDRAWIGES_tplosttrim (Draw_Interpretor& di, Standard_In typarg.SetValue(3,"IGESSolid_Face"); if (TP.IsNull()) { di<<"No Transfer Read\n"; return 1; } Standard_Integer nbFaces = 0, totFaces = 0 ; - Handle(IFSelect_WorkSession) WS = pilot->Session(); - Transfer_IteratorOfProcessForTransient itrp = TP->AbnormalResult(); + Transfer_TransientProcess::Iterator itrp = TP->AbnormalResult(); Standard_Integer k=0; if(narg > 1) { TCollection_AsciiString Arg(a[1]); @@ -543,7 +538,7 @@ static Standard_Integer XSDRAWIGES_tplosttrim (Draw_Interpretor& di, Standard_In for(Standard_Integer j = 1 ; j <= 3; j++) { TColStd_MapOfTransient aMap; if(narg == 1) k=j; - Handle(TColStd_HSequenceOfTransient) list = IFSelect_Functions::GiveList(pilot->Session(),strarg.Value(k).ToCString()); + Handle(TColStd_HSequenceOfTransient) list = XSDRAW_SelectFunctions::GiveList(WS,strarg.Value(k).ToCString()); if (!list.IsNull()) itrp.Filter (list); else { di << "No untrimmed faces\n"; @@ -597,11 +592,11 @@ static Standard_Integer XSDRAWIGES_tplosttrim (Draw_Interpretor& di, Standard_In //-------------------------------------------------------------- static Standard_Integer XSDRAWIGES_TPSTAT(Draw_Interpretor& di,Standard_Integer n, const char** a) { - Handle(IFSelect_SessionPilot) pilot = XSDRAW::Pilot(); - Standard_Integer argc = n;//= pilot->NbWords(); - const Standard_CString arg1 = a[1];//pilot->Arg(1); - const Handle(Transfer_TransientProcess) &TP = XSControl::Session(pilot)->TransferReader()->TransientProcess(); - IGESControl_Reader read; //(XSControl::Session(pilot),Standard_False); + Standard_Integer argc = n; + const Standard_CString arg1 = a[1]; + const Handle(Transfer_TransientProcess) &TP = XSDRAW::Session()->TransferReader()->TransientProcess(); + + IGESControl_Reader read; // **** tpent **** Handle(Interface_InterfaceModel) model = TP->Model(); if (model.IsNull()) {di<<"No Transfer Read\n"; return -1;} @@ -660,13 +655,236 @@ static void cleanpilot () // //-------------------------------------------------------------- -void XSDRAWIGES::InitSelect () +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +void XSDRAWIGES::InitSelect () { - Handle(IGESSelect_Activator) igesact = new IGESSelect_Activator; + Handle(XSDRAWIGES_Activator) igesact = new XSDRAWIGES_Activator; + IGESControl_Controller::Init(); -// XSDRAW::SetNorm ("IGES"); trop tot - XSDRAW::SetController (XSControl_Controller::Recorded("iges")); + Handle(XSControl_Controller) aCntl = XSControl_Controller::Recorded("iges"); + + static int gInit = 0; + if (!gInit) { + gInit = 1; + Handle(IGESSelect_Dumper) sesdump = new IGESSelect_Dumper; // ainsi,cestfait + + aCntl->AddSessionItem (new IGESSelect_RemoveCurves(Standard_True) ,"iges-remove-pcurves"); + aCntl->AddSessionItem (new IGESSelect_RemoveCurves(Standard_False),"iges-remove-curves-3d"); + aCntl->AddSessionItem (new IGESSelect_SetLabel (0,Standard_True) ,"iges-clear-label"); + aCntl->AddSessionItem (new IGESSelect_SetLabel (1,Standard_False),"iges-set-label-dnum"); + + aCntl->AddSessionItem (new IGESSelect_AutoCorrect,"iges-auto-correct",Standard_True); + aCntl->AddSessionItem (new IGESSelect_ComputeStatus,"iges-compute-status",Standard_True); + + Handle(IGESControl_FloatFormat) flf = new IGESControl_FloatFormat; + flf->SetDefault (12); + aCntl->AddSessionItem (flf,"iges-float-digits-12",Standard_True); + + // -- Sender Product Identification -- (pas un statique ...) + Handle(IGESSelect_SetGlobalParameter) set3 = new IGESSelect_SetGlobalParameter(3); + Handle(TCollection_HAsciiString) pa3 = Interface_Static::Static("write.iges.header.product")->HStringValue(); + set3->SetValue(pa3); + aCntl->AddSessionItem (pa3, "iges-header-val-sender"); + aCntl->AddSessionItem (set3,"iges-header-set-sender",Standard_True); + + aCntl->AddSessionItem (new IGESSelect_UpdateFileName,"iges-update-file-name",Standard_True); + + // -- Receiver -- Acces par Static, ajustable + Handle(IGESSelect_SetGlobalParameter) set12 = new IGESSelect_SetGlobalParameter(12); + Handle(TCollection_HAsciiString) pa12 = Interface_Static::Static("write.iges.header.receiver")->HStringValue(); + set12->SetValue(pa12); + aCntl->AddSessionItem (pa12, "iges-header-val-receiver"); + aCntl->AddSessionItem (set12,"iges-header-set-receiver",Standard_True); + + // -- Auteur -- acces par Static (demarre par whoami), ajustable + Handle(IGESSelect_SetGlobalParameter) set21 = new IGESSelect_SetGlobalParameter(21); + Handle(TCollection_HAsciiString) pa21 = Interface_Static::Static("write.iges.header.author")->HStringValue(); + set21->SetValue(pa21); + aCntl->AddSessionItem (pa21, "iges-header-val-author"); + aCntl->AddSessionItem (set21,"iges-header-set-author",Standard_True); + + // -- Compagnie (de l auteur) -- acces par Static, ajustable + Handle(IGESSelect_SetGlobalParameter) set22 = new IGESSelect_SetGlobalParameter(22); + Handle(TCollection_HAsciiString) pa22 = Interface_Static::Static("write.iges.header.company")->HStringValue(); + set22->SetValue(pa22); + aCntl->AddSessionItem (pa22, "iges-header-val-company"); + aCntl->AddSessionItem (set22,"iges-header-set-company",Standard_True); + } + + XSDRAW::SetController (aCntl); + + Handle(XSControl_WorkSession) WS = XSDRAW::Session(); + + // --- SELECTIONS, SIGNATURES, COMPTEURS, EDITEURS + // -- BypassGroup / xst-model-roots + + // Should be already set by the above call to Customise + Handle(IFSelect_SelectModelEntities) xma; + Handle(Standard_Transient) xma1 = WS->NamedItem("xst-model-all"); + if (xma1.IsNull()) xma = new IFSelect_SelectModelEntities; + else { + xma = Handle(IFSelect_SelectModelEntities)::DownCast(xma1); + WS->AddNamedItem ("xst-model-all",xma); + } + Handle(IFSelect_SelectModelRoots) xmr; + Handle(Standard_Transient) xmr1 = WS->NamedItem("xst-model-roots"); + if (!xmr1.IsNull()) + xmr = Handle(IFSelect_SelectModelRoots)::DownCast(xmr1); + else { + xmr = new IFSelect_SelectModelRoots; + WS->AddNamedItem ("xst-model-roots",xmr); + } + + Handle(XSControl_SelectForTransfer) xtr; + Handle(Standard_Transient) xtr1 = WS->NamedItem("xst-transferrable-roots"); + if (!xtr1.IsNull()) + xtr = Handle(XSControl_SelectForTransfer)::DownCast(xtr1); + else { + xtr = new XSControl_SelectForTransfer; + xtr->SetReader (WS->TransferReader()); + WS->AddNamedItem ("xst-transferrable-roots",xtr); + } + + if (!xmr.IsNull()) { + Handle(IGESSelect_SelectVisibleStatus) visa = new IGESSelect_SelectVisibleStatus; + visa->SetInput(xmr); + WS->AddNamedItem ("iges-visible-roots",visa); + Handle(IGESSelect_SelectVisibleStatus) vist = new IGESSelect_SelectVisibleStatus; + vist->SetInput(xtr); + WS->AddNamedItem ("iges-visible-transf-roots",vist); + Handle(IGESSelect_SelectVisibleStatus) blka = new IGESSelect_SelectVisibleStatus; + blka->SetDirect (Standard_False); + blka->SetInput(xmr); + WS->AddNamedItem ("iges-blanked-roots",blka); + Handle(IGESSelect_SelectVisibleStatus) blkt = new IGESSelect_SelectVisibleStatus; + blkt->SetDirect (Standard_False); + blkt->SetInput(xtr); + WS->AddNamedItem ("iges-blanked-transf-roots",blkt); + Handle(IGESSelect_SelectSubordinate) indp = new IGESSelect_SelectSubordinate (0); + indp->SetInput (xma); + WS->AddNamedItem ("iges-status-independant",indp); + + Handle(IGESSelect_SelectBypassGroup) sb = new IGESSelect_SelectBypassGroup; + sb->SetInput(xmr); + WS->AddNamedItem ("iges-bypass-group",sb); + Handle(IGESSelect_SelectBypassSubfigure) sfi = new IGESSelect_SelectBypassSubfigure; + sfi->SetInput(xmr); + WS->AddNamedItem ("iges-bypass-subfigure",sfi); + Handle(IGESSelect_SelectBypassGroup) sfb = new IGESSelect_SelectBypassGroup; + sfb->SetInput(sfi); + WS->AddNamedItem ("iges-bypass-group-subfigure",sfb); + Handle(IGESSelect_SelectBasicGeom) sc3d = new IGESSelect_SelectBasicGeom(1); + sc3d->SetInput(sfi); + WS->AddNamedItem ("iges-curves-3d",sc3d); + Handle(IGESSelect_SelectBasicGeom) sb3d = new IGESSelect_SelectBasicGeom(2); + sb3d->SetInput(sfi); + WS->AddNamedItem ("iges-basic-curves-3d",sb3d); + Handle(IGESSelect_SelectBasicGeom) sbg = new IGESSelect_SelectBasicGeom(0); + sbg->SetInput(sfi); + WS->AddNamedItem ("iges-basic-geom",sbg); + Handle(IGESSelect_SelectBasicGeom) srf = new IGESSelect_SelectBasicGeom(-1); + srf->SetInput(sfi); + WS->AddNamedItem ("iges-surfaces",srf); + Handle(IGESSelect_SelectFaces) sfa = new IGESSelect_SelectFaces; + sfa->SetInput(sfi); + WS->AddNamedItem ("iges-faces",sfa ); + Handle(IGESSelect_SelectPCurves) spc = new IGESSelect_SelectPCurves(Standard_True); + spc->SetInput(sfa); + WS->AddNamedItem ("iges-pcurves",spc); + + Handle(IFSelect_SelectType) snosub = new IFSelect_SelectType + (STANDARD_TYPE(IGESBasic_SubfigureDef)); + snosub->SetDirect(Standard_False); + snosub->SetInput(xmr); + WS->AddNamedItem ("iges-no-indep-subfigure-def",snosub); + + Handle(IGESSelect_IGESTypeForm) itf = new IGESSelect_IGESTypeForm(Standard_True); + WS->AddNamedItem ("iges-type",itf); + + Handle(IGESSelect_SignStatus) sigst = new IGESSelect_SignStatus; + Handle(IFSelect_SignMultiple) typsta = new IFSelect_SignMultiple + ("IGES Type Form Status"); + typsta->Add (itf,15); + typsta->Add (sigst); + WS->AddNamedItem ("iges-type-status",typsta); + + Handle(IFSelect_SignMultiple) typnam = new IFSelect_SignMultiple + ("IGES Type Form TypeName"); + typnam->Add (itf,4); + typnam->Add (new IFSelect_SignType(Standard_True)); + WS->AddNamedItem ("iges-type-name",typnam); + + Handle(IFSelect_SignCounter) itfs = new IFSelect_SignCounter + (itf,Standard_False,Standard_True); + WS->AddNamedItem ("iges-types",itfs); + Handle(IGESSelect_CounterOfLevelNumber) levs = + new IGESSelect_CounterOfLevelNumber; + WS->AddNamedItem ("iges-levels",levs); + + Handle(IGESSelect_SignLevelNumber) slev = new IGESSelect_SignLevelNumber(Standard_False); + WS->AddNamedItem ("iges-level-number",slev); + Handle(IGESSelect_IGESName) igna = new IGESSelect_IGESName; + WS->AddNamedItem ("iges-name",igna); + + Handle(IGESSelect_SignColor) scol1 = new IGESSelect_SignColor (1); + WS->AddNamedItem ("iges-color-number",scol1); + Handle(IGESSelect_SignColor) scol2 = new IGESSelect_SignColor (2); + WS->AddNamedItem ("iges-color-name",scol2); + Handle(IGESSelect_SignColor) scol3 = new IGESSelect_SignColor (3); + WS->AddNamedItem ("iges-color-rgb",scol3); + Handle(IGESSelect_SignColor) scol4 = new IGESSelect_SignColor (4); + WS->AddNamedItem ("iges-color-red",scol4); + Handle(IGESSelect_SignColor) scol5 = new IGESSelect_SignColor (5); + WS->AddNamedItem ("iges-color-green",scol5); + Handle(IGESSelect_SignColor) scol6 = new IGESSelect_SignColor (6); + WS->AddNamedItem ("iges-color-blue",scol6); + + Handle(IGESSelect_EditHeader) edhead = new IGESSelect_EditHeader; + WS->AddNamedItem ("iges-header-edit",edhead); + Handle(IFSelect_EditForm) edheadf = edhead->Form(Standard_False); + WS->AddNamedItem ("iges-header",edheadf); + + Handle(IGESSelect_EditDirPart) eddirp = new IGESSelect_EditDirPart; + WS->AddNamedItem ("iges-dir-part-edit",eddirp); + Handle(IFSelect_EditForm) eddirpf = eddirp->Form(Standard_False); + WS->AddNamedItem ("iges-dir-part",eddirpf); + + WS->SetSignType( typnam ); + } + atexit (cleanpilot); } diff --git a/src/IGESSelect/IGESSelect_Activator.cxx b/src/XSDRAWIGES/XSDRAWIGES_Activator.cxx similarity index 95% rename from src/IGESSelect/IGESSelect_Activator.cxx rename to src/XSDRAWIGES/XSDRAWIGES_Activator.cxx index dcd66b485d..be370dd964 100644 --- a/src/IGESSelect/IGESSelect_Activator.cxx +++ b/src/XSDRAWIGES/XSDRAWIGES_Activator.cxx @@ -12,22 +12,22 @@ // commercial license or contractual agreement. +#include + #include #include #include #include -#include #include #include #include #include -#include #include #include #include #include #include -#include +#include #include #include #include @@ -46,7 +46,6 @@ #include #include #include -#include #include #include #include @@ -56,15 +55,13 @@ #include #include -IMPLEMENT_STANDARD_RTTIEXT(IGESSelect_Activator,IFSelect_Activator) - -static int initActivator = 0; +IMPLEMENT_STANDARD_RTTIEXT(XSDRAWIGES_Activator,IFSelect_Activator) - IGESSelect_Activator::IGESSelect_Activator () +XSDRAWIGES_Activator::XSDRAWIGES_Activator () { + static int initActivator = 0; if (initActivator) return; initActivator = 1; -// Add ( 0,"load"); -// Add ( 0,"loadiges"); // homonyme + SetForGroup ("XSTEP-IGES"); Add ( 5,"listviews"); @@ -104,15 +101,12 @@ static int initActivator = 0; } - IFSelect_ReturnStatus IGESSelect_Activator::Do - (const Standard_Integer number, - const Handle(IFSelect_SessionPilot)& pilot) +IFSelect_ReturnStatus XSDRAWIGES_Activator::Do (const Standard_Integer number, const Handle(IFSelect_SessionPilot)& pilot) { Standard_Integer argc = pilot->NbWords(); const Standard_CString arg1 = pilot->Word(1).ToCString(); const Standard_CString arg2 = pilot->Word(2).ToCString(); -// const Standard_CString arg3 = pilot->Word(3).ToCString(); - Handle(IFSelect_WorkSession) WS = pilot->Session(); + const Handle(IFSelect_WorkSession) &WS = pilot->Session(); switch (number) { @@ -281,7 +275,7 @@ static int initActivator = 0; Rmax = Atof(pilot->Word(5).ToCString()); if (Rmin <= 0 || Rmax <= 0) { cout<<"intervalle : donner reels > 0"<SetDefault(digits); else { fm->SetZeroSuppress(zerosup); @@ -391,8 +385,7 @@ static int initActivator = 0; } -Standard_CString IGESSelect_Activator::Help - (const Standard_Integer number) const +Standard_CString XSDRAWIGES_Activator::Help (const Standard_Integer number) const { switch (number) { case 5 : return "Liste Vues (tous types). Nom selection sinon tout modele"; diff --git a/src/IGESSelect/IGESSelect_Activator.hxx b/src/XSDRAWIGES/XSDRAWIGES_Activator.hxx similarity index 67% rename from src/IGESSelect/IGESSelect_Activator.hxx rename to src/XSDRAWIGES/XSDRAWIGES_Activator.hxx index c5d30954b5..711ed00e00 100644 --- a/src/IGESSelect/IGESSelect_Activator.hxx +++ b/src/XSDRAWIGES/XSDRAWIGES_Activator.hxx @@ -14,31 +14,18 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#ifndef _IGESSelect_Activator_HeaderFile -#define _IGESSelect_Activator_HeaderFile - -#include -#include +#ifndef _XSDRAWIGES_Activator_HeaderFile +#define _XSDRAWIGES_Activator_HeaderFile #include -#include -#include -#include -class IFSelect_SessionPilot; - - -class IGESSelect_Activator; -DEFINE_STANDARD_HANDLE(IGESSelect_Activator, IFSelect_Activator) //! Performs Actions specific to IGESSelect, i.e. creation of //! IGES Selections and Dispatches, plus dumping specific to IGES -class IGESSelect_Activator : public IFSelect_Activator +class XSDRAWIGES_Activator : public IFSelect_Activator { - -public: - + public: - Standard_EXPORT IGESSelect_Activator(); + Standard_EXPORT XSDRAWIGES_Activator(); //! Executes a Command Line for IGESSelect Standard_EXPORT IFSelect_ReturnStatus Do (const Standard_Integer number, const Handle(IFSelect_SessionPilot)& pilot) Standard_OVERRIDE; @@ -46,27 +33,7 @@ public: //! Sends a short help message for IGESSelect commands Standard_EXPORT Standard_CString Help (const Standard_Integer number) const Standard_OVERRIDE; - - - - DEFINE_STANDARD_RTTIEXT(IGESSelect_Activator,IFSelect_Activator) - -protected: - - - - -private: - - - - + DEFINE_STANDARD_RTTIEXT(XSDRAWIGES_Activator,IFSelect_Activator) }; - - - - - - -#endif // _IGESSelect_Activator_HeaderFile +#endif // _XSDRAWIGES_Activator_HeaderFile diff --git a/src/XSDRAWSTEP/FILES b/src/XSDRAWSTEP/FILES index 852e830812..3c390fe82e 100644 --- a/src/XSDRAWSTEP/FILES +++ b/src/XSDRAWSTEP/FILES @@ -1,2 +1,4 @@ XSDRAWSTEP.cxx XSDRAWSTEP.hxx +XSDRAWSTEP_Activator.cxx +XSDRAWSTEP_Activator.hxx diff --git a/src/XSDRAWSTEP/XSDRAWSTEP.cxx b/src/XSDRAWSTEP/XSDRAWSTEP.cxx index 0be8053d39..7c45af432e 100644 --- a/src/XSDRAWSTEP/XSDRAWSTEP.cxx +++ b/src/XSDRAWSTEP/XSDRAWSTEP.cxx @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -48,6 +47,7 @@ #include #include #include +#include #include // Pour le transfert (write) @@ -66,12 +66,212 @@ static void cleanpilot () //purpose : //======================================================================= +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +//! Returns a SignType fit for STEP (creates the first time) +static Handle(IFSelect_Signature) SignType() +{ + static Handle(StepSelect_StepType) sty; + if (!sty.IsNull()) return sty; + sty = new StepSelect_StepType; + sty->SetProtocol (StepAP214::Protocol()); + return sty; +} + +//! Creates a Selection for ShapeDefinitionRepresentation +//! By default searches among root entities +static Handle(IFSelect_SelectSignature) NewSelectSDR() +{ + Handle(IFSelect_SelectSignature) sel = new IFSelect_SelectSignature + (SignType(),"SHAPE_DEFINITION_REPRESENTATION"); + sel->SetInput (new IFSelect_SelectModelRoots); + return sel; +} + +//! Creates a Selection for Placed Items, i.e. MappedItem or +//! ContextDependentShapeRepresentation, which itself refers to a +//! RepresentationRelationship with possible subtypes (Shape... +//! and/or ...WithTransformation) +//! By default in the whole StepModel +static Handle(IFSelect_SelectSignature) NewSelectPlacedItem() +{ + Handle(IFSelect_SelectSignature) sel = new IFSelect_SelectSignature + (SignType(),"MAPPED_ITEM|CONTEXT_DEPENDENT_SHAPE_REPRESENTATION",Standard_False); + sel->SetInput (new IFSelect_SelectModelEntities); + return sel; +} + +//! Creates a Selection for ShapeRepresentation and its sub-types, +//! plus ContextDependentShapeRepresentation (which is not a +//! sub-type of ShapeRepresentation) +//! By default in the whole StepModel +static Handle(IFSelect_SelectSignature) NewSelectShapeRepr() +{ + Handle(IFSelect_SelectSignature) sel = new IFSelect_SelectSignature + (SignType(),"SHAPE_REPRESENTATION",Standard_False); + // REPRESENTATION_RELATIONSHIP passe par CONTEXT_DEPENDENT_SHAPE_REPRESENTATION + sel->SetInput (new IFSelect_SelectModelEntities); + return sel; +} + void XSDRAWSTEP::Init () { - Handle(StepSelect_Activator) stepact = new StepSelect_Activator; - if (STEPControl_Controller::Init()) // XSDRAW::SetNorm("STEP AP-214"); trop tot - XSDRAW::SetController(XSControl_Controller::Recorded("STEP")); + Handle(XSDRAWSTEP_Activator) stepact = new XSDRAWSTEP_Activator; + + STEPControl_Controller::Init(); + Handle(XSControl_Controller) aCntl = XSControl_Controller::Recorded("STEP"); + + static int gInit = 0; + if (!gInit) { + gInit = 1; + + // --- SELECTIONS, SIGNATURES, COMPTEURS, EDITEURS + DeclareAndCast(IFSelect_Selection,xmr,aCntl->SessionItem("xst-model-roots")); + if (!xmr.IsNull()) { + Handle(IFSelect_Signature) sty = SignType(); + aCntl->AddSessionItem (sty,"step-type"); + Handle(IFSelect_SignCounter) tys = new IFSelect_SignCounter(sty,Standard_False,Standard_True); + aCntl->AddSessionItem (tys,"step-types"); + + //pdn S4133 18.02.99 + aCntl->AddSessionItem (new IFSelect_SignAncestor(),"xst-derived"); + + Handle(STEPSelections_SelectDerived) stdvar = new STEPSelections_SelectDerived(); + stdvar->SetProtocol(StepAP214::Protocol()); + aCntl->AddSessionItem (stdvar,"step-derived"); + + Handle(IFSelect_SelectSignature) selsdr = NewSelectSDR(); + selsdr->SetInput (xmr); + aCntl->AddSessionItem (selsdr,"step-shape-def-repr"); + + aCntl->AddSessionItem (NewSelectPlacedItem(),"step-placed-items"); + // input deja pret avec ModelAll + aCntl->AddSessionItem (NewSelectShapeRepr(),"step-shape-repr"); + } + + //pdn + Handle(STEPSelections_SelectFaces) stfaces = new STEPSelections_SelectFaces; + stfaces->SetInput (xmr); + aCntl->AddSessionItem (stfaces,"step-faces"); + + Handle(STEPSelections_SelectInstances) stinst = new STEPSelections_SelectInstances; + aCntl->AddSessionItem (stinst,"step-instances"); + Handle(STEPSelections_SelectGSCurves) stcurves = new STEPSelections_SelectGSCurves; + stcurves->SetInput (xmr); + aCntl->AddSessionItem (stcurves,"step-GS-curves"); + + Handle(STEPSelections_SelectAssembly) assembly = new STEPSelections_SelectAssembly; + assembly->SetInput (xmr); + aCntl->AddSessionItem (assembly,"step-assembly"); + + Handle(APIHeaderSection_EditHeader) edhead = new APIHeaderSection_EditHeader; + Handle(IFSelect_EditForm) edheadf = new IFSelect_EditForm (edhead,Standard_False,Standard_True,"Step Header"); + aCntl->AddSessionItem (edhead,"step-header-edit"); + aCntl->AddSessionItem (edheadf,"step-header"); + + Handle(STEPEdit_EditContext) edctx = new STEPEdit_EditContext; + Handle(IFSelect_EditForm) edctxf = new IFSelect_EditForm (edctx,Standard_False,Standard_True,"STEP Product Definition Context"); + aCntl->AddSessionItem (edctx,"step-context-edit"); + aCntl->AddSessionItem (edctxf,"step-context"); + + Handle(STEPEdit_EditSDR) edsdr = new STEPEdit_EditSDR; + Handle(IFSelect_EditForm) edsdrf = new IFSelect_EditForm (edsdr,Standard_False,Standard_True,"STEP Product Data (SDR)"); + aCntl->AddSessionItem (edsdr,"step-SDR-edit"); + aCntl->AddSessionItem (edsdrf,"step-SDR-data"); + } + + XSDRAW::SetController(aCntl); + + Handle(XSControl_WorkSession) WS = XSDRAW::Session(); + + Handle(IFSelect_SelectModelRoots) slr; + Handle(Standard_Transient) slr1 = WS->NamedItem("xst-model-roots"); + if(!slr1.IsNull()) + slr = Handle(IFSelect_SelectModelRoots)::DownCast(slr1); + else { + slr = new IFSelect_SelectModelRoots; + WS->AddNamedItem ("xst-model-roots",slr); + } + + Handle(STEPSelections_SelectForTransfer) st1= new STEPSelections_SelectForTransfer; + st1->SetReader (WS->TransferReader()); + WS->AddNamedItem ("xst-transferrable-roots",st1); + + if (!slr.IsNull()) { + Handle(IFSelect_Signature) sty = SignType(); + WS->AddNamedItem ("step-type",sty); + + Handle(IFSelect_SignCounter) tys = new IFSelect_SignCounter(sty,Standard_False,Standard_True); + WS->AddNamedItem ("step-types",tys); + + //szv:mySignType = sty; + WS->SetSignType( sty ); + + //pdn S4133 18.02.99 + WS->AddNamedItem ("xst-derived",new IFSelect_SignAncestor()); + Handle(STEPSelections_SelectDerived) stdvar = new STEPSelections_SelectDerived(); + stdvar->SetProtocol(StepAP214::Protocol()); + WS->AddNamedItem ("step-derived",stdvar); + + Handle(IFSelect_SelectSignature) selsdr = NewSelectSDR(); + selsdr->SetInput (slr); + WS->AddNamedItem ("step-shape-def-repr",selsdr); + Handle(IFSelect_SelectSignature) selrrs = NewSelectPlacedItem(); + WS->AddNamedItem ("step-placed-items",selrrs); + Handle(IFSelect_SelectSignature) selsr = NewSelectShapeRepr(); + // input deja pret avec ModelAll + WS->AddNamedItem ("step-shape-repr",selsr); + } + + //pdn + Handle(STEPSelections_SelectFaces) stfaces = new STEPSelections_SelectFaces; + stfaces->SetInput (slr); + WS->AddNamedItem ("step-faces",stfaces); + + Handle(STEPSelections_SelectInstances) stinst = new STEPSelections_SelectInstances; + WS->AddNamedItem ("step-instances",stinst); + + Handle(STEPSelections_SelectGSCurves) stcurves = new STEPSelections_SelectGSCurves; + stcurves->SetInput (slr); + WS->AddNamedItem ("step-GS-curves",stcurves); + + Handle(STEPSelections_SelectAssembly) assembly = new STEPSelections_SelectAssembly; + assembly->SetInput (slr); + WS->AddNamedItem ("step-assembly",assembly); + + Handle(APIHeaderSection_EditHeader) edhead = new APIHeaderSection_EditHeader; + Handle(IFSelect_EditForm) edheadf = new IFSelect_EditForm (edhead,Standard_False,Standard_True,"Step Header"); + WS->AddNamedItem ("step-header-edit",edhead); + WS->AddNamedItem ("step-header",edheadf); + + Handle(STEPEdit_EditContext) edctx = new STEPEdit_EditContext; + Handle(IFSelect_EditForm) edctxf = new IFSelect_EditForm (edctx,Standard_False,Standard_True,"STEP Product Definition Context"); + WS->AddNamedItem ("step-context-edit",edctx); + WS->AddNamedItem ("step-context",edctxf); + + Handle(STEPEdit_EditSDR) edsdr = new STEPEdit_EditSDR; + Handle(IFSelect_EditForm) edsdrf = new IFSelect_EditForm (edsdr,Standard_False,Standard_True,"STEP Product Data (SDR)"); + WS->AddNamedItem ("step-SDR-edit",edsdr); + WS->AddNamedItem ("step-SDR-data",edsdrf); + atexit (cleanpilot); } diff --git a/src/StepSelect/StepSelect_Activator.cxx b/src/XSDRAWSTEP/XSDRAWSTEP_Activator.cxx similarity index 92% rename from src/StepSelect/StepSelect_Activator.cxx rename to src/XSDRAWSTEP/XSDRAWSTEP_Activator.cxx index a3087a3dad..1993480ffb 100644 --- a/src/StepSelect/StepSelect_Activator.cxx +++ b/src/XSDRAWSTEP/XSDRAWSTEP_Activator.cxx @@ -21,16 +21,14 @@ #include #include #include -#include -#include +#include +#include -IMPLEMENT_STANDARD_RTTIEXT(StepSelect_Activator,IFSelect_Activator) +IMPLEMENT_STANDARD_RTTIEXT(XSDRAWSTEP_Activator,IFSelect_Activator) -static int initActivator = 0; - - -StepSelect_Activator::StepSelect_Activator () +XSDRAWSTEP_Activator::XSDRAWSTEP_Activator () { + static int initActivator = 0; if (initActivator) return; initActivator = 1; // Add ( 0,"load"); // Add ( 0,"loadstep"); // homonyme @@ -44,7 +42,7 @@ StepSelect_Activator::StepSelect_Activator () } -IFSelect_ReturnStatus StepSelect_Activator::Do +IFSelect_ReturnStatus XSDRAWSTEP_Activator::Do (const Standard_Integer number, const Handle(IFSelect_SessionPilot)& pilot) { @@ -115,7 +113,7 @@ IFSelect_ReturnStatus StepSelect_Activator::Do Rmax = Atof(pilot->Word(5).ToCString()); if (Rmin <= 0 || Rmax <= 0) { cout<<"intervalle : donner reels > 0"<SetDefault(digits); else { fm->SetZeroSuppress(zerosup); @@ -134,7 +132,7 @@ IFSelect_ReturnStatus StepSelect_Activator::Do } -Standard_CString StepSelect_Activator::Help +Standard_CString XSDRAWSTEP_Activator::Help (const Standard_Integer number) const { switch (number) { diff --git a/src/StepSelect/StepSelect_Activator.hxx b/src/XSDRAWSTEP/XSDRAWSTEP_Activator.hxx similarity index 67% rename from src/StepSelect/StepSelect_Activator.hxx rename to src/XSDRAWSTEP/XSDRAWSTEP_Activator.hxx index c915234988..94f6a29a23 100644 --- a/src/StepSelect/StepSelect_Activator.hxx +++ b/src/XSDRAWSTEP/XSDRAWSTEP_Activator.hxx @@ -14,31 +14,18 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#ifndef _StepSelect_Activator_HeaderFile -#define _StepSelect_Activator_HeaderFile - -#include -#include +#ifndef _XSDRAWSTEP_Activator_HeaderFile +#define _XSDRAWSTEP_Activator_HeaderFile #include -#include -#include -#include -class IFSelect_SessionPilot; - - -class StepSelect_Activator; -DEFINE_STANDARD_HANDLE(StepSelect_Activator, IFSelect_Activator) //! Performs Actions specific to StepSelect, i.e. creation of //! Step Selections and Counters, plus dumping specific to Step -class StepSelect_Activator : public IFSelect_Activator +class XSDRAWSTEP_Activator : public IFSelect_Activator { + public: -public: - - - Standard_EXPORT StepSelect_Activator(); + Standard_EXPORT XSDRAWSTEP_Activator(); //! Executes a Command Line for StepSelect Standard_EXPORT IFSelect_ReturnStatus Do (const Standard_Integer number, const Handle(IFSelect_SessionPilot)& pilot) Standard_OVERRIDE; @@ -46,27 +33,7 @@ public: //! Sends a short help message for StepSelect commands Standard_EXPORT Standard_CString Help (const Standard_Integer number) const Standard_OVERRIDE; - - - - DEFINE_STANDARD_RTTIEXT(StepSelect_Activator,IFSelect_Activator) - -protected: - - - - -private: - - - - + DEFINE_STANDARD_RTTIEXT(XSDRAWSTEP_Activator,IFSelect_Activator) }; - - - - - - -#endif // _StepSelect_Activator_HeaderFile +#endif // _XSDRAWSTEP_Activator_HeaderFile -- 2.39.5