Correction compilation on Linux

This commit is contained in:
abd 2008-04-28 06:22:57 +00:00
parent 14a90ed290
commit 80403d0a66
27 changed files with 2283 additions and 1859 deletions

View File

@ -27,12 +27,23 @@ EXTRA_DIST+=SMESH
doxygen=@DOXYGEN@ doxygen=@DOXYGEN@
# Below command replaces "smeshDC" by "smesh" except cases
# "ssmeshDC", "1smeshDC" and "esmeshDC" (these sequences
# can be found in file names and must not be replaces):
#
# sed 's/\([^s1e]\)smeshDC\|^smeshDC/\1smesh/g' $${filen} > ./tmp;
#
usr_docs: usr_docs:
cd ./SMESH; \ cd ./SMESH; \
echo "Processing smeshDC.py file: "; \ echo "Processing smeshDC.py file: "; \
$(doxygen) ./doxyfile_py; \ $(doxygen) ./doxyfile_py; \
sed 's|../../../share/salome|$(top_srcdir)|' ./doxyfile > ./doxyfile1; \ cd ./smeshpy_doc; \
mv -f doxyfile1 doxyfile; \ filesl=`find .`; \
for filen in $${filesl}; do \
sed 's/\([^s1e]\)smeshDC\|^smeshDC/\1smesh/g' $${filen} > ./tmp; \
mv -f tmp $${filen}; \
done; \
cd ..; \
echo "Running doxygen in directory: "`pwd`; \ echo "Running doxygen in directory: "`pwd`; \
$(doxygen) ./doxyfile; $(doxygen) ./doxyfile;

View File

@ -19,7 +19,7 @@ WARNINGS = YES
INPUT = @srcdir@/input INPUT = @srcdir@/input
FILE_PATTERNS = *.doc FILE_PATTERNS = *.doc
IMAGE_PATH = @srcdir@/images IMAGE_PATH = @srcdir@/images
EXAMPLE_PATH = ../../../share/salome/src/SMESH_SWIG EXAMPLE_PATH = @top_srcdir@/src/SMESH_SWIG
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
#HTML related options #HTML related options
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------

View File

@ -7,7 +7,7 @@ CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English OUTPUT_LANGUAGE = English
USE_WINDOWS_ENCODING = NO USE_WINDOWS_ENCODING = NO
BRIEF_MEMBER_DESC = YES BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = NO REPEAT_BRIEF = YES
ALWAYS_DETAILED_SEC = YES ALWAYS_DETAILED_SEC = YES
INLINE_INHERITED_MEMB = YES INLINE_INHERITED_MEMB = YES
FULL_PATH_NAMES = NO FULL_PATH_NAMES = NO
@ -38,7 +38,7 @@ HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = YES INTERNAL_DOCS = YES
CASE_SENSE_NAMES = YES CASE_SENSE_NAMES = YES
HIDE_SCOPE_NAMES = NO HIDE_SCOPE_NAMES = YES
SHOW_INCLUDE_FILES = YES SHOW_INCLUDE_FILES = YES
INLINE_INFO = YES INLINE_INFO = YES
SORT_MEMBER_DOCS = NO SORT_MEMBER_DOCS = NO
@ -81,6 +81,7 @@ INPUT = @top_srcdir@/src/SMESH_SWIG
FILE_PATTERNS = smeshDC.py FILE_PATTERNS = smeshDC.py
IMAGE_PATH = @srcdir@/images IMAGE_PATH = @srcdir@/images
RECURSIVE = NO RECURSIVE = NO
EXAMPLE_PATH = @top_srcdir@/src/SMESH_SWIG
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
#HTML related options #HTML related options
@ -107,19 +108,26 @@ GENERATE_RTF = NO
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Configuration options related to the dot tool # Configuration options related to the dot tool
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES #CLASS_DIAGRAMS = YES
CLASS_DIAGRAMS = NO
HIDE_UNDOC_RELATIONS = NO HIDE_UNDOC_RELATIONS = NO
HAVE_DOT = YES #HAVE_DOT = YES
CLASS_GRAPH = YES HAVE_DOT = NO
#CLASS_GRAPH = YES
CLASS_GRAPH = NO
COLLABORATION_GRAPH = NO COLLABORATION_GRAPH = NO
GROUP_GRAPHS = NO GROUP_GRAPHS = NO
UML_LOOK = NO UML_LOOK = NO
TEMPLATE_RELATIONS = YES #TEMPLATE_RELATIONS = YES
INCLUDE_GRAPH = YES #INCLUDE_GRAPH = YES
TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = NO
INCLUDED_BY_GRAPH = NO INCLUDED_BY_GRAPH = NO
CALL_GRAPH = NO CALL_GRAPH = NO
GRAPHICAL_HIERARCHY = YES #GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES #DIRECTORY_GRAPH = YES
GRAPHICAL_HIERARCHY = NO
DIRECTORY_GRAPH = NO
DOT_IMAGE_FORMAT = jpg DOT_IMAGE_FORMAT = jpg
DOT_PATH = DOT_PATH =
DOTFILE_DIRS = DOTFILE_DIRS =

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 63 KiB

View File

@ -34,6 +34,12 @@ become the elements of Group1 on the Compound_Mesh, or</li>
becomes Group1_2. See \ref grouping_elements_page "Creating Groups" becomes Group1_2. See \ref grouping_elements_page "Creating Groups"
for more information about groups.</li> for more information about groups.</li>
</ul> </ul>
<li><b>Create common groups for initial meshes</b> checkbox permits to
automatically create groups of all elements of the same type
(nodes, edges, faces and volumes) for the resulting mesh from the
elements
of the initial meshes.
</li>
<li>You can simply unite meshes or choose to <b>Merge coincident nodes <li>You can simply unite meshes or choose to <b>Merge coincident nodes
and elements</b>, in which case it is possible to define the \b Tolerance and elements</b>, in which case it is possible to define the \b Tolerance
for this operation.</li> for this operation.</li>
@ -43,4 +49,4 @@ for this operation.</li>
\image html image160.gif \image html image160.gif
*/ */

View File

@ -5,6 +5,37 @@
\n Python package smesh defines several classes, destined for easy and \n Python package smesh defines several classes, destined for easy and
clear mesh creation and edition (see the \ref introduction_to_mesh_python_page "example"). clear mesh creation and edition (see the \ref introduction_to_mesh_python_page "example").
\n Also, please see \ref smeshDC "documentation for smesh.py" \n Please draw your attention to the below notes before address to
the \ref smeshDC "documentation for smesh.py"
*/ \n 1. The main page of the \ref smeshDC "documentation for smesh.py"
contains a list of data structures and a list of functions,
provided by the package smesh.py. The first item in the data
structures list (\ref smeshDC::smeshDC "class smesh") also
represents documentation for methods of the package smesh.py itself.
\n 2. Package smesh.py gives interface to create and manage
meshes. Please, use it to create an empty mesh or to import
it from data file.
\n 3. Once you have created a mesh, you can manage it via its own
methods. See \ref smeshDC::Mesh "class Mesh" documentation for
them (it is also accessible by the second item "class Mesh" in the
data structures list).
\n 4. Class Mesh allows to assign algorithms to a mesh.
\n \t Please note, that there are always available some algorithms,
included in standard Salome installation:
- REGULAR(1D), COMPOSITE(1D), MEFISTO(2D), Quadrangle(2D), Hexa(3D), etc.
\n Also there are some algorithms, which can be installed optionally,
\n some of them are based on open-source meshers:
- NETGEN(1D-2D,2D,1D-2D-3D,3D),
\n others are based on commercial meshers:
- GHS3D(3D).
\n \t To add hypotheses, please use interfaces, provided by the
assigned algorithms.
*/

View File

@ -275,6 +275,20 @@ module SMESH
in double theMergeTolerance) in double theMergeTolerance)
raises ( SALOME::SALOME_Exception ); raises ( SALOME::SALOME_Exception );
/*!
* Concatenate the given meshes into one mesh.
* Union groups with the same name and type if
* theUniteIdenticalGroups flag is true.
* Merge coincident nodes and elements if
* theMergeNodesAndElements flag is true.
* Create the groups of all elements from initial meshes.
*/
SMESH_Mesh ConcatenateWithGroups(in mesh_array theMeshesArray,
in boolean theUniteIdenticalGroups,
in boolean theMergeNodesAndElements,
in double theMergeTolerance)
raises ( SALOME::SALOME_Exception );
/*! /*!
* \brief Return id of object, registered in current study context * \brief Return id of object, registered in current study context
* *

View File

@ -283,6 +283,14 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
// PAL16857(SMESH not conform to the MED convention): // PAL16857(SMESH not conform to the MED convention):
if ( aMeshDimension == 2 && anIsZDimension ) // 2D only if mesh is in XOY plane if ( aMeshDimension == 2 && anIsZDimension ) // 2D only if mesh is in XOY plane
aMeshDimension = 3; aMeshDimension = 3;
// PAL18941(a saved study with a mesh belong Z is opened and the mesh is belong X)
if ( aMeshDimension == 1 && !anIsXDimension ) // 1D only if mesh is along OX
if ( anIsYDimension ) {
aMeshDimension = 2;
anIsXDimension = true;
} else {
aMeshDimension = 3;
}
} }
SMDS_NodeIteratorPtr aNodesIter = myMesh->nodesIterator(); SMDS_NodeIteratorPtr aNodesIter = myMesh->nodesIterator();

View File

@ -2,6 +2,7 @@
// Created : Mon Sep 24 18:32:41 2007 // Created : Mon Sep 24 18:32:41 2007
// Author : Edward AGAPOV (eap) // Author : Edward AGAPOV (eap)
using namespace std;
#ifndef SMDS_MeshInfo_HeaderFile #ifndef SMDS_MeshInfo_HeaderFile
#define SMDS_MeshInfo_HeaderFile #define SMDS_MeshInfo_HeaderFile

View File

@ -21,6 +21,8 @@
// Created : Mon Aug 2 10:30:00 2004 // Created : Mon Aug 2 10:30:00 2004
// Author : Edward AGAPOV (eap) // Author : Edward AGAPOV (eap)
using namespace std;
#include "SMESH_Block.hxx" #include "SMESH_Block.hxx"
#include <BRepAdaptor_Curve.hxx> #include <BRepAdaptor_Curve.hxx>

View File

@ -27,6 +27,8 @@
// Author : Nicolas Geimer & Aurélien Motteux (OCC) // Author : Nicolas Geimer & Aurélien Motteux (OCC)
// Module : SMESH // Module : SMESH
using namespace std;
#ifndef _SMESH_OCTREENODE_HXX_ #ifndef _SMESH_OCTREENODE_HXX_
#define _SMESH_OCTREENODE_HXX_ #define _SMESH_OCTREENODE_HXX_

View File

@ -21,6 +21,8 @@
// Created : Mon Aug 2 10:30:00 2004 // Created : Mon Aug 2 10:30:00 2004
// Author : Edward AGAPOV (eap) // Author : Edward AGAPOV (eap)
using namespace std;
#include "SMESH_Pattern.hxx" #include "SMESH_Pattern.hxx"
#include <BRepAdaptor_Curve.hxx> #include <BRepAdaptor_Curve.hxx>

View File

@ -21,6 +21,8 @@
// Created : Mon Aug 2 10:30:00 2004 // Created : Mon Aug 2 10:30:00 2004
// Author : Edward AGAPOV (eap) // Author : Edward AGAPOV (eap)
using namespace std;
#ifndef SMESH_Pattern_HeaderFile #ifndef SMESH_Pattern_HeaderFile
#define SMESH_Pattern_HeaderFile #define SMESH_Pattern_HeaderFile

View File

@ -150,17 +150,21 @@ SMESHGUI_BuildCompoundDlg::SMESHGUI_BuildCompoundDlg( SMESHGUI* theModule)
ComboBoxUnion = new QComboBox(GroupArgs, "ComboBoxUnion"); ComboBoxUnion = new QComboBox(GroupArgs, "ComboBoxUnion");
GroupArgsLayout->addMultiCellWidget(ComboBoxUnion, 1, 1, 3, 3); GroupArgsLayout->addMultiCellWidget(ComboBoxUnion, 1, 1, 3, 3);
CheckBoxCommon = new QCheckBox(GroupArgs, "CheckBoxCommon");
CheckBoxCommon->setText(tr("CREATE_COMMON_GROUPS" ));
GroupArgsLayout->addMultiCellWidget(CheckBoxCommon, 2, 2, 0, 3);
CheckBoxMerge = new QCheckBox(GroupArgs, "CheckBoxMerge"); CheckBoxMerge = new QCheckBox(GroupArgs, "CheckBoxMerge");
CheckBoxMerge->setText(tr("MERGE_NODES_AND_ELEMENTS" )); CheckBoxMerge->setText(tr("MERGE_NODES_AND_ELEMENTS" ));
GroupArgsLayout->addMultiCellWidget(CheckBoxMerge, 2, 2, 0, 3); GroupArgsLayout->addMultiCellWidget(CheckBoxMerge, 3, 3, 0, 3);
TextLabelTol = new QLabel (GroupArgs, "TextLabelTol"); TextLabelTol = new QLabel (GroupArgs, "TextLabelTol");
TextLabelTol->setText(tr("SMESH_TOLERANCE")); TextLabelTol->setText(tr("SMESH_TOLERANCE"));
TextLabelTol->setAlignment(Qt::AlignCenter); TextLabelTol->setAlignment(Qt::AlignCenter);
GroupArgsLayout->addMultiCellWidget(TextLabelTol, 3, 3, 0, 1); GroupArgsLayout->addMultiCellWidget(TextLabelTol, 4, 4, 0, 1);
SpinBoxTol = new SMESHGUI_SpinBox (GroupArgs, "SpinBoxTol"); SpinBoxTol = new SMESHGUI_SpinBox (GroupArgs, "SpinBoxTol");
SpinBoxTol->RangeStepAndValidator(0.0, COORD_MAX, 0.1, 6); SpinBoxTol->RangeStepAndValidator(0.0, COORD_MAX, 0.1, 6);
GroupArgsLayout->addMultiCellWidget(SpinBoxTol, 3, 3, 2, 3); GroupArgsLayout->addMultiCellWidget(SpinBoxTol, 4, 4, 2, 3);
SMESHGUI_BuildCompoundDlgLayout->addWidget(GroupArgs, 2, 0); SMESHGUI_BuildCompoundDlgLayout->addWidget(GroupArgs, 2, 0);
@ -313,12 +317,18 @@ bool SMESHGUI_BuildCompoundDlg::ClickOnApply()
SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen(); SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen();
// concatenate meshes // concatenate meshes
SMESH::SMESH_Mesh_var aCompoundMesh = SMESH::SMESH_Mesh_var aCompoundMesh;
aSMESHGen->Concatenate(myMeshArray, if(CheckBoxCommon->isChecked())
!(ComboBoxUnion->currentItem()), aCompoundMesh = aSMESHGen->ConcatenateWithGroups(myMeshArray,
CheckBoxMerge->isChecked(), !(ComboBoxUnion->currentItem()),
SpinBoxTol->GetValue()); CheckBoxMerge->isChecked(),
SpinBoxTol->GetValue());
else
aCompoundMesh = aSMESHGen->Concatenate(myMeshArray,
!(ComboBoxUnion->currentItem()),
CheckBoxMerge->isChecked(),
SpinBoxTol->GetValue());
SMESH::SetName( SMESH::FindSObject( aCompoundMesh ), LineEditName->text().latin1() ); SMESH::SetName( SMESH::FindSObject( aCompoundMesh ), LineEditName->text().latin1() );
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();
mySMESHGUI->updateObjBrowser(); mySMESHGUI->updateObjBrowser();

View File

@ -108,6 +108,7 @@ public :
QLineEdit* LineEditMeshes; QLineEdit* LineEditMeshes;
QLabel* TextLabelUnion; QLabel* TextLabelUnion;
QComboBox* ComboBoxUnion; QComboBox* ComboBoxUnion;
QCheckBox* CheckBoxCommon;
QCheckBox* CheckBoxMerge; QCheckBox* CheckBoxMerge;
QLabel* TextLabelTol; QLabel* TextLabelTol;
SMESHGUI_SpinBox* SpinBoxTol; SMESHGUI_SpinBox* SpinBoxTol;

View File

@ -18,6 +18,8 @@
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// //
using namespace std;
#ifndef SMESHGUI_EditMeshDlg_H #ifndef SMESHGUI_EditMeshDlg_H
#define SMESHGUI_EditMeshDlg_H #define SMESHGUI_EditMeshDlg_H

View File

@ -17,6 +17,8 @@
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
using namespace std;
#ifndef SMESHGUI_VTKUtils_HeaderFile #ifndef SMESHGUI_VTKUtils_HeaderFile
#define SMESHGUI_VTKUtils_HeaderFile #define SMESHGUI_VTKUtils_HeaderFile

View File

@ -338,7 +338,8 @@ void _pyGen::Process( const Handle(_pyCommand)& theCommand )
} }
// Concatenate( [mesh1, ...], ... ) // Concatenate( [mesh1, ...], ... )
if ( theCommand->GetMethod() == "Concatenate" ) if ( theCommand->GetMethod() == "Concatenate" ||
theCommand->GetMethod() == "ConcatenateWithGroups")
{ {
AddMeshAccessorMethod( theCommand ); AddMeshAccessorMethod( theCommand );
} }

View File

@ -1418,6 +1418,52 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::Concatenate(const SMESH::mesh_array& theMeshe
CORBA::Boolean theMergeNodesAndElements, CORBA::Boolean theMergeNodesAndElements,
CORBA::Double theMergeTolerance) CORBA::Double theMergeTolerance)
throw ( SALOME::SALOME_Exception ) throw ( SALOME::SALOME_Exception )
{
return ConcatenateCommon(theMeshesArray,
theUniteIdenticalGroups,
theMergeNodesAndElements,
theMergeTolerance,
false);
}
//================================================================================
/*!
* SMESH_Gen_i::ConcatenateWithGroups
*
* Concatenate the given meshes into one mesh
* Create the groups of all elements from initial meshes
*/
//================================================================================
SMESH::SMESH_Mesh_ptr
SMESH_Gen_i::ConcatenateWithGroups(const SMESH::mesh_array& theMeshesArray,
CORBA::Boolean theUniteIdenticalGroups,
CORBA::Boolean theMergeNodesAndElements,
CORBA::Double theMergeTolerance)
throw ( SALOME::SALOME_Exception )
{
return ConcatenateCommon(theMeshesArray,
theUniteIdenticalGroups,
theMergeNodesAndElements,
theMergeTolerance,
true);
}
//================================================================================
/*!
* SMESH_Gen_i::ConcatenateCommon
*
* Concatenate the given meshes into one mesh
*/
//================================================================================
SMESH::SMESH_Mesh_ptr
SMESH_Gen_i::ConcatenateCommon(const SMESH::mesh_array& theMeshesArray,
CORBA::Boolean theUniteIdenticalGroups,
CORBA::Boolean theMergeNodesAndElements,
CORBA::Double theMergeTolerance,
CORBA::Boolean theCommonGroups)
throw ( SALOME::SALOME_Exception )
{ {
typedef map<int, int> TIDsMap; typedef map<int, int> TIDsMap;
typedef list<SMESH::SMESH_Group_var> TListOfNewGroups; typedef list<SMESH::SMESH_Group_var> TListOfNewGroups;
@ -1458,6 +1504,23 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::Concatenate(const SMESH::mesh_array& theMeshe
const SMDS_MeshElement* aNewElem = 0; const SMDS_MeshElement* aNewElem = 0;
int anElemNbNodes = 0; int anElemNbNodes = 0;
int anNbNodes = 0;
int anNbEdges = 0;
int anNbFaces = 0;
int anNbVolumes = 0;
SMESH::long_array_var anIDsNodes = new SMESH::long_array();
SMESH::long_array_var anIDsEdges = new SMESH::long_array();
SMESH::long_array_var anIDsFaces = new SMESH::long_array();
SMESH::long_array_var anIDsVolumes = new SMESH::long_array();
if( theCommonGroups ) {
anIDsNodes->length( anInitMeshDS->NbNodes() );
anIDsEdges->length( anInitMeshDS->NbEdges() );
anIDsFaces->length( anInitMeshDS->NbFaces() );
anIDsVolumes->length( anInitMeshDS->NbVolumes() );
}
for ( int j = 0; itElems->more(); j++) { for ( int j = 0; itElems->more(); j++) {
anElem = itElems->next(); anElem = itElems->next();
SMDSAbs_ElementType anElemType = anElem->GetType(); SMDSAbs_ElementType anElemType = anElem->GetType();
@ -1474,6 +1537,8 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::Concatenate(const SMESH::mesh_array& theMeshe
if ( nodesMap.find(aNode->GetID()) == nodesMap.end() ) { if ( nodesMap.find(aNode->GetID()) == nodesMap.end() ) {
aNewNode = aNewMeshDS->AddNode(aNode->X(), aNode->Y(), aNode->Z()); aNewNode = aNewMeshDS->AddNode(aNode->X(), aNode->Y(), aNode->Z());
nodesMap.insert( make_pair(aNode->GetID(), aNewNode->GetID()) ); nodesMap.insert( make_pair(aNode->GetID(), aNewNode->GetID()) );
if( theCommonGroups )
anIDsNodes[anNbNodes++] = aNewNode->GetID();
} }
else else
aNewNode = aNewMeshDS->FindNode( nodesMap.find(aNode->GetID())->second ); aNewNode = aNewMeshDS->FindNode( nodesMap.find(aNode->GetID())->second );
@ -1489,6 +1554,8 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::Concatenate(const SMESH::mesh_array& theMeshe
aNewElem = aNewMeshDS->AddPolyhedralVolume(aNodesArray, aNewElem = aNewMeshDS->AddPolyhedralVolume(aNodesArray,
aVolume->GetQuanities()); aVolume->GetQuanities());
elemsMap.insert(make_pair(anElem->GetID(), aNewElem->GetID())); elemsMap.insert(make_pair(anElem->GetID(), aNewElem->GetID()));
if( theCommonGroups )
anIDsVolumes[anNbVolumes++] = aNewElem->GetID();
} }
} }
else { else {
@ -1497,6 +1564,14 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::Concatenate(const SMESH::mesh_array& theMeshe
anElemType, anElemType,
anElem->IsPoly()); anElem->IsPoly());
elemsMap.insert(make_pair(anElem->GetID(), aNewElem->GetID())); elemsMap.insert(make_pair(anElem->GetID(), aNewElem->GetID()));
if( theCommonGroups ) {
if( anElemType == SMDSAbs_Edge )
anIDsEdges[anNbEdges++] = aNewElem->GetID();
else if( anElemType == SMDSAbs_Face )
anIDsFaces[anNbFaces++] = aNewElem->GetID();
else if( anElemType == SMDSAbs_Volume )
anIDsVolumes[anNbVolumes++] = aNewElem->GetID();
}
} }
}//elems loop }//elems loop
@ -1507,12 +1582,81 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::Concatenate(const SMESH::mesh_array& theMeshe
SMESH::long_array_var anInitIDs = new SMESH::long_array(); SMESH::long_array_var anInitIDs = new SMESH::long_array();
SMESH::long_array_var anNewIDs = new SMESH::long_array(); SMESH::long_array_var anNewIDs = new SMESH::long_array();
SMESH::SMESH_Group_var aNewGroup; SMESH::SMESH_Group_var aNewGroup;
SMESH::ElementType aGroupType;
CORBA::String_var aGroupName;
if ( theCommonGroups ) {
for(aGroupType=SMESH::NODE;aGroupType<=SMESH::VOLUME;aGroupType=(SMESH::ElementType)(aGroupType+1)) {
string str = "Gr";
SALOMEDS::SObject_var aMeshSObj = ObjectToSObject( myCurrentStudy, anInitMesh );
if(aMeshSObj)
str += aMeshSObj->GetName();
str += "_";
int anLen = 0;
switch(aGroupType) {
case SMESH::NODE:
str += "Nodes";
anIDsNodes->length(anNbNodes);
anLen = anNbNodes;
break;
case SMESH::EDGE:
str += "Edges";
anIDsEdges->length(anNbEdges);
anLen = anNbEdges;
break;
case SMESH::FACE:
str += "Faces";
anIDsFaces->length(anNbFaces);
anLen = anNbFaces;
break;
case SMESH::VOLUME:
str += "Volumes";
anIDsVolumes->length(anNbVolumes);
anLen = anNbVolumes;
break;
default:
break;
}
if(anLen) {
aGroupName = str.c_str();
// add a new group in the mesh
aNewGroup = aNewImpl->CreateGroup(aGroupType, aGroupName);
switch(aGroupType) {
case SMESH::NODE:
aNewGroup->Add( anIDsNodes );
break;
case SMESH::EDGE:
aNewGroup->Add( anIDsEdges );
break;
case SMESH::FACE:
aNewGroup->Add( anIDsFaces );
break;
case SMESH::VOLUME:
aNewGroup->Add( anIDsVolumes );
break;
default:
break;
}
aListOfNewGroups.clear();
aListOfNewGroups.push_back(aNewGroup);
aGroupsMap.insert(make_pair( make_pair(aGroupName, aGroupType), aListOfNewGroups ));
}
}
}
// check that current group name and type don't have identical ones in union mesh
for (int i = 0; i < aListOfGroups->length(); i++) { for (int i = 0; i < aListOfGroups->length(); i++) {
aGroup = aListOfGroups[i]; aGroup = aListOfGroups[i];
aListOfNewGroups.clear(); aListOfNewGroups.clear();
SMESH::ElementType aGroupType = aGroup->GetType(); aGroupType = aGroup->GetType();
CORBA::String_var aGroupName = aGroup->GetName(); aGroupName = aGroup->GetName();
TGroupsMap::iterator anIter = aGroupsMap.find(make_pair(aGroupName, aGroupType)); TGroupsMap::iterator anIter = aGroupsMap.find(make_pair(aGroupName, aGroupType));
// convert a list of IDs // convert a list of IDs
@ -1579,7 +1723,11 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::Concatenate(const SMESH::mesh_array& theMeshe
} }
// Update Python script // Update Python script
aPythonDump << aNewMesh << " = " << this << ".Concatenate("; aPythonDump << aNewMesh << " = " << this;
if( !theCommonGroups )
aPythonDump << ".Concatenate(";
else
aPythonDump << ".ConcatenateWithGroups(";
aPythonDump << "["; aPythonDump << "[";
for ( int i = 0; i < theMeshesArray.length(); i++) { for ( int i = 0; i < theMeshesArray.length(); i++) {
if (i > 0) aPythonDump << ", "; if (i > 0) aPythonDump << ", ";
@ -1587,7 +1735,7 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::Concatenate(const SMESH::mesh_array& theMeshe
} }
aPythonDump << "], "; aPythonDump << "], ";
aPythonDump << theUniteIdenticalGroups << ", " aPythonDump << theUniteIdenticalGroups << ", "
<< theMergeNodesAndElements << ", " << theMergeNodesAndElements << ", "
<< theMergeTolerance << ")"; << theMergeTolerance << ")";
return aNewMesh._retn(); return aNewMesh._retn();

View File

@ -259,6 +259,14 @@ public:
CORBA::Long theElementID) CORBA::Long theElementID)
throw ( SALOME::SALOME_Exception ); throw ( SALOME::SALOME_Exception );
// Concatenate the given meshes into one mesh
SMESH::SMESH_Mesh_ptr ConcatenateCommon(const SMESH::mesh_array& theMeshesArray,
CORBA::Boolean theUniteIdenticalGroups,
CORBA::Boolean theMergeNodesAndElements,
CORBA::Double theMergeTolerance,
CORBA::Boolean theCommonGroups)
throw ( SALOME::SALOME_Exception );
// Concatenate the given meshes into one mesh // Concatenate the given meshes into one mesh
SMESH::SMESH_Mesh_ptr Concatenate(const SMESH::mesh_array& theMeshesArray, SMESH::SMESH_Mesh_ptr Concatenate(const SMESH::mesh_array& theMeshesArray,
CORBA::Boolean theUniteIdenticalGroups, CORBA::Boolean theUniteIdenticalGroups,
@ -266,6 +274,13 @@ public:
CORBA::Double theMergeTolerance) CORBA::Double theMergeTolerance)
throw ( SALOME::SALOME_Exception ); throw ( SALOME::SALOME_Exception );
// Concatenate the given meshes into one mesh
// Create the groups of all elements from initial meshes
SMESH::SMESH_Mesh_ptr ConcatenateWithGroups(const SMESH::mesh_array& theMeshesArray,
CORBA::Boolean theUniteIdenticalGroups,
CORBA::Boolean theMergeNodesAndElements,
CORBA::Double theMergeTolerance)
throw ( SALOME::SALOME_Exception );
// **************************************************** // ****************************************************
// Interface inherited methods (from SALOMEDS::Driver) // Interface inherited methods (from SALOMEDS::Driver)

View File

@ -1946,12 +1946,12 @@ SMESH::long_array* SMESH_Mesh_i::GetSubMeshNodesId(const CORBA::Long ShapeID, CO
SMESHDS_SubMesh* SDSM = SM->GetSubMeshDS(); SMESHDS_SubMesh* SDSM = SM->GetSubMeshDS();
if(!SDSM) return aResult._retn(); if(!SDSM) return aResult._retn();
map<int,const SMDS_MeshElement*> theElems; set<int> theElems;
if( !all || (SDSM->NbElements()==0 && SDSM->NbNodes()==1) ) { if( !all || (SDSM->NbElements()==0) ) { // internal nodes or vertex submesh
SMDS_NodeIteratorPtr nIt = SDSM->GetNodes(); SMDS_NodeIteratorPtr nIt = SDSM->GetNodes();
while ( nIt->more() ) { while ( nIt->more() ) {
const SMDS_MeshNode* elem = nIt->next(); const SMDS_MeshNode* elem = nIt->next();
theElems.insert( make_pair(elem->GetID(),elem) ); theElems.insert( elem->GetID() );
} }
} }
else { // all nodes of submesh elements else { // all nodes of submesh elements
@ -1961,16 +1961,16 @@ SMESH::long_array* SMESH_Mesh_i::GetSubMeshNodesId(const CORBA::Long ShapeID, CO
SMDS_ElemIteratorPtr nIt = anElem->nodesIterator(); SMDS_ElemIteratorPtr nIt = anElem->nodesIterator();
while ( nIt->more() ) { while ( nIt->more() ) {
const SMDS_MeshElement* elem = nIt->next(); const SMDS_MeshElement* elem = nIt->next();
theElems.insert( make_pair(elem->GetID(),elem) ); theElems.insert( elem->GetID() );
} }
} }
} }
aResult->length(theElems.size()); aResult->length(theElems.size());
map<int, const SMDS_MeshElement * >::iterator itElem; set<int>::iterator itElem;
int i = 0; int i = 0;
for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ ) for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ )
aResult[i++] = (*itElem).first; aResult[i++] = *itElem;
return aResult._retn(); return aResult._retn();
} }

File diff suppressed because it is too large Load Diff

View File

@ -29,6 +29,8 @@
#ifndef _STD_MESHERS_DISTRIBUTION_HXX_ #ifndef _STD_MESHERS_DISTRIBUTION_HXX_
#define _STD_MESHERS_DISTRIBUTION_HXX_ #define _STD_MESHERS_DISTRIBUTION_HXX_
using namespace std;
#include "SMESH_StdMeshers.hxx" #include "SMESH_StdMeshers.hxx"
#include <vector> #include <vector>

View File

@ -24,6 +24,8 @@
// File : StdMeshers_Penta_3D.cxx // File : StdMeshers_Penta_3D.cxx
// Module : SMESH // Module : SMESH
using namespace std;
#include "StdMeshers_Penta_3D.hxx" #include "StdMeshers_Penta_3D.hxx"
#include "utilities.h" #include "utilities.h"

View File

@ -25,6 +25,7 @@
// Created : Fri Oct 27 10:24:28 2006 // Created : Fri Oct 27 10:24:28 2006
// Author : Edward AGAPOV (eap) // Author : Edward AGAPOV (eap)
using namespace std;
#include "StdMeshers_ProjectionUtils.hxx" #include "StdMeshers_ProjectionUtils.hxx"

View File

@ -191,10 +191,8 @@ namespace {
{ {
// old nodes are shared by edges and new ones are shared // old nodes are shared by edges and new ones are shared
// only by faces created by mapper // only by faces created by mapper
bool isOld = false; SMDS_ElemIteratorPtr invEdge = node->GetInverseElementIterator(SMDSAbs_Edge);
SMDS_ElemIteratorPtr invElem = node->GetInverseElementIterator(); bool isOld = invEdge->more();
while ( !isOld && invElem->more() )
isOld = ( invElem->next()->GetType() == SMDSAbs_Edge );
return isOld; return isOld;
} }
@ -212,12 +210,13 @@ namespace {
MeshCleaner( SMESH_subMesh* faceSubMesh ): sm(faceSubMesh) {} MeshCleaner( SMESH_subMesh* faceSubMesh ): sm(faceSubMesh) {}
~MeshCleaner() { Clean(sm); } ~MeshCleaner() { Clean(sm); }
void Release() { sm = 0; } // mesh will not be removed void Release() { sm = 0; } // mesh will not be removed
static void Clean( SMESH_subMesh* sm ) static void Clean( SMESH_subMesh* sm, bool withSub=true )
{ {
if ( !sm ) return; if ( !sm ) return;
switch ( sm->GetSubShape().ShapeType() ) { // PAL16567, 18920. Remove face nodes as well
case TopAbs_VERTEX: // switch ( sm->GetSubShape().ShapeType() ) {
case TopAbs_EDGE: { // case TopAbs_VERTEX:
// case TopAbs_EDGE: {
SMDS_NodeIteratorPtr nIt = sm->GetSubMeshDS()->GetNodes(); SMDS_NodeIteratorPtr nIt = sm->GetSubMeshDS()->GetNodes();
SMESHDS_Mesh* mesh = sm->GetFather()->GetMeshDS(); SMESHDS_Mesh* mesh = sm->GetFather()->GetMeshDS();
while ( nIt->more() ) { while ( nIt->more() ) {
@ -226,12 +225,13 @@ namespace {
mesh->RemoveNode( node ); mesh->RemoveNode( node );
} }
// do not break but iterate over DependsOn() // do not break but iterate over DependsOn()
} // }
default: // default:
if ( !withSub ) return;
SMESH_subMeshIteratorPtr smIt = sm->getDependsOnIterator(false,false); SMESH_subMeshIteratorPtr smIt = sm->getDependsOnIterator(false,false);
while ( smIt->more() ) while ( smIt->more() )
Clean( smIt->next() ); Clean( smIt->next(), false );
} // }
} }
}; };
@ -474,7 +474,7 @@ bool StdMeshers_Projection_2D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape&
// it will remove mesh built by pattern mapper on edges and vertices // it will remove mesh built by pattern mapper on edges and vertices
// in failure case // in failure case
// MeshCleaner cleaner( tgtSubMesh ); MeshCleaner cleaner( tgtSubMesh );
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
// mapper doesn't take care of nodes already existing on edges and vertices, // mapper doesn't take care of nodes already existing on edges and vertices,
@ -617,7 +617,7 @@ bool StdMeshers_Projection_2D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape&
} }
} }
//cleaner.Release(); // do not remove mesh cleaner.Release(); // do not remove mesh
return true; return true;
} }

View File

@ -18,6 +18,8 @@
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// //
using namespace std;
#include "StdMeshersGUI_DistrPreview.h" #include "StdMeshersGUI_DistrPreview.h"
#include <Expr_NamedUnknown.hxx> #include <Expr_NamedUnknown.hxx>