mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0024623: Visualization - improve selection mechanism
Redesign of selection mechanism: - implemented 3-level BVH tree for selection; - selection now calculates in 3D space; - intersection tests were moved to SelectMgr_BaseFrustum descendants; - removed .cdl files in Select3D and .cdl related to selection in MeshVS; - SelectMgr_ViewerSelectors are now shared between local and global contexts; - transformations of sensitive entities are now stored in SelectMgr_SelectableObject only. Sensitive entities are independent from transformations, it is applied to SelectMgr_SelectingVolumeManager instance only; - connected and multiple connected interactive objects are now represented by their child objects only for SelectMgr_SelectionManager; - if interactive object has child objects, they will be stored as separate objects in SelectMgr_SelectionManager now. - test cases bugs/vis/bug24623_1, bug24623_2, bug24623_3, bug24623_4 to test performance and memory issues.
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#include <vtkAutoInit.h>
|
||||
#include <vtkCamera.h>
|
||||
#include <vtkRenderer.h>
|
||||
#include <vtkRenderWindow.h>
|
||||
#include <vtkTransform.h>
|
||||
|
||||
// Initialization of VTK object factories.
|
||||
@@ -159,3 +160,56 @@ bool IVtkVTK_View::DisplayToWorld (const gp_XY& theDisplayPnt, gp_XYZ& theWorldP
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//================================================================
|
||||
// Function : GetWindowSize
|
||||
// Purpose :
|
||||
//================================================================
|
||||
void IVtkVTK_View::GetWindowSize (int& theX, int& theY) const
|
||||
{
|
||||
int* aSize = myRenderer->GetRenderWindow()->GetSize();
|
||||
theX = aSize[0];
|
||||
theY = aSize[1];
|
||||
}
|
||||
|
||||
//================================================================
|
||||
// Function : GetCamera
|
||||
// Purpose :
|
||||
//================================================================
|
||||
void IVtkVTK_View::GetCamera (Graphic3d_Mat4d& theProj,
|
||||
Graphic3d_Mat4d& theOrient,
|
||||
Standard_Boolean& theIsOrtho) const
|
||||
{
|
||||
theIsOrtho = !IsPerspective();
|
||||
|
||||
vtkMatrix4x4* aCompositeProj =
|
||||
myRenderer->GetActiveCamera()->GetCompositeProjectionTransformMatrix (myRenderer->GetTiledAspectRatio(),
|
||||
0,
|
||||
1);
|
||||
for (Standard_Integer aRow = 0; aRow < 4; ++aRow)
|
||||
{
|
||||
for (Standard_Integer aCol = 0; aCol < 4; ++aCol)
|
||||
{
|
||||
theProj.SetValue (aRow, aCol, aCompositeProj->GetElement (aRow, aCol));
|
||||
}
|
||||
}
|
||||
|
||||
theOrient.InitIdentity();
|
||||
}
|
||||
|
||||
//================================================================
|
||||
// Function : GetViewport
|
||||
// Purpose :
|
||||
//================================================================
|
||||
void IVtkVTK_View::GetViewport (Standard_Real& theX,
|
||||
Standard_Real& theY,
|
||||
Standard_Real& theWidth,
|
||||
Standard_Real& theHeight) const
|
||||
{
|
||||
Standard_Real aViewport[4];
|
||||
myRenderer->GetViewport (aViewport);
|
||||
theX = aViewport[0];
|
||||
theY = aViewport[1];
|
||||
theWidth = aViewport[2];
|
||||
theHeight = aViewport[3];
|
||||
}
|
||||
|
Reference in New Issue
Block a user