0029119: Documentation for PMI in XCAF
authorsnn <snn@opencascade.com>
Fri, 22 Sep 2017 08:08:30 +0000 (11:08 +0300)
committerkgv <kgv@opencascade.com>
Fri, 29 Sep 2017 06:42:09 +0000 (09:42 +0300)
Documentation is added to the XDE part of the User Guide for GD&T, Clipping planes and Saved view components.

15 files changed:
dox/user_guides/step/step.md
dox/user_guides/xde/xde.md
src/XCAFDimTolObjects/XCAFDimTolObjects_DatumObject.hxx
src/XCAFDimTolObjects/XCAFDimTolObjects_DimensionObject.hxx
src/XCAFDimTolObjects/XCAFDimTolObjects_GeomToleranceObject.hxx
src/XCAFDimTolObjects/XCAFDimTolObjects_Tool.hxx
src/XCAFDoc/XCAFDoc.hxx
src/XCAFDoc/XCAFDoc_Datum.hxx
src/XCAFDoc/XCAFDoc_DimTolTool.cxx
src/XCAFDoc/XCAFDoc_DimTolTool.hxx
src/XCAFDoc/XCAFDoc_Dimension.hxx
src/XCAFDoc/XCAFDoc_GeomTolerance.hxx
src/XCAFDoc/XCAFDoc_View.hxx
src/XCAFDoc/XCAFDoc_ViewTool.cxx
src/XCAFView/XCAFView_Object.hxx

index e706981..8c03962 100644 (file)
@@ -1481,7 +1481,7 @@ General types of STEP entities imported by OCCT are listed in the table below:
 |Datum_Feature|XCAFDoc_Datum|
 |Datum_Target|XCAFDoc_Datum|
 
-Processing of GD&T is realized in accordance with <a href="http://www.cax-if.org/documents/rec_pracs_pmi_v40.pdf">Recommended practices for the Representation and Presentation of Product Manufacturing</a> for AP242.
+Processing of GD&T is realized in accordance with <a href="https://www.cax-if.org/documents/rec_pracs_pmi_v40.pdf">Recommended practices for the Representation and Presentation of Product Manufacturing</a> for AP242.
 The general restriction is that OCCT STEP Reader imports GD&T assigned only to shapes (faces, edges, vertices, etc) or to shape groups from general shape model i.e. any constructive geometries are not translated as referenced shapes.
 
 #### Dimensions
index 59e806c..3918c1f 100644 (file)
@@ -91,26 +91,59 @@ XDE can read and write colors and layers assigned to shapes or their subparts (d
   
  @figure{/user_guides/xde/images/xde_image006.png,"Colors and Layers",240}
 
-@subsection occt_xde_1_7 Custom notes
+@subsection occt_xde_1_7 Geometric Dimensions & Tolerances (GD&T)
+
+GD&T are a type of Product and Manufacturing Information (PMI) that can be either computed automatically by a CAD system,
+or entered manually by the user. For detailed information use <a href="https://www.cax-if.org/documents/rec_pracs_pmi_v40.pdf">CAx-IF Recommended Practices
+for the Representation and Presentation of Product Manufacturing Information (PMI) (AP242)</a>
+
+XDE can read and write GD&T data of the following types:
+* dimensions, such as distance, length, radius and so on;
+* geometric tolerances;
+* datums, i.e a theoretically exact geometric references, such as point, line or plane, to which toleranced features are related.
+
+XDE supports two presentations of GD&T data:
+* semantic presentation, i.e. data is stored in a machine-consumable way and includes all information required to understand the
+  specification without the aid of any presentation elements;
+* tessellated presentation, i.e. data is displayed in a human-readable way.
+
+@subsection occt_xde_1_8 Clipping planes
+
+XDE supports reading from STEP and storing named planes used for clipping. 
+Currently, XDE supports saving of clipping planes in XBF format only.
+
+XDE provides capabilities for adding, editing and removing clipping planes.
+
+@subsection occt_xde_1_9 Saved views
+
+XDE supports reading from STEP views. Views allow to save information about camera parameters (position, direction, zoom factor, etc.)
+and visible shapes, PMIs, used clipping planes and notes. Currently, XDE supports saving of clipping planes in XBF format only.
+
+XDE provides the following view management capabilities:
+  * add/remove views;
+  * set view camera parameters;
+  * set visible shapes, PMIs, used clipping planes and notes.
+
+@subsection occt_xde_1_10 Custom notes
  
-Custom notes is a kind of application specific data attached to assembly items, their attributes and sub-shapes. Basically, there are simple textual comments, binary data and other application specific data. Each note is provided with a timestamp and the user created it.
+Custom notes is a kind of application-specific data attached to assembly items, their attributes and sub-shapes. Basically, there are simple textual comments, binary data and other application-specific data. Each note is provided with a timestamp and the user who created it.
 
 Notes API provides the following functionality:
-  * Returns total number of notes and annotated items
-  * Returns labels for all notes and annotated items
+  * Returns the total number of notes and annotated items;
+  * Returns labels for all notes and annotated items;
   * Creates notes:
-    - Comment note from a text string
-    - Binary data note from a file or byte array
-  * Checks if an assembly item is annotated
-  * Finds a label for the annotated item
-  * Returns all note labels for the annotated item
-  * Add a note to item(s):
-    - Assembly item
-    - Assembly item attribute
-    - Assembly item subshape index
-  * Remove note(s) from an annotated assembly item; orphan note(s) might be deleted optionally (items without linked notes will be deleted automatically)
-  * Delete note(s) and removes them from annotated items
-  * Get / delete orphan notes
+    - Comment note from a text string;
+    - Binary data note from a file or byte array;
+  * Checks if an assembly item is annotated;
+  * Finds a label for the annotated item;
+  * Returns all note labels for the annotated item;
+  * Adds a note to item(s):
+    - Assembly item;
+    - Assembly item attribute;
+    - Assembly item subshape index;
+  * Removes note(s) from an annotated assembly item; orphan note(s) might be deleted optionally (items without linked notes will be deleted automatically);
+  * Deletes note(s) and removes them from annotated items;
+  * Gets / deletes orphan notes.
 
 @section occt_xde_2 Working with XDE
 
@@ -504,7 +537,7 @@ XDE can read and write colors and layers assigned to shapes or their subparts (d
 
 @figure{/user_guides/xde/images/239_xde_12_400.png,"Motor Head",240}
 
-In an XDE document, colors are managed by the class *XCAFDoc_ColorTool*. This is done with the same principles as for ShapeTool with Shapes, and with the same capability of having a tool on the Main Label, or on any sub-label. The Property itself is defined as an *XCAFDoc_Color*, sub-class of *TDF_Attribute*.
+In an XDE document, colors are managed by the class *XCAFDoc_ColorTool*. It works basing on the same principles as ShapeTool works with Shapes. This tool can be provided on the Main Label or on any sub-label. The Property itself is defined as an *XCAFDoc_Color*, sub-class of *TDF_Attribute*.
  
 Colors are stored in a child of the starting document label: it is the second level (0.1.2), while Shapes are at the first level. Each color then corresponds to a dedicated label, the property itself is a Quantity_Color, which has a name and value for Red, Green, Blue. A Color may be attached to Surfaces (flat colors) or to Curves (wireframe colors), or to both. A Color may be attached to a sub-shape. In such a case, the sub-shape (and its own sub-shapes) takes its own Color as a priority.
 
@@ -627,29 +660,274 @@ To remove a Color and all the references to it (so that the related shapes will
 myColors->RemoveColor(ColLabel); 
 ~~~~~
 
-@subsection occt_xde_2_7 Custom notes
+@subsection occt_xde_2_7 Geometric Dimensions & Tolerances (GD&T)
+
+XDE can read and write GD&T assigned to shapes or their subparts (down to the level of faces and edges) to and from STEP formats. 
+
+In an XDE document, GD&T are managed by the class *XCAFDoc_DimTolTool*. It works basing on the same principles as ShapeTool works with Shapes. This tool can be provided on the Main Label or on any sub-label. The GD&T entities themselves are defined as the following sub-classes of *TDF_Attribute*:
+  * *XCAFDoc_Dimension* - for dimensions;
+  * *XCAFDoc_GeomTolerance* - for geometric tolerances;
+  * *XCAFDoc_Datum* - for geometric tolerance Datums.
+A GD&T type is identified by the attributes listed above, i.e. *XCAFDoc_DimTolTool* methods working with particular entity types check 
+for presence of the corresponding attributes in passed labels. One can use methods of *XCAFDoc_DimTolTool* beginning with 'Is' for this purpose.
+GD&T entities are stored in a child of the starting document label 0.1.4. 
+Each GD&T entity then corresponds to the dedicated label, the property itself is one of access classes:
+  * *XCAFDimTolObject_DimensionObject* - for dimensions;
+  * *XCAFDimTolObject_GeomToleranceObject* - for geometric tolerances;
+  * *XCAFDimTolObject_DatumObject* - for geometric tolerance Datums.
+
+GD&Ts and Shapes are related to by Graph Nodes. 
+
+These definitions are common to various exchange formats, at least for STEP. 
+
+@subsubsection occt_xde_2_7_1 Initialization
+To query, edit, or initialize a Document to handle GD&Ts of XCAF, use: 
+~~~~~
+Handle(XCAFDoc_DimTolTool) myDimTolTool = 
+XCAFDoc_DocumentTool::DimTolTool(Doc->Main()); 
+~~~~~
+This call can be used at any time. When it is used for the first time, a relevant structure is added to the document. This definition is used for all later GD&T calls and is not repeated for them. 
+
+@subsubsection occt_xde_2_7_2 Adding a GD&T
+*XCAFDoc_DimTolTool* provides methods to create GD&T 'empty' entities:
+  * *AddDimension* - for a new dimension;
+  * *AddGeomTolerance* - for a new geometric tolerance;
+  * *AddDatum* - for a new geometric tolerance datum.
+
+All methods create a sub-label for the corresponding GD&T entity of the tool master label and attach an attribute specific for the
+created entity.
+
+Here is an example of adding a new dimension:
+~~~~~
+TDF_Label aDimLabel = myDimTolTool->AddDimension();
+if (!aDimLabel.IsNull())
+{
+  // error processing
+}
+~~~~~
+A similar approach can be used for other GD&T types.
+
+@subsubsection occt_xde_2_7_3 Editing a GD&T
+A newly added GD&T entity is empty. To set its data a corresponding access object should be used as it is demonstrated
+below, where the dimension becomes the linear distance between two points.
+~~~~~
+Handle(XCAFDoc_Dimension) aDimAttr;
+aDimLabel.FindAttribute(XCAFDoc_Dimension::GetID(), aDimAttr);
+if (!aDimAttr.IsNull())
+{
+  Handle(XCAFDimTolObjects_DimensionObject) aDimObject = aDimAttr->GetObject();
+  // set dimension data
+  aDimObject->SetType(XCAFDimTolObjects_DimensionType_Location_LinearDistance);
+  aDimObject->SetPoint(thePnt1);  // the first reference point
+  aDimObject->SetPoint2(thePnt2); // the second reference point
+  aDimObject->SetValue(theValue); // the distance value
+  //...
+  aDimAttr->SetObject(aDimObject);
+}
+~~~~~
+A similar approach can be used for other GD&T types.
+
+@subsubsection occt_xde_2_7_4 Linking GD&Ts
+To link a GD&T entity with other OCAF labels (e.g. representing shapes) one should use the following methods:
+  * *SetDimension* - for dimensions;
+  * *SetGeomTolerance* - for geometric tolerances;
+  * SetDatum - for geometric tolerance datums.
+
+These methods can take a single label or a sequence of labels. All previous links will be removed.
+
+The example below demonstrates linking of a dimension to sequences of shape labels:
+~~~~~
+TDF_LabelSequence aShapes1, aShapes2;
+aShapes1.Append(aShape11);
+//...
+aShapes2.Append(aShape21);
+//...
+aDGTTool->SetDimension(aShapes1, aShapes2, aDimLabel);
+~~~~~
 
-In an XDE document, custom notes are managed by the class *XCAFDoc_NotesTool*. This is done with the same principles as for ShapeTool with Shapes, and with the same capability of having a tool on the Main Label, or on any sub-label. The Property itself is defined as sub-classes of an *XCAFDoc_Note* abstract class, which is a sub-class of *TDF_Attribute* one. 
+In addition, a special method *SetDatumToGeomTol* should be used to link a datum with a geometric tolerance.
+
+@subsubsection occt_xde_2_7_5 Finding GD&Ts and reference shapes
+
+*XCAFDimTolObjects_Tool* class provides basic capabilities for searching GD&Ts linked to shapes.
+Using the tool one can get sequences of dimensions, geometric tolerances and datums linked with a shape. A series of related datums is also returned for geometric tolerances.
+
+To get reference shapes for a GD&T entity one can use *GetRefShapeLabel* from *XCAFDoc_DimTolTool*.
+
+*XCAFDoc_DimTolTool* provides methods to get lists of all dimensions, geometric tolerances and datums.
+
+@subsubsection occt_xde_2_7_6 Storing custom data
+Every GD&T entity in XDE is represented as a label with attached attribute identifying entity type. All specific data is
+stored in sub-labels in standard OCAF attributes, such as *TDataStd_Integer*, *TDataStd_IntegerArray*, *TDataStd_RealArray* and so on.
+Sub-label tags are reserved for internal use and cannot be used for storing custom data. The following tag ranges are reserved for
+GD&T entities:
+  * 1 - 17 - for dimensions;
+  * 1 - 17 - for geometric tolerances;
+  * 1 - 19 - for datums.
+Custom data can be stored in labels with tags beyond the ranges listed above.
+
+@subsection occt_xde_2_8 Clipping planes
+
+In an XDE document, Clipping planes are managed by the class *XCAFDoc_ClippingPlaneTool*. It works basing on the same principles as ShapeTool works with Shapes. This tool can be provided on the Main Label or on any sub-label. Clipping planes are stored in a child of the starting document label 0.1.8, where planes themselves are defined as *TDataXtd_Plane* attribute. *TDataStd_Name* attribute is used for naming.
+
+To query, edit, or initialize a Document to handle clipping planes of XCAF, use: 
+~~~~~
+Handle(XCAFDoc_ClippingPlaneTool) myClipPlaneTool = 
+XCAFDoc_DocumentTool::ClippingPlaneTool(Doc->Main()); 
+~~~~~
+This call can be used at any time. When it is used for the first time, a relevant structure is added to the document. 
 
-Custom notes are stored in a child of the *XCAFDoc_NotesTool* label: it is at label 0.1.9.1. Each note then corresponds to a dedicated label. A note may be attached to a document item identified by a label, a sub-shape identified by integer index or an attribute identified by GUID. Annotations are stored in a child of the *XCAFDoc_NotesTool* label: it is at label 0.1.9.2.
+To add a clipping plane use one of overloaded methods *AddClippingPlane*, e.g.:
+~~~~~
+gp_Pln aPln = ...
+Standard_Boolean aCapping = ...
+TDF_Label aClipPlnLbl = myClipPlaneTool->AddClippingPlane(aPln, "Name of plane", aCapping);
+if (aClipPlnLbl.IsNull())
+{
+  // error processing
+}
+~~~~~ 
+
+To remove a plane use *RemoveClippingPlane* method, e.g.:
+~~~~~
+if (!myClipPlaneTool->RemoveClippingPlane(aClipPlnLbl))
+{
+  // not removed
+}
+~~~~~
+The plane will not be removed if it is referenced in at least one view.
+
+To change clipping plane and its name use *UpdateClippingPlane* method, e.g.:
+~~~~~
+gp_Pln aPln = ...
+myClipPlaneTool->UpdateClippingPlane(aClipPlnLbl, aPln, "New name of plane");
+~~~~~
+
+Capping property can be changed using *SetCapping* method, e.g.:
+~~~~~
+Standard_Boolean aCapping = ...
+myClipPlaneTool->SetCapping(aClipPlnLbl, aCapping);
+~~~~~
+
+*XCAFDoc_ClippingPlaneTool* can be used to get all clipping plane labels and to check if a label belongs to the ClippingPlane table, e.g.:
+~~~~~
+TDF_LabelSequence aClipPlaneLbls;
+myClipPlaneTool->GetClippingPlanes(aClipPlaneLbls);
+...
+for (TDF_LabelSequence::Iterator anIt(aClipPlaneLbls); anIt.More(); anIt.Next())
+{
+  if (myClipPlaneTool->IsClippingPlane(anIt.Value()))
+  {
+    // the label is a clipping plane
+    gp_Pln aPln;
+    TCollection_ExtendedString aName;
+    Standard_Boolean aCapping;
+    if (!myClipPlaneTool->GetClippingPlane(anIt.Value(), aPln, aName, aCapping))
+    {
+      // error processing
+    }
+    ...
+  }
+}
+~~~~~
+
+@subsection occt_xde_2_9 Saved views
+
+In an XDE document, Views are managed by the class *XCAFDoc_ViewTool*. It works basing on the same principles as ShapeTool works with Shapes. This tool can be provided on the Main Label or on any sub-label. Views are stored in a child of the starting document label 0.1.7, where a view itself is defined as *XCAFDoc_View* sub-class of *TDF_Attribute*. Views and selected shapes, clipping planes, GD&Ts and notes are related to by Graph Nodes.
+
+To query, edit, or initialize a Document to handle views of XCAF, use: 
+~~~~~
+Handle(XCAFDoc_ViewTool) myViewTool = 
+XCAFDoc_DocumentTool::ViewTool(Doc->Main()); 
+~~~~~
+This call can be used at any time. When it is used for the first time, a relevant structure is added to the document. 
+
+To add a view use *AddView* method and an access *XCAFView_Object* object to set camera parameters, e.g.:
+~~~~~
+TDF_Label aViewLbl = myViewTool->AddView();
+if (aViewLbl.IsNull())
+{
+  // error processing
+}
+Handle(XCAFDoc_View) aViewAttr;
+aViewLbl.FindAttribute(XCAFDoc_View::GetID(), aViewAttr);
+if (!aViewAttr.IsNull())
+{
+  Handle(XCAFView_Object) aViewObject = aViewAttr->GetObject();
+  // set view data
+  aViewObject->SetType(XCAFView_ProjectionType_Parallel);
+  aViewObject->SetViewDirection(theViewDir);
+  aViewObject->SetZoomFactor(2.0);
+  ...
+  aViewAttr->SetObject(aViewObject);
+}
+~~~~~ 
+
+To set shapes, clipping planes, GD&Ts and notes selected for the view use one of overloaded *SetView* methods of *XCAFDoc_ViewTool*. 
+To set only clipping planes one should use *SetClippingPlanes* method.
+~~~~~
+TDF_LabelSequence aShapes; ...
+TDF_LabelSequence aGDTs; ...
+myViewTool->SetView(aShapes, aGDTs, aViewLbl);
+TDF_LabelSequence aClippingPlanes; ...
+myViewTool->SetClippingPlanes(aClippingPlanes, aViewLbl);
+~~~~~
+
+To remove a view use *RemoveView* method.
+
+To get all view labels and check if a label belongs to the View table use:
+~~~~~
+TDF_LabelSequence aViewLbls;
+myViewTool->GetViewLabels(aViewLbls);
+...
+for (TDF_LabelSequence::Iterator anIt(aViewLbls); anIt.More(); anIt.Next())
+{
+  if (myViewTool->IsView(anIt.Value()))
+  {
+    // the label is a view
+    ...
+  }
+}
+~~~~~
+
+To get shapes, clipping planes, GD&Ts or notes associated with a particular view use the following methods:
+  * *GetRefShapeLabel* - returns a sequence of associated shape labels;
+  * *GetRefGDTLabel* - returns a sequence of associated GDT labels;
+  * *GetRefClippingPlaneLabel* - returns a sequence of associated clipping plane labels;
+  * *GetRefNoteLabel* - returns a sequence of associated note labels;
+  * *GetRefAnnotationLabel* - returns a sequence of associated annotated labels.
+
+And vice versa, to get views that display a particular clipping plane, GD&T or note use the following methods:
+  * *GetViewLabelsForShape* - returns a sequence of associated view labels for a shape;
+  * *GetViewLabelsForGDT* - returns a sequence of associated view labels for a GD&T;
+  * *GetViewLabelsForClippingPlane* - returns a sequence of associated view labels for a clipping plane;
+  * *GetViewLabelsForNote* - returns a sequence of associated view labels for a note;
+  * *GetViewLabelsForAnnotation* - returns a sequence of associated view labels for an annotated label.
+
+@subsection occt_xde_2_10 Custom notes
+
+In an XDE document, custom notes are managed by the class *XCAFDoc_NotesTool*. It works basing on the same principles as ShapeTool works with Shapes. This tool can be provided on the Main Label or on any sub-label. The Property itself is defined as sub-class of *XCAFDoc_Note* abstract class, which is a sub-class of *TDF_Attribute* one. 
+
+Custom notes are stored in a child of the *XCAFDoc_NotesTool* label, at label 0.1.9.1. Each note then corresponds to a dedicated label. A note may be attached to a document item identified by a label, a sub-shape identified by integer index or an attribute identified by GUID. Annotations are stored in a child of the *XCAFDoc_NotesTool* label, at label 0.1.9.2.
 Notes binding is done through *XCAFDoc_GraphNode* attribute.
 
   @figure{/user_guides/xde/images/xde_notes001.png,"Structure of notes part of XCAF document",240}
   
-@subsubsection occt_xde_2_7_1 Initialization
+@subsubsection occt_xde_2_10_1 Initialization
 
 To query, edit, or initialize a Document to handle custom notes of XCAF, use: 
 ~~~~~
 Handle(XCAFDoc_NotesTool) myNotes = 
 XCAFDoc_DocumentTool::NotesTool(Doc->Main ()); 
 ~~~~~
-This call can be used at any time. The first time it is used, a relevant structure is added to the document. This definition is used for all the following notes calls and will not be repeated for these
+This call can be used at any time. The first time it is used, a relevant structure is added to the document. This definition is used for all later notes calls and will not be repeated for them
   
-@subsubsection occt_xde_2_7_2 Creating Notes
+@subsubsection occt_xde_2_10_2 Creating Notes
 
 Before annotating a Document item a note must be created using one of the following methods of *XCAFDoc_NotesTool* class:
-- CreateComment : creates a note with a textual comment
-- CreateBinData : creates a note with arbitrary binary data, e.g. contents of a file
+- *CreateComment* : creates a note with a textual comment;
+- *CreateBinData* : creates a note with arbitrary binary data, e.g. contents of a file.
 
 Both methods return an instance of *XCAFDoc_Note* class.
 ~~~~~
@@ -658,13 +936,13 @@ Handle(XCAFDoc_Note) myNote = myNotes->CreateComment("User", "Timestamp", "Hello
 ~~~~~
 This code adds a child label to label 0.1.9.1 with *XCAFDoc_NoteComment* attribute.
 
-@subsubsection occt_xde_2_7_3 Editing a Note
+@subsubsection occt_xde_2_10_3 Editing a Note
 An instance of *XCAFDoc_Note* class can be used for note editing.
 One may change common note data.
 ~~~~~
 myNote->Set("New User", "New Timestamp");
 ~~~~~
-To change specific data one need to down cast *myNote* handle to the appropriate sub-class:
+To change specific data one needs to down cast *myNote* handle to the appropriate sub-class:
 ~~~~~
 Handle(XCAFDoc_NoteComment) myCommentNote = Handle(XCAFDoc_NoteComment)::DownCast(myNote);
 if (!myCommentNote.IsNull()) {
@@ -672,12 +950,12 @@ if (!myCommentNote.IsNull()) {
 }
 ~~~~~
 
-@subsubsection occt_xde_2_7_4 Adding Notes
+@subsubsection occt_xde_2_10_4 Adding Notes
 
 Once a note has been created it can be bound to a Document item using the following *XCAFDoc_NotesTool* methods:
-- AddNote : binds a note to a label
-- AddNoteToAttr : binds a note to a label's attribute
-- AddNoteToSubshape : binds a note to a sub-shape
+- *AddNote* : binds a note to a label;
+- *AddNoteToAttr* : binds a note to a label's attribute;
+- *AddNoteToSubshape* : binds a note to a sub-shape.
 
 All methods return a pointer to *XCAFDoc_AssemblyItemRef* attribute identifying the annotated item.
 ~~~~~
@@ -690,14 +968,14 @@ Handle(XCAFDoc_AssemblyItemRef) myRefAttr = myNotes->AddNoteToAttr(myNote->Label
 Standard_Integer theSubshape = 1;
 Handle(XCAFDoc_AssemblyItemRef) myRefSubshape = myNotes->AddNoteToSubshape(myNote->Label(), theSubshape);
 ~~~~~
-This code adds three child labels to label 0.1.9.2 with *XCAFDoc_AssemblyItemRef* attribute with *XCAFDoc_GraphNode* attributes added to this and note labels.
+This code adds three child labels with *XCAFDoc_AssemblyItemRef* attribute to label 0.1.9.2. *XCAFDoc_GraphNode* attributes are added to the child labels and note labels.
 
-@subsubsection occt_xde_2_7_5 Finding Notes
+@subsubsection occt_xde_2_10_5 Finding Notes
 
 To find annotation labels under label 0.1.9.2 use the following *XCAFDoc_NotesTool* methods:
-- FindAnnotatedItem : returns an annotation label for a label
-- FindAnnotatedItemAttr : returns an annotation label for a label's attribute
-- FindAnnotatedItemSubshape : returns an annotation label for a sub-shape
+- *FindAnnotatedItem* : returns an annotation label for a label;
+- *FindAnnotatedItemAttr* : returns an annotation label for a label's attribute;
+- *FindAnnotatedItemSubshape* : returns an annotation label for a sub-shape.
 
 ~~~~~
 Handle(XCAFDoc_NotesTool) myNotes = ...
@@ -711,9 +989,9 @@ TDF_Label myLabelSubshape = myNotes->FindAnnotatedItemSubshape(theLabel, theSubs
 Null label will be returned if there is no corresponding annotation.
 
 To get all notes of the Document item use the following *XCAFDoc_NotesTool* methods:
-- GetNotes : outputs a sequence of note labels bound to a label
-- GetAttrNotes : outputs a sequence of note labels bound to a label's attribute
-- GetAttrSubshape : outputs a sequence of note labels bound to a sub-shape
+- *GetNotes* : outputs a sequence of note labels bound to a label;
+- *GetAttrNotes* : outputs a sequence of note labels bound to a label's attribute;
+- *GetAttrSubshape* : outputs a sequence of note labels bound to a sub-shape.
 
 All these methods return the number of notes.
 ~~~~~
@@ -729,12 +1007,12 @@ TDF_LabelSequence theNotesSubshape;
 myNotes->GetAttrSubshape(theLabel, theSubshape, theNotesSubshape);
 ~~~~~
 
-@subsubsection occt_xde_2_7_6 Removing Notes
+@subsubsection occt_xde_2_10_6 Removing Notes
 
 To remove a note use one of the following *XCAFDoc_NotesTool* methods:
-- RemoveNote : unbinds a note from a label
-- RemoveAttrNote : unbinds a note from a label's attribute
-- RemoveSubshapeNote : unbinds a note from a sub-shape
+- *RemoveNote* : unbinds a note from a label;
+- *RemoveAttrNote* : unbinds a note from a label's attribute;
+- *RemoveSubshapeNote* : unbinds a note from a sub-shape.
 
 ~~~~~
 Handle(XCAFDoc_Note) myNote = ...
@@ -746,30 +1024,31 @@ Standard_Integer theSubshape = 1;
 myNotes->RemoveSubshapeNote(myNote->Label(), theSubshape);
 ~~~~~
 A note will not be deleted automatically.
-Counterpart methods to remove all notes are available too.
+Counterpart methods to remove all notes are available, too.
   
-@subsubsection occt_xde_2_7_7 Deleting Notes
+@subsubsection occt_xde_2_10_7 Deleting Notes
 
 To delete note(s) use the following *XCAFDoc_NotesTool* methods:
-- DeleteNote : deletes a single note
-- DeleteNotes : deletes a sequence of notes
-- DeleteAllNotes : deletes all Document notes
-- DeleteOrphanNotes : deletes notes not bound to Document items
+- *DeleteNote* : deletes a single note;
+- *DeleteNotes* : deletes a sequence of notes;
+- *DeleteAllNotes* : deletes all Document notes;
+- *DeleteOrphanNotes* : deletes notes not bound to Document items.
 
-All these methods excepting the last one break all links with Document items as well.
+All these methods except for the last one break all links with Document items as well.
   
-@subsection occt_xde_2_8 Reading and Writing STEP or IGES
+@subsection occt_xde_2_11 Reading and Writing STEP or IGES
 Note that saving and restoring the document itself are standard OCAF operations. As the various previously described definitions enter into this frame, they will not be explained any further. 
 The same can be said for Viewing: presentations can be defined from Shapes and Colors. 
 
 There are several important points to consider: 
   * Previously defined Readers and Writers for dealing with Shapes only, whether Standard or Advanced, remain unchanged in their form and in their dependencies. In addition, functions other than mapping are also unchanged.
-  * XDE provides mapping with data other than Shapes. Names, Colors, Layers, Validation Properties (Centroid, Volume, Area), and Assembly Structure are hierarchic with rigid motion.
+  * XDE provides mapping with data other than Shapes. Names, Colors, Layers, GD&T, Clipping planes, Views, Validation Properties (Centroid, Volume, Area), and Assembly Structure are hierarchic with rigid motion. Currently, Clipping planes and Views writing supported for XBF format only.
   * XDE mapping is relevant for use within the Advanced level of Data Exchanges, rather than Standard ones, because a higher level of information is better suited to a higher quality of shapes. In addition, this allows to avoid the multiplicity of combinations between various options. Note that this choice is not one of architecture but of practical usage and packaging.
   * Reader and Writer classes for XDE are generally used like those for Shapes. However, their use is adapted to manage a Document rather than a Shape.
   
 The packages to manage this are *IGESCAFControl* for IGES, and *STEPCAFControl* for STEP. 
-@subsubsection occt_xde_2_8_1 Reading a STEP file
+
+@subsubsection occt_xde_2_11_1 Reading a STEP file
 To read a STEP file by itself, use: 
 
 ~~~~~
@@ -790,7 +1069,7 @@ if ( !reader.Transfer ( doc ) ) {
 ~~~~~
 
 In addition, the reader provides methods that are applicable to document transfers and for directly querying of the data produced. 
-@subsubsection occt_xde_2_8_2 Writing a STEP file
+@subsubsection occt_xde_2_11_2 Writing a STEP file
 To write a STEP file by itself, use: 
 
 ~~~~~
@@ -811,18 +1090,19 @@ if ( ! writer.Transfer ( Doc, mode ) ) {
 IFSelect_ReturnStatus stat = writer.Write(file-name); 
 ~~~~~
 
-@subsubsection occt_xde_2_8_3 Reading an IGES File
+@subsubsection occt_xde_2_11_3 Reading an IGES File
 Use the same procedure as for a STEP file but with IGESCAFControl instead of STEPCAFControl. 
-@subsubsection occt_xde_2_8_4 Writing an IGES File
+@subsubsection occt_xde_2_11_4 Writing an IGES File
 Use the same procedure as for a STEP file but with IGESCAFControl instead of STEPCAFControl.
  
-@subsection occt_xde_2_9 Using an XDE Document
+@subsection occt_xde_2_12 Using an XDE Document
 There are several ways of exploiting XDE data from an application, you can: 
  1. Get the data relevant for the application by mapping XDE/Appli, then discard the XDE data once it has been used.
  2. Create a reference from the Application Document to the XDE Document, to have its data available as external data.
  3. Embed XDE data inside the Application Document (see the following section for details).
  4. Directly exploit XDE data such as when using file checkers.
-@subsubsection occt_xde_2_91 XDE Data inside an Application Document
+
+@subsubsection occt_xde_2_12_1 XDE Data inside an Application Document
 To have XCAF data elsewhere than under label 0.1, you use the DocLabel of XDE. The method DocLabel from XCAFDoc_DocumentTool determines the relevant Label for XCAF. However, note that the default is 0.1. 
 
 In addition, as XDE data is defined and managed in a modular way, you can consider exclusively Assembly Structure, only Colors, and so on. 
index a9f8bd3..b580ab0 100644 (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
index 7e635b1..3a18955 100644 (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);
-  
-  Standard_EXPORT Standard_Boolean GetClassOfTolerance (Standard_Boolean& theHole, XCAFDimTolObjects_DimensionFormVariance& theFormVariance, XCAFDimTolObjects_DimensionGrade& theGrade) const;
-  
+  //! 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);
+  
+  //! 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);
index 5fdf620..4b0547f 100644 (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
index ec540a9..ad88666 100644 (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:
 
index c59edef..3a6ae88 100644 (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();
index 097b67a..2ec529e 100644 (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;
   
index 9743915..69f28e8 100644 (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++)
index 66c9200..1c6253c 100644 (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 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;
-  
-  //! 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;
-  
-  //! Sets a link with GUID
-  Standard_EXPORT void SetDimTol (const TDF_Label& L, const TDF_Label& DimTolL) 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;
-  
-  //! 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;
-  
-  //! Returns all DimTol labels defined for label ShapeL
-  Standard_EXPORT Standard_Boolean GetRefDGTLabels (const TDF_Label& ShapeL, TDF_LabelSequence& DimTols) 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
+  //! 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 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 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 existing dimension tolerance to theL label.
+  Standard_EXPORT void SetDimTol (const TDF_Label& theL, 
+                                  const TDF_Label& theDimTolL) 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;
+  
+  //! 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 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 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 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;
-  
-  //! 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 all Datum labels defined for label DimTolL
-  Standard_EXPORT Standard_Boolean GetDatumOfTolerLabels (const TDF_Label& DimTolL, TDF_LabelSequence& Datums) 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 GeomToleranses labels defined for label DatumL
-  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 true if the given GDT is marked as locked
+  //! Sets a datum to the sequence of shape labels.
+  Standard_EXPORT void SetDatum (const TDF_LabelSequence& theShapeLabels, 
+                                 const TDF_Label& theDatumL) 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 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 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 theDimTolL.
+  Standard_EXPORT Standard_Boolean GetDatumWithObjectOfTolerLabels (const TDF_Label& theDimTolL, 
+                                                                    TDF_LabelSequence& theDatums) 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 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.
   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;
index 84503b2..46b3208 100644 (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)
index 54eff0b..21ffc23 100644 (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;
index 45f4356..b88bfb7 100644 (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)
index 1cc6679..d3ee01d 100644 (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());
index 98b3407..027f9a4 100644 (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
 {