1 /* === S I N F G =========================================================== */
3 ** \brief Template File
5 ** $Id: transform.cpp,v 1.2 2005/01/24 05:00:18 darco Exp $
8 ** Copyright (c) 2002 Robert B. Quattlebaum Jr.
10 ** This software and associated documentation
11 ** are CONFIDENTIAL and PROPRIETARY property of
12 ** the above-mentioned copyright holder.
14 ** You may not copy, print, publish, or in any
15 ** other way distribute this software without
16 ** a prior written agreement with
17 ** the copyright holder.
20 /* ========================================================================= */
22 /* === H E A D E R S ======================================================= */
31 #include "transform.h"
36 /* === U S I N G =========================================================== */
40 using namespace sinfg;
42 /* === M A C R O S ========================================================= */
44 /* === G L O B A L S ======================================================= */
46 /* === P R O C E D U R E S ================================================= */
48 /* === M E T H O D S ======================================================= */
51 TransformStack::get_guid()const
55 for(const_iterator iter(begin());iter!=end();++iter)
56 ret%=(*iter)->get_guid();
61 TransformStack::perform(const sinfg::Vector& x)const
65 for(const_reverse_iterator iter(rbegin());iter!=rend();++iter)
66 ret=(*iter)->perform(ret);
72 TransformStack::unperform(const sinfg::Vector& x)const
76 for(const_iterator iter(begin());iter!=end();++iter)
77 ret=(*iter)->unperform(ret);
83 TransformStack::perform(const sinfg::Rect& x)const
85 Point min(x.get_min());
86 Point max(x.get_max());
87 Rect ret(perform(min),perform(max));
89 std::swap(min[1],max[1]);
98 TransformStack::unperform(const sinfg::Rect& x)const
100 Point min(x.get_min());
101 Point max(x.get_max());
102 Rect ret(unperform(min),unperform(max));
104 std::swap(min[1],max[1]);
106 .expand(unperform(min))
107 .expand(unperform(max))
113 Transform::perform(const sinfg::Rect& x)const
115 if(x.area()>1000000000000.0)
116 return Rect::full_plane();
118 Point min(x.get_min());
119 Point max(x.get_max());
121 Rect ret(perform(min),perform(max));
123 std::swap(min[1],max[1]);
125 .expand(perform(min))
126 .expand(perform(max))
132 Transform::unperform(const sinfg::Rect& x)const
134 if(x.area()>1000000000000.0)
135 return Rect::full_plane();
137 Point min(x.get_min());
138 Point max(x.get_max());
140 Rect ret(unperform(min),unperform(max));
142 std::swap(min[1],max[1]);
144 .expand(unperform(min))
145 .expand(unperform(max))