Open CASCADE Technology
7.6.0
|
Rendering workspace. Provides methods to render primitives and maintain GL state. More...
#include <OpenGl_Workspace.hxx>
Public Member Functions | |
OpenGl_Workspace (OpenGl_View *theView, const Handle< OpenGl_Window > &theWindow) | |
Constructor of rendering workspace. More... | |
virtual | ~OpenGl_Workspace () |
Destructor. More... | |
Standard_Boolean | Activate () |
Activate rendering context. More... | |
OpenGl_View * | View () const |
const Handle< OpenGl_Context > & | GetGlContext () |
Handle< OpenGl_FrameBuffer > | FBOCreate (const Standard_Integer theWidth, const Standard_Integer theHeight) |
void | FBORelease (Handle< OpenGl_FrameBuffer > &theFbo) |
Standard_Boolean | BufferDump (const Handle< OpenGl_FrameBuffer > &theFbo, Image_PixMap &theImage, const Graphic3d_BufferType &theBufferType) |
Standard_Integer | Width () const |
Standard_Integer | Height () const |
Standard_Boolean | SetUseZBuffer (const Standard_Boolean theToUse) |
Setup Z-buffer usage flag (without affecting GL state!). Returns previously set flag. More... | |
Standard_Boolean & | UseZBuffer () |
Standard_Boolean & | UseDepthWrite () |
Graphic3d_PolygonOffset | SetDefaultPolygonOffset (const Graphic3d_PolygonOffset &theOffset) |
Configure default polygon offset parameters. Return previous settings. More... | |
bool | ToAllowFaceCulling () const |
Return true if active group might activate face culling (e.g. primitives are closed). More... | |
bool | SetAllowFaceCulling (bool theToAllow) |
Allow or disallow face culling. This call does NOT affect current state of back face culling; ApplyAspectFace() should be called to update state. More... | |
bool | ToHighlight () const |
Return true if following structures should apply highlight color. More... | |
const Handle< Graphic3d_PresentationAttributes > & | HighlightStyle () const |
Return highlight style. More... | |
void | SetHighlightStyle (const Handle< Graphic3d_PresentationAttributes > &theStyle) |
Set highlight style. More... | |
const OpenGl_Vec4 & | EdgeColor () const |
Return edge color taking into account highlight flag. More... | |
const OpenGl_Vec4 & | InteriorColor () const |
Return Interior color taking into account highlight flag. More... | |
const OpenGl_Vec4 & | TextColor () const |
Return text color taking into account highlight flag. More... | |
const OpenGl_Vec4 & | TextSubtitleColor () const |
Return text Subtitle color taking into account highlight flag. More... | |
const OpenGl_Aspects * | Aspects () const |
Currently set aspects (can differ from applied). More... | |
const OpenGl_Aspects * | SetAspects (const OpenGl_Aspects *theAspect) |
Assign new aspects (will be applied within ApplyAspects()). More... | |
const Handle< OpenGl_TextureSet > & | TextureSet () const |
Return TextureSet from set Aspects or Environment texture. More... | |
const OpenGl_Aspects * | ApplyAspects (bool theToBindTextures=true) |
Apply aspects. More... | |
void | ResetAppliedAspect () |
Clear the applied aspect state to default values. More... | |
Standard_Integer | RenderFilter () const |
Get rendering filter. More... | |
void | SetRenderFilter (Standard_Integer theFilter) |
Set filter for restricting rendering of particular elements. More... | |
bool | ShouldRender (const OpenGl_Element *theElement, const OpenGl_Group *theGroup) |
Checks whether the element can be rendered or not. More... | |
Standard_Integer | NbSkippedTransparentElements () |
Return the number of skipped transparent elements within active OpenGl_RenderFilter_OpaqueOnly filter. More... | |
void | ResetSkippedCounter () |
Reset skipped transparent elements counter. More... | |
const OpenGl_Aspects & | NoneCulling () const |
Returns face aspect for none culling mode. More... | |
const OpenGl_Aspects & | FrontCulling () const |
Returns face aspect for front face culling mode. More... | |
void | SetEnvironmentTexture (const Handle< OpenGl_TextureSet > &theTexture) |
Sets a new environment texture. More... | |
const Handle< OpenGl_TextureSet > & | EnvironmentTexture () const |
Returns environment texture. More... | |
void | DumpJson (Standard_OStream &theOStream, Standard_Integer theDepth=-1) const |
Dumps the content of me into the stream. More... | |
Public Member Functions inherited from Standard_Transient | |
Standard_Transient () | |
Empty constructor. More... | |
Standard_Transient (const Standard_Transient &) | |
Copy constructor – does nothing. More... | |
Standard_Transient & | operator= (const Standard_Transient &) |
Assignment operator, needed to avoid copying reference counter. More... | |
virtual | ~Standard_Transient () |
Destructor must be virtual. More... | |
virtual void | Delete () const |
Memory deallocator for transient classes. More... | |
virtual const opencascade::handle< Standard_Type > & | DynamicType () const |
Returns a type descriptor about this object. More... | |
Standard_Boolean | IsInstance (const opencascade::handle< Standard_Type > &theType) const |
Returns a true value if this is an instance of Type. More... | |
Standard_Boolean | IsInstance (const Standard_CString theTypeName) const |
Returns a true value if this is an instance of TypeName. More... | |
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. More... | |
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. More... | |
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. More... | |
Standard_Integer | GetRefCount () const |
Get the reference counter of this object. More... | |
void | IncrementRefCounter () const |
Increments the reference counter of this object. More... | |
Standard_Integer | DecrementRefCounter () const |
Decrements the reference counter of this object; returns the decremented value. More... | |
Protected Attributes | |
protected fields | |
OpenGl_View * | myView |
Handle< OpenGl_Window > | myWindow |
Handle< OpenGl_Context > | myGlContext |
Standard_Boolean | myUseZBuffer |
Standard_Boolean | myUseDepthWrite |
OpenGl_Aspects | myNoneCulling |
OpenGl_Aspects | myFrontCulling |
fields related to status | |
Standard_Integer | myNbSkippedTranspElems |
counter of skipped transparent elements for OpenGl_LayerList two rendering passes method More... | |
Standard_Integer | myRenderFilter |
active filter for skipping rendering of elements by some criteria (multiple render passes) More... | |
OpenGl_Aspects | myDefaultAspects |
counter of skipped transparent elements for OpenGl_LayerList two rendering passes method More... | |
const OpenGl_Aspects * | myAspectsSet |
counter of skipped transparent elements for OpenGl_LayerList two rendering passes method More... | |
Handle< Graphic3d_Aspects > | myAspectsApplied |
counter of skipped transparent elements for OpenGl_LayerList two rendering passes method More... | |
Handle< Graphic3d_PresentationAttributes > | myAspectFaceAppliedWithHL |
counter of skipped transparent elements for OpenGl_LayerList two rendering passes method More... | |
bool | myToAllowFaceCulling |
allow back face culling More... | |
Handle< Graphic3d_PresentationAttributes > | myHighlightStyle |
active highlight style More... | |
OpenGl_Aspects | myAspectFaceHl |
Hiddenline aspect. More... | |
Handle< OpenGl_TextureSet > | myEnvironmentTexture |
counter of skipped transparent elements for OpenGl_LayerList two rendering passes method More... | |
Additional Inherited Members | |
Public Types inherited from Standard_Transient | |
typedef void | base_type |
Returns a type descriptor about this object. More... | |
Static Public Member Functions inherited from Standard_Transient | |
static const char * | get_type_name () |
Returns a type descriptor about this object. More... | |
static const opencascade::handle< Standard_Type > & | get_type_descriptor () |
Returns type descriptor of Standard_Transient class. More... | |
Rendering workspace. Provides methods to render primitives and maintain GL state.
OpenGl_Workspace::OpenGl_Workspace | ( | OpenGl_View * | theView, |
const Handle< OpenGl_Window > & | theWindow | ||
) |
Constructor of rendering workspace.
|
inlinevirtual |
Destructor.
Standard_Boolean OpenGl_Workspace::Activate | ( | ) |
Activate rendering context.
const OpenGl_Aspects* OpenGl_Workspace::ApplyAspects | ( | bool | theToBindTextures = true | ) |
Apply aspects.
theToBindTextures | flag to bind texture set defined by applied aspect |
|
inline |
Currently set aspects (can differ from applied).
Standard_Boolean OpenGl_Workspace::BufferDump | ( | const Handle< OpenGl_FrameBuffer > & | theFbo, |
Image_PixMap & | theImage, | ||
const Graphic3d_BufferType & | theBufferType | ||
) |
void OpenGl_Workspace::DumpJson | ( | Standard_OStream & | theOStream, |
Standard_Integer | theDepth = -1 |
||
) | const |
Dumps the content of me into the stream.
|
inline |
Return edge color taking into account highlight flag.
|
inline |
Returns environment texture.
Handle< OpenGl_FrameBuffer > OpenGl_Workspace::FBOCreate | ( | const Standard_Integer | theWidth, |
const Standard_Integer | theHeight | ||
) |
void OpenGl_Workspace::FBORelease | ( | Handle< OpenGl_FrameBuffer > & | theFbo | ) |
|
inline |
Returns face aspect for front face culling mode.
|
inline |
Standard_Integer OpenGl_Workspace::Height | ( | ) | const |
|
inline |
Return highlight style.
|
inline |
Return Interior color taking into account highlight flag.
|
inline |
Return the number of skipped transparent elements within active OpenGl_RenderFilter_OpaqueOnly filter.
|
inline |
Returns face aspect for none culling mode.
|
inline |
Get rendering filter.
void OpenGl_Workspace::ResetAppliedAspect | ( | ) |
Clear the applied aspect state to default values.
|
inline |
Reset skipped transparent elements counter.
|
inline |
Allow or disallow face culling. This call does NOT affect current state of back face culling; ApplyAspectFace() should be called to update state.
const OpenGl_Aspects* OpenGl_Workspace::SetAspects | ( | const OpenGl_Aspects * | theAspect | ) |
Assign new aspects (will be applied within ApplyAspects()).
Graphic3d_PolygonOffset OpenGl_Workspace::SetDefaultPolygonOffset | ( | const Graphic3d_PolygonOffset & | theOffset | ) |
Configure default polygon offset parameters. Return previous settings.
|
inline |
Sets a new environment texture.
|
inline |
Set highlight style.
|
inline |
Set filter for restricting rendering of particular elements.
|
inline |
Setup Z-buffer usage flag (without affecting GL state!). Returns previously set flag.
bool OpenGl_Workspace::ShouldRender | ( | const OpenGl_Element * | theElement, |
const OpenGl_Group * | theGroup | ||
) |
Checks whether the element can be rendered or not.
theElement | [in] the element to check |
theGroup | [in] the group containing the element |
|
inline |
Return text color taking into account highlight flag.
|
inline |
Return text Subtitle color taking into account highlight flag.
|
inline |
Return TextureSet from set Aspects or Environment texture.
|
inline |
Return true if active group might activate face culling (e.g. primitives are closed).
|
inline |
Return true if following structures should apply highlight color.
|
inline |
|
inline |
|
inline |
Standard_Integer OpenGl_Workspace::Width | ( | ) | const |
|
protected |
counter of skipped transparent elements for OpenGl_LayerList two rendering passes method
|
protected |
Hiddenline aspect.
|
protected |
counter of skipped transparent elements for OpenGl_LayerList two rendering passes method
|
protected |
counter of skipped transparent elements for OpenGl_LayerList two rendering passes method
|
protected |
counter of skipped transparent elements for OpenGl_LayerList two rendering passes method
|
protected |
counter of skipped transparent elements for OpenGl_LayerList two rendering passes method
|
protected |
|
protected |
|
protected |
active highlight style
|
protected |
counter of skipped transparent elements for OpenGl_LayerList two rendering passes method
|
protected |
|
protected |
active filter for skipping rendering of elements by some criteria (multiple render passes)
|
protected |
allow back face culling
|
protected |
|
protected |
|
protected |
|
protected |