Open CASCADE Technology  6.5.4
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes
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 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.
void DisplayCallback (const Graphic3d_CView &theCView, int theReason)
void BeginAnimation (const Standard_Boolean theUseDegeneration, const Standard_Boolean theUpdateAM)
void EndAnimation ()
void EraseAnimation ()
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 Transform (const TColStd_Array2OfReal &theMatrix, const Graphic3d_TypeOfComposition theType)
void DrawStructure (const OpenGl_Structure *theStructure)
void BeginPolyline ()
void EndPolyline ()
void Draw (const Standard_ShortReal theX, const Standard_ShortReal theY, const Standard_ShortReal theZ)
void Move (const Standard_ShortReal theX, const Standard_ShortReal theY, const Standard_ShortReal theZ)
void SetLineColor (const Standard_ShortReal theR, const Standard_ShortReal theG, const Standard_ShortReal theB)
void SetLineType (const Standard_Integer theType)
void SetLineWidth (const Standard_ShortReal theWidth)
void SetMinMax (const Standard_ShortReal X1, const Standard_ShortReal Y1, const Standard_ShortReal Z1, const Standard_ShortReal X2, const Standard_ShortReal Y2, const Standard_ShortReal Z2)
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)
void ResetAppliedAspect ()
 Clear the applied aspect state.
int FindFont (const char *theFontName, const Font_FontAspect theFontAspect, const int theBestSize=-1, const float theXScale=1.0f, const float theYScale=1.0f)
void StringSize (const wchar_t *theText, int &theWidth, int &theAscent, int &theDescent)
void RenderText (const wchar_t *theText, const int theIs2d, const float theX, const float theY, const float theZ)

Data Fields

Standard_Integer NamedStatus
Standard_Integer DegenerateModel
Standard_ShortReal SkipRatio
const TEL_COLOURHighlightColor

Protected Member Functions

void CopyBuffers (Tint vid, int FrontToBack, Tfloat xm, Tfloat ym, Tfloat zm, Tfloat XM, Tfloat YM, Tfloat ZM, Tint flag)
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)

Protected Attributes

Handle< OpenGl_ViewmyView
Tint myTransientList
Standard_Boolean myIsTransientOpen
Tint myRetainMode
Standard_Boolean myUseTransparency
Standard_Boolean myUseZBuffer
Standard_Boolean myUseDepthTest
Standard_Boolean myUseGLLight
Standard_Boolean myBackBufferRestored
const OpenGl_AspectLineAspectLine_set
const OpenGl_AspectLineAspectLine_applied
const OpenGl_AspectFaceAspectFace_set
const OpenGl_AspectFaceAspectFace_applied
const OpenGl_AspectMarkerAspectMarker_set
const OpenGl_AspectMarkerAspectMarker_applied
const OpenGl_AspectTextAspectText_set
const OpenGl_AspectTextAspectText_applied
const OpenGl_TextParamTextParam_set
const OpenGl_TextParamTextParam_applied
const OpenGl_MatrixViewMatrix_applied
const OpenGl_MatrixStructureMatrix_applied
const TEL_POFFSET_PARAMPolygonOffset_applied

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.

void OpenGl_Workspace::CopyBuffers ( Tint  vid,
int  FrontToBack,
Tfloat  xm,
Tfloat  ym,
Tfloat  zm,
Tfloat  XM,
Tfloat  YM,
Tfloat  ZM,
Tint  flag 
) [protected]
int OpenGl_Workspace::FindFont ( const char *  theFontName,
const Font_FontAspect  theFontAspect,
const int  theBestSize = -1,
const float  theXScale = 1.0f,
const float  theYScale = 1.0f 
) [inline]
Standard_Boolean OpenGl_Workspace::Print ( 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 
)
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::RenderText ( const wchar_t *  theText,
const int  theIs2d,
const float  theX,
const float  theY,
const float  theZ 
) [inline]
void OpenGl_Workspace::StringSize ( const wchar_t *  theText,
int theWidth,
int theAscent,
int theDescent 
) [inline]
void OpenGl_Workspace::Update ( const Graphic3d_CView theCView,
const Aspect_CLayer2d theCUnderLayer,
const Aspect_CLayer2d theCOverLayer 
) [inline]

Field Documentation


The documentation for this class was generated from the following file: