16 #include "transformable.h"
22 #define H2D_IDENTIFY_TRF { 1.0, 1.0 }, { 0.0, 0.0 }
26 { { 0.5, 0.5 }, { -0.5, -0.5 } },
27 { { 0.5, 0.5 }, { 0.5, -0.5 } },
28 { { 0.5, 0.5 }, { -0.5, 0.5 } },
29 { {-0.5, -0.5 }, { -0.5, -0.5 } },
39 { { 0.5, 0.5 }, { -0.5, -0.5 } },
40 { { 0.5, 0.5 }, { 0.5, -0.5 } },
41 { { 0.5, 0.5 }, { 0.5, 0.5 } },
42 { { 0.5, 0.5 }, { -0.5, 0.5 } },
43 { { 1.0, 0.5 }, { 0.0, -0.5 } },
44 { { 1.0, 0.5 }, { 0.0, 0.5 } },
45 { { 0.5, 1.0 }, { -0.5, 0.0 } },
46 { { 0.5, 1.0 }, { 0.5, 0.0 } },
50 Transformable::Transformable()
57 Transformable::~Transformable() {}
80 if(e==NULL)
throw Exceptions::NullException(1);
91 son[i++] = (idx - 1) & 7;
95 for (
int k = i-1; k >= 0; k--)
102 if(
top >= H2D_MAX_TRN_LEVEL)
103 throw Hermes::Exceptions::Exception(
"Too deep transform.");
108 mat->m[0] =
ctm->m[0] * tr->m[0];
109 mat->m[1] =
ctm->m[1] * tr->m[1];
110 mat->
t[0] =
ctm->m[0] * tr->t[0] +
ctm->
t[0];
111 mat->
t[1] =
ctm->m[1] * tr->t[1] +
ctm->
t[1];
117 void Transformable::push_transforms(std::set<Transformable *>& transformables,
int son)
119 for(std::set<Transformable *>::iterator it = transformables.begin(); it != transformables.end(); ++it)
121 (*it)->push_transform(son);
123 void Transformable::pop_transforms(std::set<Transformable *>& transformables)
125 for(std::set<Transformable *>::iterator it = transformables.begin(); it != transformables.end(); ++it)
127 (*it)->pop_transform();