Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[Manta] r2321 - in trunk/scenes/csafe: python src


Chronological Thread 
  • From:
  • To:
  • Subject: [Manta] r2321 - in trunk/scenes/csafe: python src
  • Date: Tue, 9 Sep 2008 01:23:25 -0600 (MDT)

Author: brownlee
Date: Tue Sep  9 01:23:24 2008
New Revision: 2321

Modified:
   trunk/scenes/csafe/python/Histogram.py
   trunk/scenes/csafe/src/CDGridSpheres.cc
   trunk/scenes/csafe/src/CDGridSpheres.h
   trunk/scenes/csafe/src/CDTest.h
Log:
forgot to fix a warning

Modified: trunk/scenes/csafe/python/Histogram.py
==============================================================================
--- trunk/scenes/csafe/python/Histogram.py      (original)
+++ trunk/scenes/csafe/python/Histogram.py      Tue Sep  9 01:23:24 2008
@@ -183,10 +183,12 @@
         #pdc.Clear()
         #dc = wx.GCDC(pdc)
         pos = float(evt.GetPosition().x - 
self.paddingW/2.0)/float(self.width)
+        update_clip = False
         if self.selecting == True:
             self.cropMax = pos
             self.UpdateDMinMax()
             self.Refresh()
+            update_clip = True
         if self.dragging == True:
             cropWidth = self.dragWidth
             self.cropMin = pos - cropWidth/2.0
@@ -197,21 +199,21 @@
                 self.cropMax = 1.0
             self.UpdateDMinMax()
             self.Refresh()
+            update_clip = True
         if self.draggingLeft == True:
             self.cropMin = pos
             self.UpdateDMinMax()
             self.Refresh()
+            update_clip = True
         elif self.draggingRight == True:
             self.cropMax = pos
             self.UpdateDMinMax()
             self.Refresh()
-        
-       if (self.parent.group != 1):  #if not the volumedata
+            update_clip = True
+       if (update_clip and self.parent.group != 1):  #if not the volumedata
             index = self.varIndex;
-            min = self.cropDMin - 0.00001
-            max = self.cropDMax + 0.00001
-            min = float(0)
-            max = float(1)
+            min = float(self.cropDMin - 0.00001)
+            max = float(self.cropDMax + 0.00001)
             self.scene.test.setClipMinMax(index, min,max)    #TODO: should 
get rid of epsilon...
        
     def SetValues(self, datavalues, nbuckets, widthn, heightn):

Modified: trunk/scenes/csafe/src/CDGridSpheres.cc
==============================================================================
--- trunk/scenes/csafe/src/CDGridSpheres.cc     (original)
+++ trunk/scenes/csafe/src/CDGridSpheres.cc     Tue Sep  9 01:23:24 2008
@@ -571,7 +571,7 @@
 void CDGridSpheres::shade(const RenderContext& context, RayPacket& rays) 
const
 {
         // Compute ambient light
-          ColorArray ambient;
+        //  ColorArray ambient;
          // activeLights->getAmbientLight()->computeAmbient(context, rays, 
ambient);
 
         // Shade a bunch of rays that have intersected the same particle

Modified: trunk/scenes/csafe/src/CDGridSpheres.h
==============================================================================
--- trunk/scenes/csafe/src/CDGridSpheres.h      (original)
+++ trunk/scenes/csafe/src/CDGridSpheres.h      Tue Sep  9 01:23:24 2008
@@ -16,6 +16,9 @@
 #include <Model/Materials/AmbientOcclusion.h>
 #include <Model/Materials/Volume.h>
 
+#include <iostream>
+
+
 #define USE_OPTIMIZED_FCNS
 
 namespace Manta {
@@ -54,7 +57,8 @@
                void setCMap(RGBAColorMap* map) { cmap = map; }
                bool clip(int s) const;
                void setClipMinMax(int index, float clipMin, float clipMax)
-               {
+                 {
+                   std::cout << "setting clipmin/max: " << clipMin << " " << 
clipMax << std::endl;
                        clipMins[index] = clipMin;
                        clipMaxs[index] = clipMax;
                }

Modified: trunk/scenes/csafe/src/CDTest.h
==============================================================================
--- trunk/scenes/csafe/src/CDTest.h     (original)
+++ trunk/scenes/csafe/src/CDTest.h     Tue Sep  9 01:23:24 2008
@@ -156,8 +156,8 @@
             duration = 10;
             numFrames1 = numFrames2 = numFrames = 1;
 
-            _minBound = Vector(-0.001, -0.101, -0.001);
-            _maxBound = Vector( 0.101, 0.201, 0.101);
+           _minBound = Vector(-0.001, -0.101, -0.001);
+           _maxBound = Vector( 0.101, 0.201, 0.101);
 
             if (!_volCMap)
             {
@@ -362,7 +362,9 @@
                //ParticleGrid* grid = new ParticleGrid(pnrrd, _radius, 
_ridx, _cidx);
                grid->setGroup(g);
                //grid->preprocess(context);
+               cout << "building grid\n";
                grid->rebuild();
+               cout << "done building grid\n";
 #endif
 #endif  //USE_GRIDSPHERES
               
@@ -740,7 +742,9 @@
         }
        
        void updateSphereCMap() {
+#if !USE_GRIDSPHERES
          _manta_interface->addOneShotCallback(MantaInterface::Relative, 1, 
Callback::create(this, &CDTest::setSphereCMapHelper));
+#endif
        }
 
        //! called by setSphereCMap
@@ -750,6 +754,8 @@
         {
          std::vector<Color> colors;
          RGBAColorMap* map = _setCMapHelper;
+         if (!map)
+           return;
          for(int i = 0; i < map->GetNumSlices(); i++) {
            colors.push_back(map->GetSlice(i).color.color);
          }
@@ -765,9 +771,12 @@
          */
         void setClipMinMax(int index, float min, float max)
         {
+         cout << "setclip called index: " << index << " sphereminssize: " << 
_sphereMins.size() << "\n";
             if (index >= int(_sphereMins.size()))
                 return;
-#if USE_SPHEREGRIDS
+           cout << "2\n";
+#if USE_GRIDSPHERES
+           cout << "setting clips\n";
            for(int i = 0; i < int(_sphereGrids.size()); i++)
                 if (_sphereGrids[i]) _sphereGrids[i]->setClipMinMax(index, 
min, max);
 #else
@@ -791,7 +800,7 @@
          */
         void setSphereColorMinMax(int index, float min, float max)   //set 
the min max for normalizing color data
         {
-#if USE_SPHEREGRIDS
+#if USE_GRIDSPHERES
           for(int i =0; i < int(_sphereGrids.size()); i++)
             _sphereGrids[i]->setCMinMax(index, min, max);
 #else
@@ -810,7 +819,7 @@
          */
         void getSphereColorMinMax(int index, float& min, float& max)
         {
-#if USE_SPHEREGRIDS
+#if USE_GRIDSPHERES
          for(int i =0;i<int(_sphereGrids.size());i++)
             _sphereGrids[i]->getCMinMax(index, min, max);
 #else
@@ -828,7 +837,7 @@
          */
         void getSphereDataMinMax(int index, float& min, float& max)
         {
-#if USE_SPHEREGRIDS
+#if USE_GRIDSPHERES
            for(int i =0;i<int(_sphereGrids.size());i++)
              _sphereGrids[i]->getCMinMax(index, min, max);
 #else
@@ -933,7 +942,7 @@
         //! set to use ambient occlusion on spheres
         void useAO(bool st)
         {
-#if USE_SPHEREGRIDS
+#if USE_GRIDSPHERES
 
           for(int i = 0; i < int(_sphereGrids.size()); i++)
              _sphereGrids[i]->useAmbientOcclusion(st);
@@ -950,7 +959,7 @@
         */
         void setAOVars(float cutoff, int numDirs)
         {
-         #if USE_SPHEREGRIDS
+         #if USE_GRIDSPHERES
             for(int i = 0; i < int(_sphereGrids.size()); i++)
                 _sphereGrids[i]->setAmbientOcclusionVariables(cutoff, 
numDirs);
          #endif
@@ -965,7 +974,7 @@
             for (vector<Volume<float>*>::iterator itr = _volsOld.begin(); 
itr != _volsOld.end(); itr++)
                 delete *itr;
             _volsOld.clear();
-#if USE_SPHEREGRIDS
+#if USE_GRIDSPHERES
            for (vector<CDGridSpheres*>::iterator itr = 
_sphereGridsOld.begin(); itr != _sphereGridsOld.end(); itr++)
                delete *itr;
 #endif


  • [Manta] r2321 - in trunk/scenes/csafe: python src, brownlee, 09/09/2008

Archive powered by MHonArc 2.6.16.

Top of page