Compile fixes for gcc 3.4
authorKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>
Fri, 4 Jun 2004 03:04:56 +0000 (03:04 +0000)
committerKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>
Fri, 4 Jun 2004 03:04:56 +0000 (03:04 +0000)
extern/solid/include/MT/Interval.h
extern/solid/include/MT/Quaternion.h
extern/solid/include/MT/Vector3.h
extern/solid/src/complex/DT_BBoxTree.h

index 8e1666c9c236bce256a9e63edd529bcb109e48ee..b739797170018abccbdd36b86807eaa3c1c3682e 100755 (executable)
@@ -111,7 +111,7 @@ namespace MT {
        inline std::ostream& 
        operator<<(std::ostream& os, const Interval<Scalar>& z)
        {
-               return os << '[' << x.lower() << ", " << x.upper() << ']';
+               return os << '[' << z.lower() << ", " << z.upper() << ']';
        }
 
        template <typename Scalar>
index fd7149e95e8e8460d9e558d38c97cba301b6e61e..3726b4f0c5b299582549ea000f802bed096acfee 100755 (executable)
@@ -84,19 +84,19 @@ namespace MT {
   
                Quaternion<Scalar>& operator+=(const Quaternion<Scalar>& q)
                {
-                       m_co[0] += q[0]; m_co[1] += q[1]; m_co[2] += q[2]; m_co[3] += q[3];
+                       this->m_co[0] += q[0]; this->m_co[1] += q[1]; this->m_co[2] += q[2]; this->m_co[3] += q[3];
                        return *this;
                }
                
                Quaternion<Scalar>& operator-=(const Quaternion<Scalar>& q) 
                {
-                       m_co[0] -= q[0]; m_co[1] -= q[1]; m_co[2] -= q[2]; m_co[3] -= q[3];
+                       this->m_co[0] -= q[0]; this->m_co[1] -= q[1]; this->m_co[2] -= q[2]; this->m_co[3] -= q[3];
                        return *this;
                }
 
                Quaternion<Scalar>& operator*=(const Scalar& s)
                {
-                       m_co[0] *= s; m_co[1] *= s; m_co[2] *= s; m_co[3] *= s;
+                       this->m_co[0] *= s; this->m_co[1] *= s; this->m_co[2] *= s; this->m_co[3] *= s;
                        return *this;
                }
                
@@ -108,16 +108,16 @@ namespace MT {
   
                Quaternion<Scalar>& operator*=(const Quaternion<Scalar>& q)
                {
-                       setValue(m_co[3] * q[0] + m_co[0] * q[3] + m_co[1] * q[2] - m_co[2] * q[1],
-                                        m_co[3] * q[1] + m_co[1] * q[3] + m_co[2] * q[0] - m_co[0] * q[2],
-                                        m_co[3] * q[2] + m_co[2] * q[3] + m_co[0] * q[1] - m_co[1] * q[0],
-                                        m_co[3] * q[3] - m_co[0] * q[0] - m_co[1] * q[1] - m_co[2] * q[2]);
+                       setValue(this->m_co[3] * q[0] + this->m_co[0] * q[3] + this->m_co[1] * q[2] - this->m_co[2] * q[1],
+                                        this->m_co[3] * q[1] + this->m_co[1] * q[3] + this->m_co[2] * q[0] - this->m_co[0] * q[2],
+                                        this->m_co[3] * q[2] + this->m_co[2] * q[3] + this->m_co[0] * q[1] - this->m_co[1] * q[0],
+                                        this->m_co[3] * q[3] - this->m_co[0] * q[0] - this->m_co[1] * q[1] - this->m_co[2] * q[2]);
                        return *this;
                }
        
                Scalar dot(const Quaternion<Scalar>& q) const
                {
-                       return m_co[0] * q[0] + m_co[1] * q[1] + m_co[2] * q[2] + m_co[3] * q[3];
+                       return this->m_co[0] * q[0] + this->m_co[1] * q[1] + this->m_co[2] * q[2] + this->m_co[3] * q[3];
                }
 
                Scalar length2() const
@@ -149,7 +149,7 @@ namespace MT {
    
                Quaternion<Scalar> conjugate() const 
                {
-                       return Quaternion<Scalar>(-m_co[0], -m_co[1], -m_co[2], m_co[3]);
+                       return Quaternion<Scalar>(-this->m_co[0], -this->m_co[1], -this->m_co[2], this->m_co[3]);
                }
 
                Quaternion<Scalar> inverse() const
@@ -165,10 +165,10 @@ namespace MT {
                                Scalar d = Scalar(1.0) / Scalar_traits<Scalar>::sin(theta);
                                Scalar s0 = Scalar_traits<Scalar>::sin((Scalar(1.0) - t) * theta);
                                Scalar s1 = Scalar_traits<Scalar>::sin(t * theta);   
-                               return Quaternion<Scalar>((m_co[0] * s0 + q[0] * s1) * d,
-                                                                                 (m_co[1] * s0 + q[1] * s1) * d,
-                                                                                 (m_co[2] * s0 + q[2] * s1) * d,
-                                                                                 (m_co[3] * s0 + q[3] * s1) * d);
+                               return Quaternion<Scalar>((this->m_co[0] * s0 + q[0] * s1) * d,
+                                                                                 (this->m_co[1] * s0 + q[1] * s1) * d,
+                                                                                 (this->m_co[2] * s0 + q[2] * s1) * d,
+                                                                                 (this->m_co[3] * s0 + q[3] * s1) * d);
                        }
                        else
                        {
index 6248a138092f22cd15d99d3f4a602977290dcb28..98c990684074ea6cb74b7ad2c4c476795bd319b6 100755 (executable)
@@ -45,19 +45,19 @@ namespace MT {
                
                Vector3<Scalar>& operator+=(const Vector3<Scalar>& v)
                {
-                       m_co[0] += v[0]; m_co[1] += v[1]; m_co[2] += v[2];
+                       this->m_co[0] += v[0]; this->m_co[1] += v[1]; this->m_co[2] += v[2];
                        return *this;
                }
                
                Vector3<Scalar>& operator-=(const Vector3<Scalar>& v) 
                {
-                       m_co[0] -= v[0]; m_co[1] -= v[1]; m_co[2] -= v[2];
+                       this->m_co[0] -= v[0]; this->m_co[1] -= v[1]; this->m_co[2] -= v[2];
                        return *this;
                }
 
                Vector3<Scalar>& operator*=(const Scalar& s)
                {
-                       m_co[0] *= s; m_co[1] *= s; m_co[2] *= s;
+                       this->m_co[0] *= s; this->m_co[1] *= s; this->m_co[2] *= s;
                        return *this;
                }
                
@@ -69,7 +69,7 @@ namespace MT {
   
                Scalar dot(const Vector3<Scalar>& v) const
                {
-                       return m_co[0] * v[0] + m_co[1] * v[1] + m_co[2] * v[2];
+                       return this->m_co[0] * v[0] + this->m_co[1] * v[1] + this->m_co[2] * v[2];
                }
 
                Scalar length2() const
@@ -111,33 +111,33 @@ namespace MT {
    
                Vector3<Scalar> absolute() const 
                {
-                       return Vector3<Scalar>(Scalar_traits<Scalar>::abs(m_co[0]), 
-                                                                  Scalar_traits<Scalar>::abs(m_co[1]), 
-                                                                  Scalar_traits<Scalar>::abs(m_co[2]));
+                       return Vector3<Scalar>(Scalar_traits<Scalar>::abs(this->m_co[0]), 
+                                                                  Scalar_traits<Scalar>::abs(this->m_co[1]), 
+                                                                  Scalar_traits<Scalar>::abs(this->m_co[2]));
                }
 
                Vector3<Scalar> cross(const Vector3<Scalar>& v) const
                {
-                       return Vector3<Scalar>(m_co[1] * v[2] - m_co[2] * v[1],
-                                                                  m_co[2] * v[0] - m_co[0] * v[2],
-                                                                  m_co[0] * v[1] - m_co[1] * v[0]);
+                       return Vector3<Scalar>(this->m_co[1] * v[2] - this->m_co[2] * v[1],
+                                                                  this->m_co[2] * v[0] - this->m_co[0] * v[2],
+                                                                  this->m_co[0] * v[1] - this->m_co[1] * v[0]);
                }
                
                Scalar triple(const Vector3<Scalar>& v1, const Vector3<Scalar>& v2) const
                {
-                       return m_co[0] * (v1[1] * v2[2] - v1[2] * v2[1]) + 
-                                  m_co[1] * (v1[2] * v2[0] - v1[0] * v2[2]) + 
-                                  m_co[2] * (v1[0] * v2[1] - v1[1] * v2[0]);
+                       return this->m_co[0] * (v1[1] * v2[2] - v1[2] * v2[1]) + 
+                                  this->m_co[1] * (v1[2] * v2[0] - v1[0] * v2[2]) + 
+                                  this->m_co[2] * (v1[0] * v2[1] - v1[1] * v2[0]);
                }
 
                int minAxis() const
                {
-                       return m_co[0] < m_co[1] ? (m_co[0] < m_co[2] ? 0 : 2) : (m_co[1] < m_co[2] ? 1 : 2);
+                       return this->m_co[0] < this->m_co[1] ? (this->m_co[0] < this->m_co[2] ? 0 : 2) : (this->m_co[1] < this->m_co[2] ? 1 : 2);
                }
 
                int maxAxis() const 
                {
-                       return m_co[0] < m_co[1] ? (m_co[1] < m_co[2] ? 2 : 1) : (m_co[0] < m_co[2] ? 2 : 0);
+                       return this->m_co[0] < this->m_co[1] ? (this->m_co[1] < this->m_co[2] ? 2 : 1) : (this->m_co[0] < this->m_co[2] ? 2 : 0);
                }
 
                int furthestAxis() const
@@ -152,9 +152,9 @@ namespace MT {
 
                Vector3<Scalar> lerp(const Vector3<Scalar>& v, const Scalar& t) const 
                {
-                       return Vector3<Scalar>(m_co[0] + (v[0] - m_co[0]) * t,
-                                                                  m_co[1] + (v[1] - m_co[1]) * t,
-                                                                  m_co[2] + (v[2] - m_co[2]) * t);
+                       return Vector3<Scalar>(this->m_co[0] + (v[0] - this->m_co[0]) * t,
+                                                                  this->m_co[1] + (v[1] - this->m_co[1]) * t,
+                                                                  this->m_co[2] + (v[2] - this->m_co[2]) * t);
                }
     
                static Vector3<Scalar> random() 
index 995da05573a622c5f5c71b45aeef2472579d236c..3d9da6e34ba303706bc9cf76522ed82bce4240cd 100755 (executable)
@@ -136,7 +136,7 @@ public:
       : DT_Pack<Shape1, Shape2>(a, b),
         m_margin(margin)
     {
-        m_b_cbox += computeCBox(margin, m_a.m_inv_xform);
+        this->m_b_cbox += computeCBox(margin, this->m_a.m_inv_xform);
     }
     
     MT_Scalar m_margin;
@@ -185,7 +185,7 @@ bool ray_cast(const DT_BBoxTree& a, const DT_RootData<Shape>& rd,
 
     if (a.m_type == DT_BBoxTree::LEAF) 
     { 
-        return ::ray_cast(rd, a.m_index, source, target, lambda, normal); 
+        return ray_cast(rd, a.m_index, source, target, lambda, normal); 
     }
     else 
     {