mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +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:
@@ -708,3 +708,35 @@ Standard_Boolean AIS_LengthDimension::InitOneShapePoints (const TopoDS_Shape& th
|
||||
|
||||
return IsValidPoints (myFirstPoint, mySecondPoint);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetTextPosition
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const gp_Pnt AIS_LengthDimension::GetTextPosition() const
|
||||
{
|
||||
if (IsTextPositionCustom())
|
||||
{
|
||||
return myFixedTextPosition;
|
||||
}
|
||||
|
||||
// Counts text position according to the dimension parameters
|
||||
return GetTextPositionForLinear (myFirstPoint, mySecondPoint);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetTextPosition
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_LengthDimension::SetTextPosition (const gp_Pnt& theTextPos)
|
||||
{
|
||||
if (!myIsValid)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
myIsTextPositionFixed = Standard_True;
|
||||
myFixedTextPosition = theTextPos;
|
||||
|
||||
SetToUpdate();
|
||||
}
|
||||
|
Reference in New Issue
Block a user