Go to the documentation of this file.
27 #ifndef vtkChartSelectionHelper_h
28 #define vtkChartSelectionHelper_h
55 assert(link != NULL && selectionIds != NULL);
67 if (selectionPlot == plot)
104 std::vector<vtkIdType> output;
115 while (i <
size && iOld < oldSize)
117 if (ptrSelection[i] > ptrOldSelection[iOld])
119 output.push_back(ptrOldSelection[iOld++]);
121 else if (ptrSelection[i] == ptrOldSelection[iOld])
126 else if (ptrSelection[i] < ptrOldSelection[iOld])
131 while (iOld < oldSize)
133 output.push_back(ptrOldSelection[iOld++]);
136 ptrSelection = static_cast<vtkIdType *>(selection->
GetVoidPointer(0));
137 for (std::vector<vtkIdType>::iterator it = output.begin();
138 it != output.end(); ++it, ++ptrSelection)
157 std::vector<vtkIdType>::iterator it;
158 it = std::set_union(ptrSelection,
163 int newSize =
int(it - output.begin());
165 ptrSelection = static_cast<vtkIdType *>(selection->
GetVoidPointer(0));
166 for (std::vector<vtkIdType>::iterator i = output.begin(); i != it;
181 std::vector<vtkIdType> output;
190 while (i <
size && iOld < oldSize)
192 if (ptrSelection[i] > ptrOldSelection[iOld])
194 output.push_back(ptrOldSelection[iOld++]);
196 else if (ptrSelection[i] == ptrOldSelection[iOld])
201 else if (ptrSelection[i] < ptrOldSelection[iOld])
203 output.push_back(ptrSelection[i++]);
208 output.push_back(ptrSelection[i++]);
210 while (iOld < oldSize)
212 output.push_back(ptrOldSelection[iOld++]);
215 ptrSelection = static_cast<vtkIdType *>(selection->
GetVoidPointer(0));
216 for (std::vector<vtkIdType>::iterator it = output.begin();
217 it != output.end(); ++it, ++ptrSelection)
233 if (!plotSelection || !oldSelection)
239 switch(selectionMode)
283 return selectionMode;
289 #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 void SetNumberOfTuples(vtkIdType numTuples)=0
Set the number of tuples (a component group) in the array.
Hold a reference to a vtkObjectBase instance.
unsigned int GetNumberOfNodes()
Returns the number of nodes in this selection.
An algorithm for linking annotations among objects.
A node in a selection tree. Used to store selection results.
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.
virtual void AddNode(vtkSelectionNode *)
Adds a selection node.
virtual void * GetVoidPointer(vtkIdType valueIdx)=0
Return a void pointer.
vtkIdType GetNumberOfTuples()
Get the number of complete tuples (a component group) in the array.
static vtkPlot * SafeDownCast(vtkObjectBase *o)
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.
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.
T * GetPointer() const
Get a raw pointer to the contained object.
virtual void SetSelectionList(vtkAbstractArray *)
Sets the selection list.
virtual vtkSelectionNode * GetNode(unsigned int idx)
Returns a node given it's index.
T * GetPointer() const
Get the contained pointer.
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...
virtual void SetCurrentSelection(vtkSelection *sel)
Set or get the current selection in the annotation layers.
virtual void SetFieldType(int type)
Get or set the field type of the selection.
virtual vtkInformation * GetProperties()
Returns the property map.
virtual vtkSelection * GetCurrentSelection()