]> OCCT Git - occt-copy.git/commitdiff
0031350: Inspectors - property view in DFBrowser for DumpJson CR0_DMUReviewer_IR-2020-05-15_CR29451
authornds <nds@opencascade.com>
Mon, 9 Nov 2020 03:24:03 +0000 (06:24 +0300)
committernds <nds@opencascade.com>
Tue, 17 Nov 2020 10:29:58 +0000 (13:29 +0300)
(cherry picked from commit 19b5d8465313c119c9d2f344041e67883226ec61)

46 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_Name.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_GeomTolerance.cxx
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
tools/DFBrowser/DFBrowser_Item.cxx
tools/DFBrowser/DFBrowser_ItemApplication.cxx
tools/DFBrowser/DFBrowser_ItemBase.cxx
tools/DFBrowser/DFBrowser_ItemBase.hxx
tools/DFBrowser/DFBrowser_ItemDocument.cxx
tools/DFBrowser/DFBrowser_TreeLevelViewModel.cxx
tools/DFBrowser/DFBrowser_Window.cxx
tools/DFBrowser/DFBrowser_Window.hxx
tools/DFBrowserPane/DFBrowserPane_ItemRole.hxx

index 160c2cdc88904ce5e05cd9328c32dcf7ab109caa..1de7eef4efabf4e929899efa099449676c01fbc5 100644 (file)
@@ -150,12 +150,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 c0eaf85b76b58c811cc2455b698ea23b35b27da0..dedc1c98792ea064fe1f9eaae83657c70a5af2ea 100644 (file)
@@ -418,10 +418,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 279c14db1c5fc38b269b1d7f24dd3cb62ff5ef7a..d4e102289dc7deaafde2f85dbd7f09ba86602357 100644 (file)
@@ -205,5 +205,4 @@ void TDataStd_Name::DumpJson (Standard_OStream& theOStream, Standard_Integer the
   OCCT_DUMP_BASE_CLASS (theOStream, theDepth, TDF_Attribute)
 
   OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myString)
-  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 f79a5e45e1731dc0a4344101201dc6ca0d96e845..d453ddcdf27c93b84eaba7dabf5240a631af56ff 100644 (file)
@@ -910,6 +910,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 56728584d8597638e0dab08321481354a1a11bb1..be20a26f0e260e309a129a32a6f928166d900e42 100644 (file)
@@ -312,3 +312,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 aName = myName->ToCString();
+    OCCT_DUMP_FIELD_VALUE_STRING (theOStream, aName)
+  }
+  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 b1eb5343ef1f728fe752d505028c5cbf412a2566..23ba4ac7386e95f5c2200dc60c8d31dc4bf5a969 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 f810bf99400968b25d639c6f4e133d9ae691760f..eb0e6d8bc68eead3d38c673c2abb3cd470fe7726 100644 (file)
@@ -472,3 +472,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 88bd42fdccf9dd5a3e09273f6ba5e1e3a5bfe391..4eb160920fa4978af2887601ad65fca75bd1cd2b 100644 (file)
@@ -277,3 +277,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 7a9e5779a3ba56988333010073b9f96cb1af900f..4388536ac47f81ec3b7484cf76996ea9bac2c28b 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>
@@ -810,5 +811,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 f2f904580297fd83f9b4fe3336f1a46e2ff51214..9935fb28470cd90693519c39d11d78ee0c8a5aae 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>
@@ -1102,5 +1103,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 f25f12b6ba6879b845bd9e179b522a4ee413e502..c0fac77ec0f4430bec796b0a982a6f52c1463d1b 100644 (file)
@@ -471,4 +471,7 @@ void XCAFDoc_Dimension::DumpJson (Standard_OStream& theOStream, Standard_Integer
   OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
 
   OCCT_DUMP_BASE_CLASS (theOStream, theDepth, TDF_Attribute)
+
+  Handle(XCAFDimTolObjects_DimensionObject) anObject = GetObject();
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, anObject.get())
 }
index 8e9c0ea743609633e3fbbd66e74c4e6050606dad..33cc16f2d1088186940861be71d5ae98a6d886d5 100644 (file)
@@ -441,4 +441,7 @@ void XCAFDoc_GeomTolerance::DumpJson (Standard_OStream& theOStream, Standard_Int
   OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
 
   OCCT_DUMP_BASE_CLASS (theOStream, theDepth, TDF_Attribute)
+
+  Handle(XCAFDimTolObjects_GeomToleranceObject) anObject = GetObject();
+  OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, anObject.get())
 }
index b07d59ca0cbb86698ce9cc7173d65692fac131bc..277d994c58a2c82ba2a78a87a2c098dc63fdb153 100644 (file)
@@ -499,7 +499,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())
@@ -507,6 +507,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 95bf9f55bfd81eb22e07af1a32e34fa90602e38d..57e4eb3d23a0280cd6cbb1c0ce484355c9cbe120 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>
@@ -632,5 +633,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)
+  }
 }
index 3b8c887a874ea32920e45a3b5e37208de795b4c9..6eef4f5c301cf6f45a18370d8e2b1257e78e322c 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 aName = myName->ToCString();
+    OCCT_DUMP_FIELD_VALUE_STRING (theOStream, aName)
+  }
+  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 f50676b6ac3a285d64b798b38d54d0cc1944d14f..57866ff380fa279387350e74e0ceefed8389ddd5 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>
@@ -276,5 +277,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 93e6d357579ebe3a211f3245eaacfec8691021a1..f99586d760f9af30cfe4ae986b9aa97113206a1b 100644 (file)
@@ -134,6 +134,9 @@ Standard_Boolean  gp_Ax3::InitFromJson (const Standard_SStream& theSStream, Stan
   SetXDirection (aXDir);
   SetYDirection (anYDir);
 
+  if (!Direction().IsEqual (aDir, Precision::Confusion()))
+    return Standard_False;
+
   theStreamPos = aPos;
   return Standard_True;
 }
index 28f482ac3c1f17941380f24099b68871b670d48d..78a010eb62c2de1ef88d291700c725a9ea8bb058 100644 (file)
@@ -31,7 +31,7 @@
 #include <QObject>
 #include <Standard_WarningsRestore.hxx>
 
-//#define USE_DUMPJSON
+#define USE_DUMPJSON
 
 // =======================================================================
 // function : hasAttribute
@@ -77,24 +77,18 @@ void DFBrowser_Item::Init()
     int anAttributeId = 0;
     for (TDF_AttributeIterator anAttrIt (aParentLabel); anAttrIt.More(); anAttrIt.Next(), anAttributeId++)
     {
-      if (anAttributeId == aRowId)
-        anAttribute = anAttrIt.Value();
+      if (anAttributeId != aRowId)
+      {
+        continue;
+      }
+      anAttribute = anAttrIt.Value();
+      break;
     }
     SetAttribute (anAttribute);
   }
   else {
     int aCurrentId = aRowId - aNbAttributes;
-    TDF_ChildIterator aLabelsIt (aParentLabel);
-    TDF_Label aLabel;
-    for (int aLabelId = 0; aLabelsIt.More(); aLabelsIt.Next(), aLabelId++)
-    {
-      if (aLabelId < aCurrentId)
-        continue;
-      aLabel = aLabelsIt.Value();
-      break;
-    }
-    if (!aLabel.IsNull())
-      setLabel (aLabel);
+    aParentItem->InitChildLabels (aRowId, aCurrentId);
   }
   TreeModel_ItemBase::Init();
 }
@@ -123,30 +117,53 @@ int DFBrowser_Item::initRowCount() const
 // function : initValue
 // purpose :
 // =======================================================================
-QVariant DFBrowser_Item::initValue (const int theItemRole) const
+QVariant DFBrowser_Item::initValue (const int theRole) const
 {
   if (!HasAttribute())
-    return DFBrowser_ItemBase::initValue (theItemRole);
-
-  if (theItemRole == DFBrowserPane_ItemRole_DisplayExtended || theItemRole == DFBrowserPane_ItemRole_ToolTipExtended)
   {
-    int aRole = theItemRole == DFBrowserPane_ItemRole_DisplayExtended ? Qt::DisplayRole : Qt::ToolTipRole;
-    QVariant aValue = DFBrowser_Module::GetAttributeInfo (GetAttribute(), GetModule(), aRole, Column());
-    QString anAdditionalInfo = DFBrowser_Module::GetAttributeInfo (GetAttribute(), GetModule(),
-                                                                    DFBrowser_ItemRole_AdditionalInfo, Column()).toString();
-    if (!anAdditionalInfo.isEmpty())
+    // label item
+    return DFBrowser_ItemBase::initValue (theRole);
+  }
+  else
+  {
+    // attribute item
+    switch (theRole)
     {
-      if (theItemRole == DFBrowserPane_ItemRole_DisplayExtended)
-        anAdditionalInfo = TreeModel_Tools::CutString (anAdditionalInfo);
-      if (!anAdditionalInfo.isEmpty())
-        aValue = QVariant (aValue.toString() + QString (" [%1]").arg (anAdditionalInfo));
-      //if (aRole == Qt::ToolTipRole)
-      //  aValue = wrapTextByWords(aValue.toString().toStdString(), INFO_LENGHT).c_str();
+      case Qt::DisplayRole:
+      case Qt::ToolTipRole:
+      case Qt::DecorationRole:
+      case Qt::ForegroundRole:
+      case DFBrowserPane_ItemRole_DisplayShort:
+      case DFBrowser_ItemRole_AdditionalInfo:
+      {
+        if (Column() == 0)
+          return DFBrowser_Module::GetAttributeInfo (GetAttribute(), GetModule(), theRole, Column());
+        else
+          return QVariant();
+      }
+      case DFBrowserPane_ItemRole_DisplayExtended:
+      case DFBrowserPane_ItemRole_ToolTipExtended:
+      {
+        int aRole = theRole == DFBrowserPane_ItemRole_DisplayExtended ? Qt::DisplayRole : Qt::ToolTipRole;
+        QVariant aValue = DFBrowser_Module::GetAttributeInfo (GetAttribute(), GetModule(), aRole, Column());
+        QString anAdditionalInfo = DFBrowser_Module::GetAttributeInfo (GetAttribute(), GetModule(),
+                                                                        DFBrowser_ItemRole_AdditionalInfo, Column()).toString();
+        if (!anAdditionalInfo.isEmpty())
+        {
+          if (theRole == DFBrowserPane_ItemRole_DisplayExtended)
+            anAdditionalInfo = TreeModel_Tools::CutString (anAdditionalInfo);
+          if (!anAdditionalInfo.isEmpty())
+            aValue = QVariant (aValue.toString() + QString (" [%1]").arg (anAdditionalInfo));
+          //if (aRole == Qt::ToolTipRole)
+          //  aValue = wrapTextByWords(aValue.toString().toStdString(), INFO_LENGHT).c_str();
+        }
+        return aValue;
+      }
+      default:
+        break;
     }
-    return aValue;
   }
-
-  return DFBrowser_Module::GetAttributeInfo (GetAttribute(), GetModule(), theItemRole, Column());
+  return QVariant();
 }
 
 // =======================================================================
@@ -161,7 +178,9 @@ void DFBrowser_Item::initStream (Standard_OStream& theOStream) const
 #ifdef USE_DUMPJSON
   Handle(TDF_Attribute) anAttribute = GetAttribute();
   if (!anAttribute.IsNull())
+  {
     anAttribute->DumpJson (theOStream);
+  }
 #else
   (void)theOStream;
 #endif
index 4fa7ec824c29f070587a959e718127bb27226edc..599a5af27a03ba9e4bb2d180c48d94beffae8205 100644 (file)
@@ -56,13 +56,13 @@ int DFBrowser_ItemApplication::initRowCount() const
 // function : initValue
 // purpose :
 // =======================================================================
-QVariant DFBrowser_ItemApplication::initValue (const int theItemRole) const
+QVariant DFBrowser_ItemApplication::initValue (const int theRole) const
 {
-  if (theItemRole == Qt::DisplayRole ||
-      theItemRole == Qt::EditRole ||
-      theItemRole == Qt::ToolTipRole ||
-      theItemRole == DFBrowserPane_ItemRole_DisplayExtended ||
-      theItemRole == DFBrowserPane_ItemRole_ToolTipExtended)
+  if (theRole == Qt::DisplayRole ||
+      theRole == Qt::EditRole ||
+      theRole == Qt::ToolTipRole ||
+      theRole == DFBrowserPane_ItemRole_DisplayExtended ||
+      theRole == DFBrowserPane_ItemRole_ToolTipExtended)
   {
     return "TDocStd_Application";
   }
index e1d696b63e523cd32dc86d2b1f50fc3245dd08f3..faadb7e56fb0aeca517a8745d58af85a8b837715 100644 (file)
@@ -96,12 +96,11 @@ int DFBrowser_ItemBase::initRowCount() const
 // function : initValue
 // purpose :
 // =======================================================================
-QVariant DFBrowser_ItemBase::initValue (const int theItemRole) const
+QVariant DFBrowser_ItemBase::initValue (const int theRole) const
 {
-  switch (theItemRole)
+  switch (theRole)
   {
     case Qt::DisplayRole:
-    case Qt::EditRole:
     case Qt::ToolTipRole:
       return DFBrowser_Tools::GetLabelInfo (myLabel, false);
     case DFBrowserPane_ItemRole_DisplayExtended:
@@ -150,3 +149,46 @@ bool DFBrowser_ItemBase::SetUseAdditionalInfo (const bool theValue)
   return aPreviousValue;
 }
 
+// =======================================================================
+// function : InitChildLabels
+// purpose :
+// =======================================================================
+void DFBrowser_ItemBase::InitChildLabels (const int theChildId, const int theLabelId)
+{
+  TDF_Label aParentLabel = GetLabel();
+  // items can exist only by items with not empty label
+  if (aParentLabel.IsNull())
+    return;
+
+  int aChildItem = theChildId;
+  TDF_ChildIterator aLabelsIt (aParentLabel);
+  TDF_Label aLabel;
+  for (int aLabelId = 0; aLabelsIt.More(); aLabelsIt.Next(), aLabelId++, aChildItem++)
+  {
+    if (aLabelId < theLabelId)
+      continue;
+    aLabel = aLabelsIt.Value();
+
+    TreeModel_ItemBasePtr aChild = Child(aChildItem, 0, true);
+    if (!aChild)
+    {
+      continue;
+    }
+    if (aChild->IsInitialized())
+    {
+      continue;
+    }
+    DFBrowser_ItemBasePtr aChildItem = itemDynamicCast<DFBrowser_Item> (aChild);
+    aChildItem->InitWithLabel (aLabel);
+  }
+}
+
+// =======================================================================
+// function : InitWithLabel
+// purpose :
+// =======================================================================
+void DFBrowser_ItemBase::InitWithLabel (TDF_Label theLabel)
+{
+  setLabel (theLabel);
+  TreeModel_ItemBase::Init();
+}
index c87ca1d0818a86341f6c031956cc10389bb6b98f..81fefedbbc2f045fe05d4448d79be8a05278f962 100644 (file)
@@ -59,6 +59,15 @@ public:
   //! \param theRole the item model role
   Standard_EXPORT virtual QVariant data (const QModelIndex& theIndex, int theRole) const Standard_OVERRIDE;
 
+  //! Iterates through the label and initialize all children in and after the given position
+  //! \param theChildId an index of this label child
+  //! \param theLabelId an index of the label
+  void InitChildLabels (const int theChildId, const int theLabelId);
+
+  //! Inits the item by the label
+  //! \theLabel label for this item
+  Standard_EXPORT void InitWithLabel (TDF_Label theLabel);
+
 protected:
 
   //! Sets the item label
index 915b1d368f605eb22e9ea7b93955bca91b85b6f3..441a41b94c8634871d72f0992f47c48c9b25c46d 100644 (file)
@@ -62,14 +62,14 @@ const Handle(TDocStd_Document)& DFBrowser_ItemDocument::getDocument() const
 // function : initValue
 // purpose :
 // =======================================================================
-QVariant DFBrowser_ItemDocument::initValue (const int theItemRole) const
+QVariant DFBrowser_ItemDocument::initValue (const int theRole) const
 {
-  if (theItemRole == Qt::DisplayRole ||
-      theItemRole == Qt::EditRole ||
-      theItemRole == DFBrowserPane_ItemRole_DisplayExtended ||
-      theItemRole == DFBrowserPane_ItemRole_ToolTipExtended)
+  if (theRole == Qt::DisplayRole ||
+      theRole == Qt::EditRole ||
+      theRole == DFBrowserPane_ItemRole_DisplayExtended ||
+      theRole == DFBrowserPane_ItemRole_ToolTipExtended)
     return DFBrowser_Tools::GetLabelInfo (GetLabel());
-  if (theItemRole == Qt::DecorationRole)
+  if (theRole == Qt::DecorationRole)
     return DFBrowser_Tools::GetLabelIcon (GetLabel());
 
   return QVariant();
index 59c6a7f14f0c42b906d5fd4ec4997f1c441b66b7..8e33600606019d2200ee34b4bf20fc82d4a373bf 100644 (file)
@@ -95,8 +95,8 @@ QVariant DFBrowser_TreeLevelViewModel::data (const QModelIndex& theIndex, int th
     if (!aDBrowserItem)
       return QVariant();
 
-    bool aPrevValue = aDBrowserItem->SetUseAdditionalInfo (false);
-    aValue = anItemBase->data (anIndex, theRole);
+    bool aPrevValue = aDBrowserItem->SetUseAdditionalInfo (false);  
+    aValue = anItemBase->data (anIndex, DFBrowserPane_ItemRole_DisplayShort);/*anItemBase->data (anIndex, theRole);*/
     aDBrowserItem->SetUseAdditionalInfo (aPrevValue);
   }
   else { // column = 1
index 01b100b1899111e4e0f7b1cecedafa8e0b99e818..455e06600c76578094e0d0d83a008d4dce6f8581 100644 (file)
@@ -33,8 +33,8 @@
 #include <inspector/DFBrowser_PropertyPanel.hxx>
 #include <inspector/DFBrowser_SearchLine.hxx>
 #include <inspector/DFBrowser_SearchView.hxx>
-#include <inspector/DFBrowser_Thread.hxx>
-#include <inspector/DFBrowser_ThreadItemSearch.hxx>
+//#include <inspector/DFBrowser_Thread.hxx>
+//#include <inspector/DFBrowser_ThreadItemSearch.hxx>
 #include <inspector/DFBrowser_Tools.hxx>
 #include <inspector/DFBrowser_TreeLevelLine.hxx>
 #include <inspector/DFBrowser_TreeLevelView.hxx>
@@ -101,7 +101,7 @@ const int DFBROWSER_DEFAULT_POSITION_Y = 60;
 const int DEFAULT_PROPERTY_PANEL_HEIGHT = 200;
 const int DEFAULT_BROWSER_HEIGHT = 800;
 
-//#define USE_DUMPJSON
+#define USE_DUMPJSON
 
 // =======================================================================
 // function : Constructor
@@ -163,7 +163,7 @@ DFBrowser_Window::DFBrowser_Window()
            this, SLOT (onLevelDoubleClicked (const QModelIndex&)));
 
   // property widget
-  QDockWidget* aPropertyPanelWidget = new QDockWidget (tr ("PropertyPanel"), myMainWindow);
+  QDockWidget* aPropertyPanelWidget = new QDockWidget (tr ("Properties additional"), myMainWindow);
   aPropertyPanelWidget->setObjectName (aPropertyPanelWidget->windowTitle());
   aPropertyPanelWidget->setTitleBarWidget (new QWidget(myMainWindow));
   aPropertyPanelWidget->setWidget (myPropertyPanel->GetControl());
@@ -171,7 +171,7 @@ DFBrowser_Window::DFBrowser_Window()
 
   // property view
 #ifdef USE_DUMPJSON
-  myPropertyPanelWidget = new QDockWidget (tr ("PropertyPanel (DumpJson)"), myMainWindow);
+  myPropertyPanelWidget = new QDockWidget (tr ("PropertyPanel"), myMainWindow);
   myPropertyView = new ViewControl_PropertyView (myMainWindow,
     QSize(DFBROWSER_DEFAULT_VIEW_WIDTH, DFBROWSER_DEFAULT_VIEW_HEIGHT));
   myPropertyPanelWidget->setObjectName (myPropertyPanelWidget->windowTitle());
@@ -209,15 +209,15 @@ DFBrowser_Window::DFBrowser_Window()
   myMainWindow->splitDockWidget (aPropertyPanelWidget, aViewDockWidget, Qt::Vertical);
 
 #ifdef USE_DUMPJSON
-  myMainWindow->tabifyDockWidget (aDumpDockWidget, myPropertyPanelWidget);
-  myMainWindow->tabifyDockWidget (myPropertyPanelWidget, aViewDockWidget);
+  myMainWindow->tabifyDockWidget (myPropertyPanelWidget, aPropertyPanelWidget);
+  myMainWindow->tabifyDockWidget (aDumpDockWidget, aViewDockWidget);
 #else
   myMainWindow->tabifyDockWidget (aDumpDockWidget, aViewDockWidget);
 #endif
 
   myTreeView->resize (DFBROWSER_DEFAULT_TREE_VIEW_WIDTH, DFBROWSER_DEFAULT_TREE_VIEW_HEIGHT);
 
-  myThread = new DFBrowser_Thread (this);
+  //myThread = new DFBrowser_Thread (this);
 }
 
 // =======================================================================
@@ -470,7 +470,7 @@ void DFBrowser_Window::Init (const NCollection_List<Handle(Standard_Transient)>&
   QModelIndex aParentIndex = aModel->index (0, 0);
   setExpandedLevels (myTreeView, aParentIndex, 3/*levels*/);
 
-  myThread->ProcessApplication();
+  //myThread->ProcessApplication();
   myModule->SetInitialTreeViewSelection();
 }
 
@@ -481,7 +481,7 @@ void DFBrowser_Window::Init (const NCollection_List<Handle(Standard_Transient)>&
 void DFBrowser_Window::OpenFile (const TCollection_AsciiString& theFileName)
 {
   QApplication::setOverrideCursor (Qt::WaitCursor);
-  myThread->TerminateThread();
+  //myThread->TerminateThread();
 
   myTreeLevelLine->ClearHistory();
   QItemSelectionModel* aSelectionModel = myModule->GetOCAFViewSelectionModel();
@@ -491,7 +491,7 @@ void DFBrowser_Window::OpenFile (const TCollection_AsciiString& theFileName)
     QModelIndex anIndex;
     aSelectionModel->select (anIndex, QItemSelectionModel::ClearAndSelect);
   }
-  ClearThreadCache();
+  //ClearThreadCache();
 
   myTreeLevelLine->ClearHistory();
 
@@ -539,7 +539,7 @@ void DFBrowser_Window::OpenFile (const TCollection_AsciiString& theFileName)
     QModelIndex aParentIndex = anOCAFViewModel->index (0, 0);
     setExpandedLevels (myTreeView, aParentIndex, 3/*levels*/);
 
-    myThread->ProcessApplication();
+    //myThread->ProcessApplication();
     myModule->SetInitialTreeViewSelection();
     QApplication::restoreOverrideCursor();
   }
@@ -594,6 +594,7 @@ void DFBrowser_Window::setOCAFModel (QAbstractItemModel* theModel)
   myTreeView->setModel (theModel);
 
   QItemSelectionModel* aSelectionModel = new QItemSelectionModel (theModel);
+  myTreeView->setSelectionMode (QAbstractItemView::ExtendedSelection);
   myTreeView->setSelectionModel (aSelectionModel);
 
   connect (aSelectionModel, SIGNAL (selectionChanged (const QItemSelection&, const QItemSelection&)),
@@ -611,18 +612,18 @@ void DFBrowser_Window::setOCAFModel (QAbstractItemModel* theModel)
 void DFBrowser_Window::onBeforeUpdateTreeModel()
 {
   myTreeLevelLine->ClearHistory();
-  ClearThreadCache();
-  myThread->ProcessApplication();
+  //ClearThreadCache();
+  //myThread->ProcessApplication();
 }
 
 // =======================================================================
 // function : ClearThreadCache
 // purpose :
 // =======================================================================
-void DFBrowser_Window::ClearThreadCache()
-{
-  DFBrowser_ThreadItemSearch::ClearValues (GetTreeLevelLine()->GetSearchLine());
-}
+//void DFBrowser_Window::ClearThreadCache()
+//{
+  //DFBrowser_ThreadItemSearch::ClearValues (GetTreeLevelLine()->GetSearchLine());
+//}
 
 // =======================================================================
 // function : TmpDirectory
@@ -750,6 +751,25 @@ void DFBrowser_Window::onTreeViewSelectionChanged (const QItemSelection& theSele
   
   aDisplayer->ErasePresentations (View_PresentationType_Additional, false);
   aDisplayer->DisplayPresentation (findPresentation (aSelectedIndex), View_PresentationType_Main);
+
+
+  // update preview
+  NCollection_List<Handle(Standard_Transient)> aSelPresentations;
+  //QModelIndexList aSelectedIndices = myTreeView->selectionModel()->selectedIndexes();
+  for (QModelIndexList::const_iterator aSelIt = aSelectedIndices.begin(); aSelIt != aSelectedIndices.end(); aSelIt++)
+  {
+    QModelIndex anIndex = *aSelIt;
+    if (anIndex.column() != 0)
+      continue;
+
+    TreeModel_ItemBasePtr anItemBase = TreeModel_ModelBase::GetItemByIndex (anIndex);
+    if (!anItemBase)
+      continue;
+
+    anItemBase->Presentations (aSelPresentations);
+  }
+  aDisplayer->UpdatePreview (View_DisplayActionType_DisplayId, aSelPresentations);
+
 }
 
 // =======================================================================
index 17b2f21c4d494c73bee306fc3a24f77a3cceefd6..3ee6f9a5f420e60229595a1de79e6b86005b0e2c 100644 (file)
@@ -35,7 +35,7 @@
 class DFBrowser_DumpView;
 class DFBrowser_Module;
 class DFBrowser_PropertyPanel;
-class DFBrowser_Thread;
+//class DFBrowser_Thread;
 class DFBrowser_TreeLevelLine;
 
 class ViewControl_MessageDialog;
@@ -109,7 +109,7 @@ public:
   DFBrowser_Module* GetModule() const { return myModule; }
 
   //! Clears thread cache
-  Standard_EXPORT void ClearThreadCache();
+  //Standard_EXPORT void ClearThreadCache();
 
   //! Returns tree level line control
   DFBrowser_TreeLevelLine* GetTreeLevelLine() const { return myTreeLevelLine; }
@@ -220,7 +220,7 @@ private:
   ViewControl_PropertyView* myPropertyView; //!< property control to display model item values if exist
   View_Window* myViewWindow; //!< V3d view to visualize presentations/references if it can be build for a selected item
   DFBrowser_DumpView* myDumpView; //!< Text editor where "Dump" method output is shown
-  DFBrowser_Thread* myThread; //!< Threads manipulator, starting thread items, listens finalizing
+  //DFBrowser_Thread* myThread; //!< Threads manipulator, starting thread items, listens finalizing
   ViewControl_MessageDialog* myExportToShapeViewDialog; //!< dialog about exporting TopoDS_Shape to ShapeView plugin
   Handle(TInspectorAPI_PluginParameters) myParameters; //!< contains application, context, files that should be opened
   QString myOpenedFileName; //!< cached name of opened file between parent is set, apply it by parent setting and nullify
index 2cdd55b690929fa90dfa4dc023af2363ea07098a..252d75c461bc281bb5c2eb5d285d358356a8e725 100644 (file)
@@ -25,6 +25,7 @@ enum DFBrowserPane_ItemRole
   DFBrowserPane_ItemRole_Decoration_40x40, //!< icon with greater size
   DFBrowserPane_ItemRole_DisplayExtended, // extended item information (with additional information) for Qt::DisplayRole
   DFBrowserPane_ItemRole_ToolTipExtended, // exteneded tool tip information for Qt::ToolTipRole
+  DFBrowserPane_ItemRole_DisplayShort, // extended item information (with additional information) for Qt::DisplayRole
   DFBrowserPane_ItemRole_LastTreeRole //! last enumeration value to use outside incremented
 };