Merge from BR_Dev_For_4_0 branch (from tag mergeto_BR_QT4_Dev_07Jul08)

This commit is contained in:
vsr 2008-07-22 09:10:35 +00:00
parent b78e4ec403
commit 47a901faf4
43 changed files with 1062 additions and 205 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>

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

@ -625,6 +625,8 @@ module SMESH
*/ */
double_array BaryCenter(in long id); double_array BaryCenter(in long id);
/*! Gets information about imported MED file */
SALOME_MED::MedFileInfo GetMEDFileInfo();
}; };
interface SMESH_subMesh : SALOME::GenericObj, SMESH_IDSource interface SMESH_subMesh : SALOME::GenericObj, SMESH_IDSource

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

@ -246,7 +246,7 @@ bool SMDS_MeshNode::emptyInverseElements()
*/ */
//================================================================================ //================================================================================
int SMDS_MeshNode::NbInverseNodes(SMDSAbs_ElementType type) const int SMDS_MeshNode::NbInverseElements(SMDSAbs_ElementType type) const
{ {
if ( type == SMDSAbs_All ) if ( type == SMDSAbs_All )
return myInverseElements.Extent(); return myInverseElements.Extent();

View File

@ -47,7 +47,7 @@ class SMDS_EXPORT SMDS_MeshNode:public SMDS_MeshElement
void ClearInverseElements(); void ClearInverseElements();
bool emptyInverseElements(); bool emptyInverseElements();
SMDS_ElemIteratorPtr GetInverseElementIterator(SMDSAbs_ElementType type=SMDSAbs_All) const; SMDS_ElemIteratorPtr GetInverseElementIterator(SMDSAbs_ElementType type=SMDSAbs_All) const;
int NbInverseNodes(SMDSAbs_ElementType type=SMDSAbs_All) const; int NbInverseElements(SMDSAbs_ElementType type=SMDSAbs_All) const;
void SetPosition(const SMDS_PositionPtr& aPos); void SetPosition(const SMDS_PositionPtr& aPos);
const SMDS_PositionPtr& GetPosition() const; const SMDS_PositionPtr& GetPosition() const;
SMDSAbs_ElementType GetType() const; SMDSAbs_ElementType GetType() const;

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

@ -6871,7 +6871,7 @@ int SMESH_MeshEditor::removeQuadElem(SMESHDS_SubMesh * theSm,
vector<const SMDS_MeshNode*>::iterator nIt = mediumNodes.begin(); vector<const SMDS_MeshNode*>::iterator nIt = mediumNodes.begin();
for ( ; nIt != mediumNodes.end(); ++nIt ) { for ( ; nIt != mediumNodes.end(); ++nIt ) {
const SMDS_MeshNode* n = *nIt; const SMDS_MeshNode* n = *nIt;
if ( n->NbInverseNodes() == 0 ) { if ( n->NbInverseElements() == 0 ) {
if ( n->GetPosition()->GetShapeId() != theShapeID ) if ( n->GetPosition()->GetShapeId() != theShapeID )
meshDS->RemoveFreeNode( n, meshDS->MeshElements meshDS->RemoveFreeNode( n, meshDS->MeshElements
( n->GetPosition()->GetShapeId() )); ( n->GetPosition()->GetShapeId() ));

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

@ -1195,7 +1195,7 @@ static void cleanSubMesh( SMESH_subMesh * subMesh )
while (itn->more()) { while (itn->more()) {
const SMDS_MeshNode * node = itn->next(); const SMDS_MeshNode * node = itn->next();
//MESSAGE( " RM node: "<<node->GetID()); //MESSAGE( " RM node: "<<node->GetID());
if ( node->NbInverseNodes() == 0 ) if ( node->NbInverseElements() == 0 )
meshDS->RemoveFreeNode(node, subMeshDS); meshDS->RemoveFreeNode(node, subMeshDS);
else // for StdMeshers_CompositeSegment_1D: node in one submesh, edge in another else // for StdMeshers_CompositeSegment_1D: node in one submesh, edge in another
meshDS->RemoveNode(node); meshDS->RemoveNode(node);

View File

@ -99,7 +99,8 @@ dist_libSMESH_la_SOURCES = \
SMESHGUI_BuildCompoundDlg.cxx \ SMESHGUI_BuildCompoundDlg.cxx \
SMESHGUI_ComputeDlg.cxx \ SMESHGUI_ComputeDlg.cxx \
SMESHGUI_MakeNodeAtPointDlg.cxx \ SMESHGUI_MakeNodeAtPointDlg.cxx \
SMESHGUI_MeshEditPreview.cxx SMESHGUI_MeshEditPreview.cxx \
SMESHGUI_FileInfoDlg.cxx
MOC_FILES = \ MOC_FILES = \
SMESHGUI_moc.cxx \ SMESHGUI_moc.cxx \
@ -149,7 +150,8 @@ MOC_FILES = \
SMESHGUI_ConvToQuadOp_moc.cxx \ SMESHGUI_ConvToQuadOp_moc.cxx \
SMESHGUI_BuildCompoundDlg_moc.cxx \ SMESHGUI_BuildCompoundDlg_moc.cxx \
SMESHGUI_ComputeDlg_moc.cxx \ SMESHGUI_ComputeDlg_moc.cxx \
SMESHGUI_MakeNodeAtPointDlg_moc.cxx SMESHGUI_MakeNodeAtPointDlg_moc.cxx \
SMESHGUI_FileInfoDlg_moc.cxx
nodist_libSMESH_la_SOURCES= \ nodist_libSMESH_la_SOURCES= \
$(MOC_FILES) $(MOC_FILES)

View File

@ -65,6 +65,7 @@
#include "SMESHGUI_MakeNodeAtPointDlg.h" #include "SMESHGUI_MakeNodeAtPointDlg.h"
#include "SMESHGUI_BuildCompoundDlg.h" #include "SMESHGUI_BuildCompoundDlg.h"
#include "SMESHGUI_ComputeDlg.h" #include "SMESHGUI_ComputeDlg.h"
#include "SMESHGUI_FileInfoDlg.h"
#include "SMESHGUI_Utils.h" #include "SMESHGUI_Utils.h"
#include "SMESHGUI_MeshUtils.h" #include "SMESHGUI_MeshUtils.h"
@ -110,7 +111,7 @@
// IDL includes // IDL includes
#include <SALOMEconfig.h> #include <SALOMEconfig.h>
#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes) #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
#include CORBA_SERVER_HEADER(SMESH_MeshEditor) #include CORBA_CLIENT_HEADER(SMESH_MeshEditor)
// Qt includes // Qt includes
// #define INCLUDE_MENUITEM_DEF // VSR commented ???????? // #define INCLUDE_MENUITEM_DEF // VSR commented ????????
@ -1263,6 +1264,25 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
break; break;
} }
case 150: //MED FILE INFORMATION
{
SALOME_ListIO selected;
LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
if( aSel )
aSel->selectedObjects( selected );
if( selected.Extent() )
{
Handle(SALOME_InteractiveObject) anIObject = selected.First();
SMESH::SMESH_Mesh_var aMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(anIObject);
if ( !aMesh->_is_nil() )
{
SMESHGUI_FileInfoDlg dlg( desktop(), aMesh->GetMEDFileInfo() );
dlg.exec();
}
}
break;
}
case 122: // EXPORT MED case 122: // EXPORT MED
case 121: case 121:
case 123: case 123:
@ -2409,6 +2429,7 @@ void SMESHGUI::initialize( CAM_Application* app )
createSMESHAction( 125, "EXPORT_MED" ); createSMESHAction( 125, "EXPORT_MED" );
createSMESHAction( 126, "EXPORT_UNV" ); createSMESHAction( 126, "EXPORT_UNV" );
createSMESHAction( 141, "EXPORT_STL" ); createSMESHAction( 141, "EXPORT_STL" );
createSMESHAction( 150, "FILE_INFO" );
createSMESHAction( 33, "DELETE", "ICON_DELETE", Qt::Key_Delete ); createSMESHAction( 33, "DELETE", "ICON_DELETE", Qt::Key_Delete );
createSMESHAction( 5105, "SEL_FILTER_LIB" ); createSMESHAction( 5105, "SEL_FILTER_LIB" );
createSMESHAction( 701, "COMPUTE", "ICON_COMPUTE" ); createSMESHAction( 701, "COMPUTE", "ICON_COMPUTE" );
@ -2740,6 +2761,7 @@ void SMESHGUI::initialize( CAM_Application* app )
// popup for object browser // popup for object browser
createPopupItem( 150, OB, mesh, "&& selcount=1 && isImported" ); // FILE INFORMATION
createPopupItem( 704, OB, mesh, "&& isComputable"); // EDIT_MESHSUBMESH createPopupItem( 704, OB, mesh, "&& isComputable"); // EDIT_MESHSUBMESH
createPopupItem( 704, OB, subMesh, "&& isComputable" ); // EDIT_MESHSUBMESH createPopupItem( 704, OB, subMesh, "&& isComputable" ); // EDIT_MESHSUBMESH
createPopupItem( 803, OB, group ); // EDIT_GROUP createPopupItem( 803, OB, group ); // EDIT_GROUP

View File

@ -123,12 +123,15 @@ SMESHGUI_BuildCompoundDlg::SMESHGUI_BuildCompoundDlg( SMESHGUI* theModule )
TextLabelMeshes = new QLabel(tr("MESHES"), GroupArgs); TextLabelMeshes = new QLabel(tr("MESHES"), GroupArgs);
SelectButton = new QPushButton(GroupArgs); SelectButton = new QPushButton(GroupArgs);
SelectButton->setIcon(image1); SelectButton->setIcon(image1);
SelectButton->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
LineEditMeshes = new QLineEdit(GroupArgs); LineEditMeshes = new QLineEdit(GroupArgs);
LineEditMeshes->setReadOnly(true); LineEditMeshes->setReadOnly(true);
TextLabelUnion = new QLabel(tr("PROCESSING_IDENTICAL_GROUPS"), GroupArgs); TextLabelUnion = new QLabel(tr("PROCESSING_IDENTICAL_GROUPS"), GroupArgs);
ComboBoxUnion = new QComboBox(GroupArgs); ComboBoxUnion = new QComboBox(GroupArgs);
CheckBoxCommon = new QCheckBox(tr("CREATE_COMMON_GROUPS"), GroupArgs);
CheckBoxMerge = new QCheckBox(tr("MERGE_NODES_AND_ELEMENTS"), GroupArgs); CheckBoxMerge = new QCheckBox(tr("MERGE_NODES_AND_ELEMENTS"), GroupArgs);
TextLabelTol = new QLabel(tr("SMESH_TOLERANCE"), GroupArgs); TextLabelTol = new QLabel(tr("SMESH_TOLERANCE"), GroupArgs);
@ -141,9 +144,10 @@ SMESHGUI_BuildCompoundDlg::SMESHGUI_BuildCompoundDlg( SMESHGUI* theModule )
GroupArgsLayout->addWidget(LineEditMeshes, 0, 2, 1, 2); GroupArgsLayout->addWidget(LineEditMeshes, 0, 2, 1, 2);
GroupArgsLayout->addWidget(TextLabelUnion, 1, 0, 1, 3); GroupArgsLayout->addWidget(TextLabelUnion, 1, 0, 1, 3);
GroupArgsLayout->addWidget(ComboBoxUnion, 1, 3); GroupArgsLayout->addWidget(ComboBoxUnion, 1, 3);
GroupArgsLayout->addWidget(CheckBoxMerge, 2, 0, 1, 4); GroupArgsLayout->addWidget(CheckBoxCommon, 2, 0, 1, 4);
GroupArgsLayout->addWidget(TextLabelTol, 3, 0, 1, 2); GroupArgsLayout->addWidget(CheckBoxMerge, 3, 0, 1, 4);
GroupArgsLayout->addWidget(SpinBoxTol, 3, 2, 1, 2); GroupArgsLayout->addWidget(TextLabelTol, 4, 0, 1, 2);
GroupArgsLayout->addWidget(SpinBoxTol, 4, 2, 1, 2);
/***************************************************************/ /***************************************************************/
GroupButtons = new QGroupBox(this); GroupButtons = new QGroupBox(this);
@ -287,8 +291,14 @@ 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())
aCompoundMesh = aSMESHGen->ConcatenateWithGroups(myMeshArray,
!(ComboBoxUnion->currentIndex()),
CheckBoxMerge->isChecked(),
SpinBoxTol->GetValue());
else
aCompoundMesh = aSMESHGen->Concatenate(myMeshArray,
!(ComboBoxUnion->currentIndex()), !(ComboBoxUnion->currentIndex()),
CheckBoxMerge->isChecked(), CheckBoxMerge->isChecked(),
SpinBoxTol->GetValue()); SpinBoxTol->GetValue());

View File

@ -100,6 +100,7 @@ private:
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

@ -253,11 +253,14 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
AngleSpin = new SMESHGUI_SpinBox(AnglesGrp); AngleSpin = new SMESHGUI_SpinBox(AnglesGrp);
LinearAnglesCheck = new QCheckBox(tr("LINEAR_ANGLES"), AnglesGrp);
// layouting // layouting
AnglesGrpLayout->addWidget(AnglesList, 0, 0, 4, 1); AnglesGrpLayout->addWidget(AnglesList, 0, 0, 4, 1);
AnglesGrpLayout->addWidget(AddAngleButton, 0, 1); AnglesGrpLayout->addWidget(AddAngleButton, 0, 1);
AnglesGrpLayout->addWidget(RemoveAngleButton, 2, 1); AnglesGrpLayout->addWidget(RemoveAngleButton, 2, 1);
AnglesGrpLayout->addWidget(AngleSpin, 0, 2); AnglesGrpLayout->addWidget(AngleSpin, 0, 2);
AnglesGrpLayout->addWidget(LinearAnglesCheck, 4, 0);
AnglesGrpLayout->setRowMinimumHeight(1, 10); AnglesGrpLayout->setRowMinimumHeight(1, 10);
AnglesGrpLayout->setRowStretch(3, 10); AnglesGrpLayout->setRowStretch(3, 10);
@ -581,17 +584,20 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
try { try {
SUIT_OverrideCursor wc; SUIT_OverrideCursor wc;
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
if ( LinearAnglesCheck->isChecked() )
anAngles = aMeshEditor->LinearAnglesVariation( myPathMesh, myPathShape, anAngles );
SMESH::SMESH_MeshEditor::Extrusion_Error retVal; SMESH::SMESH_MeshEditor::Extrusion_Error retVal;
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
SMESH::ListOfGroups_var groups = SMESH::ListOfGroups_var groups =
aMeshEditor->ExtrusionAlongPathMakeGroups(anElementsId.inout(), myPathMesh, aMeshEditor->ExtrusionAlongPathMakeGroups(anElementsId, myPathMesh,
myPathShape, aNodeStart, myPathShape, aNodeStart,
AnglesGrp->isChecked(), anAngles.inout(), AnglesGrp->isChecked(), anAngles,
BasePointGrp->isChecked(), aBasePoint, retVal); BasePointGrp->isChecked(), aBasePoint, retVal);
else else
retVal = aMeshEditor->ExtrusionAlongPath(anElementsId.inout(), myPathMesh, retVal = aMeshEditor->ExtrusionAlongPath(anElementsId, myPathMesh,
myPathShape, aNodeStart, myPathShape, aNodeStart,
AnglesGrp->isChecked(), anAngles.inout(), AnglesGrp->isChecked(), anAngles,
BasePointGrp->isChecked(), aBasePoint); BasePointGrp->isChecked(), aBasePoint);
//wc.stop(); //wc.stop();

View File

@ -113,6 +113,7 @@ private:
QLineEdit* PathShapeLineEdit; QLineEdit* PathShapeLineEdit;
QToolButton* SelectStartPointButton; QToolButton* SelectStartPointButton;
QLineEdit* StartPointLineEdit; QLineEdit* StartPointLineEdit;
QCheckBox* LinearAnglesCheck;
QGroupBox* AnglesGrp; QGroupBox* AnglesGrp;
QListWidget* AnglesList; QListWidget* AnglesList;
QToolButton* AddAngleButton; QToolButton* AddAngleButton;

View File

@ -0,0 +1,77 @@
// SMESH SMESHGUI : GUI for SMESH component
//
// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : SMESHGUI_FileInfoDlg.cxx
// Author : Alexandre SOLOVYOV, Open CASCADE S.A.S. (alexander.solovyov@opencascade.com)
//
#include "SMESHGUI_FileInfoDlg.h"
#include <MED_Common.hxx>
#include <QGridLayout>
#include <QLabel>
#include <QLineEdit>
SMESHGUI_FileInfoDlg::SMESHGUI_FileInfoDlg( QWidget* parent, SALOME_MED::MedFileInfo* inf )
: QtxDialog( parent, true, true, QtxDialog::OK )
{
setWindowTitle( tr( "CAPTION" ) );
setSizeGripEnabled( true );
QLineEdit* fname = new QLineEdit( mainFrame() );
fname->setReadOnly( true );
QLineEdit* fsize = new QLineEdit( mainFrame() );
fsize->setReadOnly( true );
QLineEdit* medversion = new QLineEdit( mainFrame() );
medversion->setReadOnly( true );
fname->setMinimumWidth( 300 );
QGridLayout* lay = new QGridLayout( mainFrame() );
lay->setMargin( 5 ); lay->setSpacing( 5 );
lay->addWidget( new QLabel( tr( "FILE_NAME" ), mainFrame() ), 0, 0 );
lay->addWidget( fname, 0, 1 );
lay->addWidget( new QLabel( tr( "FILE_SIZE" ), mainFrame() ), 1, 0 );
lay->addWidget( fsize, 1, 1 );
lay->addWidget( new QLabel( tr( "MED_VERSION" ), mainFrame() ), 2, 0 );
lay->addWidget( medversion, 2, 1 );
fname->setText( (char*)inf->fileName );
fname->home( false );
fsize->setText( QString::number( inf->fileSize ) );
QString version;
if( inf->major>=0 )
{
version = QString::number( inf->major );
if( inf->minor>=0 )
{
version += "." + QString::number( inf->minor );
if( inf->release>=0 )
version += "." + QString::number( inf->release );
}
}
medversion->setText( version );
}
SMESHGUI_FileInfoDlg::~SMESHGUI_FileInfoDlg()
{
}

View File

@ -0,0 +1,43 @@
// SMESH SMESHGUI : GUI for SMESH component
//
// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : SMESHGUI_FileInfoDlg.h
// Author : Alexandre SOLOVYOV, Open CASCADE S.A.S. (alexander.solovyov@opencascade.com)
//
#ifndef SMESHGUI_FILEINFODLG_H
#define SMESHGUI_FILEINFODLG_H
#include <QtxDialog.h>
#include <SALOMEconfig.h>
#include CORBA_CLIENT_HEADER(MED)
class SMESHGUI_FileInfoDlg : public QtxDialog
{
Q_OBJECT
public:
SMESHGUI_FileInfoDlg( QWidget*, SALOME_MED::MedFileInfo* );
virtual ~SMESHGUI_FileInfoDlg();
};
#endif // SMESHGUI_FILEINFODLG_H

View File

@ -32,6 +32,7 @@
#include "SMESHGUI_VTKUtils.h" #include "SMESHGUI_VTKUtils.h"
#include "SMESHGUI_MeshUtils.h" #include "SMESHGUI_MeshUtils.h"
#include "SMESHGUI_IdValidator.h" #include "SMESHGUI_IdValidator.h"
#include "SMESHGUI_MeshEditPreview.h"
#include <SMESH_Actor.h> #include <SMESH_Actor.h>
#include <SMESH_TypeFilter.hxx> #include <SMESH_TypeFilter.hxx>
@ -47,10 +48,12 @@
#include <LightApp_Application.h> #include <LightApp_Application.h>
#include <LightApp_SelectionMgr.h> #include <LightApp_SelectionMgr.h>
#include <SalomeApp_Application.h>
#include <SVTK_ViewWindow.h> #include <SVTK_ViewWindow.h>
#include <SVTK_Selector.h> #include <SVTK_Selector.h>
#include <SALOME_ListIO.hxx> #include <SALOME_ListIO.hxx>
#include <VTKViewer_CellLocationsArray.h>
// OCCT includes // OCCT includes
#include <TColStd_MapOfInteger.hxx> #include <TColStd_MapOfInteger.hxx>
@ -87,6 +90,8 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
mySMESHGUI( theModule ), mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ) mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
{ {
mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI ); SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
QPixmap image0 ( mgr->loadPixmap("SMESH", tr("ICON_DLG_EDGE"))); QPixmap image0 ( mgr->loadPixmap("SMESH", tr("ICON_DLG_EDGE")));
QPixmap image1 ( mgr->loadPixmap("SMESH", tr("ICON_DLG_TRIANGLE"))); QPixmap image1 ( mgr->loadPixmap("SMESH", tr("ICON_DLG_TRIANGLE")));
@ -187,18 +192,38 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
GroupAxisLayout->addWidget(TextLabelDZ, 1, 6); GroupAxisLayout->addWidget(TextLabelDZ, 1, 6);
GroupAxisLayout->addWidget(SpinBox_DZ, 1, 7); GroupAxisLayout->addWidget(SpinBox_DZ, 1, 7);
// Controls for angle defining // Controls for angle defining & number of steps defining
TextLabelAngle = new QLabel(tr("SMESH_ANGLE"), GroupArguments); GroupAngleBox = new QGroupBox(tr("SMESH_ANGLE"), GroupArguments);
SpinBox_Angle = new SMESHGUI_SpinBox(GroupArguments); GroupAngle = new QButtonGroup(GroupAngleBox);
QGridLayout* GroupAngleLayout = new QGridLayout(GroupAngleBox);
GroupAngleLayout->setSpacing(6);
GroupAngleLayout->setMargin(11);
// Controls for nb. steps defining RadioButton3 = new QRadioButton(tr("ANGLE_BY_STEP"), GroupAngleBox);
TextLabelNbSteps = new QLabel(tr("SMESH_NUMBEROFSTEPS"), GroupArguments); RadioButton4 = new QRadioButton(tr("TOTAL_ANGLE"), GroupAngleBox);
SpinBox_NbSteps = new QSpinBox(GroupArguments); GroupAngle->addButton(RadioButton3, 0);
GroupAngle->addButton(RadioButton4, 1);
TextLabelAngle = new QLabel(tr("SMESH_ANGLE"), GroupAngleBox);
SpinBox_Angle = new SMESHGUI_SpinBox(GroupAngleBox);
TextLabelNbSteps = new QLabel(tr("SMESH_NUMBEROFSTEPS"), GroupAngleBox);
SpinBox_NbSteps = new QSpinBox(GroupAngleBox);
GroupAngleLayout->addWidget(RadioButton3, 0, 0);
GroupAngleLayout->addWidget(RadioButton4, 0, 1);
GroupAngleLayout->addWidget(TextLabelAngle, 1, 0);
GroupAngleLayout->addWidget(SpinBox_Angle, 1, 1);
GroupAngleLayout->addWidget(TextLabelNbSteps, 2, 0);
GroupAngleLayout->addWidget(SpinBox_NbSteps, 2, 1);
// Controls for tolerance defining // Controls for tolerance defining
TextLabelTolerance = new QLabel(tr("SMESH_TOLERANCE"), GroupArguments); TextLabelTolerance = new QLabel(tr("SMESH_TOLERANCE"), GroupArguments);
SpinBox_Tolerance = new SMESHGUI_SpinBox(GroupArguments); SpinBox_Tolerance = new SMESHGUI_SpinBox(GroupArguments);
// Control for mesh preview
CheckBoxPreview = new QCheckBox(tr("PREVIEW"), GroupArguments);
// CheckBox for groups generation // CheckBox for groups generation
MakeGroupsCheck = new QCheckBox(tr("SMESH_MAKE_GROUPS"), GroupArguments); MakeGroupsCheck = new QCheckBox(tr("SMESH_MAKE_GROUPS"), GroupArguments);
MakeGroupsCheck->setChecked(true); MakeGroupsCheck->setChecked(true);
@ -208,12 +233,10 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
GroupArgumentsLayout->addWidget(LineEditElements, 0, 2); GroupArgumentsLayout->addWidget(LineEditElements, 0, 2);
GroupArgumentsLayout->addWidget(CheckBoxMesh, 1, 0, 1, 3); GroupArgumentsLayout->addWidget(CheckBoxMesh, 1, 0, 1, 3);
GroupArgumentsLayout->addWidget(GroupAxis, 2, 0, 1, 3); GroupArgumentsLayout->addWidget(GroupAxis, 2, 0, 1, 3);
GroupArgumentsLayout->addWidget(TextLabelAngle, 3, 0, 1, 2); GroupArgumentsLayout->addWidget(GroupAngleBox, 3, 0, 1, 3);
GroupArgumentsLayout->addWidget(SpinBox_Angle, 3, 2); GroupArgumentsLayout->addWidget(TextLabelTolerance, 4, 0, 1, 2);
GroupArgumentsLayout->addWidget(TextLabelNbSteps, 4, 0, 1, 2); GroupArgumentsLayout->addWidget(SpinBox_Tolerance, 4, 2);
GroupArgumentsLayout->addWidget(SpinBox_NbSteps, 4, 2); GroupArgumentsLayout->addWidget(CheckBoxPreview, 5, 0, 1, 3);
GroupArgumentsLayout->addWidget(TextLabelTolerance, 5, 0, 1, 2);
GroupArgumentsLayout->addWidget(SpinBox_Tolerance, 5, 2);
GroupArgumentsLayout->addWidget(MakeGroupsCheck, 6, 0, 1, 3); GroupArgumentsLayout->addWidget(MakeGroupsCheck, 6, 0, 1, 3);
/***************************************************************/ /***************************************************************/
@ -253,6 +276,8 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3); SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3); SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
RadioButton3->setChecked(true);
SpinBox_Angle->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5.0, 3); SpinBox_Angle->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5.0, 3);
SpinBox_NbSteps->setRange(1, 999999); SpinBox_NbSteps->setRange(1, 999999);
@ -291,6 +316,10 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
connect(SelectPointButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); connect(SelectPointButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(SelectVectorButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); connect(SelectVectorButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(SpinBox_X, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
connect(SpinBox_Y, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
connect(SpinBox_Z, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
connect(SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(onVectorChanged())); connect(SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(onVectorChanged()));
connect(SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(onVectorChanged())); connect(SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(onVectorChanged()));
connect(SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(onVectorChanged())); connect(SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(onVectorChanged()));
@ -302,6 +331,12 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&))); connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool))); connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool)));
connect(GroupAngle, SIGNAL(buttonClicked(int)), this, SLOT(toDisplaySimulation()));
connect(SpinBox_Angle, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
connect(SpinBox_NbSteps, SIGNAL(valueChanged(int)), this, SLOT(toDisplaySimulation()));
connect(SpinBox_Tolerance, SIGNAL(valueChanged(double)), this, SLOT(toDisplaySimulation()));
connect(CheckBoxPreview, SIGNAL(toggled(bool)), this, SLOT(onDisplaySimulation(bool)));
ConstructorsClicked(0); ConstructorsClicked(0);
SelectionIntoArgument(); SelectionIntoArgument();
} }
@ -312,7 +347,7 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
//================================================================================= //=================================================================================
SMESHGUI_RevolutionDlg::~SMESHGUI_RevolutionDlg() SMESHGUI_RevolutionDlg::~SMESHGUI_RevolutionDlg()
{ {
// no need to delete child widgets, Qt does it all for us delete mySimulation;
} }
//================================================================================= //=================================================================================
@ -345,6 +380,8 @@ void SMESHGUI_RevolutionDlg::Init (bool ResetControls)
CheckBoxMesh->setChecked(false); CheckBoxMesh->setChecked(false);
onSelectMesh(false); onSelectMesh(false);
CheckBoxPreview->setChecked(false);
onDisplaySimulation(false);
} }
} }
@ -354,7 +391,17 @@ void SMESHGUI_RevolutionDlg::Init (bool ResetControls)
//================================================================================= //=================================================================================
void SMESHGUI_RevolutionDlg::ConstructorsClicked (int constructorId) void SMESHGUI_RevolutionDlg::ConstructorsClicked (int constructorId)
{ {
disconnect(mySelectionMgr, 0, this, 0); //disconnect(mySelectionMgr, 0, this, 0);
SALOME_ListIO io;
mySelectionMgr->selectedObjects( io );
SALOME_ListIO aList;
mySelectionMgr->setSelectedObjects( aList );
// LineEditElements->clear();
myNbOkElements = 0;
buttonApply->setEnabled(false);
buttonOk->setEnabled(false);
mySimulation->SetVisibility(false);
Selection_Mode aSelMode = ActorSelection; Selection_Mode aSelMode = ActorSelection;
@ -389,7 +436,8 @@ void SMESHGUI_RevolutionDlg::ConstructorsClicked (int constructorId)
if (CheckBoxMesh->isChecked()) if (CheckBoxMesh->isChecked())
onSelectMesh(true); onSelectMesh(true);
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); //connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
mySelectionMgr->setSelectedObjects( io );
} }
//================================================================================= //=================================================================================
@ -423,6 +471,9 @@ void SMESHGUI_RevolutionDlg::ClickOnApply()
long aNbSteps = (long)SpinBox_NbSteps->value(); long aNbSteps = (long)SpinBox_NbSteps->value();
double aTolerance = SpinBox_Tolerance->GetValue(); double aTolerance = SpinBox_Tolerance->GetValue();
if ( GroupAngle->checkedId() == 1 )
anAngle = anAngle/aNbSteps;
try { try {
SUIT_OverrideCursor aWaitCursor; SUIT_OverrideCursor aWaitCursor;
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
@ -544,6 +595,7 @@ void SMESHGUI_RevolutionDlg::onTextChange (const QString& theNewText)
buttonOk->setEnabled(true); buttonOk->setEnabled(true);
buttonApply->setEnabled(true); buttonApply->setEnabled(true);
} }
onDisplaySimulation(true);
myBusy = false; myBusy = false;
} }
@ -714,6 +766,8 @@ void SMESHGUI_RevolutionDlg::SelectionIntoArgument()
buttonOk->setEnabled(true); buttonOk->setEnabled(true);
buttonApply->setEnabled(true); buttonApply->setEnabled(true);
} }
onDisplaySimulation(true);
} }
//================================================================================= //=================================================================================
@ -729,6 +783,7 @@ void SMESHGUI_RevolutionDlg::SetEditCurrentArgument()
mySelectionMgr->clearFilters(); mySelectionMgr->clearFilters();
if (send == SelectElementsButton) { if (send == SelectElementsButton) {
mySimulation->SetVisibility(false);
myEditCurrentArgument = (QWidget*)LineEditElements; myEditCurrentArgument = (QWidget*)LineEditElements;
SMESH::SetPointRepresentation(false); SMESH::SetPointRepresentation(false);
if (CheckBoxMesh->isChecked()) { if (CheckBoxMesh->isChecked()) {
@ -842,6 +897,7 @@ void SMESHGUI_RevolutionDlg::onSelectMesh (bool toSelectMesh)
if (myEditCurrentArgument != LineEditElements) { if (myEditCurrentArgument != LineEditElements) {
LineEditElements->clear(); LineEditElements->clear();
mySimulation->SetVisibility(false);
return; return;
} }
@ -870,6 +926,7 @@ void SMESHGUI_RevolutionDlg::onSelectMesh (bool toSelectMesh)
LineEditElements->setReadOnly(false); LineEditElements->setReadOnly(false);
LineEditElements->setValidator(myIdValidator); LineEditElements->setValidator(myIdValidator);
onTextChange(LineEditElements->text()); onTextChange(LineEditElements->text());
mySimulation->SetVisibility(false);
} }
SelectionIntoArgument(); SelectionIntoArgument();
@ -908,6 +965,7 @@ void SMESHGUI_RevolutionDlg::onVectorChanged()
buttonOk->setEnabled(false); buttonOk->setEnabled(false);
buttonApply->setEnabled(false); buttonApply->setEnabled(false);
} }
onDisplaySimulation(true);
} }
//================================================================================= //=================================================================================
@ -925,3 +983,71 @@ void SMESHGUI_RevolutionDlg::keyPressEvent( QKeyEvent* e )
ClickOnHelp(); ClickOnHelp();
} }
} }
//=================================================================================
// function : toDisplaySimulation()
// purpose :
//=================================================================================
void SMESHGUI_RevolutionDlg::toDisplaySimulation()
{
onDisplaySimulation(true);
}
//=================================================================================
// function : onDisplaySimulation()
// purpose :
//=================================================================================
void SMESHGUI_RevolutionDlg::onDisplaySimulation(bool toDisplayPreview)
{
if (CheckBoxPreview->isChecked() && toDisplayPreview)
{
//display preview
if (myNbOkElements && IsAxisOk())
{
QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
SMESH::long_array_var anElementsId = new SMESH::long_array;
anElementsId->length(aListElementsId.count());
for (int i = 0; i < aListElementsId.count(); i++)
anElementsId[i] = aListElementsId[i].toInt();
SMESH::AxisStruct anAxis;
anAxis.x = SpinBox_X->GetValue();
anAxis.y = SpinBox_Y->GetValue();
anAxis.z = SpinBox_Z->GetValue();
anAxis.vx = SpinBox_DX->GetValue();
anAxis.vy = SpinBox_DY->GetValue();
anAxis.vz = SpinBox_DZ->GetValue();
double anAngle = (SpinBox_Angle->GetValue())*PI/180;
long aNbSteps = (long)SpinBox_NbSteps->value();
double aTolerance = SpinBox_Tolerance->GetValue();
if (GroupAngle->checkedId() == 1)
anAngle = anAngle/aNbSteps;
try {
SUIT_OverrideCursor aWaitCursor;
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
aMeshEditor->RotationSweep(anElementsId.inout(),
anAxis,
anAngle,
aNbSteps,
aTolerance);
SMESH::MeshPreviewStruct_var aMeshPreviewStruct = aMeshEditor->GetPreviewData();
mySimulation->SetData(aMeshPreviewStruct._retn());
} catch (...) {}
}
else
{
mySimulation->SetVisibility(false);
}
}
else
{
//erase preview
mySimulation->SetVisibility(false);
}
}

View File

@ -51,6 +51,8 @@ class SMESH_Actor;
class SVTK_Selector; class SVTK_Selector;
class LightApp_SelectionMgr; class LightApp_SelectionMgr;
class SMESH_LogicalFilter; class SMESH_LogicalFilter;
class SALOME_Actor;
class SMESHGUI_MeshEditPreview;
//================================================================================= //=================================================================================
// class : SMESHGUI_RevolutionDlg // class : SMESHGUI_RevolutionDlg
@ -85,6 +87,8 @@ private:
SMESH::SMESH_Mesh_var myMesh; SMESH::SMESH_Mesh_var myMesh;
SMESH_Actor* myActor; SMESH_Actor* myActor;
SMESH_LogicalFilter* myMeshOrSubMeshOrGroupFilter; SMESH_LogicalFilter* myMeshOrSubMeshOrGroupFilter;
SMESHGUI_MeshEditPreview* mySimulation;
SALOME_Actor* myPreviewActor;
QGroupBox* ConstructorsBox; QGroupBox* ConstructorsBox;
QButtonGroup* GroupConstructors; QButtonGroup* GroupConstructors;
@ -102,6 +106,11 @@ private:
QLineEdit* LineEditElements; QLineEdit* LineEditElements;
QCheckBox* CheckBoxMesh; QCheckBox* CheckBoxMesh;
QCheckBox* MakeGroupsCheck; QCheckBox* MakeGroupsCheck;
QGroupBox* GroupAngleBox;
QButtonGroup* GroupAngle;
QRadioButton* RadioButton3;
QRadioButton* RadioButton4;
QCheckBox* CheckBoxPreview;
QLabel* TextLabelPoint; QLabel* TextLabelPoint;
QPushButton* SelectPointButton; QPushButton* SelectPointButton;
@ -142,6 +151,8 @@ private slots:
void onTextChange( const QString& ); void onTextChange( const QString& );
void onSelectMesh( bool ); void onSelectMesh( bool );
void onVectorChanged(); void onVectorChanged();
void toDisplaySimulation();
void onDisplaySimulation( bool );
}; };
#endif // SMESHGUI_REVOLUTIONDLG_H #endif // SMESHGUI_REVOLUTIONDLG_H

View File

@ -114,6 +114,8 @@ QVariant SMESHGUI_Selection::parameter( const int ind, const QString& p ) const
else if ( p=="displayMode" ) val = QVariant( displayMode( ind ) ); else if ( p=="displayMode" ) val = QVariant( displayMode( ind ) );
else if ( p=="isComputable" ) val = QVariant( isComputable( ind ) ); else if ( p=="isComputable" ) val = QVariant( isComputable( ind ) );
else if ( p=="hasReference" ) val = QVariant( hasReference( ind ) ); else if ( p=="hasReference" ) val = QVariant( hasReference( ind ) );
else if ( p=="isImported" ) val = QVariant( isImported( ind ) );
if( val.isValid() ) if( val.isValid() )
return val; return val;
@ -486,3 +488,20 @@ QString SMESHGUI_Selection::typeName( const int t )
return "Unknown"; return "Unknown";
} }
} }
bool SMESHGUI_Selection::isImported( const int ind ) const
{
QString e = entry( ind );
_PTR(SObject) SO = SMESH::GetActiveStudyDocument()->FindObjectID( e.toLatin1().constData() );
bool res = false;
if( SO )
{
SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow( SMESH::SObjectToObject( SO ) );
if( !aMesh->_is_nil() )
{
SALOME_MED::MedFileInfo* inf = aMesh->GetMEDFileInfo();
res = strlen( (char*)inf->fileName ) > 0;
}
}
return res;
}

View File

@ -70,6 +70,8 @@ public:
static int type( const QString&, _PTR(Study) ); static int type( const QString&, _PTR(Study) );
static QString typeName( const int ); static QString typeName( const int );
bool isImported( const int ) const;
private: private:
QStringList myTypes; QStringList myTypes;
QList<SMESH_Actor*> myActors; QList<SMESH_Actor*> myActors;

View File

@ -2727,6 +2727,10 @@ Consider saving your work before application crash</translation>
<source>WARP_ELEMENTS</source> <source>WARP_ELEMENTS</source>
<translation>Warping</translation> <translation>Warping</translation>
</message> </message>
<message>
<source>MEN_FILE_INFO</source>
<translation>MED file information</translation>
</message>
</context> </context>
<context> <context>
<name>SMESHGUI</name> <name>SMESHGUI</name>
@ -4093,7 +4097,7 @@ It is impossible to read point coordinates from file</translation>
<name>SMESHGUI_RevolutionDlg</name> <name>SMESHGUI_RevolutionDlg</name>
<message> <message>
<source>ANGLE_BY_STEP</source> <source>ANGLE_BY_STEP</source>
<translation>Use Angle by Step</translation> <translation>Angle by Step</translation>
</message> </message>
<message> <message>
<source>PREVIEW</source> <source>PREVIEW</source>
@ -4113,7 +4117,7 @@ It is impossible to read point coordinates from file</translation>
</message> </message>
<message> <message>
<source>TOTAL_ANGLE</source> <source>TOTAL_ANGLE</source>
<translation>Use Total Angle</translation> <translation>Total Angle</translation>
</message> </message>
</context> </context>
<context> <context>
@ -4308,4 +4312,23 @@ It is impossible to read point coordinates from file</translation>
<translation>Gravity center</translation> <translation>Gravity center</translation>
</message> </message>
</context> </context>
<context>
<name>SMESHGUI_FileInfoDlg</name>
<message>
<source>CAPTION</source>
<translation>File information</translation>
</message>
<message>
<source>FILE_NAME</source>
<translation>File name</translation>
</message>
<message>
<source>FILE_SIZE</source>
<translation>File size (bytes)</translation>
</message>
<message>
<source>MED_VERSION</source>
<translation>MED version</translation>
</message>
</context>
</TS> </TS>

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,11 +1582,80 @@ 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));
@ -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 << ", ";

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

@ -2089,6 +2089,57 @@ SMESH_MeshEditor_i::LinearAnglesVariation(SMESH::SMESH_Mesh_ptr thePathMes
const SMESH::double_array & theAngles) const SMESH::double_array & theAngles)
{ {
SMESH::double_array_var aResult = new SMESH::double_array(); SMESH::double_array_var aResult = new SMESH::double_array();
int nbAngles = theAngles.length();
if ( nbAngles > 0 && !thePathMesh->_is_nil() && !thePathShape->_is_nil() )
{
SMESH_Mesh_i* aMeshImp = SMESH::DownCast<SMESH_Mesh_i*>( thePathMesh );
TopoDS_Shape aShape = SMESH_Gen_i::GetSMESHGen()->GeomObjectToShape( thePathShape );
SMESH_subMesh* aSubMesh = aMeshImp->GetImpl().GetSubMesh( aShape );
if ( !aSubMesh || !aSubMesh->GetSubMeshDS())
return aResult._retn();
int nbSteps = aSubMesh->GetSubMeshDS()->NbElements();
if ( nbSteps == nbAngles )
{
aResult.inout() = theAngles;
}
else
{
aResult->length( nbSteps );
double rAn2St = double( nbAngles ) / double( nbSteps );
double angPrev = 0, angle;
for ( int iSt = 0; iSt < nbSteps; ++iSt )
{
double angCur = rAn2St * ( iSt+1 );
double angCurFloor = floor( angCur );
double angPrevFloor = floor( angPrev );
if ( angPrevFloor == angCurFloor )
angle = rAn2St * theAngles[ int( angCurFloor ) ];
else
{
int iP = int( angPrevFloor );
double angPrevCeil = ceil(angPrev);
angle = ( angPrevCeil - angPrev ) * theAngles[ iP ];
int iC = int( angCurFloor );
if ( iC < nbAngles )
angle += ( angCur - angCurFloor ) * theAngles[ iC ];
iP = int( angPrevCeil );
while ( iC-- > iP )
angle += theAngles[ iC ];
}
aResult[ iSt ] = angle;
angPrev = angCur;
}
}
}
// Update Python script
TPythonDump() << "rotAngles = " << theAngles;
TPythonDump() << "rotAngles = " << this << ".LinearAnglesVariation( "
<< thePathMesh << ", "
<< thePathShape << ", "
<< "rotAngles )";
return aResult._retn(); return aResult._retn();
} }

View File

@ -240,6 +240,7 @@ SMESH_Mesh_i::ImportMEDFile( const char* theFileName, const char* theMeshName )
THROW_SALOME_CORBA_EXCEPTION("ImportMEDFile(): unknown exception", SALOME::BAD_PARAM); THROW_SALOME_CORBA_EXCEPTION("ImportMEDFile(): unknown exception", SALOME::BAD_PARAM);
} }
myFile = theFileName;
CreateGroupServants(); CreateGroupServants();
return ConvertDriverMEDReadStatus(status); return ConvertDriverMEDReadStatus(status);
@ -2479,3 +2480,28 @@ SMESH::ListOfGroups* SMESH_Mesh_i::GetGroups(const list<int>& groupIDs) const
aList->length( nbGroups ); aList->length( nbGroups );
return aList._retn(); return aList._retn();
} }
//=============================================================================
/*!
* \brief Return information about imported file
*/
//=============================================================================
SALOME_MED::MedFileInfo* SMESH_Mesh_i::GetMEDFileInfo()
{
SALOME_MED::MedFileInfo_var res = new SALOME_MED::MedFileInfo();
const char* name = myFile.c_str();
res->fileName = name;
res->fileSize = 0;//myFileInfo.size();
int major, minor, release;
if( !MED::getMEDVersion( name, major, minor, release ) )
{
major = -1;
minor = -1;
release = -1;
}
res->major = major;
res->minor = minor;
res->release = release;
return res._retn();
}

View File

@ -436,6 +436,10 @@ public:
*/ */
SMESH::double_array* BaryCenter(CORBA::Long id); SMESH::double_array* BaryCenter(CORBA::Long id);
/*!
* Returns information about imported MED file
*/
virtual SALOME_MED::MedFileInfo* GetMEDFileInfo();
std::map<int, SMESH_subMesh_i*> _mapSubMesh_i; //NRI std::map<int, SMESH_subMesh_i*> _mapSubMesh_i; //NRI
std::map<int, ::SMESH_subMesh*> _mapSubMesh; //NRI std::map<int, ::SMESH_subMesh*> _mapSubMesh; //NRI
@ -450,6 +454,7 @@ private:
std::map<int, SMESH::SMESH_subMesh_ptr> _mapSubMeshIor; std::map<int, SMESH::SMESH_subMesh_ptr> _mapSubMeshIor;
std::map<int, SMESH::SMESH_GroupBase_ptr> _mapGroups; std::map<int, SMESH::SMESH_GroupBase_ptr> _mapGroups;
std::map<int, SMESH::SMESH_Hypothesis_ptr> _mapHypo; std::map<int, SMESH::SMESH_Hypothesis_ptr> _mapHypo;
string myFile;
}; };
#endif #endif

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

@ -44,6 +44,7 @@
#include <BRep_Builder.hxx> #include <BRep_Builder.hxx>
#include <BRep_Tool.hxx> #include <BRep_Tool.hxx>
#include <TopExp.hxx> #include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS_Face.hxx> #include <TopoDS_Face.hxx>
#include <TopoDS_Vertex.hxx> #include <TopoDS_Vertex.hxx>
#include <TopoDS_Wire.hxx> #include <TopoDS_Wire.hxx>
@ -505,12 +506,20 @@ TSideVector StdMeshers_FaceSide::GetFaceWires(const TopoDS_Face& theFace,
return TSideVector(0); return TSideVector(0);
} }
} }
// find out side orientation, which is important if there are several wires (PAL19080)
bool isForward = true;
if ( nbWires > 1 ) {
TopExp_Explorer e( theFace, TopAbs_EDGE );
while ( ! e.Current().IsSame( wireEdges.back() ))
e.Next();
isForward = ( e.Current().Orientation() == wireEdges.back().Orientation() );
}
StdMeshers_FaceSide* wire = new StdMeshers_FaceSide( theFace, wireEdges, &theMesh, StdMeshers_FaceSide* wire = new StdMeshers_FaceSide( theFace, wireEdges, &theMesh,
true, theIgnoreMediumNodes); isForward, theIgnoreMediumNodes);
wires[ iW ] = StdMeshers_FaceSidePtr( wire ); wires[ iW ] = StdMeshers_FaceSidePtr( wire );
from = to; from = to;
} }
return wires; return wires;
} }

View File

@ -113,6 +113,8 @@ bool StdMeshers_MEFISTO_2D::CheckHypothesis
{ {
_hypMaxElementArea = NULL; _hypMaxElementArea = NULL;
_hypLengthFromEdges = NULL; _hypLengthFromEdges = NULL;
_edgeLength = 0;
_maxElementArea = 0;
list <const SMESHDS_Hypothesis * >::const_iterator itl; list <const SMESHDS_Hypothesis * >::const_iterator itl;
const SMESHDS_Hypothesis *theHyp; const SMESHDS_Hypothesis *theHyp;
@ -121,8 +123,8 @@ bool StdMeshers_MEFISTO_2D::CheckHypothesis
int nbHyp = hyps.size(); int nbHyp = hyps.size();
if (!nbHyp) if (!nbHyp)
{ {
aStatus = SMESH_Hypothesis::HYP_MISSING; aStatus = SMESH_Hypothesis::HYP_OK; //SMESH_Hypothesis::HYP_MISSING;
return false; // can't work with no hypothesis return true; // (PAL13464) can work with no hypothesis, LengthFromEdges is default one
} }
itl = hyps.begin(); itl = hyps.begin();
@ -137,7 +139,6 @@ bool StdMeshers_MEFISTO_2D::CheckHypothesis
_hypMaxElementArea = static_cast<const StdMeshers_MaxElementArea *>(theHyp); _hypMaxElementArea = static_cast<const StdMeshers_MaxElementArea *>(theHyp);
ASSERT(_hypMaxElementArea); ASSERT(_hypMaxElementArea);
_maxElementArea = _hypMaxElementArea->GetMaxArea(); _maxElementArea = _hypMaxElementArea->GetMaxArea();
_edgeLength = 0;
isOk = true; isOk = true;
aStatus = SMESH_Hypothesis::HYP_OK; aStatus = SMESH_Hypothesis::HYP_OK;
} }
@ -146,8 +147,6 @@ bool StdMeshers_MEFISTO_2D::CheckHypothesis
{ {
_hypLengthFromEdges = static_cast<const StdMeshers_LengthFromEdges *>(theHyp); _hypLengthFromEdges = static_cast<const StdMeshers_LengthFromEdges *>(theHyp);
ASSERT(_hypLengthFromEdges); ASSERT(_hypLengthFromEdges);
_edgeLength = 0;
_maxElementArea = 0;
isOk = true; isOk = true;
aStatus = SMESH_Hypothesis::HYP_OK; aStatus = SMESH_Hypothesis::HYP_OK;
} }
@ -201,7 +200,7 @@ bool StdMeshers_MEFISTO_2D::Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aSh
SMESH_Comment("Too few segments: ")<<wires[0]->NbSegments()); SMESH_Comment("Too few segments: ")<<wires[0]->NbSegments());
// compute average edge length // compute average edge length
if (_hypLengthFromEdges) if (!_hypMaxElementArea)
{ {
_edgeLength = 0; _edgeLength = 0;
int nbSegments = 0; int nbSegments = 0;
@ -215,7 +214,7 @@ bool StdMeshers_MEFISTO_2D::Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aSh
_edgeLength /= nbSegments; _edgeLength /= nbSegments;
} }
if (_hypLengthFromEdges && _edgeLength < DBL_MIN ) if (/*_hypLengthFromEdges &&*/ _edgeLength < DBL_MIN )
_edgeLength = 100; _edgeLength = 100;
Z nblf; //nombre de lignes fermees (enveloppe en tete) Z nblf; //nombre de lignes fermees (enveloppe en tete)

View File

@ -83,7 +83,7 @@ protected:
std::list<const SMDS_MeshNode*> myNodesOnCommonV; std::list<const SMDS_MeshNode*> myNodesOnCommonV;
SMESH_MesherHelper* myTool; // toll for working with quadratic elements SMESH_MesherHelper* myTool; // tool for working with quadratic elements
}; };
#endif #endif

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"