From f716a934ebe2af392310a02a075e96a96d6f246a Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (o)" <j.wuttke@fz-juelich.de>
Date: Mon, 12 Sep 2022 11:37:21 +0200
Subject: [PATCH] IDetector: rm unused fct numberOfElements

---
 Device/Detector/IDetector.cpp         |  7 -------
 Device/Detector/IDetector.h           |  3 ---
 auto/Wrap/doxygenBase.i               |  5 -----
 auto/Wrap/doxygenDevice.i             |  5 -----
 auto/Wrap/libBornAgainDevice.py       | 10 ---------
 auto/Wrap/libBornAgainDevice_wrap.cpp | 30 ---------------------------
 6 files changed, 60 deletions(-)

diff --git a/Device/Detector/IDetector.cpp b/Device/Detector/IDetector.cpp
index 2274c70cc4c..978192981ad 100644
--- a/Device/Detector/IDetector.cpp
+++ b/Device/Detector/IDetector.cpp
@@ -216,13 +216,6 @@ std::unique_ptr<Datafield> IDetector::createDetectorMap() const
     return std::make_unique<Datafield>(axes);
 }
 
-size_t IDetector::numberOfElements() const
-{
-    size_t result(0);
-    iterateOverNonMaskedPoints([&result](const_iterator) { ++result; });
-    return result;
-}
-
 std::pair<double, double> IDetector::regionOfInterestBounds(size_t iAxis) const
 {
     ASSERT(iAxis < m_axes.size());
diff --git a/Device/Detector/IDetector.h b/Device/Detector/IDetector.h
index 0f50f9f0338..5a8e2fe4c28 100644
--- a/Device/Detector/IDetector.h
+++ b/Device/Detector/IDetector.h
@@ -165,9 +165,6 @@ public:
     //! Return default axes units
     virtual Coords defaultCoords() const = 0;
 
-    //! Returns number of simulation elements.
-    size_t numberOfElements() const;
-
     //! The lower and upper bound of the region of interest. If no region of interest is explicitly
     //! defined, then the whole detector is taken as "region of interest".
     std::pair<double, double> regionOfInterestBounds(size_t iAxis) const;
diff --git a/auto/Wrap/doxygenBase.i b/auto/Wrap/doxygenBase.i
index 4ced4de2e97..86406132429 100644
--- a/auto/Wrap/doxygenBase.i
+++ b/auto/Wrap/doxygenBase.i
@@ -1260,11 +1260,6 @@ BaseUtils::Filesystem::stem_ext
 Returns filename without extension(s). \"/home/user/filename.int\" -> \"filename\", \"/home/user/filename.int.gz\" -> \"filename\" 
 ";
 
-%feature("docstring")  BaseUtils::Filesystem::glob "std::vector< std::string > BaseUtils::Filesystem::glob(const std::string &dir, const std::string &pattern)
-BaseUtils::Filesystem::glob
-Returns file names that agree with a regex glob pattern. 
-";
-
 %feature("docstring")  BaseUtils::Filesystem::convert_utf8_to_utf16 "std::wstring BaseUtils::Filesystem::convert_utf8_to_utf16(const std::string &str)
 BaseUtils::Filesystem::convert_utf8_to_utf16
 Converts utf8 string represented by std::string to utf16 string represented by std::wstring. 
diff --git a/auto/Wrap/doxygenDevice.i b/auto/Wrap/doxygenDevice.i
index f9b0128f33a..24ac2fb8f73 100644
--- a/auto/Wrap/doxygenDevice.i
+++ b/auto/Wrap/doxygenDevice.i
@@ -950,11 +950,6 @@ IDetector::defaultCoords
 Return default axes units. 
 ";
 
-%feature("docstring")  IDetector::numberOfElements "size_t IDetector::numberOfElements() const
-IDetector::numberOfElements
-Returns number of simulation elements. 
-";
-
 %feature("docstring")  IDetector::regionOfInterestBounds "std::pair< double, double > IDetector::regionOfInterestBounds(size_t iAxis) const
 IDetector::regionOfInterestBounds
 The lower and upper bound of the region of interest. If no region of interest is explicitly defined, then the whole detector is taken as \"region of interest\". 
diff --git a/auto/Wrap/libBornAgainDevice.py b/auto/Wrap/libBornAgainDevice.py
index fb404b4b897..88c8318621d 100644
--- a/auto/Wrap/libBornAgainDevice.py
+++ b/auto/Wrap/libBornAgainDevice.py
@@ -3829,16 +3829,6 @@ class IDetector(libBornAgainBase.ICloneable, libBornAgainParam.INode):
         """
         return _libBornAgainDevice.IDetector_defaultCoords(self)
 
-    def numberOfElements(self):
-        r"""
-        numberOfElements(IDetector self) -> size_t
-        size_t IDetector::numberOfElements() const
-        IDetector::numberOfElements
-        Returns number of simulation elements. 
-
-        """
-        return _libBornAgainDevice.IDetector_numberOfElements(self)
-
     def regionOfInterestBounds(self, iAxis):
         r"""
         regionOfInterestBounds(IDetector self, size_t iAxis) -> pvacuum_double_t
diff --git a/auto/Wrap/libBornAgainDevice_wrap.cpp b/auto/Wrap/libBornAgainDevice_wrap.cpp
index 9b4d10eb5f0..33e926dad88 100644
--- a/auto/Wrap/libBornAgainDevice_wrap.cpp
+++ b/auto/Wrap/libBornAgainDevice_wrap.cpp
@@ -34435,29 +34435,6 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_IDetector_numberOfElements(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  IDetector *arg1 = (IDetector *) 0 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  PyObject *swig_obj[1] ;
-  size_t result;
-  
-  if (!args) SWIG_fail;
-  swig_obj[0] = args;
-  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IDetector, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDetector_numberOfElements" "', argument " "1"" of type '" "IDetector const *""'"); 
-  }
-  arg1 = reinterpret_cast< IDetector * >(argp1);
-  result = ((IDetector const *)arg1)->numberOfElements();
-  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
 SWIGINTERN PyObject *_wrap_IDetector_regionOfInterestBounds(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   IDetector *arg1 = (IDetector *) 0 ;
@@ -39254,13 +39231,6 @@ static PyMethodDef SwigMethods[] = {
 		"Return default axes units. \n"
 		"\n"
 		""},
-	 { "IDetector_numberOfElements", _wrap_IDetector_numberOfElements, METH_O, "\n"
-		"IDetector_numberOfElements(IDetector self) -> size_t\n"
-		"size_t IDetector::numberOfElements() const\n"
-		"IDetector::numberOfElements\n"
-		"Returns number of simulation elements. \n"
-		"\n"
-		""},
 	 { "IDetector_regionOfInterestBounds", _wrap_IDetector_regionOfInterestBounds, METH_VARARGS, "\n"
 		"IDetector_regionOfInterestBounds(IDetector self, size_t iAxis) -> pvacuum_double_t\n"
 		"std::pair< double, double > IDetector::regionOfInterestBounds(size_t iAxis) const\n"
-- 
GitLab