Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r1259 - trunk/Core/Geometry


Chronological Thread 
  • From: sparker@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r1259 - trunk/Core/Geometry
  • Date: Sat, 16 Dec 2006 11:42:59 -0700 (MST)

Author: sparker
Date: Sat Dec 16 11:42:58 2006
New Revision: 1259

Modified:
   trunk/Core/Geometry/Vector.h
   trunk/Core/Geometry/VectorT.h
Log:
Add sqrt for vectors


Modified: trunk/Core/Geometry/Vector.h
==============================================================================
--- trunk/Core/Geometry/Vector.h        (original)
+++ trunk/Core/Geometry/Vector.h        Sat Dec 16 11:42:58 2006
@@ -557,4 +557,11 @@
   std::istream& operator>> (std::istream& is,       Vector& v);
 }
 
+namespace SCIRun {
+  inline Manta::Vector Sqrt(const Manta::Vector& v1)
+  {
+    return Manta::Vector(Sqrt(v1.data[0]), Sqrt(v1.data[1]), 
Sqrt(v1.data[2]));
+  }
+}
+
 #endif

Modified: trunk/Core/Geometry/VectorT.h
==============================================================================
--- trunk/Core/Geometry/VectorT.h       (original)
+++ trunk/Core/Geometry/VectorT.h       Sat Dec 16 11:42:58 2006
@@ -503,4 +503,15 @@
   std::istream& operator>> (std::istream& is, VectorT<T,Dim>& v);
 }
 
+namespace SCIRun {
+  template<typename T, int Dim>
+    inline Manta::VectorT<T, Dim> Sqrt(const Manta::VectorT<T, Dim>& v1)
+  {
+    Manta::VectorT<T, Dim> result;
+    for(int i=0;i<Dim;i++)
+      result[i] = Sqrt(v1[i]);
+    return result;
+  }
+}
+
 #endif




  • [MANTA] r1259 - trunk/Core/Geometry, sparker, 12/16/2006

Archive powered by MHonArc 2.6.16.

Top of page