[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz/gfx/libcoords Coords.cxx
From: |
Tuomas J. Lukka |
Subject: |
[Gzz-commits] gzz/gfx/libcoords Coords.cxx |
Date: |
Sat, 19 Oct 2002 10:27:03 -0400 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Tuomas J. Lukka <address@hidden> 02/10/19 10:27:02
Modified files:
gfx/libcoords : Coords.cxx
Log message:
Transform from derived to base system easily
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libcoords/Coords.cxx.diff?tr1=1.38&tr2=1.39&r1=text&r2=text
Patches:
Index: gzz/gfx/libcoords/Coords.cxx
diff -c gzz/gfx/libcoords/Coords.cxx:1.38 gzz/gfx/libcoords/Coords.cxx:1.39
*** gzz/gfx/libcoords/Coords.cxx:1.38 Thu Oct 10 05:29:51 2002
--- gzz/gfx/libcoords/Coords.cxx Sat Oct 19 10:27:02 2002
***************
*** 80,95 ****
class DerivedTransformCoordSys :
public TransformCoordSys<typename Deriver::BaseTransform> {
CoordSys *dep;
virtual void setSuper(CoordSys **super) {
CoordSys::setSuper(super);
this->dep = super[1];
}
virtual void setParams(float *params) {
Deriver d;
- float nparams[Deriver::BaseTransform::NParams];
d.derivedParams(super, dep, params, nparams);
t.setParams(nparams, super);
}
};
template<class Transform> class InverseTransformCoordSys : public
TransformCoordSysBase<Transform> {
--- 80,103 ----
class DerivedTransformCoordSys :
public TransformCoordSys<typename Deriver::BaseTransform> {
CoordSys *dep;
+ float nparams[Deriver::BaseTransform::NParams];
virtual void setSuper(CoordSys **super) {
CoordSys::setSuper(super);
this->dep = super[1];
}
virtual void setParams(float *params) {
Deriver d;
d.derivedParams(super, dep, params, nparams);
t.setParams(nparams, super);
}
+ virtual bool getOthertypeParams(int type, float *into) {
+ if(type == Deriver::BaseTransform::TransId) {
+ for(int i=0; i<Deriver::BaseTransform::NParams; i++)
+ into[i] = nparams[i];
+ return true;
+ }
+ return false;
+ }
};
template<class Transform> class InverseTransformCoordSys : public
TransformCoordSysBase<Transform> {
***************
*** 144,150 ****
class AffineXYCoords {
float params[7];
public:
! enum { NParams = 7 };
template<class Ptr> void setParams(Ptr p, CoordSys *super) {
for(int i=0; i<7; i++)
params[i] = p[i];
--- 152,160 ----
class AffineXYCoords {
float params[7];
public:
! enum { NParams = 7,
! TransId = 1
! };
template<class Ptr> void setParams(Ptr p, CoordSys *super) {
for(int i=0; i<7; i++)
params[i] = p[i];
***************
*** 204,210 ****
class RotateXYCoords {
float a, s, c;
public:
! enum { NParams = 1 };
template<class Ptr> void setParams(Ptr p, CoordSys *super) {
a = p[0];
angleWasSet();
--- 214,221 ----
class RotateXYCoords {
float a, s, c;
public:
! enum { NParams = 1,
! TransId = 2 };
template<class Ptr> void setParams(Ptr p, CoordSys *super) {
a = p[0];
angleWasSet();
***************
*** 402,408 ****
class RotateXYZCoords {
ZVec vec; float a, s, c;
public:
! enum { NParams = 4 };
template<class Ptr> void setParams(Ptr p, CoordSys *super) {
vec.x = p[0];
vec.y = p[1];
--- 413,420 ----
class RotateXYZCoords {
ZVec vec; float a, s, c;
public:
! enum { NParams = 4,
! TransId = 4};
template<class Ptr> void setParams(Ptr p, CoordSys *super) {
vec.x = p[0];
vec.y = p[1];
***************
*** 456,462 ****
class ScaleXYZCoords {
ZVec vec;
public:
! enum { NParams = 3 };
template<class Ptr> void setParams(Ptr p, CoordSys *super) {
vec.x = p[0];
vec.y = p[1];
--- 468,475 ----
class ScaleXYZCoords {
ZVec vec;
public:
! enum { NParams = 3,
! TransId = 5};
template<class Ptr> void setParams(Ptr p, CoordSys *super) {
vec.x = p[0];
vec.y = p[1];
***************
*** 507,513 ****
bool inverse; // kludge
F distort;
public:
! enum { NParams = 6 };
template<class Ptr> void setParams(Ptr p, CoordSys *super) {
x = p[0];
y = p[1];
--- 520,527 ----
bool inverse; // kludge
F distort;
public:
! enum { NParams = 6,
! TransId = -1 };
template<class Ptr> void setParams(Ptr p, CoordSys *super) {
x = p[0];
y = p[1];