Open CASCADE Technology 7.8.0
|
Implementation of low-level graphic structure. More...
#include <OpenGl_Structure.hxx>
Public Types | |
typedef SubclassStructIterator< OpenGl_Structure > | StructIterator |
Auxiliary wrapper to iterate OpenGl_Structure sequence. | |
typedef SubclassGroupIterator< OpenGl_Group > | GroupIterator |
Auxiliary wrapper to iterate OpenGl_Group sequence. | |
Public Types inherited from Standard_Transient | |
typedef void | base_type |
Returns a type descriptor about this object. | |
Public Member Functions | |
OpenGl_Structure (const Handle< Graphic3d_StructureManager > &theManager) | |
Create empty structure. | |
virtual void | OnVisibilityChanged () override |
Setup structure graphic state. | |
virtual void | Clear () override |
Clear graphic data. | |
virtual void | Connect (Graphic3d_CStructure &theStructure) override |
Connect other structure to this one. | |
virtual void | Disconnect (Graphic3d_CStructure &theStructure) override |
Disconnect other structure to this one. | |
virtual void | SetTransformation (const Handle< TopLoc_Datum3D > &theTrsf) override |
Synchronize structure transformation. | |
virtual void | SetTransformPersistence (const Handle< Graphic3d_TransformPers > &theTrsfPers) override |
Set transformation persistence. | |
virtual void | SetZLayer (const Graphic3d_ZLayerId theLayerIndex) override |
Set z layer ID to display the structure in specified layer. | |
virtual void | GraphicHighlight (const Handle< Graphic3d_PresentationAttributes > &theStyle) override |
Highlights structure according to the given style and updates corresponding class fields (highlight status and style) | |
virtual void | GraphicUnhighlight () override |
Unighlights structure and updates corresponding class fields (highlight status and style) | |
virtual Handle< Graphic3d_CStructure > | ShadowLink (const Handle< Graphic3d_StructureManager > &theManager) const override |
Create shadow link to this structure. | |
virtual Handle< Graphic3d_Group > | NewGroup (const Handle< Graphic3d_Structure > &theStruct) override |
Create new group within this structure. | |
virtual void | RemoveGroup (const Handle< Graphic3d_Group > &theGroup) override |
Remove group from this structure. | |
OpenGl_GraphicDriver * | GlDriver () const |
Access graphic driver. | |
void | Clear (const Handle< OpenGl_Context > &theGlCtx) |
virtual void | Render (const Handle< OpenGl_Workspace > &theWorkspace) const |
Renders the structure. | |
virtual void | Release (const Handle< OpenGl_Context > &theGlCtx) |
Releases structure resources. | |
void | ReleaseGlResources (const Handle< OpenGl_Context > &theGlCtx) |
This method releases GL resources without actual elements destruction. As result structure could be correctly destroyed layer without GL context (after last window was closed for example). | |
const OpenGl_Structure * | InstancedStructure () const |
Returns instanced OpenGL structure. | |
Standard_Size | ModificationState () const |
Returns structure modification state (for ray-tracing). | |
void | ResetModificationState () const |
Resets structure modification state (for ray-tracing). | |
Standard_Boolean | IsRaytracable () const |
Is the structure ray-tracable (contains ray-tracable elements)? | |
virtual void | updateLayerTransformation () override |
Update render transformation matrix. | |
virtual void | DumpJson (Standard_OStream &theOStream, Standard_Integer theDepth=-1) const override |
Dumps the content of me into the stream. | |
Public Member Functions inherited from Graphic3d_CStructure | |
const Handle< Graphic3d_GraphicDriver > & | GraphicDriver () const |
const Graphic3d_SequenceOfGroup & | Groups () const |
const Handle< TopLoc_Datum3D > & | Transformation () const |
Return transformation. | |
const Handle< Graphic3d_TransformPers > & | TransformPersistence () const |
Return transformation persistence. | |
bool | HasGroupTransformPersistence () const |
Return TRUE if some groups might have transform persistence; FALSE by default. | |
void | SetGroupTransformPersistence (bool theValue) |
Set if some groups might have transform persistence. | |
const Handle< Graphic3d_SequenceOfHClipPlane > & | ClipPlanes () const |
void | SetClipPlanes (const Handle< Graphic3d_SequenceOfHClipPlane > &thePlanes) |
Pass clip planes to the associated graphic driver structure. | |
const Graphic3d_BndBox3d & | BoundingBox () const |
Graphic3d_BndBox3d & | ChangeBoundingBox () |
bool | IsVisible () const |
Return structure visibility flag. | |
bool | IsVisible (const Standard_Integer theViewId) const |
Return structure visibility considering both View Affinity and global visibility state. | |
Graphic3d_ZLayerId | ZLayer () const |
Get z layer ID. | |
const Handle< Graphic3d_PresentationAttributes > & | HighlightStyle () const |
Returns valid handle to highlight style of the structure in case if highlight flag is set to true. | |
Standard_Integer | Identification () const |
Return structure id (generated by Graphic3d_GraphicDriver::NewIdentification() during structure construction). | |
Graphic3d_DisplayPriority | Priority () const |
Return structure display priority. | |
void | SetPriority (Graphic3d_DisplayPriority thePriority) |
Set structure display priority. | |
Graphic3d_DisplayPriority | PreviousPriority () const |
Return previous structure display priority. | |
void | SetPreviousPriority (Graphic3d_DisplayPriority thePriority) |
Set previous structure display priority. | |
Standard_Boolean | IsCulled () const |
Returns FALSE if the structure hits the current view volume, otherwise returns TRUE. | |
void | SetCulled (Standard_Boolean theIsCulled) const |
Marks structure as culled/not culled - note that IsAlwaysRendered() is ignored here! | |
void | MarkAsNotCulled () const |
Marks structure as overlapping the current view volume one. The method is called during traverse of BVH tree. | |
Standard_Boolean | BndBoxClipCheck () const |
Returns whether check of object's bounding box clipping is enabled before drawing of object; TRUE by default. | |
void | SetBndBoxClipCheck (Standard_Boolean theBndBoxClipCheck) |
Enable/disable check of object's bounding box clipping before drawing of object. | |
Standard_Boolean | IsAlwaysRendered () const |
Checks if the structure should be included into BVH tree or not. | |
Public Member Functions inherited from Standard_Transient | |
Standard_Transient () | |
Empty constructor. | |
Standard_Transient (const Standard_Transient &) | |
Copy constructor – does nothing. | |
Standard_Transient & | operator= (const Standard_Transient &) |
Assignment operator, needed to avoid copying reference counter. | |
virtual | ~Standard_Transient () |
Destructor must be virtual. | |
virtual const opencascade::handle< Standard_Type > & | DynamicType () const |
Returns a type descriptor about this object. | |
Standard_Boolean | IsInstance (const opencascade::handle< Standard_Type > &theType) const |
Returns a true value if this is an instance of Type. | |
Standard_Boolean | IsInstance (const Standard_CString theTypeName) const |
Returns a true value if this is an instance of TypeName. | |
Standard_Boolean | IsKind (const opencascade::handle< Standard_Type > &theType) const |
Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. | |
Standard_Boolean | IsKind (const Standard_CString theTypeName) const |
Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. | |
Standard_Transient * | This () const |
Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero. | |
Standard_Integer | GetRefCount () const noexcept |
Get the reference counter of this object. | |
void | IncrementRefCounter () noexcept |
Increments the reference counter of this object. | |
Standard_Integer | DecrementRefCounter () noexcept |
Decrements the reference counter of this object; returns the decremented value. | |
virtual void | Delete () const |
Memory deallocator for transient classes. | |
Additional Inherited Members | |
Static Public Member Functions inherited from Standard_Transient | |
static constexpr const char * | get_type_name () |
Returns a type descriptor about this object. | |
static const opencascade::handle< Standard_Type > & | get_type_descriptor () |
Returns type descriptor of Standard_Transient class. | |
Data Fields inherited from Graphic3d_CStructure | |
Handle< Graphic3d_ViewAffinity > | ViewAffinity |
view affinity mask | |
unsigned | IsInfinite: 1 |
unsigned | stick: 1 |
displaying state - should be set when structure has been added to scene graph (but can be in hidden state) | |
unsigned | highlight: 1 |
unsigned | visible: 1 |
visibility flag - can be used to suppress structure while leaving it in the scene graph | |
unsigned | HLRValidation: 1 |
unsigned | IsForHighlight: 1 |
unsigned | IsMutable: 1 |
unsigned | Is2dText: 1 |
Implementation of low-level graphic structure.
Auxiliary wrapper to iterate OpenGl_Group sequence.
Auxiliary wrapper to iterate OpenGl_Structure sequence.
OpenGl_Structure::OpenGl_Structure | ( | const Handle< Graphic3d_StructureManager > & | theManager | ) |
Create empty structure.
|
protectedvirtual |
|
protected |
Apply transform persistence into context. It disables shadows on non-3d objects when toEnable is true and restores otherwise.
[in] | theCtx | current context |
[in] | theTrsfPers | transform persistence |
[in] | theIsLocal | specifies if transform persistence is defined locally or to entire presentation |
[out] | theOldCastShadows | state of the previous cast shadows state |
|
overridevirtual |
Clear graphic data.
Implements Graphic3d_CStructure.
void OpenGl_Structure::Clear | ( | const Handle< OpenGl_Context > & | theGlCtx | ) |
|
overridevirtual |
Connect other structure to this one.
Implements Graphic3d_CStructure.
Reimplemented in OpenGl_StructureShadow.
|
overridevirtual |
Disconnect other structure to this one.
Implements Graphic3d_CStructure.
Reimplemented in OpenGl_StructureShadow.
|
overridevirtual |
Dumps the content of me into the stream.
Reimplemented from Graphic3d_CStructure.
|
inline |
Access graphic driver.
|
overridevirtual |
Highlights structure according to the given style and updates corresponding class fields (highlight status and style)
Implements Graphic3d_CStructure.
|
overridevirtual |
Unighlights structure and updates corresponding class fields (highlight status and style)
Implements Graphic3d_CStructure.
|
inline |
Returns instanced OpenGL structure.
Standard_Boolean OpenGl_Structure::IsRaytracable | ( | ) | const |
Is the structure ray-tracable (contains ray-tracable elements)?
|
inline |
Returns structure modification state (for ray-tracing).
|
overridevirtual |
Create new group within this structure.
Implements Graphic3d_CStructure.
|
overridevirtual |
Setup structure graphic state.
Implements Graphic3d_CStructure.
|
virtual |
Releases structure resources.
void OpenGl_Structure::ReleaseGlResources | ( | const Handle< OpenGl_Context > & | theGlCtx | ) |
This method releases GL resources without actual elements destruction. As result structure could be correctly destroyed layer without GL context (after last window was closed for example).
Notice however that reusage of this structure after calling this method is incorrect and will lead to broken visualization due to loosed data.
|
overridevirtual |
Remove group from this structure.
Implements Graphic3d_CStructure.
|
virtual |
Renders the structure.
|
protected |
Render the bounding box.
|
protected |
Renders groups of structure without applying any attributes (i.e. transform, material etc).
theWorkspace | current workspace |
theHasClosed | flag will be set to TRUE if structure contains at least one group of closed primitives |
|
inline |
Resets structure modification state (for ray-tracing).
|
protected |
Restore context from transform persistence changes.
[in] | theCtx | current context |
[in] | theTrsfPers | transform persistence |
[in] | theIsLocal | specifies if transform persistence is defined locally or to entire presentation |
[in] | theOldCastShadows | state of the previous cast shadows state |
|
overridevirtual |
Synchronize structure transformation.
Reimplemented from Graphic3d_CStructure.
|
overridevirtual |
Set transformation persistence.
Reimplemented from Graphic3d_CStructure.
|
overridevirtual |
Set z layer ID to display the structure in specified layer.
Reimplemented from Graphic3d_CStructure.
|
overridevirtual |
Create shadow link to this structure.
Implements Graphic3d_CStructure.
|
overridevirtual |
Update render transformation matrix.
Reimplemented from Graphic3d_CStructure.
|
protected |
Updates ray-tracable status for structure and its parents.
|
protected |
|
protected |
Used to tell OpenGl to interpret polygons in clockwise order.
|
mutableprotected |
|
mutableprotected |
|
protected |
transformation, actually used for rendering (includes Local Origin shift)