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