Open CASCADE Technology  6.9.0
Public Types | Public Member Functions

OpenGl_GraphicDriver Class Reference

This class defines an OpenGl graphic driver. More...

#include <OpenGl_GraphicDriver.hxx>

Inheritance diagram for OpenGl_GraphicDriver:
Inheritance graph
[legend]

Public Types

typedef OpenGl_Element *(* OpenGl_UserDrawCallback_t )(const CALL_DEF_USERDRAW *)
 UserDraw function prototype. More...
 

Public Member Functions

 OpenGl_GraphicDriver (const Handle< Aspect_DisplayConnection > &theDisp, const Standard_Boolean theToInitialize=Standard_True)
 Constructor. More...
 
virtual ~OpenGl_GraphicDriver ()
 Destructor. More...
 
void ReleaseContext ()
 Release default context. More...
 
Standard_Boolean InitContext ()
 Perform initialization of default OpenGL context. More...
 
Standard_Integer InquireLightLimit ()
 call_togl_inquirelight More...
 
Standard_Integer InquireViewLimit ()
 call_togl_inquireview More...
 
void DisplayStructure (const Graphic3d_CView &theCView, const Handle< Graphic3d_Structure > &theStructure, const Standard_Integer thePriority)
 call_togl_displaystructure More...
 
void EraseStructure (const Graphic3d_CView &theCView, const Handle< Graphic3d_Structure > &theStructure)
 call_togl_erasestructure More...
 
void RemoveStructure (Handle< Graphic3d_CStructure > &theCStructure)
 call_togl_removestructure More...
 
Handle< Graphic3d_CStructureStructure (const Handle< Graphic3d_StructureManager > &theManager)
 Creates new empty graphic structure. More...
 
Standard_Boolean SetImmediateModeDrawToFront (const Graphic3d_CView &theCView, const Standard_Boolean theDrawToFrontBuffer)
 
void DisplayImmediateStructure (const Graphic3d_CView &theCView, const Handle< Graphic3d_Structure > &theStructure)
 Display structure in immediate mode on top of general presentation. More...
 
void EraseImmediateStructure (const Graphic3d_CView &theCView, const Graphic3d_CStructure &theCStructure)
 Erases immediate structure. More...
 
void ActivateView (const Graphic3d_CView &ACView)
 call_togl_activateview More...
 
void AntiAliasing (const Graphic3d_CView &ACView, const Standard_Boolean AFlag)
 call_togl_antialiasing More...
 
void Background (const Graphic3d_CView &ACView)
 call_togl_background More...
 
void GradientBackground (const Graphic3d_CView &ACView, const Quantity_Color &AColor1, const Quantity_Color &AColor2, const Aspect_GradientFillMethod FillStyle)
 call_togl_gradient_background More...
 
void BackgroundImage (const Standard_CString FileName, const Graphic3d_CView &ACView, const Aspect_FillMethod FillStyle)
 
void SetBgImageStyle (const Graphic3d_CView &ACView, const Aspect_FillMethod FillStyle)
 
void SetBgGradientStyle (const Graphic3d_CView &ACView, const Aspect_GradientFillMethod FillStyle)
 
void ClipLimit (const Graphic3d_CView &ACView, const Standard_Boolean AWait)
 call_togl_cliplimit More...
 
void DeactivateView (const Graphic3d_CView &ACView)
 call_togl_deactivateview More...
 
void DepthCueing (const Graphic3d_CView &ACView, const Standard_Boolean AFlag)
 call_togl_cliplimit More...
 
void RatioWindow (const Graphic3d_CView &ACView)
 call_togl_ratio_window More...
 
void Redraw (const Graphic3d_CView &theCView, const Aspect_CLayer2d &theCUnderLayer, const Aspect_CLayer2d &theCOverLayer, const Standard_Integer theX=0, const Standard_Integer theY=0, const Standard_Integer theWidth=0, const Standard_Integer theHeight=0)
 Redraw content of the view. More...
 
void RedrawImmediate (const Graphic3d_CView &theCView, const Aspect_CLayer2d &theCUnderLayer, const Aspect_CLayer2d &theCOverLayer)
 Redraw layer of immediate presentations. More...
 
void Invalidate (const Graphic3d_CView &theCView)
 Invalidates content of the view but does not redraw it. More...
 
void RemoveView (const Graphic3d_CView &ACView)
 call_togl_removeview More...
 
void SetLight (const Graphic3d_CView &ACView)
 call_togl_setlight More...
 
void SetClipPlanes (const Graphic3d_CView &theCView)
 Pass clip planes to the associated graphic driver view. More...
 
void SetCamera (const Graphic3d_CView &theCView)
 Inform graphic driver if camera assigned to view changes. More...
 
void SetVisualisation (const Graphic3d_CView &ACView)
 call_togl_setvisualisation More...
 
Standard_Boolean View (Graphic3d_CView &ACView)
 call_togl_view More...
 
void Environment (const Graphic3d_CView &ACView)
 
void ZBufferTriedronSetup (const Graphic3d_CView &theCView, const Quantity_NameOfColor XColor=Quantity_NOC_RED, const Quantity_NameOfColor YColor=Quantity_NOC_GREEN, const Quantity_NameOfColor ZColor=Quantity_NOC_BLUE1, const Standard_Real SizeRatio=0.8, const Standard_Real AxisDiametr=0.05, const Standard_Integer NbFacettes=12)
 call_togl_ztriedron_setup More...
 
void TriedronDisplay (const Graphic3d_CView &ACView, const Aspect_TypeOfTriedronPosition APosition=Aspect_TOTP_CENTER, const Quantity_NameOfColor AColor=Quantity_NOC_WHITE, const Standard_Real AScale=0.02, const Standard_Boolean AsWireframe=Standard_True)
 call_togl_triedron_display More...
 
void TriedronErase (const Graphic3d_CView &ACView)
 call_togl_triedron_erase More...
 
void TriedronEcho (const Graphic3d_CView &ACView, const Aspect_TypeOfTriedronEcho AType=Aspect_TOTE_NONE)
 call_togl_triedron_echo More...
 
void GraduatedTrihedronDisplay (const Graphic3d_CView &theView, const Graphic3d_GraduatedTrihedron &theCubic)
 Displays Graduated trihedron. More...
 
void GraduatedTrihedronErase (const Graphic3d_CView &theView)
 Erases Graduated Trihedron from the view. theView [in] graphic view. More...
 
void GraduatedTrihedronMinMaxValues (const Graphic3d_CView &theView, const Graphic3d_Vec3 theMin, const Graphic3d_Vec3 theMax)
 Sets minimum and maximum points of scene bounding box for Graduated Trihedron stored in graphic view object. More...
 
void Layer (Aspect_CLayer2d &ACLayer)
 call_togl_layer2d More...
 
void RemoveLayer (const Aspect_CLayer2d &ACLayer)
 call_togl_removelayer2d More...
 
void BeginLayer (const Aspect_CLayer2d &ACLayer)
 call_togl_begin_layer2d More...
 
void BeginPolygon2d ()
 call_togl_begin_polygon2d More...
 
void BeginPolyline2d ()
 call_togl_begin_polyline2d More...
 
void ClearLayer (const Aspect_CLayer2d &ACLayer)
 call_togl_clear_layer2d More...
 
void Draw (const Standard_ShortReal X, const Standard_ShortReal Y)
 call_togl_draw2d More...
 
void Edge (const Standard_ShortReal X, const Standard_ShortReal Y)
 call_togl_edge2d More...
 
void EndLayer ()
 call_togl_end_layer2d More...
 
void EndPolygon2d ()
 call_togl_end_polygon2d More...
 
void EndPolyline2d ()
 call_togl_end_polyline2d More...
 
void Move (const Standard_ShortReal X, const Standard_ShortReal Y)
 call_togl_move2d More...
 
void Rectangle (const Standard_ShortReal X, const Standard_ShortReal Y, const Standard_ShortReal Width, const Standard_ShortReal Height)
 call_togl_rectangle2d More...
 
void SetColor (const Standard_ShortReal R, const Standard_ShortReal G, const Standard_ShortReal B)
 call_togl_set_color More...
 
void SetTransparency (const Standard_ShortReal ATransparency)
 call_togl_set_transparency More...
 
void UnsetTransparency ()
 call_togl_unset_transparency More...
 
void SetLineAttributes (const Standard_Integer Type, const Standard_ShortReal Width)
 call_togl_set_line_attributes More...
 
void SetTextAttributes (const Standard_CString theFontName, const Standard_Integer theType, const Standard_ShortReal theR, const Standard_ShortReal theG, const Standard_ShortReal theB)
 Set text attributes for under-/overlayer. More...
 
void Text (const Standard_CString AText, const Standard_ShortReal X, const Standard_ShortReal Y, const Standard_ShortReal AHeight)
 call_togl_text2d If AHeight < 0 default text height is used by driver (DefaultTextHeight method) More...
 
void TextSize (const Standard_CString AText, const Standard_ShortReal AHeight, Standard_ShortReal &AWidth, Standard_ShortReal &AnAscent, Standard_ShortReal &ADescent) const
 call_togl_textsize2d More...
 
void SetBackFacingModel (const Graphic3d_CView &aView)
 call_togl_backfacing More...
 
Standard_Boolean Print (const Graphic3d_CView &theCView, const Aspect_CLayer2d &theCUnderLayer, const Aspect_CLayer2d &theCOverLayer, const Aspect_Handle thePrinterDC, const Standard_Boolean theToShowBackground, const Standard_CString theFileName, const Aspect_PrintAlgo thePrintAlgorithm=Aspect_PA_STRETCH, const Standard_Real theScaleFactor=1.0) const
 Print the contents of all layers of the view to the printer. More...
 
void SetDepthTestEnabled (const Graphic3d_CView &view, const Standard_Boolean isEnabled) const
 call_togl_depthtest More...
 
Standard_Boolean IsDepthTestEnabled (const Graphic3d_CView &view) const
 call_togl_isdepthtest More...
 
void ReadDepths (const Graphic3d_CView &view, const Standard_Integer x, const Standard_Integer y, const Standard_Integer width, const Standard_Integer height, const Standard_Address buffer) const
 Reads depths of shown pixels of the given rectangle (glReadPixels with GL_DEPTH_COMPONENT) More...
 
Graphic3d_PtrFrameBuffer FBOCreate (const Graphic3d_CView &view, const Standard_Integer width, const Standard_Integer height)
 Generate offscreen FBO (needs OpenGL2+ hardware). If not supported on hardware returns NULL. More...
 
void FBORelease (const Graphic3d_CView &view, Graphic3d_PtrFrameBuffer &fboPtr)
 Remove offscreen FBO. More...
 
Standard_Boolean BufferDump (const Graphic3d_CView &theCView, Image_PixMap &theImage, const Graphic3d_BufferType &theBufferType)
 Dump active rendering buffer into specified memory buffer. More...
 
void SetGLLightEnabled (const Graphic3d_CView &view, const Standard_Boolean isEnabled) const
 call_togl_gllight More...
 
Standard_Boolean IsGLLightEnabled (const Graphic3d_CView &view) const
 call_togl_isgllight More...
 
Standard_Integer InquirePlaneLimit ()
 call_togl_inquireplane More...
 
Standard_ShortReal DefaultTextHeight () const
 
void FBOGetDimensions (const Graphic3d_CView &view, const Graphic3d_PtrFrameBuffer fboPtr, Standard_Integer &width, Standard_Integer &height, Standard_Integer &widthMax, Standard_Integer &heightMax)
 Read offscreen FBO configuration. More...
 
void FBOChangeViewport (const Graphic3d_CView &view, Graphic3d_PtrFrameBuffer &fboPtr, const Standard_Integer width, const Standard_Integer height)
 Change offscreen FBO viewport. More...
 
Standard_Boolean Export (const Standard_CString theFileName, const Graphic3d_ExportFormat theFormat, const Graphic3d_SortType theSortType, const Standard_Integer theWidth, const Standard_Integer theHeight, const Graphic3d_CView &theView, const Aspect_CLayer2d &theLayerUnder, const Aspect_CLayer2d &theLayerOver, const Standard_Real thePrecision=0.005, const Standard_Address theProgressBarFunc=NULL, const Standard_Address theProgressObject=NULL)
 Export scene into the one of the Vector graphics formats (SVG, PS, PDF...). In contrast to Bitmaps, Vector graphics is scalable (so you may got quality benefits on printing to laser printer). Notice however that results may differ a lot and do not contain some elements. More...
 
void AddZLayer (const Graphic3d_CView &theCView, const Graphic3d_ZLayerId theLayerId)
 Add a new top-level z layer with ID theLayerId for the view. Z layers allow drawing structures in higher layers in foreground of structures in lower layers. To add a structure to desired layer on display it is necessary to set the layer index for the structure. More...
 
void RemoveZLayer (const Graphic3d_CView &theCView, const Graphic3d_ZLayerId theLayerId)
 Remove Z layer from the specified view. All structures displayed at the moment in layer will be displayed in default layer (the bottom-level z layer). To unset layer index from associated structures use method UnsetZLayer (...). More...
 
void UnsetZLayer (const Graphic3d_ZLayerId theLayerId)
 Unset Z layer ID for all structures. The structure indexes will be set to default layer (the bottom-level z layer with ID = 0). More...
 
void ChangeZLayer (const Graphic3d_CStructure &theCStructure, const Graphic3d_CView &theCView, const Graphic3d_ZLayerId theNewLayerId)
 Change Z layer of a structure already presented in view. It is recommended to update z layer of already displayed structures with this method before setting new z layer index to the structure. This is usually done by viewer manager. More...
 
void SetZLayerSettings (const Graphic3d_CView &theCView, const Graphic3d_ZLayerId theLayerId, const Graphic3d_ZLayerSettings &theSettings)
 Sets the settings for a single Z layer of specified view. More...
 
void ChangePriority (const Graphic3d_CStructure &theCStructure, const Graphic3d_CView &theCView, const Standard_Integer theNewPriority)
 Changes priority of a structure within its Z layer for the specified view. More...
 
const OpenGl_CapsOptions () const
 
OpenGl_CapsChangeOptions ()
 
void EnableVBO (const Standard_Boolean theToTurnOn)
 VBO usage can be forbidden by this method even if it is supported by GL driver. Notice that disabling of VBO will cause rendering performance degradation. Warning! This method should be called only before any primitives are displayed in GL scene! More...
 
Standard_Boolean MemoryInfo (Standard_Size &theFreeBytes, TCollection_AsciiString &theInfo) const
 Returns information about GPU memory usage. Please read OpenGl_Context::MemoryInfo() for more description. More...
 
OpenGl_UserDrawCallback_tUserDrawCallback ()
 Method to setup UserDraw callback. More...
 
const Handle< OpenGl_Context > & GetSharedContext () const
 Method to retrieve valid GL context. Could return NULL-handle if no window created by this driver. More...
 
void InvalidateBVHData (Graphic3d_CView &theCView, const Standard_Integer theLayerId)
 Marks BVH tree for given priority list as dirty and marks primitive set for rebuild. More...
 
OpenGl_StateCounterGetStateCounter () const
 State counter for OpenGl structures. More...
 
const Standard_Size GetNextPrimitiveArrayUID () const
 Returns unique ID for primitive arrays. More...
 
- Public Member Functions inherited from Graphic3d_GraphicDriver
void PrintBoolean (const Standard_CString AComment, const Standard_Boolean AValue) const
 
void PrintCLight (const Graphic3d_CLight &ACLight, const Standard_Integer AField) const
 
void PrintCStructure (const Graphic3d_CStructure &ACStructure, const Standard_Integer AField) const
 
void PrintCView (const Graphic3d_CView &ACView, const Standard_Integer AField) const
 
void PrintFunction (const Standard_CString AFunc) const
 
void PrintInteger (const Standard_CString AComment, const Standard_Integer AValue) const
 
void PrintIResult (const Standard_CString AFunc, const Standard_Integer AResult) const
 
void PrintShortReal (const Standard_CString AComment, const Standard_ShortReal AValue) const
 
void PrintMatrix (const Standard_CString AComment, const TColStd_Array2OfReal &AMatrix) const
 
void PrintString (const Standard_CString AComment, const Standard_CString AString) const
 
void SetTrace (const Standard_Integer ALevel)
 
Standard_Integer Trace () const
 
const Handle
< Aspect_DisplayConnection > & 
GetDisplayConnection () const
 returns Handle to display connection More...
 
Standard_Boolean IsDeviceLost () const
 
void ResetDeviceLostFlag ()
 
- 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_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
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...
 

Additional Inherited Members

- Protected Member Functions inherited from Graphic3d_GraphicDriver
 Graphic3d_GraphicDriver (const Handle< Aspect_DisplayConnection > &theDisp)
 Initialises the Driver. More...
 
- Protected Attributes inherited from Graphic3d_GraphicDriver
Standard_Integer MyTraceLevel
 
Handle< Aspect_DisplayConnectionmyDisplayConnection
 
Standard_Boolean myDeviceLostFlag
 

Detailed Description

This class defines an OpenGl graphic driver.

Member Typedef Documentation

typedef OpenGl_Element*(* OpenGl_GraphicDriver::OpenGl_UserDrawCallback_t)(const CALL_DEF_USERDRAW *)

UserDraw function prototype.

Constructor & Destructor Documentation

OpenGl_GraphicDriver::OpenGl_GraphicDriver ( const Handle< Aspect_DisplayConnection > &  theDisp,
const Standard_Boolean  theToInitialize = Standard_True 
)

Constructor.

Parameters
theDispconnection to display, required on Linux but optional on other systems
theToInitializeperform initialization of default OpenGL context on construction
virtual OpenGl_GraphicDriver::~OpenGl_GraphicDriver ( )
virtual

Destructor.

Member Function Documentation

void OpenGl_GraphicDriver::ActivateView ( const Graphic3d_CView ACView)
virtual

call_togl_activateview

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::AddZLayer ( const Graphic3d_CView theCView,
const Graphic3d_ZLayerId  theLayerId 
)
virtual

Add a new top-level z layer with ID theLayerId for the view. Z layers allow drawing structures in higher layers in foreground of structures in lower layers. To add a structure to desired layer on display it is necessary to set the layer index for the structure.

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::AntiAliasing ( const Graphic3d_CView ACView,
const Standard_Boolean  AFlag 
)
virtual

call_togl_antialiasing

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::Background ( const Graphic3d_CView ACView)
virtual

call_togl_background

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::BackgroundImage ( const Standard_CString  FileName,
const Graphic3d_CView ACView,
const Aspect_FillMethod  FillStyle 
)
virtual
void OpenGl_GraphicDriver::BeginLayer ( const Aspect_CLayer2d ACLayer)
virtual

call_togl_begin_layer2d

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::BeginPolygon2d ( )
virtual

call_togl_begin_polygon2d

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::BeginPolyline2d ( )
virtual

call_togl_begin_polyline2d

Implements Graphic3d_GraphicDriver.

Standard_Boolean OpenGl_GraphicDriver::BufferDump ( const Graphic3d_CView theCView,
Image_PixMap theImage,
const Graphic3d_BufferType theBufferType 
)
virtual

Dump active rendering buffer into specified memory buffer.

Implements Graphic3d_GraphicDriver.

OpenGl_Caps& OpenGl_GraphicDriver::ChangeOptions ( )
inline
Returns
the visualization options
void OpenGl_GraphicDriver::ChangePriority ( const Graphic3d_CStructure theCStructure,
const Graphic3d_CView theCView,
const Standard_Integer  theNewPriority 
)
virtual

Changes priority of a structure within its Z layer for the specified view.

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::ChangeZLayer ( const Graphic3d_CStructure theCStructure,
const Graphic3d_CView theCView,
const Graphic3d_ZLayerId  theNewLayerId 
)
virtual

Change Z layer of a structure already presented in view. It is recommended to update z layer of already displayed structures with this method before setting new z layer index to the structure. This is usually done by viewer manager.

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::ClearLayer ( const Aspect_CLayer2d ACLayer)
virtual

call_togl_clear_layer2d

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::ClipLimit ( const Graphic3d_CView ACView,
const Standard_Boolean  AWait 
)
virtual

call_togl_cliplimit

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::DeactivateView ( const Graphic3d_CView ACView)
virtual

call_togl_deactivateview

Implements Graphic3d_GraphicDriver.

Standard_ShortReal OpenGl_GraphicDriver::DefaultTextHeight ( ) const
virtual
void OpenGl_GraphicDriver::DepthCueing ( const Graphic3d_CView ACView,
const Standard_Boolean  AFlag 
)
virtual

call_togl_cliplimit

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::DisplayImmediateStructure ( const Graphic3d_CView theCView,
const Handle< Graphic3d_Structure > &  theStructure 
)
virtual

Display structure in immediate mode on top of general presentation.

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::DisplayStructure ( const Graphic3d_CView theCView,
const Handle< Graphic3d_Structure > &  theStructure,
const Standard_Integer  thePriority 
)
virtual

call_togl_displaystructure

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::Draw ( const Standard_ShortReal  X,
const Standard_ShortReal  Y 
)
virtual

call_togl_draw2d

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::Edge ( const Standard_ShortReal  X,
const Standard_ShortReal  Y 
)
virtual

call_togl_edge2d

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::EnableVBO ( const Standard_Boolean  theToTurnOn)
virtual

VBO usage can be forbidden by this method even if it is supported by GL driver. Notice that disabling of VBO will cause rendering performance degradation. Warning! This method should be called only before any primitives are displayed in GL scene!

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::EndLayer ( )
virtual

call_togl_end_layer2d

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::EndPolygon2d ( )
virtual

call_togl_end_polygon2d

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::EndPolyline2d ( )
virtual

call_togl_end_polyline2d

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::Environment ( const Graphic3d_CView ACView)
virtual
void OpenGl_GraphicDriver::EraseImmediateStructure ( const Graphic3d_CView theCView,
const Graphic3d_CStructure theCStructure 
)
virtual

Erases immediate structure.

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::EraseStructure ( const Graphic3d_CView theCView,
const Handle< Graphic3d_Structure > &  theStructure 
)
virtual

call_togl_erasestructure

Implements Graphic3d_GraphicDriver.

Standard_Boolean OpenGl_GraphicDriver::Export ( const Standard_CString  theFileName,
const Graphic3d_ExportFormat  theFormat,
const Graphic3d_SortType  theSortType,
const Standard_Integer  theWidth,
const Standard_Integer  theHeight,
const Graphic3d_CView theView,
const Aspect_CLayer2d theLayerUnder,
const Aspect_CLayer2d theLayerOver,
const Standard_Real  thePrecision = 0.005,
const Standard_Address  theProgressBarFunc = NULL,
const Standard_Address  theProgressObject = NULL 
)
virtual

Export scene into the one of the Vector graphics formats (SVG, PS, PDF...). In contrast to Bitmaps, Vector graphics is scalable (so you may got quality benefits on printing to laser printer). Notice however that results may differ a lot and do not contain some elements.

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::FBOChangeViewport ( const Graphic3d_CView view,
Graphic3d_PtrFrameBuffer fboPtr,
const Standard_Integer  width,
const Standard_Integer  height 
)
virtual

Change offscreen FBO viewport.

Implements Graphic3d_GraphicDriver.

Graphic3d_PtrFrameBuffer OpenGl_GraphicDriver::FBOCreate ( const Graphic3d_CView view,
const Standard_Integer  width,
const Standard_Integer  height 
)
virtual

Generate offscreen FBO (needs OpenGL2+ hardware). If not supported on hardware returns NULL.

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::FBOGetDimensions ( const Graphic3d_CView view,
const Graphic3d_PtrFrameBuffer  fboPtr,
Standard_Integer width,
Standard_Integer height,
Standard_Integer widthMax,
Standard_Integer heightMax 
)
virtual

Read offscreen FBO configuration.

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::FBORelease ( const Graphic3d_CView view,
Graphic3d_PtrFrameBuffer fboPtr 
)
virtual

Remove offscreen FBO.

Implements Graphic3d_GraphicDriver.

const Standard_Size OpenGl_GraphicDriver::GetNextPrimitiveArrayUID ( ) const
inline

Returns unique ID for primitive arrays.

const Handle< OpenGl_Context >& OpenGl_GraphicDriver::GetSharedContext ( ) const

Method to retrieve valid GL context. Could return NULL-handle if no window created by this driver.

OpenGl_StateCounter* OpenGl_GraphicDriver::GetStateCounter ( ) const
inline

State counter for OpenGl structures.

void OpenGl_GraphicDriver::GradientBackground ( const Graphic3d_CView ACView,
const Quantity_Color AColor1,
const Quantity_Color AColor2,
const Aspect_GradientFillMethod  FillStyle 
)
virtual

call_togl_gradient_background

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::GraduatedTrihedronDisplay ( const Graphic3d_CView theView,
const Graphic3d_GraduatedTrihedron theCubic 
)
virtual

Displays Graduated trihedron.

Parameters
theView[in] the graphic view
theCubic[in] Graduated Trihedon parameters.
See Also
OpenGl_GraduatedTrihedron
Graphic3d_GraduatedTrihedron

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::GraduatedTrihedronErase ( const Graphic3d_CView theView)
virtual

Erases Graduated Trihedron from the view. theView [in] graphic view.

See Also
OpenGl_GraduatedTrihedron

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::GraduatedTrihedronMinMaxValues ( const Graphic3d_CView theView,
const Graphic3d_Vec3  theMin,
const Graphic3d_Vec3  theMax 
)
virtual

Sets minimum and maximum points of scene bounding box for Graduated Trihedron stored in graphic view object.

Parameters
theView[in] current graphic view
theMin[in] the minimum point of scene.
theMax[in] the maximum point of scene.
See Also
OpenGl_GraduatedTrihedron

Implements Graphic3d_GraphicDriver.

Standard_Boolean OpenGl_GraphicDriver::InitContext ( )

Perform initialization of default OpenGL context.

Standard_Integer OpenGl_GraphicDriver::InquireLightLimit ( )
virtual

call_togl_inquirelight

Implements Graphic3d_GraphicDriver.

Standard_Integer OpenGl_GraphicDriver::InquirePlaneLimit ( )
virtual

call_togl_inquireplane

Implements Graphic3d_GraphicDriver.

Standard_Integer OpenGl_GraphicDriver::InquireViewLimit ( )
virtual

call_togl_inquireview

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::Invalidate ( const Graphic3d_CView theCView)
virtual

Invalidates content of the view but does not redraw it.

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::InvalidateBVHData ( Graphic3d_CView theCView,
const Standard_Integer  theLayerId 
)
virtual

Marks BVH tree for given priority list as dirty and marks primitive set for rebuild.

Implements Graphic3d_GraphicDriver.

Standard_Boolean OpenGl_GraphicDriver::IsDepthTestEnabled ( const Graphic3d_CView view) const
virtual

call_togl_isdepthtest

Implements Graphic3d_GraphicDriver.

Standard_Boolean OpenGl_GraphicDriver::IsGLLightEnabled ( const Graphic3d_CView view) const
virtual

call_togl_isgllight

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::Layer ( Aspect_CLayer2d ACLayer)
virtual

call_togl_layer2d

Implements Graphic3d_GraphicDriver.

Standard_Boolean OpenGl_GraphicDriver::MemoryInfo ( Standard_Size theFreeBytes,
TCollection_AsciiString theInfo 
) const
virtual

Returns information about GPU memory usage. Please read OpenGl_Context::MemoryInfo() for more description.

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::Move ( const Standard_ShortReal  X,
const Standard_ShortReal  Y 
)
virtual

call_togl_move2d

Implements Graphic3d_GraphicDriver.

const OpenGl_Caps& OpenGl_GraphicDriver::Options ( ) const
inline
Returns
the visualization options
Standard_Boolean OpenGl_GraphicDriver::Print ( const Graphic3d_CView theCView,
const Aspect_CLayer2d theCUnderLayer,
const Aspect_CLayer2d theCOverLayer,
const Aspect_Handle  thePrinterDC,
const Standard_Boolean  theToShowBackground,
const Standard_CString  theFileName,
const Aspect_PrintAlgo  thePrintAlgorithm = Aspect_PA_STRETCH,
const Standard_Real  theScaleFactor = 1.0 
) const
virtual

Print the contents of all layers of the view to the printer.

Parameters
thePrinterDCpass the PrinterDeviceContext (HDC)
theToShowBackgroundwhen set to FALSE then print the view without background color (background is white) else set to TRUE for printing with current background color
theFileNameif != NULL, then the view will be printed to a file
thePrintAlgorithmselect print algorithm: stretch, tile
theScaleFactorscaling coefficient, used internally to scale the printings accordingly to the scale factor selected in the printer properties dialog
Returns
Standard_True if the data is passed to the printer, otherwise Standard_False if the print operation failed due to the printer errors, or lack of system memory. This might be related to insufficient memory or some internal errors. All this errors are indicated by the message boxes (on level of OpenGl_GraphicDriver). Warning: This function can reuse FBO assigned to the view, please take it into account if you use it for your purposes.

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::RatioWindow ( const Graphic3d_CView ACView)
virtual

call_togl_ratio_window

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::ReadDepths ( const Graphic3d_CView view,
const Standard_Integer  x,
const Standard_Integer  y,
const Standard_Integer  width,
const Standard_Integer  height,
const Standard_Address  buffer 
) const
virtual

Reads depths of shown pixels of the given rectangle (glReadPixels with GL_DEPTH_COMPONENT)

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::Rectangle ( const Standard_ShortReal  X,
const Standard_ShortReal  Y,
const Standard_ShortReal  Width,
const Standard_ShortReal  Height 
)
virtual

call_togl_rectangle2d

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::Redraw ( const Graphic3d_CView theCView,
const Aspect_CLayer2d theCUnderLayer,
const Aspect_CLayer2d theCOverLayer,
const Standard_Integer  theX = 0,
const Standard_Integer  theY = 0,
const Standard_Integer  theWidth = 0,
const Standard_Integer  theHeight = 0 
)
virtual

Redraw content of the view.

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::RedrawImmediate ( const Graphic3d_CView theCView,
const Aspect_CLayer2d theCUnderLayer,
const Aspect_CLayer2d theCOverLayer 
)
virtual

Redraw layer of immediate presentations.

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::ReleaseContext ( )

Release default context.

void OpenGl_GraphicDriver::RemoveLayer ( const Aspect_CLayer2d ACLayer)
virtual

call_togl_removelayer2d

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::RemoveStructure ( Handle< Graphic3d_CStructure > &  theCStructure)
virtual

call_togl_removestructure

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::RemoveView ( const Graphic3d_CView ACView)
virtual

call_togl_removeview

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::RemoveZLayer ( const Graphic3d_CView theCView,
const Graphic3d_ZLayerId  theLayerId 
)
virtual

Remove Z layer from the specified view. All structures displayed at the moment in layer will be displayed in default layer (the bottom-level z layer). To unset layer index from associated structures use method UnsetZLayer (...).

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::SetBackFacingModel ( const Graphic3d_CView aView)
virtual

call_togl_backfacing

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::SetBgGradientStyle ( const Graphic3d_CView ACView,
const Aspect_GradientFillMethod  FillStyle 
)
virtual
void OpenGl_GraphicDriver::SetBgImageStyle ( const Graphic3d_CView ACView,
const Aspect_FillMethod  FillStyle 
)
virtual
void OpenGl_GraphicDriver::SetCamera ( const Graphic3d_CView theCView)
virtual

Inform graphic driver if camera assigned to view changes.

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::SetClipPlanes ( const Graphic3d_CView theCView)
virtual

Pass clip planes to the associated graphic driver view.

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::SetColor ( const Standard_ShortReal  R,
const Standard_ShortReal  G,
const Standard_ShortReal  B 
)
virtual

call_togl_set_color

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::SetDepthTestEnabled ( const Graphic3d_CView view,
const Standard_Boolean  isEnabled 
) const
virtual

call_togl_depthtest

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::SetGLLightEnabled ( const Graphic3d_CView view,
const Standard_Boolean  isEnabled 
) const
virtual

call_togl_gllight

Implements Graphic3d_GraphicDriver.

Standard_Boolean OpenGl_GraphicDriver::SetImmediateModeDrawToFront ( const Graphic3d_CView theCView,
const Standard_Boolean  theDrawToFrontBuffer 
)
virtual
Parameters
theDrawToFrontBufferAdvanced option to modify rendering mode:
  1. TRUE. Drawing immediate mode structures directly to the front buffer over the scene image. Fast, so preferred for interactive work (used by default). However these extra drawings will be missed in image dump since it is performed from back buffer. Notice that since no pre-buffering used the V-Sync will be ignored and rendering could be seen in run-time (in case of slow hardware) and/or tearing may appear. So this is strongly recommended to draw only simple (fast) structures.
  2. FALSE. Drawing immediate mode structures to the back buffer. The complete scene is redrawn first, so this mode is slower if scene contains complex data and/or V-Sync is turned on. But it works in any case and is especially useful for view dump because the dump image is read from the back buffer.
Returns
previous mode.

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::SetLight ( const Graphic3d_CView ACView)
virtual

call_togl_setlight

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::SetLineAttributes ( const Standard_Integer  Type,
const Standard_ShortReal  Width 
)
virtual

call_togl_set_line_attributes

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::SetTextAttributes ( const Standard_CString  theFontName,
const Standard_Integer  theType,
const Standard_ShortReal  theR,
const Standard_ShortReal  theG,
const Standard_ShortReal  theB 
)
virtual

Set text attributes for under-/overlayer.

Parameters
theFontNamethe name of the font to be used
theTypethe display type of the text theR theG theB values define the color of decal or subtitle background To set the color of the text you can use the SetColor method.

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::SetTransparency ( const Standard_ShortReal  ATransparency)
virtual

call_togl_set_transparency

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::SetVisualisation ( const Graphic3d_CView ACView)
virtual

call_togl_setvisualisation

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::SetZLayerSettings ( const Graphic3d_CView theCView,
const Graphic3d_ZLayerId  theLayerId,
const Graphic3d_ZLayerSettings theSettings 
)
virtual

Sets the settings for a single Z layer of specified view.

Implements Graphic3d_GraphicDriver.

Handle< Graphic3d_CStructure > OpenGl_GraphicDriver::Structure ( const Handle< Graphic3d_StructureManager > &  theManager)
virtual

Creates new empty graphic structure.

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::Text ( const Standard_CString  AText,
const Standard_ShortReal  X,
const Standard_ShortReal  Y,
const Standard_ShortReal  AHeight 
)
virtual

call_togl_text2d If AHeight < 0 default text height is used by driver (DefaultTextHeight method)

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::TextSize ( const Standard_CString  AText,
const Standard_ShortReal  AHeight,
Standard_ShortReal AWidth,
Standard_ShortReal AnAscent,
Standard_ShortReal ADescent 
) const
virtual

call_togl_textsize2d

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::TriedronDisplay ( const Graphic3d_CView ACView,
const Aspect_TypeOfTriedronPosition  APosition = Aspect_TOTP_CENTER,
const Quantity_NameOfColor  AColor = Quantity_NOC_WHITE,
const Standard_Real  AScale = 0.02,
const Standard_Boolean  AsWireframe = Standard_True 
)
virtual

call_togl_triedron_display

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::TriedronEcho ( const Graphic3d_CView ACView,
const Aspect_TypeOfTriedronEcho  AType = Aspect_TOTE_NONE 
)
virtual

call_togl_triedron_echo

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::TriedronErase ( const Graphic3d_CView ACView)
virtual

call_togl_triedron_erase

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::UnsetTransparency ( )
virtual

call_togl_unset_transparency

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::UnsetZLayer ( const Graphic3d_ZLayerId  theLayerId)
virtual

Unset Z layer ID for all structures. The structure indexes will be set to default layer (the bottom-level z layer with ID = 0).

Implements Graphic3d_GraphicDriver.

OpenGl_UserDrawCallback_t& OpenGl_GraphicDriver::UserDrawCallback ( )

Method to setup UserDraw callback.

Standard_Boolean OpenGl_GraphicDriver::View ( Graphic3d_CView ACView)
virtual

call_togl_view

Implements Graphic3d_GraphicDriver.

void OpenGl_GraphicDriver::ZBufferTriedronSetup ( const Graphic3d_CView theCView,
const Quantity_NameOfColor  XColor = Quantity_NOC_RED,
const Quantity_NameOfColor  YColor = Quantity_NOC_GREEN,
const Quantity_NameOfColor  ZColor = Quantity_NOC_BLUE1,
const Standard_Real  SizeRatio = 0.8,
const Standard_Real  AxisDiametr = 0.05,
const Standard_Integer  NbFacettes = 12 
)
virtual

call_togl_ztriedron_setup

Implements Graphic3d_GraphicDriver.


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