1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-03 14:10:33 +03:00

0024412: TKV3d, Dimensions - Possibility to customize text position was lost:

AIS_Dimension::GetTextPosition() and AIS_Dimension::SetTextPosition() methods were added.
Added possibility to set and unset text label alignment respectively to the attach points after text position changed.
Added test cases to check text positioning with dimension parameters and with setting 3D point.
Corrected DRAW commands vmovedim, vangledim, vdistdim, vradiusdim.
Corrections of AIS_Dimension::SetTextPosition(): aspect parameters are not changed inside it.
Layout mode was removed; test cases and vdimparams, vdimension  commands were corrected.
remarks: coding style, removing redundant code of LayoutMode enumeration.
This commit is contained in:
aba
2014-02-13 12:43:56 +04:00
committed by apn
parent 3b010a7435
commit af203d549a
16 changed files with 1842 additions and 839 deletions

View File

@@ -296,7 +296,7 @@ void AIS_DiameterDimension::Compute (const Handle(PrsMgr_PresentationManager3d)&
gp_Pnt aFirstPnt (gp::Origin());
gp_Pnt aSecondPnt (gp::Origin());
ComputeSidePoints (myCircle, GetPlane(), aFirstPnt, aSecondPnt);
ComputeSidePoints (myCircle, aFirstPnt, aSecondPnt);
DrawLinearDimension (thePresentation, theMode, aFirstPnt, aSecondPnt);
}
@@ -315,7 +315,7 @@ void AIS_DiameterDimension::ComputeFlyoutSelection (const Handle(SelectMgr_Selec
gp_Pnt aFirstPnt (gp::Origin());
gp_Pnt aSecondPnt (gp::Origin());
ComputeSidePoints (myCircle, GetPlane(), aFirstPnt, aSecondPnt);
ComputeSidePoints (myCircle, aFirstPnt, aSecondPnt);
ComputeLinearFlyouts (theSelection, theEntityOwner, aFirstPnt, aSecondPnt);
}
@@ -324,15 +324,14 @@ void AIS_DiameterDimension::ComputeFlyoutSelection (const Handle(SelectMgr_Selec
//function : ComputeSidePoints
//purpose :
//=======================================================================
void AIS_DiameterDimension::ComputeSidePoints (const gp_Circ& /*theCircle*/,
const gp_Pln& /*thePlane*/,
void AIS_DiameterDimension::ComputeSidePoints (const gp_Circ& theCircle,
gp_Pnt& theFirstPnt,
gp_Pnt& theSecondPnt)
{
theFirstPnt = AnchorPoint();
gp_Vec aRadiusVector (myCircle.Location(), theFirstPnt);
theSecondPnt = myCircle.Location().Translated (-aRadiusVector);
gp_Vec aRadiusVector (theCircle.Location(), theFirstPnt);
theSecondPnt = theCircle.Location().Translated (-aRadiusVector);
}
//=======================================================================
@@ -358,3 +357,35 @@ Standard_Boolean AIS_DiameterDimension::IsValidAnchor (const gp_Circ& theCircle,
return Abs (anAnchorDist - aRadius) > Precision::Confusion()
&& aCirclePlane.Contains (theAnchor, Precision::Confusion());
}
//=======================================================================
//function : GetTextPosition
//purpose :
//=======================================================================
const gp_Pnt AIS_DiameterDimension::GetTextPosition() const
{
if (IsTextPositionCustom())
{
return myFixedTextPosition;
}
// Counts text position according to the dimension parameters
return GetTextPositionForLinear (myAnchorPoint, myCircle.Location());
}
//=======================================================================
//function : GetTextPosition
//purpose :
//=======================================================================
void AIS_DiameterDimension::SetTextPosition (const gp_Pnt& theTextPos)
{
if (!myIsValid)
{
return;
}
myIsTextPositionFixed = Standard_True;
myFixedTextPosition = theTextPos;
SetToUpdate();
}