Creates a scene nodes and its children from input data model objects. More...
#include <cadex/ModelPrs_SceneNodeFactory.hxx>
Public Types | |
typedef cadex::internal::ModelPrs_SceneNodeFactoryImpl | ImplType |
Public Member Functions | |
ModelPrs_SceneNodeFactory () | |
Constructor. | |
ModelPrs_SceneNodeFactory (const ModelPrs_SceneNodeFactoryParameters &theParameters) | |
Constructor. | |
ModelPrs_SceneNodeFactoryParameters & | Parameters () |
Returns factory parameters. | |
const ModelPrs_SceneNodeFactoryParameters & | Parameters () const |
Returns factory parameters. | |
ModelPrs_SceneNode | CreateGraph (const ModelData_Model &theModel, ModelData_RepresentationMask theRepresentationMask) |
Creates scene graph using ModelData_Model. | |
ModelPrs_SceneNode | CreateGraph (const ModelData_Model &theModel, const Base_UTF16String &theRepresentationName) |
Creates scene graph using ModelData_Model. | |
ModelPrs_SceneNode | CreateGraph (const ModelData_BIMModel &theBIMModel, ModelData_RepresentationMask theRepresentationMask) |
Creates scene graph using ModelData_BIMModel. | |
ModelPrs_SceneNode | CreateGraph (const ModelData_BIMModel &theBIMModel, const Base_UTF16String &theRepresentationName) |
Creates scene graph using ModelData_BIMModel. | |
ModelPrs_SceneNode | CreateGraph (const ModelData_BIMGeometryElement &theBIMGeometryElement, ModelData_RepresentationMask theRepresentationMask) |
Creates scene graph using ModelData_BIMGeometryElement. | |
ModelPrs_SceneNode | CreateGraph (const ModelData_BIMGeometryElement &theBIMGeometryElement, const Base_UTF16String &theRepresentationName) |
Creates scene graph using ModelData_BIMGeometryElement. | |
ModelPrs_SceneNode | CreateGraph (const ModelData_DrawingSheet &theDrawingSheet) |
Creates scene graph using ModelData_DrawingSheet. | |
ModelPrs_SceneNode | CreateNode (const ModelData_DrawingElement &theDrawingElement) |
Creates scene node using ModelData_DrawingElement. | |
ModelPrs_SceneNode | CreateNode (const ModelData_SceneGraphElement &theSceneGraphElement) |
Creates scene node using ModelData_SceneGraphElement. | |
ModelPrs_SceneNode | CreateNode (const ModelData_BIMBaseObject &theBIMElement) |
Creates scene node using ModelData_BIMBaseObject. | |
ModelPrs_SceneNode | CreateNode (const ModelData_Representation &theRepresentation) |
Creates scene node using ModelData_PolyRepresentation or ModelData_BRepRepresentation. | |
ModelPrs_SceneNode | CreateNode (const ModelData_PolyVertexSet &thePolyVertexSet) |
Creates scene node using ModelData_PolyVertexSet. | |
ModelPrs_SceneNode | CreateNode (const ModelData_Body &theBody, const ModelData_BRepRepresentation &theRep=ModelData_BRepRepresentation()) |
Creates scene node using ModelData_Body with optional owning ModelData_BRepRepresentation. | |
ModelPrs_SceneNode | CreateNode (const ModelPrs_Measurement &theMeasurement) |
Creates scene node using ModelPrs_Measurement. | |
ModelPrs_SceneNode | CreateNode (const ModelData_PMIGraphicalElement &thePMIGraphicalElement) |
Creates scene node using ModelData_PMIGraphicalElement. | |
![]() | |
void | Nullify () |
Resets reference to implementation object. | |
bool | IsNull () const |
Returns true if the object is nullified. | |
operator bool () const | |
Casts the object to the bool type. | |
internal::Base_HandledObject * | Impl () const |
Return a handle to backend (reserved for internal use). | |
Additional Inherited Members | |
![]() | |
Base_PublicObject (const internal::Base_HandledObject *theObject) | |
Constructor (reserved for internal use). | |
template<typename T > | |
T * | GetOrCreateImpl () |
Reserved for internal use. | |
Creates a scene nodes and its children from input data model objects.
The factory supports various input types to create scene nodes from:
There are two ways to create scene nodes:
The following example demonstrates creating a scene from the entire model. Note that if the model has multiple roots then resulting scene nodes will be children of a single root scene node:
The following example demonstrates creating a scene node for a single B-Rep solid:
Given that B-Rep sub-shapes may only refer to meta-data (such as visual appearances) in the context of B-Rep representation that own them, specifying that owning B-Rep representation is important when creating a node. Consider an example of a B-Rep solid with three colored faces:
In order to transmit these attributes to the scene nodes the owning B-Rep representation must be specified:
If the B-Rep representation is not provided then the appearance will be lost:
The results are shown on the following screenshots:
![]()
Body with owning B-Rep | ![]()
Body without owning B-Rep |
Of course, to achieve an equivalent correct result the factory could be simply used as follows:
A scene node factory contains a shared pointer to its internal implementation, so simple copying an object will just copy a shared pointer. Therefore any modification of the copied object will propagate to original object.
cadex::ModelPrs_SceneNodeFactory::ModelPrs_SceneNodeFactory | ( | ) |
Constructor.
Creates factory with default parameters.
cadex::ModelPrs_SceneNodeFactory::ModelPrs_SceneNodeFactory | ( | const ModelPrs_SceneNodeFactoryParameters & | myParameters | ) |
Constructor.
Creates factory with custom parameters.