Open CASCADE Technology
7.1.0.beta
|
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 () |
Standard_Boolean | IsCullingEnabled () const |
bool | ToAllowFaceCulling () const |
Return true if active group might activate face culling (e.g. primitives are closed). More... | |
void | 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... | |
void | SetHighlight (bool theToHighlight) |
Set highlight. More... | |
const OpenGl_Vec4 & | LineColor () const |
Return line color taking into account highlight flag. More... | |
const OpenGl_Vec4 & | EdgeColor () const |
Return edge color taking into account highlight flag. More... | |
const OpenGl_Vec4 & | MarkerColor () const |
Return marker 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_AspectLine * | AspectLine () const |
Currently set line aspect (can differ from applied). More... | |
const OpenGl_AspectFace * | AspectFace () const |
Currently set face aspect (can differ from applied). More... | |
const OpenGl_AspectMarker * | AspectMarker () const |
Currently set marker aspect (can differ from applied). More... | |
const OpenGl_AspectText * | AspectText () const |
Currently set text aspect (can differ from applied). More... | |
const OpenGl_AspectLine * | SetAspectLine (const OpenGl_AspectLine *theAspect) |
Assign new line aspect (will be applied within ApplyAspectLine()). More... | |
const OpenGl_AspectFace * | SetAspectFace (const OpenGl_AspectFace *theAspect) |
Assign new face aspect (will be applied within ApplyAspectFace()). More... | |
const OpenGl_AspectMarker * | SetAspectMarker (const OpenGl_AspectMarker *theAspect) |
Assign new marker aspect (will be applied within ApplyAspectMarker()). More... | |
const OpenGl_AspectText * | SetAspectText (const OpenGl_AspectText *theAspect) |
Assign new text aspect (will be applied within ApplyAspectText()). More... | |
const OpenGl_AspectLine * | ApplyAspectLine () |
Apply line aspect. More... | |
const OpenGl_AspectFace * | ApplyAspectFace () |
Apply face aspect. More... | |
const OpenGl_AspectMarker * | ApplyAspectMarker () |
Apply marker aspect. More... | |
const OpenGl_AspectText * | ApplyAspectText () |
Apply text aspect. More... | |
void | ResetAppliedAspect () |
Clear the applied aspect state to default values. More... | |
Handle< OpenGl_Texture > | DisableTexture () |
Handle< OpenGl_Texture > | EnableTexture (const Handle< OpenGl_Texture > &theTexture, const Handle< Graphic3d_TextureParams > &theParams=NULL) |
const Handle< OpenGl_Texture > & | ActiveTexture () const |
void | SetRenderFilter (const Handle< OpenGl_RenderFilter > &theFilter) |
Set filter for restricting rendering of particular elements. Filter can be applied for rendering passes used by recursive rendering algorithms for rendering elements of groups. More... | |
const Handle< OpenGl_RenderFilter > & | GetRenderFilter () const |
Get rendering filter. More... | |
const OpenGl_Matrix * | ViewMatrix () const |
const OpenGl_Matrix * | ModelMatrix () const |
void | SetPolygonOffset (const Graphic3d_PolygonOffset &theParams) |
Sets and applies current polygon offset. More... | |
const Graphic3d_PolygonOffset & | AppliedPolygonOffset () |
Returns currently applied polygon offset parameters. More... | |
const Handle< OpenGl_CappingAlgoFilter > & | DefaultCappingAlgoFilter () const |
Returns capping algorithm rendering filter. More... | |
const OpenGl_AspectFace & | NoneCulling () const |
Returns face aspect for none culling mode. More... | |
const OpenGl_AspectFace & | FrontCulling () const |
Returns face aspect for front face culling mode. More... | |
void | SetEnvironmentTexture (const Handle< OpenGl_Texture > &theTexture) |
Sets a new environment texture. More... | |
const Handle< OpenGl_Texture > & | EnvironmentTexture () const |
Returns environment texture. 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... | |
Data Fields | |
Standard_Integer | NamedStatus |
const OpenGl_Vec4 * | HighlightColor |
Protected Types | |
enum | { TEL_FRONT_MATERIAL = 1, TEL_BACK_MATERIAL = 2 } |
Protected Member Functions | |
void | updateMaterial (const int theFlag) |
void | setTextureParams (Handle< OpenGl_Texture > &theTexture, const Handle< Graphic3d_TextureParams > &theParams) |
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.
|
inline |
|
inline |
Returns currently applied polygon offset parameters.
const OpenGl_AspectFace* OpenGl_Workspace::ApplyAspectFace | ( | ) |
Apply face aspect.
|
inline |
Apply line aspect.
const OpenGl_AspectMarker* OpenGl_Workspace::ApplyAspectMarker | ( | ) |
Apply marker aspect.
|
inline |
Apply text aspect.
|
inline |
Currently set face aspect (can differ from applied).
|
inline |
Currently set line aspect (can differ from applied).
|
inline |
Currently set marker aspect (can differ from applied).
|
inline |
Currently set text aspect (can differ from applied).
Standard_Boolean OpenGl_Workspace::BufferDump | ( | const Handle< OpenGl_FrameBuffer > & | theFbo, |
Image_PixMap & | theImage, | ||
const Graphic3d_BufferType & | theBufferType | ||
) |
|
inline |
Returns capping algorithm rendering filter.
Handle< OpenGl_Texture > OpenGl_Workspace::DisableTexture | ( | ) |
|
inline |
Return edge color taking into account highlight flag.
Handle< OpenGl_Texture > OpenGl_Workspace::EnableTexture | ( | const Handle< OpenGl_Texture > & | theTexture, |
const Handle< Graphic3d_TextureParams > & | theParams = NULL |
||
) |
|
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 |
|
inline |
Get rendering filter.
Standard_Integer OpenGl_Workspace::Height | ( | ) | const |
|
inline |
Return Interior color taking into account highlight flag.
Standard_Boolean OpenGl_Workspace::IsCullingEnabled | ( | ) | const |
|
inline |
Return line color taking into account highlight flag.
|
inline |
Return marker color taking into account highlight flag.
|
inline |
|
inline |
Returns face aspect for none culling mode.
void OpenGl_Workspace::ResetAppliedAspect | ( | ) |
Clear the applied aspect state to default values.
|
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_AspectFace* OpenGl_Workspace::SetAspectFace | ( | const OpenGl_AspectFace * | theAspect | ) |
Assign new face aspect (will be applied within ApplyAspectFace()).
const OpenGl_AspectLine* OpenGl_Workspace::SetAspectLine | ( | const OpenGl_AspectLine * | theAspect | ) |
Assign new line aspect (will be applied within ApplyAspectLine()).
const OpenGl_AspectMarker* OpenGl_Workspace::SetAspectMarker | ( | const OpenGl_AspectMarker * | theAspect | ) |
Assign new marker aspect (will be applied within ApplyAspectMarker()).
const OpenGl_AspectText* OpenGl_Workspace::SetAspectText | ( | const OpenGl_AspectText * | theAspect | ) |
Assign new text aspect (will be applied within ApplyAspectText()).
|
inline |
Sets a new environment texture.
|
inline |
Set highlight.
void OpenGl_Workspace::SetPolygonOffset | ( | const Graphic3d_PolygonOffset & | theParams | ) |
Sets and applies current polygon offset.
|
inline |
Set filter for restricting rendering of particular elements. Filter can be applied for rendering passes used by recursive rendering algorithms for rendering elements of groups.
theFilter | [in] the filter instance. |
|
protected |
|
inline |
Setup Z-buffer usage flag (without affecting GL state!). Returns previously set flag.
|
inline |
Return text color taking into account highlight flag.
|
inline |
Return text Subtitle color taking into account highlight flag.
|
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.
|
protected |
|
inline |
|
inline |
|
inline |
|
inline |
Standard_Integer OpenGl_Workspace::Width | ( | ) | const |
const OpenGl_Vec4* OpenGl_Workspace::HighlightColor |
|
protected |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
|
protected |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
|
protected |
Hiddenline aspect.
|
protected |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
|
protected |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
|
protected |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
|
protected |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
|
protected |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
|
protected |
|
protected |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
|
protected |
|
protected |
|
protected |
current back material state
|
protected |
current front material state (cached to reduce GL context updates)
|
protected |
temporary variable
|
protected |
Model matrix with applied structure transformations.
|
protected |
|
protected |
currently applied polygon offset
|
protected |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
|
protected |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
|
protected |
allow back face culling
|
protected |
flag indicating highlighting mode
|
protected |
|
protected |
|
protected |
|
protected |
Standard_Integer OpenGl_Workspace::NamedStatus |
|
protected |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
|
protected |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)