casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PlotTool.h
Go to the documentation of this file.
1 //# PlotTool.h: Tool class definitions (higher-level event handlers).
2 //# Copyright (C) 2008
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id: $
27 #ifndef PLOTTOOL_H_
28 #define PLOTTOOL_H_
29 
34 
35 namespace casa {
36 
37 //# Forward Declarations
38 class PlotCanvas;
39 class PlotFactory;
40 class PlotPanToolNotifier;
41 class PlotSelectToolNotifier;
42 class PlotTrackerToolNotifier;
44 
45 
46 
48 // ABSTRACT TOOL CLASSES //
50 
51 
52 // A PlotTool is a higher-level event handler for a PlotCanvas. The idea is to
53 // take common tasks which may require multiple events and put them in one
54 // place. PlotTools also provide additional functionality in that they can be
55 // 1) active/inactive, and 2) blocking/non-blocking. The PlotCanvas will only
56 // send events to active tools, and will not send events to later tools or
57 // event handlers if the latest tool was blocking. In this way a single tool
58 // can be used to handle ALL user interaction via the GUI at one time, if
59 // desired. The PlotTool class itself is abstract and deliberately non-binding
60 // as it is mainly meant for specialization in its children classes. PlotTools
61 // can also specify which coordinate system and two axes they work on, and the
62 // PlotCanvas is expected to obey these constraints.
63 class PlotTool {
64  friend class PlotCanvas;
65  friend class PlotMouseToolGroup;
66 
67 public:
68  // Constructor which takes which coordinate system events should be
69  // processed in.
70  PlotTool(PlotCoordinate::System sys = PlotCoordinate::WORLD);
71 
72  // Constructor which takes the two axes and the coordinate system which
73  // events should be processed in.
74  PlotTool(PlotAxis xAxis, PlotAxis yAxis,
75  PlotCoordinate::System sys = PlotCoordinate::WORLD);
76 
77  // Destructor.
78  virtual ~PlotTool();
79 
80 
81  // Returns whether this tool is currently active or not.
82  virtual bool isActive() const;
83 
84  // Sets whether this tool is currently active or not.
85  virtual void setActive(bool isActive = true);
86 
87  // Returns whether this tool is blocking or not. When a PlotCanvas
88  // encounters a blocking tool, it is expected to not send events to any
89  // other handlers further in the chain.
90  virtual bool isBlocking() const;
91 
92  // Sets whether this tool is blocking or not.
93  virtual void setBlocking(bool blocking = true);
94 
95  // Gets the axes on which the tool operates.
96  // <group>
97  virtual PlotAxis getXAxis() const;
98  virtual PlotAxis getYAxis() const;
99  // </group>
100 
101  // Gets the coordinate system in which the tool wants to process events.
102  // Events passed to this tool should use this coordinate system.
103  virtual PlotCoordinate::System getCoordinateSystem() const;
104 
105  // Returns whether the last event was handled or not. Mostly used for
106  // blocking tools so that unused events can be passed along.
107  virtual bool lastEventWasHandled() const;
108 
109  // Resets any internal state such as history/stacks. Should be called by
110  // the PlotCanvas when the state of the canvases changes (axes ranges,
111  // adding/deleting items, etc.) and would thus invalidate tool states.
112  virtual void reset() { }
113 
114 
115 
116 protected:
117  // Attached canvas (or NULL for none).
119 
120  // Factory for creating implementation-specific objects.
122 
123  // Whether this tool is active.
124  bool m_active;
125 
126  // Whether this tool is blocking.
128 
129  // The tool axes.
131 
132  // The tool coordinate system.
133  PlotCoordinate::System m_coordSystem;
134 
135  // Last event handled flag.
137 
138 
139  // Returns the canvas this tool is attached to, or NULL for none.
140  virtual PlotCanvas* canvas() const;
141 
142  // Returns a factory that can be used for generating
143  // implementation-specific classes, or NULL for none.
144  virtual PlotFactory* factory() const;
145 
146  // Returns true if this tool is attached to a canvas, false otherwise.
147  virtual bool isAttached() const;
148 
149  // Attaches this tool to the given canvas. Detaches from current canvas
150  // if necessary.
151  virtual void attach(PlotCanvas* canvas);
152 
153  // Detaches this tool from its canvas.
154  virtual void detach();
155 };
156 
158 
159 
160 
161 
162 // A PlotMouseTool is a specialization of PlotTool that handles all mouse
163 // events. It is abstract, and combines all mouse event handling methods into
164 // one for convenience.
165 class PlotMouseTool : public virtual PlotTool,
166  public virtual PlotSelectEventHandler,
167  public virtual PlotClickEventHandler,
168  public virtual PlotMousePressEventHandler,
169  public virtual PlotMouseReleaseEventHandler,
170  public virtual PlotMouseDragEventHandler,
171  public virtual PlotMouseMoveEventHandler,
172  public virtual PlotWheelEventHandler {
173 public:
174  // Constructor which takes the tool's coordinate system.
175  PlotMouseTool(PlotCoordinate::System coordSys = PlotCoordinate::WORLD) :
176  PlotTool(coordSys) { }
177 
178  // Constructor which takes the tool's axes and coordinate system.
180  PlotCoordinate::System coordSys = PlotCoordinate::WORLD) :
181  PlotTool(xAxis, yAxis, coordSys) { }
182 
183  // Destructor.
184  virtual ~PlotMouseTool() { }
185 
186 
187  // Event handling methods.
188  // <group>
189  virtual void handleSelect(const PlotSelectEvent& event) {
190  handleMouseEvent(event); }
191  virtual void handleClick(const PlotClickEvent& event) {
192  handleMouseEvent(event); }
193  virtual void handleMousePress(const PlotMousePressEvent& event) {
194  handleMouseEvent(event); }
195  virtual void handleMouseRelease(const PlotMouseReleaseEvent& event) {
196  handleMouseEvent(event); }
197  virtual void handleMouseDrag(const PlotMouseDragEvent& event) {
198  handleMouseEvent(event); }
199  virtual void handleMouseMove(const PlotMouseMoveEvent& event) {
200  handleMouseEvent(event); }
201  virtual void handleWheel(const PlotWheelEvent& event) {
202  handleMouseEvent(event); }
203  // </group>
204 
205 
206  // ABSTRACT METHODS //
207 
208  // Handles the given mouse event. Guaranteed to be one of the mouse
209  // events (select, click, press, release, drag, move, wheel). The
210  // implementing class should also update the last event handled flag as
211  // necessary.
212  virtual void handleMouseEvent(const PlotEvent& event) = 0;
213 };
214 INHERITANCE_POINTER2(PlotMouseTool, PlotMouseToolPtr, PlotTool, PlotToolPtr)
215 
216 
217 
218 
219 
220 
221 // CONCRETE TOOL CLASSES //
224 
225 
226 
227 
228 // Was in PlotStandardMouseToolGroup, but needed here, so it can be passed
229 // to setActiveTool, which needs it to adjust the Select tool to either work
230 // normal or as Subtraction tool.
231 
232 // Enum for standard tools in group.
233 enum ToolCode {
240 };
241 
242 
243 
244 
245 
246 // A PlotSelectTool is a concrete subclass of PlotMouseTool that mainly handles
247 // select events. Note that plotting implementations may wish to override
248 // this class with an implementation-specific version that may be more
249 // efficient. PlotSelectTool is responsible for:
250 // 1) managing the select line (the line show while the user is click-dragging
251 // to select a region on the canvas) and cursors,
252 // 2) keeping track of selected regions,
253 // 3) showing/hiding the regions on the canvas, and
254 // 4) notifying any interested classes whenever the selected regions changes.
255 class PlotSelectTool : public virtual PlotMouseTool {
256 public:
257  // Constructor which takes the tool's coordinate system.
258  PlotSelectTool(PlotCoordinate::System system = PlotCoordinate::WORLD);
259 
260  // Constructor which takes the tool's axes and coordinate system.
261  PlotSelectTool(PlotAxis xAxis, PlotAxis yAxis,
262  PlotCoordinate::System system = PlotCoordinate::WORLD);
263 
264  // Destructor.
265  virtual ~PlotSelectTool();
266 
267  // Adds the given notifier. This object will be notified when the list
268  // of selected regions changes (either by adding one from the mouse, or
269  // clearing them).
270  virtual void addNotifier(PlotSelectToolNotifier* notifier);
271 
272  // Sets the selection line to the given.
273  // <group>
274  virtual void setSelectLine(PlotLinePtr line);
275  virtual void setSubtractLine(PlotLinePtr line);
276  virtual void setSelectLine(bool on = true);
277  // </group>
278 
279  // Sets the attributes for drawing selected regions.
280  // <group>
281  virtual void setDrawRects(bool on = true);
282  virtual void setRectLine(PlotLinePtr line);
283  virtual void setRectFill(PlotAreaFillPtr fill);
284  // </group>
285 
286  // Selected regions.
287  // <group>
288  virtual unsigned int numSelectedRects() const;
289  virtual void getSelectedRects(
290  std::vector<double>& upperLeftXs,
291  std::vector<double>& upperLeftYs,
292  std::vector<double>& lowerRightXs,
293  std::vector<double>& lowerRightYs,
294  PlotCoordinate::System system = PlotCoordinate::WORLD) const;
295  virtual std::vector<PlotRegion> getSelectedRects(
296  PlotCoordinate::System system = PlotCoordinate::WORLD) const;
297  virtual void clearSelectedRects();
298  virtual int getSelectedRectCount();
299  // </group>
300 
301  // Overrides PlotTool::setActive().
302  virtual void setActive(bool active = true);
303 
304  // Implements PlotMouseTool::handleMouseEvent().
305  virtual void handleMouseEvent(const PlotEvent& event);
306 
308 
309 
310 
312 
313 
314 protected:
315  // Notifiers.
316  std::vector<PlotSelectToolNotifier*> m_notifiers;
317 
318  // Copy of selection line to set on the canvas, or NULL if none has been
319  // set.
322 
323  // Whether or not to draw selected regions on the canvas.
325 
326  // Line for drawing selected regions, or NULL if none has been set.
328 
329  // Area fill for drawing selected regions, or NULL if none has been set.
331 
332  // Selected regions.
333  std::vector<PlotShapeRectanglePtr> m_rects;
334 
335 
336 
337  // Overrides PlotTool::attach().
338  virtual void attach(PlotCanvas* canvas);
339 
340  // Overrides PlotTool::detach().
341  virtual void detach();
342 };
343 
344 
346  PlotMouseToolPtr, PlotTool, PlotToolPtr)
347 
348 
349 
350 
351 
352 
353 
354 
355 
356 // A PlotZoomTool is a concrete subclass of PlotMouseTool that provides
357 // convenient zooming functionality. Standard behavior is to zoom on a
358 // select event, go through the zoom stack on a wheel event, go to the zoom
359 // stack base on a right click, and zoom in 50% centered on a double-click.
360 // Note that plotting implementations may wish to override this class with an
361 // implementation-specific version that may be more efficient. A PlotZoomTool
362 // is responsible for:
363 // 1) managing behavior described above,
364 // 2) managing a zoom stack,
365 // 3) managing the canvas's select line/cursor, and
366 // 3) notifying interested objects when the zoom changes.
367 class PlotZoomTool : public virtual PlotMouseTool {
368 public:
369  // Constructor which takes the tool's coordinate system.
370  PlotZoomTool(PlotCoordinate::System sys = PlotCoordinate::WORLD);
371 
372  // Constructor which takes the tool's axes and coordinate system.
373  PlotZoomTool(PlotAxis xAxis, PlotAxis yAxis,
374  PlotCoordinate::System sys = PlotCoordinate::WORLD);
375 
376  // Destructor.
377  virtual ~PlotZoomTool();
378 
379  // Adds the given notifier. This object will be notified when the zoom
380  // changes.
381  virtual void addNotifier(PlotZoomToolNotifier* notifier);
382 
383  // Sets the selection line to the given.
384  // <group>
385  virtual void setSelectLine(PlotLinePtr line);
386  virtual void setSelectLine(bool on = true);
387  // </group>
388 
389  // Gets the zoom stack.
390  virtual std::vector<PlotRegion> getZoomStack(PlotCoordinate::System sytem =
391  PlotCoordinate::WORLD) const;
392 
393  // Gets the zoom stack index.
394  virtual unsigned int getStackIndex() const;
395 
396  // Overrides PlotTool::setActive().
397  virtual void setActive(bool active = true);
398 
399  // Implements PlotMouseTool::handleMouseEvent().
400  virtual void handleMouseEvent(const PlotEvent& event);
401 
402  // Overrides PlotTool::reset().
403  virtual void reset();
404 
405 protected:
406  // Notifiers.
407  std::vector<PlotZoomToolNotifier*> m_notifiers;
408 
409  // Copy of canvas selection line, or NULL if none has been set.
411 
412  // Common canvas stack.
414 
415 
416  // Overrides PlotTool::attach().
417  virtual void attach(PlotCanvas* canvas);
418 
419  // Overrides PlotTool::detach().
420  virtual void detach();
421 
422  // Notifies all registered listeners that the zoom has changed.
423  virtual void notifyWatchers();
424 };
425 INHERITANCE_POINTER(PlotZoomTool, PlotZoomToolPtr, PlotMouseTool,
426  PlotMouseToolPtr, PlotTool, PlotToolPtr)
427 
428 
429 
430 
431 // A PlotPanTool is a concrete subclass of PlotMouseTool that provides
432 // convenient panning functionality. Standard behavior is to pan the canvas
433 // on a drag event, go through the pan stack on a wheel event, and go to the
434 // pan stack base on a right click. Note that plotting implementations may
435 // wish to override this class with an implementation-specific version that may
436 // be more efficient. A PlotPanTool is responsible for:
437 // 1) managing behavior described above,
438 // 2) managing a pan stack,
439 // 3) managing the canvas's cursor, and
440 // 4) notifying interested objects when the pan changes.
441 class PlotPanTool : public virtual PlotMouseTool {
442 public:
443  // Constructor which takes the tool's coordinate system.
444  PlotPanTool(PlotCoordinate::System sys = PlotCoordinate::WORLD);
445 
446  // Constructor which takes the tool's axes and coordinate system.
447  PlotPanTool(PlotAxis xAxis, PlotAxis yAxis,
448  PlotCoordinate::System sys = PlotCoordinate::WORLD);
449 
450  // Destructor.
451  virtual ~PlotPanTool();
452 
453  // Adds the given notifier. This object will be notified when the pan
454  // changes.
455  virtual void addNotifier(PlotPanToolNotifier* notifier);
456 
457  // Gets the pan stack.
458  virtual std::vector<PlotRegion> getPanStack(PlotCoordinate::System system =
459  PlotCoordinate::WORLD) const;
460 
461  // Gets the pan stack index.
462  virtual unsigned int getStackIndex() const;
463 
464  // Overrides PlotTool::setActive().
465  virtual void setActive(bool active = true);
466 
467  // Implements PlotMouseTool::handleMouseEvent().
468  virtual void handleMouseEvent(const PlotEvent& event);
469 
470  // Overrides PlotTool::reset().
471  virtual void reset();
472 
473 protected:
474  // Notifiers.
475  std::vector<PlotPanToolNotifier*> m_notifiers;
476 
477  // Whether we're in dragging mode or not.
479 
480  // Last coordinate in dragging mode.
481  PlotCoordinate m_lastCoord;
482 
483  // Common canvas stack.
485 
486 
487  // Overrides PlotTool::attach().
488  virtual void attach(PlotCanvas* canvas);
489 
490  // Overrides PlotTool::detach().
491  virtual void detach();
492 
493  // Notifies all registered listeners that the pan has changed.
494  virtual void notifyWatchers();
495 };
496 INHERITANCE_POINTER(PlotPanTool, PlotPanToolPtr, PlotMouseTool,
497  PlotMouseToolPtr, PlotTool, PlotToolPtr)
498 
499 
500 
501 
502 // A PlotTrackerTool is a concrete subclass of PlotMouseTool that provides
503 // convenient tracker functionality. Note that plotting implementations may
504 // wish to override this class with an implementation-specific version that may
505 // be more efficient. A PlotTrackerTool can:
506 // 1) show a label with the current position hovering over the mouse,
507 // 2) let an external class handle the tracking via notifications, or
508 // 3) both.
509 class PlotTrackerTool : public virtual PlotMouseTool {
510  friend class PlotStandardMouseToolGroup; // Why is this necessary to access
511  // attach() and detach()? >:(
512 
513 public:
514  // Static //
515 
516  // Returns a casacore::String for the given position in the given format, with the
517  // given canvas and axes.
518  static casacore::String formattedString(const casacore::String& format, double x, double y,
519  PlotCanvas* canvas, PlotAxis xAxis, PlotAxis yAxis);
520 
521 
522  // Non-Static //
523 
524  // Constructor which takes the tool's coordinate system.
525  PlotTrackerTool(PlotCoordinate::System sys = PlotCoordinate::WORLD);
526 
527  // Constructor which takes the tool's axes and coordinate system.
528  PlotTrackerTool(PlotAxis xAxis, PlotAxis yAxis,
529  PlotCoordinate::System sys = PlotCoordinate::WORLD);
530 
531  // Destructor.
532  virtual ~PlotTrackerTool();
533 
534  // Adds the given notifier. This object will be notified when the tracker
535  // changes (and a new coordinate is ready for display).
536  virtual void addNotifier(PlotTrackerToolNotifier* notifier);
537 
538  // Returns true if the tracker text is drawn on the canvas, false otherwise.
539  virtual bool drawsText() const;
540 
541  // Sets whether the tracker will draw the text on the canvas or not.
542  virtual void setDrawText(bool draw = true);
543 
544  // Sets the tracker text format to the given. The following tags can be
545  // used in the format:
546  // * %%x%% : x value
547  // * %%y%% : y values
548  // * %%pX%% : sets the precision to X for any following numbers.
549  // NOTICE: if the x or y value is a date, the date format set on the
550  // canvas this tool is attached to will be used to display the value.
551  // Default format is "(%%x%%, %%y%%)".
552  virtual void setFormat(const casacore::String& format);
553 
554  // Returns the formatted tracker text for the given position.
555  virtual casacore::String formattedString(double x, double y) {
556  return formattedString(m_format, x, y, m_canvas, m_xAxis, m_yAxis); }
557 
558  // Returns the annotation used to store the coordinates/text.
559  virtual PlotAnnotationPtr getAnnotation();
560 
561  // Gets the tracker's current position.
562  virtual PlotCoordinate getCoordinate(PlotCoordinate::System =
563  PlotCoordinate::WORLD) const;
564 
565  // Overrides PlotTool::setActive().
566  virtual void setActive(bool active = true);
567 
568  // Implements PlotMouseTool::handleMouseEvent().
569  virtual void handleMouseEvent(const PlotEvent& event);
570 
571  int getSelectedRectCount() const;
572  std::vector<PlotRegion> getSelectedRects() const;
573 
574 protected:
575  // Notifiers.
576  std::vector<PlotTrackerToolNotifier*> m_notifiers;
577 
578  // Annotation that holds current position (even if not drawn on canvas).
579  PlotAnnotationPtr m_annotation;
580 
581  // Whether to draw the annotation or not.
583 
584  // Tracker text format.
586 
587  // Overrides PlotTool::attach().
588  virtual void attach(PlotCanvas* canvas);
589 
590  // Overrides PlotTool::detach().
591  virtual void detach();
592 
593  // Notifies all registered listeners that the tracker has changed.
594  virtual void notifyWatchers();
595 
596 
597  // Static //
598 
599  // casacore::Format constants.
600  // <group>
605  // </group>
606 };
607 INHERITANCE_POINTER(PlotTrackerTool, PlotTrackerToolPtr, PlotMouseTool,
608  PlotMouseToolPtr, PlotTool, PlotToolPtr)
609 
610 
611 // A PlotFlagAllTool is a concrete subclass of PlotMouseTool that handles
612 // one-click data flag functionality.
613 // PlotFlagAllTool is responsible for:
614 // 1) the behavior described above
615 class PlotFlagAllTool : public virtual PlotMouseTool {
616 public:
617  // enum for canvas state
618  enum PPFlagType {
619  PPFLAG_FLAG,
620  PPFLAG_UNFLAG,
621  PPFLAG_NONE
622  };
623 
624  // Constructor which takes the tool's coordinate system.
625  PlotFlagAllTool(PlotCoordinate::System system = PlotCoordinate::WORLD);
626 
627  // Constructor which takes the tool's axes and coordinate system.
628  PlotFlagAllTool(PlotAxis xAxis, PlotAxis yAxis,
629  PlotCoordinate::System system = PlotCoordinate::WORLD);
630 
631  // Destructor.
632  virtual ~PlotFlagAllTool();
633 
634  // Implements PlotMouseTool::handleMouseEvent().
635  virtual void handleMouseEvent(const PlotEvent& event);
636 
637  // Sets the attributes for updating background
638  virtual void setUpdateBackground(bool on = true);
639 
640  // Inquiry if update of background is active
641  virtual bool isUpdateBackgroundActive();
642 
643  // Manipulate mark
644  void clearMark();
645 
646  // Inquiry if it is marked
647  bool isMarkedForFlag() const;
648  bool isMarkedForUnflag() const;
649 
650  // Inquiry if bgcolor is changed
651  bool isBackgroundColorChanged() const;
652 
653  //
654  void setAllFlagged();
655 
656 protected:
657  // boolean flag for whether update of background is active
658  bool m_draw;
659 
660  // boolean flag for background color
662 
663  // boolean flag for whether canvas is marked for flag
664  PlotFlagAllTool::PPFlagType m_marked;
665 
666  // keep default background setting
668 
669 private:
670  // internal methods for shared operations
671  void markAsFlag();
672  void markAsUnflag();
673 
674 };
676  PlotMouseToolPtr, PlotTool, PlotToolPtr)
677 
678 
679 // TOOL NOTIFICATION CLASSES //
682 
683 
684 // Interface for objects that want to be notified when the selection tool
685 // changes.
686 class PlotSelectToolNotifier {
687  friend class PlotSelectTool;
688 
689 public:
690  PlotSelectToolNotifier() { }
691  virtual ~PlotSelectToolNotifier() { }
692 
693 protected:
694  // This method is called AFTER the selection has been added.
695  virtual void notifySelectionAdded(PlotSelectTool& tool) = 0;
696 };
697 
698 
699 // Interface for objects that want to be notified when the zoom tool
700 // changes.
702  friend class PlotZoomTool;
703 
704 public:
706  virtual ~PlotZoomToolNotifier() { }
707 
708 protected:
709  // This method is called AFTER the canvas has been zoomed.
710  virtual void notifyZoomChanged(PlotZoomTool& tool) = 0;
711 };
712 
713 
714 // Interface for objects that want to be notified when the pan tool
715 // changes.
717  friend class PlotPanTool;
718 
719 public:
721  virtual ~PlotPanToolNotifier() { }
722 
723 protected:
724  // This method is called AFTER the canvas has been panned.
725  virtual void notifyPanChanged(PlotPanTool& tool) = 0;
726 };
727 
728 
729 // Interface for objects that want to be notified when the tracker tool
730 // changes.
732  friend class PlotTrackerTool;
733 
734 public:
737 
738 protected:
739  // This method is called AFTER the tracker has been updated.
740  virtual void notifyTrackerChanged(PlotTrackerTool& tool) = 0;
741 };
742 
743 
745 // TOOL GROUP CLASSES //
747 
748 
749 // A PlotMouseToolGroup provides an interface for a group of PlotMouseTools
750 // where only one (or none) is active at a time.
751 class PlotMouseToolGroup : public virtual PlotMouseTool {
752 public:
753  // Constructor for empty group.
754  PlotMouseToolGroup();
755 
756  // Destructor.
757  virtual ~PlotMouseToolGroup();
758 
759  // Returns the number of tools in the group.
760  unsigned int numTools() const;
761 
762  // Returns the tools in the group.
763  std::vector<PlotMouseToolPtr> tools() const;
764 
765  // Adds the given tool to the group and returns its index. If makeActive
766  // is true, the given tool becomes the group's active tool.
767  // Note (dec 2010): used to take 2nd arg, boolean, to make tool active.
768  // This is confusing design. Caller of addTool should just call setActiveTool(tool)
769  // after calling addTool() if it wants the tool to become active.
770  // In practice, source code does not anywhere call addTool with make_active=true.
771  unsigned int addTool(PlotMouseToolPtr tool);
772 
773  // Removes the given tool from the group, and returns true on success.
774  // <group>
775  bool removeTool(PlotMouseToolPtr tool);
776  bool removeTool(unsigned int index) { return removeTool(toolAt(index)); }
777  // </group>
778 
779  // Returns the tool at the given index, or NULL for invalid.
780  PlotMouseToolPtr toolAt(unsigned int index) const;
781 
782  // Returns the index of the given tool, or numTools() for invalid.
783  unsigned int indexOf(PlotMouseToolPtr tool) const;
784 
785  // Returns true if the given tool is in this group, false otherwise.
786  bool containsTool(PlotMouseToolPtr tool) const {
787  return indexOf(tool) < m_tools.size(); }
788 
789  // Returns the currently active tool, or NULL for none.
790  PlotMouseToolPtr activeTool() const { return m_activeTool; }
791 
792  // Sets the active tool to the given. If the given tool is not in the
793  // group it is first added.
794  // Toolcode is optional - meaningful only if tool has double usage, like
795  // Select tool which doubles as the Subtraction tool. Otherwise, just stuff NONE_TOOL
796  // in for that arg.
797  void setActiveTool(PlotMouseToolPtr tool, ToolCode toolcode=NONE_TOOL);
798 
799  // Sets the active tool to the one at the given index.
800  void setActiveTool(unsigned int index, ToolCode c=NONE_TOOL) {
801  setActiveTool(toolAt(index), c);
802  }
803 
804  // Overrides PlotTool::setActive().
805  void setActive(bool isActive = true);
806 
807  // Overrides PlotTool::setBlocking().
808  void setBlocking(bool blocking = true);
809 
810  // Implements PlotMouseTool::handleMouseEvent().
811  void handleMouseEvent(const PlotEvent& event);
812 
813  // Overrides PlotMouseTool's event handling methods.
814  // <group>
815  void handleSelect(const PlotSelectEvent& event);
816  void handleClick(const PlotClickEvent& event);
817  void handleMousePress(const PlotMousePressEvent& event);
818  void handleMouseRelease(const PlotMouseReleaseEvent& event);
819  void handleMouseDrag(const PlotMouseDragEvent& event);
820  void handleMouseMove(const PlotMouseMoveEvent& event);
821  void handleWheel(const PlotWheelEvent& event);
822  // </group>
823 
824  // Overrides PlotTool::getXAxis().
825  PlotAxis getXAxis() const;
826 
827  // Overrides PlotTool::getYAxis().
828  PlotAxis getYAxis() const;
829 
830  // Overrides PlotTool::getCoordinateSystem().
831  PlotCoordinate::System getCoordinateSystem() const;
832 
833  // Overrides PlotTool::lastEventWasHandled().
834  bool lastEventWasHandled() const;
835 
836  // Overrides PlotTool::reset().
837  void reset();
838 
839 protected:
840  // All tools.
841  std::vector<PlotMouseToolPtr> m_tools;
842 
843  // Active tool (or NULL for no active tool).
844  PlotMouseToolPtr m_activeTool;
845 
846  // Overrides PlotTool::attach().
847  virtual void attach(PlotCanvas* canvas);
848 
849  // Overrides PlotTool::detach().
850  virtual void detach();
851 };
852 INHERITANCE_POINTER(PlotMouseToolGroup, PlotMouseToolGroupPtr, PlotMouseTool,
853  PlotMouseToolPtr, PlotTool, PlotToolPtr)
854 
855 
856 // PlotStandardMouseToolGroup is a specialized PlotMouseToolGroup where the
857 // tools in the group are:
858 // 1) select,
859 // 2) zoom, and
860 // 3) pan.
861 // A tracker is also provided that is not in the group so that it can be active
862 // at the same time other tools are active.
863 class PlotStandardMouseToolGroup : public PlotMouseToolGroup {
864 public:
865  // Static //
866 
867  // Non-Static //
868 
869  // Constructor which creates default tools with the given coordinate
870  // system, and sets the active tool to the given.
872  PlotCoordinate::System system = PlotCoordinate::WORLD);
873 
874  // Constructor which creates default tools with the given coordinate
875  // system and axes, and sets the active tool to the given.
878  PlotCoordinate::System system = PlotCoordinate::WORLD);
879 
880  // Constructor which uses the given tools (or creates default tools if the
881  // given ones are invalid), and sets the active tool to the given.
882  PlotStandardMouseToolGroup(PlotSelectToolPtr selectTool,
883  PlotZoomToolPtr zoomTool,
884  PlotPanToolPtr panTool,
885  PlotFlagAllToolPtr flagAllTool,
886  PlotTrackerToolPtr trackerTool,
888 
889  // Destructor.
891 
892  // Gets/sets the active standard tool.
893  // <group>
894  void setActiveTool(ToolCode tool);
895  ToolCode activeToolType() const;
896  // </group>
897 
898  // Provides access to the tracker.
899  // <group>
900  void turnTracker(bool on);
901  bool trackerIsOn() const;
902  void turnTrackerDrawText(bool on);
903  bool trackerDrawsText() const;
904  // </group>
905 
906  int getSelectedRectCount();
907  std::vector<PlotRegion> getSelectedRects();
908  void clearSelectedRects();
909 
910  // methods related to per-panel flag mode
911  void clearMark();
912  bool isMarkedForFlag();
913  bool isMarkedForUnflag();
915  void setAllFlagged();
916 
917  // Provides access to the individual tools. Note: this should be avoided
918  // if possible.
919  // <group>
920  PlotSelectToolPtr selectTool();
921  PlotZoomToolPtr zoomTool();
922  PlotPanToolPtr panTool();
923  PlotFlagAllToolPtr flagAllTool();
924  PlotTrackerToolPtr trackerTool();
925  // </group>
926 
927  // Overrides PlotMouseToolGroup handler methods to give events to the
928  // tracker first.
929  // <group>
930  void handleMouseEvent(const PlotEvent& event) {
931  if(m_tracker->isActive()) m_tracker->handleMouseEvent(event);
933 
934  void handleSelect(const PlotSelectEvent& event) {
935  if(m_tracker->isActive()) m_tracker->handleSelect(event);
937 
938  void handleClick(const PlotClickEvent& event) {
939  if(m_tracker->isActive()) m_tracker->handleClick(event);
941 
943  if(m_tracker->isActive()) m_tracker->handleMousePress(event);
945 
947  if(m_tracker->isActive()) m_tracker->handleMouseRelease(event);
949 
950  void handleMouseDrag(const PlotMouseDragEvent& event) {
951  if(m_tracker->isActive()) m_tracker->handleMouseDrag(event);
953 
954  void handleMouseMove(const PlotMouseMoveEvent& event) {
955  if(m_tracker->isActive()) m_tracker->handleMouseMove(event);
957 
958  void handleWheel(const PlotWheelEvent& event) {
959  if(m_tracker->isActive()) m_tracker->handleWheel(event);
961  // </group>
962 
963 protected:
964  // Overrides PlotMouseToolGroup::attach().
965  void attach(PlotCanvas* canvas);
966 
967  // Overrides PlotMouseToolGroup::detach().
968  void detach();
969 
970 private:
971  // Tracker.
972  PlotTrackerToolPtr m_tracker;
973 };
974 INHERITANCE_POINTER(PlotStandardMouseToolGroup, PlotStandardMouseToolGroupPtr,
975  PlotMouseToolGroup, PlotMouseToolGroupPtr,
976  PlotTool, PlotToolPtr)
977 
978 }
979 
980 #endif /* PLOTTOOL_H_ */
static const casacore::String DEFAULT_FORMAT
Definition: PlotTool.h:604
int getSelectedRectCount() const
void handleMouseRelease(const PlotMouseReleaseEvent &event)
Definition: PlotTool.h:946
PlotCoordinate m_lastCoord
Last coordinate in dragging mode.
Definition: PlotTool.h:481
virtual void setFormat(const casacore::String &format)
Sets the tracker text format to the given.
void setAllFlagged()
std::vector< PlotMouseToolPtr > m_tools
All tools.
Definition: PlotTool.h:841
PlotMouseToolPtr activeTool() const
Returns the currently active tool, or NULL for none.
Definition: PlotTool.h:790
Event for when the user selects a region on a plot canvas with the mouse.
Definition: PlotEvent.h:53
Convenience class for mouse presses.
Definition: PlotEvent.h:139
virtual ~PlotPanTool()
Destructor.
virtual void getSelectedRects(std::vector< double > &upperLeftXs, std::vector< double > &upperLeftYs, std::vector< double > &lowerRightXs, std::vector< double > &lowerRightYs, PlotCoordinate::System system=PlotCoordinate::WORLD) const
ABSTRACT TOOL CLASSES A PlotTool is a higher level event handler for a PlotCanvas The idea is to take common tasks which may require multiple events and put them in one place PlotTools also provide additional functionality in that they can be active and blocking non blocking The PlotCanvas will only send events to active tools
Definition: PlotTool.h:43
bool m_drawText
Whether to draw the annotation or not.
Definition: PlotTool.h:582
bool isMarkedForFlag() const
Inquiry if it is marked.
PlotFlagAllTool::PPFlagType m_marked
boolean flag for whether canvas is marked for flag
Definition: PlotTool.h:664
virtual void attach(PlotCanvas *canvas)
Overrides PlotTool::attach().
bool m_inDraggingMode
Whether we&#39;re in dragging mode or not.
Definition: PlotTool.h:478
PlotAxis getXAxis() const
Overrides PlotTool::getXAxis().
virtual bool drawsText() const
Returns true if the tracker text is drawn on the canvas, false otherwise.
virtual PlotAnnotationPtr getAnnotation()
Returns the annotation used to store the coordinates/text.
bool m_bgcolor_changed
boolean flag for background color
Definition: PlotTool.h:661
virtual void handleMouseRelease(const PlotMouseReleaseEvent &event)
Handle the given event.
Definition: PlotTool.h:195
PlotCoordinate::System m_coordSystem
The tool coordinate system.
Definition: PlotTool.h:133
virtual void setRectLine(PlotLinePtr line)
PlotMouseToolPtr m_activeTool
Active tool (or NULL for no active tool).
Definition: PlotTool.h:844
A PlotMouseTool is a specialization of PlotTool that handles all mouse events.
Definition: PlotTool.h:165
virtual void reset()
Overrides PlotTool::reset().
std::vector< PlotSelectToolNotifier * > m_notifiers
Notifiers.
Definition: PlotTool.h:316
PlotPanToolPtr panTool()
PlotTrackerToolPtr trackerTool()
PlotLinePtr m_selLine
Copy of selection line to set on the canvas, or NULL if none has been set.
Definition: PlotTool.h:320
virtual ~PlotFlagAllTool()
Destructor.
virtual void handleClick(const PlotClickEvent &event)
Handle the given event.
Definition: PlotTool.h:191
virtual ~PlotZoomToolNotifier()
Definition: PlotTool.h:706
void clearSelectedRects()
virtual ~PlotSelectTool()
Destructor.
friend class PlotTrackerTool
Definition: PlotTool.h:732
virtual void handleSelect(const PlotSelectEvent &event)
Event handling methods.
Definition: PlotTool.h:189
virtual void setDrawText(bool draw=true)
Sets whether the tracker will draw the text on the canvas or not.
virtual void setSubtractLine(PlotLinePtr line)
Base class for a handler for PlotSelectEvent.
TOOL GROUP CLASSES A PlotMouseToolGroup provides an interface for a group of PlotMouseTools where only virtual one(or none) is active at a time.*/class PlotMouseToolGroup ~PlotMouseToolGroup()
Constructor for empty group.
Convenience class for mouse moves.
Definition: PlotEvent.h:169
virtual ~PlotZoomTool()
Destructor.
virtual bool isAttached() const
Returns true if this tool is attached to a canvas, false otherwise.
virtual void handleMouseEvent(const PlotEvent &event)
Implements PlotMouseTool::handleMouseEvent().
Definition: PlotTool.h:930
void setBlocking(bool blocking=true)
Overrides PlotTool::setBlocking().
PlotTrackerToolPtr m_tracker
Tracker.
Definition: PlotTool.h:972
Base class for a handler for PlotClickEvent.
virtual PlotCoordinate getCoordinate(PlotCoordinate::System=PlotCoordinate::WORLD) const
Gets the tracker&#39;s current position.
virtual void detach()
Detaches this tool from its canvas.
bool m_blocking
Whether this tool is blocking.
Definition: PlotTool.h:127
virtual void notifyTrackerChanged(PlotTrackerTool &tool)=0
This method is called AFTER the tracker has been updated.
virtual PlotAxis getYAxis() const
Event for when the user scrolls the scroll wheel.
Definition: PlotEvent.h:183
virtual void clearSelectedRects()
The idea behind a plot factory is to produce classes that are useful to the underlying implementation...
Definition: PlotFactory.h:52
Convenience class for mouse clicks.
Definition: PlotEvent.h:129
virtual void detach()
Overrides PlotTool::detach().
static const casacore::String FORMAT_DIVIDER
Static //.
Definition: PlotTool.h:601
INHERITANCE_POINTER(PlotZoomTool, PlotZoomToolPtr, PlotMouseTool, PlotMouseToolPtr, PlotTool, PlotToolPtr) class PlotPanTool PlotPanTool(PlotAxis xAxis, PlotAxis yAxis, PlotCoordinate::System sys=PlotCoordinate::WORLD)
A PlotPanTool is a concrete subclass of PlotMouseTool that provides convenient panning functionality...
virtual void setActive(bool active=true)
Overrides PlotTool::setActive().
PlotMouseTool(PlotAxis xAxis, PlotAxis yAxis, PlotCoordinate::System coordSys=PlotCoordinate::WORLD)
Constructor which takes the tool&#39;s axes and coordinate system.
Definition: PlotTool.h:179
virtual void handleMouseEvent(const PlotEvent &event)=0
ABSTRACT METHODS //.
Base class for a handler for PlotMouseReleaseEvent.
bool trackerIsOn() const
unsigned int addTool(PlotMouseToolPtr tool)
Adds the given tool to the group and returns its index.
unsigned int numTools() const
Returns the number of tools in the group.
PlotFlagAllToolPtr flagAllTool()
virtual bool isBlocking() const
Returns whether this tool is blocking or not.
virtual void reset()
Resets any internal state such as history/stacks.
Definition: PlotTool.h:112
void markAsFlag()
internal methods for shared operations
virtual PlotCoordinate::System getCoordinateSystem() const
Gets the coordinate system in which the tool wants to process events.
Interface for objects that want to be notified when the tracker tool changes.
Definition: PlotTool.h:731
static casacore::String formattedString(const casacore::String &format, double x, double y, PlotCanvas *canvas, PlotAxis xAxis, PlotAxis yAxis)
A PlotTrackerTool is a concrete subclass of PlotMouseTool that provides convenient tracker functional...
Interface for objects that want to be notified when the zoom tool changes.
Definition: PlotTool.h:701
A PlotSelectTool is a concrete subclass of PlotMouseTool that mainly handles select events...
Definition: PlotTool.h:255
Base class for a handler for a PlotMouseMoveEvent.
void handleMouseMove(const PlotMouseMoveEvent &event)
Definition: PlotTool.h:954
Base class for a handler for PlotMouseDragEvent.
virtual PlotAxis getXAxis() const
Gets the axes on which the tool operates.
PlotMouseTool(PlotCoordinate::System coordSys=PlotCoordinate::WORLD)
Constructor which takes the tool&#39;s coordinate system.
Definition: PlotTool.h:175
virtual void addNotifier(PlotZoomToolNotifier *notifier)
Adds the given notifier.
Referenced counted pointer for constant data.
Definition: VisModelData.h:42
PlotZoomToolPtr zoomTool()
virtual std::vector< PlotRegion > getZoomStack(PlotCoordinate::System sytem=PlotCoordinate::WORLD) const
Gets the zoom stack.
std::vector< PlotZoomToolNotifier * > m_notifiers
Notifiers.
Definition: PlotTool.h:407
Base class for an event.
Definition: PlotEvent.h:41
virtual void handleMouseMove(const PlotMouseMoveEvent &event)
Handle the given event.
Definition: PlotTool.h:199
virtual int getSelectedRectCount()
void turnTrackerDrawText(bool on)
PlotAxesStack * m_stack
Common canvas stack.
Definition: PlotTool.h:413
void clearMark()
Manipulate mark.
virtual void notifyPanChanged(PlotPanTool &tool)=0
This method is called AFTER the canvas has been panned.
A PlotAxesStack is basically a list of PlotRegions as well as axis information that provides stack fu...
Definition: PlotOptions.h:735
PlotAxis m_xAxis
The tool axes.
Definition: PlotTool.h:130
PlotFactory * m_factory
Factory for creating implementation-specific objects.
Definition: PlotTool.h:121
virtual void setSelectLine(PlotLinePtr line)
Sets the selection line to the given.
virtual void handleMouseEvent(const PlotEvent &event)
Implements PlotMouseTool::handleMouseEvent().
bool isMarkedForUnflag() const
virtual bool isActive() const
Returns whether this tool is currently active or not.
PlotLinePtr m_rectLine
Line for drawing selected regions, or NULL if none has been set.
Definition: PlotTool.h:327
void markAsUnflag()
PlotAreaFillPtr m_rectFill
Area fill for drawing selected regions, or NULL if none has been set.
Definition: PlotTool.h:330
std::vector< PlotRegion > getSelectedRects() const
Convenience class for mouse drags.
Definition: PlotEvent.h:159
INHERITANCE_POINTER(PlotTrackerTool, PlotTrackerToolPtr, PlotMouseTool, PlotMouseToolPtr, PlotTool, PlotToolPtr) class PlotFlagAllTool PlotFlagAllTool(PlotCoordinate::System system=PlotCoordinate::WORLD)
A PlotFlagAllTool is a concrete subclass of PlotMouseTool that handles one-click data flag functional...
PlotMouseToolPtr toolAt(unsigned int index) const
Returns the tool at the given index, or NULL for invalid.
virtual ~PlotTool()
Destructor.
virtual ~PlotTrackerTool()
Destructor.
virtual ~PlotMouseTool()
Destructor.
Definition: PlotTool.h:184
PlotAxis
Enum for the four plot axes.
Definition: PlotOptions.h:62
bool m_draw
boolean flag for whether update of background is active
Definition: PlotTool.h:658
virtual void setActive(bool isActive=true)
Sets whether this tool is currently active or not.
PlotLinePtr m_subLine
Definition: PlotTool.h:321
Interface for objects that want to be notified when the pan tool changes.
Definition: PlotTool.h:716
friend class PlotPanTool
Definition: PlotTool.h:717
virtual void setActive(bool active=true)
Overrides PlotTool::setActive().
std::vector< PlotShapeRectanglePtr > m_rects
Selected regions.
Definition: PlotTool.h:333
CONCRETE TOOL CLASSES Was in PlotStandardMouseToolGroup
Definition: PlotTool.h:228
PlotSelectTool(PlotCoordinate::System system=PlotCoordinate::WORLD)
Constructor which takes the tool&#39;s coordinate system.
bool m_lastEventHandled
Last event handled flag.
Definition: PlotTool.h:136
bool trackerDrawsText() const
virtual void addNotifier(PlotSelectToolNotifier *notifier)
Adds the given notifier.
PlotSelectToolPtr selectTool()
Provides access to the individual tools.
bool containsTool(PlotMouseToolPtr tool) const
Returns true if the given tool is in this group, false otherwise.
Definition: PlotTool.h:786
virtual PlotCanvas * canvas() const
Returns the canvas this tool is attached to, or NULL for none.
Base class for a handler for PlotMousePressEvent.
INHERITANCE_POINTER2(PlotLayoutSingle, PlotLayoutSinglePtr, PlotCanvasLayout, PlotCanvasLayoutPtr) INHERITANCE_POINTER2(PlotLayoutGrid
virtual void notifyZoomChanged(PlotZoomTool &tool)=0
This method is called AFTER the canvas has been zoomed.
casacore::CountedPtr< PlotTool > PlotToolPtr
Definition: PlotTool.h:157
INHERITANCE_POINTER(PlotSelectTool, PlotSelectToolPtr, PlotMouseTool, PlotMouseToolPtr, PlotTool, PlotToolPtr) class PlotZoomTool PlotZoomTool(PlotAxis xAxis, PlotAxis yAxis, PlotCoordinate::System sys=PlotCoordinate::WORLD)
A PlotZoomTool is a concrete subclass of PlotMouseTool that provides convenient zooming functionality...
static const casacore::String FORMAT_X
Definition: PlotTool.h:602
PlotCanvas is an area for different PlotItems to be attached and drawn.
Definition: PlotCanvas.h:83
PlotAnnotationPtr m_annotation
Annotation that holds current position (even if not drawn on canvas).
Definition: PlotTool.h:579
casacore::String m_format
Tracker text format.
Definition: PlotTool.h:585
virtual void setBlocking(bool blocking=true)
Sets whether this tool is blocking or not.
bool removeTool(PlotMouseToolPtr tool)
Removes the given tool from the group, and returns true on success.
virtual bool isUpdateBackgroundActive()
Inquiry if update of background is active.
virtual void handleMousePress(const PlotMousePressEvent &event)
Handle the given event.
Definition: PlotTool.h:193
PlotTrackerTool(PlotCoordinate::System sys=PlotCoordinate::WORLD)
Non-Static //.
ToolCode activeToolType() const
unsigned int indexOf(PlotMouseToolPtr tool) const
Returns the index of the given tool, or numTools() for invalid.
PlotAxis getYAxis() const
Overrides PlotTool::getYAxis().
const Double c
Fundamental physical constants (SI units):
void turnTracker(bool on)
Provides access to the tracker.
virtual void setRectFill(PlotAreaFillPtr fill)
PlotTool(PlotCoordinate::System sys=PlotCoordinate::WORLD)
Constructor which takes which coordinate system events should be processed in.
virtual bool lastEventWasHandled() const
Returns whether the last event was handled or not.
PlotAreaFillPtr m_defaultBackground
keep default background setting
Definition: PlotTool.h:667
bool m_drawRects
Whether or not to draw selected regions on the canvas.
Definition: PlotTool.h:324
virtual void attach(PlotCanvas *canvas)
Attaches this tool to the given canvas.
PlotLinePtr m_selLine
Copy of canvas selection line, or NULL if none has been set.
Definition: PlotTool.h:410
friend class PlotZoomTool
Definition: PlotTool.h:702
PlotCanvas * m_canvas
Attached canvas (or NULL for none).
Definition: PlotTool.h:118
String: the storage and methods of handling collections of characters.
Definition: String.h:223
void handleClick(const PlotClickEvent &event)
Definition: PlotTool.h:938
Base class for a handler for PlotWheelEvent.
static const casacore::String FORMAT_Y
Definition: PlotTool.h:602
virtual void attach(PlotCanvas *canvas)
Overrides PlotTool::attach().
bool m_active
Whether this tool is active.
Definition: PlotTool.h:124
~PlotStandardMouseToolGroup()
Destructor.
virtual void handleMouseDrag(const PlotMouseDragEvent &event)
Handle the given event.
Definition: PlotTool.h:197
virtual unsigned int getStackIndex() const
Gets the zoom stack index.
void handleWheel(const PlotWheelEvent &event)
Definition: PlotTool.h:958
bool lastEventWasHandled() const
Overrides PlotTool::lastEventWasHandled().
virtual ~PlotPanToolNotifier()
Definition: PlotTool.h:721
virtual void notifyWatchers()
Notifies all registered listeners that the zoom has changed.
PlotAxis m_yAxis
Definition: PlotTool.h:130
static const casacore::String FORMAT_PRECISION
Definition: PlotTool.h:603
virtual void setUpdateBackground(bool on=true)
Sets the attributes for updating background.
INHERITANCE_POINTER(PlotFlagAllTool, PlotFlagAllToolPtr, PlotMouseTool, PlotMouseToolPtr, PlotTool, PlotToolPtr) TOOL NOTIFICATION CLASSESInterface for objects that want to be notified when the selection tool changes.*/class PlotSelectToolNotifier
Definition: PlotTool.h:675
bool inSubtractionMode()
Definition: PlotTool.h:307
CONCRETE TOOL CLASSES Was in but needed so it can be passed to setActiveTool
Definition: PlotTool.h:228
bool isBackgroundColorChanged() const
Inquiry if bgcolor is changed.
virtual void detach()
Overrides PlotTool::detach().
void handleMousePress(const PlotMousePressEvent &event)
Definition: PlotTool.h:942
ToolCode
Definition: PlotTool.h:233
PlotCoordinate::System getCoordinateSystem() const
Overrides PlotTool::getCoordinateSystem().
void handleSelect(const PlotSelectEvent &event)
Overrides PlotMouseTool&#39;s event handling methods.
Definition: PlotTool.h:934
Convenience class for mouse releases.
Definition: PlotEvent.h:149
friend class PlotMouseToolGroup
Definition: PlotTool.h:65
virtual unsigned int numSelectedRects() const
Selected regions.
virtual PlotFactory * factory() const
Returns a factory that can be used for generating implementation-specific classes, or NULL for none.
virtual std::vector< PlotRegion > getPanStack(PlotCoordinate::System system=PlotCoordinate::WORLD) const
Gets the pan stack.
void handleMouseDrag(const PlotMouseDragEvent &event)
Definition: PlotTool.h:950
virtual ~PlotTrackerToolNotifier()
Definition: PlotTool.h:736
virtual void setDrawRects(bool on=true)
Sets the attributes for drawing selected regions.
virtual void handleWheel(const PlotWheelEvent &event)
Handle the given event.
Definition: PlotTool.h:201
virtual void setSelectLine(PlotLinePtr line)
Sets the selection line to the given.