diff --git a/src/STEPCAFControl/STEPCAFControl_GDTProperty.cxx b/src/STEPCAFControl/STEPCAFControl_GDTProperty.cxx index 4415930892..7e340491cf 100644 --- a/src/STEPCAFControl/STEPCAFControl_GDTProperty.cxx +++ b/src/STEPCAFControl/STEPCAFControl_GDTProperty.cxx @@ -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; } diff --git a/src/STEPCAFControl/STEPCAFControl_Reader.cxx b/src/STEPCAFControl/STEPCAFControl_Reader.cxx index ab04efc4db..e524631439 100644 --- a/src/STEPCAFControl/STEPCAFControl_Reader.cxx +++ b/src/STEPCAFControl/STEPCAFControl_Reader.cxx @@ -1765,6 +1765,191 @@ static Standard_Boolean GetMassConversionFactor(Handle(StepBasic_NamedUnit)& NU, } return Standard_True; } +//======================================================================= +//function : readPMIPresentation +//purpose : read polyline or tessellated presentation for +// (Annotation_Curve_Occurrence or Draughting_Callout) +//======================================================================= +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(Transfer_TransientProcess) aTP = theTR->TransientProcess(); + Handle(StepVisual_AnnotationCurveOccurrence) anACO; + NCollection_Vector anAnnotations; + if (thePresentEntity->IsKind(STANDARD_TYPE(StepVisual_AnnotationCurveOccurrence))) + { + anACO = Handle(StepVisual_AnnotationCurveOccurrence)::DownCast(thePresentEntity); + thePresentName = anACO->Name(); + if (!anACO.IsNull()) + anAnnotations.Append(anACO); + } + else if (thePresentEntity->IsKind(STANDARD_TYPE(StepVisual_DraughtingCallout))) + { + Handle(StepVisual_DraughtingCallout) aDCallout = + 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()) + { + anAnnotations.Append(anACO); + continue; + } + Handle(StepVisual_TessellatedAnnotationOccurrence) aTesselation = + aDCallout->ContentsValue(i).TessellatedAnnotationOccurrence(); + if (!aTesselation.IsNull()) + anAnnotations.Append(aTesselation); + } + } + + if (!anAnnotations.Length()) + return Standard_False; + + + BRep_Builder aB; + TopoDS_Compound aResAnnotation; + aB.MakeCompound(aResAnnotation); + + Standard_Integer i = 0; + Bnd_Box aBox; + Standard_Integer nbShapes = 0; + for (; i < anAnnotations.Length(); i++) + { + Handle(StepVisual_StyledItem) anItem = anAnnotations(i); + anACO = Handle(StepVisual_AnnotationCurveOccurrence)::DownCast(anItem); + TopoDS_Shape anAnnotationShape; + if (!anACO.IsNull()) + { + Handle(StepRepr_RepresentationItem) aCurveItem = anACO->Item(); + 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); + } + } + } + //case of tessellated entities + else + { + Handle(StepRepr_RepresentationItem) aTessItem = anItem->Item(); + if (aTessItem.IsNull()) + continue; + Handle(StepVisual_TessellatedGeometricSet) aTessSet = Handle(StepVisual_TessellatedGeometricSet)::DownCast(aTessItem); + if (aTessSet.IsNull()) + continue; + NCollection_Handle aListItems = aTessSet->Items(); + Standard_Integer nb = aListItems.IsNull() ? 0 : aListItems->Length(); + Handle(StepVisual_TessellatedCurveSet) aTessCurve; + for (Standard_Integer n = 1; n <= nb && aTessCurve.IsNull(); n++) + { + aTessCurve = Handle(StepVisual_TessellatedCurveSet)::DownCast(aListItems->Value(n)); + } + if (aTessCurve.IsNull()) + continue; + Handle(StepVisual_CoordinatesList) aCoordList = aTessCurve->CoordList(); + if (aCoordList.IsNull()) + continue; + Handle(TColgp_HArray1OfXYZ) aPoints = aCoordList->Points(); + + if (aPoints.IsNull() || aPoints->Length() == 0) + continue; + NCollection_Handle aCurves = aTessCurve->Curves(); + Standard_Integer aNbC = (aCurves.IsNull() ? 0 : aCurves->Length()); + TopoDS_Compound aComp; + aB.MakeCompound(aComp); + + Standard_Integer k = 0; + 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++) + { + Standard_Integer ind = anIndexes->Value(n); + Standard_Integer indnext = anIndexes->Value(n + 1); + if (ind > aPoints->Length() || indnext > aPoints->Length()) + continue; + gp_Pnt aP1(aPoints->Value(ind) * theFact); + gp_Pnt aP2(aPoints->Value(indnext) * theFact); + BRepBuilderAPI_MakeEdge aMaker(aP1, aP2); + if (aMaker.IsDone()) + { + TopoDS_Edge aCurE = aMaker.Edge(); + aB.Add(aCurW, aCurE); + } + } + aB.Add(aComp, aCurW); + } + anAnnotationShape = aComp; + } + if (!anAnnotationShape.IsNull()) + { + nbShapes++; + aB.Add(aResAnnotation, anAnnotationShape); + if (i == anAnnotations.Length() - 1) + BRepBndLib::AddClose(anAnnotationShape, aBox); + } + } + + 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 @@ -1803,50 +1988,16 @@ void readAnnotation(const Handle(XSControl_TransferReader)& theTR, 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; + 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()); } - 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; - } - } - } + Standard_Boolean isHasPlane = readAnnotationPlane(anAnPlane, aFact, aPlaneAxes); // set plane axes to XCAF if (isHasPlane) { @@ -1869,138 +2020,16 @@ void readAnnotation(const Handle(XSControl_TransferReader)& theTR, } // Retrieve presentation - Handle(StepVisual_AnnotationCurveOccurrence) anACO; - NCollection_Vector aTesselations; - NCollection_Vector anAnnotations; - if (aDMIAE->IsKind(STANDARD_TYPE(StepVisual_AnnotationCurveOccurrence))) - { - anACO = Handle(StepVisual_AnnotationCurveOccurrence)::DownCast(aDMIAE); - if( !anACO.IsNull()) - anAnnotations.Append(anACO); - } - - else if (aDMIAE->IsKind(STANDARD_TYPE(StepVisual_DraughtingCallout))) - { - Handle(StepVisual_DraughtingCallout) aDCallout = - Handle(StepVisual_DraughtingCallout)::DownCast(aDMIAE); - for (Standard_Integer i = 1; i <= aDCallout->NbContents() && anACO.IsNull(); i++) { - anACO = aDCallout->ContentsValue(i).AnnotationCurveOccurrence(); - if(!anACO.IsNull()) - { - anAnnotations.Append(anACO); - continue; - } - Handle(StepVisual_TessellatedAnnotationOccurrence) aTesselation = - aDCallout->ContentsValue(i).TessellatedAnnotationOccurrence(); - if( !aTesselation.IsNull()) - anAnnotations.Append(aTesselation); - } - } - - if (!anAnnotations.Length()) - return; - - - BRep_Builder aB; - aB.MakeCompound(aResAnnotation); - - Standard_Integer i =0; Bnd_Box aBox; - 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()) - { - Handle(StepRepr_RepresentationItem) aCurveItem = anACO->Item(); - 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 ); - } - } - } - //case of tessellated entities - else - { - Handle(StepRepr_RepresentationItem) aTessItem = anItem->Item(); - if(aTessItem.IsNull()) - continue; - Handle(StepVisual_TessellatedGeometricSet) aTessSet = Handle(StepVisual_TessellatedGeometricSet)::DownCast(aTessItem); - if( aTessSet.IsNull()) - continue; - NCollection_Handle aListItems = aTessSet->Items(); - Standard_Integer nb = aListItems.IsNull() ? 0 : aListItems->Length(); - Handle(StepVisual_TessellatedCurveSet) aTessCurve; - for (Standard_Integer n = 1; n <= nb && aTessCurve.IsNull(); n++) - { - aTessCurve = Handle(StepVisual_TessellatedCurveSet)::DownCast(aListItems->Value(n)); - } - if( aTessCurve.IsNull()) - continue; - Handle(StepVisual_CoordinatesList) aCoordList = aTessCurve->CoordList(); - if( aCoordList.IsNull()) - continue; - Handle(TColgp_HArray1OfXYZ) aPoints = aCoordList->Points(); - - if (aPoints.IsNull() || aPoints->Length() == 0) - continue; - NCollection_Handle aCurves = aTessCurve->Curves(); - Standard_Integer aNbC = (aCurves.IsNull() ? 0 : aCurves->Length()); - TopoDS_Compound aComp; - aB.MakeCompound(aComp); - - Standard_Integer k = 0; - 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++) - { - Standard_Integer ind = anIndexes->Value(n); - Standard_Integer indnext = anIndexes->Value(n + 1); - if( ind > aPoints->Length() || indnext > aPoints->Length()) - continue; - gp_Pnt aP1(aPoints->Value(ind) * aFact); - gp_Pnt aP2(aPoints->Value(indnext) * aFact); - BRepBuilderAPI_MakeEdge aMaker(aP1, aP2); - if( aMaker.IsDone()) - { - TopoDS_Edge aCurE = aMaker.Edge(); - aB.Add(aCurW, aCurE); - } - } - aB.Add(aComp, aCurW); - } - anAnnotationShape = aComp; - } - if(!anAnnotationShape.IsNull()) - { - nbShapes++; - aB.Add(aResAnnotation, anAnnotationShape); - if( i == anAnnotations.Length() - 1) - BRepBndLib::AddClose(anAnnotationShape, aBox); - } - } - - if(!nbShapes) + 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; } diff --git a/src/STEPCAFControl/STEPCAFControl_Writer.cxx b/src/STEPCAFControl/STEPCAFControl_Writer.cxx index 20c44fe5bc..f8e85130c7 100644 --- a/src/STEPCAFControl/STEPCAFControl_Writer.cxx +++ b/src/STEPCAFControl/STEPCAFControl_Writer.cxx @@ -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) { diff --git a/src/XCAFDimTolObjects/XCAFDimTolObjects_DimensionType.hxx b/src/XCAFDimTolObjects/XCAFDimTolObjects_DimensionType.hxx index 086b3c234a..e4eae44856 100644 --- a/src/XCAFDimTolObjects/XCAFDimTolObjects_DimensionType.hxx +++ b/src/XCAFDimTolObjects/XCAFDimTolObjects_DimensionType.hxx @@ -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 diff --git a/src/XDEDRAW/XDEDRAW_GDTs.cxx b/src/XDEDRAW/XDEDRAW_GDTs.cxx index 9ea57065e9..210b909b45 100644 --- a/src/XDEDRAW/XDEDRAW_GDTs.cxx +++ b/src/XDEDRAW/XDEDRAW_GDTs.cxx @@ -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(); diff --git a/tests/gdt/export/A1 b/tests/gdt/export/A1 index 4a682bc8f7..0272ad9f5e 100644 --- a/tests/gdt/export/A1 +++ b/tests/gdt/export/A1 @@ -8,6 +8,7 @@ set ref_data { NbOfDimensionalLocation: 1 NbOfAngular : 1 NbOfWithPath : 0 + NbOfCommonLabels : 0 NbOfTolerances : 6 NbOfGTWithModifiers : 1 NbOfGTWithMaxTolerance : 0 diff --git a/tests/gdt/export/A2 b/tests/gdt/export/A2 index 558a6290fd..916e6b5217 100644 --- a/tests/gdt/export/A2 +++ b/tests/gdt/export/A2 @@ -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 diff --git a/tests/gdt/export/A3 b/tests/gdt/export/A3 index 15ab2be553..12cb0fe4d9 100644 --- a/tests/gdt/export/A3 +++ b/tests/gdt/export/A3 @@ -8,6 +8,7 @@ set ref_data { NbOfDimensionalLocation: 3 NbOfAngular : 0 NbOfWithPath : 0 + NbOfCommonLabels : 0 NbOfTolerances : 13 NbOfGTWithModifiers : 2 NbOfGTWithMaxTolerance : 0 diff --git a/tests/gdt/export/A4 b/tests/gdt/export/A4 index d5714abad1..57ac5e6991 100644 --- a/tests/gdt/export/A4 +++ b/tests/gdt/export/A4 @@ -8,6 +8,7 @@ set ref_data { NbOfDimensionalLocation: 3 NbOfAngular : 1 NbOfWithPath : 0 + NbOfCommonLabels : 0 NbOfTolerances : 6 NbOfGTWithModifiers : 0 NbOfGTWithMaxTolerance : 0 diff --git a/tests/gdt/export/A5 b/tests/gdt/export/A5 index 6ab3b4a4bc..2bbe8546f2 100644 --- a/tests/gdt/export/A5 +++ b/tests/gdt/export/A5 @@ -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 diff --git a/tests/gdt/export/A6 b/tests/gdt/export/A6 index b10be35292..ca6b320bf4 100644 --- a/tests/gdt/export/A6 +++ b/tests/gdt/export/A6 @@ -10,6 +10,7 @@ set ref_data { NbOfDimensionalLocation: 2 NbOfAngular : 0 NbOfWithPath : 0 + NbOfCommonLabels : 0 NbOfTolerances : 27 NbOfGTWithModifiers : 4 NbOfGTWithMaxTolerance : 0 diff --git a/tests/gdt/export/A7 b/tests/gdt/export/A7 index 348ed7a4d9..53a48fd0ee 100644 --- a/tests/gdt/export/A7 +++ b/tests/gdt/export/A7 @@ -10,6 +10,7 @@ set ref_data { NbOfDimensionalLocation: 10 NbOfAngular : 0 NbOfWithPath : 0 + NbOfCommonLabels : 0 NbOfTolerances : 27 NbOfGTWithModifiers : 4 NbOfGTWithMaxTolerance : 0 diff --git a/tests/gdt/export/A8 b/tests/gdt/export/A8 index 2c216cb72b..f33cc1e0c8 100644 --- a/tests/gdt/export/A8 +++ b/tests/gdt/export/A8 @@ -10,6 +10,7 @@ set ref_data { NbOfDimensionalLocation: 8 NbOfAngular : 0 NbOfWithPath : 0 + NbOfCommonLabels : 0 NbOfTolerances : 27 NbOfGTWithModifiers : 4 NbOfGTWithMaxTolerance : 0 diff --git a/tests/gdt/export/A9 b/tests/gdt/export/A9 index 751ff771ca..f59f0d7ad2 100644 --- a/tests/gdt/export/A9 +++ b/tests/gdt/export/A9 @@ -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 diff --git a/tests/gdt/export/B1 b/tests/gdt/export/B1 index 1b05cc435f..cb35c448fd 100644 --- a/tests/gdt/export/B1 +++ b/tests/gdt/export/B1 @@ -8,6 +8,7 @@ set ref_data { NbOfDimensionalLocation: 1 NbOfAngular : 0 NbOfWithPath : 0 + NbOfCommonLabels : 0 NbOfTolerances : 33 NbOfGTWithModifiers : 23 NbOfGTWithMaxTolerance : 0 diff --git a/tests/gdt/export/B2 b/tests/gdt/export/B2 index 98bc13db37..db2745c6ec 100644 --- a/tests/gdt/export/B2 +++ b/tests/gdt/export/B2 @@ -8,6 +8,7 @@ set ref_data { NbOfDimensionalLocation: 1 NbOfAngular : 0 NbOfWithPath : 0 + NbOfCommonLabels : 0 NbOfTolerances : 33 NbOfGTWithModifiers : 23 NbOfGTWithMaxTolerance : 0 diff --git a/tests/gdt/export/B3 b/tests/gdt/export/B3 index 8cfcd13402..8a7ddf0f45 100644 --- a/tests/gdt/export/B3 +++ b/tests/gdt/export/B3 @@ -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 diff --git a/tests/gdt/export/B4 b/tests/gdt/export/B4 index 4c12b905df..2c8080f353 100644 --- a/tests/gdt/export/B4 +++ b/tests/gdt/export/B4 @@ -10,6 +10,7 @@ set ref_data { NbOfDimensionalLocation: 7 NbOfAngular : 0 NbOfWithPath : 0 + NbOfCommonLabels : 0 NbOfTolerances : 31 NbOfGTWithModifiers : 8 NbOfGTWithMaxTolerance : 0 diff --git a/tests/gdt/export/B5 b/tests/gdt/export/B5 index 7150ee9bdb..26e7e8eadb 100644 --- a/tests/gdt/export/B5 +++ b/tests/gdt/export/B5 @@ -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 index 0000000000..01cf96c897 --- /dev/null +++ b/tests/gdt/export/B6 @@ -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 +} diff --git a/tests/gdt/export/end b/tests/gdt/export/end index 3792789c61..126a7d9fa4 100644 --- a/tests/gdt/export/end +++ b/tests/gdt/export/end @@ -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 diff --git a/tests/gdt/import/A2 b/tests/gdt/import/A2 index d28c9081a0..927ff23ea0 100644 --- a/tests/gdt/import/A2 +++ b/tests/gdt/import/A2 @@ -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 diff --git a/tests/gdt/import/A5 b/tests/gdt/import/A5 index 4902c1967d..2a1e8f41d8 100644 --- a/tests/gdt/import/A5 +++ b/tests/gdt/import/A5 @@ -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 ) } diff --git a/tests/gdt/presentation/A2 b/tests/gdt/presentation/A2 index baebe917cc..6690da9df1 100644 --- a/tests/gdt/presentation/A2 +++ b/tests/gdt/presentation/A2 @@ -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 } diff --git a/tests/gdt/presentation/A4 b/tests/gdt/presentation/A4 index 2f98748e03..7303defd20 100644 --- a/tests/gdt/presentation/A4 +++ b/tests/gdt/presentation/A4 @@ -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 index 0000000000..4ede06c0cb --- /dev/null +++ b/tests/gdt/presentation/B5 @@ -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 + +}