-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE
//
// 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.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include "SMESHGUI.h"
#include "SMESHGUI_SpinBox.h"
+#include "SMESHGUI_Utils.h"
#include "StdMeshersGUI_SubShapeSelectorWdg.h"
#include <GEOMBase.h>
#include <LightApp_SelectionMgr.h>
#include <SALOME_ListIO.hxx>
-#include <SALOME_ListIteratorOfListIO.hxx>
#include <SUIT_ResourceMgr.h>
// Qt includes
#define SPACING 6
#define MARGIN 11
-enum { TAB_TRANSITION, TAB_VERTEX, TAB_ENF_POINTS };
+enum { TAB_TRANSITION, TAB_VERTEX, TAB_CORNERS, TAB_ENF_POINTS };
//================================================================================
// function : Constructor
QString StdMeshersGUI_QuadrangleParamCreator::helpPage() const
{
- return "a2d_meshing_hypo_page.html#hypo_quad_params_anchor";
+ return "2d_meshing_hypo.html#hypo-quad-params-anchor";
}
//=======================================================================
pointsLay->addWidget( shapesGroup );
pointsLay->addWidget( coordsGroup );
+ // Corners
+
+ myCornersSelWdg = new StdMeshersGUI_SubShapeSelectorWdg( fr, TopAbs_VERTEX );
+ myCornersSelWdg->layout()->setMargin( MARGIN );
+
// Tabs
myTabs = new QTabWidget( fr );
- myTabs->addTab( myTypeWdg, tr("TRANSITION"));
- myTabs->addTab( myVertexSelWdg, tr("SMESH_BASE_VERTEX"));
- myTabs->addTab( pointsFrame, tr("ENF_NODES"));
+ myTabs->addTab( myTypeWdg, tr("TRANSITION"));
+ myTabs->addTab( myVertexSelWdg, tr("SMESH_BASE_VERTEX"));
+ myTabs->addTab( myCornersSelWdg, tr("CORNERS"));
+ myTabs->addTab( pointsFrame, tr("ENF_NODES"));
lay->addWidget( myTabs, row, 0, 2, 3 );
QString aMainEntry = SMESHGUI_GenericHypothesisCreator::getMainShapeEntry();
if ( anEntry.isEmpty() )
anEntry = h->GetObjectEntry();
- myVertexSelWdg->SetGeomShapeEntry(anEntry);
- myVertexSelWdg->SetMainShapeEntry(aMainEntry);
+ myVertexSelWdg->SetGeomShapeEntry(anEntry,aMainEntry);
+ myCornersSelWdg->SetGeomShapeEntry(anEntry,aMainEntry);
if ( !isCreation())
{
myVertexSelWdg->SetListOfIDs(aVec);
}
+ // corners
+ SMESH::long_array_var aVec = h->GetCorners();
+ myCornersSelWdg->SetListOfIDs( aVec );
+
// enforced nodes
GEOM::ListOfGO_var shapes;
SMESH::nodes_array_var points;
h->GetEnforcedNodes( shapes, points );
- for ( int i = 0; i < shapes->length(); ++i )
+ for ( CORBA::ULong i = 0; i < shapes->length(); ++i )
{
CORBA::String_var name = shapes[i]->GetName();
CORBA::String_var entry = shapes[i]->GetStudyEntry();
item->setData( Qt::UserRole, entry.in() );
myShapesList->addItem( item );
}
- for ( int i = 0; i < points->length(); ++i )
+ for ( CORBA::ULong i = 0; i < points->length(); ++i )
{
QTreeWidgetItem* item = new QTreeWidgetItem
( QStringList()
// name
if( myName )
- SMESH::SetName( SMESH::FindSObject( h ), myName->text().toLatin1().constData() );
+ SMESH::SetName( SMESH::FindSObject( h ), myName->text().toUtf8().constData() );
// transition
h->SetQuadType( StdMeshers::QuadType( myTypeWdg->GetType()) );
h->SetTriaVertex( -1 );
}
+ // corners
+ h->SetCorners( myCornersSelWdg->GetListOfIDs() );
+
// enfored nodes
GEOM::ListOfGO_var goList = new GEOM::ListOfGO;
{
QListWidgetItem* item = myShapesList->item(i);
QString entry = item->data( Qt::UserRole ).toString();
- Handle(SALOME_InteractiveObject) io =
- new SALOME_InteractiveObject( entry.toStdString().c_str(), "GEOM" );
- GEOM::GEOM_Object_var go = GEOMBase::ConvertIOinGEOMObject( io );
+ GEOM::GEOM_Object_var go = SMESH::EntryToInterface<GEOM::GEOM_Object>( entry );
if ( !go->_is_nil() )
goList[ nbShapes++ ] = go;
}
void StdMeshersGUI_QuadrangleParamCreator::onTabChanged(int i)
{
- myVertexSelWdg->showPreview( i == TAB_VERTEX );
+ myVertexSelWdg->ShowPreview( i == TAB_VERTEX );
+ myCornersSelWdg->ShowPreview( i == TAB_CORNERS );
}
//================================================================================
*/
QWidget* StdMeshersGUI_QuadrangleParamCreator::
ItemDelegate::createEditor( QWidget* parent,
- const QStyleOptionViewItem& option,
- const QModelIndex& index ) const
+ const QStyleOptionViewItem& /*option*/,
+ const QModelIndex& /*index*/ ) const
{
SMESHGUI_SpinBox* sb = new SMESHGUI_SpinBox( parent );
sb->RangeStepAndValidator( COORD_MIN, COORD_MAX, 10 );