/[libvob]/libvob/include/vob/Vec23.hxx
ViewVC logotype

Diff of /libvob/include/vob/Vec23.hxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by tjl, Tue Apr 1 15:06:52 2003 UTC revision 1.7 by tjl, Fri May 16 15:13:10 2003 UTC
# Line 40  namespace Vec23 { Line 40  namespace Vec23 {
40      template <class T>class Vector;      template <class T>class Vector;
41      template <class T>class Vector3;      template <class T>class Vector3;
42    
43        inline float finitize(float f) {
44            return finitef(f) ? f : 0;
45        }
46    
47      /** A 2D vector.      /** A 2D vector.
48       */       */
49      template <class T>class Vector {      template <class T>class Vector {
# Line 59  namespace Vec23 { Line 63  namespace Vec23 {
63          /** Create from an array.          /** Create from an array.
64           */           */
65          Vector(T *v) : x(v[0]), y(v[1]) { }          Vector(T *v) : x(v[0]), y(v[1]) { }
66    
67            /** Making all components finite.
68             */
69            Vector finitized() const {
70                return Vector(finitize(x), finitize(y));
71            }
72    
73          /** Multiplication by scalar.          /** Multiplication by scalar.
74           */           */
75          Vector operator*(const double &s) const { return Vector(s * x, s * y); }          Vector operator*(const double &s) const { return Vector(s * x, s * y); }
# Line 117  namespace Vec23 { Line 128  namespace Vec23 {
128          /** From a 2D vector and an optional Z-component.          /** From a 2D vector and an optional Z-component.
129           */           */
130          Vector3(const Vector<T> &v, float z = 0) : x(v.x), y(v.y), z(z) { }          Vector3(const Vector<T> &v, float z = 0) : x(v.x), y(v.y), z(z) { }
131    
132            /** Making all components finite.
133             */
134            Vector3 finitized() const {
135                return Vector3(finitize(x), finitize(y), finitize(z));
136            }
137                    
138          /** Multiplication by scalar.          /** Multiplication by scalar.
139           */           */

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26