Commit 75c209cc authored by Dave Demarle's avatar Dave Demarle
Browse files

ENH: Expose the rest of the vtkSelection controls in vtkSelectionSource.

parent 54842ef6
......@@ -29,7 +29,7 @@
#include <vtkstd/map>
#include <vtkstd/vector>
vtkCxxRevisionMacro(vtkSelection, "1.13");
vtkCxxRevisionMacro(vtkSelection, "1.14");
vtkStandardNewMacro(vtkSelection);
vtkCxxSetObjectMacro(vtkSelection, SelectionList, vtkAbstractArray);
......@@ -49,6 +49,8 @@ vtkInformationKeyMacro(vtkSelection,PRESERVE_TOPOLOGY,Integer);
vtkInformationKeyMacro(vtkSelection,CONTAINING_CELLS,Integer);
vtkInformationKeyMacro(vtkSelection,PIXEL_COUNT,Integer);
vtkInformationKeyMacro(vtkSelection,INVERSE,Integer);
vtkInformationKeyMacro(vtkSelection,EXACT_TEST,Integer);
vtkInformationKeyMacro(vtkSelection,SHOW_BOUNDS,Integer);
struct vtkSelectionInternals
{
......@@ -463,4 +465,3 @@ vtkSelection* vtkSelection::GetData(vtkInformationVector* v, int i)
{
return vtkSelection::GetData(v->GetInformationObject(i));
}
......@@ -265,6 +265,14 @@ public:
static vtkSelection* GetData(vtkInformation* info);
static vtkSelection* GetData(vtkInformationVector* v, int i=0);
// Description:
// For Frustum selection.
static vtkInformationIntegerKey* EXACT_TEST();
// Description:
// For Frustum selection.
static vtkInformationIntegerKey* SHOW_BOUNDS();
protected:
vtkSelection();
~vtkSelection();
......
......@@ -35,7 +35,7 @@
#include "vtkLine.h"
#include "vtkSelection.h"
vtkCxxRevisionMacro(vtkExtractSelectedFrustum, "1.7");
vtkCxxRevisionMacro(vtkExtractSelectedFrustum, "1.8");
vtkStandardNewMacro(vtkExtractSelectedFrustum);
vtkCxxSetObjectMacro(vtkExtractSelectedFrustum,Frustum,vtkPlanes);
......@@ -257,15 +257,29 @@ int vtkExtractSelectedFrustum::RequestData(
vtkDoubleArray *corners = vtkDoubleArray::SafeDownCast(
sel->GetSelectionList());
this->CreateFrustum(corners->GetPointer(0));
if (sel->GetProperties()->Has(vtkSelection::PRESERVE_TOPOLOGY()) &&
sel->GetProperties()->Get(vtkSelection::PRESERVE_TOPOLOGY()) != 0)
if (sel->GetProperties()->Has(vtkSelection::PRESERVE_TOPOLOGY()))
{
this->SetPassThrough(
sel->GetProperties()->Get(vtkSelection::PRESERVE_TOPOLOGY())
);
}
if (sel->GetProperties()->Has(vtkSelection::INVERSE()))
{
this->SetInsideOut(
sel->GetProperties()->Get(vtkSelection::INVERSE())
);
}
if (sel->GetProperties()->Has(vtkSelection::EXACT_TEST()))
{
this->PassThroughOn();
this->SetExactTest(
sel->GetProperties()->Get(vtkSelection::EXACT_TEST())
);
}
if (sel->GetProperties()->Has(vtkSelection::INVERSE()) &&
sel->GetProperties()->Get(vtkSelection::INVERSE()) != 0)
if (sel->GetProperties()->Has(vtkSelection::SHOW_BOUNDS()))
{
this->InsideOutOn();
this->SetShowBounds(
sel->GetProperties()->Get(vtkSelection::SHOW_BOUNDS())
);
}
}
}
......
......@@ -27,7 +27,7 @@
#include "vtkstd/vector"
#include "vtkstd/set"
vtkCxxRevisionMacro(vtkSelectionSource, "1.10");
vtkCxxRevisionMacro(vtkSelectionSource, "1.11");
vtkStandardNewMacro(vtkSelectionSource);
class vtkSelectionSourceInternals
......@@ -61,12 +61,22 @@ vtkSelectionSource::vtkSelectionSource()
this->ContentType = vtkSelection::INDICES;
this->FieldType = vtkSelection::CELL;
this->ContainingCells = 1;
this->PreserveTopology = 0;
this->Inverse = 0;
this->ExactTest = 1;
this->ShowBounds = 0;
this->ArrayName = NULL;
}
//----------------------------------------------------------------------------
vtkSelectionSource::~vtkSelectionSource()
{
delete this->Internal;
if (this->ArrayName)
{
delete[] this->ArrayName;
}
}
//----------------------------------------------------------------------------
......@@ -206,6 +216,14 @@ void vtkSelectionSource::PrintSelf(ostream& os, vtkIndent indent)
os << "UNKNOWN";
}
os << endl;
os << indent << "ContainingCells: ";
os << (this->ContainingCells?"CELLS":"POINTS") << endl;
os << indent << "PreserveTopology: " << this->PreserveTopology << endl;
os << indent << "Inverse: " << this->Inverse << endl;
os << indent << "ExactTest: " << this->ExactTest << endl;
os << indent << "ShowBounds: " << this->ShowBounds << endl;
os << indent << "ArrayName: " << (this->ArrayName?this->ArrayName:"NULL") << endl;
}
//----------------------------------------------------------------------------
......@@ -344,6 +362,23 @@ int vtkSelectionSource::RequestData(
selectionList->Delete();
}
output->GetProperties()->Set(vtkSelection::CONTAINING_CELLS(),
this->ContainingCells);
output->GetProperties()->Set(vtkSelection::PRESERVE_TOPOLOGY(),
this->PreserveTopology);
output->GetProperties()->Set(vtkSelection::INVERSE(),
this->Inverse);
output->GetProperties()->Set(vtkSelection::ARRAY_NAME(),
this->ArrayName);
output->GetProperties()->Set(vtkSelection::EXACT_TEST(),
this->ExactTest);
output->GetProperties()->Set(vtkSelection::SHOW_BOUNDS(),
this->ShowBounds);
return 1;
}
......
......@@ -70,6 +70,32 @@ public:
vtkSetMacro(FieldType, int);
vtkGetMacro(FieldType, int);
// Description:
// When extracting by points, extract the cells that contain the
// passing points.
vtkSetMacro(ContainingCells, int);
vtkGetMacro(ContainingCells, int);
// Description:
vtkSetMacro(PreserveTopology, int);
vtkGetMacro(PreserveTopology, int);
// Description:
vtkSetMacro(Inverse, int);
vtkGetMacro(Inverse, int);
// Description:
vtkSetStringMacro(ArrayName);
vtkGetStringMacro(ArrayName);
// Description:
vtkSetMacro(ExactTest, int);
vtkGetMacro(ExactTest, int);
// Description:
vtkSetMacro(ShowBounds, int);
vtkGetMacro(ShowBounds, int);
protected:
vtkSelectionSource();
~vtkSelectionSource();
......@@ -86,6 +112,12 @@ protected:
int ContentType;
int FieldType;
int ContainingCells;
int PreserveTopology;
int Inverse;
int ExactTest;
int ShowBounds;
char *ArrayName;
private:
vtkSelectionSource(const vtkSelectionSource&); // Not implemented.
......
Markdown is supported
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