Open CASCADE Technology
6.8.0
|
Represents window with GL context. Provides methods to render primitives and maintain GL state. More...
#include <OpenGl_Workspace.hxx>
Data Structures | |
struct | RaytracingParams |
Compile-time ray-tracing parameters. More... | |
class | ShaderSource |
Tool class for management of shader sources. More... | |
Public Member Functions | |
OpenGl_Workspace (const Handle< OpenGl_GraphicDriver > &theDriver, const CALL_DEF_WINDOW &theCWindow, Aspect_RenderingContext theGContext, const Handle< OpenGl_Caps > &theCaps, const Handle< OpenGl_Context > &theShareCtx) | |
Main constructor - prepare GL context for specified window. More... | |
virtual | ~OpenGl_Workspace () |
Destructor. More... | |
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. More... | |
Standard_Boolean | SetImmediateModeDrawToFront (const Standard_Boolean theDrawToFrontBuffer) |
void | RedrawImmediate (const Graphic3d_CView &theCView, const Aspect_CLayer2d &theCUnderLayer, const Aspect_CLayer2d &theCOverLayer, const Standard_Boolean theToForce=Standard_False) |
void | Invalidate (const Graphic3d_CView &) |
Standard_Boolean | Print (const Handle< OpenGl_PrinterContext > &thePrintContext, 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. More... | |
const Handle < OpenGl_PrinterContext > & | PrinterContext () const |
void | DisplayCallback (const Graphic3d_CView &theCView, int theReason) |
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_Boolean & | UseZBuffer () |
Standard_Boolean & | UseDepthTest () |
Standard_Boolean & | UseGLLight () |
Standard_Integer | AntiAliasingMode () const |
const OpenGl_Matrix * | SetViewMatrix (const OpenGl_Matrix *) |
const OpenGl_Matrix * | SetStructureMatrix (const OpenGl_Matrix *, bool aRevert=false) |
const void | UpdateModelViewMatrix () |
Updates current model-view matrix replacing it with StructureMatrixT*ViewMatrix from the workspace. More... | |
const OpenGl_AspectLine * | SetAspectLine (const OpenGl_AspectLine *theAspect) |
const OpenGl_AspectFace * | SetAspectFace (const OpenGl_AspectFace *theAspect) |
const OpenGl_AspectMarker * | SetAspectMarker (const OpenGl_AspectMarker *theAspect) |
const OpenGl_AspectText * | SetAspectText (const OpenGl_AspectText *theAspect) |
void | SetTextParam (const OpenGl_TextParam *theParam) |
const OpenGl_AspectLine * | AspectLine (const Standard_Boolean theWithApply) |
const OpenGl_AspectFace * | AspectFace (const Standard_Boolean theWithApply) |
const OpenGl_AspectMarker * | AspectMarker (const Standard_Boolean theWithApply) |
const OpenGl_AspectText * | AspectText (const Standard_Boolean theWithApply) |
const OpenGl_TextParam * | AspectTextParams () const |
void | ResetAppliedAspect () |
Clear the applied aspect state. More... | |
Handle< OpenGl_Texture > | DisableTexture () |
Handle< OpenGl_Texture > | EnableTexture (const Handle< OpenGl_Texture > &theTexture, const Handle< Graphic3d_TextureParams > &theParams=NULL) |
const Handle< OpenGl_Texture > & | ActiveTexture () const |
void | SetRenderFilter (const Handle< OpenGl_RenderFilter > &theFilter) |
Set filter for restricting rendering of particular elements. Filter can be applied for rendering passes used by recursive rendering algorithms for rendering elements of groups. More... | |
const Handle < OpenGl_RenderFilter > & | GetRenderFilter () const |
Get rendering filter. More... | |
const OpenGl_Matrix * | ViewMatrix () const |
const OpenGl_Matrix * | ModelMatrix () const |
void | SetPolygonOffset (int theMode, Standard_ShortReal theFactor, Standard_ShortReal theUnits) |
Sets and applies current polygon offset. More... | |
const TEL_POFFSET_PARAM & | AppliedPolygonOffset () |
Returns currently applied polygon offset params. More... | |
Standard_Boolean | IsCullingEnabled () const |
Standard_Boolean | ToRedrawGL () const |
Returns a flag whether to redraw the scene using OpenGL rasterization. More... | |
![]() | |
OpenGl_Window (const Handle< OpenGl_GraphicDriver > &theDriver, const CALL_DEF_WINDOW &theCWindow, Aspect_RenderingContext theGContext, const Handle< OpenGl_Caps > &theCaps, const Handle< OpenGl_Context > &theShareCtx) | |
Main constructor - prepare GL context for specified window. More... | |
virtual | ~OpenGl_Window () |
Destructor. More... | |
void | Resize (const CALL_DEF_WINDOW &theCWindow) |
Resizes the window. More... | |
void | ReadDepths (const Standard_Integer theX, const Standard_Integer theY, const Standard_Integer theWidth, const Standard_Integer theHeight, float *theDepths) |
Reads depth component for current scene into specified buffer. More... | |
void | SetBackgroundColor (const Standard_ShortReal theR, const Standard_ShortReal theG, const Standard_ShortReal theB) |
Standard_Integer | Width () const |
Standard_Integer | Height () const |
const TEL_COLOUR & | BackgroundColor () const |
const Handle< OpenGl_Context > & | GetGlContext () const |
![]() | |
virtual void | Delete () const |
Memory deallocator for transient classes. More... | |
![]() | |
Standard_Transient () | |
Empty constructor. More... | |
Standard_Transient (const Standard_Transient &) | |
Copy constructor – does nothing. More... | |
Standard_Transient & | operator= (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... | |
Data Fields | |
Standard_Integer | NamedStatus |
const TEL_COLOUR * | HighlightColor |
Protected Member Functions | |
void | copyBackToFront () |
Copy content of Back buffer to the Front buffer. More... | |
virtual Standard_Boolean | Activate () |
Makes GL context for this window active in current thread. More... | |
void | redraw1 (const Graphic3d_CView &theCView, const Aspect_CLayer2d &theCUnderLayer, const Aspect_CLayer2d &theCOverLayer, const int theToSwap) |
void | updateMaterial (const int theFlag) |
void | setTextureParams (Handle< OpenGl_Texture > &theTexture, const Handle< Graphic3d_TextureParams > &theParams) |
methods related to ray-tracing | |
Standard_Boolean | UpdateRaytraceGeometry (GeomUpdateMode theMode) |
Updates 3D scene geometry for ray-tracing. More... | |
Standard_Boolean | CheckRaytraceStructure (const OpenGl_Structure *theStructure) |
Checks to see if the structure is modified. More... | |
Standard_Boolean | CreateMaterial (const OpenGl_AspectFace *theAspect, OpenGl_RaytraceMaterial &theMaterial) |
Creates ray-tracing material properties. More... | |
Standard_Boolean | UpdateRaytraceLightSources (const OpenGl_Mat4 &theInvModelView) |
Updates 3D scene light sources for ray-tracing. More... | |
Standard_Boolean | UpdateRaytraceEnvironmentMap () |
Updates environment map for ray-tracing. More... | |
Standard_Boolean | AddRaytraceStructure (const OpenGl_Structure *theStructure, std::set< const OpenGl_Structure * > &theElements) |
Adds OpenGL structure to ray-traced scene geometry. More... | |
Standard_Boolean | AddRaytraceGroups (const OpenGl_Structure *theStructure, const Standard_Integer theStructMatId, const Standard_ShortReal *theTransform) |
Adds OpenGL groups to ray-traced scene geometry. More... | |
OpenGl_TriangleSet * | AddRaytracePrimitiveArray (const OpenGl_PrimitiveArray *theArray, int theMatID, const OpenGl_Mat4 *theTrans) |
Adds OpenGL primitive array to ray-traced scene geometry. More... | |
Standard_Boolean | AddRaytraceVertexIndices (OpenGl_TriangleSet &theSet, const OpenGl_PrimitiveArray &theArray, Standard_Integer theOffset, Standard_Integer theCount, Standard_Integer theMatID) |
Adds vertex indices from OpenGL primitive array to ray-traced scene geometry. More... | |
Standard_Boolean | AddRaytraceTriangleArray (OpenGl_TriangleSet &theSet, const Handle< Graphic3d_IndexBuffer > &theIndices, Standard_Integer theOffset, Standard_Integer theCount, Standard_Integer theMatID) |
Adds OpenGL triangle array to ray-traced scene geometry. More... | |
Standard_Boolean | AddRaytraceTriangleFanArray (OpenGl_TriangleSet &theSet, const Handle< Graphic3d_IndexBuffer > &theIndices, Standard_Integer theOffset, Standard_Integer theCount, Standard_Integer theMatID) |
Adds OpenGL triangle fan array to ray-traced scene geometry. More... | |
Standard_Boolean | AddRaytraceTriangleStripArray (OpenGl_TriangleSet &theSet, const Handle< Graphic3d_IndexBuffer > &theIndices, Standard_Integer theOffset, Standard_Integer theCount, Standard_Integer theMatID) |
Adds OpenGL triangle strip array to ray-traced scene geometry. More... | |
Standard_Boolean | AddRaytraceQuadrangleArray (OpenGl_TriangleSet &theSet, const Handle< Graphic3d_IndexBuffer > &theIndices, Standard_Integer theOffset, Standard_Integer theCount, Standard_Integer theMatID) |
Adds OpenGL quadrangle array to ray-traced scene geometry. More... | |
Standard_Boolean | AddRaytraceQuadrangleStripArray (OpenGl_TriangleSet &theSet, const Handle< Graphic3d_IndexBuffer > &theIndices, Standard_Integer theOffset, Standard_Integer theCount, Standard_Integer theMatID) |
Adds OpenGL quadrangle strip array to ray-traced scene geometry. More... | |
Standard_Boolean | AddRaytracePolygonArray (OpenGl_TriangleSet &theSet, const Handle< Graphic3d_IndexBuffer > &theIndices, Standard_Integer theOffset, Standard_Integer theCount, Standard_Integer theMatID) |
Adds OpenGL polygon array to ray-traced scene geometry. More... | |
Handle< OpenGl_ShaderObject > | LoadShader (const ShaderSource &theSource, GLenum theType) |
Loads and compiles shader object from specified source. More... | |
Standard_Boolean | SafeFailBack (const TCollection_ExtendedString &theMessage) |
Performs safe exit when shaders initialization fails. More... | |
TCollection_AsciiString | GenerateShaderPrefix () |
Generates shader prefix based on current ray-tracing options. More... | |
Standard_Boolean | InitRaytraceResources (const Graphic3d_CView &theCView) |
Initializes OpenGL/GLSL shader programs. More... | |
void | ReleaseRaytraceResources () |
Releases OpenGL/GLSL shader programs. More... | |
Standard_Boolean | UploadRaytraceData () |
Uploads ray-trace data to the GPU. More... | |
Standard_Boolean | ResizeRaytraceBuffers (const Standard_Integer theSizeX, const Standard_Integer theSizeY) |
Resizes OpenGL frame buffers. More... | |
void | UpdateCamera (const OpenGl_Mat4 &theOrientation, const OpenGl_Mat4 &theViewMapping, OpenGl_Vec3 theOrigins[4], OpenGl_Vec3 theDirects[4], OpenGl_Mat4 &theInvModelProj) |
Generates viewing rays for corners of screen quad. More... | |
Standard_Boolean | SetUniformState (const Graphic3d_CView &theCView, const OpenGl_Vec3 *theOrigins, const OpenGl_Vec3 *theDirects, const OpenGl_Mat4 &theUnviewMat, const Standard_Integer theProgramIndex, Handle< OpenGl_ShaderProgram > &theRaytraceProgram) |
Sets uniform state for the given ray-tracing shader program. More... | |
Standard_Boolean | RunRaytraceShaders (const Graphic3d_CView &theCView, const Standard_Integer theSizeX, const Standard_Integer theSizeY, const OpenGl_Vec3 theOrigins[4], const OpenGl_Vec3 theDirects[4], const OpenGl_Mat4 &theUnviewMat, OpenGl_FrameBuffer *theFrameBuffer) |
Runs ray-tracing shader programs. More... | |
Standard_Boolean | Raytrace (const Graphic3d_CView &theCView, const Standard_Integer theSizeX, const Standard_Integer theSizeY, const Standard_Boolean theToSwap, const Aspect_CLayer2d &theCOverLayer, const Aspect_CLayer2d &theCUnderLayer, OpenGl_FrameBuffer *theFrameBuffer) |
Redraws the window using OpenGL/GLSL ray-tracing. More... | |
![]() | |
void | Init () |
Activates GL context and setup viewport. More... | |
void | EnableFeatures () const |
void | DisableFeatures () const |
void | MakeFrontBufCurrent () const |
Draw directly to the FRONT buffer. Can cause artifacts on the screen. More... | |
void | MakeBackBufCurrent () const |
Draw to BACK buffer. Normal and default state. More... | |
Protected Attributes | |
fields related to ray-tracing | |
RaytraceInitStatus | myComputeInitStatus |
Result of shaders initialization. More... | |
Standard_Boolean | myIsRaytraceDataValid |
Is geometry data valid? More... | |
Standard_Boolean | myIsRaytraceWarnTextures |
Warning about missing extension GL_ARB_bindless_texture has been displayed? More... | |
OpenGl_RaytraceGeometry | myRaytraceGeometry |
3D scene geometry data for ray-tracing. More... | |
Standard_ShortReal | myRaytraceSceneRadius |
Radius of bounding sphere of the scene. More... | |
Standard_ShortReal | myRaytraceSceneEpsilon |
Scene epsilon to prevent self-intersections. More... | |
RaytracingParams | myRaytraceParameters |
Compile-time ray-tracing parameters. More... | |
ShaderSource | myRaytraceShaderSource |
OpenGL/GLSL source of ray-tracing fragment shader. More... | |
ShaderSource | myPostFSAAShaderSource |
OpenGL/GLSL source of adaptive-AA fragment shader. More... | |
Handle< OpenGl_ShaderObject > | myRaytraceShader |
OpenGL/GLSL ray-tracing fragment shader. More... | |
Handle< OpenGl_ShaderObject > | myPostFSAAShader |
OpenGL/GLSL adaptive-AA fragment shader. More... | |
Handle< OpenGl_ShaderProgram > | myRaytraceProgram |
OpenGL/GLSL ray-tracing shader program. More... | |
Handle< OpenGl_ShaderProgram > | myPostFSAAProgram |
OpenGL/GLSL adaptive-AA shader program. More... | |
Handle< OpenGl_TextureBufferArb > | mySceneNodeInfoTexture |
Texture buffer of data records of high-level BVH nodes. More... | |
Handle< OpenGl_TextureBufferArb > | mySceneMinPointTexture |
Texture buffer of minimum points of high-level BVH nodes. More... | |
Handle< OpenGl_TextureBufferArb > | mySceneMaxPointTexture |
Texture buffer of maximum points of high-level BVH nodes. More... | |
Handle< OpenGl_TextureBufferArb > | mySceneTransformTexture |
Texture buffer of transformations of high-level BVH nodes. More... | |
Handle< OpenGl_TextureBufferArb > | myObjectNodeInfoTexture |
Texture buffer of data records of bottom-level BVH nodes. More... | |
Handle< OpenGl_TextureBufferArb > | myObjectMinPointTexture |
Texture buffer of minimum points of bottom-level BVH nodes. More... | |
Handle< OpenGl_TextureBufferArb > | myObjectMaxPointTexture |
Texture buffer of maximum points of bottom-level BVH nodes. More... | |
Handle< OpenGl_TextureBufferArb > | myGeometryVertexTexture |
Texture buffer of vertex coords. More... | |
Handle< OpenGl_TextureBufferArb > | myGeometryNormalTexture |
Texture buffer of vertex normals. More... | |
Handle< OpenGl_TextureBufferArb > | myGeometryTexCrdTexture |
Texture buffer of vertex UV coords. More... | |
Handle< OpenGl_TextureBufferArb > | myGeometryTriangTexture |
Texture buffer of triangle indices. More... | |
Handle< OpenGl_TextureBufferArb > | myRaytraceMaterialTexture |
Texture buffer of material properties. More... | |
Handle< OpenGl_TextureBufferArb > | myRaytraceLightSrcTexture |
Texture buffer of light source properties. More... | |
OpenGl_VertexBuffer | myRaytraceScreenQuad |
Vertex buffer (VBO) for drawing dummy quad. More... | |
Handle< OpenGl_FrameBuffer > | myRaytraceFBO1 |
Framebuffer (FBO) to perform adaptive FSAA. More... | |
Handle< OpenGl_FrameBuffer > | myRaytraceFBO2 |
Framebuffer (FBO) to perform adaptive FSAA. More... | |
Handle< OpenGl_FrameBuffer > | myOpenGlFBO |
Framebuffer (FBO) for pre-raytrace rendering by OpenGL. More... | |
Standard_Size | myViewModificationStatus |
State of OpenGL view. More... | |
Standard_Size | myLayersModificationStatus |
State of OpenGL layer list. More... | |
std::map< const OpenGl_Structure *, Standard_Size > | myStructureStates |
State of OpenGL structures reflected to ray-tracing. More... | |
std::map< Standard_Size, OpenGl_TriangleSet * > | myArrayToTrianglesMap |
PrimitiveArray to TriangleSet map for scene partial update. More... | |
Standard_Integer | myUniformLocations [2][OpenGl_RT_NbVariables] |
Cached locations of frequently used uniform variables. More... | |
Handle< OpenGl_RaytraceFilter > | myRaytraceFilter |
Graphical ray-tracing filter to filter out all raytracable structures. More... | |
Standard_Boolean | myToRedrawGL |
Redraw the scene using OpenGL rasterization or ray-tracing? More... | |
protected fields | |
Handle< OpenGl_PrinterContext > | myPrintContext |
optimization flag for immediate mode (to render directly to the front buffer) More... | |
Handle< OpenGl_View > | myView |
optimization flag for immediate mode (to render directly to the front buffer) More... | |
Handle< OpenGl_LineAttributes > | myLineAttribs |
optimization flag for immediate mode (to render directly to the front buffer) More... | |
Standard_Integer | myAntiAliasingMode |
optimization flag for immediate mode (to render directly to the front buffer) More... | |
Standard_Boolean | myTransientDrawToFront |
optimization flag for immediate mode (to render directly to the front buffer) More... | |
Standard_Boolean | myBackBufferRestored |
optimization flag for immediate mode (to render directly to the front buffer) More... | |
Standard_Boolean | myIsImmediateDrawn |
flag indicates that immediate mode buffer contains some data More... | |
Standard_Boolean | myUseTransparency |
optimization flag for immediate mode (to render directly to the front buffer) More... | |
Standard_Boolean | myUseZBuffer |
optimization flag for immediate mode (to render directly to the front buffer) More... | |
Standard_Boolean | myUseDepthTest |
optimization flag for immediate mode (to render directly to the front buffer) More... | |
Standard_Boolean | myUseGLLight |
optimization flag for immediate mode (to render directly to the front buffer) More... | |
Standard_Boolean | myIsCullingEnabled |
frustum culling flag More... | |
unsigned int | myFrameCounter |
redraw counter, for debugging More... | |
fields related to status | |
Handle< OpenGl_RenderFilter > | myRenderFilter |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More... | |
Handle< OpenGl_Texture > | myTextureBound |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More... | |
const OpenGl_AspectLine * | AspectLine_set |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More... | |
const OpenGl_AspectLine * | AspectLine_applied |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More... | |
const OpenGl_AspectFace * | AspectFace_set |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More... | |
const OpenGl_AspectFace * | AspectFace_applied |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More... | |
const OpenGl_AspectMarker * | AspectMarker_set |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More... | |
const OpenGl_AspectMarker * | AspectMarker_applied |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More... | |
const OpenGl_AspectText * | AspectText_set |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More... | |
const OpenGl_AspectText * | AspectText_applied |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More... | |
const OpenGl_TextParam * | TextParam_set |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More... | |
const OpenGl_TextParam * | TextParam_applied |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More... | |
const OpenGl_Matrix * | ViewMatrix_applied |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More... | |
const OpenGl_Matrix * | StructureMatrix_applied |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture) More... | |
OpenGl_Material | myMatFront |
current front material state (cached to reduce GL context updates) More... | |
OpenGl_Material | myMatBack |
current back material state More... | |
OpenGl_Material | myMatTmp |
temporary variable More... | |
TelCullMode | myCullingMode |
back face culling mode, applied from face aspect More... | |
OpenGl_Matrix | myModelViewMatrix |
Model matrix with applied structure transformations. More... | |
TEL_POFFSET_PARAM | PolygonOffset_applied |
Currently applied polygon offset. More... | |
OpenGl_AspectFace | myAspectFaceHl |
Hiddenline aspect. More... | |
![]() | |
Handle< OpenGl_Context > | myGlContext |
Standard_Boolean | myOwnGContext |
set to TRUE if GL context was not created by this class More... | |
Standard_Integer | myWidth |
window width More... | |
Standard_Integer | myHeight |
window height More... | |
TEL_COLOUR | myBgColor |
background color More... | |
Static Protected Attributes | |
static const Standard_Integer | THE_DEFAULT_NB_BOUNCES = 3 |
Default ray-tracing depth. More... | |
static const Standard_Integer | THE_DEFAULT_STACK_SIZE = 24 |
Default size of traversal stack. More... | |
Represents window with GL context. Provides methods to render primitives and maintain GL state.
|
protected |
|
protected |
|
protected |
Defines texture samplers.
|
protected |
Defines frequently used shader variables.
OpenGl_Workspace::OpenGl_Workspace | ( | const Handle< OpenGl_GraphicDriver > & | theDriver, |
const CALL_DEF_WINDOW & | theCWindow, | ||
Aspect_RenderingContext | theGContext, | ||
const Handle< OpenGl_Caps > & | theCaps, | ||
const Handle< OpenGl_Context > & | theShareCtx | ||
) |
Main constructor - prepare GL context for specified window.
|
virtual |
Destructor.
|
protectedvirtual |
Makes GL context for this window active in current thread.
Reimplemented from OpenGl_Window.
|
inline |
|
inline |
|
protected |
Adds OpenGL groups to ray-traced scene geometry.
|
protected |
Adds OpenGL polygon array to ray-traced scene geometry.
|
protected |
Adds OpenGL primitive array to ray-traced scene geometry.
|
protected |
Adds OpenGL quadrangle array to ray-traced scene geometry.
|
protected |
Adds OpenGL quadrangle strip array to ray-traced scene geometry.
|
protected |
Adds OpenGL structure to ray-traced scene geometry.
|
protected |
Adds OpenGL triangle array to ray-traced scene geometry.
|
protected |
Adds OpenGL triangle fan array to ray-traced scene geometry.
|
protected |
Adds OpenGL triangle strip array to ray-traced scene geometry.
|
protected |
Adds vertex indices from OpenGL primitive array to ray-traced scene geometry.
|
inline |
|
inline |
Returns currently applied polygon offset params.
const OpenGl_AspectFace* OpenGl_Workspace::AspectFace | ( | const Standard_Boolean | theWithApply | ) |
const OpenGl_AspectLine* OpenGl_Workspace::AspectLine | ( | const Standard_Boolean | theWithApply | ) |
const OpenGl_AspectMarker* OpenGl_Workspace::AspectMarker | ( | const Standard_Boolean | theWithApply | ) |
const OpenGl_AspectText* OpenGl_Workspace::AspectText | ( | const Standard_Boolean | theWithApply | ) |
|
inline |
Standard_Boolean OpenGl_Workspace::BufferDump | ( | OpenGl_FrameBuffer * | theFBOPtr, |
Image_PixMap & | theImage, | ||
const Graphic3d_BufferType & | theBufferType | ||
) |
|
protected |
Checks to see if the structure is modified.
|
protected |
Copy content of Back buffer to the Front buffer.
|
protected |
Creates ray-tracing material properties.
Handle< OpenGl_Texture > OpenGl_Workspace::DisableTexture | ( | ) |
void OpenGl_Workspace::DisplayCallback | ( | const Graphic3d_CView & | theCView, |
int | theReason | ||
) |
Handle< OpenGl_Texture > OpenGl_Workspace::EnableTexture | ( | const Handle< OpenGl_Texture > & | theTexture, |
const Handle< Graphic3d_TextureParams > & | theParams = NULL |
||
) |
Graphic3d_PtrFrameBuffer OpenGl_Workspace::FBOCreate | ( | const Standard_Integer | theWidth, |
const Standard_Integer | theHeight | ||
) |
void OpenGl_Workspace::FBORelease | ( | Graphic3d_PtrFrameBuffer | theFBOPtr | ) |
|
protected |
Generates shader prefix based on current ray-tracing options.
|
inline |
Get rendering filter.
|
protected |
Initializes OpenGL/GLSL shader programs.
|
inline |
|
inline |
|
protected |
Loads and compiles shader object from specified source.
|
inline |
Standard_Boolean OpenGl_Workspace::Print | ( | const Handle< OpenGl_PrinterContext > & | thePrintContext, |
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.
|
inline |
|
protected |
Redraws the window using OpenGL/GLSL ray-tracing.
void OpenGl_Workspace::Redraw | ( | const Graphic3d_CView & | theCView, |
const Aspect_CLayer2d & | theCUnderLayer, | ||
const Aspect_CLayer2d & | theCOverLayer | ||
) |
Redraw the window.
|
protected |
void OpenGl_Workspace::RedrawImmediate | ( | const Graphic3d_CView & | theCView, |
const Aspect_CLayer2d & | theCUnderLayer, | ||
const Aspect_CLayer2d & | theCOverLayer, | ||
const Standard_Boolean | theToForce = Standard_False |
||
) |
|
protected |
Releases OpenGL/GLSL shader programs.
void OpenGl_Workspace::ResetAppliedAspect | ( | ) |
Clear the applied aspect state.
|
protected |
Resizes OpenGL frame buffers.
|
protected |
Runs ray-tracing shader programs.
|
protected |
Performs safe exit when shaders initialization fails.
|
inline |
const OpenGl_AspectFace* OpenGl_Workspace::SetAspectFace | ( | const OpenGl_AspectFace * | theAspect | ) |
const OpenGl_AspectLine* OpenGl_Workspace::SetAspectLine | ( | const OpenGl_AspectLine * | theAspect | ) |
const OpenGl_AspectMarker* OpenGl_Workspace::SetAspectMarker | ( | const OpenGl_AspectMarker * | theAspect | ) |
const OpenGl_AspectText* OpenGl_Workspace::SetAspectText | ( | const OpenGl_AspectText * | theAspect | ) |
Standard_Boolean OpenGl_Workspace::SetImmediateModeDrawToFront | ( | const Standard_Boolean | theDrawToFrontBuffer | ) |
void OpenGl_Workspace::SetPolygonOffset | ( | int | theMode, |
Standard_ShortReal | theFactor, | ||
Standard_ShortReal | theUnits | ||
) |
Sets and applies current polygon offset.
|
inline |
Set filter for restricting rendering of particular elements. Filter can be applied for rendering passes used by recursive rendering algorithms for rendering elements of groups.
theFilter | [in] the filter instance. |
const OpenGl_Matrix* OpenGl_Workspace::SetStructureMatrix | ( | const OpenGl_Matrix * | , |
bool | aRevert = false |
||
) |
|
inline |
|
protected |
|
protected |
Sets uniform state for the given ray-tracing shader program.
const OpenGl_Matrix* OpenGl_Workspace::SetViewMatrix | ( | const OpenGl_Matrix * | ) |
|
inline |
Returns a flag whether to redraw the scene using OpenGL rasterization.
|
protected |
Generates viewing rays for corners of screen quad.
|
protected |
const void OpenGl_Workspace::UpdateModelViewMatrix | ( | ) |
Updates current model-view matrix replacing it with StructureMatrixT*ViewMatrix from the workspace.
|
protected |
Updates environment map for ray-tracing.
|
protected |
Updates 3D scene geometry for ray-tracing.
|
protected |
Updates 3D scene light sources for ray-tracing.
|
protected |
Uploads ray-trace data to the GPU.
|
inline |
|
inline |
void OpenGl_Workspace::UseTransparency | ( | const Standard_Boolean | theFlag | ) |
|
inline |
|
inline |
|
protected |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
|
protected |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
|
protected |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
|
protected |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
|
protected |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
|
protected |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
|
protected |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
|
protected |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
const TEL_COLOUR* OpenGl_Workspace::HighlightColor |
|
protected |
optimization flag for immediate mode (to render directly to the front buffer)
|
protected |
PrimitiveArray to TriangleSet map for scene partial update.
|
protected |
Hiddenline aspect.
|
protected |
optimization flag for immediate mode (to render directly to the front buffer)
|
protected |
Result of shaders initialization.
|
protected |
back face culling mode, applied from face aspect
|
protected |
redraw counter, for debugging
|
protected |
Texture buffer of vertex normals.
|
protected |
Texture buffer of vertex UV coords.
|
protected |
Texture buffer of triangle indices.
|
protected |
Texture buffer of vertex coords.
|
protected |
frustum culling flag
|
protected |
flag indicates that immediate mode buffer contains some data
|
protected |
Is geometry data valid?
|
protected |
Warning about missing extension GL_ARB_bindless_texture has been displayed?
|
protected |
State of OpenGL layer list.
|
protected |
optimization flag for immediate mode (to render directly to the front buffer)
|
protected |
current back material state
|
protected |
current front material state (cached to reduce GL context updates)
|
protected |
temporary variable
|
protected |
Model matrix with applied structure transformations.
|
protected |
Texture buffer of maximum points of bottom-level BVH nodes.
|
protected |
Texture buffer of minimum points of bottom-level BVH nodes.
|
protected |
Texture buffer of data records of bottom-level BVH nodes.
|
protected |
Framebuffer (FBO) for pre-raytrace rendering by OpenGL.
|
protected |
OpenGL/GLSL adaptive-AA shader program.
|
protected |
OpenGL/GLSL adaptive-AA fragment shader.
|
protected |
OpenGL/GLSL source of adaptive-AA fragment shader.
|
protected |
optimization flag for immediate mode (to render directly to the front buffer)
|
protected |
Framebuffer (FBO) to perform adaptive FSAA.
|
protected |
Framebuffer (FBO) to perform adaptive FSAA.
|
protected |
Graphical ray-tracing filter to filter out all raytracable structures.
|
protected |
3D scene geometry data for ray-tracing.
|
protected |
Texture buffer of light source properties.
|
protected |
Texture buffer of material properties.
|
protected |
Compile-time ray-tracing parameters.
|
protected |
OpenGL/GLSL ray-tracing shader program.
|
protected |
Scene epsilon to prevent self-intersections.
|
protected |
Radius of bounding sphere of the scene.
|
protected |
Vertex buffer (VBO) for drawing dummy quad.
|
protected |
OpenGL/GLSL ray-tracing fragment shader.
|
protected |
OpenGL/GLSL source of ray-tracing fragment shader.
|
protected |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
|
protected |
Texture buffer of maximum points of high-level BVH nodes.
|
protected |
Texture buffer of minimum points of high-level BVH nodes.
|
protected |
Texture buffer of data records of high-level BVH nodes.
|
protected |
Texture buffer of transformations of high-level BVH nodes.
|
protected |
State of OpenGL structures reflected to ray-tracing.
|
protected |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
|
protected |
Redraw the scene using OpenGL rasterization or ray-tracing?
|
protected |
optimization flag for immediate mode (to render directly to the front buffer)
|
protected |
Cached locations of frequently used uniform variables.
|
protected |
optimization flag for immediate mode (to render directly to the front buffer)
|
protected |
optimization flag for immediate mode (to render directly to the front buffer)
|
protected |
optimization flag for immediate mode (to render directly to the front buffer)
|
protected |
optimization flag for immediate mode (to render directly to the front buffer)
|
protected |
optimization flag for immediate mode (to render directly to the front buffer)
|
protected |
State of OpenGL view.
Standard_Integer OpenGl_Workspace::NamedStatus |
|
protected |
Currently applied polygon offset.
|
protected |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
|
protected |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
|
protected |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)
|
staticprotected |
Default ray-tracing depth.
|
staticprotected |
Default size of traversal stack.
|
protected |
currently bound texture (managed by OpenGl_AspectFace and OpenGl_View environment texture)