Merge from V5_1_2_BR branch (14 July 2009)

This commit is contained in:
vsr 2009-07-15 08:11:22 +00:00
parent 142fbce46d
commit 686a864564
29 changed files with 296 additions and 141 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -53,8 +53,7 @@ the information is displayed in Python Console.
\anchor mesh_element_info_anchor
<h2>Mesh Element Info</h2>
The <b>Mesh Element Info</b> box gives basic information about the
type and the coordinates of the selected mesh element.
The <b>Mesh Element Info</b> dialog box gives basic information about the type, coordinates and connectivity of the selected mesh node or element.
\n It is possible to input the Element ID or to select the Element in
the Viewer.

View File

@ -382,4 +382,9 @@ n23_params = algo3D.Parameters()
tetraN.Compute()
\endcode
\n Other meshing algorithms:
<ul>
<li>\subpage tui_defining_blsurf_hypotheses_page</li>
</ul>
*/

View File

@ -68,6 +68,8 @@
<parameter name="show_result_notification" value="2"/>
<parameter name="segmentation" value="10"/>
<parameter name="nb_segments_per_edge" value="15"/>
<parameter name="quadratic_mode" value="0"/>
<parameter name="max_angle" value="2"/>
</section>
<section name="resources">
<!-- Module resources -->

View File

@ -1955,22 +1955,22 @@ bool ElemGeomType::IsSatisfy( long theId )
case SMDSAbs_Face:
if ( myGeomType == SMDSGeom_TRIANGLE )
isOk = (!anElem->IsPoly() && aNbNode == 3);
isOk = (!anElem->IsPoly() && (anElem->IsQuadratic() ? aNbNode == 6 : aNbNode == 3));
else if ( myGeomType == SMDSGeom_QUADRANGLE )
isOk = (!anElem->IsPoly() && aNbNode == 4);
isOk = (!anElem->IsPoly() && (anElem->IsQuadratic() ? aNbNode == 8 : aNbNode == 4));
else if ( myGeomType == SMDSGeom_POLYGON )
isOk = anElem->IsPoly();
break;
case SMDSAbs_Volume:
if ( myGeomType == SMDSGeom_TETRA )
isOk = (!anElem->IsPoly() && aNbNode == 4);
isOk = (!anElem->IsPoly() && (anElem->IsQuadratic() ? aNbNode == 10 : aNbNode == 4));
else if ( myGeomType == SMDSGeom_PYRAMID )
isOk = (!anElem->IsPoly() && aNbNode == 5);
isOk = (!anElem->IsPoly() && (anElem->IsQuadratic() ? aNbNode == 13 : aNbNode == 5));
else if ( myGeomType == SMDSGeom_PENTA )
isOk = (!anElem->IsPoly() && aNbNode == 6);
isOk = (!anElem->IsPoly() && (anElem->IsQuadratic() ? aNbNode == 15 : aNbNode == 6));
else if ( myGeomType == SMDSGeom_HEXA )
isOk = (!anElem->IsPoly() && aNbNode == 8);
isOk = (!anElem->IsPoly() && (anElem->IsQuadratic() ? aNbNode == 20 : aNbNode == 8));
else if ( myGeomType == SMDSGeom_POLYHEDRA )
isOk = anElem->IsPoly();
break;

View File

@ -1164,10 +1164,18 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode){
aFilter->ClearRegisteredCellsWithType();
aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
VTKViewer_ExtractUnstructuredGrid* aHightFilter = myHighlitableActor->GetExtractUnstructuredGrid();
aHightFilter->ClearRegisteredCellsWithType();
aHightFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
if(myEntityMode & eEdges){
if (MYDEBUG) MESSAGE("EDGES");
aFilter->RegisterCellsWithType(VTK_LINE);
aFilter->RegisterCellsWithType(VTK_QUADRATIC_EDGE);
aHightFilter->RegisterCellsWithType(VTK_LINE);
aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_EDGE);
}
if(myEntityMode & eFaces){
@ -1177,6 +1185,12 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode){
aFilter->RegisterCellsWithType(VTK_QUAD);
aFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE);
aFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD);
aHightFilter->RegisterCellsWithType(VTK_TRIANGLE);
aHightFilter->RegisterCellsWithType(VTK_POLYGON);
aHightFilter->RegisterCellsWithType(VTK_QUAD);
aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE);
aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD);
}
if(myEntityMode & eVolumes){
@ -1190,6 +1204,16 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode){
aFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
aFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
aHightFilter->RegisterCellsWithType(VTK_TETRA);
aHightFilter->RegisterCellsWithType(VTK_VOXEL);
aHightFilter->RegisterCellsWithType(VTK_HEXAHEDRON);
aHightFilter->RegisterCellsWithType(VTK_WEDGE);
aHightFilter->RegisterCellsWithType(VTK_PYRAMID);
aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_TETRA);
aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
aHightFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
}
aFilter->Update();
if (MYDEBUG) MESSAGE(aFilter->GetOutput()->GetNumberOfCells());

View File

@ -53,8 +53,8 @@ enum SMDSAbs_GeometryType
// 3D element
SMDSGeom_TETRA,
SMDSGeom_PYRAMID,
SMDSGeom_PENTA,
SMDSGeom_HEXA,
SMDSGeom_PENTA,
SMDSGeom_POLYHEDRA,
};

View File

@ -4971,7 +4971,7 @@ struct SMESH_NodeSearcherImpl: public SMESH_NodeSearcher
SMDS_MeshNode tgtNode( thePnt.X(), thePnt.Y(), thePnt.Z() );
list<const SMDS_MeshNode*> nodes;
const double precision = 1e-6;
myOctreeNode->NodesAround( &tgtNode, &nodes, precision );
//myOctreeNode->NodesAround( &tgtNode, &nodes, precision );
double minSqDist = DBL_MAX;
Bnd_B3d box;

View File

@ -23,7 +23,7 @@
// File : SMESHGUI.cxx
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
// SMESH includes
//
#include "SMESHGUI.h"
#include "SMESHGUI_NodesDlg.h"
#include "SMESHGUI_TransparencyDlg.h"
@ -2091,9 +2091,12 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
/* Warning : however by internal mechanism all subMeshes icons are changed ! */
if ( !aHypothesis->_is_nil() )
{
SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(aHypothesis->GetName());
if (aCreator)
// BUG 0020378
//SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(aHypothesis->GetName());
SMESH::HypothesisCreatorPtr aCreator = SMESH::GetHypothesisCreator(aHypothesis->GetName());
if (aCreator) {
aCreator->edit( aHypothesis.in(), anIObject->getName(), desktop() );
}
else
{
// report error
@ -3056,8 +3059,7 @@ void SMESHGUI::initialize( CAM_Application* app )
popupMgr()->insert( separator(), -1, 0 );
createPopupItem( 701, OB, mesh, "&& isComputable" ); // COMPUTE
createPopupItem( 711, OB, mesh, "&& isComputable" ); // PRECOMPUTE
createPopupItem( 712, OB, mesh ); // EVALUATE
createPopupItem( 711, OB, mesh, "&& isComputable && isPreComputable" ); // PRECOMPUTE
createPopupItem( 214, OB, mesh_group ); // UPDATE
createPopupItem( 900, OB, mesh_group ); // ADV_INFO
createPopupItem( 902, OB, mesh ); // STD_INFO

View File

@ -1622,7 +1622,7 @@ void SMESHGUI_PrecomputeOp::stopOperation()
//================================================================================
/*!
* \brief perform it's intention action: reinitialise dialog
* \brief reinitialize dialog after operaiton become active again
*/
//================================================================================
@ -1633,16 +1633,48 @@ void SMESHGUI_PrecomputeOp::resumeOperation()
SMESHGUI_BaseComputeOp::resumeOperation();
}
//================================================================================
/*!
* \brief perform it's intention action: reinitialise dialog
*/
//================================================================================
void SMESHGUI_PrecomputeOp::initDialog()
{
QList<int> modes;
QMap<int, int> modeMap;
_PTR(SObject) pMesh = studyDS()->FindObjectID( myIObject->getEntry() );
getAssignedAlgos( pMesh, modeMap );
if ( modeMap.contains( SMESH::DIM_3D ) )
{
if ( modeMap.contains( SMESH::DIM_2D ) )
modes.append( SMESH::DIM_2D );
if ( modeMap.contains( SMESH::DIM_1D ) )
modes.append( SMESH::DIM_1D );
}
else if ( modeMap.contains( SMESH::DIM_2D ) )
{
if ( modeMap.contains( SMESH::DIM_1D ) )
modes.append( SMESH::DIM_1D );
}
myDlg->setPreviewModes( modes );
}
//================================================================================
/*!
* \brief detect asigned mesh algorithms
*/
//================================================================================
void SMESHGUI_PrecomputeOp::getAssignedAlgos(_PTR(SObject) theMesh,
QMap<int,int>& theModeMap)
{
_PTR(SObject) aHypRoot;
_PTR(GenericAttribute) anAttr;
int aPart = SMESH::Tag_RefOnAppliedAlgorithms;
_PTR(SObject) pMesh = studyDS()->FindObjectID( myIObject->getEntry() );
if ( pMesh && pMesh->FindSubObject( aPart, aHypRoot ) )
if ( theMesh && theMesh->FindSubObject( aPart, aHypRoot ) )
{
_PTR(ChildIterator) anIter =
SMESH::GetActiveStudyDocument()->NewChildIterator( aHypRoot );
@ -1661,27 +1693,21 @@ void SMESHGUI_PrecomputeOp::initDialog()
if ( CORBA::is_nil( aVar ) )
continue;
SMESH::SMESH_Algo_var algo = SMESH::SMESH_3D_Algo::_narrow( aVar );
if ( !algo->_is_nil() )
for( int dim = SMESH::DIM_1D; dim <= SMESH::DIM_3D; dim++ )
{
modeMap[ SMESH::DIM_1D ] = 0;
modeMap[ SMESH::DIM_2D ] = 0;
SMESH::SMESH_Algo_var algo;
switch(dim) {
case SMESH::DIM_1D: algo = SMESH::SMESH_1D_Algo::_narrow( aVar ); break;
case SMESH::DIM_2D: algo = SMESH::SMESH_2D_Algo::_narrow( aVar ); break;
case SMESH::DIM_3D: algo = SMESH::SMESH_3D_Algo::_narrow( aVar ); break;
default: break;
}
else
{
algo = SMESH::SMESH_2D_Algo::_narrow( aVar );
if ( !algo->_is_nil() )
modeMap[ SMESH::DIM_1D ] = 0;
theModeMap[ dim ] = 0;
}
}
}
}
if ( modeMap.contains( SMESH::DIM_1D ) )
modes.append( SMESH::DIM_1D );
if ( modeMap.contains( SMESH::DIM_2D ) )
modes.append( SMESH::DIM_2D );
myDlg->setPreviewModes( modes );
}
//================================================================================

View File

@ -147,6 +147,12 @@ public:
virtual LightApp_Dialog* dlg() const;
/**
* \brief returns map of assigned algorithms modes
*/
static void getAssignedAlgos(_PTR(SObject) theMesh,
QMap<int,int>& theModeMap);
protected:
virtual void startOperation();
virtual void stopOperation();

View File

@ -337,6 +337,7 @@ SMESHGUI_ExtrusionDlg::~SMESHGUI_ExtrusionDlg()
void SMESHGUI_ExtrusionDlg::Init (bool ResetControls)
{
myBusy = false;
myIDs.clear();
LineEditElements->clear();
myNbOkElements = 0;
@ -400,6 +401,8 @@ void SMESHGUI_ExtrusionDlg::ConstructorsClicked (int constructorId)
GroupArguments->setTitle(tr("EXTRUSION_1D"));
if (!CheckBoxMesh->isChecked())
{
LineEditElements->clear();
myIDs.clear();
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(EdgeSelection);
}
@ -410,6 +413,8 @@ void SMESHGUI_ExtrusionDlg::ConstructorsClicked (int constructorId)
GroupArguments->setTitle(tr("EXTRUSION_2D"));
if (!CheckBoxMesh->isChecked())
{
LineEditElements->clear();
myIDs.clear();
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
}
@ -586,17 +591,6 @@ void SMESHGUI_ExtrusionDlg::ClickOnOk()
//=================================================================================
void SMESHGUI_ExtrusionDlg::ClickOnCancel()
{
disconnect(mySelectionMgr, 0, this, 0);
mySelectionMgr->clearFilters();
//mySelectionMgr->clearSelected();
if (SMESH::GetCurrentVtkView()) {
SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
SMESH::SetPointRepresentation(false);
SMESH::SetPickable();
}
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySMESHGUI->ResetState();
reject();
}
@ -878,16 +872,45 @@ void SMESHGUI_ExtrusionDlg::enterEvent (QEvent*)
ActivateThisDialog();
}
//=================================================================================
// function : closeEvent()
// purpose :
//=================================================================================
void SMESHGUI_ExtrusionDlg::closeEvent( QCloseEvent* )
{
/* same than click on cancel button */
disconnect(mySelectionMgr, 0, this, 0);
mySelectionMgr->clearFilters();
//mySelectionMgr->clearSelected();
if (SMESH::GetCurrentVtkView()) {
SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
SMESH::SetPointRepresentation(false);
SMESH::SetPickable();
}
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySMESHGUI->ResetState();
}
void SMESHGUI_ExtrusionDlg::reject()
{
QDialog::reject();
close();
}
//=================================================================================
// function : onSelectMesh()
// purpose :
//=================================================================================
void SMESHGUI_ExtrusionDlg::onSelectMesh (bool toSelectMesh)
{
if (toSelectMesh)
if (toSelectMesh) {
myIDs = LineEditElements->text();
TextLabelElements->setText(tr("SMESH_NAME"));
}
else
TextLabelElements->setText(tr("SMESH_ID_ELEMENTS"));
myFilterBtn->setEnabled(!toSelectMesh);
if (myEditCurrentArgument != LineEditElements) {
@ -910,7 +933,7 @@ void SMESHGUI_ExtrusionDlg::onSelectMesh (bool toSelectMesh)
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(EdgeSelection);
}
else if (aConstructorId == 0)
else if (aConstructorId == 1)
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
@ -922,6 +945,9 @@ void SMESHGUI_ExtrusionDlg::onSelectMesh (bool toSelectMesh)
}
SelectionIntoArgument();
if (!toSelectMesh)
LineEditElements->setText( myIDs );
}
//=================================================================================

View File

@ -69,9 +69,12 @@ public:
SMESHGUI_ExtrusionDlg( SMESHGUI* );
~SMESHGUI_ExtrusionDlg();
void reject();
private:
void Init( bool = true );
void enterEvent( QEvent* ); /* mouse enter the QWidget */
void closeEvent( QCloseEvent* );
void keyPressEvent( QKeyEvent* );
int GetConstructorId();
@ -135,6 +138,7 @@ private:
QPushButton* buttonHelp;
QString myHelpFileName;
QString myIDs;
QPushButton* myFilterBtn;
SMESHGUI_FilterDlg* myFilterDlg;

View File

@ -560,11 +560,11 @@ void SMESHGUI_GroupDlg::init (SMESH::SMESH_GroupBase_ptr theGroup,
myGrpTypeGroup->button(grpType)->setChecked(true);
onGrpTypeChanged(grpType);
myTypeId = aType;
if ( grpType == 0 ) {
myCurrentLineEdit = 0;
myElements->clear();
setSelectionMode(aType);
myTypeId = aType;
setShowEntityMode(); // depends on myTypeId

View File

@ -498,10 +498,10 @@ void SMESHGUI_GenericHypothesisCreator::onReject()
QString SMESHGUI_GenericHypothesisCreator::helpPage() const
{
QString aHypType = hypType();
QString aHelpFileName;
QString aHelpFileName = "";
if ( aHypType == "LocalLength" )
aHelpFileName = "a1d_meshing_hypo_page.html#average_length_anchor";
if ( aHypType == "MaxLength" )
else if ( aHypType == "MaxLength" )
aHelpFileName = "a1d_meshing_hypo_page.html#max_length_anchor";
else if ( aHypType == "Arithmetic1D")
aHelpFileName = "a1d_meshing_hypo_page.html#arithmetic_1d_anchor";
@ -528,9 +528,8 @@ QString SMESHGUI_GenericHypothesisCreator::helpPage() const
else if ( aHypType == "LayerDistribution")
aHelpFileName = "radial_prism_algo_page.html";
else if ( aHypType == "SegmentLengthAroundVertex")
aHelpFileName = "segments_around_vertex_algo.html";
else
aHelpFileName = "";
aHelpFileName = "segments_around_vertex_algo_page.html";
return aHelpFileName;
}

View File

@ -22,8 +22,8 @@
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_HypothesesUtils.cxx
// Author : Julia DOROVSKIKH, Open CASCADE S.A.S.
// SMESH includes
//
#include "SMESHGUI_HypothesesUtils.h"
#include "SMESHGUI.h"
@ -82,8 +82,9 @@ namespace SMESH
THypothesisDataMap myHypothesesMap;
THypothesisDataMap myAlgorithmsMap;
typedef QMap<QString,SMESHGUI_GenericHypothesisCreator*> THypCreatorMap;
THypCreatorMap myHypCreatorMap;
// BUG 0020378
//typedef QMap<QString,SMESHGUI_GenericHypothesisCreator*> THypCreatorMap;
//THypCreatorMap myHypCreatorMap;
QList<HypothesesSet*> myListOfHypothesesSets;
@ -319,24 +320,26 @@ namespace SMESH
return false;
}
SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator(const QString& aHypType)
HypothesisCreatorPtr GetHypothesisCreator(const QString& aHypType)
{
if(MYDEBUG) MESSAGE("Get HypothesisCreator for " << aHypType.toLatin1().data());
SMESHGUI_GenericHypothesisCreator* aCreator = 0;
// check, if creator for this hypothesis type already exists
if (myHypCreatorMap.find(aHypType) != myHypCreatorMap.end()) {
aCreator = myHypCreatorMap[aHypType];
}
else {
// BUG 0020378
//if (myHypCreatorMap.find(aHypType) != myHypCreatorMap.end()) {
// aCreator = myHypCreatorMap[aHypType];
//}
//else
{
// 1. Init list of available hypotheses, if needed
InitAvailableHypotheses();
// 2. Get names of plugin libraries
HypothesisData* aHypData = GetHypothesisData(aHypType);
if (!aHypData)
return aCreator;
return HypothesisCreatorPtr(aCreator);
QString aClientLibName = aHypData->ClientLibName;
QString aServerLibName = aHypData->ServerLibName;
@ -376,7 +379,8 @@ namespace SMESH
}
else {
// map hypothesis creator to a hypothesis name
myHypCreatorMap[aHypType] = aCreator;
// BUG 0020378
//myHypCreatorMap[aHypType] = aCreator;
}
}
}
@ -386,7 +390,7 @@ namespace SMESH
}
}
return aCreator;
return HypothesisCreatorPtr(aCreator);
}

View File

@ -22,7 +22,7 @@
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_HypothesesUtils.h
// Author : Julia DOROVSKIKH, Open CASCADE S.A.S.
//
#ifndef SMESHGUI_HYPOTHESESUTILS_H
#define SMESHGUI_HYPOTHESESUTILS_H
@ -47,6 +47,9 @@
// STL includes
#include <vector>
// boost includes
#include <boost/shared_ptr.hpp>
class HypothesisData;
class HypothesesSet;
class SMESHGUI_GenericHypothesisCreator;
@ -55,6 +58,8 @@ class algo_error_array;
namespace SMESH
{
typedef boost::shared_ptr<SMESHGUI_GenericHypothesisCreator> HypothesisCreatorPtr;
SMESHGUI_EXPORT
void InitAvailableHypotheses();
@ -82,7 +87,7 @@ namespace SMESH
const HypothesisData* );
SMESHGUI_EXPORT
SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator( const QString& );
HypothesisCreatorPtr GetHypothesisCreator( const QString& );
SMESHGUI_EXPORT
SMESH::SMESH_Hypothesis_ptr CreateHypothesis( const QString&,

View File

@ -22,8 +22,8 @@
// SMESH SMESHGUI : GUI for SMESH component
// File : SMESHGUI_MeshOp.cxx
// Author : Sergey LITONIN, Open CASCADE S.A.S.
// SMESH includes
//
#include "SMESHGUI_MeshOp.h"
#include "SMESHGUI.h"
@ -1053,7 +1053,9 @@ void SMESHGUI_MeshOp::createHypothesis (const int theDim,
SMESH::CreateHypothesis(theTypeName, aHypName, false);
} else {
// Get hypotheses creator client (GUI)
SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(theTypeName);
// BUG 0020378
//SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(theTypeName);
SMESH::HypothesisCreatorPtr aCreator = SMESH::GetHypothesisCreator(theTypeName);
// Create hypothesis
if (aCreator) {
@ -1117,7 +1119,9 @@ void SMESHGUI_MeshOp::onEditHyp( const int theHypType, const int theIndex )
if ( aHyp->_is_nil() )
return;
SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator( aHyp->GetName() );
// BUG 0020378
//SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(aHyp->GetName());
SMESH::HypothesisCreatorPtr aCreator = SMESH::GetHypothesisCreator(aHyp->GetName());
if ( aCreator )
{
// Get initial parameters
@ -1699,11 +1703,14 @@ SMESH::SMESH_Hypothesis_var SMESHGUI_MeshOp::getAlgo( const int theDim )
SMESH::CreateHypothesis(aHypName, aHypData->Label, true);
} else {
// Get hypotheses creator client (GUI)
SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(aHypName);
// BUG 0020378
//SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(aHypName);
SMESH::HypothesisCreatorPtr aCreator = SMESH::GetHypothesisCreator(aHypName);
// Create algorithm
if (aCreator)
if (aCreator) {
aCreator->create(true, aHypName, myDlg);
}
else
SMESH::CreateHypothesis(aHypName, aHypData->Label, true);
}

View File

@ -93,7 +93,8 @@ SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
myVectorDefinition(NONE_SELECT),
myFilterDlg( 0 ),
mySelectedObject(SMESH::SMESH_IDSource::_nil())
mySelectedObject(SMESH::SMESH_IDSource::_nil()),
myActor(0)
{
mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));
@ -383,6 +384,7 @@ void SMESHGUI_RevolutionDlg::Init (bool ResetControls)
LineEditElements->clear();
myElementsId = "";
myNbOkElements = 0;
myIDs.clear();
myActor = 0;
myMesh = SMESH::SMESH_Mesh::_nil();
@ -412,14 +414,13 @@ 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;
/* SALOME_ListIO io;
mySelectionMgr->selectedObjects( io );
SALOME_ListIO aList;
mySelectionMgr->setSelectedObjects( aList );
// LineEditElements->clear();
myNbOkElements = 0;
mySelectionMgr->setSelectedObjects( aList );*/
buttonApply->setEnabled(false);
buttonOk->setEnabled(false);
mySimulation->SetVisibility(false);
@ -447,6 +448,9 @@ void SMESHGUI_RevolutionDlg::ConstructorsClicked (int constructorId)
if (!CheckBoxMesh->isChecked())
{
LineEditElements->clear();
myIDs.clear();
myNbOkElements = 0;
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(aSelMode);
}
@ -457,8 +461,8 @@ void SMESHGUI_RevolutionDlg::ConstructorsClicked (int constructorId)
if (CheckBoxMesh->isChecked())
onSelectMesh(true);
//connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
mySelectionMgr->setSelectedObjects( io );
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
// mySelectionMgr->setSelectedObjects( io );
}
//=================================================================================
@ -545,6 +549,7 @@ bool SMESHGUI_RevolutionDlg::ClickOnApply()
}
SMESH::UpdateView();
SMESH::Update(myIO, SMESH::eDisplay);
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
mySMESHGUI->updateObjBrowser(true); // new groups may appear
Init(false);
@ -572,19 +577,14 @@ void SMESHGUI_RevolutionDlg::ClickOnOk()
//=================================================================================
void SMESHGUI_RevolutionDlg::ClickOnCancel()
{
disconnect(mySelectionMgr, 0, this, 0);
mySelectionMgr->clearFilters();
//mySelectionMgr->clearSelected();
if (SMESH::GetCurrentVtkView()) {
SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
SMESH::SetPointRepresentation(false);
}
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySMESHGUI->ResetState();
reject();
}
void SMESHGUI_RevolutionDlg::reject()
{
close();
}
//=================================================================================
// function : ClickOnHelp()
// purpose :
@ -685,7 +685,6 @@ void SMESHGUI_RevolutionDlg::SelectionIntoArgument()
if (myBusy) return;
// clear
myActor = 0;
QString aString = "";
myBusy = true;
@ -708,20 +707,23 @@ void SMESHGUI_RevolutionDlg::SelectionIntoArgument()
return;
Handle(SALOME_InteractiveObject) IO = aList.First();
myMesh = SMESH::GetMeshByIO(IO);
if (myMesh->_is_nil())
SMESH::SMESH_Mesh_var aMeshVar = SMESH::GetMeshByIO(IO);
if (aMeshVar->_is_nil())
return;
myActor = SMESH::FindActorByObject(myMesh);
if (!myActor)
myActor = SMESH::FindActorByEntry(IO->getEntry());
if (!myActor)
SMESH_Actor* anActor = SMESH::FindActorByObject(aMeshVar);
if (!anActor)
anActor = SMESH::FindActorByEntry(IO->getEntry());
if (!anActor)
return;
int aNbUnits = 0;
if (myEditCurrentArgument == (QWidget*)LineEditElements) {
myElementsId = "";
myMesh = aMeshVar;
myActor = anActor;
myIO = IO;
// MakeGroups is available if there are groups
if ( myMesh->NbGroups() == 0 ) {
@ -747,7 +749,7 @@ void SMESHGUI_RevolutionDlg::SelectionIntoArgument()
myNbOkElements = true;
} else {
SMDS_Mesh* aMesh = myActor->GetObject()->GetMesh();
SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh();
if (!aMesh)
return;
@ -909,17 +911,16 @@ void SMESHGUI_RevolutionDlg::enterEvent (QEvent*)
void SMESHGUI_RevolutionDlg::closeEvent (QCloseEvent*)
{
/* same than click on cancel button */
ClickOnCancel();
disconnect(mySelectionMgr, 0, this, 0);
mySelectionMgr->clearFilters();
//mySelectionMgr->clearSelected();
if (SMESH::GetCurrentVtkView()) {
SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
SMESH::SetPointRepresentation(false);
}
//=======================================================================
// function : hideEvent()
// purpose : caused by ESC key
//=======================================================================
void SMESHGUI_RevolutionDlg::hideEvent (QHideEvent*)
{
if (!isMinimized())
ClickOnCancel();
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySMESHGUI->ResetState();
}
//=======================================================================
@ -928,8 +929,10 @@ void SMESHGUI_RevolutionDlg::hideEvent (QHideEvent*)
//=======================================================================
void SMESHGUI_RevolutionDlg::onSelectMesh (bool toSelectMesh)
{
if (toSelectMesh)
if (toSelectMesh) {
myIDs = LineEditElements->text();
TextLabelElements->setText(tr("SMESH_NAME"));
}
else
TextLabelElements->setText(tr("SMESH_ID_ELEMENTS"));
myFilterBtn->setEnabled(!toSelectMesh);
@ -956,7 +959,7 @@ void SMESHGUI_RevolutionDlg::onSelectMesh (bool toSelectMesh)
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(EdgeSelection);
}
else if (aConstructorId == 0)
else if (aConstructorId == 1)
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
@ -969,6 +972,9 @@ void SMESHGUI_RevolutionDlg::onSelectMesh (bool toSelectMesh)
}
SelectionIntoArgument();
if (!toSelectMesh)
LineEditElements->setText( myIDs );
}
//=================================================================================
@ -1118,6 +1124,8 @@ void SMESHGUI_RevolutionDlg::onSelectVectorMenu( QAction* action){
if(!action)
return;
disconnect(mySelectionMgr, 0, this, 0);
switch(myMenuActions[action]) {
case POINT_SELECT:
SMESH::SetPointRepresentation(true);

View File

@ -29,6 +29,9 @@
// SMESH includes
#include "SMESH_SMESHGUI.hxx"
// SALOME GUI includes
#include <SALOME_InteractiveObject.hxx>
// Qt includes
#include <QDialog>
#include <QMap>
@ -70,13 +73,14 @@ public:
SMESHGUI_RevolutionDlg( SMESHGUI* );
~SMESHGUI_RevolutionDlg();
void reject();
private:
enum {NONE_SELECT, POINT_SELECT, FACE_SELECT};
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();
@ -90,6 +94,7 @@ private:
QString myElementsId;
QWidget* myEditCurrentArgument; /* Current argument */
SVTK_Selector* mySelector;
Handle(SALOME_InteractiveObject) myIO;
SMESH::SMESH_IDSource_var mySelectedObject;
@ -152,6 +157,7 @@ private:
QString myHelpFileName;
QString myIDs;
QPushButton* myFilterBtn;
SMESHGUI_FilterDlg* myFilterDlg;

View File

@ -29,6 +29,7 @@
#include "SMESHGUI_Utils.h"
#include "SMESHGUI_VTKUtils.h"
#include "SMESHGUI_GEOMGenUtils.h"
#include "SMESHGUI_ComputeDlg.h"
#include <SMESH_Type.h>
#include <SMESH_Actor.h>
@ -113,6 +114,7 @@ QVariant SMESHGUI_Selection::parameter( const int ind, const QString& p ) const
else if ( p=="controlMode" ) val = QVariant( controlMode( ind ) );
else if ( p=="displayMode" ) val = QVariant( displayMode( ind ) );
else if ( p=="isComputable" ) val = QVariant( isComputable( ind ) );
else if ( p=="isPreComputable" ) val = QVariant( isPreComputable( ind ) );
else if ( p=="hasReference" ) val = QVariant( hasReference( ind ) );
else if ( p=="isImported" ) val = QVariant( isImported( ind ) );
else if ( p=="facesOrientationMode" ) val = QVariant( facesOrientationMode( ind ) );
@ -384,6 +386,23 @@ QVariant SMESHGUI_Selection::isComputable( int ind ) const
return QVariant( false );
}
//=======================================================================
//function : isPreComputable
//purpose :
//=======================================================================
QVariant SMESHGUI_Selection::isPreComputable( int ind ) const
{
if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
{
QMap<int,int> modeMap;
_PTR(SObject) pMesh = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
SMESHGUI_PrecomputeOp::getAssignedAlgos( pMesh, modeMap );
return QVariant( modeMap.size() > 1 );
}
return QVariant( false );
}
//=======================================================================
//function : hasReference
//purpose :

View File

@ -54,6 +54,7 @@ public:
virtual bool isAutoColor( int ) const;
virtual int numberOfNodes( int ) const;
virtual QVariant isComputable( int ) const;
virtual QVariant isPreComputable( int ) const;
virtual QVariant hasReference( int ) const;
virtual QVariant isVisible( int ) const;

View File

@ -130,6 +130,26 @@ namespace SMESH
return *this;
}
TPythonDump&
TPythonDump::
operator<<(const SMESH::GeometryType& theArg)
{
myStream<<"SMESH.";
switch(theArg){
case Geom_POINT: myStream<<"Geom_POINT"; break;
case Geom_EDGE: myStream<<"Geom_EDGE"; break;
case Geom_TRIANGLE: myStream<<"Geom_TRIANGLE"; break;
case Geom_QUADRANGLE: myStream<<"Geom_QUADRANGLE"; break;
case Geom_POLYGON: myStream<<"Geom_POLYGON"; break;
case Geom_TETRA: myStream<<"Geom_TETRA"; break;
case Geom_PYRAMID: myStream<<"Geom_PYRAMID"; break;
case Geom_HEXA: myStream<<"Geom_HEXA"; break;
case Geom_PENTA: myStream<<"Geom_PENTA"; break;
case Geom_POLYHEDRA: myStream<<"Geom_POLYHEDRA"; break;
}
return *this;
}
template<class TArray>
void DumpArray(const TArray& theArray, std::ostringstream & theStream)
{
@ -225,9 +245,11 @@ namespace SMESH
case FT_Taper: myStream<< "aTaper"; break;
case FT_Skew: myStream<< "aSkew"; break;
case FT_Area: myStream<< "aArea"; break;
case FT_Volume3D: myStream<< "aVolume3D"; break;
case FT_FreeBorders: myStream<< "aFreeBorders"; break;
case FT_FreeEdges: myStream<< "aFreeEdges"; break;
case FT_FreeNodes: myStream<< "aFreeNodes"; break;
case FT_FreeFaces: myStream<< "aFreeFaces"; break;
case FT_MultiConnection: myStream<< "aMultiConnection"; break;
case FT_MultiConnection2D:myStream<< "aMultiConnection2D";break;
case FT_Length: myStream<< "aLength"; break;
@ -239,13 +261,17 @@ namespace SMESH
case FT_LyingOnGeom: myStream<< "aLyingOnGeom"; break;
case FT_RangeOfIds: myStream<< "aRangeOfIds"; break;
case FT_BadOrientedVolume:myStream<< "aBadOrientedVolume";break;
case FT_LinearOrQuadratic:myStream<< "aLinearOrQuadratic";break;
case FT_GroupColor: myStream<< "aGroupColor"; break;
case FT_ElemGeomType: myStream<< "anElemGeomType"; break;
case FT_LessThan: myStream<< "aLessThan"; break;
case FT_MoreThan: myStream<< "aMoreThan"; break;
case FT_EqualTo: myStream<< "anEqualTo"; break;
case FT_LogicalNOT: myStream<< "aLogicalNOT"; break;
case FT_LogicalAND: myStream<< "aLogicalAND"; break;
case FT_LogicalOR: myStream<< "aLogicalOR"; break;
case FT_Undefined: myStream<< "anUndefined"; break;
case FT_Undefined:
default: myStream<< "anUndefined"; break;
}
myStream<<theArg;
}

View File

@ -1510,10 +1510,10 @@ SMESH::MeshPreviewStruct* SMESH_Gen_i::Precompute( SMESH::SMESH_Mesh_ptr theMesh
if ( aNbNode > 4 )
aNbNode /= 2; // do not take into account additional middle nodes
SMDS_MeshNode* node1 = (SMDS_MeshNode*)face->GetNode( 1 );
for ( int nIndx = 1; nIndx <= aNbNode; nIndx++ )
SMDS_MeshNode* node1 = (SMDS_MeshNode*)face->GetNode( 0 );
for ( int nIndx = 0; nIndx < aNbNode; nIndx++ )
{
SMDS_MeshNode* node2 = (SMDS_MeshNode*)face->GetNode( nIndx < aNbNode ? nIndx+1 : 1 );
SMDS_MeshNode* node2 = (SMDS_MeshNode*)face->GetNode( nIndx+1 < aNbNode ? nIndx+1 : 0 );
if ( setOfEdge.insert( SMESH_TLink ( node1, node2 ) ).second )
{
listOfElemType.push_back( SMDSAbs_Edge );
@ -3840,7 +3840,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent,
int smID = smIDs[ i ];
if ( smID == 0 ) continue;
const SMDS_MeshElement* elem = *iE;
if( smID >= maxID ) {
if( smID > maxID ) {
// corresponding subshape no longer exists: maybe geom group has been edited
if ( myNewMeshImpl->HasShapeToMesh() )
mySMESHDSMesh->RemoveElement( elem );

View File

@ -63,7 +63,7 @@ public:
* \retval TCollection_AsciiString - The file name
*/
static const char* SmeshpyName() { return "smesh"; }
static const char* GenName() { return "smesh.smesh"; }
static const char* GenName() { return "smesh"; }
};
namespace SMESH
@ -108,6 +108,9 @@ namespace SMESH
TPythonDump&
operator<<(const SMESH::ElementType& theArg);
TPythonDump&
operator<<(const SMESH::GeometryType& theArg);
TPythonDump&
operator<<(const SMESH::long_array& theArg);

View File

@ -93,6 +93,6 @@ Compound1 = smesh.smesh.Concatenate([Mesh_inf.GetMesh(), Mesh_sup.GetMesh()], 0,
smesh.SetName(Compound1, 'Compound_with_RenamedGrps_and_MergeElems')
# create a compound of two meshes with uniting groups with the same names and
# creating groups of all elements
Compound2 = smesh.smesh.ConcatenateWithGroups([Mesh_inf.GetMesh(), Mesh_sup.GetMesh()], 1, 0, 1e-05)
Compound2 = smesh.smesh.Concatenate([Mesh_inf.GetMesh(), Mesh_sup.GetMesh()], 1, 0, 1e-05, True)
smesh.SetName(Compound2, 'Compound_with_UniteGrps_and_GrpsOfAllElems')
#end

View File

@ -557,24 +557,6 @@ class smeshDC(SMESH._objref_SMESH_Gen):
aMesh = Mesh(self, self.geompyD, aSmeshMesh)
return aMesh
## Concatenate the given meshes into one mesh.
# @return an instance of Mesh class
# @param meshes the meshes to combine into one mesh
# @param uniteIdenticalGroups if true, groups with same names are united, else they are renamed
# @param mergeNodesAndElements if true, equal nodes and elements aremerged
# @param mergeTolerance tolerance for merging nodes
# @param allGroups forces creation of groups of all elements
def Concatenate( self, meshes, uniteIdenticalGroups,
mergeNodesAndElements = False, mergeTolerance = 1e-5, allGroups = False):
if allGroups:
aSmeshMesh = SMESH._objref_SMESH_Gen.ConcatenateWithGroups(
self,meshes,uniteIdenticalGroups,mergeNodesAndElements,mergeTolerance)
else:
aSmeshMesh = SMESH._objref_SMESH_Gen.Concatenate(
self,meshes,uniteIdenticalGroups,mergeNodesAndElements,mergeTolerance)
aMesh = Mesh(self, self.geompyD, aSmeshMesh)
return aMesh
## From SMESH_Gen interface
# @return the list of integer values
# @ingroup l1_auxiliary

View File

@ -198,8 +198,9 @@ void StdMeshersGUI_LayerDistributionParamWdg::onEdit()
return;
CORBA::String_var hypType = myHyp->GetName();
SMESHGUI_GenericHypothesisCreator*
editor = SMESH::GetHypothesisCreator( hypType.in() );
// BUG 0020378
//SMESHGUI_GenericHypothesisCreator* editor = SMESH::GetHypothesisCreator(hypType.in());
SMESH::HypothesisCreatorPtr editor = SMESH::GetHypothesisCreator(hypType.in());
if ( !editor ) return;
if ( myDlg ) myDlg->hide();