Commit 4724a470 authored by Sankhesh Jhaveri's avatar Sankhesh Jhaveri 💬
Browse files

ENH: Enable selection of translucent geometry

vtkHardwareSelector was skipping all translucent geometry and selecting only
opaque geometry. This change enables selection of translucent as well as opaque
geometry. Totally transparent (opacity = 0.0) is skipped.
This change fixes ParaView issue 14412

Change-Id: Ic8ead1534b4f24695e5138fc8207250f25450508
parent f0b9aebe
......@@ -127,7 +127,6 @@ int vtkActor::GetIsOpaque()
return is_opaque? 1 : 0;
}
//----------------------------------------------------------------------------
// This causes the actor to be rendered. It in turn will render the actor's
// property, texture map and then mapper. If a property hasn't been
......@@ -150,8 +149,10 @@ int vtkActor::RenderOpaqueGeometry(vtkViewport *vp)
this->GetProperty();
}
// is this actor opaque ?
if (this->GetIsOpaque())
// is this actor opaque
// Do this check only when not in selection mode
if (this->GetIsOpaque() ||
(ren->GetSelector() && this->Property->GetOpacity() > 0.0))
{
this->Property->Render(this, ren);
......
......@@ -201,7 +201,9 @@ int vtkLODActor::RenderOpaqueGeometry(vtkViewport *vp)
}
// is this actor opaque ?
if (this->GetIsOpaque())
// Do this check only when not in selection mode
if (this->GetIsOpaque() ||
(ren->GetSelector() && this->Property->GetOpacity() > 0.0))
{
this->Property->Render(this, ren);
......
......@@ -89,7 +89,9 @@ int vtkQuadricLODActor::RenderOpaqueGeometry(vtkViewport *vp)
}
// is this actor opaque ?
if (this->GetIsOpaque())
// Do this check only when not in selection mode
if (this->GetIsOpaque() ||
(ren->GetSelector() && this->Property->GetOpacity() > 0.0))
{
this->GetProperty()->Render(this, ren);
......
......@@ -42,6 +42,7 @@
#include "vtkExtractSelectedFrustum.h"
#include "vtkDataSetMapper.h"
#include "vtkSmartPointer.h"
#include "vtkProperty.h"
#include "vtkDataSetReader.h"
......@@ -174,6 +175,8 @@ int TestAreaSelections(int argc, char* argv[])
MY_CREATE_NEW(vtkActor, act2);
act2->SetMapper(map2);
act2->PickableOn(); //lets the HardwareSelector select in it
act2->GetProperty()->SetColor(0.2,0.1,0.5);
act2->GetProperty()->SetOpacity(0.6);
renderer->AddActor(act2);
sMap = vtkSmartPointer<vtkDataSetMapper>::New();
......
5b8df0c9a12363520ebc6dc0968d3330
1fbd324f95c99f7faad0c57810d1eb8d
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment