Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
transforms
BinaryTransform.cxx
Go to the documentation of this file.
1
12
#include "
BinaryTransform.h
"
13
14
#include "
UnaryTransform.h
"
15
16
#include <cassert>
17
18
namespace
hippodraw {
19
24
BinaryTransform::BinaryTransform
()
25
{
26
m_name
=
"nil"
;
27
28
m_needs_grid
=
false
;
29
m_needs_x_ticks
=
true
;
30
m_needs_y_ticks
=
true
;
31
m_is_periodic
=
false
;
32
33
m_z
= 0;
34
}
35
36
BinaryTransform::BinaryTransform
(
UnaryTransform
* z,
37
bool
is_periodic,
38
bool
needs_grid,
39
bool
needs_x_ticks,
40
bool
needs_y_ticks )
41
{
42
m_z
= z;
43
m_name
=
m_z
->
name
();
44
45
m_needs_grid
= needs_grid;
46
m_needs_x_ticks
= needs_x_ticks;
47
m_needs_y_ticks
= needs_y_ticks;
48
m_is_periodic
= is_periodic;
49
50
}
51
52
BinaryTransform::BinaryTransform
(
const
BinaryTransform
& t )
53
:
TransformBase
( t )
54
{
55
56
if
( t.
m_z
== 0 ){
57
m_z
= 0;
58
return
;
59
}
60
61
assert ( t.
m_z
);
62
63
#ifdef CLONE_DEFECT
64
m_z
= dynamic_cast <
UnaryTransform
* > ( t.
m_z
->
clone
() );
65
#else
66
m_z
= t.
m_z
->
clone
();
67
#endif
68
69
m_needs_grid
= t.
needsGrid
();
70
m_needs_x_ticks
= t.
needsXTicks
();
71
m_needs_y_ticks
= t.
needsYTicks
();
72
m_is_periodic
= t.
isPeriodic
();
73
74
}
75
76
BinaryTransform::~BinaryTransform
()
77
{
78
delete
m_z
;
79
}
80
81
double
BinaryTransform::aspectRatio
()
const
82
{
83
return
0.0;
84
}
85
86
TransformBase
*
BinaryTransform::zTransform
()
const
87
{
88
return
m_z
;
89
}
90
91
void
92
BinaryTransform::
93
setZTransform
(
TransformBase
* transform )
94
{
95
UnaryTransform
* t = dynamic_cast <
UnaryTransform
* > (
transform
);
96
97
m_z
= t;
98
}
99
100
void
BinaryTransform::transformZ
(
double
& z )
const
101
{
102
assert (
m_z
);
103
m_z
->
transform
( z );
104
}
105
106
void
BinaryTransform::inverseTransformZ
(
double
& z )
const
107
{
108
assert (
m_z
);
109
m_z
->
inverseTransform
( z );
110
}
111
112
const
Range
&
BinaryTransform::limitZ
()
const
113
{
114
assert (
m_z
);
115
return
m_z
->
limits
();
116
}
117
118
bool
BinaryTransform::needsGrid
()
const
119
{
120
return
m_needs_grid
;
121
}
122
123
void
BinaryTransform::setNeedsGrid
(
bool
needs_grid )
124
{
125
m_needs_grid
= needs_grid;
126
}
127
128
bool
BinaryTransform::needsXTicks
()
const
129
{
130
return
m_needs_x_ticks
;
131
}
132
133
void
BinaryTransform::setNeedsXTicks
(
bool
needs_x_ticks )
134
{
135
m_needs_x_ticks
= needs_x_ticks;
136
}
137
138
bool
BinaryTransform::needsYTicks
()
const
139
{
140
return
m_needs_y_ticks
;
141
}
142
143
void
BinaryTransform::setNeedsYTicks
(
bool
needs_y_ticks )
144
{
145
m_needs_y_ticks
= needs_y_ticks;
146
}
147
148
bool
BinaryTransform::isPeriodic
()
const
149
{
150
return
m_is_periodic
;
151
}
152
153
bool
BinaryTransform::isLinearInZ
()
const
154
{
155
return
m_z
->
isLinear
();
156
}
157
158
159
}
// namespace hippodraw
Generated for HippoDraw Class Library by