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