annotate src/Modules/Output/Graphics/GraphAxisSpec.h @ 118:18237d55e346

- A few changes to get graphics working. In progress.
author tom@acousticscale.org
date Sat, 16 Oct 2010 22:27:03 +0000
parents c5ac2f0c7fc5
children 73c6d61440ad
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
tom@118 24 namespace aimc {
tom@118 25
tomwalters@116 26 /*! \class GraphAxisSpec "Output/GraphAxisSpec.h"
tomwalters@116 27 * \brief Axis specification for a GraphicsView
tomwalters@116 28 */
tomwalters@116 29 class GraphAxisSpec {
tomwalters@116 30 public:
tomwalters@117 31 /*! \brief Create a new GraphAxisSpec
tomwalters@117 32 * \param fMin Minimum value on the axis to show
tomwalters@117 33 * \param fMax Maximum value on the axis to show
tomwalters@117 34 * \param iScale Scale to use
tomwalters@117 35 *
tomwalters@117 36 * Please see SetScale() and SetRange() for more details.
tomwalters@117 37 */
tomwalters@117 38 GraphAxisSpec(float fMin, float fMax, Scale::ScaleType iScale);
tomwalters@117 39 //! \brief Create a new GraphAxisSpec from defaults
tomwalters@117 40 GraphAxisSpec();
tomwalters@116 41
tomwalters@117 42 ~GraphAxisSpec();
tomwalters@116 43
tomwalters@117 44 /*! \brief Set the scale to use
tomwalters@117 45 * \param iScale Scale to use
tomwalters@117 46 */
tomwalters@117 47 void SetDisplayScale(Scale::ScaleType iScale);
tomwalters@117 48 /*! \brief Set the minumum and maximum values to show on the axis
tomwalters@117 49 * \param fMin Minimum value on the axis to show
tomwalters@117 50 * \param fMax Maximum value on the axis to show
tomwalters@117 51 *
tomwalters@117 52 * Either fMin _must_ be smaller than fMax, or fMin==fMax but then
tomwalters@117 53 * this function must be called later to fulfil the former condition
tomwalters@117 54 * before it is used to scale data.
tomwalters@117 55 */
tomwalters@117 56 void SetDisplayRange(float fMin, float fMax);
tomwalters@117 57 /*! \brief Set the label of this axis
tomwalters@117 58 * \param sLabel New label, or NULL to remove label
tomwalters@117 59 */
tomwalters@117 60 void SetLabel(const char *sLabel);
tomwalters@116 61
tomwalters@117 62 /*! \brief Read axis specification from parameter store
tomwalters@117 63 * \param pParam Parameter store to read from
tomwalters@117 64 * \param sPrefix Prefix to use, e.g. "view.x"
tomwalters@117 65 * \param fMin Default minumum value for 'auto'
tomwalters@117 66 * \param fMax Default maximum value for 'auto'
tomwalters@117 67 * \param iScale Default scale for 'auto'
tomwalters@117 68 * \return true if no error occured in reading
tomwalters@117 69 */
tomwalters@117 70 bool Initialize(Parameters *pParam,
tomwalters@116 71 const char *sPrefix,
tomwalters@116 72 float fMin,
tomwalters@116 73 float fMax,
tomwalters@116 74 Scale::ScaleType iScale);
tomwalters@116 75
tomwalters@116 76 protected:
tomwalters@117 77 //! \brief Minimum value on the axis to display
tomwalters@117 78 float m_fMin;
tomwalters@117 79 //! \brief Maximum value on the axis to display
tomwalters@117 80 float m_fMax;
tomwalters@117 81 //! \brief Scale to use
tomwalters@117 82 Scale *m_pScale;
tomwalters@117 83 //! \brief Axis label, NULL for no label
tomwalters@117 84 const char *m_sLabel;
tomwalters@116 85
tomwalters@117 86 friend class GraphicsView;
tomwalters@117 87 friend class GraphicsViewTime;
tomwalters@116 88 };
tomwalters@116 89
tom@118 90 } // namespace aimc
tom@118 91
tomwalters@116 92 #endif /* __GRAPH_AXIS_SPEC_H__ */