diff --git a/src/STEPCAFControl/STEPCAFControl_GDTProperty.cxx b/src/STEPCAFControl/STEPCAFControl_GDTProperty.cxx index 7e340491cf..4617f73919 100644 --- a/src/STEPCAFControl/STEPCAFControl_GDTProperty.cxx +++ b/src/STEPCAFControl/STEPCAFControl_GDTProperty.cxx @@ -961,33 +961,6 @@ Handle(TCollection_HAsciiString) STEPCAFControl_GDTProperty::GetDatumTargetName( return aName; } -//======================================================================= -//function : GetAxis2Placement3D -//purpose : -//======================================================================= -Handle(StepGeom_Axis2Placement3d) STEPCAFControl_GDTProperty::GetAxis2Placement3D(const gp_Ax2& theAxis) -{ - Handle(StepGeom_Axis2Placement3d) anA2P3D = new StepGeom_Axis2Placement3d(); - Handle(StepGeom_CartesianPoint) aPoint = new StepGeom_CartesianPoint(); - Handle(TColStd_HArray1OfReal) aCoords = new TColStd_HArray1OfReal(1, 3); - for (Standard_Integer i = 1; i <= 3; i++) - aCoords->SetValue(i, theAxis.Location().Coord(i)); - aPoint->Init(new TCollection_HAsciiString(), aCoords); - Handle(StepGeom_Direction) anAxis, aRefDirection; - Handle(TColStd_HArray1OfReal) anAxisCoords = new TColStd_HArray1OfReal(1, 3); - for (Standard_Integer i = 1; i <= 3; i++) - anAxisCoords->SetValue(i, theAxis.XDirection().Coord(i)); - anAxis = new StepGeom_Direction(); - anAxis->Init(new TCollection_HAsciiString(), anAxisCoords); - Handle(TColStd_HArray1OfReal) aDirCoords = new TColStd_HArray1OfReal(1, 3); - for (Standard_Integer i = 1; i <= 3; i++) - aDirCoords->SetValue(i, theAxis.YDirection().Coord(i)); - aRefDirection = new StepGeom_Direction(); - aRefDirection->Init(new TCollection_HAsciiString(), aDirCoords); - anA2P3D->Init(new TCollection_HAsciiString(), aPoint, Standard_True, anAxis, Standard_True, aRefDirection); - return anA2P3D; -} - //======================================================================= //function : IsDimensionalSize //purpose : diff --git a/src/STEPCAFControl/STEPCAFControl_GDTProperty.hxx b/src/STEPCAFControl/STEPCAFControl_GDTProperty.hxx index 09f433c988..985e311eec 100644 --- a/src/STEPCAFControl/STEPCAFControl_GDTProperty.hxx +++ b/src/STEPCAFControl/STEPCAFControl_GDTProperty.hxx @@ -88,8 +88,6 @@ public: Standard_EXPORT static Handle(TCollection_HAsciiString) GetDatumTargetName(const XCAFDimTolObjects_DatumTargetType theDatumType); - Standard_EXPORT static Handle(StepGeom_Axis2Placement3d) GetAxis2Placement3D(const gp_Ax2& theAxis); - Standard_EXPORT static Standard_Boolean IsDimensionalLocation(const XCAFDimTolObjects_DimensionType theType); Standard_EXPORT static Standard_Boolean IsDimensionalSize(const XCAFDimTolObjects_DimensionType theType); diff --git a/src/STEPCAFControl/STEPCAFControl_Writer.cxx b/src/STEPCAFControl/STEPCAFControl_Writer.cxx index 7fe5326c76..21133dcdfa 100644 --- a/src/STEPCAFControl/STEPCAFControl_Writer.cxx +++ b/src/STEPCAFControl/STEPCAFControl_Writer.cxx @@ -21,6 +21,7 @@ // Names and validation props are supported for top-level shapes only #include +#include #include #include #include @@ -2414,7 +2415,8 @@ void STEPCAFControl_Writer::WritePresentation(const Handle(XSControl_WorkSession aPrsStyles->SetValue(1, aPrsStyle); // Plane Handle(StepGeom_Plane) aPlane = new StepGeom_Plane(); - Handle(StepGeom_Axis2Placement3d) anAxis = STEPCAFControl_GDTProperty::GetAxis2Placement3D(theAnnotationPlane); + GeomToStep_MakeAxis2Placement3d anAxisMaker(theAnnotationPlane); + Handle(StepGeom_Axis2Placement3d) anAxis = anAxisMaker.Value(); // Set text position to plane origin Handle(StepGeom_CartesianPoint) aTextPos = new StepGeom_CartesianPoint(); Handle(TColStd_HArray1OfReal) aCoords = new TColStd_HArray1OfReal(1, 3); @@ -2587,8 +2589,8 @@ Handle(StepDimTol_Datum) STEPCAFControl_Writer::WriteDatumAP242(const Handle(XSC // Common for all datum targets StepBasic_Unit aUnit = GetUnit(aRC); gp_Ax2 aDTAxis = anObject->GetDatumTargetAxis(); - Handle(StepGeom_Axis2Placement3d) anA2P3D = - STEPCAFControl_GDTProperty::GetAxis2Placement3D(aDTAxis); + GeomToStep_MakeAxis2Placement3d anAxisMaker(aDTAxis); + Handle(StepGeom_Axis2Placement3d) anA2P3D = anAxisMaker.Value(); anA2P3D->SetName(new TCollection_HAsciiString("orientation")); Handle(StepRepr_HArray1OfRepresentationItem) anItems; // Process each datum target type @@ -3084,8 +3086,8 @@ static Handle(StepDimTol_HArray1OfDatumSystemOrReference) WriteDatumSystem(const // Axis if (anObject->HasAxis()) { - Handle(StepGeom_Axis2Placement3d) anAxis = - STEPCAFControl_GDTProperty::GetAxis2Placement3D(anObject->GetAxis()); + GeomToStep_MakeAxis2Placement3d anAxisMaker(anObject->GetAxis()); + Handle(StepGeom_Axis2Placement3d) anAxis = anAxisMaker.Value(); anAxis->SetName(new TCollection_HAsciiString("orientation")); Handle(StepAP242_GeometricItemSpecificUsage) aGISU = new StepAP242_GeometricItemSpecificUsage(); StepAP242_ItemIdentifiedRepresentationUsageDefinition aDefinition; diff --git a/tests/gdt/dimensions/A8 b/tests/gdt/dimensions/A8 index 33b5f78198..fffe3f7b51 100644 --- a/tests/gdt/dimensions/A8 +++ b/tests/gdt/dimensions/A8 @@ -32,7 +32,7 @@ if {$isOK} { set c_value "10" set c_type "Size_CurveLength" set c_pos {position: -5 0 7 -normal: 0 1 0 -x_direction: 0 0 -1 +normal: -1 0 0 +x_direction: 0 1 0 } }