1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
|
/*=========================================================================
Program: Visualization Toolkit
Module: vtkPVExtractSelection.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.
=========================================================================*/
/**
* @class vtkPVExtractSelection
* @brief Adds a two more output ports to vtkExtractSelection,
* the second port contains an id selection and the third is simply the input
* selection.
*
* vtkPVExtractSelection adds a second port to vtkExtractSelection.
* \li Output port 0 -- is the output from the superclass. It's nothing but the
* extracted dataset.
*
* \li Output port 1 -- is a vtkSelection consisting of indices of the cells/points
* extracted. If vtkSelection used as the input to this filter is of the field
* type vtkSelection::CELL, then the output vtkSelection has both the cell
* indicides as well as point indices of the cells/points that were extracted.
* If input field type is vtkSelection::POINT, then the output vtkSelection only
* has the indicies of the points that were extracted.
* This second output is useful for correlating particular
* cells in the subset with the original data set. This is used, for instance,
* by Chart representations to show selections.
*
* \li Output port 2 -- is simply the input vtkSelection. We currently use this
* for Histogram View/Representation. Since that view cannot show arbitrary ID
* based selections, it needs to get to the original vtkSelection to determine
* if the particular selection can be shown in the view at all.
* @sa
* vtkExtractSelection vtkSelection
*/
#ifndef vtkPVExtractSelection_h
#define vtkPVExtractSelection_h
#include "vtkExtractSelection.h"
#include "vtkPVClientServerCoreCoreModule.h" //needed for exports
class vtkSelectionNode;
class VTKPVCLIENTSERVERCORECORE_EXPORT vtkPVExtractSelection : public vtkExtractSelection
{
public:
vtkTypeMacro(vtkPVExtractSelection, vtkExtractSelection);
void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
static const int OUTPUT_PORT_EXTRACTED_DATASET = 0;
static const int OUTPUT_PORT_SELECTION_IDS = 1;
static const int OUTPUT_PORT_SELECTION_ORIGINAL = 2;
/**
* Constructor
*/
static vtkPVExtractSelection* New();
/**
* Removes all inputs from input port 1.
*/
void RemoveAllSelectionsInputs() { this->SetInputConnection(1, 0); }
protected:
vtkPVExtractSelection();
~vtkPVExtractSelection();
// sets up empty output dataset
virtual int RequestDataObject(vtkInformation* request, vtkInformationVector** inputVector,
vtkInformationVector* outputVector) VTK_OVERRIDE;
// runs the algorithm and fills the output with results
virtual int RequestData(
vtkInformation*, vtkInformationVector**, vtkInformationVector*) VTK_OVERRIDE;
virtual int FillOutputPortInformation(int port, vtkInformation* info) VTK_OVERRIDE;
vtkSelectionNode* LocateSelection(unsigned int level, unsigned int index, vtkSelection* sel);
vtkSelectionNode* LocateSelection(unsigned int composite_index, vtkSelection* sel);
private:
vtkPVExtractSelection(const vtkPVExtractSelection&) VTK_DELETE_FUNCTION;
void operator=(const vtkPVExtractSelection&) VTK_DELETE_FUNCTION;
class vtkSelectionNodeVector;
void RequestDataInternal(
vtkSelectionNodeVector& outputs, vtkDataObject* dataObjectOutput, vtkSelectionNode* sel);
// Returns the combined content type for the selection.
int GetContentType(vtkSelection* sel);
};
#endif
|