]> OCCT Git - occt.git/commitdiff
0031350: Foundation Classes - Dump improvement for OCAF classes
authornds <nds@opencascade.com>
Wed, 16 Dec 2020 09:08:49 +0000 (12:08 +0300)
committerbugmaster <bugmaster@opencascade.com>
Fri, 18 Dec 2020 16:48:02 +0000 (19:48 +0300)
- do not dump document in CDM_MetaData, just pointer text;
- move ID dump in to TDF_Attribute;
- extend TDF_Attribute with other important states(obtained by methods);
- extend TDocStd_Document  with other important states;
- avoid dumping of shapes in TNaming_UsedShapes (it takes much time);
- extend XCAFDoc, XCAFDimTolObjects dump to json;
- correct XCAFDoc_ColorTool, XCAFDoc_MaterialTool, XCAFDoc_LayerTool to dump only connected to the object information;
- correct XCAFDoc_Material to dump name and density value only if it exists;
- add check on correct direction in gp_Ax3.

38 files changed:
src/CDM/CDM_MetaData.cxx
src/TDF/TDF_Attribute.cxx
src/TDataStd/TDataStd_AsciiString.cxx
src/TDataStd/TDataStd_BooleanArray.cxx
src/TDataStd/TDataStd_BooleanList.cxx
src/TDataStd/TDataStd_ByteArray.cxx
src/TDataStd/TDataStd_ExtStringArray.cxx
src/TDataStd/TDataStd_ExtStringList.cxx
src/TDataStd/TDataStd_Integer.cxx
src/TDataStd/TDataStd_IntegerArray.cxx
src/TDataStd/TDataStd_IntegerList.cxx
src/TDataStd/TDataStd_Real.cxx
src/TDataStd/TDataStd_RealArray.cxx
src/TDataStd/TDataStd_RealList.cxx
src/TDataStd/TDataStd_ReferenceArray.cxx
src/TDataStd/TDataStd_ReferenceList.cxx
src/TDataStd/TDataStd_TreeNode.cxx
src/TDataStd/TDataStd_UAttribute.cxx
src/TDocStd/TDocStd_Document.cxx
src/TNaming/TNaming_UsedShapes.cxx
src/XCAFDimTolObjects/XCAFDimTolObjects_DatumObject.cxx
src/XCAFDimTolObjects/XCAFDimTolObjects_DatumObject.hxx
src/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.cxx
src/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.hxx
src/XCAFDimTolObjects/XCAFDimTolObjects_GeomToleranceObject.cxx
src/XCAFDimTolObjects/XCAFDimTolObjects_GeomToleranceObject.hxx
src/XCAFDoc/XCAFDoc_ColorTool.cxx
src/XCAFDoc/XCAFDoc_Datum.cxx
src/XCAFDoc/XCAFDoc_DimTolTool.cxx
src/XCAFDoc/XCAFDoc_Dimension.cxx
src/XCAFDoc/XCAFDoc_Dimension.hxx
src/XCAFDoc/XCAFDoc_GeomTolerance.cxx
src/XCAFDoc/XCAFDoc_GeomTolerance.hxx
src/XCAFDoc/XCAFDoc_GraphNode.cxx
src/XCAFDoc/XCAFDoc_LayerTool.cxx
src/XCAFDoc/XCAFDoc_Material.cxx
src/XCAFDoc/XCAFDoc_MaterialTool.cxx
src/gp/gp_Ax3.cxx

index 2cbc5ade863488ef77593edc1493e877eaa063d7..21e7499479b0d2281cea633cd0227dc3aebf3a70 100644 (file)
@@ -167,12 +167,12 @@ void CDM_MetaData::UnsetIsReadOnly() {
 //function : DumpJson
 //purpose  : 
 //=======================================================================
-void CDM_MetaData::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+void CDM_MetaData::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
 {
   OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
 
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsRetrieved)
-  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myDocument)
+  OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myDocument)
   
   OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myFolder)
   OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myName)
index 7ffc372bd925aa30f3fc2400585518f3e8a4c4e8..b82b740b30c4e6d2a3df50c6a9e6f78d2140f81a 100644 (file)
@@ -414,7 +414,7 @@ void TDF_Attribute::ExtendedDump
 //function : DumpJson
 //purpose  : 
 //=======================================================================
-void TDF_Attribute::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+void TDF_Attribute::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
 {
   OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
 
@@ -422,10 +422,14 @@ void TDF_Attribute::DumpJson (Standard_OStream& theOStream, Standard_Integer the
   TDF_Tool::Entry (Label(), aLabel);
   OCCT_DUMP_FIELD_VALUE_STRING (theOStream, aLabel)
 
-  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTransaction)
-  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, mySavedTransaction)
-  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFlags)
+  OCCT_DUMP_FIELD_VALUE_GUID (theOStream, ID())
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Transaction())
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, UntilTransaction())
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsValid())
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsNew())
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsBackuped())
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsForgotten())
 
-  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myNext.get())
-  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myBackup.get())
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFlags)
 }
index a5db33bd17dbfdbc496f6f161757d4b8b297febc..226ce3a8d5bd2eaa4ade49e492545858e7836878 100644 (file)
@@ -212,5 +212,4 @@ void TDataStd_AsciiString::DumpJson (Standard_OStream& theOStream, Standard_Inte
   OCCT_DUMP_BASE_CLASS (theOStream, theDepth, TDF_Attribute)
 
   OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myString)
-  OCCT_DUMP_FIELD_VALUE_GUID (theOStream, myID)
 }
index 382b1ada5e2ef6981b02847e9d21e92f598ef929..2f2268233f1355ebfeabfb24c78b23764bd27063 100644 (file)
@@ -339,5 +339,4 @@ void TDataStd_BooleanArray::DumpJson (Standard_OStream& theOStream, Standard_Int
   }
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myLower)
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myUpper)
-  OCCT_DUMP_FIELD_VALUE_GUID (theOStream, myID)
 }
index f398ce55b345efda5903d89367ae3efbbae0ae8c..949bf061d208c687fa35a02326bb40274f6611ca 100644 (file)
@@ -323,5 +323,4 @@ void TDataStd_BooleanList::DumpJson (Standard_OStream& theOStream, Standard_Inte
     const Standard_Byte& aValue = aListIt.Value();
     OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, aValue)
   }
-  OCCT_DUMP_FIELD_VALUE_GUID (theOStream, myID)
 }
index c0277717bd78d392e1bdb5bf2ad01db62b95d68d..0a1264e516b6dd96529dda30cbd9c7c4281a49a7 100644 (file)
@@ -326,5 +326,4 @@ void TDataStd_ByteArray::DumpJson (Standard_OStream& theOStream, Standard_Intege
     OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, aValue)
   }
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsDelta)
-  OCCT_DUMP_FIELD_VALUE_GUID (theOStream, myID)
 }
index cbeb85c5bc6dcd659ff0c34ee1d2f8e7aa10aa29..75e4fadf55ebf31fbbbaf8e97053963411bfa5e7 100644 (file)
@@ -340,10 +340,12 @@ Handle(TDF_DeltaOnModification) TDataStd_ExtStringArray::DeltaOnModification
 //function : DumpJson
 //purpose  : 
 //=======================================================================
-void TDataStd_ExtStringArray::DumpJson (Standard_OStream& theOStream, Standard_Integer /*theDepth*/) const
+void TDataStd_ExtStringArray::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
 {
   OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
 
+  OCCT_DUMP_BASE_CLASS (theOStream, theDepth, TDF_Attribute)
+
   for (TColStd_Array1OfExtendedString::Iterator aValueIt (myValue->Array1()); aValueIt.More(); aValueIt.Next())
   {
     const TCollection_ExtendedString& aValue = aValueIt.Value();
@@ -351,5 +353,4 @@ void TDataStd_ExtStringArray::DumpJson (Standard_OStream& theOStream, Standard_I
   }
 
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsDelta)
-  OCCT_DUMP_FIELD_VALUE_GUID (theOStream, myID)
 }
index 97faa89b4b43327f473b1590e570e016497b1a0c..2caab46df15e4bb3ec4377f351d99aa830358b3c 100644 (file)
@@ -372,15 +372,15 @@ Standard_OStream& TDataStd_ExtStringList::Dump (Standard_OStream& anOS) const
 //function : DumpJson
 //purpose  : 
 //=======================================================================
-void TDataStd_ExtStringList::DumpJson (Standard_OStream& theOStream, Standard_Integer /*theDepth*/) const
+void TDataStd_ExtStringList::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
 {
   OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
 
+  OCCT_DUMP_BASE_CLASS (theOStream, theDepth, TDF_Attribute)
+
   for (TDataStd_ListOfExtendedString::Iterator aListIt (myList); aListIt.More(); aListIt.Next())
   {
     const TCollection_ExtendedString& aValue = aListIt.Value();
     OCCT_DUMP_FIELD_VALUE_STRING (theOStream, aValue);
   }
-
-  OCCT_DUMP_FIELD_VALUE_GUID (theOStream, myID)
 }
index 5aefc683cb8b1124abca059c018547b60fb7f657..795d3939891051a490d41b25ce3efcf4c059475c 100644 (file)
@@ -215,5 +215,4 @@ void TDataStd_Integer::DumpJson (Standard_OStream& theOStream, Standard_Integer
   OCCT_DUMP_BASE_CLASS (theOStream, theDepth, TDF_Attribute)
 
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myValue)
-  OCCT_DUMP_FIELD_VALUE_GUID (theOStream, myID)
 }
index 1bbf603417b1dc248d5939e053410e2e545469b2..9ccd6651aed9e053d2e8985f3f371c6f2e61f448 100644 (file)
@@ -355,5 +355,4 @@ void TDataStd_IntegerArray::DumpJson (Standard_OStream& theOStream, Standard_Int
   }
 
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsDelta)
-  OCCT_DUMP_FIELD_VALUE_GUID (theOStream, myID)
 }
index 5c462dd03e09c0b90b345dc478cee0c3ad3ec596..6702826dda1975da33c07377d6df459715f82ab0 100644 (file)
@@ -379,5 +379,4 @@ void TDataStd_IntegerList::DumpJson (Standard_OStream& theOStream, Standard_Inte
     const Standard_Integer& aValue = aListIt.Value();
     OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, aValue)
   }
-  OCCT_DUMP_FIELD_VALUE_GUID (theOStream, myID)
 }
index e27807161f1519c4c0589bc8c676a4c59f90d837..373054467891f4e95b71c98dc6438087229d7c91 100644 (file)
@@ -260,5 +260,4 @@ void TDataStd_Real::DumpJson (Standard_OStream& theOStream, Standard_Integer the
 
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myValue)
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDimension)
-  OCCT_DUMP_FIELD_VALUE_GUID (theOStream, myID)
 }
index 7079fddcd9cecbff2725dc65d1fc190b389eaf28..c919ec21cc1ccf3d83f73ba628368d7cf648aa43 100644 (file)
@@ -351,5 +351,4 @@ void TDataStd_RealArray::DumpJson (Standard_OStream& theOStream, Standard_Intege
   }
 
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsDelta)
-  OCCT_DUMP_FIELD_VALUE_GUID (theOStream, myID)
 }
index ba792e222e569fa399982151fd8955784d86a949..e7eb8a70a086d6fc46e9faa33b6a0465d988f78e 100644 (file)
@@ -377,6 +377,4 @@ void TDataStd_RealList::DumpJson (Standard_OStream& theOStream, Standard_Integer
     const Standard_Real& aValue = aListIt.Value();
     OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, aValue)
   }
-
-  OCCT_DUMP_FIELD_VALUE_GUID (theOStream, myID)
 }
index 6f66c1efa9d9de16255bbfae1b3699890411e2a7..949f34b7a1c91a98124089e1b3449aa3125e59c8 100644 (file)
@@ -350,6 +350,4 @@ void TDataStd_ReferenceArray::DumpJson (Standard_OStream& theOStream, Standard_I
     TDF_Tool::Entry (anArrayIt.Value(), aLabel);
     OCCT_DUMP_FIELD_VALUE_STRING (theOStream, aLabel)
   }
-  
-  OCCT_DUMP_FIELD_VALUE_GUID (theOStream, myID)
 }
index c341779d5f774e2c5e03ff42dfc3602b48cba13d..8fa9610cc51da3df52560313b1b647264d0cc0c6 100644 (file)
@@ -403,6 +403,4 @@ void TDataStd_ReferenceList::DumpJson (Standard_OStream& theOStream, Standard_In
     TDF_Tool::Entry (aListIt.Value(), aLabel);
     OCCT_DUMP_FIELD_VALUE_STRING (theOStream, aLabel)
   }
-
-  OCCT_DUMP_FIELD_VALUE_GUID (theOStream, myID)
 }
index 1e76f1f013ed22e9508f9014c6b5f43f4e8f663f..1d7ec79b22a31114d868e939631847e5feed96ca 100644 (file)
@@ -730,6 +730,4 @@ void TDataStd_TreeNode::DumpJson (Standard_OStream& theOStream, Standard_Integer
     TDF_Tool::Entry (myLast->Label(), aLast);
     OCCT_DUMP_FIELD_VALUE_STRING (theOStream, aLast)
   }
-
-  OCCT_DUMP_FIELD_VALUE_GUID (theOStream, myTreeID)
 }
index 5ce60a1af4c159fb0fccda5aa40dbc86f17acd1e..3e19a272ed091f6312b32317da63b814715757ae 100644 (file)
@@ -141,6 +141,4 @@ void TDataStd_UAttribute::DumpJson (Standard_OStream& theOStream, Standard_Integ
   OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
 
   OCCT_DUMP_BASE_CLASS (theOStream, theDepth, TDF_Attribute)
-  
-  OCCT_DUMP_FIELD_VALUE_GUID (theOStream, myID)
 }
index b3798214f101b0e73c513ef38202e86a6907a0c8..d9656c4689c27c9c2f3007d159f0050ba5fa14da 100644 (file)
@@ -942,6 +942,13 @@ void TDocStd_Document::DumpJson (Standard_OStream& theOStream, Standard_Integer
   OCCT_DUMP_BASE_CLASS (theOStream, theDepth, CDM_Document)
   
   OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myStorageFormat)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsSaved())
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsChanged())
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsEmpty())
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, IsValid())
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, GetAvailableUndos())
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, GetAvailableRedos())
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, HasOpenCommand())
 
   for (TDF_DeltaList::Iterator anUndoIt (myUndos); anUndoIt.More(); anUndoIt.Next())
   {
index a5e79d7e8a657fa9167b52585b82252431428e1a..1d4e45276d274d30b25f61cfde895bd82356fdaa 100644 (file)
@@ -196,18 +196,4 @@ void TNaming_UsedShapes::DumpJson (Standard_OStream& theOStream, Standard_Intege
   OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
 
   OCCT_DUMP_BASE_CLASS (theOStream, theDepth, TDF_Attribute)
-
-  for (TNaming_DataMapOfShapePtrRefShape::Iterator aMapIt (myMap); aMapIt.More(); aMapIt.Next())
-  {
-    const TopoDS_Shape& aShape = aMapIt.Key();
-    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &aShape)
-
-    TCollection_AsciiString aLabel;
-    TDF_Tool::Entry (aMapIt.Value()->Label(), aLabel);
-    OCCT_DUMP_FIELD_VALUE_STRING (theOStream, aLabel)
-
-    const TopoDS_Shape& aRefShape = aMapIt.Value()->Shape();
-
-    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &aRefShape)
-  }
 }
index 676201969bd89881ec836f880093643b3561674b..357f693e660701d7b6f180179c6e6f4addcbe05a 100644 (file)
@@ -318,3 +318,75 @@ void XCAFDimTolObjects_DatumObject::SetDatumTargetNumber(const Standard_Integer
 {
   myDatumTargetNumber = theNumber;
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  :
+//=======================================================================
+void XCAFDimTolObjects_DatumObject::DumpJson (Standard_OStream& theOStream,
+                                                  Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+
+  if (!myName.IsNull())
+  {
+    Standard_CString aDatumName = myName->ToCString();
+    OCCT_DUMP_FIELD_VALUE_STRING (theOStream, aDatumName)
+  }
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myModifierWithValue)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myValueOfModifier)
+
+  if (!myDatumTarget.IsNull())
+  {
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myDatumTarget)
+  }
+
+    
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myPosition)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsDTarget)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsValidDT)
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDTargetType)
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myAxis)
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myLength)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myWidth)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDatumTargetNumber)
+
+  if (myHasPlane)
+  {
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPlane)
+  }
+
+  if (myHasPnt)
+  {
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPnt)
+  }
+
+  if (myHasPntText)
+  {
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPntText)
+  }
+
+  if (!myPresentation.IsNull())
+  {
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPresentation)
+  }
+
+  if (!mySemanticName.IsNull())
+  {
+    Standard_CString aSemanticName = mySemanticName->ToCString();
+    OCCT_DUMP_FIELD_VALUE_STRING (theOStream, aSemanticName)
+  }
+  if (!myPresentationName.IsNull())
+  {
+    Standard_CString aPresentationName = myPresentationName->ToCString();
+    OCCT_DUMP_FIELD_VALUE_STRING (theOStream, aPresentationName)
+  }
+
+  for (XCAFDimTolObjects_DatumModifiersSequence::Iterator aModifIt (myModifiers); aModifIt.More(); aModifIt.Next())
+  {
+    XCAFDimTolObjects_DatumSingleModif aModifier = aModifIt.Value();
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, aModifier)
+  }
+}
index c0e6dfc41f1d918d7acfda5c0d87a92e4195810f..3ecb65b16112e341f7dbd281372ba4f6004a1d5f 100644 (file)
@@ -201,6 +201,9 @@ public:
     return myIsValidDT;
   }
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
+
   DEFINE_STANDARD_RTTIEXT(XCAFDimTolObjects_DatumObject,Standard_Transient)
 
 private:
index 2720ad7140ab0b2c93fd205925fad7ed1b003842..bcbc8d6d6826c9ebe1f266b74f533ed612b5a5ec 100644 (file)
@@ -482,3 +482,96 @@ void XCAFDimTolObjects_DimensionObject::RemoveDescription(const Standard_Integer
   myDescriptions = aDescriptions;
   myDescriptionNames = aDescriptionNames;
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  :
+//=======================================================================
+void XCAFDimTolObjects_DimensionObject::DumpJson (Standard_OStream& theOStream,
+                                                  Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myType)
+
+  if (!myVal.IsNull())
+  {
+    for (Standard_Integer anId = myVal->Lower(); anId <= myVal->Upper(); anId++)
+    {
+      Standard_Real aValue = myVal->Value (anId);
+      OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, aValue)
+    }
+  }
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myQualifier)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsHole)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myFormVariance)
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myGrade)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myL)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myR)
+
+  if (!myPath.IsNull())
+  {
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPath)
+  }
+  
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myDir)
+  if (myHasPoint1)
+  {
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPnt1)
+  }
+
+  if (myHasPoint2)
+  {
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPnt2)
+  }
+
+  if (myHasPlane)
+  {
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPlane)
+  }
+
+  if (myHasPntText)
+  {
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPntText)
+  }
+
+  if (!myPresentation.IsNull())
+  {
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPresentation)
+  }
+
+  if (!mySemanticName.IsNull())
+  {
+    Standard_CString aSemanticName = mySemanticName->ToCString();
+    OCCT_DUMP_FIELD_VALUE_STRING (theOStream, aSemanticName)
+  }
+  if (!myPresentationName.IsNull())
+  {
+    Standard_CString aPresentationName = myPresentationName->ToCString();
+    OCCT_DUMP_FIELD_VALUE_STRING (theOStream, aPresentationName)
+  }
+
+  for (NCollection_Vector<Handle(TCollection_HAsciiString)>::Iterator aDescIt (myDescriptions); aDescIt.More(); aDescIt.Next())
+  {
+    if (aDescIt.Value().IsNull())
+      continue;
+    Standard_CString aDescription = aDescIt.Value()->ToCString();
+    OCCT_DUMP_FIELD_VALUE_STRING (theOStream, aDescription)
+  }
+  
+  for (NCollection_Vector<Handle(TCollection_HAsciiString)>::Iterator aDescNameIt (myDescriptionNames); aDescNameIt.More(); aDescNameIt.Next())
+  {
+    if (aDescNameIt.Value().IsNull())
+      continue;
+    Standard_CString aDescriptionName = aDescNameIt.Value()->ToCString();
+    OCCT_DUMP_FIELD_VALUE_STRING (theOStream, aDescriptionName)
+  }
+
+  for (XCAFDimTolObjects_DimensionModifiersSequence::Iterator aModifIt (myModifiers); aModifIt.More(); aModifIt.Next())
+  {
+    XCAFDimTolObjects_DimensionModif aModifier = aModifIt.Value();
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, aModifier)
+  }
+}
index 2794b8dd76c33f3d15d7b155becb278f4b0035d8..58e1806df857065bf4c0821f75b8d94b83c81802 100644 (file)
@@ -292,6 +292,9 @@ public:
     myDescriptionNames.Append(theName);
   }
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
+
   DEFINE_STANDARD_RTTIEXT(XCAFDimTolObjects_DimensionObject,Standard_Transient)
 
 private: 
index 0537a64b883d3900318eb9056643b53ca389f68f..14d7207cf3640a2596d2bd594c65722039646526 100644 (file)
@@ -279,3 +279,66 @@ Standard_Boolean XCAFDimTolObjects_GeomToleranceObject::HasAxis () const
 {
   return myHasAxis;
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  :
+//=======================================================================
+void XCAFDimTolObjects_GeomToleranceObject::DumpJson (Standard_OStream& theOStream,
+                                                      Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myType)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myTypeOfValue)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myValue)
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myMatReqModif)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myZoneModif)
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myValueOfZoneModif)
+
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myMaxValueModif)
+  if (myHasAxis)
+  {
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myAxis)
+  }
+
+  if (myHasPlane)
+  {
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPlane)
+  }
+
+  if (myHasPnt)
+  {
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPnt)
+  }
+
+  if (myHasPntText)
+  {
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPntText)
+  }
+
+  if (!myPresentation.IsNull())
+  {
+    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myPresentation)
+  }
+
+  if (!mySemanticName.IsNull())
+  {
+    Standard_CString aSemanticName = mySemanticName->ToCString();
+    OCCT_DUMP_FIELD_VALUE_STRING (theOStream, aSemanticName)
+  }
+  if (!myPresentationName.IsNull())
+  {
+    Standard_CString aPresentationName = myPresentationName->ToCString();
+    OCCT_DUMP_FIELD_VALUE_STRING (theOStream, aPresentationName)
+  }
+
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myAffectedPlane)
+
+  for (XCAFDimTolObjects_GeomToleranceModifiersSequence::Iterator aModifIt (myModifiers); aModifIt.More(); aModifIt.Next())
+  {
+    XCAFDimTolObjects_GeomToleranceModif aModifier = aModifIt.Value();
+    OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, aModifier)
+  }
+}
index 2a3db6c62891a53d360dafa4bfbe112de1f45c30..8bb6e1effa12d320afa2ae1727d751b420083f04 100644 (file)
@@ -214,6 +214,8 @@ public:
     return myAffectedPlane;
   }
 
+  //! Dumps the content of me into the stream
+  Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
 
   DEFINE_STANDARD_RTTIEXT(XCAFDimTolObjects_GeomToleranceObject,Standard_Transient)
 
index 22bc754df39b27b5cb80118424efb982a39ef3ab..b058b0e84ee60b3242616b4220943ec1dc36c0b2 100644 (file)
@@ -24,6 +24,7 @@
 #include <TDF_ChildIDIterator.hxx>
 #include <TDF_Label.hxx>
 #include <TDF_RelocationTable.hxx>
+#include <TDF_Tool.hxx>
 #include <TNaming_NamedShape.hxx>
 #include <TopoDS_Shape.hxx>
 #include <XCAFDoc.hxx>
@@ -779,5 +780,12 @@ void XCAFDoc_ColorTool::DumpJson (Standard_OStream& theOStream, Standard_Integer
 
   OCCT_DUMP_BASE_CLASS (theOStream, theDepth, TDF_Attribute)
    
-  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myShapeTool.get())
+  TDF_LabelSequence aLabels;
+  GetColors (aLabels);
+  for (TDF_LabelSequence::Iterator aColorLabelIt (aLabels); aColorLabelIt.More(); aColorLabelIt.Next())
+  {
+    TCollection_AsciiString aColorLabel;
+    TDF_Tool::Entry (aColorLabelIt.Value(), aColorLabel);
+    OCCT_DUMP_FIELD_VALUE_STRING (theOStream, aColorLabel)
+  }
 }
index ce0e31e0a2ce05231cb50b70972f53cf1fa60511..67ec506729652a544dd92cf113e8fac46b217293 100644 (file)
@@ -560,4 +560,7 @@ void XCAFDoc_Datum::DumpJson (Standard_OStream& theOStream, Standard_Integer the
   OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myName.get())
   OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myDescription.get())
   OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myIdentification.get())
+
+  Handle(XCAFDimTolObjects_DatumObject) anObject = GetObject();
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, anObject.get())
 }
index 8a5da13d174549e824e336c34c85c5ed91a54007..bdc6a0b9546811c4e87c91cfc1e1c30bb517aac5 100644 (file)
@@ -26,6 +26,7 @@
 #include <TDF_ChildIDIterator.hxx>
 #include <TDF_Label.hxx>
 #include <TDF_RelocationTable.hxx>
+#include <TDF_Tool.hxx>
 #include <XCAFDimTolObjects_DatumObject.hxx>
 #include <XCAFDimTolObjects_DimensionObject.hxx>
 #include <XCAFDimTolObjects_GeomToleranceObject.hxx>
@@ -1071,5 +1072,39 @@ void XCAFDoc_DimTolTool::DumpJson (Standard_OStream& theOStream, Standard_Intege
 
   OCCT_DUMP_BASE_CLASS (theOStream, theDepth, TDF_Attribute)
 
-  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myShapeTool.get())
+  TDF_LabelSequence aLabels;
+  GetDimensionLabels (aLabels);
+  for (TDF_LabelSequence::Iterator aDimLabelIt (aLabels); aDimLabelIt.More(); aDimLabelIt.Next())
+  {
+    TCollection_AsciiString aDimensionLabel;
+    TDF_Tool::Entry (aDimLabelIt.Value(), aDimensionLabel);
+    OCCT_DUMP_FIELD_VALUE_STRING (theOStream, aDimensionLabel)
+  }
+
+  aLabels.Clear();
+  GetGeomToleranceLabels (aLabels);
+  for (TDF_LabelSequence::Iterator aGeomToleranceLabelIt (aLabels); aGeomToleranceLabelIt.More(); aGeomToleranceLabelIt.Next())
+  {
+    TCollection_AsciiString aGeomToleranceLabel;
+    TDF_Tool::Entry (aGeomToleranceLabelIt.Value(), aGeomToleranceLabel);
+    OCCT_DUMP_FIELD_VALUE_STRING (theOStream, aGeomToleranceLabel)
+  }
+
+  aLabels.Clear();
+  GetDimTolLabels (aLabels);
+  for (TDF_LabelSequence::Iterator aDimTolLabelIt (aLabels); aDimTolLabelIt.More(); aDimTolLabelIt.Next())
+  {
+    TCollection_AsciiString aDimTolLabelLabel;
+    TDF_Tool::Entry (aDimTolLabelIt.Value(), aDimTolLabelLabel);
+    OCCT_DUMP_FIELD_VALUE_STRING (theOStream, aDimTolLabelLabel)
+  }
+
+  aLabels.Clear();
+  GetDatumLabels (aLabels);
+  for (TDF_LabelSequence::Iterator aDatumLabelIt (aLabels); aDatumLabelIt.More(); aDatumLabelIt.Next())
+  {
+    TCollection_AsciiString aDatumLabel;
+    TDF_Tool::Entry (aDatumLabelIt.Value(), aDatumLabel);
+    OCCT_DUMP_FIELD_VALUE_STRING (theOStream, aDatumLabel)
+  }
 }
index a11e3402d73c30554e4db42057cc66f7014305d4..664b99242f1817368877b6da0fac8a10b48f7b51 100644 (file)
@@ -429,3 +429,17 @@ const Standard_GUID& XCAFDoc_Dimension::ID() const
 {
   return GetID();
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  :
+//=======================================================================
+void XCAFDoc_Dimension::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+
+  OCCT_DUMP_BASE_CLASS (theOStream, theDepth, TDataStd_GenericEmpty)
+
+  Handle(XCAFDimTolObjects_DimensionObject) anObject = GetObject();
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, anObject.get())
+}
index 41bfafd7084eeb5e5b61aa4a18a7b2b8a79ddb90..36d4875996aa7087bc4e14df4e40b86715995781 100644 (file)
@@ -57,6 +57,8 @@ public:
   //! Returns dimension object data taken from the parent's label and its sub-labels.
   Standard_EXPORT Handle(XCAFDimTolObjects_DimensionObject) GetObject() const;
   
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
 
   DEFINE_DERIVED_ATTRIBUTE(XCAFDoc_Dimension,TDataStd_GenericEmpty)
 
index af0152859120281ff123d3645a76d25ef0775efa..e86f6e9d7e3ff646508df5c7dc75f2b3e0bd985d 100644 (file)
@@ -400,3 +400,17 @@ const Standard_GUID& XCAFDoc_GeomTolerance::ID() const
 {
   return GetID();
 }
+
+//=======================================================================
+//function : DumpJson
+//purpose  :
+//=======================================================================
+void XCAFDoc_GeomTolerance::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+  OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+
+  OCCT_DUMP_BASE_CLASS (theOStream, theDepth, TDataStd_GenericEmpty)
+
+  Handle(XCAFDimTolObjects_GeomToleranceObject) anObject = GetObject();
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, anObject.get())
+}
index 77a587b26873e7a7d0b4d6fafcb371df9d660cf8..0a000efe7a1c1e1a62f3a96f52357e7cee1c4c68 100644 (file)
@@ -58,6 +58,8 @@ public:
   
   Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE;
   
+  //! Dumps the content of me into the stream
+  Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
 
   DEFINE_DERIVED_ATTRIBUTE(XCAFDoc_GeomTolerance,TDataStd_GenericEmpty)
 };
index 673064bf4866bda522d6de5c8bcd1a8dd88daa68..efa73c447d0abdf0602c972f52bd432dcb46fc08 100644 (file)
@@ -495,7 +495,7 @@ void XCAFDoc_GraphNode::DumpJson (Standard_OStream& theOStream, Standard_Integer
   for (XCAFDoc_GraphNodeSequence::Iterator anIteratorFather (myFathers); anIteratorFather.More(); anIteratorFather.Next())
   {
     const Handle(XCAFDoc_GraphNode)& aFather = anIteratorFather.Value();
-    OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aFather.get())
+    OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, aFather)
   }
   
   for (XCAFDoc_GraphNodeSequence::Iterator anIteratorChild (myChildren); anIteratorChild.More(); anIteratorChild.Next())
@@ -503,6 +503,4 @@ void XCAFDoc_GraphNode::DumpJson (Standard_OStream& theOStream, Standard_Integer
     const Handle(XCAFDoc_GraphNode)& aChild = anIteratorChild.Value();
     OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aChild.get())
   }
-
-  OCCT_DUMP_FIELD_VALUE_GUID (theOStream, myGraphID)
 }
index 3b14fefc14f299c80292c0fbd47f3807a90b83e0..a95810b05e23e7bd2e276ac585a874b9b97ab1db 100644 (file)
@@ -25,6 +25,7 @@
 #include <TDF_ChildIterator.hxx>
 #include <TDF_Label.hxx>
 #include <TDF_RelocationTable.hxx>
+#include <TDF_Tool.hxx>
 #include <TopoDS_Shape.hxx>
 #include <XCAFDoc.hxx>
 #include <XCAFDoc_DocumentTool.hxx>
@@ -606,5 +607,12 @@ void XCAFDoc_LayerTool::DumpJson (Standard_OStream& theOStream, Standard_Integer
 
   OCCT_DUMP_BASE_CLASS (theOStream, theDepth, TDF_Attribute)
 
-  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myShapeTool.get())
+  TDF_LabelSequence aLabels;
+  GetLayerLabels (aLabels);
+  for (TDF_LabelSequence::Iterator aLayerLabelIt (aLabels); aLayerLabelIt.More(); aLayerLabelIt.Next())
+  {
+    TCollection_AsciiString aLayerLabel;
+    TDF_Tool::Entry (aLayerLabelIt.Value(), aLayerLabel);
+    OCCT_DUMP_FIELD_VALUE_STRING (theOStream, aLayerLabel)
+  }
 }
\ No newline at end of file
index 3b8c887a874ea32920e45a3b5e37208de795b4c9..31cdc46479a43b36fc8ad1e94202630e6c6eb417 100644 (file)
@@ -199,9 +199,27 @@ void XCAFDoc_Material::DumpJson (Standard_OStream& theOStream, Standard_Integer
 
   OCCT_DUMP_BASE_CLASS (theOStream, theDepth, TDF_Attribute)
 
-  OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myName.get())
-  OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myDescription.get())
+  if (!myName.IsNull())
+  {
+    Standard_CString aMaterialName = myName->ToCString();
+    OCCT_DUMP_FIELD_VALUE_STRING (theOStream, aMaterialName)
+  }
+  if (!myDescription.IsNull())
+  {
+    Standard_CString aDescriptionName = myDescription->ToCString();
+    OCCT_DUMP_FIELD_VALUE_STRING (theOStream, aDescriptionName)
+  }
+
   OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDensity)
-  OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myDensName.get())
-  OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myDensValType.get())
+
+  if (!myDensName.IsNull())
+  {
+    Standard_CString aDensName = myDensName->ToCString();
+    OCCT_DUMP_FIELD_VALUE_STRING (theOStream, aDensName)
+  }
+  if (!myDensValType.IsNull())
+  {
+    Standard_CString aDensValType = myDensValType->ToCString();
+    OCCT_DUMP_FIELD_VALUE_STRING (theOStream, aDensValType)
+  }
 }
index 242db45e59de7d77bec1178701a72415030dd6df..8ec77e5fd1f5c0ee353da2181ee08d7080efa11e 100644 (file)
@@ -22,6 +22,7 @@
 #include <TDF_ChildIDIterator.hxx>
 #include <TDF_Label.hxx>
 #include <TDF_RelocationTable.hxx>
+#include <TDF_Tool.hxx>
 #include <XCAFDoc.hxx>
 #include <XCAFDoc_DocumentTool.hxx>
 #include <XCAFDoc_Material.hxx>
@@ -244,5 +245,12 @@ void XCAFDoc_MaterialTool::DumpJson (Standard_OStream& theOStream, Standard_Inte
 
   OCCT_DUMP_BASE_CLASS (theOStream, theDepth, TDF_Attribute)
 
-  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myShapeTool.get())
+  TDF_LabelSequence aLabels;
+  GetMaterialLabels (aLabels);
+  for (TDF_LabelSequence::Iterator aMaterialLabelIt (aLabels); aMaterialLabelIt.More(); aMaterialLabelIt.Next())
+  {
+    TCollection_AsciiString aMaterialLabel;
+    TDF_Tool::Entry (aMaterialLabelIt.Value(), aMaterialLabel);
+    OCCT_DUMP_FIELD_VALUE_STRING (theOStream, aMaterialLabel)
+  }
 }
index 5e233bf74cb5949fa034064856e106a86afae748..6e8bd011ef2c59cdcb8a358cc317a5a0d3db6d9a 100644 (file)
@@ -140,6 +140,9 @@ Standard_Boolean  gp_Ax3::InitFromJson (const Standard_SStream& theSStream, Stan
   vxdir = gp_Dir (aXDir);
   vydir = gp_Dir (anYDir);
 
+  if (!Direction().IsEqual (aDir, Precision::Angular()))
+    return Standard_False;
+
   theStreamPos = aPos;
   return Standard_True;
 }