|
Open CASCADE Technology
6.7.1
|
Represents window with GL context. Provides methods to render primitives and maintain GL state. More...
#include <OpenGl_Workspace.hxx>

Public Member Functions | |
| OpenGl_Workspace (const Handle< OpenGl_Display > &theDisplay, const CALL_DEF_WINDOW &theCWindow, Aspect_RenderingContext theGContext, const Handle< OpenGl_Caps > &theCaps, const Handle< OpenGl_Context > &theShareCtx) | |
| Main constructor - prepare GL context for specified window. More... | |
| virtual | ~OpenGl_Workspace () |
| Destructor. More... | |
| void | SetActiveView (const Handle< OpenGl_View > &theView) |
| const Handle< OpenGl_View > & | ActiveView () const |
| void | Redraw (const Graphic3d_CView &theCView, const Aspect_CLayer2d &theCUnderLayer, const Aspect_CLayer2d &theCOverLayer) |
| Redraw the window. More... | |
| void | Update (const Graphic3d_CView &theCView, const Aspect_CLayer2d &theCUnderLayer, const Aspect_CLayer2d &theCOverLayer) |
| Deprecated. Simply calls Redraw(). More... | |
| Standard_Boolean | Print (const Handle< OpenGl_PrinterContext > &thePrintContext, const Graphic3d_CView &theCView, const Aspect_CLayer2d &theCUnderLayer, const Aspect_CLayer2d &theCOverLayer, const Aspect_Handle theHPrintDC, const Standard_Boolean theToShowBackground, const Standard_CString theFileName, const Aspect_PrintAlgo thePrintAlgorithm, const Standard_Real theScaleFactor) |
| Special method to perform printing. System-specific and currently only Win platform implemented. More... | |
| const Handle < OpenGl_PrinterContext > & | PrinterContext () const |
| void | DisplayCallback (const Graphic3d_CView &theCView, int theReason) |
| Standard_Boolean | SetImmediateModeDrawToFront (const Standard_Boolean theDrawToFrontBuffer) |
| Standard_Boolean | BeginAddMode () |
| void | EndAddMode () |
| void | ClearImmediatMode (const Graphic3d_CView &theCView, const Standard_Boolean theToFlush) |
| void | RedrawImmediatMode () |
| Standard_Boolean | BeginImmediatMode (const Graphic3d_CView &theCView, const Standard_Boolean theUseDepthTest, const Standard_Boolean theRetainMode) |
| void | EndImmediatMode () |
| void | DrawStructure (const OpenGl_Structure *theStructure) |
| Graphic3d_PtrFrameBuffer | FBOCreate (const Standard_Integer theWidth, const Standard_Integer theHeight) |
| void | FBORelease (Graphic3d_PtrFrameBuffer theFBOPtr) |
| Standard_Boolean | BufferDump (OpenGl_FrameBuffer *theFBOPtr, Image_PixMap &theImage, const Graphic3d_BufferType &theBufferType) |
| void | UseTransparency (const Standard_Boolean theFlag) |
| Standard_Boolean & | UseZBuffer () |
| Standard_Boolean & | UseDepthTest () |
| Standard_Boolean & | UseGLLight () |
| const OpenGl_Matrix * | SetViewMatrix (const OpenGl_Matrix *) |
| const OpenGl_Matrix * | SetStructureMatrix (const OpenGl_Matrix *, bool aRevert=false) |
| const void | UpdateModelViewMatrix () |
| Updates current model-view matrix replacing it with StructureMatrixT*ViewMatrix from the workspace. More... | |
| const OpenGl_AspectLine * | SetAspectLine (const OpenGl_AspectLine *theAspect) |
| const OpenGl_AspectFace * | SetAspectFace (const OpenGl_AspectFace *theAspect) |
| const OpenGl_AspectMarker * | SetAspectMarker (const OpenGl_AspectMarker *theAspect) |
| const OpenGl_AspectText * | SetAspectText (const OpenGl_AspectText *theAspect) |
| void | SetTextParam (const OpenGl_TextParam *theParam) |
| const OpenGl_AspectLine * | AspectLine (const Standard_Boolean theWithApply) |
| const OpenGl_AspectFace * | AspectFace (const Standard_Boolean theWithApply) |
| const OpenGl_AspectMarker * | AspectMarker (const Standard_Boolean theWithApply) |
| const OpenGl_AspectText * | AspectText (const Standard_Boolean theWithApply) |
| const OpenGl_TextParam * | AspectTextParams () const |
| void | ResetAppliedAspect () |
| Clear the applied aspect state. More... | |
| Handle< OpenGl_Texture > | DisableTexture () |
| Handle< OpenGl_Texture > | EnableTexture (const Handle< OpenGl_Texture > &theTexture, const Handle< Graphic3d_TextureParams > &theParams=NULL) |
| 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 (int theMode, Standard_ShortReal theFactor, Standard_ShortReal theUnits) |
| Sets and applies current polygon offset. More... | |
| const TEL_POFFSET_PARAM & | AppliedPolygonOffset () |
| Returns currently applied polygon offset params. More... | |
Public Member Functions inherited from OpenGl_Window | |
| OpenGl_Window (const Handle< OpenGl_Display > &theDisplay, const CALL_DEF_WINDOW &theCWindow, Aspect_RenderingContext theGContext, const Handle< OpenGl_Caps > &theCaps, const Handle< OpenGl_Context > &theShareCtx) | |
| Main constructor - prepare GL context for specified window. More... | |
| virtual | ~OpenGl_Window () |
| Destructor. More... | |
| void | Resize (const CALL_DEF_WINDOW &theCWindow) |
| Resizes the window. More... | |
| void | ReadDepths (const Standard_Integer theX, const Standard_Integer theY, const Standard_Integer theWidth, const Standard_Integer theHeight, float *theDepths) |
| Reads depth component for current scene into specified buffer. More... | |
| void | SetBackgroundColor (const Standard_ShortReal theR, const Standard_ShortReal theG, const Standard_ShortReal theB) |
| void | EnablePolygonOffset () const |
| void | DisablePolygonOffset () const |
| Standard_Integer | Width () const |
| Standard_Integer | Height () const |
| const TEL_COLOUR & | BackgroundColor () const |
| Standard_Boolean | Dither () const |
| Standard_Boolean | BackDither () const |
| const Handle< OpenGl_Display > & | GetDisplay () const |
| const Handle< OpenGl_Context > & | GetGlContext () const |
| GLCONTEXT | GetGContext () const |
| This method will be removed in future version! More... | |
Public Member Functions inherited from MMgt_TShared | |
| virtual void | Delete () const |
| Memory deallocator for transient classes. 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 | ShallowDump (Standard_OStream &) const |
| virtual const Handle_Standard_Type & | DynamicType () const |
| Returns a type information object about this object. More... | |
| Standard_Boolean | IsInstance (const 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 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... | |
| virtual Handle_Standard_Transient | This () const |
| Returns a Handle which references this object. Must never be called to objects created in stack. More... | |
| Standard_Integer | GetRefCount () const |
| Get the reference counter of this object. More... | |
Data Fields | |
| Standard_Integer | NamedStatus |
| const TEL_COLOUR * | HighlightColor |
Protected Member Functions | |
| void | CopyBuffers (const Standard_Boolean theFrontToBack) |
| virtual Standard_Boolean | Activate () |
| Makes GL context for this window active in current thread. More... | |
| void | Redraw1 (const Graphic3d_CView &theCView, const Aspect_CLayer2d &theCUnderLayer, const Aspect_CLayer2d &theCOverLayer, const int theToSwap) |
| void | updateMaterial (const int theFlag) |
| void | setTextureParams (Handle< OpenGl_Texture > &theTexture, const Handle< Graphic3d_TextureParams > &theParams) |
Protected Member Functions inherited from OpenGl_Window | |
| void | Init () |
| Activates GL context and setup viewport. More... | |
| void | EnableFeatures () const |
| void | DisableFeatures () const |
| void | MakeFrontBufCurrent () const |
| Draw directly to the FRONT buffer. Can cause artifacts on the screen. More... | |
| void | MakeBackBufCurrent () const |
| Draw to BACK buffer. Normal and default state. More... | |
| void | MakeFrontAndBackBufCurrent () const |
| Draw simultaneously to BACK and FRONT buffers. Abnormal usage. More... | |
Protected Attributes | |
protected fields | |
| Handle< OpenGl_PrinterContext > | myPrintContext |
| optimization flag for immediate mode (to render directly to the front buffer) More... | |
| Handle< OpenGl_View > | myView |
| optimization flag for immediate mode (to render directly to the front buffer) More... | |
| Standard_Boolean | myIsTransientOpen |
| optimization flag for immediate mode (to render directly to the front buffer) More... | |
| Standard_Boolean | myRetainMode |
| optimization flag for immediate mode (to render directly to the front buffer) More... | |
| Standard_Boolean | myTransientDrawToFront |
| optimization flag for immediate mode (to render directly to the front buffer) More... | |
| NCollection_Sequence< const OpenGl_Structure * > | myTransientList |
| optimization flag for immediate mode (to render directly to the front buffer) More... | |
| Standard_Boolean | myUseTransparency |
| optimization flag for immediate mode (to render directly to the front buffer) More... | |
| Standard_Boolean | myUseZBuffer |
| optimization flag for immediate mode (to render directly to the front buffer) More... | |
| Standard_Boolean | myUseDepthTest |
| optimization flag for immediate mode (to render directly to the front buffer) More... | |
| Standard_Boolean | myUseGLLight |
| optimization flag for immediate mode (to render directly to the front buffer) More... | |
| Standard_Boolean | myBackBufferRestored |
| optimization flag for immediate mode (to render directly to the front buffer) More... | |
fields related to status | |
| Handle< OpenGl_RenderFilter > | myRenderFilter |
| currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More... | |
| Handle< OpenGl_Texture > | myTextureBound |
| currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More... | |
| const OpenGl_AspectLine * | AspectLine_set |
| currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More... | |
| const OpenGl_AspectLine * | AspectLine_applied |
| currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More... | |
| const OpenGl_AspectFace * | AspectFace_set |
| currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More... | |
| const OpenGl_AspectFace * | AspectFace_applied |
| currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More... | |
| const OpenGl_AspectMarker * | AspectMarker_set |
| currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More... | |
| const OpenGl_AspectMarker * | AspectMarker_applied |
| currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More... | |
| const OpenGl_AspectText * | AspectText_set |
| currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More... | |
| const OpenGl_AspectText * | AspectText_applied |
| currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More... | |
| const OpenGl_TextParam * | TextParam_set |
| currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More... | |
| const OpenGl_TextParam * | TextParam_applied |
| currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More... | |
| const OpenGl_Matrix * | ViewMatrix_applied |
| currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More... | |
| const OpenGl_Matrix * | StructureMatrix_applied |
| currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More... | |
| OpenGl_Material | myMatFront |
| current front material state (cached to reduce GL context updates) More... | |
| OpenGl_Material | myMatBack |
| current back material state More... | |
| OpenGl_Material | myMatTmp |
| temporary variable More... | |
| OpenGl_Matrix | myModelViewMatrix |
| Model matrix with applied structure transformations. More... | |
| TEL_POFFSET_PARAM | PolygonOffset_applied |
| Currently applied polygon offset. More... | |
| OpenGl_AspectFace | myAspectFaceHl |
| Hiddenline aspect. More... | |
Protected Attributes inherited from OpenGl_Window | |
| Handle< OpenGl_Display > | myDisplay |
| Handle< OpenGl_Context > | myGlContext |
| Standard_Boolean | myOwnGContext |
| set to TRUE if GL context was not created by this class More... | |
| Standard_Integer | myWidth |
| Standard_Integer | myHeight |
| TEL_COLOUR | myBgColor |
| Standard_Boolean | myDither |
| Standard_Boolean | myBackDither |
Represents window with GL context. Provides methods to render primitives and maintain GL state.
| OpenGl_Workspace::OpenGl_Workspace | ( | const Handle< OpenGl_Display > & | theDisplay, |
| const CALL_DEF_WINDOW & | theCWindow, | ||
| Aspect_RenderingContext | theGContext, | ||
| const Handle< OpenGl_Caps > & | theCaps, | ||
| const Handle< OpenGl_Context > & | theShareCtx | ||
| ) |
Main constructor - prepare GL context for specified window.
|
virtual |
Destructor.
|
protectedvirtual |
Makes GL context for this window active in current thread.
Reimplemented from OpenGl_Window.
|
inline |
|
inline |
Returns currently applied polygon offset params.
| const OpenGl_AspectFace* OpenGl_Workspace::AspectFace | ( | const Standard_Boolean | theWithApply | ) |
| const OpenGl_AspectLine* OpenGl_Workspace::AspectLine | ( | const Standard_Boolean | theWithApply | ) |
| const OpenGl_AspectMarker* OpenGl_Workspace::AspectMarker | ( | const Standard_Boolean | theWithApply | ) |
| const OpenGl_AspectText* OpenGl_Workspace::AspectText | ( | const Standard_Boolean | theWithApply | ) |
|
inline |
| Standard_Boolean OpenGl_Workspace::BeginAddMode | ( | ) |
| Standard_Boolean OpenGl_Workspace::BeginImmediatMode | ( | const Graphic3d_CView & | theCView, |
| const Standard_Boolean | theUseDepthTest, | ||
| const Standard_Boolean | theRetainMode | ||
| ) |
| Standard_Boolean OpenGl_Workspace::BufferDump | ( | OpenGl_FrameBuffer * | theFBOPtr, |
| Image_PixMap & | theImage, | ||
| const Graphic3d_BufferType & | theBufferType | ||
| ) |
| void OpenGl_Workspace::ClearImmediatMode | ( | const Graphic3d_CView & | theCView, |
| const Standard_Boolean | theToFlush | ||
| ) |
|
protected |
| Handle< OpenGl_Texture > OpenGl_Workspace::DisableTexture | ( | ) |
| void OpenGl_Workspace::DisplayCallback | ( | const Graphic3d_CView & | theCView, |
| int | theReason | ||
| ) |
| void OpenGl_Workspace::DrawStructure | ( | const OpenGl_Structure * | theStructure | ) |
| Handle< OpenGl_Texture > OpenGl_Workspace::EnableTexture | ( | const Handle< OpenGl_Texture > & | theTexture, |
| const Handle< Graphic3d_TextureParams > & | theParams = NULL |
||
| ) |
| void OpenGl_Workspace::EndAddMode | ( | ) |
| void OpenGl_Workspace::EndImmediatMode | ( | ) |
| Graphic3d_PtrFrameBuffer OpenGl_Workspace::FBOCreate | ( | const Standard_Integer | theWidth, |
| const Standard_Integer | theHeight | ||
| ) |
| void OpenGl_Workspace::FBORelease | ( | Graphic3d_PtrFrameBuffer | theFBOPtr | ) |
|
inline |
Get rendering filter.
|
inline |
| Standard_Boolean OpenGl_Workspace::Print | ( | const Handle< OpenGl_PrinterContext > & | thePrintContext, |
| const Graphic3d_CView & | theCView, | ||
| const Aspect_CLayer2d & | theCUnderLayer, | ||
| const Aspect_CLayer2d & | theCOverLayer, | ||
| const Aspect_Handle | theHPrintDC, | ||
| const Standard_Boolean | theToShowBackground, | ||
| const Standard_CString | theFileName, | ||
| const Aspect_PrintAlgo | thePrintAlgorithm, | ||
| const Standard_Real | theScaleFactor | ||
| ) |
Special method to perform printing. System-specific and currently only Win platform implemented.
|
inline |
| void OpenGl_Workspace::Redraw | ( | const Graphic3d_CView & | theCView, |
| const Aspect_CLayer2d & | theCUnderLayer, | ||
| const Aspect_CLayer2d & | theCOverLayer | ||
| ) |
Redraw the window.
|
protected |
| void OpenGl_Workspace::RedrawImmediatMode | ( | ) |
| void OpenGl_Workspace::ResetAppliedAspect | ( | ) |
Clear the applied aspect state.
|
inline |
| const OpenGl_AspectFace* OpenGl_Workspace::SetAspectFace | ( | const OpenGl_AspectFace * | theAspect | ) |
| const OpenGl_AspectLine* OpenGl_Workspace::SetAspectLine | ( | const OpenGl_AspectLine * | theAspect | ) |
| const OpenGl_AspectMarker* OpenGl_Workspace::SetAspectMarker | ( | const OpenGl_AspectMarker * | theAspect | ) |
| const OpenGl_AspectText* OpenGl_Workspace::SetAspectText | ( | const OpenGl_AspectText * | theAspect | ) |
| Standard_Boolean OpenGl_Workspace::SetImmediateModeDrawToFront | ( | const Standard_Boolean | theDrawToFrontBuffer | ) |
| void OpenGl_Workspace::SetPolygonOffset | ( | int | theMode, |
| Standard_ShortReal | theFactor, | ||
| Standard_ShortReal | theUnits | ||
| ) |
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. |
| const OpenGl_Matrix* OpenGl_Workspace::SetStructureMatrix | ( | const OpenGl_Matrix * | , |
| bool | aRevert = false |
||
| ) |
|
inline |
|
protected |
| const OpenGl_Matrix* OpenGl_Workspace::SetViewMatrix | ( | const OpenGl_Matrix * | ) |
|
inline |
Deprecated. Simply calls Redraw().
|
protected |
| const void OpenGl_Workspace::UpdateModelViewMatrix | ( | ) |
Updates current model-view matrix replacing it with StructureMatrixT*ViewMatrix from the workspace.
|
inline |
|
inline |
| void OpenGl_Workspace::UseTransparency | ( | const Standard_Boolean | theFlag | ) |
|
inline |
|
inline |
|
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 |
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)
| const TEL_COLOUR* OpenGl_Workspace::HighlightColor |
|
protected |
Hiddenline aspect.
|
protected |
optimization flag for immediate mode (to render directly to the front buffer)
|
protected |
optimization flag for immediate mode (to render directly to the front buffer)
|
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 |
optimization flag for immediate mode (to render directly to the front buffer)
|
protected |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
|
protected |
optimization flag for immediate mode (to render directly to the front buffer)
|
protected |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
|
protected |
optimization flag for immediate mode (to render directly to the front buffer)
|
protected |
optimization flag for immediate mode (to render directly to the front buffer)
|
protected |
optimization flag for immediate mode (to render directly to the front buffer)
|
protected |
optimization flag for immediate mode (to render directly to the front buffer)
|
protected |
optimization flag for immediate mode (to render directly to the front buffer)
|
protected |
optimization flag for immediate mode (to render directly to the front buffer)
|
protected |
optimization flag for immediate mode (to render directly to the front buffer)
| Standard_Integer OpenGl_Workspace::NamedStatus |
|
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 |
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)
1.8.5