0027934: Data Exchange - implement STEP common labels
authorika <ika@opencascade.com>
Wed, 5 Oct 2016 14:02:27 +0000 (17:02 +0300)
committerapn <apn@opencascade.com>
Thu, 27 Oct 2016 14:08:04 +0000 (17:08 +0300)
implement import/export
update test cases

26 files changed:
src/STEPCAFControl/STEPCAFControl_GDTProperty.cxx
src/STEPCAFControl/STEPCAFControl_Reader.cxx
src/STEPCAFControl/STEPCAFControl_Writer.cxx
src/XCAFDimTolObjects/XCAFDimTolObjects_DimensionType.hxx
src/XDEDRAW/XDEDRAW_GDTs.cxx
tests/gdt/export/A1
tests/gdt/export/A2
tests/gdt/export/A3
tests/gdt/export/A4
tests/gdt/export/A5
tests/gdt/export/A6
tests/gdt/export/A7
tests/gdt/export/A8
tests/gdt/export/A9
tests/gdt/export/B1
tests/gdt/export/B2
tests/gdt/export/B3
tests/gdt/export/B4
tests/gdt/export/B5
tests/gdt/export/B6 [new file with mode: 0644]
tests/gdt/export/end
tests/gdt/import/A2
tests/gdt/import/A5
tests/gdt/presentation/A2
tests/gdt/presentation/A4
tests/gdt/presentation/B5 [new file with mode: 0644]

index 4415930..7e34049 100644 (file)
@@ -521,7 +521,8 @@ Standard_Boolean STEPCAFControl_GDTProperty::GetDimType(const Handle(TCollection
       theType = XCAFDimTolObjects_DimensionType_Location_LinearDistance_FromInnerToInner;
     }
 
-    if(theType != XCAFDimTolObjects_DimensionType_Location_None)
+    if(theType != XCAFDimTolObjects_DimensionType_Location_None &&
+       theType != XCAFDimTolObjects_DimensionType_CommonLabel)
     {
       return Standard_True;
     }
index ab04efc..e524631 100644 (file)
@@ -1765,165 +1765,72 @@ static Standard_Boolean GetMassConversionFactor(Handle(StepBasic_NamedUnit)& NU,
   }
   return Standard_True;
 }
-
 //=======================================================================
-//function : readAnnotation
-//purpose  : read annotation plane and position for given GDT
-// (Dimension, Geometric_Tolerance, Datum_Feature or Placed_Datum_Target_Feature)
+//function : readPMIPresentation
+//purpose  : read polyline or tessellated presentation for 
+// (Annotation_Curve_Occurrence or Draughting_Callout)
 //=======================================================================
-void readAnnotation(const Handle(XSControl_TransferReader)& theTR, 
-  const Handle(Standard_Transient) theGDT,
-  const Handle(Standard_Transient)& theDimObject)
+Standard_Boolean readPMIPresentation(const Handle(Standard_Transient)& thePresentEntity,
+                                     const Handle(XSControl_TransferReader)& theTR,
+                                     const Standard_Real theFact,
+                                     TopoDS_Shape& thePresentation, 
+                                     Handle(TCollection_HAsciiString)& thePresentName, 
+                                     Bnd_Box& theBox)
 {
-  Handle(TCollection_HAsciiString) aPresentName;
-  TopoDS_Compound aResAnnotation;
   Handle(Transfer_TransientProcess) aTP = theTR->TransientProcess();
-  const Interface_Graph& aGraph = aTP->Graph();
-  // find the proper DraughtingModelItemAssociation
-  Interface_EntityIterator subs = aGraph.Sharings(theGDT);
-  Handle(StepAP242_DraughtingModelItemAssociation) aDMIA;
-  for (subs.Start(); subs.More() && aDMIA.IsNull(); subs.Next()) {
-    if (!subs.Value()->IsKind(STANDARD_TYPE(StepAP242_DraughtingModelItemAssociation)))
-      continue;
-    aDMIA = Handle(StepAP242_DraughtingModelItemAssociation)::DownCast(subs.Value());
-    Handle(TCollection_HAsciiString) aName = aDMIA->Name();
-    aName->LowerCase();
-    if (!aName->Search(new TCollection_HAsciiString("pmi representation to presentation link"))) {
-      aDMIA = NULL;
-    }
-  }
-  if (aDMIA.IsNull() || aDMIA->NbIdentifiedItem() == 0)
-    return;
-
-  // calculate units
-  Handle(StepVisual_DraughtingModel) aDModel = 
-    Handle(StepVisual_DraughtingModel)::DownCast(aDMIA->UsedRepresentation());
-  Standard_Real aFact = 1;
-  if (!aDModel.IsNull())
-    GetLengthConversionFactorFromContext(aDModel->ContextOfItems(), aFact);
-
-  // retrieve AnnotationPlane
-  Standard_Boolean isHasPlane = Standard_False;
-  gp_Ax2 aPlaneAxes;
-  Handle(StepRepr_RepresentationItem) aDMIAE = aDMIA->IdentifiedItemValue(1);
-  if (aDMIAE.IsNull())
-    return;
-  subs = aGraph.Sharings(aDMIAE);
-  Handle(StepVisual_AnnotationPlane) anAnPlane;
-  for (subs.Start(); subs.More() && anAnPlane.IsNull(); subs.Next()) {
-    anAnPlane = Handle(StepVisual_AnnotationPlane)::DownCast(subs.Value());
-  }
-  if (!anAnPlane.IsNull()) {
-    Handle(StepRepr_RepresentationItem) aPlaneItem = anAnPlane->Item();
-    Handle(StepGeom_Axis2Placement3d) aA2P3D;
-    //retrieve axes from AnnotationPlane
-    if (aPlaneItem->IsKind(STANDARD_TYPE(StepGeom_Plane))) {
-      Handle(StepGeom_Plane) aPlane = Handle(StepGeom_Plane)::DownCast(aPlaneItem);
-      aA2P3D = aPlane->Position();
-    }
-    else if (aPlaneItem->IsKind(STANDARD_TYPE(StepVisual_PlanarBox))) {
-      Handle(StepVisual_PlanarBox) aBox = Handle(StepVisual_PlanarBox)::DownCast(aPlaneItem);
-      aA2P3D = aBox->Placement().Axis2Placement3d();
-    }
-    // build gp_Ax2 from axes
-    if (!aA2P3D.IsNull())
-    {
-      Handle(StepGeom_Direction) anAxis = aA2P3D->Axis(), 
-        aRefDir = aA2P3D->RefDirection();
-      if (!anAxis.IsNull() && !aRefDir.IsNull()) {
-        Handle(TColStd_HArray1OfReal) aCoords;
-        aCoords = anAxis->DirectionRatios();
-        gp_Dir aXDir(aCoords->Value(1), aCoords->Value(2), aCoords->Value(3));
-        aCoords = aRefDir->DirectionRatios();
-        gp_Dir aYDir(aCoords->Value(1), aCoords->Value(2), aCoords->Value(3));
-        aPlaneAxes.SetDirection(aXDir.Crossed(aYDir));
-        aPlaneAxes.SetYDirection(aYDir);
-        //set location of the annotation plane
-        Handle(TColStd_HArray1OfReal) aLocCoords;
-        Handle(StepGeom_CartesianPoint) aLoc = aA2P3D->Location();
-        gp_Pnt aLocPos( aLoc->CoordinatesValue(1) * aFact, aLoc->CoordinatesValue(2) * aFact, aLoc->CoordinatesValue(3) * aFact);
-        aPlaneAxes.SetLocation(aLocPos);
-        isHasPlane = Standard_True;
-      }
-    }
-  }
-
-  // set plane axes to XCAF
-  if (isHasPlane) {
-    if (theDimObject->IsKind(STANDARD_TYPE(XCAFDimTolObjects_DimensionObject))) {
-      Handle(XCAFDimTolObjects_DimensionObject) anObj = 
-        Handle(XCAFDimTolObjects_DimensionObject)::DownCast(theDimObject);
-      Handle(TColgp_HArray1OfPnt) aPnts = new TColgp_HArray1OfPnt(1, 1);
-      anObj->SetPlane(aPlaneAxes);
-    }
-    else if (theDimObject->IsKind(STANDARD_TYPE(XCAFDimTolObjects_DatumObject))) {
-      Handle(XCAFDimTolObjects_DatumObject) anObj =
-        Handle(XCAFDimTolObjects_DatumObject)::DownCast(theDimObject);
-      anObj->SetPlane(aPlaneAxes);
-    }
-    else if (theDimObject->IsKind(STANDARD_TYPE(XCAFDimTolObjects_GeomToleranceObject))) {
-      Handle(XCAFDimTolObjects_GeomToleranceObject) anObj =
-        Handle(XCAFDimTolObjects_GeomToleranceObject)::DownCast(theDimObject);
-      anObj->SetPlane(aPlaneAxes);
-    }
-  }
-
-  // Retrieve presentation
   Handle(StepVisual_AnnotationCurveOccurrence) anACO;
-  NCollection_Vector<Handle(StepVisual_TessellatedAnnotationOccurrence)> aTesselations;
   NCollection_Vector<Handle(StepVisual_StyledItem)> anAnnotations;
-  if (aDMIAE->IsKind(STANDARD_TYPE(StepVisual_AnnotationCurveOccurrence))) 
+  if (thePresentEntity->IsKind(STANDARD_TYPE(StepVisual_AnnotationCurveOccurrence)))
   {
-    anACO = Handle(StepVisual_AnnotationCurveOccurrence)::DownCast(aDMIAE);
-    if( !anACO.IsNull())
+    anACO = Handle(StepVisual_AnnotationCurveOccurrence)::DownCast(thePresentEntity);
+    thePresentName = anACO->Name();
+    if (!anACO.IsNull())
       anAnnotations.Append(anACO);
   }
-
-  else if (aDMIAE->IsKind(STANDARD_TYPE(StepVisual_DraughtingCallout))) 
+  else if (thePresentEntity->IsKind(STANDARD_TYPE(StepVisual_DraughtingCallout)))
   {
     Handle(StepVisual_DraughtingCallout) aDCallout =
-      Handle(StepVisual_DraughtingCallout)::DownCast(aDMIAE);
+      Handle(StepVisual_DraughtingCallout)::DownCast(thePresentEntity);
+    thePresentName = aDCallout->Name();
     for (Standard_Integer i = 1; i <= aDCallout->NbContents() && anACO.IsNull(); i++) {
       anACO = aDCallout->ContentsValue(i).AnnotationCurveOccurrence();
-      if(!anACO.IsNull())
+      if (!anACO.IsNull())
       {
         anAnnotations.Append(anACO);
         continue;
       }
-      Handle(StepVisual_TessellatedAnnotationOccurrence) aTesselation = 
+      Handle(StepVisual_TessellatedAnnotationOccurrence) aTesselation =
         aDCallout->ContentsValue(i).TessellatedAnnotationOccurrence();
-      if( !aTesselation.IsNull())
+      if (!aTesselation.IsNull())
         anAnnotations.Append(aTesselation);
     }
   }
 
   if (!anAnnotations.Length())
-    return;
+    return Standard_False;
 
 
   BRep_Builder aB;
+  TopoDS_Compound aResAnnotation;
   aB.MakeCompound(aResAnnotation);
 
-  Standard_Integer i =0;
+  Standard_Integer i = 0;
   Bnd_Box aBox;
-  Standard_Integer nbShapes =0;
-  for( ; i < anAnnotations.Length(); i++)
+  Standard_Integer nbShapes = 0;
+  for (; i < anAnnotations.Length(); i++)
   {
     Handle(StepVisual_StyledItem) anItem = anAnnotations(i);
-  
-    aPresentName = anItem->Name();
-
     anACO = Handle(StepVisual_AnnotationCurveOccurrence)::DownCast(anItem);
     TopoDS_Shape anAnnotationShape;
-    if(!anACO.IsNull())
+    if (!anACO.IsNull())
     {
       Handle(StepRepr_RepresentationItem) aCurveItem = anACO->Item();
-      anAnnotationShape = STEPConstruct::FindShape (aTP,aCurveItem);
-      if( anAnnotationShape.IsNull())
+      anAnnotationShape = STEPConstruct::FindShape(aTP, aCurveItem);
+      if (anAnnotationShape.IsNull())
       {
         Handle(Transfer_Binder) binder = theTR->Actor()->Transfer(aCurveItem, aTP);
-        if ( ! binder.IsNull() && binder->HasResult() ) {
-          anAnnotationShape = TransferBRep::ShapeResult ( aTP, binder );
+        if (!binder.IsNull() && binder->HasResult()) {
+          anAnnotationShape = TransferBRep::ShapeResult(aTP, binder);
         }
       }
     }
@@ -1931,10 +1838,10 @@ void readAnnotation(const Handle(XSControl_TransferReader)& theTR,
     else
     {
       Handle(StepRepr_RepresentationItem) aTessItem = anItem->Item();
-      if(aTessItem.IsNull())
+      if (aTessItem.IsNull())
         continue;
       Handle(StepVisual_TessellatedGeometricSet) aTessSet = Handle(StepVisual_TessellatedGeometricSet)::DownCast(aTessItem);
-      if( aTessSet.IsNull())
+      if (aTessSet.IsNull())
         continue;
       NCollection_Handle<StepVisual_Array1OfTessellatedItem> aListItems = aTessSet->Items();
       Standard_Integer nb = aListItems.IsNull() ? 0 : aListItems->Length();
@@ -1943,10 +1850,10 @@ void readAnnotation(const Handle(XSControl_TransferReader)& theTR,
       {
         aTessCurve = Handle(StepVisual_TessellatedCurveSet)::DownCast(aListItems->Value(n));
       }
-      if( aTessCurve.IsNull())
+      if (aTessCurve.IsNull())
         continue;
       Handle(StepVisual_CoordinatesList) aCoordList = aTessCurve->CoordList();
-      if( aCoordList.IsNull())
+      if (aCoordList.IsNull())
         continue;
       Handle(TColgp_HArray1OfXYZ)  aPoints = aCoordList->Points();
 
@@ -1956,24 +1863,24 @@ void readAnnotation(const Handle(XSControl_TransferReader)& theTR,
       Standard_Integer aNbC = (aCurves.IsNull() ? 0 : aCurves->Length());
       TopoDS_Compound aComp;
       aB.MakeCompound(aComp);
-      
+
       Standard_Integer k = 0;
-      for( ; k < aNbC; k++)
+      for (; k < aNbC; k++)
       {
         Handle(TColStd_HSequenceOfInteger) anIndexes = aCurves->Value(k);
         TopoDS_Wire aCurW;
         aB.MakeWire(aCurW);
 
-        for(Standard_Integer n = 1; n < anIndexes->Length(); n++)
+        for (Standard_Integer n = 1; n < anIndexes->Length(); n++)
         {
           Standard_Integer ind = anIndexes->Value(n);
           Standard_Integer indnext = anIndexes->Value(n + 1);
-          if( ind > aPoints->Length() || indnext > aPoints->Length())
+          if (ind > aPoints->Length() || indnext > aPoints->Length())
             continue;
-          gp_Pnt aP1(aPoints->Value(ind) * aFact);
-          gp_Pnt aP2(aPoints->Value(indnext) * aFact);
+          gp_Pnt aP1(aPoints->Value(ind) * theFact);
+          gp_Pnt aP2(aPoints->Value(indnext) * theFact);
           BRepBuilderAPI_MakeEdge aMaker(aP1, aP2);
-          if( aMaker.IsDone())
+          if (aMaker.IsDone())
           {
             TopoDS_Edge aCurE = aMaker.Edge();
             aB.Add(aCurW, aCurE);
@@ -1983,24 +1890,146 @@ void readAnnotation(const Handle(XSControl_TransferReader)& theTR,
       }
       anAnnotationShape = aComp;
     }
-    if(!anAnnotationShape.IsNull())
+    if (!anAnnotationShape.IsNull())
     {
       nbShapes++;
       aB.Add(aResAnnotation, anAnnotationShape);
-      if( i == anAnnotations.Length() - 1)
+      if (i == anAnnotations.Length() - 1)
         BRepBndLib::AddClose(anAnnotationShape, aBox);
     }
   }
-  
-  if(!nbShapes)
+
+  thePresentation = aResAnnotation;
+  theBox = aBox;
+  return (nbShapes > 0);
+}
+
+//=======================================================================
+//function : readAnnotationPlane
+//purpose  : read annotation plane
+//=======================================================================
+Standard_Boolean readAnnotationPlane(const Handle(StepVisual_AnnotationPlane) theAnnotationPlane,
+                                     const Standard_Real theFact,
+                                     gp_Ax2& thePlane)
+{
+  if (theAnnotationPlane.IsNull())
+    return Standard_False;
+  gp_Ax2 aPlaneAxes;
+  Handle(StepRepr_RepresentationItem) aPlaneItem = theAnnotationPlane->Item();
+  Handle(StepGeom_Axis2Placement3d) aA2P3D;
+  //retrieve axes from AnnotationPlane
+  if (aPlaneItem->IsKind(STANDARD_TYPE(StepGeom_Plane))) {
+    Handle(StepGeom_Plane) aPlane = Handle(StepGeom_Plane)::DownCast(aPlaneItem);
+    aA2P3D = aPlane->Position();
+  }
+  else if (aPlaneItem->IsKind(STANDARD_TYPE(StepVisual_PlanarBox))) {
+    Handle(StepVisual_PlanarBox) aBox = Handle(StepVisual_PlanarBox)::DownCast(aPlaneItem);
+    aA2P3D = aBox->Placement().Axis2Placement3d();
+  }
+  if (aA2P3D.IsNull())
+    return Standard_False;
+
+  // build gp_Ax2 from axes
+  Handle(StepGeom_Direction) anAxis = aA2P3D->Axis(),
+    aRefDir = aA2P3D->RefDirection();
+  if (anAxis.IsNull() || aRefDir.IsNull())
+    return Standard_False;
+
+  Handle(TColStd_HArray1OfReal) aCoords;
+  aCoords = anAxis->DirectionRatios();
+  gp_Dir aXDir(aCoords->Value(1), aCoords->Value(2), aCoords->Value(3));
+  aCoords = aRefDir->DirectionRatios();
+  gp_Dir aYDir(aCoords->Value(1), aCoords->Value(2), aCoords->Value(3));
+  aPlaneAxes.SetDirection(aXDir.Crossed(aYDir));
+  aPlaneAxes.SetYDirection(aYDir);
+  //set location of the annotation plane
+  Handle(TColStd_HArray1OfReal) aLocCoords;
+  Handle(StepGeom_CartesianPoint) aLoc = aA2P3D->Location();
+  gp_Pnt aLocPos(aLoc->CoordinatesValue(1) * theFact, aLoc->CoordinatesValue(2) * theFact, aLoc->CoordinatesValue(3) * theFact);
+  aPlaneAxes.SetLocation(aLocPos);
+  thePlane = aPlaneAxes;
+  return Standard_True;
+}
+
+//=======================================================================
+//function : readAnnotation
+//purpose  : read annotation plane and position for given GDT
+// (Dimension, Geometric_Tolerance, Datum_Feature or Placed_Datum_Target_Feature)
+//=======================================================================
+void readAnnotation(const Handle(XSControl_TransferReader)& theTR, 
+  const Handle(Standard_Transient) theGDT,
+  const Handle(Standard_Transient)& theDimObject)
+{
+  Handle(TCollection_HAsciiString) aPresentName;
+  TopoDS_Compound aResAnnotation;
+  Handle(Transfer_TransientProcess) aTP = theTR->TransientProcess();
+  const Interface_Graph& aGraph = aTP->Graph();
+  // find the proper DraughtingModelItemAssociation
+  Interface_EntityIterator subs = aGraph.Sharings(theGDT);
+  Handle(StepAP242_DraughtingModelItemAssociation) aDMIA;
+  for (subs.Start(); subs.More() && aDMIA.IsNull(); subs.Next()) {
+    if (!subs.Value()->IsKind(STANDARD_TYPE(StepAP242_DraughtingModelItemAssociation)))
+      continue;
+    aDMIA = Handle(StepAP242_DraughtingModelItemAssociation)::DownCast(subs.Value());
+    Handle(TCollection_HAsciiString) aName = aDMIA->Name();
+    aName->LowerCase();
+    if (!aName->Search(new TCollection_HAsciiString("pmi representation to presentation link"))) {
+      aDMIA = NULL;
+    }
+  }
+  if (aDMIA.IsNull() || aDMIA->NbIdentifiedItem() == 0)
+    return;
+
+  // calculate units
+  Handle(StepVisual_DraughtingModel) aDModel = 
+    Handle(StepVisual_DraughtingModel)::DownCast(aDMIA->UsedRepresentation());
+  Standard_Real aFact = 1;
+  if (!aDModel.IsNull())
+    GetLengthConversionFactorFromContext(aDModel->ContextOfItems(), aFact);
+
+  // retrieve AnnotationPlane
+  Handle(StepRepr_RepresentationItem) aDMIAE = aDMIA->IdentifiedItemValue(1);
+  if (aDMIAE.IsNull())
+    return;
+  gp_Ax2 aPlaneAxes;
+  subs = aGraph.Sharings(aDMIAE);
+  Handle(StepVisual_AnnotationPlane) anAnPlane;
+  for (subs.Start(); subs.More() && anAnPlane.IsNull(); subs.Next()) {
+    anAnPlane = Handle(StepVisual_AnnotationPlane)::DownCast(subs.Value());
+  }
+  Standard_Boolean isHasPlane = readAnnotationPlane(anAnPlane, aFact, aPlaneAxes);
+
+  // set plane axes to XCAF
+  if (isHasPlane) {
+    if (theDimObject->IsKind(STANDARD_TYPE(XCAFDimTolObjects_DimensionObject))) {
+      Handle(XCAFDimTolObjects_DimensionObject) anObj = 
+        Handle(XCAFDimTolObjects_DimensionObject)::DownCast(theDimObject);
+      Handle(TColgp_HArray1OfPnt) aPnts = new TColgp_HArray1OfPnt(1, 1);
+      anObj->SetPlane(aPlaneAxes);
+    }
+    else if (theDimObject->IsKind(STANDARD_TYPE(XCAFDimTolObjects_DatumObject))) {
+      Handle(XCAFDimTolObjects_DatumObject) anObj =
+        Handle(XCAFDimTolObjects_DatumObject)::DownCast(theDimObject);
+      anObj->SetPlane(aPlaneAxes);
+    }
+    else if (theDimObject->IsKind(STANDARD_TYPE(XCAFDimTolObjects_GeomToleranceObject))) {
+      Handle(XCAFDimTolObjects_GeomToleranceObject) anObj =
+        Handle(XCAFDimTolObjects_GeomToleranceObject)::DownCast(theDimObject);
+      anObj->SetPlane(aPlaneAxes);
+    }
+  }
+
+  // Retrieve presentation
+  Bnd_Box aBox;
+  if (!readPMIPresentation(aDMIAE, theTR, aFact, aResAnnotation, aPresentName, aBox))
     return;
   gp_Pnt aPtext(0., 0., 0.);
   // if Annotation plane location inside bounding box set it to text position
   // else set the center of bounding box to text position
-  if(!aBox.IsVoid())
+  if (!aBox.IsVoid())
   {
-    Standard_Real aXmin, aYmin, aZmin,aXmax, aYmax, aZmax; 
-    aBox.Get(aXmin, aYmin, aZmin,aXmax, aYmax, aZmax);
+    Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
+    aBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
     if (isHasPlane && !aBox.IsOut(aPlaneAxes.Location())) {
       aPtext = aPlaneAxes.Location();
     }
@@ -3703,6 +3732,8 @@ Standard_Boolean STEPCAFControl_Reader::ReadGDTs(const Handle(XSControl_WorkSess
                                                  Handle(TDocStd_Document)& theDoc) const
 {
   const Handle(Interface_InterfaceModel) &aModel = theWS->Model();
+  const Interface_Graph& aGraph = theWS->Graph();
+  const Handle(XSControl_TransferReader) &aTR = theWS->TransferReader();
   Handle(StepData_StepModel) aSM = Handle(StepData_StepModel)::DownCast(aModel);
   Interface_EntityIterator anI = aSM->Header();
   Handle(HeaderSection_FileSchema) aH;
@@ -3728,6 +3759,55 @@ Standard_Boolean STEPCAFControl_Reader::ReadGDTs(const Handle(XSControl_WorkSess
         }
       }
     }
+    else if (anEnt->IsKind(STANDARD_TYPE(StepVisual_DraughtingCallout)) ||
+      anEnt->IsKind(STANDARD_TYPE(StepVisual_AnnotationCurveOccurrence)))
+    {
+      // read common PMIs: presentation, which is not connected to any PMI.
+      Handle(StepVisual_AnnotationPlane) anAnPlane;
+      Handle(StepAP242_DraughtingModelItemAssociation) aDMIA;
+      Standard_Boolean isCommonLabel = Standard_True;
+      for (Interface_EntityIterator anIter = aGraph.Sharings(anEnt); anIter.More(); anIter.Next())
+      {
+        if (anIter.Value()->IsKind(STANDARD_TYPE(StepVisual_AnnotationPlane)))
+          anAnPlane = Handle(StepVisual_AnnotationPlane)::DownCast(anIter.Value());
+        else
+          isCommonLabel = Standard_False;
+      }
+      if (!isCommonLabel)
+        continue;
+      // create empty Dimension
+      TDF_Label aGDTL = aDGTTool->AddDimension();
+      Handle(XCAFDoc_Dimension) aDim = XCAFDoc_Dimension::Set(aGDTL);
+      TCollection_AsciiString aStr("DGT:Common_label");
+      TDataStd_Name::Set(aGDTL, aStr);
+      TDF_LabelSequence anEmptySeq1, anEmptySeq2;
+      aDGTTool->SetDimension(anEmptySeq1, anEmptySeq2, aGDTL);
+      Handle(XCAFDimTolObjects_DimensionObject) aDimObj = new XCAFDimTolObjects_DimensionObject();
+      // read annotations
+      Standard_Real aFact = 1.0;
+      if (!anAnPlane.IsNull())
+      {
+        Handle(StepVisual_DraughtingModel) aDModel;
+        for (Interface_EntityIterator anIter = aGraph.Sharings(anAnPlane); anIter.More() && aDModel.IsNull(); anIter.Next())
+        {
+          if (anIter.Value()->IsKind(STANDARD_TYPE(StepVisual_DraughtingModel)))
+            aDModel = Handle(StepVisual_DraughtingModel)::DownCast(anIter.Value());
+        }
+        if (!aDModel.IsNull())
+          GetLengthConversionFactorFromContext(aDModel->ContextOfItems(), aFact);
+      }
+      gp_Ax2 aPlaneAxes;
+      readAnnotationPlane(anAnPlane, aFact, aPlaneAxes);
+      TopoDS_Shape aPresentation;
+      Handle(TCollection_HAsciiString) aPresentName;
+      Bnd_Box aBox;
+      readPMIPresentation(anEnt, aTR, aFact, aPresentation, aPresentName, aBox);
+      // populate Dimension
+      aDimObj->SetType(XCAFDimTolObjects_DimensionType_CommonLabel);
+      aDimObj->SetPlane(aPlaneAxes);
+      aDimObj->SetPresentation(aPresentation, aPresentName);
+      aDim->SetObject(aDimObj);
+    }
   }
   return Standard_True;
 }
index 20c44fe..f8e8513 100644 (file)
@@ -2316,6 +2316,7 @@ static Handle(StepRepr_ShapeAspect) WriteShapeAspect (const Handle(XSControl_Wor
 //======================================================================
 static void WritePresentation(const Handle(XSControl_WorkSession) &WS,
                               const TopoDS_Shape thePresentation,
+                              const Handle(TCollection_HAsciiString)& thePrsName,
                               const gp_Ax2 theAnnotationPlane,
                               const gp_Pnt theTextPosition,
                               const Handle(Standard_Transient) theDimension)
@@ -2334,7 +2335,7 @@ static void WritePresentation(const Handle(XSControl_WorkSession) &WS,
   Handle(StepVisual_HArray1OfDraughtingCalloutElement) aTAOs = new StepVisual_HArray1OfDraughtingCalloutElement(1, 1);
   aTAOs->SetValue(1, aDCElement);
   Handle(StepVisual_DraughtingCallout) aDCallout = new StepVisual_DraughtingCallout();
-  aDCallout->Init(new TCollection_HAsciiString(), aTAOs);
+  aDCallout->Init(thePrsName, aTAOs);
   Handle(StepRepr_HArray1OfRepresentationItem) aDCsForDMIA = new StepRepr_HArray1OfRepresentationItem(1, 1);
   aDCsForDMIA->SetValue(1, aDCallout);
   StepAP242_ItemIdentifiedRepresentationUsageDefinition aDimension;
@@ -2381,6 +2382,61 @@ static void WritePresentation(const Handle(XSControl_WorkSession) &WS,
   aModel->AddWithRefs(anAnnPlane);
 }
 
+//======================================================================
+//function : WritePresentation
+//purpose  : auxiliary (write annotation plane and presentation for common labels)
+//======================================================================
+static void WritePresentation(const Handle(XSControl_WorkSession) &WS,
+                              const TopoDS_Shape thePresentation,
+                              const Handle(TCollection_HAsciiString)& thePrsName,
+                              const gp_Ax2 theAnnotationPlane)
+{
+  if (thePresentation.IsNull())
+    return;
+  // Get working data
+  const Handle(Interface_InterfaceModel) &aModel = WS->Model();
+
+  // Presentation
+  Handle(StepVisual_TessellatedGeometricSet) aGeomSet = STEPCAFControl_GDTProperty::GetTessellation(thePresentation);
+  Handle(StepVisual_TessellatedAnnotationOccurrence) aTAO = new StepVisual_TessellatedAnnotationOccurrence();
+  aTAO->Init(new TCollection_HAsciiString(), gdtPrsCurveStyle, aGeomSet);
+  StepVisual_DraughtingCalloutElement aDCElement;
+  aDCElement.SetValue(aTAO);
+  Handle(StepVisual_HArray1OfDraughtingCalloutElement) aTAOs = new StepVisual_HArray1OfDraughtingCalloutElement(1, 1);
+  aTAOs->SetValue(1, aDCElement);
+  Handle(StepVisual_DraughtingCallout) aDCallout = new StepVisual_DraughtingCallout();
+  aDCallout->Init(thePrsName, aTAOs);
+  aModel->AddWithRefs(aDCallout);
+
+  // Annotation plane
+  // Presentation Style
+  Handle(StepVisual_NullStyleMember) aNullStyle = new StepVisual_NullStyleMember();
+  aNullStyle->SetEnumText(0, ".NULL.");
+  StepVisual_PresentationStyleSelect aStyleItem;
+  aStyleItem.SetValue(aNullStyle);
+  Handle(StepVisual_HArray1OfPresentationStyleSelect) aStyles = new StepVisual_HArray1OfPresentationStyleSelect(1, 1);
+  aStyles->SetValue(1, aStyleItem);
+  Handle(StepVisual_PresentationStyleAssignment) aPrsStyle = new StepVisual_PresentationStyleAssignment();
+  aPrsStyle->Init(aStyles);
+  Handle(StepVisual_HArray1OfPresentationStyleAssignment) aPrsStyles =
+    new StepVisual_HArray1OfPresentationStyleAssignment(1, 1);
+  aPrsStyles->SetValue(1, aPrsStyle);
+  // Plane
+  Handle(StepGeom_Plane) aPlane = new StepGeom_Plane();
+  Handle(StepGeom_Axis2Placement3d) anAxis = STEPCAFControl_GDTProperty::GetAxis2Placement3D(theAnnotationPlane);
+  aPlane->Init(new TCollection_HAsciiString(), anAxis);
+  // Annotation plane element
+  StepVisual_AnnotationPlaneElement aPlaneElement;
+  aPlaneElement.SetValue(aDCallout);
+  Handle(StepVisual_HArray1OfAnnotationPlaneElement) aDCsForAnnPln = new StepVisual_HArray1OfAnnotationPlaneElement(1, 1);
+  aDCsForAnnPln->SetValue(1, aPlaneElement);
+  // Init AnnotationPlane entity
+  Handle(StepVisual_AnnotationPlane) anAnnPlane = new StepVisual_AnnotationPlane();
+  anAnnPlane->Init(new TCollection_HAsciiString(), aPrsStyles, aPlane, aDCsForAnnPln);
+  gdtAnnotationPlanes.Append(anAnnPlane);
+  aModel->AddWithRefs(anAnnPlane);
+}
+
 //=======================================================================
 //function : WriteDatumAP242
 //purpose  : auxiliary (write Datum entity for given shape or write all 
@@ -2579,7 +2635,7 @@ static Handle(StepDimTol_Datum) WriteDatumAP242(const Handle(XSControl_WorkSessi
   Model->AddWithRefs(aSDR);
 
   //Annotation plane and Presentation
-  WritePresentation(WS, anObject->GetPresentation(), anObject->GetPlane(), anObject->GetPointTextAttach(), aSA);
+  WritePresentation(WS, anObject->GetPresentation(), anObject->GetPresentationName(), anObject->GetPlane(), anObject->GetPointTextAttach(), aSA);
 
   return aDatum;
 }
@@ -3245,7 +3301,7 @@ static void WriteGeomTolerance (const Handle(XSControl_WorkSession) &WS,
   Model->AddWithRefs(aGeomTol);
   WriteToleranceZone(WS, anObject, aGeomTol, theRC);
   //Annotation plane and Presentation
-  WritePresentation(WS, anObject->GetPresentation(), anObject->GetPlane(), anObject->GetPointTextAttach(), aGeomTol);
+  WritePresentation(WS, anObject->GetPresentation(), anObject->GetPresentationName(), anObject->GetPlane(), anObject->GetPointTextAttach(), aGeomTol);
 }
 
 //=======================================================================
@@ -3681,14 +3737,19 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTsAP242 (const Handle(XSControl_W
   for (Standard_Integer i = 1; i <= aDGTLabels.Length(); i++) {
     TDF_Label aDimensionL = aDGTLabels.Value(i);
     TDF_LabelSequence aFirstShapeL, aSecondShapeL;
-    if (!DGTTool->GetRefShapeLabel(aDimensionL, aFirstShapeL, aSecondShapeL))
-      continue;
     Handle(XCAFDoc_Dimension) aDimAttr;
     if (!aDimensionL.FindAttribute(XCAFDoc_Dimension::GetID(),aDimAttr)) 
       continue;
     Handle(XCAFDimTolObjects_DimensionObject) anObject = aDimAttr->GetObject();
     if (anObject.IsNull())
       continue;
+    if (anObject->GetType() == XCAFDimTolObjects_DimensionType_CommonLabel)
+    {
+      WritePresentation(WS, anObject->GetPresentation(), anObject->GetPresentationName(), anObject->GetPlane());
+    }
+
+    if (!DGTTool->GetRefShapeLabel(aDimensionL, aFirstShapeL, aSecondShapeL))
+      continue;
 
     // Write links with shapes
     Handle(StepRepr_ShapeAspect) aFirstSA, aSecondSA;
@@ -3812,7 +3873,7 @@ Standard_Boolean STEPCAFControl_Writer::WriteDGTsAP242 (const Handle(XSControl_W
     // Write values
     WriteDimValues(WS, anObject, aRC, aDimension);
     //Annotation plane and Presentation
-    WritePresentation(WS, anObject->GetPresentation(), anObject->GetPlane(), anObject->GetPointTextAttach(), aDimension.Value());
+    WritePresentation(WS, anObject->GetPresentation(), anObject->GetPresentationName(), anObject->GetPlane(), anObject->GetPointTextAttach(), aDimension.Value());
   }
   // Write Derived geometry
   if (aConnectionPnts.Length() > 0) {
index 086b3c2..e4eae44 100644 (file)
@@ -49,7 +49,8 @@ XCAFDimTolObjects_DimensionType_Size_ToroidalHighMajorRadius,
 XCAFDimTolObjects_DimensionType_Size_ToroidalLowMajorRadius,
 XCAFDimTolObjects_DimensionType_Size_Thickness,
 XCAFDimTolObjects_DimensionType_Size_Angular,
-XCAFDimTolObjects_DimensionType_Size_WithPath
+XCAFDimTolObjects_DimensionType_Size_WithPath,
+XCAFDimTolObjects_DimensionType_CommonLabel
 };
 
 #endif // _XCAFDimTolObjects_DimensionType_HeaderFile
index 9ea5706..210b909 100644 (file)
@@ -371,7 +371,8 @@ static Standard_Integer DumpNbDGTs (Draw_Interpretor& di, Standard_Integer argc,
     Standard_Integer nbSize = 0,
                      nbLocation = 0,
                      nbAngular = 0,
-                     nbWithPath = 0;
+                     nbWithPath = 0,
+                     nbCommon = 0;
     for (Standard_Integer i = 1; i <= aGDTs.Length(); i++) {
       Handle(XCAFDoc_Dimension) aDimAttr;
       if (!aGDTs.Value(i).FindAttribute(XCAFDoc_Dimension::GetID(),aDimAttr)) 
@@ -380,7 +381,10 @@ static Standard_Integer DumpNbDGTs (Draw_Interpretor& di, Standard_Integer argc,
       if (anObject.IsNull())
         continue;
       XCAFDimTolObjects_DimensionType aDimType = anObject->GetType();
-      if (STEPCAFControl_GDTProperty::IsDimensionalLocation(aDimType)) {
+      if (aDimType == XCAFDimTolObjects_DimensionType_CommonLabel) {
+        nbCommon++;
+      }
+      else if (STEPCAFControl_GDTProperty::IsDimensionalLocation(aDimType)) {
         nbLocation++;
       }
       else if (aDimType == XCAFDimTolObjects_DimensionType_Location_Angular) {
@@ -407,6 +411,7 @@ static Standard_Integer DumpNbDGTs (Draw_Interpretor& di, Standard_Integer argc,
     di << "\n  NbOfDimensionalLocation: " << nbLocation;
     di << "\n  NbOfAngular            : " << nbAngular;
     di << "\n  NbOfWithPath           : " << nbWithPath;
+    di << "\n  NbOfCommonLabels       : " << nbCommon;
   }
 
   aGDTs.Clear();
index 4a682bc..0272ad9 100644 (file)
@@ -8,6 +8,7 @@ set ref_data {
   NbOfDimensionalLocation: 1
   NbOfAngular            : 1
   NbOfWithPath           : 0
+  NbOfCommonLabels       : 0
  NbOfTolerances          : 6
   NbOfGTWithModifiers    : 1
   NbOfGTWithMaxTolerance : 0
index 558a629..916e6b5 100644 (file)
@@ -3,11 +3,12 @@ set filename bug26689_nist_ctc_02_asme1_ap242-2.stp
 
 set ref_data {
 
- NbOfDimensions          : 7
+ NbOfDimensions          : 8
   NbOfDimensionalSize    : 7
   NbOfDimensionalLocation: 0
   NbOfAngular            : 0
   NbOfWithPath           : 0
+  NbOfCommonLabels       : 1
  NbOfTolerances          : 22
   NbOfGTWithModifiers    : 4
   NbOfGTWithMaxTolerance : 0
index 15ab2be..12cb0fe 100644 (file)
@@ -8,6 +8,7 @@ set ref_data {
   NbOfDimensionalLocation: 3
   NbOfAngular            : 0
   NbOfWithPath           : 0
+  NbOfCommonLabels       : 0
  NbOfTolerances          : 13
   NbOfGTWithModifiers    : 2
   NbOfGTWithMaxTolerance : 0
index d5714ab..57ac5e6 100644 (file)
@@ -8,6 +8,7 @@ set ref_data {
   NbOfDimensionalLocation: 3
   NbOfAngular            : 1
   NbOfWithPath           : 0
+  NbOfCommonLabels       : 0
  NbOfTolerances          : 6
   NbOfGTWithModifiers    : 0
   NbOfGTWithMaxTolerance : 0
index 6ab3b4a..2bbe854 100644 (file)
@@ -3,11 +3,12 @@ set filename bug26689_nist_ctc_05_asme1_ap242-1.stp
 
 set ref_data {
 
- NbOfDimensions          : 2
+ NbOfDimensions          : 6
   NbOfDimensionalSize    : 0
   NbOfDimensionalLocation: 2
   NbOfAngular            : 0
   NbOfWithPath           : 0
+  NbOfCommonLabels       : 4
  NbOfTolerances          : 10
   NbOfGTWithModifiers    : 0
   NbOfGTWithMaxTolerance : 0
index b10be35..ca6b320 100644 (file)
@@ -10,6 +10,7 @@ set ref_data {
   NbOfDimensionalLocation: 2
   NbOfAngular            : 0
   NbOfWithPath           : 0
+  NbOfCommonLabels       : 0
  NbOfTolerances          : 27
   NbOfGTWithModifiers    : 4
   NbOfGTWithMaxTolerance : 0
index 348ed7a..53a48fd 100644 (file)
@@ -10,6 +10,7 @@ set ref_data {
   NbOfDimensionalLocation: 10
   NbOfAngular            : 0
   NbOfWithPath           : 0
+  NbOfCommonLabels       : 0
  NbOfTolerances          : 27
   NbOfGTWithModifiers    : 4
   NbOfGTWithMaxTolerance : 0
index 2c216cb..f33cc1e 100644 (file)
@@ -10,6 +10,7 @@ set ref_data {
   NbOfDimensionalLocation: 8
   NbOfAngular            : 0
   NbOfWithPath           : 0
+  NbOfCommonLabels       : 0
  NbOfTolerances          : 27
   NbOfGTWithModifiers    : 4
   NbOfGTWithMaxTolerance : 0
index 751ff77..f59f0d7 100644 (file)
@@ -2,6 +2,7 @@
 set filename bug27645_nist_ftc_08_asme1_cr3000_rc.prt.stp
 puts "TODO CR26859 ALL:Error : 1 differences with reference data found :"
 puts "TODO CR26859 ALL:Error on writing file"
+
 set ref_data {
 
  NbOfDimensions          : 10
@@ -9,6 +10,7 @@ set ref_data {
   NbOfDimensionalLocation: 0
   NbOfAngular            : 0
   NbOfWithPath           : 0
+  NbOfCommonLabels       : 0
  NbOfTolerances          : 30
   NbOfGTWithModifiers    : 14
   NbOfGTWithMaxTolerance : 0
index 1b05cc4..cb35c44 100644 (file)
@@ -8,6 +8,7 @@ set ref_data {
   NbOfDimensionalLocation: 1
   NbOfAngular            : 0
   NbOfWithPath           : 0
+  NbOfCommonLabels       : 0
  NbOfTolerances          : 33
   NbOfGTWithModifiers    : 23
   NbOfGTWithMaxTolerance : 0
index 98bc13d..db2745c 100644 (file)
@@ -8,6 +8,7 @@ set ref_data {
   NbOfDimensionalLocation: 1
   NbOfAngular            : 0
   NbOfWithPath           : 0
+  NbOfCommonLabels       : 0
  NbOfTolerances          : 33
   NbOfGTWithModifiers    : 23
   NbOfGTWithMaxTolerance : 0
index 8cfcd13..8a7ddf0 100644 (file)
@@ -2,6 +2,7 @@
 set filename bug27645_nist_ftc_09_asme1_cr3000_rd.prt.stp
 puts "TODO CR26859 ALL:Error : 1 differences with reference data found :"
 puts "TODO CR26859 ALL:Error on writing file"
+
 set ref_data {
 
  NbOfDimensions          : 21
@@ -9,6 +10,7 @@ set ref_data {
   NbOfDimensionalLocation: 2
   NbOfAngular            : 0
   NbOfWithPath           : 0
+  NbOfCommonLabels       : 0
  NbOfTolerances          : 29
   NbOfGTWithModifiers    : 6
   NbOfGTWithMaxTolerance : 0
index 4c12b90..2c8080f 100644 (file)
@@ -10,6 +10,7 @@ set ref_data {
   NbOfDimensionalLocation: 7
   NbOfAngular            : 0
   NbOfWithPath           : 0
+  NbOfCommonLabels       : 0
  NbOfTolerances          : 31
   NbOfGTWithModifiers    : 8
   NbOfGTWithMaxTolerance : 0
index 7150ee9..26e7e8e 100644 (file)
@@ -8,6 +8,7 @@ set ref_data {
   NbOfDimensionalLocation: 7
   NbOfAngular            : 0
   NbOfWithPath           : 0
+  NbOfCommonLabels       : 0
  NbOfTolerances          : 31
   NbOfGTWithModifiers    : 8
   NbOfGTWithMaxTolerance : 0
diff --git a/tests/gdt/export/B6 b/tests/gdt/export/B6
new file mode 100644 (file)
index 0000000..01cf96c
--- /dev/null
@@ -0,0 +1,19 @@
+# !!!! This file is generated automatically, do not edit manually! See end script
+set filename bug27934_TEST_Machine_Part-brep-pmi.stp
+
+set ref_data {
+
+ NbOfDimensions          : 38
+  NbOfDimensionalSize    : 4
+  NbOfDimensionalLocation: 28
+  NbOfAngular            : 0
+  NbOfWithPath           : 0
+  NbOfCommonLabels       : 6
+ NbOfTolerances          : 0
+  NbOfGTWithModifiers    : 0
+  NbOfGTWithMaxTolerance : 0
+  NbOfGTWithDatums       : 0
+ NbOfDatumFeature        : 0
+ NbOfAttachedDatum       : 0
+ NbOfDatumTarget         : 0
+}
index 3792789..126a7d9 100644 (file)
@@ -9,6 +9,7 @@ set nbDimSize_First 0; set nbDimSize_Second 0;
 set nbDimLoc_First 0; set nbDimLoc_Second 0;
 set nbAng_First 0; set nbAng_Second 0;
 set nbDimWthPath_First 0; set nbDimWthPath_Second 0;
+set nbCommon_First 0; set nbCommon_Second 0;
 # Tolerances
 set nbTol_First 0; set nbTol_Second 0;
 set nbTolWthMod_First 0; set nbTolWthMod_Second 0;
@@ -49,6 +50,7 @@ if { $mist < 1} {
     regexp {NbOfDimensionalLocation +: +([-0-9.+eE]+)} $xst full nbDimLoc_First
     regexp {NbOfAngular +: +([-0-9.+eE]+)} $xst full nbAng_First
     regexp {NbOfWithPath +: +([-0-9.+eE]+)} $xst full nbWthPath_First
+    regexp {NbOfCommonLabels +: +([-0-9.+eE]+)} $xst full nbCommon_First
     regexp {NbOfTolerances +: +([-0-9.+eE]+)} $xst full nbTol_First
     regexp {NbOfGTWithModifiers +: +([-0-9.+eE]+)} $xst full nbTolWthMod_First
     regexp {NbOfGTWithMaxTolerance +: +([-0-9.+eE]+)} $xst full nbTolWthMax_First
@@ -104,6 +106,7 @@ if { $mist < 1} {
     regexp {NbOfDimensionalLocation +: +([-0-9.+eE]+)} $xst2 full nbDimLoc_Second
     regexp {NbOfAngular +: +([-0-9.+eE]+)} $xst2 full nbAng_Second
     regexp {NbOfWithPath +: +([-0-9.+eE]+)} $xst2 full nbWthPath_Second
+    regexp {NbOfCommonLabels +: +([-0-9.+eE]+)} $xst2 full nbCommon_Second
     regexp {NbOfTolerances +: +([-0-9.+eE]+)} $xst2 full nbTol_Second
     regexp {NbOfGTWithModifiers +: +([-0-9.+eE]+)} $xst2 full nbTolWthMod_Second
     regexp {NbOfGTWithMaxTolerance +: +([-0-9.+eE]+)} $xst2 full nbTolWthMax_Second
index d28c908..927ff23 100644 (file)
@@ -3,7 +3,7 @@ set filename bug26689_nist_ctc_02_asme1_ap242-2.stp
 
 set ref_data {
 
- NbOfDimensions          : 7
+ NbOfDimensions          : 8
  NbOfTolerances          : 22
  NbOfDatumFeature        : 5
  NbOfAttachedDatum       : 24
index 4902c19..2a1e8f4 100644 (file)
@@ -3,63 +3,63 @@ set filename bug26689_nist_ctc_05_asme1_ap242-1.stp
 
 set ref_data {
 
- NbOfDimensions          : 2
+ NbOfDimensions          : 6
  NbOfTolerances          : 10
  NbOfDatumFeature        : 2
  NbOfAttachedDatum       : 9
  NbOfDatumTarget         : 2
 
  0:1:1:2:2 Shape.5
-        0:1:4:10 Dimension.5.1 ( T 2, V 127, VL 64.515999999999991, VU 64.515999999999991, P 0 )
+        0:1:4:14 Dimension.5.1 ( T 2, V 127, VL 64.515999999999991, VU 64.515999999999991, P 0 )
  0:1:1:2:8 Shape.11
-        0:1:4:10 Dimension.11.1 ( T 2, V 127, VL 64.515999999999991, VU 64.515999999999991, P 0 )
+        0:1:4:14 Dimension.11.1 ( T 2, V 127, VL 64.515999999999991, VU 64.515999999999991, P 0 )
  0:1:1:2:9 Shape.12
         0:1:4:1 GeomTolerance.12.1 ( T 13 TV 0, V 0.127 )
  0:1:1:2:66 Shape.69
-        0:1:4:11 GeomTolerance.69.1 ( T 3 TV 0, V 0.050799999999999998 )
+        0:1:4:15 GeomTolerance.69.1 ( T 3 TV 0, V 0.050799999999999998 )
  0:1:1:2:67 Shape.70
-        0:1:4:11 GeomTolerance.70.1 ( T 3 TV 0, V 0.050799999999999998 )
+        0:1:4:15 GeomTolerance.70.1 ( T 3 TV 0, V 0.050799999999999998 )
  0:1:1:2:68 Shape.71
         0:1:4:2 GeomTolerance.71.1 ( T 2 TV 0, V 0.88900000000000001 )
                 0:1:4:3 Datum.71.1.1 ( )
                 0:1:4:4 Datum.71.1.2 ( )
  0:1:1:2:88 Shape.91
-        0:1:4:12 GeomTolerance.91.1 ( T 4 TV 1, V 0.76200000000000001 )
-                0:1:4:13 Datum.91.1.1 ( )
+        0:1:4:16 GeomTolerance.91.1 ( T 4 TV 1, V 0.76200000000000001 )
+                0:1:4:17 Datum.91.1.1 ( )
  0:1:1:2:89 Shape.92
-        0:1:4:12 GeomTolerance.92.1 ( T 4 TV 1, V 0.76200000000000001 )
-                0:1:4:13 Datum.92.1.1 ( )
+        0:1:4:16 GeomTolerance.92.1 ( T 4 TV 1, V 0.76200000000000001 )
+                0:1:4:17 Datum.92.1.1 ( )
  0:1:1:2:118 Shape.121
-        0:1:4:23 Datum target.121.1 ( T 3, A ( L (000), XD (10-0), RD (-010)), L 0 )
+        0:1:4:27 Datum target.121.1 ( T 3, A ( L (000), XD (10-0), RD (-010)), L 0 )
  0:1:1:2:123 Shape.126
-        0:1:4:21 Datum target.126.1 ( T 3, A ( L (000), XD (10-0), RD (-010)), L 0 )
+        0:1:4:25 Datum target.126.1 ( T 3, A ( L (000), XD (10-0), RD (-010)), L 0 )
  0:1:1:2:125 Shape.128
-        0:1:4:14 GeomTolerance.128.1 ( T 2 TV 0, V 0.63500000000000001 )
-                0:1:4:15 Datum.128.1.1 ( )
-                0:1:4:16 Datum.128.1.2 ( )
+        0:1:4:18 GeomTolerance.128.1 ( T 2 TV 0, V 0.63500000000000001 )
+                0:1:4:19 Datum.128.1.1 ( )
+                0:1:4:20 Datum.128.1.2 ( )
  0:1:1:2:141 Shape.144
-        0:1:4:17 GeomTolerance.144.1 ( T 2 TV 0, V 0.63500000000000001 )
-                0:1:4:18 Datum.144.1.1 ( )
-                0:1:4:19 Datum.144.1.2 ( )
+        0:1:4:21 GeomTolerance.144.1 ( T 2 TV 0, V 0.63500000000000001 )
+                0:1:4:22 Datum.144.1.1 ( )
+                0:1:4:23 Datum.144.1.2 ( )
  0:1:1:2:152 Shape.155
-        0:1:4:22 GeomTolerance.155.1 ( T 9 TV 0, V 0.254 )
-                0:1:4:23 Datum.155.1.1 ( )
+        0:1:4:26 GeomTolerance.155.1 ( T 9 TV 0, V 0.254 )
+                0:1:4:27 Datum.155.1.1 ( )
  0:1:1:2:153 Shape.156
-        0:1:4:7 GeomTolerance.156.1 ( T 2 TV 0, V 0.38100000000000001 )
-                0:1:4:8 Datum.156.1.1 ( )
+        0:1:4:9 GeomTolerance.156.1 ( T 2 TV 0, V 0.38100000000000001 )
+                0:1:4:10 Datum.156.1.1 ( )
  0:1:1:2:154 Shape.157
-        0:1:4:20 GeomTolerance.157.1 ( T 9 TV 0, V 0.254 )
-                0:1:4:21 Datum.157.1.1 ( )
+        0:1:4:24 GeomTolerance.157.1 ( T 9 TV 0, V 0.254 )
+                0:1:4:25 Datum.157.1.1 ( )
  0:1:1:2:199 Shape.202
-        0:1:4:5 GeomTolerance.202.1 ( T 2 TV 0, V 0.050799999999999998 )
-                0:1:4:6 Datum.202.1.1 ( )
+        0:1:4:7 GeomTolerance.202.1 ( T 2 TV 0, V 0.050799999999999998 )
+                0:1:4:8 Datum.202.1.1 ( )
  0:1:1:2:200 Shape.203
-        0:1:4:5 GeomTolerance.203.1 ( T 2 TV 0, V 0.050799999999999998 )
-                0:1:4:6 Datum.203.1.1 ( )
+        0:1:4:7 GeomTolerance.203.1 ( T 2 TV 0, V 0.050799999999999998 )
+                0:1:4:8 Datum.203.1.1 ( )
  0:1:1:2:206 Shape.209
-        0:1:4:9 Dimension.209.1 ( T 2, V 254, VL 64.515999999999991, VU 64.515999999999991, P 0 )
+        0:1:4:11 Dimension.209.1 ( T 2, V 254, VL 64.515999999999991, VU 64.515999999999991, P 0 )
  0:1:1:2:207 Shape.210
-        0:1:4:9 Dimension.210.1 ( T 2, V 254, VL 64.515999999999991, VU 64.515999999999991, P 0 )
+        0:1:4:11 Dimension.210.1 ( T 2, V 254, VL 64.515999999999991, VU 64.515999999999991, P 0 )
  0:1:1:3:1 Shape.211
         0:1:4:1 GeomTolerance.211.1 ( T 13 TV 0, V 0.127 )
 }
index baebe91..6690da9 100644 (file)
@@ -2,7 +2,7 @@
 set filename bug26689_nist_ctc_02_asme1_ap242-2.stp
 
 set ref_data {
-Centre of mass: -7.829938249111005 278.41260705890426 -84.730202273479279
-Mass: 54935.33694421465
+Centre of mass: -20.690618897992287 429.98435462807362 -195.18496405683655
+Mass: 71360.562475059254
 
 }
index 2f98748..7303def 100644 (file)
@@ -2,7 +2,7 @@
 set filename bug26689_nist_ctc_05_asme1_ap242-1.stp
 
 set ref_data {
-Centre of mass: 64.344333389783159 73.02072510397285 59.833361341556298
-Mass: 12896.277087016462
+Centre of mass: 56.678867441850549 62.371517442719387 56.338758909806039
+Mass: 14602.02565195344
 
 }
diff --git a/tests/gdt/presentation/B5 b/tests/gdt/presentation/B5
new file mode 100644 (file)
index 0000000..4ede06c
--- /dev/null
@@ -0,0 +1,8 @@
+# !!!! This file is generated automatically, do not edit manually! See end script
+set filename bug27934_TEST_Machine_Part-brep-pmi.stp
+
+set ref_data {
+Centre of mass: 3148.1200518800083 -633.28945446290447 1352.5172588429191
+Mass: 9340.0806267600256
+
+}