From: aba Date: Wed, 24 Jul 2013 15:38:10 +0000 (+0400) Subject: LibCtl_Library template class was corrected. Small style changes. X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=aba5fc192398c10daa01142053ac9e880fbc10a5;p=occt-copy.git LibCtl_Library template class was corrected. Small style changes. --- diff --git a/src/IGESCAFControl/IGESCAFControl_Reader.hxx b/src/IGESCAFControl/IGESCAFControl_Reader.hxx index a88ae85781..2c5a95735b 100644 --- a/src/IGESCAFControl/IGESCAFControl_Reader.hxx +++ b/src/IGESCAFControl/IGESCAFControl_Reader.hxx @@ -31,7 +31,6 @@ class XSControl_WorkSession; class TDocStd_Document; class TCollection_AsciiString; - //! Provides a tool to read IGES file and put it into
//! DECAF document. Besides transfer of shapes (including
//! assemblies) provided by IGESControl, supports also
@@ -50,24 +49,25 @@ class TCollection_AsciiString; //! Names
//! reader.SetNameMode(namemode);
//! Standard_Boolean namemode = reader.GetNameMode();
-class IGESCAFControl_Reader : public IGESControl_Reader { +class IGESCAFControl_Reader : public IGESControl_Reader +{ public: DEFINE_STANDARD_ALLOC //! Creates a reader with an empty
-//! IGES model and sets ColorMode, LayerMode and NameMode to Standard_True.
+ //! IGES model and sets ColorMode, LayerMode and NameMode to Standard_True.
Standard_EXPORT IGESCAFControl_Reader(); //! Creates a reader tool and attaches it to an already existing Session
-//! Clears the session if it was not yet set for IGES
+ //! Clears the session if it was not yet set for IGES
Standard_EXPORT IGESCAFControl_Reader(const Handle(XSControl_WorkSession)& WS,const Standard_Boolean scratch = Standard_True); //! Translates currently loaded IGES file into the document
-//! Returns True if succeeded, and False in case of fail
+ //! Returns True if succeeded, and False in case of fail
Standard_EXPORT Standard_Boolean Transfer(Handle(TDocStd_Document)& doc) ; Standard_EXPORT Standard_Boolean Perform(const TCollection_AsciiString& filename,Handle(TDocStd_Document)& doc) ; //! Translate IGES file given by filename into the document
-//! Return True if succeeded, and False in case of fail
+ //! Return True if succeeded, and False in case of fail
Standard_EXPORT Standard_Boolean Perform(const Standard_CString filename,Handle(TDocStd_Document)& doc) ; //! Set ColorMode for indicate read Colors or not.
Standard_EXPORT void SetColorMode(const Standard_Boolean colormode) ; @@ -82,41 +82,21 @@ public: Standard_EXPORT Standard_Boolean GetLayerMode() const; - - - - protected: - //! Reads colors of IGES entities and sets
-//! corresponding color assignments in the DECAF document
+ //! corresponding color assignments in the DECAF document
Standard_EXPORT Standard_Boolean ReadColors(Handle(TDocStd_Document)& doc) const; //! Reads Names of IGES entities and sets
-//! corresponding name to label with shape in the DECAF document
+ //! corresponding name to label with shape in the DECAF document
Standard_EXPORT Standard_Boolean ReadNames(Handle(TDocStd_Document)& doc) const; //! Reads layers of parts defined in the IGES model and
-//! set reference between shape and layers in the DECAF document
+ //! set reference between shape and layers in the DECAF document
Standard_EXPORT Standard_Boolean ReadLayers(Handle(TDocStd_Document)& doc) const; - - - private: - - - -Standard_Boolean myColorMode; -Standard_Boolean myNameMode; -Standard_Boolean myLayerMode; - + Standard_Boolean myColorMode; + Standard_Boolean myNameMode; + Standard_Boolean myLayerMode; }; - - - - - -// other Inline functions and methods (like "C++: function call" methods) - - #endif diff --git a/src/IGESCAFControl/IGESCAFControl_Writer.hxx b/src/IGESCAFControl/IGESCAFControl_Writer.hxx index 29c9d417b1..f15f1e596b 100644 --- a/src/IGESCAFControl/IGESCAFControl_Writer.hxx +++ b/src/IGESCAFControl/IGESCAFControl_Writer.hxx @@ -107,7 +107,7 @@ protected: private: //! Recursively iterates on subshapes and assigns colors
- //! to faces and edges (if set)
+ //! to faces and edges (if set)
Standard_EXPORT void MakeColors(const TopoDS_Shape& S,const XCAFPrs_DataMapOfShapeStyle& settings,XCAFPrs_DataMapOfStyleTransient& colors,TopTools_MapOfShape& Map,const XCAFPrs_Style& inherit) ; Standard_Boolean myColorMode; diff --git a/src/IGESControl/IGESControl_ActorWrite.cxx b/src/IGESControl/IGESControl_ActorWrite.cxx index 0759d45db1..139a36d808 100755 --- a/src/IGESControl/IGESControl_ActorWrite.cxx +++ b/src/IGESControl/IGESControl_ActorWrite.cxx @@ -70,7 +70,7 @@ Handle(Transfer_Binder) IGESControl_ActorWrite::Transfer DeclareAndCast(IGESData_IGESModel,modl,FP->Model()); if (modl.IsNull()) return NullResult(); - if (themodetrans < 0 || themodetrans > 1) return NullResult(); + if (myModeTrans < 0 || myModeTrans > 1) return NullResult(); Handle(Standard_Transient) ent; DeclareAndCast(TransferBRep_ShapeMapper,shmap,start); @@ -90,8 +90,8 @@ Handle(Transfer_Binder) IGESControl_ActorWrite::Transfer BRepToIGES_BREntity BR0; BR0.SetModel(modl); BR0.SetTransferProcess(FP); BRepToIGESBRep_Entity BR1; BR1.SetModel(modl); BR1.SetTransferProcess(FP); - if (themodetrans == 0) ent = BR0.TransferShape(shape); - if (themodetrans == 1) ent = BR1.TransferShape(shape); + if (myModeTrans == 0) ent = BR0.TransferShape(shape); + if (myModeTrans == 1) ent = BR1.TransferShape(shape); // modified by NIZHNY-EAP Tue Aug 29 11:37:18 2000 ___BEGIN___ XSAlgo::AlgoContainer()->MergeTransferInfo(FP, info); // modified by NIZHNY-EAP Tue Aug 29 11:37:25 2000 ___END___ diff --git a/src/IGESControl/IGESControl_Controller.cxx b/src/IGESControl/IGESControl_Controller.cxx index 9091a42795..3a609d3e4c 100755 --- a/src/IGESControl/IGESControl_Controller.cxx +++ b/src/IGESControl/IGESControl_Controller.cxx @@ -101,7 +101,7 @@ IGESControl_Controller::IGESControl_Controller (const Standard_Boolean mod) //JR/Hp : XSControl_Controller ((Standard_CString ) (mod ? "FNES" : "IGES") , (Standard_CString ) (mod ? "fnes" : "iges") ) , // : XSControl_Controller ( (mod ? "FNES" : "iges") , (mod ? "fnes" : "iges") ) , - themode (mod) + myMode (mod) { static Standard_Boolean init = Standard_False; if (!init) { @@ -168,7 +168,7 @@ IGESControl_Controller::IGESControl_Controller (const Standard_Boolean mod) TraceStatic ("write.iges.unit",6); TraceStatic ("write.iges.brep.mode",6); - theAdaptorLibrary = new IGESSelect_WorkLibrary(themode); + theAdaptorLibrary = new IGESSelect_WorkLibrary(myMode); theAdaptorProtocol = IGESSelect_WorkLibrary::DefineProtocol(); Handle(IGESToBRep_Actor) anactiges = new IGESToBRep_Actor; diff --git a/src/IGESControl/IGESControl_Controller.hxx b/src/IGESControl/IGESControl_Controller.hxx index 5408b1f4aa..a55d5183e7 100644 --- a/src/IGESControl/IGESControl_Controller.hxx +++ b/src/IGESControl/IGESControl_Controller.hxx @@ -42,60 +42,43 @@ class IGESControl_Controller; DEFINE_STANDARD_HANDLE(IGESControl_Controller,XSControl_Controller) //! Controller for IGES-5.1
-class IGESControl_Controller : public XSControl_Controller { +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
+ //! 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
+ //! It is taken from IGES Template Model
Standard_EXPORT Handle_Interface_InterfaceModel NewModel() const; //! Returns the Actor for Read attached to the pair (norm,appli)
-//! It is an Actor from IGESToBRep, adapted from an IGESModel :
-//! Unit, tolerances
+ //! It is an Actor from IGESToBRep, adapted from an IGESModel :
+ //! Unit, tolerances
Standard_EXPORT Handle_Transfer_ActorOfTransientProcess ActorRead(const Handle(Interface_InterfaceModel)& model) const; //! Takes one Shape and transfers it to the InterfaceModel
-//! (already created by NewModel for instance)
-//! is to be interpreted by each kind of XstepAdaptor
-//! Returns a status : 0 OK 1 No result 2 Fail -1 bad modeshape
-//! -2 bad model (requires an IGESModel)
-//! modeshape : 0 groupe of face (version < 5.1)
-//! 1 BREP-version 5.1 of IGES
+ //! (already created by NewModel for instance)
+ //! is to be interpreted by each kind of XstepAdaptor
+ //! Returns a status : 0 OK 1 No result 2 Fail -1 bad modeshape
+ //! -2 bad model (requires an IGESModel)
+ //! modeshape : 0 groupe of face (version < 5.1)
+ //! 1 BREP-version 5.1 of IGES
Standard_EXPORT virtual IFSelect_ReturnStatus TransferWriteShape(const TopoDS_Shape& shape,const Handle(Transfer_FinderProcess)& FP,const Handle(Interface_InterfaceModel)& model,const Standard_Integer modetrans = 0) const; //! Standard Initialisation. It creates a Controller for IGES and
-//! 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
+ //! 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 virtual void Customise(Handle(XSControl_WorkSession)& WS) ; - - - DEFINE_STANDARD_RTTI(IGESControl_Controller) -protected: - - - - -private: - - -Standard_Boolean themode; +private: + Standard_Boolean myMode; }; - - - - - -// other Inline functions and methods (like "C++: function call" methods) - - #endif diff --git a/src/IGESControl/IGESControl_Reader.cxx b/src/IGESControl/IGESControl_Reader.cxx index 1b70136c37..54c5a61ae6 100755 --- a/src/IGESControl/IGESControl_Reader.cxx +++ b/src/IGESControl/IGESControl_Reader.cxx @@ -72,7 +72,7 @@ IGESControl_Reader::IGESControl_Reader () IGESControl_Controller::Init(); SetWS (new XSControl_WorkSession); SetNorm("IGES"); - theReadOnlyVisible = Standard_False; + myReadOnlyVisible = Standard_False; } @@ -87,7 +87,7 @@ IGESControl_Reader::IGESControl_Reader IGESControl_Controller::Init(); SetWS (WS,scratch); SetNorm ("IGES"); - theReadOnlyVisible = Standard_False; + myReadOnlyVisible = Standard_False; } @@ -124,14 +124,14 @@ Standard_Integer IGESControl_Reader::NbRootsForTransfer() Interface_ShareFlags SH (model,protocol); // sln 11.06.2002 OCC448 - Interface_Static::SetIVal("read.iges.onlyvisible",theReadOnlyVisible); + Interface_Static::SetIVal("read.iges.onlyvisible",myReadOnlyVisible); Standard_Integer nb = model->NbEntities(); for (Standard_Integer i = 1; i <= nb; i ++) { Handle(IGESData_IGESEntity) ent = model->Entity(i); if ( SH.IsShared(ent) || ! actor->Recognize (ent) ) continue; // on ajoute un traitement pour ne prendre que les entites visibles - if ( ! theReadOnlyVisible || ent->BlankStatus() == 0 ) { + if ( ! myReadOnlyVisible || ent->BlankStatus() == 0 ) { theroots.Append(ent); } } diff --git a/src/IGESControl/IGESControl_Reader.hxx b/src/IGESControl/IGESControl_Reader.hxx index 1b092b3065..906321675b 100644 --- a/src/IGESControl/IGESControl_Reader.hxx +++ b/src/IGESControl/IGESControl_Reader.hxx @@ -69,55 +69,43 @@ class IGESData_IGESModel; //! reader.TransientProcess();
//! TopoDS_Shape shape =
//! TransferBRep::ShapeResult(reader.TransientProcess(),ent);
-class IGESControl_Reader : public XSControl_Reader { +class IGESControl_Reader : public XSControl_Reader +{ public: DEFINE_STANDARD_ALLOC //! Creates a Reader from scratch
Standard_EXPORT IGESControl_Reader(); + //! Creates a Reader from an already existing Session
- Standard_EXPORT IGESControl_Reader(const Handle(XSControl_WorkSession)& WS,const Standard_Boolean scratch = Standard_True); - //! Set the transion of ALL Roots (if theReadOnlyVisible is False)
-//! or of Visible Roots (if theReadOnlyVisible is True)
- void SetReadVisible(const Standard_Boolean ReadRoot) ; + Standard_EXPORT IGESControl_Reader(const Handle(XSControl_WorkSession)& WS, + const Standard_Boolean scratch = Standard_True); + + //! Set the transion of ALL Roots (if myReadOnlyVisible is False)
+ //! or of Visible Roots (if myReadOnlyVisible is True)
+ void SetReadVisible(const Standard_Boolean ReadRoot) ; + + Standard_Boolean GetReadVisible() const; - Standard_Boolean GetReadVisible() const; //! Returns the model as a IGESModel.
-//! It can then be consulted (header, product)
+ //! It can then be consulted (header, product)
Standard_EXPORT Handle_IGESData_IGESModel IGESModel() const; + //! Determines the list of root entities from Model which are candidate for
-//! a transfer to a Shape (type of entities is PRODUCT)
-//! is taken into account to define roots
- Standard_EXPORT virtual Standard_Integer NbRootsForTransfer() ; + //! a transfer to a Shape (type of entities is PRODUCT)
+ //! is taken into account to define roots
+ Standard_EXPORT virtual Standard_Integer NbRootsForTransfer(); + //! Prints Statistics and check list for Transfer
- Standard_EXPORT void PrintTransferInfo(const IFSelect_PrintFail failwarn,const IFSelect_PrintCount mode) const; - - - - - -protected: - - - + Standard_EXPORT void PrintTransferInfo (const IFSelect_PrintFail failwarn, + const IFSelect_PrintCount mode) const; private: - - - -Standard_Boolean theReadOnlyVisible; - - + Standard_Boolean myReadOnlyVisible; }; - #include - - -// other Inline functions and methods (like "C++: function call" methods) - - #endif diff --git a/src/IGESControl/IGESControl_Reader.lxx b/src/IGESControl/IGESControl_Reader.lxx index ca5ff2d6a7..a8f3978b41 100755 --- a/src/IGESControl/IGESControl_Reader.lxx +++ b/src/IGESControl/IGESControl_Reader.lxx @@ -23,7 +23,7 @@ inline void IGESControl_Reader::SetReadVisible (const Standard_Boolean ReadRoot) { - theReadOnlyVisible = ReadRoot; + myReadOnlyVisible = ReadRoot; } @@ -34,5 +34,5 @@ inline void IGESControl_Reader::SetReadVisible (const Standard_Boolean ReadRoot) inline Standard_Boolean IGESControl_Reader::GetReadVisible ()const { - return theReadOnlyVisible; + return myReadOnlyVisible; } diff --git a/src/IGESData/IGESData_SpecificLib.cxx b/src/IGESData/IGESData_SpecificLib.cxx index 71020fc7da..2d32ec5680 100644 --- a/src/IGESData/IGESData_SpecificLib.cxx +++ b/src/IGESData/IGESData_SpecificLib.cxx @@ -17,91 +17,14 @@ #include - - static NCollection_Handle < LibCtl_GlobalNode > - myGlobal; - - static NCollection_Handle < LibCtl_Node > - myLast; - - static Handle(IGESData_Protocol) - myProtocol; - - - void IGESData_SpecificLib::SetGlobal (const Handle(IGESData_SpecificModule)& theModule, - const Handle(IGESData_Protocol)& theProtocol) - { - if (myGlobal.IsNull()) - myGlobal = new LibCtl_IGESSpecificLib::LibCtl_GlobalNode; - myGlobal->Add(theModule,theProtocol); - } - - IGESData_SpecificLib::IGESData_SpecificLib(const Handle(IGESData_Protocol)& theProtocol) - { - Standard_Boolean last = Standard_False; - if (theProtocol.IsNull()) - return; - if (!myProtocol.IsNull()) - last = (myProtocol == theProtocol); - - if (last) - thelist = myLast; - // If no optimization available: list building - else - { - AddProtocol(theProtocol); - // This defines the optimization (for the next time) - myLast = thelist; - myProtocol = theProtocol; - } - } - - void IGESData_SpecificLib::SetComplete () - { - thelist = new LibCtl_IGESSpecificLib::LibCtl_Node; - // Take each of the protocols of the Global list - NCollection_Handle curr; - for (curr = myGlobal; !curr.IsNull(); ) - { - const Handle(IGESData_Protocol)& protocol = curr->Protocol(); - // As we take all , it is not preoccupied resources - if (!protocol.IsNull()) thelist->AddNode(curr); - curr = curr->Next(); - } - } - - void IGESData_SpecificLib::AddProtocol (const Handle(Standard_Transient)& theProtocol) - { - // Downcast as Protocol-> Resources, and even redefined to use in other - // Library must always return the type highest - Handle(IGESData_Protocol) aProtocol = Handle(IGESData_Protocol)::DownCast(theProtocol); - if (aProtocol.IsNull()) return; - - NCollection_Handle curr; - for (curr = myGlobal; !curr.IsNull(); ) - { - const Handle(IGESData_Protocol)& protocol = curr->Protocol(); - if (!protocol.IsNull()) - { - if (protocol->DynamicType() == theProtocol->DynamicType()) - { - if (thelist.IsNull()) - thelist = new LibCtl_IGESSpecificLib::LibCtl_Node; - thelist->AddNode(curr); - break; - } - } - curr = curr->Next(); - } - // Treat resources - Standard_Integer nb = aProtocol->NbResources(); - for (Standard_Integer i = 1; i <= nb; i++) - { - AddProtocol (aProtocol->Resource(i)); - } - - myProtocol.Nullify(); - myLast.Nullify(); - } +typedef LibCtl_GlobalNode + IGESData_GlobalNodeOfSpecificLib; + +template<> +Standard_EXPORT static NCollection_Handle< IGESData_GlobalNodeOfSpecificLib >& +IGESData_SpecificLib::GetGlobal() +{ + static NCollection_Handle< IGESData_GlobalNodeOfSpecificLib > aGlobal; + return aGlobal; +} diff --git a/src/IGESData/IGESData_SpecificLib.hxx b/src/IGESData/IGESData_SpecificLib.hxx index b688dd8266..38738f8642 100644 --- a/src/IGESData/IGESData_SpecificLib.hxx +++ b/src/IGESData/IGESData_SpecificLib.hxx @@ -40,40 +40,6 @@ class IGESData_Protocol; typedef LibCtl_Library - LibCtl_IGESSpecificLib; + IGESData_SpecificLib; -template <> -NCollection_Handle > -LibCtl_IGESSpecificLib::theglobal; - -template <> -Handle(IGESData_Protocol) -LibCtl_IGESSpecificLib::theprotocol; - -template <> -NCollection_Handle > -LibCtl_IGESSpecificLib::thelast; - - -class IGESData_SpecificLib : public LibCtl_IGESSpecificLib -{ -public: - DEFINE_STANDARD_ALLOC - Standard_EXPORT IGESData_SpecificLib() - : LibCtl_IGESSpecificLib () - { } - - Standard_EXPORT IGESData_SpecificLib(const Handle(IGESData_Protocol)& theProtocol); - - Standard_EXPORT void SetComplete (); - - Standard_EXPORT void AddProtocol (const Handle(Standard_Transient)& theProtocol); - - Standard_EXPORT static void SetGlobal (const Handle(IGESData_SpecificModule)& theModule, - const Handle(IGESData_Protocol)& theProtocol); - -}; - #endif \ No newline at end of file diff --git a/src/IGESData/IGESData_WriterLib.cxx b/src/IGESData/IGESData_WriterLib.cxx index 3e47c11d47..4332aced86 100644 --- a/src/IGESData/IGESData_WriterLib.cxx +++ b/src/IGESData/IGESData_WriterLib.cxx @@ -17,91 +17,14 @@ #include - - static NCollection_Handle < LibCtl_GlobalNode > - myGlobal; - - static NCollection_Handle < LibCtl_Node > - myLast; - - static Handle(IGESData_Protocol) - myProtocol; - - - void IGESData_WriterLib::SetGlobal (const Handle(IGESData_ReadWriteModule)& theModule, - const Handle(IGESData_Protocol)& theProtocol) - { - if (myGlobal.IsNull()) - myGlobal = new LibCtl_IGESWriterLib::LibCtl_GlobalNode; - myGlobal->Add(theModule,theProtocol); - } - - IGESData_WriterLib::IGESData_WriterLib(const Handle(IGESData_Protocol)& theProtocol) - { - Standard_Boolean last = Standard_False; - if (theProtocol.IsNull()) - return; - if (!myProtocol.IsNull()) - last = (myProtocol == theProtocol); - - if (last) - thelist = myLast; - // If no optimization available: list building - else - { - AddProtocol(theProtocol); - // This defines the optimization (for the next time) - myLast = thelist; - myProtocol = theProtocol; - } - } - - void IGESData_WriterLib::SetComplete () - { - thelist = new LibCtl_IGESWriterLib::LibCtl_Node; - // Take each of the protocols of the Global list - NCollection_Handle curr; - for (curr = myGlobal; !curr.IsNull(); ) - { - const Handle(IGESData_Protocol)& protocol = curr->Protocol(); - // As we take all , it is not preoccupied resources - if (!protocol.IsNull()) thelist->AddNode(curr); - curr = curr->Next(); - } - } - - void IGESData_WriterLib::AddProtocol (const Handle(Standard_Transient)& theProtocol) - { - // Downcast as Protocol-> Resources, and even redefined to use in other - // Library must always return the type highest - Handle(IGESData_Protocol) aProtocol = Handle(IGESData_Protocol)::DownCast(theProtocol); - if (aProtocol.IsNull()) return; - - NCollection_Handle curr; - for (curr = myGlobal; !curr.IsNull(); ) - { - const Handle(IGESData_Protocol)& protocol = curr->Protocol(); - if (!protocol.IsNull()) - { - if (protocol->DynamicType() == theProtocol->DynamicType()) - { - if (thelist.IsNull()) - thelist = new LibCtl_IGESWriterLib::LibCtl_Node; - thelist->AddNode(curr); - break; - } - } - curr = curr->Next(); - } - // Treat resources - Standard_Integer nb = aProtocol->NbResources(); - for (Standard_Integer i = 1; i <= nb; i++) - { - AddProtocol (aProtocol->Resource(i)); - } - - myProtocol.Nullify(); - myLast.Nullify(); - } +typedef LibCtl_GlobalNode + IGESData_GlobalNodeOfWriterLib; + +template<> +Standard_EXPORT static NCollection_Handle< IGESData_GlobalNodeOfWriterLib >& +IGESData_WriterLib::GetGlobal() +{ + static NCollection_Handle< IGESData_GlobalNodeOfWriterLib > aGlobal; + return aGlobal; +} diff --git a/src/IGESData/IGESData_WriterLib.hxx b/src/IGESData/IGESData_WriterLib.hxx index fcdfca5273..00d8b735cf 100644 --- a/src/IGESData/IGESData_WriterLib.hxx +++ b/src/IGESData/IGESData_WriterLib.hxx @@ -38,42 +38,10 @@ class IGESData_ReadWriteModule; class IGESData_Protocol; class Standard_Transient; -typedef LibCtl_Library - LibCtl_IGESWriterLib; - -//template <> -//NCollection_Handle > -//LibCtl_IGESWriterLib::theglobal; -// -//template <> -//Handle(IGESData_Protocol) -//LibCtl_IGESWriterLib::theprotocol; -// -//template <> -//NCollection_Handle > -//LibCtl_IGESWriterLib::thelast; -class IGESData_WriterLib : public LibCtl_IGESWriterLib -{ -public: - DEFINE_STANDARD_ALLOC - - Standard_EXPORT IGESData_WriterLib() - : LibCtl_IGESWriterLib () - { } - - Standard_EXPORT IGESData_WriterLib(const Handle(IGESData_Protocol)& theProtocol); - - Standard_EXPORT void SetComplete (); - - Standard_EXPORT void AddProtocol (const Handle(Standard_Transient)& theProtocol); - - Standard_EXPORT static void SetGlobal (const Handle(IGESData_ReadWriteModule)& theModule, - const Handle(IGESData_Protocol)& theProtocol); -}; +typedef LibCtl_Library + IGESData_WriterLib; #endif diff --git a/src/Interface/Interface_GeneralLib.cxx b/src/Interface/Interface_GeneralLib.cxx index c46097a13b..f0c5964fc7 100644 --- a/src/Interface/Interface_GeneralLib.cxx +++ b/src/Interface/Interface_GeneralLib.cxx @@ -17,91 +17,14 @@ #include - - static NCollection_Handle < LibCtl_GlobalNode > - myGlobal; - - static NCollection_Handle < LibCtl_Node > - myLast; - - static Handle(Interface_Protocol) - myProtocol; - - - void Interface_GeneralLib::SetGlobal (const Handle(Interface_GeneralModule)& theModule, - const Handle(Interface_Protocol)& theProtocol) - { - if (myGlobal.IsNull()) - myGlobal = new LibCtl_GeneralLib::LibCtl_GlobalNode; - myGlobal->Add(theModule,theProtocol); - } - - Interface_GeneralLib::Interface_GeneralLib(const Handle(Interface_Protocol)& theProtocol) - { - Standard_Boolean last = Standard_False; - if (theProtocol.IsNull()) - return; - if (!myProtocol.IsNull()) - last = (myProtocol == theProtocol); - - if (last) - thelist = myLast; - // If no optimization available: list building - else - { - AddProtocol(theProtocol); - // This defines the optimization (for the next time) - myLast = thelist; - myProtocol = theProtocol; - } - } - - void Interface_GeneralLib::SetComplete () - { - thelist = new LibCtl_GeneralLib::LibCtl_Node; - // Take each of the protocols of the Global list - NCollection_Handle curr; - for (curr = myGlobal; !curr.IsNull(); ) - { - const Handle(Interface_Protocol)& protocol = curr->Protocol(); - // As we take all , it is not preoccupied resources - if (!protocol.IsNull()) thelist->AddNode(curr); - curr = curr->Next(); - } - } - - void Interface_GeneralLib::AddProtocol (const Handle(Standard_Transient)& theProtocol) - { - // Downcast as Protocol-> Resources, and even redefined to use in other - // Library must always return the type highest - Handle(Interface_Protocol) aProtocol = Handle(Interface_Protocol)::DownCast(theProtocol); - if (aProtocol.IsNull()) return; - - NCollection_Handle curr; - for (curr = myGlobal; !curr.IsNull(); ) - { - const Handle(Interface_Protocol)& protocol = curr->Protocol(); - if (!protocol.IsNull()) - { - if (protocol->DynamicType() == theProtocol->DynamicType()) - { - if (thelist.IsNull()) - thelist = new LibCtl_GeneralLib::LibCtl_Node; - thelist->AddNode(curr); - break; - } - } - curr = curr->Next(); - } - // Treat resources - Standard_Integer nb = aProtocol->NbResources(); - for (Standard_Integer i = 1; i <= nb; i++) - { - AddProtocol (aProtocol->Resource(i)); - } - - myProtocol.Nullify(); - myLast.Nullify(); - } +typedef LibCtl_GlobalNode + Interface_GlobalNodeOfGeneralLib; + +template<> +Standard_EXPORT static NCollection_Handle< Interface_GlobalNodeOfGeneralLib >& +Interface_GeneralLib::GetGlobal() +{ + static NCollection_Handle< Interface_GlobalNodeOfGeneralLib > aGlobal; + return aGlobal; +} diff --git a/src/Interface/Interface_GeneralLib.hxx b/src/Interface/Interface_GeneralLib.hxx index 2e00854867..18fafd99d6 100644 --- a/src/Interface/Interface_GeneralLib.hxx +++ b/src/Interface/Interface_GeneralLib.hxx @@ -40,58 +40,6 @@ class Interface_Protocol; typedef LibCtl_Library - LibCtl_GeneralLib; - -//template <> -//NCollection_Handle > -//LibCtl_GeneralLib::theglobal; -// -//template <> -//Handle(Interface_Protocol) -//LibCtl_GeneralLib::theprotocol; -// -//template <> -//NCollection_Handle > -//LibCtl_GeneralLib::thelast; - -class Interface_GeneralLib : public LibCtl_GeneralLib -{ -public: - DEFINE_STANDARD_ALLOC - Standard_EXPORT Interface_GeneralLib() - : LibCtl_GeneralLib () - { } - - Standard_EXPORT Interface_GeneralLib(const Handle(Interface_Protocol)& theProtocol); - - Standard_EXPORT const Handle(Interface_Protocol)& Protocol () const - {return LibCtl_GeneralLib::Protocol();} - - Standard_EXPORT const Handle(Interface_GeneralModule)& Module () const - {return LibCtl_GeneralLib::Module();} - - Standard_EXPORT void Next () - { LibCtl_GeneralLib::Next();} - - Standard_EXPORT Standard_Boolean More () const - {return LibCtl_GeneralLib::More();} - - Standard_EXPORT void Start () - { LibCtl_GeneralLib::Start();} - - Standard_EXPORT Standard_Boolean Select (const Handle(Standard_Transient)& obj, - Handle(Interface_GeneralModule)& module, - Standard_Integer& CN) const - {return LibCtl_GeneralLib::Select(obj,module,CN);} - - Standard_EXPORT void SetComplete (); - - Standard_EXPORT void AddProtocol (const Handle(Standard_Transient)& theProtocol); - - Standard_EXPORT static void SetGlobal (const Handle(Interface_GeneralModule)& theModule, - const Handle(Interface_Protocol)& theProtocol); -}; + Interface_GeneralLib; #endif diff --git a/src/Interface/Interface_ReaderLib.cxx b/src/Interface/Interface_ReaderLib.cxx index 35372d2de5..91fb618c4b 100644 --- a/src/Interface/Interface_ReaderLib.cxx +++ b/src/Interface/Interface_ReaderLib.cxx @@ -17,91 +17,14 @@ #include - - static NCollection_Handle < LibCtl_GlobalNode > - myGlobal; - - static NCollection_Handle < LibCtl_Node > - myLast; - - static Handle(Interface_Protocol) - myProtocol; - - - void Interface_ReaderLib::SetGlobal (const Handle(Interface_ReaderModule)& theModule, - const Handle(Interface_Protocol)& theProtocol) - { - if (myGlobal.IsNull()) - myGlobal = new LibCtl_ReaderLib::LibCtl_GlobalNode; - myGlobal->Add(theModule,theProtocol); - } - - Interface_ReaderLib::Interface_ReaderLib(const Handle(Interface_Protocol)& theProtocol) - { - Standard_Boolean last = Standard_False; - if (theProtocol.IsNull()) - return; - if (!myProtocol.IsNull()) - last = (myProtocol == theProtocol); - - if (last) - thelist = myLast; - // If no optimization available: list building - else - { - AddProtocol(theProtocol); - // This defines the optimization (for the next time) - myLast = thelist; - myProtocol = theProtocol; - } - } - - void Interface_ReaderLib::SetComplete () - { - thelist = new LibCtl_ReaderLib::LibCtl_Node; - // Take each of the protocols of the Global list - NCollection_Handle curr; - for (curr = myGlobal; !curr.IsNull(); ) - { - const Handle(Interface_Protocol)& protocol = curr->Protocol(); - // As we take all , it is not preoccupied resources - if (!protocol.IsNull()) thelist->AddNode(curr); - curr = curr->Next(); - } - } - - void Interface_ReaderLib::AddProtocol (const Handle(Standard_Transient)& theProtocol) - { - // Downcast as Protocol-> Resources, and even redefined to use in other - // Library must always return the type highest - Handle(Interface_Protocol) aProtocol = Handle(Interface_Protocol)::DownCast(theProtocol); - if (aProtocol.IsNull()) return; - - NCollection_Handle curr; - for (curr = myGlobal; !curr.IsNull(); ) - { - const Handle(Interface_Protocol)& protocol = curr->Protocol(); - if (!protocol.IsNull()) - { - if (protocol->DynamicType() == theProtocol->DynamicType()) - { - if (thelist.IsNull()) - thelist = new LibCtl_ReaderLib::LibCtl_Node; - thelist->AddNode(curr); - break; - } - } - curr = curr->Next(); - } - // Treat resources - Standard_Integer nb = aProtocol->NbResources(); - for (Standard_Integer i = 1; i <= nb; i++) - { - AddProtocol (aProtocol->Resource(i)); - } - - myProtocol.Nullify(); - myLast.Nullify(); - } +typedef LibCtl_GlobalNode + Interface_GlobalNodeOfReaderLib; + +template<> +Standard_EXPORT static NCollection_Handle< Interface_GlobalNodeOfReaderLib >& +Interface_ReaderLib::GetGlobal() +{ + static NCollection_Handle< Interface_GlobalNodeOfReaderLib > aGlobal; + return aGlobal; +} diff --git a/src/Interface/Interface_ReaderLib.hxx b/src/Interface/Interface_ReaderLib.hxx index 3b03a25a33..61bd0f5826 100644 --- a/src/Interface/Interface_ReaderLib.hxx +++ b/src/Interface/Interface_ReaderLib.hxx @@ -36,39 +36,6 @@ class Standard_NoSuchObject; typedef LibCtl_Library - LibCtl_ReaderLib; - -//template <> -//NCollection_Handle > -//LibCtl_ReaderLib::theglobal; -// -//template <> -//Handle(Interface_Protocol) -//LibCtl_ReaderLib::theprotocol; -// -//template <> -//NCollection_Handle > -//LibCtl_ReaderLib::thelast; - -// Library -class Interface_ReaderLib : public LibCtl_ReaderLib -{ -public: - DEFINE_STANDARD_ALLOC - Standard_EXPORT Interface_ReaderLib() - : LibCtl_ReaderLib () - { } - - Standard_EXPORT Interface_ReaderLib(const Handle(Interface_Protocol)& theProtocol); - - Standard_EXPORT void SetComplete (); - - Standard_EXPORT void AddProtocol (const Handle(Standard_Transient)& theProtocol); - - Standard_EXPORT static void SetGlobal (const Handle(Interface_ReaderModule)& theModule, - const Handle(Interface_Protocol)& theProtocol); -}; + Interface_ReaderLib; #endif \ No newline at end of file diff --git a/src/LibCtl/LibCtl_Library.hxx b/src/LibCtl/LibCtl_Library.hxx index 928399a9da..3e18cf2ffb 100644 --- a/src/LibCtl/LibCtl_Library.hxx +++ b/src/LibCtl/LibCtl_Library.hxx @@ -18,28 +18,28 @@ #ifndef _LibCtl_Library_HeaderFile #define _LibCtl_Library_HeaderFile +#include +#include #include #include -template class LibCtl_GlobalNode; +template class LibCtl_GlobalNode; - -// Node for LibCtl_Library //! Manages a list of Modules for a Library (as an instance) : -//! Designates a GlobalNode (couple Module-Protocol) -template +//! Designates a GlobalNode (couple Module-Protocol) +template class LibCtl_Node { private: typedef LibCtl_GlobalNode LibCtl_GlobalNode; - NCollection_Handle < LibCtl_GlobalNode > thenode; - NCollection_Handle < LibCtl_Node > thenext; + NCollection_Handle < LibCtl_GlobalNode > myNode; + NCollection_Handle < LibCtl_Node > myNext; public: Standard_EXPORT LibCtl_Node (); - Standard_EXPORT void AddNode (const NCollection_Handle< LibCtl_GlobalNode >& anode); + Standard_EXPORT void AddNode (const NCollection_Handle< LibCtl_GlobalNode >& theNode); Standard_EXPORT const ModuleType& Module () const; Standard_EXPORT const ProtocolType& Protocol () const; Standard_EXPORT const NCollection_Handle< LibCtl_Node >& Next () const; @@ -53,31 +53,31 @@ LibCtl_Node //! Adds a couple (Module,Protocol), that is, stores it into //! itself if not yet done, else creates a Next Node to do it. template -void LibCtl_Node::AddNode (const NCollection_Handle< LibCtl_GlobalNode >& anode) +void LibCtl_Node::AddNode (const NCollection_Handle< LibCtl_GlobalNode >& theNode) { - if (thenode == anode) return; - if (thenext.IsNull()) { - if (thenode.IsNull()) thenode = anode; + if (myNode == theNode) return; + if (myNext.IsNull()) { + if (myNode.IsNull()) myNode = theNode; else { - thenext = new LibCtl_Node; - thenext->AddNode (anode); + myNext = new LibCtl_Node; + myNext->AddNode (theNode); } } - else thenext->AddNode (anode); + else myNext->AddNode (theNode); } //! Returns the Module designated by a precise Node. template const ModuleType& LibCtl_Node::Module () const { - return thenode->Module(); + return myNode->Module(); } //! Returns the Protocol designated by a precise Node. template const ProtocolType& LibCtl_Node::Protocol () const { - return thenode->Protocol(); + return myNode->Protocol(); } //! Returns the next Node. @@ -85,10 +85,9 @@ const ProtocolType& LibCtl_Node::Protocol () const template const NCollection_Handle< LibCtl_Node >& LibCtl_Node::Next () const { - return thenext; + return myNext; } -// GlobalNode for LibCtl_Library //! Manages a (possibly static) Global List of Modules bound to protocols. //! Remark that it requires independance from Memory Management //! (because a Global List of Modules can be build through static @@ -98,12 +97,12 @@ template class LibCtl_GlobalNode { private: - ModuleType themod; - ProtocolType theprot; - NCollection_Handle thenext; + ModuleType myMod; + ProtocolType myProt; + NCollection_Handle myNext; public: Standard_EXPORT LibCtl_GlobalNode (); - Standard_EXPORT void Add (const ModuleType& amodule, const ProtocolType& aprotocol); + Standard_EXPORT void Add (const ModuleType& theModule, const ProtocolType& theProtocol); Standard_EXPORT const ModuleType& Module () const; Standard_EXPORT const ProtocolType& Protocol () const; Standard_EXPORT const NCollection_Handle & Next () const; @@ -120,32 +119,38 @@ LibCtl_GlobalNode //! Once added, stores its attached Protocol in correspondance. template void LibCtl_GlobalNode ::Add -(const ModuleType& amodule, const ProtocolType& aprotocol) +(const ModuleType& theModule, const ProtocolType& theProtocol) { - if (themod == amodule) return; - if (theprot == aprotocol) themod = amodule; - else if (thenext.IsNull()) { - if (themod.IsNull()) { themod = amodule; theprot = aprotocol; } - else { - thenext = new LibCtl_GlobalNode; - thenext->Add (amodule,aprotocol); + if (myMod == theModule) return; + if (myProt == theProtocol) myMod = theModule; + else if (myNext.IsNull()) + { + if (myMod.IsNull()) + { + myMod = theModule; + myProt = theProtocol; + } + else + { + myNext = new LibCtl_GlobalNode; + myNext->Add (theModule,theProtocol); } } - else thenext->Add (amodule,aprotocol); + else myNext->Add (theModule,theProtocol); } //! Returns the Module stored in a given GlobalNode. template const ModuleType& LibCtl_GlobalNode ::Module () const { - return themod; + return myMod; } //! Returns the attached Protocol stored in a given GlobalNode. template const ProtocolType& LibCtl_GlobalNode ::Protocol () const { - return theprot; + return myProt; } //! Returns the next GlobalNode. @@ -154,206 +159,199 @@ template const NCollection_Handle >& LibCtl_GlobalNode ::Next () const { - return thenext; + return myNext; } // Library +//! Manages a list of Execution Modules attached to Protocols +//! to perform a specific set of functionnalities. +//! +//! Each instantiated class of Library has a global set a Modules. +//! These Modules are put in this set before working, for instance +//! by static construction (using method SetGlobal). One Module +//! is bound which each Protocol (considered as a class). +//! +//! To work, a Library is created by taking the Modules which +//! comply with a Protocol (bound with its class and the classes +//! of its Resources), given as parameter of its creation. //! -template +//! Thus, any tool can use it to get the suitable Modules +//! Warning : The order of the Modules in the Library has assumed to be +//! useless, and is not managed. +template class LibCtl_Library { public: - typedef LibCtl_GlobalNode LibCtl_GlobalNode; - typedef LibCtl_Node LibCtl_Node; - static NCollection_Handle< LibCtl_GlobalNode > theglobal; - static ProtocolType theprotocol; - static NCollection_Handle< LibCtl_Node > thelast; - - // Public methods - Standard_EXPORT static void SetGlobal(const ModuleType& amodule, const ProtocolType& aprotocol); - Standard_EXPORT LibCtl_Library (const ProtocolType& aprotocol); - Standard_EXPORT LibCtl_Library (); - Standard_EXPORT void AddProtocol(const Handle(Standard_Transient)& aprotocol); - Standard_EXPORT void Clear (); - Standard_EXPORT void SetComplete (); - Standard_EXPORT Standard_Boolean Select (const ObjectType& obj, - ModuleType& module, - Standard_Integer& CN) const; - Standard_EXPORT void Start (); - Standard_EXPORT Standard_Boolean More () const; - Standard_EXPORT void Next (); - Standard_EXPORT const ModuleType& Module () const; - Standard_EXPORT const ProtocolType& Protocol () const; + // Type definitions for template classes + typedef LibCtl_GlobalNode LibCtl_GlobalNode; + typedef LibCtl_Node LibCtl_Node; +public: + // Basic data for optimization (Protocol last request) + static ProtocolType myProtocol; + static NCollection_Handle< LibCtl_Node > myLast; -protected: - NCollection_Handle < LibCtl_Node > thelist; - NCollection_Handle < LibCtl_Node > thecurr; -}; + DEFINE_STANDARD_ALLOC -//! Adds a couple (Module-Protocol) into the global definition set -//! for this class of Library. -template -void LibCtl_Library -::SetGlobal (const ModuleType& amodule, const ProtocolType& aprotocol) -{ - if (theglobal.IsNull()) theglobal = new LibCtl_GlobalNode; - theglobal->Add(amodule,aprotocol); -} +private: + NCollection_Handle< LibCtl_Node > myList; + NCollection_Handle< LibCtl_Node > myCurr; +public: -//! Creates a Library which complies with a Protocol, that is : -//! - Same class (criterium IsInstance) -//! - This creation gets the Modules from the global set, those -//! which are bound to the given Protocol and its Resources. -template -LibCtl_Library::LibCtl_Library (const ProtocolType& aprotocol) -{ - Standard_Boolean last = Standard_False; - if (aprotocol.IsNull()) return; // PAS de protocole = Lib VIDE - if (!theprotocol.IsNull()) last = - (theprotocol == aprotocol); - - if (last) thelist = thelast; - // Si Pas d optimisation disponible : construire la liste - else { - AddProtocol(aprotocol); - // Ceci definit l optimisation (pour la fois suivante) - thelast = thelist; - theprotocol = aprotocol; + //! Gets global list of modules + static NCollection_Handle< LibCtl_GlobalNode >& GetGlobal(); + + //! Supply the global list + Standard_EXPORT static void SetGlobal (const ModuleType& theModule, const ProtocolType& theProtocol) + { + if (GetGlobal().IsNull()) GetGlobal() = new LibCtl_GlobalNode; + GetGlobal()->Add(theModule,theProtocol); + } + + Standard_EXPORT LibCtl_Library (const ProtocolType& theProtocol) + { + Standard_Boolean last = Standard_False; + // No protocol = empty library + if (theProtocol.IsNull()) return; + if (!myProtocol.IsNull()) last = + (myProtocol == theProtocol); + + if (last) + myList = myLast; + // If no optimization available: list building + else + { + AddProtocol(theProtocol); + // This defines the optimization (for the next time) + myLast = myList; + myProtocol = theProtocol; + } } -} - -//! Creates an empty Library : it will later by filled by method AddProtocol. -template -LibCtl_Library::LibCtl_Library () { } -//! Adds a couple (Module-Protocol) to the Library, given the -//! class of a Protocol. Takes Resources into account. -//! (if is not of type TheProtocol, it is not added). -template -void LibCtl_Library::AddProtocol - (const Handle(Standard_Transient)& aprotocol) -{ - ProtocolType aproto = ProtocolType::DownCast(aprotocol); - if (aproto.IsNull()) return; + Standard_EXPORT LibCtl_Library () + { } - // D first, add it to the list: search the Node - NCollection_Handle curr; - for (curr = theglobal; !curr.IsNull(); ) + //! Add a Protocol: attention: it is desoptimise (if not confusion!) + Standard_EXPORT void AddProtocol (const Handle(Standard_Transient)& theProtocol) { - const ProtocolType& protocol = curr->Protocol(); - if (!protocol.IsNull()) { - // Match Protocol ? - if (protocol->DynamicType() == aprotocol->DynamicType()) { - if (thelist.IsNull()) thelist = new LibCtl_Node; - thelist->AddNode(curr); - break; + // Downcast as Protocol-> Resources, and even redefined to use in other + // Library must always return the type highest + ProtocolType aProtocol = ProtocolType::DownCast(theProtocol); + if (aProtocol.IsNull()) return; + + NCollection_Handle< LibCtl_GlobalNode > curr; + for (curr = GetGlobal(); !curr.IsNull(); ) + { + const ProtocolType& aProtocol = curr->Protocol(); + if (!aProtocol.IsNull()) + { + // Match Protocol ? + if (aProtocol->DynamicType() == theProtocol->DynamicType()) + { + if (myList.IsNull()) + myList = new LibCtl_Node; + + myList->AddNode(curr); + break; // UN SEUL MODULE PAR PROTOCOLE + } } + curr = curr->Next(); } - curr = curr->Next(); - } - // Treat resources - Standard_Integer nb = aproto->NbResources(); - for (Standard_Integer i = 1; i <= nb; i ++) { - AddProtocol (aproto->Resource(i)); + // Treat resources + Standard_Integer nb = aProtocol->NbResources(); + for (Standard_Integer i = 1; i <= nb; i++) + { + AddProtocol (aProtocol->Resource(i)); + } + + myProtocol.Nullify(); + myLast.Nullify(); } - theprotocol.Nullify(); - thelast.Nullify(); -} - -//! Clears the list of Modules of a library (can be used to -//! redefine the order of Modules before action : Clear then -//! refill the Library by calls to AddProtocol). -template -void LibCtl_Library::Clear () -{ - thelist = new LibCtl_Node; -} + Standard_EXPORT void Clear () + { + myList = new LibCtl_Node(); + } -//! Sets a library to be defined with the complete Global list -//! (all the couples Protocol/Modules recorded in it). -template -void LibCtl_Library::SetComplete () -{ - thelist = new LibCtl_Node; - // Take each of the Protocols of the Global list and add it - NCollection_Handle curr; - for (curr = theglobal; !curr.IsNull(); ) + Standard_EXPORT void SetComplete () { - const ProtocolType& protocol = curr->Protocol(); - // As we take all, it is not preoccupied resources. - if (!protocol.IsNull()) thelist->AddNode(curr); - curr = curr->Next(); + myList = new LibCtl_Node; + // Take each of the protocols of the Global list + NCollection_Handle< LibCtl_GlobalNode > curr; + for (curr = GetGlobal(); !curr.IsNull(); ) + { + const ProtocolType& aProtocol = curr->Protocol(); + // As we take all , it is not preoccupied resources + if (!aProtocol.IsNull()) myList->AddNode(curr); + curr = curr->Next(); + } } -} -//! Selects a Module from the Library, given an Object. -//! Returns True if Select has succeeded, False else. -//! Also Returns (as arguments) the selected Module and the Case -//! Number determined by the associated Protocol. -//! If Select has failed, is Null Handle and CN is zero. -//! (Select can work on any criterium, such as Object DynamicType). -template -Standard_Boolean LibCtl_Library::Select - (const ObjectType& obj, - ModuleType& module, - Standard_Integer& CN) const -{ - module.Nullify(); CN = 0; // Answer "not found" - if (thelist.IsNull()) return Standard_False; - NCollection_Handle curr = thelist; - for (curr = thelist; !curr.IsNull(); ) + //! Selection: the corresponding theModule is returned to a Type + //! (as well as CaseNumber returns the corresponding protocol) + Standard_EXPORT Standard_Boolean Select (const ObjectType& theObj, + ModuleType& theModule, + Standard_Integer& theCN) const { - const ProtocolType& protocol = curr->Protocol(); - if (!protocol.IsNull()) { - CN = protocol->CaseNumber(obj); - if (CN > 0) { - module = curr->Module(); - return Standard_True; + // Reponse: "not found" + theModule.Nullify(); theCN = 0; + if (myList.IsNull()) + return Standard_False; + NCollection_Handle< LibCtl_Node > curr = myList; + for (curr = myList; !curr.IsNull(); ) + { + const ProtocolType& aProtocol = curr->Protocol(); + if (!aProtocol.IsNull()) + { + theCN = aProtocol->CaseNumber(theObj); + if (theCN > 0) + { + theModule = curr->Module(); + return Standard_True; + } } + curr = curr->Next(); } - curr = curr->Next(); + return Standard_False; } - return Standard_False; -} -//! Starts Iteration on the Modules (sets it on the first one). -template -void LibCtl_Library::Start () -{ - thecurr = thelist; -} + //! Initialization for iteration through the library + Standard_EXPORT void Start () + { + myCurr = myList; + } -//! Returns True if there are more Modules to iterate on. -template -Standard_Boolean LibCtl_Library::More () const -{ - return (!thecurr.IsNull()); -} + Standard_EXPORT Standard_Boolean More () const + { + return (!myCurr.IsNull()); + } -//! Iterates by getting the next Module in the list. -//! If there is none, the exception will be raised by Value. -template -void LibCtl_Library::Next () -{ - if (!thecurr.IsNull()) thecurr = thecurr->Next(); -} + Standard_EXPORT void LibCtl_Library::Next () + { + if (!myCurr.IsNull()) + myCurr = myCurr->Next(); + } -//! Returns the current Module in the Iteration. -//! Error if there is no current Module to iterate on. -template -const ModuleType& LibCtl_Library::Module () const -{ - if (thecurr.IsNull()) Standard_NoSuchObject::Raise("Library from LibCtl"); - return thecurr->Module(); -} + Standard_EXPORT const ModuleType& Module () const + { + if (myCurr.IsNull()) + Standard_NoSuchObject::Raise("Library from LibCtl"); + return myCurr->Module(); + } + + Standard_EXPORT const ProtocolType& Protocol () const + { + if (myCurr.IsNull()) + Standard_NoSuchObject::Raise("Library from LibCtl"); + return myCurr->Protocol(); + } +}; + +//! Basic data for optimization (Protocol last request) +template +ProtocolType LibCtl_Library::myProtocol; + +template +NCollection_Handle > +LibCtl_Library::myLast; -//! Returns the current Protocol in the Iteration. -//! Error if there is no current Protocol to iterate on. -template -const ProtocolType& LibCtl_Library::Protocol () const -{ - if (thecurr.IsNull()) Standard_NoSuchObject::Raise("Library from LibCtl"); - return thecurr->Protocol(); -} #endif diff --git a/src/STEPControl/STEPControl_ActorWrite.cxx b/src/STEPControl/STEPControl_ActorWrite.cxx index 62c206b04e..bcf1fa50d7 100755 --- a/src/STEPControl/STEPControl_ActorWrite.cxx +++ b/src/STEPControl/STEPControl_ActorWrite.cxx @@ -338,7 +338,7 @@ void STEPControl_ActorWrite::SetMode (const STEPControl_StepModelType M) STEPControl_StepModelType STEPControl_ActorWrite::Mode () const { - switch (themodetrans) { + switch (myModeTrans) { case 0 : return STEPControl_AsIs; case 1 : return STEPControl_FacetedBrep; case 2 : return STEPControl_ShellBasedSurfaceModel; diff --git a/src/StepData/StepData_WriterLib.cxx b/src/StepData/StepData_WriterLib.cxx index 2be41ed44f..985ade085c 100644 --- a/src/StepData/StepData_WriterLib.cxx +++ b/src/StepData/StepData_WriterLib.cxx @@ -16,93 +16,16 @@ // and conditions governing the rights and limitations under the License. #include - - - static NCollection_Handle < LibCtl_GlobalNode > - myGlobal; - - static NCollection_Handle < LibCtl_Node > - myLast; - - static Handle(StepData_Protocol) - myProtocol; - - - void StepData_WriterLib::SetGlobal (const Handle(StepData_ReadWriteModule)& theModule, - const Handle(StepData_Protocol)& theProtocol) - { - if (myGlobal.IsNull()) - myGlobal = new LibCtl_StepWriterLib::LibCtl_GlobalNode; - myGlobal->Add(theModule,theProtocol); - } - - StepData_WriterLib::StepData_WriterLib(const Handle(StepData_Protocol)& theProtocol) - { - Standard_Boolean last = Standard_False; - if (theProtocol.IsNull()) - return; - if (!myProtocol.IsNull()) - last = (myProtocol == theProtocol); - - if (last) - thelist = myLast; - // If no optimization available: list building - else - { - AddProtocol(theProtocol); - // This defines the optimization (for the next time) - myLast = thelist; - myProtocol = theProtocol; - } - } - - void StepData_WriterLib::SetComplete () - { - thelist = new LibCtl_StepWriterLib::LibCtl_Node; - // Take each of the protocols of the Global list - NCollection_Handle curr; - for (curr = myGlobal; !curr.IsNull(); ) - { - const Handle(StepData_Protocol)& protocol = curr->Protocol(); - // As we take all , it is not preoccupied resources - if (!protocol.IsNull()) thelist->AddNode(curr); - curr = curr->Next(); - } - } - - void StepData_WriterLib::AddProtocol (const Handle(Standard_Transient)& theProtocol) - { - // Downcast as Protocol-> Resources, and even redefined to use in other - // Library must always return the type highest - Handle(StepData_Protocol) aProtocol = Handle(StepData_Protocol)::DownCast(theProtocol); - if (aProtocol.IsNull()) return; - - NCollection_Handle curr; - for (curr = myGlobal; !curr.IsNull(); ) - { - const Handle(StepData_Protocol)& protocol = curr->Protocol(); - if (!protocol.IsNull()) - { - if (protocol->DynamicType() == theProtocol->DynamicType()) - { - if (thelist.IsNull()) - thelist = new LibCtl_StepWriterLib::LibCtl_Node; - thelist->AddNode(curr); - break; - } - } - curr = curr->Next(); - } - // Treat resources - Standard_Integer nb = aProtocol->NbResources(); - for (Standard_Integer i = 1; i <= nb; i++) - { - AddProtocol (aProtocol->Resource(i)); - } - - myProtocol.Nullify(); - myLast.Nullify(); - } - +#include + +typedef LibCtl_GlobalNode + StepData_GlobalNode; + +template <> +Standard_EXPORT static NCollection_Handle< StepData_GlobalNode > & +StepData_WriterLib::GetGlobal() +{ + static NCollection_Handle < StepData_GlobalNode > aGlobal; + return aGlobal; +} diff --git a/src/StepData/StepData_WriterLib.hxx b/src/StepData/StepData_WriterLib.hxx index c5ed31277d..8c98da1159 100644 --- a/src/StepData/StepData_WriterLib.hxx +++ b/src/StepData/StepData_WriterLib.hxx @@ -42,38 +42,6 @@ class StepData_Protocol; typedef LibCtl_Library - LibCtl_StepWriterLib; - -//template <> -//NCollection_Handle > -//LibCtl_StepWriterLib::theglobal; -// -//template <> -//Handle(StepData_Protocol) -//LibCtl_StepWriterLib::theprotocol; -// -//template <> -//NCollection_Handle > -//LibCtl_StepWriterLib::thelast; - -class StepData_WriterLib : public LibCtl_StepWriterLib -{ -public: - DEFINE_STANDARD_ALLOC - Standard_EXPORT StepData_WriterLib() - : LibCtl_StepWriterLib() { } - - Standard_EXPORT StepData_WriterLib(const Handle(StepData_Protocol)& theProtocol); - - Standard_EXPORT void SetComplete (); - - Standard_EXPORT void AddProtocol (const Handle(Standard_Transient)& theProtocol); - - Standard_EXPORT static void SetGlobal (const Handle(StepData_ReadWriteModule)& theModule, - const Handle(StepData_Protocol)& theProtocol); - -}; + StepData_WriterLib; #endif \ No newline at end of file diff --git a/src/Transfer/Transfer_Actor.hxx b/src/Transfer/Transfer_Actor.hxx index 1685fd5c63..084a3ac6cc 100644 --- a/src/Transfer/Transfer_Actor.hxx +++ b/src/Transfer/Transfer_Actor.hxx @@ -50,8 +50,8 @@ template < class ActorHandle, class TheStart, class TransferProcessHandle > class Transfer_Actor : public MMgt_TShared { private: - ActorHandle thenext; - Standard_Boolean thelast; + ActorHandle myNext; + Standard_Boolean myLast; public: Standard_EXPORT Transfer_Actor () { } @@ -62,7 +62,7 @@ public: //! 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. + //! (afterwards rejection), the theNext actor is then invoked. //! The provided default returns True, can be redefined. Standard_EXPORT Standard_Boolean Recognize (const TheStart& /*start*/) { @@ -76,23 +76,22 @@ public: //! information, in addition to those of TransferProcess. //! In case of Error during a Transfer, any kind of //! exception can be raised. - Standard_EXPORT Handle(Transfer_Binder) Transferring - (const TheStart& /*start*/, - const TransferProcessHandle& /*TP*/) + Standard_EXPORT Handle(Transfer_Binder) Transferring (const TheStart& /*start*/, + const TransferProcessHandle& /*TP*/) { return NullResult(); } //! Prepares and returns a binder for a Transient result. - //! Returns a Null Handle if is itself null. + //! Returns a Null Handle if is itself null. Standard_EXPORT Handle(Transfer_SimpleBinderOfTransient) TransientResult - (const Handle(Standard_Transient)& res) const + (const Handle(Standard_Transient)& theRes) const { Handle(Transfer_SimpleBinderOfTransient) binder; - if (res.IsNull()) + if (theRes.IsNull()) return binder; binder = new Transfer_SimpleBinderOfTransient; - binder->SetResult (res); + binder->SetResult (theRes); return binder; } @@ -110,7 +109,7 @@ public: //! This allows to define default Actors (which are Last). Standard_EXPORT void SetLast (const Standard_Boolean theMode) { - thelast = theMode; + myLast = theMode; } //! Defines a Next Actor : it can then be asked to work if @@ -118,31 +117,31 @@ public: //! 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 ActorHandle& next) + Standard_EXPORT void SetNext (const ActorHandle& theNext) { - if (thenext == next) + if (myNext == theNext) return; - if (thenext.IsNull()) - thenext = next; - else if (thenext->IsLast()) + if (myNext.IsNull()) + myNext = theNext; + else if (myNext->IsLast()) { - next->SetNext(thenext); - thenext = next; + theNext->SetNext(myNext); + myNext = theNext; } else - thenext->SetNext(next); + myNext->SetNext(theNext); } //! Returns the actor defined as Next, or a null handle. Standard_EXPORT ActorHandle Next () const { - return thenext; + return myNext; } //! Returns the Last status (see SetLast). Standard_EXPORT Standard_Boolean IsLast () const { - return thelast; + return myLast; } }; #endif diff --git a/src/Transfer/Transfer_ActorOfFinderProcess.cxx b/src/Transfer/Transfer_ActorOfFinderProcess.cxx index e5f7a71c92..3f794f45a8 100755 --- a/src/Transfer/Transfer_ActorOfFinderProcess.cxx +++ b/src/Transfer/Transfer_ActorOfFinderProcess.cxx @@ -23,33 +23,33 @@ IMPLEMENT_STANDARD_HANDLE(Transfer_ActorOfFinderProcess, MMgt_TShared) IMPLEMENT_STANDARD_RTTIEXT(Transfer_ActorOfFinderProcess, MMgt_TShared) -Transfer_ActorOfFinderProcess::Transfer_ActorOfFinderProcess () { themodetrans = 0; } +Transfer_ActorOfFinderProcess::Transfer_ActorOfFinderProcess () { myModeTrans = 0; } Standard_Integer& Transfer_ActorOfFinderProcess::ModeTrans () -{ return themodetrans; } +{ return myModeTrans; } Handle(Transfer_Binder) Transfer_ActorOfFinderProcess::Transfer - (const Handle(Transfer_Finder)& fnd, - const Handle(Transfer_FinderProcess)& FP) + (const Handle(Transfer_Finder)& theFinder, + const Handle(Transfer_FinderProcess)& theFP) { - Handle(Transfer_TransientMapper) tm = Handle(Transfer_TransientMapper)::DownCast (fnd); + Handle(Transfer_TransientMapper) tm = Handle(Transfer_TransientMapper)::DownCast (theFinder); if (tm.IsNull()) return NullResult(); - Handle(Standard_Transient) res = TransferTransient (tm->Value(),FP); + Handle(Standard_Transient) res = TransferTransient (tm->Value(),theFP); if (res.IsNull()) return NullResult(); return TransientResult (res); } Handle(Transfer_Binder) Transfer_ActorOfFinderProcess::Transferring - (const Handle(Transfer_Finder)& ent, - const Handle(Transfer_FinderProcess)& TP) + (const Handle(Transfer_Finder)& theFinder, + const Handle(Transfer_FinderProcess)& theTP) { - return Transfer(ent,Handle(Transfer_FinderProcess)::DownCast(TP)); + return Transfer(theFinder,Handle(Transfer_FinderProcess)::DownCast(theTP)); } Handle(Standard_Transient) Transfer_ActorOfFinderProcess::TransferTransient - (const Handle(Standard_Transient)& /*ent*/, + (const Handle(Standard_Transient)& /*theEnt*/, const Handle(Transfer_FinderProcess)& ) { - Handle(Standard_Transient) nulres; - return nulres; + Handle(Standard_Transient) aNullRes; + return aNullRes; } diff --git a/src/Transfer/Transfer_ActorOfFinderProcess.hxx b/src/Transfer/Transfer_ActorOfFinderProcess.hxx index b1f0267177..53d7f6d346 100644 --- a/src/Transfer/Transfer_ActorOfFinderProcess.hxx +++ b/src/Transfer/Transfer_ActorOfFinderProcess.hxx @@ -39,18 +39,18 @@ public: //! Returns the Transfer Mode, modifiable
Standard_EXPORT Standard_Integer& ModeTrans() ; - Standard_EXPORT virtual Handle(Transfer_Binder) Transferring(const Handle(Transfer_Finder)& start, - const Handle(Transfer_FinderProcess)& TP); + Standard_EXPORT virtual Handle(Transfer_Binder) Transferring(const Handle(Transfer_Finder)& theFinder, + const Handle(Transfer_FinderProcess)& theFP); - Standard_EXPORT virtual Handle(Transfer_Binder) Transfer(const Handle(Transfer_Finder)& start, - const Handle(Transfer_FinderProcess)& TP); + Standard_EXPORT virtual Handle(Transfer_Binder) Transfer(const Handle(Transfer_Finder)& theFinder, + const Handle(Transfer_FinderProcess)& theFP); - Standard_EXPORT virtual Handle(Standard_Transient) TransferTransient(const Handle(Standard_Transient)& start, - const Handle(Transfer_FinderProcess)& TP); + Standard_EXPORT virtual Handle(Standard_Transient) TransferTransient(const Handle(Standard_Transient)& theEnt, + const Handle(Transfer_FinderProcess)& theFP); DEFINE_STANDARD_RTTI(Transfer_ActorOfFinderProcess) protected: - Standard_Integer themodetrans; + Standard_Integer myModeTrans; }; #endif \ No newline at end of file diff --git a/src/Transfer/Transfer_ActorOfTransientProcess.cxx b/src/Transfer/Transfer_ActorOfTransientProcess.cxx index 4d6404b227..013411fd07 100755 --- a/src/Transfer/Transfer_ActorOfTransientProcess.cxx +++ b/src/Transfer/Transfer_ActorOfTransientProcess.cxx @@ -26,25 +26,25 @@ Transfer_ActorOfTransientProcess::Transfer_ActorOfTransientProcess () { } Handle(Transfer_Binder) Transfer_ActorOfTransientProcess::Transfer - (const Handle(Standard_Transient)& start, - const Handle(Transfer_TransientProcess)& TP) + (const Handle(Standard_Transient)& theEnt, + const Handle(Transfer_TransientProcess)& theTP) { - Handle(Standard_Transient) res = TransferTransient (start,TP); + Handle(Standard_Transient) res = TransferTransient (theEnt,theTP); if (res.IsNull()) return NullResult(); return TransientResult (res); } Handle(Transfer_Binder) Transfer_ActorOfTransientProcess::Transferring - (const Handle(Standard_Transient)& ent, - const Handle(Transfer_TransientProcess)& TP) + (const Handle(Standard_Transient)& theEnt, + const Handle(Transfer_TransientProcess)& theTP) { - return Transfer(ent,Handle(Transfer_TransientProcess)::DownCast(TP)); + return Transfer (theEnt, Handle(Transfer_TransientProcess)::DownCast(theTP)); } Handle(Standard_Transient) Transfer_ActorOfTransientProcess::TransferTransient - (const Handle(Standard_Transient)& /*ent*/, - const Handle(Transfer_TransientProcess)& /*TP*/) + (const Handle(Standard_Transient)& /*theEnt*/, + const Handle(Transfer_TransientProcess)& /*theTP*/) { - Handle(Standard_Transient) nulres; - return nulres; + Handle(Standard_Transient) aNullRes; + return aNullRes; } diff --git a/src/Transfer/Transfer_ActorOfTransientProcess.hxx b/src/Transfer/Transfer_ActorOfTransientProcess.hxx index 8249082216..f60967e481 100644 --- a/src/Transfer/Transfer_ActorOfTransientProcess.hxx +++ b/src/Transfer/Transfer_ActorOfTransientProcess.hxx @@ -35,11 +35,14 @@ public: Standard_EXPORT Transfer_ActorOfTransientProcess(); - Standard_EXPORT virtual Handle_Transfer_Binder Transferring(const Handle(Standard_Transient)& start,const Handle(Transfer_TransientProcess)& TP) ; + Standard_EXPORT virtual Handle_Transfer_Binder Transferring (const Handle(Standard_Transient)& theEnt, + const Handle(Transfer_TransientProcess)& theTP) ; - Standard_EXPORT virtual Handle_Transfer_Binder Transfer(const Handle(Standard_Transient)& start,const Handle(Transfer_TransientProcess)& TP) ; + Standard_EXPORT virtual Handle_Transfer_Binder Transfer (const Handle(Standard_Transient)& theEnt, + const Handle(Transfer_TransientProcess)& theTP) ; - Standard_EXPORT virtual Handle_Standard_Transient TransferTransient(const Handle(Standard_Transient)& start,const Handle(Transfer_TransientProcess)& TP) ; + Standard_EXPORT virtual Handle_Standard_Transient TransferTransient (const Handle(Standard_Transient)& theStart, + const Handle(Transfer_TransientProcess)& theTP) ; DEFINE_STANDARD_RTTI(Transfer_ActorOfTransientProcess) diff --git a/src/Transfer/Transfer_FinderProcess.cxx b/src/Transfer/Transfer_FinderProcess.cxx index c23c8e592d..52ef19aec1 100755 --- a/src/Transfer/Transfer_FinderProcess.cxx +++ b/src/Transfer/Transfer_FinderProcess.cxx @@ -38,77 +38,84 @@ IMPLEMENT_STANDARD_TYPE_END(Transfer_FinderProcess) IMPLEMENT_DOWNCAST(Transfer_FinderProcess,Standard_Transient) IMPLEMENT_STANDARD_RTTI(Transfer_FinderProcess) -Transfer_FinderProcess::Transfer_FinderProcess (const Standard_Integer nb) - : Transfer_TransferProcess (nb) { } + Transfer_FinderProcess::Transfer_FinderProcess (const Standard_Integer theNb) + : Transfer_TransferProcess (theNb) { } - void Transfer_FinderProcess::SetModel - (const Handle(Interface_InterfaceModel)& model) - { themodel = model; } + void Transfer_FinderProcess::SetModel (const Handle(Interface_InterfaceModel)& theModel) + { + myModel = theModel; + } - Handle(Interface_InterfaceModel) Transfer_FinderProcess::Model () const - { return themodel; } + Handle(Interface_InterfaceModel) Transfer_FinderProcess::Model () const + { + return myModel; + } - - Standard_Integer Transfer_FinderProcess::NextMappedWithAttribute - (const Standard_CString name, const Standard_Integer num0) const -{ - Standard_Integer num, nb = NbMapped(); - for (num = num0+1; num <= nb; num ++) { - Handle(Transfer_Finder) fnd = Mapped (num); - if (fnd.IsNull()) continue; - if (!fnd->Attribute(name).IsNull()) return num; + Standard_Integer Transfer_FinderProcess::NextMappedWithAttribute + (const Standard_CString theName, + const Standard_Integer theNum0) const + { + Standard_Integer aNum, aNb = NbMapped(); + for (aNum = theNum0 + 1; aNum <= aNb; aNum ++) + { + Handle(Transfer_Finder) aFnd = Mapped (aNum); + if (aFnd.IsNull()) continue; + if (!aFnd->Attribute(theName).IsNull()) + return aNum; + } + return 0; } - return 0; -} - Handle(Transfer_TransientMapper) Transfer_FinderProcess::TransientMapper - (const Handle(Standard_Transient)& obj) const -{ - Handle(Transfer_TransientMapper) mapper = new Transfer_TransientMapper(obj); - Standard_Integer index = MapIndex (mapper); - if (index == 0) return mapper; - return Handle(Transfer_TransientMapper)::DownCast(Mapped(index)); -} + Handle(Transfer_TransientMapper) Transfer_FinderProcess::TransientMapper + (const Handle(Standard_Transient)& theObj) const + { + Handle(Transfer_TransientMapper) aMapper = new Transfer_TransientMapper(theObj); + Standard_Integer anIndex = MapIndex (aMapper); + if (anIndex == 0) + return aMapper; + return Handle(Transfer_TransientMapper)::DownCast(Mapped(anIndex)); + } - void Transfer_FinderProcess::PrintTrace (const Handle(Transfer_Finder)& start, - const Handle(Message_Messenger)& S) const + void Transfer_FinderProcess::PrintTrace (const Handle(Transfer_Finder)& theStart, + const Handle(Message_Messenger)& theMessenger) const { - if (!start.IsNull()) S<<" Type:"<ValueTypeName(); + if (!theStart.IsNull()) + theMessenger<<" Type:"<ValueTypeName(); } - void Transfer_FinderProcess::PrintStats (const Standard_Integer mode, - const Handle(Message_Messenger)& S) const + void Transfer_FinderProcess::PrintStats (const Standard_Integer theMode, + const Handle(Message_Messenger)& theMessenger) const { - S<<"\n*******************************************************************\n"; - if (mode == 1) { // Statistiques de base - S << "******** Basic Statistics ********"<Check(); - Transfer_StatusExec stat = binder->StatusExec(); - if (stat != Transfer_StatusInitial && stat != Transfer_StatusDone) - nbe ++; + for (anI = 1; anI <= aMax; anI ++) { + const Handle(Transfer_Binder)& aBinder = MapItem(anI); + if (aBinder.IsNull()) continue; + const Handle(Interface_Check) aCheck = aBinder->Check(); + Transfer_StatusExec aStatus = aBinder->StatusExec(); + if (aStatus != Transfer_StatusInitial && aStatus != Transfer_StatusDone) + aNbe ++; else { - if (ach->NbWarnings() > 0) nbw ++; - if (binder->HasResult()) nbr ++; + if (aCheck->NbWarnings() > 0) aNbw ++; + if (aBinder->HasResult()) aNbr ++; } } - if (nbr > nbroots) - S<<"**** ( Itermediate Results : "< 0) - S<<"**** Errors on :"< 0) - S<<"**** Warnings on : "< aNbRoots) + theMessenger<<"**** ( Itermediate Results : "< 0) + theMessenger<<"**** Errors on :"< 0) + theMessenger<<"**** Warnings on : "<Recognize (start)) binder = actor->Transferring(start,this); - else binder.Nullify(); - if (!binder.IsNull()) break; - actor = actor->Next(); + if (anActor->Recognize (theStart)) aBinder = anActor->Transferring(theStart,this); + else aBinder.Nullify(); + if (!aBinder.IsNull()) break; + anActor = anActor->Next(); } - if (binder.IsNull()) { - if (thelevel > 0) thelevel --; - return binder; + if (aBinder.IsNull()) { + if (myLevel > 0) myLevel --; + return aBinder; } // Managing the root level (.. a close look ..) - if (therootl == 0 && binder->StatusExec() == Transfer_StatusDone) - therootl = thelevel - 1; + if (myRootLevel == 0 && aBinder->StatusExec() == Transfer_StatusDone) + myRootLevel = myLevel - 1; - if (thelevel > 0) thelevel --; - return binder; + if (myLevel > 0) myLevel --; + return aBinder; } //======================================================================= @@ -145,137 +152,137 @@ Transfer_FinderProcess::Transfer_FinderProcess (const Standard_Integer nb) //purpose : //======================================================================= - Handle(Transfer_Binder) Transfer_FinderProcess::Transferring (const Handle(Transfer_Finder)& start) + Handle(Transfer_Binder) Transfer_FinderProcess::Transferring (const Handle(Transfer_Finder)& theStart) { - Handle(Transfer_Binder) former = FindAndMask(start); + Handle(Transfer_Binder) aFormer = FindAndMask(theStart); // Use more: note "AlreadyUsed" so result can not be changed - if (!former.IsNull()) { - if (former->HasResult()) { - former->SetAlreadyUsed(); - return former; + if (!aFormer.IsNull()) { + if (aFormer->HasResult()) { + aFormer->SetAlreadyUsed(); + return aFormer; } // Initial state: perhaps already done ... or infeasible - Transfer_StatusExec statex = former->StatusExec(); + Transfer_StatusExec statex = aFormer->StatusExec(); switch (statex) { case Transfer_StatusInitial : // Transfer is prepared to do break; case Transfer_StatusDone : // Transfer was already done - themessenger << " .. and Transfer done" << endl; - return former; + myMessenger << " .. and Transfer done" << endl; + return aFormer; case Transfer_StatusRun : - former->SetStatusExec(Transfer_StatusLoop); - return former; + aFormer->SetStatusExec(Transfer_StatusLoop); + return aFormer; case Transfer_StatusError : - if (thetrace) { - themessenger << " *** Transfer in Error Status :" << endl; - StartTrace (former, start, thelevel,0); + if (myTrace) { + myMessenger << " *** Transfer in Error Status :" << endl; + StartTrace (aFormer, theStart, myLevel,0); } - else StartTrace (former, start,thelevel,4); + else StartTrace (aFormer, theStart,myLevel,4); Transfer_TransferFailure::Raise ("TransferProcess : Transfer in Error Status"); case Transfer_StatusLoop : // The loop is closed ... - if (thetrace) { - themessenger << " *** Transfer Head of Dead Loop :" << endl; - StartTrace (former, start, thelevel,0); + if (myTrace) { + myMessenger << " *** Transfer Head of Dead Loop :" << endl; + StartTrace (aFormer, theStart, myLevel,0); } - else StartTrace (former, start,thelevel,4); + else StartTrace (aFormer, theStart,myLevel,4); Transfer_TransferDeadLoop::Raise ("TransferProcess : Transfer at Head of a Dead Loop"); } #ifdef TRANSLOG - cout << "Transfer,level "<SetStatusExec(Transfer_StatusRun); + aFormer->SetStatusExec(Transfer_StatusRun); } #ifdef TRANSLOG cout << " GO .." << endl; #endif - Handle(Transfer_Binder) binder; + Handle(Transfer_Binder) aBinder; Standard_Boolean newbind = Standard_False; - if (theerrh) { + if (myToHandleErr) { // Transfer under protection exceptions (for notification actually) - Standard_Integer oldlev = thelevel; + Standard_Integer anOldLevel = myLevel; try { OCC_CATCH_SIGNALS - binder = TransferProduct(start); + aBinder = TransferProduct(theStart); } catch (Transfer_TransferDeadLoop) { - if (binder.IsNull()) { - themessenger << " *** Dead Loop with no Result" << endl; - if (thetrace) StartTrace (binder, start, thelevel-1,0); - binder = new Transfer_VoidBinder; - Bind (start,binder); newbind = Standard_True; - } else if (binder->StatusExec() == Transfer_StatusLoop) { - if (thetrace) { - themessenger << " *** Dead Loop : Finding head of Loop :" << endl; - StartTrace (binder, start, thelevel-1,0); + if (aBinder.IsNull()) { + myMessenger << " *** Dead Loop with no Result" << endl; + if (myTrace) StartTrace (aBinder, theStart, myLevel-1,0); + aBinder = new Transfer_VoidBinder; + Bind (theStart,aBinder); newbind = Standard_True; + } else if (aBinder->StatusExec() == Transfer_StatusLoop) { + if (myTrace) { + myMessenger << " *** Dead Loop : Finding head of Loop :" << endl; + StartTrace (aBinder, theStart, myLevel-1,0); } - else StartTrace (binder, start,thelevel-1,4); + else StartTrace (aBinder, theStart,myLevel-1,4); Transfer_TransferFailure::Raise("TransferProcess : Head of Dead Loop"); } else { - if (thetrace) { - themessenger << " *** Dead Loop : Actor in Loop :" << endl; - StartTrace (binder, start, thelevel-1,0); + if (myTrace) { + myMessenger << " *** Dead Loop : Actor in Loop :" << endl; + StartTrace (aBinder, theStart, myLevel-1,0); } } - binder->AddFail("Transfer in dead Loop"); - thelevel = oldlev; + aBinder->AddFail("Transfer in dead Loop"); + myLevel = anOldLevel; } catch (Standard_Failure) { - if (binder.IsNull()) { - themessenger << " *** Exception Raised with no Result" << endl; - binder = new Transfer_VoidBinder; - Bind (start,binder); newbind = Standard_True; + if (aBinder.IsNull()) { + myMessenger << " *** Exception Raised with no Result" << endl; + aBinder = new Transfer_VoidBinder; + Bind (theStart,aBinder); newbind = Standard_True; } - binder->AddFail("Transfer stopped by exception raising"); - if (thetrace) { - themessenger << " *** Raised : " << Standard_Failure::Caught()->GetMessageString() << endl; - StartTrace (binder, start, thelevel-1,4); + aBinder->AddFail("Transfer stopped by exception raising"); + if (myTrace) { + myMessenger << " *** Raised : " << Standard_Failure::Caught()->GetMessageString() << endl; + StartTrace (aBinder, theStart, myLevel-1,4); } - thelevel = oldlev; + myLevel = anOldLevel; } } - else binder = TransferProduct(start); + else aBinder = TransferProduct(theStart); // Conclusion : Noter dans la Map - if (!newbind && !binder.IsNull()) { - if (former.IsNull()) { - if (!IsBound(start)) Bind(start,binder); // result = 0 category + if (!newbind && !aBinder.IsNull()) { + if (aFormer.IsNull()) { + if (!IsBound(theStart)) Bind(theStart,aBinder); // result = 0 category else { // gka TRJ9 for writing SDR for solid - Rebind(start,binder); // test_pattern.sat + Rebind(theStart,aBinder); // test_pattern.sat } } - else Rebind(start,binder); + else Rebind(theStart,aBinder); #ifdef TRANSLOG cout << " ... OK" << endl; #endif } else { - //= by ABV: 5 Oct 97: nothing generated, but former can be in run state - drop it + //= by ABV: 5 Oct 97: nothing generated, but aFormer can be in run state - drop it //= ASK: may be set it to StatusInitial ? - if ( ! former.IsNull() ) former->SetStatusExec ( Transfer_StatusDone ); + if ( ! aFormer.IsNull() ) aFormer->SetStatusExec ( Transfer_StatusDone ); Handle(Transfer_Binder) nulbinder; return nulbinder; } // Manage Roots (if planned) - if (therootl >= thelevel) { - therootl = 0; - if (therootm && binder->Status() != Transfer_StatusVoid) { - SetRoot (start); + if (myRootLevel >= myLevel) { + myRootLevel = 0; + if (myToManageRoot && aBinder->Status() != Transfer_StatusVoid) { + SetRoot (theStart); } } - return thelastbnd; + return myLastBinder; } - Standard_Boolean Transfer_FinderProcess::Transfer(const Handle(Transfer_Finder)& start) + Standard_Boolean Transfer_FinderProcess::Transfer(const Handle(Transfer_Finder)& theStart) { - Handle(Transfer_Binder) binder = Transferring(start); - return (!binder.IsNull()); + Handle(Transfer_Binder) aBinder = Transferring(theStart); + return (!aBinder.IsNull()); } diff --git a/src/Transfer/Transfer_FinderProcess.hxx b/src/Transfer/Transfer_FinderProcess.hxx index a84d5d362a..4ea90bd72e 100644 --- a/src/Transfer/Transfer_FinderProcess.hxx +++ b/src/Transfer/Transfer_FinderProcess.hxx @@ -58,10 +58,10 @@ class Transfer_FinderProcess public: //! Sets FinderProcess at initial state, with an initial size
- Standard_EXPORT Transfer_FinderProcess(const Standard_Integer nb = 10000); + Standard_EXPORT Transfer_FinderProcess(const Standard_Integer theNb = 10000); //! Sets an InterfaceModel, which can be used during transfer
//! for instance if a context must be managed, it is in the Model
- Standard_EXPORT void SetModel(const Handle(Interface_InterfaceModel)& model) ; + Standard_EXPORT void SetModel(const Handle(Interface_InterfaceModel)& theModel) ; //! Returns the Model which can be used for context
Standard_EXPORT Handle_Interface_InterfaceModel Model() const; //! In the list of mapped items (between 1 and NbMapped),
@@ -78,28 +78,30 @@ public: //! num = FP->NextMappedWithAttribute(name,num) {
//! .. process mapped item
//! }
- Standard_EXPORT Standard_Integer NextMappedWithAttribute(const Standard_CString name,const Standard_Integer num0) const; + Standard_EXPORT Standard_Integer NextMappedWithAttribute (const Standard_CString theName, + const Standard_Integer theNum0) const; //! Returns a TransientMapper for a given Transient Object
//! 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 or FindElseBind to do this)
- Standard_EXPORT Handle_Transfer_TransientMapper TransientMapper(const Handle(Standard_Transient)& obj) const; + Standard_EXPORT Handle_Transfer_TransientMapper TransientMapper (const Handle(Standard_Transient)& theObj) const; //! Specific printing to trace a Finder (by its method ValueType)
- Standard_EXPORT virtual void PrintTrace(const Handle(Transfer_Finder)& start,const Handle(Message_Messenger)& S) const; + Standard_EXPORT virtual void PrintTrace (const Handle(Transfer_Finder)& theStart, + const Handle(Message_Messenger)& theMessenger) const; //! Prints statistics on a given output, according mode
- Standard_EXPORT void PrintStats(const Standard_Integer mode,const Handle(Message_Messenger)& S) const; + Standard_EXPORT void PrintStats(const Standard_Integer mode,const Handle(Message_Messenger)& theMessenger) const; - Standard_EXPORT Handle(Transfer_Binder) TransferProduct (const Handle(Transfer_Finder)& start); + Standard_EXPORT Handle(Transfer_Binder) TransferProduct (const Handle(Transfer_Finder)& theStart); - Standard_EXPORT Handle(Transfer_Binder) Transferring (const Handle(Transfer_Finder)& start); + Standard_EXPORT Handle(Transfer_Binder) Transferring (const Handle(Transfer_Finder)& theStart); - Standard_EXPORT Standard_Boolean Transfer(const Handle(Transfer_Finder)& start); + Standard_EXPORT Standard_Boolean Transfer(const Handle(Transfer_Finder)& theStart); DEFINE_STANDARD_RTTI(Transfer_FinderProcess) private: - Handle_Interface_InterfaceModel themodel; + Handle_Interface_InterfaceModel myModel; }; #endif diff --git a/src/Transfer/Transfer_Iterator.hxx b/src/Transfer/Transfer_Iterator.hxx index f2e0800195..b6998837b9 100644 --- a/src/Transfer/Transfer_Iterator.hxx +++ b/src/Transfer/Transfer_Iterator.hxx @@ -32,60 +32,64 @@ template class Transfer_Iterator : public Transfer_TransferIterator { private: - ListHandle thestarts; + ListHandle myStarts; public: DEFINE_STANDARD_ALLOC - Standard_EXPORT Transfer_Iterator (const Standard_Boolean withstarts) + Standard_EXPORT Transfer_Iterator (const Standard_Boolean theWithStarts) : Transfer_TransferIterator () - { if (withstarts) thestarts = new List(); } + { if (theWithStarts) + myStarts = new List(); } - Standard_EXPORT void Add (const Handle(Transfer_Binder)& binder) + Standard_EXPORT void Add (const Handle(Transfer_Binder)& theBinder) { - if (!thestarts.IsNull()) Standard_NoSuchObject::Raise + if (!myStarts.IsNull()) Standard_NoSuchObject::Raise ("Transfer_Iterator : Add, Starting Object required not provided"); - AddItem(binder); + AddItem(theBinder); } - Standard_EXPORT void Add (const Handle(Transfer_Binder)& binder, - const TheStart& start) + Standard_EXPORT void Add (const Handle(Transfer_Binder)& theBinder, + const TheStart& theStart) { - AddItem(binder); - if (!thestarts.IsNull()) thestarts->Append(start); + AddItem (theBinder); + if (!myStarts.IsNull()) + myStarts->Append(theStart); } - Standard_EXPORT void Filter (const ListHandle& list, - const Standard_Boolean keep = Standard_True) + Standard_EXPORT void Filter (const ListHandle& theList, + const Standard_Boolean toKeep = Standard_True) { - if (list.IsNull() || thestarts.IsNull()) return; - Standard_Integer i, j, nb = thestarts->Length(); - if (nb == 0) return; + if (theList.IsNull() || myStarts.IsNull()) + return; + Standard_Integer anI, aJ, aNb = myStarts->Length(); + if (aNb == 0) return; Handle(Transfer_Binder) factice; - TransferMap amap (nb); - for (i = 1; i <= nb; i ++) { - j = amap.Add (thestarts->Value(i),factice); - SelectItem (j,!keep); + TransferMap amap (aNb); + for (anI = 1; anI <= aNb; anI ++) { + aJ = amap.Add (myStarts->Value(anI),factice); + SelectItem (aJ,!toKeep); } // Comparaison - nb = list->Length(); - for (i = 1; i <= nb; i ++) { - j = amap.FindIndex (list->Value(i)); - if (j > 0) SelectItem (j,keep); + aNb = theList->Length(); + for (anI = 1; anI <= aNb; anI ++) { + aJ = amap.FindIndex (theList->Value(anI)); + if (aJ > 0) SelectItem (aJ,toKeep); } } Standard_EXPORT Standard_Boolean HasStarting () const - { return (!thestarts.IsNull()); } + { + return (!myStarts.IsNull()); + } Standard_EXPORT const TheStart& Starting () const { - - if (thestarts.IsNull()) Standard_NoSuchObject::Raise + if (myStarts.IsNull()) Standard_NoSuchObject::Raise ("TransferIterator : No Starting defined at all"); - return thestarts->Value(thecurr); + return myStarts->Value(thecurr); } }; #endif \ No newline at end of file diff --git a/src/Transfer/Transfer_IteratorOfProcessForFinder.hxx b/src/Transfer/Transfer_IteratorOfProcessForFinder.hxx index 270ec7ec13..7f5fa188b0 100644 --- a/src/Transfer/Transfer_IteratorOfProcessForFinder.hxx +++ b/src/Transfer/Transfer_IteratorOfProcessForFinder.hxx @@ -54,11 +54,11 @@ class Transfer_IteratorOfProcessForFinder : public Transfer_Iterator { public: - Standard_EXPORT Transfer_IteratorOfProcessForFinder(const Standard_Boolean withstarts) + Standard_EXPORT Transfer_IteratorOfProcessForFinder(const Standard_Boolean theWithStarts) : Transfer_Iterator (withstarts) + Transfer_TransferMapOfProcessForFinder> (theWithStarts) { } }; diff --git a/src/Transfer/Transfer_IteratorOfProcessForTransient.hxx b/src/Transfer/Transfer_IteratorOfProcessForTransient.hxx index b3f8ba98b7..a8edfbe285 100644 --- a/src/Transfer/Transfer_IteratorOfProcessForTransient.hxx +++ b/src/Transfer/Transfer_IteratorOfProcessForTransient.hxx @@ -55,11 +55,11 @@ class Transfer_IteratorOfProcessForTransient : public Transfer_Iterator { public: - Standard_EXPORT Transfer_IteratorOfProcessForTransient(const Standard_Boolean withstarts) + Standard_EXPORT Transfer_IteratorOfProcessForTransient(const Standard_Boolean theWithStarts) : Transfer_Iterator (withstarts) + Transfer_TransferMapOfProcessForTransient> (theWithStarts) { } }; diff --git a/src/Transfer/Transfer_Mapper.hxx b/src/Transfer/Transfer_Mapper.hxx index 086d9f1ae5..b1fc373897 100644 --- a/src/Transfer/Transfer_Mapper.hxx +++ b/src/Transfer/Transfer_Mapper.hxx @@ -32,30 +32,36 @@ template class Transfer_Mapper : public Transfer_Finder { private: - TheKey theval; + TheKey myVal; public: - Standard_EXPORT Transfer_Mapper (const TheKey& akey) - : theval (akey) + Standard_EXPORT Transfer_Mapper (const TheKey& theKey) + : myVal (theKey) { - SetHashCode ( TheHasher::HashCode (akey, IntegerLast() ) ); + SetHashCode (TheHasher::HashCode (theKey, IntegerLast())); } Standard_EXPORT const TheKey& Value () const - { return theval; } + { + return myVal; + } - Standard_EXPORT Standard_Boolean Equates (const Handle(Transfer_Finder)& other) const + Standard_EXPORT Standard_Boolean Equates (const Handle(Transfer_Finder)& theOther) const { - if (other.IsNull()) return Standard_False; - if (GetHashCode() != other->GetHashCode()) return Standard_False; - if (other->DynamicType() != DynamicType()) return Standard_False; - MapperHandle another = MapperHandle::DownCast(other); - return TheHasher::IsEqual (theval,another->Value()); + if (theOther.IsNull()) return Standard_False; + if (GetHashCode() != theOther->GetHashCode()) return Standard_False; + if (theOther->DynamicType() != DynamicType()) return Standard_False; + MapperHandle another = MapperHandle::DownCast(theOther); + return TheHasher::IsEqual (myVal,another->Value()); } Standard_EXPORT Handle(Standard_Type) ValueType () const - { return TheInfo::Type(theval); } + { + return TheInfo::Type(myVal); + } Standard_EXPORT Standard_CString ValueTypeName () const - { return TheInfo::TypeName(theval); } + { + return TheInfo::TypeName(myVal); + } }; #endif \ No newline at end of file diff --git a/src/Transfer/Transfer_TransferProcess.hxx b/src/Transfer/Transfer_TransferProcess.hxx index e52b86efe5..80101ddd5c 100644 --- a/src/Transfer/Transfer_TransferProcess.hxx +++ b/src/Transfer/Transfer_TransferProcess.hxx @@ -82,7 +82,7 @@ //! - it produces a Binder, which is then recorded in the Map //! - of course, if the Transfer has been already done, it is not //! run once more : the first Result is available - //! - it is possible to re-evaluate the Result if required (i.e. + //! - it is possible to re-evaluate the Result if required (anI.e. //! if the definitive Result is known only once other Transfers //! have been engaged) //! - in the case of a second (or more) ask for Transfer, the @@ -115,31 +115,31 @@ template themap.NbBuckets()) themap.ReSize(nb); + if (theNb > myMap.NbBuckets()) + myMap.ReSize(theNb); } //======================================================================= @@ -241,13 +242,13 @@ public: //purpose : //======================================================================= - Standard_EXPORT void SetActor(const ActorHandle& actor) + Standard_EXPORT void SetActor(const ActorHandle& theActor) { - if (theactor == actor) return; - if (theactor.IsNull()) theactor = actor; - else if (actor.IsNull()) theactor = actor; // declenche RAZ - else if (theactor->IsLast()) { actor->SetNext(theactor); theactor = actor; } - else theactor->SetNext(actor); + if (myActor == theActor) return; + if (myActor.IsNull()) myActor = theActor; + else if (theActor.IsNull()) myActor = theActor; // declenche RAZ + else if (myActor->IsLast()) { theActor->SetNext(myActor); myActor = theActor; } + else myActor->SetNext(theActor); } @@ -258,7 +259,7 @@ public: Standard_EXPORT ActorHandle Actor () const { - return theactor; + return myActor; } @@ -273,19 +274,19 @@ public: //purpose : //======================================================================= - Standard_EXPORT Handle(Transfer_Binder) Find (const TheStart& start) const + Standard_EXPORT Handle(Transfer_Binder) Find (const TheStart& theStart) const { - if (thelastobj == start) { - //if (theindex > 0) return thelastbnd->Search(categ); //skl - if (theindex > 0) return thelastbnd; //skl + if (myLastObj == theStart) { + //if (myIndex > 0) return myLastBinder->Search(categ); //skl + if (myIndex > 0) return myLastBinder; //skl } - Standard_Integer index = themap.FindIndex (start); + Standard_Integer index = myMap.FindIndex (theStart); if (index > 0) { - const Handle(Transfer_Binder)& binder = themap.FindFromIndex(index); - //if (binder.IsNull()) //skl - return binder; - //return binder->Search(categ); //skl + const Handle(Transfer_Binder)& theBinder = myMap.FindFromIndex(index); + //if (theBinder.IsNull()) //skl + return theBinder; + //return theBinder->Search(categ); //skl } Handle(Transfer_Binder) nulbinder; return nulbinder; @@ -296,11 +297,11 @@ public: //purpose : //======================================================================= - Standard_EXPORT Standard_Boolean IsBound(const TheStart& start) const + Standard_EXPORT Standard_Boolean IsBound(const TheStart& theStart) const { - Handle(Transfer_Binder) binder = Find(start); //,categ); skl - if (binder.IsNull()) return Standard_False; - return binder->HasResult(); + Handle(Transfer_Binder) theBinder = Find(theStart); //,categ); skl + if (theBinder.IsNull()) return Standard_False; + return theBinder->HasResult(); } //======================================================================= @@ -308,16 +309,16 @@ public: //purpose : //======================================================================= - Standard_EXPORT Standard_Boolean IsAlreadyUsed(const TheStart& start) const + Standard_EXPORT Standard_Boolean IsAlreadyUsed(const TheStart& theStart) const // const Standard_Integer categ) const { - Handle(Transfer_Binder) binder = Find(start); - if (binder.IsNull()) { - StartTrace (binder,start,thelevel,4); + Handle(Transfer_Binder) theBinder = Find(theStart); + if (theBinder.IsNull()) { + StartTrace (theBinder,theStart,myLevel,4); Transfer_TransferFailure::Raise ("TransferProcess : IsAlreadyUsed, transfer not done cannot be used..."); } - return (binder->Status() == Transfer_StatusUsed); + return (theBinder->Status() == Transfer_StatusUsed); } //======================================================================= @@ -325,17 +326,17 @@ public: //purpose : //======================================================================= - Standard_EXPORT Handle(Transfer_Binder) FindAndMask(const TheStart& start) + Standard_EXPORT Handle(Transfer_Binder) FindAndMask(const TheStart& theStart) { - if (thelastobj == start) + if (myLastObj == theStart) { - if (theindex > 0) return thelastbnd; + if (myIndex > 0) return myLastBinder; } - thelastobj = start; - theindex = themap.FindIndex (start); - if (theindex > 0) thelastbnd = themap.FindFromIndex(theindex); - else thelastbnd.Nullify(); - return thelastbnd; + myLastObj = theStart; + myIndex = myMap.FindIndex (theStart); + if (myIndex > 0) myLastBinder = myMap.FindFromIndex(myIndex); + else myLastBinder.Nullify(); + return myLastBinder; } //======================================================================= @@ -343,40 +344,40 @@ public: //purpose : //======================================================================= - Standard_EXPORT void Bind (const TheStart& start, - const Handle(Transfer_Binder)& binder) + Standard_EXPORT void Bind (const TheStart& theStart, + const Handle(Transfer_Binder)& theBinder) { - if (binder.IsNull()) return; - Handle(Transfer_Binder) former = FindAndMask(start); - if (!former.IsNull()) + if (theBinder.IsNull()) return; + Handle(Transfer_Binder) aFormer = FindAndMask(theStart); + if (!aFormer.IsNull()) { - if (former->DynamicType() == STANDARD_TYPE(Transfer_VoidBinder)) + if (aFormer->DynamicType() == STANDARD_TYPE(Transfer_VoidBinder)) { - binder->Merge(former); - themap(theindex) = binder; // Substitution + theBinder->Merge(aFormer); + myMap(myIndex) = theBinder; // Substitution } - else if (former->Status() == Transfer_StatusUsed) + else if (aFormer->Status() == Transfer_StatusUsed) { - StartTrace (former,start,thelevel,4); + StartTrace (aFormer,theStart,myLevel,4); Transfer_TransferFailure::Raise ("TransferProcess : Bind, already Bound"); } else { - if (thetrace > 2) StartTrace (former,start,thelevel,5); - binder->CCheck()->GetMessages (former->Check()); + if (myTrace > 2) StartTrace (aFormer,theStart,myLevel,5); + theBinder->CCheck()->GetMessages (aFormer->Check()); } } - if (theindex == 0 || thelastbnd.IsNull()) + if (myIndex == 0 || myLastBinder.IsNull()) { - if (theindex == 0) theindex = themap.Add(start,binder); - else themap(theindex) = binder; - thelastbnd = binder; + if (myIndex == 0) myIndex = myMap.Add(theStart,theBinder); + else myMap(myIndex) = theBinder; + myLastBinder = theBinder; } else { - thelastbnd = binder; - themap(theindex) = binder; + myLastBinder = theBinder; + myMap(myIndex) = theBinder; } } @@ -385,10 +386,10 @@ public: //purpose : //======================================================================= - Standard_EXPORT void Rebind (const TheStart& start, - const Handle(Transfer_Binder)& binder) + Standard_EXPORT void Rebind (const TheStart& theStart, + const Handle(Transfer_Binder)& theBinder) { - Bind(start,binder); + Bind(theStart,theBinder); } //======================================================================= @@ -396,28 +397,28 @@ public: //purpose : //======================================================================= - Standard_EXPORT Standard_Boolean Unbind (const TheStart& start) + Standard_EXPORT Standard_Boolean Unbind (const TheStart& theStart) { - 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)) + Handle(Transfer_Binder) aFormer = FindAndMask(theStart); + if (myIndex == 0) return Standard_False; + if (aFormer.IsNull()) return Standard_False; + if (aFormer->DynamicType() == STANDARD_TYPE(Transfer_VoidBinder)) return Standard_True; - themap(theindex) = thelastbnd; - if (theroots.Contains(theindex)) + myMap(myIndex) = myLastBinder; + if (myRoots.Contains(myIndex)) { TColStd_IndexedMapOfInteger aNewRoots; - for (Standard_Integer i = 1; i <= theroots.Extent(); i++) - if (theindex!= theroots.FindKey(i)) - aNewRoots.Add(theroots.FindKey(i)); + for (Standard_Integer anI = 1; anI <= myRoots.Extent(); anI++) + if (myIndex!= myRoots.FindKey(anI)) + aNewRoots.Add(myRoots.FindKey(anI)); - theroots.Clear(); - theroots = aNewRoots; + myRoots.Clear(); + myRoots = aNewRoots; } - thelastobj.Nullify(); - thelastbnd.Nullify(); - theindex = 0; + myLastObj.Nullify(); + myLastBinder.Nullify(); + myIndex = 0; return Standard_True; } @@ -426,13 +427,13 @@ public: //purpose : //======================================================================= - Standard_EXPORT Handle(Transfer_Binder) FindElseBind(const TheStart& start) + Standard_EXPORT Handle(Transfer_Binder) FindElseBind(const TheStart& theStart) { - Handle(Transfer_Binder) binder = FindAndMask (start); - if (!binder.IsNull()) return binder; - binder = new Transfer_VoidBinder; - Bind(start,binder); - return binder; + Handle(Transfer_Binder) aBinder = FindAndMask (theStart); + if (!aBinder.IsNull()) return aBinder; + aBinder = new Transfer_VoidBinder; + Bind(theStart,aBinder); + return aBinder; } //======================================================================= @@ -440,12 +441,12 @@ public: //purpose : //======================================================================= - Standard_EXPORT void SetMessenger (const Handle(Message_Messenger)& messenger) + Standard_EXPORT void SetMessenger (const Handle(Message_Messenger)& theMessenger) { - if ( messenger.IsNull() ) - themessenger = Message::DefaultMessenger(); + if ( theMessenger.IsNull() ) + myMessenger = Message::DefaultMessenger(); else - themessenger = messenger; + myMessenger = theMessenger; } //======================================================================= @@ -455,7 +456,7 @@ public: Standard_EXPORT Handle(Message_Messenger) Messenger () const { - return themessenger; + return myMessenger; } //======================================================================= @@ -465,7 +466,7 @@ public: Standard_EXPORT void SetTraceLevel (const Standard_Integer tracelev) { - thetrace = tracelev; + myTrace = tracelev; } //======================================================================= @@ -475,7 +476,7 @@ public: Standard_EXPORT Standard_Integer TraceLevel () const { - return thetrace; + return myTrace; } //======================================================================= @@ -483,10 +484,10 @@ public: //purpose : //======================================================================= - Standard_EXPORT void SendFail (const TheStart& start, - const Message_Msg& amsg) + Standard_EXPORT void SendFail (const TheStart& theStart, + const Message_Msg& theMsg) { - AddFail(start,amsg); + AddFail(theStart,theMsg); } @@ -495,10 +496,10 @@ public: //purpose : //======================================================================= - Standard_EXPORT void SendWarning(const TheStart& start, - const Message_Msg& amsg) + Standard_EXPORT void SendWarning (const TheStart& theStart, + const Message_Msg& theMsg) { - AddWarning(start,amsg); + AddWarning(theStart,theMsg); } @@ -507,21 +508,21 @@ public: //purpose : //======================================================================= - Standard_EXPORT void SendMsg (const TheStart& start, - const Message_Msg& amsg) + Standard_EXPORT void SendMsg (const TheStart& theStart, + const Message_Msg& theMsg) { - Handle(Transfer_Binder) binder = FindAndMask(start); - if (binder.IsNull()) { - binder = new Transfer_VoidBinder; - Bind (start,binder); + Handle(Transfer_Binder) theBinder = FindAndMask(theStart); + if (theBinder.IsNull()) { + theBinder = new Transfer_VoidBinder; + Bind (theStart,theBinder); } // Feeds the trace: Rule causing (user messages) - if (thetrace > 0) { - StartTrace (binder,start,thelevel,6); - themessenger << amsg.Value(); - if (amsg.IsEdited()&&thetrace>2) - themessenger << " [from: " << amsg.Original() << "]"; - themessenger << endl; + if (myTrace > 0) { + StartTrace (theBinder,theStart,myLevel,6); + myMessenger << theMsg.Value(); + if (theMsg.IsEdited()&&myTrace>2) + myMessenger << " [from: " << theMsg.Original() << "]"; + myMessenger << endl; } } @@ -530,21 +531,21 @@ public: //purpose : //======================================================================= - Standard_EXPORT void AddFail (const TheStart& start, + Standard_EXPORT void AddFail (const TheStart& theStart, const Standard_CString mess, const Standard_CString orig) { - Handle(Transfer_Binder) binder = FindAndMask(start); - if (binder.IsNull()) { - binder = new Transfer_VoidBinder; - Bind (start,binder); + Handle(Transfer_Binder) theBinder = FindAndMask(theStart); + if (theBinder.IsNull()) { + theBinder = new Transfer_VoidBinder; + Bind (theStart,theBinder); } - 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; + theBinder->AddFail (mess,orig); + if (myTrace > 0) { + StartTrace (theBinder,theStart,myLevel,1); + myMessenger << " --> Fail : " << mess; + if (orig[0] != '\0'&&myTrace>2) myMessenger << " [from: " << orig << "]"; + myMessenger << endl; } } @@ -554,11 +555,11 @@ public: //purpose : //======================================================================= - Standard_EXPORT void AddError(const TheStart& start, + Standard_EXPORT void AddError(const TheStart& theStart, const Standard_CString mess, const Standard_CString orig) { - AddFail (start,mess,orig); + AddFail (theStart,mess,orig); } //======================================================================= @@ -566,12 +567,12 @@ public: //purpose : //======================================================================= - Standard_EXPORT void AddFail (const TheStart& start, - const Message_Msg& amsg) + Standard_EXPORT void AddFail (const TheStart& theStart, + const Message_Msg& theMsg) { - if (amsg.IsEdited()) AddFail (start,TCollection_AsciiString(amsg.Value()).ToCString(), - TCollection_AsciiString(amsg.Original()).ToCString()); - else AddFail (start,TCollection_AsciiString(amsg.Value()).ToCString()); + if (theMsg.IsEdited()) AddFail (theStart,TCollection_AsciiString(theMsg.Value()).ToCString(), + TCollection_AsciiString(theMsg.Original()).ToCString()); + else AddFail (theStart,TCollection_AsciiString(theMsg.Value()).ToCString()); } //======================================================================= @@ -579,21 +580,21 @@ public: //purpose : //======================================================================= - Standard_EXPORT void AddWarning (const TheStart& start, + Standard_EXPORT void AddWarning (const TheStart& theStart, const Standard_CString mess, const Standard_CString orig) { - Handle(Transfer_Binder) binder = FindAndMask(start); - if (binder.IsNull()) { - binder = new Transfer_VoidBinder; - Bind (start,binder); + Handle(Transfer_Binder) aBinder = FindAndMask(theStart); + if (aBinder.IsNull()) { + aBinder = new Transfer_VoidBinder; + Bind (theStart,aBinder); } - 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; + aBinder->AddWarning(mess,orig); + if (myTrace > 1) { + StartTrace (aBinder,theStart,myLevel,2); + myMessenger << " --> Warning : " << mess; + if (orig[0] != '\0'&&myTrace>2) myMessenger << " [from: " << orig << "]"; + myMessenger << endl; } } @@ -602,12 +603,12 @@ public: //purpose : //======================================================================= - Standard_EXPORT void AddWarning (const TheStart& start, - const Message_Msg& amsg) + Standard_EXPORT void AddWarning (const TheStart& theStart, + const Message_Msg& theMsg) { - if (amsg.IsEdited()) AddWarning (start,TCollection_AsciiString(amsg.Value()).ToCString(), - TCollection_AsciiString(amsg.Original()).ToCString()); - else AddWarning (start,TCollection_AsciiString(amsg.Value()).ToCString()); + if (theMsg.IsEdited()) AddWarning (theStart,TCollection_AsciiString(theMsg.Value()).ToCString(), + TCollection_AsciiString(theMsg.Original()).ToCString()); + else AddWarning (theStart,TCollection_AsciiString(theMsg.Value()).ToCString()); } //======================================================================= @@ -615,12 +616,12 @@ public: //purpose : //======================================================================= - Standard_EXPORT void Mend (const TheStart& start, + Standard_EXPORT void Mend (const TheStart& theStart, const Standard_CString pref) { - Handle(Transfer_Binder) binder = FindAndMask(start); - if (binder.IsNull()) return; - Handle(Interface_Check) ach = binder->CCheck(); + Handle(Transfer_Binder) aBinder = FindAndMask(theStart); + if (aBinder.IsNull()) return; + Handle(Interface_Check) ach = aBinder->CCheck(); ach->Mend (pref); } @@ -629,14 +630,14 @@ public: //purpose : //======================================================================= - Standard_EXPORT Handle(Interface_Check) Check(const TheStart& start) const + Standard_EXPORT Handle(Interface_Check) Check(const TheStart& theStart) const { - const Handle(Transfer_Binder)& binder = Find(start); - if (binder.IsNull()) { - Handle(Interface_Check) check; - return check; + const Handle(Transfer_Binder)& aBinder = Find(theStart); + if (aBinder.IsNull()) { + Handle(Interface_Check) aCheck; + return aCheck; } - return binder->Check(); + return aBinder->Check(); } // ## ## ## Actions sur Types Privilegies ## ## ## @@ -654,20 +655,20 @@ public: //purpose : //======================================================================= - Standard_EXPORT void BindTransient (const TheStart& start, + Standard_EXPORT void BindTransient (const TheStart& theStart, const Handle(Standard_Transient)& res) { if (res.IsNull()) return; - Handle(Transfer_Binder) former = Find(start);//,categ);skl - Handle(Transfer_SimpleBinderOfTransient) binder = - Handle(Transfer_SimpleBinderOfTransient)::DownCast(former); - if (!binder.IsNull()) { - if (binder->Status() == Transfer_StatusVoid) { binder->SetResult(res); return; } + Handle(Transfer_Binder) aFormer = Find(theStart);//,categ);skl + Handle(Transfer_SimpleBinderOfTransient) aBinder = + Handle(Transfer_SimpleBinderOfTransient)::DownCast(aFormer); + if (!aBinder.IsNull()) { + if (aBinder->Status() == Transfer_StatusVoid) { aBinder->SetResult(res); return; } } - binder = new Transfer_SimpleBinderOfTransient; - binder->SetResult (res); - if (former.IsNull()) Bind(start,binder); - else Rebind(start,binder); + aBinder = new Transfer_SimpleBinderOfTransient; + aBinder->SetResult (res); + if (aFormer.IsNull()) Bind(theStart,aBinder); + else Rebind(theStart,aBinder); } //======================================================================= @@ -676,13 +677,13 @@ public: //======================================================================= Standard_EXPORT const Handle(Standard_Transient)& FindTransient - (const TheStart& start) const + (const TheStart& theStart) const { - Handle(Transfer_SimpleBinderOfTransient) binder = - Handle(Transfer_SimpleBinderOfTransient)::DownCast(Find(start)); - if (binder.IsNull()) return nultrans; - if (!binder->HasResult()) return nultrans; - return binder->Result(); + Handle(Transfer_SimpleBinderOfTransient) aBinder = + Handle(Transfer_SimpleBinderOfTransient)::DownCast(Find(theStart)); + if (aBinder.IsNull()) return myNullTrans; + if (!aBinder->HasResult()) return myNullTrans; + return aBinder->Result(); } // Binding Multiple: D by BindMultiple declare the first (if not already done) @@ -693,16 +694,16 @@ public: //purpose : //======================================================================= - Standard_EXPORT void BindMultiple(const TheStart& start) + Standard_EXPORT void BindMultiple(const TheStart& theStart) { - Handle(Transfer_Binder) binder = FindAndMask (start); - if (!binder.IsNull()) { - if (!binder->IsKind(STANDARD_TYPE(Transfer_MultipleBinder))) { - StartTrace (thelastbnd,start,thelevel,4); + Handle(Transfer_Binder) aBinder = FindAndMask (theStart); + if (!aBinder.IsNull()) { + if (!aBinder->IsKind(STANDARD_TYPE(Transfer_MultipleBinder))) { + StartTrace (myLastBinder,theStart,myLevel,4); Transfer_TransferFailure::Raise ("TransferProcess : BindMultiple"); } } - else Bind(start,new Transfer_MultipleBinder); + else Bind(theStart,new Transfer_MultipleBinder); } //======================================================================= @@ -710,15 +711,15 @@ public: //purpose : //======================================================================= - Standard_EXPORT void AddMultiple(const TheStart& start, + Standard_EXPORT void AddMultiple(const TheStart& theStart, const Handle(Standard_Transient)& res) { - Handle(Transfer_Binder) binder = FindAndMask(start); + Handle(Transfer_Binder) aBinder = FindAndMask(theStart); Handle(Transfer_MultipleBinder) multr = - Handle(Transfer_MultipleBinder)::DownCast(binder); + Handle(Transfer_MultipleBinder)::DownCast(aBinder); if (multr.IsNull()) { - StartTrace (binder,start,thelevel,4); - if (binder.IsNull()) Transfer_TransferFailure::Raise + StartTrace (aBinder,theStart,myLevel,4); + if (aBinder.IsNull()) Transfer_TransferFailure::Raise ("TransferProcess : AddMultiple, nothing bound"); else Transfer_TransferFailure::Raise ("TransferProcess : AddMultiple, Binder not a MultipleBinder"); @@ -732,11 +733,11 @@ public: //======================================================================= Standard_EXPORT Standard_Boolean FindTypedTransient - (const TheStart& start, + (const TheStart& theStart, const Handle(Standard_Type)& atype, Handle(Standard_Transient)& val) const { - return GetTypedTransient (Find(start),atype,val); + return GetTypedTransient (Find(theStart),atype,val); } @@ -746,11 +747,11 @@ public: //======================================================================= Standard_EXPORT Standard_Boolean GetTypedTransient - (const Handle(Transfer_Binder)& binder, + (const Handle(Transfer_Binder)& aBinder, const Handle(Standard_Type)& atype, Handle(Standard_Transient)& val) const { - return Transfer_SimpleBinderOfTransient::GetTypedResult(binder,atype,val); + return Transfer_SimpleBinderOfTransient::GetTypedResult(aBinder,atype,val); } @@ -764,7 +765,7 @@ public: Standard_EXPORT Standard_Integer NbMapped () const { - return themap.Extent(); + return myMap.Extent(); } //======================================================================= @@ -774,7 +775,7 @@ public: Standard_EXPORT const TheStart& Mapped(const Standard_Integer num) const { - return themap.FindKey(num); + return myMap.FindKey(num); } //======================================================================= @@ -782,9 +783,9 @@ public: //purpose : //======================================================================= - Standard_EXPORT Standard_Integer MapIndex(const TheStart& start) const + Standard_EXPORT Standard_Integer MapIndex(const TheStart& theStart) const { - return themap.FindIndex(start); + return myMap.FindIndex(theStart); } //======================================================================= @@ -794,8 +795,8 @@ public: Standard_EXPORT Handle(Transfer_Binder) MapItem(const Standard_Integer num) const { - Handle(Transfer_Binder) binder = themap.FindFromIndex(num); - return binder; + Handle(Transfer_Binder) aBinder = myMap.FindFromIndex(num); + return aBinder; } @@ -807,15 +808,15 @@ public: //purpose : //======================================================================= - Standard_EXPORT void SetRoot (const TheStart& start) + Standard_EXPORT void SetRoot (const TheStart& theStart) { - Standard_Integer index = MapIndex(start); + Standard_Integer index = MapIndex(theStart); if (index == 0) { return; } - theroots.Add(index); - if (thetrace > 2) StartTrace (MapItem(index),start,thelevel,3); + myRoots.Add(index); + if (myTrace > 2) StartTrace (MapItem(index),theStart,myLevel,3); } //======================================================================= @@ -825,7 +826,7 @@ public: Standard_EXPORT void SetRootManagement(const Standard_Boolean stat) { - therootm = stat; + myToManageRoot = stat; } //======================================================================= @@ -835,7 +836,7 @@ public: Standard_EXPORT Standard_Integer NbRoots () const { - return theroots.Extent(); + return myRoots.Extent(); } //======================================================================= @@ -845,9 +846,9 @@ public: Standard_EXPORT const TheStart& Root(const Standard_Integer num) const { - Standard_Integer ind = 0; - if (num > 0 && num <= theroots.Extent()) ind = theroots.FindKey(num); - return themap.FindKey (ind); + Standard_Integer anInd = 0; + if (num > 0 && num <= myRoots.Extent()) anInd = myRoots.FindKey(num); + return myMap.FindKey (anInd); } //======================================================================= @@ -857,9 +858,9 @@ public: 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);//->Search(categ);skl + Standard_Integer anInd = 0; + if (num > 0 && num <= myRoots.Extent()) anInd = myRoots.FindKey(num); + return myMap.FindFromIndex(anInd);//->Search(categ);skl } //======================================================================= @@ -867,11 +868,11 @@ public: //purpose : //======================================================================= - Standard_EXPORT Standard_Integer RootIndex(const TheStart& start) const + Standard_EXPORT Standard_Integer RootIndex(const TheStart& theStart) const { - Standard_Integer index = MapIndex(start); + Standard_Integer index = MapIndex(theStart); if (index == 0) return 0; - return theroots.FindIndex(index); + return myRoots.FindIndex(index); } //======================================================================= @@ -881,7 +882,7 @@ public: Standard_EXPORT Standard_Integer NestingLevel () const { - return thelevel; + return myLevel; } //======================================================================= @@ -891,7 +892,7 @@ public: Standard_EXPORT void ResetNestingLevel () { - thelevel = 0; + myLevel = 0; } // ######################################################################## @@ -900,7 +901,7 @@ public: //====================================================================== //Purpose : gka TRJ9 for writing SDR for solid - // Check if binder has already been bound to the result binder. + // Check if aBinder has already been bound to the result aBinder. //====================================================================== // static Standard_Boolean Contains(const Handle(Transfer_Binder)& resbinder, @@ -923,186 +924,19 @@ public: //purpose : //======================================================================= - Standard_EXPORT Standard_Boolean Recognize(const TheStart& start) const + Standard_EXPORT Standard_Boolean Recognize(const TheStart& theStart) const { - ActorHandle actor = theactor; + ActorHandle aActor = myActor; // It scans up to have a next result - while (!actor.IsNull()) { - if (actor->Recognize (start)) return Standard_True; - actor = actor->Next(); + while (!aActor.IsNull()) + { + if (aActor->Recognize (theStart)) + return Standard_True; + aActor = aActor->Next(); } return Standard_False; } -// //======================================================================= -// //function : Transferring -// //purpose : -// //======================================================================= -// -// Standard_EXPORT Handle(Transfer_Binder) Transferring (const TheStart& start) -// { -// Handle(Transfer_Binder) former = FindAndMask(start); -// -// // Use more: note "AlreadyUsed" so result can not be changed -// if (!former.IsNull()) { -// if (former->HasResult()) { -// former->SetAlreadyUsed(); -// return former; -// } -// -// // Initial state: perhaps already done ... or infeasible -// Transfer_StatusExec statex = former->StatusExec(); -// switch (statex) { -// case Transfer_StatusInitial : // Transfer is prepared to do -// break; -// case Transfer_StatusDone : // Transfer was already done -// themessenger << " .. and Transfer done" << endl; -// return former; -// case Transfer_StatusRun : -// former->SetStatusExec(Transfer_StatusLoop); -// return former; -// case Transfer_StatusError : -// if (thetrace) { -// themessenger << " *** Transfer in Error Status :" << endl; -// StartTrace (former, start, thelevel,0); -// } -// else StartTrace (former, start,thelevel,4); -// Transfer_TransferFailure::Raise -// ("TransferProcess : Transfer in Error Status"); -// case Transfer_StatusLoop : // The loop is closed ... -// if (thetrace) { -// themessenger << " *** Transfer Head of Dead Loop :" << endl; -// StartTrace (former, start, thelevel,0); -// } -// else StartTrace (former, start,thelevel,4); -// Transfer_TransferDeadLoop::Raise -// ("TransferProcess : Transfer at Head of a Dead Loop"); -// } -//#ifdef TRANSLOG -// cout << "Transfer,level "<SetStatusExec(Transfer_StatusRun); -// } -//#ifdef TRANSLOG -// cout << " GO .." << endl; -//#endif -// -// Handle(Transfer_Binder) binder; -// Standard_Boolean newbind = Standard_False; -// if (theerrh) { -// // Transfer under protection exceptions (for notification actually) -// Standard_Integer oldlev = thelevel; -// try { -// OCC_CATCH_SIGNALS -// binder = TransferProduct(start); -// } -// catch (Transfer_TransferDeadLoop) { -// if (binder.IsNull()) { -// themessenger << " *** Dead Loop with no Result" << endl; -// if (thetrace) StartTrace (binder, start, thelevel-1,0); -// binder = new Transfer_VoidBinder; -// Bind (start,binder); newbind = Standard_True; -// } else if (binder->StatusExec() == Transfer_StatusLoop) { -// if (thetrace) { -// themessenger << " *** Dead Loop : Finding head of Loop :" << endl; -// StartTrace (binder, start, thelevel-1,0); -// } -// else StartTrace (binder, start,thelevel-1,4); -// Transfer_TransferFailure::Raise("TransferProcess : Head of Dead Loop"); -// } else { -// if (thetrace) { -// themessenger << " *** Dead Loop : Actor in Loop :" << endl; -// StartTrace (binder, start, 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 (start,binder); newbind = Standard_True; -// } -// binder->AddFail("Transfer stopped by exception raising"); -// if (thetrace) { -// themessenger << " *** Raised : " << Standard_Failure::Caught()->GetMessageString() << endl; -// StartTrace (binder, start, thelevel-1,4); -// } -// thelevel = oldlev; -// } -// } -// -// else binder = TransferProduct(start); -// -// // Conclusion : Noter dans la Map -// -// if (!newbind && !binder.IsNull()) { -// if (former.IsNull()) { -// if (!IsBound(start)) Bind(start,binder); // result = 0 category -// else { // gka TRJ9 for writing SDR for solid -// Rebind(start,binder); // test_pattern.sat -// } -// } -// else Rebind(start,binder); -//#ifdef TRANSLOG -// cout << " ... OK" << endl; -//#endif -// } -// 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 ); -// Handle(Transfer_Binder) nulbinder; -// return nulbinder; -// } -// -// // Manage Roots (if planned) -// if (therootl >= thelevel) { -// therootl = 0; -// if (therootm && binder->Status() != Transfer_StatusVoid) { -// SetRoot (start); -// } -// } -// return thelastbnd; -// } - - //Standard_EXPORT Handle(Transfer_Binder) TransferProduct (const TheStart& start) - //{ - // thelevel ++; // decrement and if == 0, root transfer - // Handle(Transfer_Binder) binder; - // ActorHandle actor = theactor; - // while (!actor.IsNull()) - // { - // if (actor->Recognize (start)) binder = actor->Transferring(start,this); - // else binder.Nullify(); - // if (!binder.IsNull()) break; - // actor = actor->Next(); - // } - // if (binder.IsNull()) { - // if (thelevel > 0) thelevel --; - // return binder; - // } - // // Managing the root level (.. a close look ..) - // if (therootl == 0 && binder->StatusExec() == Transfer_StatusDone) - // therootl = thelevel - 1; - - // if (thelevel > 0) thelevel --; - // return binder; - //} - - //======================================================================= - //function : Transfer - //purpose : - //======================================================================= - - //Standard_EXPORT Standard_Boolean Transfer(const TheStart& start) - //{ - // Handle(Transfer_Binder) binder = Transferring(start); - // return (!binder.IsNull()); - //} - // ######################################################################### // .... Error Handling + Trace .... @@ -1111,9 +945,9 @@ public: //purpose : //======================================================================= - Standard_EXPORT void SetErrorHandle(const Standard_Boolean err) + Standard_EXPORT void SetErrorHandle(const Standard_Boolean isError) { - theerrh = err; + myToHandleErr = isError; } //======================================================================= @@ -1123,7 +957,7 @@ public: Standard_EXPORT Standard_Boolean ErrorHandle() const { - return theerrh; + return myToHandleErr; } //======================================================================= @@ -1131,38 +965,38 @@ public: //purpose : //======================================================================= - Standard_EXPORT void StartTrace(const Handle(Transfer_Binder)& binder, - const TheStart& 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"; + Standard_EXPORT void StartTrace(const Handle(Transfer_Binder)& theBinder, + const TheStart& theStart, + const Standard_Integer theLevel, + const Standard_Integer theMode) const + { + // ### Fail (Roots:50) -- Start theStart->DynamicType() + // ### Fail (Roots:50) -- Start id:#label.. Type:theStart->DynamicType() + if (myTrace > 3) { // Internal to be switch when searching bug (trace >= 4) + if (theMode == 1) myMessenger << " ### Fail"; + if (theMode == 2) myMessenger << " ### Warning"; + if (theMode == 3) myMessenger << " ### New Root n0 " << myRoots.Extent(); + if (theMode == 4) myMessenger << " ### Exception"; + if (theMode == 5) myMessenger << " ### Substitution"; + if (theMode == 6) myMessenger << " ### Information"; + if (theLevel > 1) + myMessenger << " (nested)"; // " at nesting Level:"<= 0 && theMode != 3) + myMessenger << " at " << myRoots.Extent() << " Roots"; } - if (!start.IsNull()) PrintTrace (start,themessenger); + if (!theStart.IsNull()) PrintTrace (theStart,myMessenger); - if (!binder.IsNull()) { // old: if IsNull sout <Status() != Transfer_StatusVoid) { - // --- Result Type: binder->ResultType() --- Binder : binder->DynamicType(); + // --- Result Type: theBinder->ResultType() --- Binder : theBinder->DynamicType(); if (!hasres) - themessenger << "\n --- Result Type : "; + myMessenger << "\n --- Result Type : "; else - themessenger << " , "; - themessenger << bnd->ResultTypeName(); + myMessenger << " , "; + myMessenger << bnd->ResultTypeName(); // CKY 9-JAN-1999: waiting for XSTEP Kernel message (not IGES_2075) /* Message_Msg Msg2075("IGES_2075"); Msg2075.AddString(bnd->ResultTypeName()); @@ -1172,8 +1006,8 @@ public: } bnd = bnd->NextResult(); } - if (!hasres && mode > 2) { - themessenger << "\n --- No Result recorded"; + if (!hasres && theMode > 2) { + myMessenger << "\n --- No Result recorded"; // CKY 9-JAN-1999 : waiting for XSTEP Kernel message // (not IGES_2075, no reference to specifically TopoDS_Shape) /* Message_Msg Msg2075("IGES_2075"); @@ -1182,7 +1016,7 @@ public: } //old if (isused) sout << " -- (Already Used in another Transfer)"; } - themessenger << endl; + myMessenger << endl; } @@ -1191,10 +1025,11 @@ public: //purpose : //======================================================================= - Standard_EXPORT void PrintTrace(const TheStart& start, - const Handle(Message_Messenger)& S) const + Standard_EXPORT void PrintTrace(const TheStart& theStart, + const Handle(Message_Messenger)& theMessenger) const { - if (!start.IsNull()) S <<" Type:" << start->DynamicType()->Name(); + if (!theStart.IsNull()) + theMessenger <<" Type:" << theStart->DynamicType()->Name(); } //======================================================================= @@ -1202,8 +1037,10 @@ public: //purpose : //======================================================================= - Standard_EXPORT Standard_Boolean IsLooping (const Standard_Integer alevel) const - { return alevel > NbMapped(); } + Standard_EXPORT Standard_Boolean IsLooping (const Standard_Integer theLevel) const + { + return theLevel > NbMapped(); + } // ######################################################################### // .... RESULTS .... @@ -1213,16 +1050,16 @@ public: //purpose : //======================================================================= - Standard_EXPORT Iterator RootResult(const Standard_Boolean withstart = Standard_False) const + Standard_EXPORT Iterator RootResult (const Standard_Boolean isWithStart = Standard_False) const { - Iterator iter(withstart); - Standard_Integer max = theroots.Extent(); - for (Standard_Integer j = 1; j <= max; j ++) { - Standard_Integer i = theroots.FindKey(j); - Handle(Transfer_Binder) binder = MapItem(i); - if (binder.IsNull()) continue; - if (withstart) iter.Add (binder,Mapped(i)); - else iter.Add (binder); + Iterator iter(isWithStart); + Standard_Integer aMax = myRoots.Extent(); + for (Standard_Integer aJ = 1; aJ <= aMax; aJ ++) { + Standard_Integer anI = myRoots.FindKey(aJ); + Handle(Transfer_Binder) aBinder = MapItem(anI); + if (aBinder.IsNull()) continue; + if (isWithStart) iter.Add (aBinder,Mapped(anI)); + else iter.Add (aBinder); } return iter; } @@ -1232,15 +1069,15 @@ public: //purpose : All Results //======================================================================= - Standard_EXPORT Iterator CompleteResult (const Standard_Boolean withstart = Standard_False) const + Standard_EXPORT Iterator CompleteResult (const Standard_Boolean isWithStart = Standard_False) const { - Iterator iter(withstart); - Standard_Integer max = NbMapped(); - for (Standard_Integer i = 1; i <= max; i ++) { - Handle(Transfer_Binder) binder = MapItem(i); - if (binder.IsNull()) continue; - if (withstart) iter.Add (binder,Mapped(i)); - else iter.Add (binder); + Iterator iter(isWithStart); + Standard_Integer aMax = NbMapped(); + for (Standard_Integer anI = 1; anI <= aMax; anI ++) { + Handle(Transfer_Binder) aBinder = MapItem(anI); + if (aBinder.IsNull()) continue; + if (isWithStart) iter.Add (aBinder,Mapped(anI)); + else iter.Add (aBinder); } return iter; } @@ -1253,13 +1090,13 @@ public: Standard_EXPORT Iterator AbnormalResult() const { Iterator iter(Standard_True); - Standard_Integer 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(); - if (statex != Transfer_StatusInitial && statex != Transfer_StatusDone) - iter.Add (binder,Mapped(i)); // on note les cas "pas normaux" + Standard_Integer aMax = NbMapped(); + for (Standard_Integer anI = 1; anI <= aMax; anI ++) { + Handle(Transfer_Binder) aBinder = MapItem(anI); + if (aBinder.IsNull()) continue; + Transfer_StatusExec aStatExec = aBinder->StatusExec(); + if (aStatExec != Transfer_StatusInitial && aStatExec != Transfer_StatusDone) + iter.Add (aBinder,Mapped(anI)); // on note les cas "pas normaux" } return iter; } @@ -1269,24 +1106,24 @@ public: //purpose : //======================================================================= - Standard_EXPORT Interface_CheckIterator CheckList (const Standard_Boolean erronly) const + Standard_EXPORT Interface_CheckIterator CheckList (const Standard_Boolean isErrOnly) 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 TheStart& ent = Mapped(i); + Standard_Integer num, aMax = NbMapped(); + for (Standard_Integer anI = 1; anI <= aMax; anI ++) { + Handle(Transfer_Binder) aBinder = MapItem(anI); + if (aBinder.IsNull()) continue; + Transfer_StatusExec aStatExec = aBinder->StatusExec(); + Handle(Interface_Check) aCheck = aBinder->Check(); + if (aStatExec != Transfer_StatusInitial && aStatExec != Transfer_StatusDone && + !aCheck->HasFailed()) + aCheck->AddFail("Transfer in Abnormal Status (!= Initial or Done)"); + if (!aCheck->HasFailed() && (isErrOnly || aCheck->NbWarnings() == 0)) continue; + const TheStart& ent = Mapped(anI); num = CheckNum(ent); - if (num == 0) num = i; - check->SetEntity(ent); - list.Add(check,num); + if (num == 0) num = anI; + aCheck->SetEntity(ent); + list.Add(aCheck,num); } return list; } @@ -1299,24 +1136,24 @@ public: //purpose : //======================================================================= - Standard_EXPORT Iterator ResultOne (const TheStart& start, - const Standard_Integer level, - const Standard_Boolean withstart = Standard_False) const + Standard_EXPORT Iterator ResultOne (const TheStart& theStart, + const Standard_Integer theLevel, + const Standard_Boolean isWithStart = Standard_False) const { - Iterator iter(withstart); - Standard_Integer max = NbMapped(); - Standard_Integer ind = MapIndex (start); - if (ind == 0) return iter; - Standard_Integer i1 = (level == 0 ? ind : 1); - Standard_Integer i2 = (level == 0 ? ind : max); + Iterator iter(isWithStart); + Standard_Integer aMax = NbMapped(); + Standard_Integer anInd = MapIndex (theStart); + if (anInd == 0) return iter; + Standard_Integer i1 = (theLevel == 0 ? anInd : 1); + Standard_Integer i2 = (theLevel == 0 ? anInd : aMax); Handle(TColStd_HArray1OfInteger) map = new TColStd_HArray1OfInteger (i1,i2,0); - for (Standard_Integer i = i1; i <= i2; i ++) { - ind = map->Value(i); - if (ind == 0) continue; - Handle(Transfer_Binder) binder = MapItem(i); - if (binder.IsNull()) continue; - if (withstart) iter.Add (binder,Mapped(ind)); - else iter.Add (binder); + for (Standard_Integer anI = i1; anI <= i2; anI ++) { + anInd = map->Value(anI); + if (anInd == 0) continue; + Handle(Transfer_Binder) aBinder = MapItem(anI); + if (aBinder.IsNull()) continue; + if (isWithStart) iter.Add (aBinder,Mapped(anInd)); + else iter.Add (aBinder); } return iter; } @@ -1327,34 +1164,34 @@ public: //======================================================================= Standard_EXPORT Interface_CheckIterator CheckListOne - (const TheStart& start,const Standard_Integer level, - const Standard_Boolean erronly) const + (const TheStart& theStart,const Standard_Integer theLevel, + const Standard_Boolean isErrOnly) const { - Interface_CheckIterator list; - Standard_Integer max = NbMapped(); - Standard_Integer num, ind = MapIndex (start); - if (ind == 0) return list; - Standard_Integer i1 = (level == 0 ? ind : 1); - Standard_Integer i2 = (level == 0 ? ind : max); + Interface_CheckIterator aList; + Standard_Integer aMax = NbMapped(); + Standard_Integer aNum, anInd = MapIndex (theStart); + if (anInd == 0) return aList; + Standard_Integer i1 = (theLevel == 0 ? anInd : 1); + Standard_Integer i2 = (theLevel == 0 ? anInd : aMax); Handle(TColStd_HArray1OfInteger) map = new TColStd_HArray1OfInteger (i1,i2,0); - for (Standard_Integer i = i1; i <= i2; i ++) { - ind = map->Value(i); - if (ind == 0) continue; - Handle(Transfer_Binder) binder = MapItem(ind); - 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 TheStart& ent = Mapped(ind); - num = CheckNum(ent); if (num == 0) num = ind; - check->SetEntity(ent); - list.Add(check,num); + for (Standard_Integer anI = i1; anI <= i2; anI ++) { + anInd = map->Value(anI); + if (anInd == 0) continue; + Handle(Transfer_Binder) aBinder = MapItem(anInd); + if (aBinder.IsNull()) continue; + Transfer_StatusExec aStatExec = aBinder->StatusExec(); + Handle(Interface_Check) aCheck = aBinder->Check(); + if (aStatExec != Transfer_StatusInitial && aStatExec != Transfer_StatusDone && + !aCheck->HasFailed()) + aCheck->AddFail("Transfer in Abnormal Status (!= Initial or Done)"); + if (!aCheck->HasFailed() && (isErrOnly || aCheck->NbWarnings() == 0)) continue; + const TheStart& anEnt = Mapped(anInd); + aNum = CheckNum(anEnt); if (aNum == 0) aNum = anInd; + aCheck->SetEntity(anEnt); + aList.Add(aCheck,aNum); } - return list; + return aList; } //======================================================================= @@ -1363,27 +1200,27 @@ public: //======================================================================= Standard_EXPORT Standard_Boolean IsCheckListEmpty - (const TheStart& start, const Standard_Integer level, - const Standard_Boolean erronly) const - { - Standard_Integer max = NbMapped(); - Standard_Integer ind = MapIndex (start); - if (ind == 0) return Standard_False; - Standard_Integer i1 = (level == 0 ? ind : 1); - Standard_Integer i2 = (level == 0 ? ind : max); + (const TheStart& theStart, const Standard_Integer theLevel, + const Standard_Boolean isErrOnly) const + { + Standard_Integer aMax = NbMapped(); + Standard_Integer anInd = MapIndex (theStart); + if (anInd == 0) return Standard_False; + Standard_Integer i1 = (theLevel == 0 ? anInd : 1); + Standard_Integer i2 = (theLevel == 0 ? anInd : aMax); Handle(TColStd_HArray1OfInteger) map = new TColStd_HArray1OfInteger (i1,i2,0); - for (Standard_Integer i = i1; i <= i2; i ++) { - ind = map->Value(i); - if (ind == 0) continue; - Handle(Transfer_Binder) binder = MapItem(ind); - if (binder.IsNull()) continue; + for (Standard_Integer anI = i1; anI <= i2; anI ++) { + anInd = map->Value(anI); + if (anInd == 0) continue; + Handle(Transfer_Binder) aBinder = MapItem(anInd); + if (aBinder.IsNull()) continue; - Transfer_StatusExec statex = binder->StatusExec(); - Handle(Interface_Check) check = binder->Check(); - if (statex != Transfer_StatusInitial && statex != Transfer_StatusDone) + Transfer_StatusExec aStatExec = aBinder->StatusExec(); + Handle(Interface_Check) aCheck = aBinder->Check(); + if (aStatExec != Transfer_StatusInitial && aStatExec != Transfer_StatusDone) return Standard_False; - if (check->HasFailed() || (!erronly && check->NbWarnings() > 0)) return Standard_False; + if (aCheck->HasFailed() || (!isErrOnly && aCheck->NbWarnings() > 0)) return Standard_False; } return Standard_True; } @@ -1393,23 +1230,23 @@ public: //purpose : //======================================================================= - Standard_EXPORT void RemoveResult(const TheStart& start, - const Standard_Integer level, - const Standard_Boolean compute = Standard_True) + Standard_EXPORT void RemoveResult (const TheStart& theStart, + const Standard_Integer theLevel, + const Standard_Boolean toCompute = Standard_True) { - Standard_Integer max = NbMapped(); - Standard_Integer ind = MapIndex (start); - if (ind == 0) return; - Standard_Integer i1 = (level == 0 ? ind : 1); - Standard_Integer i2 = (level == 0 ? ind : max); + Standard_Integer aMax = NbMapped(); + Standard_Integer anInd = MapIndex (theStart); + if (anInd == 0) return; + Standard_Integer i1 = (theLevel == 0 ? anInd : 1); + Standard_Integer i2 = (theLevel == 0 ? anInd : aMax); Handle(TColStd_HArray1OfInteger) map = new TColStd_HArray1OfInteger (i1,i2,0); - Standard_Integer i; // svv Jan11 2000 : porting on DEC - for (i = i1; i <= i2; i ++) { - ind = map->Value(i); - if (ind == 0) continue; - Handle(Transfer_Binder) binder = MapItem(ind); - if (binder.IsNull()) continue; + Standard_Integer anI; // svv Jan11 2000 : porting on DEC + for (anI = i1; anI <= i2; anI ++) { + anInd = map->Value(anI); + if (anInd == 0) continue; + Handle(Transfer_Binder) aBinder = MapItem(anInd); + if (aBinder.IsNull()) continue; } } diff --git a/src/Transfer/Transfer_TransientProcess.cxx b/src/Transfer/Transfer_TransientProcess.cxx index 2e474e7c99..41aa671743 100755 --- a/src/Transfer/Transfer_TransientProcess.cxx +++ b/src/Transfer/Transfer_TransientProcess.cxx @@ -49,21 +49,20 @@ IMPLEMENT_STANDARD_RTTI(Transfer_TransientProcess) //======================================================================= Transfer_TransientProcess::Transfer_TransientProcess - (const Standard_Integer nb) : Transfer_TransferProcess (nb) + (const Standard_Integer theNb) : Transfer_TransferProcess (theNb) { - thetrroots = new TColStd_HSequenceOfTransient; + theTrRoots = new TColStd_HSequenceOfTransient; } - //======================================================================= //function : SetModel //purpose : //======================================================================= void Transfer_TransientProcess::SetModel - (const Handle(Interface_InterfaceModel)& model) + (const Handle(Interface_InterfaceModel)& theModel) { - themodel = model; + myModel = theModel; } @@ -74,17 +73,17 @@ void Transfer_TransientProcess::SetModel Handle(Interface_InterfaceModel) Transfer_TransientProcess::Model () const { - return themodel; + return myModel; } -void Transfer_TransientProcess::SetGraph(const Handle(Interface_HGraph)& HG) +void Transfer_TransientProcess::SetGraph(const Handle(Interface_HGraph)& theHGraph) { - thegraph = HG; - if (!thegraph.IsNull()) - SetModel(thegraph->Graph().Model()); + myGraph = theHGraph; + if (!myGraph.IsNull()) + SetModel(myGraph->Graph().Model()); else - themodel.Nullify(); + myModel.Nullify(); } @@ -95,7 +94,7 @@ void Transfer_TransientProcess::SetGraph(const Handle(Interface_HGraph)& HG) Standard_Boolean Transfer_TransientProcess::HasGraph () const { - return !thegraph.IsNull(); + return !myGraph.IsNull(); } @@ -106,7 +105,7 @@ Standard_Boolean Transfer_TransientProcess::HasGraph () const Handle(Interface_HGraph) Transfer_TransientProcess::HGraph () const { - return thegraph; + return myGraph; } @@ -117,7 +116,7 @@ Handle(Interface_HGraph) Transfer_TransientProcess::HGraph () const const Interface_Graph& Transfer_TransientProcess::Graph () const { - return thegraph->Graph(); + return myGraph->Graph(); } @@ -126,11 +125,11 @@ const Interface_Graph& Transfer_TransientProcess::Graph () const //purpose : //======================================================================= -void Transfer_TransientProcess::SetContext(const Standard_CString name, - const Handle(Standard_Transient)& ctx) +void Transfer_TransientProcess::SetContext(const Standard_CString theName, + const Handle(Standard_Transient)& theCtx) { - if (thectx.IsNull()) thectx = new Dico_DictionaryOfTransient; - thectx->SetItem (name,ctx); + if (myCtx.IsNull()) myCtx = new Dico_DictionaryOfTransient; + myCtx->SetItem (theName,theCtx); } @@ -140,15 +139,15 @@ void Transfer_TransientProcess::SetContext(const Standard_CString name, //======================================================================= Standard_Boolean Transfer_TransientProcess::GetContext - (const Standard_CString name, const Handle(Standard_Type)& type, - Handle(Standard_Transient)& ctx) const + (const Standard_CString theName, const Handle(Standard_Type)& theType, + Handle(Standard_Transient)& theCtx) const { - if (thectx.IsNull()) return Standard_False; - if (!thectx->GetItem (name,ctx)) ctx.Nullify(); - if (ctx.IsNull()) return Standard_False; - if (type.IsNull()) return Standard_True; - if (!ctx->IsKind(type)) ctx.Nullify(); - return !ctx.IsNull(); + if (myCtx.IsNull()) return Standard_False; + if (!myCtx->GetItem (theName,theCtx)) theCtx.Nullify(); + if (theCtx.IsNull()) return Standard_False; + if (theType.IsNull()) return Standard_True; + if (!theCtx->IsKind(theType)) theCtx.Nullify(); + return !theCtx.IsNull(); } @@ -159,7 +158,7 @@ Standard_Boolean Transfer_TransientProcess::GetContext Handle(Dico_DictionaryOfTransient)& Transfer_TransientProcess::Context () { - return thectx; + return myCtx; } @@ -169,17 +168,17 @@ Handle(Dico_DictionaryOfTransient)& Transfer_TransientProcess::Context () //======================================================================= void Transfer_TransientProcess::PrintTrace - (const Handle(Standard_Transient)& start, const Handle(Message_Messenger)& S) const + (const Handle(Standard_Transient)& theStart, const Handle(Message_Messenger)& theMessenger) const { - if (!start.IsNull()) { - S << "Entity "; - if (!themodel.IsNull()) { - themodel->Print (start,S,1); -// S<<"id "; themodel->Print (start,S); -// S<<" Type:"<TypeName (start); + if (!theStart.IsNull()) { + theMessenger << "Entity "; + if (!myModel.IsNull()) { + myModel->Print (theStart,theMessenger,1); +// theMessenger<<"id "; myModel->Print (theStart,theMessenger); +// theMessenger<<" Type:"<TypeName (theStart); } - else S<<" Type:"<< Interface_InterfaceModel::ClassName(start->DynamicType()->Name()); - // << start (handle) ?? + else theMessenger<<" Type:"<< Interface_InterfaceModel::ClassName(theStart->DynamicType()->Name()); + // << theStart (handle) ?? } } @@ -190,9 +189,9 @@ void Transfer_TransientProcess::PrintTrace //======================================================================= Standard_Integer Transfer_TransientProcess::CheckNum - (const Handle(Standard_Transient)& start) const + (const Handle(Standard_Transient)& theStart) const { - return (themodel.IsNull() ? 0 : themodel->Number(start)); + return (myModel.IsNull() ? 0 : myModel->Number(theStart)); } @@ -202,12 +201,12 @@ Standard_Integer Transfer_TransientProcess::CheckNum //======================================================================= Interface_EntityIterator Transfer_TransientProcess::TypedSharings - (const Handle(Standard_Transient)& start, - const Handle(Standard_Type)& type) const + (const Handle(Standard_Transient)& theStart, + const Handle(Standard_Type)& theType) const { Interface_EntityIterator iter; - if (thegraph.IsNull()) return iter; - return thegraph->Graph().TypedSharings (start,type); + if (myGraph.IsNull()) return iter; + return myGraph->Graph().TypedSharings (theStart,theType); } @@ -217,13 +216,13 @@ Interface_EntityIterator Transfer_TransientProcess::TypedSharings //======================================================================= Standard_Boolean Transfer_TransientProcess::IsDataLoaded - (const Handle(Standard_Transient)& start) const + (const Handle(Standard_Transient)& theStart) const { - if (themodel.IsNull()) return Standard_True; - Standard_Integer num = themodel->Number(start); - if (num == 0) return Standard_True; - if (themodel->IsUnknownEntity(num)) return Standard_False; - return !themodel->IsRedefinedContent(num); + if (myModel.IsNull()) return Standard_True; + Standard_Integer aNum = myModel->Number(theStart); + if (aNum == 0) return Standard_True; + if (myModel->IsUnknownEntity(aNum)) return Standard_False; + return !myModel->IsRedefinedContent(aNum); } @@ -233,14 +232,14 @@ Standard_Boolean Transfer_TransientProcess::IsDataLoaded //======================================================================= Standard_Boolean Transfer_TransientProcess::IsDataFail - (const Handle(Standard_Transient)& start) const + (const Handle(Standard_Transient)& theStart) const { - if (themodel.IsNull()) return Standard_False; - Standard_Integer num = themodel->Number(start); - if (num == 0) return Standard_False; - if (themodel->IsErrorEntity(num)) return Standard_True; - const Handle(Interface_Check) ach = themodel->Check(num,Standard_False); // semantic - return ach->HasFailed(); + if (myModel.IsNull()) return Standard_False; + Standard_Integer aNum = myModel->Number(theStart); + if (aNum == 0) return Standard_False; + if (myModel->IsErrorEntity(aNum)) return Standard_True; + const Handle(Interface_Check) aCheck = myModel->Check(aNum,Standard_False); // semantic + return aCheck->HasFailed(); } @@ -250,42 +249,42 @@ Standard_Boolean Transfer_TransientProcess::IsDataFail //======================================================================= void Transfer_TransientProcess::PrintStats(const Standard_Integer /*mode*/, - const Handle(Message_Messenger)& S) const + const Handle(Message_Messenger)& theMessenger) const { - S<<"\n*******************************************************************\n"; + theMessenger<<"\n*******************************************************************\n"; // if (mode == 1) { // Statistiques de base - S << "******** Basic Statistics ********"<NbEntities()<Check(); - Transfer_StatusExec stat = binder->StatusExec(); - if (stat != Transfer_StatusInitial && stat != Transfer_StatusDone) - nbe ++; + theMessenger<<"**** Nb Entities : "<< aModel->NbEntities()<Check(); + Transfer_StatusExec aStatus = aBinder->StatusExec(); + if (aStatus != Transfer_StatusInitial && aStatus != Transfer_StatusDone) + aNbe ++; else { - if (ach->NbWarnings() > 0) nbw ++; - if (binder->HasResult()) nbr ++; + if (aCheck->NbWarnings() > 0) aNbw ++; + if (aBinder->HasResult()) aNbr ++; } } - if (nbr > nbroots) - S<<"**** ( Itermediate Results : "< 0) - S<<"**** Errors on : "< 0) - S<<"**** Warnings on : "< aNbRoots) + theMessenger<<"**** ( Itermediate Results : "< 0) + theMessenger<<"**** Errors on : "< 0) + theMessenger<<"**** Warnings on : "<Recognize (start)) binder = actor->Transferring(start,this); - else binder.Nullify(); - if (!binder.IsNull()) break; - actor = actor->Next(); + if (anActor->Recognize (theStart)) aBinder = anActor->Transferring(theStart,this); + else aBinder.Nullify(); + if (!aBinder.IsNull()) break; + anActor = anActor->Next(); } - if (binder.IsNull()) { - if (thelevel > 0) thelevel --; - return binder; + if (aBinder.IsNull()) { + if (myLevel > 0) myLevel --; + return aBinder; } // Managing the root level (.. a close look ..) - if (therootl == 0 && binder->StatusExec() == Transfer_StatusDone) - therootl = thelevel - 1; + if (myRootLevel == 0 && aBinder->StatusExec() == Transfer_StatusDone) + myRootLevel = myLevel - 1; - if (thelevel > 0) thelevel --; - return binder; + if (myLevel > 0) myLevel --; + return aBinder; } //======================================================================= @@ -332,138 +331,138 @@ Handle(TColStd_HSequenceOfTransient) Transfer_TransientProcess::RootsForTransfer //purpose : //======================================================================= - Handle(Transfer_Binder) Transfer_TransientProcess::Transferring (const Handle(Standard_Transient)& start) + Handle(Transfer_Binder) Transfer_TransientProcess::Transferring (const Handle(Standard_Transient)& theStart) { - Handle(Transfer_Binder) former = FindAndMask(start); + Handle(Transfer_Binder) aFormer = FindAndMask(theStart); // Use more: note "AlreadyUsed" so result can not be changed - if (!former.IsNull()) { - if (former->HasResult()) { - former->SetAlreadyUsed(); - return former; + if (!aFormer.IsNull()) { + if (aFormer->HasResult()) { + aFormer->SetAlreadyUsed(); + return aFormer; } // Initial state: perhaps already done ... or infeasible - Transfer_StatusExec statex = former->StatusExec(); + Transfer_StatusExec statex = aFormer->StatusExec(); switch (statex) { case Transfer_StatusInitial : // Transfer is prepared to do break; case Transfer_StatusDone : // Transfer was already done - themessenger << " .. and Transfer done" << endl; - return former; + myMessenger << " .. and Transfer done" << endl; + return aFormer; case Transfer_StatusRun : - former->SetStatusExec(Transfer_StatusLoop); - return former; + aFormer->SetStatusExec(Transfer_StatusLoop); + return aFormer; case Transfer_StatusError : - if (thetrace) { - themessenger << " *** Transfer in Error Status :" << endl; - StartTrace (former, start, thelevel,0); + if (myTrace) { + myMessenger << " *** Transfer in Error Status :" << endl; + StartTrace (aFormer, theStart, myLevel,0); } - else StartTrace (former, start,thelevel,4); + else StartTrace (aFormer, theStart,myLevel,4); Transfer_TransferFailure::Raise ("TransferProcess : Transfer in Error Status"); case Transfer_StatusLoop : // The loop is closed ... - if (thetrace) { - themessenger << " *** Transfer Head of Dead Loop :" << endl; - StartTrace (former, start, thelevel,0); + if (myTrace) { + myMessenger << " *** Transfer Head of Dead Loop :" << endl; + StartTrace (aFormer, theStart, myLevel,0); } - else StartTrace (former, start,thelevel,4); + else StartTrace (aFormer, theStart,myLevel,4); Transfer_TransferDeadLoop::Raise ("TransferProcess : Transfer at Head of a Dead Loop"); } #ifdef TRANSLOG - cout << "Transfer,level "<SetStatusExec(Transfer_StatusRun); + aFormer->SetStatusExec(Transfer_StatusRun); } #ifdef TRANSLOG cout << " GO .." << endl; #endif - Handle(Transfer_Binder) binder; - Standard_Boolean newbind = Standard_False; - if (theerrh) { + Handle(Transfer_Binder) aBinder; + Standard_Boolean isNewBind = Standard_False; + if (myToHandleErr) { // Transfer under protection exceptions (for notification actually) - Standard_Integer oldlev = thelevel; + Standard_Integer anOldLevel = myLevel; try { OCC_CATCH_SIGNALS - binder = TransferProduct(start); + aBinder = TransferProduct(theStart); } catch (Transfer_TransferDeadLoop) { - if (binder.IsNull()) { - themessenger << " *** Dead Loop with no Result" << endl; - if (thetrace) StartTrace (binder, start, thelevel-1,0); - binder = new Transfer_VoidBinder; - Bind (start,binder); newbind = Standard_True; - } else if (binder->StatusExec() == Transfer_StatusLoop) { - if (thetrace) { - themessenger << " *** Dead Loop : Finding head of Loop :" << endl; - StartTrace (binder, start, thelevel-1,0); + if (aBinder.IsNull()) { + myMessenger << " *** Dead Loop with no Result" << endl; + if (myTrace) StartTrace (aBinder, theStart, myLevel-1,0); + aBinder = new Transfer_VoidBinder; + Bind (theStart,aBinder); isNewBind = Standard_True; + } else if (aBinder->StatusExec() == Transfer_StatusLoop) { + if (myTrace) { + myMessenger << " *** Dead Loop : Finding head of Loop :" << endl; + StartTrace (aBinder, theStart, myLevel-1,0); } - else StartTrace (binder, start,thelevel-1,4); + else StartTrace (aBinder, theStart,myLevel-1,4); Transfer_TransferFailure::Raise("TransferProcess : Head of Dead Loop"); } else { - if (thetrace) { - themessenger << " *** Dead Loop : Actor in Loop :" << endl; - StartTrace (binder, start, thelevel-1,0); + if (myTrace) { + myMessenger << " *** Dead Loop : Actor in Loop :" << endl; + StartTrace (aBinder, theStart, myLevel-1,0); } } - binder->AddFail("Transfer in dead Loop"); - thelevel = oldlev; + aBinder->AddFail("Transfer in dead Loop"); + myLevel = anOldLevel; } catch (Standard_Failure) { - if (binder.IsNull()) { - themessenger << " *** Exception Raised with no Result" << endl; - binder = new Transfer_VoidBinder; - Bind (start,binder); newbind = Standard_True; + if (aBinder.IsNull()) { + myMessenger << " *** Exception Raised with no Result" << endl; + aBinder = new Transfer_VoidBinder; + Bind (theStart,aBinder); isNewBind = Standard_True; } - binder->AddFail("Transfer stopped by exception raising"); - if (thetrace) { - themessenger << " *** Raised : " << Standard_Failure::Caught()->GetMessageString() << endl; - StartTrace (binder, start, thelevel-1,4); + aBinder->AddFail("Transfer stopped by exception raising"); + if (myTrace) { + myMessenger << " *** Raised : " << Standard_Failure::Caught()->GetMessageString() << endl; + StartTrace (aBinder, theStart, myLevel-1,4); } - thelevel = oldlev; + myLevel = anOldLevel; } } - else binder = TransferProduct(start); + else aBinder = TransferProduct(theStart); // Conclusion : Noter dans la Map - if (!newbind && !binder.IsNull()) { - if (former.IsNull()) { - if (!IsBound(start)) Bind(start,binder); // result = 0 category + if (!isNewBind && !aBinder.IsNull()) { + if (aFormer.IsNull()) { + if (!IsBound(theStart)) Bind(theStart,aBinder); // result = 0 category else { // gka TRJ9 for writing SDR for solid - Rebind(start,binder); // test_pattern.sat + Rebind(theStart,aBinder); // test_pattern.sat } } - else Rebind(start,binder); + else Rebind(theStart,aBinder); #ifdef TRANSLOG cout << " ... OK" << endl; #endif } else { - //= by ABV: 5 Oct 97: nothing generated, but former can be in run state - drop it + //= by ABV: 5 Oct 97: nothing generated, but aFormer can be in run state - drop it //= ASK: may be set it to StatusInitial ? - if ( ! former.IsNull() ) former->SetStatusExec ( Transfer_StatusDone ); - Handle(Transfer_Binder) nulbinder; - return nulbinder; + if ( ! aFormer.IsNull() ) aFormer->SetStatusExec ( Transfer_StatusDone ); + Handle(Transfer_Binder) aNullBinder; + return aNullBinder; } // Manage Roots (if planned) - if (therootl >= thelevel) { - therootl = 0; - if (therootm && binder->Status() != Transfer_StatusVoid) { - SetRoot (start); + if (myRootLevel >= myLevel) { + myRootLevel = 0; + if (myToManageRoot && aBinder->Status() != Transfer_StatusVoid) { + SetRoot (theStart); } } - return thelastbnd; + return myLastBinder; } - Standard_Boolean Transfer_TransientProcess::Transfer(const Handle(Standard_Transient)& start) + Standard_Boolean Transfer_TransientProcess::Transfer(const Handle(Standard_Transient)& theStart) { - Handle(Transfer_Binder) binder = Transferring(start); - return (!binder.IsNull()); + Handle(Transfer_Binder) aBinder = Transferring(theStart); + return (!aBinder.IsNull()); } diff --git a/src/Transfer/Transfer_TransientProcess.hxx b/src/Transfer/Transfer_TransientProcess.hxx index 637affff92..191c1245f3 100644 --- a/src/Transfer/Transfer_TransientProcess.hxx +++ b/src/Transfer/Transfer_TransientProcess.hxx @@ -72,14 +72,14 @@ class Transfer_TransientProcess public: //! Sets TransientProcess at initial state, with an initial size
- Standard_EXPORT Transfer_TransientProcess(const Standard_Integer nb = 10000); + Standard_EXPORT Transfer_TransientProcess(const Standard_Integer theNb = 10000); //! Sets an InterfaceModel, used by StartTrace, CheckList, queries
//! on Integrity, to give informations significant for each norm.
- Standard_EXPORT void SetModel(const Handle(Interface_InterfaceModel)& model) ; + Standard_EXPORT void SetModel(const Handle(Interface_InterfaceModel)& theModel) ; //! Returns the Model used for StartTrace
Standard_EXPORT Handle_Interface_InterfaceModel Model() const; //! Sets a Graph : superseedes SetModel if already done
- Standard_EXPORT void SetGraph(const Handle(Interface_HGraph)& HG) ; + Standard_EXPORT void SetGraph(const Handle(Interface_HGraph)& theHG) ; Standard_EXPORT Standard_Boolean HasGraph() const; @@ -88,59 +88,59 @@ public: Standard_EXPORT const Interface_Graph& Graph() const; //! Sets a Context : according to receiving appli, to be
//! interpreted by the Actor
- Standard_EXPORT void SetContext (const Standard_CString name, - const Handle(Standard_Transient)& ctx) ; + Standard_EXPORT void SetContext (const Standard_CString theName, + const Handle(Standard_Transient)& theCtx) ; //! Returns the Context attached to a name, if set and if it is
//! Kind of the type, else a Null Handle
//! Returns True if OK, False if no Context
- Standard_EXPORT Standard_Boolean GetContext (const Standard_CString name, - const Handle(Standard_Type)& type, - Handle(Standard_Transient)& ctx) const; + Standard_EXPORT Standard_Boolean GetContext (const Standard_CString theName, + const Handle(Standard_Type)& theType, + Handle(Standard_Transient)& theCtx) const; //! Returns (modifiable) the whole definition of Context
//! Rather for internal use (ex.: preparing and setting in once)
Standard_EXPORT Handle_Dico_DictionaryOfTransient& Context() ; //! 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_EXPORT virtual void PrintTrace (const Handle(Standard_Transient)& theStart, + const Handle(Message_Messenger)& theMessenger) const; //! Specific number of a starting object for check-list : Number
//! in model
- Standard_EXPORT virtual Standard_Integer CheckNum(const Handle(Standard_Transient)& ent) const; + Standard_EXPORT virtual Standard_Integer CheckNum (const Handle(Standard_Transient)& theEnt) const; //! Returns the list of sharings entities, AT ANY LEVEL, which are
//! kind of a given type. Calls TypedSharings from Graph
//! Returns an empty list if the Graph has not been aknowledged
- Standard_EXPORT Interface_EntityIterator TypedSharings (const Handle(Standard_Transient)& start, - const Handle(Standard_Type)& type) const; + Standard_EXPORT Interface_EntityIterator TypedSharings (const Handle(Standard_Transient)& theStart, + const Handle(Standard_Type)& theType) const; //! Tells if an entity is well loaded from file (even if its data
//! fail on checking, they are present). Mostly often, answers
//! True. Else, there was a syntactic error in the file.
//! A non-loaded entity MAY NOT BE transferred, unless its Report
//! (in the model) is interpreted
- Standard_EXPORT Standard_Boolean IsDataLoaded(const Handle(Standard_Transient)& ent) const; + Standard_EXPORT Standard_Boolean IsDataLoaded (const Handle(Standard_Transient)& theEnt) const; //! Tells if an entity fails on data checking (load time,
//! syntactic, or semantic check). Normally, should answer False.
//! It is not prudent to try transferring an entity which fails on
//! data checking
- Standard_EXPORT Standard_Boolean IsDataFail(const Handle(Standard_Transient)& ent) const; + Standard_EXPORT Standard_Boolean IsDataFail(const Handle(Standard_Transient)& theEnt) const; //! Prints statistics on a given output, according mode
- Standard_EXPORT void PrintStats (const Standard_Integer mode, - const Handle(Message_Messenger)& S) const; + Standard_EXPORT void PrintStats (const Standard_Integer theMode, + const Handle(Message_Messenger)& theMessenger) const; Standard_EXPORT Handle_TColStd_HSequenceOfTransient RootsForTransfer() ; - Standard_EXPORT Handle(Transfer_Binder) TransferProduct (const Handle(Standard_Transient)& start); + Standard_EXPORT Handle(Transfer_Binder) TransferProduct (const Handle(Standard_Transient)& theStart); - Standard_EXPORT Handle(Transfer_Binder) Transferring (const Handle(Standard_Transient)& start); + Standard_EXPORT Handle(Transfer_Binder) Transferring (const Handle(Standard_Transient)& theStart); - Standard_EXPORT Standard_Boolean Transfer(const Handle(Standard_Transient)& start); + Standard_EXPORT Standard_Boolean Transfer(const Handle(Standard_Transient)& theStart); DEFINE_STANDARD_RTTI(Transfer_TransientProcess) private: - Handle_Interface_InterfaceModel themodel; - Handle_Interface_HGraph thegraph; - Handle_Dico_DictionaryOfTransient thectx; - Handle_TColStd_HSequenceOfTransient thetrroots; + Handle_Interface_InterfaceModel myModel; + Handle_Interface_HGraph myGraph; + Handle_Dico_DictionaryOfTransient myCtx; + Handle_TColStd_HSequenceOfTransient theTrRoots; }; #endif