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

0026344: Visualization - provide a support of zoom persistent selection

1) New Graphic3d_TransformPers structure for defining parameters and algorithm methods, featuring:
    a) application of transformation to projection and world view matrices;
    b) computation of model-world transformation of persistent object;
    c) computation of transformed bounding box of persistent object.

2) Transform persistence algorithm does not make any changes to model-world transformation of object (deals with projection and world view matrices only), thus making possible to employ local transformation in a usual way.

3) Support of BVH selection for transform persistent objects (pan, rotate, zoom, trihedron persistence only).

4) Support efficient frustum culling for transform persistent objects (pan, rotate, zoom, trihedron persistence only).

5) Support of z-fitting algorithm for world-view space transform persistent objects (rotate, zoom persistence only).

6) Rewrite usage of transform persistence structures and utilities classes:
    a) Replaced Graphic3d_CTransPers, TEL_TRANSFORM_PERSISTENCE by Graphic3d_TransformPers;
    b) Move functions from OpenGl_Utils.hxx to Graphic3d_TransformUtils.hxx;
    c) Extract matrix stack class from OpenGl_Utils.hxx to OpenGl_MatrixStack.hxx;

7) New class Graphic3d_WorldViewProjState to keep track of projection, world view matrices changes for a camera.

8) New test case bugs/vis/bug26344.

9) Renamed method Graphic3d_Camera::ModelViewState of  to ::WorldViewState for consistency.
This commit is contained in:
apl
2015-07-20 11:41:38 +03:00
committed by bugmaster
parent 317d68c924
commit 825aa485a3
59 changed files with 2324 additions and 1156 deletions

View File

@@ -43,10 +43,7 @@ PrsMgr_PresentableObject::PrsMgr_PresentableObject (const PrsMgr_TypeOfPresentat
myHasOwnPresentations (Standard_True),
myParent (NULL)
{
myTransformPersistence.Flag = 0;
myTransformPersistence.Point.x = 0.0;
myTransformPersistence.Point.y = 0.0;
myTransformPersistence.Point.z = 0.0;
//
}
//=======================================================================
@@ -311,10 +308,10 @@ void PrsMgr_PresentableObject::UpdateTransformation(const Handle(Prs3d_Presentat
void PrsMgr_PresentableObject::SetTransformPersistence (const Graphic3d_TransModeFlags& theFlag,
const gp_Pnt& thePoint)
{
myTransformPersistence.Flag = theFlag;
myTransformPersistence.Point.x = (Standard_ShortReal )thePoint.X();
myTransformPersistence.Point.y = (Standard_ShortReal )thePoint.Y();
myTransformPersistence.Point.z = (Standard_ShortReal )thePoint.Z();
myTransformPersistence.Flags = theFlag;
myTransformPersistence.Point.x() = thePoint.X();
myTransformPersistence.Point.y() = thePoint.Y();
myTransformPersistence.Point.z() = thePoint.Z();
for (Standard_Integer aPrsIter = 1; aPrsIter <= myPresentations.Length(); ++aPrsIter)
{
const Handle(PrsMgr_Presentation)& aPrs3d = myPresentations (aPrsIter).Presentation();
@@ -341,18 +338,20 @@ void PrsMgr_PresentableObject::SetTransformPersistence(
//function : GetTransformPersistence
//purpose :
//=======================================================================
Graphic3d_TransModeFlags PrsMgr_PresentableObject::GetTransformPersistenceMode() const
Graphic3d_TransModeFlags PrsMgr_PresentableObject::GetTransformPersistenceMode() const
{
return myTransformPersistence.Flag;
return myTransformPersistence.Flags;
}
//=======================================================================
//function : GetTransformPersistence
//purpose :
//=======================================================================
gp_Pnt PrsMgr_PresentableObject::GetTransformPersistencePoint() const
gp_Pnt PrsMgr_PresentableObject::GetTransformPersistencePoint() const
{
return gp_Pnt( myTransformPersistence.Point.x, myTransformPersistence.Point.y, myTransformPersistence.Point.z );
return gp_Pnt (myTransformPersistence.Point.x(),
myTransformPersistence.Point.y(),
myTransformPersistence.Point.z());
}
//=======================================================================

View File

@@ -23,7 +23,6 @@
#include <PrsMgr_Presentations.hxx>
#include <PrsMgr_TypeOfPresentation3d.hxx>
#include <Graphic3d_SequenceOfHClipPlane.hxx>
#include <Graphic3d_CTransPersStruct.hxx>
#include <Standard_Boolean.hxx>
#include <Graphic3d_ZLayerId.hxx>
#include <PrsMgr_PresentableObjectPointer.hxx>
@@ -33,6 +32,7 @@
#include <PrsMgr_Presentation.hxx>
#include <PrsMgr_PresentationManager3d.hxx>
#include <Standard_Integer.hxx>
#include <Graphic3d_TransformPers.hxx>
#include <Graphic3d_TransModeFlags.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <Graphic3d_ClipPlane.hxx>
@@ -107,7 +107,10 @@ public:
//! Gets point of transform persistence for this object
Standard_EXPORT gp_Pnt GetTransformPersistencePoint() const;
//! @return transform persistence of the presentable object.
const Graphic3d_TransformPers& TransformPersistence() const;
Standard_EXPORT void SetTypeOfPresentation (const PrsMgr_TypeOfPresentation3d aType);
//! flags the Prs of mode <AMode> to be Updated.
@@ -281,7 +284,7 @@ Standard_EXPORT virtual ~PrsMgr_PresentableObject();
private:
Graphic3d_CTransPersStruct myTransformPersistence;
Graphic3d_TransformPers myTransformPersistence;
PrsMgr_PresentableObjectPointer myParent;
gp_Trsf myLocalTransformation;
gp_Trsf myTransformation;

View File

@@ -17,6 +17,10 @@
inline PrsMgr_TypeOfPresentation3d PrsMgr_PresentableObject::TypeOfPresentation3d() const
{return myTypeOfPresentation3d;}
inline const Graphic3d_TransformPers& PrsMgr_PresentableObject::TransformPersistence() const
{
return myTransformPersistence;
}
inline const gp_Trsf& PrsMgr_PresentableObject::LocalTransformation() const
{