Implement Null_Style STEP type.
Implement export of annotation planes and presentation as tessellated geometry.
Add tests.
#include <TopoDS.hxx>
#include <DBRep.hxx>
+#include <BRepGProp.hxx>
+#include <DDocStd.hxx>
+#include <GProp_GProps.hxx>
+#include <TDocStd_Document.hxx>
+#include <XCAFDimTolObjects_DatumObject.hxx>
+#include <XCAFDimTolObjects_DimensionObject.hxx>
+#include <XCAFDimTolObjects_GeomToleranceObject.hxx>
+#include <XCAFDoc_Datum.hxx>
+#include <XCAFDoc_Dimension.hxx>
+#include <XCAFDoc_DimTolTool.hxx>
+#include <XCAFDoc_DocumentTool.hxx>
+#include <XCAFDoc_GeomTolerance.hxx>
+#include <XCAFDoc_ShapeTool.hxx>
//=======================================================================
//function : SurfaceGenOCC26675_1
//purpose : Generates a surface for intersect (in corresponding
return 0;
}
+//=======================================================================
+//function : OCC27235
+//purpose : check presentation in GDT document
+//=======================================================================
+static Standard_Integer OCC27235 (Draw_Interpretor& theDI, Standard_Integer n, const char** a)
+{
+ if (n < 2) {
+ theDI<<"Use: OCC27235 Doc";
+ return 1;
+ }
+
+ Handle(TDocStd_Document) Doc;
+ DDocStd::GetDocument(a[1], Doc);
+ if ( Doc.IsNull() ) { theDI << a[1] << " is not a document\n"; return 1; }
+ Handle(XCAFDoc_DimTolTool) aDimTolTool= XCAFDoc_DocumentTool::DimTolTool(Doc->Main());
+ Handle(XCAFDoc_ShapeTool) aShapeTool= XCAFDoc_DocumentTool::ShapeTool(Doc->Main());
+ TopoDS_Compound aPresentations;
+ BRep_Builder B;
+ B.MakeCompound(aPresentations);
+
+ TDF_LabelSequence aLabels;
+ aShapeTool->GetShapes(aLabels);
+ for ( Standard_Integer i=1; i <= aLabels.Length(); i++ )
+ {
+ aShapeTool->GetSubShapes(aLabels.Value(i), aLabels);
+ }
+
+ TDF_LabelSequence aGDTs;
+ aDimTolTool->GetDimensionLabels(aGDTs);
+ for (Standard_Integer i = 1; i <= aGDTs.Length(); i++) {
+ Handle(XCAFDoc_Dimension) aDimAttr;
+ if (!aGDTs.Value(i).FindAttribute(XCAFDoc_Dimension::GetID(),aDimAttr))
+ continue;
+ Handle(XCAFDimTolObjects_DimensionObject) anObject = aDimAttr->GetObject();
+ if (anObject.IsNull())
+ continue;
+ TopoDS_Shape aShape = anObject->GetPresentation();
+ if (!aShape.IsNull())
+ B.Add(aPresentations, aShape);
+ }
+
+ aGDTs.Clear();
+ aDimTolTool->GetGeomToleranceLabels(aGDTs);
+ for (Standard_Integer i = 1; i <= aGDTs.Length(); i++) {
+ Handle(XCAFDoc_GeomTolerance) aGTAttr;
+ if (!aGDTs.Value(i).FindAttribute(XCAFDoc_GeomTolerance::GetID(),aGTAttr))
+ continue;
+ Handle(XCAFDimTolObjects_GeomToleranceObject) anObject = aGTAttr->GetObject();
+ if (anObject.IsNull())
+ continue;
+ TopoDS_Shape aShape = anObject->GetPresentation();
+ if (!aShape.IsNull())
+ B.Add(aPresentations, aShape);
+ }
+
+ for ( Standard_Integer i=1; i <= aLabels.Length(); i++ )
+ {
+ TDF_LabelSequence aDatL;
+ if(aDimTolTool->GetRefDatumLabel(aLabels.Value(i), aDatL))
+ {
+ for(Standard_Integer j = aDatL.Lower(); j <= aDatL.Upper(); j++)
+ {
+ Handle(XCAFDoc_Datum) aDat;
+ if(!aDatL.Value(j).FindAttribute(XCAFDoc_Datum::GetID(), aDat))
+ continue;
+ Handle(XCAFDimTolObjects_DatumObject) anObject = aDat->GetObject();
+ if (anObject.IsNull())
+ continue;
+ TopoDS_Shape aShape = anObject->GetPresentation();
+ if (!aShape.IsNull())
+ B.Add(aPresentations, aShape);
+ }
+ }
+ }
+
+ GProp_GProps aG;
+ BRepGProp::LinearProperties(aPresentations, aG);
+ gp_Pnt aPnt = aG.CentreOfMass();
+ theDI << "Centre of mass: " << aPnt.X() << " " << aPnt.Y() << " " << aPnt.Z() << "\n";
+ theDI << "Mass: " << aG.Mass() << "\n";
+
+ return 0;
+}
+
void QABugs::Commands_20(Draw_Interpretor& theCommands) {
const char *group = "QABugs";
theCommands.Add ("OCC26675_1", "OCC26675_1 result", __FILE__, SurfaceGenOCC26675_1, group);
theCommands.Add ("OCC24836", "OCC24836", __FILE__, OCC24836, group);
theCommands.Add("OCC27021", "OCC27021", __FILE__, OCC27021, group);
+ theCommands.Add("OCC27235", "OCC27235", __FILE__, OCC27235, group);
return;
}
tool.Share(anent,iter);
}
break;
+ case 710:
+ {
+ DeclareAndCast(StepVisual_TessellatedCurveSet,anent,ent);
+ RWStepVisual_RWTessellatedCurveSet tool;
+ tool.Share(anent,iter);
+ }
+ break;
default : break;
}
}
break;
case 711:
{
- DeclareAndCast(StepVisual_CoordinatesList,anent,ent);
+ DeclareAndCast(StepVisual_CoordinatesList,anent,ent);
RWStepVisual_RWCoordinatesList tool;
tool.WriteStep(SW,anent);
#include <Interface_Check.hxx>
#include <Interface_EntityIterator.hxx>
#include <RWStepVisual_RWPresentationStyleAssignment.hxx>
+#include <StepData_SelectMember.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
+#include <StepVisual_NullStyleMember.hxx>
#include <StepVisual_HArray1OfPresentationStyleSelect.hxx>
#include <StepVisual_PresentationStyleAssignment.hxx>
#include <StepVisual_PresentationStyleSelect.hxx>
// --- own field : styles ---
- Handle(StepVisual_HArray1OfPresentationStyleSelect) aStyles;
- StepVisual_PresentationStyleSelect aStylesItem;
- Standard_Integer nsub1;
- if (data->ReadSubList (num,1,"styles",ach,nsub1)) {
- Standard_Integer nb1 = data->NbParams(nsub1);
- aStyles = new StepVisual_HArray1OfPresentationStyleSelect (1, nb1);
- for (Standard_Integer i1 = 1; i1 <= nb1; i1 ++) {
- //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
- if (data->ReadEntity (nsub1,i1,"styles",ach,aStylesItem))
- aStyles->SetValue(i1,aStylesItem);
- }
- }
+ Handle(StepVisual_HArray1OfPresentationStyleSelect) aStyles;
+ StepVisual_PresentationStyleSelect aStylesItem;
+ Standard_Integer nsub1;
+ if (data->ReadSubList (num,1,"styles",ach,nsub1)) {
+ Standard_Integer nb1 = data->NbParams(nsub1);
+ aStyles = new StepVisual_HArray1OfPresentationStyleSelect (1, nb1);
+ for (Standard_Integer i1 = 1; i1 <= nb1; i1 ++) {
+ Interface_ParamType aType = data->ParamType(nsub1, i1);
+ if (aType == Interface_ParamIdent) {
+ data->ReadEntity (nsub1,i1,"styles",ach,aStylesItem);
+ }
+ else {
+ Handle(StepData_SelectMember) aMember;
+ data->ReadMember(nsub1, i1, "null_style", ach, aMember);
+ Standard_CString anEnumText = aMember->EnumText();
+ Handle(StepVisual_NullStyleMember) aNullStyle = new StepVisual_NullStyleMember();
+ aNullStyle->SetEnumText(0, anEnumText);
+ aStylesItem.SetValue(aNullStyle);
+ }
+ aStyles->SetValue(i1,aStylesItem);
+ }
+ }
//--- Initialisation of the read entity ---
// --- own field : styles ---
SW.OpenSub();
- for (Standard_Integer i1 = 1; i1 <= ent->NbStyles(); i1 ++) {
- SW.Send(ent->StylesValue(i1).Value());
- }
+ for (Standard_Integer i1 = 1; i1 <= ent->NbStyles(); i1 ++) {
+ StepVisual_PresentationStyleSelect aStyle = ent->StylesValue(i1);
+ if (aStyle.Value()->IsKind(STANDARD_TYPE(StepVisual_NullStyleMember))) {
+ SW.OpenTypedSub("NULL_STYLE");
+ SW.SendEnum(".NULL.");
+ SW.CloseSub();
+ }
+ else
+ SW.Send(aStyle.Value());
+ }
SW.CloseSub();
}
#include <Interface_Check.hxx>
#include <Interface_EntityIterator.hxx>
#include <RWStepVisual_RWPresentationStyleByContext.hxx>
+#include <StepData_SelectMember.hxx>
#include <StepData_StepReaderData.hxx>
#include <StepData_StepWriter.hxx>
#include <StepVisual_HArray1OfPresentationStyleSelect.hxx>
+#include <StepVisual_NullStyleMember.hxx>
#include <StepVisual_PresentationStyleByContext.hxx>
#include <StepVisual_PresentationStyleSelect.hxx>
#include <StepVisual_StyleContextSelect.hxx>
// --- inherited field : styles ---
- Handle(StepVisual_HArray1OfPresentationStyleSelect) aStyles;
- StepVisual_PresentationStyleSelect aStylesItem;
- Standard_Integer nsub1;
- if (data->ReadSubList (num,1,"styles",ach,nsub1)) {
- Standard_Integer nb1 = data->NbParams(nsub1);
- aStyles = new StepVisual_HArray1OfPresentationStyleSelect (1, nb1);
- for (Standard_Integer i1 = 1; i1 <= nb1; i1 ++) {
- //szv#4:S4163:12Mar99 `Standard_Boolean stat1 =` not needed
- if (data->ReadEntity (nsub1,i1,"styles",ach,aStylesItem))
- aStyles->SetValue(i1,aStylesItem);
- }
- }
+ Handle(StepVisual_HArray1OfPresentationStyleSelect) aStyles;
+ StepVisual_PresentationStyleSelect aStylesItem;
+ Standard_Integer nsub1;
+ if (data->ReadSubList (num,1,"styles",ach,nsub1)) {
+ Standard_Integer nb1 = data->NbParams(nsub1);
+ aStyles = new StepVisual_HArray1OfPresentationStyleSelect (1, nb1);
+ for (Standard_Integer i1 = 1; i1 <= nb1; i1 ++) {
+ Interface_ParamType aType = data->ParamType(nsub1, i1);
+ if (aType == Interface_ParamIdent) {
+ data->ReadEntity (nsub1,i1,"styles",ach,aStylesItem);
+ }
+ else {
+ Handle(StepData_SelectMember) aMember;
+ data->ReadMember(nsub1, i1, "null_style", ach, aMember);
+ Standard_CString anEnumText = aMember->EnumText();
+ Handle(StepVisual_NullStyleMember) aNullStyle = new StepVisual_NullStyleMember();
+ aNullStyle->SetEnumText(0, anEnumText);
+ aStylesItem.SetValue(aNullStyle);
+ }
+ aStyles->SetValue(i1,aStylesItem);
+ }
+ }
// --- own field : styleContext ---
// --- inherited field styles ---
SW.OpenSub();
- for (Standard_Integer i1 = 1; i1 <= ent->NbStyles(); i1 ++) {
- SW.Send(ent->StylesValue(i1).Value());
- }
+for (Standard_Integer i1 = 1; i1 <= ent->NbStyles(); i1 ++) {
+ StepVisual_PresentationStyleSelect aStyle = ent->StylesValue(i1);
+ if (aStyle.Value()->IsKind(STANDARD_TYPE(StepVisual_NullStyleMember))) {
+ SW.OpenTypedSub("NULL_STYLE");
+ SW.SendEnum(".NULL.");
+ SW.CloseSub();
+ }
+ else
+ SW.Send(aStyle.Value());
+ }
SW.CloseSub();
// --- own field : styleContext ---
}
SW.CloseSub();
}
+
+//=======================================================================
+//function : Share
+//purpose :
+//=======================================================================
+void RWStepVisual_RWTessellatedCurveSet::Share (const Handle(StepVisual_TessellatedCurveSet) &ent,
+ Interface_EntityIterator& iter) const
+{
+ // Own filed : coordinates
+ iter.AddItem (ent->CoordList());
+}
+
const Handle(StepVisual_TessellatedCurveSet)& ent) const;
Standard_EXPORT void WriteStep (StepData_StepWriter& SW, const Handle(StepVisual_TessellatedCurveSet)& ent) const;
+
+ Standard_EXPORT void Share (const Handle(StepVisual_TessellatedCurveSet) &ent, Interface_EntityIterator& iter) const;
};
#endif // _RWStepVisual_RWTessellatedItem_HeaderFile
Handle(TCollection_HAsciiString) aName;
data->ReadString (num, 1, "name", ach, aName);
- NCollection_Handle<StepVisual_Array1OfTessellaltedItem> anItems;
+ NCollection_Handle<StepVisual_Array1OfTessellatedItem> anItems;
Standard_Integer nsub2;
if (data->ReadSubList (num,2,"items",ach,nsub2)) {
Standard_Integer nb2 = data->NbParams(nsub2);
- anItems = new StepVisual_Array1OfTessellaltedItem(1, nb2);
+ anItems = new StepVisual_Array1OfTessellatedItem(1, nb2);
for (Standard_Integer i2 = 1; i2 <= nb2; i2 ++) {
Handle(StepVisual_TessellatedItem) anItem;// = new StepVisual_TesselatedItem;
if (data->ReadEntity (nsub2,i2,"item",ach,STANDARD_TYPE(StepVisual_TessellatedItem), anItem))
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
+#include <BRep_Tool.hxx>
+#include <Geom_BSplineCurve.hxx>
+#include <Geom_Curve.hxx>
+#include <Geom_Line.hxx>
+#include <ShapeConstruct_Curve.hxx>
#include <STEPCAFControl_GDTProperty.hxx>
#include <StepBasic_MeasureValueMember.hxx>
#include <StepGeom_CartesianPoint.hxx>
#include <StepDimTol_StraightnessTolerance.hxx>
#include <StepDimTol_SurfaceProfileTolerance.hxx>
#include <StepRepr_DescriptiveRepresentationItem.hxx>
+#include <StepVisual_CoordinatesList.hxx>
+#include <StepVisual_TessellatedCurveSet.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Shape.hxx>
#include <XCAFDimTolObjects_DatumModifiersSequence.hxx>
#include <XCAFDimTolObjects_DatumModifWithValue.hxx>
aDirCoords->SetValue(i, theAxis.XDirection().Coord(i));
aRefDirection = new StepGeom_Direction();
aRefDirection->Init(new TCollection_HAsciiString(), aDirCoords);
- anA2P3D->Init(new TCollection_HAsciiString("orientation"), aPoint, Standard_True, anAxis, Standard_True, aRefDirection);
+ anA2P3D->Init(new TCollection_HAsciiString(), aPoint, Standard_True, anAxis, Standard_True, aRefDirection);
return anA2P3D;
}
return new TCollection_HAsciiString("unknown");
}
}
+
+//=======================================================================
+//function : GetTessellation
+//purpose :
+//=======================================================================
+Handle(StepVisual_TessellatedGeometricSet) STEPCAFControl_GDTProperty::GetTessellation(const TopoDS_Shape theShape)
+{
+ // Build coordinate list and curves
+ NCollection_Handle<StepVisual_VectorOfHSequenceOfInteger> aCurves = new StepVisual_VectorOfHSequenceOfInteger;
+ NCollection_Vector<gp_XYZ> aCoords;
+ Standard_Integer aPntNb = 1;
+ for (TopExp_Explorer aCurveIt(theShape, TopAbs_EDGE); aCurveIt.More(); aCurveIt.Next()) {
+ Handle(TColStd_HSequenceOfInteger) aCurve = new TColStd_HSequenceOfInteger;
+ // Find out type of edge curve
+ Standard_Real aFirst = 0, aLast = 0;
+ Handle(Geom_Curve) anEdgeCurve = BRep_Tool::Curve(TopoDS::Edge(aCurveIt.Current()), aFirst, aLast);
+ if (anEdgeCurve.IsNull())
+ continue;
+ // Line
+ if (anEdgeCurve->IsKind(STANDARD_TYPE(Geom_Line))) {
+ for (TopExp_Explorer aVertIt(aCurveIt.Current(), TopAbs_VERTEX); aVertIt.More(); aVertIt.Next()) {
+ aCoords.Append(BRep_Tool::Pnt(TopoDS::Vertex(aVertIt.Current())).XYZ());
+ aCurve->Append(aPntNb);
+ aPntNb++;
+ }
+ }
+ // BSpline
+ else {
+ ShapeConstruct_Curve aSCC;
+ Handle(Geom_BSplineCurve) aBSCurve = aSCC.ConvertToBSpline(anEdgeCurve,
+ aFirst, aLast, Precision::Confusion());
+ for (Standard_Integer i = 1; i <= aBSCurve->NbPoles(); i++) {
+ aCoords.Append(aBSCurve->Pole(i).XYZ());
+ aCurve->Append(aPntNb);
+ aPntNb++;
+ }
+ }
+ aCurves->Append(aCurve);
+ }
+
+ Handle(TColgp_HArray1OfXYZ) aPoints = new TColgp_HArray1OfXYZ(1, aCoords.Length());
+ for (Standard_Integer i = 1; i <= aPoints->Length(); i++) {
+ aPoints->SetValue(i, aCoords.Value(i - 1));
+ }
+ // STEP entities
+ Handle(StepVisual_CoordinatesList) aCoordList = new StepVisual_CoordinatesList();
+ aCoordList->Init(new TCollection_HAsciiString(), aPoints);
+ Handle(StepVisual_TessellatedCurveSet) aCurveSet = new StepVisual_TessellatedCurveSet();
+ aCurveSet->Init(new TCollection_HAsciiString(), aCoordList, aCurves);
+ NCollection_Handle<StepVisual_Array1OfTessellatedItem> aTessItems = new StepVisual_Array1OfTessellatedItem(1, 1);
+ aTessItems->SetValue(1, aCurveSet);
+ Handle(StepVisual_TessellatedGeometricSet) aGeomSet = new StepVisual_TessellatedGeometricSet();
+ aGeomSet->Init(new TCollection_HAsciiString(), aTessItems);
+ return aGeomSet;
+}
#include <StepDimTol_HArray1OfDatumReferenceModifier.hxx>
#include <StepGeom_Axis2Placement3d.hxx>
#include <StepRepr_CompoundRepresentationItem.hxx>
+#include <StepVisual_TessellatedGeometricSet.hxx>
#include <XCAFDimTolObjects_DimensionModifiersSequence.hxx>
#include <StepShape_LimitsAndFits.hxx>
#include <XCAFDimTolObjects_DatumModifiersSequence.hxx>
const Standard_Real theValue,
const StepBasic_Unit theUnit);
+ Standard_EXPORT static Handle(StepVisual_TessellatedGeometricSet) GetTessellation(const TopoDS_Shape theShape);
+
};
#endif // _STEPCAFControl_GDTProperty_HeaderFile
Handle(StepVisual_TessellatedGeometricSet) aTessSet = Handle(StepVisual_TessellatedGeometricSet)::DownCast(aTessItem);
if( aTessSet.IsNull())
continue;
- NCollection_Handle<StepVisual_Array1OfTessellaltedItem> aListItems = aTessSet->Items();
+ NCollection_Handle<StepVisual_Array1OfTessellatedItem> 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++)
#include <Interface_Static.hxx>
#include <Message_Messenger.hxx>
#include <MoniTool_DataMapIteratorOfDataMapOfShapeTransient.hxx>
+#include <NCollection_Vector.hxx>
#include <OSD_Path.hxx>
#include <Quantity_TypeOfColor.hxx>
#include <StepAP214_Protocol.hxx>
+#include <StepAP242_DraughtingModelItemAssociation.hxx>
#include <StepAP242_GeometricItemSpecificUsage.hxx>
#include <StepBasic_DerivedUnit.hxx>
#include <StepBasic_DerivedUnitElement.hxx>
#include <StepGeom_Direction.hxx>
#include <StepGeom_GeometricRepresentationContextAndGlobalUnitAssignedContext.hxx>
#include <StepGeom_GeomRepContextAndGlobUnitAssCtxAndGlobUncertaintyAssCtx.hxx>
+#include <StepGeom_Plane.hxx>
#include <StepGeom_Surface.hxx>
#include <StepRepr_CompGroupShAspAndCompShAspAndDatumFeatAndShAsp.hxx>
#include <StepRepr_CompositeShapeAspect.hxx>
#include <StepShape_ToleranceValue.hxx>
#include <StepShape_TypeQualifier.hxx>
#include <StepShape_ValueFormatTypeQualifier.hxx>
+#include <StepVisual_AnnotationPlane.hxx>
#include <StepVisual_CurveStyle.hxx>
+#include <StepVisual_DraughtingCallout.hxx>
+#include <StepVisual_DraughtingModel.hxx>
#include <StepVisual_HArray1OfInvisibleItem.hxx>
#include <StepVisual_HArray1OfLayeredItem.hxx>
#include <StepVisual_HArray1OfPresentationStyleAssignment.hxx>
#include <StepVisual_Invisibility.hxx>
#include <StepVisual_InvisibleItem.hxx>
#include <StepVisual_MechanicalDesignGeometricPresentationRepresentation.hxx>
+#include <StepVisual_NullStyleMember.hxx>
#include <StepVisual_PointStyle.hxx>
#include <StepVisual_PresentationLayerAssignment.hxx>
#include <StepVisual_PresentationRepresentation.hxx>
#include <StepVisual_PresentationStyleByContext.hxx>
#include <StepVisual_StyledItem.hxx>
#include <StepVisual_SurfaceStyleUsage.hxx>
+#include <StepVisual_TessellatedAnnotationOccurrence.hxx>
+#include <StepVisual_TessellatedGeometricSet.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_HAsciiString.hxx>
#include <TColStd_HArray1OfReal.hxx>
DimensionalValueNumber_Lower,
DimensionalValueNumber_Upper
};
+static NCollection_Vector<Handle(StepVisual_AnnotationPlane)> gdtAnnotationPlanes;
+static Handle(StepVisual_DraughtingModel) gdtPresentationDM;
+static Handle(StepVisual_HArray1OfPresentationStyleAssignment) gdtPrsCurveStyle;
// added by skl 15.01.2004 for D> writing
//#include <StepRepr_CompoundItemDefinition.hxx>
return aSA;
}
+//=======================================================================
+//function : WritePresentation
+//purpose : auxiliary (write annotation plane and presentation)
+//======================================================================
+static void WritePresentation(const Handle(XSControl_WorkSession) &WS,
+ const TopoDS_Shape thePresentation,
+ const gp_Ax2 theAnnotationPlane,
+ const Handle(Standard_Transient) theDimension)
+{
+ if (thePresentation.IsNull())
+ return;
+ // Get working data
+ 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(new TCollection_HAsciiString(), aTAOs);
+ Handle(StepRepr_HArray1OfRepresentationItem) aDCsForDMIA = new StepRepr_HArray1OfRepresentationItem(1, 1);
+ aDCsForDMIA->SetValue(1, aDCallout);
+ StepAP242_ItemIdentifiedRepresentationUsageDefinition aDimension;
+ aDimension.SetValue(theDimension);
+ Handle(StepAP242_DraughtingModelItemAssociation) aDMIA =
+ new StepAP242_DraughtingModelItemAssociation();
+ aDMIA->Init(new TCollection_HAsciiString("PMI representation to presentation link"),
+ new TCollection_HAsciiString(), aDimension, gdtPresentationDM, aDCsForDMIA);
+ aModel->AddWithRefs(aDMIA);
+
+ // 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
gp_Ax2 aDTAxis = anObject->GetDatumTargetAxis();
Handle(StepGeom_Axis2Placement3d) anA2P3D =
STEPCAFControl_GDTProperty::GetAxis2Placement3D(aDTAxis);
+ anA2P3D->SetName(new TCollection_HAsciiString("orientation"));
Handle(StepRepr_HArray1OfRepresentationItem) anItems;
// Process each datum target type
if (aDatumType == XCAFDimTolObjects_DatumTargetType_Point) {
aSDR->Init(aRDefinition, aShapeRepr);
Model->AddWithRefs(aSDR);
+ //Annotation plane and Presentation
+ WritePresentation(WS, anObject->GetPresentation(), anObject->GetPlane(), aSA);
+
return aDatum;
}
if (anObject->HasAxis()) {
Handle(StepGeom_Axis2Placement3d) anAxis =
STEPCAFControl_GDTProperty::GetAxis2Placement3D(anObject->GetAxis());
+ anAxis->SetName(new TCollection_HAsciiString("orientation"));
Handle(StepAP242_GeometricItemSpecificUsage) aGISU = new StepAP242_GeometricItemSpecificUsage();
StepAP242_ItemIdentifiedRepresentationUsageDefinition aDefinition;
aDefinition.SetValue(aDS);
}
Model->AddWithRefs(aGeomTol);
WriteToleranceZone(WS, anObject, aGeomTol, theRC);
+ //Annotation plane and Presentation
+ WritePresentation(WS, anObject->GetPresentation(), anObject->GetPlane(), aGeomTol);
}
//=======================================================================
if(DGTTool.IsNull())
return Standard_False;
+ // Common entities for presentation
+ gdtPresentationDM = new StepVisual_DraughtingModel();
+ STEPConstruct_Styles aStyles (WS);
+ Handle(StepVisual_Colour) aCurvColor = aStyles.EncodeColor(Quantity_NOC_WHITE);
+ Handle(StepRepr_RepresentationItem) anItem = NULL;
+ gdtPrsCurveStyle = new StepVisual_HArray1OfPresentationStyleAssignment(1, 1);
+ gdtPrsCurveStyle->SetValue(1, aStyles.MakeColorPSA(anItem, aCurvColor, aCurvColor));
+
TDF_LabelSequence aDGTLabels;
STEPConstruct_DataMapOfAsciiStringTransient aDatumMap;
Handle(StepRepr_RepresentationContext) aRC;
// Write values
WriteDimValues(WS, anObject, aRC, aDimension);
+ //Annotation plane and Presentation
+ WritePresentation(WS, anObject->GetPresentation(), anObject->GetPlane(), aDimension.Value());
}
//----------------------------//
WriteGeomTolerance(WS, aFirstShapeL, aGeomTolL, aDatumSystem, aRC);
}
+ // Write Draughting model for Annotation Planes
+ if (gdtAnnotationPlanes.Length() == 0)
+ return Standard_True;
+
+ Handle(StepRepr_HArray1OfRepresentationItem) aItems =
+ new StepRepr_HArray1OfRepresentationItem(1, gdtAnnotationPlanes.Length());
+ for (Standard_Integer i = 1; i <= aItems->Length(); i++) {
+ aItems->SetValue(i, gdtAnnotationPlanes.Value(i - 1));
+ }
+ gdtPresentationDM->Init(new TCollection_HAsciiString(), aItems, aRC);
+ aModel->AddWithRefs(gdtPresentationDM);
+
return Standard_True;
}
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#ifndef _StepVisual_MarkerMember_HeaderFile
-#define _StepVisual_MarkerMember_HeaderFile
+#ifndef _StepDimTol_SimpleDatumReferenceModifierMember_HeaderFile
+#define _StepDimTol_SimpleDatumReferenceModifierMember_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
StepVisual_MechanicalDesignGeometricPresentationArea.hxx
StepVisual_MechanicalDesignGeometricPresentationRepresentation.cxx
StepVisual_MechanicalDesignGeometricPresentationRepresentation.hxx
+StepVisual_NullStyle.hxx
+StepVisual_NullStyleMember.cxx
+StepVisual_NullStyleMember.hxx
StepVisual_OverRidingStyledItem.cxx
StepVisual_OverRidingStyledItem.hxx
StepVisual_PlanarBox.cxx
--- /dev/null
+// Created on: 2016-03-09
+// Created by: Irina KRYLOVA
+// Copyright (c) 2016 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#ifndef _StepVisual_NullStyle_HeaderFile
+#define _StepVisual_NullStyle_HeaderFile
+
+#include <Standard_PrimitiveTypes.hxx>
+
+enum StepVisual_NullStyle {
+ StepVisual_Null
+};
+
+#endif
--- /dev/null
+// Created on: 2015-07-16
+// Created by: Irina KRYLOVA
+// Copyright (c) 2015 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include <StepVisual_NullStyleMember.hxx>
+#include <StepData_EnumTool.hxx>
+#include <TCollection_AsciiString.hxx>
+
+IMPLEMENT_STANDARD_RTTIEXT(StepVisual_NullStyleMember,StepData_SelectInt)
+
+static StepData_EnumTool tool
+ (".NULL.");
+
+//=======================================================================
+//function : StepVisual_NullStyleMember
+//purpose :
+//=======================================================================
+
+StepVisual_NullStyleMember::StepVisual_NullStyleMember () { }
+
+//=======================================================================
+//function : EnumText
+//purpose :
+//=======================================================================
+
+Standard_CString StepVisual_NullStyleMember::EnumText () const
+{
+ return tool.Text(Int()).ToCString();
+}
+
+//=======================================================================
+//function : SetEnumText
+//purpose :
+//=======================================================================
+
+void StepVisual_NullStyleMember::SetEnumText (const Standard_Integer /*theValue*/,
+ const Standard_CString theText)
+{
+ Standard_Integer aVal = tool.Value (theText);
+ if (aVal >= 0) SetInt (aVal);
+}
+
+//=======================================================================
+//function : SetValue
+//purpose :
+//=======================================================================
+
+void StepVisual_NullStyleMember::SetValue (const StepVisual_NullStyle theValue)
+{
+ SetInt ( Standard_Integer (theValue) );
+}
+
+//=======================================================================
+//function : Value
+//purpose :
+//=======================================================================
+
+StepVisual_NullStyle StepVisual_NullStyleMember::Value () const
+{
+ return StepVisual_NullStyle (Int());
+}
--- /dev/null
+// Created on: 2016-03-09
+// Created by: Irina KRYLOVA
+// Copyright (c) 2016 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#ifndef _StepVisual_NullStyleMember_HeaderFile
+#define _StepVisual_NullStyleMember_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_Type.hxx>
+
+#include <StepData_SelectInt.hxx>
+#include <Standard_Boolean.hxx>
+#include <Standard_CString.hxx>
+#include <Standard_Integer.hxx>
+#include <StepVisual_NullStyle.hxx>
+
+class StepVisual_NullStyleMember;
+DEFINE_STANDARD_HANDLE(StepVisual_NullStyleMember, StepData_SelectInt)
+//! Defines NullStyle as unique member of PresentationStyleSelect
+//! Works with an EnumTool
+class StepVisual_NullStyleMember : public StepData_SelectInt
+{
+
+public:
+
+ Standard_EXPORT StepVisual_NullStyleMember();
+
+ virtual Standard_Boolean HasName() const Standard_OVERRIDE
+ { return Standard_True; }
+
+ virtual Standard_CString Name() const Standard_OVERRIDE
+ { return "NULL_STYLE"; }
+
+ virtual Standard_Boolean SetName(const Standard_CString /*theName*/) Standard_OVERRIDE
+ { return Standard_True; }
+
+ Standard_Integer Kind() const Standard_OVERRIDE
+ {return 4;}
+
+ Standard_EXPORT virtual Standard_CString EnumText() const Standard_OVERRIDE;
+
+ Standard_EXPORT virtual void SetEnumText (const Standard_Integer theValue, const Standard_CString theText) Standard_OVERRIDE;
+
+ Standard_EXPORT void SetValue (const StepVisual_NullStyle theValue) ;
+
+ Standard_EXPORT StepVisual_NullStyle Value() const;
+
+ DEFINE_STANDARD_RTTIEXT(StepVisual_NullStyleMember,StepData_SelectInt)
+};
+#endif // _StepVisual_NullStyleMember_HeaderFile
#include <Standard_Transient.hxx>
#include <StepVisual_CurveStyle.hxx>
#include <StepVisual_FillAreaStyle.hxx>
+#include <StepVisual_NullStyleMember.hxx>
#include <StepVisual_PointStyle.hxx>
#include <StepVisual_PresentationStyleSelect.hxx>
#include <StepVisual_SurfaceStyleUsage.hxx>
// if (ent->IsKind(STANDARD_TYPE(StepVisual_SymbolStyle))) return 4;
// if (ent->IsKind(STANDARD_TYPE(StepVisual_FillAreaStyle))) return 5;
// if (ent->IsKind(STANDARD_TYPE(StepVisual_TextStyle))) return 6;
+ if (ent->IsKind(STANDARD_TYPE(StepVisual_NullStyleMember))) return 7;
return 0;
}
return GetCasted(StepVisual_CurveStyle,Value());
}
+Handle(StepVisual_NullStyleMember) StepVisual_PresentationStyleSelect::NullStyle () const
+{
+ return GetCasted(StepVisual_NullStyleMember,Value());
+}
+
Handle(StepVisual_SurfaceStyleUsage) StepVisual_PresentationStyleSelect::SurfaceStyleUsage () const
{
return GetCasted(StepVisual_SurfaceStyleUsage,Value());
class Standard_Transient;
class StepVisual_PointStyle;
class StepVisual_CurveStyle;
+class StepVisual_NullStyleMember;
class StepVisual_SurfaceStyleUsage;
//! 4 -> SymbolStyle
//! 5 -> FillAreaStyle
//! 6 -> TextStyle
+ //! 7 -> NullStyle
//! 0 else
Standard_EXPORT Standard_Integer CaseNum (const Handle(Standard_Transient)& ent) const;
//! returns Value as a CurveStyle (Null if another type)
Standard_EXPORT Handle(StepVisual_CurveStyle) CurveStyle() const;
+
+ //! returns Value as a NullStyleMember (Null if another type)
+ Standard_EXPORT Handle(StepVisual_NullStyleMember) NullStyle() const;
//! returns Value as a SurfaceStyleUsage (Null if another type)
Standard_EXPORT Handle(StepVisual_SurfaceStyleUsage) SurfaceStyleUsage() const;
StepVisual_TessellatedGeometricSet::StepVisual_TessellatedGeometricSet () {}
-void StepVisual_TessellatedGeometricSet::Init(const Handle(TCollection_HAsciiString)& theName, const NCollection_Handle<StepVisual_Array1OfTessellaltedItem>& theItems)
+void StepVisual_TessellatedGeometricSet::Init(const Handle(TCollection_HAsciiString)& theName, const NCollection_Handle<StepVisual_Array1OfTessellatedItem>& theItems)
{
StepRepr_RepresentationItem::Init(theName);
myItems = theItems;
}
-NCollection_Handle<StepVisual_Array1OfTessellaltedItem> StepVisual_TessellatedGeometricSet::Items() const
+NCollection_Handle<StepVisual_Array1OfTessellatedItem> StepVisual_TessellatedGeometricSet::Items() const
{
return myItems;
}
class Standard_Transient;
-typedef NCollection_Array1<Handle(StepVisual_TessellatedItem)> StepVisual_Array1OfTessellaltedItem;
-//typedef NCollection_Handle<StepVisual_Array1OfTessellaltedItem> Handle(StepVisual_Array1OfTessellaltedItem);
+typedef NCollection_Array1<Handle(StepVisual_TessellatedItem)> StepVisual_Array1OfTessellatedItem;
-//DEFINE_HARRAY1(StepVisual_HArray1OfTessellaltedItem, StepVisual_Array1OfTessellaltedItem)
DEFINE_STANDARD_HANDLE(StepVisual_TessellatedGeometricSet, StepVisual_TessellatedItem)
class StepVisual_TessellatedGeometricSet : public StepVisual_TessellatedItem
{
//! Returns a DraughtingCalloutElement select type
Standard_EXPORT StepVisual_TessellatedGeometricSet();
- Standard_EXPORT void Init(const Handle(TCollection_HAsciiString)& theName, const NCollection_Handle<StepVisual_Array1OfTessellaltedItem>& theItems);
+ Standard_EXPORT void Init(const Handle(TCollection_HAsciiString)& theName, const NCollection_Handle<StepVisual_Array1OfTessellatedItem>& theItems);
- Standard_EXPORT NCollection_Handle<StepVisual_Array1OfTessellaltedItem> Items() const;
+ Standard_EXPORT NCollection_Handle<StepVisual_Array1OfTessellatedItem> Items() const;
private:
- NCollection_Handle<StepVisual_Array1OfTessellaltedItem> myItems;
+ NCollection_Handle<StepVisual_Array1OfTessellatedItem> myItems;
public:
incr ref_Compare
append err_compare_ref " Reference data - $refstr\n"
append err_compare_ref " Current data - $curstr\n"
- append err_compare_ref " Current data after writing - $curstr\n"
+ append err_compare_ref " Current data after writing - $cur2str\n"
append err_compare_ref "--------------------------------------------------------------------\n"
}
}
002 tolerances
003 import
004 export
+005 presentation
--- /dev/null
+# !!!! This file is generated automatically, do not edit manually! See end script
+set filename bug26689_nist_ctc_01_asme1_ap242.stp
+
+set ref_data {
+Centre of mass: 33.295841310232461 -56.047419205695817 -22.610629589474502
+Mass: 12142.750755797097
+
+}
--- /dev/null
+# !!!! This file is generated automatically, do not edit manually! See end script
+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
+
+}
--- /dev/null
+# !!!! This file is generated automatically, do not edit manually! See end script
+set filename bug26689_nist_ctc_04_asme1_ap242.stp
+
+set ref_data {
+Centre of mass: 35.242126579745523 445.83237754232533 -68.402802262745169
+Mass: 9074.4079919607357
+
+}
--- /dev/null
+# !!!! This file is generated automatically, do not edit manually! See end script
+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
+
+}
--- /dev/null
+pload QAcommands
--- /dev/null
+# Set flag dump_file to 1 in order to regenerate script files with actual data
+# used as reference. In this mode all tests intentionaly report failure.
+set dump_file 0
+########################################################################
+set mist 0;
+# First
+set x_First 0; set y_First 0; set z_First 0;
+set mass_First 0;
+# Second
+set x_Second 0; set y_Second 0; set z_Second 0;
+set mass_Second 0;
+###################################################################
+set ref_Compare 0
+set todo_msg ""
+set todo_mask "puts \"TODO CR27235 ALL: "
+set end_line "\" \n"
+##################################################################
+
+# Read original file
+if { [string length $filename] > 1} {
+ set path_file [locate_data_file $filename]
+ if { [catch { ReadStep D_First $path_file } catch_result] } {
+ set err_msg "Error: First - file was not read - exception "
+ puts $err_msg
+ append todo_msg $todo_mask $err_msg $end_line
+ set mist 1
+ }
+} else {
+ set mist 1
+}
+
+# Get information presentations
+if { $mist < 1} {
+ puts ""
+ set xst [ OCC27235 D_First]
+
+ if { [llength $xst] > 0 } {
+ regexp {Centre of mass+: +([-0-9.+eE]+) +([-0-9.+eE]+) +([-0-9.+eE]+)} $xst full x_First y_First z_First
+ regexp {Mass+: +([-0-9.+eE]+)} $xst full mass_First
+ } else {
+ puts " GDT information was NOT provided"
+ }
+}
+
+if { $mist != 1 } {
+ puts ""
+ set result ""
+ append result [format $xst]
+}
+
+# Writing file
+if { $mist < 1} {
+ puts " "
+ puts "-----------------------------WRITING FILE ------------------------------"
+ if { [catch { WriteStep D_First $imagedir/${casename}_D_First.stp } catch_result] } {
+ set err_msg "Error: First - file was not written - exception"
+ puts $err_msg
+ append todo_msg $todo_mask $err_msg $end_line
+ set mist 1
+ }
+ if { $mist < 1 } {
+ if { [catch { ReadStep D_Second $imagedir/${casename}_D_First.stp } catch_result] } {
+ set err_msg "Error: Second - file was not read - exception"
+ puts $err_msg
+ append todo_msg $todo_mask $err_msg $end_line
+ set mist 1
+ }
+ }
+}
+
+catch {[file delete $imagedir/${casename}_D_First.stp]}
+if { [catch { Close D_First } catch_result] } {
+ set err_msg "Error : cannot close a document D_First - exception"
+ puts $err_msg
+}
+
+# Get information about translation
+if { $mist < 1} {
+ puts ""
+ set xst2 [ OCC27235 D_Second]
+
+ if { [llength $xst] > 0 } {
+ regexp {Centre of mass+: +([-0-9.+eE]+) +([-0-9.+eE]+) +([-0-9.+eE]+)} $xst2 full x_Second y_Second z_Second
+ regexp {Mass+: +([-0-9.+eE]+)} $xst2 full mass_Second
+ } else {
+ puts " GDT information was NOT provided"
+ }
+ if { [catch { Close D_Second } catch_result] } {
+ set err_msg "Error : cannot close a document D_Second - exception"
+ puts $err_msg
+ }
+}
+
+if { $mist != 1 } {
+ puts ""
+ set result2 ""
+ append result2 [format $xst2]
+}
+
+set err_compare_ref ""
+# Put reference data to the test script file if option "dump" is set
+if { $dump_file == 1 } {
+ set fd_stream [open $dirname/$groupname/$gridname/$casename w]
+ puts $fd_stream "# !!!! This file is generated automatically, do not edit manually! See end script"
+ puts $fd_stream "set filename $filename"
+ if { $mist != 1 } {
+ puts $fd_stream ""
+ puts $fd_stream "set ref_data \{"
+ puts $fd_stream $result
+ puts $fd_stream "\}"
+ }
+ close $fd_stream
+} elseif { $mist != 1 } {
+ puts "========================== Comparision with reference data ========"
+ puts ""
+ # Comparision of reference data with obtained result
+ set x_Ref 0; set y_Ref 0; set z_Ref 0;
+ set mass_Ref 0;
+ regexp {Centre of mass+: +([-0-9.+eE]+) +([-0-9.+eE]+) +([-0-9.+eE]+)} $ref_data full x_Ref y_Ref z_Ref
+ regexp {Mass+: +([-0-9.+eE]+)} $ref_data full mass_Ref
+
+ if {[expr abs($x_Ref - $x_First)] > 1e-4 || [expr abs($x_Ref - $x_Second)] > 1e-4} {
+ incr ref_Compare
+ append err_compare_ref " Reference data - $x_Ref\n"
+ append err_compare_ref " Current data - $x_Second ($x_First)\n"
+ append err_compare_ref "--------------------------------------------------------------------\n"
+ }
+
+ if {[expr abs($y_Ref - $y_First)] > 1e-4 || [expr abs($y_Ref - $y_Second)] > 1e-4} {
+ incr ref_Compare
+ append err_compare_ref " Reference data - $y_Ref\n"
+ append err_compare_ref " Current data - $y_Second ($y_First)\n"
+ append err_compare_ref "--------------------------------------------------------------------\n"
+ }
+ if {[expr abs($z_Ref - $z_First)] > 1e-4 || [expr abs($z_Ref - $z_Second)] > 1e-4} {
+ incr ref_Compare
+ append err_compare_ref " Reference data - $z_Ref\n"
+ append err_compare_ref " Current data - $z_Second ($z_First)\n"
+ append err_compare_ref "--------------------------------------------------------------------\n"
+ }
+ if {[expr abs($mass_Ref - $mass_First)] > 1e-4 || [expr abs($mass_Ref - $mass_Second)] > 1e-4} {
+ incr ref_Compare
+ append err_compare_ref " Reference data - $mass_Ref\n"
+ append err_compare_ref " Current data - $mass_Second ($mass_First)\n"
+ append err_compare_ref "--------------------------------------------------------------------\n"
+ }
+ }
+
+if { $dump_file != 0 } {
+ puts "Error : Running in regeneration mode, comparision was not performed!"
+ if { $mist != 1 } {
+ puts "Generation of test file $groupname/$gridname/$casename successful"
+ } else {
+ puts "Generation of reference data failed"
+ }
+} else {
+ if { $ref_Compare > 0} {
+ puts "Error : $ref_Compare differences with reference data found :\n$err_compare_ref"
+ } else {
+ puts "Comparision of current result with reference data - OK\n"
+ }
+}
+
+puts "--------------------------------------------------------------------"
+puts ""
+
+puts "TEST COMPLETED"