00001 /* 00002 * The information in this file is 00003 * Copyright(c) 2007 Ball Aerospace & Technologies Corporation 00004 * and is subject to the terms and conditions of the 00005 * GNU Lesser General Public License Version 2.1 00006 * The license text is available from 00007 * http://www.gnu.org/licenses/lgpl.html 00008 */ 00009 00010 #ifndef CARTESIANPLOT_H 00011 #define CARTESIANPLOT_H 00012 00013 #include "PlotView.h" 00014 #include "TypesFile.h" 00015 00016 class CartesianGridlines; 00017 00018 /** 00019 * A two-dimensional Cartesian plot. 00020 * 00021 * A Cartesian plot can display either a linear scale or a log scale on either 00022 * the x-axis, the y-axis, or both. 00023 * 00024 * This subclass of Subject will notify upon the following conditions: 00025 * - The following methods are called: setXScaleType(), setYScaleType(), 00026 * setXDataType(), setYDataType(). 00027 * - Everything documented in PlotView. 00028 * 00029 * @see PlotView 00030 */ 00031 class CartesianPlot : public PlotView 00032 { 00033 public: 00034 /** 00035 * Emitted with any<ScaleType> when the X scale type changes. 00036 */ 00037 SIGNAL_METHOD(CartesianPlot, XScaleTypeChanged); 00038 00039 /** 00040 * Emitted with any<ScaleType> when the Y scale type changes. 00041 */ 00042 SIGNAL_METHOD(CartesianPlot, YScaleTypeChanged); 00043 00044 /** 00045 * Emitted with any<std::string> when the X data type changes. 00046 */ 00047 SIGNAL_METHOD(CartesianPlot, XDataTypeChanged); 00048 00049 /** 00050 * Emitted with any<std::string> when the Y data type changes. 00051 */ 00052 SIGNAL_METHOD(CartesianPlot, YDataTypeChanged); 00053 00054 /** 00055 * @copydoc SessionItem::getContextMenuActions() 00056 * 00057 * @default The default implementation returns the context menu actions 00058 * listed \ref cartesianplot "here". The default actions can be 00059 * removed or additional actions can be added by attaching to the 00060 * signalAboutToShowContextMenu() signal. 00061 */ 00062 virtual std::list<ContextMenuAction> getContextMenuActions() const = 0; 00063 00064 /** 00065 * Returns a pointer to the plot's horizontal or vertical gridlines. 00066 * 00067 * @param orientation 00068 * The orientation of the gridlines to get. 00069 * 00070 * @return A pointer to the plot's horizontal or vertical gridlines 00071 * object. 00072 */ 00073 virtual CartesianGridlines* getGridlines(OrientationType orientation) = 0; 00074 00075 /** 00076 * Returns read-only access to the plot's horizontal or vertical gridlines. 00077 * 00078 * @param orientation 00079 * The orientation of the gridlines to get. 00080 * 00081 * @return A const pointer to the plot's horizontal or vertical gridlines 00082 * object. The plot object represented by the returned pointer 00083 * should not be modified. To modify the values, call the 00084 * non-const version of getGridlines(OrientationType). 00085 */ 00086 virtual const CartesianGridlines* getGridlines(OrientationType orientation) const = 0; 00087 00088 /** 00089 * Sets the scale type of the x-axis. 00090 * 00091 * @param scaleType 00092 * The new x-axis scale type. 00093 * 00094 * @notify This method notifies signalXScaleTypeChanged() if the given 00095 * scale type is different than the current scale type. 00096 */ 00097 virtual void setXScaleType(ScaleType scaleType) = 0; 00098 00099 /** 00100 * Sets the scale type of the y-axis. 00101 * 00102 * @param scaleType 00103 * The new y-axis scale type. 00104 * 00105 * @notify This method notifies signalYScaleTypeChanged() if the given 00106 * scale type is different than the current scale type. 00107 */ 00108 virtual void setYScaleType(ScaleType scaleType) = 0; 00109 00110 /** 00111 * Returns the scale type of the x-axis. 00112 * 00113 * @return The x-axis scale type. 00114 */ 00115 virtual ScaleType getXScaleType() const = 0; 00116 00117 /** 00118 * Returns the scale type of the y-axis. 00119 * 00120 * @return The y-axis scale type. 00121 */ 00122 virtual ScaleType getYScaleType() const = 0; 00123 00124 /** 00125 * Sets the data type of the x-axis. 00126 * 00127 * The data type is an optional string that can be set to describe the data 00128 * that is plotted along the x-axis. If the plot is contained in a 00129 * PlotWidget, the data type is used as the axis text. 00130 * 00131 * @param dataType 00132 * The x-axis data type. An empty string indicates that no data 00133 * type is associated or known. 00134 * 00135 * @notify This method notifies signalXDataTypeChanged() if the given data 00136 * type is different than the current data type. 00137 */ 00138 virtual void setXDataType(const std::string& dataType) = 0; 00139 00140 /** 00141 * Sets the data type of the y-axis. 00142 * 00143 * The data type is an optional string that can be set to describe the data 00144 * that is plotted along the y-axis. If the plot is contained in a 00145 * PlotWidget, the data type is used as the axis text. 00146 * 00147 * @param dataType 00148 * The y-axis data type. An empty string indicates that no data 00149 * type is associated or known. 00150 * 00151 * @notify This method notifies signalYDataTypeChanged() if the given data 00152 * type is different than the current data type. 00153 */ 00154 virtual void setYDataType(const std::string& dataType) = 0; 00155 00156 /** 00157 * Returns the data type of the x-axis. 00158 * 00159 * @return The x-axis data type. An empty string indicates that no data 00160 * type has been set. 00161 * 00162 * @see setXDataType() 00163 */ 00164 virtual std::string getXDataType() const = 0; 00165 00166 /** 00167 * Returns the data type of the y-axis. 00168 * 00169 * @return The y-axis data type. An empty string indicates that no data 00170 * type has been set. 00171 * 00172 * @see setYDataType() 00173 */ 00174 virtual std::string getYDataType() const = 0; 00175 00176 protected: 00177 /** 00178 * This object should be destroyed by calling DesktopServices::deleteView(). 00179 */ 00180 virtual ~CartesianPlot() {} 00181 }; 00182 00183 #endif