mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0027860: Visualization - clean up Transformation Persistence API
Graphic3d_Camera::TransformMatrices redundant NCollection_Handle usage has been replaced with validity flags. Graphic3d_TransModeFlags now defined as enumeration, not integer bit flags. Graphic3d_TMF_PanPers and Graphic3d_TMF_FullPers have been removed. Graphic3d_TMF_ZoomRotatePers has been introduced. Graphic3d_TransformPers is now inherits Standard_Transient. Graphic3d_TransformPers now defines dedicated constructors for 3D persistence (zoom / rotate) and 2D persistence (2d / trihedron). 2D persistence now supports dedicated values for X and Y offsets. The corner is now specified by enumeration Aspect_TypeOfTriedronPosition instead of indirect interpretation of anchor point values. Fixed handling of Graphic3d_TMF_ZoomRotatePers (combination of Graphic3d_TMF_RotatePers + Graphic3d_TMF_ZoomPers). PrsMgr_PresentableObject, Graphic3d_CStructure now hold Handle(Graphic3d_TransformPers) instead of a value. Method ::SetTransformPersistence(), ::TransformPersistence() now works with Handle(Graphic3d_TransformPers). Old methods have been marked deprecated.
This commit is contained in:
@@ -651,10 +651,11 @@ void AIS_Manipulator::updateTransformation()
|
||||
|
||||
if (myIsZoomPersistentMode)
|
||||
{
|
||||
if (!(GetTransformPersistenceMode () == Graphic3d_TMF_ZoomPers
|
||||
&& GetTransformPersistencePoint().IsEqual (myPosition.Location(), 0.)))
|
||||
if (TransformPersistence().IsNull()
|
||||
|| TransformPersistence()->Mode() != Graphic3d_TMF_ZoomPers
|
||||
|| !TransformPersistence()->AnchorPoint().IsEqual (myPosition.Location(), 0.0))
|
||||
{
|
||||
setTransformPersistence (Graphic3d_TMF_ZoomPers, myPosition.Location());
|
||||
setTransformPersistence (new Graphic3d_TransformPers (Graphic3d_TMF_ZoomPers, myPosition.Location()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -734,7 +735,7 @@ void AIS_Manipulator::SetZoomPersistence (const Standard_Boolean theToEnable)
|
||||
|
||||
if (!theToEnable)
|
||||
{
|
||||
setTransformPersistence (Graphic3d_TMF_None, gp::Origin());
|
||||
setTransformPersistence (Handle(Graphic3d_TransformPers)());
|
||||
}
|
||||
|
||||
updateTransformation();
|
||||
@@ -742,28 +743,28 @@ void AIS_Manipulator::SetZoomPersistence (const Standard_Boolean theToEnable)
|
||||
|
||||
//=======================================================================
|
||||
//function : SetTransformPersistence
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_Manipulator::SetTransformPersistence (const Graphic3d_TransModeFlags& theFlag, const gp_Pnt& thePoint)
|
||||
void AIS_Manipulator::SetTransformPersistence (const Handle(Graphic3d_TransformPers)& theTrsfPers)
|
||||
{
|
||||
Standard_ASSERT_RETURN (!myIsZoomPersistentMode,
|
||||
"AIS_Manipulator::SetTransformPersistence: "
|
||||
"Custom settings are not supported by this class in ZoomPersistence mode",);
|
||||
"Custom settings are not allowed by this class in ZoomPersistence mode",);
|
||||
|
||||
setTransformPersistence (theFlag, thePoint);
|
||||
setTransformPersistence (theTrsfPers);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : setTransformPersistence
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_Manipulator::setTransformPersistence (const Graphic3d_TransModeFlags& theFlag, const gp_Pnt& thePoint)
|
||||
void AIS_Manipulator::setTransformPersistence (const Handle(Graphic3d_TransformPers)& theTrsfPers)
|
||||
{
|
||||
AIS_InteractiveObject::SetTransformPersistence (theFlag, thePoint);
|
||||
AIS_InteractiveObject::SetTransformPersistence (theTrsfPers);
|
||||
|
||||
for (Standard_Integer anIt = 0; anIt < 3; ++anIt)
|
||||
{
|
||||
myAxes[anIt].SetTransformPersistence (theFlag, thePoint);
|
||||
myAxes[anIt].SetTransformPersistence (theTrsfPers);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -814,8 +815,7 @@ void AIS_Manipulator::Compute (const Handle(PrsMgr_PresentationManager3d)& thePr
|
||||
anAspectAx->SetColor (myAxes[anIt].Color());
|
||||
aGroup->SetGroupPrimitivesAspect (anAspectAx->Aspect());
|
||||
myAxes[anIt].Compute (thePrsMgr, thePrs, anAspectAx);
|
||||
myAxes[anIt].SetTransformPersistence (GetTransformPersistenceMode(),
|
||||
GetTransformPersistencePoint());
|
||||
myAxes[anIt].SetTransformPersistence (TransformPersistence());
|
||||
}
|
||||
|
||||
updateTransformation();
|
||||
|
Reference in New Issue
Block a user