167 |
// alternative versions for transforms with and without |
// alternative versions for transforms with and without |
168 |
// given features. |
// given features. |
169 |
|
|
170 |
bool performGL(GLPerformablePrimitiveTransform &t) const { |
bool performGL(const GLPerformablePrimitiveTransform *_) const { |
171 |
t.performGL(); |
t.performGL(); |
172 |
return super->performGL(); |
return super->performGL(); |
173 |
} |
} |
174 |
template<class T> bool performGL(T &t) const { |
bool performGL(const PotentiallyGLPerformablePrimitiveTransform *_) const { |
175 |
|
if(!t.performGL()) return false; |
176 |
|
return super->performGL(); |
177 |
|
} |
178 |
|
bool performGL(const void *t) const { |
179 |
return false; |
return false; |
180 |
} |
} |
181 |
|
|
182 |
bool canPerformGL(GLPerformablePrimitiveTransform &t) const { |
bool canPerformGL(const GLPerformablePrimitiveTransform *_) const { |
183 |
return super->canPerformGL(); |
return super->canPerformGL(); |
184 |
} |
} |
185 |
template<class T> bool canPerformGL(T &t) const { |
bool canPerformGL(const PotentiallyGLPerformablePrimitiveTransform *_) const { |
186 |
|
return t.canPerformGL() && super->canPerformGL() ; |
187 |
|
} |
188 |
|
bool canPerformGL(const void *t) const { |
189 |
return false; |
return false; |
190 |
} |
} |
191 |
|
|
203 |
return super->isNonlinear(); |
return super->isNonlinear(); |
204 |
} |
} |
205 |
|
|
206 |
float selfNonlinearity(NonlinearPrimitiveTransform &t, |
float selfNonlinearity(const NonlinearPrimitiveTransform *_, |
207 |
const ZPt &p, float radius) const { |
const ZPt &p, float radius) const { |
208 |
return t.nonlinearity(p, radius); |
return t.nonlinearity(p, radius); |
209 |
} |
} |
210 |
template<class T> float selfNonlinearity(T &t, |
float selfNonlinearity(const void *t, |
211 |
const ZPt &p, float radius) const { |
const ZPt &p, float radius) const { |
212 |
return 0; |
return 0; |
213 |
} |
} |
243 |
glVertex3f(mp.x, mp.y, mp.z); |
glVertex3f(mp.x, mp.y, mp.z); |
244 |
} |
} |
245 |
|
|
246 |
virtual bool performGL() const { return performGL(t); } |
virtual bool performGL() const { return performGL(&t); } |
247 |
|
|
248 |
virtual bool canPerformGL() const { return canPerformGL(t); } |
virtual bool canPerformGL() const { return canPerformGL(&t); } |
249 |
|
|
250 |
virtual float nonlinearity(const ZPt &p, float radius) const { |
virtual float nonlinearity(const ZPt &p, float radius) const { |
251 |
float s = selfNonlinearity(t, p, radius); |
float s = selfNonlinearity(&t, p, radius); |
252 |
ZPt mp; |
ZPt mp; |
253 |
t.tr(p, mp); |
t.tr(p, mp); |
254 |
float su = super->nonlinearity(mp, radius); |
float su = super->nonlinearity(mp, radius); |
264 |
virtual void dump(std::ostream &out) const { |
virtual void dump(std::ostream &out) const { |
265 |
out << "[inversetrans "<< |
out << "[inversetrans "<< |
266 |
PrimitiveHierarchicalTransform<OrigPrimitive>::name |
PrimitiveHierarchicalTransform<OrigPrimitive>::name |
267 |
<< " "; |
<<"("<<this->canPerformGL() |
268 |
|
<< ") "; |
269 |
super->dump(out); |
super->dump(out); |
270 |
dumpParams(&t, out); |
dumpParams(&t, out); |
271 |
out <<"]"; |
out <<"]"; |
488 |
} |
} |
489 |
|
|
490 |
virtual void dump(std::ostream &out) const { |
virtual void dump(std::ostream &out) const { |
491 |
out << "[trans "<<name<< " "; |
out << "[trans "<<name<<"("<<this->canPerformGL()<< |
492 |
|
") "; |
493 |
super->dump(out); |
super->dump(out); |
494 |
dumpParams(&t, out); |
dumpParams(&t, out); |
495 |
out <<"]"; |
out <<"]"; |