Hide menu
cadex::ModelPrs_Scene Class Reference

Provides CAD Exchanger visualization structure. More...

Inheritance diagram for cadex::ModelPrs_Scene:
cadex::Base_PublicObject

Public Types

typedef cadex::internal::ModelPrs_SceneImpl ImplType
 

Public Member Functions

 ModelPrs_Scene ()
 Constructor. More...
 
void AddRoot (ModelPrs_SceneNode &theNode)
 Adds a root scene node. More...
 
void RemoveRoot (ModelPrs_SceneNode &theNode)
 Remove a root scene node. More...
 
void Clear ()
 Clear all root scene nodes. More...
 
void Update ()
 Applies changes of attached Scene Nodes. More...
 
void Wait ()
 Waiting until all changes are applied by Update method. More...
 
void Accept (ModelPrs_SceneNodeVisitor &theVisitor)
 Accepts a visitor.
 
ModelPrs_SelectionManagerSelectionManager ()
 Returns object for selection management.
 
- Public Member Functions inherited from cadex::Base_PublicObject
 Base_PublicObject ()
 Constructor. More...
 
void Nullify ()
 Resets reference to implementation object.
 
bool IsNull () const
 Returns true if the object is nullified. More...
 
 operator bool () const
 Casts the object to the bool type. More...
 
internal::Base_HandledObject * Impl () const
 Return a handle to backend (reserved for internal use).
 
const internal::Base_Handle & HImpl () const
 
template<typename T >
T * Impl () const
 Reserved for internal use.
 
bool operator== (const Base_PublicObject &theObject) const
 
bool operator!= (const Base_PublicObject &theObject) const
 

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.

Warning
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
Examples
visualization/offscreen/main.cxx, and visualization/qtquick_qml/baseviewer/main.cxx.

Constructor & Destructor Documentation

◆ ModelPrs_Scene()

cadex::ModelPrs_Scene::ModelPrs_Scene ( )

Constructor.

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

Member Function Documentation

◆ AddRoot()

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

Adds a root scene node.

See also
RemoveRoot(), Clear()
Examples
visualization/offscreen/main.cxx.

◆ 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 ( )

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:

ModelPrs_SceneNode aNode;
aScene.AddRoot (aNode);
...
aNode.SetGeometry (aGeometry);
aNode.SetAppearearance (anAppearance);
aNode.SetDisplayMode (ModelPrs_DM_Wireframe);
aScene.Update();

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
Wait()
Examples
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
ModelPrs_OffscreenViewPort:
ModelPrs_OffscreenViewPort aViewPort;
aViewPort.AttachToScene (aScene);
...
aScene.Update();
aScene.Wait(); // all changes are applied
aViewPort.GrabToImage ("test.png");
Examples
visualization/offscreen/main.cxx.
ModelPrs_Scene()
Constructor.
Definition: ModelPrs_Scene.cxx:109
Wireframe display mode.
Definition: ModelPrs_DisplayMode.hxx:26