Workspace 6.21.5
Public Types | Public Member Functions | List of all members
ClipRegion Class Reference

Defines a region in 3D space which is to be used for clipping models in a scene. More...

#include <Rendering/SceneComponents/Models/clipregion.h>

Inheritance diagram for ClipRegion:
[legend]

Public Types

enum  ClipCriteria { InsideRegion , OutsideRegion }
 

Public Member Functions

 ClipRegion (const ClipRegion &clipRegion)
 
 ClipRegion (const QString &id="")
 
 ~ClipRegion () override
 
ClipRegionclone () const override
 
ClipCriteria getClipCriteria () const
 
Mesh::TransformMatrix getMatrixGlobal () const override
 
const Mesh::RegiongetRegion () const
 
const Mesh::TransformMatrixgetTransformMatrix () const
 
bool getVisible () const
 
ClipRegionoperator= (const ClipRegion &rhs)
 
void setClipCriteria (ClipCriteria criteria)
 
void setRegion (const Mesh::Region &region)
 
void setTransformMatrix (const Mesh::TransformMatrix &transformMatrix)
 
void setVisible (bool b)
 
void updateGlobalMatrix () override
 
bool visit (SceneProcessor &processor) override
 
- Public Member Functions inherited from SceneItem
 ~SceneItem () override
 
SceneItemclone () const override=0
 
bool getEnabled () const
 
const QString & getId () const
 
const Mesh::BoundingBoxMinimalgetLocalBoundingBox () const
 
virtual Mesh::TransformMatrix getMatrixGlobal () const
 
virtual Mesh::TransformMatrix getMatrixLocal () const
 
const QString & getName () const
 
Mesh::TransformMatrix getParentMatrixGlobal () const
 
TransformgetParentTransform ()
 
void setEnabled (bool b)
 
void setId (const QString &itemId)
 
virtual void setLocalBoundingBox (const Mesh::BoundingBoxMinimal &bb)
 
void setName (const QString &name)
 
virtual TransformtoTransform ()
 
virtual const TransformtoTransform () const
 
virtual void updateGlobalMatrix ()
 
virtual bool visit (SceneProcessor &processor)=0
 
- Public Member Functions inherited from Observable
virtual ~Observable ()
 
void attachObserver (Observer &observer)
 
void destroy ()
 
void detachObserver (Observer &observer)
 
void notifyEvent (const ObservableEvent &event)
 
- Public Member Functions inherited from Clonable
virtual ~Clonable ()=default
 
virtual Clonableclone () const =0
 

Additional Inherited Members

- Protected Member Functions inherited from SceneItem
 SceneItem (const QString &id)
 
 SceneItem (const SceneItem &item)
 
virtual void addToScene (Scene &scene, const QString &opIdPath="")
 
bool isTransformModified () const
 
SceneItemoperator= (const SceneItem &item)
 
void setTransformModified (bool b)
 
- Protected Member Functions inherited from Observable
 Observable ()
 
 Observable (const Observable &)
 

Detailed Description

ClipRegions are a type of SceneItem which specify a region in 3D space which is to be used for render-time clipping of MeshModelInstances in a scene. MeshModelInstances affected by ClipRegions are rendered such that parts of the instance that are inside / outside (depending upon the selected criteria) are not drawn (i.e. clipped).

ClipRegions affect all MeshModelInstances at the same level or below them in the scene graph, i.e. all MeshModelInstances under the same transform as a ClipRegion, or a child transform, will be tested against the ClipRegion.

Member Enumeration Documentation

◆ ClipCriteria

Enumerator
InsideRegion 
OutsideRegion 

Constructor & Destructor Documentation

◆ ClipRegion() [1/2]

ClipRegion ( const QString &  id = "")

Constructs a new ClipRegion with default values. By default, the ClipRegion is defined with a "null" region, that is, a region that will not result on any clipping being performed.

◆ ClipRegion() [2/2]

ClipRegion ( const ClipRegion clipRegion)

◆ ~ClipRegion()

~ClipRegion ( )
override

Member Function Documentation

◆ clone()

ClipRegion * clone ( ) const
overridevirtual
Returns
A clone of this object.
Note
Subclasses would normally return their own type rather than the Clonable type. The C++ language rules allow a more derived type to be returned from a virtual function and the compiler will still treat it as a valid override.

Implements SceneItem.

◆ getClipCriteria()

ClipRegion::ClipCriteria getClipCriteria ( ) const
Returns
The 'criteria' setting currently applied to the clip region - ie. whether the region is to clip all geometry inside or outside its area.
See also
setClipCriteria

◆ getMatrixGlobal()

Mesh::TransformMatrix getMatrixGlobal ( ) const
overridevirtual
Returns

Reimplemented from SceneItem.

◆ getRegion()

const Region & getRegion ( ) const
Returns
The region to be tested against for clipping.
See also
setRegion

◆ getTransformMatrix()

const Mesh::TransformMatrix & getTransformMatrix ( ) const
Returns
The transform matrix that is applicable to this clip region.
See also
setTransformMatrix

◆ getVisible()

bool getVisible ( ) const
Returns
True if the clip region is visible when its scene is being visualised.
Note
The WSGLWidget and other such scene visualisation widgets are free to ignore this property, or provide 'overrides'. For example, the WSGLWidget provides a "show symbols" property, which enables all non-models, such as clip regions, to be set as visible or invisible.
See also
setVisible

◆ operator=()

ClipRegion & operator= ( const ClipRegion rhs)
Parameters
rhsThe ClipRegion whose details we are assigning to this clip region.

Assigns the specified ClipRegion to this ClipRegion, performing a deep copy of all relevant information.

◆ setClipCriteria()

void setClipCriteria ( ClipRegion::ClipCriteria  criteria)
Parameters
criteriaThe criteria used to define the clip region. Inside will clip all geometry inside the clip region, Outside will clip all geometry ouside.
See also
getClipCriteria

◆ setRegion()

void setRegion ( const Mesh::Region region)
Parameters
regionThe region the is to be tested against for clipping.
See also
getRegion

◆ setTransformMatrix()

void setTransformMatrix ( const Mesh::TransformMatrix transformMatrix)
Parameters
transformMatrixTransforms the ClipRegion using the 4x4 matrix.
See also
getTransformMatrix

◆ setVisible()

void setVisible ( bool  b)
Parameters
bWhether or not the clip region should be visible when its scene is being visualised.
Note
The WSGLWidget and other such scene visualisation widgets are free to ignore this property, or provide 'overrides'. For example, the WSGLWidget provides a "show symbols" property, which enables all non-models, such as clip regions, to be set as visible or invisible.
See also
getVisible

◆ updateGlobalMatrix()

void updateGlobalMatrix ( )
overridevirtual

Reimplemented from SceneItem.

◆ visit()

bool visit ( SceneProcessor processor)
overridevirtual
Parameters
processorThe SceneProcessor that the ClipRegion is to visit.
Returns
true if the visit was successful, false otherwise.
Note
Generally, this will be invoked by a call to the SceneProcessor::process function. It should not be necessary to invoke this function directly.

Implements SceneItem.