DCQ : Merge with Ecole_Ete_a6.

This commit is contained in:
yfr 2004-06-18 08:34:31 +00:00
parent fe9985e3cf
commit c3bf92bd87
300 changed files with 50735 additions and 16131 deletions

View File

@ -1,43 +1,9 @@
###############################################################################
#This is the SMESH change log. Do not modify because it is automatically
#created with :
#cvs2cl.pl --accum -l "-b" -U users.cvs2cl --header header.cvs2cl -T -b --utc
#cvs2cl.pl -l "-b" -U users.cvs2cl --header header.cvs2cl -T -b --utc
###############################################################################
2004-03-23 13:25 tag V1_5_0
2004-03-23 13:20 Jerome Robert <jerome.robert@eads.net>
* INSTALL, bin/VERSION: Version 1.5.0.
2004-03-23 09:53 Jerome Robert <jerome.robert@eads.net>
* src/SMESHGUI/SMESHGUI.cxx: Add a MEDFILE attribut for selection
in Efficas. Patch submited by P. Rascle on 2004-03-22.
* src/SMDS/SMDS_Position.cxx: Fix bug SMESH5512 (Crash on DEBIAN
woody, V1_4_0b).
2004-03-16 12:51 Jerome Robert <jerome.robert@eads.net>
* src/SMESHGUI/SMESHGUI_Swig.cxx: Fix bug SMESH5451: SMESH_mechanic
script aborts.
* doc/html/SMESHTutorial_1/: ControlFeature.png, ImportResult.png,
MeshInit.png, MeshResult.png, MeshResult2.png, SMESHOverview.png,
SMESHTutorial_1.html, SelectAlgorithms.png, SetColor.png,
SubMeshContruction.png, SubShapesSelection.png: Add a small
tutorial.
2004-03-15 18:42 Jerome Robert <jerome.robert@eads.net>
* Merge br_enable_import_mesh. Enable import mesh and save/load SMESH study.
2004-02-02 16:43 Jerome Robert <jerome.robert@eads.net>
* src/SMDS/SMDS_Mesh.cxx: Fix a bug (crash when adding an
hexahedron from ids).
2004-01-30 15:42 tag V1_4_0b
2004-01-30 13:18 Nicolas Rejneri <nicolas.rejneri@opencascade.com>
* doc/html/INPUT/: doxyfile, sources/static/tree.js: NRI : 1.4.0

View File

@ -1,6 +1,6 @@
This is SMESH V1_5_0
This is SMESH V2.0.0
Compatible with :
GEOM V1_4_0
KERNEL V1_4_0
MED V1_4_0
GEOM V2_0_0
KERNEL V2_0_0
MED V2_0_0

View File

@ -14,7 +14,7 @@ VPATH=.:@srcdir@:@top_srcdir@/bin:@top_srcdir@/resources:./bin:@top_srcdir@/idl
@COMMENCE@
SUBDIRS = idl src
SUBDIRS = idl src doc
RESOURCES_FILES = \
delete.png \
@ -40,6 +40,8 @@ mesh_hypo_volume.png \
mesh_info.png \
mesh_init.png \
mesh_length.png \
mesh_free_edges.png \
mesh_multi_edges.png \
mesh_line_n.png \
mesh_line.png \
mesh_move_node.png \
@ -71,6 +73,7 @@ mesh_tree_hypo.png \
mesh_tree_hypo_segment.png \
mesh_tree_hypo_volume.png \
mesh_tree_mesh.png \
mesh_tree_importedmesh.png \
mesh_tree_mesh_warn.png \
mesh_triangle_n.png \
mesh_triangle.png \
@ -78,10 +81,16 @@ mesh_update.png \
mesh_vertex_n.png \
mesh_vertex.png \
mesh_wireframe.png \
mesh_points.png \
mesh_wrap.png \
mesh_tree_group.png \
mesh_edit_group.png \
mesh_make_group.png \
ModuleMesh.png \
select1.png \
SMESH_en.xml \
SMESH.config \
StdMeshers.xml \
SMESHCatalog.xml \
flight_solid.brep
@ -104,10 +113,10 @@ include/salome/SALOMEconfig.h: salome_adm/unix/SALOMEconfig.ref
# test if SALOMEconfig.h has changed (contents)
salome_adm/unix/SALOMEconfig.ref: salome_adm/unix/SALOMEconfig.h
@if ! [ -a $@ ]; then \
cp -p $< $@; \
cp -p -f $< $@; \
fi; \
if ! cmp $< $@; then \
cp -p $< $@; \
cp -p -f $< $@; \
fi; \
include/salome/sstream: salome_adm/unix/sstream
@ -131,7 +140,7 @@ install-include: $(include_list)
$(INSTALL) -d $(includedir)
@for f in X $(include_list); do \
if test $$f != X; then \
($(INSTALL_DATA) $$f $(includedir)/. || exit 1); \
($(INSTALL_DATA) -p $$f $(includedir)/. || exit 1); \
fi; \
done

View File

@ -47,7 +47,7 @@ if test -f ${GEOM_DIR}/bin/salome/libGEOM_Swig.py ; then
else
AC_MSG_WARN("Cannot find compiled Geom module distribution")
fi
AC_MSG_RESULT(for Geom: $Geom_ok)
])dnl

View File

@ -45,7 +45,7 @@ if test -f ${MED_DIR}/bin/salome/libMEDMEM_Swig.py ; then
AC_SUBST(MED_ROOT_DIR)
else
AC_MSG_WARN("Cannot find compiled Med module distribution")
AC_MSG_WARN("Cannot find Med module sources")
fi
AC_MSG_RESULT(for Med: $Med_ok)

View File

@ -34,6 +34,10 @@ CXX = @CXX@
CXXFLAGS = @CXXFLAGS@
CXX_DEPEND_FLAG = @CXX_DEPEND_FLAG@
# BOOST Library
BOOST_CPPFLAGS = @BOOST_CPPFLAGS@
# JAVA
JAVA_INCLUDES = @JAVA_INCLUDES@
@ -127,7 +131,8 @@ OMNIORB_CXXFLAGS = @OMNIORB_CXXFLAGS@
OMNIORB_IDL = @OMNIORB_IDL@
OMNIORB_IDLCXXFLAGS = @OMNIORB_IDLCXXFLAGS@
OMNIORB_IDLPYFLAGS = @OMNIORB_IDLPYFLAGS@ -I$(top_srcdir)/idl -I$(top_builddir)/idl -I$(KERNEL_ROOT_DIR)/idl/salome -I$(GEOM_ROOT_DIR)/idl/salome -I$(MED_ROOT_DIR)/idl/salome
OMNIORB_IDLPYFLAGS = @OMNIORB_IDLPYFLAGS@ -I$(top_srcdir)/idl -I$(top_builddir)/idl/salome \
-I$(KERNEL_ROOT_DIR)/idl/salome -I$(GEOM_ROOT_DIR)/idl/salome -I$(MED_ROOT_DIR)/idl/salome
OMNIORB_IDL_CLN_H = @OMNIORB_IDL_CLN_H@
OMNIORB_IDL_CLN_CXX = @OMNIORB_IDL_CLN_CXX@
@ -144,7 +149,8 @@ CORBA_INCLUDES = @CORBA_INCLUDES@
CORBA_LIBS = @CORBA_LIBS@
CORBA_CXXFLAGS = @CORBA_CXXFLAGS@
IDLCXXFLAGS = -bcxx @IDLCXXFLAGS@ -I$(top_srcdir)/idl -I$(top_builddir)/idl -I$(KERNEL_ROOT_DIR)/idl/salome -I$(GEOM_ROOT_DIR)/idl/salome -I$(MED_ROOT_DIR)/idl/salome
IDLCXXFLAGS = -bcxx @IDLCXXFLAGS@ -I$(top_srcdir)/idl -I$(top_builddir)/idl/salome \
-I$(KERNEL_ROOT_DIR)/idl/salome -I$(GEOM_ROOT_DIR)/idl/salome -I$(MED_ROOT_DIR)/idl/salome
IDLPYFLAGS = @IDLPYFLAGS@
IDL = @IDL@
@ -195,13 +201,13 @@ datadir=@datadir@/salome
idldir=$(prefix)/idl/salome
sharedpydir=@libdir@/python$(PYTHON_VERSION)/site-packages/salome/shared_modules
docdir=$(datadir)/doc
docdir=${prefix}/doc/salome
#
# begin of package rules
#
.PHONY: all lib bin inc resources tests install uninstall dep depend depend_idl cleandep mostlyclean clean distclean
.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
@ -243,11 +249,7 @@ ac_cxx_namespaces.m4 check_omniorb.m4 pyembed.m4 \
ac_cxx_partial_specialization.m4 check_opengl.m4 python.m4 \
ac_cxx_typename.m4 check_pthreads.m4 check_cas.m4 \
ac_cc_warnings.m4 check_qt.m4 check_med2.m4 \
check_swig.m4
#ifeq (@WITHNETGEN@,yes)
# ACLOCAL_SRC += check_Netgen.m4
#endif
check_swig.m4 check_boost.m4
$(top_srcdir)/aclocal.m4: $(ACLOCAL_SRC:%=@KERNEL_ROOT_DIR@/salome_adm/unix/config_files/%)
cd $(top_srcdir) ; aclocal --acdir=adm_local/unix/config_files -I @KERNEL_ROOT_DIR@/salome_adm/unix/config_files

View File

@ -1,2 +1,2 @@
THIS IS SALOME - SMESH VERSION: 1.5.0
THIS IS SALOME - SMESH VERSION: 2.0.0

View File

@ -113,6 +113,14 @@ dnl
AC_CXX_HAVE_SSTREAM
echo
echo ---------------------------------------------
echo BOOST Library
echo ---------------------------------------------
echo
CHECK_BOOST
dnl
dnl ---------------------------------------------
dnl testing MPICH
@ -273,14 +281,6 @@ echo
CHECK_MED
echo
echo ---------------------------------------------
echo Testing Netgen
echo ---------------------------------------------
echo
CHECK_NETGEN
echo
echo ---------------------------------------------
echo Summary
@ -288,7 +288,7 @@ echo ---------------------------------------------
echo
echo Configure
variables="cc_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok med2_ok omniORB_ok occ_ok doxygen_ok graphviz_ok Kernel_ok Geom_ok Med_ok Netgen_ok"
variables="cc_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok med2_ok omniORB_ok occ_ok doxygen_ok graphviz_ok Kernel_ok Geom_ok Med_ok"
for var in $variables
do
@ -318,7 +318,7 @@ else
fi
# make other build directories
for rep in salome_adm adm_local doc bin/salome include/salome lib/salome share/salome/resources share/salome/doc idl
for rep in salome_adm adm_local doc bin/salome include/salome lib/salome share/salome/resources idl
do
# if test ! -d $rep ; then
# eval mkdir $rep
@ -351,14 +351,15 @@ dnl copy shells and utilities contained in the bin directory
dnl excluding .in files (treated in AC-OUTPUT below) and CVS
dnl directory
cd bin
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) ;;
*) ln -fs $i; echo $local_bin ;;
./bin/CVS | ./bin/salome) ;;
*) /usr/bin/install -C $i .; echo $local_bin ;;
esac
done
cd $ROOT_BUILDDIR

View File

@ -33,21 +33,3 @@ V1_3_1: 2004-01-05 14:28
merge_1_2_d: 2003-01-20 11:25
Branch to merge Release 1.2d of Salome Pro.
V1_4_0b: 2004-01-30 15:42
Pre-release of 1.4.0. Include the merge of the branch merge_1_2_d.
V1_4_0_branch: 2004-01-30 15:42
Maintenance branch for 1.4.0. This tag is equal to V1_4_0b.
br_enable_import_mesh: 2004-02-16 10:00
Branch on head after V1_4_0b. Development branch enable import mesh and save/load SMESH study. Initiated by Jerome Robert.
br_geomclient_colocal: 2004-02-23 10:00
Branch on br_enable_import_mesh. Development branch for colocalization. Initiated by Francis KLOSS.
V1_4_0: 2004-03-23 11:40
Release 1.4.0. Tag on V1_4_0_branch branch.
V1_5_0: 2004-03-23 13:25
Release 1.5.0. Tag on head. Include mesh import/export, save/load study, tutorial, bug corrected in V1_4_0.

View File

@ -11,9 +11,11 @@ top_builddir=..
srcdir=@srcdir@
VPATH=.:@srcdir@
SUBDIRS=html
SUBDIRS= salome
doc:
@COMMENCE@
docs:
@@SETX@; for d in $(SUBDIRS); do \
(cd $$d && $(MAKE) $@) || exit 1; \
done
@ -31,3 +33,8 @@ install:
@@SETX@; for d in $(SUBDIRS); do \
(cd $$d && $(MAKE) $@) || exit 1; \
done
uninstall:
@@SETX@; for d in $(SUBDIRS); do \
(cd $$d && $(MAKE) $@) || exit 1; \
done

View File

@ -3,7 +3,7 @@
#---------------------------------------------------------------------------
# General configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = "SALOME - SMESH - v.1.4.0"
PROJECT_NAME = "SALOME - SMESH - v.1.3.0"
PROJECT_NUMBER = id#1.1
OUTPUT_DIRECTORY = ../
OUTPUT_LANGUAGE = English

View File

@ -1,4 +1,4 @@
foldersTree = gFld("<b>SALOME v.1.4.0 </b>", "", "")
foldersTree = gFld("<b>SALOME v.1.3.0 </b>", "", "")
insDoc(foldersTree, gLnk("Main Page", "", "main.html"))
aux1 = insFld(foldersTree, gFld("TUI Reference Guide", ""))

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

44
doc/salome/Makefile.in Normal file
View File

@ -0,0 +1,44 @@
# -* Makefile *-
#
# Author : Patrick GOLDBRONN (CEA)
# Date : 30/11/2001
# $Header$
#
# source path
top_srcdir=@top_srcdir@
top_builddir=../..
srcdir=@srcdir@
VPATH=.:@srcdir@
SUBDIRS= tui gui
@COMMENCE@
docs:
@@SETX@; for d in $(SUBDIRS); do \
(cd $$d && $(MAKE) $@) || exit 1; \
done; \
cp -f $(srcdir)/SMESH_index.html SMESH_index.html
clean:
@@SETX@; for d in $(SUBDIRS); do \
(cd $$d && $(MAKE) $@) || exit 1; \
done
distclean: clean
@@SETX@; for d in $(SUBDIRS); do \
(cd $$d && $(MAKE) $@) || exit 1; \
done
install:
$(MAKE) docs
(cd tui && $(MAKE) install);
(cd gui && $(MAKE) install);
cp -f SMESH_index.html $(docdir)
uninstall:
@@SETX@; for d in $(SUBDIRS); do \
(cd $$d && $(MAKE) $@) || exit 1; \
done; \
rm -fr $(docdir)/SMESH_index.html

View File

@ -0,0 +1,188 @@
#######################################################################################
# File : PluginMeshers.txt
# Author : Julia DOROVSKIKH
# Module : SMESH
# $Header$
#######################################################################################
#
# How to add your own mesher (as a set of hypotheses and algorithms) to the application
#
#######################################################################################
1. Create mesher plugin package, e.g. MyMesher.
2. Create XML file to describe all algorithms and hypotheses, provided by plugin package
(see SMESH_SRC/resources/SMESH_Meshers.xml for example).
<meshers-group name="MyName"
resources="MyResourceKey"
server-lib="libMyServerLib.so"
gui-lib="libMyClientLib.so">
<hypotheses>
<hypothesis type="MyHypType1"
label-id="My beautiful hypothesis name"
icon-id="my_hypo_1_icon.png"/>
</hypotheses>
<algorithms>
<algorithm type="MyAlgType1"
label-id="My beautiful algorithm name"
icon-id="my_algo_1_icon.png"/>
</algorithms>
</meshers-group>
Attributes of <meshers-group> tag:
- value of <name> attribute is used to collect hypotheses/algoritms in groups;
you can also use this attribute for short description of your mesher plugin
- value of <resources> attribute (MyResourceKey) is used to access resources
(messages and icons) from GUI (see paragraphs 4.2 and 5);
currently it should coincide with the name of plugin package; this limitation
will be eliminated in the further development.
- value of <server-lib> attribute describes the name of your mesher's
server plugin library (See paragraph 3)
- value of <gui-lib> attribute describes the name of your mesher's
client plugin library (See paragraph 4)
Attributes of <hypothesis/algorithm> tag:
- value of <type> attribute is an unique name of the hypothesis/algorithm
* It is a value of _name field of your hypothesis class
(see paragraph 3, implementation of constructor of
StdMeshers_LocalLength class: _name = "LocalLength")
* It is a key to each certain hypothesis class
(see paragraph 3, implementation of "GetHypothesisCreator()" method in StdMeshers_i.cxx)
* It is a key to each certain hypothesis GUI
(see paragraph 4, implementation of "StdMeshersGUI_HypothesisCreator::CreateHypothesis()"
and "StdMeshersGUI_HypothesisCreator::EditHypothesis()" methods in StdMeshersGUI.cxx)
* It is a key to each certain hypothesis icon in Object Browser
(see paragraph 4.2.1)
- value of <label-id> attribute is displayed in the GUI in the list
of available hypotheses/algorithms ("Create Hypothesis/Algorithm" dialog)
- value of <icon-id> attribute is a name of icon file, which is displayed in GUI
in the list of available hypotheses/algorithms ("Create Hypothesis/Algorithm" dialog)
Note: All attributes values are accessible in your GUI via HypothesisData class
(see paragraph 4.1)
Note: The environment variable SMESH_MeshersList contains the list of plugins names,
separated by colon (":") symbol, e.g.:
setenv SMESH_MeshersList StdMeshers:NETGENPlugin
Please, pay attention that StdMeshers should also be included into this environment variable,
if you want to use standard hypotheses/algorithms, provided with SMESH module.
The SALOME automatically locates XML files, searching them in the following directories:
${<PLUGINNAME>_ROOT_DIR}/share/salome/resources
${SALOME_<PluginName>Resources}
${HOME}/.salome/resources
${KERNEL_ROOT_DIR}/share/salome/resources
where <PluginName> is a name of each mesher plugin package
3. Build server plugin library <libMyServerLib.so>.
3.1. Define interface to your hypotheses and algorithms.
Example: SMESH_SRC/idl/SMESH_BasicHypothesis.idl
NETGENPLUGIN_SRC/src/NETGENPlugin_Algorithm.idl
3.2. Implement functionality of your hypotheses and algorithms.
Inherit corresponding classes from SMESH.
Example: SMESH_SRC/src/StdMeshers/StdMeshers_*
NETGENPLUGIN_SRC/src/NETGENPlugin_NETGEN_3D
3.3. Implement interface to your hypotheses and algorithms.
Inherit corresponding classes from SMESH_I.
Example: SMESH_SRC/src/StdMeshers_I/SMESH_*_i
NETGENPLUGIN_SRC/src/NETGENPlugin_NETGEN_3D_i
3.4. Implement being exported method.
GenericHypothesisCreator_i* GetHypothesisCreator (const char* aHypType)
<aHypType> is a value of <type> attribute in the XML-description file
Example: SMESH_SRC/src/StdMeshers_I/StdMeshers_i.cxx
NETGENPLUGIN_SRC/src/NETGENPlugin_i.cxx
4. Build client (GUI) plugin library <libMyClientLib.so>.
This step is required only if your hypotheses/algorithms need specific GUI for their construction.
4.1. Implement the required GUI (e.g. construction dialog boxes).
Example: SMESH_SRC/src/StdMeshersGUI/StdMeshersGUI_*Dlg
Note: all data from XML-description files is accessible in your GUI via HypothesisData class
(mySMESHGUI->GetHypothesisData (aHypType),
see SMESHGUI_Hypotheses.h for HypothesisData definition)
4.2. Provide icons and messages for your GUI.
4.2.1. Implement resource files
MyResourceKey_icons.po and MyResourceKey_msg_en.po
Example: SMESH_SRC/src/StdMeshersGUI/StdMeshers_*.po
NETGENPLUGIN_SRC/src/NETGENPlugin_icons.po
Note: ICON_SMESH_TREE_HYPO_MyHypType1 is ID of icon for Object Browser
for hypothesis with type="MyHypType1".
ICON_SMESH_TREE_ALGO_MyAlgType1 is ID of icon for Object Browser
for algorithm with type="MyAlgType1".
See paragraph 2 for definition of MyResourceKey, MyHypType1, MyAlgType1.
4.2.2. Define environment variable SALOME_<MyResourceKey>Resources to point to the
directory where resources are situated.
Example: setenv SALOME_StdMeshersResources ${SMESH_ROOT_DIR}/share/salome/resources
4.3. Implement your Hypothesis Creator and being exported method
SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator
(QString aHypType, QString aServerLibName, SMESHGUI* aSMESHGUI)
<aHypType> is to pass a value of <type> attribute in XML-description file;
<aServerLibName> is to pass a value of <server-lib> attribute in XML-description file.
Example: SMESH_SRC/src/StdMeshersGUI/StdMeshersGUI.cxx
5. If your hypotheses/algorithms do not need specific GUI,
but you want to provide icons for object browser, see 4.2 paragrath
6. Setup your SALOME environment.
6.1. Add your plugin to the LD_LIBRARY_PATH, PYTHONPATH (and maybe PATH) environment variables, e.g.:
setenv PATH <path-to-my-plugin>/bin/salome:${PATH}
setenv LD_LIBRARY_PATH <path-to-my-plugin>/lib/salome:${LD_LIBRARY_PATH}
setenv PYTHONPATH <path-to-my-plugin>/lib/python2.2/site-packages/salome:${PYTHONPATH}
6.2. Set mesher plugin resources environment variable (see 4.2.2 paragraph)
Note: If you use runSalome.py script from KERNEL package to launch SALOME, you may not to set
environment variables, because this script sets them itself. All what you should do is
to add <plugin> section to your ${HOME}/.salome/salome.launch file for SMESH module section:
...
<modules-list>
...
<module name="SMESH">
<plugin name="MyMesher"/>
</module>
...
</modules-list>
...

View File

@ -0,0 +1,95 @@
<!DOCTYPE doctype PUBLIC "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<meta name="GENERATOR"
content="Mozilla/4.73 [en] (WinNT; I) [Netscape]">
<title>Mesh Module Documentation</title>
</head>
<body bgcolor="#cccccc" text="#000000" link="#0000ee" alink="#0000ee"
vlink="#551a8b">
<div align="center"> &nbsp;
<center>
<center>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;&nbsp;</center>
<table width="96%" align="center">
<tbody>
<tr>
<td><a href="http://www.opencascade.com"><img
src="tui/SMESH/sources/logocorp.gif" border="0" height="46" width="122">
</a></td>
<td>
<div align="right"><a href="http://www.opencascade.org/SALOME/"><img
src="tui/SMESH/sources/application.gif" border="0" height="46" width="108">
</a></div>
</td>
</tr>
</tbody>
</table>
<div align="center">
<center>
<hr width="100%" size="2">
<h1>Mesh MODULE Documentation</h1>
</center>
</div>
<table width="96%">
<tbody>
</tbody>
</table>
</center>
<div align="center">
<p> <img src="tui/SMESH/sources/Application-About.png"
alt="Application-About.png" width="30%" height="20%">
&nbsp; &nbsp;&nbsp; </p>
</div>
<center>
<table width="96%">
<tbody>
</tbody>
</table>
<br>
<br>
<br>
</center>
<address> </address>
<center><big><a href="gui/SMESH/smesh.html">GUI Documentation</a></big></center>
<address> </address>
<center></center>
<center><br>
</center>
<address> </address>
<center><big><a href="tui/SMESH/index.html">TUI Documentation</a></big></center>
<address> </address>
<center></center>
<center><br>
<br>
</center>
</div>
<br>
<br>
<br>
</body>
</html>

View File

@ -0,0 +1,33 @@
# Copyright (C) 2003 CEA/DEN, EDF R&D
#
#
#
# File : Makefile.in
# Author : Vasily Rusyaev (Open Cascade NN)
# Module : doc
# $Header:
top_srcdir=@top_srcdir@
top_builddir=../../..
srcdir=@srcdir@
VPATH=.:@srcdir@
@COMMENCE@
docs:
cp -fr $(srcdir)/SMESH ./
-find $(PWD) -name CVS -exec rm -rf {} \;
clean:
rm -fr `ls | grep -v "Makefile"`
distclean: clean
rm -fr SMESH
install:
mkdir -p $(docdir)/gui
cp -rf SMESH $(docdir)/gui
-find $(PWD) -name CVS -exec rm -rf {} \;
uninstall:
rm -rf $(docdir)/gui/SMESH

View File

@ -6,7 +6,7 @@
top_srcdir=@top_srcdir@
top_builddir=..
srcdir=@srcdir@
VPATH=.:$(srcdir):${KERNEL_ROOT_DIR}/idl/salome:${GEOM_ROOT_DIR}/idl/salome:${MED_ROOT_DIR}/idl/salome
VPATH=.:${KERNEL_ROOT_DIR}/idl/salome:${GEOM_ROOT_DIR}/idl/salome:${MED_ROOT_DIR}/idl/salome
@COMMENCE@
@ -14,16 +14,21 @@ IDL_FILES = \
SMESH_Gen.idl \
SMESH_Mesh.idl \
SMESH_Hypothesis.idl \
SMESH_BasicHypothesis.idl
SMESH_BasicHypothesis.idl \
SMESH_Filter.idl \
SMESH_Group.idl
PY_CLIENT_IDL = $(IDL_FILES)
# we copy all idl file in $(top_builddir)/idl
inc: $(IDL_FILES:%=$(top_builddir)/idl/%)
inc: $(top_builddir)/idl/salome $(IDL_FILES:%=$(top_builddir)/idl/salome/%)
$(IDL_FILES:%=$(top_builddir)/idl/%):$(top_builddir)/idl/%:%
$(top_builddir)/idl/salome:
mkdir $@
$(IDL_FILES:%=$(top_builddir)/idl/salome/%):$(IDL_FILES:%=$(top_srcdir)/idl/%)
# $(CP) $< $@
cp -f $< $@
cp -f $^ $(top_builddir)/idl/salome
lib: pyidl
@ -35,7 +40,7 @@ pyidl: $(PYTHON_BUILD_SITE) $(IDL_FILES:%.idl=$(PYTHON_BUILD_SITE)/%_idl.py)
$(PYTHON_BUILD_SITE):
$(INSTALL) -d $@
$(PYTHON_BUILD_SITE)/%_idl.py: %.idl
$(PYTHON_BUILD_SITE)/%_idl.py: $(top_builddir)/idl/salome/%.idl
$(OMNIORB_IDL) $(OMNIORB_IDLPYFLAGS) -C$(PYTHON_BUILD_SITE) $<
@ -43,12 +48,12 @@ $(PYTHON_BUILD_SITE)/%_idl.py: %.idl
install: install-pyidl install-idl
# create directory $(idldir) and copy idl files into it
install-idl: $(IDL_FILES)
install-idl: $(IDL_FILES:%=$(top_builddir)/idl/salome/%)
$(INSTALL) -d $(idldir)
$(INSTALL_DATA) $^ $(idldir)
install-pyidl: $(IDL_FILES)
install-pyidl: $(IDL_FILES:%=$(top_builddir)/idl/salome/%)
$(INSTALL) -d $(PYTHON_SITE_INSTALL)
@for file in $^ dummy; do \
if [ $$file != "dummy" ]; then \
@ -63,6 +68,6 @@ cleandep:
distclean:
-$(RM) *.py
-$(RM) $(IDL_FILES:%=$(top_builddir)/idl/%)
-$(RM) $(IDL_FILES:%=$(top_builddir)/idl/salome/%)
-$(RM) Makefile

View File

@ -30,67 +30,142 @@
#include "SMESH_Hypothesis.idl"
module SMESH
/*!
* StdMeshers: interfaces to standard hypotheses and algorithms
*/
module StdMeshers
{
interface SMESH_LocalLength : SMESH_Hypothesis
/*!
* StdMeshers_LocalLength: interface of "Average length" hypothesis
*/
interface StdMeshers_LocalLength : SMESH::SMESH_Hypothesis
{
/*!
* Sets <length> parameter value
*/
void SetLength(in double length)
raises (SALOME::SALOME_Exception);
/*!
* Returns <length> parameter value
*/
double GetLength();
};
interface SMESH_NumberOfSegments : SMESH_Hypothesis
/*!
* StdMeshers_NumberOfSegments: interface of "Nb. Segments" hypothesis
*/
interface StdMeshers_NumberOfSegments : SMESH::SMESH_Hypothesis
{
/*!
* Sets <number of segments> parameter value
*/
void SetNumberOfSegments(in long segmentsNumber)
raises (SALOME::SALOME_Exception);
/*!
* Returns <number of segments> parameter value
*/
long GetNumberOfSegments();
/*!
* Sets <scale factor> parameter value
*/
void SetScaleFactor(in double scaleFactor)
raises (SALOME::SALOME_Exception);
/*!
* Returns <scale factor> parameter value
*/
double GetScaleFactor();
};
interface SMESH_MaxElementArea : SMESH_Hypothesis
/*!
* StdMeshers_MaxElementArea: interface of "Max. Triangle Area" hypothesis
*/
interface StdMeshers_MaxElementArea : SMESH::SMESH_Hypothesis
{
/*!
* Sets <maximum element area> parameter value
*/
void SetMaxElementArea(in double area)
raises (SALOME::SALOME_Exception);
/*!
* Returns <maximum element area> parameter value
*/
double GetMaxElementArea();
};
interface SMESH_LengthFromEdges : SMESH_Hypothesis
/*!
* StdMeshers_LengthFromEdges: interface of "Length From Edges (2D Hyp. for Triangulator)" hypothesis
*/
interface StdMeshers_LengthFromEdges : SMESH::SMESH_Hypothesis
{
/*!
* Sets <mode> parameter value
*/
void SetMode(in long mode)
raises (SALOME::SALOME_Exception);
/*!
* Returns <mode> parameter value
*/
long GetMode();
};
interface SMESH_MaxElementVolume : SMESH_Hypothesis
/*!
* StdMeshers_MaxElementVolume: interface of "Max. Hexahedron or Tetrahedron Volume" hypothesis
*/
interface StdMeshers_MaxElementVolume : SMESH::SMESH_Hypothesis
{
/*!
* Sets <maximum element volume> parameter value
*/
void SetMaxElementVolume(in double volume)
raises (SALOME::SALOME_Exception);
/*!
* Returns <maximum element volume> parameter value
*/
double GetMaxElementVolume();
};
interface SMESH_Regular_1D : SMESH_1D_Algo
/*!
* StdMeshers_NotConformAllowed: interface of "Not Conform Mesh Allowed" hypothesis.
* Presence of this hypothesis permits to algorithm generation of not conform mesh.
*/
interface StdMeshers_NotConformAllowed : SMESH::SMESH_Hypothesis
{
};
interface SMESH_MEFISTO_2D : SMESH_2D_Algo
/*!
* StdMeshers_Regular_1D: interface of "Wire discretisation" algorithm
*/
interface StdMeshers_Regular_1D : SMESH::SMESH_1D_Algo
{
};
interface SMESH_Quadrangle_2D : SMESH_2D_Algo
/*!
* StdMeshers_MEFISTO_2D: interface of "Triangle (Mefisto)" algorithm
*/
interface StdMeshers_MEFISTO_2D : SMESH::SMESH_2D_Algo
{
};
interface SMESH_Hexa_3D : SMESH_3D_Algo
/*!
* StdMeshers_Quadrangle_2D: interface of "Quadrangle (Mapping)" algorithm
*/
interface StdMeshers_Quadrangle_2D : SMESH::SMESH_2D_Algo
{
};
#ifdef HAVE_NETGEN
interface SMESH_NETGEN_3D : SMESH_3D_Algo
/*!
* StdMeshers_Hexa_3D: interface of "Hexahedron (i,j,k)" algorithm
*/
interface StdMeshers_Hexa_3D : SMESH::SMESH_3D_Algo
{
};
#endif
};

110
idl/SMESH_Filter.idl Normal file
View File

@ -0,0 +1,110 @@
// 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 : SMESH_Filter.idl
// Author : Alexey Petrov, OCC
#ifndef _SMESH_FILTER_IDL_
#define _SMESH_FILTER_IDL_
#include "SALOME_Exception.idl"
#include "SALOME_GenericObj.idl"
#include "SMESH_Mesh.idl"
module SMESH{
interface Functor: SALOME::GenericObj{
void SetMesh(in SMESH_Mesh theMesh);
};
interface NumericalFunctor: Functor{
double GetValue(in long theElementId);
};
interface MinimumAngle: NumericalFunctor{};
interface AspectRatio: NumericalFunctor{};
interface Warping: NumericalFunctor{};
interface Taper: NumericalFunctor{};
interface Skew: NumericalFunctor{};
interface Area: NumericalFunctor{};
interface Length: NumericalFunctor{};
interface MultiConnection: NumericalFunctor{};
interface Predicate: Functor{
boolean IsSatisfy(in long thEntityId);
};
interface FreeBorders: Predicate{};
interface Comparator: Predicate{
void SetMargin(in double theValue);
void SetNumFunctor(in NumericalFunctor theFunct);
};
interface LessThan: Comparator{};
interface MoreThan: Comparator{};
interface EqualTo: Comparator{
void SetTolerance(in double theTolerance );
};
interface Logical: Predicate{};
interface LogicalNOT: Logical{
void SetPredicate(in Predicate thePredicate);
};
interface LogicalBinary: Logical{
void SetPredicate1(in Predicate thePredicate);
void SetPredicate2(in Predicate thePredicate);
};
interface LogicalAND: LogicalBinary{};
interface LogicalOR: LogicalBinary{};
interface Filter: SALOME::GenericObj{
void SetPredicate( in Predicate thePredicate );
long_array GetElementsId( in SMESH_Mesh theMesh );
};
interface FilterManager: SALOME::GenericObj{
MinimumAngle CreateMinimumAngle();
AspectRatio CreateAspectRatio();
Warping CreateWarping();
Taper CreateTaper();
Skew CreateSkew();
Area CreateArea();
Length CreateLength();
MultiConnection CreateMultiConnection();
FreeBorders CreateFreeBorders();
LessThan CreateLessThan();
MoreThan CreateMoreThan();
EqualTo CreateEqualTo();
LogicalNOT CreateLogicalNOT();
LogicalAND CreateLogicalAND();
LogicalOR CreateLogicalOR();
Filter CreateFilter();
};
};
#endif

View File

@ -39,19 +39,35 @@
module SMESH
{
typedef sequence<GEOM::GEOM_Shape> shape_array;
typedef sequence<SMESH_Mesh> mesh_array;
interface FilterManager;
interface SMESH_Gen : Engines::Component, SALOMEDS::Driver
{
FilterManager CreateFilterManager();
/*!
* Create an hypothesis that can be shared by differents parts of the mesh.
Set the current study
*/
void SetCurrentStudy( in SALOMEDS::Study theStudy );
/*!
Get the current study
*/
SALOMEDS::Study GetCurrentStudy();
/*!
* Create a hypothesis that can be shared by differents parts of the mesh.
* An hypothesis is either:
* - a method used to generate or modify a part of the mesh (algorithm).
* - a parameter or a law used by an algorithm.
* Algorithms are 1D, 2D or 3D.
*/
SMESH_Hypothesis CreateHypothesis( in string anHyp,
in long studyId)
raises (SALOME::SALOME_Exception);
SMESH_Hypothesis CreateHypothesis( in string theHypName,
in string theLibName )
raises ( SALOME::SALOME_Exception );
/*!
* Create a Mesh object, given a geometry shape.
@ -60,57 +76,53 @@ module SMESH
* of TopoDS_Shapes and bind CORBA references of shape & subshapes
* with TopoDS_Shapes
*/
SMESH_Mesh Init(in GEOM::GEOM_Gen geomEngine,
in long studyId,
in GEOM::GEOM_Shape aShape)
raises (SALOME::SALOME_Exception);
SMESH_Mesh CreateMesh( in GEOM::GEOM_Shape theShape )
raises ( SALOME::SALOME_Exception );
/*!
* Create Mesh object(s) importing data from given MED file
*/
mesh_array CreateMeshesFromMED( in string theFileName,
out SMESH::DriverMED_ReadStatus theStatus )
raises ( SALOME::SALOME_Exception );
/*!
* Create a Mesh object, without a geometry shape reference
*/
// SMESH_Mesh NewEmpty(in GEOM::GEOM_Gen geomEngine,
// in long studyId)
// raises (SALOME::SALOME_Exception);
// SMESH_Mesh NewEmpty()
// raises ( SALOME::SALOME_Exception );
/*!
* Mesh a subShape.
* First, verify list of hypothesis associated with the subShape,
* return NOK if hypothesis are not sufficient
*/
boolean Compute(in SMESH_Mesh aMesh, in GEOM::GEOM_Shape aSubShape)
raises (SALOME::SALOME_Exception);
boolean Compute( in SMESH_Mesh theMesh,
in GEOM::GEOM_Shape theSubShape )
raises ( SALOME::SALOME_Exception );
/*!
*
*/
boolean IsReadyToCompute(in SMESH_Mesh aMesh, in GEOM::GEOM_Shape aSubShape)
raises (SALOME::SALOME_Exception);
boolean IsReadyToCompute( in SMESH_Mesh theMesh,
in GEOM::GEOM_Shape theSubShape )
raises ( SALOME::SALOME_Exception );
/*!
*
*/
long_array GetSubShapesId(in GEOM::GEOM_Gen geomEngine,
in long studyId,
in GEOM::GEOM_Shape mainShape,
in shape_array listOfSubShape)
raises (SALOME::SALOME_Exception);
long_array GetSubShapesId( in GEOM::GEOM_Shape theMainShape,
in shape_array theListOfSubShape )
raises ( SALOME::SALOME_Exception );
/*!
*
*/
// long_array GetSubMeshesState(in GEOM::GEOM_Gen geomEngine,
// in long studyId,
// in shape_array listOfSubShape)
// raises (SALOME::SALOME_Exception);
// long_array GetSubMeshesState( in shape_array theListOfSubShape )
// raises ( SALOME::SALOME_Exception );
/**
* Import a mesh from a file.
* @param fileName file name to be imported.
* @param fileType Currently it could be either "DAT", "UNV" or "MED".
* @param studyId The id of the current study.
*/
SMESH_Mesh Import(in long studyId, in string fileName, in string fileType);
};
};

103
idl/SMESH_Group.idl Normal file
View File

@ -0,0 +1,103 @@
// Copyright (C) 2004 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 : SMESH_Group.idl
// Author : Sergey ANIKIN, OCC
// $Header$
#ifndef _SMESH_GROUP_IDL_
#define _SMESH_GROUP_IDL_
#include "SALOME_Exception.idl"
#include "SALOME_GenericObj.idl"
#include "SMESH_Mesh.idl"
module SMESH
{
/*!
* SMESH_Group: interface of group object
*/
interface SMESH_Group : SALOME::GenericObj
{
/*!
* Sets group name
*/
void SetName( in string name );
/*!
* Returns group name
*/
string GetName();
/*!
* Returns group type (type of elements in the group)
*/
ElementType GetType();
/*!
* Returns the number of elements in the group
*/
long Size();
/*!
* Returns true if the group does not contain any elements
*/
boolean IsEmpty();
/*!
* Clears the group's contents
*/
void Clear();
/*!
* returns true if the group contains an element with ID == <elem_id>
*/
boolean Contains( in long elem_id );
/*!
* Adds elements to the group
*/
long Add( in long_array elem_ids );
/*!
* Returns ID of an element at position <elem_index>
*/
long GetID( in long elem_index );
/*!
* Returns a sequence of all element IDs in the group
*/
long_array GetListOfID();
/*!
* Removes elements from the group
*/
long Remove( in long_array elem_ids );
/*!
* Returns the mesh object this group belongs to
*/
SMESH_Mesh GetMesh();
};
};
#endif

View File

@ -27,26 +27,29 @@
#define _SMESH_HYPOTHESIS_IDL_
#include "SALOME_Exception.idl"
#include "SALOME_GenericObj.idl"
module SMESH
{
interface SMESH_Hypothesis;
typedef sequence<SMESH_Hypothesis> ListOfHypothesis;
typedef sequence<string> ListOfHypothesisName;
interface SMESH_Hypothesis
interface SMESH_Hypothesis : SALOME::GenericObj
{
/*!
* Get the Hypothesis typeName
*/
string GetName();
/*!
* Get the Hypothesis plugin library Name
*/
string GetLibName();
/*!
* Get the internal Id
*/
long GetId();
};
};
typedef sequence<string> ListOfHypothesisName;
interface SMESH_Algo : SMESH_Hypothesis
{

View File

@ -27,13 +27,30 @@
#define _SMESH_MESH_IDL_
#include "SALOME_Exception.idl"
#include "SMESH_Hypothesis.idl"
//#include "SMESH_Hypothesis.idl"
#include "SALOME_GenericObj.idl"
//#include "GEOM_Shape.idl"
//#include "MED.idl"
module GEOM
{
interface GEOM_Shape;
};
module SALOME_MED
{
interface MESH;
interface FAMILY;
};
#include "GEOM_Shape.idl"
#include "MED.idl"
module SMESH
{
interface SMESH_Hypothesis;
typedef sequence<SMESH_Hypothesis> ListOfHypothesis;
typedef sequence<double> double_array ;
typedef sequence<long> long_array ;
typedef sequence<string> string_array ;
@ -49,8 +66,7 @@ module SMESH
ADD_PRISM,
ADD_HEXAHEDRON,
REMOVE_NODE,
REMOVE_ELEMENT,
REMOVE_ALL
REMOVE_ELEMENT
};
struct log_block
@ -60,12 +76,56 @@ module SMESH
double_array coords;
long_array indexes;
};
/*!
* Enumeration for element type, like in SMDS
*/
enum ElementType
{
ALL,
NODE,
EDGE,
FACE,
VOLUME
};
/*!
* Enumeration for hypothesis status (used by AddHypothesis() and RemoveHypothesis() methods)
*/
enum Hypothesis_Status // in the order of severity
{
HYP_OK,
HYP_MISSING, // algo misses a hypothesis
HYP_CONCURENT, // several applicable hypotheses
HYP_BAD_PARAMETER,// hypothesis has a bad parameter value
HYP_UNKNOWN_FATAL,// --- all statuses below should be considered as fatal
// for Add/RemoveHypothesis operations
HYP_INCOMPATIBLE, // hypothesis does not fit algo
HYP_NOTCONFORM, // not conform mesh is produced appling a hypothesis
HYP_ALREADY_EXIST,// such hypothesis already exist
HYP_BAD_DIM // bad dimension
};
/*!
* Enumeration for DriverMED read status (used by ImportMEDFile() method)
*/
enum DriverMED_ReadStatus // in the order of severity
{
DRS_OK,
DRS_EMPTY, // a MED file contains no mesh with the given name
DRS_WARN_RENUMBER, // a MED file has overlapped ranges of element numbers,
// so the numbers from the file are ignored
DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data
DRS_FAIL // general failure (exception etc.)
};
typedef sequence<log_block> log_array;
interface SMESH_Group;
interface SMESH_subMesh;
interface SMESH_MeshEditor;
interface SMESH_Mesh
interface SMESH_Mesh : SALOME::GenericObj
{
/*!
* Associate a Shape to a Mesh created with NewEmpty
@ -80,7 +140,7 @@ module SMESH
* SubMesh will be used instead of SubShape in a next idl version to
* adress a specific subMesh...
*/
SMESH_subMesh GetElementsOnShape(in GEOM::GEOM_Shape aSubShape)
SMESH_subMesh GetSubMesh(in GEOM::GEOM_Shape aSubShape, in string name)
raises (SALOME::SALOME_Exception);
/*!
@ -89,6 +149,25 @@ module SMESH
// SMESH_subMesh NewEmpty()
// raises (SALOME::SALOME_Exception);
/*!
* Remove a submesh
*/
void RemoveSubMesh(in SMESH_subMesh aSubMesh)
raises (SALOME::SALOME_Exception);
/*!
* Create a group
*/
SMESH_Group CreateGroup( in ElementType elem_type,
in string name )
raises (SALOME::SALOME_Exception);
/*!
* Remove a group
*/
void RemoveGroup(in SMESH_Group aGroup)
raises (SALOME::SALOME_Exception);
/*!
* Add hypothesis to the mesh, under a particular subShape
* (or the main shape itself)
@ -106,7 +185,8 @@ module SMESH
* (or one previous hypothesis on the subShape)
* raises exception if hypothesis has not been created
*/
boolean AddHypothesis(in GEOM::GEOM_Shape aSubShape, in SMESH_Hypothesis anHyp)
Hypothesis_Status AddHypothesis(in GEOM::GEOM_Shape aSubShape,
in SMESH_Hypothesis anHyp)
raises (SALOME::SALOME_Exception);
// boolean AddHypothesis(in SMESH_subMesh aSubMesh, in SMESH_Hypothesis anHyp)
// raises (SALOME::SALOME_Exception);
@ -115,8 +195,8 @@ module SMESH
/*!
* Remove an hypothesis previouly added with AddHypothesis.
*/
boolean RemoveHypothesis(in GEOM::GEOM_Shape aSubShape,
in SMESH_Hypothesis anHyp)
Hypothesis_Status RemoveHypothesis(in GEOM::GEOM_Shape aSubShape,
in SMESH_Hypothesis anHyp)
raises (SALOME::SALOME_Exception);
// boolean RemoveHypothesis(in SMESH_subMesh aSubMesh,
// in SMESH_Hypothesis anHyp)
@ -162,11 +242,13 @@ module SMESH
raises (SALOME::SALOME_Exception);
/*!
* Export mesh to a file
* @param fileName file name where to export the file
* @param fileType Currently it could be either "DAT", "UNV" or "MED".
* Export Mesh with DAT and MED Formats
*/
void Export( in string fileName, in string fileType )
void ExportDAT( in string file )
raises (SALOME::SALOME_Exception);
void ExportMED( in string file, in boolean auto_groups )
raises (SALOME::SALOME_Exception);
void ExportUNV( in string file )
raises (SALOME::SALOME_Exception);
/*!
@ -199,11 +281,19 @@ module SMESH
long NbHexas()
raises (SALOME::SALOME_Exception);
long NbPyramids()
raises (SALOME::SALOME_Exception);
long NbPrisms()
raises (SALOME::SALOME_Exception);
long NbSubMesh()
raises (SALOME::SALOME_Exception);
string Dump();
};
interface SMESH_subMesh
interface SMESH_subMesh : SALOME::GenericObj
{
/*!
*
@ -223,6 +313,12 @@ module SMESH
long_array GetElementsId()
raises (SALOME::SALOME_Exception);
/*!
*
*/
long_array GetElementsByType( in ElementType theType )
raises (SALOME::SALOME_Exception);
/*!
*
*/

View File

@ -0,0 +1,45 @@
// 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 : SMESH_NetgenAlgorithm.idl
// Author : Julia DOROVSKIKH
// $Header$
#ifndef _SMESH_NETGENALGORITHM_IDL_
#define _SMESH_NETGENALGORITHM_IDL_
#include "SMESH_Hypothesis.idl"
/*!
* NETGENPlugin: interfaces to NETGEN related hypotheses and algorithms
*/
module NETGENPlugin
{
/*!
* NETGENPlugin_NETGEN_3D: interface of "Tetrahedron (Netgen)" algorithm
*/
interface NETGENPlugin_NETGEN_3D : SMESH::SMESH_3D_Algo
{
};
};
#endif

2
resources/SMESH.config Normal file
View File

@ -0,0 +1,2 @@
language=en
resources=StdMeshers:NETGENPlugin

View File

@ -0,0 +1,78 @@
<?xml version='1.0' encoding='us-ascii'?>
<!DOCTYPE meshers PUBLIC "" "desktop.dtd">
<!-- GUI customization for MESH component -->
<meshers>
<meshers-group name="Standard Meshers"
resources="StdMeshers"
server-lib="libStdMeshersEngine.so"
gui-lib="libStdMeshersGUI.so">
<hypotheses>
<hypothesis type="LocalLength"
label-id="Average length"
icon-id="mesh_hypo_length.png"/>
<hypothesis type="LengthFromEdges"
label-id="Length From Edges (2D Hyp. for Triangulator)"
icon-id="mesh_hypo_length.png"/>
<hypothesis type="NumberOfSegments"
label-id="Nb. Segments"
icon-id="mesh_hypo_segment.png"/>
<hypothesis type="MaxElementArea"
label-id="Max. Triangle Area"
icon-id="mesh_hypo_area.png"/>
<hypothesis type="MaxElementVolume"
label-id="Max. Hexahedron or Tetrahedron Volume"
icon-id="mesh_hypo_volume.png"/>
<hypothesis type="NotConformAllowed"
label-id="Not Conform Mesh Allowed"
icon-id="mesh_hypo_length.png"/>
</hypotheses>
<algorithms>
<algorithm type="Regular_1D"
label-id="Wire discretisation"
icon-id="mesh_algo_regular.png"/>
<algorithm type="MEFISTO_2D"
label-id="Triangle (Mefisto)"
icon-id="mesh_algo_mefisto.png"/>
<algorithm type="Quadrangle_2D"
label-id="Quadrangle (Mapping)"
icon-id="mesh_algo_quad.png"/>
<algorithm type="Hexa_3D"
label-id="Hexahedron (i,j,k)"
icon-id="mesh_algo_hexa.png"/>
</algorithms>
</meshers-group>
<meshers-group name="Your Meshers Group"
resources=""
server-lib=""
gui-lib="">
<hypotheses>
<hypothesis type=""
label-id=""
icon-id=""/>
</hypotheses>
<algorithms>
<algorithm type=""
label-id=""
icon-id=""/>
</algorithms>
</meshers-group>
</meshers>

View File

@ -0,0 +1,89 @@
<?xml version='1.0' encoding='us-ascii'?>
<!DOCTYPE meshers PUBLIC "" "desktop.dtd">
<!-- GUI customization for MESH component -->
<meshers>
<meshers-group name="Standard Meshers"
resources="StdMeshers"
server-lib="libStdMeshersEngine.so"
gui-lib="libStdMeshersGUI.so">
<hypotheses>
<hypothesis type="LocalLength"
label-id="Average length"
icon-id="mesh_hypo_length.png"/>
<hypothesis type="LengthFromEdges"
label-id="Length From Edges (2D Hyp. for Triangulator)"
icon-id="mesh_hypo_length.png"/>
<hypothesis type="NumberOfSegments"
label-id="Nb. Segments"
icon-id="mesh_hypo_segment.png"/>
<hypothesis type="MaxElementArea"
label-id="Max. Triangle Area"
icon-id="mesh_hypo_area.png"/>
<hypothesis type="MaxElementVolume"
label-id="Max. Hexahedron or Tetrahedron Volume"
icon-id="mesh_hypo_volume.png"/>
<hypothesis type="NotConformAllowed"
label-id="Not Conform Mesh Allowed"
icon-id="mesh_hypo_length.png"/>
</hypotheses>
<algorithms>
<algorithm type="Regular_1D"
label-id="Wire discretisation"
icon-id="mesh_algo_regular.png"/>
<algorithm type="MEFISTO_2D"
label-id="Triangle (Mefisto)"
icon-id="mesh_algo_mefisto.png"/>
<algorithm type="Quadrangle_2D"
label-id="Quadrangle (Mapping)"
icon-id="mesh_algo_quad.png"/>
<algorithm type="Hexa_3D"
label-id="Hexahedron (i,j,k)"
icon-id="mesh_algo_hexa.png"/>
</algorithms>
</meshers-group>
<meshers-group name="NETGEN"
resources="NETGENPlugin"
server-lib="libNETGENEngine.so"
gui-lib="">
<algorithms>
<algorithm type="NETGEN_3D"
label-id="Tetrahedron (Netgen)"
icon-id="mesh_algo_tetra.png"/>
</algorithms>
</meshers-group>
<meshers-group name="Your Meshers Group"
resources=""
server-lib=""
gui-lib="">
<hypotheses>
<hypothesis type=""
label-id=""
icon-id=""/>
</hypotheses>
<algorithms>
<algorithm type=""
label-id=""
icon-id=""/>
</algorithms>
</meshers-group>
</meshers>

View File

@ -17,7 +17,7 @@
<submenu label-id="Import" item-id="11" pos-id="8">
<popup-item item-id="111" pos-id="" label-id="DAT file" icon-id="" tooltip-id="" accel-id="Ctrl+B" toggle-id="" execute-action=""/>
<popup-item item-id="112" pos-id="" label-id="UNV File" icon-id="" tooltip-id="" accel-id="Ctrl+I" toggle-id="" execute-action=""/>
<popup-item item-id="113" pos-id="" label-id="MED File" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="113" pos-id="" label-id="MED File" icon-id="" tooltip-id="" accel-id="Ctrl+M" toggle-id="" execute-action=""/>
</submenu>
<endsubmenu />
<submenu label-id="Export" item-id="12" pos-id="9">
@ -37,37 +37,34 @@
<!-- ************************** Hypothesis (menubar) ************************************ -->
<menu-item label-id="Hypotheses" item-id="50" pos-id="3">
<popup-item item-id="5030" pos-id="" label-id="Average length" icon-id="mesh_hypo_length.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="5031" pos-id="" label-id="Nb. Segments" icon-id="mesh_hypo_segment.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="5032" pos-id="" label-id="Max. Triangle Area" icon-id="mesh_hypo_area.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="5033" pos-id="" label-id="Max. Hexahedron or Tetrahedron Volume" icon-id="mesh_hypo_volume.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="5034" pos-id="" label-id="Length From Edges (2D Hyp. for Triangulator)" icon-id="mesh_hypo_length.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="5000" pos-id="" label-id="Wire discretisation" icon-id="mesh_algo_regular.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="5010" pos-id="" label-id="Triangle (Mefisto)" icon-id="mesh_algo_mefisto.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="5011" pos-id="" label-id="Quadrangle (Mapping)" icon-id="mesh_algo_quad.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="5020" pos-id="" label-id="Hexahedron (i,j,k)" icon-id="mesh_algo_hexa.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="5021" pos-id="" label-id="Tetrahedron (Netgen)" icon-id="mesh_algo_tetra.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="5000" pos-id="" label-id="Create Hypotheses" icon-id="mesh_hypo_length.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="5010" pos-id="" label-id="Create Algorithms" icon-id="mesh_algo_mefisto.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</menu-item>
<!-- ************************** Mesh (menubar) ************************************ -->
<menu-item label-id="Mesh" item-id="70" pos-id="4">
<popup-item item-id="703" pos-id="" label-id="Global Hyp." icon-id="mesh_init.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="702" pos-id="" label-id="Local Hyp." icon-id="mesh_add_sub.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="704" pos-id="" label-id="Edit Hyp." icon-id="mesh_edit.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="703" pos-id="" label-id="Global Hypothesis" icon-id="mesh_init.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="702" pos-id="" label-id="Local Hypothesis" icon-id="mesh_add_sub.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="704" pos-id="" label-id="Edit Hypothesis" icon-id="mesh_edit.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="701" pos-id="" label-id="Compute" icon-id="mesh_compute.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="801" pos-id="" label-id="Create Group" icon-id="mesh_tree_group.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="802" pos-id="" label-id="Construct Group" icon-id="mesh_make_group.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="803" pos-id="" label-id="Edit Group" icon-id="mesh_edit_group.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="900" pos-id="" label-id="Mesh Infos" icon-id="mesh_info.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</menu-item>
<!-- ************************** Control (menubar) ************************************ -->
<menu-item label-id="Controls" item-id="60" pos-id="5">
<popup-item item-id="6001" pos-id="" label-id="Length" icon-id="mesh_length.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6002" pos-id="" label-id="Connectivity" icon-id="mesh_connectivity.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6003" pos-id="" label-id="Free borders" icon-id="mesh_free_edges.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6004" pos-id="" label-id="Borders at multi-connection" icon-id="mesh_multi_edges.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<!-- popup-item item-id="6002" pos-id="" label-id="Connectivity" icon-id="mesh_connectivity.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/ -->
<popup-item item-id="6011" pos-id="" label-id="Area" icon-id="mesh_area.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6012" pos-id="" label-id="Taper" icon-id="mesh_taper.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6013" pos-id="" label-id="Aspect Ratio" icon-id="mesh_aspect.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6012" pos-id="" label-id="Taper" icon-id="mesh_taper.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6013" pos-id="" label-id="Aspect Ratio" icon-id="mesh_aspect.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6014" pos-id="" label-id="Minimum angle" icon-id="mesh_angle.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6015" pos-id="" label-id="Warp" icon-id="mesh_wrap.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6016" pos-id="" label-id="Skew" icon-id="mesh_skew.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
@ -90,30 +87,28 @@
</submenu>
<endsubmenu />
<popup-item item-id="405" pos-id="" label-id="Move Node" icon-id="mesh_move_node.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="806" pos-id="" label-id="Orientation" icon-id="mesh_orientation.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="807" pos-id="" label-id="Diagonal Inversion" icon-id="mesh_diagonal.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</menu-item>
<!-- ************************** Numbering (menubar) ************************************ -->
<menu-item label-id="Numbering" item-id="80" pos-id="7">
<popup-item item-id="9010" pos-id="" label-id="Display Nodes #" icon-id="" tooltip-id="" accel-id="" toggle-id="false" execute-action=""/>
<popup-item item-id="9011" pos-id="" label-id="Display Elements #" icon-id="" tooltip-id="" accel-id="" toggle-id="false" execute-action=""/>
<popup-item item-id="406" pos-id="" label-id="Orientation" icon-id="mesh_orientation.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="407" pos-id="" label-id="Diagonal Inversion" icon-id="mesh_diagonal.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</menu-item>
<!-- ********************************* Settings (menubar) ********************************* -->
<menu-item label-id="Preferences" item-id="4" pos-id="">
<submenu label-id="Mesh" item-id="100" pos-id="-1">
<submenu label-id="Display Mode" item-id="1000" pos-id="">
<popup-item item-id="10001" pos-id="" label-id="Wireframe" icon-id="" tooltip-id="" accel-id="" toggle-id="false" execute-action=""/>
<popup-item item-id="10002" pos-id="" label-id="Shading" icon-id="" tooltip-id=""accel-id="" toggle-id="true" execute-action=""/>
<popup-item item-id="10003" pos-id="" label-id="Shrink" icon-id="" tooltip-id="" accel-id="" toggle-id="false" execute-action=""/>
<popup-item item-id="10001" pos-id="" label-id="Wireframe" icon-id="mesh_wireframe.png" tooltip-id="" accel-id="" toggle-id="false" execute-action=""/>
<popup-item item-id="10002" pos-id="" label-id="Shading" icon-id="mesh_shading.png" tooltip-id=""accel-id="" toggle-id="true" execute-action=""/>
<popup-item item-id="10004" pos-id="" label-id="Nodes" icon-id="mesh_points.png" tooltip-id="" accel-id="" toggle-id="false" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="10003" pos-id="" label-id="Shrink" icon-id="mesh_shrink.png" tooltip-id="" accel-id="" toggle-id="false" execute-action=""/>
</submenu>
<endsubmenu />
<popup-item item-id="1001" pos-id="" label-id="Automatic Update" icon-id="" tooltip-id="" accel-id="" toggle-id="false" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="1003" pos-id="" label-id="Colors - Size" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="1003" pos-id="" label-id="Colors / Size" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="1005" pos-id="" label-id="Scalars Bar" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="1005" pos-id="" label-id="Scalar Bar" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="1006" pos-id="" label-id="Selection" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</submenu>
<endsubmenu />
<separator pos-id="-1"/>
@ -121,12 +116,6 @@
<!-- ********************************* View (menubar) ********************************* -->
<menu-item label-id="View" item-id="2" pos-id="">
<submenu label-id="Display Mode" item-id="21" pos-id="">
<popup-item item-id="211" pos-id="" label-id="Wireframe" icon-id="mesh_wireframe.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="212" pos-id="" label-id="Shading" icon-id="mesh_shading.png" tooltip-id=""accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="213" pos-id="" label-id="Shrink" icon-id="mesh_shrink.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</submenu>
<endsubmenu />
<separator pos-id=""/>
<popup-item item-id="214" pos-id="" label-id="Update" icon-id="mesh_update.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</menu-item>
@ -134,83 +123,210 @@
<!-- ################################# POPUP MENU ################################# -->
<popupmenu label-id="Popup for ObjectBrowser" context-id="" parent-id="ObjectBrowser" object-id="Mesh">
<popup-item item-id="705" pos-id="" label-id="Edit Global Hyp." icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="705" pos-id="" label-id="Edit Global Hypothesis" icon-id="mesh_edit.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="701" pos-id="" label-id="Compute" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="214" pos-id="" label-id="Update" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="701" pos-id="" label-id="Compute" icon-id="mesh_compute.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="214" pos-id="" label-id="Update" icon-id="mesh_update.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="900" pos-id="" label-id="Show Info" icon-id="mesh_info.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="801" pos-id="" label-id="Create Group" icon-id="mesh_tree_group.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="1101" pos-id="" label-id="Rename" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="122" pos-id="" label-id="Export to MED" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</popupmenu>
<popupmenu label-id="Popup for ObjectBrowser" context-id="" parent-id="ObjectBrowser" object-id="SubMesh">
<popup-item item-id="706" pos-id="" label-id="Edit Local Hyp." icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="706" pos-id="" label-id="Edit Local Hypothesis" icon-id="mesh_edit.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="214" pos-id="" label-id="Update" icon-id="mesh_update.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="900" pos-id="" label-id="Show Info" icon-id="mesh_info.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="802" pos-id="" label-id="Construct Group" icon-id="mesh_make_group.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="33" pos-id="" label-id="Delete" icon-id="delete.png" tooltip-id="" accel-id="" toggle-id="" execute-action="" />
</popupmenu>
<popupmenu label-id="Popup for ObjectBrowser" context-id="" parent-id="ObjectBrowser" object-id="Group">
<popup-item item-id="803" pos-id="" label-id="Edit" icon-id="mesh_edit_group.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="214" pos-id="" label-id="Update" icon-id="mesh_update.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="900" pos-id="" label-id="Show Info" icon-id="mesh_info.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="1101" pos-id="" label-id="Rename" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="33" pos-id="" label-id="Delete" icon-id="delete.png" tooltip-id="" accel-id="" toggle-id="" execute-action="" />
</popupmenu>
<popupmenu label-id="Popup for ObjectBrowser" context-id="" parent-id="ObjectBrowser" object-id="Hypothesis">
<popup-item item-id="1100" pos-id="" label-id="Edit" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="1102" pos-id="" label-id="Unassign Hyp." icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="1101" pos-id="" label-id="Rename" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</popupmenu>
<popupmenu label-id="Popup for ObjectBrowser" context-id="" parent-id="ObjectBrowser" object-id="Algorithm">
<popup-item item-id="1102" pos-id="" label-id="Unassign Algo." icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="1102" pos-id="" label-id="Unassign Hypothesis" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="1101" pos-id="" label-id="Rename" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</popupmenu>
<popupmenu label-id="Popup for ObjectBrowser" context-id="" parent-id="ObjectBrowser" object-id="Algorithm">
<popup-item item-id="1102" pos-id="" label-id="Unassign Algorithm" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="1101" pos-id="" label-id="Rename" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</popupmenu>
<popupmenu label-id="Popup for Viewer" context-id="" parent-id="Viewer" object-id="Mesh">
<popup-item item-id="214" pos-id="" label-id="Update" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="214" pos-id="" label-id="Update" icon-id="mesh_update.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="900" pos-id="" label-id="Show Info" icon-id="mesh_info.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<submenu label-id="Properties" item-id="113" pos-id="">
<submenu label-id="Display Mode" item-id="1131" pos-id="">
<popup-item item-id="211" pos-id="" label-id="Wireframe" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="212" pos-id="" label-id="Shading" icon-id="" tooltip-id=""accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="213" pos-id="" label-id="Shrink" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</submenu>
<endsubmenu />
<separator pos-id=""/>
<popup-item item-id="1132" pos-id="" label-id="Colors - Size" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="1133" pos-id="" label-id="Transparency" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<submenu label-id="Numbering" item-id="114" pos-id="">
<popup-item item-id="9010" pos-id="" label-id="Display Nodes #" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="9011" pos-id="" label-id="Display Elements #" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</submenu>
<endsubmenu />
<separator pos-id=""/>
<submenu label-id="Display Mode" item-id="1131" pos-id="">
<popup-item item-id="211" pos-id="" label-id="Wireframe" icon-id="mesh_wireframe.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="212" pos-id="" label-id="Shading" icon-id="mesh_shading.png" tooltip-id=""accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="215" pos-id="" label-id="Nodes" icon-id="mesh_points.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="213" pos-id="" label-id="Shrink" icon-id="mesh_shrink.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</submenu>
<endsubmenu />
<popup-item item-id="1132" pos-id="" label-id="Colors / Size" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="1133" pos-id="" label-id="Transparency" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<submenu label-id="Control" item-id="2000" pos-id="">
<popup-item item-id="6001" pos-id="" label-id="Length" icon-id="mesh_length.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6003" pos-id="" label-id="Free borders" icon-id="mesh_free_edges.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6004" pos-id="" label-id="Borders at multi-connection" icon-id="mesh_multi_edges.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<!-- popup-item item-id="6002" pos-id="" label-id="Connectivity" icon-id="mesh_connectivity.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/ -->
<popup-item item-id="6011" pos-id="" label-id="Area" icon-id="mesh_area.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6012" pos-id="" label-id="Taper" icon-id="mesh_taper.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6013" pos-id="" label-id="Aspect Ratio" icon-id="mesh_aspect.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6014" pos-id="" label-id="Minimum angle" icon-id="mesh_angle.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6015" pos-id="" label-id="Warp" icon-id="mesh_wrap.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6016" pos-id="" label-id="Skew" icon-id="mesh_skew.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="200" pos-id="" label-id="Reset" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="201" pos-id="" label-id="Scalar Bar Properties" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</submenu>
<endsubmenu />
<separator pos-id=""/>
</popupmenu>
<popupmenu label-id="ScalarBar" context-id="" parent-id="Viewer" object-id="ScalarBar">
<popup-item item-id="200" pos-id="" label-id="Erase" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="201" pos-id="" label-id="Edit" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="202" pos-id="" label-id="Update View" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popupmenu label-id="Popup for Viewer" context-id="" parent-id="Viewer" object-id="SubMesh">
<popup-item item-id="214" pos-id="" label-id="Update" icon-id="mesh_update.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="900" pos-id="" label-id="Show Info" icon-id="mesh_info.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<submenu label-id="Numbering" item-id="114" pos-id="">
<popup-item item-id="9010" pos-id="" label-id="Display Nodes #" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="9011" pos-id="" label-id="Display Elements #" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</submenu>
<endsubmenu />
<separator pos-id=""/>
<submenu label-id="Display Mode" item-id="1131" pos-id="">
<popup-item item-id="211" pos-id="" label-id="Wireframe" icon-id="mesh_wireframe.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="212" pos-id="" label-id="Shading" icon-id="mesh_shading.png" tooltip-id=""accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="215" pos-id="" label-id="Nodes" icon-id="mesh_points.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="213" pos-id="" label-id="Shrink" icon-id="mesh_shrink.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</submenu>
<endsubmenu />
<popup-item item-id="1132" pos-id="" label-id="Colors / Size" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="1133" pos-id="" label-id="Transparency" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<submenu label-id="Control" item-id="2000" pos-id="">
<popup-item item-id="6001" pos-id="" label-id="Length" icon-id="mesh_length.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6003" pos-id="" label-id="Free borders" icon-id="mesh_free_edges.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6004" pos-id="" label-id="Borders at multi-connection" icon-id="mesh_multi_edges.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<!-- popup-item item-id="6002" pos-id="" label-id="Connectivity" icon-id="mesh_connectivity.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/ -->
<popup-item item-id="6011" pos-id="" label-id="Area" icon-id="mesh_area.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6012" pos-id="" label-id="Taper" icon-id="mesh_taper.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6013" pos-id="" label-id="Aspect Ratio" icon-id="mesh_aspect.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6014" pos-id="" label-id="Minimum angle" icon-id="mesh_angle.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6015" pos-id="" label-id="Warp" icon-id="mesh_wrap.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6016" pos-id="" label-id="Skew" icon-id="mesh_skew.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="200" pos-id="" label-id="Reset" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="201" pos-id="" label-id="Scalar Bar Properties" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</submenu>
<endsubmenu />
<separator pos-id=""/>
</popupmenu>
<popupmenu label-id="Popup for Viewer" context-id="" parent-id="Viewer" object-id="Group">
<popup-item item-id="803" pos-id="" label-id="Edit" icon-id="mesh_edit_group.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="214" pos-id="" label-id="Update" icon-id="mesh_update.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="900" pos-id="" label-id="Show Info" icon-id="mesh_info.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<submenu label-id="Numbering" item-id="114" pos-id="">
<popup-item item-id="9010" pos-id="" label-id="Display Nodes #" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="9011" pos-id="" label-id="Display Elements #" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</submenu>
<endsubmenu />
<separator pos-id=""/>
<submenu label-id="Display Mode" item-id="1131" pos-id="">
<popup-item item-id="211" pos-id="" label-id="Wireframe" icon-id="mesh_wireframe.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="212" pos-id="" label-id="Shading" icon-id="mesh_shading.png" tooltip-id=""accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="215" pos-id="" label-id="Nodes" icon-id="mesh_points.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="213" pos-id="" label-id="Shrink" icon-id="mesh_shrink.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</submenu>
<endsubmenu />
<popup-item item-id="1132" pos-id="" label-id="Colors / Size" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="1133" pos-id="" label-id="Transparency" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<submenu label-id="Control" item-id="2000" pos-id="">
<popup-item item-id="6001" pos-id="" label-id="Length" icon-id="mesh_length.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6003" pos-id="" label-id="Free borders" icon-id="mesh_free_edges.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6004" pos-id="" label-id="Borders at multi-connection" icon-id="mesh_multi_edges.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<!-- popup-item item-id="6002" pos-id="" label-id="Connectivity" icon-id="mesh_connectivity.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/ -->
<popup-item item-id="6011" pos-id="" label-id="Area" icon-id="mesh_area.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6012" pos-id="" label-id="Taper" icon-id="mesh_taper.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6013" pos-id="" label-id="Aspect Ratio" icon-id="mesh_aspect.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6014" pos-id="" label-id="Minimum angle" icon-id="mesh_angle.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6015" pos-id="" label-id="Warp" icon-id="mesh_wrap.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="6016" pos-id="" label-id="Skew" icon-id="mesh_skew.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="200" pos-id="" label-id="Reset" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="201" pos-id="" label-id="Scalar Bar Properties" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</submenu>
<endsubmenu />
<separator pos-id=""/>
</popupmenu>
<popupmenu label-id="Elements" context-id="" parent-id="Viewer" object-id="Elements">
<popup-item item-id="804" pos-id="" label-id="Add" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="805" pos-id="" label-id="Remove" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</popupmenu>
</menubar>
<!-- ///////////////////////////////////// TOOLBARS ////////////////////////////////////// -->
<toolbar label-id="Mesh Toolbar">
<toolbutton-item item-id="703" pos-id="" label-id="Init" icon-id="mesh_init.png" tooltip-id="Global Hyp." accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="702" pos-id="" label-id="Add SubMesh" icon-id="mesh_add_sub.png" tooltip-id="Local Hyp." accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="704" pos-id="" label-id="Edit" icon-id="mesh_edit.png" tooltip-id="Edit Hyp." accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="703" pos-id="" label-id="Init" icon-id="mesh_init.png" tooltip-id="Global Hypothesis" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="702" pos-id="" label-id="Add SubMesh" icon-id="mesh_add_sub.png" tooltip-id="Local Hypothesis" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="704" pos-id="" label-id="Edit" icon-id="mesh_edit.png" tooltip-id="Edit Hypothesis" accel-id="" toggle-id="" execute-action=""/>
<separatorTB/>
<toolbutton-item item-id="701" pos-id="" label-id="Compute" icon-id="mesh_compute.png" tooltip-id="Compute" accel-id="" toggle-id="" execute-action=""/>
<separatorTB/>
<toolbutton-item item-id="801" pos-id="" label-id="Create Group" icon-id="mesh_tree_group.png" tooltip-id="Create Group" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="802" pos-id="" label-id="Construct Group" icon-id="mesh_make_group.png" tooltip-id="Construct Group" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="803" pos-id="" label-id="Edit Group" icon-id="mesh_edit_group.png" tooltip-id="Edit Group" accel-id="" toggle-id="" execute-action=""/>
<separatorTB/>
<toolbutton-item item-id="900" pos-id="" label-id="Mesh Infos" icon-id="mesh_info.png" tooltip-id="Mesh Infos" accel-id="" toggle-id="" execute-action=""/>
</toolbar>
<toolbar label-id="Hypotheses Toolbar">
<toolbutton-item item-id="5030" label-id="Average length" icon-id="mesh_hypo_length.png" tooltip-id="Avreage length Hypothesis" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="5031" label-id="Segments" icon-id="mesh_hypo_segment.png" tooltip-id="Nb. Segments Hypothesis" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="5032" label-id="Max. Triangle Area" icon-id="mesh_hypo_area.png" tooltip-id="Max. Triangle Area Hypothesis" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="5033" label-id="Max. Hexahedron or Tetrahedron Volume" icon-id="mesh_hypo_volume.png" tooltip-id="Max. Hexahedron or Tetrahedron Volume Hypothesis" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="5034" label-id="Length From Edges (2D Hyp. for Triangulator)" icon-id="mesh_hypo_length.png" tooltip-id="Length From Edges Hypothesis" accel-id="" toggle-id="" execute-action=""/>
<separatorTB/>
<toolbutton-item item-id="5000" label-id="Wire Discretisation" icon-id="mesh_algo_regular.png" tooltip-id="Wire Discratisation Algorithm" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="5010" label-id="Triangle (Mefisto)" icon-id="mesh_algo_mefisto.png" tooltip-id="Triangle (Mefisto) Algorithm" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="5011" label-id="Quadrangle (Mapping)" icon-id="mesh_algo_quad.png" tooltip-id="Quadrangle (Mapping) Algorithm" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="5020" label-id="Hexahedron (i,j,k)" icon-id="mesh_algo_hexa.png" tooltip-id="Hexahedron (i,j,k) Algorithm" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="5021" label-id="Tetrahedron (Netgen)" icon-id="mesh_algo_hexa.png" tooltip-id="Tetrahedron (Netgen) Delaunay Algorithm" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="5000" label-id="Create Hypotheses" icon-id="mesh_hypo_length.png" tooltip-id="Create Hypotheses" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="5010" label-id="Create Algorithms" icon-id="mesh_algo_mefisto.png" tooltip-id="Create Algorithms" accel-id="" toggle-id="" execute-action=""/>
</toolbar>
<toolbar label-id="Controls toolbar">
<toolbutton-item item-id="6001" label-id="Length" icon-id="mesh_length.png" tooltip-id="Length" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="6002" label-id="Connectivity" icon-id="mesh_connectivity.png" tooltip-id="Connectivity" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="6003" label-id="Free borders" icon-id="mesh_free_edges.png" tooltip-id="Free borders" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="6004" label-id="Borders at multi-connection" icon-id="mesh_multi_edges.png" tooltip-id="Borders at multi-connection" accel-id="" toggle-id="" execute-action=""/>
<!--<toolbutton-item item-id="6002" label-id="Connectivity" icon-id="mesh_connectivity.png" tooltip-id="Connectivity" accel-id="" toggle-id="" execute-action=""/>-->
<toolbutton-item item-id="6011" label-id="Area" icon-id="mesh_area.png" tooltip-id="Area" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="6012" label-id="Taper" icon-id="mesh_taper.png" tooltip-id="Taper" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="6013" label-id="Aspect Ratio" icon-id="mesh_aspect.png" tooltip-id="Aspect Ratio" accel-id="" toggle-id="" execute-action=""/>
@ -233,16 +349,12 @@
<toolbar label-id="Modification toolbar">
<toolbutton-item item-id="405" label-id="Move Node" icon-id="mesh_move_node.png" tooltip-id="Move Node" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="806" label-id="Orientation" icon-id="mesh_orientation.png" tooltip-id="Orientation" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="807" label-id="Diagonal Inversion" icon-id="mesh_diagonal.png" tooltip-id="Diagonal Inversion" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="406" label-id="Orientation" icon-id="mesh_orientation.png" tooltip-id="Orientation" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="407" label-id="Diagonal Inversion" icon-id="mesh_diagonal.png" tooltip-id="Diagonal Inversion" accel-id="" toggle-id="" execute-action=""/>
</toolbar>
<toolbar label-id="Display Mode Toolbar">
<toolbutton-item item-id="214" pos-id="" label-id="Update" icon-id="mesh_update.png" tooltip-id="Update View" accel-id="" toggle-id="" execute-action=""/>
<separatorTB/>
<toolbutton-item item-id="211" pos-id="" label-id="Wireframe" icon-id="mesh_wireframe.png" tooltip-id="Wireframe" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="212" pos-id="" label-id="Shading" icon-id="mesh_shading.png" tooltip-id="shading" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="213" pos-id="" label-id="Shrink" icon-id="mesh_shrink.png" tooltip-id="shrink" accel-id="" toggle-id="" execute-action=""/>
</toolbar>
</desktop>

View File

@ -17,7 +17,7 @@
<submenu label-id="Import" item-id="11" pos-id="8">
<popup-item item-id="111" pos-id="" label-id="DAT file" icon-id="" tooltip-id="" accel-id="Ctrl+B" toggle-id="" execute-action=""/>
<popup-item item-id="112" pos-id="" label-id="UNV File" icon-id="" tooltip-id="" accel-id="Ctrl+I" toggle-id="" execute-action=""/>
<popup-item item-id="113" pos-id="" label-id="MED File" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="113" pos-id="" label-id="MED File" icon-id="" tooltip-id="" accel-id="Ctrl+M" toggle-id="" execute-action=""/>
</submenu>
<endsubmenu />
<submenu label-id="Export" item-id="12" pos-id="9">
@ -37,17 +37,8 @@
<!-- ************************** Hypothesis (menubar) ************************************ -->
<menu-item label-id="Hypotheses" item-id="50" pos-id="3">
<popup-item item-id="5030" pos-id="" label-id="Average length" icon-id="mesh_hypo_length.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="5031" pos-id="" label-id="Nb. Segments" icon-id="mesh_hypo_segment.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="5032" pos-id="" label-id="Max. Triangle Area" icon-id="mesh_hypo_area.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="5033" pos-id="" label-id="Max. Hexahedron or Tetrahedron Volume" icon-id="mesh_hypo_volume.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="5034" pos-id="" label-id="Length From Edges (2D Hyp. for Triangulator)" icon-id="mesh_hypo_length.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="5000" pos-id="" label-id="Wire discretisation" icon-id="mesh_algo_regular.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="5010" pos-id="" label-id="Triangle (Mefisto)" icon-id="mesh_algo_mefisto.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="5011" pos-id="" label-id="Quadrangle (Mapping)" icon-id="mesh_algo_quad.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="5020" pos-id="" label-id="Hexahedron (i,j,k)" icon-id="mesh_algo_hexa.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="5021" pos-id="" label-id="Tetrahedron (Netgen)" icon-id="mesh_algo_tetra.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="5000" pos-id="" label-id="Create Hypothesis" icon-id="mesh_hypo_length.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="5010" pos-id="" label-id="Create Algorithm" icon-id="mesh_algo_mefisto.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</menu-item>
<!-- ************************** Mesh (menubar) ************************************ -->
@ -58,6 +49,8 @@
<separator pos-id=""/>
<popup-item item-id="701" pos-id="" label-id="Compute" icon-id="mesh_compute.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="801" pos-id="" label-id="Create Group" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="900" pos-id="" label-id="Mesh Infos" icon-id="mesh_info.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</menu-item>
@ -90,8 +83,8 @@
</submenu>
<endsubmenu />
<popup-item item-id="405" pos-id="" label-id="Move Node" icon-id="mesh_move_node.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="806" pos-id="" label-id="Orientation" icon-id="mesh_orientation.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="807" pos-id="" label-id="Diagonal Inversion" icon-id="mesh_diagonal.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="406" pos-id="" label-id="Orientation" icon-id="mesh_orientation.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="407" pos-id="" label-id="Diagonal Inversion" icon-id="mesh_diagonal.png" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</menu-item>
<!-- ************************** Numbering (menubar) ************************************ -->
@ -111,7 +104,7 @@
<endsubmenu />
<popup-item item-id="1001" pos-id="" label-id="Automatic Update" icon-id="" tooltip-id="" accel-id="" toggle-id="false" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="1003" pos-id="" label-id="Colors - Size" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="1003" pos-id="" label-id="Colors - Size" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="1005" pos-id="" label-id="Scalars Bar" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</submenu>
@ -139,11 +132,15 @@
<popup-item item-id="701" pos-id="" label-id="Compute" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="214" pos-id="" label-id="Update" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="801" pos-id="" label-id="Create Group" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="1101" pos-id="" label-id="Rename" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</popupmenu>
<popupmenu label-id="Popup for ObjectBrowser" context-id="" parent-id="ObjectBrowser" object-id="SubMesh">
<popup-item item-id="706" pos-id="" label-id="Edit Local Hyp." icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
<popup-item item-id="802" pos-id="" label-id="Construct Group" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</popupmenu>
<popupmenu label-id="Popup for ObjectBrowser" context-id="" parent-id="ObjectBrowser" object-id="Hypothesis">
@ -151,13 +148,13 @@
<popup-item item-id="1102" pos-id="" label-id="Unassign Hyp." icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="1101" pos-id="" label-id="Rename" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</popupmenu>
<popupmenu label-id="Popup for ObjectBrowser" context-id="" parent-id="ObjectBrowser" object-id="Algorithm">
<popup-item item-id="1102" pos-id="" label-id="Unassign Algo." icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<popup-item item-id="1101" pos-id="" label-id="Rename" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
</popupmenu>
<popupmenu label-id="Popup for Viewer" context-id="" parent-id="Viewer" object-id="Mesh">
<popup-item item-id="214" pos-id="" label-id="Update" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
<separator pos-id=""/>
@ -195,17 +192,8 @@
</toolbar>
<toolbar label-id="Hypotheses Toolbar">
<toolbutton-item item-id="5030" label-id="Average length" icon-id="mesh_hypo_length.png" tooltip-id="Avreage length Hypothesis" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="5031" label-id="Segments" icon-id="mesh_hypo_segment.png" tooltip-id="Nb. Segments Hypothesis" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="5032" label-id="Max. Triangle Area" icon-id="mesh_hypo_area.png" tooltip-id="Max. Triangle Area Hypothesis" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="5033" label-id="Max. Hexahedron or Tetrahedron Volume" icon-id="mesh_hypo_volume.png" tooltip-id="Max. Hexahedron or Tetrahedron Volume Hypothesis" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="5034" label-id="Length From Edges (2D Hyp. for Triangulator)" icon-id="mesh_hypo_length.png" tooltip-id="Length From Edges Hypothesis" accel-id="" toggle-id="" execute-action=""/>
<separatorTB/>
<toolbutton-item item-id="5000" label-id="Wire Discretisation" icon-id="mesh_algo_regular.png" tooltip-id="Wire Discratisation Algorithm" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="5010" label-id="Triangle (Mefisto)" icon-id="mesh_algo_mefisto.png" tooltip-id="Triangle (Mefisto) Algorithm" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="5011" label-id="Quadrangle (Mapping)" icon-id="mesh_algo_quad.png" tooltip-id="Quadrangle (Mapping) Algorithm" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="5020" label-id="Hexahedron (i,j,k)" icon-id="mesh_algo_hexa.png" tooltip-id="Hexahedron (i,j,k) Algorithm" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="5021" label-id="Tetrahedron (Netgen)" icon-id="mesh_algo_hexa.png" tooltip-id="Tetrahedron (Netgen) Delaunay Algorithm" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="5000" label-id="Create Hypothesis" icon-id="mesh_hypo_length.png" tooltip-id="Create Hypothesis" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="5010" label-id="Create Algorithm" icon-id="mesh_algo_mefisto.png" tooltip-id="Create Algorithm" accel-id="" toggle-id="" execute-action=""/>
</toolbar>
<toolbar label-id="Controls toolbar">
@ -233,8 +221,8 @@
<toolbar label-id="Modification toolbar">
<toolbutton-item item-id="405" label-id="Move Node" icon-id="mesh_move_node.png" tooltip-id="Move Node" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="806" label-id="Orientation" icon-id="mesh_orientation.png" tooltip-id="Orientation" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="807" label-id="Diagonal Inversion" icon-id="mesh_diagonal.png" tooltip-id="Diagonal Inversion" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="406" label-id="Orientation" icon-id="mesh_orientation.png" tooltip-id="Orientation" accel-id="" toggle-id="" execute-action=""/>
<toolbutton-item item-id="407" label-id="Diagonal Inversion" icon-id="mesh_diagonal.png" tooltip-id="Diagonal Inversion" accel-id="" toggle-id="" execute-action=""/>
</toolbar>
<toolbar label-id="Display Mode Toolbar">

78
resources/StdMeshers.xml Normal file
View File

@ -0,0 +1,78 @@
<?xml version='1.0' encoding='us-ascii'?>
<!DOCTYPE meshers PUBLIC "" "desktop.dtd">
<!-- GUI customization for MESH component -->
<meshers>
<meshers-group name="Standard Meshers"
resources="StdMeshers"
server-lib="libStdMeshersEngine.so"
gui-lib="libStdMeshersGUI.so">
<hypotheses>
<hypothesis type="LocalLength"
label-id="Average length"
icon-id="mesh_hypo_length.png"/>
<hypothesis type="LengthFromEdges"
label-id="Length From Edges (2D Hyp. for Triangulator)"
icon-id="mesh_hypo_length.png"/>
<hypothesis type="NumberOfSegments"
label-id="Nb. Segments"
icon-id="mesh_hypo_segment.png"/>
<hypothesis type="MaxElementArea"
label-id="Max. Triangle Area"
icon-id="mesh_hypo_area.png"/>
<hypothesis type="MaxElementVolume"
label-id="Max. Hexahedron or Tetrahedron Volume"
icon-id="mesh_hypo_volume.png"/>
<hypothesis type="NotConformAllowed"
label-id="Not Conform Mesh Allowed"
icon-id="mesh_hypo_length.png"/>
</hypotheses>
<algorithms>
<algorithm type="Regular_1D"
label-id="Wire discretisation"
icon-id="mesh_algo_regular.png"/>
<algorithm type="MEFISTO_2D"
label-id="Triangle (Mefisto)"
icon-id="mesh_algo_mefisto.png"/>
<algorithm type="Quadrangle_2D"
label-id="Quadrangle (Mapping)"
icon-id="mesh_algo_quad.png"/>
<algorithm type="Hexa_3D"
label-id="Hexahedron (i,j,k)"
icon-id="mesh_algo_hexa.png"/>
</algorithms>
</meshers-group>
<meshers-group name="Your Meshers Group"
resources=""
server-lib=""
gui-lib="">
<hypotheses>
<hypothesis type=""
label-id=""
icon-id=""/>
</hypotheses>
<algorithms>
<algorithm type=""
label-id=""
icon-id=""/>
</algorithms>
</meshers-group>
</meshers>

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 B

BIN
resources/mesh_free_edges.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 B

BIN
resources/mesh_multi_edges.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 480 B

BIN
resources/mesh_points.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 912 B

50
src/Controls/Makefile.in Normal file
View File

@ -0,0 +1,50 @@
# SMESH OBJECT : interactive object for SMESH visualization
#
# 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
# Module : SMESH
top_srcdir=@top_srcdir@
top_builddir=../..
srcdir=@srcdir@
VPATH=.:@srcdir@:@top_srcdir@/idl:$(top_builddir)/idl
@COMMENCE@
EXPORT_HEADERS = SMESH_Controls.hxx
# Libraries targets
LIB = libSMESHControls.la
LIB_SRC = SMESH_Controls.cxx
# Executables targets
BIN = SMESHControls
BIN_SRC =
CPPFLAGS+=$(OCC_INCLUDES) $(BOOST_CPPFLAGS)
LDFLAGS+=$(OCC_KERNEL_LIBS) -L${KERNEL_ROOT_DIR}/lib/salome -lOpUtil -lSMDS
@CONCLUDE@

View File

@ -0,0 +1,42 @@
// 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
#include "SMESH_Controls.hxx"
int main(int argc, char** argv)
{
using namespace SMESH::Controls;
new MinimumAngle();
new AspectRatio();
new Warping();
new Taper();
new Skew();
new Area();
new Length();
new MultiConnection();
new FreeBorders();
new LessThan();
new MoreThan();
new EqualTo();
new LogicalNOT();
new LogicalAND();
new LogicalOR();
return 1;
}

View File

@ -0,0 +1,774 @@
// 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
#include <set>
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <gp_XYZ.hxx>
#include <Precision.hxx>
#include <TColgp_SequenceOfXYZ.hxx>
#include <TColStd_MapOfInteger.hxx>
#include "SMDS_Mesh.hxx"
#include "SMDS_Iterator.hxx"
#include "SMDS_MeshElement.hxx"
#include "SMDS_MeshNode.hxx"
#include "SMESH_Controls.hxx"
/*
AUXILIARY METHODS
*/
static inline double getAngle( const gp_XYZ& P1, const gp_XYZ& P2, const gp_XYZ& P3 )
{
return gp_Vec( P1 - P2 ).Angle( gp_Vec( P3 - P2 ) );
}
static inline double getArea( const gp_XYZ& P1, const gp_XYZ& P2, const gp_XYZ& P3 )
{
gp_Vec aVec1( P2 - P1 );
gp_Vec aVec2( P3 - P1 );
return ( aVec1 ^ aVec2 ).Magnitude() * 0.5;
}
static inline double getArea( const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3 )
{
return getArea( P1.XYZ(), P2.XYZ(), P3.XYZ() );
}
static inline double getDistance( const gp_XYZ& P1, const gp_XYZ& P2 )
{
double aDist = gp_Pnt( P1 ).Distance( gp_Pnt( P2 ) );
return aDist;
}
static int getNbMultiConnection( SMDS_Mesh* theMesh, const int theId )
{
if ( theMesh == 0 )
return 0;
const SMDS_MeshElement* anEdge = theMesh->FindElement( theId );
if ( anEdge == 0 || anEdge->GetType() != SMDSAbs_Edge || anEdge->NbNodes() != 2 )
return 0;
TColStd_MapOfInteger aMap;
int aResult = 0;
SMDS_ElemIteratorPtr anIter = anEdge->nodesIterator();
if ( anIter != 0 )
{
while( anIter->more() )
{
const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next();
if ( aNode == 0 )
return 0;
SMDS_ElemIteratorPtr anElemIter = aNode->GetInverseElementIterator();
while( anElemIter->more() )
{
const SMDS_MeshElement* anElem = anElemIter->next();
if ( anElem != 0 && anElem->GetType() != SMDSAbs_Edge )
{
int anId = anElem->GetID();
if ( anIter->more() ) // i.e. first node
aMap.Add( anId );
else if ( aMap.Contains( anId ) )
aResult++;
}
}
}
}
return aResult;
}
using namespace SMESH::Controls;
/*
FUNCTORS
*/
/*
Class : NumericalFunctor
Description : Base class for numerical functors
*/
NumericalFunctor::NumericalFunctor():
myMesh(NULL)
{}
void NumericalFunctor::SetMesh( SMDS_Mesh* theMesh )
{
myMesh = theMesh;
}
bool NumericalFunctor::getPoints( const int theId,
TColgp_SequenceOfXYZ& theRes ) const
{
theRes.Clear();
if ( myMesh == 0 )
return false;
// Get nodes of the face
const SMDS_MeshElement* anElem = myMesh->FindElement( theId );
if ( anElem == 0 || anElem->GetType() != GetType() )
return false;
int nbNodes = anElem->NbNodes();
SMDS_ElemIteratorPtr anIter = anElem->nodesIterator();
if ( anIter != 0 )
{
while( anIter->more() )
{
const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next();
if ( aNode != 0 )
theRes.Append( gp_XYZ( aNode->X(), aNode->Y(), aNode->Z() ) );
}
}
return true;
}
/*
Class : MinimumAngle
Description : Functor for calculation of minimum angle
*/
double MinimumAngle::GetValue( long theId )
{
TColgp_SequenceOfXYZ P;
if ( !getPoints( theId, P ) || P.Length() != 3 && P.Length() != 4 )
return 0;
double aMin;
if ( P.Length() == 3 )
{
double A0 = getAngle( P( 3 ), P( 1 ), P( 2 ) );
double A1 = getAngle( P( 1 ), P( 2 ), P( 3 ) );
double A2 = getAngle( P( 2 ), P( 3 ), P( 1 ) );
aMin = Min( A0, Min( A1, A2 ) );
}
else
{
double A0 = getAngle( P( 4 ), P( 1 ), P( 2 ) );
double A1 = getAngle( P( 1 ), P( 2 ), P( 3 ) );
double A2 = getAngle( P( 2 ), P( 3 ), P( 4 ) );
double A3 = getAngle( P( 3 ), P( 4 ), P( 1 ) );
aMin = Min( Min( A0, A1 ), Min( A2, A3 ) );
}
return aMin * 180 / PI;
}
SMDSAbs_ElementType MinimumAngle::GetType() const
{
return SMDSAbs_Face;
}
/*
Class : AspectRatio
Description : Functor for calculating aspect ratio
*/
double AspectRatio::GetValue( long theId )
{
TColgp_SequenceOfXYZ P;
if ( !getPoints( theId, P ) || P.Length() != 3 && P.Length() != 4 )
return 0;
int nbNodes = P.Length();
// Compute lengths of the sides
double aLen[ nbNodes ];
for ( int i = 0; i < nbNodes - 1; i++ )
aLen[ i ] = getDistance( P( i + 1 ), P( i + 2 ) );
aLen[ nbNodes - 1 ] = getDistance( P( 1 ), P( nbNodes ) );
// Compute aspect ratio
if ( nbNodes == 3 )
{
double aMaxLen = Max( aLen[ 0 ], Max( aLen[ 1 ], aLen[ 2 ] ) );
double anArea = getArea( P( 1 ), P( 2 ), P( 3 ) );
static double aCoef = sqrt( 3. ) / 4;
return anArea != 0 ? aCoef * aMaxLen * aMaxLen / anArea : 0;
}
else
{
double aMaxLen = Max( Max( aLen[ 0 ], aLen[ 1 ] ), Max( aLen[ 2 ], aLen[ 3 ] ) );
double aMinLen = Min( Min( aLen[ 0 ], aLen[ 1 ] ), Min( aLen[ 2 ], aLen[ 3 ] ) );
return aMinLen != 0 ? aMaxLen / aMinLen : 0;
}
}
SMDSAbs_ElementType AspectRatio::GetType() const
{
return SMDSAbs_Face;
}
/*
Class : Warping
Description : Functor for calculating warping
*/
double Warping::GetValue( long theId )
{
TColgp_SequenceOfXYZ P;
if ( !getPoints( theId, P ) || P.Length() != 4 )
return 0;
gp_XYZ G = ( P( 1 ) + P( 2 ) + P( 3 ) + P( 4 ) ) / 4;
double A1 = ComputeA( P( 1 ), P( 2 ), P( 3 ), G );
double A2 = ComputeA( P( 2 ), P( 3 ), P( 4 ), G );
double A3 = ComputeA( P( 3 ), P( 4 ), P( 1 ), G );
double A4 = ComputeA( P( 4 ), P( 1 ), P( 2 ), G );
return Max( Max( A1, A2 ), Max( A3, A4 ) );
}
double Warping::ComputeA( const gp_XYZ& thePnt1,
const gp_XYZ& thePnt2,
const gp_XYZ& thePnt3,
const gp_XYZ& theG ) const
{
double aLen1 = gp_Pnt( thePnt1 ).Distance( gp_Pnt( thePnt2 ) );
double aLen2 = gp_Pnt( thePnt2 ).Distance( gp_Pnt( thePnt3 ) );
double L = Min( aLen1, aLen2 ) * 0.5;
gp_XYZ GI = ( thePnt2 - thePnt1 ) / 2. - theG;
gp_XYZ GJ = ( thePnt3 - thePnt2 ) / 2. - theG;
gp_XYZ N = GI.Crossed( GJ );
N.Normalize();
double H = gp_Vec( thePnt2 - theG ).Dot( gp_Vec( N ) );
return asin( fabs( H / L ) ) * 180 / PI;
}
SMDSAbs_ElementType Warping::GetType() const
{
return SMDSAbs_Face;
}
/*
Class : Taper
Description : Functor for calculating taper
*/
double Taper::GetValue( long theId )
{
TColgp_SequenceOfXYZ P;
if ( !getPoints( theId, P ) || P.Length() != 4 )
return 0;
// Compute taper
double J1 = getArea( P( 4 ), P( 1 ), P( 2 ) ) / 2;
double J2 = getArea( P( 3 ), P( 1 ), P( 2 ) ) / 2;
double J3 = getArea( P( 2 ), P( 3 ), P( 4 ) ) / 2;
double J4 = getArea( P( 3 ), P( 4 ), P( 1 ) ) / 2;
double JA = 0.25 * ( J1 + J2 + J3 + J4 );
double T1 = fabs( ( J1 - JA ) / JA );
double T2 = fabs( ( J2 - JA ) / JA );
double T3 = fabs( ( J3 - JA ) / JA );
double T4 = fabs( ( J4 - JA ) / JA );
return Max( Max( T1, T2 ), Max( T3, T4 ) );
}
SMDSAbs_ElementType Taper::GetType() const
{
return SMDSAbs_Face;
}
/*
Class : Skew
Description : Functor for calculating skew in degrees
*/
static inline double skewAngle( const gp_XYZ& p1, const gp_XYZ& p2, const gp_XYZ& p3 )
{
gp_XYZ p12 = ( p2 + p1 ) / 2;
gp_XYZ p23 = ( p3 + p2 ) / 2;
gp_XYZ p31 = ( p3 + p1 ) / 2;
return gp_Vec( p31 - p2 ).Angle( p12 - p23 );
}
double Skew::GetValue( long theId )
{
TColgp_SequenceOfXYZ P;
if ( !getPoints( theId, P ) || P.Length() != 3 && P.Length() != 4 )
return 0;
// Compute skew
static double PI2 = PI / 2;
if ( P.Length() == 3 )
{
double A0 = fabs( PI2 - skewAngle( P( 3 ), P( 1 ), P( 2 ) ) );
double A1 = fabs( PI2 - skewAngle( P( 1 ), P( 2 ), P( 3 ) ) );
double A2 = fabs( PI2 - skewAngle( P( 2 ), P( 3 ), P( 1 ) ) );
return Max( A0, Max( A1, A2 ) ) * 180 / PI;
}
else
{
gp_XYZ p12 = ( P( 1 ) + P( 2 ) ) / 2;
gp_XYZ p23 = ( P( 2 ) + P( 3 ) ) / 2;
gp_XYZ p34 = ( P( 3 ) + P( 4 ) ) / 2;
gp_XYZ p41 = ( P( 4 ) + P( 1 ) ) / 2;
double A = fabs( PI2 - gp_Vec( p34 - p12 ).Angle( p23 - p41 ) );
return A * 180 / PI;
}
}
SMDSAbs_ElementType Skew::GetType() const
{
return SMDSAbs_Face;
}
/*
Class : Area
Description : Functor for calculating area
*/
double Area::GetValue( long theId )
{
TColgp_SequenceOfXYZ P;
if ( !getPoints( theId, P ) || P.Length() != 3 && P.Length() != 4 )
return 0;
if ( P.Length() == 3 )
return getArea( P( 1 ), P( 2 ), P( 3 ) );
else
return getArea( P( 1 ), P( 2 ), P( 3 ) ) + getArea( P( 1 ), P( 3 ), P( 4 ) );
}
SMDSAbs_ElementType Area::GetType() const
{
return SMDSAbs_Face;
}
/*
Class : Length
Description : Functor for calculating length off edge
*/
double Length::GetValue( long theId )
{
TColgp_SequenceOfXYZ P;
return getPoints( theId, P ) && P.Length() == 2 ? getDistance( P( 1 ), P( 2 ) ) : 0;
}
SMDSAbs_ElementType Length::GetType() const
{
return SMDSAbs_Edge;
}
/*
Class : MultiConnection
Description : Functor for calculating number of faces conneted to the edge
*/
double MultiConnection::GetValue( long theId )
{
return getNbMultiConnection( myMesh, theId );
}
SMDSAbs_ElementType MultiConnection::GetType() const
{
return SMDSAbs_Edge;
}
/*
PREDICATES
*/
/*
Class : FreeBorders
Description : Predicate for free borders
*/
FreeBorders::FreeBorders()
{
myMesh = 0;
}
void FreeBorders::SetMesh( SMDS_Mesh* theMesh )
{
myMesh = theMesh;
}
bool FreeBorders::IsSatisfy( long theId )
{
return getNbMultiConnection( myMesh, theId ) == 1;
}
SMDSAbs_ElementType FreeBorders::GetType() const
{
return SMDSAbs_Edge;
}
/*
Class : FreeEdges
Description : Predicate for free Edges
*/
FreeEdges::FreeEdges()
{
myMesh = 0;
}
void FreeEdges::SetMesh( SMDS_Mesh* theMesh )
{
myMesh = theMesh;
}
bool FreeEdges::IsSatisfy( long theId )
{
return getNbMultiConnection( myMesh, theId ) == 1;
}
SMDSAbs_ElementType FreeEdges::GetType() const
{
return SMDSAbs_Face;
}
FreeEdges::Border::Border(long thePntId1, long thePntId2){
PntId[0] = thePntId1; PntId[1] = thePntId2;
if(thePntId1 > thePntId2){
PntId[1] = thePntId1; PntId[0] = thePntId2;
}
}
//bool operator<(const FreeEdges::Border& x, const FreeEdges::Border& y){
// if(x.PntId[0] < y.PntId[0]) return true;
// if(x.PntId[0] == y.PntId[0])
// if(x.PntId[1] < y.PntId[1]) return true;
// return false;
//}
namespace SMESH{
namespace Controls{
struct EdgeBorder: public FreeEdges::Border{
long ElemId;
EdgeBorder(long theElemId, long thePntId1, long thePntId2):
FreeEdges::Border(thePntId1,thePntId2),
ElemId(theElemId)
{}
};
bool operator<(const FreeEdges::Border& x, const FreeEdges::Border& y){
if(x.PntId[0] < y.PntId[0]) return true;
if(x.PntId[0] == y.PntId[0])
if(x.PntId[1] < y.PntId[1]) return true;
return false;
}
typedef std::set<EdgeBorder> EdgeBorderS;
inline void UpdateBorders(const EdgeBorder& theBorder,
EdgeBorderS& theRegistry,
EdgeBorderS& theContainer)
{
if(theRegistry.find(theBorder) == theRegistry.end()){
theRegistry.insert(theBorder);
theContainer.insert(theBorder);
}else{
theContainer.erase(theBorder);
}
}
}
}
void FreeEdges::GetBoreders(Borders& theBorders)
{
EdgeBorderS aRegistry;
EdgeBorderS aContainer;
SMDS_FaceIteratorPtr anIter = myMesh->facesIterator();
for(; anIter->more(); ){
const SMDS_MeshFace* anElem = anIter->next();
long anElemId = anElem->GetID();
SMDS_ElemIteratorPtr aNodesIter = anElem->nodesIterator();
long aNodeId[2];
const SMDS_MeshElement* aNode;
if(aNodesIter->more()){
aNode = aNodesIter->next();
aNodeId[0] = aNodeId[1] = aNode->GetID();
}
for(; aNodesIter->more(); ){
aNode = aNodesIter->next();
EdgeBorder aBorder(anElemId,aNodeId[1],aNode->GetID());
aNodeId[1] = aNode->GetID();
//std::cout<<aBorder.PntId[0]<<"; "<<aBorder.PntId[1]<<"; "<<aBorder.ElemId<<"\n";
UpdateBorders(aBorder,aRegistry,aContainer);
}
EdgeBorder aBorder(anElemId,aNodeId[0],aNodeId[1]);
UpdateBorders(aBorder,aRegistry,aContainer);
}
//std::cout<<"aContainer.size() = "<<aContainer.size()<<"\n";
if(aContainer.size()){
EdgeBorderS::const_iterator anIter = aContainer.begin();
for(; anIter != aContainer.end(); anIter++){
const EdgeBorder& aBorder = *anIter;
//std::cout<<aBorder.PntId[0]<<"; "<<aBorder.PntId[1]<<"; "<<aBorder.ElemId<<"\n";
theBorders.insert(Borders::value_type(aBorder.ElemId,aBorder));
}
}
}
/*
Class : Comparator
Description : Base class for comparators
*/
Comparator::Comparator():
myMargin(0)
{}
Comparator::~Comparator()
{}
void Comparator::SetMesh( SMDS_Mesh* theMesh )
{
if ( myFunctor )
myFunctor->SetMesh( theMesh );
}
void Comparator::SetMargin( double theValue )
{
myMargin = theValue;
}
void Comparator::SetNumFunctor( NumericalFunctorPtr theFunct )
{
myFunctor = theFunct;
}
SMDSAbs_ElementType Comparator::GetType() const
{
return myFunctor ? myFunctor->GetType() : SMDSAbs_All;
}
/*
Class : LessThan
Description : Comparator "<"
*/
bool LessThan::IsSatisfy( long theId )
{
return myFunctor && myFunctor->GetValue( theId ) < myMargin;
}
/*
Class : MoreThan
Description : Comparator ">"
*/
bool MoreThan::IsSatisfy( long theId )
{
return myFunctor && myFunctor->GetValue( theId ) > myMargin;
}
/*
Class : EqualTo
Description : Comparator "="
*/
EqualTo::EqualTo():
myToler(Precision::Confusion())
{}
bool EqualTo::IsSatisfy( long theId )
{
return myFunctor && fabs( myFunctor->GetValue( theId ) - myMargin ) < myToler;
}
void EqualTo::SetTolerance( double theToler )
{
myToler = theToler;
}
/*
Class : LogicalNOT
Description : Logical NOT predicate
*/
LogicalNOT::LogicalNOT()
{}
LogicalNOT::~LogicalNOT()
{}
bool LogicalNOT::IsSatisfy( long theId )
{
return myPredicate && !myPredicate->IsSatisfy( theId );
}
void LogicalNOT::SetMesh( SMDS_Mesh* theMesh )
{
if ( myPredicate )
myPredicate->SetMesh( theMesh );
}
void LogicalNOT::SetPredicate( PredicatePtr thePred )
{
myPredicate = thePred;
}
SMDSAbs_ElementType LogicalNOT::GetType() const
{
return myPredicate ? myPredicate->GetType() : SMDSAbs_All;
}
/*
Class : LogicalBinary
Description : Base class for binary logical predicate
*/
LogicalBinary::LogicalBinary()
{}
LogicalBinary::~LogicalBinary()
{}
void LogicalBinary::SetMesh( SMDS_Mesh* theMesh )
{
if ( myPredicate1 )
myPredicate1->SetMesh( theMesh );
if ( myPredicate2 )
myPredicate2->SetMesh( theMesh );
}
void LogicalBinary::SetPredicate1( PredicatePtr thePredicate )
{
myPredicate1 = thePredicate;
}
void LogicalBinary::SetPredicate2( PredicatePtr thePredicate )
{
myPredicate2 = thePredicate;
}
SMDSAbs_ElementType LogicalBinary::GetType() const
{
if ( !myPredicate1 || !myPredicate2 )
return SMDSAbs_All;
SMDSAbs_ElementType aType1 = myPredicate1->GetType();
SMDSAbs_ElementType aType2 = myPredicate2->GetType();
return aType1 == aType2 ? aType1 : SMDSAbs_All;
}
/*
Class : LogicalAND
Description : Logical AND
*/
bool LogicalAND::IsSatisfy( long theId )
{
return
myPredicate1 &&
myPredicate2 &&
myPredicate1->IsSatisfy( theId ) &&
myPredicate2->IsSatisfy( theId );
}
/*
Class : LogicalOR
Description : Logical OR
*/
bool LogicalOR::IsSatisfy( long theId )
{
return
myPredicate1 &&
myPredicate2 &&
myPredicate1->IsSatisfy( theId ) ||
myPredicate2->IsSatisfy( theId );
}
/*
FILTER
*/
Filter::Filter()
{}
Filter::~Filter()
{}
void Filter::SetPredicate( PredicatePtr thePredicate )
{
myPredicate = thePredicate;
}
Filter::TIdSequence
Filter::GetElementsId( SMDS_Mesh* theMesh )
{
TIdSequence aSequence;
if ( !theMesh || !myPredicate ) return aSequence;
myPredicate->SetMesh( theMesh );
SMDSAbs_ElementType aType = myPredicate->GetType();
switch(aType){
case SMDSAbs_Edge:{
SMDS_EdgeIteratorPtr anIter = theMesh->edgesIterator();
if ( anIter != 0 ) {
while( anIter->more() ) {
const SMDS_MeshElement* anElem = anIter->next();
long anId = anElem->GetID();
if ( myPredicate->IsSatisfy( anId ) )
aSequence.push_back( anId );
}
}
}
case SMDSAbs_Face:{
SMDS_FaceIteratorPtr anIter = theMesh->facesIterator();
if ( anIter != 0 ) {
while( anIter->more() ) {
const SMDS_MeshElement* anElem = anIter->next();
long anId = anElem->GetID();
if ( myPredicate->IsSatisfy( anId ) )
aSequence.push_back( anId );
}
}
}
}
return aSequence;
}

View File

@ -0,0 +1,340 @@
// 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
#ifndef _SMESH_CONTROLS_HXX_
#define _SMESH_CONTROLS_HXX_
#include <map>
#include <vector>
#include <boost/shared_ptr.hpp>
#include "SMDSAbs_ElementType.hxx"
class SMDS_Mesh;
class gp_Pnt;
class gp_XYZ;
class TColgp_SequenceOfXYZ;
namespace SMESH{
namespace Controls{
class Functor{
public:
~Functor(){}
virtual void SetMesh( SMDS_Mesh* theMesh ) = 0;
};
typedef boost::shared_ptr<Functor> FunctorPtr;
class NumericalFunctor: public virtual Functor{
public:
NumericalFunctor();
virtual void SetMesh( SMDS_Mesh* theMesh );
virtual double GetValue( long theElementId ) = 0;
virtual SMDSAbs_ElementType GetType() const = 0;
protected:
bool getPoints( const int theId,
TColgp_SequenceOfXYZ& theRes ) const;
protected:
SMDS_Mesh* myMesh;
};
typedef boost::shared_ptr<NumericalFunctor> NumericalFunctorPtr;
/*
Class : SMESH_MinimumAngle
Description : Functor for calculation of minimum angle
*/
class MinimumAngle: public virtual NumericalFunctor{
public:
virtual double GetValue( long theElementId );
virtual SMDSAbs_ElementType GetType() const;
};
/*
Class : AspectRatio
Description : Functor for calculating aspect ratio
*/
class AspectRatio: public virtual NumericalFunctor{
public:
virtual double GetValue( long theElementId );
virtual SMDSAbs_ElementType GetType() const;
};
/*
Class : Warping
Description : Functor for calculating warping
*/
class Warping: public virtual NumericalFunctor{
public:
virtual double GetValue( long theElementId );
virtual SMDSAbs_ElementType GetType() const;
private:
double ComputeA( const gp_XYZ&, const gp_XYZ&,
const gp_XYZ&, const gp_XYZ& ) const;
};
/*
Class : Taper
Description : Functor for calculating taper
*/
class Taper: public virtual NumericalFunctor{
public:
virtual double GetValue( long theElementId );
virtual SMDSAbs_ElementType GetType() const;
};
/*
Class : Skew
Description : Functor for calculating skew in degrees
*/
class Skew: public virtual NumericalFunctor{
public:
virtual double GetValue( long theElementId );
virtual SMDSAbs_ElementType GetType() const;
};
/*
Class : Area
Description : Functor for calculating area
*/
class Area: public virtual NumericalFunctor{
public:
virtual double GetValue( long theElementId );
virtual SMDSAbs_ElementType GetType() const;
};
/*
Class : Length
Description : Functor for calculating length of edge
*/
class Length: public virtual NumericalFunctor{
public:
virtual double GetValue( long theElementId );
virtual SMDSAbs_ElementType GetType() const;
};
/*
Class : MultiConnection
Description : Functor for calculating number of faces conneted to the edge
*/
class MultiConnection: public virtual NumericalFunctor{
public:
virtual double GetValue( long theElementId );
virtual SMDSAbs_ElementType GetType() const;
};
/*
PREDICATES
*/
/*
Class : Predicate
Description : Base class for all predicates
*/
class Predicate: public virtual Functor{
public:
virtual bool IsSatisfy( long theElementId ) = 0;
virtual SMDSAbs_ElementType GetType() const = 0;
};
typedef boost::shared_ptr<Predicate> PredicatePtr;
/*
Class : FreeBorders
Description : Predicate for free borders
*/
class FreeBorders: public virtual Predicate{
public:
FreeBorders();
virtual void SetMesh( SMDS_Mesh* theMesh );
virtual bool IsSatisfy( long theElementId );
virtual SMDSAbs_ElementType GetType() const;
protected:
SMDS_Mesh* myMesh;
};
/*
Class : FreeEdges
Description : Predicate for free Edges
*/
class FreeEdges: public virtual Predicate{
public:
FreeEdges();
virtual void SetMesh( SMDS_Mesh* theMesh );
virtual bool IsSatisfy( long theElementId );
virtual SMDSAbs_ElementType GetType() const;
struct Border{
long PntId[2];
Border(long thePntId1, long thePntId2);
};
typedef long TElemId;
typedef std::map<TElemId,Border> Borders;
void GetBoreders(Borders& theBorders);
protected:
SMDS_Mesh* myMesh;
};
typedef boost::shared_ptr<FreeEdges> FreeEdgesPtr;
/*
Class : Comparator
Description : Base class for comparators
*/
class Comparator: public virtual Predicate{
public:
Comparator();
virtual ~Comparator();
virtual void SetMesh( SMDS_Mesh* theMesh );
virtual void SetMargin(double theValue);
virtual void SetNumFunctor(NumericalFunctorPtr theFunct);
virtual bool IsSatisfy( long theElementId ) = 0;
virtual SMDSAbs_ElementType GetType() const;
protected:
double myMargin;
NumericalFunctorPtr myFunctor;
};
typedef boost::shared_ptr<Comparator> ComparatorPtr;
/*
Class : LessThan
Description : Comparator "<"
*/
class LessThan: public virtual Comparator{
public:
virtual bool IsSatisfy( long theElementId );
};
/*
Class : MoreThan
Description : Comparator ">"
*/
class MoreThan: public virtual Comparator{
public:
virtual bool IsSatisfy( long theElementId );
};
/*
Class : EqualTo
Description : Comparator "="
*/
class EqualTo: public virtual Comparator{
public:
EqualTo();
virtual bool IsSatisfy( long theElementId );
virtual void SetTolerance( double theTol );
private:
double myToler;
};
typedef boost::shared_ptr<EqualTo> EqualToPtr;
/*
Class : LogicalNOT
Description : Logical NOT predicate
*/
class LogicalNOT: public virtual Predicate{
public:
LogicalNOT();
virtual ~LogicalNOT();
virtual bool IsSatisfy( long theElementId );
virtual void SetMesh( SMDS_Mesh* theMesh );
virtual void SetPredicate(PredicatePtr thePred);
virtual SMDSAbs_ElementType GetType() const;
private:
PredicatePtr myPredicate;
};
typedef boost::shared_ptr<LogicalNOT> LogicalNOTPtr;
/*
Class : LogicalBinary
Description : Base class for binary logical predicate
*/
class LogicalBinary: public virtual Predicate{
public:
LogicalBinary();
virtual ~LogicalBinary();
virtual void SetMesh( SMDS_Mesh* theMesh );
virtual void SetPredicate1(PredicatePtr thePred);
virtual void SetPredicate2(PredicatePtr thePred);
virtual SMDSAbs_ElementType GetType() const;
protected:
PredicatePtr myPredicate1;
PredicatePtr myPredicate2;
};
typedef boost::shared_ptr<LogicalBinary> LogicalBinaryPtr;
/*
Class : LogicalAND
Description : Logical AND
*/
class LogicalAND: public virtual LogicalBinary{
public:
virtual bool IsSatisfy( long theElementId );
};
/*
Class : LogicalOR
Description : Logical OR
*/
class LogicalOR: public virtual LogicalBinary{
public:
virtual bool IsSatisfy( long theElementId );
};
/*
FILTER
*/
class Filter{
public:
Filter();
virtual ~Filter();
virtual void SetPredicate(PredicatePtr thePred);
typedef std::vector<long> TIdSequence;
virtual TIdSequence GetElementsId( SMDS_Mesh* theMesh );
protected:
PredicatePtr myPredicate;
};
};
};
#endif

View File

@ -38,16 +38,3 @@ void Document_Reader::SetDocument(SMESHDS_Document * aDoc)
{
myDocument = aDoc;
}
void Document_Reader::Read()
{
int myMeshId = myDocument->NewMesh();
SMDS_Mesh * myMesh = myDocument->GetMesh(myMeshId);
myReader->SetMesh(myMesh);
myReader->SetFile(myFile);
myReader->Read();
}
Document_Reader::Document_Reader(Mesh_Reader* reader): myReader(reader)
{
}

View File

@ -28,22 +28,17 @@
#define _INCLUDE_DOCUMENT_READER
#include "SMESHDS_Document.hxx"
#include "Mesh_Reader.h"
#include <string>
class Document_Reader
{
public:
virtual void Read();
virtual void Read() = 0;
void SetFile(string);
void SetDocument(SMESHDS_Document *);
Document_Reader(Mesh_Reader*);
protected:
SMESHDS_Document * myDocument;
SMESHDS_Document * myDocument;
string myFile;
private:
Mesh_Reader* myReader;
};
#endif

View File

@ -18,9 +18,14 @@
// 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 : Document_Writer.cxx
// Module : SMESH
using namespace std;
#include "Document_Writer.h"
#include "utilities.h"
void Document_Writer::SetFile(string aFile)
{
@ -31,28 +36,3 @@ void Document_Writer::SetDocument(SMESHDS_Document * aDoc)
{
myDocument = aDoc;
}
void Document_Writer::Write()
{
SCRUTE(myFile);
SMESHDS_Mesh * myMesh;
int nb_of_meshes = myDocument->NbMeshes(); //voir avec Yves
SCRUTE(nb_of_meshes);
int numero = 0;
myDocument->InitMeshesIterator();
while(myDocument->MoreMesh())
{
numero++;
myMesh = myDocument->NextMesh();
myWriter->SetMesh(myMesh);
myWriter->SetFile(myFile);
myWriter->SetMeshId(numero);
myWriter->Add();
}
}
Document_Writer::Document_Writer(Mesh_Writer* writer): myWriter(writer)
{
}

View File

@ -28,21 +28,17 @@
#define _INCLUDE_DOCUMENT_WRITER
#include "SMESHDS_Document.hxx"
#include "Mesh_Writer.h"
#include <string>
class Document_Writer
{
public:virtual void Write();
public:virtual void Write() = 0;
void SetFile(string);
void SetDocument(SMESHDS_Document *);
Document_Writer(Mesh_Writer* );
protected:
SMESHDS_Document * myDocument;
protected: SMESHDS_Document * myDocument;
string myFile;
Mesh_Writer * myWriter;
};
#endif

View File

@ -0,0 +1,36 @@
// 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
#include "Driver_Document.h"
Driver_Document::Driver_Document():
myDocument(NULL)
{}
void Driver_Document::SetFile(const std::string& theFileName)
{
myFile = theFileName;
}
void Driver_Document::SetDocument(SMESHDS_Document * theDocument)
{
myDocument = theDocument;
}

View File

@ -0,0 +1,44 @@
// 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
#ifndef _INCLUDE_DRIVER_DOCUMENT
#define _INCLUDE_DRIVER_DOCUMENT
#include <string>
class SMESHDS_Document;
class Driver_Document
{
public:
Driver_Document();
virtual ~Driver_Document(){}
virtual void Perform() = 0;
void SetFile(const std::string& theFileName);
void SetDocument(SMESHDS_Document *theDocument);
protected:
SMESHDS_Document * myDocument;
std::string myFile;
};
#endif

View File

@ -0,0 +1,46 @@
// SMESH Driver : implementaion of driver for reading and writing
//
// 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 : Mesh_Reader.cxx
// Module : SMESH
#include "Driver_Mesh.h"
using namespace std;
Driver_Mesh::Driver_Mesh():
myFile(""),
myMeshId(-1)
{}
void Driver_Mesh::SetMeshId(int theMeshId)
{
myMeshId = theMeshId;
}
void Driver_Mesh::SetFile(const std::string& theFileName)
{
myFile = theFileName;
}

57
src/Driver/Driver_Mesh.h Normal file
View File

@ -0,0 +1,57 @@
// SMESH Driver : implementaion of driver for reading and writing
//
// 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 : Mesh_Reader.h
// Module : SMESH
#ifndef _INCLUDE_DRIVER_MESH
#define _INCLUDE_DRIVER_MESH
#include <string>
class Driver_Mesh
{
public:
Driver_Mesh();
virtual ~Driver_Mesh(){}
enum Status {
DRS_OK,
DRS_EMPTY, // a file contains no mesh with the given name
DRS_WARN_RENUMBER, // a file has overlapped ranges of element numbers,
// so the numbers from the file are ignored
DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data
DRS_FAIL // general failure (exception etc.)
};
virtual Status Perform() = 0;
void SetMeshId(int theMeshId);
void SetFile(const std::string& theFileName);
protected:
std::string myFile;
int myMeshId;
};
#endif

View File

@ -0,0 +1,31 @@
// 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
#include "Driver_SMDS_Mesh.h"
using namespace std;
Driver_SMDS_Mesh::Driver_SMDS_Mesh():
myMesh(NULL)
{}
void Driver_SMDS_Mesh::SetMesh(SMDS_Mesh *theMesh)
{
myMesh = theMesh;
}

View File

@ -0,0 +1,38 @@
// 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
#ifndef _INCLUDE_DRIVER_SMDS_MESH
#define _INCLUDE_DRIVER_SMDS_MESH
#include "Driver_Mesh.h"
class SMDS_Mesh;
class Driver_SMDS_Mesh: public Driver_Mesh
{
public:
Driver_SMDS_Mesh();
void SetMesh(SMDS_Mesh *theMesh);
protected:
SMDS_Mesh *myMesh;
};
#endif

View File

@ -0,0 +1,31 @@
// 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
#include "Driver_SMESHDS_Mesh.h"
using namespace std;
Driver_SMESHDS_Mesh::Driver_SMESHDS_Mesh():
myMesh(NULL)
{}
void Driver_SMESHDS_Mesh::SetMesh(SMESHDS_Mesh *theMesh)
{
myMesh = theMesh;
}

View File

@ -0,0 +1,38 @@
// 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
#ifndef _INCLUDE_DRIVER_SMESHDS_MESH
#define _INCLUDE_DRIVER_SMESHDS_MESH
#include "Driver_Mesh.h"
class SMESHDS_Mesh;
class Driver_SMESHDS_Mesh: public Driver_Mesh
{
public:
Driver_SMESHDS_Mesh();
void SetMesh(SMESHDS_Mesh *theMesh);
protected:
SMESHDS_Mesh *myMesh;
};
#endif

View File

@ -35,28 +35,18 @@ VPATH=.:@srcdir@
@COMMENCE@
# header files
EXPORT_HEADERS = \
SMESHDriver.h \
Document_Reader.h \
Document_Writer.h \
Mesh_Reader.h \
Mesh_Writer.h
EXPORT_HEADERS= Document_Reader.h Document_Writer.h Mesh_Reader.h Mesh_Writer.h
# Libraries targets
LIB = libMeshDriver.la
LIB_SRC = \
SMESHDriver.cxx \
Document_Reader.cxx \
Document_Writer.cxx
# Mesh_Reader.cxx \
# Mesh_Writer.cxx \
LIB_SRC = Document_Reader.cxx Document_Writer.cxx Mesh_Reader.cxx Mesh_Writer.cxx
LIB_CLIENT_IDL =
LIB_SERVER_IDL =
# additionnal information to compil and link file
CPPFLAGS += $(OCC_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
CPPFLAGS += $(OCC_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome $(BOOST_CPPFLAGS)
CXXFLAGS += $(OCC_CXXFLAGS) $(MED2_INCLUDES) -rdynamic -ldl -I${KERNEL_ROOT_DIR}/include/salome
LDFLAGS += $(MED2_LIBS) -lSMESHDS -lSMDS

View File

@ -1,4 +1,4 @@
// SMESH Driver : implementation of driver for reading and writing
// SMESH Driver : implementaion of driver for reading and writing
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@ -18,97 +18,122 @@
// 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 : SMESHDriver.cxx
// Module : SMESH
using namespace std;
#include "SMESHDriver.h"
#include <dlfcn.h>
#include <utilities.h>
Document_Reader* SMESHDriver::GetDocumentReader(string Extension)
{
// if there is not document reader in the driver create a default
// one with the mesh reader.
Document_Reader * docReader=
(Document_Reader*)getMeshDocumentDriver(Extension);
//A enlever
#include "DriverMED_R_SMESHDS_Document.h"
#include "DriverMED_R_SMESHDS_Mesh.h"
#include "DriverMED_R_SMDS_Mesh.h"
#include "DriverMED_W_SMESHDS_Document.h"
#include "DriverMED_W_SMESHDS_Mesh.h"
#include "DriverMED_W_SMDS_Mesh.h"
#include "DriverDAT_R_SMESHDS_Document.h"
#include "DriverDAT_R_SMESHDS_Mesh.h"
#include "DriverDAT_R_SMDS_Mesh.h"
#include "DriverDAT_W_SMESHDS_Document.h"
#include "DriverDAT_W_SMESHDS_Mesh.h"
#include "DriverDAT_W_SMDS_Mesh.h"
//
Document_Reader* SMESHDriver::GetDocumentReader(string Extension, string Class) {
if (Extension==string("MED")) {
DriverMED_R_SMESHDS_Document* myDriver = new DriverMED_R_SMESHDS_Document();
return (myDriver);
}
else if (Extension==string("DAT")) {
DriverDAT_R_SMESHDS_Document* myDriver = new DriverDAT_R_SMESHDS_Document();
return (myDriver);
}
else {
MESSAGE("No driver known for this extension");
return (Document_Reader*)NULL;
}
if(docReader==NULL)
{
Mesh_Reader * reader=GetMeshReader(Extension);
if(reader==NULL)
{
MESSAGE("No driver known for this extension");
return NULL;
}
return new Document_Reader(reader);
}
else return docReader;
}
Document_Writer* SMESHDriver::GetDocumentWriter(string Extension)
{
Mesh_Writer * writer=GetMeshWriter(Extension);
if(writer==NULL)
{
MESSAGE("No driver known for this extension");
return NULL;
}
return new Document_Writer(writer);
Document_Writer* SMESHDriver::GetDocumentWriter(string Extension, string Class) {
if (Extension==string("MED")) {
DriverMED_W_SMESHDS_Document* myDriver = new DriverMED_W_SMESHDS_Document();
return (myDriver);
}
else if (Extension==string("DAT")) {
DriverDAT_W_SMESHDS_Document* myDriver = new DriverDAT_W_SMESHDS_Document();
return (myDriver);
}
else {
MESSAGE("No driver known for this extension");
return (Document_Writer*)NULL;
}
}
Mesh_Reader* SMESHDriver::GetMeshReader(string extension)
{
void * driver = getMeshDriver(extension, string("Reader"));
return (Mesh_Reader*)driver;
Mesh_Reader* SMESHDriver::GetMeshReader(string Extension, string Class) {
if (Extension==string("MED")) {
if (strcmp(Class.c_str(),"SMESHDS_Mesh")==0) {
DriverMED_R_SMESHDS_Mesh* myDriver = new DriverMED_R_SMESHDS_Mesh();
return (myDriver);
}
else if (strcmp(Class.c_str(),"SMDS_Mesh")==0) {
DriverMED_R_SMDS_Mesh* myDriver = new DriverMED_R_SMDS_Mesh();
return (myDriver);
}
}
else if (Extension==string("DAT")) {
if (strcmp(Class.c_str(),"SMESHDS_Mesh")==0) {
DriverDAT_R_SMESHDS_Mesh* myDriver = new DriverDAT_R_SMESHDS_Mesh();
return (myDriver);
}
else if (strcmp(Class.c_str(),"SMDS_Mesh")==0) {
DriverDAT_R_SMDS_Mesh* myDriver = new DriverDAT_R_SMDS_Mesh();
return (myDriver);
}
}
}
Mesh_Writer* SMESHDriver::GetMeshWriter(string extension)
{
void * driver = getMeshDriver(extension, string("Writer"));
return (Mesh_Writer*)driver;
Mesh_Writer* SMESHDriver::GetMeshWriter(string Extension, string Class) {
if (Extension==string("MED")) {
if (strcmp(Class.c_str(),"SMESHDS_Mesh")==0) {
DriverMED_W_SMESHDS_Mesh* myDriver = new DriverMED_W_SMESHDS_Mesh();
return (myDriver);
}
else if (strcmp(Class.c_str(),"SMDS_Mesh")==0) {
DriverMED_W_SMDS_Mesh* myDriver = new DriverMED_W_SMDS_Mesh();
return (myDriver);
}
}
else if (Extension==string("DAT")) {
if (strcmp(Class.c_str(),"SMESHDS_Mesh")==0) {
DriverDAT_W_SMESHDS_Mesh* myDriver = new DriverDAT_W_SMESHDS_Mesh();
return (myDriver);
}
else if (strcmp(Class.c_str(),"SMDS_Mesh")==0) {
DriverDAT_W_SMDS_Mesh* myDriver = new DriverDAT_W_SMDS_Mesh();
return (myDriver);
}
}
}
void * SMESHDriver::getMeshDriver(string extension, string type)
{
string libName = string("libMeshDriver")+extension+string(".so");
void * handle = dlopen(libName.c_str(), RTLD_LAZY);
if(!handle)
{
cerr << dlerror() << endl;
return NULL;
}
else
{
void * (*factory)();
string symbol = string("SMESH_create")+extension+string("Mesh")+type;
factory = (void * (*)()) dlsym(handle, symbol.c_str());
if(factory==NULL)
{
cerr << dlerror() << endl;
return NULL;
}
else return factory();
}
}
void * SMESHDriver::getMeshDocumentDriver(string extension)
{
string libName = string("libMeshDriver")+extension+string(".so");
void * handle = dlopen(libName.c_str(), RTLD_LAZY);
if(!handle)
{
cerr << dlerror() << endl;
return NULL;
}
else
{
void * (*factory)();
string symbol = string("SMESH_create")+extension+string("DocumentReader");
factory = (void * (*)()) dlsym(handle, symbol.c_str());
if(factory==NULL)
{
cerr << dlerror() << endl;
return NULL;
}
else return factory();
}
}

View File

@ -32,17 +32,14 @@
#include "Mesh_Reader.h"
#include "Mesh_Writer.h"
class SMESHDriver
{
class SMESHDriver {
public :
static Document_Reader* GetDocumentReader(string Extension);
static Document_Writer* GetDocumentWriter(string Extension);
static Document_Reader* GetDocumentReader(string Extension, string Class);
static Document_Writer* GetDocumentWriter(string Extension, string Class);
static Mesh_Reader* GetMeshReader(string Extension);
static Mesh_Writer* GetMeshWriter(string Extension);
static Mesh_Reader* GetMeshReader(string Extension, string Class);
static Mesh_Writer* GetMeshWriter(string Extension, string Class);
private:
static void * getMeshDriver(string Extension, string type);
static void * getMeshDocumentDriver(string Extension);
};
#endif

View File

@ -0,0 +1,28 @@
// 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
#include "DriverDAT_R_SMDS_Mesh.h"
#include "DriverDAT_W_SMDS_Mesh.h"
int main(int argc, char** argv)
{
DriverDAT_R_SMDS_Mesh aR;
DriverDAT_W_SMDS_Mesh aW;
return 1;
}

View File

@ -24,21 +24,11 @@
// File : DriverDAT_R_SMDS_Mesh.cxx
// Module : SMESH
using namespace std;
#include "DriverDAT_R_SMDS_Mesh.h"
#include "utilities.h"
extern "C"
{
/**
* Factory function which will be called by SMESHDriver
*/
void * SMESH_createDATMeshReader()
{
return new DriverDAT_R_SMDS_Mesh();
}
}
DriverDAT_R_SMDS_Mesh::DriverDAT_R_SMDS_Mesh()
{
;

View File

@ -24,25 +24,17 @@
// File : DriverDAT_W_SMDS_Mesh.cxx
// Module : SMESH
using namespace std;
#include "DriverDAT_W_SMDS_Mesh.h"
#include "SMDS_MeshElement.hxx"
#include "SMDS_MeshNode.hxx"
#include "utilities.h"
extern "C"
{
/**
* Factory function which will be called by SMESHDriver
*/
void * SMESH_createDATMeshWriter()
{
return new DriverDAT_W_SMDS_Mesh();
}
}
DriverDAT_W_SMDS_Mesh::DriverDAT_W_SMDS_Mesh()
{
;
}
DriverDAT_W_SMDS_Mesh::~DriverDAT_W_SMDS_Mesh()
@ -72,12 +64,12 @@ void DriverDAT_W_SMDS_Mesh::SetMeshId(int aMeshId)
void DriverDAT_W_SMDS_Mesh::Add()
{
MESSAGE("Adding a mesh to a DAT document. As DAT do not support more than one mesh in a file, the previous mesh is deleted");
Write();
;
}
void DriverDAT_W_SMDS_Mesh::Write()
{
int nbNodes, nbCells;
int i;
@ -88,7 +80,7 @@ void DriverDAT_W_SMDS_Mesh::Write()
fprintf(stderr, ">> ERREUR : ouverture du fichier %s \n", file2Read);
exit(EXIT_FAILURE);
}
SCRUTE(myMesh);
/****************************************************************************
* NOMBRES D'OBJETS *
****************************************************************************/
@ -105,6 +97,9 @@ void DriverDAT_W_SMDS_Mesh::Write()
nb_of_faces = myMesh->NbFaces();
nb_of_volumes = myMesh->NbVolumes();
nbCells = nb_of_edges + nb_of_faces + nb_of_volumes;
SCRUTE(nb_of_edges);
SCRUTE(nb_of_faces);
SCRUTE(nb_of_volumes);
fprintf(stdout, "%d %d\n", nbNodes, nbCells);
fprintf(myFileId, "%d %d\n", nbNodes, nbCells);
@ -116,15 +111,14 @@ void DriverDAT_W_SMDS_Mesh::Write()
fprintf(stdout, "(* NOEUDS DU MAILLAGE : *)\n");
fprintf(stdout, "(************************)\n");
SMDS_Iterator<const SMDS_MeshNode *> * itNodes=myMesh->nodesIterator();
SMDS_NodeIteratorPtr itNodes=myMesh->nodesIterator();
while(itNodes->more())
{
const SMDS_MeshNode * node = itNodes->next();
fprintf(myFileId, "%d %e %e %e\n", node->GetID(), node->X(),
node->Y(), node->Z());
}
delete itNodes;
/****************************************************************************
* ECRITURE DES ELEMENTS *
****************************************************************************/
@ -133,10 +127,10 @@ void DriverDAT_W_SMDS_Mesh::Write()
fprintf(stdout, "(**************************)");
/* Ecriture des connectivites, noms, numeros des mailles */
SMDS_Iterator<const SMDS_MeshEdge*> * itEdges=myMesh->edgesIterator();
SMDS_EdgeIteratorPtr itEdges=myMesh->edgesIterator();
while(itEdges->more())
{
const SMDS_MeshEdge * elem = itEdges->next();
const SMDS_MeshElement * elem = itEdges->next();
switch (elem->NbNodes())
{
@ -152,15 +146,13 @@ void DriverDAT_W_SMDS_Mesh::Write()
}
}
SMDS_Iterator<const SMDS_MeshElement *> * itNodes=elem->nodesIterator();
while(itNodes->more())
fprintf(myFileId, "%d ", itNodes->next()->GetID());
SMDS_ElemIteratorPtr it=elem->nodesIterator();
while(it->more()) fprintf(myFileId, "%d ", it->next()->GetID());
fprintf(myFileId, "\n");
}
delete itEdges;
SMDS_Iterator<const SMDS_MeshFace *> * itFaces=myMesh->facesIterator();
SMDS_FaceIteratorPtr itFaces=myMesh->facesIterator();
while(itFaces->more())
{
const SMDS_MeshElement * elem = itFaces->next();
@ -184,16 +176,13 @@ void DriverDAT_W_SMDS_Mesh::Write()
}
}
SMDS_Iterator<const SMDS_MeshElement *> * itNodes=elem->nodesIterator();
while(itNodes->more())
fprintf(myFileId, "%d ", itNodes->next()->GetID());
delete itNodes;
SMDS_ElemIteratorPtr it=elem->nodesIterator();
while(it->more()) fprintf(myFileId, "%d ", it->next()->GetID());
fprintf(myFileId, "\n");
}
delete itFaces;
SMDS_Iterator<const SMDS_MeshVolume*> * itVolumes=myMesh->volumesIterator();
SMDS_VolumeIteratorPtr itVolumes=myMesh->volumesIterator();
while(itVolumes->more())
{
const SMDS_MeshElement * elem = itVolumes->next();
@ -207,14 +196,11 @@ void DriverDAT_W_SMDS_Mesh::Write()
}
}
SMDS_Iterator<const SMDS_MeshElement *> * itNodes=elem->nodesIterator();
while(itNodes->more())
fprintf(myFileId, "%d ", itNodes->next()->GetID());
delete itNodes;
SMDS_ElemIteratorPtr it=elem->nodesIterator();
while(it->more()) fprintf(myFileId, "%d ", it->next()->GetID());
fprintf(myFileId, "\n");
}
delete itVolumes;
fclose(myFileId);
}

View File

@ -125,14 +125,13 @@ void DriverDAT_W_SMESHDS_Mesh::Add()
fprintf(stdout, "(* NOEUDS DU MAILLAGE : *)\n");
fprintf(stdout, "(************************)\n");
SMDS_Iterator<const SMDS_MeshNode *> * itNodes=myMesh->nodesIterator();
SMDS_NodeIteratorPtr itNodes=myMesh->nodesIterator();
while(itNodes->more())
{
const SMDS_MeshNode * node = itNodes->next();
fprintf(myFileId, "%d %e %e %e\n", node->GetID(), node->X(),
node->Y(), node->Z());
}
delete itNodes;
/****************************************************************************
* ECRITURE DES ELEMENTS *
@ -142,7 +141,7 @@ void DriverDAT_W_SMESHDS_Mesh::Add()
fprintf(stdout, "(**************************)");
/* Ecriture des connectivites, noms, numeros des mailles */
SMDS_Iterator<const SMDS_MeshEdge*> * itEdges=myMesh->edgesIterator();
SMDS_EdgeIteratorPtr itEdges=myMesh->edgesIterator();
while(itEdges->more())
{
const SMDS_MeshEdge * elem = itEdges->next();
@ -161,15 +160,14 @@ void DriverDAT_W_SMESHDS_Mesh::Add()
}
}
SMDS_Iterator<const SMDS_MeshElement *> * itNodes=elem->nodesIterator();
SMDS_ElemIteratorPtr itNodes=elem->nodesIterator();
while(itNodes->more())
fprintf(myFileId, "%d ", itNodes->next()->GetID());
fprintf(myFileId, "\n");
}
delete itEdges;
SMDS_Iterator<const SMDS_MeshFace *> * itFaces=myMesh->facesIterator();
SMDS_FaceIteratorPtr itFaces=myMesh->facesIterator();
while(itFaces->more())
{
const SMDS_MeshElement * elem = itFaces->next();
@ -193,16 +191,14 @@ void DriverDAT_W_SMESHDS_Mesh::Add()
}
}
SMDS_Iterator<const SMDS_MeshElement *> * itNodes=elem->nodesIterator();
SMDS_ElemIteratorPtr itNodes=elem->nodesIterator();
while(itNodes->more())
fprintf(myFileId, "%d ", itNodes->next()->GetID());
delete itNodes;
fprintf(myFileId, "\n");
}
delete itFaces;
SMDS_Iterator<const SMDS_MeshVolume*> * itVolumes=myMesh->volumesIterator();
SMDS_VolumeIteratorPtr itVolumes=myMesh->volumesIterator();
while(itVolumes->more())
{
const SMDS_MeshElement * elem = itVolumes->next();
@ -216,14 +212,12 @@ void DriverDAT_W_SMESHDS_Mesh::Add()
}
}
SMDS_Iterator<const SMDS_MeshElement *> * itNodes=elem->nodesIterator();
SMDS_ElemIteratorPtr itNodes=elem->nodesIterator();
while(itNodes->more())
fprintf(myFileId, "%d ", itNodes->next()->GetID());
delete itNodes;
fprintf(myFileId, "\n");
}
delete itVolumes;
fclose(myFileId);
}

View File

@ -35,30 +35,18 @@ VPATH=.:@srcdir@
@COMMENCE@
# header files
EXPORT_HEADERS = \
DriverDAT_R_SMDS_Mesh.h \
DriverDAT_R_SMESHDS_Mesh.h \
DriverDAT_W_SMDS_Mesh.h \
DriverDAT_W_SMESHDS_Mesh.h
# DriverDAT_W_SMESHDS_Document.h \
# DriverDAT_R_SMESHDS_Document.h \
EXPORT_HEADERS= DriverDAT_R_SMDS_Mesh.h DriverDAT_R_SMESHDS_Mesh.h DriverDAT_R_SMESHDS_Document.h DriverDAT_W_SMDS_Mesh.h DriverDAT_W_SMESHDS_Mesh.h DriverDAT_W_SMESHDS_Document.h
# Libraries targets
LIB = libMeshDriverDAT.la
LIB_SRC = \
DriverDAT_R_SMDS_Mesh.cxx \
DriverDAT_R_SMESHDS_Mesh.cxx \
DriverDAT_W_SMDS_Mesh.cxx \
DriverDAT_W_SMESHDS_Mesh.cxx
#DriverDAT_W_SMESHDS_Document.cxx \
#DriverDAT_R_SMESHDS_Document.cxx \
LIB_SRC = DriverDAT_R_SMDS_Mesh.cxx DriverDAT_R_SMESHDS_Mesh.cxx DriverDAT_R_SMESHDS_Document.cxx DriverDAT_W_SMDS_Mesh.cxx DriverDAT_W_SMESHDS_Mesh.cxx DriverDAT_W_SMESHDS_Document.cxx
LIB_CLIENT_IDL =
LIB_SERVER_IDL =
# additionnal information to compil and link file
CPPFLAGS += $(OCC_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
CPPFLAGS += $(OCC_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome $(BOOST_CPPFLAGS)
CXXFLAGS += $(OCC_CXXFLAGS) $(MED2_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
LDFLAGS += $(MED2_LIBS) -lMeshDriver

View File

@ -0,0 +1,367 @@
// SMESH DriverMED : tool to split groups on families
//
// 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 : DriverMED_Family.cxx
// Author : Julia DOROVSKIKH
// Module : SMESH
// $Header$
#include "DriverMED_Family.h"
#include <sstream>
//=============================================================================
/*!
* Split each group from list <aGroups> on some parts (families)
* on the basis of the elements membership in other groups from this list.
* Resulting families have no common elements.
*/
//=============================================================================
list<DriverMED_FamilyPtr> DriverMED_Family::MakeFamilies
(const map <int, SMESHDS_SubMesh*>& theSubMeshes,
const list<SMESHDS_Group*>& theGroups,
const bool doGroupOfNodes,
const bool doGroupOfEdges,
const bool doGroupOfFaces,
const bool doGroupOfVolumes)
{
list<DriverMED_FamilyPtr> aFamilies;
string anAllNodesGroupName = "Group_Of_All_Nodes";
string anAllEdgesGroupName = "Group_Of_All_Edges";
string anAllFacesGroupName = "Group_Of_All_Faces";
string anAllVolumesGroupName = "Group_Of_All_Volumes";
// Reserve four ids for families of free elements
// (1 - nodes, -1 - edges, -2 - faces, -3 - volumes).
// 'Free' means here not belonging to any group.
int aNodeFamId = FIRST_NODE_FAMILY;
int aElemFamId = FIRST_ELEM_FAMILY;
// Process sub-meshes
map<int, SMESHDS_SubMesh*>::const_iterator aSMIter = theSubMeshes.begin();
for (; aSMIter != theSubMeshes.end(); aSMIter++)
{
list<DriverMED_FamilyPtr> aSMFams = SplitByType((*aSMIter).second, (*aSMIter).first);
list<DriverMED_FamilyPtr>::iterator aSMFamsIter = aSMFams.begin();
for (; aSMFamsIter != aSMFams.end(); aSMFamsIter++)
{
DriverMED_FamilyPtr aFam2 = (*aSMFamsIter);
list<DriverMED_FamilyPtr>::iterator aFamsIter = aFamilies.begin();
while (aFamsIter != aFamilies.end())
{
DriverMED_FamilyPtr aFam1 = *aFamsIter;
list<DriverMED_FamilyPtr>::iterator aCurrIter = aFamsIter++;
if (aFam1->myType == aFam2->myType)
{
DriverMED_FamilyPtr aCommon (new DriverMED_Family);
aFam1->Split(aFam2, aCommon);
if (!aCommon->IsEmpty())
{
aFamilies.push_back(aCommon);
}
if (aFam1->IsEmpty())
{
aFamilies.erase(aCurrIter);
}
if (aFam2->IsEmpty()) break;
}
}
// The rest elements of family
if (!aFam2->IsEmpty())
{
aFamilies.push_back(aFam2);
}
}
}
// Process groups
list<SMESHDS_Group*>::const_iterator aGroupsIter = theGroups.begin();
for (; aGroupsIter != theGroups.end(); aGroupsIter++)
{
DriverMED_FamilyPtr aFam2 (new DriverMED_Family);
aFam2->Init(*aGroupsIter);
list<DriverMED_FamilyPtr>::iterator aFamsIter = aFamilies.begin();
while (aFamsIter != aFamilies.end())
{
DriverMED_FamilyPtr aFam1 = *aFamsIter;
list<DriverMED_FamilyPtr>::iterator aCurrIter = aFamsIter++;
if (aFam1->myType == aFam2->myType)
{
DriverMED_FamilyPtr aCommon (new DriverMED_Family);
aFam1->Split(aFam2, aCommon);
if (!aCommon->IsEmpty())
{
aFamilies.push_back(aCommon);
}
if (aFam1->IsEmpty())
{
aFamilies.erase(aCurrIter);
}
if (aFam2->IsEmpty()) break;
}
}
// The rest elements of group
if (!aFam2->IsEmpty())
{
aFamilies.push_back(aFam2);
}
}
list<DriverMED_FamilyPtr>::iterator aFamsIter = aFamilies.begin();
for (; aFamsIter != aFamilies.end(); aFamsIter++)
{
DriverMED_FamilyPtr aFam = *aFamsIter;
if (aFam->myType == SMDSAbs_Node) {
aFam->SetId(aNodeFamId++);
if (doGroupOfNodes) aFam->myGroupNames.insert(anAllNodesGroupName);
}
else {
aFam->SetId(aElemFamId--);
if (aFam->myType == SMDSAbs_Edge) {
if (doGroupOfEdges) aFam->myGroupNames.insert(anAllEdgesGroupName);
}
else if (aFam->myType == SMDSAbs_Face) {
if (doGroupOfFaces) aFam->myGroupNames.insert(anAllFacesGroupName);
}
else if (aFam->myType == SMDSAbs_Volume) {
if (doGroupOfVolumes) aFam->myGroupNames.insert(anAllVolumesGroupName);
}
}
}
// Create families for elements, not belonging to any group
if (doGroupOfNodes)
{
DriverMED_FamilyPtr aFreeNodesFam (new DriverMED_Family);
aFreeNodesFam->SetId(REST_NODES_FAMILY);
aFreeNodesFam->myType = SMDSAbs_Node;
aFreeNodesFam->myGroupNames.insert(anAllNodesGroupName);
aFamilies.push_back(aFreeNodesFam);
}
if (doGroupOfEdges)
{
DriverMED_FamilyPtr aFreeEdgesFam (new DriverMED_Family);
aFreeEdgesFam->SetId(REST_EDGES_FAMILY);
aFreeEdgesFam->myType = SMDSAbs_Edge;
aFreeEdgesFam->myGroupNames.insert(anAllEdgesGroupName);
aFamilies.push_back(aFreeEdgesFam);
}
if (doGroupOfFaces)
{
DriverMED_FamilyPtr aFreeFacesFam (new DriverMED_Family);
aFreeFacesFam->SetId(REST_FACES_FAMILY);
aFreeFacesFam->myType = SMDSAbs_Face;
aFreeFacesFam->myGroupNames.insert(anAllFacesGroupName);
aFamilies.push_back(aFreeFacesFam);
}
if (doGroupOfVolumes)
{
DriverMED_FamilyPtr aFreeVolumesFam (new DriverMED_Family);
aFreeVolumesFam->SetId(REST_VOLUMES_FAMILY);
aFreeVolumesFam->myType = SMDSAbs_Volume;
aFreeVolumesFam->myGroupNames.insert(anAllVolumesGroupName);
aFamilies.push_back(aFreeVolumesFam);
}
DriverMED_FamilyPtr aNullFam (new DriverMED_Family);
aNullFam->SetId(0);
aNullFam->myType = SMDSAbs_All;
aFamilies.push_back(aNullFam);
return aFamilies;
}
//=============================================================================
/*!
* Create TFamilyInfo for this family
*/
//=============================================================================
MEDA::PFamilyInfo DriverMED_Family::GetFamilyInfo
(const MEDA::PMeshInfo& theMeshInfo) const
{
string aValue;
ostringstream aStr;
aStr << myId;
aValue = aStr.str();
MED::TStringVector anAttrDescs (1, ""); // 1 attribute with empty description,
MED::TIntVector anAttrIds (1, myId); // Id=0,
MED::TIntVector anAttrVals (1, myId); // Value=0
MEDA::PFamilyInfo anInfo = MEDA::TWrapper::CrFamilyInfo(theMeshInfo,
aValue,
myId,
myGroupNames,
anAttrDescs,anAttrIds,anAttrVals);
// cout << endl;
// cout << "Groups: ";
// set<string>::iterator aGrIter = myGroupNames.begin();
// for (; aGrIter != myGroupNames.end(); aGrIter++)
// {
// cout << " " << *aGrIter;
// }
// cout << endl;
//
// cout << "Elements: ";
// set<const SMDS_MeshElement *>::iterator anIter = myElements.begin();
// for (; anIter != myElements.end(); anIter++)
// {
// cout << " " << (*anIter)->GetID();
// }
// cout << endl;
return anInfo;
}
//=============================================================================
/*!
* Initialize the tool by SMESHDS_Group
*/
//=============================================================================
void DriverMED_Family::Init (SMESHDS_Group* group)
{
// Elements
myElements.clear();
group->InitIterator();
while (group->More())
{
myElements.insert(group->Next());
}
// Type
myType = group->GetType();
// Groups list
myGroupNames.clear();
myGroupNames.insert(string(group->GetStoreName()));
}
//=============================================================================
/*!
* Split <theSubMesh> on some parts (families)
* on the basis of the elements type.
*/
//=============================================================================
list<DriverMED_FamilyPtr> DriverMED_Family::SplitByType (SMESHDS_SubMesh* theSubMesh,
const int theId)
{
list<DriverMED_FamilyPtr> aFamilies;
DriverMED_FamilyPtr aNodesFamily (new DriverMED_Family);
DriverMED_FamilyPtr anEdgesFamily (new DriverMED_Family);
DriverMED_FamilyPtr aFacesFamily (new DriverMED_Family);
DriverMED_FamilyPtr aVolumesFamily (new DriverMED_Family);
char submeshGrpName[ 30 ];
sprintf( submeshGrpName, "SubMesh %d", theId );
SMDS_NodeIteratorPtr aNodesIter = theSubMesh->GetNodes();
while (aNodesIter->more())
{
const SMDS_MeshNode* aNode = aNodesIter->next();
aNodesFamily->AddElement(aNode);
}
SMDS_ElemIteratorPtr anElemsIter = theSubMesh->GetElements();
while (anElemsIter->more())
{
const SMDS_MeshElement* anElem = anElemsIter->next();
switch (anElem->GetType())
{
case SMDSAbs_Edge:
anEdgesFamily->AddElement(anElem);
break;
case SMDSAbs_Face:
aFacesFamily->AddElement(anElem);
break;
case SMDSAbs_Volume:
aVolumesFamily->AddElement(anElem);
break;
default:
break;
}
}
if (!aNodesFamily->IsEmpty()) {
aNodesFamily->SetType(SMDSAbs_Node);
aNodesFamily->AddGroupName(submeshGrpName);
aFamilies.push_back(aNodesFamily);
}
if (!anEdgesFamily->IsEmpty()) {
anEdgesFamily->SetType(SMDSAbs_Edge);
anEdgesFamily->AddGroupName(submeshGrpName);
aFamilies.push_back(anEdgesFamily);
}
if (!aFacesFamily->IsEmpty()) {
aFacesFamily->SetType(SMDSAbs_Face);
aFacesFamily->AddGroupName(submeshGrpName);
aFamilies.push_back(aFacesFamily);
}
if (!aVolumesFamily->IsEmpty()) {
aVolumesFamily->SetType(SMDSAbs_Volume);
aVolumesFamily->AddGroupName(submeshGrpName);
aFamilies.push_back(aVolumesFamily);
}
return aFamilies;
}
//=============================================================================
/*!
* Remove from <myElements> elements, common with <by>,
* Remove from <by> elements, common with <myElements>,
* Create family <common> from common elements, with combined groups list.
*/
//=============================================================================
void DriverMED_Family::Split (DriverMED_FamilyPtr by,
DriverMED_FamilyPtr common)
{
// Elements
set<const SMDS_MeshElement *>::iterator anIter = by->myElements.begin();
for (; anIter != by->myElements.end(); anIter++)
{
if (myElements.find(*anIter) != myElements.end())
{
common->myElements.insert(*anIter);
myElements.erase(*anIter);
by->myElements.erase(*anIter);
}
}
if (!common->IsEmpty())
{
// Groups list
common->myGroupNames = myGroupNames;
set<string>::iterator aGrNamesIter = by->myGroupNames.begin();
for (; aGrNamesIter != by->myGroupNames.end(); aGrNamesIter++)
{
common->myGroupNames.insert(*aGrNamesIter);
}
// Type
common->myType = myType;
}
}

View File

@ -0,0 +1,121 @@
// SMESH DriverMED : tool to split groups on families
//
// 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 : DriverMED_Family.hxx
// Author : Julia DOROVSKIKH
// Module : SMESH
// $Header$
#ifndef _INCLUDE_DRIVERMED_FAMILY
#define _INCLUDE_DRIVERMED_FAMILY
#include "SMDS_Mesh.hxx"
#include "SMESHDS_Group.hxx"
#include "SMESHDS_SubMesh.hxx"
#include "MEDA_Wrapper.hxx"
#include <boost/shared_ptr.hpp>
#include <set>
using namespace std;
#define REST_NODES_FAMILY 1
#define REST_EDGES_FAMILY -1
#define REST_FACES_FAMILY -2
#define REST_VOLUMES_FAMILY -3
#define FIRST_NODE_FAMILY 2
#define FIRST_ELEM_FAMILY -4
class DriverMED_Family;
typedef boost::shared_ptr<DriverMED_Family> DriverMED_FamilyPtr;
class DriverMED_Family
{
public:
// Methods for groups storing to MED
static list<DriverMED_FamilyPtr> MakeFamilies (const map <int, SMESHDS_SubMesh*>& theSubMeshes,
const list<SMESHDS_Group*>& theGroups,
const bool doGroupOfNodes,
const bool doGroupOfEdges,
const bool doGroupOfFaces,
const bool doGroupOfVolumes);
// Split each group from list <theGroups> and each sub-mesh from list <theSubMeshes>
// on some parts (families) on the basis of the elements membership in other groups
// from <theGroups> and other sub-meshes from <theSubMeshes>.
// Resulting families have no common elements.
MEDA::PFamilyInfo GetFamilyInfo (const MEDA::PMeshInfo& theMeshInfo) const;
// Create TFamilyInfo for this family
const set<const SMDS_MeshElement *>& GetElements () const { return myElements; }
// Returns elements of this family
int GetId () const { return myId; }
// Returns a family ID
public:
// Methods for groups reading from MED
void AddElement (const SMDS_MeshElement* theElement) { myElements.insert(theElement); }
void AddGroupName (string theGroupName) { myGroupNames.insert(theGroupName); }
void SetType (const SMDSAbs_ElementType theType) { myType = theType; }
SMDSAbs_ElementType GetType () { return myType; }
bool MemberOf (string theGroupName) const
{ return (myGroupNames.find(theGroupName) != myGroupNames.end()); }
const MED::TStringSet& GetGroupNames () const { return myGroupNames; }
private:
void Init (SMESHDS_Group* group);
// Initialize the tool by SMESHDS_Group
static list<DriverMED_FamilyPtr> SplitByType (SMESHDS_SubMesh* theSubMesh,
const int theId);
// Split <theSubMesh> on some parts (families)
// on the basis of the elements type.
void Split (DriverMED_FamilyPtr by,
DriverMED_FamilyPtr common);
// Remove from <Elements> elements, common with <by>,
// Remove from <by> elements, common with <Elements>,
// Create family <common> from common elements, with combined groups list.
void SetId (const int theId) { myId = theId; }
// Sets a family ID
bool IsEmpty () const { return myElements.empty(); }
// Check, if this family has empty list of elements
private:
int myId;
SMDSAbs_ElementType myType;
set<const SMDS_MeshElement *> myElements;
MED::TStringSet myGroupNames;
};
#endif

View File

@ -31,14 +31,13 @@ using namespace std;
extern "C"
{
void * SMESH_createMEDDocumentReader()
Document_Reader *maker()
{
return new DriverMED_R_SMESHDS_Document;
}
}
DriverMED_R_SMESHDS_Document::DriverMED_R_SMESHDS_Document()
:Document_Reader(new DriverMED_R_SMESHDS_Mesh())
{
;
}
@ -61,6 +60,8 @@ void DriverMED_R_SMESHDS_Document::Read()
int myMeshId;
//string myFile = string("/home/home_users/cai/projects/salome_prev04/SALOME_ROOT/data/fra1.med");
/****************************************************************************
* OUVERTURE DU FICHIER EN LECTURE *
****************************************************************************/

File diff suppressed because it is too large Load Diff

View File

@ -29,34 +29,60 @@
#include "SMESHDS_Mesh.hxx"
#include "Mesh_Reader.h"
#include "DriverMED_Family.h"
#include <vector>
#include <list>
extern "C"
{
#include <med.h>
}
using namespace std;
class SMESHDS_Group;
class SMESHDS_SubMesh;
class DriverMED_R_SMESHDS_Mesh:public Mesh_Reader
{
public:
public:DriverMED_R_SMESHDS_Mesh();
~DriverMED_R_SMESHDS_Mesh();
DriverMED_R_SMESHDS_Mesh();
~DriverMED_R_SMESHDS_Mesh();
void Read();
void ReadMySelf();
void Add();
enum ReadStatus {
DRS_OK,
DRS_EMPTY, // a MED file contains no mesh with the given name
DRS_WARN_RENUMBER, // a MED file has overlapped ranges of element numbers,
// so the numbers from the file are ignored
DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data
DRS_FAIL // general failure (exception etc.)
};
void SetMesh(SMDS_Mesh * aMesh);
void SetFile(string);
void SetFileId(med_idt);
void SetMeshId(int);
void Read();
ReadStatus ReadMySelf();
void Add();
void LinkMeshToShape(string, string, vector < int >);
list<string> GetGroupNames();
void GetGroup(SMESHDS_Group* theGroup);
void CreateAllSubMeshes();
void GetSubMesh(SMESHDS_SubMesh* theSubMesh, const int theId);
private: SMDS_Mesh * myMesh;
string myFile;
med_idt myFileId;
int myMeshId;
list<string> GetMeshNames();
void SetMesh(SMDS_Mesh * aMesh);
void SetFile(string);
void SetFileId(med_idt);
void SetMeshId(int);
void SetMeshName(string theMeshName);
private:
SMDS_Mesh * myMesh;
string myFile;
med_idt myFileId;
int myMeshId;
string myMeshName;
map<int, DriverMED_FamilyPtr> myFamilies;
};
#endif

View File

@ -207,7 +207,7 @@ void DriverMED_W_SMDS_Mesh::Write()
for (i = 0; i < MED_NBR_GEOMETRIE_MAILLE; i++)
nmailles[i] = 0;
SMDS_Iterator<const SMDS_MeshFace *> * itFaces=myMesh->facesIterator();
SMDS_FaceIteratorPtr itFaces=myMesh->facesIterator();
int nb_of_nodes, nb_of_faces;
nb_of_faces = myMesh->NbFaces();
//SCRUTE(nb_of_faces);
@ -251,7 +251,7 @@ void DriverMED_W_SMDS_Mesh::Write()
}
SMDS_Iterator<const SMDS_MeshVolume*> * itVolumes=myMesh->volumesIterator();
SMDS_VolumeIteratorPtr itVolumes=myMesh->volumesIterator();
while(itVolumes->more())
{
const SMDS_MeshVolume * elem = itVolumes->next();
@ -295,7 +295,7 @@ void DriverMED_W_SMDS_Mesh::Write()
nomnoe = "";
i = 0;
SMDS_Iterator<const SMDS_MeshNode *> * itNodes=myMesh->nodesIterator();
SMDS_NodeIteratorPtr itNodes=myMesh->nodesIterator();
while(itNodes->more())
{
const SMDS_MeshNode * node = itNodes->next();
@ -370,8 +370,7 @@ void DriverMED_W_SMDS_Mesh::Write()
//elem_id=*(numele+j);
//fprintf(stdout,"%d \n",myId);
SMDS_Iterator<const SMDS_MeshElement *> * itNode=
elem->nodesIterator();
SMDS_ElemIteratorPtr itNode= elem->nodesIterator();
while(itNode->more())
{

File diff suppressed because it is too large Load Diff

View File

@ -31,32 +31,66 @@
#include "Mesh_Writer.h"
#include <string>
#include <list>
#include <map>
extern "C"
{
#include <med.h>
}
using namespace std;
class SMESHDS_Group;
class SMESHDS_SubMesh;
class DriverMED_W_SMESHDS_Mesh:public Mesh_Writer
{
public:
public:DriverMED_W_SMESHDS_Mesh();
~DriverMED_W_SMESHDS_Mesh();
DriverMED_W_SMESHDS_Mesh();
~DriverMED_W_SMESHDS_Mesh();
void Add();
void Write();
void SetMesh(SMDS_Mesh * aMesh);
void SetFile(string);
/*! sets file name; only for usage with Add(), not Write()
*/
void SetFile(string);
void AddGroupOfNodes();
void AddGroupOfEdges();
void AddGroupOfFaces();
void AddGroupOfVolumes();
void SetFileId(med_idt);
void SetMeshId(int);
/*! functions to prepare adding one mesh
*/
void SetMesh(SMDS_Mesh * aMesh);
void SetMeshId(int);
void SetMeshName(string theMeshName);
void AddGroup(SMESHDS_Group* theGroup);
void AddAllSubMeshes();
void AddSubMesh(SMESHDS_SubMesh* theSubMesh, int theID);
void CreateFamily(char *, char *, int, med_int);
/*! add one mesh
*/
void Add();
private: SMDS_Mesh * myMesh;
string myFile;
med_idt myFileId;
int myMeshId;
/*! functions to write via DriverMED_W_SMDS_Mesh (no groups)
*/
void SetFileId(med_idt);
void Write();
private:
SMDS_Mesh * myMesh;
string myFile;
med_idt myFileId;
int myMeshId;
string myMeshName;
list<SMESHDS_Group*> myGroups;
bool myAllSubMeshes;
map<int,SMESHDS_SubMesh*> mySubMeshes;
bool myDoGroupOfNodes;
bool myDoGroupOfEdges;
bool myDoGroupOfFaces;
bool myDoGroupOfVolumes;
};
#endif

View File

@ -0,0 +1,28 @@
// 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
#include "DriverMED_R_SMESHDS_Mesh.h"
#include "DriverMED_W_SMESHDS_Mesh.h"
int main(int argc, char** argv)
{
DriverMED_R_SMESHDS_Mesh aR;
DriverMED_W_SMESHDS_Mesh aW;
return 1;
}

View File

@ -19,9 +19,12 @@
#
# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
#
#
#
# File : Makefile.in
# Author : Marc Tajchman (CEA)
# Module : SMESH
# $Header$
top_srcdir=@top_srcdir@
top_builddir=../..
@ -33,29 +36,28 @@ VPATH=.:@srcdir@
# header files
EXPORT_HEADERS = \
DriverMED_R_SMESHDS_Mesh.h \
DriverMED_R_SMESHDS_Document.h \
DriverMED_R_SMDS_Mesh.h \
DriverMED_W_SMESHDS_Mesh.h
#DriverMED_W_SMDS_Mesh.h \
#DriverMED_W_SMESHDS_Document.h
DriverMED_R_SMDS_Mesh.h DriverMED_R_SMESHDS_Mesh.h DriverMED_R_SMESHDS_Document.h \
DriverMED_W_SMDS_Mesh.h DriverMED_W_SMESHDS_Mesh.h DriverMED_W_SMESHDS_Document.h \
DriverMED_Family.h
# Libraries targets
LIB = libMeshDriverMED.la
LIB_SRC = \
DriverMED_R_SMDS_Mesh.cxx \
DriverMED_R_SMESHDS_Mesh.cxx \
DriverMED_R_SMESHDS_Document.cxx \
DriverMED_R_SMDS_Mesh.cxx \
DriverMED_W_SMESHDS_Mesh.cxx
#DriverMED_W_SMDS_Mesh.cxx \
#DriverMED_W_SMESHDS_Document.cxx
DriverMED_W_SMDS_Mesh.cxx \
DriverMED_W_SMESHDS_Document.cxx \
DriverMED_W_SMESHDS_Mesh.cxx \
DriverMED_Family.cxx
LIB_CLIENT_IDL =
LIB_SERVER_IDL =
# additionnal information to compil and link file
CPPFLAGS += $(OCC_INCLUDES) $(QT_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
CPPFLAGS += $(OCC_INCLUDES) $(QT_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome $(BOOST_CPPFLAGS)
CXXFLAGS += $(OCC_CXXFLAGS) $(MED2_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
LDFLAGS += $(MED2_LIBS) -lMeshDriver -lmed
LDFLAGS += $(MED2_LIBS) -lMeshDriver -L${KERNEL_ROOT_DIR}/lib/salome -lMEDWrapper
%_moc.cxx: %.h
$(MOC) $< -o $@

View File

@ -3,20 +3,6 @@ using namespace std;
#include "utilities.h"
extern "C"
{
/**
* Factory function which will be called by SMESHDriver
*/
void * SMESH_createUNVMeshReader()
{
return new DriverUNV_R_SMDS_Mesh();
}
}
DriverUNV_R_SMDS_Mesh::DriverUNV_R_SMDS_Mesh()
{
;

View File

@ -1,7 +1,13 @@
using namespace std;
#include "DriverUNV_W_SMDS_Mesh.h"
#include "SMDS_MeshElement.hxx"
#include "SMDS_MeshNode.hxx"
#include <utilities.h>
#define sNODE_UNV_ID " 2411"
@ -13,19 +19,6 @@
#define sELT_BEAM_DESC1 "%10d %2d 1 1 7 %1d\n"
#define sELT_BEAM_DESC2 " 0 1 1\n"
extern "C"
{
/**
* Factory function which will be called by SMESHDriver
*/
void * SMESH_createUNVMeshWriter()
{
return new DriverUNV_W_SMDS_Mesh();
}
}
DriverUNV_W_SMDS_Mesh::DriverUNV_W_SMDS_Mesh()
{
;
@ -96,6 +89,7 @@ void DriverUNV_W_SMDS_Mesh::Write()
SCRUTE(nb_of_volumes);
fprintf(stdout, "%d %d\n", nbNodes, nbCells);
fprintf(myFileId, "%d %d\n", nbNodes, nbCells);
/****************************************************************************
* ECRITURE DES NOEUDS *
@ -107,7 +101,7 @@ void DriverUNV_W_SMDS_Mesh::Write()
fprintf(myFileId, "%s\n", sUNV_SEPARATOR);
fprintf(myFileId, "%s\n", sNODE_UNV_ID);
SMDS_Iterator<const SMDS_MeshNode *> * itNodes=myMesh->nodesIterator();
SMDS_NodeIteratorPtr itNodes=myMesh->nodesIterator();
while(itNodes->more())
{
const SMDS_MeshNode * node = itNodes->next();
@ -116,7 +110,6 @@ void DriverUNV_W_SMDS_Mesh::Write()
fprintf(myFileId, "%25.16E%25.16E%25.16E\n", node->X(), node->Y(),
node->Z());
}
delete itNodes;
fprintf(myFileId, "%s\n", sUNV_SEPARATOR);
/****************************************************************************
@ -130,11 +123,11 @@ void DriverUNV_W_SMDS_Mesh::Write()
fprintf(myFileId, "%s\n", sUNV_SEPARATOR);
fprintf(myFileId, "%s\n", sELT_UNV_ID);
SMDS_Iterator<const SMDS_MeshEdge *> * itEdges=myMesh->edgesIterator();
SMDS_EdgeIteratorPtr itEdges=myMesh->edgesIterator();
while(itEdges->more())
{
const SMDS_MeshElement * elem = itEdges->next();
SMDS_Iterator<const SMDS_MeshElement*> *itn=elem->nodesIterator();
SMDS_ElemIteratorPtr itn=elem->nodesIterator();
switch (elem->NbNodes())
{
@ -155,11 +148,9 @@ void DriverUNV_W_SMDS_Mesh::Write()
break;
}
delete itn;
}
delete itEdges;
SMDS_Iterator<const SMDS_MeshFace*> * itFaces=myMesh->facesIterator();
SMDS_FaceIteratorPtr itFaces=myMesh->facesIterator();
while(itFaces->more())
{
const SMDS_MeshElement * elem = itFaces->next();
@ -190,15 +181,13 @@ void DriverUNV_W_SMDS_Mesh::Write()
fprintf(myFileId, "element not registered\n");
}
SMDS_Iterator<const SMDS_MeshElement*> *itn=elem->nodesIterator();
SMDS_ElemIteratorPtr itn=elem->nodesIterator();
while(itn->more()) fprintf(myFileId, "%10d", itn->next()->GetID());
delete itn;
fprintf(myFileId, "\n");
}
delete itFaces;
SMDS_Iterator<const SMDS_MeshVolume*> * itVolumes=myMesh->volumesIterator();
SMDS_VolumeIteratorPtr itVolumes=myMesh->volumesIterator();
while(itVolumes->more())
{
const SMDS_MeshElement * elem = itVolumes->next();
@ -222,13 +211,11 @@ void DriverUNV_W_SMDS_Mesh::Write()
break;
}
SMDS_Iterator<const SMDS_MeshElement*> *itn=elem->nodesIterator();
SMDS_ElemIteratorPtr itn=elem->nodesIterator();
while(itn->more()) fprintf(myFileId, "%10d", itn->next()->GetID());
delete itn;
fprintf(myFileId, "\n");
}
delete itVolumes;
fprintf(myFileId, "%s\n", sUNV_SEPARATOR);

View File

@ -112,7 +112,7 @@ void DriverUNV_W_SMESHDS_Mesh::Add()
fprintf(myFileId, "%s\n", sUNV_SEPARATOR);
fprintf(myFileId, "%s\n", sNODE_UNV_ID);
SMDS_Iterator<const SMDS_MeshNode *> * itNodes=myMesh->nodesIterator();
SMDS_NodeIteratorPtr itNodes=myMesh->nodesIterator();
while(itNodes->more())
{
const SMDS_MeshNode * node = itNodes->next();
@ -121,7 +121,6 @@ void DriverUNV_W_SMESHDS_Mesh::Add()
fprintf(myFileId, "%25.16E%25.16E%25.16E\n", node->X(), node->Y(),
node->Z());
}
delete itNodes;
fprintf(myFileId, "%s\n", sUNV_SEPARATOR);
/****************************************************************************
@ -135,11 +134,11 @@ void DriverUNV_W_SMESHDS_Mesh::Add()
fprintf(myFileId, "%s\n", sUNV_SEPARATOR);
fprintf(myFileId, "%s\n", sELT_UNV_ID);
SMDS_Iterator<const SMDS_MeshEdge *> * itEdges=myMesh->edgesIterator();
SMDS_EdgeIteratorPtr itEdges=myMesh->edgesIterator();
while(itEdges->more())
{
const SMDS_MeshEdge * elem = itEdges->next();
SMDS_Iterator<const SMDS_MeshElement*> *itn=elem->nodesIterator();
SMDS_ElemIteratorPtr itn=elem->nodesIterator();
switch (elem->NbNodes())
{
@ -159,11 +158,9 @@ void DriverUNV_W_SMESHDS_Mesh::Add()
itn->next()->GetID(), itn->next()->GetID());
break;
}
delete itn;
}
delete itEdges;
SMDS_Iterator<const SMDS_MeshFace*> * itFaces=myMesh->facesIterator();
SMDS_FaceIteratorPtr itFaces=myMesh->facesIterator();
while(itFaces->more())
{
const SMDS_MeshElement * elem = itFaces->next();
@ -194,15 +191,13 @@ void DriverUNV_W_SMESHDS_Mesh::Add()
fprintf(myFileId, "element not registered\n");
}
SMDS_Iterator<const SMDS_MeshElement*> *itn=elem->nodesIterator();
SMDS_ElemIteratorPtr itn=elem->nodesIterator();
while(itn->more()) fprintf(myFileId, "%10d", itn->next()->GetID());
delete itn;
fprintf(myFileId, "\n");
}
delete itFaces;
SMDS_Iterator<const SMDS_MeshVolume*> * itVolumes=myMesh->volumesIterator();
SMDS_VolumeIteratorPtr itVolumes=myMesh->volumesIterator();
while(itVolumes->more())
{
const SMDS_MeshElement * elem = itVolumes->next();
@ -226,13 +221,11 @@ void DriverUNV_W_SMESHDS_Mesh::Add()
break;
}
SMDS_Iterator<const SMDS_MeshElement*> *itn=elem->nodesIterator();
SMDS_ElemIteratorPtr itn=elem->nodesIterator();
while(itn->more()) fprintf(myFileId, "%10d", itn->next()->GetID());
delete itn;
fprintf(myFileId, "\n");
}
delete itVolumes;
fprintf(myFileId, "%s\n", sUNV_SEPARATOR);
fclose(myFileId);

View File

@ -35,30 +35,25 @@ VPATH=.:@srcdir@
@COMMENCE@
# header files
EXPORT_HEADERS = \
DriverUNV_R_SMDS_Mesh.h \
DriverUNV_W_SMDS_Mesh.h
#DriverUNV_W_SMESHDS_Mesh.h \
#DriverUNV_W_SMESHDS_Document.h \
#DriverUNV_R_SMESHDS_Mesh.h \
#DriverUNV_R_SMESHDS_Document.h \
EXPORT_HEADERS= DriverUNV_R_SMDS_Mesh.h DriverUNV_R_SMESHDS_Mesh.h DriverUNV_R_SMESHDS_Document.h \
DriverUNV_W_SMDS_Mesh.h DriverUNV_W_SMESHDS_Mesh.h DriverUNV_W_SMESHDS_Document.h
# Libraries targets
LIB = libMeshDriverUNV.la
LIB_SRC = \
DriverUNV_R_SMDS_Mesh.cxx \
DriverUNV_W_SMDS_Mesh.cxx
#DriverUNV_W_SMESHDS_Mesh.cxx \
#DriverUNV_R_SMESHDS_Mesh.cxx \
#DriverUNV_R_SMESHDS_Document.cxx \
#DriverUNV_W_SMESHDS_Document.cxx \
DriverUNV_R_SMESHDS_Mesh.cxx \
DriverUNV_R_SMESHDS_Document.cxx \
DriverUNV_W_SMESHDS_Document.cxx \
DriverUNV_W_SMDS_Mesh.cxx \
DriverUNV_W_SMESHDS_Mesh.cxx
LIB_CLIENT_IDL =
LIB_SERVER_IDL =
# additionnal information to compil and link file
CPPFLAGS += $(OCC_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
CPPFLAGS += $(OCC_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome $(BOOST_CPPFLAGS)
CXXFLAGS += $(OCC_CXXFLAGS) $(MED2_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
LDFLAGS += $(MED2_LIBS) -lMeshDriver

View File

@ -0,0 +1,123 @@
// 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
#include <fstream>
#include "UNV2411_Structure.hxx"
#include "UNV_Utilities.hxx"
using namespace std;
using namespace UNV;
using namespace UNV2411;
#ifdef _DEBUG_
static int MYDEBUG = 1;
#else
static int MYDEBUG = 0;
#endif
static string _label_dataset = "2411";
UNV2411::TRecord::TRecord():
exp_coord_sys_num(0),
disp_coord_sys_num(0),
color(0)
{}
void UNV2411::Read(std::ifstream& in_stream, TDataSet& theDataSet)
{
if(!in_stream.good())
EXCEPTION(runtime_error,"ERROR: Input file not good.");
/*
* adjust the \p istream to our
* position
*/
if(!beginning_of_dataset(in_stream,_label_dataset))
EXCEPTION(runtime_error,"ERROR: Could not find "<<_label_dataset<<" dataset!");
/**
* always 3 coordinates in the UNV file, no matter
* which dimensionality libMesh is in
*/
TNodeLab aLabel;
std::string num_buf;
for(; !in_stream.eof();){
in_stream >> aLabel ;
if(aLabel == -1){
// end of dataset is reached
break;
}
TRecord aRec;
in_stream>>aRec.exp_coord_sys_num;
in_stream>>aRec.disp_coord_sys_num;
in_stream>>aRec.color;
/*
* take care of the
* floating-point data
*/
for(int d = 0; d < 3; d++){
in_stream>>num_buf;
aRec.coord[d] = D_to_e(num_buf);
}
theDataSet.insert(TDataSet::value_type(aLabel,aRec));
}
}
void UNV2411::Write(std::ofstream& out_stream, const TDataSet& theDataSet)
{
if(!out_stream.good())
EXCEPTION(runtime_error,"ERROR: Output file not good.");
/*
* Write beginning of dataset
*/
out_stream<<" -1\n";
out_stream<<" "<<_label_dataset<<"\n";
TDataSet::const_iterator anIter = theDataSet.begin();
for(; anIter != theDataSet.end(); anIter++){
const TNodeLab& aLabel = anIter->first;
const TRecord& aRec = anIter->second;
char buf[78];
sprintf(buf, "%10d%10d%10d%10d\n",
aLabel,
aRec.exp_coord_sys_num,
aRec.disp_coord_sys_num,
aRec.color);
out_stream<<buf;
// the coordinates
sprintf(buf, "%25.16E%25.16E%25.16E\n",
aRec.coord[0],
aRec.coord[1],
aRec.coord[2]);
out_stream<<buf;
}
/*
* Write end of dataset
*/
out_stream<<" -1\n";
}

View File

@ -0,0 +1,46 @@
// 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
#ifndef UNV2411_Structure_HeaderFile
#define UNV2411_Structure_HeaderFile
#include <map>
#include <fstream>
namespace UNV2411{
struct TRecord{
TRecord();
int exp_coord_sys_num; // export coordinate system number
int disp_coord_sys_num; // displacement coordinate system number
int color; // color
double coord[3]; // node coordinates in the part coordinate system
};
typedef int TNodeLab; // type of node label
typedef std::map<TNodeLab,TRecord> TDataSet;
void Read(std::ifstream& in_stream, TDataSet& theDataSet);
void Write(std::ofstream& out_stream, const TDataSet& theDataSet);
};
#endif

View File

@ -0,0 +1,202 @@
// 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
#include <fstream>
#include <iomanip>
#include "UNV2412_Structure.hxx"
#include "UNV_Utilities.hxx"
using namespace std;
using namespace UNV;
using namespace UNV2412;
#ifdef _DEBUG_
static int MYDEBUG = 1;
#else
static int MYDEBUG = 0;
#endif
static string _label_dataset = "2412";
UNV2412::TRecord::TRecord():
phys_prop_tab_num(2),
mat_prop_tab_num(1),
color(7),
beam_orientation(0),
beam_fore_end(0),
beam_aft_end(0)
{}
void UNV2412::Read(std::ifstream& in_stream, TDataSet& theDataSet)
{
if(!in_stream.good())
EXCEPTION(runtime_error,"ERROR: Input file not good.");
/*
* adjust the \p istream to our
* position
*/
if(!beginning_of_dataset(in_stream,_label_dataset))
EXCEPTION(runtime_error,"ERROR: Could not find "<<_label_dataset<<" dataset!");
TElementLab aLabel;
for(; !in_stream.eof();){
in_stream >> aLabel ;
if(aLabel == -1){
// end of dataset is reached
break;
}
int n_nodes;
TRecord aRec;
in_stream>>aRec.fe_descriptor_id;
in_stream>>aRec.phys_prop_tab_num;
in_stream>>aRec.mat_prop_tab_num;
in_stream>>aRec.color;
in_stream>>n_nodes;
if(IsBeam(aRec.fe_descriptor_id)){
in_stream>>aRec.beam_orientation;
in_stream>>aRec.beam_fore_end;
in_stream>>aRec.beam_aft_end;
}
aRec.node_labels.resize(n_nodes);
for(int j=0; j < n_nodes; j++){
// read node labels
in_stream>>aRec.node_labels[j];
}
theDataSet.insert(TDataSet::value_type(aLabel,aRec));
}
}
void UNV2412::Write(std::ofstream& out_stream, const TDataSet& theDataSet)
{
if(!out_stream.good())
EXCEPTION(runtime_error,"ERROR: Output file not good.");
/*
* Write beginning of dataset
*/
out_stream<<" -1\n";
out_stream<<" "<<_label_dataset<<"\n";
TDataSet::const_iterator anIter = theDataSet.begin();
for(; anIter != theDataSet.end(); anIter++){
const TElementLab& aLabel = anIter->first;
const TRecord& aRec = anIter->second;
out_stream<<std::setw(10)<<aLabel; /* element ID */
out_stream<<std::setw(10)<<aRec.fe_descriptor_id; /* type of element */
out_stream<<std::setw(10)<<aRec.phys_prop_tab_num;
out_stream<<std::setw(10)<<aRec.mat_prop_tab_num;
out_stream<<std::setw(10)<<aRec.color;
out_stream<<std::setw(10)<<aRec.node_labels.size()<<std::endl; /* No. of nodes per element */
if(IsBeam(aRec.fe_descriptor_id)){
out_stream<<std::setw(10)<<aRec.beam_orientation;
out_stream<<std::setw(10)<<aRec.beam_fore_end;
out_stream<<std::setw(10)<<aRec.beam_aft_end<<std::endl;
}
int n_nodes = aRec.node_labels.size();
int iEnd = (n_nodes-1)/8 + 1;
for(int i = 0, k = 0; i < iEnd; i++){
int jEnd = n_nodes - 8*(i+1);
if(jEnd < 0)
jEnd = 8 + jEnd;
else
jEnd = 8;
for(int j = 0; j < jEnd ; k++, j++){
out_stream<<std::setw(10)<<aRec.node_labels[k];
}
out_stream<<std::endl;
}
}
/*
* Write end of dataset
*/
out_stream<<" -1\n";
}
bool UNV2412::IsBeam(int theFeDescriptorId){
switch (theFeDescriptorId){
case 11:
case 21:
case 22:
case 24:
case 25:
return true;
}
return false;
}
bool UNV2412::IsFace(int theFeDescriptorId){
switch (theFeDescriptorId){
case 71: // TRI3
case 72:
case 74:
case 41: // Plane Stress Linear Triangle - TRI3
case 91: // Thin Shell Linear Triangle - TRI3
case 42: // Plane Stress Quadratic Triangle - TRI6
case 92: // Thin Shell Quadratic Triangle - TRI6
case 43: // Plane Stress Cubic Triangle
case 44: // Plane Stress Linear Quadrilateral - QUAD4
case 94: // Thin Shell Linear Quadrilateral - QUAD4
case 45: // Plane Stress Quadratic Quadrilateral - QUAD8
case 95: // Thin Shell Quadratic Quadrilateral - QUAD8
case 46: // Plane Stress Cubic Quadrilateral
return true;
}
return false;
}
bool UNV2412::IsVolume(int theFeDescriptorId){
//if(!IsBeam(theFeDescriptorId) && !IsFace(theFeDescriptorId))
// return true;
switch (theFeDescriptorId){
case 111: // Solid Linear Tetrahedron - TET4
case 118: // Solid Quadratic Tetrahedron - TET10
case 112: // Solid Linear Prism - PRISM6
case 115: // Solid Linear Brick - HEX8
case 116: // Solid Quadratic Brick - HEX20
case 117: // Solid Cubic Brick
return true;
}
return false;
}

View File

@ -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
#ifndef UNV2412_Structure_HeaderFile
#define UNV2412_Structure_HeaderFile
#include <map>
#include <vector>
#include <fstream>
namespace UNV2412{
struct TRecord{
TRecord();
int fe_descriptor_id; // FE descriptor id
int phys_prop_tab_num; // physical property table number
int mat_prop_tab_num; // material property table number
int color; // color
std::vector<int> node_labels; // node labels defining element
//FOR BEAM ELEMENTS ONLY
int beam_orientation; // beam orientation node number
int beam_fore_end; // beam fore-end cross section number
int beam_aft_end; // beam aft-end cross section number
};
typedef int TElementLab; // type of element label
typedef std::map<TElementLab,TRecord> TDataSet;
void Read(std::ifstream& in_stream, TDataSet& theDataSet);
void Write(std::ofstream& out_stream, const TDataSet& theDataSet);
bool IsBeam(int theFeDescriptorId);
bool IsFace(int theFeDescriptorId);
bool IsVolume(int theFeDescriptorId);
};
#endif

View File

@ -0,0 +1,69 @@
// 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
#include "UNV2411_Structure.hxx"
#include "UNV2412_Structure.hxx"
#include "UNV_Utilities.hxx"
#include "DriverUNV_R_SMDS_Mesh.h"
#include "DriverUNV_W_SMDS_Mesh.h"
using namespace std;
#ifdef DEBUG
static int MYDEBUG = 1;
#else
static int MYDEBUG = 0;
#endif
void ReadMed(const char* theFileName){
std::ifstream in_stream(theFileName);
UNV2411::TDataSet aDataSet2411;
UNV2411::Read(in_stream,aDataSet2411);
in_stream.seekg(0);
UNV2412::TDataSet aDataSet2412;
UNV2412::Read(in_stream,aDataSet2412);
string aFileName(theFileName);
aFileName += "-";
std::ofstream out_stream(aFileName.c_str());
UNV2411::Write(out_stream,aDataSet2411);
UNV2412::Write(out_stream,aDataSet2412);
}
int main(int argc, char** argv){
DriverUNV_R_SMDS_Mesh aR;
DriverUNV_W_SMDS_Mesh aW;
try{
if(argc > 1){
ReadMed(argv[1]);
}
return 0;
}catch(std::exception& exc){
cout<<"Follow exception was accured :\n"<<exc.what()<<endl;
}catch(...){
cout<<"Unknown exception was accured !!!"<<endl;
}
return 1;
}

View File

@ -0,0 +1,37 @@
// Copyright (C) 2003 CEA/DEN, EDF R&D
//
//
//
// File : VISU_DatConvertor.cxx
// Author : Alexey PETROV
// Module : VISU
#include "UNV_Utilities.hxx"
using namespace std;
#ifdef _DEBUG_
static int MYDEBUG = 1;
#else
static int MYDEBUG = 0;
#endif
int UNV::PrefixPrinter::myCounter = 0;
UNV::PrefixPrinter::PrefixPrinter()
{
myCounter++;
}
UNV::PrefixPrinter::~PrefixPrinter()
{
myCounter--;
}
string UNV::PrefixPrinter::GetPrefix()
{
if(myCounter)
return string(myCounter*2,' ');
return "";
}

View File

@ -0,0 +1,104 @@
// Copyright (C) 2003 CEA/DEN, EDF R&D
//
//
//
// File : VISU_DatConvertor.hxx
// Author : Alexey PETROV
// Module : VISU
#ifndef MED_Utilities_HeaderFile
#define MED_Utilities_HeaderFile
#include <iostream>
#include <sstream>
#include <string>
#include <stdexcept>
namespace UNV{
using namespace std;
class PrefixPrinter{
static int myCounter;
public:
PrefixPrinter();
~PrefixPrinter();
static string GetPrefix();
};
/**
* @returns \p false when error occured, \p true otherwise.
* Adjusts the \p in_stream to the beginning of the
* dataset \p ds_name.
*/
inline bool beginning_of_dataset(std::istream& in_file, const std::string& ds_name)
{
assert (in_file.good());
assert (!ds_name.empty());
std::string olds, news;
while(true){
in_file >> olds >> news;
/*
* a "-1" followed by a number means the beginning of a dataset
* stop combing at the end of the file
*/
while( ((olds != "-1") || (news == "-1") ) && !in_file.eof() ){
olds = news;
in_file >> news;
}
if(in_file.eof())
return false;
if (news == ds_name)
return true;
}
// should never end up here
return false;
}
/**
* Method for converting exponential notation
* from "D" to "e", for example
* \p 3.141592654D+00 \p --> \p 3.141592654e+00
* in order to make it readable for C++.
*/
inline double D_to_e(std::string& number)
{
/* find "D" in string, start looking at
* 6th element, to improve speed.
* We dont expect a "D" earlier
*/
const int position = number.find("D",6);
if(position != std::string::npos){
number.replace(position, 1, "e");
}
return atof (number.c_str());
}
};
#ifndef MESSAGE
#define MESSAGE(msg) std::cout<<__FILE__<<"["<<__LINE__<<"]::"<<msg<<endl;
#define BEGMSG(msg) std::cout<<UNV::PrefixPrinter::GetPrefix()<<msg
#define ADDMSG(msg) std::cout<<msg
#endif
#ifndef EXCEPTION
#define EXCEPTION(TYPE, MSG) {\
std::ostringstream aStream;\
aStream<<__FILE__<<"["<<__LINE__<<"]::"<<MSG;\
throw TYPE(aStream.str());\
}
#endif
#endif

View File

@ -31,14 +31,9 @@ VPATH=.:@srcdir@
@COMMENCE@
SUBDIRS = OBJECT SMDS SMESHDS Driver DriverMED DriverDAT DriverUNV MEFISTO2 \
SMESH SMESH_I SMESHFiltersSelection SMESHGUI \
SMESH_SWIG
ifeq (@WITHNETGEN@,yes)
SUBDIRS = OBJECT SMDS SMESHDS Driver DriverMED DriverDAT DriverUNV MEFISTO2 \
NETGEN SMESH SMESH_I SMESHFiltersSelection SMESHGUI \
SMESH_SWIG
endif
SUBDIRS = \
SMDS SMESHDS Driver DriverMED DriverDAT DriverUNV \
SMESH SMESH_I OBJECT SMESHFiltersSelection SMESHGUI SMESH_SWIG \
MEFISTO2 StdMeshers StdMeshers_I StdMeshersGUI
@MODULE@

View File

@ -0,0 +1,67 @@
# SMESH NETGENPlugin : implementaion of SMESH idl descriptions
#
# Copyright (C) 2004 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 : Julia DOROVSKIKH
# Module : SMESH
# $Header$
top_srcdir=@top_srcdir@
top_builddir=../..
srcdir=@srcdir@
VPATH=.:@srcdir@:@top_srcdir@/idl:$(top_builddir)/idl:
@COMMENCE@
EXPORT_PYSCRIPTS =
# .po files to transform in .qm
PO_FILES = NETGENPlugin_icons.po
# Libraries targets
LIB = libNETGENEngine.la
LIB_SRC = \
NETGENPlugin_NETGEN_3D.cxx \
NETGENPlugin_NETGEN_3D_i.cxx \
NETGENPlugin_i.cxx
LIB_SERVER_IDL = SMESH_NetgenAlgorithm.idl
LIB_CLIENT_IDL = SMESH_Gen.idl SMESH_Mesh.idl SMESH_Group.idl
# Executables targets
BIN =
BIN_SRC =
# additionnal information to compil and link file
NETGEN_INCLUDES=@NETGEN_INCLUDES@
CPPFLAGS+= $(OCC_INCLUDES) $(HDF5_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome \
-I${GEOM_ROOT_DIR}/include/salome $(NETGEN_INCLUDES) $(BOOST_CPPFLAGS)
CXXFLAGS+= $(OCC_CXXFLAGS) $(HDF5_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome \
-I${GEOM_ROOT_DIR}/include/salome $(NETGEN_INCLUDES)
LDFLAGS+= $(HDF5_LIBS) -lSMESHimpl -lSMESHEngine -lStdMeshers -lStdMeshersEngine -lNETGEN -L${KERNEL_ROOT_DIR}/lib/salome -L${GEOM_ROOT_DIR}/lib/salome -lSalomeGenericObj
@CONCLUDE@

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,43 @@
//=============================================================================
// File : NETGENPlugin_NETGEN_3D.hxx
// Moved here from SMESH_NETGEN_3D.hxx
// Created : lundi 27 Janvier 2003
// Author : Nadir BOUHAMOU (CEA)
// Project : SALOME
// Copyright : CEA 2003
// $Header$
//=============================================================================
#ifndef _NETGENPlugin_NETGEN_3D_HXX_
#define _NETGENPlugin_NETGEN_3D_HXX_
#include "SMESH_3D_Algo.hxx"
#include "SMESH_Mesh.hxx"
#include "StdMeshers_MaxElementVolume.hxx"
#include "Utils_SALOME_Exception.hxx"
class NETGENPlugin_NETGEN_3D: public SMESH_3D_Algo
{
public:
NETGENPlugin_NETGEN_3D(int hypId, int studyId, SMESH_Gen* gen);
virtual ~NETGENPlugin_NETGEN_3D();
virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape,
SMESH_Hypothesis::Hypothesis_Status& aStatus);
virtual bool Compute(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape);
ostream & SaveTo(ostream & save);
istream & LoadFrom(istream & load);
friend ostream & operator << (ostream & save, NETGENPlugin_NETGEN_3D & hyp);
friend istream & operator >> (istream & load, NETGENPlugin_NETGEN_3D & hyp);
protected:
double _maxElementVolume;
const StdMeshers_MaxElementVolume* _hypMaxElementVolume;
};
#endif

View File

@ -0,0 +1,85 @@
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
//
// 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 : NETGENPlugin_NETGEN_3D_i.cxx
// Moved here from SMESH_NETGEN_3D_i.cxx
// Author : Nadir Bouhamou CEA
// Module : SMESH
// $Header$
using namespace std;
#include "NETGENPlugin_NETGEN_3D_i.hxx"
#include "SMESH_Gen.hxx"
#include "Utils_CorbaException.hxx"
#include "utilities.h"
//=============================================================================
/*!
* NETGENPlugin_NETGEN_3D_i::NETGENPlugin_NETGEN_3D_i
*
* Constructor
*/
//=============================================================================
NETGENPlugin_NETGEN_3D_i::NETGENPlugin_NETGEN_3D_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( "NETGENPlugin_NETGEN_3D_i::NETGENPlugin_NETGEN_3D_i" );
myBaseImpl = new ::NETGENPlugin_NETGEN_3D( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
}
//=============================================================================
/*!
* NETGENPlugin_NETGEN_3D_i::~NETGENPlugin_NETGEN_3D_i
*
* Destructor
*/
//=============================================================================
NETGENPlugin_NETGEN_3D_i::~NETGENPlugin_NETGEN_3D_i()
{
MESSAGE( "NETGENPlugin_NETGEN_3D_i::~NETGENPlugin_NETGEN_3D_i" );
}
//=============================================================================
/*!
* NETGENPlugin_NETGEN_3D_i::GetImpl
*
* Get implementation
*/
//=============================================================================
::NETGENPlugin_NETGEN_3D* NETGENPlugin_NETGEN_3D_i::GetImpl()
{
MESSAGE( "NETGENPlugin_NETGEN_3D_i::GetImpl" );
return ( ::NETGENPlugin_NETGEN_3D* )myBaseImpl;
}

View File

@ -0,0 +1,58 @@
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
//
// 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 : NETGENPlugin_NETGEN_3D_i.hxx
// Moved here from SMESH_NETGEN_3D_i.hxx
// Author : Nadir Bouhamou CEA
// Module : SMESH
// $Header$
#ifndef _NETGENPlugin_NETGEN_3D_I_HXX_
#define _NETGENPlugin_NETGEN_3D_I_HXX_
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_NetgenAlgorithm)
#include "SMESH_3D_Algo_i.hxx"
#include "NETGENPlugin_NETGEN_3D.hxx"
// ======================================================
// NETGEN 3d algorithm
// ======================================================
class NETGENPlugin_NETGEN_3D_i:
public virtual POA_NETGENPlugin::NETGENPlugin_NETGEN_3D,
public virtual SMESH_3D_Algo_i
{
public:
// Constructor
NETGENPlugin_NETGEN_3D_i( PortableServer::POA_ptr thePOA,
int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
virtual ~NETGENPlugin_NETGEN_3D_i();
// Get implementation
::NETGENPlugin_NETGEN_3D* GetImpl();
};
#endif

View File

@ -1,4 +1,4 @@
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// SMESH NETGENPlugin : 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
@ -21,40 +21,40 @@
//
//
//
// File : SMESH_HypothesisFactory_i.hxx
// Author : Paul RASCLE, EDF
// File : NETGENPlugin.cxx
// Author : Julia DOROVSKIKH
// Module : SMESH
// $Header$
#ifndef _SMESH_HYPOTHESISFACTORY_I_HXX_
#define _SMESH_HYPOTHESISFACTORY_I_HXX_
#include "SMESH_Hypothesis_i.hxx"
#include <map>
#include <string>
using namespace std;
#include "SMESH_Hypothesis_i.hxx"
#include "SMESH_Gen_i.hxx"
class GenericHypothesisCreator_i
#include "utilities.h"
#include "NETGENPlugin_NETGEN_3D_i.hxx"
//=============================================================================
/*!
*
*/
//=============================================================================
extern "C"
{
public:
virtual SMESH_Hypothesis_i* Create(const char* anHyp,
int studyId,
::SMESH_Gen* genImpl) = 0;
};
GenericHypothesisCreator_i* GetHypothesisCreator (const char* aHypName)
{
MESSAGE("GetHypothesisCreator " << aHypName);
class SMESH_HypothesisFactory_i
{
public:
SMESH_HypothesisFactory_i();
virtual ~SMESH_HypothesisFactory_i();
GenericHypothesisCreator_i* aCreator = 0;
SMESH_Hypothesis_i* Create(const char* anHyp,
CORBA::Long studyId,
::SMESH_Gen* genImpl)
throw (SALOME::SALOME_Exception);
// Hypotheses
private:
map<string, GenericHypothesisCreator_i*> _creatorMap;
};
// Algorithms
if (strcmp(aHypName, "NETGEN_3D") == 0)
aCreator = new HypothesisCreator_i<NETGENPlugin_NETGEN_3D_i>;
else ;
#endif
return aCreator;
}
}

View File

@ -0,0 +1,20 @@
# 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 <EMAIL@ADDRESS>\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
#-----------------------------------------------------------
# ObjectBrowser
#-----------------------------------------------------------
#mesh_tree_algo_netgen
msgid "ICON_SMESH_TREE_ALGO_NETGEN_3D"
msgstr "mesh_tree_algo_tetra.png"
#msgstr "mesh_tree_algo_netgen.png"

View File

@ -27,31 +27,32 @@
top_srcdir=@top_srcdir@
top_builddir=../..
srcdir=@srcdir@
VPATH=.:@srcdir@:@top_srcdir@/idl:$(top_builddir)/idl:${KERNEL_ROOT_DIR}/idl/salome:${MED_ROOT_DIR}/idl/salome
VPATH=.:@srcdir@:@top_srcdir@/idl:$(top_builddir)/idl
@COMMENCE@
EXPORT_HEADERS = SMESH_Actor.h \
SMESH_Grid.h
EXPORT_HEADERS = SMESH_Actor.h SMESH_Object.h
# Libraries targets
LIB = libSMESHObject.la
LIB_SRC = SMESH_Actor.cxx \
SMESH_Grid.cxx
LIB_SRC = SMESH_Object.cxx SMESH_DeviceActor.cxx SMESH_Actor.cxx
LIB_CLIENT_IDL = SALOME_Exception.idl \
SALOME_GenericObj.idl \
SMESH_Mesh.idl \
SMESH_Filter.idl \
SMESH_Group.idl
LIB_CLIENT_IDL =
# Executables targets
BIN =
BIN_SRC =
CPPFLAGS+=$(QT_INCLUDES) $(PYTHON_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
LDFLAGS+=$(QT_MT_LIBS) $(OCC_KERNEL_LIBS) $(VTK_LIBS) $(OGL_LIBS) $(PYTHON_LIBS) -lSalomeObject -L${KERNEL_ROOT_DIR}/lib/salome
%_moc.cxx: %.h
$(MOC) $< -o $@
CPPFLAGS+=$(OCC_INCLUDES) $(VTK_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome \
$(BOOST_CPPFLAGS) $(QT_INCLUDES)
LDFLAGS+=$(OCC_KERNEL_LIBS) $(VTK_LIBS) -L${KERNEL_ROOT_DIR}/lib/salome -lSMDS \
-lSalomeGUI -lSalomeObject -lOpUtil
@CONCLUDE@

File diff suppressed because it is too large Load Diff

View File

@ -30,126 +30,205 @@
#define SMESH_ACTOR_H
#include "SALOME_Actor.h"
#include "SMESH_Object.h"
// VTK Includes
#include <vtkActor.h>
#include <vtkDataSetMapper.h>
#include <vtkUnstructuredGridReader.h>
class vtkProperty;
class vtkShrinkFilter;
class vtkPolyDataMapper;
class vtkUnstructuredGrid;
class vtkMergeFilter;
class vtkPolyData;
// Open CASCADE Includes
#include <TColStd_IndexedMapOfInteger.hxx>
#include <TColStd_DataMapOfIntegerInteger.hxx>
class vtkMapper;
class vtkActor2D;
class vtkMaskPoints;
class vtkLabeledDataMapper;
class vtkSelectVisiblePoints;
typedef struct rgbStruct
{
float r;
float g;
float b;
} RGBStruct;
class vtkScalarBarActor;
class vtkLookupTable;
class SMESH_Actor : public SALOME_Actor {
class SMESH_DeviceActor;
class SALOME_ExtractUnstructuredGrid;
class SMESH_Actor : public SALOME_Actor{
friend class SMESH_VisualObj;
public:
vtkTypeMacro(SMESH_Actor,SALOME_Actor);
static SMESH_Actor* New(TVisualObjPtr theVisualObj,
SMESH::FilterManager_ptr theFilterMgr,
const char* theEntry,
const char* theName,
int theIsClear);
virtual void ReleaseGraphicsResources(vtkWindow *renWin);
virtual int RenderOpaqueGeometry(vtkViewport *viewport);
virtual int RenderTranslucentGeometry(vtkViewport *viewport);
virtual void Render(vtkRenderer *ren);
static SMESH_Actor* New();
virtual void AddToRender(vtkRenderer* theRenderer);
virtual void RemoveFromRender(vtkRenderer* theRenderer);
// Description:
// This causes the actor to be rendered. It, in turn, will render the actor`s
// property and then mapper.
virtual void Render(vtkRenderer *, vtkMapper *);
// Description:
// This method is used internally by the rendering process.
// We overide the superclass method to properly set the estimated render time.
int RenderOpaqueGeometry(vtkViewport *viewport);
void ShallowCopy(vtkProp *prop);
void setReader(vtkUnstructuredGridReader* r) ;
vtkUnstructuredGridReader* getReader();
// Highlight
virtual bool hasHighlight() { return true; }
virtual void highlight(Standard_Boolean highlight);
virtual void SetPreSelected(Standard_Boolean presel = Standard_False);
vtkMapper* getMapper();
virtual bool IsInfinitive();
void setDisplayMode(int);
virtual void SetOpacity(float theValue);
virtual float GetOpacity();
void SetColor(float r,float g,float b);
void GetColor(float& r,float& g,float& b);
void SetHighlightColor(float r,float g,float b);
void GetHighlightColor(float& r,float& g,float& b);
void SetPreselectedColor(float r,float g,float b);
void GetPreselectedColor(float& r,float& g,float& b);
void SetSufaceColor(float r,float g,float b);
void GetSufaceColor(float& r,float& g,float& b);
void SetBackSufaceColor(float r,float g,float b);
void GetBackSufaceColor(float& r,float& g,float& b);
void SetEdgeColor(float r,float g,float b);
void GetEdgeColor(float& r,float& g,float& b);
void SetEdgeHighlightColor(float r,float g,float b);
void GetEdgeHighlightColor(float& r,float& g,float& b);
void SetEdgePreselectedColor(float r,float g,float b);
void GetEdgePreselectedColor(float& r,float& g,float& b);
void SetNodeColor(float r,float g,float b);
void GetNodeColor(float& r,float& g,float& b);
void SetHighlightColor(float r,float g,float b);
void GetHighlightColor(float& r,float& g,float& b);
void SetPreHighlightColor(float r,float g,float b);
void GetPreHighlightColor(float& r,float& g,float& b);
void SetNodeSize(int size) ;
int GetNodeSize() ;
float GetLineWidth();
void SetLineWidth(float theVal);
void SetNodeSize(float size) ;
float GetNodeSize() ;
void ClearNode();
void ClearElement();
virtual int GetObjId(int theVtkID);
virtual TVectorId GetVtkId(int theObjID);
void RemoveNode(int idSMESHDSnode);
void RemoveElement(int idSMESHDSelement);
virtual int GetNodeObjId(int theVtkID);
virtual TVectorId GetNodeVtkId(int theObjID);
void AddNode(int idSMESHDSnode, int idVTKnode);
void AddElement(int idSMESHDSelement, int idVTKelement);
virtual int GetElemObjId(int theVtkID);
virtual TVectorId GetElemVtkId(int theObjID);
int GetIdVTKNode(int idSMESHDSnode);
int GetIdVTKElement(int idSMESHDSelement);
virtual int GetObjDimension( const int theObjId );
int GetIdSMESHDSNode(int idVTKnode);
int GetIdSMESHDSElement(int idVTKelement);
virtual void SetVisibility(int theMode);
void SetIdsVTKNode(const TColStd_DataMapOfIntegerInteger& mapVTK);
void SetIdsSMESHDSNode(const TColStd_DataMapOfIntegerInteger& mapSMESHDS);
enum EReperesent { ePoint, eEdge, eSurface};
virtual void SetRepresentation(int theMode);
void SetPointRepresentation(int theIsPointsVisible);
bool GetPointRepresentation(){ return myIsPointsVisible;}
void SetIdsVTKElement(const TColStd_DataMapOfIntegerInteger& mapVTK);
void SetIdsSMESHDSElement(const TColStd_DataMapOfIntegerInteger& mapSMESHDS);
virtual vtkPolyData* GetPolyDataInput();
virtual void SetTransform(SALOME_Transform* theTransform);
vtkDataSet* DataSource;
vtkActor* EdgeDevice;
vtkActor* EdgeShrinkDevice;
vtkUnstructuredGrid* GetUnstructuredGrid();
virtual vtkMapper* GetMapper();
float GetShrinkFactor();
void SetShrinkFactor(float value );
void GetChildActors(vtkActorCollection*);
bool IsShrunkable() { return myIsShrinkable;}
bool IsShrunk() { return myIsShrunk;}
void SetShrink();
void UnShrink();
void SetVisibility(bool visibility);
void SetPointsLabeled(bool theIsPointsLabeled);
bool GetPointsLabeled(){ return myIsPointsLabeled;}
void SetCellsLabeled(bool theIsCellsLabeled);
bool GetCellsLabeled(){ return myIsCellsLabeled;}
enum eControl{eNone, eLengthEdges, eFreeBorders, eMultiConnection,
eArea, eTaper, eAspectRatio, eMinimumAngle, eWarping, eSkew};
void SetControlMode(eControl theMode);
eControl GetControlMode(){ return myColorMode;}
enum e1DControl{e1DNone, e1DColored, e1DHighlited};
e1DControl Get1DControlMode(){ return my1DColorMode;}
vtkScalarBarActor* GetScalarBarActor(){ return myScalarBarActor;}
TVisualObjPtr GetObject() { return myVisualObj;}
protected:
TVisualObjPtr myVisualObj;
SMESH::FilterManager_var myFilterMgr;
vtkScalarBarActor* myScalarBarActor;
vtkLookupTable* myLookupTable;
vtkProperty* mySurfaceProp;
vtkProperty* myBackSurfaceProp;
vtkProperty* myEdgeProp;
vtkProperty* myNodeProp;
SMESH_DeviceActor* myBaseActor;
SMESH_DeviceActor* myNodeActor;
SMESH_DeviceActor* myPickableActor;
vtkProperty* myHighlightProp;
vtkProperty* myPreselectProp;
SMESH_DeviceActor* myHighlitableActor;
eControl myColorMode;
SMESH_DeviceActor* my2DActor;
SMESH_DeviceActor* my3DActor;
SMESH_DeviceActor* myControlActor;
e1DControl my1DColorMode;
vtkProperty* my1DProp;
SMESH_DeviceActor* my1DActor;
vtkProperty* my1DExtProp;
SMESH_DeviceActor* my1DExtActor;
bool myIsPointsVisible;
bool myIsShrinkable;
bool myIsShrunk;
bool myIsPointsLabeled;
vtkUnstructuredGrid* myPointsNumDataSet;
vtkActor2D *myPointLabels;
vtkMaskPoints* myPtsMaskPoints;
vtkLabeledDataMapper* myPtsLabeledDataMapper;
vtkSelectVisiblePoints* myPtsSelectVisiblePoints;
bool myIsCellsLabeled;
vtkUnstructuredGrid* myCellsNumDataSet;
vtkActor2D *myCellsLabels;
vtkMaskPoints* myClsMaskPoints;
vtkCellCenters* myCellCenters;
vtkLabeledDataMapper* myClsLabeledDataMapper;
vtkSelectVisiblePoints* myClsSelectVisiblePoints;
SMESH_Actor();
~SMESH_Actor();
SMESH_Actor(const SMESH_Actor&) {};
void operator=(const SMESH_Actor&) {};
vtkUnstructuredGridReader* myReader;
void Init(TVisualObjPtr theVisualObj,
SMESH::FilterManager_ptr theFilterMgr,
const char* theEntry,
const char* theName,
int theIsClear);
float myShrinkFactor;
void SetUnstructuredGrid(vtkUnstructuredGrid* theGrid);
void SetIsShrunkable(bool theShrunkable);
void UpdateHighlight();
RGBStruct edgeColor;
RGBStruct edgeHighlightColor;
RGBStruct edgePreselectedColor;
RGBStruct actorColor;
RGBStruct actorHighlightColor;
RGBStruct actorPreselectedColor;
RGBStruct actorNodeColor; // LPN
int actorNodeSize; // LPN
private:
// hide the two parameter Render() method from the user and the compiler.
virtual void Render(vtkRenderer *, vtkMapper *) {};
virtual void ShallowCopy(vtkProp *prop);
virtual void SetMapper(vtkMapper *);
static SMESH_Actor* New();
// Not implemented.
SMESH_Actor(const SMESH_Actor&);
void operator=(const SMESH_Actor&);
};
#endif //SMESH_ACTOR_H

View File

@ -0,0 +1,357 @@
// SMESH OBJECT : interactive object for SMESH visualization
//
// 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 : SMESH_Actor.cxx
// Author : Nicolas REJNERI
// Module : SMESH
// $Header$
#include "SMESH_DeviceActor.h"
#include "SALOME_Transform.h"
#include "SALOME_TransformFilter.h"
#include "SALOME_PassThroughFilter.h"
#include "SALOME_ExtractUnstructuredGrid.h"
#include "utilities.h"
// VTK Includes
#include <vtkObjectFactory.h>
#include <vtkShrinkFilter.h>
#include <vtkShrinkPolyData.h>
#include <vtkProperty.h>
#include <vtkPolyData.h>
#include <vtkMergeFilter.h>
#include <vtkPolyDataMapper.h>
#include <vtkUnstructuredGrid.h>
#ifdef _DEBUG_
static int MYDEBUG = 0;
static int MYDEBUGWITHFILES = 0;
#else
static int MYDEBUG = 0;
static int MYDEBUGWITHFILES = 0;
#endif
using namespace std;
vtkStandardNewMacro(SMESH_DeviceActor);
SMESH_DeviceActor::SMESH_DeviceActor(){
if(MYDEBUG) MESSAGE("SMESH_DeviceActor");
myIsShrunk = false;
myIsShrinkable = false;
myRepresentation = eSurface;
myProperty = vtkProperty::New();
myMapper = vtkPolyDataMapper::New();
vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor,
myPolygonOffsetUnits);
//myMapper->SetResolveCoincidentTopologyToShiftZBuffer();
//myMapper->SetResolveCoincidentTopologyZShift(0.02);
myMapper->UseLookupTableScalarRangeOn();
myMapper->SetColorModeToMapScalars();
myShrinkFilter = vtkShrinkFilter::New();
myExtractUnstructuredGrid = SALOME_ExtractUnstructuredGrid::New();
myExtractUnstructuredGrid->SetStoreMapping(true);
myMergeFilter = vtkMergeFilter::New();
myStoreMapping = false;
myGeomFilter = SALOME_GeometryFilter::New();
myTransformFilter = SALOME_TransformFilter::New();
for(int i = 0; i < 6; i++)
myPassFilter.push_back(SALOME_PassThroughFilter::New());
}
SMESH_DeviceActor::~SMESH_DeviceActor(){
if(MYDEBUG) MESSAGE("~SMESH_DeviceActor");
myProperty->Delete();
myMapper->RemoveAllInputs();
myMapper->Delete();
myShrinkFilter->UnRegisterAllOutputs();
myShrinkFilter->Delete();
myExtractUnstructuredGrid->UnRegisterAllOutputs();
myExtractUnstructuredGrid->Delete();
myMergeFilter->UnRegisterAllOutputs();
myMergeFilter->Delete();
myGeomFilter->UnRegisterAllOutputs();
myGeomFilter->Delete();
myTransformFilter->UnRegisterAllOutputs();
myTransformFilter->Delete();
for(int i = 0, iEnd = myPassFilter.size(); i < iEnd; i++){
myPassFilter[i]->UnRegisterAllOutputs();
myPassFilter[i]->Delete();
}
}
void SMESH_DeviceActor::SetStoreMapping(int theStoreMapping){
myStoreMapping = theStoreMapping;
Modified();
}
void SMESH_DeviceActor::SetUnstructuredGrid(vtkUnstructuredGrid* theGrid){
if(theGrid){
//myIsShrinkable = theGrid->GetNumberOfCells() > 10;
myIsShrinkable = true;
myExtractUnstructuredGrid->SetInput(theGrid);
myMergeFilter->SetGeometry(myExtractUnstructuredGrid->GetOutput());
theGrid = static_cast<vtkUnstructuredGrid*>(myMergeFilter->GetOutput());
int anId = 0;
myPassFilter.at( anId )->SetInput( theGrid );
myPassFilter.at( anId + 1)->SetInput( myPassFilter.at( anId )->GetOutput() );
anId++; // 1
myGeomFilter->SetStoreMapping( myStoreMapping );
myGeomFilter->SetInput( myPassFilter.at( anId )->GetOutput() );
anId++; // 2
myPassFilter.at( anId )->SetInput( myGeomFilter->GetOutput() );
myPassFilter.at( anId + 1 )->SetInput( myPassFilter.at( anId )->GetOutput() );
anId++; // 3
myTransformFilter->SetInput( myPassFilter.at( anId )->GetPolyDataOutput() );
anId++; // 4
myPassFilter.at( anId )->SetInput( myTransformFilter->GetOutput() );
myPassFilter.at( anId + 1 )->SetInput( myPassFilter.at( anId )->GetOutput() );
anId++; // 5
myMapper->SetInput( myPassFilter.at( anId )->GetPolyDataOutput() );
vtkLODActor::SetMapper( myMapper );
Modified();
}
}
SALOME_ExtractUnstructuredGrid* SMESH_DeviceActor::GetExtractUnstructuredGrid(){
return myExtractUnstructuredGrid;
}
vtkUnstructuredGrid* SMESH_DeviceActor::GetUnstructuredGrid(){
myExtractUnstructuredGrid->Update();
return myExtractUnstructuredGrid->GetOutput();
}
vtkMergeFilter* SMESH_DeviceActor::GetMergeFilter(){
return myMergeFilter;
}
vtkPolyData* SMESH_DeviceActor::GetPolyDataInput(){
return myPassFilter.back()->GetPolyDataOutput();
}
unsigned long int SMESH_DeviceActor::GetMTime(){
unsigned long mTime = this->Superclass::GetMTime();
mTime = max(mTime,myExtractUnstructuredGrid->GetMTime());
mTime = max(mTime,myMergeFilter->GetMTime());
mTime = max(mTime,myGeomFilter->GetMTime());
mTime = max(mTime,myTransformFilter->GetMTime());
return mTime;
}
void SMESH_DeviceActor::SetTransform(SALOME_Transform* theTransform){
myTransformFilter->SetTransform(theTransform);
}
void SMESH_DeviceActor::SetShrink()
{
if ( !myIsShrinkable ) return;
if ( vtkDataSet* aDataSet = myPassFilter.at( 0 )->GetOutput() )
{
myShrinkFilter->SetInput( aDataSet );
myPassFilter.at( 1 )->SetInput( myShrinkFilter->GetOutput() );
myIsShrunk = true;
}
}
void SMESH_DeviceActor::UnShrink()
{
if ( !myIsShrunk ) return;
if ( vtkDataSet* aDataSet = myPassFilter.at( 0 )->GetOutput() )
{
myPassFilter.at( 1 )->SetInput( aDataSet );
myPassFilter.at( 1 )->Modified();
myIsShrunk = false;
Modified();
}
}
void SMESH_DeviceActor::SetRepresentation(EReperesent theMode){
switch(theMode){
case ePoint:
myGeomFilter->SetInside(true);
GetProperty()->SetRepresentation(0);
break;
case eInsideframe:
myGeomFilter->SetInside(true);
GetProperty()->SetRepresentation(1);
break;
default :
GetProperty()->SetRepresentation(theMode);
myGeomFilter->SetInside(false);
}
myRepresentation = theMode;
myMapper->Modified();
Modified();
}
void SMESH_DeviceActor::SetVisibility(int theMode){
if(!myExtractUnstructuredGrid->GetInput() || GetUnstructuredGrid()->GetNumberOfCells()){
vtkLODActor::SetVisibility(theMode);
}else{
vtkLODActor::SetVisibility(false);
}
}
int SMESH_DeviceActor::GetVisibility(){
if(!GetUnstructuredGrid()->GetNumberOfCells()){
vtkLODActor::SetVisibility(false);
}
return vtkLODActor::GetVisibility();
}
int SMESH_DeviceActor::GetObjId(int theVtkID){
if (GetRepresentation() == ePoint){
return GetNodeObjId(theVtkID);
}else{
return GetElemObjId(theVtkID);
}
}
SMESH_DeviceActor::TVectorId SMESH_DeviceActor::GetVtkId(int theObjID){
if (GetRepresentation() == ePoint){
return GetNodeVtkId(theObjID);
}else{
return GetElemVtkId(theObjID);
}
}
int SMESH_DeviceActor::GetNodeObjId(int theVtkID){
vtkIdType aRetID = myVisualObj->GetNodeObjId(theVtkID);
if(MYDEBUG) MESSAGE("GetNodeObjId - theVtkID = "<<theVtkID<<"; aRetID = "<<aRetID);
return aRetID;
}
SMESH_DeviceActor::TVectorId SMESH_DeviceActor::GetNodeVtkId(int theObjID){
SMESH_DeviceActor::TVectorId aVecId;
vtkIdType anID = myVisualObj->GetNodeVTKId(theObjID);
if(anID < 0)
return aVecId;
aVecId.push_back(anID);
return aVecId;
}
int SMESH_DeviceActor::GetElemObjId(int theVtkID){
vtkIdType aGridID = myGeomFilter->GetObjId(theVtkID);
if(aGridID < 0)
return -1;
vtkIdType anExtractID = myExtractUnstructuredGrid->GetOutId(aGridID);
if(anExtractID < 0)
return -1;
vtkIdType aRetID = myVisualObj->GetElemObjId(anExtractID);
if(MYDEBUG)
MESSAGE("GetElemObjId - theVtkID = "<<theVtkID<<"; anExtractID = "<<anExtractID<<"; aGridID = "<<aGridID<<"; aRetID = "<<aRetID);
return aRetID;
}
SMESH_DeviceActor::TVectorId SMESH_DeviceActor::GetElemVtkId(int theObjID){
TVectorId aVecId;
vtkIdType aGridID = myVisualObj->GetElemVTKId(theObjID);
if(aGridID < 0)
return aVecId;
aVecId = myGeomFilter->GetVtkId(aGridID);
if(MYDEBUG)
MESSAGE("GetElemVtkId - theObjID = "<<theObjID<<"; aGridID = "<<aGridID<<"; aGridID = "<<aGridID<<"; aVecId[0] = "<<aVecId[0]);
return aVecId;
}
float SMESH_DeviceActor::GetShrinkFactor(){
return myShrinkFilter->GetShrinkFactor();
}
void SMESH_DeviceActor::SetShrinkFactor(float theValue){
theValue = theValue > 0.1? theValue: 0.8;
myShrinkFilter->SetShrinkFactor(theValue);
Modified();
}
void SMESH_DeviceActor::Render(vtkRenderer *ren, vtkMapper* m){
int aResolveCoincidentTopology = vtkMapper::GetResolveCoincidentTopology();
float aFactor, aUnit;
vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(aFactor,aUnit);
vtkMapper::SetResolveCoincidentTopologyToPolygonOffset();
vtkMapper::SetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor,
myPolygonOffsetUnits);
vtkLODActor::Render(ren,m);
vtkMapper::SetResolveCoincidentTopologyPolygonOffsetParameters(aFactor,aUnit);
vtkMapper::SetResolveCoincidentTopology(aResolveCoincidentTopology);
}
void SMESH_DeviceActor::SetPolygonOffsetParameters(float factor, float units){
myPolygonOffsetFactor = factor;
myPolygonOffsetUnits = units;
}

View File

@ -0,0 +1,133 @@
// SMESH OBJECT : interactive object for SMESH visualization
//
// 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 : SMESH_Actor.h
// Author : Nicolas REJNERI
// Module : SMESH
// $Header$
#ifndef SMESH_DEVICE_ACTOR_H
#define SMESH_DEVICE_ACTOR_H
#include "SALOME_GeometryFilter.h"
#include "SMESH_Object.h"
#include <vtkLODActor.h>
class vtkProperty;
class vtkMergeFilter;
class vtkShrinkFilter;
class vtkPolyDataMapper;
class vtkUnstructuredGrid;
class SALOME_Transform;
class SALOME_TransformFilter;
class SALOME_PassThroughFilter;
class SALOME_ExtractUnstructuredGrid;
class SMESH_DeviceActor: public vtkLODActor{
friend class SMESH_Actor;
public:
vtkTypeMacro(SMESH_DeviceActor,vtkLODActor);
static SMESH_DeviceActor* New();
void SetStoreMapping(int theStoreMapping);
int GetStoreMapping(){ return myStoreMapping;}
typedef SALOME_GeometryFilter::TVectorId TVectorId;
int GetObjId(int theVtkID);
TVectorId GetVtkId(int theObjID);
int GetNodeObjId(int theVtkID);
TVectorId GetNodeVtkId(int theObjID);
int GetElemObjId(int theVtkID);
TVectorId GetElemVtkId(int theObjID);
vtkPolyData* GetPolyDataInput();
virtual void SetTransform(SALOME_Transform* theTransform);
virtual unsigned long int GetMTime();
float GetShrinkFactor();
void SetShrinkFactor(float value);
bool IsShrunkable() { return myIsShrinkable;}
bool IsShrunk() { return myIsShrunk;}
void SetShrink();
void UnShrink();
enum EReperesent { ePoint, eWireframe, eSurface, eInsideframe};
EReperesent GetRepresentation(){ return myRepresentation;}
void SetRepresentation(EReperesent theMode);
virtual void SetVisibility(int theMode);
virtual int GetVisibility();
SALOME_ExtractUnstructuredGrid* GetExtractUnstructuredGrid();
vtkUnstructuredGrid* GetUnstructuredGrid();
vtkMergeFilter* GetMergeFilter();
virtual void Render(vtkRenderer *, vtkMapper *);
protected:
void SetUnstructuredGrid(vtkUnstructuredGrid* theGrid);
vtkPolyDataMapper *myMapper;
TVisualObjPtr myVisualObj;
vtkProperty *myProperty;
EReperesent myRepresentation;
vtkMergeFilter* myMergeFilter;
SALOME_ExtractUnstructuredGrid* myExtractUnstructuredGrid;
bool myStoreMapping;
SALOME_GeometryFilter *myGeomFilter;
SALOME_TransformFilter *myTransformFilter;
std::vector<SALOME_PassThroughFilter*> myPassFilter;
vtkShrinkFilter* myShrinkFilter;
bool myIsShrinkable;
bool myIsShrunk;
float myPolygonOffsetFactor;
float myPolygonOffsetUnits;
void SetPolygonOffsetParameters(float factor, float units);
void GetPolygonOffsetParameters(float& factor, float& units){
factor = myPolygonOffsetFactor;
units = myPolygonOffsetUnits;
}
SMESH_DeviceActor();
~SMESH_DeviceActor();
SMESH_DeviceActor(const SMESH_DeviceActor&) {};
void operator=(const SMESH_DeviceActor&) {};
};
#endif //SMESH_ACTOR_H

1037
src/OBJECT/SMESH_Object.cxx Normal file

File diff suppressed because it is too large Load Diff

207
src/OBJECT/SMESH_Object.h Normal file
View File

@ -0,0 +1,207 @@
// SMESH OBJECT : interactive object for SMESH visualization
//
// 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 : SMESH_Object.h
// Author : Nicolas REJNERI
// Module : SMESH
// $Header$
#ifndef SMESH_OBJECT_H
#define SMESH_OBJECT_H
// IDL Headers
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Mesh)
#include CORBA_SERVER_HEADER(SMESH_Group)
#include CORBA_SERVER_HEADER(SMESH_Filter)
#include <map>
#include <list>
#include <boost/shared_ptr.hpp>
#include <vtkSystemIncludes.h>
class vtkUnstructuredGrid;
class vtkPoints;
class SALOME_ExtractUnstructuredGrid;
class SMESH_Actor;
class SMDS_Mesh;
class SMDS_MeshNode;
class SMDS_MeshElement;
class SMESH_VisualObj;
typedef boost::shared_ptr<SMESH_VisualObj> TVisualObjPtr;
/*
Class : SMESH_VisualObj
Description : Base class for all mesh objects to be visuilised
*/
class SMESH_VisualObj
{
protected:
typedef std::list<const SMDS_MeshElement*> TEntityList;
typedef std::map<vtkIdType,vtkIdType> TMapOfIds;
public:
SMESH_VisualObj();
virtual ~SMESH_VisualObj();
virtual void Update( int theIsClear = true ) = 0;
virtual void UpdateFunctor( SMESH::Functor_ptr theFunctor ) = 0;
virtual int GetElemDimension( const int theObjId ) = 0;
virtual int GetNbEntities( const SMESH::ElementType) const = 0;
virtual int GetEntities( const SMESH::ElementType, TEntityList& ) const = 0;
virtual bool IsNodePrs() const = 0;
vtkUnstructuredGrid* GetUnstructuredGrid() { return myGrid; }
vtkIdType GetNodeObjId( int theVTKID );
vtkIdType GetNodeVTKId( int theObjID );
vtkIdType GetElemObjId( int theVTKID );
vtkIdType GetElemVTKId( int theObjID );
protected:
void createPoints( vtkPoints* );
void buildPrs();
void buildNodePrs();
void buildElemPrs();
private:
TMapOfIds mySMDS2VTKNodes;
TMapOfIds myVTK2SMDSNodes;
TMapOfIds mySMDS2VTKElems;
TMapOfIds myVTK2SMDSElems;
vtkUnstructuredGrid* myGrid;
};
/*
Class : SMESH_MeshObj
Description : Class for visualisation of mesh
*/
class SMESH_MeshObj: public SMESH_VisualObj
{
public:
SMESH_MeshObj( SMESH::SMESH_Mesh_ptr );
virtual ~SMESH_MeshObj();
virtual void Update( int theIsClear = true );
virtual int GetNbEntities( const SMESH::ElementType) const;
virtual int GetEntities( const SMESH::ElementType, TEntityList& ) const;
virtual bool IsNodePrs() const;
virtual int GetElemDimension( const int theObjId );
virtual void UpdateFunctor( SMESH::Functor_ptr f );
SMESH::SMESH_Mesh_ptr GetMeshServer() { return myMeshServer.in(); }
SMDS_Mesh* GetMesh() { return myMesh; }
protected:
SMESH::SMESH_Mesh_var myMeshServer;
SMDS_Mesh* myMesh;
};
/*
Class : SMESH_SubMeshObj
Description : Base class for visualisation of submeshes and groups
*/
class SMESH_SubMeshObj: public SMESH_VisualObj
{
public:
SMESH_SubMeshObj(SMESH_MeshObj* theMeshObj);
virtual ~SMESH_SubMeshObj();
virtual void Update( int theIsClear = true );
virtual void UpdateFunctor( SMESH::Functor_ptr );
virtual int GetElemDimension( const int theObjId );
protected:
SMESH_MeshObj* myMeshObj;
};
/*
Class : SMESH_GroupObj
Description : Class for visualisation of groups
*/
class SMESH_GroupObj: public SMESH_SubMeshObj
{
public:
SMESH_GroupObj( SMESH::SMESH_Group_ptr, SMESH_MeshObj* );
virtual ~SMESH_GroupObj();
virtual int GetNbEntities( const SMESH::ElementType) const;
virtual int GetEntities( const SMESH::ElementType, TEntityList& ) const;
virtual bool IsNodePrs() const;
private:
SMESH::SMESH_Group_var myGroupServer;
};
/*
Class : SMESH_subMeshObj
Description : Class for visualisation of submeshes
*/
class SMESH_subMeshObj : public SMESH_SubMeshObj
{
public:
SMESH_subMeshObj( SMESH::SMESH_subMesh_ptr,
SMESH_MeshObj* );
virtual ~SMESH_subMeshObj();
virtual int GetNbEntities( const SMESH::ElementType) const;
virtual int GetEntities( const SMESH::ElementType, TEntityList& ) const;
virtual bool IsNodePrs() const;
protected:
SMESH::SMESH_subMesh_var mySubMeshServer;
};
extern void WriteUnstructuredGrid(vtkUnstructuredGrid* theGrid, const char* theFileName);
#endif

Some files were not shown because too many files have changed in this diff Show More