Go to the documentation of this file.
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++]);
133 ptrSelection = static_cast<vtkIdType *>(selection->
GetVoidPointer(0));
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());
161 ptrSelection = static_cast<vtkIdType *>(selection->
GetVoidPointer(0));
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++]);
209 ptrSelection = static_cast<vtkIdType *>(selection->
GetVoidPointer(0));
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
data structure to represent mouse events.
A node in a selection tree. Used to store selection results.
static vtkInformationObjectBaseKey * PROP()
Pointer to the prop the selection belongs to.
virtual std::string AddNode(vtkSelectionNode *)
Adds a selection node.
Hold a reference to a vtkObjectBase instance.
An algorithm for linking annotations among objects.
data object that represents a "selection" in VTK.
Abstract class for 2D plots.
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...
virtual vtkTable * GetInput()
Get the input table used by the plot.
unsigned int GetNumberOfNodes() const
Returns the number of nodes in this selection.
The selection data provided is point-data.
vtkIdType GetNumberOfTuples()
Get the number of complete tuples (a component group) in the array.
static vtkPlot * SafeDownCast(vtkObjectBase *o)
void SetNumberOfTuples(vtkIdType number) override
Set the number of tuples (a component group) in the array.
static int GetMouseSelectionMode(const vtkContextMouseEvent &mouse, int selectionMode)
Combine the SelectionMode with any mouse modifiers to get an effective selection mode for this click ...
static void MinusSelection(vtkIdTypeArray *selection, vtkIdTypeArray *oldSelection)
Subtract the supplied selection from the oldSelection.
helper functions for making selections in charts.
virtual void SetContentType(int type)
Get or set the content type of the selection.
static vtkInformationObjectBaseKey * SOURCE()
Pointer to the data or algorithm the selection belongs to.
static void ToggleSelection(vtkIdTypeArray *selection, vtkIdTypeArray *oldSelection)
Toggle the supplied selection from the oldSelection.
static vtkSmartPointer< T > New()
Create an instance of a VTK object.
Allocate and hold a VTK object.
virtual void SetSelectionList(vtkAbstractArray *)
Sets the selection list.
T * GetPointer() const
Get the contained pointer.
virtual vtkSelectionNode * GetNode(unsigned int idx) const
Returns a node given it's index.
int GetModifiers() const
Return the modifier keys, if any, ORed together.
dynamic, self-adjusting array of vtkIdType
static void AddSelection(vtkIdTypeArray *selection, vtkIdTypeArray *oldSelection)
Add the supplied selection from the oldSelection.
static void MakeSelection(vtkAnnotationLink *link, vtkIdTypeArray *selectionIds, vtkPlot *plot)
Populate the annotation link with the supplied selectionIds array, and set the appropriate node prope...
void * GetVoidPointer(vtkIdType valueIdx) override
Return a void pointer.
virtual void SetCurrentSelection(vtkSelection *sel)
Set or get the current selection in the annotation layers.
Select entities by their offsets into the dataset.
virtual void SetFieldType(int type)
Get or set the field type of the selection.
virtual vtkInformation * GetProperties()
Returns the property map.
virtual vtkSelection * GetCurrentSelection()