Hide menu
No Matches
cadex::ModelPrs_Scene Class Reference

Provides CAD Exchanger visualization structure. More...

Inheritance diagram for cadex::ModelPrs_Scene:

Public Types

typedef cadex::internal::ModelPrs_SceneImpl ImplType

Public Member Functions

 ModelPrs_Scene ()
 ModelPrs_Scene (ImplType *)
 Constructor. Reserved for internal use.
void AddRoot (ModelPrs_SceneNode &theNode)
 Adds a root scene node.
void RemoveRoot (ModelPrs_SceneNode &theNode)
 Remove a root scene node.
void Clear ()
 Clear all root scene nodes.
void Update (const Base_ProgressStatus &theProgressStatus=Base_ProgressStatus())
 Applies changes of attached Scene Nodes.
void Wait ()
 Waiting until all changes are applied by Update method.
void Accept (ModelPrs_SceneNodeVisitor &theVisitor)
 Accepts a visitor.
ModelPrs_SelectionManagerSelectionManager ()
 Returns object for selection management.
- Public Member Functions inherited from cadex::Base_PublicObject
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

- Protected Member Functions inherited from cadex::Base_PublicObject
 Base_PublicObject (const internal::Base_HandledObject *theObject)
 Constructor (reserved for internal use).
template<typename T >
T * GetOrCreateImpl ()
 Reserved for internal use.

Detailed Description

Provides CAD Exchanger visualization structure.

This class is a part of Visualization Toolkit add-on, which is licensed separately from the base CAD Exchanger SDK.

ModelPrs_Scene encapsulates a visualization scene graph. It means that scene contains an entry point to all roots.

A scene 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.

See also
Using pimpl pattern
visualization/offscreen/Program.cs, visualization/offscreen/main.cxx, visualization/qtquick_qml/baseviewer/main.cxx, visualization/winforms/baseviewer/Program.cs, and visualization/wpf/baseviewer/App.xaml.cs.

Constructor & Destructor Documentation

◆ ModelPrs_Scene()

cadex::ModelPrs_Scene::ModelPrs_Scene ( )


Creates an object with implementation (IsNull() will return false).

Member Function Documentation

◆ AddRoot()

void cadex::ModelPrs_Scene::AddRoot ( ModelPrs_SceneNode theNode)

◆ Clear()

void cadex::ModelPrs_Scene::Clear ( )

Clear all root scene nodes.

See also
AddRoot(), RemoveRoot()

◆ RemoveRoot()

void cadex::ModelPrs_Scene::RemoveRoot ( ModelPrs_SceneNode theNode)

Remove a root scene node.

See also
AddRoot(), Clear()

◆ Update()

void cadex::ModelPrs_Scene::Update ( const Base_ProgressStatus theProgressStatus = Base_ProgressStatus())

Applies changes of attached Scene Nodes.

Updating the scene can be time-consuming and therefore should be delayed until changes to the underlying scene node’s data have been applied. For instance, the following example demonstrates multiple changes and single scene update:

aScene.AddRoot (aNode);
aNode.SetGeometry (aGeometry);
aNode.SetAppearearance (anAppearance);
Provides CAD Exchanger visualization structure.
Definition: ModelPrs_Scene.hxx:39
void AddRoot(ModelPrs_SceneNode &theNode)
Adds a root scene node.
Definition: ModelPrs_Scene.cxx:138
void Update(const Base_ProgressStatus &theProgressStatus=Base_ProgressStatus())
Applies changes of attached Scene Nodes.
Definition: ModelPrs_Scene.cxx:188
Represents a node in the visual scene graph.
Definition: ModelPrs_SceneNode.hxx:44
void SetDisplayMode(ModelPrs_DisplayMode theMode)
Sets theMode as display mode.
Definition: ModelPrs_SceneNode.cxx:860
@ ModelPrs_DM_Wireframe
Wireframe display mode.
Definition: ModelPrs_DisplayMode.hxx:30

This method is asynchronous. It means that changes will be applied piecemeal.

Any manipulations with scene nodes forbidden while changes are applied. Wait() method helps to understand when changes were applied.

See also
visualization/offscreen/Program.cs, and visualization/offscreen/main.cxx.

◆ Wait()

void cadex::ModelPrs_Scene::Wait ( )

Waiting until all changes are applied by Update method.

See also
This method useful to use when it requires to apply all changes before next steps. For example when you generate an images via
aViewPort.AttachToScene (aScene);
aScene.Wait(); // all changes are applied
aViewPort.GrabToImage ("test.png");
Defines a viewport without any visible window (frame).
Definition: ModelPrs_OffscreenViewPort.hxx:50
bool AttachToScene(const ModelPrs_Scene &theScene)
Attaches to ModelPrs_Scene.
Definition: ModelPrs_OffscreenViewPort.cxx:257
bool GrabToImage(const Base_UTF16String &thePath) const
Grab to image in specified thePath.
Definition: ModelPrs_OffscreenViewPort.cxx:285
void Wait()
Waiting until all changes are applied by Update method.
Definition: ModelPrs_Scene.cxx:207
visualization/offscreen/Program.cs, and visualization/offscreen/main.cxx.