diff --git a/src/CDM/CDM_MetaData.cxx b/src/CDM/CDM_MetaData.cxx index 2cbc5ade86..21e7499479 100644 --- a/src/CDM/CDM_MetaData.cxx +++ b/src/CDM/CDM_MetaData.cxx @@ -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) diff --git a/src/TDF/TDF_Attribute.cxx b/src/TDF/TDF_Attribute.cxx index 7ffc372bd9..b82b740b30 100644 --- a/src/TDF/TDF_Attribute.cxx +++ b/src/TDF/TDF_Attribute.cxx @@ -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_VALUES_DUMPED (theOStream, theDepth, myNext.get()) - OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myBackup.get()) + 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_VALUE_NUMERICAL (theOStream, myFlags) } diff --git a/src/TDataStd/TDataStd_AsciiString.cxx b/src/TDataStd/TDataStd_AsciiString.cxx index a5db33bd17..226ce3a8d5 100644 --- a/src/TDataStd/TDataStd_AsciiString.cxx +++ b/src/TDataStd/TDataStd_AsciiString.cxx @@ -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) } diff --git a/src/TDataStd/TDataStd_BooleanArray.cxx b/src/TDataStd/TDataStd_BooleanArray.cxx index 382b1ada5e..2f2268233f 100644 --- a/src/TDataStd/TDataStd_BooleanArray.cxx +++ b/src/TDataStd/TDataStd_BooleanArray.cxx @@ -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) } diff --git a/src/TDataStd/TDataStd_BooleanList.cxx b/src/TDataStd/TDataStd_BooleanList.cxx index f398ce55b3..949bf061d2 100644 --- a/src/TDataStd/TDataStd_BooleanList.cxx +++ b/src/TDataStd/TDataStd_BooleanList.cxx @@ -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) } diff --git a/src/TDataStd/TDataStd_ByteArray.cxx b/src/TDataStd/TDataStd_ByteArray.cxx index c0277717bd..0a1264e516 100644 --- a/src/TDataStd/TDataStd_ByteArray.cxx +++ b/src/TDataStd/TDataStd_ByteArray.cxx @@ -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) } diff --git a/src/TDataStd/TDataStd_ExtStringArray.cxx b/src/TDataStd/TDataStd_ExtStringArray.cxx index cbeb85c5bc..75e4fadf55 100644 --- a/src/TDataStd/TDataStd_ExtStringArray.cxx +++ b/src/TDataStd/TDataStd_ExtStringArray.cxx @@ -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) } diff --git a/src/TDataStd/TDataStd_ExtStringList.cxx b/src/TDataStd/TDataStd_ExtStringList.cxx index 97faa89b4b..2caab46df1 100644 --- a/src/TDataStd/TDataStd_ExtStringList.cxx +++ b/src/TDataStd/TDataStd_ExtStringList.cxx @@ -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) } diff --git a/src/TDataStd/TDataStd_Integer.cxx b/src/TDataStd/TDataStd_Integer.cxx index 5aefc683cb..795d393989 100644 --- a/src/TDataStd/TDataStd_Integer.cxx +++ b/src/TDataStd/TDataStd_Integer.cxx @@ -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) } diff --git a/src/TDataStd/TDataStd_IntegerArray.cxx b/src/TDataStd/TDataStd_IntegerArray.cxx index 1bbf603417..9ccd6651ae 100644 --- a/src/TDataStd/TDataStd_IntegerArray.cxx +++ b/src/TDataStd/TDataStd_IntegerArray.cxx @@ -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) } diff --git a/src/TDataStd/TDataStd_IntegerList.cxx b/src/TDataStd/TDataStd_IntegerList.cxx index 5c462dd03e..6702826dda 100644 --- a/src/TDataStd/TDataStd_IntegerList.cxx +++ b/src/TDataStd/TDataStd_IntegerList.cxx @@ -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) } diff --git a/src/TDataStd/TDataStd_Real.cxx b/src/TDataStd/TDataStd_Real.cxx index e27807161f..3730544678 100644 --- a/src/TDataStd/TDataStd_Real.cxx +++ b/src/TDataStd/TDataStd_Real.cxx @@ -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) } diff --git a/src/TDataStd/TDataStd_RealArray.cxx b/src/TDataStd/TDataStd_RealArray.cxx index 7079fddcd9..c919ec21cc 100644 --- a/src/TDataStd/TDataStd_RealArray.cxx +++ b/src/TDataStd/TDataStd_RealArray.cxx @@ -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) } diff --git a/src/TDataStd/TDataStd_RealList.cxx b/src/TDataStd/TDataStd_RealList.cxx index ba792e222e..e7eb8a70a0 100644 --- a/src/TDataStd/TDataStd_RealList.cxx +++ b/src/TDataStd/TDataStd_RealList.cxx @@ -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) } diff --git a/src/TDataStd/TDataStd_ReferenceArray.cxx b/src/TDataStd/TDataStd_ReferenceArray.cxx index 6f66c1efa9..949f34b7a1 100644 --- a/src/TDataStd/TDataStd_ReferenceArray.cxx +++ b/src/TDataStd/TDataStd_ReferenceArray.cxx @@ -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) } diff --git a/src/TDataStd/TDataStd_ReferenceList.cxx b/src/TDataStd/TDataStd_ReferenceList.cxx index c341779d5f..8fa9610cc5 100644 --- a/src/TDataStd/TDataStd_ReferenceList.cxx +++ b/src/TDataStd/TDataStd_ReferenceList.cxx @@ -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) } diff --git a/src/TDataStd/TDataStd_TreeNode.cxx b/src/TDataStd/TDataStd_TreeNode.cxx index 1e76f1f013..1d7ec79b22 100644 --- a/src/TDataStd/TDataStd_TreeNode.cxx +++ b/src/TDataStd/TDataStd_TreeNode.cxx @@ -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) } diff --git a/src/TDataStd/TDataStd_UAttribute.cxx b/src/TDataStd/TDataStd_UAttribute.cxx index 5ce60a1af4..3e19a272ed 100644 --- a/src/TDataStd/TDataStd_UAttribute.cxx +++ b/src/TDataStd/TDataStd_UAttribute.cxx @@ -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) } diff --git a/src/TDocStd/TDocStd_Document.cxx b/src/TDocStd/TDocStd_Document.cxx index b3798214f1..d9656c4689 100644 --- a/src/TDocStd/TDocStd_Document.cxx +++ b/src/TDocStd/TDocStd_Document.cxx @@ -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()) { diff --git a/src/TNaming/TNaming_UsedShapes.cxx b/src/TNaming/TNaming_UsedShapes.cxx index a5e79d7e8a..1d4e45276d 100644 --- a/src/TNaming/TNaming_UsedShapes.cxx +++ b/src/TNaming/TNaming_UsedShapes.cxx @@ -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) - } } diff --git a/src/XCAFDimTolObjects/XCAFDimTolObjects_DatumObject.cxx b/src/XCAFDimTolObjects/XCAFDimTolObjects_DatumObject.cxx index 676201969b..357f693e66 100644 --- a/src/XCAFDimTolObjects/XCAFDimTolObjects_DatumObject.cxx +++ b/src/XCAFDimTolObjects/XCAFDimTolObjects_DatumObject.cxx @@ -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) + } +} diff --git a/src/XCAFDimTolObjects/XCAFDimTolObjects_DatumObject.hxx b/src/XCAFDimTolObjects/XCAFDimTolObjects_DatumObject.hxx index c0e6dfc41f..3ecb65b161 100644 --- a/src/XCAFDimTolObjects/XCAFDimTolObjects_DatumObject.hxx +++ b/src/XCAFDimTolObjects/XCAFDimTolObjects_DatumObject.hxx @@ -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: diff --git a/src/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.cxx b/src/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.cxx index 2720ad7140..bcbc8d6d68 100644 --- a/src/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.cxx +++ b/src/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.cxx @@ -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::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::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) + } +} diff --git a/src/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.hxx b/src/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.hxx index 2794b8dd76..58e1806df8 100644 --- a/src/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.hxx +++ b/src/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.hxx @@ -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: diff --git a/src/XCAFDimTolObjects/XCAFDimTolObjects_GeomToleranceObject.cxx b/src/XCAFDimTolObjects/XCAFDimTolObjects_GeomToleranceObject.cxx index 0537a64b88..14d7207cf3 100644 --- a/src/XCAFDimTolObjects/XCAFDimTolObjects_GeomToleranceObject.cxx +++ b/src/XCAFDimTolObjects/XCAFDimTolObjects_GeomToleranceObject.cxx @@ -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) + } +} diff --git a/src/XCAFDimTolObjects/XCAFDimTolObjects_GeomToleranceObject.hxx b/src/XCAFDimTolObjects/XCAFDimTolObjects_GeomToleranceObject.hxx index 2a3db6c628..8bb6e1effa 100644 --- a/src/XCAFDimTolObjects/XCAFDimTolObjects_GeomToleranceObject.hxx +++ b/src/XCAFDimTolObjects/XCAFDimTolObjects_GeomToleranceObject.hxx @@ -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) diff --git a/src/XCAFDoc/XCAFDoc_ColorTool.cxx b/src/XCAFDoc/XCAFDoc_ColorTool.cxx index 22bc754df3..b058b0e84e 100644 --- a/src/XCAFDoc/XCAFDoc_ColorTool.cxx +++ b/src/XCAFDoc/XCAFDoc_ColorTool.cxx @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -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) + } } diff --git a/src/XCAFDoc/XCAFDoc_Datum.cxx b/src/XCAFDoc/XCAFDoc_Datum.cxx index ce0e31e0a2..67ec506729 100644 --- a/src/XCAFDoc/XCAFDoc_Datum.cxx +++ b/src/XCAFDoc/XCAFDoc_Datum.cxx @@ -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()) } diff --git a/src/XCAFDoc/XCAFDoc_DimTolTool.cxx b/src/XCAFDoc/XCAFDoc_DimTolTool.cxx index 8a5da13d17..bdc6a0b954 100644 --- a/src/XCAFDoc/XCAFDoc_DimTolTool.cxx +++ b/src/XCAFDoc/XCAFDoc_DimTolTool.cxx @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -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) + } } diff --git a/src/XCAFDoc/XCAFDoc_Dimension.cxx b/src/XCAFDoc/XCAFDoc_Dimension.cxx index a11e3402d7..664b99242f 100644 --- a/src/XCAFDoc/XCAFDoc_Dimension.cxx +++ b/src/XCAFDoc/XCAFDoc_Dimension.cxx @@ -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()) +} diff --git a/src/XCAFDoc/XCAFDoc_Dimension.hxx b/src/XCAFDoc/XCAFDoc_Dimension.hxx index 41bfafd708..36d4875996 100644 --- a/src/XCAFDoc/XCAFDoc_Dimension.hxx +++ b/src/XCAFDoc/XCAFDoc_Dimension.hxx @@ -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) diff --git a/src/XCAFDoc/XCAFDoc_GeomTolerance.cxx b/src/XCAFDoc/XCAFDoc_GeomTolerance.cxx index af01528591..e86f6e9d7e 100644 --- a/src/XCAFDoc/XCAFDoc_GeomTolerance.cxx +++ b/src/XCAFDoc/XCAFDoc_GeomTolerance.cxx @@ -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()) +} diff --git a/src/XCAFDoc/XCAFDoc_GeomTolerance.hxx b/src/XCAFDoc/XCAFDoc_GeomTolerance.hxx index 77a587b268..0a000efe7a 100644 --- a/src/XCAFDoc/XCAFDoc_GeomTolerance.hxx +++ b/src/XCAFDoc/XCAFDoc_GeomTolerance.hxx @@ -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) }; diff --git a/src/XCAFDoc/XCAFDoc_GraphNode.cxx b/src/XCAFDoc/XCAFDoc_GraphNode.cxx index 673064bf48..efa73c447d 100644 --- a/src/XCAFDoc/XCAFDoc_GraphNode.cxx +++ b/src/XCAFDoc/XCAFDoc_GraphNode.cxx @@ -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) } diff --git a/src/XCAFDoc/XCAFDoc_LayerTool.cxx b/src/XCAFDoc/XCAFDoc_LayerTool.cxx index 3b14fefc14..a95810b05e 100644 --- a/src/XCAFDoc/XCAFDoc_LayerTool.cxx +++ b/src/XCAFDoc/XCAFDoc_LayerTool.cxx @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -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 diff --git a/src/XCAFDoc/XCAFDoc_Material.cxx b/src/XCAFDoc/XCAFDoc_Material.cxx index 3b8c887a87..31cdc46479 100644 --- a/src/XCAFDoc/XCAFDoc_Material.cxx +++ b/src/XCAFDoc/XCAFDoc_Material.cxx @@ -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) + } } diff --git a/src/XCAFDoc/XCAFDoc_MaterialTool.cxx b/src/XCAFDoc/XCAFDoc_MaterialTool.cxx index 242db45e59..8ec77e5fd1 100644 --- a/src/XCAFDoc/XCAFDoc_MaterialTool.cxx +++ b/src/XCAFDoc/XCAFDoc_MaterialTool.cxx @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -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) + } } diff --git a/src/gp/gp_Ax3.cxx b/src/gp/gp_Ax3.cxx index 5e233bf74c..6e8bd011ef 100644 --- a/src/gp/gp_Ax3.cxx +++ b/src/gp/gp_Ax3.cxx @@ -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; }