[cig-commits] r13053 - cs/cigma/trunk/src

luis at geodynamics.org luis at geodynamics.org
Wed Oct 15 02:07:54 PDT 2008


Author: luis
Date: 2008-10-15 02:07:53 -0700 (Wed, 15 Oct 2008)
New Revision: 13053

Modified:
   cs/cigma/trunk/src/NodeCoordinates.cpp
   cs/cigma/trunk/src/NodeCoordinates.h
Log:
Switch to virtual methods in NodeCoordinates

Modified: cs/cigma/trunk/src/NodeCoordinates.cpp
===================================================================
--- cs/cigma/trunk/src/NodeCoordinates.cpp	2008-10-15 09:07:52 UTC (rev 13052)
+++ cs/cigma/trunk/src/NodeCoordinates.cpp	2008-10-15 09:07:53 UTC (rev 13053)
@@ -10,24 +10,28 @@
     //std::cout << "Calling NodeCoordinates()" << std::endl;
 
     // XXX: don't do this..use virtual functions
+    /*
     nno = 0;
     nsd = 0;
     coords = 0;
+    */
 }
 
 NodeCoordinates::~NodeCoordinates()
 {
     //std::cout << "Calling ~NodeCoordinates()" << std::endl;
-
+    /*
     if (coords != 0)
     {
         delete [] coords;
         coords = 0;
     }
+    */
 }
 
 // ----------------------------------------------------------------------------
 
+/*
 void NodeCoordinates::setCoordinates(double *coords, int nno, int nsd)
 {
     this->nno = nno;
@@ -38,6 +42,7 @@
     }
     this->coords = coords;
 }
+*/
 
 // ----------------------------------------------------------------------------
 

Modified: cs/cigma/trunk/src/NodeCoordinates.h
===================================================================
--- cs/cigma/trunk/src/NodeCoordinates.h	2008-10-15 09:07:52 UTC (rev 13052)
+++ cs/cigma/trunk/src/NodeCoordinates.h	2008-10-15 09:07:53 UTC (rev 13053)
@@ -3,7 +3,7 @@
 
 #include "Common.h"
 #include <boost/noncopyable.hpp>
-#include <boost/smart_ptr.hpp>
+//#include <boost/smart_ptr.hpp>
 
 namespace cigma
 {
@@ -14,31 +14,35 @@
 {
 public:
     NodeCoordinates();
-    ~NodeCoordinates();
+    virtual ~NodeCoordinates();
 
-    void setCoordinates(double *coords, int nno, int nsd);
+    virtual void setCoordinates(double *coords, int nno, int nsd) = 0;
 
-    int n_points() const;
-    int n_dim() const;
+    virtual int n_points() const = 0;
+    virtual int n_dim() const = 0;
 
-    double getPoint(int i, int j) const;
-    double * getPointOffset(int i);
+    virtual double getPoint(int i, int j) const = 0;
+    virtual double* getPointOffset(int i) = 0;
 
     /* XXX: add locator */
 
+/*
 public:
-    int nno;    /* XXX: Get rid of these...use pure virtual functions (cf. cigma::Cell) */
+    int nno;    // XXX: Get rid of these...use pure virtual functions (cf. cigma::Cell)
     int nsd;
     double *coords;
+*/
 };
 
 // ----------------------------------------------------------------------------
 
+/*
 inline int cigma::NodeCoordinates::n_points() const { return nno; }
 inline int cigma::NodeCoordinates::n_dim() const { return nsd; }
 
 inline double cigma::NodeCoordinates::getPoint(int i, int j) const { return coords[i*nsd + j]; }
 inline double * cigma::NodeCoordinates::getPointOffset(int i) { return &coords[i*nsd]; }
+*/
 
 
 // ----------------------------------------------------------------------------



More information about the cig-commits mailing list