\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.
tetraN.Compute()
\endcode
+\n Other meshing algorithms:
+
+<ul>
+<li>\subpage tui_defining_blsurf_hypotheses_page</li>
+</ul>
*/
\ No newline at end of file
<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 -->
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;
aFilter = myBaseActor->GetExtractUnstructuredGrid();
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){
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){
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());
// 3D element
SMDSGeom_TETRA,
SMDSGeom_PYRAMID,
- SMDSGeom_PENTA,
SMDSGeom_HEXA,
+ SMDSGeom_PENTA,
SMDSGeom_POLYHEDRA,
};
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;
// File : SMESHGUI.cxx
// Author : Nicolas REJNERI, Open CASCADE S.A.S.
// SMESH includes
-//
+
#include "SMESHGUI.h"
#include "SMESHGUI_NodesDlg.h"
#include "SMESHGUI_TransparencyDlg.h"
/* 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
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
//================================================================================
/*!
- * \brief perform it's intention action: reinitialise dialog
+ * \brief reinitialize dialog after operaiton become active again
*/
//================================================================================
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 );
CORBA::Object_var aVar = _CAST(SObject,anObj)->GetObject();
if ( CORBA::is_nil( aVar ) )
continue;
-
- SMESH::SMESH_Algo_var algo = SMESH::SMESH_3D_Algo::_narrow( aVar );
- if ( !algo->_is_nil() )
- {
- modeMap[ SMESH::DIM_1D ] = 0;
- modeMap[ SMESH::DIM_2D ] = 0;
- }
- else
+
+ for( int dim = SMESH::DIM_1D; dim <= SMESH::DIM_3D; dim++ )
{
- algo = SMESH::SMESH_2D_Algo::_narrow( aVar );
+ 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;
+ }
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 );
}
//================================================================================
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();
void SMESHGUI_ExtrusionDlg::Init (bool ResetControls)
{
myBusy = false;
+ myIDs.clear();
LineEditElements->clear();
myNbOkElements = 0;
GroupArguments->setTitle(tr("EXTRUSION_1D"));
if (!CheckBoxMesh->isChecked())
{
+ LineEditElements->clear();
+ myIDs.clear();
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(EdgeSelection);
}
GroupArguments->setTitle(tr("EXTRUSION_2D"));
if (!CheckBoxMesh->isChecked())
{
+ LineEditElements->clear();
+ myIDs.clear();
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
}
//=================================================================================
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();
}
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) {
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);
}
SelectionIntoArgument();
+
+ if (!toSelectMesh)
+ LineEditElements->setText( myIDs );
}
//=================================================================================
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();
QPushButton* buttonHelp;
QString myHelpFileName;
+ QString myIDs;
QPushButton* myFilterBtn;
SMESHGUI_FilterDlg* myFilterDlg;
myGrpTypeGroup->button(grpType)->setChecked(true);
onGrpTypeChanged(grpType);
+ myTypeId = aType;
if ( grpType == 0 ) {
myCurrentLineEdit = 0;
myElements->clear();
setSelectionMode(aType);
- myTypeId = aType;
setShowEntityMode(); // depends on myTypeId
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";
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;
}
// 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"
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;
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;
}
else {
// map hypothesis creator to a hypothesis name
- myHypCreatorMap[aHypType] = aCreator;
+ // BUG 0020378
+ //myHypCreatorMap[aHypType] = aCreator;
}
}
}
}
}
- return aCreator;
+ return HypothesisCreatorPtr(aCreator);
}
// 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
// STL includes
#include <vector>
+// boost includes
+#include <boost/shared_ptr.hpp>
+
class HypothesisData;
class HypothesesSet;
class SMESHGUI_GenericHypothesisCreator;
namespace SMESH
{
+ typedef boost::shared_ptr<SMESHGUI_GenericHypothesisCreator> HypothesisCreatorPtr;
+
SMESHGUI_EXPORT
void InitAvailableHypotheses();
const HypothesisData* );
SMESHGUI_EXPORT
- SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator( const QString& );
+ HypothesisCreatorPtr GetHypothesisCreator( const QString& );
SMESHGUI_EXPORT
SMESH::SMESH_Hypothesis_ptr CreateHypothesis( const QString&,
- const QString&,
- const bool = false);
+ const QString&,
+ const bool = false );
SMESHGUI_EXPORT
bool AddHypothesisOnMesh( SMESH::SMESH_Mesh_ptr, SMESH::SMESH_Hypothesis_ptr );
// 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"
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) {
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
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);
}
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 ));
LineEditElements->clear();
myElementsId = "";
myNbOkElements = 0;
+ myIDs.clear();
myActor = 0;
myMesh = SMESH::SMESH_Mesh::_nil();
//=================================================================================
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);
if (!CheckBoxMesh->isChecked())
{
+ LineEditElements->clear();
+ myIDs.clear();
+ myNbOkElements = 0;
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(aSelMode);
}
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 );
}
//=================================================================================
}
SMESH::UpdateView();
+ SMESH::Update(myIO, SMESH::eDisplay);
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
mySMESHGUI->updateObjBrowser(true); // new groups may appear
Init(false);
//=================================================================================
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 :
if (myBusy) return;
// clear
- myActor = 0;
QString aString = "";
myBusy = true;
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 ) {
myNbOkElements = true;
} else {
- SMDS_Mesh* aMesh = myActor->GetObject()->GetMesh();
+ SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh();
if (!aMesh)
return;
void SMESHGUI_RevolutionDlg::closeEvent (QCloseEvent*)
{
/* same than click on cancel button */
- ClickOnCancel();
-}
-
-//=======================================================================
-// function : hideEvent()
-// purpose : caused by ESC key
-//=======================================================================
-void SMESHGUI_RevolutionDlg::hideEvent (QHideEvent*)
-{
- if (!isMinimized())
- 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();
}
//=======================================================================
//=======================================================================
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);
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);
}
SelectionIntoArgument();
+
+ if (!toSelectMesh)
+ LineEditElements->setText( myIDs );
}
//=================================================================================
if(!action)
return;
+ disconnect(mySelectionMgr, 0, this, 0);
+
switch(myMenuActions[action]) {
case POINT_SELECT:
SMESH::SetPointRepresentation(true);
// SMESH includes
#include "SMESH_SMESHGUI.hxx"
+// SALOME GUI includes
+#include <SALOME_InteractiveObject.hxx>
+
// Qt includes
#include <QDialog>
#include <QMap>
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();
QString myElementsId;
QWidget* myEditCurrentArgument; /* Current argument */
SVTK_Selector* mySelector;
+ Handle(SALOME_InteractiveObject) myIO;
SMESH::SMESH_IDSource_var mySelectedObject;
QString myHelpFileName;
+ QString myIDs;
QPushButton* myFilterBtn;
SMESHGUI_FilterDlg* myFilterDlg;
#include "SMESHGUI_Utils.h"
#include "SMESHGUI_VTKUtils.h"
#include "SMESHGUI_GEOMGenUtils.h"
+#include "SMESHGUI_ComputeDlg.h"
#include <SMESH_Type.h>
#include <SMESH_Actor.h>
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 ) );
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 :
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;
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)
{
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;
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;
}
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 );
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 );
* \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
TPythonDump&
operator<<(const SMESH::ElementType& theArg);
+ TPythonDump&
+ operator<<(const SMESH::GeometryType& theArg);
+
TPythonDump&
operator<<(const SMESH::long_array& theArg);
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
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
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();