myReadBuffer (0),
myDrawBuffer (0),
myDefaultVao (0),
- myIsGlDebugCtx (Standard_False)
+ myIsGlDebugCtx (Standard_False),
+ myResolutionRatio (1.0f)
{
// system-dependent fields
#if defined(HAVE_EGL)
{
if (!myActiveProgram.IsNull())
{
- myActiveProgram->SetUniform (this, myActiveProgram->GetStateLocation (OpenGl_OCCT_POINT_SIZE), theSize);
+ myActiveProgram->SetUniform (this, myActiveProgram->GetStateLocation (OpenGl_OCCT_POINT_SIZE), theSize * myResolutionRatio);
#if !defined(GL_ES_VERSION_2_0)
//myContext->core11fwd->glEnable (GL_VERTEX_PROGRAM_POINT_SIZE);
#endif
#if !defined(GL_ES_VERSION_2_0)
//else
{
- core11fwd->glPointSize (theSize);
+ core11fwd->glPointSize (theSize * myResolutionRatio);
if (core20fwd != NULL)
{
//myContext->core11fwd->glDisable (GL_VERTEX_PROGRAM_POINT_SIZE);
Standard_EXPORT void DisableFeatures() const;
+ //! Set resolution ratio.
+ //! Note that this method rounds @theRatio to nearest integer.
+ void SetResolutionRatio (const Standard_ShortReal theRatio)
+ {
+ myResolutionRatio = Max (1.0f, std::floor (theRatio + 0.5f));
+ }
+
private:
//! Wrapper to system function to retrieve GL function pointer by name.
private: //! @name fields tracking current state
- Handle(OpenGl_ShaderProgram) myActiveProgram; //!< currently active GLSL program
- Handle(OpenGl_Sampler) myTexSampler; //!< currently active sampler object
- Handle(OpenGl_FrameBuffer) myDefaultFbo; //!< default Frame Buffer Object
- Standard_Integer myRenderMode; //!< value for active rendering mode
- Standard_Integer myReadBuffer; //!< current read buffer
- Standard_Integer myDrawBuffer; //!< current draw buffer
- unsigned int myDefaultVao; //!< default Vertex Array Object
- Standard_Boolean myIsGlDebugCtx; //!< debug context initialization state
- TCollection_AsciiString myVendor; //!< Graphics Driver's vendor
- TColStd_PackedMapOfInteger myFilters[6]; //!< messages suppressing filter (for sources from GL_DEBUG_SOURCE_API_ARB to GL_DEBUG_SOURCE_OTHER_ARB)
+ Handle(OpenGl_ShaderProgram) myActiveProgram; //!< currently active GLSL program
+ Handle(OpenGl_Sampler) myTexSampler; //!< currently active sampler object
+ Handle(OpenGl_FrameBuffer) myDefaultFbo; //!< default Frame Buffer Object
+ Standard_Integer myRenderMode; //!< value for active rendering mode
+ Standard_Integer myReadBuffer; //!< current read buffer
+ Standard_Integer myDrawBuffer; //!< current draw buffer
+ unsigned int myDefaultVao; //!< default Vertex Array Object
+ Standard_Boolean myIsGlDebugCtx; //!< debug context initialization state
+ TCollection_AsciiString myVendor; //!< Graphics Driver's vendor
+ TColStd_PackedMapOfInteger myFilters[6]; //!< messages suppressing filter (for sources from GL_DEBUG_SOURCE_API_ARB to GL_DEBUG_SOURCE_OTHER_ARB)
+ Standard_ShortReal myResolutionRatio; //!< scaling factor for parameters like text size
+ //!< to be properly displayed on device (screen / printer)
public:
--- /dev/null
+puts "============"
+puts "OCC26790 apply view resolution to built-in markers"
+puts "============"
+puts ""
+pload VISUALIZATION
+
+vclear
+vclose all
+
+vinit View1
+
+for { set aMarkerType 0 } { $aMarkerType < 13 } { incr aMarkerType } {
+ set aRow [expr $aMarkerType - 7]
+ set aCol 5
+ vmarkerstest m${aMarkerType} $aCol $aRow 0 MarkerType=$aMarkerType PointsOnSide=1
+}
+
+vright
+vfit
+
+vdump $imagedir/${casename}_1.png
+
+vrenderparams -resolution 144
+
+vdump $imagedir/${casename}_2.png