Commit dde337ab authored by Utkarsh Ayachit's avatar Utkarsh Ayachit
Browse files

ENH: Includes fixes for BUG #6523, BUG #6524, BUG #6525, BUG #6526, BUG #6530, BUG #6534.

In summary:
* spreadsheet view supports composite datasets.
* selection support added for composite datasets.

Some GUI work remains when is comes to creation of the filters to extract
selections.
parent 9a9a43ce
......@@ -79,6 +79,7 @@ vtkGraph.cxx
vtkGraphEdge.cxx
vtkHexagonalPrism.cxx
vtkHexahedron.cxx
vtkHierarchicalBoxDataIterator.cxx
vtkHierarchicalBoxDataSetAlgorithm.cxx
vtkHierarchicalBoxDataSet.cxx
vtkHyperOctreeAlgorithm.cxx
......
/*=========================================================================
Program: Visualization Toolkit
Module: vtkHierarchicalBoxDataIterator.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkHierarchicalBoxDataIterator.h"
#include "vtkCompositeDataSetInternals.h"
#include "vtkObjectFactory.h"
vtkStandardNewMacro(vtkHierarchicalBoxDataIterator);
vtkCxxRevisionMacro(vtkHierarchicalBoxDataIterator, "1.1");
//----------------------------------------------------------------------------
vtkHierarchicalBoxDataIterator::vtkHierarchicalBoxDataIterator()
{
}
//----------------------------------------------------------------------------
vtkHierarchicalBoxDataIterator::~vtkHierarchicalBoxDataIterator()
{
}
//----------------------------------------------------------------------------
unsigned int vtkHierarchicalBoxDataIterator::GetCurrentLevel()
{
if (this->IsDoneWithTraversal())
{
vtkErrorMacro("IsDoneWithTraversal is true.");
return 0;
}
vtkCompositeDataSetIndex index = this->Superclass::GetCurrentIndex();
return index[0];
}
//----------------------------------------------------------------------------
unsigned int vtkHierarchicalBoxDataIterator::GetCurrentIndex()
{
if (this->IsDoneWithTraversal())
{
vtkErrorMacro("IsDoneWithTraversal is true.");
return 0;
}
vtkCompositeDataSetIndex index = this->Superclass::GetCurrentIndex();
if (index.size()==2)
{
return index[1];
}
return 0;
}
//----------------------------------------------------------------------------
void vtkHierarchicalBoxDataIterator::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
}
/*=========================================================================
Program: Visualization Toolkit
Module: vtkHierarchicalBoxDataIterator.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkHierarchicalBoxDataIterator - subclass of vtkCompositeDataIterator
// with API to get current level and dataset index.
// .SECTION Description
#ifndef __vtkHierarchicalBoxDataIterator_h
#define __vtkHierarchicalBoxDataIterator_h
#include "vtkCompositeDataIterator.h"
class VTK_FILTERING_EXPORT vtkHierarchicalBoxDataIterator : public vtkCompositeDataIterator
{
public:
static vtkHierarchicalBoxDataIterator* New();
vtkTypeRevisionMacro(vtkHierarchicalBoxDataIterator, vtkCompositeDataIterator);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Returns the level for the current dataset.
unsigned int GetCurrentLevel();
// Description:
// Returns the dataset index for the current data object. Valid only if the
// current data is a leaf node i.e. no a composite dataset.
unsigned int GetCurrentIndex();
//BTX
protected:
vtkHierarchicalBoxDataIterator();
~vtkHierarchicalBoxDataIterator();
private:
vtkHierarchicalBoxDataIterator(const vtkHierarchicalBoxDataIterator&); // Not implemented.
void operator=(const vtkHierarchicalBoxDataIterator&); // Not implemented.
//ETX
};
#endif
......@@ -15,6 +15,7 @@
#include "vtkHierarchicalBoxDataSet.h"
#include "vtkAMRBox.h"
#include "vtkHierarchicalBoxDataIterator.h"
#include "vtkInformation.h"
#include "vtkInformationIdTypeKey.h"
#include "vtkInformationIntegerKey.h"
......@@ -29,7 +30,7 @@
#include <vtkstd/vector>
#include <assert.h>
vtkCxxRevisionMacro(vtkHierarchicalBoxDataSet, "1.19");
vtkCxxRevisionMacro(vtkHierarchicalBoxDataSet, "1.20");
vtkStandardNewMacro(vtkHierarchicalBoxDataSet);
vtkInformationKeyMacro(vtkHierarchicalBoxDataSet,BOX,IntegerVector);
......@@ -49,6 +50,14 @@ vtkHierarchicalBoxDataSet::~vtkHierarchicalBoxDataSet()
{
}
//----------------------------------------------------------------------------
vtkCompositeDataIterator* vtkHierarchicalBoxDataSet::NewIterator()
{
vtkHierarchicalBoxDataIterator* iter = vtkHierarchicalBoxDataIterator::New();
iter->SetDataSet(this);
return iter;
}
//----------------------------------------------------------------------------
void vtkHierarchicalBoxDataSet::SetNumberOfLevels(unsigned int numLevels)
{
......
......@@ -50,6 +50,10 @@ public:
vtkTypeRevisionMacro(vtkHierarchicalBoxDataSet,vtkCompositeDataSet);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Return a new iterator (the iterator has to be deleted by user).
virtual vtkCompositeDataIterator* NewIterator();
// Description:
// Return class name of data type (see vtkType.h for definitions).
virtual int GetDataObjectType() {return VTK_HIERARCHICAL_BOX_DATA_SET;}
......
......@@ -31,7 +31,7 @@
#include <vtkstd/map>
#include <vtkstd/vector>
vtkCxxRevisionMacro(vtkSelection, "1.23");
vtkCxxRevisionMacro(vtkSelection, "1.24");
vtkStandardNewMacro(vtkSelection);
vtkInformationKeyMacro(vtkSelection,CONTENT_TYPE,Integer);
......@@ -40,15 +40,14 @@ vtkInformationKeyMacro(vtkSelection,SOURCE_ID,Integer);
vtkInformationKeyMacro(vtkSelection,PROP,ObjectBase);
vtkInformationKeyMacro(vtkSelection,PROP_ID,Integer);
vtkInformationKeyMacro(vtkSelection,PROCESS_ID,Integer);
vtkInformationKeyMacro(vtkSelection,GROUP,Integer);
vtkInformationKeyMacro(vtkSelection,BLOCK,Integer);
vtkInformationKeyMacro(vtkSelection,COMPOSITE_INDEX,Integer);
vtkInformationKeyMacro(vtkSelection,HIERARCHICAL_LEVEL,Integer);
vtkInformationKeyMacro(vtkSelection,HIERARCHICAL_INDEX,Integer);
vtkInformationKeyMacro(vtkSelection,FIELD_TYPE,Integer);
vtkInformationKeyMacro(vtkSelection,EPSILON,Double);
vtkInformationKeyMacro(vtkSelection,PRESERVE_TOPOLOGY,Integer);
vtkInformationKeyMacro(vtkSelection,CONTAINING_CELLS,Integer);
vtkInformationKeyMacro(vtkSelection,PIXEL_COUNT,Integer);
vtkInformationKeyMacro(vtkSelection,INVERSE,Integer);
vtkInformationKeyMacro(vtkSelection,SHOW_BOUNDS,Integer);
vtkInformationKeyMacro(vtkSelection,INDEXED_VERTICES,Integer);
struct vtkSelectionInternals
......@@ -283,6 +282,8 @@ void vtkSelection::DeepCopy(vtkDataObject* src)
return;
}
this->Initialize();
this->Superclass::DeepCopy(src);
this->Properties->Copy(input->Properties, 1);
......@@ -477,7 +478,6 @@ void vtkSelection::UnionSelectionList(vtkSelection* other)
break;
}
case SELECTIONS:
case COMPOSITE_SELECTIONS:
case FRUSTUM:
default:
{
......
......@@ -35,10 +35,8 @@
// the selection was performed on a renderer, PROP or PROP_ID point to the
// prop the selection was made on. Selection nodes corresponding to
// composite datasets may contain child nodes. Each child node of a
// composite dataset should have GROUP and BLOCK set. This way, the pointer
// to the composite dataset can be obtained from the parent of a block
// node. The pointer to the block can be obtained from the composite
// dataset using GROUP and BLOCK.
// composite dataset should have COMPOSITE_INDEX set. This is the flat-index to
// identify a node with in the composite dataset to which the selection applies.
//
// .SECTION Caveats
// Each node can have one parent and should not be added to more than one
......@@ -183,7 +181,6 @@ public:
enum SelectionContent
{
SELECTIONS,
COMPOSITE_SELECTIONS,
GLOBALIDS,
PEDIGREEIDS,
VALUES,
......@@ -227,12 +224,6 @@ public:
// For location selection of points, if distance is greater than this reject.
static vtkInformationDoubleKey* EPSILON();
// Description:
// This flag tells the extraction filter not to convert the selected
// output into an unstructured grid, but instead to produce a vtkInsidedness
// array and add it to the input dataset.
static vtkInformationIntegerKey* PRESERVE_TOPOLOGY();
// Description:
// This flag tells the extraction filter, when FIELD_TYPE==POINT, that
// it should also extract the cells that contain any of the extracted points.
......@@ -270,12 +261,13 @@ public:
static vtkInformationIntegerKey* PROCESS_ID();
// Description:
// The composite data group the selection belongs to.
static vtkInformationIntegerKey* GROUP();
// Used to identify a node in composite datasets.
static vtkInformationIntegerKey* COMPOSITE_INDEX();
// Description:
// The composite data block the selection belongs to.
static vtkInformationIntegerKey* BLOCK();
// Used to identify a dataset in a hiererchical box dataset.
static vtkInformationIntegerKey* HIERARCHICAL_LEVEL();
static vtkInformationIntegerKey* HIERARCHICAL_INDEX();
// Description:
// This key is used when making visible vertex selection. It means
......@@ -288,10 +280,6 @@ public:
static vtkSelection* GetData(vtkInformation* info);
static vtkSelection* GetData(vtkInformationVector* v, int i=0);
// Description:
// For Frustum selection.
static vtkInformationIntegerKey* SHOW_BOUNDS();
//BTX
protected:
vtkSelection();
......
......@@ -78,6 +78,7 @@ vtkExtractGrid.cxx
vtkExtractLevel.cxx
vtkExtractPolyDataGeometry.cxx
vtkExtractRectilinearGrid.cxx
vtkExtractSelectionBase.cxx
vtkExtractSelectedFrustum.cxx
vtkExtractSelectedIds.cxx
vtkExtractSelectedLocations.cxx
......@@ -256,11 +257,12 @@ SET_SOURCE_FILES_PROPERTIES(
vtkApproximatingSubdivisionFilter
vtkButtonSource
vtkDicer
vtkDijkstraGraphGeodesicPath
vtkEdgeSubdivisionCriterion.cxx
vtkExtractSelectionBase
vtkGeodesicPath
vtkGraphGeodesicPath
vtkDijkstraGraphGeodesicPath
vtkInterpolatingSubdivisionFilter
vtkEdgeSubdivisionCriterion.cxx
vtkStreamer
ABSTRACT
)
......
......@@ -56,8 +56,6 @@ const char* SelectionTypeToString(int type)
{
case vtkSelection::SELECTIONS:
return "Selections";
case vtkSelection::COMPOSITE_SELECTIONS:
return "Composite Selections";
case vtkSelection::GLOBALIDS:
return "Global IDs";
case vtkSelection::PEDIGREEIDS:
......
......@@ -314,6 +314,7 @@ int TestExtraction(int argc, char *argv[])
vtkExtractSelection *ext = vtkExtractSelection::New();
ext->SetInput(0, sampleData);
ext->SetInput(1, sel);
ext->PreserveTopologyOff();
vtkUnstructuredGridWriter *writer = vtkUnstructuredGridWriter::New();
vtkUnstructuredGrid *extGrid;
......@@ -360,7 +361,7 @@ int TestExtraction(int argc, char *argv[])
showMe(extGrid, 1, 0, COLORBYCELL, ciaF);
sel->GetProperties()->Set(vtkSelection::INVERSE(), 0);
sel->GetProperties()->Set(vtkSelection::PRESERVE_TOPOLOGY(), 1);
ext->PreserveTopologyOn();
ext->Update();
extIData = vtkImageData::SafeDownCast(ext->GetOutput());
if (DoWrite)
......@@ -377,6 +378,7 @@ int TestExtraction(int argc, char *argv[])
vtkIdTypeArray *pointIds = NULL;
sel->Clear();
ext->PreserveTopologyOff();
sel->GetProperties()->Set(
vtkSelection::CONTENT_TYPE(), vtkSelection::GLOBALIDS);
sel->GetProperties()->Set(
......@@ -426,7 +428,7 @@ int TestExtraction(int argc, char *argv[])
showMe(extGrid, 5, 0, COLORBYPOINT, piaF);
sel->GetProperties()->Set(vtkSelection::CONTAINING_CELLS(), 0);
sel->GetProperties()->Set(vtkSelection::PRESERVE_TOPOLOGY(), 1);
ext->PreserveTopologyOn();
ext->Update();
extIData = vtkImageData::SafeDownCast(ext->GetOutput());
if (DoWrite)
......@@ -444,7 +446,7 @@ int TestExtraction(int argc, char *argv[])
showMe(extIData, 6, 0, COLORBYPOINT, insideArray);
sel->GetProperties()->Set(vtkSelection::CONTAINING_CELLS(), 1);
sel->GetProperties()->Set(vtkSelection::PRESERVE_TOPOLOGY(), 1);
ext->PreserveTopologyOn();
ext->Update();
extIData = vtkImageData::SafeDownCast(ext->GetOutput());
if (DoWrite)
......@@ -459,6 +461,7 @@ int TestExtraction(int argc, char *argv[])
//--------------------------------------------------------------------------
//Test extract INDICES filter on cells
sel->Clear();
ext->PreserveTopologyOff();
sel->GetProperties()->Set(
vtkSelection::CONTENT_TYPE(), vtkSelection::INDICES);
cellIds = vtkIdTypeArray::New();
......@@ -494,7 +497,7 @@ int TestExtraction(int argc, char *argv[])
showMe(extGrid, 1, 1, COLORBYCELL, cia);
sel->GetProperties()->Set(vtkSelection::INVERSE(), 0);
sel->GetProperties()->Set(vtkSelection::PRESERVE_TOPOLOGY(), 1);
ext->PreserveTopologyOn();
ext->Update();
extIData = vtkImageData::SafeDownCast(ext->GetOutput());
if (DoWrite)
......@@ -509,6 +512,7 @@ int TestExtraction(int argc, char *argv[])
//--------------------------------------------------------------------------
//Test extract INDICES filter on points
sel->Clear();
ext->PreserveTopologyOff();
sel->GetProperties()->Set(
vtkSelection::CONTENT_TYPE(), vtkSelection::INDICES);
sel->GetProperties()->Set(
......@@ -558,8 +562,8 @@ int TestExtraction(int argc, char *argv[])
showMe(extGrid, 5, 1, COLORBYPOINT, pia);
sel->GetProperties()->Set(vtkSelection::INVERSE(), 0);
sel->GetProperties()->Set(vtkSelection::PRESERVE_TOPOLOGY(), 1);
sel->GetProperties()->Set(vtkSelection::CONTAINING_CELLS(), 0);
ext->PreserveTopologyOn();
ext->Update();
extIData = vtkImageData::SafeDownCast(ext->GetOutput());
if (DoWrite)
......@@ -591,6 +595,7 @@ int TestExtraction(int argc, char *argv[])
//--------------------------------------------------------------------------
//Test extract VALUES filter on cells
sel->Clear();
ext->PreserveTopologyOff();
sel->GetProperties()->Set(
vtkSelection::CONTENT_TYPE(), vtkSelection::VALUES);
cellIds = vtkIdTypeArray::New();
......@@ -627,7 +632,7 @@ int TestExtraction(int argc, char *argv[])
showMe(extGrid, 1, 2, COLORBYCELL, ciaR);
sel->GetProperties()->Set(vtkSelection::INVERSE(), 0);
sel->GetProperties()->Set(vtkSelection::PRESERVE_TOPOLOGY(), 1);
ext->PreserveTopologyOn();
ext->Update();
extIData = vtkImageData::SafeDownCast(ext->GetOutput());
if (DoWrite)
......@@ -642,6 +647,7 @@ int TestExtraction(int argc, char *argv[])
//--------------------------------------------------------------------------
//Test extract VALUES filter on points
sel->Clear();
ext->PreserveTopologyOff();
sel->GetProperties()->Set(
vtkSelection::CONTENT_TYPE(), vtkSelection::VALUES);
sel->GetProperties()->Set(
......@@ -693,7 +699,7 @@ int TestExtraction(int argc, char *argv[])
sel->GetProperties()->Set(vtkSelection::INVERSE(), 0);
sel->GetProperties()->Set(vtkSelection::CONTAINING_CELLS(), 0);
sel->GetProperties()->Set(vtkSelection::PRESERVE_TOPOLOGY(), 1);
ext->PreserveTopologyOn();
ext->Update();
extIData = vtkImageData::SafeDownCast(ext->GetOutput());
if (DoWrite)
......@@ -725,6 +731,7 @@ int TestExtraction(int argc, char *argv[])
//-------------------------------------------------------------------------
//test the extract THRESHOLD filter on cell data
sel->Clear();
ext->PreserveTopologyOff();
sel->GetProperties()->Set(
vtkSelection::CONTENT_TYPE(), vtkSelection::THRESHOLDS);
vtkDoubleArray *cellThresh = vtkDoubleArray::New();
......@@ -757,7 +764,7 @@ int TestExtraction(int argc, char *argv[])
showMe(extGrid, 1, 3, COLORBYCELL, cxa);
sel->GetProperties()->Set(vtkSelection::INVERSE(), 0);
sel->GetProperties()->Set(vtkSelection::PRESERVE_TOPOLOGY(), 1);
ext->PreserveTopologyOn();
ext->Update();
extIData = vtkImageData::SafeDownCast(ext->GetOutput());
if (DoWrite)
......@@ -772,6 +779,7 @@ int TestExtraction(int argc, char *argv[])
//-------------------------------------------------------------------------
//test the extract THRESHOLD filter on point data
sel->Clear();
ext->PreserveTopologyOff();
sel->GetProperties()->Set(
vtkSelection::CONTENT_TYPE(), vtkSelection::THRESHOLDS);
sel->GetProperties()->Set(vtkSelection::FIELD_TYPE(), vtkSelection::POINT);
......@@ -817,7 +825,7 @@ int TestExtraction(int argc, char *argv[])
showMe(extGrid, 5, 3, COLORBYPOINT, pxa);
sel->GetProperties()->Set(vtkSelection::CONTAINING_CELLS(), 0);
sel->GetProperties()->Set(vtkSelection::PRESERVE_TOPOLOGY(), 1);
ext->PreserveTopologyOn();
ext->Update();
extIData = vtkImageData::SafeDownCast(ext->GetOutput());
if (DoWrite)
......@@ -849,6 +857,7 @@ int TestExtraction(int argc, char *argv[])
//-------------------------------------------------------------------------
//test the extract LOCATIONS filter on cells
sel->Clear();
ext->PreserveTopologyOff();
sel->GetProperties()->Set(
vtkSelection::CONTENT_TYPE(), vtkSelection::LOCATIONS);
vtkDoubleArray *cellLocs = vtkDoubleArray::New();
......@@ -884,7 +893,7 @@ int TestExtraction(int argc, char *argv[])
showMe(extGrid, 1, 4, COLORBYCELL, cia);
sel->GetProperties()->Set(vtkSelection::INVERSE(), 0);
sel->GetProperties()->Set(vtkSelection::PRESERVE_TOPOLOGY(), 1);
ext->PreserveTopologyOn();
ext->Update();
extIData = vtkImageData::SafeDownCast(ext->GetOutput());
if (DoWrite)
......@@ -900,6 +909,7 @@ int TestExtraction(int argc, char *argv[])
//test the extract LOCATIONS filter on points
sel->Clear();
ext->PreserveTopologyOff();
sel->GetProperties()->Set(
vtkSelection::CONTENT_TYPE(), vtkSelection::LOCATIONS);
sel->GetProperties()->Set(vtkSelection::FIELD_TYPE(), vtkSelection::POINT);
......@@ -948,7 +958,7 @@ int TestExtraction(int argc, char *argv[])
sel->GetProperties()->Set(vtkSelection::INVERSE(), 0);
sel->GetProperties()->Set(vtkSelection::CONTAINING_CELLS(), 0);
sel->GetProperties()->Set(vtkSelection::PRESERVE_TOPOLOGY(), 1);
ext->PreserveTopologyOn();
ext->Update();
extIData = vtkImageData::SafeDownCast(ext->GetOutput());
if (DoWrite)
......@@ -975,6 +985,7 @@ int TestExtraction(int argc, char *argv[])
//-------------------------------------------------------------------------
//test the extract FRUSTUM filter
sel->Clear();
ext->PreserveTopologyOff();
sel->GetProperties()->Set(
vtkSelection::CONTENT_TYPE(), vtkSelection::FRUSTUM);
vtkDoubleArray *frustcorners = vtkDoubleArray::New();
......@@ -1014,7 +1025,7 @@ int TestExtraction(int argc, char *argv[])
showMe(extGrid, 1, 5, COLORBYCELL, cia);
sel->GetProperties()->Set(vtkSelection::INVERSE(), 0);
sel->GetProperties()->Set(vtkSelection::PRESERVE_TOPOLOGY(), 1);
ext->PreserveTopologyOn();
ext->Update();
extIData = vtkImageData::SafeDownCast(ext->GetOutput());
if (DoWrite)
......@@ -1030,6 +1041,7 @@ int TestExtraction(int argc, char *argv[])
//test the extract FRUSTUM filter on points
sel->Clear();
ext->PreserveTopologyOff();
sel->GetProperties()->Set(
vtkSelection::CONTENT_TYPE(), vtkSelection::FRUSTUM);
sel->GetProperties()->Set(vtkSelection::FIELD_TYPE(), vtkSelection::POINT);
......@@ -1083,7 +1095,7 @@ int TestExtraction(int argc, char *argv[])
sel->GetProperties()->Set(vtkSelection::INVERSE(), 0);
sel->GetProperties()->Set(vtkSelection::CONTAINING_CELLS(), 0);
sel->GetProperties()->Set(vtkSelection::PRESERVE_TOPOLOGY(), 1);
ext->PreserveTopologyOn();
ext->Update();
extIData = vtkImageData::SafeDownCast(ext->GetOutput());
if (DoWrite)
......
......@@ -25,13 +25,14 @@
#include "vtkSelection.h"
#include "vtkStreamingDemandDrivenPipeline.h"
vtkCxxRevisionMacro(vtkAppendSelection, "1.4");
vtkCxxRevisionMacro(vtkAppendSelection, "1.5");
vtkStandardNewMacro(vtkAppendSelection);
//----------------------------------------------------------------------------
vtkAppendSelection::vtkAppendSelection()
{
this->UserManagedInputs = 0;
this->AppendByUnion = 1;
}
//----------------------------------------------------------------------------
......@@ -121,6 +122,25 @@ int vtkAppendSelection::RequestData(vtkInformation *vtkNotUsed(request),
{
return 1;
}
if (!this->AppendByUnion)
{
output->SetContentType(vtkSelection::SELECTIONS);
for (int idx=0; idx < numInputs; ++idx)
{
vtkInformation *inInfo = inputVector[0]->GetInformationObject(idx);
vtkSelection *sel = vtkSelection::GetData(inInfo);
if (sel != NULL)
{
vtkSelection* clone = sel->NewInstance();
clone->ShallowCopy(sel);
output->AddChild(clone);
clone->Delete();
}
} // for each input
return 1;
}
// The first non-null selection determines the required content type of all selections.
int idx = 0;
......@@ -176,5 +196,6 @@ int vtkAppendSelection::FillInputPortInformation(int port, vtkInformation *info)
void vtkAppendSelection::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
os << "UserManagedInputs:" << (this->UserManagedInputs?"On":"Off") << endl;
os << "UserManagedInputs: " << (this->UserManagedInputs?"On":"Off") << endl;
os << "AppendByUnion: " << (this->AppendByUnion? "On": "Off") << endl;
}
......@@ -20,7 +20,8 @@
//
// .SECTION Description
// vtkAppendSelection is a filter that appends one of more selections into
// a single selection. All selections must have the same content type.
// a single selection. All selections must have the same content type unless
// AppendByUnion is false.
#ifndef __vtkAppendSelection_h
#define __vtkAppendSelection_h
......@@ -71,6 +72,17 @@ public:
// Set Nth input, should only be used when UserManagedInputs is true.
void SetInputByNumber(int num, vtkSelection *input);
// Description:
// When set to true, all the selections are combined together to form a single
// vtkSelection output.
// When set to false, the output is a composite selection with
// input selections as the children of the composite selection. This allows
// for selections with different content types and properties. Default is
// true.
vtkSetMacro(AppendByUnion, int);
vtkGetMacro(AppendByUnion, int);
vtkBooleanMacro(AppendByUnion, int);
protected:
vtkAppendSelection();
~vtkAppendSelection();
......@@ -86,7 +98,7 @@ protected:
{ vtkErrorMacro( << "AddInput() must be called with a vtkSelection not a vtkDataObject."); };
int UserManagedInputs;
int AppendByUnion;
private:
vtkAppendSelection(const vtkAppendSelection&); // Not implemented.
void operator=(const vtkAppendSelection&); // Not implemented.
......
......@@ -20,6 +20,7 @@
#include "vtkCellData.h"
#include "vtkCommand.h"
#include "vtkCompositeDataSet.h"
#include "vtkDataArrayTemplate.h"
#include "vtkDataSet.h"
#include "vtkDoubleArray.h"
......@@ -27,6 +28,7 @@
#include "vtkExtractSelection.h"
#include "vtkFieldData.h"
#include "vtkGraph.h"