Open CASCADE Technology 7.8.0
Public Member Functions | Protected Member Functions | Protected Attributes
Graphic3d_GraphicDriver Class Referenceabstract

This class allows the definition of a graphic driver for 3d interface (currently only OpenGl driver is used). More...

#include <Graphic3d_GraphicDriver.hxx>

Inheritance diagram for Graphic3d_GraphicDriver:
Inheritance graph
[legend]

Public Member Functions

virtual Standard_Integer InquireLimit (const Graphic3d_TypeOfLimit theType) const =0
 Request limit of graphic resource of specific type.
 
Standard_Integer InquireLightLimit () const
 Request maximum number of active light sources supported by driver and hardware.
 
Standard_Integer InquirePlaneLimit () const
 Request maximum number of active clipping planes supported by driver and hardware.
 
Standard_Integer InquireViewLimit () const
 Request maximum number of views supported by driver.
 
virtual Handle< Graphic3d_CStructureCreateStructure (const Handle< Graphic3d_StructureManager > &theManager)=0
 Creates new empty graphic structure.
 
virtual void RemoveStructure (Handle< Graphic3d_CStructure > &theCStructure)=0
 Removes structure from graphic driver and releases its resources.
 
virtual Handle< Graphic3d_CViewCreateView (const Handle< Graphic3d_StructureManager > &theMgr)=0
 Creates new view for this graphic driver.
 
virtual void RemoveView (const Handle< Graphic3d_CView > &theView)=0
 Removes view from graphic driver and releases its resources.
 
virtual void EnableVBO (const Standard_Boolean status)=0
 enables/disables usage of OpenGL vertex buffer arrays while drawing primitive arrays
 
virtual bool IsVerticalSync () const =0
 Returns TRUE if vertical synchronization with display refresh rate (VSync) should be used; TRUE by default.
 
virtual void SetVerticalSync (bool theToEnable)=0
 Set if vertical synchronization with display refresh rate (VSync) should be used.
 
virtual Standard_Boolean MemoryInfo (Standard_Size &theFreeBytes, TCollection_AsciiString &theInfo) const =0
 Returns information about GPU memory usage.
 
virtual Standard_ShortReal DefaultTextHeight () const =0
 
virtual void TextSize (const Handle< Graphic3d_CView > &theView, const Standard_CString theText, const Standard_ShortReal theHeight, Standard_ShortReal &theWidth, Standard_ShortReal &theAscent, Standard_ShortReal &theDescent) const =0
 Computes text width.
 
virtual void InsertLayerBefore (const Graphic3d_ZLayerId theNewLayerId, const Graphic3d_ZLayerSettings &theSettings, const Graphic3d_ZLayerId theLayerAfter)=0
 Adds a layer to all views. To add a structure to desired layer on display it is necessary to set the layer ID for the structure.
 
virtual void InsertLayerAfter (const Graphic3d_ZLayerId theNewLayerId, const Graphic3d_ZLayerSettings &theSettings, const Graphic3d_ZLayerId theLayerBefore)=0
 Adds a layer to all views.
 
virtual void RemoveZLayer (const Graphic3d_ZLayerId theLayerId)=0
 Removes Z layer. All structures displayed at the moment in layer will be displayed in default layer (the bottom-level z layer). By default, there are always default bottom-level layer that can't be removed. The passed theLayerId should be not less than 0 (reserved for default layers that can not be removed).
 
virtual void ZLayers (TColStd_SequenceOfInteger &theLayerSeq) const
 Returns list of Z layers defined for the graphical driver.
 
virtual void SetZLayerSettings (const Graphic3d_ZLayerId theLayerId, const Graphic3d_ZLayerSettings &theSettings)=0
 Sets the settings for a single Z layer.
 
virtual const Graphic3d_ZLayerSettingsZLayerSettings (const Graphic3d_ZLayerId theLayerId) const
 Returns the settings of a single Z layer.
 
virtual Standard_Boolean ViewExists (const Handle< Aspect_Window > &theWindow, Handle< Graphic3d_CView > &theView)=0
 Returns view associated with the window if it is exists and is activated. Returns Standard_True if the view associated to the window exists.
 
const Handle< Aspect_DisplayConnection > & GetDisplayConnection () const
 returns Handle to display connection
 
Standard_Integer NewIdentification ()
 Returns a new identification number for a new structure.
 
void RemoveIdentification (const Standard_Integer theId)
 Frees the identifier of a structure.
 
void DumpJson (Standard_OStream &theOStream, Standard_Integer theDepth=-1) const
 Dumps the content of me into the stream.
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor.
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing.
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter.
 
virtual ~Standard_Transient ()
 Destructor must be virtual.
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object.
 
Standard_Boolean IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type.
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName.
 
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.
 
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.
 
Standard_TransientThis () 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.
 
Standard_Integer GetRefCount () const noexcept
 Get the reference counter of this object.
 
void IncrementRefCounter () noexcept
 Increments the reference counter of this object.
 
Standard_Integer DecrementRefCounter () noexcept
 Decrements the reference counter of this object; returns the decremented value.
 
virtual void Delete () const
 Memory deallocator for transient classes.
 

Protected Member Functions

 Graphic3d_GraphicDriver (const Handle< Aspect_DisplayConnection > &theDisp)
 Initializes the Driver.
 

Protected Attributes

Handle< Aspect_DisplayConnectionmyDisplayConnection
 
Aspect_GenId myStructGenId
 
NCollection_List< Handle< Graphic3d_Layer > > myLayers
 
NCollection_DataMap< Graphic3d_ZLayerId, Handle< Graphic3d_Layer > > myLayerIds
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object.
 
- Static Public Member Functions inherited from Standard_Transient
static constexpr const charget_type_name ()
 Returns a type descriptor about this object.
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class.
 

Detailed Description

This class allows the definition of a graphic driver for 3d interface (currently only OpenGl driver is used).

Constructor & Destructor Documentation

◆ Graphic3d_GraphicDriver()

Graphic3d_GraphicDriver::Graphic3d_GraphicDriver ( const Handle< Aspect_DisplayConnection > &  theDisp)
protected

Initializes the Driver.

Member Function Documentation

◆ CreateStructure()

virtual Handle< Graphic3d_CStructure > Graphic3d_GraphicDriver::CreateStructure ( const Handle< Graphic3d_StructureManager > &  theManager)
pure virtual

Creates new empty graphic structure.

Implemented in OpenGl_GraphicDriver.

◆ CreateView()

virtual Handle< Graphic3d_CView > Graphic3d_GraphicDriver::CreateView ( const Handle< Graphic3d_StructureManager > &  theMgr)
pure virtual

Creates new view for this graphic driver.

Implemented in D3DHost_GraphicDriver, and OpenGl_GraphicDriver.

◆ DefaultTextHeight()

virtual Standard_ShortReal Graphic3d_GraphicDriver::DefaultTextHeight ( ) const
pure virtual

Implemented in OpenGl_GraphicDriver.

◆ DumpJson()

void Graphic3d_GraphicDriver::DumpJson ( Standard_OStream theOStream,
Standard_Integer  theDepth = -1 
) const

Dumps the content of me into the stream.

◆ EnableVBO()

virtual void Graphic3d_GraphicDriver::EnableVBO ( const Standard_Boolean  status)
pure virtual

enables/disables usage of OpenGL vertex buffer arrays while drawing primitive arrays

Implemented in OpenGl_GraphicDriver.

◆ GetDisplayConnection()

const Handle< Aspect_DisplayConnection > & Graphic3d_GraphicDriver::GetDisplayConnection ( ) const

returns Handle to display connection

◆ InquireLightLimit()

Standard_Integer Graphic3d_GraphicDriver::InquireLightLimit ( ) const
inline

Request maximum number of active light sources supported by driver and hardware.

◆ InquireLimit()

virtual Standard_Integer Graphic3d_GraphicDriver::InquireLimit ( const Graphic3d_TypeOfLimit  theType) const
pure virtual

Request limit of graphic resource of specific type.

Implemented in OpenGl_GraphicDriver.

◆ InquirePlaneLimit()

Standard_Integer Graphic3d_GraphicDriver::InquirePlaneLimit ( ) const
inline

Request maximum number of active clipping planes supported by driver and hardware.

◆ InquireViewLimit()

Standard_Integer Graphic3d_GraphicDriver::InquireViewLimit ( ) const
inline

Request maximum number of views supported by driver.

◆ InsertLayerAfter()

virtual void Graphic3d_GraphicDriver::InsertLayerAfter ( const Graphic3d_ZLayerId  theNewLayerId,
const Graphic3d_ZLayerSettings theSettings,
const Graphic3d_ZLayerId  theLayerBefore 
)
pure virtual

Adds a layer to all views.

Parameters
theNewLayerId[in] id of new layer, should be > 0 (negative values are reserved for default layers).
theSettings[in] new layer settings
theLayerBefore[in] id of layer to append new layer after

Implemented in OpenGl_GraphicDriver.

◆ InsertLayerBefore()

virtual void Graphic3d_GraphicDriver::InsertLayerBefore ( const Graphic3d_ZLayerId  theNewLayerId,
const Graphic3d_ZLayerSettings theSettings,
const Graphic3d_ZLayerId  theLayerAfter 
)
pure virtual

Adds a layer to all views. To add a structure to desired layer on display it is necessary to set the layer ID for the structure.

Parameters
theNewLayerId[in] id of new layer, should be > 0 (negative values are reserved for default layers).
theSettings[in] new layer settings
theLayerAfter[in] id of layer to append new layer before

Implemented in OpenGl_GraphicDriver.

◆ IsVerticalSync()

virtual bool Graphic3d_GraphicDriver::IsVerticalSync ( ) const
pure virtual

Returns TRUE if vertical synchronization with display refresh rate (VSync) should be used; TRUE by default.

Implemented in OpenGl_GraphicDriver.

◆ MemoryInfo()

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

Returns information about GPU memory usage.

Implemented in OpenGl_GraphicDriver.

◆ NewIdentification()

Standard_Integer Graphic3d_GraphicDriver::NewIdentification ( )

Returns a new identification number for a new structure.

◆ RemoveIdentification()

void Graphic3d_GraphicDriver::RemoveIdentification ( const Standard_Integer  theId)

Frees the identifier of a structure.

◆ RemoveStructure()

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

Removes structure from graphic driver and releases its resources.

Implemented in OpenGl_GraphicDriver.

◆ RemoveView()

virtual void Graphic3d_GraphicDriver::RemoveView ( const Handle< Graphic3d_CView > &  theView)
pure virtual

Removes view from graphic driver and releases its resources.

Implemented in OpenGl_GraphicDriver.

◆ RemoveZLayer()

virtual void Graphic3d_GraphicDriver::RemoveZLayer ( const Graphic3d_ZLayerId  theLayerId)
pure virtual

Removes Z layer. All structures displayed at the moment in layer will be displayed in default layer (the bottom-level z layer). By default, there are always default bottom-level layer that can't be removed. The passed theLayerId should be not less than 0 (reserved for default layers that can not be removed).

Implemented in OpenGl_GraphicDriver.

◆ SetVerticalSync()

virtual void Graphic3d_GraphicDriver::SetVerticalSync ( bool  theToEnable)
pure virtual

Set if vertical synchronization with display refresh rate (VSync) should be used.

Implemented in OpenGl_GraphicDriver.

◆ SetZLayerSettings()

virtual void Graphic3d_GraphicDriver::SetZLayerSettings ( const Graphic3d_ZLayerId  theLayerId,
const Graphic3d_ZLayerSettings theSettings 
)
pure virtual

Sets the settings for a single Z layer.

Implemented in OpenGl_GraphicDriver.

◆ TextSize()

virtual void Graphic3d_GraphicDriver::TextSize ( const Handle< Graphic3d_CView > &  theView,
const Standard_CString  theText,
const Standard_ShortReal  theHeight,
Standard_ShortReal theWidth,
Standard_ShortReal theAscent,
Standard_ShortReal theDescent 
) const
pure virtual

Computes text width.

Implemented in OpenGl_GraphicDriver.

◆ ViewExists()

virtual Standard_Boolean Graphic3d_GraphicDriver::ViewExists ( const Handle< Aspect_Window > &  theWindow,
Handle< Graphic3d_CView > &  theView 
)
pure virtual

Returns view associated with the window if it is exists and is activated. Returns Standard_True if the view associated to the window exists.

Implemented in OpenGl_GraphicDriver.

◆ ZLayers()

virtual void Graphic3d_GraphicDriver::ZLayers ( TColStd_SequenceOfInteger theLayerSeq) const
virtual

Returns list of Z layers defined for the graphical driver.

◆ ZLayerSettings()

virtual const Graphic3d_ZLayerSettings & Graphic3d_GraphicDriver::ZLayerSettings ( const Graphic3d_ZLayerId  theLayerId) const
virtual

Returns the settings of a single Z layer.

Field Documentation

◆ myDisplayConnection

Handle< Aspect_DisplayConnection > Graphic3d_GraphicDriver::myDisplayConnection
protected

◆ myLayerIds

NCollection_DataMap<Graphic3d_ZLayerId, Handle< Graphic3d_Layer > > Graphic3d_GraphicDriver::myLayerIds
protected

◆ myLayers

NCollection_List<Handle< Graphic3d_Layer > > Graphic3d_GraphicDriver::myLayers
protected

◆ myStructGenId

Aspect_GenId Graphic3d_GraphicDriver::myStructGenId
protected

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