//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)
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)
}
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, TDF_Attribute)
OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myString)
- OCCT_DUMP_FIELD_VALUE_GUID (theOStream, myID)
}
}
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myLower)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myUpper)
- OCCT_DUMP_FIELD_VALUE_GUID (theOStream, myID)
}
const Standard_Byte& aValue = aListIt.Value();
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, aValue)
}
- OCCT_DUMP_FIELD_VALUE_GUID (theOStream, myID)
}
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, aValue)
}
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsDelta)
- OCCT_DUMP_FIELD_VALUE_GUID (theOStream, myID)
}
//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();
}
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsDelta)
- OCCT_DUMP_FIELD_VALUE_GUID (theOStream, myID)
}
//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)
}
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, TDF_Attribute)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myValue)
- OCCT_DUMP_FIELD_VALUE_GUID (theOStream, myID)
}
}
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsDelta)
- OCCT_DUMP_FIELD_VALUE_GUID (theOStream, myID)
}
const Standard_Integer& aValue = aListIt.Value();
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, aValue)
}
- OCCT_DUMP_FIELD_VALUE_GUID (theOStream, myID)
}
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, TDF_Attribute)
OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myString)
- OCCT_DUMP_FIELD_VALUE_GUID (theOStream, myID)
}
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myValue)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDimension)
- OCCT_DUMP_FIELD_VALUE_GUID (theOStream, myID)
}
}
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsDelta)
- OCCT_DUMP_FIELD_VALUE_GUID (theOStream, myID)
}
const Standard_Real& aValue = aListIt.Value();
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, aValue)
}
-
- OCCT_DUMP_FIELD_VALUE_GUID (theOStream, myID)
}
TDF_Tool::Entry (anArrayIt.Value(), aLabel);
OCCT_DUMP_FIELD_VALUE_STRING (theOStream, aLabel)
}
-
- OCCT_DUMP_FIELD_VALUE_GUID (theOStream, myID)
}
TDF_Tool::Entry (aListIt.Value(), aLabel);
OCCT_DUMP_FIELD_VALUE_STRING (theOStream, aLabel)
}
-
- OCCT_DUMP_FIELD_VALUE_GUID (theOStream, myID)
}
TDF_Tool::Entry (myLast->Label(), aLast);
OCCT_DUMP_FIELD_VALUE_STRING (theOStream, aLast)
}
-
- OCCT_DUMP_FIELD_VALUE_GUID (theOStream, myTreeID)
}
OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
OCCT_DUMP_BASE_CLASS (theOStream, theDepth, TDF_Attribute)
-
- OCCT_DUMP_FIELD_VALUE_GUID (theOStream, myID)
}
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())
{
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)
- }
}
{
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)
+ }
+}
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:
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)
+ }
+}
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:
{
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)
+ }
+}
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)
#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>
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)
+ }
}
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())
}
#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>
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)
+ }
}
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())
}
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())
}
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())
const Handle(XCAFDoc_GraphNode)& aChild = anIteratorChild.Value();
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, aChild.get())
}
-
- OCCT_DUMP_FIELD_VALUE_GUID (theOStream, myGraphID)
}
#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>
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)
+ }
}
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)
+ }
}
#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>
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)
+ }
}
SetXDirection (aXDir);
SetYDirection (anYDir);
+ if (!Direction().IsEqual (aDir, Precision::Confusion()))
+ return Standard_False;
+
theStreamPos = aPos;
return Standard_True;
}
#include <QObject>
#include <Standard_WarningsRestore.hxx>
-//#define USE_DUMPJSON
+#define USE_DUMPJSON
// =======================================================================
// function : hasAttribute
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();
}
// 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();
}
// =======================================================================
#ifdef USE_DUMPJSON
Handle(TDF_Attribute) anAttribute = GetAttribute();
if (!anAttribute.IsNull())
+ {
anAttribute->DumpJson (theOStream);
+ }
#else
(void)theOStream;
#endif
// 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";
}
// 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:
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();
+}
//! \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
// 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();
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
#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>
const int DEFAULT_PROPERTY_PANEL_HEIGHT = 200;
const int DEFAULT_BROWSER_HEIGHT = 800;
-//#define USE_DUMPJSON
+#define USE_DUMPJSON
// =======================================================================
// function : Constructor
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());
// 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());
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);
}
// =======================================================================
QModelIndex aParentIndex = aModel->index (0, 0);
setExpandedLevels (myTreeView, aParentIndex, 3/*levels*/);
- myThread->ProcessApplication();
+ //myThread->ProcessApplication();
myModule->SetInitialTreeViewSelection();
}
void DFBrowser_Window::OpenFile (const TCollection_AsciiString& theFileName)
{
QApplication::setOverrideCursor (Qt::WaitCursor);
- myThread->TerminateThread();
+ //myThread->TerminateThread();
myTreeLevelLine->ClearHistory();
QItemSelectionModel* aSelectionModel = myModule->GetOCAFViewSelectionModel();
QModelIndex anIndex;
aSelectionModel->select (anIndex, QItemSelectionModel::ClearAndSelect);
}
- ClearThreadCache();
+ //ClearThreadCache();
myTreeLevelLine->ClearHistory();
QModelIndex aParentIndex = anOCAFViewModel->index (0, 0);
setExpandedLevels (myTreeView, aParentIndex, 3/*levels*/);
- myThread->ProcessApplication();
+ //myThread->ProcessApplication();
myModule->SetInitialTreeViewSelection();
QApplication::restoreOverrideCursor();
}
myTreeView->setModel (theModel);
QItemSelectionModel* aSelectionModel = new QItemSelectionModel (theModel);
+ myTreeView->setSelectionMode (QAbstractItemView::ExtendedSelection);
myTreeView->setSelectionModel (aSelectionModel);
connect (aSelectionModel, SIGNAL (selectionChanged (const QItemSelection&, const QItemSelection&)),
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
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);
+
}
// =======================================================================
class DFBrowser_DumpView;
class DFBrowser_Module;
class DFBrowser_PropertyPanel;
-class DFBrowser_Thread;
+//class DFBrowser_Thread;
class DFBrowser_TreeLevelLine;
class ViewControl_MessageDialog;
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; }
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
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
};