Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r1476 - in trunk: Core/Geometry Model/Groups Model/Groups/private Model/MiscObjects Model/Readers fox/FManta scenes


Chronological Thread 
  • From: bigler@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r1476 - in trunk: Core/Geometry Model/Groups Model/Groups/private Model/MiscObjects Model/Readers fox/FManta scenes
  • Date: Mon, 16 Jul 2007 13:13:51 -0600 (MDT)

Author: bigler
Date: Mon Jul 16 13:13:49 2007
New Revision: 1476

Modified:
   trunk/Core/Geometry/varray.h
   trunk/Model/Groups/DynBVH.cc
   trunk/Model/Groups/DynBVH.h
   trunk/Model/Groups/Group.cc
   trunk/Model/Groups/Group.h
   trunk/Model/Groups/KDTreeLoaderIW.cc
   trunk/Model/Groups/TimeSteppedParticles.h
   trunk/Model/Groups/private/CGT.cc
   trunk/Model/Groups/private/CGT.h
   trunk/Model/Groups/private/ParticleCGT.cc
   trunk/Model/Groups/private/ParticleCGT.h
   trunk/Model/MiscObjects/KeyFrameAnimation.cc
   trunk/Model/Readers/PlyReader.cc
   trunk/fox/FManta/FMantaKdExplorer.cc
   trunk/scenes/boeing777.cc
   trunk/scenes/objviewer.cc
Log:

Core/Geometry/varray.h

  Don't use a #define to define the INT type.

Model/Groups/DynBVH.cc
Model/Groups/DynBVH.h

  Group::getSize() changed to Group::size().

  object_ids and num_nodes are now unsigned.

Model/Groups/Group.cc
Model/Groups/Group.h

  Group::getSize() changed to Group::size().

  int no longer used for indexing.  size_t is used to match the
  std::vector API.

  Other formatting and warning bashing.

Model/Groups/KDTreeLoaderIW.cc

  Removed unused variable.

Model/Groups/TimeSteppedParticles.h
Model/Groups/private/CGT.cc
Model/Groups/private/CGT.h
Model/Groups/private/ParticleCGT.cc
Model/Readers/PlyReader.cc
Model/MiscObjects/KeyFrameAnimation.cc
fox/FManta/FMantaKdExplorer.cc

  Group::getSize() changed to Group::size().

Model/Groups/private/ParticleCGT.h

  Reorder members to quiet GCC warning.

scenes/boeing777.cc
scenes/objviewer.cc

  Quiet some warnings.


Modified: trunk/Core/Geometry/varray.h
==============================================================================
--- trunk/Core/Geometry/varray.h        (original)
+++ trunk/Core/Geometry/varray.h        Mon Jul 16 13:13:49 2007
@@ -19,11 +19,10 @@
 
 //#define DEBUG_ARRAY
 
-//#define INT long long
-#define INT unsigned int
-
 template <class T>
 class VArray {
+public:
+  typedef unsigned int INT;
 protected:
        INT curLen;
        INT curMaxLen;

Modified: trunk/Model/Groups/DynBVH.cc
==============================================================================
--- trunk/Model/Groups/DynBVH.cc        (original)
+++ trunk/Model/Groups/DynBVH.cc        Mon Jul 16 13:13:49 2007
@@ -437,7 +437,7 @@
   //wants to improve on that, go for it.
   PreprocessContext context;
 
-  if(currGroup && currGroup->getSize() == group->getSize()) {
+  if(currGroup && currGroup->size() == group->size()) {
     currGroup = group;
     parallelUpdateBounds(context, proc, numProcs);
   }
@@ -447,19 +447,19 @@
     cerr << "\nDynBVH::preprocess START\n";
     double start = SCIRun::Time::currentSeconds();
 
-    if(group->getSize() > object_ids.size()) {
-      nodes.resize(2*group->getSize());
-      object_ids.resize(group->getSize());
+    if(group->size() > object_ids.size()) {
+      nodes.resize(2*group->size());
+      object_ids.resize(group->size());
       // TODO(boulos): Free these after construction? or keep around
       // for rebuild?
-      obj_bounds.resize(group->getSize());
-      obj_centroids.resize(group->getSize());
+      obj_bounds.resize(group->size());
+      obj_centroids.resize(group->size());
     }
 
 
     currGroup = group;
 
-    for ( int i = 0; i < currGroup->getSize(); i++ ) {
+    for ( size_t i = 0; i < currGroup->size(); i++ ) {
       object_ids[i] = i;
       currGroup->get(i)->computeBounds(context, obj_bounds[i]);
       obj_centroids[i] = obj_bounds[i].center();
@@ -468,7 +468,7 @@
     num_nodes = 1; // root node
     int nextFree = 1;
     double build_start = SCIRun::Time::currentSeconds();
-    build(context, 0, 0, currGroup->getSize(), nextFree);
+    build(context, 0, 0, currGroup->size(), nextFree);
     double updateBound_start = SCIRun::Time::currentSeconds();
     updateBounds(context, 0);
     double end = SCIRun::Time::currentSeconds();

Modified: trunk/Model/Groups/DynBVH.h
==============================================================================
--- trunk/Model/Groups/DynBVH.h (original)
+++ trunk/Model/Groups/DynBVH.h Mon Jul 16 13:13:49 2007
@@ -57,8 +57,8 @@
         };
 
         vector<BVHNode> nodes;
-        vector<int> object_ids;
-        int num_nodes;
+        vector<unsigned int> object_ids;
+        unsigned int num_nodes;
         Group* currGroup;
         SCIRun::Barrier barrier;
 

Modified: trunk/Model/Groups/Group.cc
==============================================================================
--- trunk/Model/Groups/Group.cc (original)
+++ trunk/Model/Groups/Group.cc Mon Jul 16 13:13:49 2007
@@ -11,13 +11,17 @@
   return new Group(args);
 }
 
-Group::Group(const vector<string>& /* args */): dirtybbox(true),
-       barrier("group barrier"), mutex("group mutex")
+Group::Group(const vector<string>& /* args */)
+  : dirtybbox(true),
+    barrier("group barrier"),
+    mutex("group mutex")
 {
 }
 
-Group::Group(): dirtybbox(true), barrier("group barrier"),
-                mutex("group mutex")
+Group::Group()
+  : dirtybbox(true),
+    barrier("group barrier"),
+    mutex("group mutex")
 {
 }
 
@@ -27,7 +31,7 @@
 
 Group* Group::clone(CloneDepth depth, Clonable* incoming)
 {
-  Group *copy;
+  Group* copy;
   if (incoming)
     copy = static_cast<Group*>(incoming);
   else
@@ -35,26 +39,25 @@
 
   //since we need to make clones of the things contained in the group,
   //we can't just do copy->objs = objs;
-  for(vector<Object*>::iterator iter = objs.begin();
-      iter != objs.end(); ++iter) {
-    Object *obj = *iter;
+  for(vector<Object*>::iterator iter = objs.begin(); iter != objs.end(); 
++iter) {
+    Object* obj = *iter;
     copy->objs.push_back(static_cast<Object*>(obj->clone(depth)));
   }
-  
+
   copy->bbox = bbox;
   copy->dirtybbox = dirtybbox;
 
   return copy;
 }
 
-Interpolable::InterpErr 
-Group::serialInterpolate(const std::vector<keyframe_t> &group_keyframes)
+Interpolable::InterpErr
+Group::serialInterpolate(const std::vector<keyframe_t>& group_keyframes)
 {
   return parallelInterpolate(group_keyframes, 0, 1);
 }
 
-Interpolable::InterpErr 
-Group::parallelInterpolate(const std::vector<keyframe_t> &group_keyframes,
+Interpolable::InterpErr
+Group::parallelInterpolate(const std::vector<keyframe_t>& group_keyframes,
                            int proc, int numProc)
 {
   if (proc == 0)
@@ -62,22 +65,22 @@
 
   InterpErr worstError = success;
   vector<keyframe_t> keyframes(group_keyframes);
-  
-  Group *groups[group_keyframes.size()];
-  for(unsigned int frame=0; frame < keyframes.size(); ++frame) {
+
+  Group* groups[group_keyframes.size()];
+  for(size_t frame=0; frame < keyframes.size(); ++frame) {
     Group *group = dynamic_cast<Group*>(group_keyframes[frame].keyframe);
     if (group == NULL)
       return notInterpolable;
     groups[frame] = group;
-    ASSERT(group->getSize() == getSize());
+    ASSERT(group->size() == size());
   }
 
   //Do the serial objects in parallel
-  int serialSize = (parallelSplit - objs.begin());
-  int start = proc*serialSize/numProc;
-  int end = (proc+1)*serialSize/numProc;
-  for (int i=start; i < end; ++i) {
-    for(unsigned int frame=0; frame < keyframes.size(); ++frame) {
+  size_t serialSize = (parallelSplit - objs.begin());
+  size_t start = proc*serialSize/numProc;
+  size_t end = (proc+1)*serialSize/numProc;
+  for (size_t i=start; i < end; ++i) {
+    for(size_t frame=0; frame < keyframes.size(); ++frame) {
       keyframes[frame].keyframe = groups[frame]->get(i);
     }
     InterpErr retcode = objs[i]->serialInterpolate(keyframes);
@@ -86,8 +89,8 @@
   }
 
   //now do the parallel objects
-  for (unsigned int i=serialSize; i < objs.size(); ++i) {
-    for(unsigned int frame=0; frame < keyframes.size(); ++frame) {
+  for (size_t i=serialSize; i < objs.size(); ++i) {
+    for(size_t frame=0; frame < keyframes.size(); ++frame) {
       keyframes[frame].keyframe = groups[frame]->get(i);
     }
     InterpErr retcode = objs[i]->parallelInterpolate(keyframes, proc, 
numProc);
@@ -106,20 +109,21 @@
   dirtybbox = true;
 }
 
-void Group::set(int i, Object *obj) {
+void Group::set(size_t i, Object* obj) {
   ASSERT( i < objs.size() );
   objs[i] = obj;
   dirtybbox = true;
 }
 
-Object *Group::get( int i ) {
+Object* Group::get( size_t i ) {
   ASSERT( i < objs.size() );
   return objs[i];
 }
 
-const Object* Group::get(int i) const
+const Object* Group::get(size_t i) const
 {
-    return objs[i];
+  ASSERT( i < objs.size() );
+  return objs[i];
 }
 
 bool Group::isDirty() const{
@@ -131,18 +135,13 @@
   dirtybbox = true;
 }
 
-void Group::shrinkTo(int firstNumObjs, bool deleteRemainder)
+void Group::shrinkTo(size_t firstNumObjs, bool deleteRemainder)
 {
-    if (deleteRemainder)
-        for(int i=firstNumObjs;i<static_cast<int>(objs.size());i++)
-            delete objs[i];
-    objs.resize(firstNumObjs);
-    dirtybbox = true;
-}
-
-int Group::getSize() const
-{
-  return static_cast<int>(objs.size());
+  if (deleteRemainder)
+    for(size_t i=firstNumObjs;i < objs.size(); i++)
+      delete objs[i];
+  objs.resize(firstNumObjs);
+  dirtybbox = true;
 }
 
 //used by partition
@@ -156,8 +155,7 @@
   //partition so that objs are serial and then parallel
   parallelSplit = partition(objs.begin(), objs.end(), isSerial);
 
-  for(vector<Object*>::iterator iter = objs.begin();
-      iter != objs.end(); ++iter)
+  for(vector<Object*>::iterator iter = objs.begin(); iter != objs.end(); 
++iter)
     (*iter)->preprocess(context);
   dirtybbox = true;
 }
@@ -165,7 +163,7 @@
 void Group::computeBounds(const PreprocessContext& context, BBox& bbox) const
 {
   if (dirtybbox) {
-      computeBounds(context, 0, 1);
+    computeBounds(context, 0, 1);
   }
   bbox.extendByBox(this->bbox);
 }
@@ -181,17 +179,16 @@
   }
 
   //Compute Bounding boxes in parallel
-  int size = getSize();
-  int start = proc*size/numProcs;
-  int end = (proc+1)*size/numProcs;
-  for (int i=start; i < end; ++i) {
+  size_t start = proc*size()/numProcs;
+  size_t end = (proc+1)*size()/numProcs;
+  for (size_t i=start; i < end; ++i) {
     objs[i]->computeBounds(dummyContext, myBBox);
   }
 
   //this barrier enforces that bbox has been initialized before
   //threads start writing to it.
   barrier.wait(numProcs);
-  
+
   mutex.lock();
   this->bbox.extendByBox(myBBox);
   mutex.unlock();
@@ -207,7 +204,6 @@
 
 void Group::intersect(const RenderContext& context, RayPacket& rays) const
 {
-  for(vector<Object*>::const_iterator iter = objs.begin();
-      iter != objs.end(); ++iter)
+  for(vector<Object*>::const_iterator iter = objs.begin(); iter != 
objs.end(); ++iter)
     (*iter)->intersect(context, rays);
 }

Modified: trunk/Model/Groups/Group.h
==============================================================================
--- trunk/Model/Groups/Group.h  (original)
+++ trunk/Model/Groups/Group.h  Mon Jul 16 13:13:49 2007
@@ -51,24 +51,24 @@
 #ifndef SWIG
     virtual Group* clone(CloneDepth depth, Clonable* incoming=NULL);
 
-    virtual InterpErr serialInterpolate(const std::vector<keyframe_t> 
&keyframes);
-    virtual InterpErr parallelInterpolate(const std::vector<keyframe_t> 
&keyframes,
+    virtual InterpErr serialInterpolate(const std::vector<keyframe_t>& 
keyframes);
+    virtual InterpErr parallelInterpolate(const std::vector<keyframe_t>& 
keyframes,
                                           int proc, int numProc);
 #endif
     virtual bool isParallel() const { return true; }
 
     virtual void add(Object* obj);
-    virtual void set( int i, Object *obj );
-    Object *get( int i );
-    const Object* get(int i) const;
+    virtual void set( size_t i, Object* obj );
+    Object* get( size_t i );
+    const Object* get( size_t i ) const;
     
     //whether the group has been modified (is dirty) and needs state,
     //such as the bounding box, to be updated.
     bool isDirty() const;
     void setDirty();
 
-    void shrinkTo(int firstNumObjs, bool deleteRemainder);
-    int getSize() const;
+    void shrinkTo(size_t firstNumObjs, bool deleteRemainder);
+    size_t size() const { return objs.size(); }
 
     virtual void preprocess(const PreprocessContext&);
     virtual void intersect(const RenderContext& context, RayPacket& rays) 
const;

Modified: trunk/Model/Groups/KDTreeLoaderIW.cc
==============================================================================
--- trunk/Model/Groups/KDTreeLoaderIW.cc        (original)
+++ trunk/Model/Groups/KDTreeLoaderIW.cc        Mon Jul 16 13:13:49 2007
@@ -199,7 +199,6 @@
   // Allocate space for the nodes
   KDTreeNode* nodes =
     reinterpret_cast<KDTreeNode*>(malloc(num_nodes*sizeof(KDTreeNode)));
-  KDTreeNode* current_node = nodes;
   unsigned int current_node_index = 0;
   
   unsigned int current_tri_index = 0;

Modified: trunk/Model/Groups/TimeSteppedParticles.h
==============================================================================
--- trunk/Model/Groups/TimeSteppedParticles.h   (original)
+++ trunk/Model/Groups/TimeSteppedParticles.h   Mon Jul 16 13:13:49 2007
@@ -27,11 +27,11 @@
     void computeBounds(const PreprocessContext& context, BBox& bbox) const;
 
     // GUI interface
-    void next(void) { tstep=(tstep + 1)%getSize(); }
-    void previous(void) { tstep=(tstep + getSize() - 1)%getSize(); }
+    void next(void) { tstep=(tstep + 1)%size(); }
+    void previous(void) { tstep=(tstep + size() - 1)%size(); }
 
   private:
-    int tstep;
+    size_t tstep;
   };
 }
 

Modified: trunk/Model/Groups/private/CGT.cc
==============================================================================
--- trunk/Model/Groups/private/CGT.cc   (original)
+++ trunk/Model/Groups/private/CGT.cc   Mon Jul 16 13:13:49 2007
@@ -61,17 +61,17 @@
 
   //make the current mailboxes big enough.
   if (mailboxes.empty() != true)
-    if (mailboxes[0].mailbox.size() < currGroup->getSize())
+    if (mailboxes[0].mailbox.size() < currGroup->size())
       for (size_t i=0; i < mailboxes.size(); ++i)
-        mailboxes[i].mailbox.resize(currGroup->getSize(), -1);
+        mailboxes[i].mailbox.resize(currGroup->size(), -1);
 
   //make new mailboxes if needed, and make the new ones big enough as well.
   if (mailboxes.size() < numProcs) {
     int oldSize = mailboxes.size();
     mailboxes.resize(numProcs);
     for (size_t i=max(oldSize-1, 0); i < numProcs; ++i)
-      mailboxes[i].mailbox.resize(max((int)mailboxes[0].mailbox.size(),
-                                      currGroup->getSize()),
+      mailboxes[i].mailbox.resize(max(mailboxes[0].mailbox.size(),
+                                      currGroup->size()),
                                   mailboxes[i].rayID);
   }
 
@@ -117,7 +117,7 @@
     sse_t epsilon = mul4(bounds.diameter(), set4(1e-4f));
     bounds.min = sub4(bounds.min,epsilon);
     bounds.max = add4(bounds.max,epsilon);
-    if (currGroup->getSize() == 0)
+    if (currGroup->size() == 0)
       return;
     diam = bounds.diameter();
 
@@ -139,9 +139,9 @@
     float _diam[4];
     for (int i=0; i < 4; ++i)
       _diam[i] = ((float4&)diam)[i];//store44(_diam,diam);
-    N[0] = (int)(powf(factor * currGroup->getSize() * _diam[0] * _diam[0] / 
(_diam[1] * _diam[2]), 1/3.));
-    N[1] = (int)(powf(factor * currGroup->getSize() * _diam[1] * _diam[1] / 
(_diam[0] * _diam[2]), 1/3.));
-    N[2] = (int)(powf(factor * currGroup->getSize() * _diam[2] * _diam[2] / 
(_diam[1] * _diam[0]), 1/3.));
+    N[0] = (int)(powf(factor * currGroup->size() * _diam[0] * _diam[0] / 
(_diam[1] * _diam[2]), 1/3.));
+    N[1] = (int)(powf(factor * currGroup->size() * _diam[1] * _diam[1] / 
(_diam[0] * _diam[2]), 1/3.));
+    N[2] = (int)(powf(factor * currGroup->size() * _diam[2] * _diam[2] / 
(_diam[1] * _diam[0]), 1/3.));
 
     N[0] = max(N[0],3);
     N[1] = max(N[1],3);
@@ -185,12 +185,11 @@
     splitLength = MAX_CELLS_WIDTH / ((float4&)scaleN)[0];
 
     if (cellVector.size() < N[0]*N[1]*N[2]) {
-      int oldSize = cellVector.size();
       cellVector.resize(N[0]*N[1]*N[2]);
     }
 
     if (firstTime)
-      cout << "building grid for " << currGroup->getSize() << " triangles, 
res = " << N[0] << "x" << N[1] << "x" << N[2] << endl << "bounds = " << 
bounds << endl;
+      cout << "building grid for " << currGroup->size() << " triangles, res 
= " << N[0] << "x" << N[1] << "x" << N[2] << endl << "bounds = " << bounds << 
endl;
 
     if (firstTime || DISPLAY_BUILD_TIMES)
       cout << "first stage of grid build : " 
@@ -276,7 +275,7 @@
   
   const int SCALER = 10;
   if (buildQueues.size() != numProcs*numProcs || 
-      SCALER*currGroup->getSize() > buildQueueCapacity) {
+      SCALER*currGroup->size() > buildQueueCapacity) {
     //The current method of deleting BIG arrays and recreating them
     //whenever the number of threads change is expensive. But since we
     //don't expect the number of threads to change very often, we'll
@@ -291,7 +290,7 @@
     buildQueue_sizes.resize(numProcs*numProcs);
     buildQueue_was_resized = true;
 
-    buildQueueCapacity = SCALER*currGroup->getSize();
+    buildQueueCapacity = SCALER*currGroup->size();
   }
   buildQueue_resize_mutex.unlock();
 
@@ -345,7 +344,7 @@
   vector<int> myBuildQueue_sizes(numProcs, 0);
 
 //   printf("thread %d exited first barrier\n", proc);
-  const int numTri = currGroup->getSize();
+  const int numTri = currGroup->size();
   const int startTri = (numTri * proc) / numProcs;
   const int endTri = (numTri * (proc+1)) / numProcs;
 
@@ -385,7 +384,7 @@
       int z1 = xyz[2];
 
       int c = x0 + N[0]*(y0+N[1]*z0);
-      const int numCells = (z1-z0+1)*(y1-y0+1)*(x1-x0+1);
+      //      const int numCells = (z1-z0+1)*(y1-y0+1)*(x1-x0+1);
 
       for (int z=z0;z<=z1;z++) {
         int q = z % (numProcs);

Modified: trunk/Model/Groups/private/CGT.h
==============================================================================
--- trunk/Model/Groups/private/CGT.h    (original)
+++ trunk/Model/Groups/private/CGT.h    Mon Jul 16 13:13:49 2007
@@ -143,8 +143,9 @@
   }
 
   Grid() : firstTime(true), mutex("generic build mutex"),
+           barrier("CGT build barrier"),
            buildQueue_resize_mutex("build queue resize mutex"),
-           barrier("CGT build barrier"), buildQueue_was_resized(false),
+           buildQueue_was_resized(false),
            currGroup(NULL)
   {
 #ifdef MACRO_CELLS

Modified: trunk/Model/Groups/private/ParticleCGT.cc
==============================================================================
--- trunk/Model/Groups/private/ParticleCGT.cc   (original)
+++ trunk/Model/Groups/private/ParticleCGT.cc   Mon Jul 16 13:13:49 2007
@@ -488,7 +488,7 @@
     sse_t epsilon = mul4(bounds.diameter(), set4(1e-4f));
     bounds.min = sub4(bounds.min,epsilon);
     bounds.max = add4(bounds.max,epsilon);
-    if (currGroup->getSize() == 0)
+    if (currGroup->size() == 0)
       return;
     diam = bounds.diameter();
 
@@ -510,9 +510,9 @@
       float _diam[4];
     for (int i=0; i < 4; ++i)
       _diam[i] = ((float4&)diam)[i];//store44(_diam,diam);
-    N[0] = (int)(powf(factor * currGroup->getSize() * _diam[0] * _diam[0] / 
(_diam[1] * _diam[2]), 1/3.));
-    N[1] = (int)(powf(factor * currGroup->getSize() * _diam[1] * _diam[1] / 
(_diam[0] * _diam[2]), 1/3.));
-    N[2] = (int)(powf(factor * currGroup->getSize() * _diam[2] * _diam[2] / 
(_diam[1] * _diam[0]), 1/3.));
+    N[0] = (int)(powf(factor * currGroup->size() * _diam[0] * _diam[0] / 
(_diam[1] * _diam[2]), 1/3.));
+    N[1] = (int)(powf(factor * currGroup->size() * _diam[1] * _diam[1] / 
(_diam[0] * _diam[2]), 1/3.));
+    N[2] = (int)(powf(factor * currGroup->size() * _diam[2] * _diam[2] / 
(_diam[1] * _diam[0]), 1/3.));
 
     N[0] = max(N[0],3);
     N[1] = max(N[1],3);
@@ -556,12 +556,11 @@
     splitLength = MAX_CELLS_WIDTH / ((float4&)scaleN)[0];
 
     if (cellVector.size() < N[0]*N[1]*N[2]) {
-      int oldSize = cellVector.size();
       cellVector.resize(N[0]*N[1]*N[2]);
     }
 
     if (firstTime)
-      cout << "building grid for " << currGroup->getSize() << " triangles, 
res = " << N[0] << "x" << N[1] << "x" << N[2] << endl << "bounds = " << 
bounds << endl;
+      cout << "building grid for " << currGroup->size() << " triangles, res 
= " << N[0] << "x" << N[1] << "x" << N[2] << endl << "bounds = " << bounds << 
endl;
 
     if (firstTime || DISPLAY_BUILD_TIMES)
       cout << "first stage of grid build : " 
@@ -652,7 +651,7 @@
   
       const int SCALER = 10;
       if (buildQueues.size() != numProcs*numProcs || 
-          SCALER*currGroup->getSize() > buildQueueCapacity) {
+          SCALER*currGroup->size() > buildQueueCapacity) {
         //The current method of deleting BIG arrays and recreating them
         //whenever the number of threads change is expensive. But since we
         //don't expect the number of threads to change very often, we'll
@@ -667,7 +666,7 @@
         buildQueue_sizes.resize(numProcs*numProcs);
         buildQueue_was_resized = true;
 
-        buildQueueCapacity = SCALER*currGroup->getSize();
+        buildQueueCapacity = SCALER*currGroup->size();
       }
       buildQueue_resize_mutex.unlock();
 
@@ -721,7 +720,7 @@
       vector<int> myBuildQueue_sizes(numProcs, 0);
 
       //   printf("thread %d exited first barrier\n", proc);
-      const int numTri = currGroup->getSize();
+      const int numTri = currGroup->size();
       const int startTri = (numTri * proc) / numProcs;
       const int endTri = (numTri * (proc+1)) / numProcs;
 
@@ -761,7 +760,7 @@
         int z1 = xyz[2];
 
         int c = x0 + N[0]*(y0+N[1]*z0);
-        const int numCells = (z1-z0+1)*(y1-y0+1)*(x1-x0+1);
+        //        const int numCells = (z1-z0+1)*(y1-y0+1)*(x1-x0+1);
 
         for (int z=z0;z<=z1;z++) {
           int q = z % (numProcs);

Modified: trunk/Model/Groups/private/ParticleCGT.h
==============================================================================
--- trunk/Model/Groups/private/ParticleCGT.h    (original)
+++ trunk/Model/Groups/private/ParticleCGT.h    Mon Jul 16 13:13:49 2007
@@ -335,8 +335,9 @@
 
     ParticleGrid() :
       firstTime(true), mutex("generic build mutex"),
+      barrier("CGT build barrier"),
       buildQueue_resize_mutex("build queue resize mutex"),
-      barrier("CGT build barrier"), buildQueue_was_resized(false),
+      buildQueue_was_resized(false),
       currGroup(NULL)
     {
 #ifdef MACRO_CELLS

Modified: trunk/Model/MiscObjects/KeyFrameAnimation.cc
==============================================================================
--- trunk/Model/MiscObjects/KeyFrameAnimation.cc        (original)
+++ trunk/Model/MiscObjects/KeyFrameAnimation.cc        Mon Jul 16 13:13:49 
2007
@@ -104,7 +104,7 @@
       int end   = (start+1) % frames.size();
       float t = frame - start;
 
-      assert(frames[start]->getSize() == frames[end]->getSize());
+      assert(frames[start]->size() == frames[end]->size());
       std::vector<keyframe_t> keyframes(2);
       keyframes[0].keyframe = frames[start];
       keyframes[0].t = 1-t;

Modified: trunk/Model/Readers/PlyReader.cc
==============================================================================
--- trunk/Model/Readers/PlyReader.cc    (original)
+++ trunk/Model/Readers/PlyReader.cc    Mon Jul 16 13:13:49 2007
@@ -129,7 +129,7 @@
 Manta::readPlyFile(const string fileName, AffineTransform &_t, 
                    Mesh *mesh, Material *m) {
      long nVertices;
-     int objs_start = mesh->getSize();
+     size_t objs_start = mesh->size();
      unsigned int vertex_indices_start = mesh->vertex_indices.size();
      vertices_start = mesh->vertices.size();
 

Modified: trunk/fox/FManta/FMantaKdExplorer.cc
==============================================================================
--- trunk/fox/FManta/FMantaKdExplorer.cc        (original)
+++ trunk/fox/FManta/FMantaKdExplorer.cc        Mon Jul 16 13:13:49 2007
@@ -316,7 +316,7 @@
   
   // Check to see if the plane group already has a parallelogram.
   // If so delete it.
-  if (plane_group->getSize() == 3) {
+  if (plane_group->size() == 3) {
     Object *old = plane_group->get(1);
     delete old;
     old = plane_group->get(2);

Modified: trunk/scenes/boeing777.cc
==============================================================================
--- trunk/scenes/boeing777.cc   (original)
+++ trunk/scenes/boeing777.cc   Mon Jul 16 13:13:49 2007
@@ -119,7 +119,7 @@
   string bg_method = "";
   
        // Parse args.i
-       for (int i=0;i<args.size();++i) {
+       for (int i=0;i<static_cast<int>(args.size());++i) {
                if (args[i] == "-file") {
                        // Determine the index of the filename.
                        if (!getStringArg(i, args, file_name))

Modified: trunk/scenes/objviewer.cc
==============================================================================
--- trunk/scenes/objviewer.cc   (original)
+++ trunk/scenes/objviewer.cc   Mon Jul 16 13:13:49 2007
@@ -124,7 +124,7 @@
 Scene* make_scene(const ReadContext& context, const vector<string>& args) {
 
     // Check the arguments.
-    for (int i=0;i<args.size();++i) {
+    for (int i=0;i<static_cast<int>(args.size());++i) {
 
         if (args[i] == "-file") {
             // Read in the file name.
@@ -223,7 +223,7 @@
         std::cerr << "Min: " << bmin << " Max: " << bmax << " translate: " 
<< translate << std::endl;
 
         Vectorf *vertex;
-        for (int i=1;i<=model->numvertices;++i) {
+        for (size_t i=1;i<=model->numvertices;++i) {
             vertex = (Vectorf *)&model->vertices[i*3];
 
             vertex->operator-=(translate);
@@ -254,11 +254,11 @@
     Material* red=new Lambertian(Color(RGBColor(.6,0,0)));
     Material* yellow=new Lambertian(Color(RGBColor(.6,.6,0)));
 
-    // Add a floor.
-    Parallelogram* floor = new Parallelogram(yellow, 
Vector(-20,-20,bounds[0][2]),
-                                             Vector(40,0,0), Vector(0,40,0));
     Group *manta_group = new Group();
-    // manta_group->add( floor );
+//     // Add a floor.
+//     Parallelogram* floor = new Parallelogram(yellow, 
Vector(-20,-20,bounds[0][2]),
+//                                              Vector(40,0,0), 
Vector(0,40,0));
+//     manta_group->add( floor );
 
     if (display_bounds) {
         manta_group->add( new Cube( red, bounds[0], bounds[1] ) );
@@ -341,7 +341,7 @@
     // Path to the model for loading textures.
     string model_path = model->pathname;
 
-    int pos = model_path.rfind( '/' );
+    size_t pos = model_path.rfind( '/' );
     if (pos != string::npos) {
         model_path = model_path.substr( 0, pos+1 );
     }
@@ -349,7 +349,7 @@
     material_array = new Material *[ model->nummaterials ];
 
     // Read in the materials.
-    for (int i=0;i<model->nummaterials;++i) {
+    for (unsigned int i=0;i<model->nummaterials;++i) {
 
         
//////////////////////////////////////////////////////////////////////
         // Copy out material attributes.
@@ -369,9 +369,9 @@
 
         float Ns     = model->materials[i].shininess;
         float Tr     = model->materials[i].refraction;
-        float alpha  = model->materials[i].alpha;
+//         float alpha  = model->materials[i].alpha;
         float reflectivity = model->materials[i].reflectivity;
-        int   shader = model->materials[i].shader;
+//         int   shader = model->materials[i].shader;
 
         // Copy out texture names.
         // string ambient_map_name  = (model->materials[i].ambient_map[0]  
!= '\0') ?
@@ -383,8 +383,8 @@
         float* diffuse_map_scaling = model->materials[i].diffuse_map_scaling;
         float* specular_map_scaling = 
model->materials[i].specular_map_scaling;
 
-        int index = i;
-        if (blender) {
+        unsigned int index = i;
+        if (blender && index > 0) {
           // Note that the first material added by blender is always an
           // unused default material..
           --index;
@@ -402,8 +402,8 @@
             std::cerr << "Material " << index << " dielectric" << std::endl;
 
             // Constant textures for refraction parameters.
-            Texture<Real> *n  = new Constant<Real>( 1.6 );
-            Texture<Real> *nt = new Constant<Real>( 1.0 );
+//             Texture<Real> *n  = new Constant<Real>( 1.6 );
+//             Texture<Real> *nt = new Constant<Real>( 1.0 );
 
             Texture<Color> *diffuse_map = check_for_texture( model_path, 
diffuse_map_name, diffuse , diffuse_map_scaling);
             // Texture<Color> *diffuse_map = new Constant<Color>( 
Color(RGB(.9, .8, .8)) );
@@ -498,8 +498,8 @@
     while (group != 0) {
         // Determine the material for this group.
         Material *material;
-        int material_index = group->material;
-        if (blender) --material_index;
+        unsigned int material_index = group->material;
+        if (blender && material_index > 0) --material_index;
         if (material_index < model->nummaterials) {
           material = material_array[material_index];
         }




  • [MANTA] r1476 - in trunk: Core/Geometry Model/Groups Model/Groups/private Model/MiscObjects Model/Readers fox/FManta scenes, bigler, 07/16/2007

Archive powered by MHonArc 2.6.16.

Top of page