]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
[EDF30834] : WIP
authorAnthony Geay <anthony.geay@edf.fr>
Thu, 29 Aug 2024 16:10:09 +0000 (18:10 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Thu, 29 Aug 2024 16:10:09 +0000 (18:10 +0200)
src/ShapeRecogn/ShapeRecognMeshBuilder.cxx
src/ShapeRecogn/ShapeRecognMeshBuilder.hxx
src/ShapeRecogn/Swig/CMakeLists.txt
src/ShapeRecogn/Swig/ShapeRecogn.i
src/ShapeRecogn/Swig/ShapeRecognCommon.i [new file with mode: 0644]
src/ShapeRecogn/Swig/ShapeRecognImpl.i [new file with mode: 0644]

index 4f1895c5573447e12636889eaa54da4beb14c379..fe0e7b2b06ae33db39861b44d8805c989a9dde4c 100644 (file)
 using namespace MEDCoupling;
 
 ShapeRecognMeshBuilder::ShapeRecognMeshBuilder(MCAuto< MEDCouplingUMesh > mesh)
+{
+    assign( mesh );
+}
+
+ShapeRecognMeshBuilder::ShapeRecognMeshBuilder(MEDCouplingUMesh *mesh)
+{
+    MCAuto< MEDCouplingUMesh > meshIn = MCAuto< MEDCouplingUMesh >::TakeRef( mesh );
+    assign( meshIn );
+}
+
+void ShapeRecognMeshBuilder::assign(MCAuto< MEDCouplingUMesh > mesh)
 {
     this->mesh = mesh;
     if (mesh->getMeshDimension() != 2)
@@ -35,6 +46,7 @@ ShapeRecognMeshBuilder::ShapeRecognMeshBuilder(MCAuto< MEDCouplingUMesh > mesh)
         throw INTERP_KERNEL::Exception("Expect a mesh containing exclusively triangular cells");
 }
 
+
 MCAuto<ShapeRecognMesh> ShapeRecognMeshBuilder::recognize()
 {
     mesh->incrRef();
index 6bd1853c8d5aea9c148e6a173807b985883c78a2..af7b534760eb9a3e465130a91b6faba3853d832c 100644 (file)
@@ -37,6 +37,7 @@ namespace MEDCoupling
     {
     public:
         ShapeRecognMeshBuilder(MCAuto< MEDCouplingUMesh > mesh);
+        ShapeRecognMeshBuilder(MEDCouplingUMesh *mesh);
         ~ShapeRecognMeshBuilder() = default;
 
         const Nodes *getNodes() const;
@@ -77,6 +78,7 @@ namespace MEDCoupling
             MCAuto<DataArrayDouble> values) const;
         double *buildArea3DArray(const std::array<double, 3> &(*areaFunc)(Areas *, mcIdType)) const;
         double *buildAreaArray(double (*areaFunc)(Areas *, mcIdType)) const;
+        void assign(MCAuto< MEDCouplingUMesh > mesh);
     private:
         MCConstAuto< MEDCouplingUMesh > mesh;
         std::unique_ptr<Nodes> nodes;
index c738e10f503b80ece836ed67f40d57dcc66de998..1a73c982c3e7d5e64699d70b2263c6ce7351f9f7 100644 (file)
@@ -75,7 +75,6 @@ IF(WIN32)
 ENDIF(WIN32)
 
 INSTALL(TARGETS _ShapeRecogn DESTINATION ${MEDCOUPLING_INSTALL_PYTHON})
-INSTALL(FILES ShapeRecogn.i DESTINATION ${MEDCOUPLING_INSTALL_HEADERS})
 
 SALOME_INSTALL_SCRIPTS(
   ${CMAKE_CURRENT_BINARY_DIR}/ShapeRecogn.py 
index 3e0313357b32c448db2a8f1f489f06dd19e53101..0b129593b065128c04bfaed421279f0d724eca1e 100644 (file)
 
 %module ShapeRecogn
 
-%include "std_string.i"
-%include "MEDCouplingCommon.i"
+%include "ShapeRecognCommon.i"
 
-%{
-#include "ShapeRecognMesh.hxx"
-#include "ShapeRecognMeshBuilder.hxx"
-using namespace MEDCoupling;
+%pythoncode %{
+def MEDCouplingDataArrayDoubleIadd(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayDouble____iadd___(self, self, *args)
+def MEDCouplingDataArrayDoubleIsub(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayDouble____isub___(self, self, *args)
+def MEDCouplingDataArrayDoubleImul(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayDouble____imul___(self, self, *args)
+def MEDCouplingDataArrayDoubleIdiv(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayDouble____idiv___(self, self, *args)
+def MEDCouplingDataArrayDoubleIpow(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayDouble____ipow___(self, self, *args)
+def MEDCouplingDataArrayInt32Iadd(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayInt32____iadd___(self, self, *args)
+def MEDCouplingDataArrayInt32Isub(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayInt32____isub___(self, self, *args)
+def MEDCouplingDataArrayInt32Imul(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayInt32____imul___(self, self, *args)
+def MEDCouplingDataArrayInt32Idiv(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayInt32____idiv___(self, self, *args)
+def MEDCouplingDataArrayInt32Imod(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayInt32____imod___(self, self, *args)
+def MEDCouplingDataArrayInt32Ipow(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayInt32____ipow___(self, self, *args)
+def MEDCouplingDataArrayInt64Iadd(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayInt64____iadd___(self, self, *args)
+def MEDCouplingDataArrayInt64Isub(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayInt64____isub___(self, self, *args)
+def MEDCouplingDataArrayInt64Imul(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayInt64____imul___(self, self, *args)
+def MEDCouplingDataArrayInt64Idiv(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayInt64____idiv___(self, self, *args)
+def MEDCouplingDataArrayInt64Imod(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayInt64____imod___(self, self, *args)
+def MEDCouplingDataArrayInt64Ipow(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayInt64____ipow___(self, self, *args)
+def MEDCouplingDataArrayFloatIadd(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayFloat____iadd___(self, self, *args)
+def MEDCouplingDataArrayFloatIsub(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayFloat____isub___(self, self, *args)
+def MEDCouplingDataArrayFloatImul(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayFloat____imul___(self, self, *args)
+def MEDCouplingDataArrayFloatIdiv(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayFloat____idiv___(self, self, *args)
+def MEDCouplingDataArrayDoubleTupleIadd(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayDoubleTuple____iadd___(self, self, *args)
+def MEDCouplingDataArrayDoubleTupleIsub(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayDoubleTuple____isub___(self, self, *args)
+def MEDCouplingDataArrayDoubleTupleImul(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayDoubleTuple____imul___(self, self, *args)
+def MEDCouplingDataArrayDoubleTupleIdiv(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayDoubleTuple____idiv___(self, self, *args)
+def MEDCouplingDataArrayInt32TupleIadd(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayInt32Tuple____iadd___(self, self, *args)
+def MEDCouplingDataArrayInt32TupleIsub(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayInt32Tuple____isub___(self, self, *args)
+def MEDCouplingDataArrayInt32TupleImul(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayInt32Tuple____imul___(self, self, *args)
+def MEDCouplingDataArrayInt32TupleIdiv(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayInt32Tuple____idiv___(self, self, *args)
+def MEDCouplingDataArrayInt32TupleImod(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayInt32Tuple____imod___(self, self, *args)
+def MEDCouplingDataArrayInt64TupleIadd(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayInt64Tuple____iadd___(self, self, *args)
+def MEDCouplingDataArrayInt64TupleIsub(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayInt64Tuple____isub___(self, self, *args)
+def MEDCouplingDataArrayInt64TupleImul(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayInt64Tuple____imul___(self, self, *args)
+def MEDCouplingDataArrayInt64TupleIdiv(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayInt64Tuple____idiv___(self, self, *args)
+def MEDCouplingDataArrayInt64TupleImod(self,*args):
+    import _MEDRenumber
+    return _MEDRenumber.DataArrayInt64Tuple____imod___(self, self, *args)
 %}
 
-%ignore getAreas() const;
-%ignore getNodes() const;
-%include "ShapeRecognMesh.hxx"
-%include "ShapeRecognMeshBuilder.hxx"
+
+%pythoncode %{
+InterpKernelException.__reduce__=INTERPKERNELExceptionReduce
+DataArrayDouble.__reduce__=MEDCouplingDataArrayDoubleReduce
+DataArrayDouble.__iadd__=MEDCouplingDataArrayDoubleIadd
+DataArrayDouble.__isub__=MEDCouplingDataArrayDoubleIsub
+DataArrayDouble.__imul__=MEDCouplingDataArrayDoubleImul
+DataArrayDouble.__idiv__=MEDCouplingDataArrayDoubleIdiv
+DataArrayDouble.__ipow__=MEDCouplingDataArrayDoubleIpow
+
+DataArrayInt32.__reduce__=MEDCouplingDataArrayInt32Reduce
+DataArrayInt32.__iadd__=MEDCouplingDataArrayInt32Iadd
+DataArrayInt32.__isub__=MEDCouplingDataArrayInt32Isub
+DataArrayInt32.__imul__=MEDCouplingDataArrayInt32Imul
+DataArrayInt32.__idiv__=MEDCouplingDataArrayInt32Idiv
+DataArrayInt32.__imod__=MEDCouplingDataArrayInt32Imod
+DataArrayInt32.__ipow__=MEDCouplingDataArrayInt32Ipow
+DataArrayInt64.__reduce__=MEDCouplingDataArrayInt64Reduce
+DataArrayInt64.__iadd__=MEDCouplingDataArrayInt64Iadd
+DataArrayInt64.__isub__=MEDCouplingDataArrayInt64Isub
+DataArrayInt64.__imul__=MEDCouplingDataArrayInt64Imul
+DataArrayInt64.__idiv__=MEDCouplingDataArrayInt64Idiv
+DataArrayInt64.__imod__=MEDCouplingDataArrayInt64Imod
+DataArrayInt64.__ipow__=MEDCouplingDataArrayInt64Ipow
+
+DataArrayDoubleTuple.__iadd__=MEDCouplingDataArrayDoubleTupleIadd
+DataArrayDoubleTuple.__isub__=MEDCouplingDataArrayDoubleTupleIsub
+DataArrayDoubleTuple.__imul__=MEDCouplingDataArrayDoubleTupleImul
+DataArrayDoubleTuple.__idiv__=MEDCouplingDataArrayDoubleTupleIdiv
+
+DataArrayInt32Tuple.__iadd__=MEDCouplingDataArrayInt32TupleIadd
+DataArrayInt32Tuple.__isub__=MEDCouplingDataArrayInt32TupleIsub
+DataArrayInt32Tuple.__imul__=MEDCouplingDataArrayInt32TupleImul
+DataArrayInt32Tuple.__idiv__=MEDCouplingDataArrayInt32TupleIdiv
+DataArrayInt32Tuple.__itruediv__=MEDCouplingDataArrayInt32TupleIdiv
+DataArrayInt32Tuple.__ifloordiv__=MEDCouplingDataArrayInt32TupleIdiv
+DataArrayInt32Tuple.__imod__=MEDCouplingDataArrayInt32TupleImod
+
+DataArrayInt64Tuple.__iadd__=MEDCouplingDataArrayInt64TupleIadd
+DataArrayInt64Tuple.__isub__=MEDCouplingDataArrayInt64TupleIsub
+DataArrayInt64Tuple.__imul__=MEDCouplingDataArrayInt64TupleImul
+DataArrayInt64Tuple.__idiv__=MEDCouplingDataArrayInt64TupleIdiv
+DataArrayInt64Tuple.__itruediv__=MEDCouplingDataArrayInt64TupleIdiv
+DataArrayInt64Tuple.__ifloordiv__=MEDCouplingDataArrayInt64TupleIdiv
+DataArrayInt64Tuple.__imod__=MEDCouplingDataArrayInt64TupleImod
+
+
+
+
+del INTERPKERNELExceptionReduce
+del MEDCouplingDataArrayDoubleIadd
+del MEDCouplingDataArrayDoubleIdiv
+del MEDCouplingDataArrayDoubleImul
+del MEDCouplingDataArrayDoubleIpow
+del MEDCouplingDataArrayDoubleIsub
+del MEDCouplingDataArrayDoubleReduce
+del MEDCouplingDataArrayDoubleTupleIadd
+del MEDCouplingDataArrayDoubleTupleIdiv
+del MEDCouplingDataArrayDoubleTupleImul
+del MEDCouplingDataArrayDoubleTupleIsub
+del MEDCouplingDataArrayInt32Iadd
+del MEDCouplingDataArrayInt32Idiv
+del MEDCouplingDataArrayInt32Imod
+del MEDCouplingDataArrayInt32Imul
+del MEDCouplingDataArrayInt32Ipow
+del MEDCouplingDataArrayInt32Isub
+del MEDCouplingDataArrayInt32Reduce
+del MEDCouplingDataArrayInt32TupleIadd
+del MEDCouplingDataArrayInt32TupleIdiv
+del MEDCouplingDataArrayInt32TupleImod
+del MEDCouplingDataArrayInt32TupleImul
+del MEDCouplingDataArrayInt32TupleIsub
+del MEDCouplingDataArrayInt64Iadd
+del MEDCouplingDataArrayInt64Idiv
+del MEDCouplingDataArrayInt64Imod
+del MEDCouplingDataArrayInt64Imul
+del MEDCouplingDataArrayInt64Ipow
+del MEDCouplingDataArrayInt64Isub
+del MEDCouplingDataArrayInt64Reduce
+del MEDCouplingDataArrayInt64TupleIadd
+del MEDCouplingDataArrayInt64TupleIdiv
+del MEDCouplingDataArrayInt64TupleImod
+del MEDCouplingDataArrayInt64TupleImul
+del MEDCouplingDataArrayInt64TupleIsub
+
+%}
diff --git a/src/ShapeRecogn/Swig/ShapeRecognCommon.i b/src/ShapeRecogn/Swig/ShapeRecognCommon.i
new file mode 100644 (file)
index 0000000..5362e77
--- /dev/null
@@ -0,0 +1,65 @@
+// Copyright (C) 2024  CEA, EDF
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+%include "std_string.i"
+%include "MEDCouplingCommon.i"
+
+%{
+#include "MEDCouplingMemArray.txx"
+#include "MCAuto.hxx"
+#include "MEDCouplingDataArrayTypemaps.i"
+
+using namespace MEDCoupling;
+using namespace INTERP_KERNEL;
+%}
+
+%template(ivec) std::vector<int>;
+%template(dvec) std::vector<double>;
+%template(svec) std::vector<std::string>;
+
+#ifdef WITH_NUMPY
+%init %{ import_array(); %}
+#endif
+
+%init %{ initializeMe_shape_recogn(); %}
+
+%feature("autodoc", "1");
+%feature("docstring");
+
+%nodefaultctor;
+
+%rename (InterpKernelException) INTERP_KERNEL::Exception;
+
+%{
+  void initializeMe_shape_recogn()
+  {// AGY : here initialization of C++ traits in MEDCouplingDataArrayTypemaps.i for code factorization. Awful, I know, but no other solutions.
+    SWIGTITraits<double>::TI=SWIGTYPE_p_MEDCoupling__DataArrayDouble;
+    SWIGTITraits<float>::TI=SWIGTYPE_p_MEDCoupling__DataArrayFloat;
+  }
+%}
+
+%include "ShapeRecognImpl.i"
+
+%pythoncode %{
+import os
+__filename=os.environ.get('PYTHONSTARTUP')
+if __filename and os.path.isfile(__filename):
+  with open(__filename) as __fp:
+        exec(__fp.read())
+%}
diff --git a/src/ShapeRecogn/Swig/ShapeRecognImpl.i b/src/ShapeRecogn/Swig/ShapeRecognImpl.i
new file mode 100644 (file)
index 0000000..c09a233
--- /dev/null
@@ -0,0 +1,185 @@
+// Copyright (C) 2024  CEA, EDF
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+%{
+#include "ShapeRecognMesh.hxx"
+#include "ShapeRecognMeshBuilder.hxx"
+#include "Areas.hxx"
+%}
+
+%feature("unref") ShapeRecognMesh "$this->decrRef();"
+
+%newobject ShapeRecognMeshBuilder::recognize;
+
+%newobject ShapeRecognMesh::getNodeK1;
+%newobject ShapeRecognMesh::getNodeK2;
+%newobject ShapeRecognMesh::getNodePrimitiveType;
+%newobject ShapeRecognMesh::getNodeNormal;
+%newobject ShapeRecognMesh::getAreaId;
+%newobject ShapeRecognMesh::getAreaPrimitiveType;
+%newobject ShapeRecognMesh::getAreaNormal;
+%newobject ShapeRecognMesh::getMinorRadius;
+%newobject ShapeRecognMesh::getRadius;
+%newobject ShapeRecognMesh::getAngle;
+%newobject ShapeRecognMesh::getCenter;
+%newobject ShapeRecognMesh::getAxis;
+%newobject ShapeRecognMesh::getApex;
+
+class Areas
+{
+public:
+    double getMinorRadius(mcIdType areaId) const;
+    double getRadius(mcIdType areaId) const;
+    double getAngle(mcIdType areaId) const;
+    /*const std::array<double, 3> &getNormal(mcIdType areaId) const;
+    const std::array<double, 3> &getCenter(mcIdType areaId) const;
+    const std::array<double, 3> &getAxis(mcIdType areaId) const;
+    const std::array<double, 3> &getAxisPoint(mcIdType areaId) const;
+    const std::array<double, 3> &getApex(mcIdType areaId) const;
+    std::array<double, 3> getAffinePoint(mcIdType areaId) const;*/
+private:
+    Areas();
+    ~Areas();
+};
+
+class ShapeRecognMesh : public RefCountObject
+{
+public:
+    ~ShapeRecognMesh();
+
+    // Node properties
+    MEDCouplingFieldDouble *getNodeK1() const
+    {
+        MEDCouplingFieldDouble *ret = const_cast<MEDCouplingFieldDouble *>( self->getNodeK1() );
+        ret->incrRef();
+        return ret;
+    }
+
+    MEDCouplingFieldDouble *getNodeK2() const
+    {
+        MEDCouplingFieldDouble *ret = const_cast<MEDCouplingFieldDouble *>( self->getNodeK2() );
+        ret->incrRef();
+        return ret;
+    }
+
+    MEDCouplingFieldDouble *getNodePrimitiveType() const
+    {
+        MEDCouplingFieldDouble *ret = const_cast<MEDCouplingFieldDouble *>( self->getNodePrimitiveType() );
+        ret->incrRef();
+        return ret;
+    }
+    
+    MEDCouplingFieldDouble *getNodeNormal() const
+    {
+        MEDCouplingFieldDouble *ret = const_cast<MEDCouplingFieldDouble *>( self->getNodeNormal() );
+        ret->incrRef();
+        return ret;
+    }
+
+    // Area properties
+
+    MEDCouplingFieldDouble *getAreaId() const
+    {
+        MEDCouplingFieldDouble *ret = const_cast<MEDCouplingFieldDouble *>( self->getAreaId() );
+        ret->incrRef();
+        return ret;
+    }
+    
+    MEDCouplingFieldDouble *getAreaPrimitiveType() const
+    {
+        MEDCouplingFieldDouble *ret = const_cast<MEDCouplingFieldDouble *>( self->getAreaPrimitiveType() );
+        ret->incrRef();
+        return ret;
+    }
+    
+    MEDCouplingFieldDouble *getAreaNormal() const
+    {
+        MEDCouplingFieldDouble *ret = const_cast<MEDCouplingFieldDouble *>( self->getAreaNormal() );
+        ret->incrRef();
+        return ret;
+    }
+    
+    MEDCouplingFieldDouble *getMinorRadius() const
+    {
+        MEDCouplingFieldDouble *ret = const_cast<MEDCouplingFieldDouble *>( self->getMinorRadius() );
+        ret->incrRef();
+        return ret;
+    }
+    
+    MEDCouplingFieldDouble *getRadius() const
+    {
+        MEDCouplingFieldDouble *ret = const_cast<MEDCouplingFieldDouble *>( self->getRadius() );
+        ret->incrRef();
+        return ret;
+    }
+
+    MEDCouplingFieldDouble *getAngle() const
+    {
+        MEDCouplingFieldDouble *ret = const_cast<MEDCouplingFieldDouble *>( self->getAngle() );
+        ret->incrRef();
+        return ret;
+    }
+    
+    MEDCouplingFieldDouble *getCenter() const
+    {
+        MEDCouplingFieldDouble *ret = const_cast<MEDCouplingFieldDouble *>( self->getCenter() );
+        ret->incrRef();
+        return ret;
+    }
+    
+    MEDCouplingFieldDouble *getAxis() const
+    {
+        MEDCouplingFieldDouble *ret = const_cast<MEDCouplingFieldDouble *>( self->getAxis() );
+        ret->incrRef();
+        return ret;
+    }
+
+    MEDCouplingFieldDouble *getApex() const
+    {
+        MEDCouplingFieldDouble *ret = const_cast<MEDCouplingFieldDouble *>( self->getApex() );
+        ret->incrRef();
+        return ret;
+    }
+private:
+    ShapeRecognMesh();
+};
+
+class ShapeRecognMeshBuilder
+{
+public:
+    ShapeRecognMeshBuilder(MEDCouplingUMesh *mesh);
+    ~ShapeRecognMeshBuilder();
+
+    //const Nodes *getNodes() const;
+    const Areas *getAreas() const;
+    %extend
+    {
+    ShapeRecognMeshBuilder(MEDCouplingUMesh *mesh)
+    {
+        
+
+    }
+
+    ShapeRecognMesh *recognize()
+    {
+        MCAuto<ShapeRecognMesh> ret = self->recognize();
+        return ret.retn();
+    }
+    }
+};