</li>
<li>Bottom-up way, using \ref modifying_meshes_page "mesh modification"
operations, especially \ref extrusion_page "extrusion" and \ref
- revolution_page "revolution". To create an empty mesh not based on a
+ revolution_page "revolution". To create an empty mesh not based on
geometry, use the same dialog as to \ref constructing_meshes_page
"construct the mesh on geometry" but specify neither the geometry
nor meshing algorithms.
(and exported to) the file in MED, UNV, STL, CGNS, DAT, GMF and
SAUVE formats.
</li>
- <li>The 3D mesh can be generated from the 2D mesh not based on the geometry,
+ <li>The 3D mesh can be generated from the 2D mesh not based on geometry,
which was either \ref importing_exporting_meshes_page "imported" or created in
- other way. To setup the meshing parameters of a mesh not based on a geometry,
+ other way. To setup the meshing parameters of a mesh not based on geometry,
just invoke \ref editing_meshes_page "Edit mesh / sub-mesh" command on
your 2D mesh.
</li>
void SetDisplayEntity(int theCommandID);
- int ActionToControl( int theID, bool theReversed = false );
+ int ActionToControl( int theID, bool theReversed = false );
void Control( int theCommandID );
filter,
QObject::tr( "SMESH_IMPORT_MESH" ) );
}
- if ( filenames.count() > 0 ) {
+ if ( filenames.count() > 0 )
+ {
SUIT_OverrideCursor wc;
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
QStringList errors;
QStringList anEntryList;
bool isEmpty = false;
- for ( QStringList::ConstIterator it = filenames.begin(); it != filenames.end(); ++it ) {
+ for ( QStringList::ConstIterator it = filenames.begin(); it != filenames.end(); ++it )
+ {
QString filename = *it;
SMESH::mesh_array_var aMeshes = new SMESH::mesh_array;
try {
arg( QObject::tr( "SMESH_ERR_UNKNOWN_IMPORT_ERROR" ) ) );
}
- for ( int i = 0, iEnd = aMeshes->length(); i < iEnd; i++ ) {
+ for ( int i = 0, iEnd = aMeshes->length(); i < iEnd; i++ )
+ {
_PTR(SObject) aMeshSO = SMESH::FindSObject( aMeshes[i] );
if ( aMeshSO ) {
_PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
void Control( int theCommandID )
{
- SMESH_Actor::eControl aControl = SMESH_Actor::eControl( ActionToControl( theCommandID ) );
+ SMESH_Actor::eControl aControl = SMESH_Actor::eControl( ActionToControl( theCommandID ));
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
- LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
+
SALOME_ListIO selected;
- if ( aSel )
+ if ( LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr() )
aSel->selectedObjects( selected );
if ( !selected.IsEmpty() ) {
for ( ; It.More(); It.Next())
{
Handle(SALOME_InteractiveObject) anIO = It.Value();
- if(!anIO.IsNull()){
+ if ( !anIO.IsNull() ) {
_PTR(SObject) SO = aStudy->FindObjectID( It.Value()->getEntry() );
if ( SO ) {
CORBA::Object_var aObject = SMESH::SObjectToObject( SO );
SMESH::SMESH_IDSource_var anIDSrc = SMESH::SMESH_IDSource::_narrow( aObject );
if ( !anIDSrc->_is_nil() ) {
- if ( SMESH_Actor *anActor = SMESH::FindActorByEntry( anIO->getEntry()) ) {
+ SMESH_Actor *anActor = SMESH::FindActorByEntry( anIO->getEntry());
+ if (( !anActor && selected.Extent() == 1 ) &&
+ ( anActor = SMESH::CreateActor( aStudy, anIO->getEntry() )))
+ {
anActor->SetControlMode( aControl );
+ SMESH::DisplayActor( SMESH::GetCurrentVtkView(), anActor );
+ SMESH::UpdateView ( SMESH::eDisplay, anIO->getEntry() );
+ }
+ if ( anActor )
+ {
+ if ( anActor->GetControlMode() != aControl )
+ anActor->SetControlMode( aControl );
QString functorName = functorToString( anActor->GetFunctor() );
anActor->GetScalarBarActor()->SetTitle( functorName.toLatin1().constData() );
SMESH::RepaintCurrentView();
createMenu( SMESHOp::OpPropertiesVolume, basicPropId, -1 );
createMenu( SMESHOp::OpUpdate, viewId, -1 );
- connect( nodeMenu, SIGNAL( aboutToShow() ), this, SLOT( onUpdateControlActions() ) );
- connect( edgeMenu, SIGNAL( aboutToShow() ), this, SLOT( onUpdateControlActions() ) );
- connect( faceMenu, SIGNAL( aboutToShow() ), this, SLOT( onUpdateControlActions() ) );
+ connect( nodeMenu, SIGNAL( aboutToShow() ), this, SLOT( onUpdateControlActions() ) );
+ connect( edgeMenu, SIGNAL( aboutToShow() ), this, SLOT( onUpdateControlActions() ) );
+ connect( faceMenu, SIGNAL( aboutToShow() ), this, SLOT( onUpdateControlActions() ) );
connect( volumeMenu, SIGNAL( aboutToShow() ), this, SLOT( onUpdateControlActions() ) );
// ----- create toolbars --------------
*/
void SMESHGUI::onUpdateControlActions()
{
- LightApp_SelectionMgr* aSel = SMESHGUI::selectionMgr();
SALOME_ListIO selected;
- if ( aSel )
+ if ( LightApp_SelectionMgr* aSel = SMESHGUI::selectionMgr() )
aSel->selectedObjects( selected );
SMESH_Actor::eControl aControl = SMESH_Actor::eNone;
if ( selected.Extent() ) {
if ( selected.First()->hasEntry() ) {
- aControl = SMESH::FindActorByEntry( selected.First()->getEntry() )->GetControlMode();
- SALOME_ListIteratorOfListIO it(selected);
- for ( ; it.More(); it.Next() ) {
- Handle(SALOME_InteractiveObject) anIO = it.Value();
- if ( anIO->hasEntry() ) {
- if ( SMESH_Actor* anActor = SMESH::FindActorByEntry( anIO->getEntry() ) ) {
- if ( aControl != anActor->GetControlMode() ) {
- aControl = SMESH_Actor::eNone;
- break;
+ if ( SMESH_Actor* anActor = SMESH::FindActorByEntry( selected.First()->getEntry() )) {
+ aControl = anActor->GetControlMode();
+ SALOME_ListIteratorOfListIO it(selected);
+ for ( it.Next(); it.More(); it.Next() ) {
+ Handle(SALOME_InteractiveObject) anIO = it.Value();
+ if ( anIO->hasEntry() ) {
+ if ( SMESH_Actor* anActor = SMESH::FindActorByEntry( anIO->getEntry() ) ) {
+ if ( aControl != anActor->GetControlMode() ) {
+ aControl = SMESH_Actor::eNone;
+ break;
+ }
}
}
}