[MOAB-dev] r1395 - MOAB/branches/3.0

kraftche at mcs.anl.gov kraftche at mcs.anl.gov
Thu Nov 15 09:26:17 CST 2007


Author: kraftche
Date: 2007-11-15 09:26:17 -0600 (Thu, 15 Nov 2007)
New Revision: 1395

Modified:
   MOAB/branches/3.0/MBMeshSet.cpp
   MOAB/branches/3.0/MBMeshSet.hpp
   MOAB/branches/3.0/MBOrientedBox.hpp
   MOAB/branches/3.0/ReadSTL.cpp
   MOAB/branches/3.0/SparseTagCollections.cpp
   MOAB/branches/3.0/WriteSTL.cpp
   MOAB/branches/3.0/WriteVtk.cpp
   MOAB/branches/3.0/configure.in
Log:
Backport bug fixes to 3.0 branch:

o Make 'expr' syntax portable in configure.in (svn r1298)

o Windows build issues 
  - svn r1326: WriteVTk.cpp
  - svn r1327: ReadSTL.cpp, WriteSTL.cpp
  - svn r1328: MBOrientedBox.hpp

o Fix SparseTagCollection::get_number_entities bug (svn r1356)

o Fix non-portable bitfield usage in MBMeshSet (svn r1393)



Modified: MOAB/branches/3.0/MBMeshSet.cpp
===================================================================
--- MOAB/branches/3.0/MBMeshSet.cpp	2007-11-15 15:02:15 UTC (rev 1394)
+++ MOAB/branches/3.0/MBMeshSet.cpp	2007-11-15 15:26:17 UTC (rev 1395)
@@ -160,13 +160,13 @@
 int MBMeshSet::add_parent( MBEntityHandle parent )
 { 
   int result;
-  mParentCount = insert_in_vector( mParentCount, parentMeshSets, parent, result );
+  mParentCount = insert_in_vector( (Count)mParentCount, parentMeshSets, parent, result );
   return result;
 }
 int MBMeshSet::add_child( MBEntityHandle child )
 { 
   int result;
-  mChildCount = insert_in_vector( mChildCount, childMeshSets, child, result );
+  mChildCount = insert_in_vector( (Count)mChildCount, childMeshSets, child, result );
   return result;
 }
 
@@ -240,13 +240,13 @@
 int MBMeshSet::remove_parent( MBEntityHandle parent )
 { 
   int result;
-  mParentCount = remove_from_vector( mParentCount, parentMeshSets, parent, result );
+  mParentCount = remove_from_vector( (Count)mParentCount, parentMeshSets, parent, result );
   return result;
 }
 int MBMeshSet::remove_child( MBEntityHandle child )
 { 
   int result;
-  mChildCount = remove_from_vector( mChildCount, childMeshSets, child, result );
+  mChildCount = remove_from_vector( (Count)mChildCount, childMeshSets, child, result );
   return result;
 }
 

Modified: MOAB/branches/3.0/MBMeshSet.hpp
===================================================================
--- MOAB/branches/3.0/MBMeshSet.hpp	2007-11-15 15:02:15 UTC (rev 1394)
+++ MOAB/branches/3.0/MBMeshSet.hpp	2007-11-15 15:26:17 UTC (rev 1395)
@@ -239,12 +239,12 @@
   //! parentMeshSets.hnd.  If MANY, then parentMeshSets.ptr contains
   //! array begin and end pointers for a dynamically allocated array
   //! of parent handles.
-  Count mParentCount : 2;
+  unsigned mParentCount : 2;
   //! If less than MANY, the number of children stored inline in
   //! childMeshSets.hnd.  If MANY, then childMeshSets.ptr contains
   //! array begin and end pointers for a dynamically allocated array
   //! of child handles.
-  Count mChildCount : 2;
+  unsigned mChildCount : 2;
 private:
   //! Storage for parent and child lists
   CompactList parentMeshSets, childMeshSets;

Modified: MOAB/branches/3.0/MBOrientedBox.hpp
===================================================================
--- MOAB/branches/3.0/MBOrientedBox.hpp	2007-11-15 15:02:15 UTC (rev 1394)
+++ MOAB/branches/3.0/MBOrientedBox.hpp	2007-11-15 15:26:17 UTC (rev 1395)
@@ -35,8 +35,9 @@
 
 /**\brief Oriented bounding box
  */
-struct MBOrientedBox
+class MBOrientedBox
 {
+public:
   MBCartVect center;  //!< Box center
   MBCartVect axis[3]; //!< Box axes, unit vectors sorted by extent of box along axis
 #if MB_ORIENTED_BOX_UNIT_VECTORS

Modified: MOAB/branches/3.0/ReadSTL.cpp
===================================================================
--- MOAB/branches/3.0/ReadSTL.cpp	2007-11-15 15:02:15 UTC (rev 1394)
+++ MOAB/branches/3.0/ReadSTL.cpp	2007-11-15 15:26:17 UTC (rev 1395)
@@ -25,8 +25,23 @@
 #include "MBInterface.hpp"
 #include "MBReadUtilIface.hpp"
 #include "MBRange.hpp"
+#include "MBEntityHandle.h"
 
-#include <inttypes.h>  // for int32_t
+#ifdef MOAB_HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+#ifdef MOAB_HAVE_STDDEF_H
+#include <stddef.h>
+#endif
+#ifdef MOAB_HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
+#ifdef _MSC_VER /* windows */
+#  include <BaseTsd.h>
+typedef ULONG32 uint32_t;
+#endif
+
 #include <errno.h>
 #include <string.h>
 #include <limits.h>

Modified: MOAB/branches/3.0/SparseTagCollections.cpp
===================================================================
--- MOAB/branches/3.0/SparseTagCollections.cpp	2007-11-15 15:02:15 UTC (rev 1394)
+++ MOAB/branches/3.0/SparseTagCollections.cpp	2007-11-15 15:26:17 UTC (rev 1395)
@@ -335,6 +335,7 @@
 //! get number of entities of type
 MBErrorCode SparseTagCollection::get_number_entities(MBEntityType type, int& num_entities)
 {
+  num_entities = 0;
   std::map<MBEntityHandle, void*>::iterator iter;
   for(iter = mData.begin(); iter != mData.end(); ++iter)
   {

Modified: MOAB/branches/3.0/WriteSTL.cpp
===================================================================
--- MOAB/branches/3.0/WriteSTL.cpp	2007-11-15 15:02:15 UTC (rev 1394)
+++ MOAB/branches/3.0/WriteSTL.cpp	2007-11-15 15:26:17 UTC (rev 1395)
@@ -25,26 +25,30 @@
 #include "MBInterface.hpp"
 #include "MBRange.hpp"
 #include "MBWriteUtilIface.hpp"
+#include "MBEntityHandle.h"
 
+#ifdef MOAB_HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+#ifdef MOAB_HAVE_STDDEF_H
+#include <stddef.h>
+#endif
+#ifdef MOAB_HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <errno.h>
-#include <inttypes.h>
-#include <unistd.h>
 #include <math.h>
+#include <fcntl.h>
 
 #ifdef _MSC_VER /* windows */
-#  include <io.h>
-#  define O_BINARY _O_BINARY
-#  define O_CREAT  _O_CREAT
-#  define O_EXCL   _O_EXCL
-#  define O_TRUNC  _O_TRUNC
-#  define O_WRONLY _O_WRONLY
-#  define fdopen(A,B)  _fdopen( (A), (B) )
-#  define open(A,B,C)  _open( (A), (B), (C) )
+#  include <BaseTsd.h>
+typedef ULONG32 uint32_t;
 #else  /* posix */
-#  include <fcntl.h>
+#  include <unistd.h>
 #  define _S_IREAD  (S_IRUSR|S_IRGRP|S_IROTH)
 #  define _S_IWRITE (S_IWUSR|S_IWGRP|S_IWOTH)
 #endif

Modified: MOAB/branches/3.0/WriteVtk.cpp
===================================================================
--- MOAB/branches/3.0/WriteVtk.cpp	2007-11-15 15:02:15 UTC (rev 1394)
+++ MOAB/branches/3.0/WriteVtk.cpp	2007-11-15 15:26:17 UTC (rev 1395)
@@ -405,29 +405,32 @@
   {
     for (unsigned j = 0; j < vals_per_tag; ++j, ++d)
     {
-      stream << *d << ' ';
+      if (sizeof(T) == 1) 
+        stream << (unsigned int)*d << ' ';
+      else
+        stream << *d << ' ';
     }
     stream << std::endl;
   }
 }
 
-template <>
-void WriteVtk::write_data<unsigned char>( std::ostream& stream, 
-                                          const std::vector<unsigned char>& data,
-                                          unsigned vals_per_tag )
-{
-  std::vector<unsigned char>::const_iterator d = data.begin();
-  const unsigned long n = data.size() / vals_per_tag;
-  
-  for (unsigned long i = 0; i < n; ++i)
-  {
-    for (unsigned j = 0; j < vals_per_tag; ++j, ++d)
-    {
-      stream << (unsigned int)*d << ' ';
-    }
-    stream << std::endl;
-  }
-}
+//template <>
+//void WriteVtk::write_data<unsigned char>( std::ostream& stream, 
+//                                          const std::vector<unsigned char>& data,
+//                                          unsigned vals_per_tag )
+//{
+//  std::vector<unsigned char>::const_iterator d = data.begin();
+//  const unsigned long n = data.size() / vals_per_tag;
+//  
+//  for (unsigned long i = 0; i < n; ++i)
+//  {
+//    for (unsigned j = 0; j < vals_per_tag; ++j, ++d)
+//    {
+//      stream << (unsigned int)*d << ' ';
+//    }
+//    stream << std::endl;
+//  }
+//}
 
 
 template <typename T>

Modified: MOAB/branches/3.0/configure.in
===================================================================
--- MOAB/branches/3.0/configure.in	2007-11-15 15:02:15 UTC (rev 1394)
+++ MOAB/branches/3.0/configure.in	2007-11-15 15:26:17 UTC (rev 1395)
@@ -30,8 +30,8 @@
 ################################################################################
 
 AC_DEFINE(MB_VERSION,["AC_PACKAGE_VERSION"],[MOAB Version])
-VERSION_MAJOR=`expr AC_PACKAGE_VERSION : '\([[0-9]]\+\)'`
-VERSION_MINOR=`expr AC_PACKAGE_VERSION : '[[0-9]]*\.\([[0-9]]\+\)'`
+VERSION_MAJOR=`expr AC_PACKAGE_VERSION : '\([[0-9]]*\)'`
+VERSION_MINOR=`expr AC_PACKAGE_VERSION : '[[0-9]]*\.\([[0-9]]*\)'`
 VERSION_PATCH=`expr AC_PACKAGE_VERSION : '[[0-9]]*\.[[0-9]]*\.\(.*\)'`
 test "x" != "x$VERSION_MAJOR" || AC_MSG_ERROR("Invalid version string: AC_PACKAGE_VERSION")
 test "x" != "x$VERSION_MINOR" || AC_MSG_ERROR("Invalid version string: AC_PACKAGE_VERSION")




More information about the moab-dev mailing list