From: jfa Date: Wed, 28 Mar 2007 08:50:47 +0000 (+0000) Subject: Import a new plugin, sent by Stephane LIAUZU X-Git-Tag: V4_0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=302a69f9267ba3306d96507b0e4b3c6eab1ddc90;p=plugins%2Fhexoticplugin.git Import a new plugin, sent by Stephane LIAUZU --- 302a69f9267ba3306d96507b0e4b3c6eab1ddc90 diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..c0076b3 --- /dev/null +++ b/INSTALL @@ -0,0 +1,5 @@ +This is the version 3.2.0 of HexoticPLUGIN +Compatible with : + - KERNEL 3.2.0 + - GUI 3.2.0 + - SMESH 3.2.0 diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..7accff3 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,94 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS, L3S, LJLL, MENSI +# +# 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/ +# +# -* Makefile *- +# +# Author : Lioka RAZAFINDRAZAKA (CEA) +# Date : 2006/06/30 +# + +# source path +top_srcdir=@top_srcdir@ +top_builddir=. +srcdir=@srcdir@ +VPATH=.:@srcdir@:@top_srcdir@/bin:@top_srcdir@/resources:./bin:@top_srcdir@/idl + + +@COMMENCE@ + +SUBDIRS = idl src adm_local + +RESOURCES_FILES = \ + HexoticPlugin.xml \ + HexoticPLUGIN.xml \ + mesh_algo_Hexotic.png \ + mesh_hypo_Hexotic.png \ + mesh_tree_algo_Hexotic.png \ + mesh_tree_hypo_Hexotic.png \ + Hexotic.png + +BIN_SCRIPT = VERSION + +# copy header files in common directory ------------ + +ifeq ($(HAVE_SSTREAM),yes) + include_list=include/salome/SALOMEconfig.h +else + include_list=include/salome/SALOMEconfig.h include/salome/sstream +endif + +inc: idl $(include_list) + +include/salome/SALOMEconfig.h: salome_adm/unix/SALOMEconfig.ref + -$(RM) $@ + $(LN_S) ../../$< $@ + +# test if SALOMEconfig.h has changed (contents) +salome_adm/unix/SALOMEconfig.ref: salome_adm/unix/SALOMEconfig.h + @if ! [ -a $@ ]; then \ + cp -p -f $< $@; \ + fi; \ + if ! cmp $< $@; then \ + cp -p -f $< $@; \ + fi; \ + +include/salome/sstream: salome_adm/unix/sstream + -$(RM) $@ + $(LN_S) ../../$< $@ + +# install script in $(bindir) : +install-bin: $(BIN_SCRIPT) + $(INSTALL) -d $(bindir) + if test $(BIN_SCRIPT)X != X; then \ + $(INSTALL_PROGRAM) $^ $(bindir); \ + fi + +# CLEAN -------------------- + +distclean: distclean-other + +distclean-other: + -$(RM) salome_adm/unix/*~ salome_adm/unix/*% salome_adm/unix/*.bak salome_adm/unix/*.new salome_adm/unix/*.old + -$(RM) salome_adm/unix/make_* + -$(RM) salome_adm/unix/depend salome_adm/unix/SALOMEconfig.h + -$(RM) config.cache config.log config.status + +@MODULE@ + +install: install-bin diff --git a/adm_local/Makefile.in b/adm_local/Makefile.in new file mode 100644 index 0000000..b19e7c1 --- /dev/null +++ b/adm_local/Makefile.in @@ -0,0 +1,60 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS, L3S, LJLL, MENSI +# +# 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/ +# +# source path +top_srcdir=@top_srcdir@ +top_builddir=.. +srcdir=@srcdir@ +VPATH=.:$(srcdir)/adm_local + + +all: resources + +install: + cp -rf @top_srcdir@/adm_local @prefix@ + +bin: + +resources : + cp -rf @top_srcdir@/adm_local $(top_builddir) + +inc: + +lib: + +depend: + +depend_idl: + +install-end: + +install-include: + +install-bin: + +uninstall: + +uninstall-idl: + +distclean: + +clean: + +distclean-other: + diff --git a/adm_local/unix/config_files/check_HexoticPLUGIN.m4 b/adm_local/unix/config_files/check_HexoticPLUGIN.m4 new file mode 100644 index 0000000..e2e6497 --- /dev/null +++ b/adm_local/unix/config_files/check_HexoticPLUGIN.m4 @@ -0,0 +1,53 @@ +AC_DEFUN([CHECK_HEXOTIC],[ + +AC_REQUIRE([AC_PROG_CXX])dnl +AC_REQUIRE([AC_PROG_CXXCPP])dnl + +AC_CHECKING(for Hexotic comercial product) + +AC_LANG_SAVE +AC_LANG_CPLUSPLUS + +AC_ARG_WITH(, + [ --with-Hexotic=DIR root directory path of Hexotic installation], + Hexotic_HOME=$withval,Hexotic_HOME="") + +Hexotic_ok=no + +if test "x$Hexotic_HOME" == "x" ; then + +# no --with-Hexotic option used + if test "x$HexoticHOME" != "x" ; then + + # HexoticHOME environment variable defined + Hexotic_HOME=$HexoticHOME + + fi +# +fi + +if test "x$Hexotic_HOME" != "x"; then + + echo + echo ------------------------------------------------- + echo You are about to choose to use somehow the + echo Hexotic commercial product to generate 3D hexahedral mesh. + echo + + AC_MSG_CHECKING(for Hexotic executable) + + AC_CHECK_PROG(HEXOTIC, hexotic,found) + + if test "x$HEXOTIC" == x ; then + AC_MSG_RESULT(no) + AC_MSG_WARN(Hexotic program not found in PATH variable) + else + Hexotic_ok=yes + fi + +fi + +AC_MSG_RESULT(for Hexotic: $Hexotic_ok) +AC_LANG_RESTORE + +])dnl diff --git a/adm_local/unix/make_commence.in b/adm_local/unix/make_commence.in new file mode 100644 index 0000000..e400843 --- /dev/null +++ b/adm_local/unix/make_commence.in @@ -0,0 +1,284 @@ +# common directories to put headerfiles +inc_builddir=$(top_builddir)/include/salome + +@SET_MAKE@ +SHELL=/bin/sh + +# header missing + +HAVE_SSTREAM=@HAVE_SSTREAM@ + + +LIBS=@LIBS@ +LDFLAGS=@LDFLAGS@ -L$(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome -Xlinker -rpath-link -Xlinker $(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome +# add libstdc++ to link c++ library with libtool ! +LDFLAGS+= -lstdc++ + +CP=@CP@ + +# CPP + +CPP=@CPP@ +CXXCPP=@CXXCPP@ +CPPFLAGS=@CPPFLAGS@ -I$(inc_builddir) -I$(srcdir) -I. + +# C + +CC = @CC@ +CFLAGS = @CFLAGS@ +C_DEPEND_FLAG = @C_DEPEND_FLAG@ + +# C++ + +CXX = @CXX@ +CXXFLAGS = @CXXFLAGS@ +CXX_DEPEND_FLAG = @CXX_DEPEND_FLAG@ + +# BOOST Library + +BOOST_CPPFLAGS = @BOOST_CPPFLAGS@ + +# JAVA + +JAVA_INCLUDES = @JAVA_INCLUDES@ +JAVA_LIBS = @JAVA_LIBS@ +JAVA_LDPATH = @JAVA_LDPATH@ + +# PYTHON + +PYTHON = @PYTHON@ +PYTHONHOME = @PYTHONHOME@ +PYTHON_INCLUDES = @PYTHON_INCLUDES@ +PYTHON_LIBS = @PYTHON_LIBS@ +PYTHON_VERSION = @PYTHON_VERSION@ +PYTHON_SITE = @PYTHON_SITE@ +PYTHON_SITE_INSTALL = @PYTHON_SITE_INSTALL@ + +# QT + +QT_ROOT = @QT_ROOT@ +QT_INCLUDES = @QT_INCLUDES@ +QT_MT_INCLUDES = @QT_INCLUDES@ -DQT_THREAD_SUPPORT +QT_LIBS = @QT_LIBS@ +QT_MT_LIBS = @QT_MT_LIBS@ + +MOC = @MOC@ +UIC = @UIC@ +MSG2QM = @MSG2QM@ + +#QWT + +QWT_INCLUDES=@QWT_INCLUDES@ +QWT_LIBS=@QWT_LIBS@ + +# SIP +SIP = @SIP@ +SIP_INCLUDES = @SIP_INCLUDES@ +SIP_LIBS = @SIP_LIBS@ + +# PYQT +PYQT_SIPS = @PYQT_SIPS@ +PYQT_LIBS = @PYQT_LIBS@ + +# openGL +OGL_INCLUDES=@OGL_INCLUDES@ +OGL_LIBS=@OGL_LIBS@ + +# VTK +VTK_INCLUDES=@VTK_INCLUDES@ +VTK_LIBS=@VTK_LIBS@ + +# HDF5 + +HDF5_INCLUDES=@HDF5_INCLUDES@ +HDF5_LIBS=@HDF5_LIBS@ +HDF5_MT_LIBS=@HDF5_MT_LIBS@ + +# OpenCasCade + +OCC_INCLUDES=@CAS_CPPFLAGS@ +OCC_CXXFLAGS=@CAS_CXXFLAGS@ + +OCC_KERNEL_LIBS=@CAS_KERNEL@ +OCC_OCAF_LIBS=@CAS_OCAF@ +OCC_VIEWER_LIBS=@CAS_VIEWER@ +OCC_MODELER_LIBS=@CAS_MODELER@ +OCC_DATAEXCHANGE_LIBS=@CAS_DATAEXCHANGE@ +OCC_LIBS=@CAS_LDFLAGS@ +OCC_LDPATH=@CAS_LDPATH@ + +# MPICH + +MPICH_INCLUDES=@MPICH_INCLUDES@ +MPICH_LIBS=@MPICH_LIBS@ + +# Swig C++ Python + +SWIG = @SWIG@ +SWIG_FLAGS = @SWIG_FLAGS@ -I$(inc_builddir) -I$(srcdir) -I. + +# OMNIORB + +OMNIORB_ROOT = @OMNIORB_ROOT@ +OMNIORB_INCLUDES = @OMNIORB_INCLUDES@ +OMNIORB_LIBS = @OMNIORB_LIBS@ +OMNIORB_CXXFLAGS = @OMNIORB_CXXFLAGS@ + +OMNIORB_IDL = @OMNIORB_IDL@ +OMNIORB_IDLCXXFLAGS = @OMNIORB_IDLCXXFLAGS@ +OMNIORB_IDLPYFLAGS = @OMNIORB_IDLPYFLAGS@ -I$(srcdir) -I$(KERNEL_ROOT_DIR)/idl/salome \ + -I$(GEOM_ROOT_DIR)/idl/salome -I$(MED_ROOT_DIR)/idl/salome\ + -I$(SMESH_ROOT_DIR)/idl/salome + +OMNIORB_IDL_CLN_H = @OMNIORB_IDL_CLN_H@ +OMNIORB_IDL_CLN_CXX = @OMNIORB_IDL_CLN_CXX@ +OMNIORB_IDL_CLN_OBJ = @OMNIORB_IDL_CLN_OBJ@ + +OMNIORB_IDL_SRV_H = @OMNIORB_IDL_SRV_H@ +OMNIORB_IDL_SRV_CXX = @OMNIORB_IDL_SRV_CXX@ +OMNIORB_IDL_SRV_OBJ = @OMNIORB_IDL_SRV_OBJ@ + +# Default ORB + +CORBA_ROOT = @CORBA_ROOT@ +CORBA_INCLUDES = @CORBA_INCLUDES@ +CORBA_LIBS = @CORBA_LIBS@ +CORBA_CXXFLAGS = @CORBA_CXXFLAGS@ + +IDLCXXFLAGS = -bcxx @IDLCXXFLAGS@ -I$(srcdir) -I$(KERNEL_ROOT_DIR)/idl/salome \ + -I$(GEOM_ROOT_DIR)/idl/salome -I$(MED_ROOT_DIR)/idl/salome\ + -I$(SMESH_ROOT_DIR)/idl/salome +IDLPYFLAGS = @IDLPYFLAGS@ + +IDL = @IDL@ + +IDL_CLN_H = @IDL_CLN_H@ +IDL_CLN_CXX = @IDL_CLN_CXX@ +IDL_CLN_OBJ = @IDL_CLN_OBJ@ + +IDL_SRV_H = @IDL_SRV_H@ +IDL_SRV_CXX = @IDL_SRV_CXX@ +IDL_SRV_OBJ = @IDL_SRV_OBJ@ + +CPPFLAGS+= $(CORBA_INCLUDES) +CXXFLAGS+= $(CORBA_CXXFLAGS) + +# SALOME + +SALOME_INCLUDES = \ + -I$(KERNEL_ROOT_DIR)/include/salome \ + -I$(GEOM_ROOT_DIR)/include/salome \ + -I$(SMESH_ROOT_DIR)/include/salome + +CPPFLAGS += -DSOLIDGEOM -DLINUX $(OCC_INCLUDES) $(SALOME_INCLUDES) $(BOOST_CPPFLAGS) +CXXFLAGS += -DSOLIDGEOM -DLINUX $(OCC_CXXFLAGS) $(SALOME_INCLUDES) + +LDFLAGS += -L${KERNEL_ROOT_DIR}/lib@LIB_LOCATION_SUFFIX@/salome -L${SMESH_ROOT_DIR}/lib@LIB_LOCATION_SUFFIX@/salome -L${GEOM_ROOT_DIR}/lib@LIB_LOCATION_SUFFIX@/salome -lSMESHimpl -lSMESHEngine -lStdMeshers -lStdMeshersEngine -lSalomeGenericObj + +# add corba libs when link salome application ! +#LDFLAGS+= $(CORBA_LIBS) +LIBS+=$(CORBA_LIBS) + +## Shared libraries +LT_STATIC_EXEC=@LT_STATIC_EXEC@ +DYNAMIC_DIRS=@DYNAMIC_DIRS@ +LT_LIB=libtool +LT=$(top_builddir)/libtool +LT_COMPILE=$(LT) --mode=compile $(CC) +LT_LINK_LIB=$(LT_LIB) --mode=link $(CC) -rpath $(libdir) +LT_LINK_EXE=$(LT) --mode=link $(CC) $(LT_STATIC_EXEC) -dlopen self -rpath $(bindir) $(DYNAMIC_DIRS) +LT_RUN=$(LT) --mode=execute +LT_INSTALL_PROG=$(LT) --mode=install $(INSTALL_PROGRAM) +LT_INSTALL_LIB=$(LT) --mode=install $(INSTALL_DATA) +LT_UNINSTALL=$(LT) --mode=uninstall $(RM) + +INSTALL=@INSTALL@ +INSTALL_PROGRAM=@INSTALL_PROGRAM@ +INSTALL_DATA=@INSTALL_DATA@ + +# create a symbolic link (or a copie ?) +LN_S=@LN_S@ + +## Installation points +prefix=@prefix@ +exec_prefix=@exec_prefix@ +bindir=@bindir@/salome +libdir=@exec_prefix@/lib@LIB_LOCATION_SUFFIX@/salome +# warning : if user give this path in configure we could have salome/salome :-( +includedir=@includedir@/salome +datadir=@datadir@/salome +idldir=$(prefix)/idl/salome +sharedpydir=@exec_prefix@/lib@LIB_LOCATION_SUFFIX@/python$(PYTHON_VERSION)/site-packages/salome/shared_modules + +docdir=${prefix}/doc/salome + +# +# begin of package rules +# + +.PHONY: all lib bin inc resources docs tests install uninstall dep depend depend_idl cleandep mostlyclean clean distclean + +.SUFFIXES: .cxx .cc .c .f .o .lo .idl .py .i .ui .po .qm + +all: + $(MAKE) inc + $(MAKE) depend_idl + $(MAKE) depend + $(MAKE) lib + $(MAKE) bin + $(MAKE) resources + +# +# add target to build administrative files +# + +Makefile: $(top_builddir)/config.status $(srcdir)/Makefile.in + cd $(top_builddir) ; ./config.status + +LOCAL_MAKE = make_commence make_omniorb + +KERNEL_MAKE = make_module make_conclude depend SALOMEconfig.h F77config.h sstream envScript + +$(top_builddir)/config.status: $(top_srcdir)/configure \ + $(LOCAL_MAKE:%=$(top_srcdir)/adm_local/unix/%.in) \ + $(KERNEL_MAKE:%=$(KERNEL_ROOT_DIR)/salome_adm/unix/%.in) + cd $(top_builddir) ; ./config.status --recheck + +# VPATH contain $(srcdir), so make configure is good in top_srcdir and we must add target configure otherwise :-) +ifneq ($(top_srcdir),$(srcdir)) +configure: $(top_srcdir)/configure +endif + +$(top_srcdir)/configure: $(top_srcdir)/configure.in $(top_srcdir)/aclocal.m4 + cd $(top_srcdir) ; autoconf + +$(top_srcdir)/configure.in: $(top_srcdir)/configure.in.base + cd $(top_srcdir) && ./build_configure + + +ACLOCAL_KERNEL = \ +ac_cxx_bool.m4 check_corba.m4 \ +ac_cxx_depend_flag.m4 check_hdf5.m4 enable_pthreads.m4 \ +ac_cxx_mutable.m4 check_mico.m4 libtool.m4 \ +ac_cxx_namespaces.m4 check_omniorb.m4 pyembed.m4 \ +ac_cxx_partial_specialization.m4 python.m4 \ +ac_cxx_typename.m4 check_pthreads.m4 check_cas.m4 \ +ac_cc_warnings.m4 check_swig.m4 check_boost.m4 + +ACLOCAL_GUI = \ +check_vtk.m4 check_opengl.m4 check_qt.m4 \ +check_GUI.m4 check_corba_in_GUI.m4 + +ACLOCAL_GEOM = check_GEOM.m4 + +ACLOCAL_SMESH = check_SMESH.m4 + +$(top_srcdir)/aclocal.m4: $(ACLOCAL_KERNEL%=@KERNEL_ROOT_DIR@/salome_adm/unix/config_files/%) \ + $(ACLOCAL_GUI:%=@GUI_ROOT_DIR@/adm_local/unix/config_files/%) \ + $(ACLOCAL_GEOM:%=@GEOM_ROOT_DIR@/adm_local/unix/config_files/%) \ + $(ACLOCAL_SMESH:%=@SMESH_ROOT_DIR@/adm_local/unix/config_files/%) + cd $(top_srcdir) ; aclocal -I adm_local/unix/config_files -I @KERNEL_ROOT_DIR@/salome_adm/unix/config_files \ + -I @GUI_ROOT_DIR@/adm_local/unix/config_files \ + -I @GEOM_ROOT_DIR@/adm_local/unix/config_files \ + -I @SMESH_ROOT_DIR@/adm_local/unix/config_files + diff --git a/adm_local/unix/make_omniorb.in b/adm_local/unix/make_omniorb.in new file mode 100644 index 0000000..217e040 --- /dev/null +++ b/adm_local/unix/make_omniorb.in @@ -0,0 +1,61 @@ +#======================================================================= +# Begin specific part to omniorb +# (include from file adm/unix/make_omniorb generated by +# adm/unix/make_omniorb.in) +#======================================================================= +# -* Makefile *- +# +# Author : Patrick GOLDBRONN (CEA) +# Date : 29/06/2001 +# + +# Client and server object are the same with omniorb +# There are one header file and one source file generate + +#IDLOBJ=$(IDLSRC:%.idl=%$(IDL_CLN_OBJ)) + +# dependancies between idl and it's generated files +%$(OMNIORB_IDL_CLN_CXX) %$(OMNIORB_IDL_CLN_H): ${KERNEL_ROOT_DIR}/idl/salome/%.idl + $(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $< + +%$(OMNIORB_IDL_CLN_CXX) %$(OMNIORB_IDL_CLN_H): ${GEOM_ROOT_DIR}/idl/salome/%.idl + $(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $< + +#%$(OMNIORB_IDL_CLN_CXX) %$(OMNIORB_IDL_CLN_H): ${MED_ROOT_DIR}/idl/salome/%.idl +# $(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $< + +%$(OMNIORB_IDL_CLN_CXX) %$(OMNIORB_IDL_CLN_H): ${SMESH_ROOT_DIR}/idl/salome/%.idl + $(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $< + +%$(OMNIORB_IDL_CLN_CXX) %$(OMNIORB_IDL_CLN_H): ${top_builddir}/idl/salome/%.idl + $(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $< + +# dependncies between idl files +depend_idl: .depidl + +# we use cpp to generate dependencies between idl files. +# we change cpp output to keep only idl file and transform it to get a suitable rule +.depidl: $(IDL_FILES) + @touch $@ + @for dep in $? dummy; do \ + if [ $$dep != "dummy" ]; then \ + echo Building dependencies for $$dep; \ + basedep=`basename $$dep .idl`; \ + header="$$basedep"$(IDL_CLN_H); \ + sed '\%^'"$$header"':%,\%[^\\]$$%d' <$@ >$@- && mv $@- $@; \ + $(CPP) $(C_DEPEND_FLAG) -I$(srcdir) $$dep 2>/dev/null | \ + sed `echo "s%$$basedep\\.idl%$$header:%g"` | \ + sed 's% $(srcdir)/% %g' | \ + sed 's% $(top_srcdir)/% %g' | \ + sed 's% $(top_builddir)/% %g' | \ + sed 's%^.*:\.o: *%%' | sed 's%^ *\\ *%%'| sed 's%^ *\(.*\):%\1:%' | \ + sed 's/\.idl/$(IDL_CLN_H)/' >>$@; \ + echo '' >>$@; \ + fi; \ + done ; + +-include .depidl + +#======================================================================= +# End specific part to omniorb +#======================================================================= diff --git a/bin/VERSION.in b/bin/VERSION.in new file mode 100755 index 0000000..603250d --- /dev/null +++ b/bin/VERSION.in @@ -0,0 +1 @@ +THIS IS SALOME - HexoticPLUGIN VERSION: @VERSION@ diff --git a/build_configure b/build_configure new file mode 100755 index 0000000..b1db1b3 --- /dev/null +++ b/build_configure @@ -0,0 +1,261 @@ +#!/bin/bash + +# +# Tool for updating list of .in file for the SALOME project +# and regenerating configure script +# +# Author : Marc Tajchman - CEA +# Date : 10/10/2002 +# + +ORIG_DIR=`pwd` +CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"` + +######################################################################## +# Test if the KERNEL_ROOT_DIR is set correctly + +if test ! -d "${KERNEL_ROOT_DIR}"; then + echo "failed : KERNEL_ROOT_DIR variable is not correct !" + exit +fi + +# Test if the KERNEL_SRC is set correctly + +#if test ! -d "${KERNEL_SRC}"; then +# echo "failed : KERNEL_SRC variable is not correct !" +# exit +#fi +######################################################################## +# Test if the GUI_ROOT_DIR is set correctly + +if test ! -d "${GUI_ROOT_DIR}"; then + echo "failed : GUI_ROOT_DIR variable is not correct !" + exit +fi + +######################################################################## +# Test if the MED_ROOT_DIR is set correctly + +if test ! -d "${MED_ROOT_DIR}"; then + echo "failed : MED_ROOT_DIR variable is not correct !" + exit +fi + +######################################################################## +# Test if the GEOM_ROOT_DIR is set correctly + +if test ! -d "${GEOM_ROOT_DIR}"; then + echo "failed : GEOM_ROOT_DIR variable is not correct !" + exit +fi + +######################################################################## +# Test if the SMESH_ROOT_DIR is set correctly + +if test ! -d "${SMESH_ROOT_DIR}"; then + echo "failed : SMESH_ROOT_DIR variable is not correct !" + exit +fi + +######################################################################## +# find_in - utility function +# +# usage : +# find_in directory filename +# +# Finds files following the *.in pattern, recursively in the +# directory (first argument). +# Results are appended into the file (second argument) +# +# Difference from the standard unix find is that files are tested +# before directories +# + +find_in() +{ + local i + local f=$2 + +# if the first argument is not a directory, returns + + if [ ! -d "$1" ] ; then + return + fi + +# dont look in the CVS directories + + case $1 in + */CVS) return ;; + */adm_local/*) return ;; + *) ;; + esac + +# for each regular file contained in the directory +# test if it's a .in file + + for i in "$1"/* + do + if [ -f "$i" ] ; then + case $i in + *.in) echo " "$i" \\" >> $f;; + *) ;; + esac + fi + done + +# for each subdirectory of the first argument, proceeds recursively + + for i in "$1"/* + do + if [ -d "$i" ] ; then + find_in "$i" "$f" + fi + done +} + + +####################################################################### +# Generate list of .in files (Makefile.in, config.h.in, etc) +# appending it in file configure.in + +cd ${CONF_DIR} +ABS_CONF_DIR=`pwd` + +echo +echo "CONF_DIR : $CONF_DIR" +echo "ABS_CONF_DIR : $ABS_CONF_DIR" +echo "KERNEL_ROOT_DIR : $KERNEL_ROOT_DIR" +echo "ROOT_SRCDIR : $ROOT_SRCDIR" +echo + +# +# Common part of the configure.in file +# +chmod u+w configure.in.base +if ! \cp -f configure.in.base configure.in_tmp1 +then + echo + echo "error : can't create files in" ${CONF_DIR} + echo "aborting ..." + chmod u-w configure.in.base + exit +fi +chmod u-w configure.in.base + +if [ -e "${CONF_DIR}/salome_adm" ] ; then + echo "salome_adm file exists in the current directory" + \rm -f ${CONF_DIR}/salome_adm +fi + +# make a link allowing AC_OUTPUT to find the salome_adm/.../*.in files +echo "" >> configure.in_tmp1 +echo 'ln -fs ${KERNEL_ROOT_DIR}/salome_adm ${ROOT_SRCDIR}/.' >> configure.in_tmp1 + +echo "" >> configure.in_tmp1 +echo "AC_OUTPUT([ \\" >> configure.in_tmp1 + +# +# List of .in files in the adm/unix directory +# These files MUST be on top of AC_OUTPUT list so we +# put them "manually" +# + +echo " ./salome_adm/unix/SALOMEconfig.h \\" >> configure.in_tmp1 +echo " ./salome_adm/unix/F77config.h \\" >> configure.in_tmp1 +echo " ./salome_adm/unix/sstream \\" >> configure.in_tmp1 +echo " ./salome_adm/unix/depend \\" >> configure.in_tmp1 +echo " ./adm_local/unix/make_omniorb:${ABS_CONF_DIR}/adm_local/unix/make_omniorb.in \\" >> configure.in_tmp1 +echo " ./salome_adm/unix/envScript \\" >> configure.in_tmp1 +echo " ./adm_local/unix/make_commence:${ABS_CONF_DIR}/adm_local/unix/make_commence.in \\" >> configure.in_tmp1 +echo " ./salome_adm/unix/make_conclude \\" >> configure.in_tmp1 +echo " ./salome_adm/unix/make_module \\" >> configure.in_tmp1 + +\rm -f configure.in_tmp2 configure.in_tmp3 +touch configure.in_tmp2 +find_in . configure.in_tmp2 + +sed -e '/^...salome_adm/d' configure.in_tmp2 > configure.in_tmp3 +sed -e '/^...adm_local.unix.make_omniorb/d' configure.in_tmp3 configure.in_tmp2 +sed -e '/^...adm_local.unix.make_commence/d' configure.in_tmp2 > configure.in_tmp3 +sed -e '/configure.in/d' configure.in_tmp3 > configure.in_tmp2 +sed -e 's/.in / /' configure.in_tmp2 >> configure.in_tmp1 +#sed '/^.salome_adm/d' configure.in_tmp2 > configure.in_tmp3 +#sed '/configure.in/d' configure.in_tmp3 > configure.in_tmp2 +#sed 's/.in / /' configure.in_tmp2 >> configure.in_tmp1 + +echo "])" >> configure.in_tmp1 + +# delete the link created for AC_OUTPUT +echo "" >> configure.in_tmp1 +#echo 'rm -f ${ROOT_SRCDIR}/salome_adm' >> configure.in_tmp1 + +\mv configure.in_tmp1 configure.in_new +\rm -f configure.in_tmp2 configure.in_tmp3 + +######################################################################## +# Create new (or replace old) configure.in file +# Print a message if the file is write protected +# + +echo +if test ! -f configure.in +then + echo -n "Creating new file 'configure.in' ... " + if \mv configure.in_new configure.in >& /dev/null + then + echo "done" + else + echo "error, check your file permissions" + fi +else + echo -n "Updating 'configure.in' file ... " + if ! \cp configure.in configure.in_old >& /dev/null + then + echo + echo + echo "Can't backup previous configure.in" + echo -n "Continue (you will not be able to revert) - (Y/N) ? " + read R + case "x$R" in + xn*) exit;; + xN*) exit;; + esac + echo + echo -n " " + fi + if \cp configure.in_new configure.in >& /dev/null + then + echo "done" + else + echo + echo "error, can't update previous configure.in" + fi +fi + +######################################################################## +# Use autoconf to rebuild the configure script +# + +if test -f configure +then + echo -n "Updating 'configure' script ... " +else + echo -n "Creating 'configure' script ... " +fi + +aclocal -I adm_local/unix/config_files -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \ + -I ${GUI_ROOT_DIR}/adm_local/unix/config_files \ + -I ${MED_ROOT_DIR}/adm_local/unix/config_files \ + -I ${GEOM_ROOT_DIR}/adm_local/unix/config_files \ + -I ${SMESH_ROOT_DIR}/adm_local/unix/config_files + +if autoconf +then + echo "done" +else + echo "failed (check file permissions and/or user quotas ...)" +fi + +cd ${ORIG_DIR} + +echo diff --git a/configure.in.base b/configure.in.base new file mode 100644 index 0000000..516f016 --- /dev/null +++ b/configure.in.base @@ -0,0 +1,427 @@ +# +# PLEASE DO NOT MODIFY configure.in FILE +# +# ALL CHANGES WILL BE DISCARDED BY THE NEXT +# build_configure COMMAND +# +# CHANGES MUST BE MADE IN configure.in.base FILE +# +# +# Author : Lioka RAZAFINDRAZAKA (CEA) +# Date : 2006/06/30 +# Modified by : Patrick GOLDBRONN (CEA) +# Modified by : Marc Tajchman (CEA) +# +# Created from configure.in.base +# + +AC_INIT(src) +AC_CONFIG_AUX_DIR(${KERNEL_ROOT_DIR}/salome_adm/unix/config_files) +AC_CANONICAL_HOST + +PACKAGE=salome +AC_SUBST(PACKAGE) + +VERSION=0.0.1 +AC_SUBST(VERSION) + +dnl +dnl Initialize source and build root directories +dnl + +ROOT_BUILDDIR=`pwd` +ROOT_SRCDIR=`echo $0 | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"` +cd $ROOT_SRCDIR +ROOT_SRCDIR=`pwd` +cd $ROOT_BUILDDIR + +AC_SUBST(ROOT_SRCDIR) +AC_SUBST(ROOT_BUILDDIR) + +echo +echo Source root directory : $ROOT_SRCDIR +echo Build root directory : $ROOT_BUILDDIR +echo +echo + +if test -z "$AR"; then + AC_CHECK_PROGS(AR,ar xar,:,$PATH) +fi +AC_SUBST(AR) + +dnl Export the AR macro so that it will be placed in the libtool file +dnl correctly. +export AR + +echo +echo --------------------------------------------- +echo testing make +echo --------------------------------------------- +echo + +AC_PROG_MAKE_SET +AC_PROG_INSTALL +dnl +dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + pour les librairies dynamiques ! + +AC_ENABLE_DEBUG(yes) +AC_DISABLE_PRODUCTION + +echo --------------------------------------------- +echo testing libtool +echo --------------------------------------------- + +dnl first, we set static to no! +dnl if we want it, use --enable-static +AC_ENABLE_STATIC(no) + +AC_LIBTOOL_DLOPEN +AC_PROG_LIBTOOL + +dnl Fix up the INSTALL macro if it s a relative path. We want the +dnl full-path to the binary instead. +case "$INSTALL" in + *install-sh*) + INSTALL='\${KERNEL_ROOT_DIR}'/salome_adm/unix/config_files/install-sh + ;; +esac + +echo +echo --------------------------------------------- +echo testing C/C++ +echo --------------------------------------------- +echo + +cc_ok=no +dnl inutil car libtool +dnl AC_PROG_CC +AC_PROG_CXX +AC_DEPEND_FLAG +# AC_CC_WARNINGS([ansi]) +cc_ok=yes + +dnl Library libdl : +AC_CHECK_LIB(dl,dlopen) + +dnl add library libm : +AC_CHECK_LIB(m,ceil) + +dnl +dnl Well we use sstream which is not in gcc pre-2.95.3 +dnl We must test if it exists. If not, add it in include ! +dnl + +AC_CXX_HAVE_SSTREAM + +dnl +dnl --------------------------------------------- +dnl testing MPICH +dnl --------------------------------------------- +dnl + +CHECK_MPICH + +echo +echo --------------------------------------------- +echo testing LEX \& YACC +echo --------------------------------------------- +echo + +lex_yacc_ok=no +AC_PROG_YACC +AC_PROG_LEX +lex_yacc_ok=yes + +echo +echo --------------------------------------------- +echo testing python +echo --------------------------------------------- +echo + +CHECK_PYTHON + +echo +echo --------------------------------------------- +echo BOOST Library +echo --------------------------------------------- +echo + +CHECK_BOOST + +dnl echo +dnl echo --------------------------------------------- +dnl echo testing java +dnl echo --------------------------------------------- +dnl echo + +dnl CHECK_JAVA + +echo +echo --------------------------------------------- +echo testing swig +echo --------------------------------------------- +echo + +CHECK_SWIG + +echo +echo --------------------------------------------- +echo testing threads +echo --------------------------------------------- +echo + +ENABLE_PTHREADS + +echo +echo --------------------------------------------- +echo testing omniORB +echo --------------------------------------------- +echo + +CHECK_OMNIORB + +dnl echo +dnl echo --------------------------------------------- +dnl echo testing mico +dnl echo --------------------------------------------- +dnl echo + +dnl CHECK_MICO + +echo +echo --------------------------------------------- +echo default ORB : omniORB +echo --------------------------------------------- +echo + +DEFAULT_ORB=omniORB +CHECK_CORBA + +AC_SUBST_FILE(CORBA) +corba=make_$ORB +CORBA=adm_local/unix/$corba + +echo +echo --------------------------------------------- +echo testing openGL +echo --------------------------------------------- +echo + +CHECK_OPENGL + +echo +echo --------------------------------------------- +echo testing QT +echo --------------------------------------------- +echo + +CHECK_QT + +echo +echo --------------------------------------------- +echo testing MSG2QM +echo --------------------------------------------- +echo + +CHECK_MSG2QM + +echo +echo --------------------------------------------- +echo testing VTK +echo --------------------------------------------- +echo + +CHECK_VTK + +echo +echo --------------------------------------------- +echo testing HDF5 +echo --------------------------------------------- +echo + +CHECK_HDF5 + +echo +echo --------------------------------------------- +echo Testing OpenCascade +echo --------------------------------------------- +echo + +CHECK_CAS + +echo +echo --------------------------------------------- +echo Testing html generators +echo --------------------------------------------- +echo + +CHECK_HTML_GENERATORS + +echo +echo --------------------------------------------- +echo Testing GUI +echo --------------------------------------------- +echo + +CHECK_SALOME_GUI + +echo +echo --------------------------------------------- +echo Testing full GUI +echo --------------------------------------------- +echo + +CHECK_CORBA_IN_GUI +if test "x${CORBA_IN_GUI}" != "xyes"; then + echo "failed : For configure HexoticPLUGIN module necessary full GUI !" + exit +fi + +echo +echo --------------------------------------------- +echo Testing Kernel +echo --------------------------------------------- +echo + +CHECK_KERNEL + +echo +echo --------------------------------------------- +echo Testing Geom +echo --------------------------------------------- +echo + +CHECK_GEOM + +# echo +# echo --------------------------------------------- +# echo Testing Med +# echo --------------------------------------------- +# echo +# +# CHECK_MED + +echo +echo --------------------------------------------- +echo Testing Hexotic +echo --------------------------------------------- +echo + +CHECK_HEXOTIC + +echo +echo --------------------------------------------- +echo Testing SMesh +echo --------------------------------------------- +echo + +CHECK_SMESH + +echo +echo --------------------------------------------- +echo Summary +echo --------------------------------------------- +echo + +echo Configure +variables="cc_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok omniORB_ok occ_ok doxygen_ok graphviz_ok Kernel_ok Geom_ok SMesh_ok Hexotic_ok" + +for var in $variables +do + printf " %10s : " `echo \$var | sed -e "s,_ok,,"` + eval echo \$$var +done + +echo +echo "Default ORB : $DEFAULT_ORB" +echo + +dnl generals files which could be included in every makefile + +AC_SUBST_FILE(COMMENCE) COMMENCE=adm_local/unix/make_commence +AC_SUBST_FILE(CONCLUDE) CONCLUDE=salome_adm/unix/make_conclude +AC_SUBST_FILE(MODULE) MODULE=salome_adm/unix/make_module + +dnl les dependences +AC_SUBST_FILE(DEPEND) DEPEND=salome_adm/unix/depend + +dnl We don t need to say when we re entering directories if we re using +dnl GNU make becuase make does it for us. +if test "X$GMAKE" = "Xyes"; then + AC_SUBST(SETX) SETX=":" +else + AC_SUBST(SETX) SETX="set -x" +fi + +# make other build directories +for rep in salome_adm adm_local doc bin/salome include/salome lib${LIB_LOCATION_SUFFIX}/salome share/salome/resources idl +do +# if test ! -d $rep ; then +# eval mkdir $rep +# fi + $INSTALL -d $rep +done + +echo +echo --------------------------------------------- +echo copying resource files, shell scripts, and +echo xml files +echo --------------------------------------------- +echo + + +dnl copy resources directories + +#for i in `find $ROOT_SRCDIR -name 'resources' -print` +#do +# local_res=`echo $i | sed -e "s,$ROOT_SRCDIR,.,"` +# local_res_dir=`echo $local_res | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"` +# mkdir -p $local_res_dir +# cd $local_res_dir +# ln -fs $i +# echo $local_res +# cd $ROOT_BUILDDIR +#done + +dnl copy shells and utilities contained in the bin directory +dnl excluding .in files (treated in AC-OUTPUT below) and CVS +dnl directory + +#mkdir -p bin/salome +#cd bin/salome +#for i in $ROOT_SRCDIR/bin/* +#do +# local_bin=`echo $i | sed -e "s,$ROOT_SRCDIR,.,"` +# case "$local_bin" in +# *.in | *~) ;; +# ./bin/CVS | ./bin/salome) ;; +# *) /usr/bin/install -C $i .; echo $local_bin ;; +# esac +#done +#cd $ROOT_BUILDDIR + +AC_SUBST_FILE(ENVSCRIPT) ENVSCRIPT=salome_adm/unix/envScript + +dnl copy xml files to the build tree (lib directory) +dnl pourquoi ???? + +#cd lib +#for i in `find $ROOT_SRCDIR -name "*.xml" -print` +#do +# ln -fs $i +# echo `echo $i | sed -e "s,$ROOT_SRCDIR,.,"` +#done +#cd $ROOT_BUILDDIR + + +echo +echo --------------------------------------------- +echo generating Makefiles and configure files +echo --------------------------------------------- +echo + +#AC_OUTPUT_COMMANDS([ \ +# chmod +x ./bin/* \ +#]) + +## do not delete this line diff --git a/env_Hexoticplugin-Src.sh b/env_Hexoticplugin-Src.sh new file mode 100644 index 0000000..d90f7c2 --- /dev/null +++ b/env_Hexoticplugin-Src.sh @@ -0,0 +1,3 @@ +#------ Hexoticplugin-Src ------ +export HexoticPLUGIN_SRC_DIR=${INSTALL_ROOT}/HexoticPLUGIN_SRC +## diff --git a/idl/HexoticPlugin_Algorithm.idl b/idl/HexoticPlugin_Algorithm.idl new file mode 100644 index 0000000..c621d5d --- /dev/null +++ b/idl/HexoticPlugin_Algorithm.idl @@ -0,0 +1,59 @@ +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : HexoticPlugin_Algorithm.idl +// Author : Lioka RAZAFINDRAZAKA (CEA) + +#ifndef _SMESH_HexoticALGORITHM_IDL_ +#define _SMESH_HexoticALGORITHM_IDL_ + +#include "SMESH_Hypothesis.idl" + +/*! + * HexoticPlugin: interfaces to Hexotic related hypotheses and algorithms + */ +module HexoticPlugin +{ + /*! + * HexoticPlugin_Hexotic: interface of Hexotic algorithm + */ + interface HexoticPlugin_Hexotic : SMESH::SMESH_3D_Algo + { + }; + + /*! + * HexoticPlugin_Hypothesis: interface of "Hexotic parameters" hypothesis + */ + interface HexoticPlugin_Hypothesis : SMESH::SMESH_Hypothesis + { + void SetHexesMinLevel(in long value); + long GetHexesMinLevel(); + + void SetHexesMaxLevel(in long value); + long GetHexesMaxLevel(); + + void SetHexoticQuadrangles(in boolean value); + boolean GetHexoticQuadrangles(); + }; + +}; + +#endif diff --git a/idl/Makefile.in b/idl/Makefile.in new file mode 100644 index 0000000..165f7d7 --- /dev/null +++ b/idl/Makefile.in @@ -0,0 +1,84 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS, L3S, LJLL, MENSI +# +# 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/ +# +# +# generate dependencies for idl file : +# + +# source path +top_srcdir=@top_srcdir@ +top_builddir=.. +srcdir=@srcdir@ +VPATH=.:${KERNEL_ROOT_DIR}/idl/salome:${GEOM_ROOT_DIR}/idl/salome :${SMESH_ROOT_DIR}/idl/salome +#:${MED_ROOT_DIR}/idl/salome + +@COMMENCE@ + +IDL_FILES = HexoticPlugin_Algorithm.idl + + +# copy all idl file in $(top_builddir)/idl +inc: $(top_builddir)/idl/salome $(IDL_FILES:%=$(top_builddir)/idl/salome/%) + +$(top_builddir)/idl/salome: + $(INSTALL) -d $@ + +$(IDL_FILES:%=$(top_builddir)/idl/salome/%):$(IDL_FILES:%=$(top_srcdir)/idl/%) + cp -f $^ $(top_builddir)/idl/salome + + +# python wrap +lib: pyidl + +PYTHON_BUILD_SITE=$(top_builddir)/lib@LIB_LOCATION_SUFFIX@/python$(PYTHON_VERSION)/site-packages/@PACKAGE@ + +pyidl: $(PYTHON_BUILD_SITE) $(IDL_FILES:%.idl=$(PYTHON_BUILD_SITE)/%_idl.py) + +$(PYTHON_BUILD_SITE): + $(INSTALL) -d $@ + +$(PYTHON_BUILD_SITE)/%_idl.py: $(top_builddir)/idl/salome/%.idl + $(OMNIORB_IDL) $(OMNIORB_IDLPYFLAGS) -C$(PYTHON_BUILD_SITE) $< + + +# install python client (generated from idl file) +install: $(IDL_FILES:%=$(top_builddir)/idl/salome/%) + $(INSTALL) -d $(idldir) $(PYTHON_SITE_INSTALL) + $(INSTALL_DATA) $^ $(idldir) + @for file in $^ dummy; do \ + if [ $$file != "dummy" ]; then \ + $(OMNIORB_IDL) $(OMNIORB_IDLPYFLAGS) -C$(PYTHON_SITE_INSTALL) $$file ; \ + fi ; \ + done ; + +uninstall: + -$(RM) $(IDL_FILES:%=$(idldir)/%) + -$(RM) $(IDL_FILES:%.idl=$(PYTHON_SITE_INSTALL)/%_idl.py) + +# clean +cleandep: + -$(RM) .dep* + +clean: cleandep + -$(RM) $(top_builddir)/idl/salome/*.idl + -$(RM) $(PYTHON_BUILD_SITE)/*.py + +distclean: clean + -$(RM) Makefile + diff --git a/resources/Hexotic.png b/resources/Hexotic.png new file mode 100644 index 0000000..487fdb7 Binary files /dev/null and b/resources/Hexotic.png differ diff --git a/resources/HexoticPLUGIN.xml b/resources/HexoticPLUGIN.xml new file mode 100644 index 0000000..e997aad --- /dev/null +++ b/resources/HexoticPLUGIN.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + diff --git a/resources/HexoticPlugin.xml b/resources/HexoticPlugin.xml new file mode 100644 index 0000000..e997aad --- /dev/null +++ b/resources/HexoticPlugin.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + diff --git a/resources/mesh_algo_Hexotic.png b/resources/mesh_algo_Hexotic.png new file mode 100644 index 0000000..2629a2b Binary files /dev/null and b/resources/mesh_algo_Hexotic.png differ diff --git a/resources/mesh_hypo_Hexotic.png b/resources/mesh_hypo_Hexotic.png new file mode 100644 index 0000000..487fdb7 Binary files /dev/null and b/resources/mesh_hypo_Hexotic.png differ diff --git a/resources/mesh_tree_algo_Hexotic.png b/resources/mesh_tree_algo_Hexotic.png new file mode 100755 index 0000000..092eae3 Binary files /dev/null and b/resources/mesh_tree_algo_Hexotic.png differ diff --git a/resources/mesh_tree_hypo_Hexotic.png b/resources/mesh_tree_hypo_Hexotic.png new file mode 100644 index 0000000..cd813c8 Binary files /dev/null and b/resources/mesh_tree_hypo_Hexotic.png differ diff --git a/src/GUI/HexoticPLUGIN_images.po b/src/GUI/HexoticPLUGIN_images.po new file mode 100644 index 0000000..12d5d24 --- /dev/null +++ b/src/GUI/HexoticPLUGIN_images.po @@ -0,0 +1,59 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS, L3S, LJLL, MENSI +# +# 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/ +# +# This is a Qt message file in .po format. Each msgid starts with +# a scope. This scope should *NOT* be translated - eg. "Foo::Bar" +# would be translated to "Pub", not "Foo::Pub". +msgid "" +msgstr "" +"Project-Id-Version: PROJECT VERSION\n" +"POT-Creation-Date: 2002-05-28 10:57:43 AM CEST\n" +"PO-Revision-Date: YYYY-MM-DD\n" +"Last-Translator: FULLNAME \n" +"Content-Type: text/plain; charset=iso-8859-1\n" + + +#----------------------------------------------------------- +# Hypothesis +#----------------------------------------------------------- + +msgid "ICON_DLG_Hexotic_PARAMETERS" +msgstr "mesh_hypo_Hexotic.png" + +msgid "ICON_DLG_Hexotic_PARAMETERS_3D" +msgstr "mesh_hypo_Hexotic.png" + +#----------------------------------------------------------- +# ObjectBrowser +#----------------------------------------------------------- + +msgid "ICON_SMESH_TREE_ALGO_Hexotic_3D" +msgstr "mesh_tree_algo_tetra.png" + +msgid "ICON_SMESH_TREE_ALGO_Hexotic_3D" +msgstr "mesh_tree_algo_Hexotic.png" + +msgid "ICON_SMESH_TREE_ALGO_Hexotic_2D3D" +msgstr "mesh_tree_algo_Hexotic.png" + +msgid "ICON_SMESH_TREE_HYPO_Hexotic_Parameters" +msgstr "mesh_tree_hypo_Hexotic.png" + +msgid "ICON_SMESH_TREE_HYPO_Hexotic_Parameters_3D" +msgstr "mesh_tree_hypo_Hexotic.png" diff --git a/src/GUI/HexoticPLUGIN_msg_en.po b/src/GUI/HexoticPLUGIN_msg_en.po new file mode 100644 index 0000000..0e10204 --- /dev/null +++ b/src/GUI/HexoticPLUGIN_msg_en.po @@ -0,0 +1,44 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS, L3S, LJLL, MENSI +# +# 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/ +# +# This is a Qt message file in .po format. Each msgid starts with +# a scope. This scope should *NOT* be translated - eg. "Foo::Bar" +# would be translated to "Pub", not "Foo::Pub". +msgid "" +msgstr "" +"Project-Id-Version: PROJECT VERSION\n" +"POT-Creation-Date: 2002-05-28 10:46:48 AM CEST\n" +"PO-Revision-Date: YYYY-MM-DD\n" +"Last-Translator: FULLNAME \n" +"Content-Type: text/plain; charset=iso-8859-1\n" + +msgid "Hexotic_3D_TITLE" +msgstr "Hypothesis Construction" + +msgid "Hexotic_3D_HYPOTHESIS" +msgstr "Hexotic 3D" + +msgid "Hexotic_HEXES_MIN_LEVEL" +msgstr "Nb. Hexes Min Level" + +msgid "Hexotic_HEXES_MAX_LEVEL" +msgstr "Nb. Hexes Max Level" + +msgid "Hexotic_QUADRANGLES" +msgstr "Salome Quadrangles" diff --git a/src/GUI/HexoticPluginGUI.cxx b/src/GUI/HexoticPluginGUI.cxx new file mode 100755 index 0000000..b173d25 --- /dev/null +++ b/src/GUI/HexoticPluginGUI.cxx @@ -0,0 +1,43 @@ +// HexoticPlugin GUI: GUI for plugged-in mesher HexoticPlugin +// +// Copyright (C) 2003 CEA +// +// 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.org +// +// +// +// File : HexoticPluginGUI.cxx +// Author : Lioka RAZAFINDRAZAKA (CEA) +// Module : HexoticPlugin + +#include "HexoticPluginGUI_HypothesisCreator.h" + +//============================================================================= +/*! GetHypothesisCreator + * + */ +//============================================================================= +extern "C" +{ + SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator( const QString& aHypType ) + { + SMESHGUI_GenericHypothesisCreator* aCreator = NULL; + if( aHypType=="Hexotic_Parameters" ) + aCreator = new HexoticPluginGUI_HypothesisCreator( aHypType ); + return aCreator; + } +} diff --git a/src/GUI/HexoticPluginGUI_HypothesisCreator.cxx b/src/GUI/HexoticPluginGUI_HypothesisCreator.cxx new file mode 100644 index 0000000..8b20591 --- /dev/null +++ b/src/GUI/HexoticPluginGUI_HypothesisCreator.cxx @@ -0,0 +1,210 @@ +// HexoticPlugin GUI: GUI for plugged-in mesher HexoticPlugin +// +// Copyright (C) 2003 CEA +// +// 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.org +// +// +// +// File : HexoticPluginGUI_HypothesisCreator.cxx +// Author : Lioka RAZAFINDRAZAKA (CEA) +// Module : HexoticPlugin +// $Header: + +#include "HexoticPluginGUI_HypothesisCreator.h" + +#include +#include + +#include CORBA_SERVER_HEADER(HexoticPlugin_Algorithm) + +#include + +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + + enum Fineness + { + VeryCoarse, + Coarse, + Moderate, + Fine, + VeryFine, + UserDefined + }; + +HexoticPluginGUI_HypothesisCreator::HexoticPluginGUI_HypothesisCreator( const QString& theHypType ) +: SMESHGUI_GenericHypothesisCreator( theHypType ), + myIs3D(true) +{ +} + +HexoticPluginGUI_HypothesisCreator::~HexoticPluginGUI_HypothesisCreator() +{ +} + +bool HexoticPluginGUI_HypothesisCreator::checkParams() const +{ + HexoticHypothesisData data_old, data_new; + readParamsFromHypo( data_old ); + readParamsFromWidgets( data_new ); + bool res = storeParamsToHypo( data_new ); + return res; +} + +QFrame* HexoticPluginGUI_HypothesisCreator::buildFrame() +{ + QFrame* fr = new QFrame( 0, "myframe" ); + QVBoxLayout* lay = new QVBoxLayout( fr, 5, 0 ); + + QGroupBox* GroupC1 = new QGroupBox( 2, Qt::Horizontal, fr, "GroupC1" ); + lay->addWidget( GroupC1 ); + + GroupC1->setTitle( tr( "SMESH_ARGUMENTS" ) ); + GroupC1->layout()->setSpacing( 6 ); + GroupC1->layout()->setMargin( 11 ); + + myName = 0; + if( isCreation() ) { + new QLabel( tr( "SMESH_NAME" ), GroupC1 ); + myName = new QLineEdit( GroupC1 ); + } + + HexoticPlugin::HexoticPlugin_Hypothesis_var h = + HexoticPlugin::HexoticPlugin_Hypothesis::_narrow( initParamsHypothesis() ); + + new QLabel( tr( "Hexotic_HEXES_MIN_LEVEL" ), GroupC1 ); + myHexesMinLevel = new QtxIntSpinBox( GroupC1 ); + // myHexesMinLevel->setMinValue( 3 ); + myHexesMinLevel->setMinValue( h->GetHexesMinLevel() ); + myHexesMinLevel->setMaxValue( 8 ); + myHexesMinLevel->setLineStep( 1 ); + + new QLabel( tr( "Hexotic_HEXES_MAX_LEVEL" ), GroupC1 ); + myHexesMaxLevel = new QtxIntSpinBox( GroupC1 ); + myHexesMaxLevel->setMinValue( 3 ); + myHexesMaxLevel->setMaxValue( 8 ); + myHexesMaxLevel->setLineStep( 1 ); + + myHexoticQuadrangles = new QCheckBox( tr( "Hexotic_QUADRANGLES" ), GroupC1 ); + GroupC1->addSpace(0); + myIs3D = true; + + return fr; +} + +void HexoticPluginGUI_HypothesisCreator::retrieveParams() const +{ + HexoticHypothesisData data; + readParamsFromHypo( data ); + + if( myName ) + myName->setText( data.myName ); + myHexesMinLevel->setValue( data.myHexesMinLevel ); + myHexesMaxLevel->setValue( data.myHexesMaxLevel ); + myHexoticQuadrangles->setChecked( data.myHexoticQuadrangles ); + + myHexesMinLevel->setEnabled(true); + myHexesMaxLevel->setEnabled(true); +} + +QString HexoticPluginGUI_HypothesisCreator::storeParams() const +{ + HexoticHypothesisData data; + readParamsFromWidgets( data ); + storeParamsToHypo( data ); + + QString valStr; + valStr += tr("Hexotic_SEG_MIN_SIZE") + " = " + QString::number( data.myHexesMinLevel ) + "; "; + valStr += tr("Hexotic_SEG_MAX_SIZE") + " = " + QString::number( data.myHexesMaxLevel ) + "; "; + valStr += tr("Hexotic_QUADRANGLES") + " = " + QString::number( data.myHexoticQuadrangles ) + "; "; + + return valStr; +} + +bool HexoticPluginGUI_HypothesisCreator::readParamsFromHypo( HexoticHypothesisData& h_data ) const +{ + HexoticPlugin::HexoticPlugin_Hypothesis_var h = + HexoticPlugin::HexoticPlugin_Hypothesis::_narrow( initParamsHypothesis() ); + + HypothesisData* data = SMESH::GetHypothesisData( hypType() ); + h_data.myName = isCreation() && data ? data->Label : ""; + h_data.myHexesMinLevel = h->GetHexesMinLevel(); + h_data.myHexesMaxLevel = h->GetHexesMaxLevel(); + h_data.myHexoticQuadrangles = h->GetHexoticQuadrangles(); + + return true; +} + +bool HexoticPluginGUI_HypothesisCreator::storeParamsToHypo( const HexoticHypothesisData& h_data ) const +{ + HexoticPlugin::HexoticPlugin_Hypothesis_var h = + HexoticPlugin::HexoticPlugin_Hypothesis::_narrow( hypothesis() ); + + bool ok = true; + try + { + if( isCreation() ) + SMESH::SetName( SMESH::FindSObject( h ), h_data.myName.latin1() ); + + h->SetHexesMinLevel( h_data.myHexesMinLevel ); + h->SetHexesMaxLevel( h_data.myHexesMaxLevel ); + h->SetHexoticQuadrangles( h_data.myHexoticQuadrangles ); + } + catch(const SALOME::SALOME_Exception& ex) + { + SalomeApp_Tools::QtCatchCorbaException(ex); + ok = false; + } + return ok; +} + +bool HexoticPluginGUI_HypothesisCreator::readParamsFromWidgets( HexoticHypothesisData& h_data ) const +{ + h_data.myName = myName ? myName->text() : ""; + h_data.myHexesMinLevel = myHexesMinLevel->value(); + h_data.myHexesMaxLevel = myHexesMaxLevel->value(); + h_data.myHexoticQuadrangles = myHexoticQuadrangles->isChecked(); + + return true; +} + +QString HexoticPluginGUI_HypothesisCreator::caption() const +{ + return tr( QString( "Hexotic_%1_TITLE" ).arg(myIs3D?QString("3D"):QString("3D")) ); +} + +QPixmap HexoticPluginGUI_HypothesisCreator::icon() const +{ + QString hypIconName = tr( QString("ICON_DLG_Hexotic_PARAMETERS%1").arg(myIs3D?QString(""):QString("")) ); + return SUIT_Session::session()->resourceMgr()->loadPixmap( "HexoticPlugin", hypIconName ); +} + +QString HexoticPluginGUI_HypothesisCreator::type() const +{ + return tr( QString( "Hexotic_%1_HYPOTHESIS" ).arg(myIs3D?QString("3D"):QString("3D")) ); +} diff --git a/src/GUI/HexoticPluginGUI_HypothesisCreator.h b/src/GUI/HexoticPluginGUI_HypothesisCreator.h new file mode 100644 index 0000000..198be62 --- /dev/null +++ b/src/GUI/HexoticPluginGUI_HypothesisCreator.h @@ -0,0 +1,81 @@ +// HexoticPlugin GUI: GUI for plugged-in mesher HexoticPlugin +// +// Copyright (C) 2003 CEA +// +// 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.org +// +// +// +// File : HexoticPluginGUI_HypothesisCreator.h +// Author : Lioka RAZAFINDRAZAKA (CEA) +// Module : HexoticPlugin +// $Header: + +#ifndef HexoticPLUGINGUI_HypothesisCreator_HeaderFile +#define HexoticPLUGINGUI_HypothesisCreator_HeaderFile + +#include + +class QtxIntSpinBox; +class QtxDblSpinBox; +class QCheckBox; +class QLineEdit; + +typedef struct +{ + QString myName; + int myHexesMinLevel, myHexesMaxLevel; + bool myHexoticQuadrangles; +} HexoticHypothesisData; + +/*! + * \brief Class for creation of Hexotic hypotheses +*/ +class HexoticPluginGUI_HypothesisCreator : public SMESHGUI_GenericHypothesisCreator +{ + Q_OBJECT + +public: + HexoticPluginGUI_HypothesisCreator( const QString& ); + virtual ~HexoticPluginGUI_HypothesisCreator(); + + virtual bool checkParams() const; + +protected: + virtual QFrame* buildFrame (); + virtual void retrieveParams() const; + virtual QString storeParams () const; + + virtual QString caption() const; + virtual QPixmap icon() const; + virtual QString type() const; + +private: + bool readParamsFromHypo( HexoticHypothesisData& ) const; + bool readParamsFromWidgets( HexoticHypothesisData& ) const; + bool storeParamsToHypo( const HexoticHypothesisData& ) const; + +private: + QLineEdit* myName; + QtxIntSpinBox* myHexesMinLevel; + QtxIntSpinBox* myHexesMaxLevel; + QCheckBox* myHexoticQuadrangles; + + bool myIs3D; +}; + +#endif diff --git a/src/GUI/HexoticPlugin_images.po b/src/GUI/HexoticPlugin_images.po new file mode 100755 index 0000000..12d5d24 --- /dev/null +++ b/src/GUI/HexoticPlugin_images.po @@ -0,0 +1,59 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS, L3S, LJLL, MENSI +# +# 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/ +# +# This is a Qt message file in .po format. Each msgid starts with +# a scope. This scope should *NOT* be translated - eg. "Foo::Bar" +# would be translated to "Pub", not "Foo::Pub". +msgid "" +msgstr "" +"Project-Id-Version: PROJECT VERSION\n" +"POT-Creation-Date: 2002-05-28 10:57:43 AM CEST\n" +"PO-Revision-Date: YYYY-MM-DD\n" +"Last-Translator: FULLNAME \n" +"Content-Type: text/plain; charset=iso-8859-1\n" + + +#----------------------------------------------------------- +# Hypothesis +#----------------------------------------------------------- + +msgid "ICON_DLG_Hexotic_PARAMETERS" +msgstr "mesh_hypo_Hexotic.png" + +msgid "ICON_DLG_Hexotic_PARAMETERS_3D" +msgstr "mesh_hypo_Hexotic.png" + +#----------------------------------------------------------- +# ObjectBrowser +#----------------------------------------------------------- + +msgid "ICON_SMESH_TREE_ALGO_Hexotic_3D" +msgstr "mesh_tree_algo_tetra.png" + +msgid "ICON_SMESH_TREE_ALGO_Hexotic_3D" +msgstr "mesh_tree_algo_Hexotic.png" + +msgid "ICON_SMESH_TREE_ALGO_Hexotic_2D3D" +msgstr "mesh_tree_algo_Hexotic.png" + +msgid "ICON_SMESH_TREE_HYPO_Hexotic_Parameters" +msgstr "mesh_tree_hypo_Hexotic.png" + +msgid "ICON_SMESH_TREE_HYPO_Hexotic_Parameters_3D" +msgstr "mesh_tree_hypo_Hexotic.png" diff --git a/src/GUI/HexoticPlugin_msg_en.po b/src/GUI/HexoticPlugin_msg_en.po new file mode 100755 index 0000000..d11e8ad --- /dev/null +++ b/src/GUI/HexoticPlugin_msg_en.po @@ -0,0 +1,77 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS, L3S, LJLL, MENSI +# +# 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/ +# +# This is a Qt message file in .po format. Each msgid starts with +# a scope. This scope should *NOT* be translated - eg. "Foo::Bar" +# would be translated to "Pub", not "Foo::Pub". +msgid "" +msgstr "" +"Project-Id-Version: PROJECT VERSION\n" +"POT-Creation-Date: 2002-05-28 10:46:48 AM CEST\n" +"PO-Revision-Date: YYYY-MM-DD\n" +"Last-Translator: FULLNAME \n" +"Content-Type: text/plain; charset=iso-8859-1\n" + +msgid "Hexotic_MAX_SIZE" +msgstr "Max. Size" + +msgid "Hexotic_SECOND_ORDER" +msgstr "Second Order" + +msgid "Hexotic_OPTIMIZE" +msgstr "Optimize" + +msgid "Hexotic_FINENESS" +msgstr "Fineness" + +msgid "Hexotic_VERYCOARSE" +msgstr "Very Coarse" + +msgid "Hexotic_COARSE" +msgstr "Coarse" + +msgid "Hexotic_MODERATE" +msgstr "Moderate" + +msgid "Hexotic_FINE" +msgstr "Fine" + +msgid "Hexotic_VERYFINE" +msgstr "Very Fine" + +msgid "Hexotic_CUSTOM" +msgstr "Custom" + +msgid "Hexotic_GROWTH_RATE" +msgstr "Growth Rate" + +msgid "Hexotic_SEG_PER_EDGE" +msgstr "Nb. Segs per Edge" + +msgid "Hexotic_SEG_PER_RADIUS" +msgstr "Nb. Segs per Radius" + +msgid "Hexotic_ALLOW_QUADRANGLES" +msgstr "Allow Quadrangles" + +msgid "Hexotic_3D_HYPOTHESIS" +msgstr "Hexotic 3D" + +msgid "Hexotic_3D_TITLE" +msgstr "Hypothesis Construction" diff --git a/src/GUI/Makefile.in b/src/GUI/Makefile.in new file mode 100644 index 0000000..db2feae --- /dev/null +++ b/src/GUI/Makefile.in @@ -0,0 +1,73 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS, L3S, LJLL, MENSI +# +# 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/ +# +# File : Makefile.in +// Author : Lioka RAZAFINDRAZAKA (CEA) +# Module : HexoticPLUGIN + +top_srcdir=@top_srcdir@ +top_builddir=../.. +srcdir=@srcdir@ +VPATH=.:@srcdir@:@top_srcdir@/idl:$(top_builddir)/idl:${KERNEL_ROOT_DIR}/idl/salome:${GUI_ROOT_DIR}/idl/salome:${GEOM_ROOT_DIR}/idl/salome:${SMESH_ROOT_DIR}/idl/salome:${MED_ROOT_DIR}/idl/salome + +@COMMENCE@ + +# .po files to transform in .qm +PO_FILES = \ + HexoticPLUGIN_images.po \ + HexoticPLUGIN_msg_en.po + +# Libraries targets +LIB = libHexoticPluginGUI.la + +LIB_SRC = \ + HexoticPluginGUI.cxx \ + HexoticPluginGUI_HypothesisCreator.cxx + +LIB_MOC = \ + HexoticPluginGUI_HypothesisCreator.h + +LIB_CLIENT_IDL = \ + SALOME_Exception.idl \ + SALOME_GenericObj.idl \ + SALOME_Component.idl \ + SALOME_Comm.idl \ + GEOM_Gen.idl \ + MED.idl \ + SMESH_Gen.idl \ + SMESH_Mesh.idl \ + SMESH_Group.idl \ + HexoticPlugin_Algorithm.idl + +LIB_SERVER_IDL = + +# additionnal information to compil and link file + +CPPFLAGS += $(QT_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) \ + -I${KERNEL_ROOT_DIR}/include/salome -I${GUI_ROOT_DIR}/include/salome \ + -I${GEOM_ROOT_DIR}/include/salome -I${SMESH_ROOT_DIR}/include/salome \ + $(BOOST_CPPFLAGS) +CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome -I${GUI_ROOT_DIR}/include/salome \ + -I${GEOM_ROOT_DIR}/include/salome -I${SMESH_ROOT_DIR}/include/salome + +LDFLAGS += -lSMESH $(OCC_KERNEL_LIBS) -L${KERNEL_ROOT_DIR}/lib/salome \ + -L${GUI_ROOT_DIR}/lib/salome -L${GEOM_ROOT_DIR}/lib/salome \ + -L${SMESH_ROOT_DIR}/lib/salome + +@CONCLUDE@ diff --git a/src/HexoticPlugin/HexoticPlugin_Hexotic.cxx b/src/HexoticPlugin/HexoticPlugin_Hexotic.cxx new file mode 100644 index 0000000..4aaa430 --- /dev/null +++ b/src/HexoticPlugin/HexoticPlugin_Hexotic.cxx @@ -0,0 +1,599 @@ +// HexoticPlugin : C++ implementation +// +// Copyright (C) 2006 OPEN CASCADE, CEA/DEN, EDF R&D +// +// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// File : HexoticPlugin_Hexotic.cxx +// Author : Lioka RAZAFINDRAZAKA (CEA) +// Date : 2006/06/30 +// Project : SALOME +//============================================================================= +using namespace std; + +#include "HexoticPlugin_Hexotic.hxx" +#include "HexoticPlugin_Hypothesis.hxx" +// #include "HexoticPlugin_Mesher.hxx" + +#include "SMDS_MeshElement.hxx" +#include "SMDS_MeshNode.hxx" + +#include +#include + +#include "utilities.h" + +#ifndef WIN32 +#include +#endif + +#ifdef _DEBUG_ +#define DUMP(txt) \ +// cout << txt +#else +#define DUMP(txt) +#endif + +#include +#include +#include + +#include + +//============================================================================= +/*! + * + */ +//============================================================================= + +HexoticPlugin_Hexotic::HexoticPlugin_Hexotic(int hypId, int studyId, SMESH_Gen* gen) + : SMESH_3D_Algo(hypId, studyId, gen) +{ + MESSAGE("HexoticPlugin_Hexotic::HexoticPlugin_Hexotic"); + _name = "Hexotic_3D"; + _shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID);// 1 bit /shape type + _iShape=0; + _nbShape=0; + _nodeRefNumber=0; + _compatibleHypothesis.push_back("Hexotic_Parameters"); +} + +//============================================================================= +/*! + * + */ +//============================================================================= + +HexoticPlugin_Hexotic::~HexoticPlugin_Hexotic() +{ + MESSAGE("HexoticPlugin_Hexotic::~HexoticPlugin_Hexotic"); +} + +//============================================================================= +/*! + * + */ +//============================================================================= + +bool HexoticPlugin_Hexotic::CheckHypothesis( SMESH_Mesh& aMesh, + const TopoDS_Shape& aShape, + SMESH_Hypothesis::Hypothesis_Status& aStatus ) +{ + // MESSAGE("HexoticPlugin_Hexotic::CheckHypothesis"); + + _hypothesis = NULL; + + list::const_iterator itl; + const SMESHDS_Hypothesis* theHyp; + + const list& hyps = GetUsedHypothesis(aMesh, aShape); + int nbHyp = hyps.size(); + if (!nbHyp) + { + aStatus = SMESH_Hypothesis::HYP_OK; + return true; // can work with no hypothesis + } + + itl = hyps.begin(); + theHyp = (*itl); // use only the first hypothesis + + string hypName = theHyp->GetName(); + if (hypName == "Hexotic_Parameters") + { + _hypothesis = static_cast (theHyp); + ASSERT(_hypothesis); + aStatus = SMESH_Hypothesis::HYP_OK; + } + else + aStatus = SMESH_Hypothesis::HYP_INCOMPATIBLE; + + return aStatus == SMESH_Hypothesis::HYP_OK; +} + +//======================================================================= +//function : countFaces +//purpose : +//======================================================================= + +static int countFaces( SMESHDS_Mesh* the2DMesh, + list< const SMDS_MeshElement* >& theListOfFaces, + bool externalFaces ) +{ + int nbFaces = 0; + TopExp_Explorer fExp( (the2DMesh->ShapeToMesh()), TopAbs_FACE ); + SMESHDS_SubMesh* the2DSubMesh; + SMDS_ElemIteratorPtr itOnSmdsElement; + + if ( externalFaces ) + nbFaces = the2DMesh->NbFaces(); + else { + for ( ; fExp.More(); fExp.Next() ) { + the2DSubMesh = the2DMesh->MeshElements( fExp.Current() ); + if ( the2DSubMesh ) { + itOnSmdsElement = the2DSubMesh->GetElements(); + while ( itOnSmdsElement->more() ) { + theListOfFaces.push_back( itOnSmdsElement->next() ); + nbFaces++; + } + } + } + } + return nbFaces; +} + +//======================================================================= +//function : writeHexoticFile +//purpose : +//======================================================================= + +static bool writeHexoticFile (ofstream & theFile, + SMESHDS_Mesh * theMesh, + map & theSmdsToHexoticIdMap, + map & theHexoticIdToNodeMap, + const TCollection_AsciiString & Hexotic_In) { + cout << endl; + cout << "Creating Hexotic processed mesh file : " << Hexotic_In << endl; + + bool onlyExternalFaces = true; + int nbVertices = 0; + int nbTriangles = 0; + const char* space = " "; + const int dummyint = 0; + + int aSmdsNodeID = 1; + const SMDS_MeshNode* aNode; + SMDS_NodeIteratorPtr itOnNode; + + list< const SMDS_MeshElement* > faces; + list< const SMDS_MeshElement* >::iterator itListFace; + const SMDS_MeshElement* aFace; + map::const_iterator itOnSmdsNode; + SMDS_ElemIteratorPtr itOnSmdsElement; + SMDS_ElemIteratorPtr itOnFaceNode; + SMDS_FaceIteratorPtr itOnSmdsFace; + +// Writing SMESH points into Hexotic File + + nbVertices = theMesh->NbNodes(); + + theFile << "MeshVersionFormatted 1" << endl; + theFile << endl; + theFile << "Dimension" << endl; + theFile << 3 << endl; + theFile << "# Set of mesh vertices" << endl; + theFile << "Vertices" << endl; + theFile << nbVertices << endl; + + itOnNode = theMesh->nodesIterator(); + while ( itOnNode->more() ) { + aNode = itOnNode->next(); + theSmdsToHexoticIdMap.insert( map ::value_type( aNode->GetID(), aSmdsNodeID )); + theHexoticIdToNodeMap.insert (map ::value_type( aSmdsNodeID, aNode )); + aSmdsNodeID++; + theFile << aNode->X() << space << aNode->Y() << space << aNode->Z() << space << dummyint << endl; + } + +// Writing SMESH faces into Hexotic File + + nbTriangles = countFaces(theMesh, faces, onlyExternalFaces); + + theFile << endl; + theFile << "# Set of mesh triangles (v1,v2,v3,tag)" << endl; + theFile << "Triangles" << endl; + theFile << nbTriangles << endl; + + if ( onlyExternalFaces ) { + itOnSmdsFace = theMesh->facesIterator(); + while ( itOnSmdsFace->more() ) { + aFace = itOnSmdsFace->next(); + itOnFaceNode = aFace->nodesIterator(); + while ( itOnFaceNode->more() ) { + aSmdsNodeID = itOnFaceNode->next()->GetID(); + itOnSmdsNode = theSmdsToHexoticIdMap.find( aSmdsNodeID ); + ASSERT( itOnSmdsNode != theSmdsToHexoticIdMap.end() ); + theFile << (*itOnSmdsNode).second << space; + } + theFile << dummyint << endl; + } + } + else { + itListFace = faces.begin(); + for ( ; itListFace != faces.end(); ++itListFace ) { + aFace = *itListFace; + itOnFaceNode = aFace->nodesIterator(); + while ( itOnFaceNode->more() ) { + aSmdsNodeID = itOnFaceNode->next()->GetID(); + itOnSmdsNode = theSmdsToHexoticIdMap.find( aSmdsNodeID ); + ASSERT( itOnSmdsNode != theSmdsToHexoticIdMap.end() ); + theFile << (*itOnSmdsNode).second << space; + } + theFile << dummyint << endl; + } + } + + theFile << endl; + theFile << "End" << endl; + + cout << "Processed mesh file created, it contains :" << endl; + cout << " " << nbVertices << " vertices" << endl; + cout << " " << nbTriangles << " triangles" << endl; + cout << endl; + + return true; +} + +//======================================================================= +//function : getInt +//purpose : +//======================================================================= + +static bool getInt( int & theValue, char * & theLine ) +{ + char *ptr; + theValue = strtol( theLine, &ptr, 10 ); + if ( ptr == theLine || + // there must not be neither '.' nor ',' nor 'E' ... + (*ptr != ' ' && *ptr != '\n' && *ptr != '\0')) + return false; + + DUMP( " " << theValue ); + theLine = ptr; + return true; +} + +//======================================================================= +//function : getDouble +//purpose : +//======================================================================= + +static bool getDouble( double & theValue, char * & theLine ) +{ + char *ptr; + theValue = strtod( theLine, &ptr ); + if ( ptr == theLine ) + return false; + + DUMP( " " << theValue ); + theLine = ptr; + return true; +} + +//======================================================================= +//function : readLine +//purpose : +//======================================================================= + +#define HexoticPlugin_BUFLENGTH 256 +#define HexoticPlugin_ReadLine(aPtr,aBuf,aFile,aLineNb) \ +{ aPtr = fgets( aBuf, HexoticPlugin_BUFLENGTH - 2, aFile ); aLineNb++; DUMP(endl); } + +//======================================================================= +//function : readResult +//purpose : +//======================================================================= + +static bool readResult(FILE * theFile, + SMESHDS_Mesh * theMesh, + const TopoDS_Shape & theShape, + map & theHexoticIdToNodeMap, + const TCollection_AsciiString & Hexotic_Out, + int & nodeRefNumber) +{ + // --------------------------------- + // Read generated elements and nodes + // --------------------------------- + + cout << "Reading Hexotic output file : " << Hexotic_Out << endl; + cout << endl; + + char aBuffer[ HexoticPlugin_BUFLENGTH ]; + char * aPtr; + int aLineNb = 0; + int shapeID = theMesh->ShapeToIndex( theShape ); + + int line = 1, EndOfFile = 0, nbElem = 0, nField = 10, nbRef = 0, aHexoticNodeID = 0; + char * theField; + + char * tabField [nField]; + int tabRef [nField]; + + tabField[0] = "MeshVersionFormatted"; tabRef[0] = 0; + tabField[1] = "Dimension"; tabRef[1] = 0; + tabField[2] = "Vertices"; tabRef[2] = 3; + tabField[3] = "Edges"; tabRef[3] = 2; + tabField[4] = "Triangles"; tabRef[4] = 3; + tabField[5] = "Quadrilaterals"; tabRef[5] = 4; + tabField[6] = "Hexahedra"; tabRef[6] = 8; + tabField[7] = "Corners"; tabRef[7] = 1; + tabField[8] = "Ridges"; tabRef[0] = 1; + tabField[9] = "End"; tabRef[0] = 0; + + nodeRefNumber += theMesh->NbNodes(); + + SMDS_NodeIteratorPtr itOnHexoticInputNode = theMesh->nodesIterator(); + while ( itOnHexoticInputNode->more() ) + theMesh->RemoveNode( itOnHexoticInputNode->next() ); + + while ( EndOfFile == 0 ) { + HexoticPlugin_ReadLine( aPtr, aBuffer, theFile, aLineNb ); + for ( int iField = 0; iField < nField; iField++ ) { + stringstream theMessage; + theField = tabField[iField]; + if ( strncmp(aPtr, theField, strlen(theField)) == 0 ) { + if ( strcmp(theField, "End") == 0 ) { + EndOfFile = 1; + theMessage << "End of Hexotic output file has been reached"; + } + else { + HexoticPlugin_ReadLine( aPtr, aBuffer, theFile, aLineNb ); + line++; + getInt( nbElem, aPtr ); + + if ( strcmp(theField, "MeshVersionFormatted") == 0 ) + theMessage << "Hexotic mesh descriptor : " << theField << " " << nbElem; + else if ( strcmp(theField, "Dimension") == 0 ) + theMessage << "Hexotic mesh of " << nbElem << "D dimension"; + else if ( strcmp(theField, "Vertices") == 0 || + strcmp(theField, "Edges") == 0 || + strcmp(theField, "Quadrilaterals") == 0 || + strcmp(theField, "Hexahedra") == 0 ) { + nbRef = tabRef[iField]; + HexoticPlugin_ReadLine( aPtr, aBuffer, theFile, aLineNb ); // read blank line + + if ( strcmp(theField, "Vertices") == 0 ) { + int aHexoticID; + double coord[nbRef]; + SMDS_MeshNode * aHexoticNode; + + for ( int iElem = 0; iElem < nbElem; iElem++ ) { + aHexoticID = iElem + 1 + nodeRefNumber; + HexoticPlugin_ReadLine( aPtr, aBuffer, theFile, aLineNb ); // read file lines + for ( int iCoord = 0; iCoord < 3; iCoord++ ) + getDouble ( coord[ iCoord ], aPtr ); + aHexoticNode = theMesh->AddNode(coord[0], coord[1], coord[2]); + theMesh->SetNodeInVolume( aHexoticNode, shapeID ); + theHexoticIdToNodeMap[ aHexoticID ] = aHexoticNode; + } + } + else { + const SMDS_MeshNode * node[nbRef]; + SMDS_MeshElement* aHexoticElement; + map ::iterator itOnHexoticNode; + + for ( int iElem = 0; iElem < nbElem; iElem++ ) { + HexoticPlugin_ReadLine( aPtr, aBuffer, theFile, aLineNb ); // read file lines + for ( int iRef = 0; iRef < nbRef; iRef++ ) { + getInt ( aHexoticNodeID, aPtr ); // read nbRef aHexoticNodeID + aHexoticNodeID += nodeRefNumber; + itOnHexoticNode = theHexoticIdToNodeMap.find( aHexoticNodeID ); + node[ iRef ] = itOnHexoticNode->second; + } + + if ( strcmp(theField, "Edges") == 0 ) // create an element + aHexoticElement = theMesh->AddEdge( node[0], node[1] ); + else if ( strcmp(theField, "Quadrilaterals") == 0 ) + aHexoticElement = theMesh->AddFace( node[0], node[1], node[2], node[3] ); + else if ( strcmp(theField, "Hexahedra") == 0 ) + aHexoticElement = theMesh->AddVolume( node[0], node[1], node[2], node[3], node[4], node[5], node[6], node[7] ); + + theMesh->SetMeshElementOnShape( aHexoticElement, shapeID ); + } + } + theMessage << nbElem << " " << theField << " created"; + } + } + if ( theMessage.str().size() != 0 ) { + cout << theMessage.str() << endl; + break; + } + } + } + } + cout << endl; + return true; +} + +//============================================================================= +/*! + * Pass parameters to Hexotic + */ +//============================================================================= + +void HexoticPlugin_Hexotic::SetParameters(const HexoticPlugin_Hypothesis* hyp) { + if (hyp) { + MESSAGE("HexoticPlugin_Hexotic::SetParameters"); + _hexesMinLevel = hyp->GetHexesMinLevel(); + _hexesMaxLevel = hyp->GetHexesMaxLevel(); + _hexoticQuadrangles = hyp->GetHexoticQuadrangles(); + } +} + +//======================================================================= +//function : getTmpDir +//purpose : +//======================================================================= + +static TCollection_AsciiString getTmpDir() +{ + TCollection_AsciiString aTmpDir; + + char *Tmp_dir = getenv("SALOME_TMP_DIR"); + if(Tmp_dir != NULL) { + aTmpDir = Tmp_dir; + #ifdef WIN32 + if(aTmpDir.Value(aTmpDir.Length()) != '\\') aTmpDir+='\\'; + #else + if(aTmpDir.Value(aTmpDir.Length()) != '/') aTmpDir+='/'; + #endif + } + else { + #ifdef WIN32 + aTmpDir = TCollection_AsciiString("C:\\"); + #else + aTmpDir = TCollection_AsciiString("/tmp/"); + #endif + } + return aTmpDir; +} + +//============================================================================= +/*! + * Here we are going to use the Hexotic mesher + */ +//============================================================================= + +bool HexoticPlugin_Hexotic::Compute(SMESH_Mesh& theMesh, + const TopoDS_Shape& theShape) +{ + bool Ok; + SMESHDS_Mesh* meshDS = theMesh.GetMeshDS(); + + if (_iShape == 0 && _nbShape == 0) { + cout << endl; + cout << "Hexotic execution..." << endl; + cout << endl; + + TopExp_Explorer expf(meshDS->ShapeToMesh(), TopAbs_SOLID); + for ( ; expf.More(); expf.Next() ) + _nbShape++; + } + + _iShape++; + + if (_iShape == _nbShape ) { + SetParameters(_hypothesis); + + cout << endl; + cout << _name << " parameters :" << endl; + cout << " " << _name << " Segments Min Level = " << _hexesMinLevel << endl; + cout << " " << _name << " Segments Max Level = " << _hexesMaxLevel << endl; + cout << " " << "Salome Quadrangles : " << (_hexoticQuadrangles ? "yes":"no") << endl; + + TCollection_AsciiString aTmpDir = getTmpDir(); + TCollection_AsciiString Hexotic_In, Hexotic_Out; + TCollection_AsciiString run_Hexotic( "hexotic" ); + + TCollection_AsciiString minl = " -minl ", maxl = " -maxl "; + TCollection_AsciiString in = " -in ", out = " -out "; + + TCollection_AsciiString minLevel, maxLevel; + minLevel = _hexesMinLevel; + maxLevel = _hexesMaxLevel; + + map aSmdsToHexoticIdMap; + map aHexoticIdToNodeMap; + + Hexotic_In = aTmpDir + "Hexotic_In.mesh"; + Hexotic_Out = aTmpDir + "Hexotic_Out.mesh"; + run_Hexotic += minl + minLevel + maxl + maxLevel + in + Hexotic_In + out + Hexotic_Out; + + // cout << "Hexotic command : " << run_Hexotic << endl; + + OSD_File( Hexotic_In ).Remove(); + OSD_File( Hexotic_Out ).Remove(); + + ofstream HexoticFile (Hexotic_In.ToCString() , ios::out); + + Ok = ( writeHexoticFile(HexoticFile, meshDS, aSmdsToHexoticIdMap, aHexoticIdToNodeMap, Hexotic_In) ); + HexoticFile.close(); + + MESSAGE("HexoticPlugin_Hexotic::Compute"); + + system( run_Hexotic.ToCString() ); + + // -------------- + // read a result + // -------------- + + FILE * aResultFile = fopen( Hexotic_Out.ToCString(), "r" ); + if (aResultFile) { + Ok = readResult( aResultFile, meshDS, theShape, aHexoticIdToNodeMap, Hexotic_Out, _nodeRefNumber ); + fclose(aResultFile); + cout << "Hexotic output file read !" << endl; + cout << endl; + } + else + Ok = false; + _iShape=0; + } + return Ok; +} + +//============================================================================= +/*! + * + */ +//============================================================================= + +ostream & HexoticPlugin_Hexotic::SaveTo(ostream & save) +{ + return save; +} + +//============================================================================= +/*! + * + */ +//============================================================================= + +istream & HexoticPlugin_Hexotic::LoadFrom(istream & load) +{ + return load; +} + +//============================================================================= +/*! + * + */ +//============================================================================= + +ostream & operator << (ostream & save, HexoticPlugin_Hexotic & hyp) +{ + return hyp.SaveTo( save ); +} + +//============================================================================= +/*! + * + */ +//============================================================================= + +istream & operator >> (istream & load, HexoticPlugin_Hexotic & hyp) +{ + return hyp.LoadFrom( load ); +} diff --git a/src/HexoticPlugin/HexoticPlugin_Hexotic.hxx b/src/HexoticPlugin/HexoticPlugin_Hexotic.hxx new file mode 100644 index 0000000..9673dd0 --- /dev/null +++ b/src/HexoticPlugin/HexoticPlugin_Hexotic.hxx @@ -0,0 +1,69 @@ +// HexoticPlugin : C++ implementation +// +// Copyright (C) 2006 OPEN CASCADE, CEA/DEN, EDF R&D +// +// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// File : HexoticPlugin_Hexotic.hxx +// Author : Lioka RAZAFINDRAZAKA (CEA) +// Date : 2006/06/30 +// Project : SALOME +//============================================================================= + +#ifndef _HexoticPlugin_Hexotic_HXX_ +#define _HexoticPlugin_Hexotic_HXX_ + +#include "SMESH_3D_Algo.hxx" +#include "SMESH_Mesh.hxx" +#include "Utils_SALOME_Exception.hxx" + +class SMESH_Mesh; +class HexoticPlugin_Hypothesis; + +class HexoticPlugin_Hexotic: public SMESH_3D_Algo +{ +public: + HexoticPlugin_Hexotic(int hypId, int studyId, SMESH_Gen* gen); + virtual ~HexoticPlugin_Hexotic(); + + virtual bool CheckHypothesis(SMESH_Mesh& aMesh, + const TopoDS_Shape& aShape, + SMESH_Hypothesis::Hypothesis_Status& aStatus); + + void SetParameters(const HexoticPlugin_Hypothesis* hyp); + + virtual bool Compute(SMESH_Mesh& aMesh, + const TopoDS_Shape& aShape); + + ostream & SaveTo(ostream & save); + istream & LoadFrom(istream & load); + friend ostream & operator << (ostream & save, HexoticPlugin_Hexotic & hyp); + friend istream & operator >> (istream & load, HexoticPlugin_Hexotic & hyp); + +protected: + const HexoticPlugin_Hypothesis* _hypothesis; +private: + int _iShape; + int _nbShape; + int _nodeRefNumber; + int _hexesMinLevel; + int _hexesMaxLevel; + bool _hexoticQuadrangles; +}; + +#endif diff --git a/src/HexoticPlugin/HexoticPlugin_Hexotic_i.cxx b/src/HexoticPlugin/HexoticPlugin_Hexotic_i.cxx new file mode 100644 index 0000000..42c487f --- /dev/null +++ b/src/HexoticPlugin/HexoticPlugin_Hexotic_i.cxx @@ -0,0 +1,82 @@ +// HexoticPlugin : idl implementation +// +// Copyright (C) 2006 OPEN CASCADE, CEA/DEN, EDF R&D +// +// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// File : HexoticPlugin_Hexotic_i.cxx +// Author : Lioka RAZAFINDRAZAKA (CEA) +// Module : HexoticPlugin +// $Header : /home/server/cvs-PAL/HexoticPLUGIN/HexoticPLUGIN_SRC/src/HexoticPlugin_Hexotic_i.cxx,v 1.2 2006/06/01 11:43:58 jfa Exp $ + +using namespace std; +#include "HexoticPlugin_Hexotic_i.hxx" +#include "SMESH_Gen.hxx" +#include "HexoticPlugin_Hexotic.hxx" + +#include "Utils_CorbaException.hxx" +#include "utilities.h" + +//============================================================================= +/*! + * HexoticPlugin_Hexotic_i::HexoticPlugin_Hexotic_i + * + * Constructor + */ +//============================================================================= + +HexoticPlugin_Hexotic_i::HexoticPlugin_Hexotic_i( PortableServer::POA_ptr thePOA, + int theStudyId, + ::SMESH_Gen* theGenImpl ) + : SALOME::GenericObj_i( thePOA ), + SMESH_Hypothesis_i( thePOA ), + SMESH_Algo_i( thePOA ), + SMESH_3D_Algo_i( thePOA ) +{ + MESSAGE( "HexoticPlugin_Hexotic_i::HexoticPlugin_Hexotic_i" ); + myBaseImpl = new ::HexoticPlugin_Hexotic( theGenImpl->GetANewId(), + theStudyId, + theGenImpl ); +} + +//============================================================================= +/*! + * HexoticPlugin_Hexotic_i::~HexoticPlugin_Hexotic_i + * + * Destructor + */ +//============================================================================= + +HexoticPlugin_Hexotic_i::~HexoticPlugin_Hexotic_i() +{ + MESSAGE( "HexoticPlugin_Hexotic_i::~HexoticPlugin_Hexotic_i" ); +} + +//============================================================================= +/*! + * HexoticPlugin_Hexotic_i::GetImpl + * + * Get implementation + */ +//============================================================================= + +::HexoticPlugin_Hexotic* HexoticPlugin_Hexotic_i::GetImpl() +{ + MESSAGE( "HexoticPlugin_Hexotic_i::GetImpl" ); + return ( ::HexoticPlugin_Hexotic* )myBaseImpl; +} diff --git a/src/HexoticPlugin/HexoticPlugin_Hexotic_i.hxx b/src/HexoticPlugin/HexoticPlugin_Hexotic_i.hxx new file mode 100644 index 0000000..69b9793 --- /dev/null +++ b/src/HexoticPlugin/HexoticPlugin_Hexotic_i.hxx @@ -0,0 +1,56 @@ +// HexoticPlugin : idl implementation +// +// Copyright (C) 2006 OPEN CASCADE, CEA/DEN, EDF R&D +// +// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// File : HexoticPlugin_Hexotic_i.hxx +// Author : Lioka RAZAFINDRAZAKA (CEA) +// Module : HexoticPlugin +// $Header: /home/server/cvs-PAL/HexoticPLUGIN/HexoticPLUGIN_SRC/src/HexoticPlugin_Hexotic_i.hxx,v 1.3 2006/06/01 11:43:58 jfa Exp $ + +#ifndef _HexoticPlugin_Hexotic_I_HXX_ +#define _HexoticPlugin_Hexotic_I_HXX_ + +#include +#include CORBA_SERVER_HEADER(HexoticPlugin_Algorithm) +#include CORBA_SERVER_HEADER(SALOME_Exception) + +#include "SMESH_3D_Algo_i.hxx" +#include "HexoticPlugin_Hexotic.hxx" + +// ====================================================== +// Hexotic 3d algorithm +// ====================================================== +class HexoticPlugin_Hexotic_i: + public virtual POA_HexoticPlugin::HexoticPlugin_Hexotic, + public virtual SMESH_3D_Algo_i +{ +public: + // Constructor + HexoticPlugin_Hexotic_i (PortableServer::POA_ptr thePOA, + int theStudyId, + ::SMESH_Gen* theGenImpl ); + // Destructor + virtual ~HexoticPlugin_Hexotic_i(); + + // Get implementation + ::HexoticPlugin_Hexotic* GetImpl(); +}; + +#endif diff --git a/src/HexoticPlugin/HexoticPlugin_Hypothesis.cxx b/src/HexoticPlugin/HexoticPlugin_Hypothesis.cxx new file mode 100644 index 0000000..08401d3 --- /dev/null +++ b/src/HexoticPlugin/HexoticPlugin_Hypothesis.cxx @@ -0,0 +1,199 @@ +// HexoticPlugin : C++ implementation +// +// Copyright (C) 2006 OPEN CASCADE, CEA/DEN, EDF R&D +// +// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// File : HexoticPlugin_Hypothesis.cxx +// Author : Lioka RAZAFINDRAZAKA (CEA) +// Date : 2006/06/30 +// Project : SALOME +//============================================================================= + +using namespace std; +#include +#include + +//============================================================================= +/*! + * + */ +//============================================================================= +HexoticPlugin_Hypothesis::HexoticPlugin_Hypothesis (int hypId, int studyId, + SMESH_Gen * gen) + : SMESH_Hypothesis(hypId, studyId, gen), + _hexesMinLevel( GetDefaultHexesMinLevel() ), + _hexesMaxLevel( GetDefaultHexesMaxLevel() ), + _hexoticQuadrangles( GetDefaultHexoticQuadrangles() ) +{ + MESSAGE("HexoticPlugin_Hypothesis::HexoticPlugin_Hypothesis"); + _name = "Hexotic_Parameters"; + _param_algo_dim = 3; +} + +//============================================================================= +/*! + * + */ +//============================================================================= + +void HexoticPlugin_Hypothesis::SetHexesMinLevel(int theVal) { + if (theVal != _hexesMinLevel) { + _hexesMinLevel = theVal; + NotifySubMeshesHypothesisModification(); + } +} + +void HexoticPlugin_Hypothesis::SetHexesMaxLevel(int theVal) { + if (theVal != _hexesMaxLevel) { + _hexesMaxLevel = theVal; + NotifySubMeshesHypothesisModification(); + } +} + +void HexoticPlugin_Hypothesis::SetHexoticQuadrangles(bool theVal) { + if (theVal != _hexoticQuadrangles) { + _hexoticQuadrangles = theVal; + NotifySubMeshesHypothesisModification(); + } +} + +//============================================================================= +/*! + * + */ +//============================================================================= +ostream & HexoticPlugin_Hypothesis::SaveTo(ostream & save) +{ + save << _hexesMinLevel << " " << _hexesMaxLevel; + save << " " << (int)_hexoticQuadrangles; + cout <> val); +// if (isOK) +// _maxSize = val; +// else +// load.clear(ios::badbit | load.rdstate()); + +// isOK = (load >> is); +// if (isOK) +// SetFineness((Fineness) is); +// else +// load.clear(ios::badbit | load.rdstate()); + +// if (_fineness == UserDefined) +// { +// isOK = (load >> val); +// if (isOK) +// _growthRate = val; +// else +// load.clear(ios::badbit | load.rdstate()); + +// isOK = (load >> val); +// if (isOK) +// _nbSegPerEdge = val; +// else +// load.clear(ios::badbit | load.rdstate()); + +// isOK = (load >> val); +// if (isOK) +// _nbSegPerRadius = val; +// else +// load.clear(ios::badbit | load.rdstate()); +// } + +// isOK = (load >> is); +// if (isOK) +// _secondOrder = (bool) is; +// else +// load.clear(ios::badbit | load.rdstate()); + +// isOK = (load >> is); +// if (isOK) +// _optimize = (bool) is; +// else +// load.clear(ios::badbit | load.rdstate()); + return load; +} + +//============================================================================= +/*! + * + */ +//============================================================================= +ostream & operator <<(ostream & save, HexoticPlugin_Hypothesis & hyp) +{ + return hyp.SaveTo( save ); +} + +//============================================================================= +/*! + * + */ +//============================================================================= +istream & operator >>(istream & load, HexoticPlugin_Hypothesis & hyp) +{ + return hyp.LoadFrom( load ); +} + + +//================================================================================ +/*! + * \brief Does nothing + * \param theMesh - the built mesh + * \param theShape - the geometry of interest + * \retval bool - always false + */ +//================================================================================ +bool HexoticPlugin_Hypothesis::SetParametersByMesh(const SMESH_Mesh* theMesh, + const TopoDS_Shape& theShape) +{ + return false; +} + +//============================================================================= +int HexoticPlugin_Hypothesis::GetDefaultHexesMinLevel() +{ + return 3; +} + +int HexoticPlugin_Hypothesis::GetDefaultHexesMaxLevel() +{ + return 8; +} + +bool HexoticPlugin_Hypothesis::GetDefaultHexoticQuadrangles() +{ + return true; +} diff --git a/src/HexoticPlugin/HexoticPlugin_Hypothesis.hxx b/src/HexoticPlugin/HexoticPlugin_Hypothesis.hxx new file mode 100644 index 0000000..33eff43 --- /dev/null +++ b/src/HexoticPlugin/HexoticPlugin_Hypothesis.hxx @@ -0,0 +1,79 @@ +// HexoticPlugin : C++ implementation +// +// Copyright (C) 2006 OPEN CASCADE, CEA/DEN, EDF R&D +// +// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// File : HexoticPlugin_Hypothesis.hxx +// Author : Lioka RAZAFINDRAZAKA (CEA) +// Date : 2006/06/30 +// Project : SALOME +// $Header: /home/server/cvs/HexoticPLUGIN/HexoticPLUGIN_SRC/src/HexoticPlugin/HexoticPlugin_Hypothesis.hxx,v 1.2 2006/05/06 08:54:13 jfa Exp $ +//============================================================================= + +#ifndef _HexoticPlugin_Hypothesis_HXX_ +#define _HexoticPlugin_Hypothesis_HXX_ + +#include "SMESH_Hypothesis.hxx" +#include "Utils_SALOME_Exception.hxx" + +// Parameters for work of Hexotic +// + +class HexoticPlugin_Hypothesis: public SMESH_Hypothesis +{ +public: + + HexoticPlugin_Hypothesis(int hypId, int studyId, SMESH_Gen * gen); + + void SetHexesMinLevel(int theVal); + int GetHexesMinLevel() const { return _hexesMinLevel; } + + void SetHexesMaxLevel(int theVal); + int GetHexesMaxLevel() const { return _hexesMaxLevel; } + + void SetHexoticQuadrangles(bool theVal); + bool GetHexoticQuadrangles() const { return _hexoticQuadrangles; } + + // the parameters default values + + static int GetDefaultHexesMinLevel(); + static int GetDefaultHexesMaxLevel(); + static bool GetDefaultHexoticQuadrangles(); + + // Persistence + virtual ostream & SaveTo(ostream & save); + virtual istream & LoadFrom(istream & load); + friend ostream & operator <<(ostream & save, HexoticPlugin_Hypothesis & hyp); + friend istream & operator >>(istream & load, HexoticPlugin_Hypothesis & hyp); + + /*! + * \brief Does nothing + * \param theMesh - the built mesh + * \param theShape - the geometry of interest + * \retval bool - always false + */ + virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape); + +private: + int _hexesMinLevel; + int _hexesMaxLevel; + bool _hexoticQuadrangles; +}; + +#endif diff --git a/src/HexoticPlugin/HexoticPlugin_Hypothesis_i.cxx b/src/HexoticPlugin/HexoticPlugin_Hypothesis_i.cxx new file mode 100644 index 0000000..9dfdf04 --- /dev/null +++ b/src/HexoticPlugin/HexoticPlugin_Hypothesis_i.cxx @@ -0,0 +1,154 @@ +// HexoticPlugin : C++ implementation +// +// Copyright (C) 2006 OPEN CASCADE, CEA/DEN, EDF R&D +// +// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// File : HexoticPlugin_Hypothesis_i.cxx +// Author : Lioka RAZAFINDRAZAKA (CEA) +// Date : 2006/06/30 +// Project : SALOME +//============================================================================= +using namespace std; + +#include "HexoticPlugin_Hypothesis_i.hxx" +#include "SMESH_Gen.hxx" +#include "SMESH_PythonDump.hxx" + +#include "Utils_CorbaException.hxx" +#include "utilities.h" + +//============================================================================= +/*! + * HexoticPlugin_Hypothesis_i::HexoticPlugin_Hypothesis_i + * + * Constructor + */ +//============================================================================= +HexoticPlugin_Hypothesis_i:: +HexoticPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA, + int theStudyId, + ::SMESH_Gen* theGenImpl) + : SALOME::GenericObj_i( thePOA ), + SMESH_Hypothesis_i( thePOA ) +{ + MESSAGE( "HexoticPlugin_Hypothesis_i::HexoticPlugin_Hypothesis_i" ); + myBaseImpl = new ::HexoticPlugin_Hypothesis (theGenImpl->GetANewId(), + theStudyId, + theGenImpl); +} + +//============================================================================= +/*! + * HexoticPlugin_Hypothesis_i::~HexoticPlugin_Hypothesis_i + * + * Destructor + */ +//============================================================================= +HexoticPlugin_Hypothesis_i::~HexoticPlugin_Hypothesis_i() +{ + MESSAGE( "HexoticPlugin_Hypothesis_i::~HexoticPlugin_Hypothesis_i" ); +} + +//============================================================================= +/*! + * HexoticPlugin_Hypothesis_i::SetHexesMinLevel + * HexoticPlugin_Hypothesis_i::SetHexesMaxLevel + * HexoticPlugin_Hypothesis_i::SetHexoticQuadrangles + */ +//============================================================================= + +void HexoticPlugin_Hypothesis_i::SetHexesMinLevel (CORBA::Long theValue) +{ + // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexesMinLevel"); + ASSERT(myBaseImpl); + this->GetImpl()->SetHexesMinLevel(theValue); + SMESH::TPythonDump() << _this() << ".SetHexesMinLevel( " << theValue << " )"; +} + +void HexoticPlugin_Hypothesis_i::SetHexesMaxLevel (CORBA::Long theValue) +{ + // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexesMaxLevel"); + ASSERT(myBaseImpl); + this->GetImpl()->SetHexesMaxLevel(theValue); + SMESH::TPythonDump() << _this() << ".SetHexesMaxLevel( " << theValue << " )"; +} + +void HexoticPlugin_Hypothesis_i::SetHexoticQuadrangles (CORBA::Boolean theValue) +{ + // MESSAGE("HexoticPlugin_Hypothesis_i::SetHexoticQuadrangles"); + ASSERT(myBaseImpl); + this->GetImpl()->SetHexoticQuadrangles(theValue); + SMESH::TPythonDump() << _this() << ".SetHexoticQuadrangles( " << theValue << " )"; +} + +//============================================================================= +/*! + * HexoticPlugin_Hypothesis_i::GetHexesMinLevel + * HexoticPlugin_Hypothesis_i::GetHexesMaxLevel + * HexoticPlugin_Hypothesis_i::GetHexoticQuadrangles + */ +//============================================================================= + +CORBA::Long HexoticPlugin_Hypothesis_i::GetHexesMinLevel() +{ + // MESSAGE("HexoticPlugin_Hypothesis_i::GetHexesMinLevel"); + ASSERT(myBaseImpl); + return this->GetImpl()->GetHexesMinLevel(); +} + +CORBA::Long HexoticPlugin_Hypothesis_i::GetHexesMaxLevel() +{ + // MESSAGE("HexoticPlugin_Hypothesis_i::GetHexesMaxLevel"); + ASSERT(myBaseImpl); + return this->GetImpl()->GetHexesMaxLevel(); +} + +CORBA::Boolean HexoticPlugin_Hypothesis_i::GetHexoticQuadrangles() +{ + // MESSAGE("HexoticPlugin_Hypothesis_i::GetHexoticQuadrangles"); + ASSERT(myBaseImpl); + return this->GetImpl()->GetHexoticQuadrangles(); +} + +//============================================================================= +/*! + * HexoticPlugin_Hypothesis_i::GetImpl + * + * Get implementation + */ +//============================================================================= +::HexoticPlugin_Hypothesis* HexoticPlugin_Hypothesis_i::GetImpl() +{ + // MESSAGE("HexoticPlugin_Hypothesis_i::GetImpl"); + return (::HexoticPlugin_Hypothesis*)myBaseImpl; +} + +//================================================================================ +/*! + * \brief Verify whether hypothesis supports given entity type + * \param type - dimension (see SMESH::Dimension enumeration) + * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise + * + * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration) + */ +//================================================================================ +CORBA::Boolean HexoticPlugin_Hypothesis_i::IsDimSupported( SMESH::Dimension type ) +{ + return type == SMESH::DIM_3D; +} diff --git a/src/HexoticPlugin/HexoticPlugin_Hypothesis_i.hxx b/src/HexoticPlugin/HexoticPlugin_Hypothesis_i.hxx new file mode 100644 index 0000000..be0b732 --- /dev/null +++ b/src/HexoticPlugin/HexoticPlugin_Hypothesis_i.hxx @@ -0,0 +1,70 @@ +// HexoticPlugin : C++ implementation +// +// Copyright (C) 2006 OPEN CASCADE, CEA/DEN, EDF R&D +// +// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// File : HexoticPlugin_Hypothesis_i.hxx +// Author : Lioka RAZAFINDRAZAKA (CEA) +// Date : 2006/06/30 +// Project : SALOME +//============================================================================= + +#ifndef _HexoticPlugin_Hypothesis_i_HXX_ +#define _HexoticPlugin_Hypothesis_i_HXX_ + +#include +#include CORBA_SERVER_HEADER(HexoticPlugin_Algorithm) + +#include "SMESH_Hypothesis_i.hxx" +#include "HexoticPlugin_Hypothesis.hxx" + +class SMESH_Gen; + +// HexoticPlugin parameters hypothesis + +class HexoticPlugin_Hypothesis_i: + public virtual POA_HexoticPlugin::HexoticPlugin_Hypothesis, + public virtual SMESH_Hypothesis_i +{ + public: + // Constructor + HexoticPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA, + int theStudyId, + ::SMESH_Gen* theGenImpl); + // Destructor + virtual ~HexoticPlugin_Hypothesis_i(); + + // Methods for setting and getting parameters values + void SetHexesMinLevel(CORBA::Long theVal); + CORBA::Long GetHexesMinLevel(); + + void SetHexesMaxLevel(CORBA::Long theVal); + CORBA::Long GetHexesMaxLevel(); + + void SetHexoticQuadrangles(CORBA::Boolean theVal); + CORBA::Boolean GetHexoticQuadrangles(); + + // Get implementation + ::HexoticPlugin_Hypothesis* GetImpl(); + + // Verify whether hypothesis supports given entity type + CORBA::Boolean IsDimSupported( SMESH::Dimension type ); +}; + +#endif diff --git a/src/HexoticPlugin/HexoticPlugin_i.cxx b/src/HexoticPlugin/HexoticPlugin_i.cxx new file mode 100644 index 0000000..96a1e89 --- /dev/null +++ b/src/HexoticPlugin/HexoticPlugin_i.cxx @@ -0,0 +1,67 @@ +// SMESH HexoticPlugin : implementaion of SMESH idl descriptions +// +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : HexoticPlugin_i.cxx +// Author : Lioka RAZAFINDRAZAKA (CEA) +// Module : SMESH +// $Header: /home/server/cvs-PAL/HexoticPLUGIN/HexoticPLUGIN_SRC/src/HexoticPlugin_i.cxx,v 1.3 2006/06/01 11:43:58 jfa Exp $ + +using namespace std; +#include "SMESH_Hypothesis_i.hxx" + +#include "utilities.h" + +#include "HexoticPlugin_Hexotic_i.hxx" +#include "HexoticPlugin_Hypothesis_i.hxx" + +template class HexoticPlugin_Creator_i:public HypothesisCreator_i +{ + // as we have 'module HexoticPlugin' in HexoticPlugin_Algorithm.idl + virtual std::string GetModuleName() { return "HexoticPlugin"; } +}; + +//============================================================================= +/*! + * + */ +//============================================================================= + +extern "C" +{ + GenericHypothesisCreator_i* GetHypothesisCreator (const char* aHypName) + { + MESSAGE("GetHypothesisCreator " << aHypName); + + GenericHypothesisCreator_i* aCreator = 0; + + // Algorithms + if (strcmp(aHypName, "Hexotic_3D") == 0) + aCreator = new HexoticPlugin_Creator_i; + // Hypotheses + else if (strcmp(aHypName, "Hexotic_Parameters") == 0) + aCreator = new HexoticPlugin_Creator_i; + else ; + + return aCreator; + } +} diff --git a/src/HexoticPlugin/Makefile.in b/src/HexoticPlugin/Makefile.in new file mode 100644 index 0000000..8a3fac3 --- /dev/null +++ b/src/HexoticPlugin/Makefile.in @@ -0,0 +1,54 @@ +# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS, L3S, LJLL, MENSI +# +# 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/ +# +# -* Makefile *- +# +# Author : Lioka RAZAFINDRAZAKA (CEA) +# Module : HexoticPLUGIN +# Date : 2006/06/30 +# +# + +# source path +top_srcdir=@top_srcdir@ +top_builddir=../.. +srcdir=@srcdir@ +VPATH=.:@srcdir@:@top_srcdir@/idl:$(top_builddir)/idl:${KERNEL_ROOT_DIR}/idl/salome:${GUI_ROOT_DIR}/idl/salome:${GEOM_ROOT_DIR}/idl/salome:${SMESH_ROOT_DIR}/idl/salome:${MED_ROOT_DIR}/idl/salome + +@COMMENCE@ + +LIB_SRC = \ + HexoticPlugin_Hexotic.cxx \ + HexoticPlugin_Hexotic_i.cxx \ + HexoticPlugin_Hypothesis.cxx \ + HexoticPlugin_Hypothesis_i.cxx \ + HexoticPlugin_i.cxx + +LIB_SERVER_IDL = HexoticPlugin_Algorithm.idl + +LIB_CLIENT_IDL = \ + SALOME_Component.idl \ + SALOME_Comm.idl \ + GEOM_Gen.idl \ + MED.idl + +# Libraries targets +LIB = libHexoticEngine.la + +@CONCLUDE@ diff --git a/src/Makefile.in b/src/Makefile.in new file mode 100644 index 0000000..8514b42 --- /dev/null +++ b/src/Makefile.in @@ -0,0 +1,35 @@ +# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# +# +# +# File : Makefile.in +# Author : Lioka RAZAFINDRAZAKA (CEA) +# Module : SMESH + +top_srcdir=@top_srcdir@ +top_builddir=.. +srcdir=@srcdir@ +VPATH=.:@srcdir@ + +@COMMENCE@ + +SUBDIRS = HexoticPlugin GUI + +@MODULE@