]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
cleaning swigging
authorageay <ageay>
Wed, 1 Dec 2010 14:57:55 +0000 (14:57 +0000)
committerageay <ageay>
Wed, 1 Dec 2010 14:57:55 +0000 (14:57 +0000)
src/MEDCoupling_Swig/MEDCouplingBasicsTest.py
src/MEDCoupling_Swig/libMEDCoupling_Swig.i

index afc4f6f217b8cf146810667ed30bf526f055c3cb..64515da85163a1086c2fe43a0e4fb9ba78810e02 100644 (file)
@@ -4089,6 +4089,9 @@ class MEDCouplingBasicsTest(unittest.TestCase):
         pos1=[5.,30.,2.]
         self.assertEqual(16,m.getCellContainingPoint(pos1,1e-12));
         #
+        elems=m2.giveElemsInBoundingBox([3.5,6.,12.2,25.,0.,1.5],1e-7)
+        self.assertEqual([1, 2, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17],elems)
+        #
         pt=[2.4,12.7,-3.4]
         m.scale(pt,3.7);
         m3=m.buildUnstructured();
index 9a49e4f045631416135502276cef0cac0a5c560b..9c0ca044be3023159fc8a50ee4881371d4093abc 100644 (file)
@@ -245,7 +245,6 @@ namespace ParaMEDMEM
     virtual MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const = 0;
     virtual MEDCouplingFieldDouble *fillFromAnalytic(TypeOfField t, int nbOfComp, const char *func) const throw(INTERP_KERNEL::Exception);
     virtual MEDCouplingFieldDouble *buildOrthogonalField() const = 0;
-    virtual void rotate(const double *center, const double *vector, double angle) = 0;
     virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception) = 0;
     virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const;
     static MEDCouplingMesh *mergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2);
@@ -338,6 +337,20 @@ namespace ParaMEDMEM
            self->translate(v);
            delete [] v;
          }
+
+         void rotate(PyObject *center, PyObject *vector, double alpha)
+         {
+           int sz;
+           double *c=convertPyToNewDblArr2(center,&sz);
+           if(!c)
+             return ;
+           double *v=convertPyToNewDblArr2(vector,&sz);
+           if(!v)
+             { delete [] c; return ; }
+           self->rotate(c,v,alpha);
+           delete [] c;
+           delete [] v;
+         }
        }
   };
 }
@@ -365,7 +378,6 @@ namespace ParaMEDMEM
       static DataArrayDouble *mergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2);
       static MEDCouplingPointSet *buildInstanceFromMeshType(MEDCouplingMeshType type);
       virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const = 0;
-      virtual void renumberNodes(const int *newNodeNumbers, int newNbOfNodes);
       virtual bool isEmptyMesh(const std::vector<int>& tinyInfo) const = 0;
       //! size of returned tinyInfo must be always the same.
       void getTinySerializationInformation(std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const;
@@ -373,7 +385,6 @@ namespace ParaMEDMEM
       void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const;
       void unserialization(const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
                            const std::vector<std::string>& littleStrings);
-      virtual void giveElemsInBoundingBox(const double *bbox, double eps, std::vector<int>& elems) = 0;
       virtual void giveElemsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps, std::vector<int>& elems) = 0;
       virtual DataArrayInt *zipCoordsTraducer() = 0;
       %extend 
@@ -439,19 +450,6 @@ namespace ParaMEDMEM
              self->findBoundaryNodes(nodes);
              return convertIntArrToPyList2(nodes);
            }
-           void rotate(PyObject *center, PyObject *vector, double alpha)
-           {
-             int sz;
-             double *c=convertPyToNewDblArr2(center,&sz);
-             if(!c)
-               return ;
-             double *v=convertPyToNewDblArr2(vector,&sz);
-             if(!v)
-               { delete [] c; return ; }
-             self->rotate(c,v,alpha);
-             delete [] c;
-             delete [] v;
-           }
            void renumberNodes(PyObject *li, int newNbOfNodes)
            {
              int size;
@@ -519,6 +517,16 @@ namespace ParaMEDMEM
              return ret;
            }
 
+           PyObject *giveElemsInBoundingBox(PyObject *bbox, double eps)
+           {
+             std::vector<int> elems;
+             int size;
+             double *tmp=convertPyToNewDblArr2(bbox,&size);
+             self->giveElemsInBoundingBox(tmp,eps,elems);
+             delete [] tmp;
+             return convertIntArrToPyList2(elems);
+           }
+
            static void rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords)
            {
              int sz;