1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-07 18:30:55 +03:00

0028790: Data Exchange - Wrong orientation of Annotation Plane in GD&T (Writing)

Fix building of Axis2Placement3d.
This commit is contained in:
ika 2017-05-26 12:33:03 +03:00 committed by bugmaster
parent 4560c05480
commit 1603a49799
4 changed files with 9 additions and 36 deletions

View File

@ -961,33 +961,6 @@ Handle(TCollection_HAsciiString) STEPCAFControl_GDTProperty::GetDatumTargetName(
return aName; 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 //function : IsDimensionalSize
//purpose : //purpose :

View File

@ -88,8 +88,6 @@ public:
Standard_EXPORT static Handle(TCollection_HAsciiString) GetDatumTargetName(const XCAFDimTolObjects_DatumTargetType theDatumType); 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 IsDimensionalLocation(const XCAFDimTolObjects_DimensionType theType);
Standard_EXPORT static Standard_Boolean IsDimensionalSize(const XCAFDimTolObjects_DimensionType theType); Standard_EXPORT static Standard_Boolean IsDimensionalSize(const XCAFDimTolObjects_DimensionType theType);

View File

@ -21,6 +21,7 @@
// Names and validation props are supported for top-level shapes only // Names and validation props are supported for top-level shapes only
#include <BRep_Builder.hxx> #include <BRep_Builder.hxx>
#include <GeomToStep_MakeAxis2Placement3d.hxx>
#include <GeomToStep_MakeCartesianPoint.hxx> #include <GeomToStep_MakeCartesianPoint.hxx>
#include <HeaderSection_FileSchema.hxx> #include <HeaderSection_FileSchema.hxx>
#include <Interface_EntityIterator.hxx> #include <Interface_EntityIterator.hxx>
@ -2414,7 +2415,8 @@ void STEPCAFControl_Writer::WritePresentation(const Handle(XSControl_WorkSession
aPrsStyles->SetValue(1, aPrsStyle); aPrsStyles->SetValue(1, aPrsStyle);
// Plane // Plane
Handle(StepGeom_Plane) aPlane = new StepGeom_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 // Set text position to plane origin
Handle(StepGeom_CartesianPoint) aTextPos = new StepGeom_CartesianPoint(); Handle(StepGeom_CartesianPoint) aTextPos = new StepGeom_CartesianPoint();
Handle(TColStd_HArray1OfReal) aCoords = new TColStd_HArray1OfReal(1, 3); 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 // Common for all datum targets
StepBasic_Unit aUnit = GetUnit(aRC); StepBasic_Unit aUnit = GetUnit(aRC);
gp_Ax2 aDTAxis = anObject->GetDatumTargetAxis(); gp_Ax2 aDTAxis = anObject->GetDatumTargetAxis();
Handle(StepGeom_Axis2Placement3d) anA2P3D = GeomToStep_MakeAxis2Placement3d anAxisMaker(aDTAxis);
STEPCAFControl_GDTProperty::GetAxis2Placement3D(aDTAxis); Handle(StepGeom_Axis2Placement3d) anA2P3D = anAxisMaker.Value();
anA2P3D->SetName(new TCollection_HAsciiString("orientation")); anA2P3D->SetName(new TCollection_HAsciiString("orientation"));
Handle(StepRepr_HArray1OfRepresentationItem) anItems; Handle(StepRepr_HArray1OfRepresentationItem) anItems;
// Process each datum target type // Process each datum target type
@ -3084,8 +3086,8 @@ static Handle(StepDimTol_HArray1OfDatumSystemOrReference) WriteDatumSystem(const
// Axis // Axis
if (anObject->HasAxis()) { if (anObject->HasAxis()) {
Handle(StepGeom_Axis2Placement3d) anAxis = GeomToStep_MakeAxis2Placement3d anAxisMaker(anObject->GetAxis());
STEPCAFControl_GDTProperty::GetAxis2Placement3D(anObject->GetAxis()); Handle(StepGeom_Axis2Placement3d) anAxis = anAxisMaker.Value();
anAxis->SetName(new TCollection_HAsciiString("orientation")); anAxis->SetName(new TCollection_HAsciiString("orientation"));
Handle(StepAP242_GeometricItemSpecificUsage) aGISU = new StepAP242_GeometricItemSpecificUsage(); Handle(StepAP242_GeometricItemSpecificUsage) aGISU = new StepAP242_GeometricItemSpecificUsage();
StepAP242_ItemIdentifiedRepresentationUsageDefinition aDefinition; StepAP242_ItemIdentifiedRepresentationUsageDefinition aDefinition;

View File

@ -32,7 +32,7 @@ if {$isOK} {
set c_value "10" set c_value "10"
set c_type "Size_CurveLength" set c_type "Size_CurveLength"
set c_pos {position: -5 0 7 set c_pos {position: -5 0 7
normal: 0 1 0 normal: -1 0 0
x_direction: 0 0 -1 x_direction: 0 1 0
} }
} }