static const TCollection_AsciiString aScope ("global");
return aScope;
}
+
+ //! Global configuration of current DE Session
+ static Handle(DE_Wrapper) THE_GLOBAL_CONFIGURATION;
}
//=======================================================================
//=======================================================================
Handle(DE_Wrapper) DE_Wrapper::GlobalWrapper()
{
- static const Handle(DE_Wrapper)& aConfiguration = new DE_Wrapper();
- return aConfiguration;
+ if (THE_GLOBAL_CONFIGURATION.IsNull())
+ {
+ THE_GLOBAL_CONFIGURATION = new DE_Wrapper();
+ }
+ return THE_GLOBAL_CONFIGURATION;
+}
+
+//=======================================================================
+// function : SetGlobalWrapper
+// purpose :
+//=======================================================================
+void DE_Wrapper::SetGlobalWrapper(const Handle(DE_Wrapper)& theWrapper)
+{
+ if (!theWrapper.IsNull())
+ {
+ THE_GLOBAL_CONFIGURATION = theWrapper;
+ }
}
//=======================================================================
//! @param[in] theWrapper object to copy
Standard_EXPORT DE_Wrapper(const Handle(DE_Wrapper)& theWrapper);
- //! Gets global configuration singleton
+ //! Gets global configuration singleton.
+ //! If wrapper is not set, create it by default as base class object.
//! @return point to global configuration
Standard_EXPORT static Handle(DE_Wrapper) GlobalWrapper();
+ //! Sets global configuration singleton
+ //! @param[in] theWrapper object to set as global configuration
+ Standard_EXPORT static void SetGlobalWrapper(const Handle(DE_Wrapper)& theWrapper);
+
public:
//! Reads a CAD file, according internal configuration
//! Copies values of all fields
//! @return new object with the same field values
- Standard_EXPORT Handle(DE_Wrapper) Copy() const;
+ Standard_EXPORT virtual Handle(DE_Wrapper) Copy() const;
protected: