annotate trunk/src/Modules/Output/Graphics/GraphAxisSpec.h @ 397:7a573750b186

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