Source
static casacore::String formattedString(const casacore::String& format, double x, double y,
//# PlotTool.h: Tool class definitions (higher-level event handlers).
//# Copyright (C) 2008
//# Associated Universities, Inc. Washington DC, USA.
//#
//# This library is free software; you can redistribute it and/or modify it
//# under the terms of the GNU Library General Public License as published by
//# the Free Software Foundation; either version 2 of the License, or (at your
//# option) any later version.
//#
//# This library is distributed in the hope that it will be useful, but WITHOUT
//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
//# License for more details.
//#
//# You should have received a copy of the GNU Library General Public License
//# along with this library; if not, write to the Free Software Foundation,
//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
//#
//# Correspondence concerning AIPS++ should be addressed as follows:
//# Internet email: aips2-request@nrao.edu.
//# Postal address: AIPS++ Project Office
//# National Radio Astronomy Observatory
//# 520 Edgemont Road
//# Charlottesville, VA 22903-2475 USA
//#
//# $Id: $
namespace casa {
//# Forward Declarations
class PlotCanvas;
class PlotFactory;
class PlotPanToolNotifier;
class PlotSelectToolNotifier;
class PlotTrackerToolNotifier;
class PlotZoomToolNotifier;
///////////////////////////
// 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
// 1) active/inactive, and 2) blocking/non-blocking. The PlotCanvas will only
// send events to active tools, and will not send events to later tools or
// event handlers if the latest tool was blocking. In this way a single tool
// can be used to handle ALL user interaction via the GUI at one time, if
// desired. The PlotTool class itself is abstract and deliberately non-binding
// as it is mainly meant for specialization in its children classes. PlotTools
// can also specify which coordinate system and two axes they work on, and the
// PlotCanvas is expected to obey these constraints.
class PlotTool {
friend class PlotCanvas;
friend class PlotMouseToolGroup;
public:
// Constructor which takes which coordinate system events should be
// processed in.
PlotTool(PlotCoordinate::System sys = PlotCoordinate::WORLD);
// Constructor which takes the two axes and the coordinate system which
// events should be processed in.
PlotTool(PlotAxis xAxis, PlotAxis yAxis,
PlotCoordinate::System sys = PlotCoordinate::WORLD);
// Destructor.
virtual ~PlotTool();
// Returns whether this tool is currently active or not.
virtual bool isActive() const;
// Sets whether this tool is currently active or not.
virtual void setActive(bool isActive = true);
// Returns whether this tool is blocking or not. When a PlotCanvas
// encounters a blocking tool, it is expected to not send events to any
// other handlers further in the chain.
virtual bool isBlocking() const;