0027372: Import/Export dimension text position

Modify Import/Export STEP.
Add Draw commands to set and get orientation and position of dimension text.
Add Draw commands to set and get presentation.
Add test.
This commit is contained in:
ika
2016-04-07 14:57:51 +03:00
committed by bugmaster
parent 8f8398f6e4
commit f0bf70e8cc
7 changed files with 303 additions and 15 deletions

View File

@@ -1805,27 +1805,21 @@ void readAnnotation(const Handle(XSControl_TransferReader)& theTR,
if (theDimObject->IsKind(STANDARD_TYPE(XCAFDimTolObjects_DimensionObject))) {
Handle(XCAFDimTolObjects_DimensionObject) anObj =
Handle(XCAFDimTolObjects_DimensionObject)::DownCast(theDimObject);
Handle(TColgp_HArray1OfPnt) aPnts = new TColgp_HArray1OfPnt(1, 1);
anObj->SetPlane(aPlaneAxes);
}
else if (theDimObject->IsKind(STANDARD_TYPE(XCAFDimTolObjects_DatumObject))) {
Handle(XCAFDimTolObjects_DatumObject) anObj =
Handle(XCAFDimTolObjects_DatumObject)::DownCast(theDimObject);
anObj->SetPlane(aPlaneAxes);
}
else if (theDimObject->IsKind(STANDARD_TYPE(XCAFDimTolObjects_GeomToleranceObject))) {
Handle(XCAFDimTolObjects_GeomToleranceObject) anObj =
Handle(XCAFDimTolObjects_GeomToleranceObject)::DownCast(theDimObject);
anObj->SetPlane(aPlaneAxes);
}
}
// Retrieve presentation
Handle(StepVisual_AnnotationCurveOccurrence) anACO;
NCollection_Vector<Handle(StepVisual_TessellatedAnnotationOccurrence)> aTesselations;
@@ -1953,11 +1947,21 @@ void readAnnotation(const Handle(XSControl_TransferReader)& theTR,
if(!nbShapes)
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())
{
Standard_Real aXmin, aYmin, aZmin,aXmax, aYmax, aZmax;
aBox.Get(aXmin, aYmin, aZmin,aXmax, aYmax, aZmax);
aPtext = gp_Pnt((aXmin + aXmax) * 0.5, (aYmin + aYmax) * 0.5, (aZmin + aZmax) * 0.5);
if (isHasPlane && !aBox.IsOut(aPlaneAxes.Location())) {
aPtext = aPlaneAxes.Location();
}
else {
aPtext = gp_Pnt((aXmin + aXmax) * 0.5, (aYmin + aYmax) * 0.5, (aZmin + aZmax) * 0.5);
}
}
else {
aPtext = aPlaneAxes.Location();
}
// set point to XCAF