Open CASCADE Technology  6.8.0
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
OpenGl_View Class Reference

#include <OpenGl_View.hxx>

Inheritance diagram for OpenGl_View:
Inheritance graph
[legend]

Public Member Functions

 OpenGl_View (const CALL_DEF_VIEWCONTEXT &AContext, OpenGl_StateCounter *theCounter)
 
virtual ~OpenGl_View ()
 
void ReleaseGlResources (const Handle< OpenGl_Context > &theCtx)
 
void SetTextureEnv (const Handle< OpenGl_Context > &theCtx, const Handle< Graphic3d_TextureEnv > &theTexture)
 
void SetSurfaceDetail (const Visual3d_TypeOfSurfaceDetail AMode)
 
void SetBackfacing (const Standard_Integer AMode)
 
void SetLights (const CALL_DEF_VIEWCONTEXT &AContext)
 
void SetAntiAliasing (const Standard_Boolean AMode)
 
void SetClipPlanes (const Graphic3d_SequenceOfHClipPlane &thePlanes)
 
void SetVisualisation (const CALL_DEF_VIEWCONTEXT &AContext)
 
const Handle< Graphic3d_Camera > & Camera ()
 
void SetCamera (const Handle< Graphic3d_Camera > &theCamera)
 
void SetClipLimit (const Graphic3d_CView &theCView)
 
void SetFog (const Graphic3d_CView &theCView, const Standard_Boolean theFlag)
 
void TriedronDisplay (const Handle< OpenGl_Context > &theCtx, const Aspect_TypeOfTriedronPosition thePosition, const Quantity_NameOfColor theColor, const Standard_Real theScale, const Standard_Boolean theAsWireframe)
 
void TriedronErase (const Handle< OpenGl_Context > &theCtx)
 
void GraduatedTrihedronDisplay (const Handle< OpenGl_Context > &theCtx, const Graphic3d_CGraduatedTrihedron &theCubic)
 
void GraduatedTrihedronErase (const Handle< OpenGl_Context > &theCtx)
 
Standard_Real Height () const
 
Standard_Real Width () const
 
Standard_Integer Backfacing () const
 
const TEL_TRANSFORM_PERSISTENCEBeginTransformPersistence (const Handle< OpenGl_Context > &theCtx, const TEL_TRANSFORM_PERSISTENCE *theTransPers)
 
void EndTransformPersistence (const Handle< OpenGl_Context > &theCtx)
 
void DisplayStructure (const OpenGl_Structure *theStructure, const Standard_Integer thePriority)
 Add structure to display list with specified priority. The structure will be added to associated with it z layer. If the z layer is not presented in the view, the structure will be displayed in default bottom-level z layer. More...
 
void EraseStructure (const OpenGl_Structure *theStructure)
 Erase structure from display list. More...
 
void DisplayImmediateStructure (const OpenGl_Structure *theStructure)
 Add structure to the list of immediate structures. More...
 
void EraseImmediateStructure (const OpenGl_Structure *theStructure)
 Erase structure from display list. More...
 
void AddZLayer (const Standard_Integer theLayerId)
 Insert a new top-level z layer with ID <theLayerId> More...
 
void RemoveZLayer (const Standard_Integer theLayerId)
 Remove a z layer with ID <theLayerId> More...
 
void ChangeZLayer (const OpenGl_Structure *theStructure, const Standard_Integer theNewLayerId)
 Display structure in z layer with ID <theNewLayerId> If the layer with ID <theNewLayerId> is not presented in the view, the structure will be displayed in default bottom-level layer. More...
 
void SetZLayerSettings (const Standard_Integer theLayerId, const Graphic3d_ZLayerSettings theSettings)
 Sets the settings for a single Z layer of specified view. More...
 
void ChangePriority (const OpenGl_Structure *theStructure, const Standard_Integer theNewPriority)
 Changes the priority of a structure within its ZLayer. More...
 
void CreateBackgroundTexture (const Standard_CString AFileName, const Aspect_FillMethod AFillStyle)
 
void SetBackgroundTextureStyle (const Aspect_FillMethod FillStyle)
 
void SetBackgroundGradient (const Quantity_Color &AColor1, const Quantity_Color &AColor2, const Aspect_GradientFillMethod AType)
 
void SetBackgroundGradientType (const Aspect_GradientFillMethod AType)
 
void Render (const Handle< OpenGl_PrinterContext > &thePrintContext, const Handle< OpenGl_Workspace > &theWorkspace, const Graphic3d_CView &theCView, const Aspect_CLayer2d &theCUnderLayer, const Aspect_CLayer2d &theCOverLayer)
 
void DrawBackground (OpenGl_Workspace &theWorkspace)
 
const OpenGl_LayerListLayerList () const
 Returns list of OpenGL Z-layers. More...
 
const OpenGl_ListOfLightLightList () const
 Returns list of openGL light sources. More...
 
const Handle< OpenGl_Texture > & TextureEnv () const
 Returns OpenGL environment map. More...
 
Visual3d_TypeOfSurfaceDetail SurfaceDetail () const
 Returns visualization mode for objects in the view. More...
 
OpenGl_BVHTreeSelectorBVHTreeSelector ()
 Returns selector for BVH tree, providing a possibility to store information about current view volume and to detect which objects are overlapping it. More...
 
void InvalidateBVHData (const Standard_Integer theLayerId)
 Marks BVH tree for given priority list as dirty and marks primitive set for rebuild. More...
 
void GetMatrices (OpenGl_Mat4 &theOrientation, OpenGl_Mat4 &theViewMapping) const
 Returns view-mapping and orientation matrices. More...
 
const OpenGl_SequenceOfStructureImmediateStructures () const
 Returns list of immediate structures rendered on top of main presentation. More...
 
Standard_Size ModificationState () const
 Returns modification state for ray-tracing. More...
 
 DEFINE_STANDARD_RTTI (OpenGl_View) friend class OpenGl_Workspace
 
- 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...
 

Protected Types

typedef std::pair
< Standard_Size, Standard_Size
StateInfo
 

Protected Member Functions

void RenderStructs (const Handle< OpenGl_Workspace > &AWorkspace)
 
void RedrawLayer2d (const Handle< OpenGl_PrinterContext > &thePrintContext, const Handle< OpenGl_Workspace > &theWorkspace, const Graphic3d_CView &theCView, const Aspect_CLayer2d &theCLayer)
 
void RedrawTrihedron (const Handle< OpenGl_Workspace > &theWorkspace)
 
void RedrawScene (const Handle< OpenGl_PrinterContext > &thePrintContext, const Handle< OpenGl_Workspace > &theWorkspace)
 Redraw contents of model scene: clipping planes, lights, structures. The peculiar properties of "scene" is that it requires empty Z-Buffer and uses projection and orientation matrices supplied by 3d view. More...
 

Protected Attributes

Handle< OpenGl_LineAttributesmyLineAttribs
 
Handle< OpenGl_TexturemyTextureEnv
 
Visual3d_TypeOfSurfaceDetail mySurfaceDetail
 
Standard_Integer myBackfacing
 
OPENGL_BG_TEXTURE myBgTexture
 
OPENGL_BG_GRADIENT myBgGradient
 
OPENGL_ZCLIP myZClip
 
Graphic3d_SequenceOfHClipPlane myClipPlanes
 
Handle< Graphic3d_CameramyCamera
 
OPENGL_FOG myFog
 
OpenGl_TrihedronmyTrihedron
 
OpenGl_GraduatedTrihedronmyGraduatedTrihedron
 
int myVisualization
 
Visual3d_TypeOfModel myShadingModel
 lighting shading model More...
 
OpenGl_ListOfLight myLights
 
Standard_Boolean myAntiAliasing
 
OpenGl_LayerList myZLayers
 main list of displayed structure, sorted by layers More...
 
OpenGl_SequenceOfStructure myImmediateList
 list of immediate structures rendered on top of main presentation More...
 
const TEL_TRANSFORM_PERSISTENCEmyTransPers
 
Standard_Boolean myIsTransPers
 
Standard_Size myProjectionState
 Modification state. More...
 
Standard_Size myModelViewState
 
OpenGl_StateCountermyStateCounter
 
Standard_Size myCurrLightSourceState
 
StateInfo myLastOrientationState
 
StateInfo myLastViewMappingState
 
StateInfo myLastLightSourceState
 
OpenGl_BVHTreeSelector myBVHSelector
 Is needed for selection of overlapping objects and storage of the current view volume. More...
 
Standard_Size myModificationState
 

Member Typedef Documentation

typedef std::pair<Standard_Size, Standard_Size> OpenGl_View::StateInfo
protected

Constructor & Destructor Documentation

OpenGl_View::OpenGl_View ( const CALL_DEF_VIEWCONTEXT AContext,
OpenGl_StateCounter theCounter 
)
virtual OpenGl_View::~OpenGl_View ( )
virtual

Member Function Documentation

void OpenGl_View::AddZLayer ( const Standard_Integer  theLayerId)

Insert a new top-level z layer with ID <theLayerId>

Standard_Integer OpenGl_View::Backfacing ( ) const
inline
const TEL_TRANSFORM_PERSISTENCE* OpenGl_View::BeginTransformPersistence ( const Handle< OpenGl_Context > &  theCtx,
const TEL_TRANSFORM_PERSISTENCE theTransPers 
)
OpenGl_BVHTreeSelector& OpenGl_View::BVHTreeSelector ( )
inline

Returns selector for BVH tree, providing a possibility to store information about current view volume and to detect which objects are overlapping it.

const Handle< Graphic3d_Camera >& OpenGl_View::Camera ( )
inline
void OpenGl_View::ChangePriority ( const OpenGl_Structure theStructure,
const Standard_Integer  theNewPriority 
)

Changes the priority of a structure within its ZLayer.

void OpenGl_View::ChangeZLayer ( const OpenGl_Structure theStructure,
const Standard_Integer  theNewLayerId 
)

Display structure in z layer with ID <theNewLayerId> If the layer with ID <theNewLayerId> is not presented in the view, the structure will be displayed in default bottom-level layer.

void OpenGl_View::CreateBackgroundTexture ( const Standard_CString  AFileName,
const Aspect_FillMethod  AFillStyle 
)
OpenGl_View::DEFINE_STANDARD_RTTI ( OpenGl_View  )
void OpenGl_View::DisplayImmediateStructure ( const OpenGl_Structure theStructure)

Add structure to the list of immediate structures.

void OpenGl_View::DisplayStructure ( const OpenGl_Structure theStructure,
const Standard_Integer  thePriority 
)

Add structure to display list with specified priority. The structure will be added to associated with it z layer. If the z layer is not presented in the view, the structure will be displayed in default bottom-level z layer.

void OpenGl_View::DrawBackground ( OpenGl_Workspace theWorkspace)
void OpenGl_View::EndTransformPersistence ( const Handle< OpenGl_Context > &  theCtx)
void OpenGl_View::EraseImmediateStructure ( const OpenGl_Structure theStructure)

Erase structure from display list.

void OpenGl_View::EraseStructure ( const OpenGl_Structure theStructure)

Erase structure from display list.

void OpenGl_View::GetMatrices ( OpenGl_Mat4 theOrientation,
OpenGl_Mat4 theViewMapping 
) const

Returns view-mapping and orientation matrices.

void OpenGl_View::GraduatedTrihedronDisplay ( const Handle< OpenGl_Context > &  theCtx,
const Graphic3d_CGraduatedTrihedron theCubic 
)
void OpenGl_View::GraduatedTrihedronErase ( const Handle< OpenGl_Context > &  theCtx)
Standard_Real OpenGl_View::Height ( ) const
inline
const OpenGl_SequenceOfStructure& OpenGl_View::ImmediateStructures ( ) const
inline

Returns list of immediate structures rendered on top of main presentation.

void OpenGl_View::InvalidateBVHData ( const Standard_Integer  theLayerId)

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

const OpenGl_LayerList& OpenGl_View::LayerList ( ) const
inline

Returns list of OpenGL Z-layers.

const OpenGl_ListOfLight& OpenGl_View::LightList ( ) const
inline

Returns list of openGL light sources.

Standard_Size OpenGl_View::ModificationState ( ) const
inline

Returns modification state for ray-tracing.

void OpenGl_View::RedrawLayer2d ( const Handle< OpenGl_PrinterContext > &  thePrintContext,
const Handle< OpenGl_Workspace > &  theWorkspace,
const Graphic3d_CView theCView,
const Aspect_CLayer2d theCLayer 
)
protected
void OpenGl_View::RedrawScene ( const Handle< OpenGl_PrinterContext > &  thePrintContext,
const Handle< OpenGl_Workspace > &  theWorkspace 
)
protected

Redraw contents of model scene: clipping planes, lights, structures. The peculiar properties of "scene" is that it requires empty Z-Buffer and uses projection and orientation matrices supplied by 3d view.

Parameters
thePrintCtx[in] printer context which facilitates tiled printing.
theWorkspace[in] rendering workspace.
theCView[in] view data.
theProjection[in] view projection matrix.
theOrientation[in] view orientation matrix.
void OpenGl_View::RedrawTrihedron ( const Handle< OpenGl_Workspace > &  theWorkspace)
protected
void OpenGl_View::ReleaseGlResources ( const Handle< OpenGl_Context > &  theCtx)
void OpenGl_View::RemoveZLayer ( const Standard_Integer  theLayerId)

Remove a z layer with ID <theLayerId>

void OpenGl_View::Render ( const Handle< OpenGl_PrinterContext > &  thePrintContext,
const Handle< OpenGl_Workspace > &  theWorkspace,
const Graphic3d_CView theCView,
const Aspect_CLayer2d theCUnderLayer,
const Aspect_CLayer2d theCOverLayer 
)
void OpenGl_View::RenderStructs ( const Handle< OpenGl_Workspace > &  AWorkspace)
protected
void OpenGl_View::SetAntiAliasing ( const Standard_Boolean  AMode)
inline
void OpenGl_View::SetBackfacing ( const Standard_Integer  AMode)
void OpenGl_View::SetBackgroundGradient ( const Quantity_Color AColor1,
const Quantity_Color AColor2,
const Aspect_GradientFillMethod  AType 
)
void OpenGl_View::SetBackgroundGradientType ( const Aspect_GradientFillMethod  AType)
void OpenGl_View::SetBackgroundTextureStyle ( const Aspect_FillMethod  FillStyle)
void OpenGl_View::SetCamera ( const Handle< Graphic3d_Camera > &  theCamera)
inline
void OpenGl_View::SetClipLimit ( const Graphic3d_CView theCView)
void OpenGl_View::SetClipPlanes ( const Graphic3d_SequenceOfHClipPlane thePlanes)
inline
void OpenGl_View::SetFog ( const Graphic3d_CView theCView,
const Standard_Boolean  theFlag 
)
void OpenGl_View::SetLights ( const CALL_DEF_VIEWCONTEXT AContext)
void OpenGl_View::SetSurfaceDetail ( const Visual3d_TypeOfSurfaceDetail  AMode)
void OpenGl_View::SetTextureEnv ( const Handle< OpenGl_Context > &  theCtx,
const Handle< Graphic3d_TextureEnv > &  theTexture 
)
void OpenGl_View::SetVisualisation ( const CALL_DEF_VIEWCONTEXT AContext)
void OpenGl_View::SetZLayerSettings ( const Standard_Integer  theLayerId,
const Graphic3d_ZLayerSettings  theSettings 
)

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

Visual3d_TypeOfSurfaceDetail OpenGl_View::SurfaceDetail ( ) const
inline

Returns visualization mode for objects in the view.

const Handle< OpenGl_Texture >& OpenGl_View::TextureEnv ( ) const
inline

Returns OpenGL environment map.

void OpenGl_View::TriedronDisplay ( const Handle< OpenGl_Context > &  theCtx,
const Aspect_TypeOfTriedronPosition  thePosition,
const Quantity_NameOfColor  theColor,
const Standard_Real  theScale,
const Standard_Boolean  theAsWireframe 
)
void OpenGl_View::TriedronErase ( const Handle< OpenGl_Context > &  theCtx)
Standard_Real OpenGl_View::Width ( ) const
inline

Field Documentation

Standard_Boolean OpenGl_View::myAntiAliasing
protected
Standard_Integer OpenGl_View::myBackfacing
protected
OPENGL_BG_GRADIENT OpenGl_View::myBgGradient
protected
OPENGL_BG_TEXTURE OpenGl_View::myBgTexture
protected
OpenGl_BVHTreeSelector OpenGl_View::myBVHSelector
protected

Is needed for selection of overlapping objects and storage of the current view volume.

Handle< Graphic3d_Camera > OpenGl_View::myCamera
protected
Graphic3d_SequenceOfHClipPlane OpenGl_View::myClipPlanes
protected
Standard_Size OpenGl_View::myCurrLightSourceState
protected
OPENGL_FOG OpenGl_View::myFog
protected
OpenGl_GraduatedTrihedron* OpenGl_View::myGraduatedTrihedron
protected
OpenGl_SequenceOfStructure OpenGl_View::myImmediateList
protected

list of immediate structures rendered on top of main presentation

Standard_Boolean OpenGl_View::myIsTransPers
protected
StateInfo OpenGl_View::myLastLightSourceState
protected
StateInfo OpenGl_View::myLastOrientationState
protected
StateInfo OpenGl_View::myLastViewMappingState
protected
OpenGl_ListOfLight OpenGl_View::myLights
protected
Handle< OpenGl_LineAttributes > OpenGl_View::myLineAttribs
protected
Standard_Size OpenGl_View::myModelViewState
protected
Standard_Size OpenGl_View::myModificationState
protected
Standard_Size OpenGl_View::myProjectionState
protected

Modification state.

Visual3d_TypeOfModel OpenGl_View::myShadingModel
protected

lighting shading model

OpenGl_StateCounter* OpenGl_View::myStateCounter
protected
Visual3d_TypeOfSurfaceDetail OpenGl_View::mySurfaceDetail
protected
Handle< OpenGl_Texture > OpenGl_View::myTextureEnv
protected
const TEL_TRANSFORM_PERSISTENCE* OpenGl_View::myTransPers
protected
OpenGl_Trihedron* OpenGl_View::myTrihedron
protected
int OpenGl_View::myVisualization
protected
OPENGL_ZCLIP OpenGl_View::myZClip
protected
OpenGl_LayerList OpenGl_View::myZLayers
protected

main list of displayed structure, sorted by layers


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