#include <Aspect_CLayer2d.hxx>
#include <Aspect_Handle.hxx>
#include <Aspect_PrintAlgo.hxx>
+#include <Aspect_PolygonOffsetMode.hxx>
#include <InterfaceGraphic_Graphic3d.hxx>
#include <InterfaceGraphic_Visual3d.hxx>
#include <NCollection_Sequence.hxx>
#include <OpenGl_AspectFace.hxx>
-#include <OpenGl_Display.hxx>
#include <OpenGl_FrameBuffer.hxx>
#include <OpenGl_Matrix.hxx>
#include <OpenGl_NamedStatus.hxx>
#include <OpenGl_TextParam.hxx>
#include <OpenGl_RenderFilter.hxx>
#include <OpenGl_Vec.hxx>
+#include <OpenGl_LineAttributes.hxx>
#include <Handle_OpenGl_View.hxx>
#include <Handle_OpenGl_Texture.hxx>
public:
//! Main constructor - prepare GL context for specified window.
- OpenGl_Workspace (const Handle(OpenGl_Display)& theDisplay,
+ OpenGl_Workspace (const Handle(Aspect_DisplayConnection)& theDisplayConnection,
const CALL_DEF_WINDOW& theCWindow,
Aspect_RenderingContext theGContext,
const Handle(OpenGl_Caps)& theCaps,
Standard_Boolean& UseDepthTest() { return myUseDepthTest; }
Standard_Boolean& UseGLLight() { return myUseGLLight; }
+ Standard_Integer AntiAliasingMode() const { return myAntiAliasingMode; }
+
//// RELATED TO STATUS ////
Standard_Integer NamedStatus;
//! @return applied model structure matrix.
inline const OpenGl_Matrix* ModelMatrix() const { return StructureMatrix_applied; }
+ //! Sets and applies current polygon offset.
+ void SetPolygonOffset (int theMode, Standard_ShortReal theFactor, Standard_ShortReal theUnits);
+
+ //! Returns currently applied polygon offset params.
+ const TEL_POFFSET_PARAM& AppliedPolygonOffset() { return PolygonOffset_applied; }
+
protected:
//! Copy content of Back buffer to the Front buffer
};
+ //! Default ray-tracing depth.
+ static const Standard_Integer THE_DEFAULT_RAY_DEPTH = 3;
+
//! Default size of traversal stack.
static const Standard_Integer THE_DEFAULT_STACK_SIZE = 24;
+ //! Compile-time ray-tracing parameters.
+ struct RaytracingParams
+ {
+ //! Actual size of traversal stack in shader program.
+ Standard_Integer StackSize;
+
+ //! Actual ray-tracing depth (number of ray bounces).
+ Standard_Integer TraceDepth;
+
+ //! Sets light propagation through transparent media.
+ Standard_Boolean TransparentShadows;
+
+ //! Creates default compile-time ray-tracing parameters.
+ RaytracingParams()
+ : StackSize (THE_DEFAULT_STACK_SIZE),
+ TraceDepth (THE_DEFAULT_RAY_DEPTH),
+ TransparentShadows (Standard_False)
+ {
+ //
+ }
+ };
+
protected: //! @name methods related to ray-tracing
//! Updates 3D scene geometry for ray-tracing.
Standard_Boolean SafeFailBack (const TCollection_ExtendedString& theMessage);
//! Initializes OpenGL/GLSL shader programs.
- Standard_Boolean InitRaytraceResources();
+ Standard_Boolean InitRaytraceResources (const Graphic3d_CView& theCView);
//! Releases OpenGL/GLSL shader programs.
void ReleaseRaytraceResources();
//! Scene epsilon to prevent self-intersections.
Standard_ShortReal myRaytraceSceneEpsilon;
- //! Actual size of traversal stack in shader program.
- Standard_Integer myTraversalStackSize;
+ //! Compile-time ray-tracing parameters.
+ RaytracingParams myRaytraceParameters;
//! OpenGL/GLSL source of ray-tracing fragment shader.
ShaderSource myRaytraceShaderSource;
protected: //! @name protected fields
Handle(OpenGl_PrinterContext) myPrintContext;
- Handle(OpenGl_View) myView; // WSViews - now just one view is supported
+ Handle(OpenGl_View) myView;
+ Handle(OpenGl_LineAttributes) myLineAttribs;
+ Standard_Integer myAntiAliasingMode;
Standard_Boolean myTransientDrawToFront; //!< optimization flag for immediate mode (to render directly to the front buffer)
Standard_Boolean myBackBufferRestored;
Standard_Boolean myIsImmediateDrawn; //!< flag indicates that immediate mode buffer contains some data
OpenGl_Material myMatTmp; //!< temporary variable
TelCullMode myCullingMode; //!< back face culling mode, applied from face aspect
- //! Model matrix with applied structure transformations
- OpenGl_Matrix myModelViewMatrix;
+ OpenGl_Matrix myModelViewMatrix; //!< Model matrix with applied structure transformations
- const TEL_POFFSET_PARAM* PolygonOffset_applied;
+ TEL_POFFSET_PARAM PolygonOffset_applied; //!< Currently applied polygon offset.
- OpenGl_AspectFace myAspectFaceHl; // Hiddenline aspect
+ OpenGl_AspectFace myAspectFaceHl; //!< Hiddenline aspect
public: //! @name type definition