]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
add swig for XAO
authorfps <fps@opencascade.com>
Fri, 13 Sep 2013 15:59:18 +0000 (15:59 +0000)
committerfps <fps@opencascade.com>
Fri, 13 Sep 2013 15:59:18 +0000 (15:59 +0000)
Makefile.am
configure.ac
src/Makefile.am
src/XAO_Swig/Makefile.am [new file with mode: 0644]
src/XAO_Swig/xao.py [new file with mode: 0644]
src/XAO_Swig/xao_swig.i [new file with mode: 0644]

index 863140fa7a5b2aad0744e982d19a6dc55ad97488..a0437371689fce17b90c893949eb54c32c6f4dbe 100644 (file)
@@ -56,3 +56,6 @@ docs: usr_docs
 
 dev_docs:
        (cd doc && $(MAKE) $(AM_MAKEFLAGS) dev_docs)
+       
+unittest:
+       ( ./src/XAO/tests/TestXAO )
index 13db63495ec1ddcc8eccf7b1fa0eaddf65d8da38..0fc06936af2873fbbd1da4ce66294cecf3a600d5 100644 (file)
@@ -505,6 +505,7 @@ AC_OUTPUT([ \
   src/AdvancedGUI/Makefile \
   src/XAO/Makefile \
   src/XAO/tests/Makefile \
+  src/XAO_Swig/Makefile \
   src/ImportExportGUI/Makefile \
   src/ARCHIMEDE/Makefile \
   src/BREPExport/Makefile \
index 0ca45f805dcd89ee7f6dac3d3d2ba1f212ca8ed4..e3eb2bd4705e4b7f3aa2008157f3c10c709f86d7 100644 (file)
@@ -23,7 +23,7 @@
 
 SUBDIRS = ARCHIMEDE NMTDS NMTTools GEOMAlgo SKETCHER OCC2VTK GEOM      \
           BREPExport BREPImport IGESExport IGESImport STEPExport       \
-          STEPImport STLExport VTKExport ShHealOper XAO GEOMImpl GEOM_I        \
+          STEPImport STLExport VTKExport ShHealOper XAO XAO_Swig GEOMImpl GEOM_I       \
           GEOMClient GEOM_I_Superv GEOM_SWIG GEOM_PY
 
 if WITH_OPENCV
diff --git a/src/XAO_Swig/Makefile.am b/src/XAO_Swig/Makefile.am
new file mode 100644 (file)
index 0000000..b95f8a5
--- /dev/null
@@ -0,0 +1,53 @@
+# Copyright (C) 2013  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# 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.
+#
+# 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 $(top_srcdir)/adm_local/unix/make_common_starter.am
+
+# this option puts it to dist
+#BUILT_SOURCES = swig_wrap.cpp
+
+SWIG_FLAGS    = @SWIG_FLAGS@ -I$(srcdir)/../XAO
+SWIG_SOURCES  = xao_swig.i
+
+# Libraries targets
+lib_LTLIBRARIES = _xao_swig.la
+_xao_swig_la_SOURCES = $(SWIG_SOURCES)
+nodist__xao_swig_la_SOURCES = swig_wrap.cpp
+nodist_salomescript_DATA = xao_swig.py
+
+dist_salomescript_PYTHON = xao.py
+
+EXTRA_DIST += $(SWIG_SOURCES)
+
+xao_swig.py: swig_wrap.cpp
+
+_xao_swig_la_CPPFLAGS = \
+       $(PYTHON_INCLUDES) \
+       $(CAS_CPPFLAGS) \
+       -I$(srcdir)/../XAO \
+       -I$(top_builddir)/idl
+
+_xao_swig_la_LDFLAGS = -module
+_xao_swig_la_LIBADD  = \
+       ../XAO/libXAO.la
+
+swig_wrap.cpp : $(SWIG_SOURCES)
+       $(SWIG) $(SWIG_FLAGS) -o $@ $<
+
+CLEANFILES = swig_wrap.cpp xao_swig.py
diff --git a/src/XAO_Swig/xao.py b/src/XAO_Swig/xao.py
new file mode 100644 (file)
index 0000000..431bc04
--- /dev/null
@@ -0,0 +1,28 @@
+#!/usr/bin/env python
+# -*- coding: iso-8859-1 -*-
+
+from xao_swig import *
+
+#from xao_swig import BOOLEAN, INTEGER, DOUBLE, STRING
+#from xao_swig import VERTEX, EDGE, FACE, SOLID, WHOLE
+#from xao_swig import BREP, STEP
+
+#from xao_swig import VectorBoolean, VectorDouble, VectorInteger, VectorString, VectorStep
+#from xao_swig import VectorVectorBoolean, VectorVectorDouble, VectorVectorInteger, VectorVectorString
+#from xao_swig import ListField, ListGroup, SetInt
+
+#from xao_swig import Field, BooleanField, IntegerField, DoubleField, StringField
+#from xao_swig import Step, BooleanStep, IntegerStep, DoubleStep, StringStep
+#from xao_swig import Xao, Group, Geometry, GeometricElement
+
+#from xao_swig import XAO_Exception
+
+#from xao_swig import BrepGeometry as _BrepGeometry
+
+#class BrepGeometry(_BrepGeometry):
+#    def setShape(self, shape):
+#        if shape is not None and 'GetShapeStream' in dir(shape):
+#            _BrepGeometry.setShape(self, shape.GetShapeStream())
+#        else:
+#            raise XAO_Exception("toto")
+
diff --git a/src/XAO_Swig/xao_swig.i b/src/XAO_Swig/xao_swig.i
new file mode 100644 (file)
index 0000000..01df965
--- /dev/null
@@ -0,0 +1,65 @@
+%module xao_swig
+%{
+#include "XAO_Exception.hxx"
+#include "XAO_XaoUtils.hxx"
+#include "XAO_Xao.hxx"
+#include "XAO_GeometricElement.hxx"
+#include "XAO_Geometry.hxx"
+#include "XAO_BrepGeometry.hxx"
+#include "XAO_Group.hxx"
+#include "XAO_Field.hxx"
+#include "XAO_Step.hxx"
+#include "XAO_BooleanField.hxx"
+#include "XAO_DoubleField.hxx"
+#include "XAO_IntegerField.hxx"
+#include "XAO_StringField.hxx"
+#include "XAO_BooleanStep.hxx"
+#include "XAO_DoubleStep.hxx"
+#include "XAO_IntegerStep.hxx"
+#include "XAO_StringStep.hxx"
+%}
+
+%include "std_string.i"
+%include "std_vector.i"
+%include "std_list.i"
+%include "std_map.i"
+%include "std_set.i"
+namespace std
+{
+%template(ListGroup)    list<XAO::Group*>;
+%template(ListField)    list<XAO::Field*>;
+%template(VectorStep)   vector<XAO::Step*>;
+%template(SetInt)       set<int>;
+
+%template(VectorBoolean)    vector<bool>;
+%template(VectorInteger)    vector<int>;
+%template(VectorDouble)     vector<double>;
+%template(VectorString)     vector<string>;
+
+%template(VectorVectorBoolean)  vector< vector<bool> >;
+%template(VectorVectorInteger)  vector< vector<int> >;
+%template(VectorVectorDouble)   vector< vector<double> >;
+%template(VectorVectorString)   vector< vector<string> >;
+}
+
+%include XAO_Exception.hxx
+%include XAO_XaoUtils.hxx
+
+%include XAO_Step.hxx
+%include XAO_BooleanStep.hxx
+%include XAO_DoubleStep.hxx
+%include XAO_IntegerStep.hxx
+%include XAO_StringStep.hxx
+
+%include XAO_Field.hxx
+%include XAO_BooleanField.hxx
+%include XAO_DoubleField.hxx
+%include XAO_IntegerField.hxx
+%include XAO_StringField.hxx
+
+%include XAO_Group.hxx
+
+%include XAO_GeometricElement.hxx
+%include XAO_Geometry.hxx
+%include XAO_BrepGeometry.hxx
+%include XAO_Xao.hxx