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

@@ -32,13 +32,18 @@ SelectMgr_SelectableObjectSet::SelectMgr_SelectableObjectSet()
// function : Append
// purpose : Adds new object to the set and marks BVH tree for rebuild
//=======================================================================
void SelectMgr_SelectableObjectSet::Append (const Handle(SelectMgr_SelectableObject)& theObject)
Standard_Boolean SelectMgr_SelectableObjectSet::Append (const Handle(SelectMgr_SelectableObject)& theObject)
{
Standard_Integer aSize = Size();
if (aSize < myObjects.Add (theObject))
{
MarkDirty();
return Standard_True;
}
return Standard_False;
}
//=======================================================================
@@ -46,7 +51,7 @@ void SelectMgr_SelectableObjectSet::Append (const Handle(SelectMgr_SelectableObj
// purpose : Removes object theObject from set and marks BVH tree for
// rebuild
//=======================================================================
void SelectMgr_SelectableObjectSet::Remove (const Handle(SelectMgr_SelectableObject)& theObject)
Standard_Boolean SelectMgr_SelectableObjectSet::Remove (const Handle(SelectMgr_SelectableObject)& theObject)
{
const Standard_Integer anIndex = myObjects.FindIndex (theObject);
@@ -60,7 +65,11 @@ void SelectMgr_SelectableObjectSet::Remove (const Handle(SelectMgr_SelectableObj
myObjects.RemoveLast();
MarkDirty();
return Standard_True;
}
return Standard_False;
}
//=======================================================================
@@ -119,21 +128,3 @@ Standard_Integer SelectMgr_SelectableObjectSet::Size() const
{
return myObjects.Size();
}
//=======================================================================
// function : GetObjectById
// purpose : Returns object from set by theIndex given
//=======================================================================
const Handle(SelectMgr_SelectableObject)& SelectMgr_SelectableObjectSet::GetObjectById (const Standard_Integer theIndex) const
{
return myObjects.FindKey (theIndex + 1);
}
//=======================================================================
// function : Contains
// purpose : Returns true if this objects set contains theObject given
//=======================================================================
Standard_Boolean SelectMgr_SelectableObjectSet::Contains (const Handle(SelectMgr_SelectableObject)& theObject) const
{
return myObjects.Contains (theObject);
}