1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +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

@@ -35,37 +35,45 @@ public:
//! Creates new empty objects set and initializes BVH tree
//! builder to Binned builder with 1 element per list
SelectMgr_SelectableObjectSet();
Standard_EXPORT SelectMgr_SelectableObjectSet();
//! Releases resources of selectable object set.
virtual ~SelectMgr_SelectableObjectSet() { }
//! Adds new object to the set and marks BVH tree for rebuild
void Append (const Handle(SelectMgr_SelectableObject)& theObject);
//! Adds new object to the set and marks BVH tree for rebuild.
//! @return true if structure added, otherwise returns false (structure already in the set).
Standard_EXPORT Standard_Boolean Append (const Handle(SelectMgr_SelectableObject)& theObject);
//! Removes object theObject from set and marks BVH tree for rebuild
void Remove (const Handle(SelectMgr_SelectableObject)& theObject);
//! Removes object theObject from set and marks BVH tree for rebuild.
//! @return true if structure removed, otherwise returns false (structure is not in the set).
Standard_EXPORT Standard_Boolean Remove (const Handle(SelectMgr_SelectableObject)& theObject);
//! Returns bounding box of object with index theIndex
virtual Select3D_BndBox3d Box (const Standard_Integer theIndex) const Standard_OVERRIDE;
Standard_EXPORT virtual Select3D_BndBox3d Box (const Standard_Integer theIndex) const Standard_OVERRIDE;
//! Returns center of object with index theIndex in the set
//! along the given axis theAxis
virtual Standard_Real Center (const Standard_Integer theIndex,
const Standard_Integer theAxis) const Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Real Center (const Standard_Integer theIndex,
const Standard_Integer theAxis) const Standard_OVERRIDE;
//! Swaps items with indexes theIndex1 and theIndex2 in the set
virtual void Swap (const Standard_Integer theIndex1,
const Standard_Integer theIndex2) Standard_OVERRIDE;
Standard_EXPORT virtual void Swap (const Standard_Integer theIndex1,
const Standard_Integer theIndex2) Standard_OVERRIDE;
//! Returns size of objects set
virtual Standard_Integer Size() const Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Integer Size() const Standard_OVERRIDE;
//! Returns object from set by theIndex given
const Handle(SelectMgr_SelectableObject)& GetObjectById (const Standard_Integer theIndex) const;
const Handle(SelectMgr_SelectableObject)& GetObjectById (const Standard_Integer theIndex) const
{
return myObjects.FindKey (theIndex + 1);
}
//! Returns true if this objects set contains theObject given
Standard_Boolean Contains (const Handle(SelectMgr_SelectableObject)& theObject) const;
Standard_Boolean Contains (const Handle(SelectMgr_SelectableObject)& theObject) const
{
return myObjects.Contains (theObject);
}
private: