[cgma-dev] r1926 - in cgm/trunk: geom geom/Cholla util

janehu at mcs.anl.gov janehu at mcs.anl.gov
Wed Jun 25 12:34:56 CDT 2008


Author: janehu
Date: 2008-06-25 12:34:56 -0500 (Wed, 25 Jun 2008)
New Revision: 1926

Modified:
   cgm/trunk/geom/Cholla/CubitFacet.hpp
   cgm/trunk/geom/Cholla/CubitPoint.hpp
   cgm/trunk/geom/Curve.hpp
   cgm/trunk/geom/DagType.hpp
   cgm/trunk/geom/IntermediateGeomEngine.hpp
   cgm/trunk/geom/RefEntity.hpp
   cgm/trunk/geom/TBOwner.hpp
   cgm/trunk/util/CubitFileIOWrapper.hpp
   cgm/trunk/util/CubitString.hpp
   cgm/trunk/util/CubitUtil.hpp
   cgm/trunk/util/CubitVector.hpp
   cgm/trunk/util/DLIList.cpp
   cgm/trunk/util/DLIList.hpp
   cgm/trunk/util/KDDTree.cpp
   cgm/trunk/util/KDDTree.hpp
   cgm/trunk/util/PriorityQueue.cpp
   cgm/trunk/util/RTreeNode.cpp
   cgm/trunk/util/RTreeNode.hpp
Log:
Check in for Serge Gosselin to remove compiling warnings we see in CGM.

Modified: cgm/trunk/geom/Cholla/CubitFacet.hpp
===================================================================
--- cgm/trunk/geom/Cholla/CubitFacet.hpp	2008-06-25 14:31:10 UTC (rev 1925)
+++ cgm/trunk/geom/Cholla/CubitFacet.hpp	2008-06-25 17:34:56 UTC (rev 1926)
@@ -134,7 +134,7 @@
   virtual int id() = 0; 
   virtual void set_id( int ii ) = 0; 
   int tool_id(){return toolID;} 
-  void set_tool_id(int tool_id){toolID = tool_id;} 
+  void set_tool_id(int my_tool_id){toolID = my_tool_id;} 
        
   virtual CubitFacetEdge *edge( int index ) = 0; 
   virtual void edge( CubitFacetEdge *the_edge, int index ) = 0; 
@@ -261,7 +261,7 @@
     //- Returns all adjacent facets to this edge (not including 
     //- this facet) 
   
-  CubitFacet *adjacent( int &index, int *tool_data )  
+  CubitFacet *adjacent( int &index, int *my_tool_data )  
     //- Returns all adjacent facets to this edge index(not including 
     //- this facet) 
   {
@@ -270,7 +270,7 @@
 		CubitPoint *p1, *p2; 
    
 		get_edge_pts( index, p1, p2 ); 
-		return shared_facet_on_surf( p1, p2, *tool_data ); 
+		return shared_facet_on_surf( p1, p2, *my_tool_data ); 
   } 
 
   CubitPoint* next_node(CubitPoint *current_point)

Modified: cgm/trunk/geom/Cholla/CubitPoint.hpp
===================================================================
--- cgm/trunk/geom/Cholla/CubitPoint.hpp	2008-06-25 14:31:10 UTC (rev 1925)
+++ cgm/trunk/geom/Cholla/CubitPoint.hpp	2008-06-25 17:34:56 UTC (rev 1926)
@@ -85,7 +85,7 @@
   virtual double z() = 0;
   virtual void set( const CubitVector &pos ) = 0;
 
-  virtual void marked(int marked) {markedFlag = marked;};
+  virtual void marked(int is_marked) {markedFlag = is_marked;};
   virtual int marked() {return markedFlag;};
       
   virtual CubitVector coordinates() const = 0;
@@ -111,8 +111,9 @@
   virtual double u() { return uVal; };
   virtual double v() { return vVal; };
   virtual double size() {return sizeVal; };
-  virtual void set_uv( double u, double v ) { uVal = u; vVal = v; };
-  virtual void set_uvs(double u, double v, double s) {uVal = u; vVal = v; sizeVal = s; }
+  virtual void set_uv( double u_new, double v_new ) { uVal = u_new; vVal = v_new; };
+  virtual void set_uvs(double u_new, double v_new, double s_new) 
+    {uVal = u_new; vVal = v_new; sizeVal = s_new; }
     //- get and set the u-v coordinates (careful with internal boundaries - see TDFacetBoundarPoint)
   virtual CubitStatus get_uv( CubitFacet *facet, double &u, double &v );
   virtual CubitStatus get_uvs( CubitFacet *facet, double &u, double &v, double &s);

Modified: cgm/trunk/geom/Curve.hpp
===================================================================
--- cgm/trunk/geom/Curve.hpp	2008-06-25 14:31:10 UTC (rev 1925)
+++ cgm/trunk/geom/Curve.hpp	2008-06-25 17:34:56 UTC (rev 1926)
@@ -109,7 +109,7 @@
   
   virtual CubitStatus mid_point(const CubitVector &point1,
                                 const CubitVector &point2,
-                                CubitVector& mid_point );
+                                CubitVector& my_mid_point );
     //R CubitStatus
     //I CubitVector, CubitVector
     //I- points between which the mid_point is needed
@@ -118,7 +118,7 @@
     //- This function returns the mid point between two points on this
     //-edge, by parameter
   
-  virtual CubitStatus mid_point(CubitVector& mid_point);
+  virtual CubitStatus mid_point(CubitVector& my_mid_point);
     //R CubitStatus
     //O CubitVector
     //O- mid point on this edge
@@ -397,11 +397,11 @@
 }
 
 inline
-CubitStatus Curve::mid_point(CubitVector &mid_point)
+CubitStatus Curve::mid_point(CubitVector &my_mid_point)
 {
   double param1 = 0.5 * (start_param() + end_param());
   
-  return position_from_u(param1, mid_point);
+  return position_from_u(param1, my_mid_point);
 }
 
 inline
@@ -418,12 +418,12 @@
 inline
 CubitStatus Curve::mid_point(const CubitVector &point1,
                              const CubitVector &point2,
-                             CubitVector& mid_point )
+                             CubitVector& my_mid_point )
 {
   double param1 = u_from_position(point1);
   double param2 = u_from_position(point2);
   param1 = 0.5 * (param1 + param2);
-  return position_from_u(param1, mid_point);
+  return position_from_u(param1, my_mid_point);
 }
 
   //R CubitStatus

Modified: cgm/trunk/geom/DagType.hpp
===================================================================
--- cgm/trunk/geom/DagType.hpp	2008-06-25 14:31:10 UTC (rev 1925)
+++ cgm/trunk/geom/DagType.hpp	2008-06-25 17:34:56 UTC (rev 1926)
@@ -27,8 +27,8 @@
       // Dimension may be outside the range [0,3], but
       // if so is_valid() will return false.  (i.e. it is
       // possible to construct invalid DagType objects.)
-    inline DagType( int dimension, FunctionalType func )
-      : intType( 3 * dimension + func ) 
+    inline DagType( int my_dimension, FunctionalType func )
+      : intType( 3 * my_dimension + func ) 
       { }
     
     
@@ -44,7 +44,7 @@
       // Return values are one of GroupingEntity_TYPE,
       // SenseEntity_TYPE, or BasicTopologyEntity_TYPE.
     inline FunctionalType functional_type() const
-      { return (FunctionalType)(intType % 3); }
+      { return static_cast<FunctionalType> (intType % 3); }
       
     
       // Is this a valid DagType?  
@@ -55,8 +55,8 @@
       // move above a Body or below a RefVertex in the DAG.
     inline bool is_valid() const
       { 
-        const unsigned body_type = 11;
-        return (unsigned)intType <= body_type;
+        const unsigned my_body_type = 11;
+        return static_cast<unsigned>(intType) <= my_body_type;
       }
       
       // get parent of this type

Modified: cgm/trunk/geom/IntermediateGeomEngine.hpp
===================================================================
--- cgm/trunk/geom/IntermediateGeomEngine.hpp	2008-06-25 14:31:10 UTC (rev 1925)
+++ cgm/trunk/geom/IntermediateGeomEngine.hpp	2008-06-25 17:34:56 UTC (rev 1926)
@@ -12,6 +12,9 @@
 {
 
 public:
+  
+  virtual ~IntermediateGeomEngine() {}
+
   virtual bool is_composite(TBOwner *bridge_owner) = 0;
   virtual bool is_partition(TBOwner *bridge_owner) = 0;
 

Modified: cgm/trunk/geom/RefEntity.hpp
===================================================================
--- cgm/trunk/geom/RefEntity.hpp	2008-06-25 14:31:10 UTC (rev 1925)
+++ cgm/trunk/geom/RefEntity.hpp	2008-06-25 17:34:56 UTC (rev 1926)
@@ -304,7 +304,7 @@
 
 inline int
 RefEntity::marked()
-{return (int) markedFlag;}
+{return static_cast<int>(markedFlag);}
 
 inline void
 RefEntity::list_mark(int value)

Modified: cgm/trunk/geom/TBOwner.hpp
===================================================================
--- cgm/trunk/geom/TBOwner.hpp	2008-06-25 14:31:10 UTC (rev 1925)
+++ cgm/trunk/geom/TBOwner.hpp	2008-06-25 17:34:56 UTC (rev 1926)
@@ -22,6 +22,8 @@
 {
 
   public:
+
+    virtual ~TBOwner() {}
   
     virtual CubitStatus remove_bridge( TopologyBridge* bridge ) = 0;
     
@@ -33,7 +35,7 @@
                                      bool reversed ) = 0;
                                      
     virtual CubitBoolean contains_bridge( TopologyBridge* bridge ) const
-      { return (CubitBoolean)(bridge->owner() == this); }
+      { return static_cast<CubitBoolean>(bridge->owner() == this); }
     
     virtual void notify_reversed( TopologyBridge* ) = 0;
 

Modified: cgm/trunk/util/CubitFileIOWrapper.hpp
===================================================================
--- cgm/trunk/util/CubitFileIOWrapper.hpp	2008-06-25 14:31:10 UTC (rev 1925)
+++ cgm/trunk/util/CubitFileIOWrapper.hpp	2008-06-25 17:34:56 UTC (rev 1926)
@@ -77,7 +77,7 @@
     unsigned char* lpCurFromByte;
     unsigned char lachrBuffer[sizeof(T)];
     
-    unsigned char* lpCurAtom = (unsigned char*)xpT;
+    unsigned char* lpCurAtom = reinterpret_cast<unsigned char*>(xpT);
     int lintAtom = xintCount;
     while(lintAtom) {
         lintAtom--;

Modified: cgm/trunk/util/CubitString.hpp
===================================================================
--- cgm/trunk/util/CubitString.hpp	2008-06-25 14:31:10 UTC (rev 1925)
+++ cgm/trunk/util/CubitString.hpp	2008-06-25 17:34:56 UTC (rev 1926)
@@ -27,7 +27,7 @@
 
 class CubitStringRep;
 
-const size_t MAX_POS = (size_t) -1;    // "SIZE_T_MAX"
+const size_t MAX_POS = static_cast<size_t>(-1);    // "SIZE_T_MAX"
 
 class CUBIT_UTIL_EXPORT CubitString
 {

Modified: cgm/trunk/util/CubitUtil.hpp
===================================================================
--- cgm/trunk/util/CubitUtil.hpp	2008-06-25 14:31:10 UTC (rev 1925)
+++ cgm/trunk/util/CubitUtil.hpp	2008-06-25 17:34:56 UTC (rev 1926)
@@ -130,7 +130,7 @@
            sense == CUBIT_REVERSED );
    if ( sense == CUBIT_UNKNOWN ) return CUBIT_UNKNOWN;
    else {
-      CubitSense opp_sense = (CubitSense) (1 - sense);
+      CubitSense opp_sense = static_cast<CubitSense>(1 - sense);
       return opp_sense;
    }
 }

Modified: cgm/trunk/util/CubitVector.hpp
===================================================================
--- cgm/trunk/util/CubitVector.hpp	2008-06-25 14:31:10 UTC (rev 1925)
+++ cgm/trunk/util/CubitVector.hpp	2008-06-25 17:34:56 UTC (rev 1926)
@@ -44,7 +44,7 @@
   CubitVector(const CubitVectorStruct& from);  
   
     //- Heading: Set and Inquire Functions
-  void set(const double x, const double y, const double z);
+  void set(const double x_coord, const double y_coord, const double z_coord);
     //- Change vector components to {x}, {y}, and {z}
   
   void set( const double xyz[3] );
@@ -66,22 +66,22 @@
   double& y();
   double& z();
   
-  void get_xyz( double &x, double &y, double &z ) const; //- Get x, y, z components
+  void get_xyz( double &x_coord, double &y_coord, double &z_coord ) const; //- Get x, y, z components
   void get_xyz( double xyz[3] ) const; //- Get xyz tuple
   
   double &r(); //- Return r component of vector, if (r,theta) format
   
   double &theta();  //- Return theta component of vector, if (r,theta) format
   
-  void x( const double x ); //- Set x component of vector
+  void x( const double x_coord ); //- Set x component of vector
   
-  void y( const double y ); //- Set y component of vector
+  void y( const double y_coord ); //- Set y component of vector
   
-  void z( const double z ); //- Set z component of vector
+  void z( const double z_coord ); //- Set z component of vector
   
-  void r( const double x ); //- Set r component of vector, if (r,theta) format
+  void r( const double radius ); //- Set r component of vector, if (r,theta) format
   
-  void theta( const double y ); //- Set theta component of vector, if (r,theta) format
+  void theta( const double angle ); //- Set theta component of vector, if (r,theta) format
   
   void xy_to_rtheta();
     //- convert from cartesian to polar coordinates, just 2d for now
@@ -303,26 +303,26 @@
   xyz[1] = yVal;
   xyz[2] = zVal;
 }
-inline void CubitVector::get_xyz(double &x, double &y, double &z) const
+inline void CubitVector::get_xyz(double &x_coord, double &y_coord, double &z_coord) const
 {
-  x = xVal; 
-  y = yVal; 
-  z = zVal;
+  x_coord = xVal; 
+  y_coord = yVal; 
+  z_coord = zVal;
 }
 inline double &CubitVector::r()
 { return xVal; }
 inline double &CubitVector::theta()
 { return yVal; }
-inline void CubitVector::x( const double x )
-{ xVal = x; }
-inline void CubitVector::y( const double y )
-{ yVal = y; }
-inline void CubitVector::z( const double z )
-{ zVal = z; }
-inline void CubitVector::r( const double x )
-{ xVal = x; }
-inline void CubitVector::theta( const double y )
-{ yVal = y; }
+inline void CubitVector::x( const double x_coord )
+{ xVal = x_coord; }
+inline void CubitVector::y( const double y_coord )
+{ yVal = y_coord; }
+inline void CubitVector::z( const double z_coord )
+{ zVal = z_coord; }
+inline void CubitVector::r( const double radius )
+{ xVal = radius; }
+inline void CubitVector::theta( const double angle )
+{ yVal = angle; }
 inline CubitVector& CubitVector::operator+=(const CubitVector &v)
 {
   xVal += v.xVal;
@@ -386,13 +386,13 @@
   y( -temp );
 }
 
-inline void CubitVector::set(const double x,
-                             const double y,
-                             const double z)
+inline void CubitVector::set(const double x_coord,
+                             const double y_coord,
+                             const double z_coord)
 {
-  xVal = x;
-  yVal = y;
-  zVal = z;
+  xVal = x_coord;
+  yVal = y_coord;
+  zVal = z_coord;
 }
 
 inline void CubitVector::set(const double xyz[3])

Modified: cgm/trunk/util/DLIList.cpp
===================================================================
--- cgm/trunk/util/DLIList.cpp	2008-06-25 14:31:10 UTC (rev 1925)
+++ cgm/trunk/util/DLIList.cpp	2008-06-25 17:34:56 UTC (rev 1926)
@@ -27,16 +27,16 @@
 //- will be grown by {increment} each time it is filled. Memory for the
 //- list is not allocated until the first element is inserted using
 //- {insertLink}. 
-template <class X> MY_INLINE DLIList<X>::DLIList (int size)
+template <class X> MY_INLINE DLIList<X>::DLIList (int list_size)
 {
    index      = 0;
    itemCount  = 0;
    listLength = 0;
    listArray  = NULL;
-   if (size)
+   if (list_size)
    {
-      listArray = new X [size];
-      listLength = size;
+      listArray = new X [list_size];
+      listLength = list_size;
    }
 }
 
@@ -76,7 +76,7 @@
 {
     // Make a new array
   int new_size = 
-    (int) ((double)listLength * by_what_factor)
+    static_cast<int>( static_cast<double>(listLength) * by_what_factor )
     + by_how_much;
   X* temp_list = new X [new_size];
 
@@ -173,7 +173,7 @@
   X* end1 = iter1 + itemCount;               // end of this array
   X* iter2 = intersect_list.listArray;       // iterstor for other array
   X* end2 = iter2 + intersect_list.itemCount;// end of other array
-  X* insert = iter1 - 1;                     // location of last insert
+  X* last_insert = iter1 - 1;                // location of last insert
   
   for ( ; iter1 < end1; ++iter1 )
   {
@@ -183,13 +183,13 @@
     if (iter2 == end2)
       break;
     
-    if ((*iter2 == *iter1) &&   // items are the same and ...
-        (insert < listArray ||  // is the first item or ...
-         *iter1 != *insert))    // is not the same as the previous item
-      *++insert = *iter1;
+    if ((*iter2 == *iter1) &&        // items are the same and ...
+        (last_insert < listArray ||  // is the first item or ...
+         *iter1 != *last_insert))    // is not the same as the previous item
+      *++last_insert = *iter1;
   }
   
-  itemCount = insert - listArray + 1;
+  itemCount = last_insert - listArray + 1;
   reset();
 }    
 
@@ -218,7 +218,7 @@
 
 template <class X> MY_INLINE void DLIList<X>::intersect ( void* merge_list )
 {
-  intersect( *(DLIList<X>*)merge_list );
+  intersect( *static_cast< DLIList<X>* >(merge_list) );
 }
 
 
@@ -230,7 +230,7 @@
    if ( !itemCount )
    {
       PRINT_WARNING("Attempted link removal from empty DLIList\n");
-      return (X)0;
+      return X(0);
    }
 
      // save the current value
@@ -267,7 +267,7 @@
    if ( !itemCount )
    {
       PRINT_WARNING("Attempted link removal from empty DLIList\n");
-      return (X)0;
+      return X(0);
    }
 
      // save the current value
@@ -334,7 +334,7 @@
    if ( !itemCount )
    {
       PRINT_WARNING("Attempted step_and_get from empty DLIList\n");
-      return (X)0;
+      return X(0);
    }
 
    if (++index == itemCount)
@@ -400,7 +400,7 @@
 template <class X> MY_INLINE DLIList<X>& DLIList<X>::
                        operator+=(void* from)
 {
-  DLIList<X>* cast_from = (DLIList<X>*)from;
+  DLIList<X>* cast_from = static_cast< DLIList<X>* >(from);
   
      // Don't do anything if the list being appended is empty.
    if (cast_from->itemCount == 0)
@@ -594,14 +594,14 @@
 {
    // report amount of memory allocated
 
-   int size = listLength * sizeof(X);
+   int my_size = listLength * sizeof(X);
 
    if (verbose_boolean)
    {
-      PRINT_INFO("      DLIList: %d bytes\n",size);
+      PRINT_INFO("      DLIList: %d bytes\n", my_size);
    }
 
-   return size;
+   return my_size;
 }
 
 template <class X> MY_INLINE void DLIList<X>::copy_to(X *other_array)

Modified: cgm/trunk/util/DLIList.hpp
===================================================================
--- cgm/trunk/util/DLIList.hpp	2008-06-25 14:31:10 UTC (rev 1925)
+++ cgm/trunk/util/DLIList.hpp	2008-06-25 17:34:56 UTC (rev 1926)
@@ -37,7 +37,7 @@
 public:
   friend class DLIListIterator<X>;
   
-  explicit DLIList (int size = 0);
+  explicit DLIList (int list_size = 0);
     //- Constructor: Create a list with initial size 'size'. Memory for the
     //- list is not allocated until the first element is added to the list. 
   
@@ -109,7 +109,7 @@
   int operator==(const DLIList<X>& from);
   int operator!=(const DLIList<X>& from);
 
-  X & operator[](int index) const;
+  X & operator[](int my_index) const;
   void merge_unique(const DLIList<X>& merge_list, 
                     bool merge_list_unique = false);
     //- Merges the contents of the list, merge_list, with those of "this"
@@ -264,10 +264,10 @@
 }
 
 template <class X> inline
-X & DLIList<X>::operator[](int index) const
+X & DLIList<X>::operator[](int my_index) const
 {
-    assert( index >= 0 && index < itemCount );
-    return listArray[index];
+    assert( my_index >= 0 && my_index < itemCount );
+    return listArray[my_index];
 }
 
 template <class X> inline void DLIList<X>::step()
@@ -379,7 +379,7 @@
   if ( !itemCount )
   {
     PRINT_WARNING("Attempted get of empty DLIList\n");
-    return (X)0;
+    return X(0);
   }
   else
   {
@@ -393,7 +393,7 @@
   if ( !itemCount )
   {
     PRINT_WARNING("Attempted get_and_step from empty DLIList\n");
-    return (X)0;
+    return X(0);
   }
   else
 #endif
@@ -410,7 +410,7 @@
    if ( !itemCount )
    {
       PRINT_WARNING("Attempted get_and_back from empty DLIList\n");
-      return (X)0;
+      return X(0);
    }
    X temp = listArray[index--];
    if (index < 0)
@@ -423,7 +423,7 @@
   if (!itemCount)
   {
     PRINT_WARNING("Attempted next of empty DLIList\n");
-    return (X)0;
+    return X(0);
   }
   else if (index == itemCount-1)
     return listArray[0];
@@ -436,7 +436,7 @@
   if ( !itemCount )
   {
     PRINT_WARNING("Attempted next of empty DLIList\n");
-    return (X)0;
+    return X(0);
   }
   else
   {
@@ -484,7 +484,7 @@
 
 template <class X> inline X DLIList<X>::change_to (X new_value)
 {
-  X temp = (X)0;
+  X temp = X(0);
   if ( !itemCount )
   {
     PRINT_WARNING("DLIList: Attempted update of empty list\n");
@@ -516,7 +516,7 @@
 // If the item was found and removed it is returned, else 0 is returned.
 template <class X> inline X DLIList<X>::remove (X item)
 {
-  X temp = (X)0;
+  X temp = X(0);
   if (move_to(item))
     temp = remove();
   return temp;

Modified: cgm/trunk/util/KDDTree.cpp
===================================================================
--- cgm/trunk/util/KDDTree.cpp	2008-06-25 14:31:10 UTC (rev 1925)
+++ cgm/trunk/util/KDDTree.cpp	2008-06-25 17:34:56 UTC (rev 1926)
@@ -60,7 +60,7 @@
   if (myRandomOn)
   {
     //// seed the random number generator
-    srand( (unsigned)time( NULL ) );
+    srand( static_cast<unsigned>(time(NULL)) );
   }
 }
 
@@ -375,17 +375,17 @@
 
 //- Find the depth of the tree
 template <class Z> void KDDTree<Z>::recursive_find_max_height
- (KDDTreeNode<Z> *root, int depth, int *maxdepth)
+ (KDDTreeNode<Z> *the_root, int depth, int *maxdepth)
 {
-  if (root)
+  if (the_root)
   {
     depth++;
     if (depth > *maxdepth)
     {
       *maxdepth = depth;
     }
-    recursive_find_max_height (root->left, depth, maxdepth);
-    recursive_find_max_height (root->right, depth, maxdepth);
+    recursive_find_max_height (the_root->left, depth, maxdepth);
+    recursive_find_max_height (the_root->right, depth, maxdepth);
   }
 }
 
@@ -495,7 +495,7 @@
       myMarkedNodes++;
       if (myDeletionTolerance != 0)
       {
-        if ( (((double)myMarkedNodes / myNodeList.size()) > myDeletionTolerance) &&
+        if ( (( static_cast<double>(myMarkedNodes) / myNodeList.size()) > myDeletionTolerance) &&
              (myMarkedNodes > 1)
            )
         {

Modified: cgm/trunk/util/KDDTree.hpp
===================================================================
--- cgm/trunk/util/KDDTree.hpp	2008-06-25 14:31:10 UTC (rev 1925)
+++ cgm/trunk/util/KDDTree.hpp	2008-06-25 17:34:56 UTC (rev 1926)
@@ -49,7 +49,7 @@
     double min_dist_sq (CubitVector &q, CubitBox &b_box);
 
     //- Find the depth of the tree recursively
-    void recursive_find_max_height (KDDTreeNode<Z> *root, int depth, int *maxdepth);
+    void recursive_find_max_height (KDDTreeNode<Z> *the_root, int depth, int *maxdepth);
 
     //- Balance the tree recursively
     KDDTreeNode<Z> *recursive_balance (DIMENSION dim, int left, int right,

Modified: cgm/trunk/util/PriorityQueue.cpp
===================================================================
--- cgm/trunk/util/PriorityQueue.cpp	2008-06-25 14:31:10 UTC (rev 1925)
+++ cgm/trunk/util/PriorityQueue.cpp	2008-06-25 17:34:56 UTC (rev 1926)
@@ -35,7 +35,7 @@
   {
     PRINT_ERROR("Empty priority queue had top request.\n");
     assert(!empty());
-	return (Object)0;
+    return static_cast<Object>(0);
   }
   return theItems[1];
 }

Modified: cgm/trunk/util/RTreeNode.cpp
===================================================================
--- cgm/trunk/util/RTreeNode.cpp	2008-06-25 14:31:10 UTC (rev 1925)
+++ cgm/trunk/util/RTreeNode.cpp	2008-06-25 17:34:56 UTC (rev 1926)
@@ -35,7 +35,7 @@
   myChildrenNodes = new RTreeNode<Y>* [maxChildren];
   int ii;
   for ( ii = 0; ii < maxChildren; ii++ )
-    myChildrenNodes[ii] = (RTreeNode<Y>*) NULL;
+    myChildrenNodes[ii] = static_cast< RTreeNode<Y>* >(NULL);
   if ( data == NULL )
   {
     PRINT_ERROR("Building RTree with null data is not allowed!\n");
@@ -70,17 +70,17 @@
   distIsBox = 1;
   myDist = CUBIT_DBL_MAX;
 }
-template <class Y> MY_INLINE RTreeNode<Y>::RTreeNode (CubitBox &bounding_box,
+template <class Y> MY_INLINE RTreeNode<Y>::RTreeNode (CubitBox &bound_box,
                                                       int max_children,
                                                       int min_children)
 {  
   maxChildren = max_children;
   minChildren = min_children;
-  myBoundingBox = new CubitBox(bounding_box);
+  myBoundingBox = new CubitBox(bound_box);
   myChildrenNodes = new RTreeNode<Y>* [maxChildren];
   int ii;
   for ( ii = 0; ii < maxChildren; ii++ )
-    myChildrenNodes[ii] = (RTreeNode<Y>*) NULL;
+    myChildrenNodes[ii] = static_cast< RTreeNode<Y>* >(NULL);
   myData = NULL;
   myLevel = UNSET_RNODE;
   myParent = NULL;
@@ -199,7 +199,7 @@
   }
     //do error checking...
   if ( child_index == -1 || child_index >= maxChildren )
-    return (RTreeNode<Y>*)NULL;
+    return static_cast< RTreeNode<Y>* >(NULL);
   RTreeNode<Y> *f = n->myChildrenNodes[child_index];
     //Now continue on...
   curr_node = choose_leaf(f,e);
@@ -420,12 +420,12 @@
   myBoundingBox = new CubitBox(new_box);
 }
 template <class Y> MY_INLINE void RTreeNode<Y>::add_child(RTreeNode<Y> *child_node,
-                                                CubitBoolean recalc_b_box)
+							  CubitBoolean recalc_bound_box)
 {
   assert(nextChildIndex < maxChildren && child_node != NULL );
   myChildrenNodes[nextChildIndex] = child_node;
     //update the bounding box. by uniting with child node...
-  if ( recalc_b_box )
+  if ( recalc_bound_box )
   {
     CubitBox *old_box = myBoundingBox;
     myBoundingBox = new CubitBox( *old_box |= child_node->bounding_box());
@@ -464,8 +464,8 @@
   RTreeNode<Y> *e_1, *e_2;
   CubitBox e_box_1, e_box_2, j;
   double d, max_d = -CUBIT_DBL_MAX;
-  seed_1 = (RTreeNode<Y>*)NULL;
-  seed_2 = (RTreeNode<Y>*)NULL;
+  seed_1 = static_cast< RTreeNode<Y>* >(NULL);
+  seed_2 = static_cast< RTreeNode<Y>* >(NULL);
   
   for(ii = 0; ii < input_list_size; ii++ )
   {
@@ -509,7 +509,7 @@
   int ii, next_index = 0;
   double d1, d2, max_diff = -CUBIT_DBL_MAX;
   add_to_group_1 = CUBIT_TRUE;
-  RTreeNode<Y> *max_diff_node = (RTreeNode<Y>*)NULL;
+  RTreeNode<Y> *max_diff_node = static_cast< RTreeNode<Y>* >(NULL);
   RTreeNode<Y> *curr_node;
   CubitBox group_1_box = group_1->bounding_box();
   CubitBox group_2_box = group_2->bounding_box();
@@ -659,7 +659,7 @@
   if ( root->num_children() == 1 )
   {
     new_root = root->get_child(0);
-    new_root->set_parent((RTreeNode<Y>*)NULL);
+    new_root->set_parent(static_cast< RTreeNode<Y>* >(NULL));
     delete_root = CUBIT_TRUE;
   }
   return CUBIT_TRUE;

Modified: cgm/trunk/util/RTreeNode.hpp
===================================================================
--- cgm/trunk/util/RTreeNode.hpp	2008-06-25 14:31:10 UTC (rev 1925)
+++ cgm/trunk/util/RTreeNode.hpp	2008-06-25 17:34:56 UTC (rev 1926)
@@ -110,7 +110,7 @@
 
 public:
   RTreeNode(Y data, double tol, int max_children, int min_children );
-  RTreeNode(CubitBox &bounding_box, int max_children, int min_children);
+  RTreeNode(CubitBox &bound_box, int max_children, int min_children);
   
   ~RTreeNode();
     //- Constructor/Destructor
@@ -140,7 +140,7 @@
     {return myData;}
     //- Determine if the RTreeNode is a leaf node.
   
-  void add_child(RTreeNode<Y>* child_node, CubitBoolean recalc_b_box);
+  void add_child(RTreeNode<Y>* child_node, CubitBoolean recalc_bound_box);
     //- Add the child to the myChildrenNodes' list. Adds
     //- it to the next availabel spot.  Won't add if overflow will
     //- occur.
@@ -156,7 +156,7 @@
     //- Returns the number of children in the myChildrenNode's array.
 
   RTreeNode<Y>* get_child(int i)
-    {return ((i < nextChildIndex) ? myChildrenNodes[i] : (RTreeNode<Y>*)NULL) ;}
+    {return ( (i < nextChildIndex) ? myChildrenNodes[i] : static_cast< RTreeNode<Y>* >(NULL) );}
   
     
   void flush(CubitBox &new_box);




More information about the cgma-dev mailing list