- Added Register and UnRegister methods to DE_ConfigurationNode for managing bindings with DE_Wrapper.
- Introduced DE_MultiPluginHolder to facilitate registration of multiple configuration nodes simultaneously.
- Created new plugin factory functions for various configuration nodes (DEBREP, DEXCAF, DEGLTF, DEIGES, DEOBJ, DEPLY, DESTEP, DESTL, DEVRML) to streamline their registration with DE_Wrapper.
- Removed unnecessary DE_PluginHolder instances from individual configuration node implementations.
- Updated CMake files to include newly created source files for each configuration node.
- Implemented singleton patterns in draw commands to ensure plugins are registered only once during initialization.
(void)theBuffer;
return false;
}
+
+//=================================================================================================
+
+void DE_ConfigurationNode::Register(const Handle(DE_Wrapper)& theWrapper) const
+{
+ theWrapper->Bind(this);
+}
+
+//=================================================================================================
+
+void DE_ConfigurationNode::UnRegister(const Handle(DE_Wrapper)& theWrapper) const
+{
+ theWrapper->UnBind(this);
+}
class DE_ConfigurationContext;
class DE_Provider;
+class DE_Wrapper;
class NCollection_Buffer;
//! Base class to work with CAD transfer properties.
//!< unit is unknown, default 1.0 (MM)
} GlobalParameters;
+public:
+
+ //! Registers configuration node with the specified wrapper
+ //! @param[in] theWrapper wrapper to register with
+ Standard_EXPORT virtual void Register(const Handle(DE_Wrapper)& theWrapper) const;
+
+ //! Unregisters configuration node from the specified wrapper
+ //! @param[in] theWrapper wrapper to unregister from
+ Standard_EXPORT virtual void UnRegister(const Handle(DE_Wrapper)& theWrapper) const;
+
private:
Standard_Boolean myIsEnabled; //!< Flag to use a current provider for Read or Write process via DE_Wrapper
// clang-format on
#define _DE_PluginHolder_HeaderFile
#include <DE_Wrapper.hxx>
+#include <tuple>
//! Base class to work with DE_Wrapper global registration of components.
//! Control life-time of current configuration node.
{
Standard_Mutex::Sentry aLock(DE_Wrapper::GlobalLoadMutex());
myInternalConfiguration = new TheConfType;
- DE_Wrapper::GlobalWrapper()->Bind(myInternalConfiguration);
+ myInternalConfiguration->Register(DE_Wrapper::GlobalWrapper());
}
~DE_PluginHolder()
{
Standard_Mutex::Sentry aLock(DE_Wrapper::GlobalLoadMutex());
- DE_Wrapper::GlobalWrapper()->UnBind(myInternalConfiguration);
+ myInternalConfiguration->UnRegister(DE_Wrapper::GlobalWrapper());
}
private:
Handle(TheConfType) myInternalConfiguration; //!< Wrapped object
};
+//! Helper class for variadic plugin registration.
+//! Allows registration of multiple configuration node types simultaneously.
+template <typename... TheConfTypes>
+class DE_MultiPluginHolder
+{
+public:
+ DE_MultiPluginHolder()
+ : myHolders{}
+ {
+ }
+
+private:
+ std::tuple<DE_PluginHolder<TheConfTypes>...> myHolders; //!< Tuple of individual plugin holders
+};
+
+//! Macro to define plugin factory function for DE_Wrapper configuration nodes.
+//! @param[in] theNodeType - first configuration node class to instantiate
+//! @param[in] ... - additional configuration node classes to instantiate (optional)
+//! Needs to be called after loading of the library to register configuration nodes.
+//!
+//! Example of usage:
+//! @code
+//! // Inside implementation of the configuration node source file:
+//! DEPLUGIN(DESTEP_ConfigurationNode)
+//!
+//! // For multiple node types:
+//! DEPLUGIN(DESTEP_ConfigurationNode, DEIGES_ConfigurationNode, DEVRML_ConfigurationNode)
+//! @endcode
+//!
+//! After loading of the library TKDESTEP:
+//! @code
+//! OSD_SharedLibrary aSharedLibrary("libTKDESTEP.so");
+//! if (!aSharedLibrary.DlOpen(OSD_RTLD_LAZY))
+//! {
+//! // Error handling
+//! return;
+//! }
+//!
+//! typedef void (*PluginFactoryFunc)();
+//! PluginFactoryFunc aFunc = (PluginFactoryFunc)aSharedLibrary.DlSymb("PLUGINFACTORY");
+//! if (aFunc == NULL)
+//! {
+//! // Error handling
+//! return;
+//! }
+//!
+//! aFunc(); // Call factory function to register configuration nodes
+//! @endcode
+//!
+//! Will create instances of all specified configuration nodes and set them to DE_Wrapper global
+//! configuration.
+//!
+//! Note: if OCCT_NO_PLUGINS is defined, macro does nothing.
+#ifdef OCCT_NO_PLUGINS
+ #define DEPLUGIN(theNodeType, ...)
+#else
+ #define DEPLUGIN(theNodeType, ...) \
+ extern "C" Standard_EXPORT void PLUGINFACTORY() \
+ { \
+ static DE_MultiPluginHolder<theNodeType, ##__VA_ARGS__> aMultiHolder; \
+ }
+#endif
+
#endif // _DE_PluginHolder_HeaderFile
#include <DE_ShapeFixConfigurationNode.hxx>
#include <DE_ConfigurationContext.hxx>
-#include <DE_PluginHolder.hxx>
#include <DE_Wrapper.hxx>
IMPLEMENT_STANDARD_RTTIEXT(DE_ShapeFixConfigurationNode, DE_ConfigurationNode)
#include <DEBREP_Provider.hxx>
#include <DE_ConfigurationContext.hxx>
-#include <DE_PluginHolder.hxx>
#include <NCollection_Buffer.hxx>
IMPLEMENT_STANDARD_RTTIEXT(DEBREP_ConfigurationNode, DE_ConfigurationNode)
return aScope;
}
-// Wrapper to auto-load DE component
-DE_PluginHolder<DEBREP_ConfigurationNode> THE_OCCT_BREP_COMPONENT_PLUGIN;
} // namespace
//=================================================================================================
#include <DEXCAF_Provider.hxx>
#include <DE_ConfigurationContext.hxx>
-#include <DE_PluginHolder.hxx>
#include <NCollection_Buffer.hxx>
IMPLEMENT_STANDARD_RTTIEXT(DEXCAF_ConfigurationNode, DE_ConfigurationNode)
return aScope;
}
-// Wrapper to auto-load DE component
-DE_PluginHolder<DEXCAF_ConfigurationNode> THE_OCCT_XCAF_COMPONENT_PLUGIN;
} // namespace
//=================================================================================================
set(OCCT_TKDECascade_FILES
EXTERNLIB
PACKAGES
+ TKDECascade.cxx
)
--- /dev/null
+// Copyright (c) 2025 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include <DEBREP_ConfigurationNode.hxx>
+#include <DEXCAF_ConfigurationNode.hxx>
+#include <DE_PluginHolder.hxx>
+
+//! Plugin factory function to register TKDECascade configuration nodes.
+//! Call PLUGINFACTORY() to register both DEBREP_ConfigurationNode and DEXCAF_ConfigurationNode
+//! with the global DE_Wrapper.
+DEPLUGIN(DEBREP_ConfigurationNode, DEXCAF_ConfigurationNode)
\ No newline at end of file
#include <DEGLTF_Provider.hxx>
#include <DE_ConfigurationContext.hxx>
-#include <DE_PluginHolder.hxx>
IMPLEMENT_STANDARD_RTTIEXT(DEGLTF_ConfigurationNode, DE_ConfigurationNode)
return aScope;
}
-// Wrapper to auto-load DE component
-DE_PluginHolder<DEGLTF_ConfigurationNode> THE_OCCT_GLTF_COMPONENT_PLUGIN;
} // namespace
//=================================================================================================
set(OCCT_TKDEGLTF_FILES
EXTERNLIB
PACKAGES
+ TKDEGLTF.cxx
)
--- /dev/null
+// Copyright (c) 2025 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include <DEGLTF_ConfigurationNode.hxx>
+#include <DE_PluginHolder.hxx>
+
+//! Plugin factory function to register DEGLTF configuration node.
+//! Call PLUGINFACTORY() to register the DEGLTF_ConfigurationNode with the global DE_Wrapper.
+DEPLUGIN(DEGLTF_ConfigurationNode)
\ No newline at end of file
#include <DEIGES_Provider.hxx>
#include <DE_ConfigurationContext.hxx>
-#include <DE_PluginHolder.hxx>
#include <NCollection_Buffer.hxx>
IMPLEMENT_STANDARD_RTTIEXT(DEIGES_ConfigurationNode, DE_ShapeFixConfigurationNode)
return aScope;
}
-// Wrapper to auto-load DE component
-DE_PluginHolder<DEIGES_ConfigurationNode> THE_OCCT_IGES_COMPONENT_PLUGIN;
} // namespace
//=================================================================================================
EXTERNLIB
PACKAGES
TKDEIGES_pch.hxx
+ TKDEIGES.cxx
)
--- /dev/null
+// Copyright (c) 2025 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include <DEIGES_ConfigurationNode.hxx>
+#include <DE_PluginHolder.hxx>
+
+//! Plugin factory function to register DEIGES configuration node.
+//! Call PLUGINFACTORY() to register the DEIGES_ConfigurationNode with the global DE_Wrapper.
+DEPLUGIN(DEIGES_ConfigurationNode)
\ No newline at end of file
#include <DEOBJ_Provider.hxx>
#include <DE_ConfigurationContext.hxx>
-#include <DE_PluginHolder.hxx>
IMPLEMENT_STANDARD_RTTIEXT(DEOBJ_ConfigurationNode, DE_ConfigurationNode)
return aScope;
}
-// Wrapper to auto-load DE component
-DE_PluginHolder<DEOBJ_ConfigurationNode> THE_OCCT_OBJ_COMPONENT_PLUGIN;
} // namespace
//=================================================================================================
set(OCCT_TKDEOBJ_FILES
EXTERNLIB
PACKAGES
+ TKDEOBJ.cxx
)
--- /dev/null
+// Copyright (c) 2025 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include <DEOBJ_ConfigurationNode.hxx>
+#include <DE_PluginHolder.hxx>
+
+//! Plugin factory function to register DEOBJ configuration node.
+//! Call PLUGINFACTORY() to register the DEOBJ_ConfigurationNode with the global DE_Wrapper.
+DEPLUGIN(DEOBJ_ConfigurationNode)
\ No newline at end of file
#include <DEPLY_Provider.hxx>
#include <DE_ConfigurationContext.hxx>
-#include <DE_PluginHolder.hxx>
#include <NCollection_Buffer.hxx>
IMPLEMENT_STANDARD_RTTIEXT(DEPLY_ConfigurationNode, DE_ConfigurationNode)
return aScope;
}
-// Wrapper to auto-load DE component
-DE_PluginHolder<DEPLY_ConfigurationNode> THE_OCCT_PLY_COMPONENT_PLUGIN;
} // namespace
//=================================================================================================
set(OCCT_TKDEPLY_FILES
EXTERNLIB
PACKAGES
+ TKDEPLY.cxx
)
--- /dev/null
+// Copyright (c) 2025 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include <DEPLY_ConfigurationNode.hxx>
+#include <DE_PluginHolder.hxx>
+
+//! Plugin factory function to register DEPLY configuration node.
+//! Call PLUGINFACTORY() to register the DEPLY_ConfigurationNode with the global DE_Wrapper.
+DEPLUGIN(DEPLY_ConfigurationNode)
\ No newline at end of file
#include <DESTEP_Provider.hxx>
#include <DE_ConfigurationContext.hxx>
-#include <DE_PluginHolder.hxx>
#include <NCollection_Buffer.hxx>
IMPLEMENT_STANDARD_RTTIEXT(DESTEP_ConfigurationNode, DE_ShapeFixConfigurationNode)
return aScope;
}
-// Wrapper to auto-load DE component
-DE_PluginHolder<DESTEP_ConfigurationNode> THE_OCCT_STEP_COMPONENT_PLUGIN;
} // namespace
//=================================================================================================
EXTERNLIB
PACKAGES
TKDESTEP_pch.hxx
+ TKDESTEP.cxx
)
--- /dev/null
+// Copyright (c) 2025 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include <DESTEP_ConfigurationNode.hxx>
+#include <DE_PluginHolder.hxx>
+
+//! Plugin factory function to register DESTEP configuration node.
+//! Call PLUGINFACTORY() to register the DESTEP_ConfigurationNode with the global DE_Wrapper.
+DEPLUGIN(DESTEP_ConfigurationNode)
\ No newline at end of file
#include <DESTL_Provider.hxx>
#include <DE_ConfigurationContext.hxx>
-#include <DE_PluginHolder.hxx>
#include <NCollection_Buffer.hxx>
IMPLEMENT_STANDARD_RTTIEXT(DESTL_ConfigurationNode, DE_ConfigurationNode)
return aScope;
}
-// Wrapper to auto-load DE component
-DE_PluginHolder<DESTL_ConfigurationNode> THE_OCCT_STL_COMPONENT_PLUGIN;
} // namespace
//=================================================================================================
set(OCCT_TKDESTL_FILES
EXTERNLIB
PACKAGES
+ TKDESTL.cxx
)
--- /dev/null
+// Copyright (c) 2025 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include <DESTL_ConfigurationNode.hxx>
+#include <DE_PluginHolder.hxx>
+
+//! Plugin factory function to register DESTL configuration node.
+//! Call PLUGINFACTORY() to register the DESTL_ConfigurationNode with the global DE_Wrapper.
+DEPLUGIN(DESTL_ConfigurationNode)
\ No newline at end of file
#include <DEVRML_Provider.hxx>
#include <DE_ConfigurationContext.hxx>
-#include <DE_PluginHolder.hxx>
IMPLEMENT_STANDARD_RTTIEXT(DEVRML_ConfigurationNode, DE_ConfigurationNode)
return aScope;
}
-// Wrapper to auto-load DE component
-DE_PluginHolder<DEVRML_ConfigurationNode> THE_OCCT_VRML_COMPONENT_PLUGIN;
} // namespace
//=================================================================================================
set(OCCT_TKDEVRML_FILES
EXTERNLIB
PACKAGES
+ TKDEVRML.cxx
)
--- /dev/null
+// Copyright (c) 2025 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include <DEVRML_ConfigurationNode.hxx>
+#include <DE_PluginHolder.hxx>
+
+//! Plugin factory function to register DEVRML configuration node.
+//! Call PLUGINFACTORY() to register the DEVRML_ConfigurationNode with the global DE_Wrapper.
+DEPLUGIN(DEVRML_ConfigurationNode)
\ No newline at end of file
#include <DE_Provider.hxx>
#include <DE_Wrapper.hxx>
#include <DEBREP_ConfigurationNode.hxx>
+#include <DEXCAF_ConfigurationNode.hxx>
+#include <DE_PluginHolder.hxx>
#include <Draw.hxx>
#include <Draw_Interpretor.hxx>
#include <Draw_PluginMacro.hxx>
#include <XSControl_WorkSession.hxx>
#include <XSDRAW.hxx>
+namespace
+{
+// Singleton to ensure DEBREP and DEXCAF plugins are registered only once
+void DECascadeSingleton()
+{
+ static DE_MultiPluginHolder<DEBREP_ConfigurationNode, DEXCAF_ConfigurationNode> aHolder;
+ (void)aHolder;
+}
+} // namespace
+
//=================================================================================================
static Standard_Integer DumpConfiguration(Draw_Interpretor& theDI,
}
aIsActivated = Standard_True;
+ //! Ensure DEBREP and DEXCAF plugins are registered
+ DECascadeSingleton();
+
Standard_CString aGroup = "XDE translation commands";
theDI.Add("DumpConfiguration",
"DumpConfiguration [-path <path>] [-recursive {on|off}] [-format fmt1 fmt2 ...] "
// Load XSDRAW session for pilot activation
XSDRAW::LoadDraw(theDI);
-
- // Workaround to force load TKDECascade lib
- DEBREP_ConfigurationNode aTmpObj;
- (void)aTmpObj;
}
// Declare entry point PLUGINFACTORY
#include <DBRep.hxx>
#include <DDocStd.hxx>
#include <DDocStd_DrawDocument.hxx>
+#include <DEGLTF_ConfigurationNode.hxx>
+#include <DE_PluginHolder.hxx>
#include <Draw.hxx>
#include <Draw_Interpretor.hxx>
#include <Draw_PluginMacro.hxx>
#include <XSControl_WorkSession.hxx>
#include <XSDRAW.hxx>
+namespace
+{
+// Singleton to ensure DEGLTF plugin is registered only once
+void DEGLTFSingleton()
+{
+ static DE_PluginHolder<DEGLTF_ConfigurationNode> aHolder;
+ (void)aHolder;
+}
+} // namespace
+
//=============================================================================
// function : parseNameFormat
// purpose : Parse RWMesh_NameFormat enumeration
}
aIsActivated = Standard_True;
+ //! Ensure DEGLTF plugin is registered
+ DEGLTFSingleton();
+
const char* aGroup = "XSTEP-STL/VRML"; // Step transfer file commands
theDI.Add("ReadGltf",
"ReadGltf Doc file [-parallel {on|off}] [-listExternalFiles] [-noCreateDoc] "
#include <DBRep.hxx>
#include <DDocStd.hxx>
#include <DDocStd_DrawDocument.hxx>
+#include <DEIGES_ConfigurationNode.hxx>
+#include <DE_PluginHolder.hxx>
#include <Draw.hxx>
#include <DrawTrSurf.hxx>
#include <Draw_Interpretor.hxx>
return 0;
}
+namespace
+{
+// Singleton to ensure DEIGES plugin is registered only once
+void DEIGESSingleton()
+{
+ static DE_PluginHolder<DEIGES_ConfigurationNode> aHolder;
+ (void)aHolder;
+}
+} // namespace
+
//=================================================================================================
void XSDRAWIGES::Factory(Draw_Interpretor& theDI)
IGESControl_Controller::Init();
+ //! Ensure DEIGES plugin is registered
+ DEIGESSingleton();
+
const char* aGroup = "DE: IGES";
theDI.Add("tplosttrim",
#include <DBRep.hxx>
#include <DDocStd.hxx>
#include <DDocStd_DrawDocument.hxx>
+#include <DEOBJ_ConfigurationNode.hxx>
+#include <DE_PluginHolder.hxx>
#include <Draw.hxx>
#include <Draw_Interpretor.hxx>
#include <Draw_PluginMacro.hxx>
return 0;
}
+namespace
+{
+// Singleton to ensure DEOBJ plugin is registered only once
+void DEOBJSingleton()
+{
+ static DE_PluginHolder<DEOBJ_ConfigurationNode> aHolder;
+ (void)aHolder;
+}
+} // namespace
+
//=================================================================================================
void XSDRAWOBJ::Factory(Draw_Interpretor& theDI)
}
aIsActivated = Standard_True;
+ //! Ensure DEOBJ plugin is registered
+ DEOBJSingleton();
+
const char* aGroup = "XSTEP-STL/VRML"; // Step transfer file commands
theDI.Add(
"ReadObj",
#include <DBRep.hxx>
#include <DDocStd.hxx>
#include <DDocStd_DrawDocument.hxx>
+#include <DEPLY_ConfigurationNode.hxx>
+#include <DE_PluginHolder.hxx>
#include <Draw.hxx>
#include <Draw_Interpretor.hxx>
#include <Draw_PluginMacro.hxx>
return 0;
}
+namespace
+{
+// Singleton to ensure DEPLY plugin is registered only once
+void DEPLYSingleton()
+{
+ static DE_PluginHolder<DEPLY_ConfigurationNode> aHolder;
+ (void)aHolder;
+}
+} // namespace
+
//=================================================================================================
void XSDRAWPLY::Factory(Draw_Interpretor& theDI)
}
aIsActivated = Standard_True;
+ //! Ensure DEPLY plugin is registered
+ DEPLYSingleton();
+
const char* aGroup = "XSTEP-STL/VRML"; // Step transfer file commands
// XSDRAW::LoadDraw(theCommands);
theDI.Add("WritePly",
#include <DDF.hxx>
#include <DDocStd.hxx>
#include <DDocStd_DrawDocument.hxx>
+#include <DESTEP_ConfigurationNode.hxx>
+#include <DE_PluginHolder.hxx>
#include <Draw.hxx>
#include <Draw_Interpretor.hxx>
#include <Draw_PluginMacro.hxx>
return 0;
}
+namespace
+{
+// Singleton to ensure DESTEP plugin is registered only once
+void DESTEPSingleton()
+{
+ static DE_PluginHolder<DESTEP_ConfigurationNode> aHolder;
+ (void)aHolder;
+}
+} // namespace
+
//=================================================================================================
void XSDRAWSTEP::Factory(Draw_Interpretor& theDI)
STEPCAFControl_Controller::Init();
aIsActivated = Standard_True;
+ //! Ensure DESTEP plugin is registered
+ DESTEPSingleton();
+
const char* aGroup = "DE: STEP"; // Step transfer file commands
theDI.Add("stepwrite", "stepwrite mode[0-4 afsmw] shape", __FILE__, stepwrite, aGroup);
theDI.Add("testwritestep",
#include <DBRep.hxx>
#include <DDocStd.hxx>
#include <DDocStd_DrawDocument.hxx>
+#include <DESTL_ConfigurationNode.hxx>
+#include <DE_PluginHolder.hxx>
#include <Draw.hxx>
#include <Draw_Interpretor.hxx>
#include <Draw_PluginMacro.hxx>
return 0;
}
+namespace
+{
+// Singleton to ensure DESTL plugin is registered only once
+void DESTLSingleton()
+{
+ static DE_PluginHolder<DESTL_ConfigurationNode> aHolder;
+ (void)aHolder;
+}
+} // namespace
+
//=================================================================================================
void XSDRAWSTL::Factory(Draw_Interpretor& theDI)
}
aIsActivated = Standard_True;
+ //! Ensure DESTL plugin is registered
+ DESTLSingleton();
+
const char* aGroup = "XSTEP-STL/VRML"; // Step transfer file commands
theDI.Add("writestl",
#include <DBRep.hxx>
#include <DDocStd.hxx>
#include <DDocStd_DrawDocument.hxx>
+#include <DEVRML_ConfigurationNode.hxx>
+#include <DE_PluginHolder.hxx>
#include <Draw.hxx>
#include <Draw_Interpretor.hxx>
#include <Draw_PluginMacro.hxx>
return 0;
}
+namespace
+{
+// Singleton to ensure DEVRML plugin is registered only once
+void DEVRMLSingleton()
+{
+ static DE_PluginHolder<DEVRML_ConfigurationNode> aHolder;
+ (void)aHolder;
+}
+} // namespace
+
//=================================================================================================
void XSDRAWVRML::Factory(Draw_Interpretor& theDI)
}
anInitActor = Standard_True;
+ //! Ensure DEVRML plugin is registered
+ DEVRMLSingleton();
+
Standard_CString aGroup = "XDE translation commands";
theDI.Add(
"ReadVrml",