mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-12 01:30:34 +05:00
Merge from BR_Dev_For_4_0 branch (from tag mergeto_BR_QT4_Dev_07Jul08)
This commit is contained in:
parent
b78e4ec403
commit
47a901faf4
@ -27,12 +27,23 @@ EXTRA_DIST+=SMESH
|
||||
|
||||
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:
|
||||
cd ./SMESH; \
|
||||
echo "Processing smeshDC.py file: "; \
|
||||
$(doxygen) ./doxyfile_py; \
|
||||
sed 's|../../../share/salome|$(top_srcdir)|' ./doxyfile > ./doxyfile1; \
|
||||
mv -f doxyfile1 doxyfile; \
|
||||
cd ./smeshpy_doc; \
|
||||
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`; \
|
||||
$(doxygen) ./doxyfile;
|
||||
|
||||
|
@ -19,7 +19,7 @@ WARNINGS = YES
|
||||
INPUT = @srcdir@/input
|
||||
FILE_PATTERNS = *.doc
|
||||
IMAGE_PATH = @srcdir@/images
|
||||
EXAMPLE_PATH = ../../../share/salome/src/SMESH_SWIG
|
||||
EXAMPLE_PATH = @top_srcdir@/src/SMESH_SWIG
|
||||
#---------------------------------------------------------------------------
|
||||
#HTML related options
|
||||
#---------------------------------------------------------------------------
|
||||
|
@ -7,7 +7,7 @@ CREATE_SUBDIRS = NO
|
||||
OUTPUT_LANGUAGE = English
|
||||
USE_WINDOWS_ENCODING = NO
|
||||
BRIEF_MEMBER_DESC = YES
|
||||
REPEAT_BRIEF = NO
|
||||
REPEAT_BRIEF = YES
|
||||
ALWAYS_DETAILED_SEC = YES
|
||||
INLINE_INHERITED_MEMB = YES
|
||||
FULL_PATH_NAMES = NO
|
||||
@ -38,7 +38,7 @@ HIDE_FRIEND_COMPOUNDS = NO
|
||||
HIDE_IN_BODY_DOCS = NO
|
||||
INTERNAL_DOCS = YES
|
||||
CASE_SENSE_NAMES = YES
|
||||
HIDE_SCOPE_NAMES = NO
|
||||
HIDE_SCOPE_NAMES = YES
|
||||
SHOW_INCLUDE_FILES = YES
|
||||
INLINE_INFO = YES
|
||||
SORT_MEMBER_DOCS = NO
|
||||
@ -81,6 +81,7 @@ INPUT = @top_srcdir@/src/SMESH_SWIG
|
||||
FILE_PATTERNS = smeshDC.py
|
||||
IMAGE_PATH = @srcdir@/images
|
||||
RECURSIVE = NO
|
||||
EXAMPLE_PATH = @top_srcdir@/src/SMESH_SWIG
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
#HTML related options
|
||||
@ -107,19 +108,26 @@ GENERATE_RTF = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the dot tool
|
||||
#---------------------------------------------------------------------------
|
||||
CLASS_DIAGRAMS = YES
|
||||
#CLASS_DIAGRAMS = YES
|
||||
CLASS_DIAGRAMS = NO
|
||||
HIDE_UNDOC_RELATIONS = NO
|
||||
HAVE_DOT = YES
|
||||
CLASS_GRAPH = YES
|
||||
#HAVE_DOT = YES
|
||||
HAVE_DOT = NO
|
||||
#CLASS_GRAPH = YES
|
||||
CLASS_GRAPH = NO
|
||||
COLLABORATION_GRAPH = NO
|
||||
GROUP_GRAPHS = NO
|
||||
UML_LOOK = NO
|
||||
TEMPLATE_RELATIONS = YES
|
||||
INCLUDE_GRAPH = YES
|
||||
#TEMPLATE_RELATIONS = YES
|
||||
#INCLUDE_GRAPH = YES
|
||||
TEMPLATE_RELATIONS = NO
|
||||
INCLUDE_GRAPH = NO
|
||||
INCLUDED_BY_GRAPH = NO
|
||||
CALL_GRAPH = NO
|
||||
GRAPHICAL_HIERARCHY = YES
|
||||
DIRECTORY_GRAPH = YES
|
||||
#GRAPHICAL_HIERARCHY = YES
|
||||
#DIRECTORY_GRAPH = YES
|
||||
GRAPHICAL_HIERARCHY = NO
|
||||
DIRECTORY_GRAPH = NO
|
||||
DOT_IMAGE_FORMAT = jpg
|
||||
DOT_PATH =
|
||||
DOTFILE_DIRS =
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 63 KiB |
@ -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"
|
||||
for more information about groups.</li>
|
||||
</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
|
||||
and elements</b>, in which case it is possible to define the \b Tolerance
|
||||
for this operation.</li>
|
||||
@ -43,4 +49,4 @@ for this operation.</li>
|
||||
|
||||
\image html image160.gif
|
||||
|
||||
*/
|
||||
*/
|
||||
|
@ -5,6 +5,37 @@
|
||||
\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").
|
||||
|
||||
\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.
|
||||
|
||||
*/
|
||||
|
@ -275,6 +275,20 @@ module SMESH
|
||||
in double theMergeTolerance)
|
||||
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
|
||||
*
|
||||
|
@ -625,6 +625,8 @@ module SMESH
|
||||
*/
|
||||
double_array BaryCenter(in long id);
|
||||
|
||||
/*! Gets information about imported MED file */
|
||||
SALOME_MED::MedFileInfo GetMEDFileInfo();
|
||||
};
|
||||
|
||||
interface SMESH_subMesh : SALOME::GenericObj, SMESH_IDSource
|
||||
|
@ -2,6 +2,7 @@
|
||||
// Created : Mon Sep 24 18:32:41 2007
|
||||
// Author : Edward AGAPOV (eap)
|
||||
|
||||
using namespace std;
|
||||
|
||||
#ifndef SMDS_MeshInfo_HeaderFile
|
||||
#define SMDS_MeshInfo_HeaderFile
|
||||
|
@ -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 )
|
||||
return myInverseElements.Extent();
|
||||
|
@ -47,7 +47,7 @@ class SMDS_EXPORT SMDS_MeshNode:public SMDS_MeshElement
|
||||
void ClearInverseElements();
|
||||
bool emptyInverseElements();
|
||||
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);
|
||||
const SMDS_PositionPtr& GetPosition() const;
|
||||
SMDSAbs_ElementType GetType() const;
|
||||
|
@ -21,6 +21,8 @@
|
||||
// Created : Mon Aug 2 10:30:00 2004
|
||||
// Author : Edward AGAPOV (eap)
|
||||
|
||||
using namespace std;
|
||||
|
||||
#include "SMESH_Block.hxx"
|
||||
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
|
@ -6871,7 +6871,7 @@ int SMESH_MeshEditor::removeQuadElem(SMESHDS_SubMesh * theSm,
|
||||
vector<const SMDS_MeshNode*>::iterator nIt = mediumNodes.begin();
|
||||
for ( ; nIt != mediumNodes.end(); ++nIt ) {
|
||||
const SMDS_MeshNode* n = *nIt;
|
||||
if ( n->NbInverseNodes() == 0 ) {
|
||||
if ( n->NbInverseElements() == 0 ) {
|
||||
if ( n->GetPosition()->GetShapeId() != theShapeID )
|
||||
meshDS->RemoveFreeNode( n, meshDS->MeshElements
|
||||
( n->GetPosition()->GetShapeId() ));
|
||||
|
@ -27,6 +27,8 @@
|
||||
// Author : Nicolas Geimer & Aurélien Motteux (OCC)
|
||||
// Module : SMESH
|
||||
|
||||
using namespace std;
|
||||
|
||||
#ifndef _SMESH_OCTREENODE_HXX_
|
||||
#define _SMESH_OCTREENODE_HXX_
|
||||
|
||||
|
@ -21,6 +21,8 @@
|
||||
// Created : Mon Aug 2 10:30:00 2004
|
||||
// Author : Edward AGAPOV (eap)
|
||||
|
||||
using namespace std;
|
||||
|
||||
#include "SMESH_Pattern.hxx"
|
||||
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
|
@ -21,6 +21,8 @@
|
||||
// Created : Mon Aug 2 10:30:00 2004
|
||||
// Author : Edward AGAPOV (eap)
|
||||
|
||||
using namespace std;
|
||||
|
||||
#ifndef SMESH_Pattern_HeaderFile
|
||||
#define SMESH_Pattern_HeaderFile
|
||||
|
||||
|
@ -1195,7 +1195,7 @@ static void cleanSubMesh( SMESH_subMesh * subMesh )
|
||||
while (itn->more()) {
|
||||
const SMDS_MeshNode * node = itn->next();
|
||||
//MESSAGE( " RM node: "<<node->GetID());
|
||||
if ( node->NbInverseNodes() == 0 )
|
||||
if ( node->NbInverseElements() == 0 )
|
||||
meshDS->RemoveFreeNode(node, subMeshDS);
|
||||
else // for StdMeshers_CompositeSegment_1D: node in one submesh, edge in another
|
||||
meshDS->RemoveNode(node);
|
||||
|
@ -99,7 +99,8 @@ dist_libSMESH_la_SOURCES = \
|
||||
SMESHGUI_BuildCompoundDlg.cxx \
|
||||
SMESHGUI_ComputeDlg.cxx \
|
||||
SMESHGUI_MakeNodeAtPointDlg.cxx \
|
||||
SMESHGUI_MeshEditPreview.cxx
|
||||
SMESHGUI_MeshEditPreview.cxx \
|
||||
SMESHGUI_FileInfoDlg.cxx
|
||||
|
||||
MOC_FILES = \
|
||||
SMESHGUI_moc.cxx \
|
||||
@ -149,7 +150,8 @@ MOC_FILES = \
|
||||
SMESHGUI_ConvToQuadOp_moc.cxx \
|
||||
SMESHGUI_BuildCompoundDlg_moc.cxx \
|
||||
SMESHGUI_ComputeDlg_moc.cxx \
|
||||
SMESHGUI_MakeNodeAtPointDlg_moc.cxx
|
||||
SMESHGUI_MakeNodeAtPointDlg_moc.cxx \
|
||||
SMESHGUI_FileInfoDlg_moc.cxx
|
||||
|
||||
nodist_libSMESH_la_SOURCES= \
|
||||
$(MOC_FILES)
|
||||
|
@ -65,6 +65,7 @@
|
||||
#include "SMESHGUI_MakeNodeAtPointDlg.h"
|
||||
#include "SMESHGUI_BuildCompoundDlg.h"
|
||||
#include "SMESHGUI_ComputeDlg.h"
|
||||
#include "SMESHGUI_FileInfoDlg.h"
|
||||
|
||||
#include "SMESHGUI_Utils.h"
|
||||
#include "SMESHGUI_MeshUtils.h"
|
||||
@ -110,7 +111,7 @@
|
||||
// IDL includes
|
||||
#include <SALOMEconfig.h>
|
||||
#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
|
||||
#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
|
||||
#include CORBA_CLIENT_HEADER(SMESH_MeshEditor)
|
||||
|
||||
// Qt includes
|
||||
// #define INCLUDE_MENUITEM_DEF // VSR commented ????????
|
||||
@ -1263,6 +1264,25 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
||||
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 121:
|
||||
case 123:
|
||||
@ -2409,6 +2429,7 @@ void SMESHGUI::initialize( CAM_Application* app )
|
||||
createSMESHAction( 125, "EXPORT_MED" );
|
||||
createSMESHAction( 126, "EXPORT_UNV" );
|
||||
createSMESHAction( 141, "EXPORT_STL" );
|
||||
createSMESHAction( 150, "FILE_INFO" );
|
||||
createSMESHAction( 33, "DELETE", "ICON_DELETE", Qt::Key_Delete );
|
||||
createSMESHAction( 5105, "SEL_FILTER_LIB" );
|
||||
createSMESHAction( 701, "COMPUTE", "ICON_COMPUTE" );
|
||||
@ -2740,6 +2761,7 @@ void SMESHGUI::initialize( CAM_Application* app )
|
||||
|
||||
// popup for object browser
|
||||
|
||||
createPopupItem( 150, OB, mesh, "&& selcount=1 && isImported" ); // FILE INFORMATION
|
||||
createPopupItem( 704, OB, mesh, "&& isComputable"); // EDIT_MESHSUBMESH
|
||||
createPopupItem( 704, OB, subMesh, "&& isComputable" ); // EDIT_MESHSUBMESH
|
||||
createPopupItem( 803, OB, group ); // EDIT_GROUP
|
||||
|
@ -123,12 +123,15 @@ SMESHGUI_BuildCompoundDlg::SMESHGUI_BuildCompoundDlg( SMESHGUI* theModule )
|
||||
TextLabelMeshes = new QLabel(tr("MESHES"), GroupArgs);
|
||||
SelectButton = new QPushButton(GroupArgs);
|
||||
SelectButton->setIcon(image1);
|
||||
SelectButton->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
|
||||
LineEditMeshes = new QLineEdit(GroupArgs);
|
||||
LineEditMeshes->setReadOnly(true);
|
||||
|
||||
TextLabelUnion = new QLabel(tr("PROCESSING_IDENTICAL_GROUPS"), GroupArgs);
|
||||
ComboBoxUnion = new QComboBox(GroupArgs);
|
||||
|
||||
CheckBoxCommon = new QCheckBox(tr("CREATE_COMMON_GROUPS"), GroupArgs);
|
||||
|
||||
CheckBoxMerge = new QCheckBox(tr("MERGE_NODES_AND_ELEMENTS"), 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(TextLabelUnion, 1, 0, 1, 3);
|
||||
GroupArgsLayout->addWidget(ComboBoxUnion, 1, 3);
|
||||
GroupArgsLayout->addWidget(CheckBoxMerge, 2, 0, 1, 4);
|
||||
GroupArgsLayout->addWidget(TextLabelTol, 3, 0, 1, 2);
|
||||
GroupArgsLayout->addWidget(SpinBoxTol, 3, 2, 1, 2);
|
||||
GroupArgsLayout->addWidget(CheckBoxCommon, 2, 0, 1, 4);
|
||||
GroupArgsLayout->addWidget(CheckBoxMerge, 3, 0, 1, 4);
|
||||
GroupArgsLayout->addWidget(TextLabelTol, 4, 0, 1, 2);
|
||||
GroupArgsLayout->addWidget(SpinBoxTol, 4, 2, 1, 2);
|
||||
|
||||
/***************************************************************/
|
||||
GroupButtons = new QGroupBox(this);
|
||||
@ -287,12 +291,18 @@ bool SMESHGUI_BuildCompoundDlg::ClickOnApply()
|
||||
|
||||
SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen();
|
||||
// concatenate meshes
|
||||
SMESH::SMESH_Mesh_var aCompoundMesh =
|
||||
aSMESHGen->Concatenate(myMeshArray,
|
||||
!(ComboBoxUnion->currentIndex()),
|
||||
CheckBoxMerge->isChecked(),
|
||||
SpinBoxTol->GetValue());
|
||||
|
||||
SMESH::SMESH_Mesh_var aCompoundMesh;
|
||||
if(CheckBoxCommon->isChecked())
|
||||
aCompoundMesh = aSMESHGen->ConcatenateWithGroups(myMeshArray,
|
||||
!(ComboBoxUnion->currentIndex()),
|
||||
CheckBoxMerge->isChecked(),
|
||||
SpinBoxTol->GetValue());
|
||||
else
|
||||
aCompoundMesh = aSMESHGen->Concatenate(myMeshArray,
|
||||
!(ComboBoxUnion->currentIndex()),
|
||||
CheckBoxMerge->isChecked(),
|
||||
SpinBoxTol->GetValue());
|
||||
|
||||
SMESH::SetName( SMESH::FindSObject( aCompoundMesh ), LineEditName->text() );
|
||||
mySMESHGUI->updateObjBrowser();
|
||||
} catch(...) {
|
||||
|
@ -100,6 +100,7 @@ private:
|
||||
QLineEdit* LineEditMeshes;
|
||||
QLabel* TextLabelUnion;
|
||||
QComboBox* ComboBoxUnion;
|
||||
QCheckBox* CheckBoxCommon;
|
||||
QCheckBox* CheckBoxMerge;
|
||||
QLabel* TextLabelTol;
|
||||
SMESHGUI_SpinBox* SpinBoxTol;
|
||||
|
@ -253,11 +253,14 @@ SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theMod
|
||||
|
||||
AngleSpin = new SMESHGUI_SpinBox(AnglesGrp);
|
||||
|
||||
LinearAnglesCheck = new QCheckBox(tr("LINEAR_ANGLES"), AnglesGrp);
|
||||
|
||||
// layouting
|
||||
AnglesGrpLayout->addWidget(AnglesList, 0, 0, 4, 1);
|
||||
AnglesGrpLayout->addWidget(AddAngleButton, 0, 1);
|
||||
AnglesGrpLayout->addWidget(RemoveAngleButton, 2, 1);
|
||||
AnglesGrpLayout->addWidget(AngleSpin, 0, 2);
|
||||
AnglesGrpLayout->addWidget(LinearAnglesCheck, 4, 0);
|
||||
AnglesGrpLayout->setRowMinimumHeight(1, 10);
|
||||
AnglesGrpLayout->setRowStretch(3, 10);
|
||||
|
||||
@ -581,17 +584,20 @@ bool SMESHGUI_ExtrusionAlongPathDlg::ClickOnApply()
|
||||
try {
|
||||
SUIT_OverrideCursor wc;
|
||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
||||
if ( LinearAnglesCheck->isChecked() )
|
||||
anAngles = aMeshEditor->LinearAnglesVariation( myPathMesh, myPathShape, anAngles );
|
||||
|
||||
SMESH::SMESH_MeshEditor::Extrusion_Error retVal;
|
||||
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
|
||||
SMESH::ListOfGroups_var groups =
|
||||
aMeshEditor->ExtrusionAlongPathMakeGroups(anElementsId.inout(), myPathMesh,
|
||||
aMeshEditor->ExtrusionAlongPathMakeGroups(anElementsId, myPathMesh,
|
||||
myPathShape, aNodeStart,
|
||||
AnglesGrp->isChecked(), anAngles.inout(),
|
||||
AnglesGrp->isChecked(), anAngles,
|
||||
BasePointGrp->isChecked(), aBasePoint, retVal);
|
||||
else
|
||||
retVal = aMeshEditor->ExtrusionAlongPath(anElementsId.inout(), myPathMesh,
|
||||
retVal = aMeshEditor->ExtrusionAlongPath(anElementsId, myPathMesh,
|
||||
myPathShape, aNodeStart,
|
||||
AnglesGrp->isChecked(), anAngles.inout(),
|
||||
AnglesGrp->isChecked(), anAngles,
|
||||
BasePointGrp->isChecked(), aBasePoint);
|
||||
|
||||
//wc.stop();
|
||||
|
@ -113,6 +113,7 @@ private:
|
||||
QLineEdit* PathShapeLineEdit;
|
||||
QToolButton* SelectStartPointButton;
|
||||
QLineEdit* StartPointLineEdit;
|
||||
QCheckBox* LinearAnglesCheck;
|
||||
QGroupBox* AnglesGrp;
|
||||
QListWidget* AnglesList;
|
||||
QToolButton* AddAngleButton;
|
||||
|
77
src/SMESHGUI/SMESHGUI_FileInfoDlg.cxx
Normal file
77
src/SMESHGUI/SMESHGUI_FileInfoDlg.cxx
Normal 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()
|
||||
{
|
||||
}
|
43
src/SMESHGUI/SMESHGUI_FileInfoDlg.h
Normal file
43
src/SMESHGUI/SMESHGUI_FileInfoDlg.h
Normal 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
|
@ -32,6 +32,7 @@
|
||||
#include "SMESHGUI_VTKUtils.h"
|
||||
#include "SMESHGUI_MeshUtils.h"
|
||||
#include "SMESHGUI_IdValidator.h"
|
||||
#include "SMESHGUI_MeshEditPreview.h"
|
||||
|
||||
#include <SMESH_Actor.h>
|
||||
#include <SMESH_TypeFilter.hxx>
|
||||
@ -47,10 +48,12 @@
|
||||
|
||||
#include <LightApp_Application.h>
|
||||
#include <LightApp_SelectionMgr.h>
|
||||
#include <SalomeApp_Application.h>
|
||||
|
||||
#include <SVTK_ViewWindow.h>
|
||||
#include <SVTK_Selector.h>
|
||||
#include <SALOME_ListIO.hxx>
|
||||
#include <VTKViewer_CellLocationsArray.h>
|
||||
|
||||
// OCCT includes
|
||||
#include <TColStd_MapOfInteger.hxx>
|
||||
@ -87,6 +90,8 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
|
||||
mySMESHGUI( theModule ),
|
||||
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
|
||||
{
|
||||
mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));
|
||||
|
||||
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
|
||||
QPixmap image0 ( mgr->loadPixmap("SMESH", tr("ICON_DLG_EDGE")));
|
||||
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(SpinBox_DZ, 1, 7);
|
||||
|
||||
// Controls for angle defining
|
||||
TextLabelAngle = new QLabel(tr("SMESH_ANGLE"), GroupArguments);
|
||||
SpinBox_Angle = new SMESHGUI_SpinBox(GroupArguments);
|
||||
// Controls for angle defining & number of steps defining
|
||||
GroupAngleBox = new QGroupBox(tr("SMESH_ANGLE"), GroupArguments);
|
||||
GroupAngle = new QButtonGroup(GroupAngleBox);
|
||||
QGridLayout* GroupAngleLayout = new QGridLayout(GroupAngleBox);
|
||||
GroupAngleLayout->setSpacing(6);
|
||||
GroupAngleLayout->setMargin(11);
|
||||
|
||||
// Controls for nb. steps defining
|
||||
TextLabelNbSteps = new QLabel(tr("SMESH_NUMBEROFSTEPS"), GroupArguments);
|
||||
SpinBox_NbSteps = new QSpinBox(GroupArguments);
|
||||
RadioButton3 = new QRadioButton(tr("ANGLE_BY_STEP"), GroupAngleBox);
|
||||
RadioButton4 = new QRadioButton(tr("TOTAL_ANGLE"), GroupAngleBox);
|
||||
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
|
||||
TextLabelTolerance = new QLabel(tr("SMESH_TOLERANCE"), GroupArguments);
|
||||
SpinBox_Tolerance = new SMESHGUI_SpinBox(GroupArguments);
|
||||
|
||||
// Control for mesh preview
|
||||
CheckBoxPreview = new QCheckBox(tr("PREVIEW"), GroupArguments);
|
||||
|
||||
// CheckBox for groups generation
|
||||
MakeGroupsCheck = new QCheckBox(tr("SMESH_MAKE_GROUPS"), GroupArguments);
|
||||
MakeGroupsCheck->setChecked(true);
|
||||
@ -208,12 +233,10 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
|
||||
GroupArgumentsLayout->addWidget(LineEditElements, 0, 2);
|
||||
GroupArgumentsLayout->addWidget(CheckBoxMesh, 1, 0, 1, 3);
|
||||
GroupArgumentsLayout->addWidget(GroupAxis, 2, 0, 1, 3);
|
||||
GroupArgumentsLayout->addWidget(TextLabelAngle, 3, 0, 1, 2);
|
||||
GroupArgumentsLayout->addWidget(SpinBox_Angle, 3, 2);
|
||||
GroupArgumentsLayout->addWidget(TextLabelNbSteps, 4, 0, 1, 2);
|
||||
GroupArgumentsLayout->addWidget(SpinBox_NbSteps, 4, 2);
|
||||
GroupArgumentsLayout->addWidget(TextLabelTolerance, 5, 0, 1, 2);
|
||||
GroupArgumentsLayout->addWidget(SpinBox_Tolerance, 5, 2);
|
||||
GroupArgumentsLayout->addWidget(GroupAngleBox, 3, 0, 1, 3);
|
||||
GroupArgumentsLayout->addWidget(TextLabelTolerance, 4, 0, 1, 2);
|
||||
GroupArgumentsLayout->addWidget(SpinBox_Tolerance, 4, 2);
|
||||
GroupArgumentsLayout->addWidget(CheckBoxPreview, 5, 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_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
|
||||
|
||||
RadioButton3->setChecked(true);
|
||||
|
||||
SpinBox_Angle->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5.0, 3);
|
||||
|
||||
SpinBox_NbSteps->setRange(1, 999999);
|
||||
@ -291,6 +316,10 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
|
||||
connect(SelectPointButton, 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_DY, 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(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);
|
||||
SelectionIntoArgument();
|
||||
}
|
||||
@ -312,7 +347,7 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
|
||||
//=================================================================================
|
||||
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);
|
||||
onSelectMesh(false);
|
||||
CheckBoxPreview->setChecked(false);
|
||||
onDisplaySimulation(false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -354,7 +391,17 @@ void SMESHGUI_RevolutionDlg::Init (bool ResetControls)
|
||||
//=================================================================================
|
||||
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;
|
||||
|
||||
@ -389,7 +436,8 @@ void SMESHGUI_RevolutionDlg::ConstructorsClicked (int constructorId)
|
||||
if (CheckBoxMesh->isChecked())
|
||||
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();
|
||||
double aTolerance = SpinBox_Tolerance->GetValue();
|
||||
|
||||
if ( GroupAngle->checkedId() == 1 )
|
||||
anAngle = anAngle/aNbSteps;
|
||||
|
||||
try {
|
||||
SUIT_OverrideCursor aWaitCursor;
|
||||
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
|
||||
@ -544,6 +595,7 @@ void SMESHGUI_RevolutionDlg::onTextChange (const QString& theNewText)
|
||||
buttonOk->setEnabled(true);
|
||||
buttonApply->setEnabled(true);
|
||||
}
|
||||
onDisplaySimulation(true);
|
||||
|
||||
myBusy = false;
|
||||
}
|
||||
@ -714,6 +766,8 @@ void SMESHGUI_RevolutionDlg::SelectionIntoArgument()
|
||||
buttonOk->setEnabled(true);
|
||||
buttonApply->setEnabled(true);
|
||||
}
|
||||
|
||||
onDisplaySimulation(true);
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
@ -729,6 +783,7 @@ void SMESHGUI_RevolutionDlg::SetEditCurrentArgument()
|
||||
mySelectionMgr->clearFilters();
|
||||
|
||||
if (send == SelectElementsButton) {
|
||||
mySimulation->SetVisibility(false);
|
||||
myEditCurrentArgument = (QWidget*)LineEditElements;
|
||||
SMESH::SetPointRepresentation(false);
|
||||
if (CheckBoxMesh->isChecked()) {
|
||||
@ -842,6 +897,7 @@ void SMESHGUI_RevolutionDlg::onSelectMesh (bool toSelectMesh)
|
||||
|
||||
if (myEditCurrentArgument != LineEditElements) {
|
||||
LineEditElements->clear();
|
||||
mySimulation->SetVisibility(false);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -870,6 +926,7 @@ void SMESHGUI_RevolutionDlg::onSelectMesh (bool toSelectMesh)
|
||||
LineEditElements->setReadOnly(false);
|
||||
LineEditElements->setValidator(myIdValidator);
|
||||
onTextChange(LineEditElements->text());
|
||||
mySimulation->SetVisibility(false);
|
||||
}
|
||||
|
||||
SelectionIntoArgument();
|
||||
@ -908,6 +965,7 @@ void SMESHGUI_RevolutionDlg::onVectorChanged()
|
||||
buttonOk->setEnabled(false);
|
||||
buttonApply->setEnabled(false);
|
||||
}
|
||||
onDisplaySimulation(true);
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
@ -925,3 +983,71 @@ void SMESHGUI_RevolutionDlg::keyPressEvent( QKeyEvent* e )
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -51,6 +51,8 @@ class SMESH_Actor;
|
||||
class SVTK_Selector;
|
||||
class LightApp_SelectionMgr;
|
||||
class SMESH_LogicalFilter;
|
||||
class SALOME_Actor;
|
||||
class SMESHGUI_MeshEditPreview;
|
||||
|
||||
//=================================================================================
|
||||
// class : SMESHGUI_RevolutionDlg
|
||||
@ -65,83 +67,92 @@ public:
|
||||
~SMESHGUI_RevolutionDlg();
|
||||
|
||||
private:
|
||||
void Init( bool = true);
|
||||
void closeEvent( QCloseEvent* );
|
||||
void enterEvent( QEvent* ); /* mouse enter the QWidget */
|
||||
void hideEvent( QHideEvent* ); /* ESC key */
|
||||
void keyPressEvent( QKeyEvent* );
|
||||
int GetConstructorId();
|
||||
bool IsAxisOk();
|
||||
void Init( bool = true);
|
||||
void closeEvent( QCloseEvent* );
|
||||
void enterEvent( QEvent* ); /* mouse enter the QWidget */
|
||||
void hideEvent( QHideEvent* ); /* ESC key */
|
||||
void keyPressEvent( QKeyEvent* );
|
||||
int GetConstructorId();
|
||||
bool IsAxisOk();
|
||||
|
||||
SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
|
||||
SMESHGUI_IdValidator* myIdValidator;
|
||||
LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
|
||||
int myNbOkElements; /* to check when elements are defined */
|
||||
QString myElementsId;
|
||||
QWidget* myEditCurrentArgument; /* Current argument */
|
||||
SVTK_Selector* mySelector;
|
||||
SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
|
||||
SMESHGUI_IdValidator* myIdValidator;
|
||||
LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
|
||||
int myNbOkElements; /* to check when elements are defined */
|
||||
QString myElementsId;
|
||||
QWidget* myEditCurrentArgument; /* Current argument */
|
||||
SVTK_Selector* mySelector;
|
||||
|
||||
bool myBusy;
|
||||
SMESH::SMESH_Mesh_var myMesh;
|
||||
SMESH_Actor* myActor;
|
||||
SMESH_LogicalFilter* myMeshOrSubMeshOrGroupFilter;
|
||||
bool myBusy;
|
||||
SMESH::SMESH_Mesh_var myMesh;
|
||||
SMESH_Actor* myActor;
|
||||
SMESH_LogicalFilter* myMeshOrSubMeshOrGroupFilter;
|
||||
SMESHGUI_MeshEditPreview* mySimulation;
|
||||
SALOME_Actor* myPreviewActor;
|
||||
|
||||
QGroupBox* ConstructorsBox;
|
||||
QButtonGroup* GroupConstructors;
|
||||
QRadioButton* RadioButton1;
|
||||
QRadioButton* RadioButton2;
|
||||
QGroupBox* GroupButtons;
|
||||
QPushButton* buttonOk;
|
||||
QPushButton* buttonCancel;
|
||||
QPushButton* buttonApply;
|
||||
QPushButton* buttonHelp;
|
||||
QGroupBox* GroupArguments;
|
||||
QGroupBox* GroupAxis;
|
||||
QLabel* TextLabelElements;
|
||||
QPushButton* SelectElementsButton;
|
||||
QLineEdit* LineEditElements;
|
||||
QCheckBox* CheckBoxMesh;
|
||||
QCheckBox* MakeGroupsCheck;
|
||||
QGroupBox* ConstructorsBox;
|
||||
QButtonGroup* GroupConstructors;
|
||||
QRadioButton* RadioButton1;
|
||||
QRadioButton* RadioButton2;
|
||||
QGroupBox* GroupButtons;
|
||||
QPushButton* buttonOk;
|
||||
QPushButton* buttonCancel;
|
||||
QPushButton* buttonApply;
|
||||
QPushButton* buttonHelp;
|
||||
QGroupBox* GroupArguments;
|
||||
QGroupBox* GroupAxis;
|
||||
QLabel* TextLabelElements;
|
||||
QPushButton* SelectElementsButton;
|
||||
QLineEdit* LineEditElements;
|
||||
QCheckBox* CheckBoxMesh;
|
||||
QCheckBox* MakeGroupsCheck;
|
||||
QGroupBox* GroupAngleBox;
|
||||
QButtonGroup* GroupAngle;
|
||||
QRadioButton* RadioButton3;
|
||||
QRadioButton* RadioButton4;
|
||||
QCheckBox* CheckBoxPreview;
|
||||
|
||||
QLabel* TextLabelPoint;
|
||||
QPushButton* SelectPointButton;
|
||||
QLabel* TextLabelX;
|
||||
SMESHGUI_SpinBox* SpinBox_X;
|
||||
QLabel* TextLabelY;
|
||||
SMESHGUI_SpinBox* SpinBox_Y;
|
||||
QLabel* TextLabelZ;
|
||||
SMESHGUI_SpinBox* SpinBox_Z;
|
||||
QLabel* TextLabelVector;
|
||||
QPushButton* SelectVectorButton;
|
||||
QLabel* TextLabelDX;
|
||||
SMESHGUI_SpinBox* SpinBox_DX;
|
||||
QLabel* TextLabelDY;
|
||||
SMESHGUI_SpinBox* SpinBox_DY;
|
||||
QLabel* TextLabelDZ;
|
||||
SMESHGUI_SpinBox* SpinBox_DZ;
|
||||
QLabel* TextLabelPoint;
|
||||
QPushButton* SelectPointButton;
|
||||
QLabel* TextLabelX;
|
||||
SMESHGUI_SpinBox* SpinBox_X;
|
||||
QLabel* TextLabelY;
|
||||
SMESHGUI_SpinBox* SpinBox_Y;
|
||||
QLabel* TextLabelZ;
|
||||
SMESHGUI_SpinBox* SpinBox_Z;
|
||||
QLabel* TextLabelVector;
|
||||
QPushButton* SelectVectorButton;
|
||||
QLabel* TextLabelDX;
|
||||
SMESHGUI_SpinBox* SpinBox_DX;
|
||||
QLabel* TextLabelDY;
|
||||
SMESHGUI_SpinBox* SpinBox_DY;
|
||||
QLabel* TextLabelDZ;
|
||||
SMESHGUI_SpinBox* SpinBox_DZ;
|
||||
|
||||
QLabel* TextLabelAngle;
|
||||
SMESHGUI_SpinBox* SpinBox_Angle;
|
||||
QLabel* TextLabelNbSteps;
|
||||
QSpinBox* SpinBox_NbSteps;
|
||||
QLabel* TextLabelTolerance;
|
||||
SMESHGUI_SpinBox* SpinBox_Tolerance;
|
||||
QLabel* TextLabelAngle;
|
||||
SMESHGUI_SpinBox* SpinBox_Angle;
|
||||
QLabel* TextLabelNbSteps;
|
||||
QSpinBox* SpinBox_NbSteps;
|
||||
QLabel* TextLabelTolerance;
|
||||
SMESHGUI_SpinBox* SpinBox_Tolerance;
|
||||
|
||||
QString myHelpFileName;
|
||||
QString myHelpFileName;
|
||||
|
||||
private slots:
|
||||
void ConstructorsClicked( int );
|
||||
void ClickOnOk();
|
||||
void ClickOnCancel();
|
||||
void ClickOnApply();
|
||||
void ClickOnHelp();
|
||||
void SetEditCurrentArgument();
|
||||
void SelectionIntoArgument();
|
||||
void DeactivateActiveDialog();
|
||||
void ActivateThisDialog();
|
||||
void onTextChange( const QString& );
|
||||
void onSelectMesh( bool );
|
||||
void onVectorChanged();
|
||||
void ConstructorsClicked( int );
|
||||
void ClickOnOk();
|
||||
void ClickOnCancel();
|
||||
void ClickOnApply();
|
||||
void ClickOnHelp();
|
||||
void SetEditCurrentArgument();
|
||||
void SelectionIntoArgument();
|
||||
void DeactivateActiveDialog();
|
||||
void ActivateThisDialog();
|
||||
void onTextChange( const QString& );
|
||||
void onSelectMesh( bool );
|
||||
void onVectorChanged();
|
||||
void toDisplaySimulation();
|
||||
void onDisplaySimulation( bool );
|
||||
};
|
||||
|
||||
#endif // SMESHGUI_REVOLUTIONDLG_H
|
||||
|
@ -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=="isComputable" ) val = QVariant( isComputable( ind ) );
|
||||
else if ( p=="hasReference" ) val = QVariant( hasReference( ind ) );
|
||||
else if ( p=="isImported" ) val = QVariant( isImported( ind ) );
|
||||
|
||||
|
||||
if( val.isValid() )
|
||||
return val;
|
||||
@ -486,3 +488,20 @@ QString SMESHGUI_Selection::typeName( const int t )
|
||||
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;
|
||||
}
|
||||
|
@ -70,6 +70,8 @@ public:
|
||||
static int type( const QString&, _PTR(Study) );
|
||||
static QString typeName( const int );
|
||||
|
||||
bool isImported( const int ) const;
|
||||
|
||||
private:
|
||||
QStringList myTypes;
|
||||
QList<SMESH_Actor*> myActors;
|
||||
|
@ -2727,6 +2727,10 @@ Consider saving your work before application crash</translation>
|
||||
<source>WARP_ELEMENTS</source>
|
||||
<translation>Warping</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MEN_FILE_INFO</source>
|
||||
<translation>MED file information</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SMESHGUI</name>
|
||||
@ -4093,7 +4097,7 @@ It is impossible to read point coordinates from file</translation>
|
||||
<name>SMESHGUI_RevolutionDlg</name>
|
||||
<message>
|
||||
<source>ANGLE_BY_STEP</source>
|
||||
<translation>Use Angle by Step</translation>
|
||||
<translation>Angle by Step</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>PREVIEW</source>
|
||||
@ -4113,7 +4117,7 @@ It is impossible to read point coordinates from file</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>TOTAL_ANGLE</source>
|
||||
<translation>Use Total Angle</translation>
|
||||
<translation>Total Angle</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@ -4308,4 +4312,23 @@ It is impossible to read point coordinates from file</translation>
|
||||
<translation>Gravity center</translation>
|
||||
</message>
|
||||
</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>
|
||||
|
@ -338,7 +338,8 @@ void _pyGen::Process( const Handle(_pyCommand)& theCommand )
|
||||
}
|
||||
|
||||
// Concatenate( [mesh1, ...], ... )
|
||||
if ( theCommand->GetMethod() == "Concatenate" )
|
||||
if ( theCommand->GetMethod() == "Concatenate" ||
|
||||
theCommand->GetMethod() == "ConcatenateWithGroups")
|
||||
{
|
||||
AddMeshAccessorMethod( theCommand );
|
||||
}
|
||||
|
@ -1418,6 +1418,52 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::Concatenate(const SMESH::mesh_array& theMeshe
|
||||
CORBA::Boolean theMergeNodesAndElements,
|
||||
CORBA::Double theMergeTolerance)
|
||||
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 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;
|
||||
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++) {
|
||||
anElem = itElems->next();
|
||||
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() ) {
|
||||
aNewNode = aNewMeshDS->AddNode(aNode->X(), aNode->Y(), aNode->Z());
|
||||
nodesMap.insert( make_pair(aNode->GetID(), aNewNode->GetID()) );
|
||||
if( theCommonGroups )
|
||||
anIDsNodes[anNbNodes++] = aNewNode->GetID();
|
||||
}
|
||||
else
|
||||
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,
|
||||
aVolume->GetQuanities());
|
||||
elemsMap.insert(make_pair(anElem->GetID(), aNewElem->GetID()));
|
||||
if( theCommonGroups )
|
||||
anIDsVolumes[anNbVolumes++] = aNewElem->GetID();
|
||||
}
|
||||
}
|
||||
else {
|
||||
@ -1497,6 +1564,14 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::Concatenate(const SMESH::mesh_array& theMeshe
|
||||
anElemType,
|
||||
anElem->IsPoly());
|
||||
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
|
||||
|
||||
@ -1507,12 +1582,81 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::Concatenate(const SMESH::mesh_array& theMeshe
|
||||
SMESH::long_array_var anInitIDs = new SMESH::long_array();
|
||||
SMESH::long_array_var anNewIDs = new SMESH::long_array();
|
||||
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++) {
|
||||
aGroup = aListOfGroups[i];
|
||||
aListOfNewGroups.clear();
|
||||
SMESH::ElementType aGroupType = aGroup->GetType();
|
||||
CORBA::String_var aGroupName = aGroup->GetName();
|
||||
|
||||
aGroupType = aGroup->GetType();
|
||||
aGroupName = aGroup->GetName();
|
||||
|
||||
TGroupsMap::iterator anIter = aGroupsMap.find(make_pair(aGroupName, aGroupType));
|
||||
|
||||
// convert a list of IDs
|
||||
@ -1579,7 +1723,11 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::Concatenate(const SMESH::mesh_array& theMeshe
|
||||
}
|
||||
|
||||
// Update Python script
|
||||
aPythonDump << aNewMesh << " = " << this << ".Concatenate(";
|
||||
aPythonDump << aNewMesh << " = " << this;
|
||||
if( !theCommonGroups )
|
||||
aPythonDump << ".Concatenate(";
|
||||
else
|
||||
aPythonDump << ".ConcatenateWithGroups(";
|
||||
aPythonDump << "[";
|
||||
for ( int i = 0; i < theMeshesArray.length(); i++) {
|
||||
if (i > 0) aPythonDump << ", ";
|
||||
@ -1587,7 +1735,7 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::Concatenate(const SMESH::mesh_array& theMeshe
|
||||
}
|
||||
aPythonDump << "], ";
|
||||
aPythonDump << theUniteIdenticalGroups << ", "
|
||||
<< theMergeNodesAndElements << ", "
|
||||
<< theMergeNodesAndElements << ", "
|
||||
<< theMergeTolerance << ")";
|
||||
|
||||
return aNewMesh._retn();
|
||||
|
@ -259,6 +259,14 @@ public:
|
||||
CORBA::Long theElementID)
|
||||
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
|
||||
SMESH::SMESH_Mesh_ptr Concatenate(const SMESH::mesh_array& theMeshesArray,
|
||||
CORBA::Boolean theUniteIdenticalGroups,
|
||||
@ -266,6 +274,13 @@ public:
|
||||
CORBA::Double theMergeTolerance)
|
||||
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)
|
||||
|
@ -2089,6 +2089,57 @@ SMESH_MeshEditor_i::LinearAnglesVariation(SMESH::SMESH_Mesh_ptr thePathMes
|
||||
const SMESH::double_array & theAngles)
|
||||
{
|
||||
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();
|
||||
}
|
||||
|
||||
|
@ -240,6 +240,7 @@ SMESH_Mesh_i::ImportMEDFile( const char* theFileName, const char* theMeshName )
|
||||
THROW_SALOME_CORBA_EXCEPTION("ImportMEDFile(): unknown exception", SALOME::BAD_PARAM);
|
||||
}
|
||||
|
||||
myFile = theFileName;
|
||||
CreateGroupServants();
|
||||
|
||||
return ConvertDriverMEDReadStatus(status);
|
||||
@ -2479,3 +2480,28 @@ SMESH::ListOfGroups* SMESH_Mesh_i::GetGroups(const list<int>& groupIDs) const
|
||||
aList->length( nbGroups );
|
||||
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();
|
||||
}
|
||||
|
@ -436,6 +436,10 @@ public:
|
||||
*/
|
||||
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*> _mapSubMesh; //NRI
|
||||
@ -450,6 +454,7 @@ private:
|
||||
std::map<int, SMESH::SMESH_subMesh_ptr> _mapSubMeshIor;
|
||||
std::map<int, SMESH::SMESH_GroupBase_ptr> _mapGroups;
|
||||
std::map<int, SMESH::SMESH_Hypothesis_ptr> _mapHypo;
|
||||
string myFile;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -29,6 +29,8 @@
|
||||
#ifndef _STD_MESHERS_DISTRIBUTION_HXX_
|
||||
#define _STD_MESHERS_DISTRIBUTION_HXX_
|
||||
|
||||
using namespace std;
|
||||
|
||||
#include "SMESH_StdMeshers.hxx"
|
||||
|
||||
#include <vector>
|
||||
|
@ -44,6 +44,7 @@
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <TopExp.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
@ -505,12 +506,20 @@ TSideVector StdMeshers_FaceSide::GetFaceWires(const TopoDS_Face& theFace,
|
||||
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,
|
||||
true, theIgnoreMediumNodes);
|
||||
isForward, theIgnoreMediumNodes);
|
||||
wires[ iW ] = StdMeshers_FaceSidePtr( wire );
|
||||
from = to;
|
||||
}
|
||||
return wires;
|
||||
}
|
||||
|
||||
|
||||
|
@ -113,6 +113,8 @@ bool StdMeshers_MEFISTO_2D::CheckHypothesis
|
||||
{
|
||||
_hypMaxElementArea = NULL;
|
||||
_hypLengthFromEdges = NULL;
|
||||
_edgeLength = 0;
|
||||
_maxElementArea = 0;
|
||||
|
||||
list <const SMESHDS_Hypothesis * >::const_iterator itl;
|
||||
const SMESHDS_Hypothesis *theHyp;
|
||||
@ -121,8 +123,8 @@ bool StdMeshers_MEFISTO_2D::CheckHypothesis
|
||||
int nbHyp = hyps.size();
|
||||
if (!nbHyp)
|
||||
{
|
||||
aStatus = SMESH_Hypothesis::HYP_MISSING;
|
||||
return false; // can't work with no hypothesis
|
||||
aStatus = SMESH_Hypothesis::HYP_OK; //SMESH_Hypothesis::HYP_MISSING;
|
||||
return true; // (PAL13464) can work with no hypothesis, LengthFromEdges is default one
|
||||
}
|
||||
|
||||
itl = hyps.begin();
|
||||
@ -137,7 +139,6 @@ bool StdMeshers_MEFISTO_2D::CheckHypothesis
|
||||
_hypMaxElementArea = static_cast<const StdMeshers_MaxElementArea *>(theHyp);
|
||||
ASSERT(_hypMaxElementArea);
|
||||
_maxElementArea = _hypMaxElementArea->GetMaxArea();
|
||||
_edgeLength = 0;
|
||||
isOk = true;
|
||||
aStatus = SMESH_Hypothesis::HYP_OK;
|
||||
}
|
||||
@ -146,8 +147,6 @@ bool StdMeshers_MEFISTO_2D::CheckHypothesis
|
||||
{
|
||||
_hypLengthFromEdges = static_cast<const StdMeshers_LengthFromEdges *>(theHyp);
|
||||
ASSERT(_hypLengthFromEdges);
|
||||
_edgeLength = 0;
|
||||
_maxElementArea = 0;
|
||||
isOk = true;
|
||||
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());
|
||||
|
||||
// compute average edge length
|
||||
if (_hypLengthFromEdges)
|
||||
if (!_hypMaxElementArea)
|
||||
{
|
||||
_edgeLength = 0;
|
||||
int nbSegments = 0;
|
||||
@ -215,7 +214,7 @@ bool StdMeshers_MEFISTO_2D::Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aSh
|
||||
_edgeLength /= nbSegments;
|
||||
}
|
||||
|
||||
if (_hypLengthFromEdges && _edgeLength < DBL_MIN )
|
||||
if (/*_hypLengthFromEdges &&*/ _edgeLength < DBL_MIN )
|
||||
_edgeLength = 100;
|
||||
|
||||
Z nblf; //nombre de lignes fermees (enveloppe en tete)
|
||||
|
@ -83,7 +83,7 @@ protected:
|
||||
|
||||
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
|
||||
|
@ -24,6 +24,8 @@
|
||||
// File : StdMeshers_Penta_3D.cxx
|
||||
// Module : SMESH
|
||||
|
||||
using namespace std;
|
||||
|
||||
#include "StdMeshers_Penta_3D.hxx"
|
||||
|
||||
#include "utilities.h"
|
||||
|
@ -25,6 +25,7 @@
|
||||
// Created : Fri Oct 27 10:24:28 2006
|
||||
// Author : Edward AGAPOV (eap)
|
||||
|
||||
using namespace std;
|
||||
|
||||
#include "StdMeshers_ProjectionUtils.hxx"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user