Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r761 - in trunk: Core/Math Engine/ImageTraversers Interface SwigInterface


Chronological Thread 
  • From: bigler@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r761 - in trunk: Core/Math Engine/ImageTraversers Interface SwigInterface
  • Date: Fri, 9 Dec 2005 17:04:56 -0700 (MST)

Author: bigler
Date: Fri Dec  9 17:04:55 2005
New Revision: 761

Modified:
   trunk/Core/Math/CheapRNG.h
   trunk/Engine/ImageTraversers/DissolveImageTraverser.cc
   trunk/Engine/ImageTraversers/DissolveTiledImageTraverser.cc
   trunk/Interface/Callback.h
   trunk/Interface/CallbackHelpers.h
   trunk/Interface/RenderParameters.h
   trunk/SwigInterface/manta.cc
   trunk/SwigInterface/manta.i
   trunk/SwigInterface/runmanta.py
Log:

Mostly fixes for Swig.

Core/Math/CheapRNG.h

  Added MIT license.
Engine/ImageTraversers/DissolveImageTraverser.cc
Engine/ImageTraversers/DissolveTiledImageTraverser.cc

  Turns out there was a typo in the original Graphics Gems article.
  This change reflects the fixes in the errata.

Interface/Callback.h
Interface/CallbackHelpers.h

  Swig doesn't like the const function pointers.  I'm ifdef'ing them
  out for now for swig compiles.

  Fixed some indentation for the const versions of the functions.

Interface/RenderParameters.h

  Swig didn't know what a real was in this class.  I added the header
  file, but that wasn't enough.  I had to explictly tell it that Real
  was in the Manta scope.

SwigInterface/manta.cc
SwigInterface/runmanta.py

  Fixes for the change in Phong API.  Phong now takes a Texture
  templated across ColorComponent instead of Real for the
  reflectivity.

SwigInterface/manta.i

  RTRTInterface is now MantaInterface.

  Create a CheckerTexture_ColorComponent template type for Phong and
  others.

SwigInterface/runmanta.py

  Fixes for the change in Phong API.  Phong now takes a Texture
  templated across ColorComponent instead of Real for the
  reflectivity.

  Call createManta instead of createRTRT.


Modified: trunk/Core/Math/CheapRNG.h
==============================================================================
--- trunk/Core/Math/CheapRNG.h  (original)
+++ trunk/Core/Math/CheapRNG.h  Fri Dec  9 17:04:55 2005
@@ -18,6 +18,34 @@
  * Author: James Bigler
  * Date: June 16, 2005
  *
+ * This is licensed under the MIT license:
+
+  For more information, please see: http://software.sci.utah.edu
+
+  The MIT License
+
+  Copyright (c) 2005
+  SCI Institute, University of Utah
+
+  License for the specific language governing rights and limitations under
+  Permission is hereby granted, free of charge, to any person obtaining a
+  copy of this software and associated documentation files (the "Software"),
+  to deal in the Software without restriction, including without limitation
+  the rights to use, copy, modify, merge, publish, distribute, sublicense,
+  and/or sell copies of the Software, and to permit persons to whom the
+  Software is furnished to do so, subject to the following conditions:
+
+  The above copyright notice and this permission notice shall be included
+  in all copies or substantial portions of the Software.
+
+  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+  DEALINGS IN THE SOFTWARE.
+
  */
 
 // All these values are u_int32_t to make sure we have an unsigned 32

Modified: trunk/Engine/ImageTraversers/DissolveImageTraverser.cc
==============================================================================
--- trunk/Engine/ImageTraversers/DissolveImageTraverser.cc      (original)
+++ trunk/Engine/ImageTraversers/DissolveImageTraverser.cc      Fri Dec  9 
17:04:55 2005
@@ -40,7 +40,7 @@
   /* 20 */ 0x00090000,  //     1,048,575
   /* 21 */ 0x00140000,  //     2,097,151
   /* 22 */ 0x00300000,  //     4,194,303
-  /* 23 */ 0x00400000,  //     8,388,607
+  /* 23 */ 0x00420000,  //     8,388,607
   /* 24 */ 0x00D80000,  //    16,777,215
   /* 25 */ 0x01200000,  //    33,554,431
   /* 26 */ 0x03880000,  //    67,108,863

Modified: trunk/Engine/ImageTraversers/DissolveTiledImageTraverser.cc
==============================================================================
--- trunk/Engine/ImageTraversers/DissolveTiledImageTraverser.cc (original)
+++ trunk/Engine/ImageTraversers/DissolveTiledImageTraverser.cc Fri Dec  9 
17:04:55 2005
@@ -41,7 +41,7 @@
   /* 20 */ 0x00090000,  //     1,048,575
   /* 21 */ 0x00140000,  //     2,097,151
   /* 22 */ 0x00300000,  //     4,194,303
-  /* 23 */ 0x00400000,  //     8,388,607
+  /* 23 */ 0x00420000,  //     8,388,607
   /* 24 */ 0x00D80000,  //    16,777,215
   /* 25 */ 0x01200000,  //    33,554,431
   /* 26 */ 0x03880000,  //    67,108,863

Modified: trunk/Interface/Callback.h
==============================================================================
--- trunk/Interface/Callback.h  (original)
+++ trunk/Interface/Callback.h  Fri Dec  9 17:04:55 2005
@@ -13,11 +13,13 @@
       return new Callback_0Data_0Arg<T>(ptr, pmf);
     }
 
+#ifndef SWIG // For now these const versions won't compile in swig
                template<class T> static
     CallbackBase_0Data*
     create(T* ptr, void (T::*pmf)() const) {
       return new Callback_0Data_0Arg_const<T>(ptr, pmf);
     }
+#endif
 
     template<class T, typename Arg1> static
     CallbackBase_0Data*
@@ -25,11 +27,13 @@
       return new Callback_0Data_1Arg<T, Arg1>(ptr, pmf, arg1);
     }
                
+#ifndef SWIG // For now these const versions won't compile in swig
                template<class T, typename Arg1> static
     CallbackBase_0Data*
     create(T* ptr, void (T::*pmf)(Arg1) const, Arg1 arg1) {
       return new Callback_0Data_1Arg_const<T, Arg1>(ptr, pmf, arg1);
     }
+#endif
 
     template<class T, typename Arg1, typename Arg2> static
     CallbackBase_0Data*
@@ -37,12 +41,13 @@
       return new Callback_0Data_2Arg<T, Arg1, Arg2>(ptr, pmf, arg1, arg2);
     }
                
+#ifndef SWIG // For now these const versions won't compile in swig
                template<class T, typename Arg1, typename Arg2> static
     CallbackBase_0Data*
     create(T* ptr, void (T::*pmf)(Arg1, Arg2) const, Arg1 arg1, Arg2 arg2) {
       return new Callback_0Data_2Arg_const<T, Arg1, Arg2>(ptr, pmf, arg1, 
arg2);
     }
-
+#endif
     template<class T, typename Arg1, typename Arg2, typename Arg3> static
     CallbackBase_0Data*
     create(T* ptr, void (T::*pmf)(Arg1, Arg2, Arg3), Arg1 arg1, Arg2 arg2, 
Arg3 arg3) {

Modified: trunk/Interface/CallbackHelpers.h
==============================================================================
--- trunk/Interface/CallbackHelpers.h   (original)
+++ trunk/Interface/CallbackHelpers.h   Fri Dec  9 17:04:55 2005
@@ -140,25 +140,26 @@
     void (T::*pmf)();
   };
 
+#ifndef SWIG // For now these const versions won't compile in swig
   template<class T>
-               class Callback_0Data_0Arg_const : public CallbackBase_0Data {
-               public:
-                       Callback_0Data_0Arg_const(T* ptr, void (T::*pmf)() 
const)
+  class Callback_0Data_0Arg_const : public CallbackBase_0Data {
+  public:
+    Callback_0Data_0Arg_const(T* ptr, void (T::*pmf)() const)
       : ptr(ptr), pmf(pmf)
     {
     }
-                       virtual ~Callback_0Data_0Arg_const()
+    virtual ~Callback_0Data_0Arg_const()
     {
     }
-                       virtual void call()
+    virtual void call()
     {
-                               (ptr->*pmf)();
+      (ptr->*pmf)();
     }
-               private:
-                       T* ptr;
-                       void (T::*pmf)() const;
-               };
-       
+  private:
+    T* ptr;
+    void (T::*pmf)() const;
+  };
+#endif
 
   template<class T, typename Arg1>
   class Callback_0Data_1Arg : public CallbackBase_0Data {
@@ -180,25 +181,27 @@
     Arg1 arg1;
   };
 
+#ifndef SWIG // For now these const versions won't compile in swig
        template<class T, typename Arg1>
        class Callback_0Data_1Arg_const : public CallbackBase_0Data {
        public:
                Callback_0Data_1Arg_const(T* ptr, void (T::*pmf)(Arg1) const, 
Arg1 arg1)
-               : ptr(ptr), pmf(pmf), arg1(arg1)
-       {
-       }
+      : ptr(ptr), pmf(pmf), arg1(arg1)
+    {
+    }
                virtual ~Callback_0Data_1Arg_const()
-       {
-       }
+    {
+    }
                virtual void call()
-       {
+    {
                        (ptr->*pmf)(arg1);
-       }
+    }
        private:
                T* ptr;
                void (T::*pmf)(Arg1) const;
                Arg1 arg1;
        };
+#endif
 
   template<class T, typename Arg1, typename Arg2>
   class Callback_0Data_2Arg : public CallbackBase_0Data {
@@ -221,26 +224,28 @@
     Arg2 arg2;
   };
 
+#ifndef SWIG // For now these const versions won't compile in swig
        template<class T, typename Arg1, typename Arg2>
        class Callback_0Data_2Arg_const : public CallbackBase_0Data {
        public:
                Callback_0Data_2Arg_const(T* ptr, void (T::*pmf)(Arg1, Arg2) 
const, Arg1 arg1, Arg2 arg2)
-               : ptr(ptr), pmf(pmf), arg1(arg1), arg2(arg2)
-       {
-       }
+      : ptr(ptr), pmf(pmf), arg1(arg1), arg2(arg2)
+    {
+    }
                virtual ~Callback_0Data_2Arg_const()
-       {
-       }
+    {
+    }
                virtual void call()
-       {
+    {
                        (ptr->*pmf)(arg1, arg2);
-       }
+    }
        private:
                T* ptr;
                void (T::*pmf)(Arg1, Arg2) const;
                Arg1 arg1;
                Arg2 arg2;
        };
+#endif
 
   template<class T, typename Arg1, typename Arg2, typename Arg3>
     class Callback_0Data_3Arg : public CallbackBase_0Data {

Modified: trunk/Interface/RenderParameters.h
==============================================================================
--- trunk/Interface/RenderParameters.h  (original)
+++ trunk/Interface/RenderParameters.h  Fri Dec  9 17:04:55 2005
@@ -2,6 +2,8 @@
 #ifndef Manta_Interface_RenderParameters_h
 #define Manta_Interface_RenderParameters_h
 
+#include <MantaTypes.h>
+
 namespace Manta {
   class RenderParameters {
   public:
@@ -10,7 +12,7 @@
       importanceCutoff = 0.01;
     }
     int maxDepth;
-    Real importanceCutoff;
+    Manta::Real importanceCutoff;
   private:
   };
 }

Modified: trunk/SwigInterface/manta.cc
==============================================================================
--- trunk/SwigInterface/manta.cc        (original)
+++ trunk/SwigInterface/manta.cc        Fri Dec  9 17:04:55 2005
@@ -29,15 +29,16 @@
                           Color(RGBColor(.6,.6,.6)), 32, 0.4);
 
   Material* plane_matl = new Phong(new 
CheckerTexture<Color>(Color(RGBColor(.6,.6,.6)),
-                                                            
Color(RGBColor(0,0,0)),
-                                                            Vector(1,0,0),
-                                                            Vector(0,1,0)),
-                                  new 
Constant<Color>(Color(RGBColor(.6,.6,.6))),
-                                  32,
-                                  new CheckerTexture<double>(0.2, 0.5,
-                                                             Vector(1,0,0),
-                                                             Vector(0,1,0)));
-                                                             
+                                                                             
                                                                              
                                                                              
       Color(RGBColor(0,0,0)),
+                                                                             
                                                                              
                                                                              
       Vector(1,0,0),
+                                                                             
                                                                              
                                                                              
       Vector(0,1,0)),
+                                                                             
                                                           new 
Constant<Color>(Color(RGBColor(.6,.6,.6))),
+                                                                             
                                                           32,
+                                                                             
                                                           new 
CheckerTexture<ColorComponent>
+                                   ((ColorComponent)0.2,
+                                    (ColorComponent)0.5,
+                                    Vector(1,0,0),
+                                    Vector(0,1,0)));
 
   Group* world = new Group();
   Primitive* floor = new Parallelogram(plane_matl, Point(-20,-20,0),

Modified: trunk/SwigInterface/manta.i
==============================================================================
--- trunk/SwigInterface/manta.i (original)
+++ trunk/SwigInterface/manta.i Fri Dec  9 17:04:55 2005
@@ -52,7 +52,7 @@
 
 
 %{
-#include <Interface/RTRTInterface.h>
+#include <Interface/MantaInterface.h>
 #include <Interface/UserInterface.h>
 #include <Interface/RenderParameters.h>
 #include <Interface/Scene.h>
@@ -75,7 +75,7 @@
 %include <Interface/Transaction.h>
 %include <Interface/TValue.h>
 
-%include <Interface/RTRTInterface.h>
+%include <Interface/MantaInterface.h>
 %include <SwigInterface/manta.h>
 
 namespace Manta {
@@ -248,6 +248,7 @@
   %template(CheckerTexture_Color) CheckerTexture<Color>;
   %template(Texture_Real) Texture<Manta::Real>;
   %template(CheckerTexture_Real) CheckerTexture<Manta::Real>;
+  %template(CheckerTexture_ColorComponent) 
CheckerTexture<Manta::ColorComponent>;
   %template(Constant_Color) Constant<Color>;
 }
 

Modified: trunk/SwigInterface/runmanta.py
==============================================================================
--- trunk/SwigInterface/runmanta.py     (original)
+++ trunk/SwigInterface/runmanta.py     Fri Dec  9 17:04:55 2005
@@ -11,7 +11,7 @@
                                               Vector(1,0,0),
                                               Vector(0,1,0)))
     constant_color1 = manta_new(Constant_Color(Color(RGBColor(.6,.6,.6))))
-    checker2 = manta_new(CheckerTexture_Real(0.2, 0.5, Vector(1,0,0),
+    checker2 = manta_new(CheckerTexture_ColorComponent(0.2, 0.5, 
Vector(1,0,0),
                                              Vector(0,1,0)))
     plane_matl = manta_new(Phong(checker1, constant_color1, 32, checker2))
 
@@ -36,7 +36,7 @@
     return scene
 
     
-engine = createRTRT()
+engine = createManta()
 engine.changeNumWorkers(1)
 engine.selectImageType("rgba8")
 engine.selectLoadBalancer("workqueue")




  • [MANTA] r761 - in trunk: Core/Math Engine/ImageTraversers Interface SwigInterface, bigler, 12/09/2005

Archive powered by MHonArc 2.6.16.

Top of page