mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +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:
@@ -1103,46 +1103,14 @@ Standard_Integer Graphic3d_Structure::Identification() const
|
||||
//function : SetTransformPersistence
|
||||
//purpose :
|
||||
//=============================================================================
|
||||
void Graphic3d_Structure::SetTransformPersistence (const Graphic3d_TransModeFlags& theFlag)
|
||||
void Graphic3d_Structure::SetTransformPersistence (const Handle(Graphic3d_TransformPers)& theTrsfPers)
|
||||
{
|
||||
SetTransformPersistence (theFlag, gp_Pnt (0.0, 0.0, 0.0));
|
||||
}
|
||||
if (IsDeleted())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
//function : SetTransformPersistence
|
||||
//purpose :
|
||||
//=============================================================================
|
||||
void Graphic3d_Structure::SetTransformPersistence (const Graphic3d_TransModeFlags& theFlag,
|
||||
const gp_Pnt& thePoint)
|
||||
{
|
||||
if (IsDeleted()) return;
|
||||
|
||||
myCStructure->TransformPersistence.Flags = theFlag;
|
||||
myCStructure->TransformPersistence.Point.x() = thePoint.X();
|
||||
myCStructure->TransformPersistence.Point.y() = thePoint.Y();
|
||||
myCStructure->TransformPersistence.Point.z() = thePoint.Z();
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
//function : TransformPersistenceMode
|
||||
//purpose :
|
||||
//=============================================================================
|
||||
Graphic3d_TransModeFlags Graphic3d_Structure::TransformPersistenceMode() const
|
||||
{
|
||||
return myCStructure->TransformPersistence.Flags;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
//function : TransformPersistencePoint
|
||||
//purpose :
|
||||
//=============================================================================
|
||||
gp_Pnt Graphic3d_Structure::TransformPersistencePoint() const
|
||||
{
|
||||
gp_Pnt aPnt (0.0, 0.0, 0.0);
|
||||
aPnt.SetX (myCStructure->TransformPersistence.Point.x());
|
||||
aPnt.SetY (myCStructure->TransformPersistence.Point.y());
|
||||
aPnt.SetZ (myCStructure->TransformPersistence.Point.z());
|
||||
return aPnt;
|
||||
myCStructure->SetTransformPersistence (theTrsfPers);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
|
Reference in New Issue
Block a user