annotate src/Modules/Output/Graphics/GraphAxisSpec.h @ 116:47b009f2c936

- First add of a lot of graphics code from the old version. Not working yet, not even compiling yet.
author tomwalters
date Fri, 15 Oct 2010 05:40:53 +0000
parents
children c5ac2f0c7fc5
rev   line source
tomwalters@116 1 // Copyright 2006, Willem van Engen
tomwalters@116 2 //
tomwalters@116 3 // AIM-C: A C++ implementation of the Auditory Image Model
tomwalters@116 4 // http://www.acousticscale.org/AIMC
tomwalters@116 5 //
tomwalters@116 6 // Licensed under the Apache License, Version 2.0 (the "License");
tomwalters@116 7 // you may not use this file except in compliance with the License.
tomwalters@116 8 // You may obtain a copy of the License at
tomwalters@116 9 //
tomwalters@116 10 // http://www.apache.org/licenses/LICENSE-2.0
tomwalters@116 11 //
tomwalters@116 12 // Unless required by applicable law or agreed to in writing, software
tomwalters@116 13 // distributed under the License is distributed on an "AS IS" BASIS,
tomwalters@116 14 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
tomwalters@116 15 // See the License for the specific language governing permissions and
tomwalters@116 16 // limitations under the License.
tomwalters@116 17
tomwalters@116 18 #ifndef __GRAPH_AXIS_SPEC_H__
tomwalters@116 19 #define __GRAPH_AXIS_SPEC_H__
tomwalters@116 20
tomwalters@116 21 #include "Support/Parameters.h"
tomwalters@116 22 #include "Modules/Output/Graphics/Scale/Scale.h"
tomwalters@116 23
tomwalters@116 24 /*! \class GraphAxisSpec "Output/GraphAxisSpec.h"
tomwalters@116 25 * \brief Axis specification for a GraphicsView
tomwalters@116 26 */
tomwalters@116 27 class GraphAxisSpec {
tomwalters@116 28 public:
tomwalters@116 29 /*! \brief Create a new GraphAxisSpec
tomwalters@116 30 * \param fMin Minimum value on the axis to show
tomwalters@116 31 * \param fMax Maximum value on the axis to show
tomwalters@116 32 * \param iScale Scale to use
tomwalters@116 33 *
tomwalters@116 34 * Please see SetScale() and SetRange() for more details.
tomwalters@116 35 */
tomwalters@116 36 GraphAxisSpec(float fMin, float fMax, Scale::ScaleType iScale);
tomwalters@116 37 //! \brief Create a new GraphAxisSpec from defaults
tomwalters@116 38 GraphAxisSpec();
tomwalters@116 39
tomwalters@116 40 ~GraphAxisSpec();
tomwalters@116 41
tomwalters@116 42 /*! \brief Set the scale to use
tomwalters@116 43 * \param iScale Scale to use
tomwalters@116 44 */
tomwalters@116 45 void SetDisplayScale(Scale::ScaleType iScale);
tomwalters@116 46 /*! \brief Set the minumum and maximum values to show on the axis
tomwalters@116 47 * \param fMin Minimum value on the axis to show
tomwalters@116 48 * \param fMax Maximum value on the axis to show
tomwalters@116 49 *
tomwalters@116 50 * Either fMin _must_ be smaller than fMax, or fMin==fMax but then
tomwalters@116 51 * this function must be called later to fulfil the former condition
tomwalters@116 52 * before it is used to scale data.
tomwalters@116 53 */
tomwalters@116 54 void SetDisplayRange(float fMin, float fMax);
tomwalters@116 55 /*! \brief Set the label of this axis
tomwalters@116 56 * \param sLabel New label, or NULL to remove label
tomwalters@116 57 */
tomwalters@116 58 void SetLabel(const char *sLabel);
tomwalters@116 59
tomwalters@116 60 /*! \brief Read axis specification from parameter store
tomwalters@116 61 * \param pParam Parameter store to read from
tomwalters@116 62 * \param sPrefix Prefix to use, e.g. "view.x"
tomwalters@116 63 * \param fMin Default minumum value for 'auto'
tomwalters@116 64 * \param fMax Default maximum value for 'auto'
tomwalters@116 65 * \param iScale Default scale for 'auto'
tomwalters@116 66 * \return true if no error occured in reading
tomwalters@116 67 */
tomwalters@116 68 bool Initialize(Parameters *pParam,
tomwalters@116 69 const char *sPrefix,
tomwalters@116 70 float fMin,
tomwalters@116 71 float fMax,
tomwalters@116 72 Scale::ScaleType iScale);
tomwalters@116 73
tomwalters@116 74 protected:
tomwalters@116 75 //! \brief Minimum value on the axis to display
tomwalters@116 76 float m_fMin;
tomwalters@116 77 //! \brief Maximum value on the axis to display
tomwalters@116 78 float m_fMax;
tomwalters@116 79 //! \brief Scale to use
tomwalters@116 80 Scale *m_pScale;
tomwalters@116 81 //! \brief Axis label, NULL for no label
tomwalters@116 82 const char *m_sLabel;
tomwalters@116 83
tomwalters@116 84 friend class GraphicsView;
tomwalters@116 85 friend class GraphicsViewTime;
tomwalters@116 86 };
tomwalters@116 87
tomwalters@116 88 #endif /* __GRAPH_AXIS_SPEC_H__ */