OCCT3D About OCCT
Open CASCADE Technology Reference Manual 8.0.1
Loading...
Searching...
No Matches
Public Member Functions
OpenGl_ShaderGrid Class Reference

State and geometry model of the OpenGl shader-rendered grid. More...

#include <OpenGl_ShaderGrid.hxx>

Public Member Functions

bool IsShown () const
 Return TRUE if the grid is currently shown.
 
bool IsBackground () const
 Return TRUE if the grid is rendered as a background.
 
const Aspect_GridParamsParams () const
 Return current parameters.
 
bool Display (const Aspect_GridParams &theParams, const gp_Ax3 &thePlane, const occ::handle< Graphic3d_Camera > &theCamera, const occ::handle< OpenGl_Context > &theContext)
 Store grid state. Returns FALSE when parameters cannot produce a shader grid.
 
void Erase ()
 Clear grid state.
 
void AddZFitBounds (Bnd_Box &theGraphicBox, const occ::handle< Graphic3d_Camera > &theCamera) const
 Add helper bounds required by camera Z fitting.
 
bool Echo (const occ::handle< Graphic3d_Camera > &theCamera, const int theWidth, const int theHeight, const int theX, const int theY, Graphic3d_Vertex &thePoint, Graphic3d_Vertex &theDisplayPoint) const
 Return snapped point for the grid under the window pixel.
 
bool SnapPoint (const occ::handle< Graphic3d_Camera > &theCamera, const Graphic3d_Vertex &thePoint, Graphic3d_Vertex &theGridPoint) const
 Return snapped point for an arbitrary world point.
 
void SetUniforms (const occ::handle< OpenGl_Context > &theContext, const occ::handle< OpenGl_ShaderProgram > &theProgram, const occ::handle< Graphic3d_Camera > &theCamera, const NCollection_Mat4< float > &theWorldView) const
 Upload shader uniforms for current grid state.
 
NCollection_Mat4< floatDrawWorldView (const NCollection_Mat4< float > &theCurrentWorldView) const
 Return worldview matrix to use for drawing.
 

Detailed Description

State and geometry model of the OpenGl shader-rendered grid.

Member Function Documentation

◆ AddZFitBounds()

void OpenGl_ShaderGrid::AddZFitBounds ( Bnd_Box & theGraphicBox,
const occ::handle< Graphic3d_Camera > & theCamera ) const

Add helper bounds required by camera Z fitting.

◆ Display()

bool OpenGl_ShaderGrid::Display ( const Aspect_GridParams & theParams,
const gp_Ax3 & thePlane,
const occ::handle< Graphic3d_Camera > & theCamera,
const occ::handle< OpenGl_Context > & theContext )

Store grid state. Returns FALSE when parameters cannot produce a shader grid.

◆ DrawWorldView()

NCollection_Mat4< float > OpenGl_ShaderGrid::DrawWorldView ( const NCollection_Mat4< float > & theCurrentWorldView) const

Return worldview matrix to use for drawing.

◆ Echo()

bool OpenGl_ShaderGrid::Echo ( const occ::handle< Graphic3d_Camera > & theCamera,
const int theWidth,
const int theHeight,
const int theX,
const int theY,
Graphic3d_Vertex & thePoint,
Graphic3d_Vertex & theDisplayPoint ) const

Return snapped point for the grid under the window pixel.

◆ Erase()

void OpenGl_ShaderGrid::Erase ( )

Clear grid state.

◆ IsBackground()

bool OpenGl_ShaderGrid::IsBackground ( ) const
inline

Return TRUE if the grid is rendered as a background.

◆ IsShown()

bool OpenGl_ShaderGrid::IsShown ( ) const
inline

Return TRUE if the grid is currently shown.

◆ Params()

const Aspect_GridParams & OpenGl_ShaderGrid::Params ( ) const
inline

Return current parameters.

◆ SetUniforms()

void OpenGl_ShaderGrid::SetUniforms ( const occ::handle< OpenGl_Context > & theContext,
const occ::handle< OpenGl_ShaderProgram > & theProgram,
const occ::handle< Graphic3d_Camera > & theCamera,
const NCollection_Mat4< float > & theWorldView ) const

Upload shader uniforms for current grid state.

◆ SnapPoint()

bool OpenGl_ShaderGrid::SnapPoint ( const occ::handle< Graphic3d_Camera > & theCamera,
const Graphic3d_Vertex & thePoint,
Graphic3d_Vertex & theGridPoint ) const

Return snapped point for an arbitrary world point.


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