// Create tab widget
myTabWg = new QTabWidget( mainFrame() );
+ myTabs[ Dim0D ] = new SMESHGUI_MeshTab( myTabWg );
myTabs[ Dim1D ] = new SMESHGUI_MeshTab( myTabWg );
myTabs[ Dim2D ] = new SMESHGUI_MeshTab( myTabWg );
myTabs[ Dim3D ] = new SMESHGUI_MeshTab( myTabWg );
myTabWg->addTab( myTabs[ Dim3D ], tr( "DIM_3D" ) );
myTabWg->addTab( myTabs[ Dim2D ], tr( "DIM_2D" ) );
myTabWg->addTab( myTabs[ Dim1D ], tr( "DIM_1D" ) );
+ myTabWg->addTab( myTabs[ Dim0D ], tr( "DIM_0D" ) );
// Hypotheses Sets
myHypoSetPopup = new QPopupMenu();
//================================================================================
SMESHGUI_MeshTab* SMESHGUI_MeshDlg::tab( const int theId ) const
{
- return ( theId >= Dim1D && theId <= Dim3D ? myTabs[ theId ] : 0 );
+ return ( theId >= Dim0D && theId <= Dim3D ? myTabs[ theId ] : 0 );
}
//================================================================================
void SMESHGUI_MeshDlg::reset()
{
clearSelection();
+ myTabs[ Dim0D ]->reset();
myTabs[ Dim1D ]->reset();
myTabs[ Dim2D ]->reset();
myTabs[ Dim3D ]->reset();
void SMESHGUI_MeshDlg::setMaxHypoDim( const int maxDim )
{
- const int DIM = maxDim - 1;
- for ( int dim = Dim1D; dim <= Dim3D; ++dim ) {
+ const int DIM = maxDim;
+ for ( int dim = Dim0D; dim <= Dim3D; ++dim ) {
bool enable = ( dim <= DIM );
if ( !enable )
myTabs[ dim ]->reset();
GLOBAL_HYPO_TAG =2,
LOCAL_ALGO_TAG =2,
LOCAL_HYPO_TAG =1,
+ SUBMESH_ON_VERTEX_TAG =4,
SUBMESH_ON_EDGE_TAG =5,
SUBMESH_ON_WIRE_TAG =6,
SUBMESH_ON_FACE_TAG =7,
if( !myDlg )
{
myDlg = new SMESHGUI_MeshDlg( myToCreate, myIsMesh );
- for ( int i = SMESH::DIM_1D; i <= SMESH::DIM_3D; i++ )
+ for ( int i = SMESH::DIM_0D; i <= SMESH::DIM_3D; i++ )
{
connect( myDlg->tab( i ), SIGNAL( createHyp( const int, const int ) ),
this, SLOT( onCreateHyp( const int, const int ) ) );
}
SMESHGUI_SelectionOp::startOperation();
- // iterate through dimensions and get available algoritms,
- // set them to the dialog
+ // iterate through dimensions and get available algoritms, set them to the dialog
_PTR(SComponent) aFather = SMESH::GetActiveStudyDocument()->FindComponent( "SMESH" );
- for ( int i = SMESH::DIM_1D; i <= SMESH::DIM_3D; i++ )
+ for ( int i = SMESH::DIM_0D; i <= SMESH::DIM_3D; i++ )
{
SMESHGUI_MeshTab* aTab = myDlg->tab( i );
QStringList hypList;
if ( !geom->_is_nil() ) {
int tag = -1;
switch ( geom->GetShapeType() ) {
+ case GEOM::VERTEX: tag = SUBMESH_ON_VERTEX_TAG ; break;
case GEOM::EDGE: tag = SUBMESH_ON_EDGE_TAG ; break;
case GEOM::WIRE: tag = SUBMESH_ON_WIRE_TAG ; break;
case GEOM::FACE: tag = SUBMESH_ON_FACE_TAG ; break;
static int getTabDim (const QObject* tab, SMESHGUI_MeshDlg* dlg )
{
int aDim = -1;
- for (int i = SMESH::DIM_1D; i <= SMESH::DIM_3D; i++)
+ for (int i = SMESH::DIM_0D; i <= SMESH::DIM_3D; i++)
if (tab == dlg->tab(i))
aDim = i;
return aDim;
const int theHypType,
const int theIndex)
{
- if ( theDim > -1 && theDim < 3 &&
+ if ( theDim > -1 && theDim <= SMESH::DIM_3D &&
theHypType > -1 && theHypType < NbHypTypes &&
theIndex > -1 && theIndex < myAvailableHypData[ theDim ][ theHypType ].count() )
return myAvailableHypData[ theDim ][ theHypType ][ theIndex ];
// find highest available dimension, all algos of this dimension are available for choice
int aTopDim = -1;
- for (int i = SMESH::DIM_1D; i <= SMESH::DIM_3D; i++)
+ for (int i = SMESH::DIM_0D; i <= SMESH::DIM_3D; i++)
if (isAccessibleDim( i ))
aTopDim = i;
if (aTopDim == -1)
const bool isSubmesh = ( myToCreate ? !myIsMesh : myDlg->isObjectShown( SMESHGUI_MeshDlg::Mesh ));
HypothesisData* algoData = hypData( aDim, Algo, theIndex );
- HypothesisData* algoByDim[3];
+ HypothesisData* algoByDim[4];
algoByDim[ aDim ] = algoData;
QStringList anAvailable;
{
int dim = aDim + 1, lastDim = SMESH::DIM_3D, dir = 1;
if ( !forward ) {
- dim = aDim - 1; lastDim = SMESH::DIM_1D; dir = -1;
+ dim = aDim - 1; lastDim = SMESH::DIM_0D; dir = -1;
}
HypothesisData* prevAlgo = algoData;
bool noCompatible = false;
// restore previously selected algo
algoIndex = myAvailableHypData[dim][Algo].findIndex( curAlgo );
- if ( !isSubmesh && algoIndex < 0 && soleCompatible && !forward )
+ if ( !isSubmesh && algoIndex < 0 && soleCompatible && !forward && dim != SMESH::DIM_0D)
// select the sole compatible algo
algoIndex = myAvailableHypData[dim][Algo].findIndex( soleCompatible );
setCurrentHyp( dim, Algo, algoIndex );
_PTR(SObject) pObj = SMESH::GetActiveStudyDocument()->FindComponent("SMESH");
- for ( int dim = SMESH::DIM_1D; dim <= SMESH::DIM_3D; dim++ )
+ for ( int dim = SMESH::DIM_0D; dim <= SMESH::DIM_3D; dim++ )
{
if ( !isAccessibleDim( dim ))
continue;
if (!aHypoSet) return;
// clear all hyps
- for (int dim = SMESH::DIM_1D; dim <= SMESH::DIM_3D; dim++) {
+ for (int dim = SMESH::DIM_0D; dim <= SMESH::DIM_3D; dim++) {
setCurrentHyp(dim, Algo, -1);
setCurrentHyp(dim, AddHyp, -1);
setCurrentHyp(dim, MainHyp, -1);
if ( aMeshSO )
SMESH::SetName( aMeshSO, myDlg->objectText( SMESHGUI_MeshDlg::Obj ).latin1() );
- for ( int aDim = SMESH::DIM_1D; aDim <= SMESH::DIM_3D; aDim++ ) {
+ for ( int aDim = SMESH::DIM_0D; aDim <= SMESH::DIM_3D; aDim++ ) {
if ( !isAccessibleDim( aDim )) continue;
// assign hypotheses
// create sub-mesh
SMESH::SMESH_subMesh_var aSubMeshVar = aMeshVar->GetSubMesh( aGeomVar, aName.latin1() );
- for ( int aDim = SMESH::DIM_1D; aDim <= SMESH::DIM_3D; aDim++ )
+ for ( int aDim = SMESH::DIM_0D; aDim <= SMESH::DIM_3D; aDim++ )
{
if ( !isAccessibleDim( aDim )) continue;
// Get hypotheses and algorithms assigned to the mesh/sub-mesh
QStringList anExisting;
- for ( int dim = SMESH::DIM_1D; dim <= SMESH::DIM_3D; dim++ )
+ for ( int dim = SMESH::DIM_0D; dim <= SMESH::DIM_3D; dim++ )
{
// get algorithm
existingHyps( dim, Algo, pObj, anExisting, myObjHyps[ dim ][ Algo ] );
// get hypotheses
bool hypWithoutAlgo = false;
- for ( int dim = SMESH::DIM_1D; dim <= SMESH::DIM_3D; dim++ )
+ for ( int dim = SMESH::DIM_0D; dim <= SMESH::DIM_3D; dim++ )
{
for ( int hypType = MainHyp; hypType <= AddHyp; hypType++ )
{
SMESH::SetName( pObj, myDlg->objectText( SMESHGUI_MeshDlg::Obj ).latin1() );
// Assign new hypotheses and algorithms
- for ( int dim = SMESH::DIM_1D; dim <= SMESH::DIM_3D; dim++ )
+ for ( int dim = SMESH::DIM_0D; dim <= SMESH::DIM_3D; dim++ )
{
if ( !isAccessibleDim( dim )) continue;