26 #ifndef vtkChartSelectionHelper_h 27 #define vtkChartSelectionHelper_h 54 assert(link !=
nullptr && selectionIds !=
nullptr);
66 if (selectionPlot == plot)
102 std::vector<vtkIdType> output;
112 while (i <
size && iOld < oldSize)
114 if (ptrSelection[i] > ptrOldSelection[iOld])
116 output.push_back(ptrOldSelection[iOld++]);
118 else if (ptrSelection[i] == ptrOldSelection[iOld])
123 else if (ptrSelection[i] < ptrOldSelection[iOld])
128 while (iOld < oldSize)
130 output.push_back(ptrOldSelection[iOld++]);
134 for (std::vector<vtkIdType>::iterator it = output.begin();
135 it != output.end(); ++it, ++ptrSelection)
153 std::vector<vtkIdType>::iterator it;
154 it = std::set_union(ptrSelection,
159 int newSize =
int(it - output.begin());
162 for (std::vector<vtkIdType>::iterator i = output.begin(); i != it;
175 std::vector<vtkIdType> output;
184 while (i <
size && iOld < oldSize)
186 if (ptrSelection[i] > ptrOldSelection[iOld])
188 output.push_back(ptrOldSelection[iOld++]);
190 else if (ptrSelection[i] == ptrOldSelection[iOld])
195 else if (ptrSelection[i] < ptrOldSelection[iOld])
197 output.push_back(ptrSelection[i++]);
202 output.push_back(ptrSelection[i++]);
204 while (iOld < oldSize)
206 output.push_back(ptrOldSelection[iOld++]);
210 for (std::vector<vtkIdType>::iterator it = output.begin();
211 it != output.end(); ++it, ++ptrSelection)
226 if (!plotSelection || !oldSelection)
232 switch(selectionMode)
275 return selectionMode;
280 #endif // vtkChartSelectionHelper_h A node in a selection tree.
virtual vtkSelection * GetCurrentSelection()
Set or get the current selection in the annotation layers.
virtual void SetFieldType(int type)
Get or set the field type of the selection.
static void AddSelection(vtkIdTypeArray *selection, vtkIdTypeArray *oldSelection)
Add the supplied selection from the oldSelection.
vtkIdType GetNumberOfTuples()
Get the number of complete tuples (a component group) in the array.
The selection data provided is point-data.
unsigned int GetNumberOfNodes() const
Returns the number of nodes in this selection.
static void MinusSelection(vtkIdTypeArray *selection, vtkIdTypeArray *oldSelection)
Subtract the supplied selection from the oldSelection.
data object that represents a "selection" in VTK.
static void MakeSelection(vtkAnnotationLink *link, vtkIdTypeArray *selectionIds, vtkPlot *plot)
Populate the annotation link with the supplied selectionIds array, and set the appropriate node prope...
dynamic, self-adjusting array of vtkIdType
Hold a reference to a vtkObjectBase instance.
virtual vtkInformation * GetProperties()
Returns the property map.
static vtkSmartPointer< T > New()
Create an instance of a VTK object.
void SetNumberOfTuples(vtkIdType number) override
Set the number of tuples (a component group) in the array.
virtual std::string AddNode(vtkSelectionNode *)
Adds a selection node.
static vtkPlot * SafeDownCast(vtkObjectBase *o)
helper functions for making selections in charts.
int GetModifiers() const
Return the modifier keys, if any, ORed together.
data structure to represent mouse events.
static vtkInformationObjectBaseKey * PROP()
Pointer to the prop the selection belongs to.
virtual vtkSelectionNode * GetNode(unsigned int idx) const
Returns a node given it's index.
virtual void SetContentType(int type)
Get or set the content type of the selection.
Abstract class for 2D plots.
virtual vtkTable * GetInput()
Get the input table used by the plot.
static void BuildSelection(vtkAnnotationLink *link, int selectionMode, vtkIdTypeArray *plotSelection, vtkIdTypeArray *oldSelection, vtkPlot *plot)
Build a selection based on the supplied selectionMode using the new plotSelection and combining it wi...
static int GetMouseSelectionMode(const vtkContextMouseEvent &mouse, int selectionMode)
Combine the SelectionMode with any mouse modifiers to get an effective selection mode for this click ...
Allocate and hold a VTK object.
Select entities by their offsets into the dataset.
static vtkInformationObjectBaseKey * SOURCE()
Pointer to the data or algorithm the selection belongs to.
virtual void SetSelectionList(vtkAbstractArray *)
Sets the selection list.
static void ToggleSelection(vtkIdTypeArray *selection, vtkIdTypeArray *oldSelection)
Toggle the supplied selection from the oldSelection.
T * GetPointer() const
Get the contained pointer.
virtual void SetCurrentSelection(vtkSelection *sel)
Set or get the current selection in the annotation layers.
void * GetVoidPointer(vtkIdType valueIdx) override
Get the address of a particular data index.
An algorithm for linking annotations among objects.