Open CASCADE Technology 6.6.0
Public Member Functions | Data Fields | Protected Member Functions
OpenGl_Workspace Class Reference

Reprepsents window with GL context. Provides methods to render primitives and maintan GL state.

#include <OpenGl_Workspace.hxx>

Inheritance diagram for OpenGl_Workspace:
Inheritance graph
[legend]

Public Member Functions

 OpenGl_Workspace (const Handle< OpenGl_Display > &theDisplay, const CALL_DEF_WINDOW &theCWindow, Aspect_RenderingContext theGContext, const Handle< OpenGl_Context > &theShareCtx)
 Main constructor - prepare GL context for specified window.
virtual ~OpenGl_Workspace ()
 Destructor.
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.
void Update (const Graphic3d_CView &theCView, const Aspect_CLayer2d &theCUnderLayer, const Aspect_CLayer2d &theCOverLayer)
 Deprecated. Simply calls Redraw().
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.
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_BooleanUseZBuffer ()
Standard_BooleanUseDepthTest ()
Standard_BooleanUseGLLight ()
const OpenGl_MatrixSetViewMatrix (const OpenGl_Matrix *)
const OpenGl_MatrixSetStructureMatrix (const OpenGl_Matrix *)
const OpenGl_AspectLineSetAspectLine (const OpenGl_AspectLine *theAspect)
const OpenGl_AspectFaceSetAspectFace (const OpenGl_AspectFace *theAspect)
const OpenGl_AspectMarkerSetAspectMarker (const OpenGl_AspectMarker *theAspect)
const OpenGl_AspectTextSetAspectText (const OpenGl_AspectText *theAspect)
void SetTextParam (const OpenGl_TextParam *theParam)
const OpenGl_AspectLineAspectLine (const Standard_Boolean theWithApply)
const OpenGl_AspectFaceAspectFace (const Standard_Boolean theWithApply)
const OpenGl_AspectMarkerAspectMarker (const Standard_Boolean theWithApply)
const OpenGl_AspectTextAspectText (const Standard_Boolean theWithApply)
const OpenGl_TextParamAspectTextParams () const
void ResetAppliedAspect ()
 Clear the applied aspect state.
Handle< OpenGl_TextureDisableTexture ()
Handle< OpenGl_TextureEnableTexture (const Handle< OpenGl_Texture > &theTexture, const Handle< Graphic3d_TextureParams > &theParams=NULL)

Data Fields

Standard_Integer NamedStatus
const TEL_COLOURHighlightColor

Protected Member Functions

void CopyBuffers (const Standard_Boolean theFrontToBack)
virtual Standard_Boolean Activate ()
 Makes GL context for this window active in current thread.
void Redraw1 (const Graphic3d_CView &theCView, const Aspect_CLayer2d &theCUnderLayer, const Aspect_CLayer2d &theCOverLayer, const int theToSwap)
void UpdateMaterial (const int flag)
void setTextureParams (Handle< OpenGl_Texture > &theTexture, const Handle< Graphic3d_TextureParams > &theParams)

Protected Attributes

protected fields
Handle< OpenGl_PrinterContextmyPrintContext
 optimization flag for immediate mode (to render directly to the front buffer)
Handle< OpenGl_ViewmyView
 optimization flag for immediate mode (to render directly to the front buffer)
Standard_Boolean myIsTransientOpen
 optimization flag for immediate mode (to render directly to the front buffer)
Standard_Boolean myRetainMode
 optimization flag for immediate mode (to render directly to the front buffer)
Standard_Boolean myTransientDrawToFront
 optimization flag for immediate mode (to render directly to the front buffer)
NCollection_Sequence< const
OpenGl_Structure * > 
myTransientList
 optimization flag for immediate mode (to render directly to the front buffer)
Standard_Boolean myUseTransparency
 optimization flag for immediate mode (to render directly to the front buffer)
Standard_Boolean myUseZBuffer
 optimization flag for immediate mode (to render directly to the front buffer)
Standard_Boolean myUseDepthTest
 optimization flag for immediate mode (to render directly to the front buffer)
Standard_Boolean myUseGLLight
 optimization flag for immediate mode (to render directly to the front buffer)
Standard_Boolean myBackBufferRestored
 optimization flag for immediate mode (to render directly to the front buffer)
fields related to status
Handle< OpenGl_TexturemyTextureBound
 currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
const OpenGl_AspectLineAspectLine_set
 currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
const OpenGl_AspectLineAspectLine_applied
 currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
const OpenGl_AspectFaceAspectFace_set
 currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
const OpenGl_AspectFaceAspectFace_applied
 currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
const OpenGl_AspectMarkerAspectMarker_set
 currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
const OpenGl_AspectMarkerAspectMarker_applied
 currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
const OpenGl_AspectTextAspectText_set
 currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
const OpenGl_AspectTextAspectText_applied
 currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
const OpenGl_TextParamTextParam_set
 currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
const OpenGl_TextParamTextParam_applied
 currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
const OpenGl_MatrixViewMatrix_applied
 currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
const OpenGl_MatrixStructureMatrix_applied
 currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
const TEL_POFFSET_PARAMPolygonOffset_applied
 currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
OpenGl_AspectFace myAspectFaceHl
 currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)

Constructor & Destructor Documentation

OpenGl_Workspace::OpenGl_Workspace ( const Handle< OpenGl_Display > &  theDisplay,
const CALL_DEF_WINDOW theCWindow,
Aspect_RenderingContext  theGContext,
const Handle< OpenGl_Context > &  theShareCtx 
)
virtual OpenGl_Workspace::~OpenGl_Workspace ( ) [virtual]

Member Function Documentation

virtual Standard_Boolean OpenGl_Workspace::Activate ( ) [protected, virtual]

Reimplemented from OpenGl_Window.

const Handle< OpenGl_View >& OpenGl_Workspace::ActiveView ( ) const [inline]
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)
const OpenGl_TextParam* OpenGl_Workspace::AspectTextParams ( ) const [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 
)
void OpenGl_Workspace::CopyBuffers ( const Standard_Boolean  theFrontToBack) [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)
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 
)
const Handle< OpenGl_PrinterContext >& OpenGl_Workspace::PrinterContext ( ) const [inline]
void OpenGl_Workspace::Redraw ( const Graphic3d_CView theCView,
const Aspect_CLayer2d theCUnderLayer,
const Aspect_CLayer2d theCOverLayer 
)
void OpenGl_Workspace::Redraw1 ( const Graphic3d_CView theCView,
const Aspect_CLayer2d theCUnderLayer,
const Aspect_CLayer2d theCOverLayer,
const int  theToSwap 
) [protected]
void OpenGl_Workspace::RedrawImmediatMode ( )
void OpenGl_Workspace::ResetAppliedAspect ( )
void OpenGl_Workspace::SetActiveView ( const Handle< OpenGl_View > &  theView) [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)
const OpenGl_Matrix* OpenGl_Workspace::SetStructureMatrix ( const OpenGl_Matrix )
void OpenGl_Workspace::SetTextParam ( const OpenGl_TextParam theParam) [inline]
void OpenGl_Workspace::setTextureParams ( Handle< OpenGl_Texture > &  theTexture,
const Handle< Graphic3d_TextureParams > &  theParams 
) [protected]
const OpenGl_Matrix* OpenGl_Workspace::SetViewMatrix ( const OpenGl_Matrix )
void OpenGl_Workspace::Update ( const Graphic3d_CView theCView,
const Aspect_CLayer2d theCUnderLayer,
const Aspect_CLayer2d theCOverLayer 
) [inline]
void OpenGl_Workspace::UpdateMaterial ( const int  flag) [protected]
Standard_Boolean& OpenGl_Workspace::UseDepthTest ( ) [inline]
Standard_Boolean& OpenGl_Workspace::UseGLLight ( ) [inline]
void OpenGl_Workspace::UseTransparency ( const Standard_Boolean  theFlag)
Standard_Boolean& OpenGl_Workspace::UseZBuffer ( ) [inline]

Field Documentation

Handle< OpenGl_View > OpenGl_Workspace::myView [protected]

The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines