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

luis at geodynamics.org luis at geodynamics.org
Wed Oct 15 10:13:02 PDT 2008


Author: luis
Date: 2008-10-15 10:13:01 -0700 (Wed, 15 Oct 2008)
New Revision: 13078

Added:
   cs/cigma/trunk/src/py_Locator.h
Modified:
   cs/cigma/trunk/src/py_Locator.cpp
Log:
Header file for pyLocator bindings

Modified: cs/cigma/trunk/src/py_Locator.cpp
===================================================================
--- cs/cigma/trunk/src/py_Locator.cpp	2008-10-15 17:12:59 UTC (rev 13077)
+++ cs/cigma/trunk/src/py_Locator.cpp	2008-10-15 17:13:01 UTC (rev 13078)
@@ -1,42 +1,39 @@
-#include "Locator.h"
-#include "AnnLocator.h"
-#include <boost/python.hpp>
+#include "py_Locator.h"
 
 using namespace cigma;
 using namespace boost::python;
 
-struct pyLocator : Locator, wrapper<Locator>
+int pyLocator::n_dim() const
 {
-    int n_dim() const
-    {
-        return this->get_override("n_dim")();
-    }
+    return this->get_override("n_dim")();
+}
 
-    int n_idx() const
-    {
-        return this->get_override("n_idx")();
-    }
+int pyLocator::n_idx() const
+{
+    return this->get_override("n_idx")();
+}
 
-    int idx(int i) const
-    {
-        return this->get_override("idx")(i);
-    }
+int pyLocator::idx(int i) const
+{
+    return this->get_override("idx")(i);
+}
 
-    void searchBoundingBox(double *bbox)
-    {
-        this->get_override("searchBoundingBox")(bbox);
-    }
+void pyLocator::searchBoundingBox(double *bbox)
+{
+    this->get_override("searchBoundingBox")(bbox);
+}
 
-    bool check_idx(int i) const
+bool pyLocator::check_idx(int i) const
+{
+    if (override c = this->get_override("check_idx"))
     {
-        if (override c = this->get_override("check_idx"))
-        {
-            return c(i);
-        }
-        return Locator::check_idx(i);
+        return c(i);
     }
-};
+    return Locator::check_idx(i);
+}
 
+
+// ----------------------------------------------------------------------------
 void export_Locator()
 {
     using namespace cigma;

Added: cs/cigma/trunk/src/py_Locator.h
===================================================================
--- cs/cigma/trunk/src/py_Locator.h	                        (rev 0)
+++ cs/cigma/trunk/src/py_Locator.h	2008-10-15 17:13:01 UTC (rev 13078)
@@ -0,0 +1,17 @@
+#ifndef __PY_LOCATOR_H__
+#define __PY_LOCATOR_H__
+
+#include "Locator.h"
+#include "AnnLocator.h"
+#include <boost/python.hpp>
+
+struct pyLocator : cigma::Locator, boost::python::wrapper<cigma::Locator>
+{
+    int n_dim() const;
+    int n_idx() const;
+    int idx(int i) const;
+    void searchBoundingBox(double *bbox);
+    bool check_idx(int i) const;
+};
+
+#endif



More information about the cig-commits mailing list