tomwalters@116: // Copyright 2006, Willem van Engen tomwalters@116: // tomwalters@116: // AIM-C: A C++ implementation of the Auditory Image Model tomwalters@116: // http://www.acousticscale.org/AIMC tomwalters@116: // tomwalters@116: // Licensed under the Apache License, Version 2.0 (the "License"); tomwalters@116: // you may not use this file except in compliance with the License. tomwalters@116: // You may obtain a copy of the License at tomwalters@116: // tomwalters@116: // http://www.apache.org/licenses/LICENSE-2.0 tomwalters@116: // tomwalters@116: // Unless required by applicable law or agreed to in writing, software tomwalters@116: // distributed under the License is distributed on an "AS IS" BASIS, tomwalters@116: // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. tomwalters@116: // See the License for the specific language governing permissions and tomwalters@116: // limitations under the License. tomwalters@116: tomwalters@116: #ifndef __GRAPH_AXIS_SPEC_H__ tomwalters@116: #define __GRAPH_AXIS_SPEC_H__ tomwalters@116: tomwalters@116: #include "Support/Parameters.h" tomwalters@116: #include "Modules/Output/Graphics/Scale/Scale.h" tomwalters@116: tom@229: namespace aimc { tom@229: tomwalters@116: /*! \class GraphAxisSpec "Output/GraphAxisSpec.h" tomwalters@116: * \brief Axis specification for a GraphicsView tomwalters@116: */ tomwalters@116: class GraphAxisSpec { tomwalters@116: public: tomwalters@228: /*! \brief Create a new GraphAxisSpec tomwalters@228: * \param fMin Minimum value on the axis to show tomwalters@228: * \param fMax Maximum value on the axis to show tomwalters@228: * \param iScale Scale to use tomwalters@228: * tomwalters@228: * Please see SetScale() and SetRange() for more details. tomwalters@228: */ tomwalters@228: GraphAxisSpec(float fMin, float fMax, Scale::ScaleType iScale); tomwalters@228: //! \brief Create a new GraphAxisSpec from defaults tomwalters@228: GraphAxisSpec(); tomwalters@116: tomwalters@228: ~GraphAxisSpec(); tomwalters@116: tomwalters@228: /*! \brief Set the scale to use tomwalters@228: * \param iScale Scale to use tomwalters@228: */ tomwalters@228: void SetDisplayScale(Scale::ScaleType iScale); tomwalters@228: /*! \brief Set the minumum and maximum values to show on the axis tomwalters@228: * \param fMin Minimum value on the axis to show tomwalters@228: * \param fMax Maximum value on the axis to show tomwalters@228: * tomwalters@228: * Either fMin _must_ be smaller than fMax, or fMin==fMax but then tomwalters@228: * this function must be called later to fulfil the former condition tomwalters@228: * before it is used to scale data. tomwalters@228: */ tomwalters@228: void SetDisplayRange(float fMin, float fMax); tomwalters@228: /*! \brief Set the label of this axis tomwalters@228: * \param sLabel New label, or NULL to remove label tomwalters@228: */ tomwalters@228: void SetLabel(const char *sLabel); tomwalters@116: tomwalters@228: /*! \brief Read axis specification from parameter store tomwalters@228: * \param pParam Parameter store to read from tomwalters@228: * \param sPrefix Prefix to use, e.g. "view.x" tomwalters@228: * \param fMin Default minumum value for 'auto' tomwalters@228: * \param fMax Default maximum value for 'auto' tomwalters@228: * \param iScale Default scale for 'auto' tomwalters@228: * \return true if no error occured in reading tomwalters@228: */ tomwalters@228: bool Initialize(Parameters *pParam, tomwalters@116: const char *sPrefix, tomwalters@116: float fMin, tomwalters@116: float fMax, tomwalters@116: Scale::ScaleType iScale); tomwalters@116: tomwalters@116: protected: tomwalters@228: //! \brief Minimum value on the axis to display tomwalters@228: float m_fMin; tomwalters@228: //! \brief Maximum value on the axis to display tomwalters@228: float m_fMax; tomwalters@228: //! \brief Scale to use tomwalters@228: Scale *m_pScale; tomwalters@228: //! \brief Axis label, NULL for no label tomwalters@228: const char *m_sLabel; tomwalters@116: tomwalters@228: friend class GraphicsView; tomwalters@228: friend class GraphicsViewTime; tomwalters@116: }; tomwalters@116: tom@229: } // namespace aimc tom@229: tomwalters@116: #endif /* __GRAPH_AXIS_SPEC_H__ */