1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-29 14:00:49 +03:00

0029119: Documentation for PMI in XCAF

Documentation is added to the XDE part of the User Guide for GD&T, Clipping planes and Saved view components.
This commit is contained in:
snn
2017-09-22 11:08:30 +03:00
committed by kgv
parent 6fd0eb0c1e
commit a8a3b37c0d
15 changed files with 707 additions and 232 deletions

View File

@@ -35,7 +35,7 @@
class XCAFDimTolObjects_DatumObject;
DEFINE_STANDARD_HANDLE(XCAFDimTolObjects_DatumObject, Standard_Transient)
//! object to store datum
//! Access object to store datum
class XCAFDimTolObjects_DatumObject : public Standard_Transient
{
@@ -45,93 +45,131 @@ public:
Standard_EXPORT XCAFDimTolObjects_DatumObject(const Handle(XCAFDimTolObjects_DatumObject)& theObj);
//! Returns datum name.
Standard_EXPORT Handle(TCollection_HAsciiString) GetName() const;
//! Sets datum name.
Standard_EXPORT void SetName (const Handle(TCollection_HAsciiString)& theTag);
//! Returns a sequence of modifiers of the datum.
Standard_EXPORT XCAFDimTolObjects_DatumModifiersSequence GetModifiers() const;
//! Sets new sequence of datum modifiers.
Standard_EXPORT void SetModifiers (const XCAFDimTolObjects_DatumModifiersSequence& theModifiers);
Standard_EXPORT void GetModifierWithValue (XCAFDimTolObjects_DatumModifWithValue& theModifier, Standard_Real& theValue) const;
//! Retrieves datum modifier with value.
Standard_EXPORT void GetModifierWithValue (XCAFDimTolObjects_DatumModifWithValue& theModifier,
Standard_Real& theValue) const;
Standard_EXPORT void SetModifierWithValue (const XCAFDimTolObjects_DatumModifWithValue theModifier, const Standard_Real theValue);
//! Sets datum modifier with value.
Standard_EXPORT void SetModifierWithValue (const XCAFDimTolObjects_DatumModifWithValue theModifier,
const Standard_Real theValue);
//! Adds a modifier to the datum sequence of modifiers.
Standard_EXPORT void AddModifier (const XCAFDimTolObjects_DatumSingleModif theModifier);
//! Returns datum target shape.
Standard_EXPORT TopoDS_Shape GetDatumTarget() const;
//! Sets datum target shape.
Standard_EXPORT void SetDatumTarget (const TopoDS_Shape& theShape);
//! Returns datum position in the related geometric tolerance object.
Standard_EXPORT Standard_Integer GetPosition () const;
//! Sets datum position in the related geometric tolerance object.
Standard_EXPORT void SetPosition (const Standard_Integer thePosition);
//! Returns True if the datum target is specified.
Standard_EXPORT Standard_Boolean IsDatumTarget() const;
//! Sets or drops the datum target indicator.
Standard_EXPORT void IsDatumTarget(const Standard_Boolean theIsDT);
//! Returns datum target type
Standard_EXPORT XCAFDimTolObjects_DatumTargetType GetDatumTargetType() const;
//! Sets datum target to point, line, rectangle, circle or area type.
Standard_EXPORT void SetDatumTargetType (const XCAFDimTolObjects_DatumTargetType theType);
//! Returns datum target axis.
//! The Z axis of the datum placement denotes the normal of the surface
//! pointing away from the material.
Standard_EXPORT gp_Ax2 GetDatumTargetAxis() const;
//! Sets datum target axis.
Standard_EXPORT void SetDatumTargetAxis (const gp_Ax2& theAxis);
//! Returns datum target length for line and rectangle types.
//! The length along the X axis of the datum placement.
Standard_EXPORT Standard_Real GetDatumTargetLength() const;
//! Sets datum target length.
Standard_EXPORT void SetDatumTargetLength (const Standard_Real theLength);
//! Returns datum target width for rectangle type.
//! The width along the derived Y axis, with the placement itself positioned
//! at the centre of the rectangle.
Standard_EXPORT Standard_Real GetDatumTargetWidth() const;
//! Sets datum target width.
Standard_EXPORT void SetDatumTargetWidth (const Standard_Real theWidth);
//! Returns datum target number.
Standard_EXPORT Standard_Integer GetDatumTargetNumber() const;
//! Sets datum target number.
Standard_EXPORT void SetDatumTargetNumber (const Standard_Integer theNumber);
Standard_EXPORT void SetPlane (const gp_Ax2& thePlane)
//! Sets annotation plane.
Standard_EXPORT void SetPlane (const gp_Ax2& thePlane)
{
myPlane = thePlane;
myHasPlane = Standard_True;
}
Standard_EXPORT const gp_Ax2& GetPlane() const { return myPlane; }
//! Returns annotation plane.
Standard_EXPORT const gp_Ax2& GetPlane() const { return myPlane; }
Standard_EXPORT void SetPoint (const gp_Pnt& thePnt)
//! Sets a point on the datum target shape.
Standard_EXPORT void SetPoint (const gp_Pnt& thePnt)
{
myPnt = thePnt;
myHasPnt = Standard_True;
}
Standard_EXPORT const gp_Pnt& GetPoint() const
//! Gets point on the datum shape.
Standard_EXPORT const gp_Pnt& GetPoint() const
{
return myPnt;
}
Standard_EXPORT void SetPointTextAttach (const gp_Pnt& thePntText)
//! Sets a position of the datum text.
Standard_EXPORT void SetPointTextAttach (const gp_Pnt& thePntText)
{
myPntText = thePntText;
myHasPntText = Standard_True;
}
Standard_EXPORT const gp_Pnt& GetPointTextAttach() const
//! Gets datum text position.
Standard_EXPORT const gp_Pnt& GetPointTextAttach() const
{
return myPntText;
}
//! Returns True if the datum has annotation plane.
Standard_Boolean HasPlane() const { return myHasPlane; }
//! Returns True if point on the datum target is specified.
Standard_Boolean HasPoint() const { return myHasPnt; }
Standard_EXPORT Standard_Boolean HasPointText() const
//! Returns True if the datum text position is specified.
Standard_EXPORT Standard_Boolean HasPointText() const
{
return myHasPntText;
}
//! Set graphical presentation for object
//! Set graphical presentation for object.
Standard_EXPORT void SetPresentation(const TopoDS_Shape& thePresentation,
const Handle(TCollection_HAsciiString)& thePresentationName)
{
@@ -139,19 +177,19 @@ public:
myPresentationName = thePresentationName;
}
//! Returns graphical presentation of the object
//! Returns graphical presentation of the object.
Standard_EXPORT TopoDS_Shape GetPresentation() const
{
return myPresentation;
}
//! Returns graphical presentation of the object
//! Returns graphical presentation of the object.
Standard_EXPORT Handle(TCollection_HAsciiString) GetPresentationName() const
{
return myPresentationName;
}
//! Returns true if datum has valid parameters for datum target (width, length, circle radius etc)
//! Returns True if the datum has valid parameters for datum target (width, length, circle radius etc)
Standard_EXPORT Standard_Boolean HasDatumTargetParams()
{
return myIsValidDT;
@@ -181,7 +219,8 @@ private:
Standard_Boolean myHasPnt;
Standard_Boolean myHasPntText;
TopoDS_Shape myPresentation;
Handle(TCollection_HAsciiString) myPresentationName;
Handle(TCollection_HAsciiString) myPresentationName;
};
#endif // _XCAFDimTolObjects_DatumObject_HeaderFile

View File

@@ -44,7 +44,7 @@
class XCAFDimTolObjects_DimensionObject;
DEFINE_STANDARD_HANDLE(XCAFDimTolObjects_DimensionObject, Standard_Transient)
//! object to store dimension
//! Access object to store dimension data
class XCAFDimTolObjects_DimensionObject : public Standard_Transient
{
@@ -54,125 +54,181 @@ public:
Standard_EXPORT XCAFDimTolObjects_DimensionObject(const Handle(XCAFDimTolObjects_DimensionObject)& theObj);
//! Sets dimension qualifier as min., max. or average.
Standard_EXPORT void SetQualifier (const XCAFDimTolObjects_DimensionQualifier theQualifier);
//! Returns dimension qualifier.
Standard_EXPORT XCAFDimTolObjects_DimensionQualifier GetQualifier() const;
//! Returns True if the object has dimension qualifier.
Standard_EXPORT Standard_Boolean HasQualifier() const;
//! Sets a specific type of dimension.
Standard_EXPORT void SetType (const XCAFDimTolObjects_DimensionType theTyupe);
//! Returns dimension type.
Standard_EXPORT XCAFDimTolObjects_DimensionType GetType() const;
//! Returns the main dimension value.
//! It will be the middle value in case of range dimension.
Standard_EXPORT Standard_Real GetValue() const;
//! Returns raw array of dimension values
Standard_EXPORT Handle(TColStd_HArray1OfReal) GetValues() const;
//! Sets the main dimension value.
//! Overwrites previous values.
Standard_EXPORT void SetValue (const Standard_Real theValue);
//! Replaces current raw array of dimension values with theValues array.
Standard_EXPORT void SetValues (const Handle(TColStd_HArray1OfReal)& theValue);
//! Returns True if the dimension is of range kind.
//! Dimension is of range kind if its values array contains two elements
//! defining lower and upper bounds.
Standard_EXPORT Standard_Boolean IsDimWithRange() const;
//! Sets the upper bound of the range dimension, otherwise
//! resets it to an empty range with the specified upper bound.
Standard_EXPORT void SetUpperBound (const Standard_Real theUpperBound);
Standard_EXPORT void SetLowerBound (const Standard_Real theLowerBound);
//! Sets the lower bound of the range dimension, otherwise
//! resets it to an empty range with the specified lower bound.
Standard_EXPORT void SetLowerBound(const Standard_Real theLowerBound);
//! Returns the upper bound of the range dimension, otherwise - zero.
Standard_EXPORT Standard_Real GetUpperBound() const;
//! Returns the lower bound of the range dimension, otherwise - zero.
Standard_EXPORT Standard_Real GetLowerBound() const;
//! Returns True if the dimension is of +/- tolerance kind.
//! Dimension is of +/- tolerance kind if its values array contains three elements
//! defining the main value and the lower/upper tolerances.
Standard_EXPORT Standard_Boolean IsDimWithPlusMinusTolerance() const;
Standard_EXPORT Standard_Boolean SetUpperTolValue (const Standard_Real theUperTolValue);
//! Sets the upper value of the toleranced dimension, otherwise
//! resets a simple dimension to toleranced one with the specified lower/upper tolerances.
//! Returns False in case of range dimension.
Standard_EXPORT Standard_Boolean SetUpperTolValue(const Standard_Real theUperTolValue);
Standard_EXPORT Standard_Boolean SetLowerTolValue (const Standard_Real theLowerTolValue);
//! Sets the lower value of the toleranced dimension, otherwise
//! resets a simple dimension to toleranced one with the specified lower/upper tolerances.
//! Returns False in case of range dimension.
Standard_EXPORT Standard_Boolean SetLowerTolValue(const Standard_Real theLowerTolValue);
//! Returns the lower value of the toleranced dimension, otherwise - zero.
Standard_EXPORT Standard_Real GetUpperTolValue() const;
//! Returns the upper value of the toleranced dimension, otherwise - zero.
Standard_EXPORT Standard_Real GetLowerTolValue() const;
//! Returns True if the form variance was set to not XCAFDimTolObjects_DimensionFormVariance_None value.
Standard_EXPORT Standard_Boolean IsDimWithClassOfTolerance() const;
Standard_EXPORT void SetClassOfTolerance (const Standard_Boolean theHole, const XCAFDimTolObjects_DimensionFormVariance theFormVariance, const XCAFDimTolObjects_DimensionGrade theGrade);
//! Sets tolerance class of the dimension.
//! \param theHole - True if the tolerance applies to an internal feature
//! \param theFormVariance - represents the fundamental deviation or "position letter"
//! of the ISO 286 limits-and-fits tolerance classification.
//! \param theGrade - represents the quality or the accuracy grade of a tolerance.
Standard_EXPORT void SetClassOfTolerance (const Standard_Boolean theHole,
const XCAFDimTolObjects_DimensionFormVariance theFormVariance,
const XCAFDimTolObjects_DimensionGrade theGrade);
Standard_EXPORT Standard_Boolean GetClassOfTolerance (Standard_Boolean& theHole, XCAFDimTolObjects_DimensionFormVariance& theFormVariance, XCAFDimTolObjects_DimensionGrade& theGrade) const;
//! Retrieves tolerance class parameters of the dimension.
//! Returns True if the dimension is toleranced.
Standard_EXPORT Standard_Boolean GetClassOfTolerance (Standard_Boolean& theHole,
XCAFDimTolObjects_DimensionFormVariance& theFormVariance,
XCAFDimTolObjects_DimensionGrade& theGrade) const;
//! Sets the number of places to the left and right of the decimal point respectively.
Standard_EXPORT void SetNbOfDecimalPlaces (const Standard_Integer theL, const Standard_Integer theR);
Standard_EXPORT void GetNbOfDecimalPlaces (Standard_Integer& theL, Standard_Integer& theR) const;
//! Returns the number of places to the left and right of the decimal point respectively.
Standard_EXPORT void GetNbOfDecimalPlaces(Standard_Integer& theL, Standard_Integer& theR) const;
//! Returns a sequence of modifiers of the dimension.
Standard_EXPORT XCAFDimTolObjects_DimensionModifiersSequence GetModifiers() const;
//! Sets new sequence of dimension modifiers.
Standard_EXPORT void SetModifiers (const XCAFDimTolObjects_DimensionModifiersSequence& theModifiers);
//! Adds a modifier to the dimension sequence of modifiers.
Standard_EXPORT void AddModifier (const XCAFDimTolObjects_DimensionModif theModifier);
//! Returns a 'curve' along which the dimension is measured.
Standard_EXPORT TopoDS_Edge GetPath() const;
//! Sets a 'curve' along which the dimension is measured.
Standard_EXPORT void SetPath (const TopoDS_Edge& thePath);
//! Returns the orientation of the dimension in annotation plane.
Standard_EXPORT Standard_Boolean GetDirection (gp_Dir& theDir) const;
//! Sets an orientation of the dimension in annotation plane.
Standard_EXPORT Standard_Boolean SetDirection (const gp_Dir& theDir);
Standard_EXPORT Handle(TColgp_HArray1OfPnt) GetPoints() const;
//! Sets position of the dimension text.
Standard_EXPORT void SetPointTextAttach (const gp_Pnt& thePntText)
{
myPntText = thePntText;
myHasPntText = Standard_True;
}
//! Returns position of the dimension text.
Standard_EXPORT const gp_Pnt& GetPointTextAttach() const { return myPntText; }
//! Returns True if the position of dimension text is specified.
Standard_EXPORT Standard_Boolean HasTextPoint() const
{
return myHasPntText;
}
//! Sets annotation plane.
Standard_EXPORT void SetPlane (const gp_Ax2& thePlane)
{
myPlane = thePlane;
myHasPlane = Standard_True;
}
//! Returns annotation plane.
Standard_EXPORT const gp_Ax2& GetPlane() const { return myPlane; }
//! Returns True if the object has annotation plane.
Standard_EXPORT Standard_Boolean HasPlane() const { return myHasPlane; }
//! Returns true, if connection point exists (for dimesional_size),
//! if connection point for first shape exists (for dimensional_location)
//! if connection point for the first shape exists (for dimensional_location).
Standard_EXPORT Standard_Boolean HasPoint() const { return myHasPoint1; }
// Returns true, if connection point for second shape exists (for dimensional_location only)
// Returns true, if connection point for the second shape exists (for dimensional_location only).
Standard_EXPORT Standard_Boolean HasPoint2() const { return myHasPoint2; }
//! Set connection point (for dimesional_size),
//! Set connection point for first shape (for dimensional_location)
//! Set connection point for the first shape (for dimensional_location).
Standard_EXPORT void SetPoint(const gp_Pnt thePnt) {
myPnt1 = thePnt;
myHasPoint1 = Standard_True;
}
// Set connection point for second shape(for dimensional_location only)
// Set connection point for the second shape (for dimensional_location only).
Standard_EXPORT void SetPoint2(const gp_Pnt thePnt) {
myPnt2 = thePnt;
myHasPoint2 = Standard_True;
}
//! Get connection point (for dimesional_size),
//! Get connection point for first shape (for dimensional_location)
//! Get connection point for the first shape (for dimensional_location).
Standard_EXPORT gp_Pnt GetPoint() const {
return myPnt1;
}
// Get connection point for second shape(for dimensional_location only)
// Get connection point for the second shape (for dimensional_location only).
Standard_EXPORT gp_Pnt GetPoint2() const {
return myPnt2;
}
//! Set graphical presentation for object
//! Set graphical presentation for the object.
Standard_EXPORT void SetPresentation(const TopoDS_Shape& thePresentation,
const Handle(TCollection_HAsciiString)& thePresentationName)
{
@@ -180,31 +236,31 @@ public:
myPresentationName = thePresentationName;
}
//! Returns graphical presentation of the object
//! Returns graphical presentation of the object.
Standard_EXPORT TopoDS_Shape GetPresentation() const
{
return myPresentation;
}
//! Returns graphical presentation of the object
//! Returns graphical presentation name of the object.
Standard_EXPORT Handle(TCollection_HAsciiString) GetPresentationName() const
{
return myPresentationName;
}
//! Returns true, if the object has descriptions
//! Returns true, if the object has descriptions.
Standard_EXPORT Standard_Boolean HasDescriptions() const
{
return (myDescriptions.Length() > 0);
}
//! Returns number of descriptions
//! Returns number of descriptions.
Standard_EXPORT Standard_Integer NbDescriptions() const
{
return myDescriptions.Length();
}
//! Returns description with the given number
//! Returns description with the given number.
Standard_EXPORT Handle(TCollection_HAsciiString) GetDescription(const Standard_Integer theNumber) const
{
if (theNumber < myDescriptions.Lower() || theNumber > myDescriptions.Upper())
@@ -212,7 +268,7 @@ public:
return myDescriptions.Value(theNumber);
}
//! Returns name of description with the given number
//! Returns name of description with the given number.
Standard_EXPORT Handle(TCollection_HAsciiString) GetDescriptionName(const Standard_Integer theNumber) const
{
if (theNumber < myDescriptions.Lower() || theNumber > myDescriptions.Upper())
@@ -220,10 +276,10 @@ public:
return myDescriptionNames.Value(theNumber);
}
//! Remove description with the given number
//! Remove description with the given number.
Standard_EXPORT void RemoveDescription(const Standard_Integer theNumber);
//! Add new description
//! Add new description.
Standard_EXPORT void AddDescription(const Handle(TCollection_HAsciiString) theDescription, const Handle(TCollection_HAsciiString) theName)
{
myDescriptions.Append(theDescription);

View File

@@ -36,7 +36,7 @@
class XCAFDimTolObjects_GeomToleranceObject;
DEFINE_STANDARD_HANDLE(XCAFDimTolObjects_GeomToleranceObject, Standard_Transient)
//! attribute to store dimension and tolerance
//! Access object to store dimension and tolerance
class XCAFDimTolObjects_GeomToleranceObject : public Standard_Transient
{
@@ -46,38 +46,55 @@ public:
Standard_EXPORT XCAFDimTolObjects_GeomToleranceObject(const Handle(XCAFDimTolObjects_GeomToleranceObject)& theObj);
//! Sets type of the object.
Standard_EXPORT void SetType (const XCAFDimTolObjects_GeomToleranceType theType);
//! Returns type of the object.
Standard_EXPORT XCAFDimTolObjects_GeomToleranceType GetType() const;
//! Sets type of tolerance value.
Standard_EXPORT void SetTypeOfValue (const XCAFDimTolObjects_GeomToleranceTypeValue theTypeOfValue);
//! Returns type of tolerance value.
Standard_EXPORT XCAFDimTolObjects_GeomToleranceTypeValue GetTypeOfValue() const;
//! Sets tolerance value.
Standard_EXPORT void SetValue (const Standard_Real theValue);
//! Returns tolerance value.
Standard_EXPORT Standard_Real GetValue() const;
//! Sets material requirement of the tolerance.
Standard_EXPORT void SetMaterialRequirementModifier (const XCAFDimTolObjects_GeomToleranceMatReqModif theMatReqModif);
//! Returns material requirement of the tolerance.
Standard_EXPORT XCAFDimTolObjects_GeomToleranceMatReqModif GetMaterialRequirementModifier() const;
//! Sets tolerance zone.
Standard_EXPORT void SetZoneModifier (const XCAFDimTolObjects_GeomToleranceZoneModif theZoneModif);
//! Returns tolerance zone.
Standard_EXPORT XCAFDimTolObjects_GeomToleranceZoneModif GetZoneModifier() const;
//! Sets value associated with tolerance zone.
Standard_EXPORT void SetValueOfZoneModifier (const Standard_Real theValue);
//! Returns value associated with tolerance zone.
Standard_EXPORT Standard_Real GetValueOfZoneModifier() const;
//! Sets new sequence of tolerance modifiers.
Standard_EXPORT void SetModifiers (const XCAFDimTolObjects_GeomToleranceModifiersSequence& theModifiers);
//! Adds a tolerance modifier to the sequence of modifiers.
Standard_EXPORT void AddModifier (const XCAFDimTolObjects_GeomToleranceModif theModifier);
//! Returns a sequence of modifiers of the tolerance.
Standard_EXPORT XCAFDimTolObjects_GeomToleranceModifiersSequence GetModifiers() const;
//! Sets the maximal upper tolerance value for tolerance with modifiers.
Standard_EXPORT void SetMaxValueModifier (const Standard_Real theModifier);
//! Returns the maximal upper tolerance.
Standard_EXPORT Standard_Real GetMaxValueModifier() const;
Standard_EXPORT void SetAxis (const gp_Ax2 theAxis);
@@ -86,43 +103,52 @@ public:
Standard_EXPORT Standard_Boolean HasAxis () const;
//! Sets annotation plane.
void SetPlane (const gp_Ax2& thePlane)
{
myPlane = thePlane;
myHasPlane = Standard_True;
}
//! Returns annotation plane.
const gp_Ax2& GetPlane() const { return myPlane; }
//! Sets reference point.
void SetPoint (const gp_Pnt& thePnt)
{
myPnt = thePnt;
myHasPnt = Standard_True;
}
//! Returns reference point.
const gp_Pnt& GetPoint() const { return myPnt; }
//! Sets text position.
void SetPointTextAttach (const gp_Pnt& thePntText)
{
myPntText = thePntText;
myHasPntText = Standard_True;
}
//! Returns the text position.
const gp_Pnt& GetPointTextAttach() const
{
return myPntText;
}
//! Returns True if the object has annotation plane.
Standard_Boolean HasPlane() const { return myHasPlane; }
//! Returns True if reference point is specified.
Standard_Boolean HasPoint() const { return myHasPnt; }
//! Returns True if text position is specified.
Standard_Boolean HasPointText() const
{
return myHasPntText;
}
//! Set graphical presentation for object
//! Set graphical presentation for object.
Standard_EXPORT void SetPresentation(const TopoDS_Shape& thePresentation,
const Handle(TCollection_HAsciiString)& thePresentationName)
{
@@ -130,13 +156,13 @@ public:
myPresentationName = thePresentationName;
}
//! Returns graphical presentation of the object
//! Returns graphical presentation of the object.
Standard_EXPORT TopoDS_Shape GetPresentation() const
{
return myPresentation;
}
//! Returns graphical presentation of the object
//! Returns graphical presentation of the object.
Standard_EXPORT Handle(TCollection_HAsciiString) GetPresentationName() const
{
return myPresentationName;
@@ -167,10 +193,4 @@ private:
};
#endif // _XCAFDimTolObjects_GeomToleranceObject_HeaderFile

View File

@@ -42,21 +42,28 @@ public:
Standard_EXPORT XCAFDimTolObjects_Tool(const Handle(TDocStd_Document)& theDoc);
//! Returns a sequence of Dimensions currently stored
//! in the DGTtable
//! in the GD&T table
Standard_EXPORT void GetDimensions (XCAFDimTolObjects_DimensionObjectSequence& theDimensionObjectSequence) const;
//! Returns all Dimensions defined for Shape
Standard_EXPORT Standard_Boolean GetRefDimensions (const TopoDS_Shape& theShape, XCAFDimTolObjects_DimensionObjectSequence& theDimensions) const;
Standard_EXPORT Standard_Boolean GetRefDimensions (const TopoDS_Shape& theShape,
XCAFDimTolObjects_DimensionObjectSequence& theDimensions) const;
//! Returns a sequence of Tolerancess currently stored
//! in the DGTtable
Standard_EXPORT void GetGeomTolerances (XCAFDimTolObjects_GeomToleranceObjectSequence& theGeomToleranceObjectSequence, XCAFDimTolObjects_DatumObjectSequence& theDatumObjectSequence, XCAFDimTolObjects_DataMapOfToleranceDatum& theMap) const;
//! Returns a sequence of Tolerances currently stored
//! in the GD&T table
Standard_EXPORT void GetGeomTolerances (XCAFDimTolObjects_GeomToleranceObjectSequence& theGeomToleranceObjectSequence,
XCAFDimTolObjects_DatumObjectSequence& theDatumObjectSequence,
XCAFDimTolObjects_DataMapOfToleranceDatum& theMap) const;
//! Returns all GeomTolerances defined for Shape
Standard_EXPORT Standard_Boolean GetRefGeomTolerances (const TopoDS_Shape& theShape, XCAFDimTolObjects_GeomToleranceObjectSequence& theGeomToleranceObjectSequence, XCAFDimTolObjects_DatumObjectSequence& theDatumObjectSequence, XCAFDimTolObjects_DataMapOfToleranceDatum& theMap) const;
Standard_EXPORT Standard_Boolean GetRefGeomTolerances (const TopoDS_Shape& theShape,
XCAFDimTolObjects_GeomToleranceObjectSequence& theGeomToleranceObjectSequence,
XCAFDimTolObjects_DatumObjectSequence& theDatumObjectSequence,
XCAFDimTolObjects_DataMapOfToleranceDatum& theMap) const;
//! Returns DatumObject defined for Shape
Standard_EXPORT Standard_Boolean GetRefDatum (const TopoDS_Shape& theShape, Handle(XCAFDimTolObjects_DatumObject)& theDatum) const;
Standard_EXPORT Standard_Boolean GetRefDatum (const TopoDS_Shape& theShape,
Handle(XCAFDimTolObjects_DatumObject)& theDatum) const;
private:

View File

@@ -80,13 +80,13 @@ public:
Standard_EXPORT static Standard_GUID DimTolRefGUID();
//! Return GUIDs for TreeNode representing specified types of Dimension
Standard_EXPORT static Standard_GUID DimensionRefFirstGUID() ;
Standard_EXPORT static Standard_GUID DimensionRefFirstGUID() ;
//! Return GUIDs for TreeNode representing specified types of Dimension
Standard_EXPORT static Standard_GUID DimensionRefSecondGUID() ;
Standard_EXPORT static Standard_GUID DimensionRefSecondGUID() ;
//! Return GUIDs for TreeNode representing specified types of GeomTolerance
Standard_EXPORT static Standard_GUID GeomToleranceRefGUID() ;
Standard_EXPORT static Standard_GUID GeomToleranceRefGUID() ;
//! Return GUIDs for TreeNode representing specified types of datum
Standard_EXPORT static Standard_GUID DatumRefGUID();

View File

@@ -58,9 +58,12 @@ public:
Standard_EXPORT Handle(TCollection_HAsciiString) GetIdentification() const;
//! Returns dimension object data taken from the paren's label and its sub-labels.
Standard_EXPORT Handle(XCAFDimTolObjects_DatumObject) GetObject() const;
Standard_EXPORT void SetObject (const Handle(XCAFDimTolObjects_DatumObject)& theObject);
//! Updates parent's label and its sub-labels with data taken from theDatumObject.
//! Old data associated with the label will be lost.
Standard_EXPORT void SetObject(const Handle(XCAFDimTolObjects_DatumObject)& theDatumObject);
Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE;

View File

@@ -405,11 +405,11 @@ void XCAFDoc_DimTolTool::SetDimension(const TDF_LabelSequence& theFirstL,
//=======================================================================
void XCAFDoc_DimTolTool::SetGeomTolerance(const TDF_Label& theL,
const TDF_Label& theDimTolL) const
const TDF_Label& theGeomTolL) const
{
TDF_LabelSequence aSeq;
aSeq.Append(theL);
SetGeomTolerance(aSeq, theDimTolL);
SetGeomTolerance(aSeq, theGeomTolL);
}
//=======================================================================
@@ -418,7 +418,7 @@ void XCAFDoc_DimTolTool::SetGeomTolerance(const TDF_Label& theL,
//=======================================================================
void XCAFDoc_DimTolTool::SetGeomTolerance(const TDF_LabelSequence& theL,
const TDF_Label& theDimTolL) const
const TDF_Label& theGeomTolL) const
{
// // set reference
// Handle(TDataStd_TreeNode) refNode, mainNode;
@@ -427,7 +427,7 @@ void XCAFDoc_DimTolTool::SetGeomTolerance(const TDF_LabelSequence& theL,
// refNode->Remove(); // abv: fix against bug in TreeNode::Append()
// mainNode->Append(refNode);
if(!IsGeomTolerance(theDimTolL) || theL.Length() == 0)
if (!IsGeomTolerance(theGeomTolL) || theL.Length() == 0)
{
return;
}
@@ -435,20 +435,19 @@ void XCAFDoc_DimTolTool::SetGeomTolerance(const TDF_LabelSequence& theL,
Handle(XCAFDoc_GraphNode) aChGNode;
Handle(XCAFDoc_GraphNode) aFGNode;
//Handle(XCAFDoc_GraphNode) ChGNode, FGNode;
if ( theDimTolL.FindAttribute (XCAFDoc::GeomToleranceRefGUID(), aChGNode) ) {
if (theGeomTolL.FindAttribute(XCAFDoc::GeomToleranceRefGUID(), aChGNode)) {
while (aChGNode->NbFathers() > 0) {
aFGNode = aChGNode->GetFather(1);
aFGNode->UnSetChild(aChGNode);
if(aFGNode->NbChildren() == 0)
aFGNode->ForgetAttribute( XCAFDoc::GeomToleranceRefGUID() );
}
theDimTolL.ForgetAttribute ( XCAFDoc::GeomToleranceRefGUID() );
theGeomTolL.ForgetAttribute(XCAFDoc::GeomToleranceRefGUID());
}
if (!theDimTolL.FindAttribute(XCAFDoc::GeomToleranceRefGUID(), aChGNode)) {
if (!theGeomTolL.FindAttribute(XCAFDoc::GeomToleranceRefGUID(), aChGNode)) {
aChGNode = new XCAFDoc_GraphNode;
aChGNode = XCAFDoc_GraphNode::Set(theDimTolL);
aChGNode = XCAFDoc_GraphNode::Set(theGeomTolL);
aChGNode->SetGraphID(XCAFDoc::GeomToleranceRefGUID());
}
for(Standard_Integer i = theL.Lower(); i <= theL.Upper(); i++)

View File

@@ -37,12 +37,8 @@ class TDF_RelocationTable;
class XCAFDoc_DimTolTool;
DEFINE_STANDARD_HANDLE(XCAFDoc_DimTolTool, TDF_Attribute)
//! Provides tools to store and retrieve attributes (colors)
//! of TopoDS_Shape in and from TDocStd_Document
//! A Document is intended to hold different
//! attributes of ONE shape and it's sub-shapes.
//! Attribute containing DimTol section of DECAF document.
//! Provide tools for management of DimTol section of document.
//! Attribute containing GD&T section of XCAF document.
//! Provide tools for GD&T section management.
class XCAFDoc_DimTolTool : public TDF_Attribute
{
@@ -51,150 +47,196 @@ public:
Standard_EXPORT XCAFDoc_DimTolTool();
//! Creates (if not exist) DimTolTool.
//! Creates (if not exist) DimTolTool attribute.
Standard_EXPORT static Handle(XCAFDoc_DimTolTool) Set (const TDF_Label& L);
//! Returns the standard GD&T tool GUID.
Standard_EXPORT static const Standard_GUID& GetID();
//! returns the label under which colors are stored
//! Returns the label under which GD&T table is stored.
Standard_EXPORT TDF_Label BaseLabel() const;
//! Returns internal XCAFDoc_ShapeTool tool
Standard_EXPORT const Handle(XCAFDoc_ShapeTool)& ShapeTool();
//! Returns True if label belongs to a dimtoltable and
//! is a Dimension definition
//! Returns True if the label belongs to a GD&T table and
//! is a Dimension definition.
Standard_EXPORT Standard_Boolean IsDimension (const TDF_Label& theLab) const;
//! Returns a sequence of Dimensions labels currently stored
//! in the DGTtable
//! Returns a sequence of Dimension labels currently stored
//! in the GD&T table.
Standard_EXPORT void GetDimensionLabels (TDF_LabelSequence& theLabels) const;
//! Sets a link with GUID
Standard_EXPORT void SetDimension (const TDF_LabelSequence& theFirstLS, const TDF_LabelSequence& theSecondLS, const TDF_Label& theDimTolL) const;
//! Sets a dimension to sequences target labels.
Standard_EXPORT void SetDimension (const TDF_LabelSequence& theFirstLS,
const TDF_LabelSequence& theSecondLS,
const TDF_Label& theDimL) const;
//! Sets a link with GUID
Standard_EXPORT void SetDimension (const TDF_Label& theFirstL, const TDF_Label& theSecondL, const TDF_Label& theDimTolL) const;
//! Sets a dimension to target labels.
Standard_EXPORT void SetDimension(const TDF_Label& theFirstL,
const TDF_Label& theSecondL,
const TDF_Label& theDimL) const;
//! Sets a link with GUID
Standard_EXPORT void SetDimension (const TDF_Label& theL, const TDF_Label& theDimTolL) const;
//! Sets a dimension to the target label.
Standard_EXPORT void SetDimension (const TDF_Label& theL,
const TDF_Label& theDimL) const;
//! Returns all Dimension labels defined for label ShapeL
Standard_EXPORT Standard_Boolean GetRefDimensionLabels (const TDF_Label& theShapeL, TDF_LabelSequence& theDimensions) const;
//! Returns all Dimension labels defined for theShapeL.
Standard_EXPORT Standard_Boolean GetRefDimensionLabels (const TDF_Label& theShapeL,
TDF_LabelSequence& theDimensions) const;
//! Adds a dimension definition to a DGTtable and returns its label
//! Adds a dimension definition to the GD&T table and returns its label.
Standard_EXPORT TDF_Label AddDimension() ;
//! Returns True if label belongs to a dimtoltable and
//! is a DimTol definition
//! Returns True if the label belongs to the GD&T table and is a dimension tolerance.
Standard_EXPORT Standard_Boolean IsGeomTolerance (const TDF_Label& theLab) const;
//! Returns a sequence of Tolerance labels currently stored
//! in the DGTtable
//! Returns a sequence of Tolerance labels currently stored in the GD&T table.
Standard_EXPORT void GetGeomToleranceLabels (TDF_LabelSequence& theLabels) const;
//! Sets a link with GUID
Standard_EXPORT void SetGeomTolerance (const TDF_Label& theL, const TDF_Label& theDimTolL) const;
//! Sets a geometry tolerance from theGeomTolL to theL label.
//! Checks if theGeomTolL is a geometry tolerance definition first.
Standard_EXPORT void SetGeomTolerance (const TDF_Label& theL,
const TDF_Label& theGeomTolL) const;
//! Sets a link with GUID
Standard_EXPORT void SetGeomTolerance (const TDF_LabelSequence& theL, const TDF_Label& theDimTolL) const;
//! Sets a geometry tolerance from theGeomTolL to sequence of labels theL.
//! Checks if theGeomTolL is a geometry tolerance definition first.
Standard_EXPORT void SetGeomTolerance(const TDF_LabelSequence& theL,
const TDF_Label& theGeomTolL) const;
//! Returns all GeomTolerance labels defined for label ShapeL
Standard_EXPORT Standard_Boolean GetRefGeomToleranceLabels (const TDF_Label& theShapeL, TDF_LabelSequence& theDimTols) const;
//! Returns all GeomTolerance labels defined for theShapeL.
Standard_EXPORT Standard_Boolean GetRefGeomToleranceLabels (const TDF_Label& theShapeL,
TDF_LabelSequence& theDimTols) const;
//! Adds a GeomTolerance definition to a DGTtable and returns its label
//! Adds a GeomTolerance definition to the GD&T table and returns its label.
Standard_EXPORT TDF_Label AddGeomTolerance();
//! Returns True if label belongs to a dimtoltable and
//! is a DimTol definition
Standard_EXPORT Standard_Boolean IsDimTol (const TDF_Label& lab) const;
//! Returns True if theLab belongs to the GD&T table and is a dmension tolerance.
Standard_EXPORT Standard_Boolean IsDimTol(const TDF_Label& theLab) const;
//! Returns a sequence of D&GTs currently stored
//! in the DGTtable
//! Returns a sequence of D&GTs currently stored in the GD&T table.
Standard_EXPORT void GetDimTolLabels (TDF_LabelSequence& Labels) const;
//! Finds a dimtol definition in a DGTtable and returns
//! its label if found
//! Returns False if dimtol is not found in DGTtable
Standard_EXPORT Standard_Boolean FindDimTol (const Standard_Integer kind, const Handle(TColStd_HArray1OfReal)& aVal, const Handle(TCollection_HAsciiString)& aName, const Handle(TCollection_HAsciiString)& aDescription, TDF_Label& lab) const;
//! Finds a dimension tolerance definition in the GD&T table
//! sutisfying the specified kind, values, name and description
//! and returns its label if found.
//! Returns False if dimension tolerance is not found in DGTtable.
Standard_EXPORT Standard_Boolean FindDimTol (const Standard_Integer theKind,
const Handle(TColStd_HArray1OfReal)& theVal,
const Handle(TCollection_HAsciiString)& theName,
const Handle(TCollection_HAsciiString)& theDescription,
TDF_Label& lab) const;
//! Finds a dimtol definition in a DGTtable and returns
//! its label if found (or Null label else)
Standard_EXPORT TDF_Label FindDimTol (const Standard_Integer kind, const Handle(TColStd_HArray1OfReal)& aVal, const Handle(TCollection_HAsciiString)& aName, const Handle(TCollection_HAsciiString)& aDescription) const;
//! Finds a dimension tolerance in the GD&T table
//! sutisfying the specified kind, values, name and description
//! and returns its label if found (or Null label else).
Standard_EXPORT TDF_Label FindDimTol (const Standard_Integer theKind,
const Handle(TColStd_HArray1OfReal)& theVal,
const Handle(TCollection_HAsciiString)& theName,
const Handle(TCollection_HAsciiString)& theDescription) const;
//! Adds a dimtol definition to a DGTtable and returns its label
Standard_EXPORT TDF_Label AddDimTol (const Standard_Integer kind, const Handle(TColStd_HArray1OfReal)& aVal, const Handle(TCollection_HAsciiString)& aName, const Handle(TCollection_HAsciiString)& aDescription) const;
//! Adds a a dimension tolerance definition with the specified
//! kind, value, name and description to the GD&T table and returns its label.
Standard_EXPORT TDF_Label AddDimTol (const Standard_Integer theKind,
const Handle(TColStd_HArray1OfReal)& theVal,
const Handle(TCollection_HAsciiString)& theName,
const Handle(TCollection_HAsciiString)& theDescription) const;
//! Sets a link with GUID
Standard_EXPORT void SetDimTol (const TDF_Label& L, const TDF_Label& DimTolL) const;
//! Sets existing dimension tolerance to theL label.
Standard_EXPORT void SetDimTol (const TDF_Label& theL,
const TDF_Label& theDimTolL) const;
//! Sets a link with GUID
//! Adds a DimTol as necessary
Standard_EXPORT TDF_Label SetDimTol (const TDF_Label& L, const Standard_Integer kind, const Handle(TColStd_HArray1OfReal)& aVal, const Handle(TCollection_HAsciiString)& aName, const Handle(TCollection_HAsciiString)& aDescription) const;
//! Creates a dimension tolerance and sets it to theL label.
Standard_EXPORT TDF_Label SetDimTol (const TDF_Label& theL,
const Standard_Integer theKind,
const Handle(TColStd_HArray1OfReal)& theVal,
const Handle(TCollection_HAsciiString)& theName,
const Handle(TCollection_HAsciiString)& theDescription) const;
//! Returns ShapeL defined for label DimTolL
//! Returns False if the DimTolL is not in DGTtable
Standard_EXPORT Standard_Boolean GetRefShapeLabel (const TDF_Label& DimTolL, TDF_LabelSequence& ShapeLFirst, TDF_LabelSequence& ShapeLSecond) const;
//! Gets all shape labels reffered by theL label of the GD&T table.
//! Returns False if there are no shape labels added to the sequences.
Standard_EXPORT Standard_Boolean GetRefShapeLabel (const TDF_Label& theL,
TDF_LabelSequence& theShapeLFirst,
TDF_LabelSequence& theShapeLSecond) const;
//! Returns all DimTol labels defined for label ShapeL
Standard_EXPORT Standard_Boolean GetRefDGTLabels (const TDF_Label& ShapeL, TDF_LabelSequence& DimTols) const;
//! Returns dimension tolerance assigned to theDimTolL label.
//! Returns False if no such dimension tolerance is assigned.
Standard_EXPORT Standard_Boolean GetDimTol (const TDF_Label& theDimTolL,
Standard_Integer& theKind,
Handle(TColStd_HArray1OfReal)& theVal,
Handle(TCollection_HAsciiString)& theName,
Handle(TCollection_HAsciiString)& theDescription) const;
//! Returns dimtol assigned to <DimTolL>
//! Returns False if no such dimtol is assigned
Standard_EXPORT Standard_Boolean GetDimTol (const TDF_Label& DimTolL, Standard_Integer& kind, Handle(TColStd_HArray1OfReal)& aVal, Handle(TCollection_HAsciiString)& aName, Handle(TCollection_HAsciiString)& aDescription) const;
//! Returns True if label belongs to a dimtoltable and
//! is a Datum definition
//! Returns True if label belongs to the GD&T table and
//! is a Datum definition.
Standard_EXPORT Standard_Boolean IsDatum (const TDF_Label& lab) const;
//! Returns a sequence of Datumss currently stored
//! in the DGTtable
//! Returns a sequence of Datums currently stored
//! in the GD&T table.
Standard_EXPORT void GetDatumLabels (TDF_LabelSequence& Labels) const;
//! Finds a datum and returns its label if found
Standard_EXPORT Standard_Boolean FindDatum (const Handle(TCollection_HAsciiString)& aName, const Handle(TCollection_HAsciiString)& aDescription, const Handle(TCollection_HAsciiString)& anIdentification, TDF_Label& lab) const;
//! Finds a datum sutisfying the specified name, description and
//! identification and returns its label if found.
Standard_EXPORT Standard_Boolean FindDatum (const Handle(TCollection_HAsciiString)& theName,
const Handle(TCollection_HAsciiString)& theDescription,
const Handle(TCollection_HAsciiString)& theIdentification,
TDF_Label& lab) const;
//! Adds a datum definition to a DGTtable and returns its label
Standard_EXPORT TDF_Label AddDatum (const Handle(TCollection_HAsciiString)& aName, const Handle(TCollection_HAsciiString)& aDescription, const Handle(TCollection_HAsciiString)& anIdentification) const;
//! Adds a datum definition to the GD&T table and returns its label.
Standard_EXPORT TDF_Label AddDatum (const Handle(TCollection_HAsciiString)& theName,
const Handle(TCollection_HAsciiString)& theDescription,
const Handle(TCollection_HAsciiString)& theIdentification) const;
//! Adds a datum definition to a DGTtable and returns its label
//! Adds a datum definition to the GD&T table and returns its label.
Standard_EXPORT TDF_Label AddDatum() ;
//! Sets a link with GUID
Standard_EXPORT void SetDatum (const TDF_LabelSequence& theShapeLabels, const TDF_Label& theDatumL) const;
//! Sets a link with GUID for Datum
//! Sets connection between Datum and Tolerance
Standard_EXPORT void SetDatumToGeomTol (const TDF_Label& theL, const TDF_Label& theTolerL) const;
//! Sets a datum to the sequence of shape labels.
Standard_EXPORT void SetDatum (const TDF_LabelSequence& theShapeLabels,
const TDF_Label& theDatumL) const;
//! Sets a link with GUID for Datum
//! Adds a Datum as necessary
//! Sets connection between Datum and Tolerance
Standard_EXPORT void SetDatum (const TDF_Label& L, const TDF_Label& TolerL, const Handle(TCollection_HAsciiString)& aName, const Handle(TCollection_HAsciiString)& aDescription, const Handle(TCollection_HAsciiString)& anIdentification) const;
//! Sets a datum to theL label and binds it with theTolerL label.
//! A datum with the specified name, description and identification
//! is created if it isn't found in the GD&T table.
Standard_EXPORT void SetDatum (const TDF_Label& theL,
const TDF_Label& theTolerL,
const Handle(TCollection_HAsciiString)& theName,
const Handle(TCollection_HAsciiString)& theDescription,
const Handle(TCollection_HAsciiString)& theIdentification) const;
//! Sets a datum from theDatumL label to theToletL label.
Standard_EXPORT void SetDatumToGeomTol (const TDF_Label& theDatumL,
const TDF_Label& theTolerL) const;
//! Returns datum assigned to <DatumL>
//! Returns False if no such datum is assigned
Standard_EXPORT Standard_Boolean GetDatum (const TDF_Label& DatumL, Handle(TCollection_HAsciiString)& aName, Handle(TCollection_HAsciiString)& aDescription, Handle(TCollection_HAsciiString)& anIdentification) const;
//! Returns datum assigned to theDatumL label.
//! Returns False if no such datum is assigned.
Standard_EXPORT Standard_Boolean GetDatum (const TDF_Label& theDatumL,
Handle(TCollection_HAsciiString)& theName,
Handle(TCollection_HAsciiString)& theDescription,
Handle(TCollection_HAsciiString)& theIdentification) const;
//! Returns all Datum labels defined for label DimTolL
Standard_EXPORT Standard_Boolean GetDatumOfTolerLabels (const TDF_Label& DimTolL, TDF_LabelSequence& Datums) const;
//! Returns all Datum labels defined for theDimTolL label.
Standard_EXPORT Standard_Boolean GetDatumOfTolerLabels (const TDF_Label& theDimTolL,
TDF_LabelSequence& theDatums) const;
//! Returns all Datum labels with XCAFDimTolObjects_DatumObject defined for label DimTolL
Standard_EXPORT Standard_Boolean GetDatumWithObjectOfTolerLabels (const TDF_Label& DimTolL, TDF_LabelSequence& Datums) const;
//! Returns all Datum labels with XCAFDimTolObjects_DatumObject defined for label theDimTolL.
Standard_EXPORT Standard_Boolean GetDatumWithObjectOfTolerLabels (const TDF_Label& theDimTolL,
TDF_LabelSequence& theDatums) const;
//! Returns all GeomToleranses labels defined for label DatumL
Standard_EXPORT Standard_Boolean GetTolerOfDatumLabels (const TDF_Label& theDatumL, TDF_LabelSequence& theTols) const;
//! Returns all GeomToleranses labels defined for theDatumL label.
Standard_EXPORT Standard_Boolean GetTolerOfDatumLabels (const TDF_Label& theDatumL,
TDF_LabelSequence& theTols) const;
//! Returns Datum label defined for label ShapeL
Standard_EXPORT Standard_Boolean GetRefDatumLabel (const TDF_Label& theShapeL, TDF_LabelSequence& theDatum) const;
//! Returns Datum label defined for theShapeL label.
Standard_EXPORT Standard_Boolean GetRefDatumLabel (const TDF_Label& theShapeL,
TDF_LabelSequence& theDatum) const;
//! Returns true if the given GDT is marked as locked
//! Returns true if the given GDT is marked as locked.
Standard_EXPORT Standard_Boolean IsLocked(const TDF_Label& theViewL) const;
//! Mark the given GDT as locked
//! Mark the given GDT as locked.
Standard_EXPORT void Lock(const TDF_Label& theViewL) const;
//! Unlock the given GDT
//! Unlock the given GDT.
Standard_EXPORT void Unlock(const TDF_Label& theViewL) const;
Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE;

View File

@@ -34,7 +34,9 @@ class XCAFDimTolObjects_DimensionObject;
class XCAFDoc_Dimension;
DEFINE_STANDARD_HANDLE(XCAFDoc_Dimension, TDF_Attribute)
//! attribute to store dimension
//! Attribute that identifies a dimension in the GD&T table.
//! Its parent label is used as a container to store data provided
//! by XCAFDimTolObjects_DimensionObject.
class XCAFDoc_Dimension : public TDF_Attribute
{
@@ -54,8 +56,11 @@ public:
Standard_EXPORT void Paste (const Handle(TDF_Attribute)& Into, const Handle(TDF_RelocationTable)& RT) const Standard_OVERRIDE;
//! Updates parent's label and its sub-labels with data taken from theDimensionObject.
//! Old data associated with the label will be lost.
Standard_EXPORT void SetObject (const Handle(XCAFDimTolObjects_DimensionObject)& theDimensionObject);
//! Returns dimension object data taken from the paren's label and its sub-labels.
Standard_EXPORT Handle(XCAFDimTolObjects_DimensionObject) GetObject() const;
DEFINE_STANDARD_RTTIEXT(XCAFDoc_Dimension,TDF_Attribute)

View File

@@ -34,7 +34,7 @@ class XCAFDimTolObjects_GeomToleranceObject;
class XCAFDoc_GeomTolerance;
DEFINE_STANDARD_HANDLE(XCAFDoc_GeomTolerance, TDF_Attribute)
//! attribute to store dimension and tolerance
//! Attribute to store dimension and tolerance
class XCAFDoc_GeomTolerance : public TDF_Attribute
{
@@ -49,8 +49,11 @@ public:
Standard_EXPORT static Handle(XCAFDoc_GeomTolerance) Set (const TDF_Label& theLabel);
Standard_EXPORT void SetObject (const Handle(XCAFDimTolObjects_GeomToleranceObject)& theObject);
//! Updates parent's label and its sub-labels with data taken from theGeomToleranceObject.
//! Old data associated with the label will be lost.
Standard_EXPORT void SetObject(const Handle(XCAFDimTolObjects_GeomToleranceObject)& theGeomToleranceObject);
//! Returns geometry tolerance object data taken from the paren's label and its sub-labels.
Standard_EXPORT Handle(XCAFDimTolObjects_GeomToleranceObject) GetObject() const;
Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE;

View File

@@ -34,7 +34,7 @@ class XCAFView_Object;
class XCAFDoc_View;
DEFINE_STANDARD_HANDLE(XCAFDoc_View, TDF_Attribute)
//! attribute to store view
//! Attribute to store view
class XCAFDoc_View : public TDF_Attribute
{
@@ -54,8 +54,11 @@ public:
Standard_EXPORT void Paste (const Handle(TDF_Attribute)& Into, const Handle(TDF_RelocationTable)& RT) const Standard_OVERRIDE;
Standard_EXPORT void SetObject (const Handle(XCAFView_Object)& theViewObject);
//! Updates parent's label and its sub-labels with data taken from theViewObject.
//! Old data associated with the label will be lost.
Standard_EXPORT void SetObject(const Handle(XCAFView_Object)& theViewObject);
//! Returns view object data taken from the paren's label and its sub-labels.
Standard_EXPORT Handle(XCAFView_Object) GetObject() const;
DEFINE_STANDARD_RTTIEXT(XCAFDoc_View, TDF_Attribute)

View File

@@ -165,6 +165,24 @@ void XCAFDoc_ViewTool::SetView(const TDF_LabelSequence& theShapes,
}
theViewL.ForgetAttribute(XCAFDoc::ViewRefPlaneGUID());
}
if (theViewL.FindAttribute(XCAFDoc::ViewRefNoteGUID(), aChGNode)) {
while (aChGNode->NbFathers() > 0) {
aPlaneGNode = aChGNode->GetFather(1);
aPlaneGNode->UnSetChild(aChGNode);
if (aPlaneGNode->NbChildren() == 0)
aPlaneGNode->ForgetAttribute(XCAFDoc::ViewRefNoteGUID());
}
theViewL.ForgetAttribute(XCAFDoc::ViewRefNoteGUID());
}
if (theViewL.FindAttribute(XCAFDoc::ViewRefAnnotationGUID(), aChGNode)) {
while (aChGNode->NbFathers() > 0) {
aPlaneGNode = aChGNode->GetFather(1);
aPlaneGNode->UnSetChild(aChGNode);
if (aPlaneGNode->NbChildren() == 0)
aPlaneGNode->ForgetAttribute(XCAFDoc::ViewRefAnnotationGUID());
}
theViewL.ForgetAttribute(XCAFDoc::ViewRefAnnotationGUID());
}
if (!theViewL.FindAttribute(XCAFDoc::ViewRefShapeGUID(), aChGNode) && theShapes.Length() > 0) {
aChGNode = new XCAFDoc_GraphNode;
@@ -214,7 +232,7 @@ void XCAFDoc_ViewTool::SetView(const TDF_LabelSequence& theShapes,
aChGNode->SetFather(aPlaneGNode);
}
if (!theViewL.FindAttribute(XCAFDoc::ViewRefPlaneGUID(), aChGNode) && theClippingPlanes.Length() > 0) {
if (!theViewL.FindAttribute(XCAFDoc::ViewRefNoteGUID(), aChGNode) && theNotes.Length() > 0) {
aChGNode = new XCAFDoc_GraphNode;
aChGNode = XCAFDoc_GraphNode::Set(theViewL);
aChGNode->SetGraphID(XCAFDoc::ViewRefPlaneGUID());

View File

@@ -30,7 +30,7 @@
class XCAFView_Object;
DEFINE_STANDARD_HANDLE(XCAFView_Object, Standard_Transient)
//! object to store view
//! Access object for saved view
class XCAFView_Object : public Standard_Transient
{