1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0024389: Invalid hilight of AIS dimension line in local selection

- Fixed invalid presentation of dimension highlight.
- Fixed bug on switching between selection modes. Individual sensitive entities generated for each selection mode.
- Revised selection: AIS_DimensionSelectionMode enumeration added, redundant AIS_DimensionDisplayMode is removed.
- Revised entity owner usage: used standard SelectMgr_EntityOwner for neutral selection, AIS_DimensionOwner for "line", "text" selection modes.
- Made arrows selectable.
- Got rid of predefined arrow angle. The arrow angle is now taken from dimension aspect.
- The 3D text is now centered by bounding box for better alignment.
This commit is contained in:
apl
2013-12-07 14:07:41 +04:00
committed by abv
parent 73cd8a8afd
commit fe83e1ea69
18 changed files with 1164 additions and 596 deletions

View File

@@ -183,29 +183,29 @@ Standard_Boolean AIS_LengthDimension::initTwoEdgesLength (const TopoDS_Edge & th
// Offset to avoid confusion Edge and Dimension
gp_Vec anOffset(theDirAttach);
anOffset = anOffset*myDrawer->DimensionAspect()->ArrowAspect()->Length()*(-10.);
aCurPos.Translate(anOffset);
myGeom.myTextPosition = aCurPos;
anOffset = anOffset * myDrawer->DimensionAspect()->ArrowAspect()->Length()*(-10.);
aCurPos.Translate (anOffset);
// Find attachment points
if (!isFirstInfinite)
{
if (myGeom.myTextPosition.Distance(aPoint11) > myGeom.myTextPosition.Distance(aPoint12))
if (aCurPos.Distance (aPoint11) > aCurPos.Distance (aPoint12))
myFirstPoint = aPoint12;
else
myFirstPoint = aPoint11;
}
else
myFirstPoint = ElCLib::Value(ElCLib::Parameter(aLin1,myGeom.myTextPosition), aLin1);
myFirstPoint = ElCLib::Value (ElCLib::Parameter (aLin1, aCurPos), aLin1);
if (!isSecondInfinite)
{
if (myGeom.myTextPosition.Distance(aPoint21) > myGeom.myTextPosition.Distance(aPoint22))
if (aCurPos.Distance (aPoint21) > aCurPos.Distance (aPoint22))
mySecondPoint = aPoint22;
else
mySecondPoint = aPoint21;
}
else
mySecondPoint = ElCLib::Value(ElCLib::Parameter(aLin2, myGeom.myTextPosition), aLin2);
mySecondPoint = ElCLib::Value (ElCLib::Parameter (aLin2, aCurPos), aLin2);
return Standard_True;
}
@@ -240,13 +240,13 @@ Standard_Boolean AIS_LengthDimension::initEdgeVertexLength (const TopoDS_Edge &
if (!isInfinite)
{
if (myGeom.myTextPosition.Distance(anEdgePoint1) > myGeom.myTextPosition.Distance(anEdgePoint2))
if (aCurPos.Distance (anEdgePoint1) > aCurPos.Distance (anEdgePoint2))
mySecondPoint = anEdgePoint2;
else
mySecondPoint = anEdgePoint1;
}
else
mySecondPoint = ElCLib::Value(ElCLib::Parameter(aLin,myGeom.myTextPosition),aLin);
mySecondPoint = ElCLib::Value (ElCLib::Parameter (aLin, aCurPos), aLin);
return Standard_True;
}
@@ -326,8 +326,8 @@ Standard_Boolean AIS_LengthDimension::initEdgeFaceLength (const TopoDS_Edge& the
else theDirAttach = gp::DZ ();
gp_Vec aVector (theDirAttach);
aVector.Multiply (1.5 * myValue);
myGeom.myTextPosition = mySecondPoint.Translated (aVector);
aVector.Multiply (1.5 * myValue);
return Standard_True;
}
@@ -395,9 +395,10 @@ Standard_Boolean AIS_LengthDimension::initTwoShapesPoints (const TopoDS_Shape& t
}
else // curvilinear faces
{
AIS::ComputeLengthBetweenCurvilinearFaces (aFirstFace, aSecondFace, aFirstSurface,
aSecondSurface,Standard_True, myValue,
myGeom.myTextPosition,myFirstPoint,mySecondPoint,aDirAttach);
AIS::ComputeLengthBetweenCurvilinearFaces (aFirstFace, aSecondFace, aFirstSurface,
aSecondSurface, Standard_True, myValue,
mySelectionGeom.TextPos, myFirstPoint,
mySecondPoint, aDirAttach);
isSuccess = Standard_True;
}
}
@@ -493,6 +494,9 @@ void AIS_LengthDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /
const Handle(Prs3d_Presentation)& thePresentation,
const Standard_Integer theMode)
{
thePresentation->Clear();
mySelectionGeom.Clear (theMode);
// Initialization of points, if they are not set
if (!myIsInitialized)
{
@@ -516,9 +520,7 @@ void AIS_LengthDimension::Compute (const Handle(PrsMgr_PresentationManager3d)& /
return;
}
thePresentation->Clear();
drawLinearDimension (thePresentation, (AIS_DimensionDisplayMode)theMode);
drawLinearDimension (thePresentation, theMode);
}
//=======================================================================