// to setActiveTool, which needs it to adjust the Select tool to either work
// normal or as Subtraction tool.
// Enum for standard tools in group.
// A PlotSelectTool is a concrete subclass of PlotMouseTool that mainly handles
// select events. Note that plotting implementations may wish to override
// this class with an implementation-specific version that may be more
PlotFlagAllTool::PPFlagType m_marked;
// keep default background setting
PlotAreaFillPtr m_defaultBackground;
INHERITANCE_POINTER(PlotFlagAllTool, PlotFlagAllToolPtr, PlotMouseTool,
PlotMouseToolPtr, PlotTool, PlotToolPtr)
// A PlotUnflagAllTool is a concrete subclass of PlotMouseTool that handles
// one-click data unflag functionality.
// PlotUnflagAllTool is responsible for:
// 1) the behavior described above
class PlotUnflagAllTool : public virtual PlotMouseTool {
// Constructor which takes the tool's coordinate system.
PlotUnflagAllTool(PlotCoordinate::System system = PlotCoordinate::WORLD);
// Constructor which takes the tool's axes and coordinate system.
PlotUnflagAllTool(PlotAxis xAxis, PlotAxis yAxis,
PlotCoordinate::System system = PlotCoordinate::WORLD);
virtual ~PlotUnflagAllTool();
// Implements PlotMouseTool::handleMouseEvent().
virtual void handleMouseEvent(const PlotEvent& event);
INHERITANCE_POINTER(PlotUnflagAllTool, PlotUnflagAllToolPtr, PlotMouseTool,
PlotMouseToolPtr, PlotTool, PlotToolPtr)
///////////////////////////////
// TOOL NOTIFICATION CLASSES //
///////////////////////////////
// Interface for objects that want to be notified when the selection tool
class PlotSelectToolNotifier {
friend class PlotSelectTool;
PlotStandardMouseToolGroup(PlotAxis xAxis, PlotAxis yAxis,
ToolCode activeTool = NONE_TOOL,
PlotCoordinate::System system = PlotCoordinate::WORLD);
// Constructor which uses the given tools (or creates default tools if the
// given ones are invalid), and sets the active tool to the given.
PlotStandardMouseToolGroup(PlotSelectToolPtr selectTool,
PlotZoomToolPtr zoomTool,
PlotFlagAllToolPtr flagAllTool,
PlotUnflagAllToolPtr unflagAllTool,
PlotTrackerToolPtr trackerTool,
ToolCode activeTool = NONE_TOOL);
~PlotStandardMouseToolGroup();
// Gets/sets the active standard tool.
void setActiveTool(ToolCode tool);
ToolCode activeToolType() const;
bool isBackgroundColorChanged();
// Provides access to the individual tools. Note: this should be avoided
PlotSelectToolPtr selectTool();
PlotZoomToolPtr zoomTool();
PlotPanToolPtr panTool();
PlotFlagAllToolPtr flagAllTool();
PlotUnflagAllToolPtr unflagAllTool();
PlotTrackerToolPtr trackerTool();
// Overrides PlotMouseToolGroup handler methods to give events to the
void handleMouseEvent(const PlotEvent& event) {
if(m_tracker->isActive()) m_tracker->handleMouseEvent(event);
PlotMouseToolGroup::handleMouseEvent(event); }