[MOAB-dev] r1457 - MOAB/trunk

kraftche at mcs.anl.gov kraftche at mcs.anl.gov
Fri Dec 7 16:52:26 CST 2007


Author: kraftche
Date: 2007-12-07 16:52:26 -0600 (Fri, 07 Dec 2007)
New Revision: 1457

Modified:
   MOAB/trunk/MBOrientedBox.cpp
   MOAB/trunk/MBOrientedBox.hpp
Log:
add constructor because Microsoft compiler can't do struct initialization if struct has non-intrinsic members

Modified: MOAB/trunk/MBOrientedBox.cpp
===================================================================
--- MOAB/trunk/MBOrientedBox.cpp	2007-12-07 22:47:18 UTC (rev 1456)
+++ MOAB/trunk/MBOrientedBox.cpp	2007-12-07 22:52:26 UTC (rev 1457)
@@ -426,7 +426,7 @@
                                                 const MBRange& vertices )
 {
     // Sum input CovarienceData structures
-  CovarienceData data_sum = { 0.0, MBCartVect(0.0), 0.0 };
+  CovarienceData data_sum( MBMatrix3(0.0), MBCartVect(0.0), 0.0 );
   for (const CovarienceData* const end = data+data_length; data != end; ++data) {
     data_sum.matrix += data->matrix;
     data_sum.center += data->center;

Modified: MOAB/trunk/MBOrientedBox.hpp
===================================================================
--- MOAB/trunk/MBOrientedBox.hpp	2007-12-07 22:47:18 UTC (rev 1456)
+++ MOAB/trunk/MBOrientedBox.hpp	2007-12-07 22:52:26 UTC (rev 1457)
@@ -97,6 +97,9 @@
      *  and resulting box orientation.
      */
   struct CovarienceData {
+    CovarienceData() {}
+    CovarienceData( const MBMatrix3& m, const MBCartVect& c, double a)
+      : matrix(m), center(c), area(a) {}
     MBMatrix3 matrix;    //!< Running sum for covariance matrix
     MBCartVect center;   //!< Sum of triangle centroids weighted by 2*triangle area
     double area;         //!< 2x the sum of the triangle areas




More information about the moab-dev mailing list