#define _Font_Rect_H__
#include <NCollection_Vec2.hxx>
+#include <Standard_Dump.hxx>
//! Auxiliary POD structure - 2D rectangle definition.
struct Font_Rect
return Top - Bottom;
}
+ //! Dumps the content of me into the stream
+ void DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
+ {
+ OCCT_DUMP_CLASS_BEGIN (theOStream, Font_Rect);
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Left);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Right);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Top);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Bottom);
+ }
};
#endif // _Font_Rect_H__
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsTextZoomable);
/*Aspect_InteriorStyle myInteriorStyle;
- Graphic3d_TypeOfShadingModel myShadingModel;
- Graphic3d_AlphaMode myAlphaMode;
- Standard_ShortReal myAlphaCutoff;
+ Graphic3d_TypeOfShadingModel myShadingModel;*/
- Aspect_TypeOfLine myLineType;
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAlphaMode);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAlphaCutoff);
+
+ /*Aspect_TypeOfLine myLineType;
Standard_ShortReal myLineWidth;
Aspect_TypeOfMarker myMarkerType;
{
OCCT_DUMP_CLASS_BEGIN (theOStream, Graphic3d_Group);
+ OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, this);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsClosed);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myContainsFacet);
}
{
OCCT_DUMP_CLASS_BEGIN (theOStream, Graphic3d_Layer);
+ OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, this);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myLayerId);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myNbStructures);
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myNbStructuresNotCulled);
{
OCCT_DUMP_CLASS_BEGIN (theOStream, OpenGl_Context)
+ //Handle(OpenGl_ResourcesMap) mySharedResources;
+ //Handle(OpenGl_DelayReleaseMap) myDelayed;
+ //Handle(OpenGl_ResourcesStack) myUnusedResources;
+ //OpenGl_Clipping myClippingState;
+ //void* myGlLibHandle;
+ //NCollection_Handle<OpenGl_GlFunctions> myFuncs;
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAnisoMax);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTexClamp);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myMaxTexDim);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myMaxTexCombined);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myMaxDumpSizeX);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myMaxDumpSizeY);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myMaxClipPlanes);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myMaxMsaaSamples);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myMaxDrawBuffers);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myMaxColorAttachments);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myGlVerMajor);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myGlVerMinor);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsInitialized);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsStereoBuffers);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsGlNormalizeEnabled);
+
+ //Graphic3d_TextureUnit mySpriteTexUnit;
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasRayTracing);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasRayTracingTextures);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasRayTracingAdaptiveSampling);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myHasRayTracingAdaptiveSamplingAtomic);
+
+ //Handle(OpenGl_ShaderManager) myShaderManager;
+ //Handle(Font_TextFormatter) myDefaultFormatter;
+
+ //Handle(OpenGl_FrameStats) myFrameStats;
+ //Handle(OpenGl_ShaderProgram) myActiveProgram;
+ //Handle(OpenGl_TextureSet) myActiveTextures;
+
+ //Handle(OpenGl_FrameBuffer) myDefaultFbo;
+ //Handle(OpenGl_LineAttributes) myHatchStyles;
+
+ for (int i = 0; i < 4; i++)
+ {
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myViewport[i]);
+ }
+
+ for (int i = 0; i < 4; i++)
+ {
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myViewportVirt[i]);
+ }
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myPointSpriteOrig);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myRenderMode);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myPolygonMode);
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPolygonOffset)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToCullBackFaces);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myReadBuffer);
+
+ //NCollection_Array1<Standard_Integer> myDrawBuffers;
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDefaultVao);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myColorMask);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAllowAlphaToCov);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myAlphaToCoverage);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsGlDebugCtx);
+
+ //TCollection_AsciiString myVendor;
+ //TColStd_PackedMapOfInteger myFilters[6];
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myResolution);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myResolutionRatio);
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myLineWidthScale);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myLineFeather);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myRenderScale);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myRenderScaleInv);
+
+ //OpenGl_Material myMatFront;
+ //OpenGl_Material myMatBack;
+
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &ModelWorldState)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &WorldViewState)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &ProjectionState)
}
+
+// =======================================================================
+// function : DumpJsonOpenGl
+// purpose :
+// =======================================================================
+void OpenGl_Context::DumpJsonOpenGl (Standard_OStream& theOStream, const Standard_Integer)
+{
+ GLboolean isEnableBlend = glIsEnabled (GL_BLEND);
+ GLboolean isEnableCullFace = glIsEnabled (GL_CULL_FACE);
+ GLboolean isEnableDepthTest = glIsEnabled (GL_DEPTH_TEST);
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, isEnableBlend);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, isEnableCullFace);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, isEnableDepthTest);
+}
+
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const;
+
+ //! Dumps the content of openGL into the stream
+ static Standard_EXPORT void DumpJsonOpenGl (Standard_OStream& theOStream, const Standard_Integer theDepth = -1);
private:
#include <OpenGl_Element.hxx>
+#include <Standard_Dump.hxx>
+
// =======================================================================
// function : OpenGl_Element
// purpose :
{
//
}
+
+// =======================================================================
+// function : DumpJson
+// purpose :
+// =======================================================================
+void OpenGl_Element::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
+{
+ OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, this);
+}
virtual void SynchronizeAspects() {}
//! Dumps the content of me into the stream
- virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const
- { (void)theOStream; (void)theDepth; }
+ Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const;
protected:
#include <Graphic3d_AspectFillCapping.hxx>
#include <Graphic3d_GroupDefinitionError.hxx>
+#define DEBUG_INFO
+#ifdef DEBUG_INFO
+#include <Message_Alerts.hxx>
+#include <Message_PerfMeter.hxx>
+#endif // DEBUG_INFO
+
IMPLEMENT_STANDARD_RTTIEXT(OpenGl_Group,Graphic3d_Group)
namespace
// =======================================================================
void OpenGl_Group::Render (const Handle(OpenGl_Workspace)& theWorkspace) const
{
+
+#ifdef DEBUG_INFO
+ Message_PerfMeter aPerfMeter;
+
+ Standard_SStream aGroupStream;
+ DumpJson (aGroupStream);
+ MESSAGE_INFO_OBJECT(this, aGroupStream, "OpenGl_Group::Render", "", &aPerfMeter, NULL)
+ Handle(Message_Alert) aParentAlert = OCCT_Message_Alert;
+
+ Standard_SStream aContextStream;
+ theWorkspace->GetGlContext()->DumpJson (aContextStream);
+ MESSAGE_INFO_OBJECT(this, aContextStream, "Context", "", &aPerfMeter, aParentAlert)
+#endif
+
// Setup aspects
theWorkspace->SetAllowFaceCulling (myIsClosed
&& !theWorkspace->GetGlContext()->Clipping().IsClippingOrCappingOn());
const OpenGl_Aspects* aBackAspects = theWorkspace->Aspects();
const bool isAspectSet = myAspects != NULL && renderFiltered (theWorkspace, myAspects);
-
+
// Render group elements
for (OpenGl_ElementNode* aNodeIter = myFirst; aNodeIter != NULL; aNodeIter = aNodeIter->next)
{
#include <Graphic3d_GraphicDriver.hxx>
+#define DEBUG_INFO
+#ifdef DEBUG_INFO
+#include <Message_Alerts.hxx>
+#include <Message_PerfMeter.hxx>
+#endif
+
namespace
{
//! Auxiliary class extending sequence iterator with index.
}
}
+// =======================================================================
+// function : DumpJson
+// purpose :
+// =======================================================================
+void OpenGl_LayerList::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
+{
+ OCCT_DUMP_CLASS_BEGIN (theOStream, OpenGl_LayerList);
+
+ for (NCollection_List<Handle(Graphic3d_Layer)>::Iterator aLayersIt (myLayers); aLayersIt.More(); aLayersIt.Next())
+ {
+ Handle(Graphic3d_Layer) aLayerId = aLayersIt.Value();
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aLayerId.get());
+ }
+
+
+ /*
+ NCollection_List<Handle(Graphic3d_Layer)> myLayers;
+ NCollection_DataMap<Graphic3d_ZLayerId, Handle(Graphic3d_Layer)> myLayerIds;
+ Handle(Select3D_BVHBuilder3d) myBVHBuilder; //!< BVH tree builder for frustom culling
+ */
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myNbPriorities);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myNbStructures);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myImmediateNbStructures);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myModifStateOfRaytraceable);
+
+ /*
+ //! Collection of references to layers with transparency gathered during rendering pass.
+ mutable OpenGl_LayerStack myTransparentToProcess;
+ */
+}
+
//=======================================================================
//function : InsertLayerBefore
//purpose :
const OpenGl_GlobalLayerSettings& theDefaultSettings,
const Graphic3d_Layer& theLayer) const
{
+#ifdef DEBUG_INFO
+ Message_PerfMeter aPerfMeter;
+ MESSAGE_INFO("OpenGl_LayerList::renderLayer", "", &aPerfMeter, NULL)
+#endif
+
const Handle(OpenGl_Context)& aCtx = theWorkspace->GetGlContext();
const Graphic3d_ZLayerSettings& aLayerSettings = theLayer.LayerSettings();
return;
}
+#ifdef DEBUG_INFO
+ Message_PerfMeter aPerfMeter;
+ MESSAGE_INFO("OpenGl_LayerList::renderTransparent", "", &aPerfMeter, NULL)
+#endif
+
const Handle(OpenGl_Context) aCtx = theWorkspace->GetGlContext();
const Handle(OpenGl_ShaderManager)& aManager = aCtx->ShaderManager();
OpenGl_View* aView = theWorkspace->View();
//! Assigns BVH tree builder for frustom culling.
void SetFrustumCullingBVHBuilder (const Handle(Select3D_BVHBuilder3d)& theBuilder);
+ //! Dumps the content of me into the stream
+ Standard_EXPORT void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const;
+
protected:
//! Stack of references to existing layers of predefined maximum size.
#include <Graphic3d_TextureParams.hxx>
#include <NCollection_AlignedAllocator.hxx>
+#define DEBUG_INFO
+#ifdef DEBUG_INFO
+#include <Message_Alerts.hxx>
+#include <Message_PerfMeter.hxx>
+#endif // DEBUG_INFO
+
namespace
{
//! Convert data type to GL info
return;
}
+#ifdef DEBUG_INFO
+ Message_PerfMeter aPerfMeter;
+ Standard_SStream aGroupStream;
+ DumpJson (aGroupStream);
+ MESSAGE_INFO_STREAM(aGroupStream, "OpenGl_PrimitiveArray::Render", Standard_Dump::GetPointerInfo(this), &aPerfMeter, NULL)
+#endif
+
const OpenGl_Aspects* anAspectFace = theWorkspace->ApplyAspects();
const Handle(OpenGl_Context)& aCtx = theWorkspace->GetGlContext();
//! Returns estimated GPU memory usage for holding data without considering overheads and allocation alignment rules.
virtual Standard_Size EstimatedDataSize() const = 0;
+ //! Dumps the content of me into the stream
+ virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const
+ { (void)theOStream; (void)theDepth; };
+
private:
//! Copy should be performed only within Handles!
#include <OpenGl_View.hxx>
#include <OpenGl_Workspace.hxx>
+#define DEBUG_INFO
+#ifdef DEBUG_INFO
+#include <Message_Alerts.hxx>
+#include <Message_PerfMeter.hxx>
+#endif
+
IMPLEMENT_STANDARD_RTTIEXT(OpenGl_Structure,Graphic3d_CStructure)
// =======================================================================
void OpenGl_Structure::renderGeometry (const Handle(OpenGl_Workspace)& theWorkspace,
bool& theHasClosed) const
{
+ Message_PerfMeter aPerfMeter;
+ MESSAGE_INFO("OpenGl_Structure::renderGeometry", "", &aPerfMeter, NULL)
+
if (myInstancedStructure != NULL)
{
myInstancedStructure->renderGeometry (theWorkspace, theHasClosed);
#include <Graphic3d_TransformUtils.hxx>
#include <TCollection_HAsciiString.hxx>
+#define DEBUG_INFO
+#ifdef DEBUG_INFO
+#include <Message_Alerts.hxx>
+#include <Message_PerfMeter.hxx>
+#endif
+
namespace
{
static const OpenGl_Mat4d THE_IDENTITY_MATRIX;
// =======================================================================
void OpenGl_Text::Render (const Handle(OpenGl_Workspace)& theWorkspace) const
{
+
+#ifdef DEBUG_INFO
+ Message_PerfMeter aPerfMeter;
+
+ Standard_SStream aGroupStream;
+ DumpJson (aGroupStream);
+ MESSAGE_INFO_STREAM (aGroupStream, "OpenGl_Text::Render", "", &aPerfMeter, NULL)
+ Handle(Message_Alert) aParentAlert = OCCT_Message_Alert;
+
const OpenGl_Aspects* aTextAspect = theWorkspace->ApplyAspects();
+ aGroupStream.str("");
+ aTextAspect->DumpJson (aGroupStream);
+ MESSAGE_INFO_STREAM (aGroupStream, "aTextAspect", "", &aPerfMeter, aParentAlert)
+
+ aGroupStream.str("");
+ OpenGl_Context::DumpJsonOpenGl (aGroupStream);
+ MESSAGE_INFO_STREAM (aGroupStream, "openGl_parameters1", "", &aPerfMeter, aParentAlert)
+#endif
+
const Handle(OpenGl_Context)& aCtx = theWorkspace->GetGlContext();
const Handle(OpenGl_TextureSet) aPrevTexture = aCtx->BindTextures (Handle(OpenGl_TextureSet)());
{
glEnable (GL_DEPTH_TEST);
}
+
+#ifdef DEBUG_INFO
+ aGroupStream.str("");
+ OpenGl_Context::DumpJsonOpenGl (aGroupStream);
+ MESSAGE_INFO_STREAM (aGroupStream, "openGl_parameters2", "", &aPerfMeter, aParentAlert)
+#endif
}
// =======================================================================
unsigned int theResolution) const
{
#if !defined(GL_ES_VERSION_2_0)
- const Standard_Integer aPrevPolygonMode = theCtx->SetPolygonMode (GL_FILL);
+ const Standard_Integer aPrevPolygonMode = theCtx->SetPolygonMode (GL_FILL && GL_LINE && GL_POINT);
const bool aPrevHatchingMode = theCtx->SetPolygonHatchEnabled (false);
#endif
return;
}
+#ifdef DEBUG_INFO
+ Message_PerfMeter aPerfMeter;
+
+ Standard_SStream aGroupStream;
+ OpenGl_Context::DumpJsonOpenGl (aGroupStream);
+ MESSAGE_INFO_STREAM (aGroupStream, "openGl_parameters3", "", &aPerfMeter, NULL)
+#endif
+
// Note that using difference resolution in different Views in same Viewer
// will lead to performance regression (for example, text will be recreated every time).
const TCollection_AsciiString aFontKey = FontKey (theTextAspect, (Standard_Integer)myText->Height(), theResolution);
}
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:
}
}
+#ifdef DEBUG_INFO
+ aGroupStream.str("");
+ OpenGl_Context::DumpJsonOpenGl (aGroupStream);
+ MESSAGE_INFO_STREAM (aGroupStream, "openGl_parameters4", "", &aPerfMeter, NULL)
+#endif
+
// main draw call
theCtx->SetColor4fv (theColorText);
setupMatrix (theCtx, theTextAspect, OpenGl_Vec3 (0.0f, 0.0f, 0.0f));
theCtx->ApplyProjectionMatrix();
}
+#ifdef DEBUG_INFO
+ aGroupStream.str("");
+ OpenGl_Context::DumpJsonOpenGl (aGroupStream);
+ MESSAGE_INFO_STREAM (aGroupStream, "openGl_parameters5", "", &aPerfMeter, NULL)
+#endif
+
#if !defined(GL_ES_VERSION_2_0)
if (theCtx->core11 != NULL)
{
#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
//OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myAspect.get());
//OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myShadingModel);
+
//Handle(Graphic3d_Text) myText; //!< text parameters
//mutable Handle(OpenGl_Font) myFont;
+
//mutable NCollection_Vector<GLuint> myTextures; //!< textures' IDs
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTextures.Size());
+
//mutable NCollection_Vector<Handle(OpenGl_VertexBuffer)> myVertsVbo; //!< VBOs of vertices
- //mutable NCollection_Vector<Handle(OpenGl_VertexBuffer)> myTCrdsVbo; //!< VBOs of texture coordinates
+ for (NCollection_Vector<Handle(OpenGl_VertexBuffer)>::Iterator aCrdsIt (myTCrdsVbo); aCrdsIt.More(); aCrdsIt.Next())
+ {
+ Handle(OpenGl_VertexBuffer) aVertexBuffer = aCrdsIt.Value();
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aVertexBuffer.get());
+ }
//mutable Handle(OpenGl_VertexBuffer) myBndVertsVbo;//!< VBOs of vertices for bounding box
- //mutable Font_Rect myBndBox;
+
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myBndBox);
+
//mutable OpenGl_Mat4d myProjMatrix;
//mutable OpenGl_Mat4d myModelMatrix;
//mutable OpenGl_Mat4d myOrientationMatrix;
theCtx->ShaderManager()->UpdateMaterialState();
}
#endif
+
+
+// =======================================================================
+// function : DumpJson
+// purpose :
+// =======================================================================
+void OpenGl_VertexBuffer::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
+{
+ OCCT_DUMP_CLASS_BEGIN (theOStream, OpenGl_VertexBuffer)
+
+ OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myOffset);
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myBufferId);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myComponentsNb);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myElemsNb);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDataType);
+}
//! Unbind all vertex attributes. Default implementation does nothing.
Standard_EXPORT virtual void UnbindAllAttributes (const Handle(OpenGl_Context)& theGlCtx) const;
+ //! Dumps the content of me into the stream
+ Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const;
+
protected:
GLubyte* myOffset; //!< offset to data
#include <OpenGl_Structure.hxx>
#include <OpenGl_ArbFBO.hxx>
+#define DEBUG_INFO
+#ifdef DEBUG_INFO
+#include <Message_Alerts.hxx>
+#include <Message_PerfMeter.hxx>
+#endif
+
namespace
{
//! Format Frame Buffer format for logging messages.
return;
}
+#ifdef DEBUG_INFO
+ Message_PerfMeter aPerfMeter;
+ MESSAGE_INFO("OpenGl_View::Redraw", "", &aPerfMeter, NULL)
+#endif
+
myWindow->SetSwapInterval();
++myFrameCounter;
return;
}
+#ifdef DEBUG_INFO
+ Message_PerfMeter aPerfMeter;
+ MESSAGE_INFO("OpenGl_View::RedrawImmediate", "", &aPerfMeter, NULL)
+#endif
+
const Graphic3d_StereoMode aStereoMode = myRenderParams.StereoMode;
Graphic3d_Camera::Projection aProjectType = myCamera->ProjectionType();
OpenGl_FrameBuffer* aFrameBuffer = myFBO.get();
OpenGl_FrameBuffer* theReadDrawFbo,
OpenGl_FrameBuffer* theOitAccumFbo)
{
+
+#ifdef DEBUG_INFO
+ Message_PerfMeter aPerfMeter;
+ MESSAGE_INFO("OpenGl_View::redraw", "", &aPerfMeter, NULL)
+#endif
+
Handle(OpenGl_Context) aCtx = myWorkspace->GetGlContext();
if (theReadDrawFbo != NULL)
{
OpenGl_FrameBuffer* theOitAccumFbo,
const Standard_Boolean theIsPartialUpdate)
{
+#ifdef DEBUG_INFO
+ Message_PerfMeter aPerfMeter;
+ MESSAGE_INFO("OpenGl_View::redrawImmediate", "", &aPerfMeter, NULL)
+#endif
+
Handle(OpenGl_Context) aCtx = myWorkspace->GetGlContext();
GLboolean toCopyBackToFront = GL_FALSE;
if (theDrawFbo == theReadFbo
// Step 1: Prepare for render
// ==================================
+#ifdef DEBUG_INFO
+ Message_PerfMeter aPerfMeter;
+ MESSAGE_INFO("OpenGl_View::render", "", &aPerfMeter, NULL)
+#endif
+
const Handle(OpenGl_Context)& aContext = myWorkspace->GetGlContext();
aContext->SetAllowSampleAlphaToCoverage (myRenderParams.ToEnableAlphaToCoverage
&& theOutputFBO != NULL
if ( myZLayers.NbStructures() <= 0 )
return;
+#ifdef DEBUG_INFO
+ Message_PerfMeter aPerfMeter;
+ MESSAGE_INFO("OpenGl_View::renderStructs", "", &aPerfMeter, NULL)
+#endif
+
Handle(OpenGl_Context) aCtx = myWorkspace->GetGlContext();
Standard_Boolean toRenderGL = theToDrawImmediate ||
myRenderParams.Method != Graphic3d_RM_RAYTRACING ||
OpenGl_FrameBuffer* theOitAccumFbo,
const Standard_Boolean theToDrawImmediate)
{
+
+#ifdef DEBUG_INFO
+ Message_PerfMeter aPerfMeter;
+ MESSAGE_INFO("OpenGl_View::renderScene", "", &aPerfMeter, NULL)
+#endif
+
const Handle(OpenGl_Context)& aContext = myWorkspace->GetGlContext();
// Specify clipping planes in view transformation space
#include <Graphic3d_TransformUtils.hxx>
#include <NCollection_AlignedAllocator.hxx>
+#define DEBUG_INFO
+#ifdef DEBUG_INFO
+#include <Message_Alerts.hxx>
+#include <Message_PerfMeter.hxx>
+#endif // DEBUG_INFO
+
IMPLEMENT_STANDARD_RTTIEXT(OpenGl_Workspace,Standard_Transient)
namespace
// =======================================================================
bool OpenGl_Workspace::ShouldRender (const OpenGl_Element* theElement)
{
+#ifdef DEBUG_INFO
+ Message_PerfMeter aPerfMeter;
+
+ Standard_SStream aWorkspaceStream;
+ DumpJson (aWorkspaceStream);
+ MESSAGE_INFO_OBJECT(this, aWorkspaceStream, "Workspace", "", &aPerfMeter, NULL)
+#endif
+
// render only non-raytracable elements when RayTracing is enabled
if ((myRenderFilter & OpenGl_RenderFilter_NonRaytraceableOnly) != 0)
{
}
return true;
}
+
+// =======================================================================
+// function : DumpJson
+// purpose :
+// =======================================================================
+void OpenGl_Workspace::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
+{
+ OCCT_DUMP_CLASS_BEGIN (theOStream, OpenGl_Workspace);
+
+ //OpenGl_View* myView;
+ //Handle(OpenGl_Window) myWindow;
+ //Handle(OpenGl_Context) myGlContext;
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myUseZBuffer);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myUseDepthWrite);
+
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myNoneCulling);
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myFrontCulling);
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myNbSkippedTranspElems);
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myRenderFilter);
+
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myDefaultAspects);
+
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myAspectsSet);
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myAspectsApplied.get());
+ //Handle(Graphic3d_PresentationAttributes) myAspectFaceAppliedWithHL;
+
+ //const OpenGl_Matrix* ViewMatrix_applied;
+ //const OpenGl_Matrix* StructureMatrix_applied;
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToAllowFaceCulling);
+ //Handle(Graphic3d_PresentationAttributes) myHighlightStyle;
+ //OpenGl_Matrix myModelViewMatrix;
+
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myAspectFaceHl);
+ //Handle(OpenGl_TextureSet) myEnvironmentTexture;
+}
//! Returns environment texture.
const Handle(OpenGl_TextureSet)& EnvironmentTexture() const { return myEnvironmentTexture; }
+ //! Dumps the content of me into the stream
+ Standard_EXPORT void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const;
+
protected: //! @name protected fields
OpenGl_View* myView;
MESSAGE_INFO_STREAM(aStream, "Quantity_Color", "", &aPerfMeter, NULL);
}
+ // stream of some table values
+ {
+ Standard_SStream aStream;
+ OCCT_DUMP_FIELD_VALUES_NUMERICAL (aStream, "value_1", 1, 100);
+ OCCT_DUMP_FIELD_VALUES_STRING (aStream, "value_2", 2, "value_1", "value_2");
+
+ MESSAGE_INFO_STREAM(aStream, "Table: Name to value", "", &aPerfMeter, NULL);
+ }
+
// SHAPE messages
{
BRepBuilderAPI_MakeEdge aBuilder (gp_Pnt (0., 0., 0.), gp_Pnt (20., 10., 20.));
}
return QVariant();
}
+
+// ======================================================================
+// function : initStream
+// purpose :
+// =======================================================================
+void VInspector_ItemOpenGlLayerList::initStream (Standard_OStream& theOStream) const
+{
+ Standard_Boolean isDefault;
+ const OpenGl_LayerList& aListOfLayers = GetLayerList (isDefault);
+ if (isDefault)
+ return;
+ aListOfLayers.DumpJson (theOStream);
+}
+
// =======================================================================
// function : createChild
//! \return the value
Standard_EXPORT virtual QVariant initValue (const int theItemRole) const Standard_OVERRIDE;
+ //! Returns stream value of the item to fulfill property panel.
+ //! \return stream value or dummy
+ Standard_EXPORT virtual void initStream (Standard_OStream& theOStream) const;
+
protected:
//! Creates a child item in the given position.