diff --git a/doc/salome/gui/SMESH/images/hexa_ijk_mesh.png b/doc/salome/gui/SMESH/images/hexa_ijk_mesh.png
new file mode 100644
index 000000000..577ee8ec6
Binary files /dev/null and b/doc/salome/gui/SMESH/images/hexa_ijk_mesh.png differ
diff --git a/doc/salome/gui/SMESH/images/image88.jpg b/doc/salome/gui/SMESH/images/image88.jpg
old mode 100755
new mode 100644
index 3b2a9739c..9499ab219
Binary files a/doc/salome/gui/SMESH/images/image88.jpg and b/doc/salome/gui/SMESH/images/image88.jpg differ
diff --git a/doc/salome/gui/SMESH/images/sewing_auto.png b/doc/salome/gui/SMESH/images/sewing_auto.png
index 0bf19b490..f81cfe277 100644
Binary files a/doc/salome/gui/SMESH/images/sewing_auto.png and b/doc/salome/gui/SMESH/images/sewing_auto.png differ
diff --git a/doc/salome/gui/SMESH/input/adding_nodes_and_elements.doc b/doc/salome/gui/SMESH/input/adding_nodes_and_elements.doc
index 1aa0661ab..855b7e5ea 100644
--- a/doc/salome/gui/SMESH/input/adding_nodes_and_elements.doc
+++ b/doc/salome/gui/SMESH/input/adding_nodes_and_elements.doc
@@ -90,29 +90,35 @@ selecting them in the 3D viewer and click the \b Apply or
\anchor adding_0delems_on_all_nodes_anchor
Making 0D elements on Element Nodes
-There is another way to create 0D elements. It is possible to create
+There is another way to create 0D elements. It is possible to create
0D elements on all nodes of the selected mesh, sub-mesh, or a group of elements or nodes.
\image html dlg_0D_on_all_nodes.png
-In this dialog
+In this dialog
- The radio-buttons allow choosing the type of object to create 0D elements on.
- - Mesh, sub-mesh, group - this button allows selecting
- a mesh, a sub-mesh or a group to create 0D elements on the nodes of its
+
- Mesh, sub-mesh, group - this button allows selecting
+ a mesh, a sub-mesh or a group to create 0D elements on the nodes of its
elements. The name of the selected object is shown in the dialog.
- Elements - this button allows selecting elements in the
VTK viewer or typing their IDs in the dialog.
- Nodes - this button allows selecting nodes to create
0D elements on in the VTK viewer or typing their IDs in the dialog.
- - Set Filter button allows selecting elements or nodes
-by filtering mesh elements or nodes with different criteria
-(see \ref filtering_elements "Filter usage").
-- Switching on Add to group check-box allows specifying the
- name of the group to which all created or found 0D elements will be added. You can either select an existing group from
- a drop-down list, or enter the name of the group to be created.
+ - Set Filter button allows selecting elements or nodes
+ by filtering mesh elements or nodes with different criteria
+ (see \ref filtering_elements "Filter usage").
+ - Switching on Add to group check-box allows specifying the
+ name of the group to which all created or found (existing) 0D elements will
+ be added. You can either select an existing group from a drop-down
+ list, or enter the name of the group to be created. If a selected
+ existing \ref grouping_elements_page "group" is not Standalone
+ (Group On Geometry or Group On Filter) it will be converted to
+ Standalone.
+ \warning If Add to group is activated it has to be filled in.
+
@@ -124,7 +130,7 @@ by filtering mesh elements or nodes with different criteria
In this dialog box specify the nodes, which will form your ball elements,
either by selecting them in the 3D viewer or by manually entering their IDs,
specify the ball diameter and click the \b Apply or Apply and
-Close button.
+ Close button.
\image html add_ball.png
diff --git a/doc/salome/gui/SMESH/input/basic_meshing_algos.doc b/doc/salome/gui/SMESH/input/basic_meshing_algos.doc
index 4804800c5..090abd76f 100644
--- a/doc/salome/gui/SMESH/input/basic_meshing_algos.doc
+++ b/doc/salome/gui/SMESH/input/basic_meshing_algos.doc
@@ -39,8 +39,15 @@ number of mesh segments following an 1D hypothesis.
For meshing of 3D entities (solid objects):
-- Hexahedron (i,j,k)meshing algorithm - 6-sided solids are
- split into hexahedral (cuboid) elements.
+- Hexahedron (i,j,k) meshing algorithm - solids are
+ split into hexahedral elements thus forming a structured 3D
+ mesh. The algorithm requires that 2D mesh generated on a solid could
+ be considered as a mesh of a box, i.e. there should be six nodes shared
+ by three quadrangles and the rest nodes should be shared by four
+ quadrangles.
+\image html hexa_ijk_mesh.png "Structured mesh generated by Hexahedron (i,j,k) on a solid bound by 16 faces"
+
+
- \subpage cartesian_algo_page "Body Fitting" meshing
algorithm - solids are split into hexahedral elements forming
a Cartesian grid; polyhedra and other types of elements are generated
@@ -66,7 +73,7 @@ There is also a number of more specific algorithms:
- \subpage projection_algos_page "for meshing by projection of another mesh"
- \subpage import_algos_page "for meshing by importing elements from another mesh"
- \subpage radial_prism_algo_page "for meshing geometrical objects with cavities"
-- \subpage radial_quadrangle_1D2D_algo_page "for meshing special 2d faces (circles and part of circles)"
+- \subpage radial_quadrangle_1D2D_algo_page "for meshing special faces (circles and parts of circles)"
- \subpage use_existing_page "Use Edges to be Created Manually" and
\ref use_existing_page "Use Faces to be Created Manually" algorithms can be
used to create a 1D or a 2D mesh in a python script.
diff --git a/doc/salome/gui/SMESH/input/constructing_meshes.doc b/doc/salome/gui/SMESH/input/constructing_meshes.doc
index f28be8601..1a5112839 100644
--- a/doc/salome/gui/SMESH/input/constructing_meshes.doc
+++ b/doc/salome/gui/SMESH/input/constructing_meshes.doc
@@ -187,13 +187,9 @@ creation and computing) of the following steps:
which is a 2D object, you do not need to define a 3D Algorithm and
Hypotheses.
- In the Object Browser the structure of the new mesh will be
+ In the Object Browser the structure of the new mesh is
displayed as follows:
-
-
\image html image88.jpg
-
-
It contains:
- a mesh name (Mesh_mechanic);
@@ -203,6 +199,13 @@ creation and computing) of the following steps:
to the hypotheses chosen at the construction of the mesh;
- Applied algorithms folder containing the references
to the algorithms chosen at the construction of the mesh.
+ - SubMeshes on Face folder containing the sub-meshes
+ defined on geometrical faces. There also can be folders for
+ sub-meshes on vertices, edges, wires, shells, solids and
+ compounds.
+ - Groups of Faces folder containing the groups of mesh
+ faces. There also can be folders for groups of nodes, edges,
+ volumes 0D elements and balls.
There is an alternative way to assign Algorithms and Hypotheses by
@@ -212,15 +215,25 @@ creation and computing) of the following steps:
CustomMeshers.xml file located in the home directory. CustomMeshers.xml
file must describe sets of hypotheses in the
same way as ${SMESH_ROOT_DIR}/share/salome/resources/smesh/StdMeshers.xml
- file does (sets of hypotheses are enclosed between
- tags).
-
-
+ file does (sets of hypotheses are enclosed between \
+ tags). For example:
+~~~~~~{.xml}
+
+
+
+
+
+
+
+~~~~~~
+
+
\image html hypo_sets.png
List of sets of hypotheses. Tag [custom] is
automatically added to the sets defined by the user.
-
-
+
\note
- \a "Automatic" in the names of predefined sets of hypotheses
does not actually mean that they are suitable for meshing any
diff --git a/doc/salome/gui/SMESH/input/selection_filter_library.doc b/doc/salome/gui/SMESH/input/selection_filter_library.doc
index 6acd7e751..308706075 100644
--- a/doc/salome/gui/SMESH/input/selection_filter_library.doc
+++ b/doc/salome/gui/SMESH/input/selection_filter_library.doc
@@ -3,7 +3,7 @@
\page selection_filter_library_page Selection filter library
\n Selection filter library allows creating and storing in files
-filters that can be later reused for operations on meshes. You can
+filters that can be later loaded and used for operations on meshes. You can
access to it from the Main Menu via Tools / Selection filter library.
It is also possible to save any filter by invoking the filter library
from \a Filter dialog launched from any mesh operation.
diff --git a/doc/salome/gui/SMESH/input/sewing_meshes.doc b/doc/salome/gui/SMESH/input/sewing_meshes.doc
index 18be054a3..8697b36f4 100644
--- a/doc/salome/gui/SMESH/input/sewing_meshes.doc
+++ b/doc/salome/gui/SMESH/input/sewing_meshes.doc
@@ -63,9 +63,9 @@ To use \b Automatic sewing:
- The found groups of Coincident Free Borders are shown in a
list, a group per a line. Each group has its own color which is used
to display the borders of the group in the VTK Viewer. A free border
- within a group is designated by IDs of its first and last nodes within
- parenthesis. All borders present in the list will be sewn upon \b
- Apply.
+ within a group is designated by IDs of its first, second and last
+ nodes within parenthesis. All borders present in the list will be
+ sewn upon \b Apply.
- \b Remove button removes selected groups from the list.
- Select All check-box selects all groups in the list.
- When a group is selected, its borders appear in Edit Selected
diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx
index 146e8c12a..bb114051d 100644
--- a/src/SMESH/SMESH_MeshEditor.cxx
+++ b/src/SMESH/SMESH_MeshEditor.cxx
@@ -7963,10 +7963,6 @@ public:
const SMDS_MeshElement* Get() const
{ return myElem; }
- void Set(const SMDS_MeshElement* e) const
- { myElem = e; }
-
-
private:
mutable const SMDS_MeshElement* myElem;
};
diff --git a/src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.cxx b/src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.cxx
index 295f5c52e..96fca0d9f 100644
--- a/src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.cxx
+++ b/src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.cxx
@@ -223,6 +223,7 @@ SMESHGUI_Add0DElemsOnAllNodesOp::SMESHGUI_Add0DElemsOnAllNodesOp()
connect( myDlg, SIGNAL( selTypeChanged(int) ), SLOT( onSelTypeChange(int)));
connect( myDlg->myFilterBtn, SIGNAL( clicked()), SLOT( onSetFilter() ));
+ connect( myDlg->myGroupBox, SIGNAL( clicked(bool)), SLOT( updateButtons() ));
}
//================================================================================
@@ -270,6 +271,7 @@ void SMESHGUI_Add0DElemsOnAllNodesOp::selectionDone()
myIO.Nullify();
myDlg->setObjectText( 0, "");
+ updateButtons();
SALOME_ListIO aList;
selectionMgr()->selectedObjects( aList );
@@ -297,7 +299,8 @@ void SMESHGUI_Add0DElemsOnAllNodesOp::selectionDone()
// fill the list of existing groups
myDlg->myGroupListCmBox->clear();
myDlg->myGroupListCmBox->addItem( QString() );
- if ( !myIO.IsNull() && myIO->hasEntry()) {
+ if ( !myIO.IsNull() && myIO->hasEntry())
+ {
SMESH::SMESH_Mesh_var mesh = SMESH::GetMeshByIO( myIO );
_PTR(SObject) meshSO = SMESH::ObjectToSObject( mesh );
_PTR(SObject) group0DRoot;
@@ -313,9 +316,44 @@ void SMESHGUI_Add0DElemsOnAllNodesOp::selectionDone()
myDlg->myGroupListCmBox->addItem( groupName.c_str() );
}
}
+ // enable buttons
+ updateButtons();
}
}
+//=======================================================================
+//function : updateButtons
+//purpose : enable [Apply]
+//=======================================================================
+
+void SMESHGUI_Add0DElemsOnAllNodesOp::updateButtons()
+{
+ bool ok = false;
+
+ if (( !myIO.IsNull() && myIO->hasEntry() && !myDlg->objectText( 0 ).isEmpty() ) &&
+ ( !myDlg->myGroupBox->isChecked() || !myDlg->myGroupListCmBox->currentText().isEmpty() ))
+ {
+ SMESH::SMESH_Mesh_var mesh = SMESH::GetMeshByIO( myIO );
+ if ( !mesh->_is_nil() )
+ {
+ if ( myDlg->getSelectionType() == SEL_OBJECT )
+ ok = true;
+ else
+ {
+ QString ids = myDlg->objectText( 0 );
+ QStringList idList = ids.split( " ", QString::SkipEmptyParts );
+ const bool isElem = ( myDlg->getSelectionType() == SEL_ELEMENTS );
+ QStringList::iterator idIt = idList.begin();
+ for ( ; idIt != idList.end() && !ok; ++idIt )
+ ok = ( mesh->GetElementType( idIt->toLong(), isElem ) != SMESH::ALL );
+ }
+ }
+ }
+
+ myDlg->button( QtxDialog::Apply )->setEnabled( ok );
+ myDlg->button( QtxDialog::OK )->setEnabled( ok );
+}
+
//================================================================================
/*!
* \brief Return a filter of objects
@@ -496,3 +534,14 @@ void SMESHGUI_Add0DElemsOnAllNodesOp::onSetFilter()
myFilterDlg->show();
}
+
+//=======================================================================
+//function : onTextChanged
+//purpose : SLOT called when the user types IDs
+//=======================================================================
+
+void SMESHGUI_Add0DElemsOnAllNodesOp::onTextChanged( int obj, const QStringList& text )
+{
+ SMESHGUI_SelectionOp::onTextChanged( obj, text );
+ updateButtons();
+}
diff --git a/src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.h b/src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.h
index 49ae8724a..805b9316b 100644
--- a/src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.h
+++ b/src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.h
@@ -99,6 +99,8 @@ class SMESHGUI_EXPORT SMESHGUI_Add0DElemsOnAllNodesOp : public SMESHGUI_Selectio
virtual bool onApply();
void onSelTypeChange(int);
void onSetFilter();
+ virtual void onTextChanged( int, const QStringList& );
+ void updateButtons();
private:
SMESHGUI_Add0DElemsOnAllNodesDlg* myDlg;
diff --git a/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx b/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx
index 53b2cbf48..4c6ebea19 100644
--- a/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx
+++ b/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx
@@ -253,7 +253,7 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
OkButton->setAutoDefault(true);
OkButton->setDefault(true);
- ApplyButton = new QPushButton(tr("SMESH_BUT_APPLY"), GroupButtons);
+ ApplyButton = new QPushButton(tr("SMESH_BUT_APPLY"), GroupButtons);
ApplyButton->setAutoDefault(true);
CloseButton = new QPushButton(tr("SMESH_BUT_CLOSE"), GroupButtons);
@@ -444,64 +444,64 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
mesh->SetParameters( aParameters.join(":").toLatin1().constData() );
- SMESH::ListOfIDSources_var nodes = new SMESH::ListOfIDSources();
- SMESH::ListOfIDSources_var edges = new SMESH::ListOfIDSources();
- SMESH::ListOfIDSources_var faces = new SMESH::ListOfIDSources();
- maxSelType = SelectorWdg->GetSelected( nodes, edges, faces );
+ SMESH::ListOfIDSources_var nodes = new SMESH::ListOfIDSources();
+ SMESH::ListOfIDSources_var edges = new SMESH::ListOfIDSources();
+ SMESH::ListOfIDSources_var faces = new SMESH::ListOfIDSources();
+ maxSelType = SelectorWdg->GetSelected( nodes, edges, faces );
- // is it necessary to switch on the next Display Mode?
- SMESH::ElementType newType = (SMESH::ElementType)( maxSelType + 1 );
- SMESH::array_of_ElementType_var oldTypes = mesh->GetTypes();
- meshHadNewTypeBefore = false;
- for ( size_t i = 0; i < oldTypes->length() && !meshHadNewTypeBefore; ++i )
- meshHadNewTypeBefore = ( oldTypes[i] >= newType );
+ // is it necessary to switch on the next Display Mode?
+ SMESH::ElementType newType = (SMESH::ElementType)( maxSelType + 1 );
+ SMESH::array_of_ElementType_var oldTypes = mesh->GetTypes();
+ meshHadNewTypeBefore = false;
+ for ( size_t i = 0; i < oldTypes->length() && !meshHadNewTypeBefore; ++i )
+ meshHadNewTypeBefore = ( oldTypes[i] >= newType );
- SMESH::SMESH_MeshEditor_var aMeshEditor = mesh->GetMeshEditor();
- SMESH::SMESH_MeshEditor::Extrusion_Error retVal;
+ SMESH::SMESH_MeshEditor_var aMeshEditor = mesh->GetMeshEditor();
+ SMESH::SMESH_MeshEditor::Extrusion_Error retVal;
- SMESH::ListOfGroups_var groups =
- aMeshEditor->ExtrusionAlongPathObjects( nodes, edges, faces, myPath,
- GEOM::GEOM_Object::_nil(),
- aNodeStart, AnglesGrp->isChecked(),
- anAngles, LinearAnglesCheck->isChecked(),
- BasePointGrp->isChecked(), aBasePoint,
- makeGroups, retVal );
+ SMESH::ListOfGroups_var groups =
+ aMeshEditor->ExtrusionAlongPathObjects( nodes, edges, faces, myPath,
+ GEOM::GEOM_Object::_nil(),
+ aNodeStart, AnglesGrp->isChecked(),
+ anAngles, LinearAnglesCheck->isChecked(),
+ BasePointGrp->isChecked(), aBasePoint,
+ makeGroups, retVal );
- wc.suspend();
- switch (retVal) {
- case SMESH::SMESH_MeshEditor::EXTR_NO_ELEMENTS:
- SUIT_MessageBox::warning(this,
- tr("SMESH_ERROR"),
- tr("NO_ELEMENTS_SELECTED"));
- return false; break;
- case SMESH::SMESH_MeshEditor::EXTR_PATH_NOT_EDGE:
- SUIT_MessageBox::warning(this,
- tr("SMESH_ERROR"),
- tr("SELECTED_PATH_IS_NOT_EDGE"));
- return false; break;
- case SMESH::SMESH_MeshEditor::EXTR_BAD_PATH_SHAPE:
- SUIT_MessageBox::warning(this,
- tr("SMESH_ERROR"),
- tr("BAD_SHAPE_TYPE"));
- return false; break;
- case SMESH::SMESH_MeshEditor::EXTR_BAD_STARTING_NODE:
- SUIT_MessageBox::warning(this,
- tr("SMESH_ERROR"),
- tr("EXTR_BAD_STARTING_NODE"));
- return false; break;
- case SMESH::SMESH_MeshEditor::EXTR_BAD_ANGLES_NUMBER:
- SUIT_MessageBox::warning(this,
- tr("SMESH_ERROR"),
- tr("WRONG_ANGLES_NUMBER"));
- return false; break;
- case SMESH::SMESH_MeshEditor::EXTR_CANT_GET_TANGENT:
- SUIT_MessageBox::warning(this,
- tr("SMESH_ERROR"),
- tr("CANT_GET_TANGENT"));
- return false; break;
- case SMESH::SMESH_MeshEditor::EXTR_OK:
- break;
- }
+ wc.suspend();
+ switch (retVal) {
+ case SMESH::SMESH_MeshEditor::EXTR_NO_ELEMENTS:
+ SUIT_MessageBox::warning(this,
+ tr("SMESH_ERROR"),
+ tr("NO_ELEMENTS_SELECTED"));
+ return false; break;
+ case SMESH::SMESH_MeshEditor::EXTR_PATH_NOT_EDGE:
+ SUIT_MessageBox::warning(this,
+ tr("SMESH_ERROR"),
+ tr("SELECTED_PATH_IS_NOT_EDGE"));
+ return false; break;
+ case SMESH::SMESH_MeshEditor::EXTR_BAD_PATH_SHAPE:
+ SUIT_MessageBox::warning(this,
+ tr("SMESH_ERROR"),
+ tr("BAD_SHAPE_TYPE"));
+ return false; break;
+ case SMESH::SMESH_MeshEditor::EXTR_BAD_STARTING_NODE:
+ SUIT_MessageBox::warning(this,
+ tr("SMESH_ERROR"),
+ tr("EXTR_BAD_STARTING_NODE"));
+ return false; break;
+ case SMESH::SMESH_MeshEditor::EXTR_BAD_ANGLES_NUMBER:
+ SUIT_MessageBox::warning(this,
+ tr("SMESH_ERROR"),
+ tr("WRONG_ANGLES_NUMBER"));
+ return false; break;
+ case SMESH::SMESH_MeshEditor::EXTR_CANT_GET_TANGENT:
+ SUIT_MessageBox::warning(this,
+ tr("SMESH_ERROR"),
+ tr("CANT_GET_TANGENT"));
+ return false; break;
+ case SMESH::SMESH_MeshEditor::EXTR_OK:
+ break;
+ }
} catch (...) {
return false;
}
@@ -1048,11 +1048,19 @@ bool SMESHGUI_ExtrusionAlongPathDlg::isValuesValid()
if ( type != SMESH::NODE )
return false;
- SMESH::long_array_var elems = mesh->GetNodeInverseElements( aNodeStart );
- if ( elems->length() != 1 ||
- mesh->GetElementType( elems[0], true ) != SMESH::EDGE )
- return false;
-
+ if ( mesh->HasShapeToMesh() )
+ {
+ SMESH::NodePosition_var pos = mesh->GetNodePosition( aNodeStart );
+ if ( pos->shapeType != GEOM::VERTEX )
+ return false;
+ }
+ else
+ {
+ SMESH::long_array_var elems = mesh->GetNodeInverseElements( aNodeStart );
+ if ( elems->length() != 1 ||
+ mesh->GetElementType( elems[0], true ) != SMESH::EDGE )
+ return false;
+ }
return true;
}
diff --git a/src/SMESHGUI/SMESHGUI_MeshOp.cxx b/src/SMESHGUI/SMESHGUI_MeshOp.cxx
index 0b4c1eafc..f4912f423 100644
--- a/src/SMESHGUI/SMESHGUI_MeshOp.cxx
+++ b/src/SMESHGUI/SMESHGUI_MeshOp.cxx
@@ -206,11 +206,11 @@ void SMESHGUI_MeshOp::startOperation()
for ( int i = SMESH::DIM_0D; i <= SMESH::DIM_3D; i++ )
{
connect( myDlg->tab( i ), SIGNAL( createHyp( const int, const int ) ),
- this, SLOT( onCreateHyp( const int, const int ) ) );
+ this, SLOT( onCreateHyp( const int, const int ) ) );
connect( myDlg->tab( i ), SIGNAL( editHyp( const int, const int ) ),
- this, SLOT( onEditHyp( const int, const int ) ) );
+ this, SLOT( onEditHyp( const int, const int ) ) );
connect( myDlg->tab( i ), SIGNAL( selectAlgo( const int ) ),
- this, SLOT( onAlgoSelected( const int ) ) );
+ this, SLOT( onAlgoSelected( const int ) ) );
}
connect( myDlg, SIGNAL( hypoSet( const QString& )), SLOT( onHypoSet( const QString& )));
connect( myDlg, SIGNAL( geomSelectionByMesh( bool )), SLOT( onGeomSelectionByMesh( bool )));
@@ -1583,11 +1583,12 @@ void SMESHGUI_MeshOp::onAlgoSelected( const int theIndex,
// remember current algo
prevAlgo = algoByDim[ dim ] = hypData( dim, Algo, algoIndex );
}
- if ( myMaxShapeDim == SMESH::DIM_3D && forward && algoDim == SMESH::DIM_1D ) {
- algoDim = SMESH::DIM_3D;
- forward = -1;
- a3DAlgo = prevAlgo;
- continue;
+ if ( myMaxShapeDim == SMESH::DIM_3D && forward && algoDim == SMESH::DIM_1D )
+ {
+ algoDim = SMESH::DIM_3D;
+ forward = -1;
+ a3DAlgo = prevAlgo;
+ continue;
}
}
diff --git a/src/SMESHGUI/SMESHGUI_SewingDlg.cxx b/src/SMESHGUI/SMESHGUI_SewingDlg.cxx
index 00ce12ef3..3753dff1d 100644
--- a/src/SMESHGUI/SMESHGUI_SewingDlg.cxx
+++ b/src/SMESHGUI/SMESHGUI_SewingDlg.cxx
@@ -54,6 +54,7 @@
#include
#include
#include
+#include
// OCCT includes
#include
@@ -832,8 +833,9 @@ QString SMESHGUI_SewingDlg::getPartText(const SMESH::FreeBorderPart& aPART)
if ( 0 <= aPART.node1 && aPART.node1 < aBRD.nodeIDs.length() &&
0 <= aPART.nodeLast && aPART.nodeLast < aBRD.nodeIDs.length() )
{
- text += QString("( %1 %2 ) ")
+ text += QString("( %1 %2 %3 ) ")
.arg( aBRD.nodeIDs[ aPART.node1 ] )
+ .arg( aBRD.nodeIDs[ aPART.node2 ] )
.arg( aBRD.nodeIDs[ aPART.nodeLast ] );
}
}
@@ -883,30 +885,30 @@ void SMESHGUI_SewingDlg::onDetectClicked()
SMESH::SMESH_MeshEditor_var editor = myMesh->GetMeshEditor();
myBorders = editor->FindCoincidentFreeBorders( SpinBoxTolerance->GetValue() );
- if ( !haveBorders() )
- return;
-
- for ( size_t i = 0; i < myBorderDisplayers.size(); ++i )
+ if ( haveBorders() )
{
- delete myBorderDisplayers[ i ];
- myBorderDisplayers[ i ] = 0;
- }
- myBorderDisplayers.resize( myBorders->coincidentGroups.length(), 0 );
+ for ( size_t i = 0; i < myBorderDisplayers.size(); ++i )
+ {
+ delete myBorderDisplayers[ i ];
+ myBorderDisplayers[ i ] = 0;
+ }
+ myBorderDisplayers.resize( myBorders->coincidentGroups.length(), 0 );
- for ( CORBA::ULong i = 0; i < myBorders->coincidentGroups.length(); ++i )
- {
- QString groupText = getGroupText( i );
- if ( groupText.isEmpty() )
- continue;
+ for ( CORBA::ULong i = 0; i < myBorders->coincidentGroups.length(); ++i )
+ {
+ QString groupText = getGroupText( i );
+ if ( groupText.isEmpty() )
+ continue;
- QColor groupColor;
- groupColor.setHsvF( float(i) / myBorders->coincidentGroups.length(), 1., 1. );
- QPixmap icon( QSize( 20, 20 ));
- icon.fill( groupColor );
+ QColor groupColor;
+ groupColor.setHsvF( float(i) / myBorders->coincidentGroups.length(), 1., 1. );
+ QPixmap icon( QSize( 20, 20 ));
+ icon.fill( groupColor );
- QListWidgetItem * item = new QListWidgetItem( icon, groupText, ListCoincident );
- item->setData( GROUP_COLOR, groupColor );
- item->setData( GROUP_INDEX, i );
+ QListWidgetItem * item = new QListWidgetItem( icon, groupText, ListCoincident );
+ item->setData( GROUP_COLOR, groupColor );
+ item->setData( GROUP_INDEX, i );
+ }
}
myBusy = false;
@@ -1389,7 +1391,11 @@ bool SMESHGUI_SewingDlg::ClickOnApply()
QString msg = tr(QString("ERROR_%1").arg(anError).toLatin1().data());
SUIT_MessageBox::warning(this, tr("SMESH_WRN_WARNING"), msg);
}
- } catch (...) {
+ }
+ catch ( const SALOME::SALOME_Exception& S_ex )
+ {
+ SalomeApp_Tools::QtCatchCorbaException( S_ex );
+ return false;
}
if (aResult) {
@@ -1887,7 +1893,6 @@ SMESHGUI_SewingDlg::BorderGroupDisplayer::~BorderGroupDisplayer()
}
}
myIdPreview.SetPointsLabeled(false);
- //myViewWindow->Repaint();
}
void SMESHGUI_SewingDlg::BorderGroupDisplayer::Hide()
@@ -2010,7 +2015,6 @@ void SMESHGUI_SewingDlg::BorderGroupDisplayer::Update()
myPartActors[ i ]->SetMarkerStd( VTK::MT_POINT, 13 );
myPartActors[ i ]->SetPickable ( false );
myViewWindow->AddActor( myPartActors[ i ]);
- //myViewWindow->Repaint();
}
}
}
diff --git a/src/SMESHUtils/SMESH_FreeBorders.cxx b/src/SMESHUtils/SMESH_FreeBorders.cxx
index 939178f73..6d180f8c2 100644
--- a/src/SMESHUtils/SMESH_FreeBorders.cxx
+++ b/src/SMESHUtils/SMESH_FreeBorders.cxx
@@ -54,12 +54,13 @@ namespace
BNode(const SMDS_MeshNode * node): SMESH_TNodeXYZ( node ) {}
const SMDS_MeshNode * Node() const { return _node; }
- void AddLinked( BEdge* e ) const;
- void AddClose ( const BEdge* e, double u ) const;
+ void AddLinked( BEdge* e ) const;
+ void AddClose ( const BEdge* e, double u ) const;
BEdge* GetCloseEdge( size_t i ) const { return myCloseEdges[i].first; }
double GetCloseU( size_t i ) const { return myCloseEdges[i].second; }
BEdge* GetCloseEdgeOfBorder( int borderID, double * u = 0 ) const;
- bool IsCloseEdge( const BEdge* ) const;
+ bool HasCloseEdgeWithNode( const BNode* n ) const;
+ bool IsCloseEdge( const BEdge*, double * u = 0 ) const;
bool operator<(const BNode& other) const { return Node()->GetID() < other.Node()->GetID(); }
};
/*!
@@ -149,8 +150,8 @@ namespace
// is1st shows which end of toE is projected on this at u
double u2;
const double eps = 0.1;
- if ( toE == myBNode1->GetCloseEdgeOfBorder( toE->myBorderID, &u2 ) ||
- toE == myBNode2->GetCloseEdgeOfBorder( toE->myBorderID, &u2 ))
+ if ( myBNode1->IsCloseEdge( toE, &u2 ) ||
+ myBNode2->IsCloseEdge( toE, &u2 ))
return (( 0 < u2 && u2 < 1 ) && // u2 is proj param of myBNode's on toE
( Abs( u2 - int( !is1st )) > eps ));
@@ -164,24 +165,59 @@ namespace
if ( this->myCloseBorders != bordIDs )
return false;
- eRange[0] = this;
- while ( eRange[0]->myPrev && eRange[0]->myPrev->myCloseBorders == bordIDs )
+ if ( bordIDs.size() == 1 && bordIDs.count( myBorderID )) // border close to self
{
- if ( eRange[0]->myPrev == this /*|| eRange[0]->myPrev->myInGroup*/ )
- break;
- eRange[0] = eRange[0]->myPrev;
- }
-
- eRange[1] = this;
- if ( eRange[0]->myPrev != this ) // not closed range
- while ( eRange[1]->myNext && eRange[1]->myNext->myCloseBorders == bordIDs )
+ double u;
+ eRange[0] = this;
+ while ( eRange[0]->myBNode1->GetCloseEdgeOfBorder( myBorderID, &u ))
{
- if ( eRange[1]->myNext == this /*|| eRange[1]->myNext->myInGroup*/ )
+ if ( eRange[0]->myPrev == this || u < 0 || u > 1 )
+ break;
+ eRange[0] = eRange[0]->myPrev;
+ }
+ eRange[1] = this;
+ while ( eRange[1]->myBNode2->GetCloseEdgeOfBorder( myBorderID, &u ))
+ {
+ if ( eRange[1]->myNext == this || u < 0 || u > 1 )
break;
eRange[1] = eRange[1]->myNext;
}
+ }
+ else
+ {
+ eRange[0] = this;
+ while ( eRange[0]->myPrev && eRange[0]->myPrev->myCloseBorders == bordIDs )
+ {
+ if ( eRange[0]->myPrev == this )
+ break;
+ eRange[0] = eRange[0]->myPrev;
+ }
- return ( eRange[0] != eRange[1] );
+ eRange[1] = this;
+ if ( eRange[0]->myPrev != this ) // not closed border
+ while ( eRange[1]->myNext && eRange[1]->myNext->myCloseBorders == bordIDs )
+ {
+ if ( eRange[1]->myNext == this )
+ break;
+ eRange[1] = eRange[1]->myNext;
+ }
+ }
+
+ if ( eRange[0] == eRange[1] )
+ {
+ std::set::iterator closeBord = eRange[0]->myCloseBorders.begin();
+ for ( ; closeBord != eRange[0]->myCloseBorders.end(); ++closeBord )
+ {
+ if ( BEdge* be = eRange[0]->myBNode1->GetCloseEdgeOfBorder( *closeBord ))
+ if ( be->myCloseBorders == eRange[0]->myCloseBorders )
+ return true;
+ if ( BEdge* be = eRange[0]->myBNode2->GetCloseEdgeOfBorder( *closeBord ))
+ if ( be->myCloseBorders == eRange[0]->myCloseBorders )
+ return true;
+ }
+ return false;
+ }
+ return true;
}
}; // class BEdge
@@ -197,8 +233,7 @@ namespace
if ( e1->myPrev )
{
for ( bord = bordIDs.begin(); bord != bordIDs.end(); ++bord )
- if (( *bord != e1->myBorderID ) &&
- (( be = e1->myBNode1->GetCloseEdgeOfBorder( *bord, &u ))) &&
+ if ((( be = e1->myBNode1->GetCloseEdgeOfBorder( *bord, &u ))) &&
( be->myInGroup == groupID ) &&
( 0 < u && u < 1 ) &&
( be->IsOverlappingProjection( e1->myPrev, u, false )))
@@ -206,12 +241,17 @@ namespace
e1 = e1->myPrev;
break;
}
+ if ( bord == bordIDs.end() && // not extended
+ e1->myBNode1->HasCloseEdgeWithNode( e1->myPrev->myBNode1 ))
+ {
+ e1 = e1->myPrev;
+ }
+ e1->myInGroup = groupID;
}
if ( e2->myNext )
{
for ( bord = bordIDs.begin(); bord != bordIDs.end(); ++bord )
- if (( *bord != e2->myBorderID ) &&
- (( be = e2->myBNode2->GetCloseEdgeOfBorder( *bord, &u ))) &&
+ if ((( be = e2->myBNode2->GetCloseEdgeOfBorder( *bord, &u ))) &&
( be->myInGroup == groupID ) &&
( 0 < u && u < 1 ) &&
( be->IsOverlappingProjection( e2->myNext, u, true )))
@@ -219,6 +259,12 @@ namespace
e2 = e2->myNext;
break;
}
+ if ( bord == bordIDs.end() && // not extended
+ e2->myBNode2->HasCloseEdgeWithNode( e2->myNext->myBNode2 ))
+ {
+ e2 = e2->myNext;
+ }
+ e2->myInGroup = groupID;
}
}
@@ -261,11 +307,22 @@ namespace
if ( uPtr ) *uPtr = u;
return e;
}
- bool BNode::IsCloseEdge( const BEdge* e ) const
+ bool BNode::HasCloseEdgeWithNode( const BNode* n ) const
+ {
+ for ( size_t i = 0; i < myCloseEdges.size(); ++i )
+ if ( GetCloseEdge( i )->Contains( n ) &&
+ 0 < GetCloseU( i ) && GetCloseU( i ) < 1 )
+ return true;
+ return false;
+ }
+ bool BNode::IsCloseEdge( const BEdge* e, double * uPtr ) const
{
for ( size_t i = 0; i < myCloseEdges.size(); ++i )
if ( e == GetCloseEdge( i ) )
+ {
+ if ( uPtr ) *uPtr = GetCloseU( i );
return true;
+ }
return false;
}
@@ -315,6 +372,7 @@ void SMESH_MeshAlgos::FindCoincidentFreeBorders(SMDS_Mesh& mesh,
// find free links
typedef NCollection_DataMap TLink2FaceMap;
TLink2FaceMap linkMap;
+ int nbSharedLinks = 0;
SMDS_FaceIteratorPtr faceIt = mesh.facesIterator();
while ( faceIt->more() )
{
@@ -327,27 +385,36 @@ void SMESH_MeshAlgos::FindCoincidentFreeBorders(SMDS_Mesh& mesh,
{
const SMDS_MeshNode* n1 = nodeIt->next();
SMESH_TLink link( n0, n1 );
- if ( !linkMap.Bind( link, face ))
- linkMap.UnBind( link );
+ if ( const SMDS_MeshElement** faceInMap = linkMap.ChangeSeek( link ))
+ {
+ nbSharedLinks += bool( *faceInMap );
+ *faceInMap = 0;
+ }
+ else
+ {
+ linkMap.Bind( link, face );
+ }
n0 = n1;
}
}
- if ( linkMap.IsEmpty() )
+ if ( linkMap.Extent() == nbSharedLinks )
return;
// form free borders
std::set < BNode > bNodes;
- std::vector< BEdge > bEdges( linkMap.Extent() );
+ std::vector< BEdge > bEdges( linkMap.Extent() - nbSharedLinks );
TLink2FaceMap::Iterator linkIt( linkMap );
- for ( int iEdge = 0; linkIt.More(); linkIt.Next(), ++iEdge )
+ for ( int iEdge = 0; linkIt.More(); linkIt.Next() )
{
+ if ( !linkIt.Value() ) continue;
const SMESH_TLink & link = linkIt.Key();
std::set< BNode >::iterator n1 = bNodes.insert( BNode( link.node1() )).first;
std::set< BNode >::iterator n2 = bNodes.insert( BNode( link.node2() )).first;
bEdges[ iEdge ].Set( &*n1, &*n2, linkIt.Value(), iEdge+1 );
n1->AddLinked( & bEdges[ iEdge ] );
n2->AddLinked( & bEdges[ iEdge ] );
+ ++iEdge;
}
linkMap.Clear();
@@ -563,36 +630,44 @@ void SMESH_MeshAlgos::FindCoincidentFreeBorders(SMDS_Mesh& mesh,
}
beRange[1]->myInGroup = groupID;
+ // get starting edge of each close border
+ closeEdges.clear();
+ be = beRange[0];
+ if ( be->myCloseBorders.empty() )
+ be = beRange[0]->myNext;
+ std::set::iterator closeBord = be->myCloseBorders.begin();
+ for ( ; closeBord != be->myCloseBorders.end(); ++closeBord )
+ if ( BEdge* e = be->myBNode2->GetCloseEdgeOfBorder( *closeBord ))
+ closeEdges.push_back( e );
+
+ for ( size_t iE = 0; iE < closeEdges.size(); ++iE )
+ if ( be->myCloseBorders != closeEdges[iE]->myCloseBorders )
+ {
+ closeBord = closeEdges[iE]->myCloseBorders.begin();
+ for ( ; closeBord != closeEdges[iE]->myCloseBorders.end(); ++closeBord )
+ if ( !be->myCloseBorders.count( *closeBord ))
+ if ( BEdge* e = closeEdges[iE]->myBNode2->GetCloseEdgeOfBorder( *closeBord ))
+ if ( std::find( closeEdges.begin(), closeEdges.end(), e ) == closeEdges.end() )
+ closeEdges.push_back( e );
+ }
+
// add parts of other borders
BEdge* be1st = beRange[0];
- closeEdges.clear();
- std::set::iterator closeBord = be1st->myCloseBorders.begin();
- for ( ; closeBord != be1st->myCloseBorders.end(); ++closeBord )
- closeEdges.push_back( be1st->myBNode2->GetCloseEdgeOfBorder( *closeBord ));
-
for ( size_t iE = 0; iE < closeEdges.size(); ++iE )
{
be = closeEdges[ iE ];
if ( !be ) continue;
bool ok = be->GetRangeOfSameCloseBorders( beRange, be->myCloseBorders );
- if ( !ok && be->myPrev )
- ok = be->myPrev->GetRangeOfSameCloseBorders( beRange, be1st->myCloseBorders );
- if ( !ok && be->myNext )
- ok = be->myNext->GetRangeOfSameCloseBorders( beRange, be1st->myCloseBorders );
+ // if ( !ok && be->myPrev )
+ // ok = be->myPrev->GetRangeOfSameCloseBorders( beRange, be1st->myCloseBorders );
+ // if ( !ok && be->myNext )
+ // ok = be->myNext->GetRangeOfSameCloseBorders( beRange, be1st->myCloseBorders );
if ( !ok )
continue;
be = beRange[0];
- if ( be->myCloseBorders != be1st->myCloseBorders )
- {
- //add missing edges to closeEdges
- closeBord = be->myCloseBorders.begin();
- for ( ; closeBord != be->myCloseBorders.end(); ++closeBord )
- if ( !be1st->myCloseBorders.count( *closeBord ))
- closeEdges.push_back( be->myBNode2->GetCloseEdgeOfBorder( *closeBord ));
- }
ranges.push_back( beRange[0] );
ranges.push_back( beRange[1] );
@@ -645,9 +720,11 @@ void SMESH_MeshAlgos::FindCoincidentFreeBorders(SMDS_Mesh& mesh,
part._node2 = beRange[0]->myID + 1;
part._nodeLast = beRange[1]->myID + 1;
}
+ // if ( group[0]._node2 != part._node2 )
group.push_back( part );
}
- foundFreeBordes._coincidentGroups.push_back( group );
+ //if ( group.size() > 1 )
+ foundFreeBordes._coincidentGroups.push_back( group );
}
else
{
diff --git a/src/SMESHUtils/SMESH_MeshAlgos.cxx b/src/SMESHUtils/SMESH_MeshAlgos.cxx
index 1a9dd65bb..a5171703b 100644
--- a/src/SMESHUtils/SMESH_MeshAlgos.cxx
+++ b/src/SMESHUtils/SMESH_MeshAlgos.cxx
@@ -1541,10 +1541,8 @@ SMESH_MeshAlgos::FindFaceInSet(const SMDS_MeshNode* n1,
const SMDS_MeshElement* face = 0;
SMDS_ElemIteratorPtr invElemIt = n1->GetInverseElementIterator(SMDSAbs_Face);
- //MESSAGE("n1->GetInverseElementIterator(SMDSAbs_Face) " << invElemIt);
while ( invElemIt->more() && !face ) // loop on inverse faces of n1
{
- //MESSAGE("in while ( invElemIt->more() && !face )");
const SMDS_MeshElement* elem = invElemIt->next();
if (avoidSet.count( elem ))
continue;
@@ -1563,9 +1561,6 @@ SMESH_MeshAlgos::FindFaceInSet(const SMDS_MeshNode* n1,
if ( !face && elem->IsQuadratic())
{
// analysis for quadratic elements using all nodes
- // const SMDS_VtkFace* F = dynamic_cast(elem);
- // if (!F) throw SALOME_Exception(LOCALIZED("not an SMDS_VtkFace"));
- // use special nodes iterator
SMDS_ElemIteratorPtr anIter = elem->interlacedNodesElemIterator();
const SMDS_MeshNode* prevN = static_cast( anIter->next() );
for ( i1 = -1, i2 = 0; anIter->more() && !face; i1++, i2++ )
diff --git a/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx b/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx
index 6edbf2b85..7c9dca548 100644
--- a/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx
+++ b/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx
@@ -1115,9 +1115,9 @@ bool _QuadFaceGrid::LoadGrid( SMESH_Mesh& mesh )
// store the rest nodes row by row
- const SMDS_MeshNode* dummy = mesh.GetMeshDS()->AddNode(0,0,0);
- const SMDS_MeshElement* firstQuad = dummy; // most left face above the last row of found nodes
-
+ TIDSortedElemSet emptySet, avoidSet;
+ const SMDS_MeshElement* firstQuad = 0; // most left face above the last row of found nodes
+
int nbFoundNodes = myIndexer._xSize;
while ( nbFoundNodes != myGrid.size() )
{
@@ -1134,8 +1134,6 @@ bool _QuadFaceGrid::LoadGrid( SMESH_Mesh& mesh )
// o---o o o o o
//n1down n2down
//
- TIDSortedElemSet emptySet, avoidSet;
- avoidSet.insert( firstQuad );
firstQuad = SMESH_MeshAlgos::FindFaceInSet( n1down, n2down, emptySet, avoidSet);
while ( firstQuad && !faceSubMesh->Contains( firstQuad )) {
avoidSet.insert( firstQuad );
@@ -1182,8 +1180,8 @@ bool _QuadFaceGrid::LoadGrid( SMESH_Mesh& mesh )
n1down = myGrid[ nbFoundNodes - myIndexer._xSize - 1 ];
n1up = n2up;
}
+ avoidSet.clear(); avoidSet.insert( firstQuad );
}
- mesh.GetMeshDS()->RemoveNode(dummy);
DumpGrid(); // debug
return true;