]> OCCT Git - occt-copy.git/commitdiff
0031278: Visualization - display elements above transparent area
authornds <nds@opencascade.com>
Mon, 30 Dec 2019 10:07:57 +0000 (13:07 +0300)
committernds <nds@opencascade.com>
Mon, 30 Dec 2019 10:07:57 +0000 (13:07 +0300)
# comment DEBUG_INFO as it leads to poor performance, restore some commented code in text

src/OpenGl/OpenGl_Group.cxx
src/OpenGl/OpenGl_LayerList.cxx
src/OpenGl/OpenGl_PrimitiveArray.cxx
src/OpenGl/OpenGl_Structure.cxx
src/OpenGl/OpenGl_Text.cxx
src/OpenGl/OpenGl_View_Redraw.cxx
src/OpenGl/OpenGl_Workspace.cxx

index 1fe886273fb21d55300937256cd34aba5cf843a7..8c6f0ff4d02676ed7ed72a055dd7fb379c0774df 100644 (file)
@@ -28,7 +28,7 @@
 #include <Graphic3d_AspectFillCapping.hxx>
 #include <Graphic3d_GroupDefinitionError.hxx>
 
-#define DEBUG_INFO
+//#define DEBUG_INFO
 #ifdef DEBUG_INFO
 #include <Message_Alerts.hxx>
 #include <Message_PerfMeter.hxx>
index f1188f5847bc23bf5006554e90b3851a7c3ad873..3b8d2c3021f08d500f7955d9f898e5875cb96b4c 100644 (file)
@@ -26,7 +26,7 @@
 
 #include <Graphic3d_GraphicDriver.hxx>
 
-#define DEBUG_INFO
+//#define DEBUG_INFO
 #ifdef DEBUG_INFO
 #include <Message_Alerts.hxx>
 #include <Message_PerfMeter.hxx>
index 93473710cdaab271f7b5b546d35d211995cc1b89..5573c7ff1df45b9db50f233ad224938abef35eca 100644 (file)
@@ -29,7 +29,7 @@
 #include <Graphic3d_TextureParams.hxx>
 #include <NCollection_AlignedAllocator.hxx>
 
-#define DEBUG_INFO
+//#define DEBUG_INFO
 #ifdef DEBUG_INFO
 #include <Message_Alerts.hxx>
 #include <Message_PerfMeter.hxx>
index f81e5eedc20d759ea6f050c3eb60390bce8f8ce2..a552a33ff2b7547055fe2a8308314c53aa522e6b 100644 (file)
@@ -25,7 +25,7 @@
 #include <OpenGl_View.hxx>
 #include <OpenGl_Workspace.hxx>
 
-#define DEBUG_INFO
+//#define DEBUG_INFO
 #ifdef DEBUG_INFO
 #include <Message_Alerts.hxx>
 #include <Message_PerfMeter.hxx>
@@ -389,8 +389,10 @@ void OpenGl_Structure::Clear (const Handle(OpenGl_Context)& theGlCtx)
 void OpenGl_Structure::renderGeometry (const Handle(OpenGl_Workspace)& theWorkspace,
                                        bool&                           theHasClosed) const
 {
+#ifdef DEBUG_INFO
   Message_PerfMeter aPerfMeter;
   MESSAGE_INFO("OpenGl_Structure::renderGeometry", "", &aPerfMeter, NULL)
+#endif
 
   if (myInstancedStructure != NULL)
   {
index eaf07a1d76909be461b21dcf842496ad4b9bb019..2fe1563ea0d4b1ed40e9950f58c5a140f7d459f0 100644 (file)
@@ -30,7 +30,7 @@
 #include <Graphic3d_TransformUtils.hxx>
 #include <TCollection_HAsciiString.hxx>
 
-#define DEBUG_INFO
+//#define DEBUG_INFO
 #ifdef DEBUG_INFO
 #include <Message_Alerts.hxx>
 #include <Message_PerfMeter.hxx>
@@ -285,7 +285,6 @@ void OpenGl_Text::StringSize (const Handle(OpenGl_Context)& theCtx,
 // =======================================================================
 void OpenGl_Text::Render (const Handle(OpenGl_Workspace)& theWorkspace) const
 {
-
 #ifdef DEBUG_INFO
   Message_PerfMeter aPerfMeter;
 
@@ -293,8 +292,10 @@ void OpenGl_Text::Render (const Handle(OpenGl_Workspace)& theWorkspace) const
   DumpJson (aGroupStream);
   MESSAGE_INFO_STREAM (aGroupStream, "OpenGl_Text::Render", "", &aPerfMeter, NULL)
   Handle(Message_Alert) aParentAlert = OCCT_Message_Alert;
-
+#endif
   const OpenGl_Aspects* aTextAspect = theWorkspace->ApplyAspects();
+
+#ifdef DEBUG_INFO
   aGroupStream.str("");
   aTextAspect->DumpJson (aGroupStream);
   MESSAGE_INFO_STREAM (aGroupStream, "aTextAspect", "", &aPerfMeter, aParentAlert)
@@ -356,7 +357,7 @@ void OpenGl_Text::Render (const Handle(OpenGl_Context)& theCtx,
                           unsigned int theResolution) const
 {
 #if !defined(GL_ES_VERSION_2_0)
-  const Standard_Integer aPrevPolygonMode  = theCtx->SetPolygonMode (GL_FILL && GL_LINE && GL_POINT);
+  const Standard_Integer aPrevPolygonMode  = theCtx->SetPolygonMode (GL_FILL);
   const bool             aPrevHatchingMode = theCtx->SetPolygonHatchEnabled (false);
 #endif
 
@@ -806,10 +807,10 @@ void OpenGl_Text::render (const Handle(OpenGl_Context)& theCtx,
     }
     case Aspect_TODT_SHADOW:
     {
-      //BackPolygonOffsetSentry aPolygonOffsetTmp (hasDepthTest ? theCtx : Handle(OpenGl_Context)());
-      //theCtx->SetColor4fv (theColorSubs);
-      //setupMatrix (theCtx, theTextAspect, OpenGl_Vec3 (+1.0f, -1.0f, 0.0f));
-      //drawText    (theCtx, theTextAspect);
+      BackPolygonOffsetSentry aPolygonOffsetTmp (hasDepthTest ? theCtx : Handle(OpenGl_Context)());
+      theCtx->SetColor4fv (theColorSubs);
+      setupMatrix (theCtx, theTextAspect, OpenGl_Vec3 (+1.0f, -1.0f, 0.0f));
+      drawText    (theCtx, theTextAspect);
       break;
     }
     case Aspect_TODT_DIMENSION:
@@ -864,16 +865,16 @@ void OpenGl_Text::render (const Handle(OpenGl_Context)& theCtx,
   #endif
     const bool aColorMaskBack = theCtx->SetColorMask (false);
 
-    //glClear (GL_STENCIL_BUFFER_BIT);
-    //glEnable (GL_STENCIL_TEST);
-    //glStencilFunc (GL_ALWAYS, 1, 0xFF);
-    //glStencilOp (GL_KEEP, GL_KEEP, GL_REPLACE);
+    glClear (GL_STENCIL_BUFFER_BIT);
+    glEnable (GL_STENCIL_TEST);
+    glStencilFunc (GL_ALWAYS, 1, 0xFF);
+    glStencilOp (GL_KEEP, GL_KEEP, GL_REPLACE);
 
-    //drawRect (theCtx, theTextAspect, OpenGl_Vec4 (1.0f, 1.0f, 1.0f, 1.0f));
+    drawRect (theCtx, theTextAspect, OpenGl_Vec4 (1.0f, 1.0f, 1.0f, 1.0f));
 
-    //glStencilFunc (GL_ALWAYS, 0, 0xFF);
+    glStencilFunc (GL_ALWAYS, 0, 0xFF);
 
-    //theCtx->SetColorMask (aColorMaskBack);
+    theCtx->SetColorMask (aColorMaskBack);
   }
 
   // reset OpenGL state
index c4a54e30baa5031f9159ffa76724ddd9f5329aea..1fd9aab95af2a165b9ed4f8212fea8964f33c060 100644 (file)
@@ -39,7 +39,7 @@
 #include <OpenGl_Structure.hxx>
 #include <OpenGl_ArbFBO.hxx>
 
-#define DEBUG_INFO
+//#define DEBUG_INFO
 #ifdef DEBUG_INFO
 #include <Message_Alerts.hxx>
 #include <Message_PerfMeter.hxx>
index d05046ea25bae0a689d8c44710e4b36886314654..a9032de1f27cf4e094d1123e83045a026c2ebcf9 100644 (file)
@@ -33,7 +33,7 @@
 #include <Graphic3d_TransformUtils.hxx>
 #include <NCollection_AlignedAllocator.hxx>
 
-#define DEBUG_INFO
+//#define DEBUG_INFO
 #ifdef DEBUG_INFO
 #include <Message_Alerts.hxx>
 #include <Message_PerfMeter.hxx>