Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
axes
AxisModelBase.h
Go to the documentation of this file.
1
/* -*- mode: c++; -*- */
2
14
#ifndef _AxisModelBase_H_
15
#define _AxisModelBase_H_
16
17
#include "
AxisLoc.h
"
18
#include "
Range.h
"
19
20
namespace
hippodraw {
21
22
class
AxisTick;
23
33
class
MDL_HIPPOPLOT_API
AxisModelBase
34
{
35
protected
:
36
38
Range
m_range
;
39
41
mutable
Range
m_scaled_range
;
42
46
Range
m_start_range
;
47
49
bool
m_is_dragging
;
50
53
bool
m_auto_range
;
54
56
bool
m_empty
;
57
62
double
m_scale_factor
;
63
65
bool
m_scaling_on
;
66
70
double
m_first_tick
;
71
74
double
m_tick_step
;
75
77
const
int
m_max_ticks
;
78
79
//The actual program doesn't represent nor support any minor
80
//ticks.
81
int
m_num_minor_ticks
;
// The Number of minor ticks between the major ones.
82
83
AxisLoc
m_label_location
;
84
AxisLoc
m_scale_location
;
85
88
double
m_pmag
;
89
93
bool
m_use_pmag
;
94
97
double
m_rmag
;
98
100
std::vector<AxisTick>
m_ticks
;
101
103
std::vector<AxisTick>
m_ticks_in_range
;
104
108
bool
m_auto_ticks
;
109
112
void
startDragging (
bool
dragging );
113
114
public
:
115
118
AxisModelBase
(
AxisLoc
label,
AxisLoc
scale );
119
121
AxisModelBase
(
const
AxisModelBase
& axis_model );
122
124
virtual
~
AxisModelBase
();
125
127
virtual
AxisModelBase
*
clone
()
const
= 0;
128
129
131
void
setTickStep(
const
double
& t_step );
132
135
double
getTickStep()
const
;
136
138
void
setFirstTick(
const
double
& first_tick );
139
141
double
getFirstTick()
const
;
142
144
double
getMaxTicks()
const
;
145
147
void
setRMag (
const
double
& rmag );
148
150
double
getRMag()
const
;
151
153
void
setPMag(
const
double
& pmag );
154
156
double
getPMag()
const
;
157
158
160
void
setRange (
double
low,
double
high,
double
pos );
161
165
void
setRange (
const
Range
&,
bool
scaled =
false
);
166
168
void
setIntersectRange (
const
Range
&,
const
Range
& );
169
171
void
setRangePos (
double
);
172
176
void
setUnionRange (
const
Range
& range );
177
179
void
setEmpty ();
180
187
const
Range
& getRange (
bool
scaled )
const
;
188
190
void
setAutoRanging (
bool
flag );
191
194
bool
isAutoRanging ( )
const
;
195
197
void
setScaleFactor (
double
);
198
201
double
getScaleFactor ()
const
;
202
206
bool
isScaling ()
const
;
207
209
void
setScaling (
bool
on =
true
);
210
220
virtual
bool
needPMag ()
const
;
221
223
virtual
void
setUsePMag(
const
bool
& use_p_mag );
224
228
virtual
bool
isLog()
const
= 0;
229
230
AxisLoc
getLabelLocation()
const
;
231
AxisLoc
getScaleLocation()
const
;
232
234
void
setTicks(
const
std::vector<AxisTick> & ticks);
235
239
const
std::vector<AxisTick> & getTicks()
const
;
240
244
void
adjustTicks();
245
249
void
setAutoTicks (
bool
yes );
250
254
bool
isAutoTicks ()
const
;
255
258
virtual
const
Range
& adjustValues (
const
Range
& limit ) = 0;
259
261
virtual
const
Range
& adjustLogValues() = 0;
262
269
virtual
Range
calcLow (
int
parm,
bool
dragging =
false
) = 0;
270
277
virtual
Range
calcHigh (
int
parm,
bool
dragging =
false
) = 0;
278
279
};
280
281
}
// namespace hippodraw
282
283
#endif // _AxisModel_H_
Generated for HippoDraw Class Library by