1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0030949: Foundation Classes - Dump improvement for OCCT classes

1. new file Standard_Dump to prepare and parse Dump in JSON format for OCCT objects
2. some presentations cover the proposed dump functionality.
3. 'bounding', 'vaspects' has '-dumpJson' field to see the DumpJson result
4. Bnd_Box constructor with min/max points is implemented to use Dump of this class in Dump BVH_Box
5. Limitation (some classes of Graphic3d, Prs3d has not full filling for DumpJson)
This commit is contained in:
nds
2019-09-19 15:13:42 +03:00
committed by bugmaster
parent c42ef16585
commit 0904aa6395
83 changed files with 1420 additions and 4 deletions

View File

@@ -110,6 +110,7 @@ Graphic3d_NameOfTexture2D.hxx
Graphic3d_NameOfTextureEnv.hxx
Graphic3d_NameOfTexturePlane.hxx
Graphic3d_NMapOfTransient.hxx
Graphic3d_PolygonOffset.cxx
Graphic3d_PolygonOffset.hxx
Graphic3d_PriorityDefinitionError.hxx
Graphic3d_RenderingMode.hxx

View File

@@ -12,6 +12,7 @@
// commercial license or contractual agreement.
#include <Graphic3d_Aspects.hxx>
#include <Standard_Dump.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_Aspects, Standard_Transient)
@@ -60,3 +61,25 @@ void Graphic3d_Aspects::SetTextureMap (const Handle(Graphic3d_TextureMap)& theTe
myTextureSet = new Graphic3d_TextureSet (theTexture);
}
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void Graphic3d_Aspects::DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth) const
{
DUMP_CLASS_BEGIN (theOStream, Graphic3d_Aspects);
DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myInteriorColor);
DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myBackInteriorColor);
DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myEdgeColor);
DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPolygonOffset);
DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToSkipFirstEdge);
DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToDistinguishMaterials);
DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToDrawEdges);
DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToDrawSilhouette);
DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToSuppressBackFaces);
DUMP_FIELD_VALUE_NUMERICAL (theOStream, myToMapTexture);
DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsTextZoomable);
}

View File

@@ -477,6 +477,9 @@ public:
&& myIsTextZoomable == theOther.myIsTextZoomable;
}
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const;
protected:
Handle(Graphic3d_ShaderProgram) myProgram;

View File

@@ -447,3 +447,15 @@ void Graphic3d_Group::AddText (const Handle(Graphic3d_Text)& theTextParams,
Update();
}
// =======================================================================
// function : DumpJson
// purpose :
// =======================================================================
void Graphic3d_Group::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
{
DUMP_CLASS_BEGIN (theOStream, Graphic3d_Group);
DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsClosed);
DUMP_FIELD_VALUE_NUMERICAL (theOStream, myContainsFacet);
}

View File

@@ -276,6 +276,9 @@ public:
const Standard_Boolean theHasOwnAnchor = Standard_True);
//! Dumps the content of me into the stream
Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const;
protected:
//! Creates a group in the structure <AStructure>.

View File

@@ -0,0 +1,29 @@
// Copyright (c) 2016 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Graphic3d_PolygonOffset.hxx>
#include <Standard_Dump.hxx>
//=======================================================================
//function : DumpJson
//purpose :
//=======================================================================
void Graphic3d_PolygonOffset::DumpJson (Standard_OStream& theOStream, const Standard_Integer) const
{
DUMP_CLASS_BEGIN (theOStream, Graphic3d_PolygonOffset);
DUMP_FIELD_VALUE_NUMERICAL (theOStream, Mode);
DUMP_FIELD_VALUE_NUMERICAL (theOStream, Factor);
DUMP_FIELD_VALUE_NUMERICAL (theOStream, Units);
}

View File

@@ -15,6 +15,7 @@
#define _Graphic3d_PolygonOffset_HeaderFile
#include <Aspect_PolygonOffsetMode.hxx>
#include <Standard_OStream.hxx>
//! Polygon offset parameters.
struct Graphic3d_PolygonOffset
@@ -33,6 +34,10 @@ struct Graphic3d_PolygonOffset
&& Factor == theOther.Factor
&& Units == theOther.Units;
}
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, const Standard_Integer theDepth = -1) const;
};
#endif // _Graphic3d_PolygonOffset_HeaderFile