#include CORBA_CLIENT_HEADER(SMESH_MeshEditor)
// Qt includes
-// #define INCLUDE_MENUITEM_DEF // VSR commented ????????
+// #define INCLUDE_MENUITEM_DEF // VSR commented ????????
#include <QMenu>
// BOOST includes
// Declarations
//=============================================================
void ImportMeshesFromFile(SMESH::SMESH_Gen_ptr theComponentMesh,
- int theCommandID);
+ int theCommandID);
void ExportMeshToFile(int theCommandID);
// Definitions
//=============================================================
void ImportMeshesFromFile( SMESH::SMESH_Gen_ptr theComponentMesh,
- int theCommandID )
+ int theCommandID )
{
QStringList filter;
std::string myExtension;
anInitialPath = QDir::currentPath();
QStringList filenames = SUIT_FileDlg::getOpenFileNames( SMESHGUI::desktop(),
- anInitialPath,
- filter,
- QObject::tr( "SMESH_IMPORT_MESH" ) );
+ anInitialPath,
+ filter,
+ QObject::tr( "SMESH_IMPORT_MESH" ) );
if ( filenames.count() > 0 ) {
SUIT_OverrideCursor wc;
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
QStringList errors;
bool isEmpty = false;
for ( QStringList::ConstIterator it = filenames.begin(); it != filenames.end(); ++it ) {
- QString filename = *it;
- SMESH::mesh_array_var aMeshes = new SMESH::mesh_array;
- try {
- switch ( theCommandID ) {
- case 111:
- {
- // DAT format (currently unsupported)
- errors.append( QString( "%1 :\n\t%2" ).arg( filename ).
- arg( QObject::tr( "SMESH_ERR_NOT_SUPPORTED_FORMAT" ) ) );
- break;
- }
- case 112:
- {
- // UNV format
- aMeshes->length( 1 );
- aMeshes[0] = theComponentMesh->CreateMeshesFromUNV( filename.toLatin1().constData() );
- if ( aMeshes[0]->_is_nil() )
- errors.append( QString( "%1 :\n\t%2" ).arg( filename ).
- arg( QObject::tr( "SMESH_ERR_UNKNOWN_IMPORT_ERROR" ) ) );
- break;
- }
- case 113:
- {
- // MED format
- SMESH::DriverMED_ReadStatus res;
- aMeshes = theComponentMesh->CreateMeshesFromMED( filename.toLatin1().constData(), res );
- if ( res != SMESH::DRS_OK ) {
- errors.append( QString( "%1 :\n\t%2" ).arg( filename ).
- arg( QObject::tr( QString( "SMESH_DRS_%1" ).arg( res ).toLatin1().data() ) ) );
- }
- break;
- }
- }
- }
- catch ( const SALOME::SALOME_Exception& S_ex ) {
- errors.append( QString( "%1 :\n\t%2" ).arg( filename ).
- arg( QObject::tr( "SMESH_ERR_UNKNOWN_IMPORT_ERROR" ) ) );
- }
-
- for ( int i = 0, iEnd = aMeshes->length(); i < iEnd; i++ ) {
- _PTR(SObject) aMeshSO = SMESH::FindSObject( aMeshes[i] );
- if ( aMeshSO ) {
- _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
- _PTR(AttributePixMap) aPixmap = aBuilder->FindOrCreateAttribute( aMeshSO, "AttributePixMap" );
- aPixmap->SetPixMap( "ICON_SMESH_TREE_MESH_IMPORTED" );
- if ( theCommandID == 112 ) // mesh names aren't taken from the file for UNV import
- SMESH::SetName( aMeshSO, QFileInfo(filename).fileName() );
- }
- else {
- isEmpty = true;
- }
- }
+ QString filename = *it;
+ SMESH::mesh_array_var aMeshes = new SMESH::mesh_array;
+ try {
+ switch ( theCommandID ) {
+ case 111:
+ {
+ // DAT format (currently unsupported)
+ errors.append( QString( "%1 :\n\t%2" ).arg( filename ).
+ arg( QObject::tr( "SMESH_ERR_NOT_SUPPORTED_FORMAT" ) ) );
+ break;
+ }
+ case 112:
+ {
+ // UNV format
+ aMeshes->length( 1 );
+ aMeshes[0] = theComponentMesh->CreateMeshesFromUNV( filename.toLatin1().constData() );
+ if ( aMeshes[0]->_is_nil() )
+ errors.append( QString( "%1 :\n\t%2" ).arg( filename ).
+ arg( QObject::tr( "SMESH_ERR_UNKNOWN_IMPORT_ERROR" ) ) );
+ break;
+ }
+ case 113:
+ {
+ // MED format
+ SMESH::DriverMED_ReadStatus res;
+ aMeshes = theComponentMesh->CreateMeshesFromMED( filename.toLatin1().constData(), res );
+ if ( res != SMESH::DRS_OK ) {
+ errors.append( QString( "%1 :\n\t%2" ).arg( filename ).
+ arg( QObject::tr( QString( "SMESH_DRS_%1" ).arg( res ).toLatin1().data() ) ) );
+ }
+ break;
+ }
+ }
+ }
+ catch ( const SALOME::SALOME_Exception& S_ex ) {
+ errors.append( QString( "%1 :\n\t%2" ).arg( filename ).
+ arg( QObject::tr( "SMESH_ERR_UNKNOWN_IMPORT_ERROR" ) ) );
+ }
+
+ for ( int i = 0, iEnd = aMeshes->length(); i < iEnd; i++ ) {
+ _PTR(SObject) aMeshSO = SMESH::FindSObject( aMeshes[i] );
+ if ( aMeshSO ) {
+ _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
+ _PTR(AttributePixMap) aPixmap = aBuilder->FindOrCreateAttribute( aMeshSO, "AttributePixMap" );
+ aPixmap->SetPixMap( "ICON_SMESH_TREE_MESH_IMPORTED" );
+ if ( theCommandID == 112 ) // mesh names aren't taken from the file for UNV import
+ SMESH::SetName( aMeshSO, QFileInfo(filename).fileName() );
+ }
+ else {
+ isEmpty = true;
+ }
+ }
}
// update Object browser
// show Error message box if there were errors
if ( errors.count() > 0 ) {
- SUIT_MessageBox::critical( SMESHGUI::desktop(),
- QObject::tr( "SMESH_ERROR" ),
- QObject::tr( "SMESH_IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ) );
+ SUIT_MessageBox::critical( SMESHGUI::desktop(),
+ QObject::tr( "SMESH_ERROR" ),
+ QObject::tr( "SMESH_IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ) );
}
// show warning message box, if some imported mesh is empty
if ( isEmpty ) {
- SUIT_MessageBox::warning( SMESHGUI::desktop(),
- QObject::tr( "SMESH_WRN_WARNING" ),
- QObject::tr( "SMESH_DRS_SOME_EMPTY" ) );
+ SUIT_MessageBox::warning( SMESHGUI::desktop(),
+ QObject::tr( "SMESH_WRN_WARNING" ),
+ QObject::tr( "SMESH_DRS_SOME_EMPTY" ) );
}
}
}
}
inline void InverseEntityMode(unsigned int& theOutputMode,
- unsigned int theMode)
+ unsigned int theMode)
{
bool anIsNotPresent = ~theOutputMode & theMode;
if(anIsNotPresent)
if(selected.Extent() >= 1){
SALOME_ListIteratorOfListIO It( selected );
for( ; It.More(); It.Next()){
- Handle(SALOME_InteractiveObject) IObject = It.Value();
- if(IObject->hasEntry()){
- if(SMESH_Actor *anActor = SMESH::FindActorByEntry(IObject->getEntry())){
- unsigned int aMode = anActor->GetEntityMode();
- switch(theCommandID){
+ Handle(SALOME_InteractiveObject) IObject = It.Value();
+ if(IObject->hasEntry()){
+ if(SMESH_Actor *anActor = SMESH::FindActorByEntry(IObject->getEntry())){
+ unsigned int aMode = anActor->GetEntityMode();
+ switch(theCommandID){
case 216:
InverseEntityMode(aMode,SMESH_Actor::e0DElements);
break;
- case 217:
- InverseEntityMode(aMode,SMESH_Actor::eEdges);
- break;
- case 218:
- InverseEntityMode(aMode,SMESH_Actor::eFaces);
- break;
- case 219:
- InverseEntityMode(aMode,SMESH_Actor::eVolumes);
- break;
- case 220:
- aMode = SMESH_Actor::eAllEntity;
- break;
- }
- if(aMode)
- anActor->SetEntityMode(aMode);
- }
- }
+ case 217:
+ InverseEntityMode(aMode,SMESH_Actor::eEdges);
+ break;
+ case 218:
+ InverseEntityMode(aMode,SMESH_Actor::eFaces);
+ break;
+ case 219:
+ InverseEntityMode(aMode,SMESH_Actor::eVolumes);
+ break;
+ case 220:
+ aMode = SMESH_Actor::eAllEntity;
+ break;
+ }
+ if(aMode)
+ anActor->SetEntityMode(aMode);
+ }
+ }
}
}
}
_PTR(SObject) aGroupSObject = SMESH::FindSObject(aGroupObject);
if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aGroupSObject->GetID().c_str()))
{
- if( aGroupObject->GetType() == SMESH::NODE )
- anActor->SetNodeColor( aColor.R, aColor.G, aColor.B );
- else if( aGroupObject->GetType() == SMESH::EDGE )
- anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B );
- else
- anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B );
+ if( aGroupObject->GetType() == SMESH::NODE )
+ anActor->SetNodeColor( aColor.R, aColor.G, aColor.B );
+ else if( aGroupObject->GetType() == SMESH::EDGE )
+ anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B );
+ else
+ anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B );
}
}
Handle(SALOME_InteractiveObject) anIObject = selected.First();
SMESH::SMESH_Mesh_var aMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(anIObject);
if ( !aMesh->_is_nil() ) {
- aMesh->SetAutoColor( false );
+ aMesh->SetAutoColor( false );
}
}
}
if(selected.Extent() >= 1){
switch(theCommandID){
case 1134:{
- SMESHGUI::GetSMESHGUI()->EmitSignalDeactivateDialog();
- (new SMESHGUI_ClippingDlg( SMESHGUI::GetSMESHGUI() ))->show();
- return;
+ SMESHGUI::GetSMESHGUI()->EmitSignalDeactivateDialog();
+ (new SMESHGUI_ClippingDlg( SMESHGUI::GetSMESHGUI() ))->show();
+ return;
}
case 1133:{
- SMESHGUI::GetSMESHGUI()->EmitSignalDeactivateDialog();
- (new SMESHGUI_TransparencyDlg( SMESHGUI::GetSMESHGUI() ))->show();
- return;
+ SMESHGUI::GetSMESHGUI()->EmitSignalDeactivateDialog();
+ (new SMESHGUI_TransparencyDlg( SMESHGUI::GetSMESHGUI() ))->show();
+ return;
}}
SALOME_ListIteratorOfListIO It( selected );
for( ; It.More(); It.Next()){
- Handle(SALOME_InteractiveObject) IObject = It.Value();
- if(IObject->hasEntry()){
- if(SMESH_Actor *anActor = SMESH::FindActorByEntry(IObject->getEntry())){
- switch(theCommandID){
- case 211:
- anActor->SetRepresentation(SMESH_Actor::eEdge);
- break;
- case 212:
- anActor->SetRepresentation(SMESH_Actor::eSurface);
- break;
- case 213:
- if(anActor->IsShrunk())
- anActor->UnShrink();
- else
- anActor->SetShrink();
- break;
- case 215:
- anActor->SetRepresentation(SMESH_Actor::ePoint);
- break;
+ Handle(SALOME_InteractiveObject) IObject = It.Value();
+ if(IObject->hasEntry()){
+ if(SMESH_Actor *anActor = SMESH::FindActorByEntry(IObject->getEntry())){
+ switch(theCommandID){
+ case 211:
+ anActor->SetRepresentation(SMESH_Actor::eEdge);
+ break;
+ case 212:
+ anActor->SetRepresentation(SMESH_Actor::eSurface);
+ break;
+ case 213:
+ if(anActor->IsShrunk())
+ anActor->UnShrink();
+ else
+ anActor->SetShrink();
+ break;
+ case 215:
+ anActor->SetRepresentation(SMESH_Actor::ePoint);
+ break;
case 231:
if(anActor->GetQuadratic2DRepresentation() != SMESH_Actor::eLines)
anActor->SetQuadratic2DRepresentation(SMESH_Actor::eLines);
if(anActor->GetQuadratic2DRepresentation() != SMESH_Actor::eArcs)
anActor->SetQuadratic2DRepresentation(SMESH_Actor::eArcs);
break;
- case 1132:{
- vtkFloatingPointType color[3];
- anActor->GetSufaceColor(color[0], color[1], color[2]);
- int c0 = int (color[0] * 255);
- int c1 = int (color[1] * 255);
- int c2 = int (color[2] * 255);
- QColor c(c0, c1, c2);
-
- vtkFloatingPointType edgecolor[3];
- anActor->GetEdgeColor(edgecolor[0], edgecolor[1], edgecolor[2]);
- c0 = int (edgecolor[0] * 255);
- c1 = int (edgecolor[1] * 255);
- c2 = int (edgecolor[2] * 255);
- QColor e(c0, c1, c2);
-
- vtkFloatingPointType backfacecolor[3];
- anActor->GetBackSufaceColor(backfacecolor[0], backfacecolor[1], backfacecolor[2]);
- c0 = int (backfacecolor[0] * 255);
- c1 = int (backfacecolor[1] * 255);
- c2 = int (backfacecolor[2] * 255);
- QColor b(c0, c1, c2);
-
- vtkFloatingPointType nodecolor[3];
- anActor->GetNodeColor(nodecolor[0], nodecolor[1], nodecolor[2]);
- c0 = int (nodecolor[0] * 255);
- c1 = int (nodecolor[1] * 255);
- c2 = int (nodecolor[2] * 255);
- QColor n(c0, c1, c2);
-
- int Edgewidth = (int)anActor->GetLineWidth();
- if(Edgewidth == 0)
- Edgewidth = 1;
- int intValue = int(anActor->GetNodeSize());
- vtkFloatingPointType Shrink = anActor->GetShrinkFactor();
-
- SMESHGUI_Preferences_ColorDlg *aDlg =
- new SMESHGUI_Preferences_ColorDlg( SMESHGUI::GetSMESHGUI() );
- aDlg->SetColor(1, c);
- aDlg->SetColor(2, e);
- aDlg->SetColor(3, n);
- aDlg->SetColor(4, b);
- aDlg->SetIntValue(1, Edgewidth);
- aDlg->SetIntValue(2, intValue);
- aDlg->SetIntValue(3, int(Shrink*100.));
- if(aDlg->exec()){
- QColor color = aDlg->GetColor(1);
- QColor edgecolor = aDlg->GetColor(2);
- QColor nodecolor = aDlg->GetColor(3);
- QColor backfacecolor = aDlg->GetColor(4);
- /* actor color and backface color */
- anActor->SetSufaceColor(vtkFloatingPointType (color.red()) / 255.,
- vtkFloatingPointType (color.green()) / 255.,
- vtkFloatingPointType (color.blue()) / 255.);
- anActor->SetBackSufaceColor(vtkFloatingPointType (backfacecolor.red()) / 255.,
- vtkFloatingPointType (backfacecolor.green()) / 255.,
- vtkFloatingPointType (backfacecolor.blue()) / 255.);
-
- /* edge color */
- anActor->SetEdgeColor(vtkFloatingPointType (edgecolor.red()) / 255.,
- vtkFloatingPointType (edgecolor.green()) / 255.,
- vtkFloatingPointType (edgecolor.blue()) / 255.);
-
- /* Shrink factor and size edges */
- anActor->SetShrinkFactor(aDlg->GetIntValue(3) / 100.);
- anActor->SetLineWidth(aDlg->GetIntValue(1));
-
- /* Nodes color and size */
- anActor->SetNodeColor(vtkFloatingPointType (nodecolor.red()) / 255.,
- vtkFloatingPointType (nodecolor.green()) / 255.,
- vtkFloatingPointType (nodecolor.blue()) / 255.);
- anActor->SetNodeSize(aDlg->GetIntValue(2));
-
- SMESH::SMESH_GroupBase_var aGroupObject = SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IObject);
- if( !aGroupObject->_is_nil() )
- {
- SMESH::ElementType anElementType = aGroupObject->GetType();
- QColor aColor;
- switch( anElementType )
- {
- case SMESH::NODE: aColor = nodecolor; break;
- case SMESH::EDGE: aColor = edgecolor; break;
- default: aColor = color; break;
- }
-
- SALOMEDS::Color aGroupColor;
- aGroupColor.R = (float)aColor.red() / 255.0;
- aGroupColor.G = (float)aColor.green() / 255.0;
- aGroupColor.B = (float)aColor.blue() / 255.0;
- aGroupObject->SetColor( aGroupColor );
- }
-
- delete aDlg;
- }
- break;
- }}
- }
- }
+ case 1132:{
+ vtkFloatingPointType color[3];
+ anActor->GetSufaceColor(color[0], color[1], color[2]);
+ int c0 = int (color[0] * 255);
+ int c1 = int (color[1] * 255);
+ int c2 = int (color[2] * 255);
+ QColor c(c0, c1, c2);
+
+ vtkFloatingPointType edgecolor[3];
+ anActor->GetEdgeColor(edgecolor[0], edgecolor[1], edgecolor[2]);
+ c0 = int (edgecolor[0] * 255);
+ c1 = int (edgecolor[1] * 255);
+ c2 = int (edgecolor[2] * 255);
+ QColor e(c0, c1, c2);
+
+ vtkFloatingPointType backfacecolor[3];
+ anActor->GetBackSufaceColor(backfacecolor[0], backfacecolor[1], backfacecolor[2]);
+ c0 = int (backfacecolor[0] * 255);
+ c1 = int (backfacecolor[1] * 255);
+ c2 = int (backfacecolor[2] * 255);
+ QColor b(c0, c1, c2);
+
+ vtkFloatingPointType nodecolor[3];
+ anActor->GetNodeColor(nodecolor[0], nodecolor[1], nodecolor[2]);
+ c0 = int (nodecolor[0] * 255);
+ c1 = int (nodecolor[1] * 255);
+ c2 = int (nodecolor[2] * 255);
+ QColor n(c0, c1, c2);
+
+ int Edgewidth = (int)anActor->GetLineWidth();
+ if(Edgewidth == 0)
+ Edgewidth = 1;
+ int intValue = int(anActor->GetNodeSize());
+ vtkFloatingPointType Shrink = anActor->GetShrinkFactor();
+
+ SMESHGUI_Preferences_ColorDlg *aDlg =
+ new SMESHGUI_Preferences_ColorDlg( SMESHGUI::GetSMESHGUI() );
+ aDlg->SetColor(1, c);
+ aDlg->SetColor(2, e);
+ aDlg->SetColor(3, n);
+ aDlg->SetColor(4, b);
+ aDlg->SetIntValue(1, Edgewidth);
+ aDlg->SetIntValue(2, intValue);
+ aDlg->SetIntValue(3, int(Shrink*100.));
+ if(aDlg->exec()){
+ QColor color = aDlg->GetColor(1);
+ QColor edgecolor = aDlg->GetColor(2);
+ QColor nodecolor = aDlg->GetColor(3);
+ QColor backfacecolor = aDlg->GetColor(4);
+ /* actor color and backface color */
+ anActor->SetSufaceColor(vtkFloatingPointType (color.red()) / 255.,
+ vtkFloatingPointType (color.green()) / 255.,
+ vtkFloatingPointType (color.blue()) / 255.);
+ anActor->SetBackSufaceColor(vtkFloatingPointType (backfacecolor.red()) / 255.,
+ vtkFloatingPointType (backfacecolor.green()) / 255.,
+ vtkFloatingPointType (backfacecolor.blue()) / 255.);
+
+ /* edge color */
+ anActor->SetEdgeColor(vtkFloatingPointType (edgecolor.red()) / 255.,
+ vtkFloatingPointType (edgecolor.green()) / 255.,
+ vtkFloatingPointType (edgecolor.blue()) / 255.);
+
+ /* Shrink factor and size edges */
+ anActor->SetShrinkFactor(aDlg->GetIntValue(3) / 100.);
+ anActor->SetLineWidth(aDlg->GetIntValue(1));
+
+ /* Nodes color and size */
+ anActor->SetNodeColor(vtkFloatingPointType (nodecolor.red()) / 255.,
+ vtkFloatingPointType (nodecolor.green()) / 255.,
+ vtkFloatingPointType (nodecolor.blue()) / 255.);
+ anActor->SetNodeSize(aDlg->GetIntValue(2));
+
+ SMESH::SMESH_GroupBase_var aGroupObject = SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IObject);
+ if( !aGroupObject->_is_nil() )
+ {
+ SMESH::ElementType anElementType = aGroupObject->GetType();
+ QColor aColor;
+ switch( anElementType )
+ {
+ case SMESH::NODE: aColor = nodecolor; break;
+ case SMESH::EDGE: aColor = edgecolor; break;
+ default: aColor = color; break;
+ }
+
+ SALOMEDS::Color aGroupColor;
+ aGroupColor.R = (float)aColor.red() / 255.0;
+ aGroupColor.G = (float)aColor.green() / 255.0;
+ aGroupColor.B = (float)aColor.blue() / 255.0;
+ aGroupObject->SetColor( aGroupColor );
+ }
+
+ delete aDlg;
+ }
+ break;
+ }}
+ }
+ }
}
SMESH::RepaintCurrentView();
}
if( !selected.IsEmpty() ){
Handle(SALOME_InteractiveObject) anIO = selected.First();
if(!anIO.IsNull()){
- QString aTitle;
- SMESH_Actor::eControl aControl = SMESH_Actor::eNone;
- if(SMESH_Actor *anActor = SMESH::FindActorByEntry(anIO->getEntry())){
- switch ( theCommandID ){
- case 6001:
- aTitle = QObject::tr( "LENGTH_EDGES" );
- aControl = SMESH_Actor::eLength;
- break;
- case 6018:
- aTitle = QObject::tr( "LENGTH2D_EDGES" );
- aControl = SMESH_Actor::eLength2D;
- break;
- case 6002:
- aTitle = QObject::tr( "FREE_EDGES" );
- aControl = SMESH_Actor::eFreeEdges;
- break;
- case 6003:
- aTitle = QObject::tr( "FREE_BORDERS" );
- aControl = SMESH_Actor::eFreeBorders;
- break;
- case 6004:
- aTitle = QObject::tr( "MULTI_BORDERS" );
- aControl = SMESH_Actor::eMultiConnection;
- break;
- case 6005:
- aTitle = QObject::tr( "FREE_NODES" );
- aControl = SMESH_Actor::eFreeNodes;
- break;
- case 6019:
- aTitle = QObject::tr( "MULTI2D_BORDERS" );
- aControl = SMESH_Actor::eMultiConnection2D;
- break;
- case 6011:
- aTitle = QObject::tr( "AREA_ELEMENTS" );
- aControl = SMESH_Actor::eArea;
- break;
- case 6012:
- aTitle = QObject::tr( "TAPER_ELEMENTS" );
- aControl = SMESH_Actor::eTaper;
- break;
- case 6013:
- aTitle = QObject::tr( "ASPECTRATIO_ELEMENTS" );
- aControl = SMESH_Actor::eAspectRatio;
- break;
- case 6017:
- aTitle = QObject::tr( "ASPECTRATIO_3D_ELEMENTS" );
- aControl = SMESH_Actor::eAspectRatio3D;
- break;
- case 6014:
- aTitle = QObject::tr( "MINIMUMANGLE_ELEMENTS" );
- aControl = SMESH_Actor::eMinimumAngle;
- break;
- case 6015:
- aTitle = QObject::tr( "WARP_ELEMENTS" );
- aControl = SMESH_Actor::eWarping;
- break;
- case 6016:
- aTitle = QObject::tr( "SKEW_ELEMENTS" );
- aControl = SMESH_Actor::eSkew;
- break;
- case 6009:
- aTitle = QObject::tr( "SMESH_VOLUME" );
- aControl = SMESH_Actor::eVolume3D;
- break;
- case 6021:
- aTitle = QObject::tr( "FREE_FACES" );
- aControl = SMESH_Actor::eFreeFaces;
- break;
- }
- anActor->SetControlMode(aControl);
- anActor->GetScalarBarActor()->SetTitle(aTitle.toLatin1().data());
- SMESH::RepaintCurrentView();
- }
+ QString aTitle;
+ SMESH_Actor::eControl aControl = SMESH_Actor::eNone;
+ if(SMESH_Actor *anActor = SMESH::FindActorByEntry(anIO->getEntry())){
+ switch ( theCommandID ){
+ case 6001:
+ aTitle = QObject::tr( "LENGTH_EDGES" );
+ aControl = SMESH_Actor::eLength;
+ break;
+ case 6018:
+ aTitle = QObject::tr( "LENGTH2D_EDGES" );
+ aControl = SMESH_Actor::eLength2D;
+ break;
+ case 6002:
+ aTitle = QObject::tr( "FREE_EDGES" );
+ aControl = SMESH_Actor::eFreeEdges;
+ break;
+ case 6003:
+ aTitle = QObject::tr( "FREE_BORDERS" );
+ aControl = SMESH_Actor::eFreeBorders;
+ break;
+ case 6004:
+ aTitle = QObject::tr( "MULTI_BORDERS" );
+ aControl = SMESH_Actor::eMultiConnection;
+ break;
+ case 6005:
+ aTitle = QObject::tr( "FREE_NODES" );
+ aControl = SMESH_Actor::eFreeNodes;
+ break;
+ case 6019:
+ aTitle = QObject::tr( "MULTI2D_BORDERS" );
+ aControl = SMESH_Actor::eMultiConnection2D;
+ break;
+ case 6011:
+ aTitle = QObject::tr( "AREA_ELEMENTS" );
+ aControl = SMESH_Actor::eArea;
+ break;
+ case 6012:
+ aTitle = QObject::tr( "TAPER_ELEMENTS" );
+ aControl = SMESH_Actor::eTaper;
+ break;
+ case 6013:
+ aTitle = QObject::tr( "ASPECTRATIO_ELEMENTS" );
+ aControl = SMESH_Actor::eAspectRatio;
+ break;
+ case 6017:
+ aTitle = QObject::tr( "ASPECTRATIO_3D_ELEMENTS" );
+ aControl = SMESH_Actor::eAspectRatio3D;
+ break;
+ case 6014:
+ aTitle = QObject::tr( "MINIMUMANGLE_ELEMENTS" );
+ aControl = SMESH_Actor::eMinimumAngle;
+ break;
+ case 6015:
+ aTitle = QObject::tr( "WARP_ELEMENTS" );
+ aControl = SMESH_Actor::eWarping;
+ break;
+ case 6016:
+ aTitle = QObject::tr( "SKEW_ELEMENTS" );
+ aControl = SMESH_Actor::eSkew;
+ break;
+ case 6009:
+ aTitle = QObject::tr( "SMESH_VOLUME" );
+ aControl = SMESH_Actor::eVolume3D;
+ break;
+ case 6021:
+ aTitle = QObject::tr( "FREE_FACES" );
+ aControl = SMESH_Actor::eFreeFaces;
+ break;
+ }
+ anActor->SetControlMode(aControl);
+ anActor->GetScalarBarActor()->SetTitle(aTitle.toLatin1().data());
+ SMESH::RepaintCurrentView();
+ }
}
}
}
bool CheckOIType(const Handle(SALOME_InteractiveObject) & theIO,
- MeshObjectType theType,
- const QString theInTypeName,
- QString & theOutTypeName)
+ MeshObjectType theType,
+ const QString theInTypeName,
+ QString & theOutTypeName)
{
SMESH_TypeFilter aTypeFilter( theType );
QString entry;
_PTR(SComponent) aSComp = aSObj->GetFatherComponent();
CORBA::String_var anID = aSComp->GetID().c_str();
if (!strcmp(anID.in(),theIO->getEntry()))
- return "Component";
+ return "Component";
}
QString aTypeName;
if (
- CheckOIType ( theIO, HYPOTHESIS, "Hypothesis", aTypeName ) ||
- CheckOIType ( theIO, ALGORITHM, "Algorithm", aTypeName ) ||
- CheckOIType ( theIO, MESH, "Mesh", aTypeName ) ||
- CheckOIType ( theIO, SUBMESH, "SubMesh", aTypeName ) ||
- CheckOIType ( theIO, GROUP, "Group", aTypeName )
- )
+ CheckOIType ( theIO, HYPOTHESIS, "Hypothesis", aTypeName ) ||
+ CheckOIType ( theIO, ALGORITHM, "Algorithm", aTypeName ) ||
+ CheckOIType ( theIO, MESH, "Mesh", aTypeName ) ||
+ CheckOIType ( theIO, SUBMESH, "SubMesh", aTypeName ) ||
+ CheckOIType ( theIO, GROUP, "Group", aTypeName )
+ )
return aTypeName;
return "NoType";
SALOME_ListIteratorOfListIO It(selected);
for ( ; It.More(); It.Next())
{
- Handle(SALOME_InteractiveObject) IObject = It.Value();
- QString Type = CheckTypeObject(IObject);
- if (Type.compare(RefType) != 0)
- return "Heterogeneous Selection";
+ Handle(SALOME_InteractiveObject) IObject = It.Value();
+ QString Type = CheckTypeObject(IObject);
+ if (Type.compare(RefType) != 0)
+ return "Heterogeneous Selection";
}
return RefType;
QString cur = anIO->getComponentDataType();
_PTR(SObject) aSO = aStudy->FindObjectID(anIO->getEntry());
if (aSO) {
- // check if object is reference
- _PTR(SObject) aRefSObj;
- aNameList.append("\n - ");
- if ( aSO->ReferencedObject( aRefSObj ) ) {
- QString aRefName = QString::fromStdString ( aRefSObj->GetName() );
- aNameList.append( aRefName );
- cur = QString::fromStdString ( aRefSObj->GetFatherComponent()->ComponentDataType() );
- }
- else
- aNameList.append(anIO->getName());
- objectCount++;
+ // check if object is reference
+ _PTR(SObject) aRefSObj;
+ aNameList.append("\n - ");
+ if ( aSO->ReferencedObject( aRefSObj ) ) {
+ QString aRefName = QString::fromStdString ( aRefSObj->GetName() );
+ aNameList.append( aRefName );
+ cur = QString::fromStdString ( aRefSObj->GetFatherComponent()->ComponentDataType() );
+ }
+ else
+ aNameList.append(anIO->getName());
+ objectCount++;
}
if( aParentComponent.isNull() )
if ( aParentComponent != SMESHGUI::GetSMESHGUI()->name() ) {
SUIT_MessageBox::warning( SMESHGUI::desktop(),
- QObject::tr("ERR_ERROR"),
- QObject::tr("NON_SMESH_OBJECTS_SELECTED").arg( SMESHGUI::GetSMESHGUI()->moduleName() ) );
+ QObject::tr("ERR_ERROR"),
+ QObject::tr("NON_SMESH_OBJECTS_SELECTED").arg( SMESHGUI::GetSMESHGUI()->moduleName() ) );
return;
}
// VSR 17/11/04: check if all objects selected belong to SMESH component <-- finish
if (SUIT_MessageBox::warning
- (SMESHGUI::desktop(),
- QObject::tr("SMESH_WRN_WARNING"),
- QObject::tr("SMESH_REALLY_DELETE").arg( objectCount ).arg( aNameList ),
- SUIT_MessageBox::Yes | SUIT_MessageBox::No,
- SUIT_MessageBox::Yes) != SUIT_MessageBox::Yes)
+ (SMESHGUI::desktop(),
+ QObject::tr("SMESH_WRN_WARNING"),
+ QObject::tr("SMESH_REALLY_DELETE").arg( objectCount ).arg( aNameList ),
+ SUIT_MessageBox::Yes | SUIT_MessageBox::No,
+ SUIT_MessageBox::Yes) != SUIT_MessageBox::Yes)
return;
SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
for( ; It.More(); It.Next()){ // loop on selected IO's
Handle(SALOME_InteractiveObject) IObject = It.Value();
if(IObject->hasEntry()) {
- _PTR(SObject) aSO = aStudy->FindObjectID(IObject->getEntry());
-
- // disable removal of "SMESH" component object
- if(aSO->FindAttribute(anAttr, "AttributeIOR")){
- anIOR = anAttr;
- if ( engineIOR() == anIOR->Value().c_str() )
- continue;
- }
- //Check the referenced object
- _PTR(SObject) aRefSObject;
- if ( aSO && aSO->ReferencedObject( aRefSObject ) )
- aSO = aRefSObject; // Delete main Object instead of reference
+ _PTR(SObject) aSO = aStudy->FindObjectID(IObject->getEntry());
+
+ // disable removal of "SMESH" component object
+ if(aSO->FindAttribute(anAttr, "AttributeIOR")){
+ anIOR = anAttr;
+ if ( engineIOR() == anIOR->Value().c_str() )
+ continue;
+ }
+ //Check the referenced object
+ _PTR(SObject) aRefSObject;
+ if ( aSO && aSO->ReferencedObject( aRefSObject ) )
+ aSO = aRefSObject; // Delete main Object instead of reference
// put the whole hierarchy of sub-objects of the selected SO into a list and
// then treat them all starting from the deepest objects (at list back)
std::string anEntry = SO->GetID();
/** Erase graphical object **/
- if(SO->FindAttribute(anAttr, "AttributeIOR")){
- QVector<SUIT_ViewWindow*> aViews = vm->getViews();
- for(int i = 0; i < nbSf; i++){
- SUIT_ViewWindow *sf = aViews[i];
- if(SMESH_Actor* anActor = SMESH::FindActorByEntry(sf,anEntry.c_str())){
- SMESH::RemoveActor(sf,anActor);
- }
- }
- }
+ if(SO->FindAttribute(anAttr, "AttributeIOR")){
+ QVector<SUIT_ViewWindow*> aViews = vm->getViews();
+ for(int i = 0; i < nbSf; i++){
+ SUIT_ViewWindow *sf = aViews[i];
+ if(SMESH_Actor* anActor = SMESH::FindActorByEntry(sf,anEntry.c_str())){
+ SMESH::RemoveActor(sf,anActor);
+ }
+ }
+ }
/** Remove an object from data structures **/
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( SMESH::SObjectToObject( SO ));
//op->finish();
}
}
- } /* listSO back loop */
+ } /* listSO back loop */
} /* IObject->hasEntry() */
} /* more/next */
aStudyBuilder->CommitCommand();
{
_PTR(Study) aStudy = study->studyDS();
if ( aStudy )
- GetSMESHGen()->SetCurrentStudy( _CAST(Study,aStudy)->GetStudy() );
+ GetSMESHGen()->SetCurrentStudy( _CAST(Study,aStudy)->GetStudy() );
}
}
static bool checkLock(_PTR(Study) theStudy) {
if (isStudyLocked(theStudy)) {
SUIT_MessageBox::warning( SMESHGUI::desktop(),
- QObject::tr("WRN_WARNING"),
- QObject::tr("WRN_STUDY_LOCKED") );
+ QObject::tr("WRN_WARNING"),
+ QObject::tr("WRN_STUDY_LOCKED") );
return true;
}
return false;
//QAction* act = action( theCommandID );
- switch (theCommandID) {
- case 33: // DELETE
+ switch (theCommandID) {
+ case 33: // DELETE
if(checkLock(aStudy)) break;
OnEditDelete();
break;
- case 113: // IMPORT
+ case 113: // IMPORT
case 112:
case 111:
{
break;
}
- case 122: // EXPORT MED
+ case 122: // EXPORT MED
case 121:
case 123:
case 124:
break;
}
- case 200: // SCALAR BAR
+ case 200: // SCALAR BAR
{
LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
SALOME_ListIO selected;
aSel->selectedObjects( selected );
if( selected.Extent() ) {
- Handle(SALOME_InteractiveObject) anIO = selected.First();
- if( anIO->hasEntry() ) {
- if( SMESH_Actor* anActor = SMESH::FindActorByEntry( anIO->getEntry() ) ) {
- anActor->SetControlMode( SMESH_Actor::eNone );
- }
- }
+ Handle(SALOME_InteractiveObject) anIO = selected.First();
+ if( anIO->hasEntry() ) {
+ if( SMESH_Actor* anActor = SMESH::FindActorByEntry( anIO->getEntry() ) ) {
+ anActor->SetControlMode( SMESH_Actor::eNone );
+ }
+ }
}
break;
}
SALOME_ListIteratorOfListIO it(selected);
for( ; it.More(); it.Next()) {
Handle(SALOME_InteractiveObject) anIObject = it.Value();
- if(anIObject->hasEntry()) {
- if(SMESH_Actor *anActor = SMESH::FindActorByEntry(anIObject->getEntry())){
- anActor->SetFacesOriented( !anActor->GetFacesOriented() );
- }
- }
+ if(anIObject->hasEntry()) {
+ if(SMESH_Actor *anActor = SMESH::FindActorByEntry(anIObject->getEntry())){
+ anActor->SetFacesOriented( !anActor->GetFacesOriented() );
+ }
+ }
}
break;
}
- case 214: // UPDATE
+ case 214: // UPDATE
{
if(checkLock(aStudy)) break;
try {
break;
}
- case 300: // ERASE
- case 301: // DISPLAY
- case 302: // DISPLAY ONLY
+ case 300: // ERASE
+ case 301: // DISPLAY
+ case 302: // DISPLAY ONLY
{
SMESH::EDisplaing anAction;
switch (theCommandID) {
- case 300: anAction = SMESH::eErase; break;
- case 301: anAction = SMESH::eDisplay; break;
- case 302: anAction = SMESH::eDisplayOnly; break;
+ case 300: anAction = SMESH::eErase; break;
+ case 301: anAction = SMESH::eDisplay; break;
+ case 302: anAction = SMESH::eDisplayOnly; break;
}
LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
aSel->selectedObjects( sel_objects );
if( theCommandID==302 )
- startOperation( myEraseAll );
+ startOperation( myEraseAll );
extractContainers( sel_objects, to_process );
}
if (anAction == SMESH::eErase) {
- SALOME_ListIO l1;
- aSel->setSelectedObjects( l1 );
+ SALOME_ListIO l1;
+ aSel->setSelectedObjects( l1 );
}
else
- aSel->setSelectedObjects( to_process );
+ aSel->setSelectedObjects( to_process );
break;
}
- case 4000: // NODES
+ case 4000: // NODES
{
if(checkLock(aStudy)) break;
if ( vtkwnd ) {
- EmitSignalDeactivateDialog();
+ EmitSignalDeactivateDialog();
- ( new SMESHGUI_NodesDlg( this ) )->show();
+ ( new SMESHGUI_NodesDlg( this ) )->show();
}
else {
- SUIT_MessageBox::warning(desktop(),
- tr("SMESH_WRN_WARNING"),
- tr("SMESH_WRN_VIEWER_VTK"));
+ SUIT_MessageBox::warning(desktop(),
+ tr("SMESH_WRN_WARNING"),
+ tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
break;
}
- case 406: // MOVE NODE
+ case 406: // MOVE NODE
{
if ( !vtkwnd )
{
SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
- tr( "NOT_A_VTK_VIEWER" ) );
+ tr( "NOT_A_VTK_VIEWER" ) );
break;
}
break;
}
- case 701: // COMPUTE MESH
- case 711: // PRECOMPUTE MESH
- case 712: // EVALUATE MESH
+ case 701: // COMPUTE MESH
+ case 711: // PRECOMPUTE MESH
+ case 712: // EVALUATE MESH
{
if (checkLock(aStudy)) break;
startOperation( theCommandID );
if ( !vtkwnd )
{
SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
- tr( "NOT_A_VTK_VIEWER" ) );
+ tr( "NOT_A_VTK_VIEWER" ) );
break;
}
if ( !vtkwnd )
{
SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
- tr( "NOT_A_VTK_VIEWER" ) );
+ tr( "NOT_A_VTK_VIEWER" ) );
break;
}
{
if(checkLock(aStudy)) break;
if( vtkwnd ) {
- EmitSignalDeactivateDialog();
- ( new SMESHGUI_SmoothingDlg( this ) )->show();
+ EmitSignalDeactivateDialog();
+ ( new SMESHGUI_SmoothingDlg( this ) )->show();
}
else {
- SUIT_MessageBox::warning(desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+ SUIT_MessageBox::warning(desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
{
if (checkLock(aStudy)) break;
if (vtkwnd) {
- EmitSignalDeactivateDialog();
- ( new SMESHGUI_ExtrusionDlg ( this ) )->show();
+ EmitSignalDeactivateDialog();
+ ( new SMESHGUI_ExtrusionDlg ( this ) )->show();
} else {
- SUIT_MessageBox::warning(desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+ SUIT_MessageBox::warning(desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
{
if(checkLock(aStudy)) break;
if( vtkwnd ) {
- EmitSignalDeactivateDialog();
- ( new SMESHGUI_RevolutionDlg( this ) )->show();
+ EmitSignalDeactivateDialog();
+ ( new SMESHGUI_RevolutionDlg( this ) )->show();
}
else {
- SUIT_MessageBox::warning(desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+ SUIT_MessageBox::warning(desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
( new SMESHGUI_MeshPatternDlg( this ) )->show();
}
else {
- SUIT_MessageBox::warning(desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+ SUIT_MessageBox::warning(desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
{
if (checkLock(aStudy)) break;
if (vtkwnd) {
- EmitSignalDeactivateDialog();
- ( new SMESHGUI_ExtrusionAlongPathDlg( this ) )->show();
+ EmitSignalDeactivateDialog();
+ ( new SMESHGUI_ExtrusionAlongPathDlg( this ) )->show();
} else {
- SUIT_MessageBox::warning(desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+ SUIT_MessageBox::warning(desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
startOperation( 417 );
/* if (checkLock(aStudy)) break;
if (vtkwnd) {
- EmitSignalDeactivateDialog();
- new SMESHGUI_ConvToQuadDlg();
+ EmitSignalDeactivateDialog();
+ new SMESHGUI_ConvToQuadDlg();
} else {
- SUIT_MessageBox::warning(desktop(),
+ SUIT_MessageBox::warning(desktop(),
tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
- }*/
+ }*/
break;
}
case 418: // create 2D mesh from 3D
if ( !vtkwnd )
{
SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
- tr( "NOT_A_VTK_VIEWER" ) );
+ tr( "NOT_A_VTK_VIEWER" ) );
break;
}
int nbSel = selected.Extent();
if (nbSel == 1) {
- // check if mesh is selected
+ // check if mesh is selected
aMesh = SMESH::GetMeshByIO( selected.First() );
}
SMESHGUI_GroupDlg *aDlg = new SMESHGUI_GroupDlg( this, aMesh);
if ( !vtkwnd )
{
SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
- tr( "NOT_A_VTK_VIEWER" ) );
+ tr( "NOT_A_VTK_VIEWER" ) );
break;
}
int nbSel = selected.Extent();
if (nbSel == 1) {
- // check if submesh is selected
- Handle(SALOME_InteractiveObject) IObject = selected.First();
- if (IObject->hasEntry()) {
- _PTR(SObject) aSObj = aStudy->FindObjectID(IObject->getEntry());
- if( aSObj ) {
- SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow( SMESH::SObjectToObject( aSObj ) );
- if (!aSubMesh->_is_nil()) {
- try {
- SMESH::SMESH_Mesh_var aMesh = aSubMesh->GetFather();
- // get submesh elements list by types
- SMESH::long_array_var aNodes = aSubMesh->GetElementsByType(SMESH::NODE);
- SMESH::long_array_var aEdges = aSubMesh->GetElementsByType(SMESH::EDGE);
- SMESH::long_array_var aFaces = aSubMesh->GetElementsByType(SMESH::FACE);
- SMESH::long_array_var aVolumes = aSubMesh->GetElementsByType(SMESH::VOLUME);
- // create group for each type o elements
- QString aName = IObject->getName();
- if (aNodes->length() > 0) {
- SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::NODE, aName + "_Nodes");
- aGroup->Add(aNodes.inout());
- }
- if (aEdges->length() > 0) {
- SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::EDGE, aName + "_Edges");
- aGroup->Add(aEdges.inout());
- }
- if (aFaces->length() > 0) {
- SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::FACE, aName + "_Faces");
- aGroup->Add(aFaces.inout());
- }
- if (aVolumes->length() > 0) {
- SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::VOLUME, aName + "_Volumes");
- aGroup->Add(aVolumes.inout());
- }
- updateObjBrowser();
-
- }
+ // check if submesh is selected
+ Handle(SALOME_InteractiveObject) IObject = selected.First();
+ if (IObject->hasEntry()) {
+ _PTR(SObject) aSObj = aStudy->FindObjectID(IObject->getEntry());
+ if( aSObj ) {
+ SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow( SMESH::SObjectToObject( aSObj ) );
+ if (!aSubMesh->_is_nil()) {
+ try {
+ SMESH::SMESH_Mesh_var aMesh = aSubMesh->GetFather();
+ // get submesh elements list by types
+ SMESH::long_array_var aNodes = aSubMesh->GetElementsByType(SMESH::NODE);
+ SMESH::long_array_var aEdges = aSubMesh->GetElementsByType(SMESH::EDGE);
+ SMESH::long_array_var aFaces = aSubMesh->GetElementsByType(SMESH::FACE);
+ SMESH::long_array_var aVolumes = aSubMesh->GetElementsByType(SMESH::VOLUME);
+ // create group for each type o elements
+ QString aName = IObject->getName();
+ if (aNodes->length() > 0) {
+ SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::NODE, aName + "_Nodes");
+ aGroup->Add(aNodes.inout());
+ }
+ if (aEdges->length() > 0) {
+ SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::EDGE, aName + "_Edges");
+ aGroup->Add(aEdges.inout());
+ }
+ if (aFaces->length() > 0) {
+ SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::FACE, aName + "_Faces");
+ aGroup->Add(aFaces.inout());
+ }
+ if (aVolumes->length() > 0) {
+ SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::VOLUME, aName + "_Volumes");
+ aGroup->Add(aVolumes.inout());
+ }
+ updateObjBrowser();
+
+ }
catch(const SALOME::SALOME_Exception & S_ex){
- SalomeApp_Tools::QtCatchCorbaException(S_ex);
- }
- }
- }
- }
+ SalomeApp_Tools::QtCatchCorbaException(S_ex);
+ }
+ }
+ }
+ }
}
else if(nbSel==0) {
SUIT_MessageBox::warning(desktop(),
- tr("SMESH_WRN_WARNING"),
- tr("SMESH_WRN_NO_AVAILABLE_DATA"));
+ tr("SMESH_WRN_WARNING"),
+ tr("SMESH_WRN_NO_AVAILABLE_DATA"));
}
break;
}
if ( !vtkwnd )
{
SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
- tr( "NOT_A_VTK_VIEWER" ) );
+ tr( "NOT_A_VTK_VIEWER" ) );
break;
}
SMESH::SMESH_GroupBase_var aGroup =
SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(It.Value());
if (!aGroup->_is_nil()) {
- nbSelectedGroups++;
+ nbSelectedGroups++;
SMESHGUI_GroupDlg *aDlg = new SMESHGUI_GroupDlg( this, aGroup);
aDlg->show();
- }
+ }
}
if (nbSelectedGroups == 0)
- {
- SMESHGUI_GroupDlg *aDlg = new SMESHGUI_GroupDlg( this, SMESH::SMESH_GroupBase::_nil());
- aDlg->show();
- }
+ {
+ SMESHGUI_GroupDlg *aDlg = new SMESHGUI_GroupDlg( this, SMESH::SMESH_GroupBase::_nil());
+ aDlg->show();
+ }
break;
}
{
if(checkLock(aStudy)) break;
if (myState == 800) {
- SMESHGUI_GroupDlg *aDlg = (SMESHGUI_GroupDlg*) myActiveDialogBox;
- if (aDlg) aDlg->onAdd();
+ SMESHGUI_GroupDlg *aDlg = (SMESHGUI_GroupDlg*) myActiveDialogBox;
+ if (aDlg) aDlg->onAdd();
}
break;
}
{
if(checkLock(aStudy)) break;
if (myState == 800) {
- SMESHGUI_GroupDlg *aDlg = (SMESHGUI_GroupDlg*) myActiveDialogBox;
- if (aDlg) aDlg->onRemove();
+ SMESHGUI_GroupDlg *aDlg = (SMESHGUI_GroupDlg*) myActiveDialogBox;
+ if (aDlg) aDlg->onRemove();
}
break;
}
if ( !vtkwnd )
{
SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
- tr( "NOT_A_VTK_VIEWER" ) );
+ tr( "NOT_A_VTK_VIEWER" ) );
break;
}
if (!aGroup->_is_nil()) {
SMESHGUI_GroupDlg *aDlg = new SMESHGUI_GroupDlg( this, aGroup, true );
aDlg->show();
- }
+ }
}
break;
}
if ( !vtkwnd )
{
SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
- tr( "NOT_A_VTK_VIEWER" ) );
+ tr( "NOT_A_VTK_VIEWER" ) );
break;
}
if ( !vtkwnd )
{
SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
- tr( "NOT_A_VTK_VIEWER" ) );
+ tr( "NOT_A_VTK_VIEWER" ) );
break;
}
break;
}
- case 900: // MESH INFOS
+ case 900: // MESH INFOS
{
EmitSignalDeactivateDialog();
LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
SALOME_ListIO IOs;
SALOME_ListIteratorOfListIO It (selected);
for ( ; It.More(); It.Next() ) {
- IOs.Clear(); IOs.Append( It.Value() );
- aSel->setSelectedObjects( IOs );
+ IOs.Clear(); IOs.Append( It.Value() );
+ aSel->setSelectedObjects( IOs );
( new SMESHGUI_MeshInfosDlg( this ) )->show();
}
// restore selection
break;
}
- case 902: // STANDARD MESH INFOS
+ case 902: // STANDARD MESH INFOS
{
EmitSignalDeactivateDialog();
LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
SALOME_ListIO IOs;
SALOME_ListIteratorOfListIO It (selected);
for ( ; It.More(); It.Next() ) {
- IOs.Clear();
- IOs.Append( It.Value() );
- aSel->setSelectedObjects( IOs );
+ IOs.Clear();
+ IOs.Append( It.Value() );
+ aSel->setSelectedObjects( IOs );
( new SMESHGUI_StandardMeshInfosDlg( this ) )->show();
}
// restore selection
- aSel->setSelectedObjects( selected );
+ aSel->setSelectedObjects( selected );
}
else
( new SMESHGUI_StandardMeshInfosDlg( this ) )->show();
break;
}
- case 903: // WHAT IS
+ case 903: // WHAT IS
{
EmitSignalDeactivateDialog();
( new SMESHGUI_WhatIsDlg( this ) )->show();
break;
}
- case 1100: // EDIT HYPOTHESIS
+ case 1100: // EDIT HYPOTHESIS
{
if(checkLock(aStudy)) break;
if (nbSel == 1) {
Handle(SALOME_InteractiveObject) anIObject = selected.First();
- SMESH::SMESH_Hypothesis_var aHypothesis = SMESH::IObjectToInterface<SMESH::SMESH_Hypothesis>(anIObject);
+ SMESH::SMESH_Hypothesis_var aHypothesis = SMESH::IObjectToInterface<SMESH::SMESH_Hypothesis>(anIObject);
/* Look for all mesh objects that have this hypothesis affected in order to flag as ModifiedMesh */
/* At end below '...->updateObjBrowser(true)' will change icon of mesh objects */
break;
}
- case 1101: // RENAME
+ case 1101: // RENAME
{
if ( checkLock( aStudy ) )
break;
{
SMESHGUI::GetSMESHGen()->SetName(obj->GetIOR().c_str(), newName.toLatin1().data());
- // update name of group object and its actor
- SMESH::SMESH_GroupBase_var aGroupObject = SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IObject);
- if( !aGroupObject->_is_nil() )
- {
- aGroupObject->SetName( newName.toLatin1().data() );
- if ( SMESH_Actor *anActor = SMESH::FindActorByEntry( IObject->getEntry() ) )
- anActor->setName( newName.toLatin1().data() );
- }
+ // update name of group object and its actor
+ SMESH::SMESH_GroupBase_var aGroupObject = SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IObject);
+ if( !aGroupObject->_is_nil() )
+ {
+ aGroupObject->SetName( newName.toLatin1().data() );
+ if ( SMESH_Actor *anActor = SMESH::FindActorByEntry( IObject->getEntry() ) )
+ anActor->setName( newName.toLatin1().data() );
+ }
updateObjBrowser();
}
if (!isAny) {
SUIT_MessageBox::warning(desktop(),
- QObject::tr("SMESH_WRN_WARNING"),
- QObject::tr("SMESH_WRN_NO_APPROPRIATE_SELECTION"));
+ QObject::tr("SMESH_WRN_WARNING"),
+ QObject::tr("SMESH_WRN_NO_APPROPRIATE_SELECTION"));
}
break;
}
- case 1102: // REMOVE HYPOTHESIS / ALGORITHMS
+ case 1102: // REMOVE HYPOTHESIS / ALGORITHMS
{
if(checkLock(aStudy)) break;
SUIT_OverrideCursor wc;
SALOME_ListIteratorOfListIO It(selected);
for (int i = 0; It.More(); It.Next(), i++) {
- Handle(SALOME_InteractiveObject) IObject = It.Value();
- SMESH::RemoveHypothesisOrAlgorithmOnMesh(IObject);
+ Handle(SALOME_InteractiveObject) IObject = It.Value();
+ SMESH::RemoveHypothesisOrAlgorithmOnMesh(IObject);
}
SALOME_ListIO l1;
aSel->setSelectedObjects( l1 );
break;
}
- case 4009: // ELEM0D
- case 4010: // GEOM::EDGE
- case 4021: // TRIANGLE
- case 4022: // QUAD
- case 4023: // POLYGON
- case 4031: // TETRA
- case 4032: // HEXA
+ case 4009: // ELEM0D
+ case 4010: // GEOM::EDGE
+ case 4021: // TRIANGLE
+ case 4022: // QUAD
+ case 4023: // POLYGON
+ case 4031: // TETRA
+ case 4032: // HEXA
{
if(checkLock(aStudy)) break;
if ( vtkwnd ) {
- EmitSignalDeactivateDialog();
+ EmitSignalDeactivateDialog();
SMDSAbs_ElementType type = SMDSAbs_Edge;
int nbNodes = 2;
switch (theCommandID) {
type = SMDSAbs_Face; nbNodes = 4; break;
case 4031: // TETRA
type = SMDSAbs_Volume; nbNodes = 4; break;
- case 4023: // POLYGON
- type = SMDSAbs_Face; nbNodes = 5; break; // 5 - identificator for POLYGON
+ case 4023: // POLYGON
+ type = SMDSAbs_Face; nbNodes = 5; break; // 5 - identificator for POLYGON
case 4032: // HEXA
type = SMDSAbs_Volume; nbNodes = 8; break;
- case 4033: // POLYHEDRE
- type = SMDSAbs_Volume; nbNodes = 9; break; // 9 - identificator for POLYHEDRE
+ case 4033: // POLYHEDRE
+ type = SMDSAbs_Volume; nbNodes = 9; break; // 9 - identificator for POLYHEDRE
default:;
}
- ( new SMESHGUI_AddMeshElementDlg( this, type, nbNodes ) )->show();
+ ( new SMESHGUI_AddMeshElementDlg( this, type, nbNodes ) )->show();
}
else {
- SUIT_MessageBox::warning(desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+ SUIT_MessageBox::warning(desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
- case 4033: // POLYHEDRON
+ case 4033: // POLYHEDRON
{
if(checkLock(aStudy)) break;
if ( vtkwnd ) {
- EmitSignalDeactivateDialog();
- ( new SMESHGUI_CreatePolyhedralVolumeDlg( this ) )->show();
+ EmitSignalDeactivateDialog();
+ ( new SMESHGUI_CreatePolyhedralVolumeDlg( this ) )->show();
}
else {
- SUIT_MessageBox::warning(SMESHGUI::desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+ SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
{
if(checkLock(aStudy)) break;
if ( vtkwnd ) {
- EmitSignalDeactivateDialog();
- int type;
-
- switch (theCommandID) {
- case 4034:
- type = QUAD_EDGE; break;
- case 4035:
- type = QUAD_TRIANGLE; break;
- case 4036:
- type = QUAD_QUADRANGLE; break;
- case 4037:
- type = QUAD_TETRAHEDRON; break;
- case 4038:
- type = QUAD_PYRAMID; break;
- case 4039:
- type = QUAD_PENTAHEDRON; break;
- case 4040:
- type = QUAD_HEXAHEDRON;
- break;
- default:;
- }
- ( new SMESHGUI_AddQuadraticElementDlg( this, type ) )->show();
+ EmitSignalDeactivateDialog();
+ int type;
+
+ switch (theCommandID) {
+ case 4034:
+ type = QUAD_EDGE; break;
+ case 4035:
+ type = QUAD_TRIANGLE; break;
+ case 4036:
+ type = QUAD_QUADRANGLE; break;
+ case 4037:
+ type = QUAD_TETRAHEDRON; break;
+ case 4038:
+ type = QUAD_PYRAMID; break;
+ case 4039:
+ type = QUAD_PENTAHEDRON; break;
+ case 4040:
+ type = QUAD_HEXAHEDRON;
+ break;
+ default:;
+ }
+ ( new SMESHGUI_AddQuadraticElementDlg( this, type ) )->show();
}
else {
- SUIT_MessageBox::warning(SMESHGUI::desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+ SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
- case 4041: // REMOVES NODES
+ case 4041: // REMOVES NODES
{
if(checkLock(aStudy)) break;
if ( vtkwnd ) {
- EmitSignalDeactivateDialog();
- ( new SMESHGUI_RemoveNodesDlg( this ) )->show();
+ EmitSignalDeactivateDialog();
+ ( new SMESHGUI_RemoveNodesDlg( this ) )->show();
}
else {
- SUIT_MessageBox::warning(SMESHGUI::desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+ SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
- case 4042: // REMOVES ELEMENTS
+ case 4042: // REMOVES ELEMENTS
{
if(checkLock(aStudy)) break;
if( vtkwnd ) {
- EmitSignalDeactivateDialog();
- ( new SMESHGUI_RemoveElementsDlg( this ) )->show();
+ EmitSignalDeactivateDialog();
+ ( new SMESHGUI_RemoveElementsDlg( this ) )->show();
}
else
- {
- SUIT_MessageBox::warning(SMESHGUI::desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
- }
+ {
+ SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+ }
break;
}
case 4043: { // CLEAR_MESH
}
}
catch (const SALOME::SALOME_Exception& S_ex){
- wc.suspend();
- SalomeApp_Tools::QtCatchCorbaException(S_ex);
- wc.resume();
+ wc.suspend();
+ SalomeApp_Tools::QtCatchCorbaException(S_ex);
+ wc.resume();
}
}
SMESH::UpdateView();
updateObjBrowser();
break;
}
- case 4051: // RENUMBERING NODES
+ case 4051: // RENUMBERING NODES
{
if(checkLock(aStudy)) break;
if( vtkwnd ) {
- EmitSignalDeactivateDialog();
- ( new SMESHGUI_RenumberingDlg( this, 0 ) )->show();
+ EmitSignalDeactivateDialog();
+ ( new SMESHGUI_RenumberingDlg( this, 0 ) )->show();
}
else
- {
- SUIT_MessageBox::warning(SMESHGUI::desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
- }
+ {
+ SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+ }
break;
}
- case 4052: // RENUMBERING ELEMENTS
+ case 4052: // RENUMBERING ELEMENTS
{
if(checkLock(aStudy)) break;
if ( vtkwnd ) {
- EmitSignalDeactivateDialog();
- ( new SMESHGUI_RenumberingDlg( this, 1 ) )->show();
+ EmitSignalDeactivateDialog();
+ ( new SMESHGUI_RenumberingDlg( this, 1 ) )->show();
}
else
- {
- SUIT_MessageBox::warning(SMESHGUI::desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
- }
+ {
+ SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+ }
break;
}
case 4061: // TRANSLATION
{
if(checkLock(aStudy)) break;
if ( vtkwnd ) {
- EmitSignalDeactivateDialog();
- ( new SMESHGUI_TranslationDlg( this ) )->show();
+ EmitSignalDeactivateDialog();
+ ( new SMESHGUI_TranslationDlg( this ) )->show();
}
else {
- SUIT_MessageBox::warning(SMESHGUI::desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+ SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
{
if(checkLock(aStudy)) break;
if( vtkwnd ) {
- EmitSignalDeactivateDialog();
- ( new SMESHGUI_RotationDlg( this ) )->show();
+ EmitSignalDeactivateDialog();
+ ( new SMESHGUI_RotationDlg( this ) )->show();
}
else {
- SUIT_MessageBox::warning(SMESHGUI::desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+ SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
{
if(checkLock(aStudy)) break;
if(vtkwnd) {
- EmitSignalDeactivateDialog();
- ( new SMESHGUI_SymmetryDlg( this ) )->show();
+ EmitSignalDeactivateDialog();
+ ( new SMESHGUI_SymmetryDlg( this ) )->show();
}
else {
- SUIT_MessageBox::warning(SMESHGUI::desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+ SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
{
if(checkLock(aStudy)) break;
if(vtkwnd) {
- EmitSignalDeactivateDialog();
- ( new SMESHGUI_SewingDlg( this ) )->show();
+ EmitSignalDeactivateDialog();
+ ( new SMESHGUI_SewingDlg( this ) )->show();
}
else {
- SUIT_MessageBox::warning(SMESHGUI::desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+ SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
{
if(checkLock(aStudy)) break;
if(vtkwnd) {
- EmitSignalDeactivateDialog();
- ( new SMESHGUI_EditMeshDlg( this, 0 ) )->show();
+ EmitSignalDeactivateDialog();
+ ( new SMESHGUI_EditMeshDlg( this, 0 ) )->show();
}
else {
- SUIT_MessageBox::warning(SMESHGUI::desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+ SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
{
if (checkLock(aStudy)) break;
if (vtkwnd) {
- EmitSignalDeactivateDialog();
- ( new SMESHGUI_EditMeshDlg( this, 1 ) )->show();
+ EmitSignalDeactivateDialog();
+ ( new SMESHGUI_EditMeshDlg( this, 1 ) )->show();
} else {
- SUIT_MessageBox::warning(SMESHGUI::desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
+ SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
}
break;
- case 6017: // CONTROLS
+ case 6017: // CONTROLS
case 6016:
case 6015:
case 6014:
SALOME_ListIO selected; mgr->selectedObjects( selected );
if ( selected.Extent() == 1 && selected.First()->hasEntry() ) {
- _PTR(SObject) SO = aStudy->FindObjectID( selected.First()->getEntry() );
- if ( SO ) {
- CORBA::Object_var aObject = SMESH::SObjectToObject( SO );
- SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow( aObject );
- SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow( aObject );
- SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( aObject );
- if ( !aMesh->_is_nil() || !aSubMesh->_is_nil() || !aGroup->_is_nil() ) {
- ::Control( theCommandID );
- break;
- }
- }
+ _PTR(SObject) SO = aStudy->FindObjectID( selected.First()->getEntry() );
+ if ( SO ) {
+ CORBA::Object_var aObject = SMESH::SObjectToObject( SO );
+ SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow( aObject );
+ SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow( aObject );
+ SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( aObject );
+ if ( !aMesh->_is_nil() || !aSubMesh->_is_nil() || !aGroup->_is_nil() ) {
+ ::Control( theCommandID );
+ break;
+ }
+ }
}
SUIT_MessageBox::warning(desktop(),
- tr( "SMESH_WRN_WARNING" ),
- tr( "SMESH_BAD_SELECTION" ) );
+ tr( "SMESH_WRN_WARNING" ),
+ tr( "SMESH_BAD_SELECTION" ) );
break;
}
else {
SUIT_MessageBox::warning(desktop(),
- tr( "SMESH_WRN_WARNING" ),
- tr( "NOT_A_VTK_VIEWER" ) );
+ tr( "SMESH_WRN_WARNING" ),
+ tr( "NOT_A_VTK_VIEWER" ) );
}
break;
case 9010:
SALOME_ListIteratorOfListIO it(selected);
for( ; it.More(); it.Next()) {
Handle(SALOME_InteractiveObject) anIObject = it.Value();
- if(anIObject->hasEntry()) {
- if(SMESH_Actor *anActor = SMESH::FindActorByEntry(anIObject->getEntry())){
- anActor->SetPointsLabeled( !anActor->GetPointsLabeled() );
- }
- }
+ if(anIObject->hasEntry()) {
+ if(SMESH_Actor *anActor = SMESH::FindActorByEntry(anIObject->getEntry())){
+ anActor->SetPointsLabeled( !anActor->GetPointsLabeled() );
+ }
+ }
}
break;
}
LightApp_SelectionMgr* mgr = selectionMgr();
SALOME_ListIO selected; mgr->selectedObjects( selected );
- if (selected.Extent() == 1) {
- Handle(SALOME_InteractiveObject) anIObject = selected.First();
- if(anIObject->hasEntry())
- if(SMESH_Actor *anActor = SMESH::FindActorByEntry(anIObject->getEntry())){
- anActor->SetCellsLabeled( !anActor->GetCellsLabeled() );
- }
+ if (selected.Extent() == 1) {
+ Handle(SALOME_InteractiveObject) anIObject = selected.First();
+ if(anIObject->hasEntry())
+ if(SMESH_Actor *anActor = SMESH::FindActorByEntry(anIObject->getEntry())){
+ anActor->SetCellsLabeled( !anActor->GetCellsLabeled() );
+ }
}
break;
}
const QString& clients,
const QString& types,
const QString& theRule,
- const int pId )
+ const int pId )
{
int parentId = pId;
if( pId!=-1 )
myRules.clear();
QString OB = "'ObjectBrowser'",
- View = "'" + SVTK_Viewer::Type() + "'",
- pat = "'%1'",
- mesh = pat.arg( SMESHGUI_Selection::typeName( MESH ) ),
- group = pat.arg( SMESHGUI_Selection::typeName( GROUP ) ),
- hypo = pat.arg( SMESHGUI_Selection::typeName( HYPOTHESIS ) ),
- algo = pat.arg( SMESHGUI_Selection::typeName( ALGORITHM ) ),
- elems = QString( "'%1' '%2' '%3' '%4' '%5' '%6'" ).
+ View = "'" + SVTK_Viewer::Type() + "'",
+ pat = "'%1'",
+ mesh = pat.arg( SMESHGUI_Selection::typeName( MESH ) ),
+ group = pat.arg( SMESHGUI_Selection::typeName( GROUP ) ),
+ hypo = pat.arg( SMESHGUI_Selection::typeName( HYPOTHESIS ) ),
+ algo = pat.arg( SMESHGUI_Selection::typeName( ALGORITHM ) ),
+ elems = QString( "'%1' '%2' '%3' '%4' '%5' '%6'" ).
arg( SMESHGUI_Selection::typeName( SUBMESH_VERTEX ) ).
- arg( SMESHGUI_Selection::typeName( SUBMESH_EDGE ) ).
- arg( SMESHGUI_Selection::typeName( SUBMESH_FACE ) ).
- arg( SMESHGUI_Selection::typeName( SUBMESH_SOLID ) ).
- arg( SMESHGUI_Selection::typeName( SUBMESH_COMPOUND ) ).
- arg( SMESHGUI_Selection::typeName( SUBMESH ) ),
+ arg( SMESHGUI_Selection::typeName( SUBMESH_EDGE ) ).
+ arg( SMESHGUI_Selection::typeName( SUBMESH_FACE ) ).
+ arg( SMESHGUI_Selection::typeName( SUBMESH_SOLID ) ).
+ arg( SMESHGUI_Selection::typeName( SUBMESH_COMPOUND ) ).
+ arg( SMESHGUI_Selection::typeName( SUBMESH ) ),
subMesh = elems,
- mesh_group = mesh + " " + subMesh + " " + group,
- hyp_alg = hypo + " " + algo;
+ mesh_group = mesh + " " + subMesh + " " + group,
+ hyp_alg = hypo + " " + algo;
// popup for object browser
QString
popupMgr()->insert( separator(), -1, -1 );
connect( application(), SIGNAL( viewManagerActivated( SUIT_ViewManager* ) ),
- this, SLOT( onViewManagerActivated( SUIT_ViewManager* ) ) );
+ this, SLOT( onViewManagerActivated( SUIT_ViewManager* ) ) );
}
//================================================================================
if ( obj ) {
QString aName = QString( obj->GetName().c_str() );
while ( aName.at( aName.length() - 1 ) == ' ' ) // Remove extraspaces in Name of Popup
- aName.remove( (aName.length() - 1), 1 );
+ aName.remove( (aName.length() - 1), 1 );
title = aName;
}
}
if( name=="selection_object_color" || name=="selection_element_color" ||
name=="selection_width" || name=="highlight_color" || name=="highlight_width" ||
name=="selection_precision_node" || name=="selection_precision_element" ||
- name=="selection_precision_object")
+ name=="selection_precision_object")
SMESH::UpdateSelectionProp( this );
else if (name == QString("scalar_bar_vertical_x") || name == QString("scalar_bar_vertical_width")){
sbX1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_x", sbX1);
sbW = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_width", sbW);
if(sbX1+sbW > aTol){
- aWarning = "Origin and Size Vertical: X+Width > 1\n";
- sbX1=0.01;
- sbW=0.08;
- aResourceMgr->setValue("SMESH", "scalar_bar_vertical_x", sbX1);
- aResourceMgr->setValue("SMESH", "scalar_bar_vertical_width", sbW);
+ aWarning = "Origin and Size Vertical: X+Width > 1\n";
+ sbX1=0.01;
+ sbW=0.08;
+ aResourceMgr->setValue("SMESH", "scalar_bar_vertical_x", sbX1);
+ aResourceMgr->setValue("SMESH", "scalar_bar_vertical_width", sbW);
}
}
else if(name == QString("scalar_bar_vertical_y") || name == QString("scalar_bar_vertical_height")){
sbY1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_y", sbY1);
sbH = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_height",sbH);
if(sbY1+sbH > aTol){
- aWarning = "Origin and Size Vertical: Y+Height > 1\n";
- aResourceMgr->setValue("SMESH", "scalar_bar_vertical_y", sbY1);
- aResourceMgr->setValue("SMESH", "scalar_bar_vertical_height",sbH);
+ aWarning = "Origin and Size Vertical: Y+Height > 1\n";
+ aResourceMgr->setValue("SMESH", "scalar_bar_vertical_y", sbY1);
+ aResourceMgr->setValue("SMESH", "scalar_bar_vertical_height",sbH);
}
}
else if(name == QString("scalar_bar_horizontal_x") || name == QString("scalar_bar_horizontal_width")){
sbX1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_x", sbX1);
sbW = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_width", sbW);
if(sbX1+sbW > aTol){
- aWarning = "Origin and Size Horizontal: X+Width > 1\n";
- sbX1=0.1;
- sbW=0.08;
- aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_x", sbX1);
- aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_width", sbW);
+ aWarning = "Origin and Size Horizontal: X+Width > 1\n";
+ sbX1=0.1;
+ sbW=0.08;
+ aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_x", sbX1);
+ aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_width", sbW);
}
}
else if(name == QString("scalar_bar_horizontal_y") || name == QString("scalar_bar_horizontal_height")){
sbY1 = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_y", sbY1);
sbH = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_height",sbH);
if(sbY1+sbH > aTol){
- aWarning = "Origin and Size Horizontal: Y+Height > 1\n";
- sbY1=0.01;
- sbH=0.08;
- aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_y", sbY1);
- aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_height",sbH);
+ aWarning = "Origin and Size Horizontal: Y+Height > 1\n";
+ sbY1=0.01;
+ sbH=0.08;
+ aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_y", sbY1);
+ aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_height",sbH);
}
}
else if ( name == "segmentation" ) {
if(aWarning.size() != 0){
aWarning += "The default values are applied instead.";
SUIT_MessageBox::warning(SMESHGUI::desktop(),
- QObject::tr("SMESH_ERR_SCALARBAR_PARAMS"),
- QObject::tr(aWarning.c_str()));
+ QObject::tr("SMESH_ERR_SCALARBAR_PARAMS"),
+ QObject::tr(aWarning.c_str()));
}
}
}
{
aTolerance /= 2;
if( aTolerance < 1 )
- break;
+ break;
}
//cout << "Iteration N" << anIterations << " (tolerance=" << aTolerance << ")"<< endl;
//cout << h << " ";
if( abs( h - aHue ) < aTolerance )
{
- ok = false;
- //cout << "break (diff = " << abs( h - aHue ) << ")";
- break;
+ ok = false;
+ //cout << "break (diff = " << abs( h - aHue ) << ")";
+ break;
}
}
//cout << endl;
QVector<SUIT_ViewWindow*> views = vman->getViews();
for (int i = 0, iEnd = vman->getViewsCount(); i < iEnd; i++)
{
- if (SVTK_ViewWindow* vtkView = dynamic_cast<SVTK_ViewWindow*>(views[i]))
+ if (SVTK_ViewWindow* vtkView = dynamic_cast<SVTK_ViewWindow*>(views[i]))
{
- VTK::ActorCollectionCopy aCopy(vtkView->getRenderer()->GetActors());
- vtkActorCollection* allActors = aCopy.GetActors();
- allActors->InitTraversal();
- while (vtkActor* actor = allActors->GetNextActor())
+ VTK::ActorCollectionCopy aCopy(vtkView->getRenderer()->GetActors());
+ vtkActorCollection* allActors = aCopy.GetActors();
+ allActors->InitTraversal();
+ while (vtkActor* actor = allActors->GetNextActor())
{
- if (actor->GetVisibility()) // store only visible actors
+ if (actor->GetVisibility()) // store only visible actors
{
SMESH_Actor* aSmeshActor = 0;
if (actor->IsA("SMESH_Actor"))
aSmeshActor = SMESH_Actor::SafeDownCast(actor);
- if (aSmeshActor && aSmeshActor->hasIO())
+ if (aSmeshActor && aSmeshActor->hasIO())
{
Handle(SALOME_InteractiveObject) io = aSmeshActor->getIO();
if (io->hasEntry())
ip->setParameter(entry, param + QString::number(ipl+1).toLatin1().data(), planeValue);
}
} // if (io->hasEntry())
- } // SMESH_Actor && hasIO
- } // isVisible
- } // while.. actors traversal
- } // if (vtkView)
+ } // SMESH_Actor && hasIO
+ } // isVisible
+ } // while.. actors traversal
+ } // if (vtkView)
} // for (views)
vtkViewers++;
} // if (SVTK view model)
bool ok;
int viewIndex = viewIndexStr.toUInt(&ok);
if (!ok) // bad conversion of view index to integer
- continue;
+ continue;
// viewers
if (viewerTypStr == SVTK_Viewer::Type())
// access later when restoring other parameters
SVTK_ViewWindow* vtkView = (SVTK_ViewWindow*) vman->getActiveView();
vtkRenderer* Renderer = vtkView->getRenderer();
- VTK::ActorCollectionCopy aCopy(Renderer->GetActors());
+ VTK::ActorCollectionCopy aCopy(Renderer->GetActors());
vtkActorCollection* theActors = aCopy.GetActors();
theActors->InitTraversal();
bool isFound = false;
}
}
} // if (paramNameStr == "Visibility")
- else
+ else
{
// the rest properties "work" with SMESH_Actor
- if (aSmeshActor)
+ if (aSmeshActor)
{
QString val ((*valuesIt).c_str());
}
}
} // if (aSmeshActor)
- } // other parameters than Visibility
+ } // other parameters than Visibility
}
} // for names/parameters iterator
} // for entries iterator
vtkIdList *anIds = vtkIdList::New();
if(aConn)
- for (int i = 0, iEnd = theIds.size(); i < iEnd; i++)
- anIds->InsertId(i,theIds[aConn[i]]);
+ for (int i = 0, iEnd = theIds.size(); i < iEnd; i++)
+ anIds->InsertId(i,theIds[aConn[i]]);
else
- for (int i = 0, iEnd = theIds.size(); i < iEnd; i++)
- anIds->InsertId(i,theIds[i]);
+ for (int i = 0, iEnd = theIds.size(); i < iEnd; i++)
+ anIds->InsertId(i,theIds[i]);
myGrid->InsertNextCell(theType,anIds);
anIds->Delete();
~TElementSimulation()
{
if (FindVtkViewWindow(myApplication->activeViewManager(), myViewWindow)) {
- myVTKViewWindow->RemoveActor(myPreviewActor);
- myVTKViewWindow->RemoveActor(myFaceOrientation);
+ myVTKViewWindow->RemoveActor(myPreviewActor);
+ myVTKViewWindow->RemoveActor(myFaceOrientation);
}
myPreviewActor->Delete();
myFaceOrientation->Delete();
//=================================================================================
SMESHGUI_AddMeshElementDlg::SMESHGUI_AddMeshElementDlg( SMESHGUI* theModule,
SMDSAbs_ElementType ElementType,
- int nbNodes )
+ int nbNodes )
: QDialog( SMESH::GetDesktop( theModule ) ),
mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
aMeshEditor->AddEdge(anArrayOfIndices.inout()); break;
case SMDSAbs_Face: {
if(myIsPoly)
- aMeshEditor->AddPolygonalFace(anArrayOfIndices.inout());
+ aMeshEditor->AddPolygonalFace(anArrayOfIndices.inout());
else
- aMeshEditor->AddFace(anArrayOfIndices.inout());
+ aMeshEditor->AddFace(anArrayOfIndices.inout());
break;
}
case SMDSAbs_Volume:
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- platform)).
- arg(myHelpFileName));
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
bool allOk = true;
for (int i = 0; i < aListId.count(); i++) {
if( const SMDS_MeshNode * n = aMesh->FindNode( aListId[ i ].toInt() ) )
- {
- newIndices.Add( n->GetID() );
- myNbOkNodes++;
- }
+ {
+ newIndices.Add( n->GetID() );
+ myNbOkNodes++;
+ }
else
- allOk = false;
+ allOk = false;
}
mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
if (myIsPoly)
{
- if ( !allOk || myElementType != SMDSAbs_Face || aListId.count() < 3 )
- myNbOkNodes = 0;
- else
- myNbOkNodes = aListId.count();
+ if ( !allOk || myElementType != SMDSAbs_Face || aListId.count() < 3 )
+ myNbOkNodes = 0;
+ else
+ myNbOkNodes = aListId.count();
}
}
void SetPosition (SMESH_Actor* theActor,
const int theType,
TVTKIds& theIds,
- const int theMode,
+ const int theMode,
const bool theReverse)
{
vtkUnstructuredGrid *aGrid = theActor->GetUnstructuredGrid();
~TElementSimulation()
{
if (FindVtkViewWindow(myApplication->activeViewManager(), myViewWindow)) {
- myVTKViewWindow->RemoveActor(myPreviewActor);
- myVTKViewWindow->RemoveActor(myFaceOrientation);
+ myVTKViewWindow->RemoveActor(myPreviewActor);
+ myVTKViewWindow->RemoveActor(myFaceOrientation);
}
myPreviewActor->Delete();
myFaceOrientation->Delete();
// purpose : constructor
//=================================================================================
SMESHGUI_AddQuadraticElementDlg::SMESHGUI_AddQuadraticElementDlg( SMESHGUI* theModule,
- const int theType )
+ const int theType )
: QDialog( SMESH::GetDesktop( theModule ) ),
mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- platform)).
- arg(myHelpFileName));
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
for (int i = 0; i < aListId.count(); i++) {
if ( const SMDS_MeshNode * n = aMesh->FindNode( aListId[ i ].toInt() ) )
{
- newIndices.Add( n->GetID() );
+ newIndices.Add( n->GetID() );
}
else
{
- allOk = false;
- break;
+ allOk = false;
+ break;
}
}
else
{
for ( int row = 0; row < myNbCorners; row++ )
- anIds.push_back( myActor->GetObject()->GetNodeVTKId( myTable->item(row, 0)->text().toInt() ) );
+ anIds.push_back( myActor->GetObject()->GetNodeVTKId( myTable->item(row, 0)->text().toInt() ) );
for ( int row = 0; row < myTable->rowCount(); row++ )
{
- anID = myTable->item(row, 1)->text().toInt(&ok);
- if (!ok) {
- anID = myTable->item(row, 0)->text().toInt();
- aDisplayMode = VTK_WIREFRAME;
- }
- anIds.push_back( myActor->GetObject()->GetNodeVTKId(anID) );
+ anID = myTable->item(row, 1)->text().toInt(&ok);
+ if (!ok) {
+ anID = myTable->item(row, 0)->text().toInt();
+ aDisplayMode = VTK_WIREFRAME;
+ }
+ anIds.push_back( myActor->GetObject()->GetNodeVTKId(anID) );
}
}
// clear table
for ( int row = 0; row < myTable->rowCount(); row++ )
for ( int col = 0; col < myTable->columnCount(); col++ )
- if ( QTableWidgetItem* aTWI = myTable->item(row, col) ) aTWI->setText("");
+ if ( QTableWidgetItem* aTWI = myTable->item(row, col) ) aTWI->setText("");
myTable->setEnabled( false );
}
if (!myMesh->_is_nil()) {
QStringList aParameters;
aParameters << (CheckBoxMerge->isChecked() ? SpinBoxTol->text() : QString(" "));
- try {
+ try {
SUIT_OverrideCursor aWaitCursor;
SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen();
// concatenate meshes
SMESH::SMESH_Mesh_var aCompoundMesh;
if(CheckBoxCommon->isChecked())
- aCompoundMesh = aSMESHGen->ConcatenateWithGroups(myMeshArray,
- !(ComboBoxUnion->currentIndex()),
- CheckBoxMerge->isChecked(),
- SpinBoxTol->GetValue());
+ aCompoundMesh = aSMESHGen->ConcatenateWithGroups(myMeshArray,
+ !(ComboBoxUnion->currentIndex()),
+ CheckBoxMerge->isChecked(),
+ SpinBoxTol->GetValue());
else
- aCompoundMesh = aSMESHGen->Concatenate(myMeshArray,
- !(ComboBoxUnion->currentIndex()),
- CheckBoxMerge->isChecked(),
- SpinBoxTol->GetValue());
+ aCompoundMesh = aSMESHGen->Concatenate(myMeshArray,
+ !(ComboBoxUnion->currentIndex()),
+ CheckBoxMerge->isChecked(),
+ SpinBoxTol->GetValue());
aCompoundMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- "application")).
- arg(myHelpFileName));
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ "application")).
+ arg(myHelpFileName));
}
}
vtkFloatingPointType aDel = aDataSet->GetLength()/2.0;
vtkFloatingPointType aDelta[2][3] = {{aDir[0][0]*aDel, aDir[0][1]*aDel, aDir[0][2]*aDel},
- {aDir[1][0]*aDel, aDir[1][1]*aDel, aDir[1][2]*aDel}};
+ {aDir[1][0]*aDel, aDir[1][1]*aDel, aDir[1][2]*aDel}};
vtkFloatingPointType aParam, aPnt0[3], aPnt1[3], aPnt2[3];
vtkFloatingPointType aPnt01[3] = {aPnt[0] - aDelta[0][0] - aDelta[1][0],
- aPnt[1] - aDelta[0][1] - aDelta[1][1],
- aPnt[2] - aDelta[0][2] - aDelta[1][2]};
+ aPnt[1] - aDelta[0][1] - aDelta[1][1],
+ aPnt[2] - aDelta[0][2] - aDelta[1][2]};
vtkFloatingPointType aPnt02[3] = {aPnt01[0] + aNormal[0],
- aPnt01[1] + aNormal[1],
- aPnt01[2] + aNormal[2]};
+ aPnt01[1] + aNormal[1],
+ aPnt01[2] + aNormal[2]};
vtkPlane::IntersectWithLine(aPnt01,aPnt02,aNormal,anOrigin,aParam,aPnt0);
vtkFloatingPointType aPnt11[3] = {aPnt[0] - aDelta[0][0] + aDelta[1][0],
- aPnt[1] - aDelta[0][1] + aDelta[1][1],
- aPnt[2] - aDelta[0][2] + aDelta[1][2]};
+ aPnt[1] - aDelta[0][1] + aDelta[1][1],
+ aPnt[2] - aDelta[0][2] + aDelta[1][2]};
vtkFloatingPointType aPnt12[3] = {aPnt11[0] + aNormal[0],
- aPnt11[1] + aNormal[1],
- aPnt11[2] + aNormal[2]};
+ aPnt11[1] + aNormal[1],
+ aPnt11[2] + aNormal[2]};
vtkPlane::IntersectWithLine(aPnt11,aPnt12,aNormal,anOrigin,aParam,aPnt1);
vtkFloatingPointType aPnt21[3] = {aPnt[0] + aDelta[0][0] - aDelta[1][0],
- aPnt[1] + aDelta[0][1] - aDelta[1][1],
- aPnt[2] + aDelta[0][2] - aDelta[1][2]};
+ aPnt[1] + aDelta[0][1] - aDelta[1][1],
+ aPnt[2] + aDelta[0][2] - aDelta[1][2]};
vtkFloatingPointType aPnt22[3] = {aPnt21[0] + aNormal[0],
- aPnt21[1] + aNormal[1],
- aPnt21[2] + aNormal[2]};
+ aPnt21[1] + aNormal[1],
+ aPnt21[2] + aNormal[2]};
vtkPlane::IntersectWithLine(aPnt21,aPnt22,aNormal,anOrigin,aParam,aPnt2);
vtkPlaneSource* aPlaneSource = aPlane->myPlaneSource;
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- platform)).
- arg(myHelpFileName));
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
Handle(SALOME_InteractiveObject) IOS = aList.First();
myActor = SMESH::FindActorByEntry(IOS->getEntry());
if (myActor) {
- std::for_each(myPlanes.begin(),myPlanes.end(),TSetVisiblity(false));
- myPlanes.clear();
-
- vtkIdType anId = 0, anEnd = myActor->GetNumberOfClippingPlanes();
- for ( ; anId < anEnd; anId++) {
- if (vtkImplicitFunction* aFunction = myActor->GetClippingPlane(anId)) {
- if(OrientedPlane* aPlane = OrientedPlane::SafeDownCast(aFunction)){
- OrientedPlane* anOrientedPlane = OrientedPlane::New(aViewWindow);
- SMESH::TVTKPlane aTVTKPlane(anOrientedPlane);
- anOrientedPlane->Delete();
- aTVTKPlane->ShallowCopy(aPlane);
- myPlanes.push_back(aTVTKPlane);
- }
- }
- }
-
- std::for_each(myPlanes.begin(),myPlanes.end(),
- TSetVisiblity(PreviewCheckBox->isChecked()));
+ std::for_each(myPlanes.begin(),myPlanes.end(),TSetVisiblity(false));
+ myPlanes.clear();
+
+ vtkIdType anId = 0, anEnd = myActor->GetNumberOfClippingPlanes();
+ for ( ; anId < anEnd; anId++) {
+ if (vtkImplicitFunction* aFunction = myActor->GetClippingPlane(anId)) {
+ if(OrientedPlane* aPlane = OrientedPlane::SafeDownCast(aFunction)){
+ OrientedPlane* anOrientedPlane = OrientedPlane::New(aViewWindow);
+ SMESH::TVTKPlane aTVTKPlane(anOrientedPlane);
+ anOrientedPlane->Delete();
+ aTVTKPlane->ShallowCopy(aPlane);
+ myPlanes.push_back(aTVTKPlane);
+ }
+ }
+ }
+
+ std::for_each(myPlanes.begin(),myPlanes.end(),
+ TSetVisiblity(PreviewCheckBox->isChecked()));
}
}
SMESH::RenderViewWindow(aViewWindow);
vtkFloatingPointType aDel = aDataSet->GetLength()/2.0;
vtkFloatingPointType aDelta[2][3] = {{aDir[0][0]*aDel, aDir[0][1]*aDel, aDir[0][2]*aDel},
- {aDir[1][0]*aDel, aDir[1][1]*aDel, aDir[1][2]*aDel}};
+ {aDir[1][0]*aDel, aDir[1][1]*aDel, aDir[1][2]*aDel}};
vtkFloatingPointType aParam, aPnt0[3], aPnt1[3], aPnt2[3];
vtkFloatingPointType aPnt01[3] = {aPnt[0] - aDelta[0][0] - aDelta[1][0],
- aPnt[1] - aDelta[0][1] - aDelta[1][1],
- aPnt[2] - aDelta[0][2] - aDelta[1][2]};
+ aPnt[1] - aDelta[0][1] - aDelta[1][1],
+ aPnt[2] - aDelta[0][2] - aDelta[1][2]};
vtkFloatingPointType aPnt02[3] = {aPnt01[0] + aNormal[0],
- aPnt01[1] + aNormal[1],
- aPnt01[2] + aNormal[2]};
+ aPnt01[1] + aNormal[1],
+ aPnt01[2] + aNormal[2]};
vtkPlane::IntersectWithLine(aPnt01,aPnt02,aNormal,anOrigin,aParam,aPnt0);
vtkFloatingPointType aPnt11[3] = {aPnt[0] - aDelta[0][0] + aDelta[1][0],
- aPnt[1] - aDelta[0][1] + aDelta[1][1],
- aPnt[2] - aDelta[0][2] + aDelta[1][2]};
+ aPnt[1] - aDelta[0][1] + aDelta[1][1],
+ aPnt[2] - aDelta[0][2] + aDelta[1][2]};
vtkFloatingPointType aPnt12[3] = {aPnt11[0] + aNormal[0],
- aPnt11[1] + aNormal[1],
- aPnt11[2] + aNormal[2]};
+ aPnt11[1] + aNormal[1],
+ aPnt11[2] + aNormal[2]};
vtkPlane::IntersectWithLine(aPnt11,aPnt12,aNormal,anOrigin,aParam,aPnt1);
vtkFloatingPointType aPnt21[3] = {aPnt[0] + aDelta[0][0] - aDelta[1][0],
- aPnt[1] + aDelta[0][1] - aDelta[1][1],
- aPnt[2] + aDelta[0][2] - aDelta[1][2]};
+ aPnt[1] + aDelta[0][1] - aDelta[1][1],
+ aPnt[2] + aDelta[0][2] - aDelta[1][2]};
vtkFloatingPointType aPnt22[3] = {aPnt21[0] + aNormal[0],
- aPnt21[1] + aNormal[1],
- aPnt21[2] + aNormal[2]};
+ aPnt21[1] + aNormal[1],
+ aPnt21[2] + aNormal[2]};
vtkPlane::IntersectWithLine(aPnt21,aPnt22,aNormal,anOrigin,aParam,aPnt2);
vtkPlaneSource* aPlaneSource = aPlane->myPlaneSource;
// used in SMESHGUI::restoreVisualParameters() to avoid
// declaration of OrientedPlane outside of SMESHGUI_ClippingDlg.cxx
static void AddPlane (SMESH_Actor* theActor,
- SVTK_ViewWindow* theViewWindow,
- SMESH::Orientation theOrientation,
- double theDistance,
- vtkFloatingPointType theAngle[2]);
+ SVTK_ViewWindow* theViewWindow,
+ SMESH::Orientation theOrientation,
+ double theDistance,
+ vtkFloatingPointType theAngle[2]);
static void GetPlaneParam (SMESH_Actor* theActor,
- int thePlaneIndex,
- SMESH::Orientation& theOrientation,
- double& theDistance,
- vtkFloatingPointType* theAngle);
+ int thePlaneIndex,
+ SMESH::Orientation& theOrientation,
+ double& theDistance,
+ vtkFloatingPointType* theAngle);
protected:
void keyPressEvent( QKeyEvent* );
{
dlg()->show();
SUIT_MessageBox::warning( myDlg,
- tr( "SMESH_WRN_WARNING" ), tr("MESH_IS_NOT_SELECTED") );
+ tr( "SMESH_WRN_WARNING" ), tr("MESH_IS_NOT_SELECTED") );
return false;
}
if( CORBA::is_nil(mesh) )
{
SUIT_MessageBox::warning( myDlg,
- tr( "SMESH_WRN_WARNING" ), tr("REF_IS_NULL") );
+ tr( "SMESH_WRN_WARNING" ), tr("REF_IS_NULL") );
return false;
}
{
bool aParam = true;
if( myDlg->IsEnabledCheck() )
- aParam = myDlg->IsMediumNdsOnGeom();
+ aParam = myDlg->IsMediumNdsOnGeom();
aEditor->ConvertToQuadratic( aParam );
aResult = true;
// Connect signals and slots
connect( myTypeGrp, SIGNAL( buttonClicked( int ) ),
- this, SLOT( onTypeChanged( int ) ) );
+ this, SLOT( onTypeChanged( int ) ) );
connect( myProjectChk, SIGNAL( toggled( bool ) ),
- this, SLOT( onProject( bool ) ) );
+ this, SLOT( onProject( bool ) ) );
connect( aSelBtn, SIGNAL( clicked() ),
- this, SLOT( onSelBtnClicked() ) );
+ this, SLOT( onSelBtnClicked() ) );
return aMainGrp;
}
// selection and SMESHGUI
connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ),
- this, SLOT( onSelectionDone() ) );
+ this, SLOT( onSelectionDone() ) );
connect( mySMESHGUI, SIGNAL( SignalDeactivateActiveDialog() ),
- this, SLOT( onDeactivate() ) );
+ this, SLOT( onDeactivate() ) );
connect( mySMESHGUI, SIGNAL( SignalCloseAllDialogs() ),
- this, SLOT( onClose() ) );
+ this, SLOT( onClose() ) );
mySwitch2d->setEnabled( theType == Type_2d );
mySwitch3d->setEnabled( theType == Type_3d );
{
if ( myGeomObj->_is_nil() ) {
SUIT_MessageBox::information( this,
- tr( "SMESH_INSUFFICIENT_DATA" ),
- tr( "SMESHGUI_INVALID_PARAMETERS" ) );
+ tr( "SMESH_INSUFFICIENT_DATA" ),
+ tr( "SMESHGUI_INVALID_PARAMETERS" ) );
return false;
}
return true;
if ( aWritten != aLen ) {
SUIT_MessageBox::information( this,
- tr( "SMESH_ERROR" ),
- tr( "ERROR_OF_SAVING" ) );
+ tr( "SMESH_ERROR" ),
+ tr( "ERROR_OF_SAVING" ) );
}
else {
//SUIT_Application::getDesktop()->setSelectionModes(ActorSelection);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
- aViewWindow->SetSelectionMode( ActorSelection );
+ aViewWindow->SetSelectionMode( ActorSelection );
disconnect( mySelectionMgr, 0, this, 0 );
disconnect( mySMESHGUI, 0, this, 0 );
mySMESHGUI->ResetState();
else {
//SUIT_Application::getDesktop()->setSelectionModes(ActorSelection);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
- aViewWindow->SetSelectionMode( ActorSelection );
+ aViewWindow->SetSelectionMode( ActorSelection );
disconnect( mySelectionMgr, 0, this, 0 );
disconnect( mySMESHGUI, 0, this, 0 );
mySMESHGUI->ResetState();
platform = "application";
#endif
SUIT_MessageBox::warning( this,
- tr( "WRN_WARNING" ),
- tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
- arg( app->resourceMgr()->stringValue( "ExternalBrowser",
- platform ) ).
- arg( myHelpFileName ) );
+ tr( "WRN_WARNING" ),
+ tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
+ arg( app->resourceMgr()->stringValue( "ExternalBrowser",
+ platform ) ).
+ arg( myHelpFileName ) );
}
}
if ( myType == Type_2d ) {
mySelectionMgr->installFilter( new SMESH_NumberFilter( "SMESH",
- TopAbs_SHAPE,
- -1,
- TopAbs_FACE ) );
+ TopAbs_SHAPE,
+ -1,
+ TopAbs_FACE ) );
}
else {
TColStd_MapOfInteger aTypes;
aTypes.Add( TopAbs_SHELL );
aTypes.Add( TopAbs_SOLID );
mySelectionMgr->installFilter( new SMESH_NumberFilter( "SMESH",
- TopAbs_FACE,
- 6,
- aTypes,
- GEOM::GEOM_Object::_nil(),
- true ) );
+ TopAbs_FACE,
+ 6,
+ aTypes,
+ GEOM::GEOM_Object::_nil(),
+ true ) );
}
}
typedef std::vector<vtkIdType> TVTKIds;
void SetPosition(SMESH_Actor* theActor,
- vtkIdType theType,
- const TVTKIds& theIds,
- bool theReset=true)
+ vtkIdType theType,
+ const TVTKIds& theIds,
+ bool theReset=true)
{
vtkUnstructuredGrid *aGrid = theActor->GetUnstructuredGrid();
myGrid->SetPoints(aGrid->GetPoints());
vtkIdList *anIds = vtkIdList::New();
for (int i = 0, iEnd = theIds.size(); i < iEnd; i++)
- anIds->InsertId(i,theIds[i]);
+ anIds->InsertId(i,theIds[i]);
myGrid->InsertNextCell(theType,anIds);
if(theIds.size()!=0){
- myGrid->InsertNextCell(theType,anIds);
- myGrid->Modified();
+ myGrid->InsertNextCell(theType,anIds);
+ myGrid->Modified();
}
-
+
anIds->Delete();
SetVisibility(true);
~TPolySimulation(){
if( myViewWindow )
- myViewWindow->RemoveActor(myPreviewActor);
+ myViewWindow->RemoveActor(myPreviewActor);
myPreviewActor->Delete();
{
case 0 :
{
- if ( myActor ){
+ if ( myActor ){
myActor->SetPointRepresentation(true);
- }
+ }
else
SMESH::SetPointRepresentation(true);
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(NodeSelection);
-
- AddButton->setEnabled(false);
- RemoveButton->setEnabled(false);
- TextLabelIds->setText( tr( "SMESH_ID_NODES" ) );
- myFacesByNodesLabel->show();
- myFacesByNodes->clear();
- myFacesByNodes->show();
- AddButton->show();
- RemoveButton->show();
- Preview->show();
- break;
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(NodeSelection);
+
+ AddButton->setEnabled(false);
+ RemoveButton->setEnabled(false);
+ TextLabelIds->setText( tr( "SMESH_ID_NODES" ) );
+ myFacesByNodesLabel->show();
+ myFacesByNodes->clear();
+ myFacesByNodes->show();
+ AddButton->show();
+ RemoveButton->show();
+ Preview->show();
+ break;
}
case 1 :
{
- if( myActor ){
- myActor->SetPointRepresentation(false);
- } else {
- SMESH::SetPointRepresentation(false);
- }
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(FaceSelection);
-
- TextLabelIds->setText( tr( "SMESH_ID_FACES" ) );
- myFacesByNodesLabel->hide();
- myFacesByNodes->hide();
- AddButton->hide();
- RemoveButton->hide();
- Preview->show();
- break;
+ if( myActor ){
+ myActor->SetPointRepresentation(false);
+ } else {
+ SMESH::SetPointRepresentation(false);
+ }
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(FaceSelection);
+
+ TextLabelIds->setText( tr( "SMESH_ID_FACES" ) );
+ myFacesByNodesLabel->hide();
+ myFacesByNodes->hide();
+ AddButton->hide();
+ RemoveButton->hide();
+ Preview->show();
+ break;
}
}
if(checkEditLine(false) == -1) {return;}
busy = true;
if (GetConstructorId() == 0)
- {
- SMESH::long_array_var anIdsOfNodes = new SMESH::long_array;
- SMESH::long_array_var aQuantities = new SMESH::long_array;
-
- aQuantities->length( myFacesByNodes->count() );
-
- TColStd_ListOfInteger aNodesIds;
-
- int aNbQuantities = 0;
- for (int i = 0; i < myFacesByNodes->count(); i++ ) {
- QStringList anIds = myFacesByNodes->item(i)->text().split( " ", QString::SkipEmptyParts );
- for (QStringList::iterator it = anIds.begin(); it != anIds.end(); ++it)
- aNodesIds.Append( (*it).toInt() );
-
- aQuantities[aNbQuantities++] = anIds.count();
- }
-
- anIdsOfNodes->length(aNodesIds.Extent());
-
- int aNbIdsOfNodes = 0;
- TColStd_ListIteratorOfListOfInteger It;
- It.Initialize(aNodesIds);
- for( ;It.More();It.Next())
- anIdsOfNodes[aNbIdsOfNodes++] = It.Value();
-
- try{
- SUIT_OverrideCursor aWaitCursor;
- SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
- aMeshEditor->AddPolyhedralVolume(anIdsOfNodes, aQuantities);
- }catch(SALOME::SALOME_Exception& exc){
- INFOS("Follow exception was cought:\n\t"<<exc.details.text);
- }catch(std::exception& exc){
- INFOS("Follow exception was cought:\n\t"<<exc.what());
- }catch(...){
- INFOS("Unknown exception was cought !!!");
- }
- }
+ {
+ SMESH::long_array_var anIdsOfNodes = new SMESH::long_array;
+ SMESH::long_array_var aQuantities = new SMESH::long_array;
+
+ aQuantities->length( myFacesByNodes->count() );
+
+ TColStd_ListOfInteger aNodesIds;
+
+ int aNbQuantities = 0;
+ for (int i = 0; i < myFacesByNodes->count(); i++ ) {
+ QStringList anIds = myFacesByNodes->item(i)->text().split( " ", QString::SkipEmptyParts );
+ for (QStringList::iterator it = anIds.begin(); it != anIds.end(); ++it)
+ aNodesIds.Append( (*it).toInt() );
+
+ aQuantities[aNbQuantities++] = anIds.count();
+ }
+
+ anIdsOfNodes->length(aNodesIds.Extent());
+
+ int aNbIdsOfNodes = 0;
+ TColStd_ListIteratorOfListOfInteger It;
+ It.Initialize(aNodesIds);
+ for( ;It.More();It.Next())
+ anIdsOfNodes[aNbIdsOfNodes++] = It.Value();
+
+ try{
+ SUIT_OverrideCursor aWaitCursor;
+ SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
+ aMeshEditor->AddPolyhedralVolume(anIdsOfNodes, aQuantities);
+ }catch(SALOME::SALOME_Exception& exc){
+ INFOS("Follow exception was cought:\n\t"<<exc.details.text);
+ }catch(std::exception& exc){
+ INFOS("Follow exception was cought:\n\t"<<exc.what());
+ }catch(...){
+ INFOS("Unknown exception was cought !!!");
+ }
+ }
else if (GetConstructorId() == 1)
- {
- SMESH::long_array_var anIdsOfFaces = new SMESH::long_array;
-
- QStringList aListId = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts );
- anIdsOfFaces->length(aListId.count());
- for ( int i = 0; i < aListId.count(); i++ )
- anIdsOfFaces[i] = aListId[i].toInt();
-
- try{
- SUIT_OverrideCursor aWaitCursor;
- SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
- aMeshEditor->AddPolyhedralVolumeByFaces(anIdsOfFaces);
- }catch(SALOME::SALOME_Exception& exc){
- INFOS("Follow exception was cought:\n\t"<<exc.details.text);
- }catch(std::exception& exc){
- INFOS("Follow exception was cought:\n\t"<<exc.what());
- }catch(...){
- INFOS("Unknown exception was cought !!!");
- }
- }
+ {
+ SMESH::long_array_var anIdsOfFaces = new SMESH::long_array;
+
+ QStringList aListId = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts );
+ anIdsOfFaces->length(aListId.count());
+ for ( int i = 0; i < aListId.count(); i++ )
+ anIdsOfFaces[i] = aListId[i].toInt();
+
+ try{
+ SUIT_OverrideCursor aWaitCursor;
+ SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
+ aMeshEditor->AddPolyhedralVolumeByFaces(anIdsOfFaces);
+ }catch(SALOME::SALOME_Exception& exc){
+ INFOS("Follow exception was cought:\n\t"<<exc.details.text);
+ }catch(std::exception& exc){
+ INFOS("Follow exception was cought:\n\t"<<exc.what());
+ }catch(...){
+ INFOS("Unknown exception was cought !!!");
+ }
+ }
//SALOME_ListIO aList;
//mySelectionMgr->setSelectedObjects( aList );
SMESH::UpdateView();
if( myActor ){
- unsigned int anEntityMode = myActor->GetEntityMode();
- myActor->SetEntityMode(SMESH_Actor::eVolumes | anEntityMode);
+ unsigned int anEntityMode = myActor->GetEntityMode();
+ myActor->SetEntityMode(SMESH_Actor::eVolumes | anEntityMode);
}
//ConstructorsClicked( GetConstructorId() );
busy = false;
ClickOnCancel();
}
-
+
//=================================================================================
// function : ClickOnCancel()
// purpose :
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- platform)).
- arg(myHelpFileName));
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
if (GetConstructorId() == 0)
{
if ( aMesh ) {
- TColStd_MapOfInteger newIndices;
+ TColStd_MapOfInteger newIndices;
- QStringList aListId = theNewText.split( " ", QString::SkipEmptyParts );
- for ( int i = 0; i < aListId.count(); i++ ) {
- const SMDS_MeshNode * n = aMesh->FindNode( aListId[ i ].toInt() );
- if ( n ) {
- newIndices.Add(n->GetID());
- myNbOkElements++;
- }
- }
+ QStringList aListId = theNewText.split( " ", QString::SkipEmptyParts );
+ for ( int i = 0; i < aListId.count(); i++ ) {
+ const SMDS_MeshNode * n = aMesh->FindNode( aListId[ i ].toInt() );
+ if ( n ) {
+ newIndices.Add(n->GetID());
+ myNbOkElements++;
+ }
+ }
- mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
+ mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->highlight( myActor->getIO(), true, true );
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->highlight( myActor->getIO(), true, true );
- if ( myNbOkElements>0 && aListId.count()>=3)
- AddButton->setEnabled(true);
- else
- AddButton->setEnabled(false);
+ if ( myNbOkElements>0 && aListId.count()>=3)
+ AddButton->setEnabled(true);
+ else
+ AddButton->setEnabled(false);
- displaySimulation();
+ displaySimulation();
}
} else if (GetConstructorId() == 1)
{
- myNbOkElements = 0;
- buttonOk->setEnabled( false );
- buttonApply->setEnabled( false );
+ myNbOkElements = 0;
+ buttonOk->setEnabled( false );
+ buttonApply->setEnabled( false );
- // check entered ids of faces and hilight them
- QStringList aListId;
- if ( aMesh ) {
- TColStd_MapOfInteger newIndices;
+ // check entered ids of faces and hilight them
+ QStringList aListId;
+ if ( aMesh ) {
+ TColStd_MapOfInteger newIndices;
- aListId = theNewText.split( " ", QString::SkipEmptyParts );
-
- for ( int i = 0; i < aListId.count(); i++ ) {
- const SMDS_MeshElement * e = aMesh->FindElement( aListId[ i ].toInt() );
- if ( e ) {
- newIndices.Add(e->GetID());
- myNbOkElements++;
- }
- }
-
- mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->highlight( myActor->getIO(), true, true );
+ aListId = theNewText.split( " ", QString::SkipEmptyParts );
+
+ for ( int i = 0; i < aListId.count(); i++ ) {
+ const SMDS_MeshElement * e = aMesh->FindElement( aListId[ i ].toInt() );
+ if ( e ) {
+ newIndices.Add(e->GetID());
+ myNbOkElements++;
+ }
+ }
+
+ mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->highlight( myActor->getIO(), true, true );
- if ( myNbOkElements ) {
- if (aListId.count()>1){
- buttonOk->setEnabled( true );
- buttonApply->setEnabled( true );
- }
- else{
- buttonOk->setEnabled( false );
- buttonApply->setEnabled( false );
- }
- if(aListId.count()>1)
- displaySimulation();
- }
- }
+ if ( myNbOkElements ) {
+ if (aListId.count()>1){
+ buttonOk->setEnabled( true );
+ buttonApply->setEnabled( true );
+ }
+ else{
+ buttonOk->setEnabled( false );
+ buttonApply->setEnabled( false );
+ }
+ if(aListId.count()>1)
+ displaySimulation();
+ }
+ }
}
busy = false;
}
case 0:{ // nodes
const SMDS_MeshNode * aNode = aMesh->FindNode( aListId[ i ].toInt() );
if( !aNode ){
- SUIT_MessageBox::warning(this,
- tr("SMESH_POLYEDRE_CREATE_ERROR"),
- tr("The incorrect indices of nodes!"));
-
- myEditCurrentArgument->clear();
- myEditCurrentArgument->setText( aString );
- return -1;
+ SUIT_MessageBox::warning(this,
+ tr("SMESH_POLYEDRE_CREATE_ERROR"),
+ tr("The incorrect indices of nodes!"));
+
+ myEditCurrentArgument->clear();
+ myEditCurrentArgument->setText( aString );
+ return -1;
}
break;
bool aElemIsOK = true;
const SMDS_MeshElement * aElem = aMesh->FindElement( aListId[ i ].toInt() );
if (!aElem)
- {
- aElemIsOK = false;
- }
+ {
+ aElemIsOK = false;
+ }
else
- {
- SMDSAbs_ElementType aType = aMesh->GetElementType( aElem->GetID(),true );
- if (aType != SMDSAbs_Face){
- aElemIsOK = false;
- }
- }
+ {
+ SMDSAbs_ElementType aType = aMesh->GetElementType( aElem->GetID(),true );
+ if (aType != SMDSAbs_Face){
+ aElemIsOK = false;
+ }
+ }
if (!aElemIsOK){
- SUIT_MessageBox::warning(this,
- tr("SMESH_POLYEDRE_CREATE_ERROR"),
- tr("The incorrect indices of faces!"));
-
- myEditCurrentArgument->clear();
- myEditCurrentArgument->setText( aString );
- return -1;
+ SUIT_MessageBox::warning(this,
+ tr("SMESH_POLYEDRE_CREATE_ERROR"),
+ tr("The incorrect indices of faces!"));
+
+ myEditCurrentArgument->clear();
+ myEditCurrentArgument->setText( aString );
+ return -1;
}
break;
}
vtkIdType aType = VTK_CONVEX_POINT_SET;
SMDS_Mesh* aMesh = 0;
if ( myActor ){
- aMesh = myActor->GetObject()->GetMesh();
+ aMesh = myActor->GetObject()->GetMesh();
}
if (GetConstructorId() == 0 && aMesh){
- if (!AddButton->isEnabled()){
- mySimulation->ResetGrid(true);
- for (int i = 0; i < myFacesByNodes->count(); i++) {
- QStringList anIds = myFacesByNodes->item(i)->text().split( " ", QString::SkipEmptyParts );
- SMESH::TPolySimulation::TVTKIds aVTKIds_faces;
- for (QStringList::iterator it = anIds.begin(); it != anIds.end(); ++it){
- const SMDS_MeshNode* aNode = aMesh->FindNode( (*it).toInt() );
- if (!aNode) continue;
- vtkIdType aId = myActor->GetObject()->GetNodeVTKId( (*it).toInt() );
- aVTKIds.push_back(aId);
- aVTKIds_faces.push_back(aId);
- }
- if(!Preview->isChecked()){
- aType = VTK_POLYGON;
- mySimulation->SetPosition(myActor, aType, aVTKIds_faces,false);
- }
- }
- if(myFacesByNodes->count() == 0){
- mySimulation->SetVisibility(false);
- } else {
- mySimulation->SetVisibility(true);
- }
- if(Preview->isChecked()){
- mySimulation->SetPosition(myActor, aType, aVTKIds);
- }
- } else {
- // add ids from edit line
- QStringList anEditIds = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts );
- for ( int i = 0; i < anEditIds.count(); i++ )
- aVTKIds.push_back( myActor->GetObject()->GetNodeVTKId( anEditIds[ i ].toInt() ));
- aType = VTK_POLYGON;
- mySimulation->SetPosition(myActor, aType, aVTKIds);
- }
+ if (!AddButton->isEnabled()){
+ mySimulation->ResetGrid(true);
+ for (int i = 0; i < myFacesByNodes->count(); i++) {
+ QStringList anIds = myFacesByNodes->item(i)->text().split( " ", QString::SkipEmptyParts );
+ SMESH::TPolySimulation::TVTKIds aVTKIds_faces;
+ for (QStringList::iterator it = anIds.begin(); it != anIds.end(); ++it){
+ const SMDS_MeshNode* aNode = aMesh->FindNode( (*it).toInt() );
+ if (!aNode) continue;
+ vtkIdType aId = myActor->GetObject()->GetNodeVTKId( (*it).toInt() );
+ aVTKIds.push_back(aId);
+ aVTKIds_faces.push_back(aId);
+ }
+ if(!Preview->isChecked()){
+ aType = VTK_POLYGON;
+ mySimulation->SetPosition(myActor, aType, aVTKIds_faces,false);
+ }
+ }
+ if(myFacesByNodes->count() == 0){
+ mySimulation->SetVisibility(false);
+ } else {
+ mySimulation->SetVisibility(true);
+ }
+ if(Preview->isChecked()){
+ mySimulation->SetPosition(myActor, aType, aVTKIds);
+ }
+ } else {
+ // add ids from edit line
+ QStringList anEditIds = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts );
+ for ( int i = 0; i < anEditIds.count(); i++ )
+ aVTKIds.push_back( myActor->GetObject()->GetNodeVTKId( anEditIds[ i ].toInt() ));
+ aType = VTK_POLYGON;
+ mySimulation->SetPosition(myActor, aType, aVTKIds);
+ }
}else if(GetConstructorId() == 1 && aMesh){
- QStringList aListId = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts );
- for ( int i = 0; i < aListId.count(); i++ )
- {
- const SMDS_MeshElement * anElem = aMesh->FindElement( aListId[ i ].toInt() );
- if ( !anElem ) continue;
- SMDSAbs_ElementType aFaceType = aMesh->GetElementType( anElem->GetID(),true );
- if (aFaceType != SMDSAbs_Face) continue;
-
- SMDS_ElemIteratorPtr anIter = anElem->nodesIterator();
- SMESH::TPolySimulation::TVTKIds aVTKIds_faces;
- while( anIter->more() )
- if ( const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next() ){
- vtkIdType aId = myActor->GetObject()->GetNodeVTKId( aNode->GetID() );
- aVTKIds.push_back(aId);
- aVTKIds_faces.push_back(aId);
- }
- if(!Preview->isChecked()){
- aType = VTK_POLYGON;
- mySimulation->SetPosition(myActor, aType, aVTKIds_faces);
- }
- }
- if(Preview->isChecked())
- mySimulation->SetPosition(myActor, aType, aVTKIds);
+ QStringList aListId = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts );
+ for ( int i = 0; i < aListId.count(); i++ )
+ {
+ const SMDS_MeshElement * anElem = aMesh->FindElement( aListId[ i ].toInt() );
+ if ( !anElem ) continue;
+ SMDSAbs_ElementType aFaceType = aMesh->GetElementType( anElem->GetID(),true );
+ if (aFaceType != SMDSAbs_Face) continue;
+
+ SMDS_ElemIteratorPtr anIter = anElem->nodesIterator();
+ SMESH::TPolySimulation::TVTKIds aVTKIds_faces;
+ while( anIter->more() )
+ if ( const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next() ){
+ vtkIdType aId = myActor->GetObject()->GetNodeVTKId( aNode->GetID() );
+ aVTKIds.push_back(aId);
+ aVTKIds_faces.push_back(aId);
+ }
+ if(!Preview->isChecked()){
+ aType = VTK_POLYGON;
+ mySimulation->SetPosition(myActor, aType, aVTKIds_faces);
+ }
+ }
+ if(Preview->isChecked())
+ mySimulation->SetPosition(myActor, aType, aVTKIds);
}
SMESH::UpdateView();
}
{
if (myListBox->count() == 0) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
- tr("NO_SELECTED_GROUPS"));
+ tr("NO_SELECTED_GROUPS"));
return false;
}
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- platform)).
- arg(myHelpFileName));
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
SUIT_ViewWindow* wnd = vtk_viewer->getViewManager()->getActiveView();
SMESH_Actor* anActor = SMESH::FindActorByEntry( wnd, entry.toLatin1().data() );
if( !anActor )
- anActor = SMESH::CreateActor( study()->studyDS(), entry.toLatin1().data(), true );
+ anActor = SMESH::CreateActor( study()->studyDS(), entry.toLatin1().data(), true );
if( anActor )
{
- SMESH::DisplayActor( wnd, anActor );
+ SMESH::DisplayActor( wnd, anActor );
prs = LightApp_Displayer::buildPresentation( entry.toLatin1().data(), aViewFrame );
}
if( prs )
- UpdatePrs( prs );
+ UpdatePrs( prs );
else if( anActor )
- SMESH::RemoveActor( vtk_viewer->getViewManager()->getActiveView(), anActor );
+ SMESH::RemoveActor( vtk_viewer->getViewManager()->getActiveView(), anActor );
}
}
}
void SetPointsData ( SMDS_Mesh* theMesh,
- TColStd_MapOfInteger & theNodesIdMap )
+ TColStd_MapOfInteger & theNodesIdMap )
{
vtkPoints* aPoints = vtkPoints::New();
aPoints->SetNumberOfPoints(theNodesIdMap.Extent());
TColStd_MapIteratorOfMapOfInteger idIter( theNodesIdMap );
for( int i = 0; idIter.More(); idIter.Next(), i++ ) {
- const SMDS_MeshNode* aNode = theMesh->FindNode(idIter.Key());
- aPoints->SetPoint( i, aNode->X(), aNode->Y(), aNode->Z() );
- myIDs.push_back(idIter.Key());
+ const SMDS_MeshNode* aNode = theMesh->FindNode(idIter.Key());
+ aPoints->SetPoint( i, aNode->X(), aNode->Y(), aNode->Z() );
+ myIDs.push_back(idIter.Key());
}
myIdGrid->SetPoints(aPoints);
}
void SetElemsData( TColStd_MapOfInteger & theElemsIdMap,
- std::list<gp_XYZ> & aGrCentersXYZ )
+ std::list<gp_XYZ> & aGrCentersXYZ )
{
vtkPoints* aPoints = vtkPoints::New();
aPoints->SetNumberOfPoints(theElemsIdMap.Extent());
TColStd_MapIteratorOfMapOfInteger idIter( theElemsIdMap );
for( ; idIter.More(); idIter.Next() ) {
- myIDs.push_back(idIter.Key());
+ myIDs.push_back(idIter.Key());
}
gp_XYZ aXYZ;
std::list<gp_XYZ>::iterator coordIt = aGrCentersXYZ.begin();
for( int i = 0; coordIt != aGrCentersXYZ.end(); coordIt++, i++ ) {
- aXYZ = *coordIt;
- aPoints->SetPoint( i, aXYZ.X(), aXYZ.Y(), aXYZ.Z() );
+ aXYZ = *coordIt;
+ aPoints->SetPoint( i, aXYZ.X(), aXYZ.Y(), aXYZ.Z() );
}
myIdGrid->SetPoints(aPoints);
aPoints->Delete();
myIsPointsLabeled = theIsPointsLabeled && myIdGrid->GetNumberOfPoints();
if ( myIsPointsLabeled ) {
- myPointsNumDataSet->ShallowCopy(myIdGrid);
- vtkDataSet *aDataSet = myPointsNumDataSet;
- int aNbElem = myIDs.size();
- vtkIntArray *anArray = vtkIntArray::New();
- anArray->SetNumberOfValues( aNbElem );
- for ( int i = 0; i < aNbElem; i++ )
- anArray->SetValue( i, myIDs[i] );
- aDataSet->GetPointData()->SetScalars( anArray );
- anArray->Delete();
- myPtsMaskPoints->SetInput( aDataSet );
- myPointLabels->SetVisibility( theIsActorVisible );
+ myPointsNumDataSet->ShallowCopy(myIdGrid);
+ vtkDataSet *aDataSet = myPointsNumDataSet;
+ int aNbElem = myIDs.size();
+ vtkIntArray *anArray = vtkIntArray::New();
+ anArray->SetNumberOfValues( aNbElem );
+ for ( int i = 0; i < aNbElem; i++ )
+ anArray->SetValue( i, myIDs[i] );
+ aDataSet->GetPointData()->SetScalars( anArray );
+ anArray->Delete();
+ myPtsMaskPoints->SetInput( aDataSet );
+ myPointLabels->SetVisibility( theIsActorVisible );
}
else {
- myPointLabels->SetVisibility( false );
+ myPointLabels->SetVisibility( false );
}
}
//myPtsSelectVisiblePoints->UnRegisterAllOutputs(); //vtk 5.0 porting
myPtsSelectVisiblePoints->Delete();
- //myPtsMaskPoints->UnRegisterAllOutputs(); //vtk 5.0 porting
+ //myPtsMaskPoints->UnRegisterAllOutputs(); //vtk 5.0 porting
myPtsMaskPoints->Delete();
myPointLabels->Delete();
static const char * IconFirst[] = {
"18 10 2 1",
-" g None",
-". g #000000",
+" g None",
+". g #000000",
" . . ",
" .. .. .. ",
" .. ... ... ",
// purpose :
//=================================================================================
SMESHGUI_EditMeshDlg::SMESHGUI_EditMeshDlg (SMESHGUI* theModule,
- int theAction)
+ int theAction)
: QDialog(SMESH::GetDesktop(theModule)),
mySMESHGUI(theModule),
mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
/***************************************************************/
GroupConstructors = new QGroupBox(myAction == 1 ?
- tr("SMESH_MERGE_ELEMENTS") :
- tr("SMESH_MERGE_NODES"),
- this);
+ tr("SMESH_MERGE_ELEMENTS") :
+ tr("SMESH_MERGE_NODES"),
+ this);
QButtonGroup* ButtonGroup = new QButtonGroup(this);
QHBoxLayout* GroupConstructorsLayout = new QHBoxLayout(GroupConstructors);
/***************************************************************/
// Controls for coincident elements detecting
GroupCoincident = new QGroupBox(myAction == 1 ?
- tr("COINCIDENT_ELEMENTS") :
- tr("COINCIDENT_NODES"),
- this);
+ tr("COINCIDENT_ELEMENTS") :
+ tr("COINCIDENT_NODES"),
+ this);
QGridLayout* GroupCoincidentLayout = new QGridLayout(GroupCoincident);
GroupCoincidentLayout->setSpacing(SPACING);
// purpose :
//=================================================================================
void SMESHGUI_EditMeshDlg::FindGravityCenter(TColStd_MapOfInteger & theElemsIdMap,
- std::list< gp_XYZ > & theGrCentersXYZ)
+ std::list< gp_XYZ > & theGrCentersXYZ)
{
if (!myActor)
return;
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- platform)).
- arg(myHelpFileName));
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
switch (myAction) {
case 0 :
if(!mySubMeshOrGroup->_is_nil())
- aMeshEditor->FindCoincidentNodesOnPart(mySubMeshOrGroup, SpinBoxTolerance->GetValue(), aGroupsArray);
+ aMeshEditor->FindCoincidentNodesOnPart(mySubMeshOrGroup, SpinBoxTolerance->GetValue(), aGroupsArray);
else
- aMeshEditor->FindCoincidentNodes(SpinBoxTolerance->GetValue(), aGroupsArray);
+ aMeshEditor->FindCoincidentNodes(SpinBoxTolerance->GetValue(), aGroupsArray);
break;
case 1 :
if(!mySubMeshOrGroup->_is_nil())
- aMeshEditor->FindEqualElements(mySubMeshOrGroup, aGroupsArray);
+ aMeshEditor->FindEqualElements(mySubMeshOrGroup, aGroupsArray);
else
- aMeshEditor->FindEqualElements(myMesh, aGroupsArray);
+ aMeshEditor->FindEqualElements(myMesh, aGroupsArray);
break;
}
QStringList anIDs;
for (int j = 0; j < aGroup.length(); j++)
- anIDs.append(QString::number(aGroup[j]));
+ anIDs.append(QString::number(aGroup[j]));
ListCoincident->addItem(anIDs.join(" "));
}
if (myAction == 0) {
SMESH::SetPointRepresentation(true);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(NodeSelection);
+ aViewWindow->SetSelectionMode(NodeSelection);
}
else
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(CellSelection);
+ aViewWindow->SetSelectionMode(CellSelection);
}
}
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject()));
connect(ElementsLineEdit, SIGNAL(textChanged(const QString&)),
- SLOT(onTextChange(const QString&)));
+ SLOT(onTextChange(const QString&)));
connect(StartPointLineEdit, SIGNAL(textChanged(const QString&)),
- SLOT(onTextChange(const QString&)));
+ SLOT(onTextChange(const QString&)));
connect(MeshCheck, SIGNAL(toggled(bool)), SLOT(onSelectMesh()));
SMESH::SetPointRepresentation(false);
if (MeshCheck->isChecked()) {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(ActorSelection);
+ aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(myElementsFilter);
} else {
if (type == 0)
- {
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(EdgeSelection);
- }
+ {
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(EdgeSelection);
+ }
if (type == 1)
- {
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(FaceSelection);
- }
+ {
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(FaceSelection);
+ }
}
}
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
bool bOk;
int j = 0;
for (int i = 0; i < aListElementsId.count(); i++) {
- long ind = aListElementsId[ i ].toLong(&bOk);
- if (bOk) {
- const SMDS_MeshElement* e = aMesh->FindElement(ind);
- if (e) {
- bool typeMatch = Elements1dRB->isChecked() && e->GetType() == SMDSAbs_Edge ||
- Elements2dRB->isChecked() && e->GetType() == SMDSAbs_Face;
- if (typeMatch)
- anElementsId[ j++ ] = ind;
- }
- }
+ long ind = aListElementsId[ i ].toLong(&bOk);
+ if (bOk) {
+ const SMDS_MeshElement* e = aMesh->FindElement(ind);
+ if (e) {
+ bool typeMatch = Elements1dRB->isChecked() && e->GetType() == SMDSAbs_Edge ||
+ Elements2dRB->isChecked() && e->GetType() == SMDSAbs_Face;
+ if (typeMatch)
+ anElementsId[ j++ ] = ind;
+ }
+ }
}
anElementsId->length(j);
}
/*
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) {
if( MeshCheck->isChecked() ) {
- if( GetConstructorId() == 0 )
- SMESH::ListOfGroups_var groups =
- aMeshEditor->ExtrusionAlongPathObject1DMakeGroups(myIDSource, myPathMesh,
- myPathShape, aNodeStart,
- AnglesGrp->isChecked(), anAngles,
- BasePointGrp->isChecked(), aBasePoint, retVal);
- else
- SMESH::ListOfGroups_var groups =
- aMeshEditor->ExtrusionAlongPathObject2DMakeGroups(myIDSource, myPathMesh,
- myPathShape, aNodeStart,
- AnglesGrp->isChecked(), anAngles,
- BasePointGrp->isChecked(), aBasePoint, retVal);
+ if( GetConstructorId() == 0 )
+ SMESH::ListOfGroups_var groups =
+ aMeshEditor->ExtrusionAlongPathObject1DMakeGroups(myIDSource, myPathMesh,
+ myPathShape, aNodeStart,
+ AnglesGrp->isChecked(), anAngles,
+ BasePointGrp->isChecked(), aBasePoint, retVal);
+ else
+ SMESH::ListOfGroups_var groups =
+ aMeshEditor->ExtrusionAlongPathObject2DMakeGroups(myIDSource, myPathMesh,
+ myPathShape, aNodeStart,
+ AnglesGrp->isChecked(), anAngles,
+ BasePointGrp->isChecked(), aBasePoint, retVal);
}
else
- SMESH::ListOfGroups_var groups =
- aMeshEditor->ExtrusionAlongPathMakeGroups(anElementsId, myPathMesh,
- myPathShape, aNodeStart,
- AnglesGrp->isChecked(), anAngles,
- BasePointGrp->isChecked(), aBasePoint, retVal);
+ SMESH::ListOfGroups_var groups =
+ aMeshEditor->ExtrusionAlongPathMakeGroups(anElementsId, myPathMesh,
+ myPathShape, aNodeStart,
+ AnglesGrp->isChecked(), anAngles,
+ BasePointGrp->isChecked(), aBasePoint, retVal);
}
else {
if( MeshCheck->isChecked() ) {
- if( GetConstructorId() == 0 )
- retVal = aMeshEditor->ExtrusionAlongPathObject1D(myIDSource, myPathMesh,
- myPathShape, aNodeStart,
- AnglesGrp->isChecked(), anAngles,
- BasePointGrp->isChecked(), aBasePoint);
- else
- retVal = aMeshEditor->ExtrusionAlongPathObject2D(myIDSource, myPathMesh,
- myPathShape, aNodeStart,
- AnglesGrp->isChecked(), anAngles,
- BasePointGrp->isChecked(), aBasePoint);
+ if( GetConstructorId() == 0 )
+ retVal = aMeshEditor->ExtrusionAlongPathObject1D(myIDSource, myPathMesh,
+ myPathShape, aNodeStart,
+ AnglesGrp->isChecked(), anAngles,
+ BasePointGrp->isChecked(), aBasePoint);
+ else
+ retVal = aMeshEditor->ExtrusionAlongPathObject2D(myIDSource, myPathMesh,
+ myPathShape, aNodeStart,
+ AnglesGrp->isChecked(), anAngles,
+ BasePointGrp->isChecked(), aBasePoint);
}
else
- retVal = aMeshEditor->ExtrusionAlongPath(anElementsId, myPathMesh,
- myPathShape, aNodeStart,
- AnglesGrp->isChecked(), anAngles,
- BasePointGrp->isChecked(), aBasePoint);
+ retVal = aMeshEditor->ExtrusionAlongPath(anElementsId, myPathMesh,
+ myPathShape, aNodeStart,
+ AnglesGrp->isChecked(), anAngles,
+ BasePointGrp->isChecked(), aBasePoint);
}
*/
ElemType = SMESH::EDGE;
if( !MeshCheck->isChecked() ) {
SMESH::ListOfGroups_var groups =
- aMeshEditor->ExtrusionAlongPathX(anElementsId, myPath, aNodeStart, AnglesGrp->isChecked(),
- anAngles, LinearAnglesCheck->isChecked(),
- BasePointGrp->isChecked(), aBasePoint,
- NeedGroups, ElemType, retVal);
+ aMeshEditor->ExtrusionAlongPathX(anElementsId, myPath, aNodeStart, AnglesGrp->isChecked(),
+ anAngles, LinearAnglesCheck->isChecked(),
+ BasePointGrp->isChecked(), aBasePoint,
+ NeedGroups, ElemType, retVal);
}
else {
SMESH::ListOfGroups_var groups =
- aMeshEditor->ExtrusionAlongPathObjX(myIDSource, myPath, aNodeStart, AnglesGrp->isChecked(),
- anAngles, LinearAnglesCheck->isChecked(),
- BasePointGrp->isChecked(), aBasePoint,
- NeedGroups, ElemType, retVal);
+ aMeshEditor->ExtrusionAlongPathObjX(myIDSource, myPath, aNodeStart, AnglesGrp->isChecked(),
+ anAngles, LinearAnglesCheck->isChecked(),
+ BasePointGrp->isChecked(), aBasePoint,
+ NeedGroups, ElemType, retVal);
}
switch (retVal) {
case SMESH::SMESH_MeshEditor::EXTR_NO_ELEMENTS:
SUIT_MessageBox::warning(this,
- tr("SMESH_ERROR"),
- tr("NO_ELEMENTS_SELECTED"));
+ tr("SMESH_ERROR"),
+ tr("NO_ELEMENTS_SELECTED"));
return false; break;
case SMESH::SMESH_MeshEditor::EXTR_PATH_NOT_EDGE:
SUIT_MessageBox::warning(this,
- tr("SMESH_ERROR"),
- tr("SELECTED_PATH_IS_NOT_EDGE"));
+ tr("SMESH_ERROR"),
+ tr("SELECTED_PATH_IS_NOT_EDGE"));
return false; break;
case SMESH::SMESH_MeshEditor::EXTR_BAD_PATH_SHAPE:
SUIT_MessageBox::warning(this,
- tr("SMESH_ERROR"),
- tr("BAD_SHAPE_TYPE"));
+ tr("SMESH_ERROR"),
+ tr("BAD_SHAPE_TYPE"));
return false; break;
case SMESH::SMESH_MeshEditor::EXTR_BAD_STARTING_NODE:
SUIT_MessageBox::warning(this,
- tr("SMESH_ERROR"),
- tr("EXTR_BAD_STARTING_NODE"));
+ tr("SMESH_ERROR"),
+ tr("EXTR_BAD_STARTING_NODE"));
return false; break;
case SMESH::SMESH_MeshEditor::EXTR_BAD_ANGLES_NUMBER:
SUIT_MessageBox::warning(this,
- tr("SMESH_ERROR"),
- tr("WRONG_ANGLES_NUMBER"));
+ tr("SMESH_ERROR"),
+ tr("WRONG_ANGLES_NUMBER"));
return false; break;
case SMESH::SMESH_MeshEditor::EXTR_CANT_GET_TANGENT:
SUIT_MessageBox::warning(this,
- tr("SMESH_ERROR"),
- tr("CANT_GET_TANGENT"));
+ tr("SMESH_ERROR"),
+ tr("CANT_GET_TANGENT"));
return false; break;
case SMESH::SMESH_MeshEditor::EXTR_OK:
break;
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- platform)).
- arg(myHelpFileName));
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
const Handle(SALOME_InteractiveObject)& anIO = myMeshActor->getIO();
TColStd_MapOfInteger newIndices;
for (int i = 0; i < aListId.count(); i++) {
- long ind = aListId[ i ].toLong(&bOk);
- if (bOk) {
- const SMDS_MeshElement* e = aMesh->FindElement(ind);
- if (e) {
- // check also type of element
- bool typeMatch = Elements1dRB->isChecked() && e->GetType() == SMDSAbs_Edge ||
- Elements2dRB->isChecked() && e->GetType() == SMDSAbs_Face;
- if (typeMatch)
- newIndices.Add(e->GetID());
- }
- }
+ long ind = aListId[ i ].toLong(&bOk);
+ if (bOk) {
+ const SMDS_MeshElement* e = aMesh->FindElement(ind);
+ if (e) {
+ // check also type of element
+ bool typeMatch = Elements1dRB->isChecked() && e->GetType() == SMDSAbs_Edge ||
+ Elements2dRB->isChecked() && e->GetType() == SMDSAbs_Face;
+ if (typeMatch)
+ newIndices.Add(e->GetID());
+ }
+ }
}
mySelector->AddOrRemoveIndex(anIO, newIndices, false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->highlight( anIO, true, true );
+ aViewWindow->highlight( anIO, true, true );
}
}
else if (send == StartPointLineEdit &&
SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPath);
SMDS_Mesh* aMesh = 0;
if (aPathActor)
- aMesh = aPathActor->GetObject()->GetMesh();
+ aMesh = aPathActor->GetObject()->GetMesh();
if (aMesh) {
- //mySelectionMgr->clearSelected();
- //mySelectionMgr->AddIObject(aPathActor->getIO());
+ //mySelectionMgr->clearSelected();
+ //mySelectionMgr->AddIObject(aPathActor->getIO());
SALOME_ListIO aList;
aList.Append(aPathActor->getIO());
mySelectionMgr->setSelectedObjects(aList, false);
- bool bOk;
- long ind = theNewText.toLong(&bOk);
- if (bOk) {
- const SMDS_MeshNode* n = aMesh->FindNode(ind);
- if (n) {
- //if (!mySelectionMgr->IsIndexSelected(aPathActor->getIO(), n->GetID())) {
+ bool bOk;
+ long ind = theNewText.toLong(&bOk);
+ if (bOk) {
+ const SMDS_MeshNode* n = aMesh->FindNode(ind);
+ if (n) {
+ //if (!mySelectionMgr->IsIndexSelected(aPathActor->getIO(), n->GetID())) {
TColStd_MapOfInteger newIndices;
- newIndices.Add(n->GetID());
- mySelector->AddOrRemoveIndex( aPathActor->getIO(), newIndices, false );
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->highlight( aPathActor->getIO(), true, true );
- }
- }
+ newIndices.Add(n->GetID());
+ mySelector->AddOrRemoveIndex( aPathActor->getIO(), newIndices, false );
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->highlight( aPathActor->getIO(), true, true );
+ }
+ }
}
}
}
TopoDS_Vertex aVertex;
if (!aGeomObj->_is_nil()) {
if (aGeomObj->IsShape() && GEOMBase::GetShape(aGeomObj, aVertex) && !aVertex.IsNull()) {
- gp_Pnt aPnt = BRep_Tool::Pnt(aVertex);
- XSpin->SetValue(aPnt.X());
- YSpin->SetValue(aPnt.Y());
- ZSpin->SetValue(aPnt.Z());
+ gp_Pnt aPnt = BRep_Tool::Pnt(aVertex);
+ XSpin->SetValue(aPnt.X());
+ YSpin->SetValue(aPnt.Y());
+ ZSpin->SetValue(aPnt.Z());
}
return;
}
SMESH::SetPointRepresentation(false);
if (MeshCheck->isChecked()) {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(ActorSelection);
+ aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(myElementsFilter);
} else {
if (Elements1dRB->isChecked())
- {
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(EdgeSelection);
- }
+ {
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(EdgeSelection);
+ }
else if (Elements2dRB->isChecked())
- {
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(FaceSelection);
- }
+ {
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(FaceSelection);
+ }
}
} else if (button == SelectPathMeshButton) {
myEditCurrentArgument = PathMeshLineEdit;
if (!myPath->_is_nil()) {
SMESH_Actor* aPathActor = SMESH::FindActorByObject(myPath);
if (aPathActor) {
- SMESH::SetPointRepresentation(true);
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(NodeSelection);
- SMESH::SetPickable(aPathActor);
+ SMESH::SetPointRepresentation(true);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(NodeSelection);
+ SMESH::SetPickable(aPathActor);
}
}
}
QKeyEvent* ke = (QKeyEvent*)event;
if (object == AnglesList) {
if (ke->key() == Qt::Key_Delete)
- OnAngleRemoved();
+ OnAngleRemoved();
}
}
else if (event->type() == QEvent::FocusIn) {
if (object == ElementsLineEdit) {
if (myEditCurrentArgument != ElementsLineEdit)
- SetEditCurrentArgument(SelectElementsButton);
+ SetEditCurrentArgument(SelectElementsButton);
}
else if (object == StartPointLineEdit) {
if (myEditCurrentArgument != StartPointLineEdit)
- SetEditCurrentArgument(SelectStartPointButton);
+ SetEditCurrentArgument(SelectStartPointButton);
}
else if (object == XSpin->editor() || object == YSpin->editor() || object == ZSpin->editor()) {
if (myEditCurrentArgument != XSpin)
- SetEditCurrentArgument(SelectBasePointButton);
+ SetEditCurrentArgument(SelectBasePointButton);
}
}
return QDialog::eventFilter(object, event);
{
if(myMesh->_is_nil()) {
SUIT_MessageBox::critical(this,
- tr("SMESH_ERROR"),
- tr("NO_MESH_SELECTED"));
+ tr("SMESH_ERROR"),
+ tr("NO_MESH_SELECTED"));
return;
}
if ( !myFilterDlg )
enableLinear = false;
anItem->text().toDouble(&enableLinear);
if( !enableLinear )
- break;
+ break;
}
}
if( !enableLinear )
{
GroupArguments->setTitle(tr("EXTRUSION_1D"));
if (!CheckBoxMesh->isChecked())
- {
- LineEditElements->clear();
- myIDs.clear();
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(EdgeSelection);
- }
+ {
+ LineEditElements->clear();
+ myIDs.clear();
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(EdgeSelection);
+ }
break;
}
case 1:
{
GroupArguments->setTitle(tr("EXTRUSION_2D"));
if (!CheckBoxMesh->isChecked())
- {
- LineEditElements->clear();
- myIDs.clear();
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(FaceSelection);
- }
+ {
+ LineEditElements->clear();
+ myIDs.clear();
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(FaceSelection);
+ }
break;
}
}
aParameters << SpinBox_Dz->text();
} else if ( RadioButton4->isChecked() ) {
gp_XYZ aNormale(SpinBox_Vx->GetValue(),
- SpinBox_Vy->GetValue(),
- SpinBox_Vz->GetValue());
+ SpinBox_Vy->GetValue(),
+ SpinBox_Vz->GetValue());
aNormale /= aNormale.Modulus();
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) {
if( CheckBoxMesh->isChecked() ) {
- if( GetConstructorId() == 0 )
- SMESH::ListOfGroups_var groups =
- aMeshEditor->ExtrusionSweepObject1DMakeGroups(mySelectedObject, aVector, aNbSteps);
- else
- SMESH::ListOfGroups_var groups =
- aMeshEditor->ExtrusionSweepObject2DMakeGroups(mySelectedObject, aVector, aNbSteps);
- }
- else
- SMESH::ListOfGroups_var groups =
- aMeshEditor->ExtrusionSweepMakeGroups(myElementsId.inout(), aVector, aNbSteps);
+ if( GetConstructorId() == 0 )
+ SMESH::ListOfGroups_var groups =
+ aMeshEditor->ExtrusionSweepObject1DMakeGroups(mySelectedObject, aVector, aNbSteps);
+ else
+ SMESH::ListOfGroups_var groups =
+ aMeshEditor->ExtrusionSweepObject2DMakeGroups(mySelectedObject, aVector, aNbSteps);
+ }
+ else
+ SMESH::ListOfGroups_var groups =
+ aMeshEditor->ExtrusionSweepMakeGroups(myElementsId.inout(), aVector, aNbSteps);
}
else {
- if( CheckBoxMesh->isChecked() ) {
- if( GetConstructorId() == 0 )
- aMeshEditor->ExtrusionSweepObject1D(mySelectedObject, aVector, aNbSteps);
- else
- aMeshEditor->ExtrusionSweepObject2D(mySelectedObject, aVector, aNbSteps);
- }
- else
- aMeshEditor->ExtrusionSweep(myElementsId.inout(), aVector, aNbSteps);
+ if( CheckBoxMesh->isChecked() ) {
+ if( GetConstructorId() == 0 )
+ aMeshEditor->ExtrusionSweepObject1D(mySelectedObject, aVector, aNbSteps);
+ else
+ aMeshEditor->ExtrusionSweepObject2D(mySelectedObject, aVector, aNbSteps);
+ }
+ else
+ aMeshEditor->ExtrusionSweep(myElementsId.inout(), aVector, aNbSteps);
}
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- platform)).
- arg(myHelpFileName));
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
myElementsId->length( myNbOkElements = newIndices.Extent() );
mySelector->AddOrRemoveIndex(myIO, newIndices, false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->highlight( myIO, true, true );
+ aViewWindow->highlight( myIO, true, true );
}
}
aNbElements = aMapIndex.Extent();
if (aNbElements < 1)
- return;
+ return;
myElementsId = new SMESH::long_array;
myElementsId->length( aNbElements );
myEditCurrentArgument = (QWidget*)LineEditElements;
if (CheckBoxMesh->isChecked()) {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(ActorSelection);
+ aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
} else {
int aConstructorId = GetConstructorId();
if (aConstructorId == 0)
- {
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(EdgeSelection);
- }
+ {
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(EdgeSelection);
+ }
else if (aConstructorId == 1)
- {
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(FaceSelection);
- }
+ {
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(FaceSelection);
+ }
}
}
else if (send == SelectVectorButton){
int aConstructorId = GetConstructorId();
if (aConstructorId == 0)
{
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(EdgeSelection);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(EdgeSelection);
}
else if (aConstructorId == 1)
{
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(FaceSelection);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(FaceSelection);
}
LineEditElements->setReadOnly(false);
{
if(myMesh->_is_nil()) {
SUIT_MessageBox::critical(this,
- tr("SMESH_ERROR"),
- tr("NO_MESH_SELECTED"));
+ tr("SMESH_ERROR"),
+ tr("NO_MESH_SELECTED"));
return;
}
if ( !myFilterDlg )
if (aWg->isEnabled() && aWg->validator()->validate(aText, p) != QValidator::Acceptable) {
if (theMsg)
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
- tr("SMESHGUI_INVALID_PARAMETERS"));
+ tr("SMESHGUI_INVALID_PARAMETERS"));
return false;
}
}
~ComboDelegate();
QWidget* createEditor( QWidget*, const QStyleOptionViewItem&,
- const QModelIndex& ) const;
+ const QModelIndex& ) const;
void setEditorData( QWidget*, const QModelIndex& ) const;
void setModelData( QWidget*, QAbstractItemModel*, const QModelIndex& ) const;
void updateEditorGeometry( QWidget*, const QStyleOptionViewItem&,
- const QModelIndex& ) const;
+ const QModelIndex& ) const;
private:
QTableWidget* myTable;
};
}
QWidget* SMESHGUI_FilterTable::ComboDelegate::createEditor( QWidget* parent,
- const QStyleOptionViewItem& option,
- const QModelIndex& index ) const
+ const QStyleOptionViewItem& option,
+ const QModelIndex& index ) const
{
QStringList l = index.data( Qt::UserRole ).toStringList();
if ( !l.isEmpty() ) {
}
void SMESHGUI_FilterTable::ComboDelegate::setEditorData( QWidget* editor,
- const QModelIndex& index ) const
+ const QModelIndex& index ) const
{
QString value = index.model()->data( index, Qt::DisplayRole ).toString();
QComboBox* cb = dynamic_cast<QComboBox*>( editor );
}
void SMESHGUI_FilterTable::ComboDelegate::setModelData( QWidget* editor,
- QAbstractItemModel* model,
- const QModelIndex& index) const
+ QAbstractItemModel* model,
+ const QModelIndex& index) const
{
QComboBox* cb = dynamic_cast<QComboBox*>( editor );
if ( cb ) model->setData( index, cb->currentText(), Qt::DisplayRole );
}
void SMESHGUI_FilterTable::ComboDelegate::updateEditorGeometry( QWidget* editor,
- const QStyleOptionViewItem& option,
- const QModelIndex& index ) const
+ const QStyleOptionViewItem& option,
+ const QModelIndex& index ) const
{
editor->setGeometry( option.rect );
}
void SMESHGUI_FilterTable::Table::setReadOnly( bool on )
{
setEditTriggers( on ?
- QAbstractItemView::NoEditTriggers :
- QAbstractItemView::AllEditTriggers );
+ QAbstractItemView::NoEditTriggers :
+ QAbstractItemView::AllEditTriggers );
}
bool SMESHGUI_FilterTable::Table::isReadOnly() const
theCriterion.Threshold = (double)((ComboItem*)aTable->item(theRow, 2))->value();
else if ( aCriterionType != SMESH::FT_RangeOfIds &&
aCriterionType != SMESH::FT_BelongToGeom &&
- aCriterionType != SMESH::FT_BelongToPlane &&
- aCriterionType != SMESH::FT_BelongToCylinder &&
- aCriterionType != SMESH::FT_BelongToGenSurface &&
- aCriterionType != SMESH::FT_LyingOnGeom)
+ aCriterionType != SMESH::FT_BelongToPlane &&
+ aCriterionType != SMESH::FT_BelongToCylinder &&
+ aCriterionType != SMESH::FT_BelongToGenSurface &&
+ aCriterionType != SMESH::FT_LyingOnGeom)
{
theCriterion.Compare = ((ComboItem*)aTable->item(theRow, 1))->value();
theCriterion.Threshold = aTable->item(theRow, 2)->text().toDouble();
aText.toDouble(&isOk);
aTable->item( row, 2 )->setText(isOk ? aText : QString(""));
if (!aTable->isEditable(row, 1))
- aTable->setEditable(true, row, 1);
+ aTable->setEditable(true, row, 1);
if (!aTable->isEditable(row, 2))
- aTable->setEditable(true, row, 2);
+ aTable->setEditable(true, row, 2);
}
}
}
static int aLenCr = qAbs( aMaxLenCr -
- aMetrics.width(tr("CRITERION"))) / aMetrics.width(' ') + 5;
+ aMetrics.width(tr("CRITERION"))) / aMetrics.width(' ') + 5;
QString aCrStr;
aCrStr.fill(' ', aLenCr);
aTable->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
connect(aTable, SIGNAL(cellChanged(int, int)),
- this, SLOT(onCriterionChanged(int, int)));
+ this, SLOT(onCriterionChanged(int, int)));
connect(aTable, SIGNAL(currentCellChanged(int, int, int, int)),
- this, SLOT(onCurrentChanged(int, int)));
+ this, SLOT(onCurrentChanged(int, int)));
return aTable;
}
Table* aTable = anIter.value();
for (int i = 0, n = aTable->rowCount(); i < n; i++)
for (int j = 0, m = aTable->columnCount(); j < m; j++)
- {
- QTableWidgetItem* anItem = aTable->item(i, j);
- if ( dynamic_cast<SMESHGUI_FilterTable::CheckItem*>( anItem ) ) {
- Qt::ItemFlags f = anItem->flags();
- if (!isEditable) f = f & ~Qt::ItemIsUserCheckable;
- else f = f | Qt::ItemIsUserCheckable;
- anItem->setFlags( f );
- }
- }
+ {
+ QTableWidgetItem* anItem = aTable->item(i, j);
+ if ( dynamic_cast<SMESHGUI_FilterTable::CheckItem*>( anItem ) ) {
+ Qt::ItemFlags f = anItem->flags();
+ if (!isEditable) f = f & ~Qt::ItemIsUserCheckable;
+ else f = f | Qt::ItemIsUserCheckable;
+ anItem->setFlags( f );
+ }
+ }
//end of IPAL19974
if (isEditable)
// Purpose : Get text and internal value from cell of ID value
//=======================================================================
bool SMESHGUI_FilterTable::GetID( const int theRow,
- QString& theText,
- const int theEntityType )
+ QString& theText,
+ const int theEntityType )
{
Table* aTable = myTables[ theEntityType == -1 ? GetType() : theEntityType ];
QTableWidgetItem* anItem = aTable->item( theRow, 5 );
mySetInViewer->setChecked(true);
mySourceGrp->button(myApplyToState.contains(theTypes.first()) ?
- myApplyToState[ theTypes.first() ] :
- Selection)->setChecked(true);
+ myApplyToState[ theTypes.first() ] :
+ Selection)->setChecked(true);
}
//=======================================================================
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- platform)).
- arg(myHelpFileName));
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
SMESH::GetActiveStudyDocument()->FindObjectByName(aName.toLatin1().constData(), "GEOM");
if (aList.size() == 0) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
- tr("BAD_SHAPE_NAME").arg(aName));
+ tr("BAD_SHAPE_NAME").arg(aName));
return false;
}
aFace.IsNull() ||
aFace.ShapeType() != TopAbs_FACE) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
- tr("SHAPE_IS_NOT_A_FACE").arg(aName));
+ tr("SHAPE_IS_NOT_A_FACE").arg(aName));
return false;
}
Handle(Geom_Surface) aSurf = BRep_Tool::Surface(TopoDS::Face(aFace));
if (aSurf.IsNull()) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
- tr("SHAPE_IS_NOT_A_FACE").arg(aName));
+ tr("SHAPE_IS_NOT_A_FACE").arg(aName));
return false;
}
if (aType == SMESH::FT_BelongToPlane && !aSurf->IsKind(STANDARD_TYPE(Geom_Plane))) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
- tr("SHAPE_IS_NOT_A_PLANE").arg(aName));
+ tr("SHAPE_IS_NOT_A_PLANE").arg(aName));
return false;
}
if (aType == SMESH::FT_BelongToCylinder && !aSurf->IsKind(STANDARD_TYPE(Geom_CylindricalSurface))) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
- tr("SHAPE_IS_NOT_A_CYLINDER").arg(aName));
+ tr("SHAPE_IS_NOT_A_CYLINDER").arg(aName));
return false;
}
}
const int = -1 );
void SetID( const int,
- const QString&,
- const int = -1 );
+ const QString&,
+ const int = -1 );
bool GetID( const int,
- QString&,
- const int = -1 );
+ QString&,
+ const int = -1 );
void Update();
connect(myOpenBtn, SIGNAL(clicked()), this, SLOT(onBrowse()));
connect(myListBox, SIGNAL(itemSelectionChanged()),
- this, SLOT(onFilterChanged()));
+ this, SLOT(onFilterChanged()));
connect(myAddBtn, SIGNAL(clicked()), this, SLOT(onAddBtnPressed()));
connect(myDeleteBtn, SIGNAL(clicked()), this, SLOT(onDeleteBtnPressed()));
if (myLibrary->_is_nil()) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"),
- tr("LIBRARY_IS_NOT_LOADED"));
+ tr("LIBRARY_IS_NOT_LOADED"));
return false;
}
} else if (myMode == EDIT || myMode == ADD_TO) {
SMESH::Filter_var aFilter = createFilter();
if (!myListBox->selectedItems().empty() &&
- !myLibrary->Replace(myCurrFilterName.toLatin1().constData(),
- myName->text().toLatin1().constData(),
- aFilter.in())) {
+ !myLibrary->Replace(myCurrFilterName.toLatin1().constData(),
+ myName->text().toLatin1().constData(),
+ aFilter.in())) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
- tr("ERROR_OF_EDITING"));
+ tr("ERROR_OF_EDITING"));
aResult = false;
}
else
delete aFileName;
} else if (myMode != COPY_FROM) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
- tr("ERROR_OF_SAVING"));
+ tr("ERROR_OF_SAVING"));
} else {
}
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- platform)).
- arg(myHelpFileName));
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
if (myLibrary->_is_nil()) {
if (myMode == COPY_FROM) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
- tr("ERROR_LOAD"));
+ tr("ERROR_LOAD"));
return;
} else {
myLibrary = aFilterMgr->CreateLibrary();
if (aCurrName.isEmpty()) {
if (theMess)
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
- tr("EMPTY_FILTER_NAME"));
+ tr("EMPTY_FILTER_NAME"));
return false;
}
if (aNames[ f ] == aCurrName && aNames[ f ] != myCurrFilterName) {
if (theMess)
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
- tr("ERROR_FILTER_NAME"));
+ tr("ERROR_FILTER_NAME"));
return false;
}
}
if (!isWritable) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"),
- tr("NO_PERMISSION"));
+ tr("NO_PERMISSION"));
return false;
}
SMESH::Filter_var aFilter = createFilter();
myLibrary->Replace(myCurrFilterName.toLatin1().constData(),
- myName->text().toLatin1().constData(),
- aFilter);
+ myName->text().toLatin1().constData(),
+ aFilter);
}
// Fill table with filter parameters
SMESH::Filter_var aFilter = createFilter();
myLibrary->Replace(myCurrFilterName.toLatin1().constData(),
- myName->text().toLatin1().constData(),
- aFilter);
+ myName->text().toLatin1().constData(),
+ aFilter);
}
myTable->Clear(myTable->GetType());
{
if (myLibrary->_is_nil()) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"),
- tr("LIBRARY_IS_NOT_LOADED"));
+ tr("LIBRARY_IS_NOT_LOADED"));
return;
}
if (!aResult) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
- tr("ERROR_OF_ADDING"));
+ tr("ERROR_OF_ADDING"));
}
updateList();
if (theName != aName)
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_WARNING"),
- tr("ASSIGN_NEW_NAME").arg(theName).arg(aName));
+ tr("ASSIGN_NEW_NAME").arg(theName).arg(aName));
}
//=======================================================================
{
if (myLibrary->_is_nil()) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"),
- tr("LIBRARY_IS_NOT_LOADED"));
+ tr("LIBRARY_IS_NOT_LOADED"));
return;
}
if (anIndex == -1 || !myLibrary->Delete(myCurrFilterName.toLatin1().constData())) {
SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
- tr("ERROR_OF_DELETING"));
+ tr("ERROR_OF_DELETING"));
} else {
myCurrFilterName = "";
myCurrFilter = -1;
{
SMESH::Filter_var aFilter = createFilter(myTable->GetType());
myLibrary->Replace(myCurrFilterName.toLatin1().constData(),
- myName->text().toLatin1().constData(),
- aFilter);
+ myName->text().toLatin1().constData(),
+ aFilter);
}
}
}
SMESH::SMESH_subMesh_var aSubmesh =
SObjectToInterface<SMESH::SMESH_subMesh>( theMeshOrSubmesh );
if ( !aSubmesh->_is_nil() )
- return aSubmesh->GetSubShape();
+ return aSubmesh->GetSubShape();
}
}
return GEOM::GEOM_Object::_nil();
SALOMEDS_SObject* aRefSO = _CAST(SObject,aRefSOClient);
aMeshShape = GEOM::GEOM_Object::_narrow(aRefSO->GetObject());
} else {
- SALOMEDS_SObject* aSO = _CAST(SObject,aSObject);
+ SALOMEDS_SObject* aSO = _CAST(SObject,aSObject);
aMeshShape = GEOM::GEOM_Object::_narrow(aSO->GetObject());
}
// purpose :
//=================================================================================
SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule,
- SMESH::SMESH_Mesh_ptr theMesh )
+ SMESH::SMESH_Mesh_ptr theMesh )
: QDialog( SMESH::GetDesktop( theModule ) ),
mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
// purpose :
//=================================================================================
SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule,
- SMESH::SMESH_GroupBase_ptr theGroup,
+ SMESH::SMESH_GroupBase_ptr theGroup,
const bool theIsConvert )
: QDialog( SMESH::GetDesktop( theModule ) ),
mySMESHGUI( theModule ),
QLabel* aColorLab = new QLabel(tr( "SMESH_CHECK_COLOR" ), aColorBox );
myColorBtn = new QtxColorButton(aColorBox);
myColorBtn->setSizePolicy( QSizePolicy::MinimumExpanding,
- myColorBtn->sizePolicy().verticalPolicy() );
+ myColorBtn->sizePolicy().verticalPolicy() );
aColorBoxLayout->addWidget(aColorLab);
aColorBoxLayout->addWidget(myColorBtn);
switch (theMode) {
case 0:
if (myActor)
- myActor->SetPointRepresentation(true);
- else
- SMESH::SetPointRepresentation(true);
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(NodeSelection);
- break;
+ myActor->SetPointRepresentation(true);
+ else
+ SMESH::SetPointRepresentation(true);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(NodeSelection);
+ break;
case 1:
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(EdgeSelection);
- break;
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(EdgeSelection);
+ break;
case 2:
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(FaceSelection);
- break;
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(FaceSelection);
+ break;
default:
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(VolumeSelection);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(VolumeSelection);
}
} else {
if (theMode == 4)
- mySelectionMgr->installFilter(mySubMeshFilter);
+ mySelectionMgr->installFilter(mySubMeshFilter);
else if (theMode == 5)
- mySelectionMgr->installFilter(myGroupFilter);
+ mySelectionMgr->installFilter(myGroupFilter);
else if (theMode == 6)
- mySelectionMgr->installFilter(myMeshFilter);
+ mySelectionMgr->installFilter(myMeshFilter);
else if (theMode == 7)
- mySelectionMgr->installFilter(myGeomFilter);
+ mySelectionMgr->installFilter(myGeomFilter);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(ActorSelection);
+ aViewWindow->SetSelectionMode(ActorSelection);
}
mySelectionMode = theMode;
}
if (myMesh->_is_nil())
return false;
myGroup = myMesh->ConvertToStandalone( myGroupOnGeom );
- // nullify pointer, because object become dead
+ // nullify pointer, because object become dead
myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
}
}
int i, k = myElements->count();
anIdList->length(k);
for (i = 0; i < k; i++) {
- anIdList[i] = myElements->item(i)->text().toInt();
+ anIdList[i] = myElements->item(i)->text().toInt();
}
myGroup = SMESH::AddGroup(myMesh, aType, myName->text());
_PTR(SObject) aMeshGroupSO = SMESH::FindSObject(myGroup);
if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aMeshGroupSO->GetID().c_str())) {
- anActor->setName(myName->text().toLatin1().data());
- switch ( myTypeId ) {
- case 0: anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); break;
- case 1: anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break;
- case 2:
- case 3: anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); break;
- }
+ anActor->setName(myName->text().toLatin1().data());
+ switch ( myTypeId ) {
+ case 0: anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); break;
+ case 1: anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break;
+ case 2:
+ case 3: anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); break;
+ }
}
QList<int> aAddList;
int i, total = myElements->count();
for (i = 0; i < total; i++) {
- int anId = myElements->item(i)->text().toInt();
- int idx = myIdList.indexOf(anId);
- if ( idx == -1 )
- aAddList.append(anId);
- else
- myIdList.removeAt(idx);
+ int anId = myElements->item(i)->text().toInt();
+ int idx = myIdList.indexOf(anId);
+ if ( idx == -1 )
+ aAddList.append(anId);
+ else
+ myIdList.removeAt(idx);
}
if (!aAddList.empty()) {
- SMESH::long_array_var anIdList = new SMESH::long_array;
- int added = aAddList.count();
- anIdList->length(added);
- for (i = 0; i < added; i++)
- anIdList[i] = aAddList[i];
- myGroup->Add(anIdList.inout());
+ SMESH::long_array_var anIdList = new SMESH::long_array;
+ int added = aAddList.count();
+ anIdList->length(added);
+ for (i = 0; i < added; i++)
+ anIdList[i] = aAddList[i];
+ myGroup->Add(anIdList.inout());
}
if (!myIdList.empty()) {
- SMESH::long_array_var anIdList = new SMESH::long_array;
- int removed = myIdList.count();
- anIdList->length(removed);
- for (i = 0; i < removed; i++)
- anIdList[i] = myIdList[i];
- myGroup->Remove(anIdList.inout());
+ SMESH::long_array_var anIdList = new SMESH::long_array;
+ int removed = myIdList.count();
+ anIdList->length(removed);
+ for (i = 0; i < removed; i++)
+ anIdList[i] = myIdList[i];
+ myGroup->Remove(anIdList.inout());
}
/* init for next operation */
myIdList.clear();
for (i = 0; i < total; i++) {
- myIdList.append(myElements->item(i)->text().toInt());
+ myIdList.append(myElements->item(i)->text().toInt());
}
}
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
GEOM::GEOM_IGroupOperations_var aGroupOp =
- SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
+ SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
if (myGeomObjects->length() == 1) {
- myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType,
- myName->text().toLatin1().data(),
- myGeomObjects[0]);
+ myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType,
+ myName->text().toLatin1().data(),
+ myGeomObjects[0]);
}
else {
SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen();
aNewGeomGroupName += myName->text();
SALOMEDS::SObject_var aNewGroupSO =
geomGen->AddInStudy(aSMESHGen->GetCurrentStudy(), aGroupVar,
- aNewGeomGroupName.toLatin1().data(), aMeshShape);
+ aNewGeomGroupName.toLatin1().data(), aMeshShape);
}
myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType,
- myName->text().toLatin1().data(),
- aGroupVar);
+ myName->text().toLatin1().data(),
+ aGroupVar);
}
SALOMEDS::Color aColor = getGroupColor();
_PTR(SObject) aMeshGroupSO = SMESH::FindSObject(myGroupOnGeom);
if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aMeshGroupSO->GetID().c_str())) {
- anActor->setName(myName->text().toLatin1().data());
- switch ( myTypeId ) {
- case 0: anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); break;
- case 1: anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break;
- case 2:
- case 3: anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); break;
- }
+ anActor->setName(myName->text().toLatin1().data());
+ switch ( myTypeId ) {
+ case 0: anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); break;
+ case 1: anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B ); break;
+ case 2:
+ case 3: anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); break;
+ }
}
}
myGeomObjects->length(0);
if (myGeomGroupBtn->isChecked())
- myGeomGroupBtn->setChecked(false);
+ myGeomGroupBtn->setChecked(false);
if (!myCreate)
myName->setText( "" );
Handle(SALOME_InteractiveObject) IO = aList.First();
if (myCreate) {
- restoreShowEntityMode();
- myMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO);
+ restoreShowEntityMode();
+ myMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO);
setShowEntityMode();
updateGeomPopup();
if (myMesh->_is_nil())
- {
+ {
updateButtons();
- myIsBusy = false;
- return;
- }
+ myIsBusy = false;
+ return;
+ }
myGroup = SMESH::SMESH_Group::_nil();
// NPAL19389: create a group with a selection in another group
else {
SMESH::SMESH_GroupBase_var aGroup = SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IO);
if (aGroup->_is_nil())
- {
- myIsBusy = false;
+ {
+ myIsBusy = false;
return;
- }
+ }
myIsBusy = false;
myCurrentLineEdit = 0;
- myGroup = SMESH::SMESH_Group::_nil();
- myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
+ myGroup = SMESH::SMESH_Group::_nil();
+ myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
init(aGroup);
myIsBusy = true;
if (myGrpTypeId == 0)
{
- if (myTypeId == -1)
- onTypeChanged(0);
- else
- {
- myElements->clear();
- setSelectionMode(myTypeId);
- }
+ if (myTypeId == -1)
+ onTypeChanged(0);
+ else
+ {
+ myElements->clear();
+ setSelectionMode(myTypeId);
+ }
}
myIsBusy = false;
if (aNbSel == 0 || !aMeshSO)
{
- myGeomObjects->length(0);
- updateButtons();
- myIsBusy = false;
- return;
+ myGeomObjects->length(0);
+ updateButtons();
+ myIsBusy = false;
+ return;
}
myGeomObjects->length(aNbSel);
myGeomObjects->length(i);
if ( i == 0 )
- {
- myIsBusy = false;
- return;
- }
+ {
+ myIsBusy = false;
+ return;
+ }
aNbSel = i;
}
QString aListStr = "";
int aNbItems = 0;
if (myTypeId == 0) {
- aNbItems = SMESH::GetNameOfSelectedNodes(mySelector, myActor->getIO(), aListStr);
+ aNbItems = SMESH::GetNameOfSelectedNodes(mySelector, myActor->getIO(), aListStr);
} else {
- aNbItems = SMESH::GetNameOfSelectedElements(mySelector, myActor->getIO(), aListStr);
+ aNbItems = SMESH::GetNameOfSelectedElements(mySelector, myActor->getIO(), aListStr);
}
if (aNbItems > 0) {
- QListWidgetItem* anItem;
- QList<QListWidgetItem*> listItemsToSel;
- QStringList anElements = aListStr.split( " ", QString::SkipEmptyParts);
- for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
- QList<QListWidgetItem*> found = myElements->findItems(*it, Qt::MatchExactly);
- foreach(anItem, found)
- if (!anItem->isSelected())
- listItemsToSel.push_back(anItem);
- }
- bool blocked = myElements->signalsBlocked();
- myElements->blockSignals(true);
- foreach(anItem, listItemsToSel) anItem->setSelected(true);
- myElements->blockSignals(blocked);
- onListSelectionChanged();
- listItemsToSel.clear();
+ QListWidgetItem* anItem;
+ QList<QListWidgetItem*> listItemsToSel;
+ QStringList anElements = aListStr.split( " ", QString::SkipEmptyParts);
+ for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
+ QList<QListWidgetItem*> found = myElements->findItems(*it, Qt::MatchExactly);
+ foreach(anItem, found)
+ if (!anItem->isSelected())
+ listItemsToSel.push_back(anItem);
+ }
+ bool blocked = myElements->signalsBlocked();
+ myElements->blockSignals(true);
+ foreach(anItem, listItemsToSel) anItem->setSelected(true);
+ myElements->blockSignals(blocked);
+ onListSelectionChanged();
+ listItemsToSel.clear();
}
}
}
{
if(myMesh->_is_nil()) {
SUIT_MessageBox::critical(this,
- tr("SMESH_ERROR"),
- tr("NO_MESH_SELECTED"));
+ tr("SMESH_ERROR"),
+ tr("NO_MESH_SELECTED"));
return;
}
if (aNbItems > 0) {
QStringList anElements = aListStr.split( " ", QString::SkipEmptyParts);
for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
- QList<QListWidgetItem*> found = myElements->findItems(*it, Qt::MatchExactly);
- if (found.count() == 0) {
- anItem = new QListWidgetItem(*it);
- myElements->addItem(anItem);
- if (!anItem->isSelected())
- listItemsToSel.push_back(anItem);
- }
- else {
- foreach(anItem, found)
- if (!anItem->isSelected())
- listItemsToSel.push_back(anItem);
- }
+ QList<QListWidgetItem*> found = myElements->findItems(*it, Qt::MatchExactly);
+ if (found.count() == 0) {
+ anItem = new QListWidgetItem(*it);
+ myElements->addItem(anItem);
+ if (!anItem->isSelected())
+ listItemsToSel.push_back(anItem);
+ }
+ else {
+ foreach(anItem, found)
+ if (!anItem->isSelected())
+ listItemsToSel.push_back(anItem);
+ }
}
bool blocked = myElements->signalsBlocked();
myElements->blockSignals(true);
SMESH::SMESH_subMesh_var aSubMesh =
SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIt.Value());
if (!aSubMesh->_is_nil()) {
- // check if mesh is the same
- if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
+ // check if mesh is the same
+ if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
try {
SMESH::long_array_var anElements = aSubMesh->GetElementsByType(aType);
int k = anElements->length();
if (found.count() == 0) {
anItem = new QListWidgetItem(aText);
myElements->addItem(anItem);
- if (!anItem->isSelected())
- listItemsToSel.push_back(anItem);
+ if (!anItem->isSelected())
+ listItemsToSel.push_back(anItem);
+ }
+ else {
+ foreach(anItem, found)
+ if (!anItem->isSelected())
+ listItemsToSel.push_back(anItem);
}
- else {
- foreach(anItem, found)
- if (!anItem->isSelected())
- listItemsToSel.push_back(anItem);
- }
}
- bool blocked = myElements->signalsBlocked();
- myElements->blockSignals(true);
- foreach(anItem, listItemsToSel) anItem->setSelected(true);
- myElements->blockSignals(blocked);
- onListSelectionChanged();
- listItemsToSel.clear();
+ bool blocked = myElements->signalsBlocked();
+ myElements->blockSignals(true);
+ foreach(anItem, listItemsToSel) anItem->setSelected(true);
+ myElements->blockSignals(blocked);
+ onListSelectionChanged();
+ listItemsToSel.clear();
}
catch (const SALOME::SALOME_Exception& ex) {
SalomeApp_Tools::QtCatchCorbaException(ex);
SMESH::SMESH_GroupBase_var aGroup =
SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(anIt.Value());
if (!aGroup->_is_nil()) {
- // check if mesh is the same
- if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
- SMESH::long_array_var anElements = aGroup->GetListOfID();
- int k = anElements->length();
- for (int i = 0; i < k; i++) {
- QString aText = QString::number(anElements[i]);
- QList<QListWidgetItem*> found = myElements->findItems(aText, Qt::MatchExactly);
- if (found.count() == 0) {
- anItem = new QListWidgetItem(aText);
- myElements->addItem(anItem);
- if (!anItem->isSelected())
- listItemsToSel.push_back(anItem);
- }
- else {
- foreach(anItem, found)
- if (!anItem->isSelected())
- listItemsToSel.push_back(anItem);
- }
- }
- bool blocked = myElements->signalsBlocked();
- myElements->blockSignals(true);
- foreach(anItem, listItemsToSel) anItem->setSelected(true);
- myElements->blockSignals(blocked);
- onListSelectionChanged();
- listItemsToSel.clear();
- }
+ // check if mesh is the same
+ if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
+ SMESH::long_array_var anElements = aGroup->GetListOfID();
+ int k = anElements->length();
+ for (int i = 0; i < k; i++) {
+ QString aText = QString::number(anElements[i]);
+ QList<QListWidgetItem*> found = myElements->findItems(aText, Qt::MatchExactly);
+ if (found.count() == 0) {
+ anItem = new QListWidgetItem(aText);
+ myElements->addItem(anItem);
+ if (!anItem->isSelected())
+ listItemsToSel.push_back(anItem);
+ }
+ else {
+ foreach(anItem, found)
+ if (!anItem->isSelected())
+ listItemsToSel.push_back(anItem);
+ }
+ }
+ bool blocked = myElements->signalsBlocked();
+ myElements->blockSignals(true);
+ foreach(anItem, listItemsToSel) anItem->setSelected(true);
+ myElements->blockSignals(blocked);
+ onListSelectionChanged();
+ listItemsToSel.clear();
+ }
}
}
mySelectGroup->setChecked(false);
int k = anElements->length();
for (int i = 0; i < k; i++) {
- QString aText = QString::number(anElements[i]);
- QList<QListWidgetItem*> found = myElements->findItems(aText, Qt::MatchExactly);
- if (found.count() == 0) {
- anItem = new QListWidgetItem(aText);
- myElements->addItem(anItem);
- if (!anItem->isSelected())
- listItemsToSel.push_back(anItem);
- }
- else {
- foreach(anItem, found)
- if (!anItem->isSelected())
- listItemsToSel.push_back(anItem);
- }
+ QString aText = QString::number(anElements[i]);
+ QList<QListWidgetItem*> found = myElements->findItems(aText, Qt::MatchExactly);
+ if (found.count() == 0) {
+ anItem = new QListWidgetItem(aText);
+ myElements->addItem(anItem);
+ if (!anItem->isSelected())
+ listItemsToSel.push_back(anItem);
+ }
+ else {
+ foreach(anItem, found)
+ if (!anItem->isSelected())
+ listItemsToSel.push_back(anItem);
+ }
}
bool blocked = myElements->signalsBlocked();
myElements->blockSignals(true);
SALOME_ListIteratorOfListIO anIt (aList);
for ( ; anIt.More(); anIt.Next()) {
- SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIt.Value());
- if (!aSubMesh->_is_nil()) {
- // check if mesh is the same
- if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
- if (aType == SMESH::NODE) {
- try {
- SMESH::long_array_var anElements = aSubMesh->GetNodesId();
- int k = anElements->length();
- for (int i = 0; i < k; i++) {
- QList<QListWidgetItem*> found =
- myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly);
- QListWidgetItem* anItem;
- foreach(anItem, found) delete anItem;
- }
- }
- catch (const SALOME::SALOME_Exception& ex) {
- SalomeApp_Tools::QtCatchCorbaException(ex);
- }
- }
- else {
- try {
- SMESH::long_array_var anElements = aSubMesh->GetElementsId();
- int k = anElements->length();
- for (int i = 0; i < k; i++) {
- QList<QListWidgetItem*> found =
- myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly);
- QListWidgetItem* anItem;
- foreach(anItem, found) delete anItem;
- }
- }
- catch (const SALOME::SALOME_Exception& ex) {
- SalomeApp_Tools::QtCatchCorbaException(ex);
- }
- }
- }
- }
+ SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIt.Value());
+ if (!aSubMesh->_is_nil()) {
+ // check if mesh is the same
+ if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) {
+ if (aType == SMESH::NODE) {
+ try {
+ SMESH::long_array_var anElements = aSubMesh->GetNodesId();
+ int k = anElements->length();
+ for (int i = 0; i < k; i++) {
+ QList<QListWidgetItem*> found =
+ myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly);
+ QListWidgetItem* anItem;
+ foreach(anItem, found) delete anItem;
+ }
+ }
+ catch (const SALOME::SALOME_Exception& ex) {
+ SalomeApp_Tools::QtCatchCorbaException(ex);
+ }
+ }
+ else {
+ try {
+ SMESH::long_array_var anElements = aSubMesh->GetElementsId();
+ int k = anElements->length();
+ for (int i = 0; i < k; i++) {
+ QList<QListWidgetItem*> found =
+ myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly);
+ QListWidgetItem* anItem;
+ foreach(anItem, found) delete anItem;
+ }
+ }
+ catch (const SALOME::SALOME_Exception& ex) {
+ SalomeApp_Tools::QtCatchCorbaException(ex);
+ }
+ }
+ }
+ }
}
}
else if (myCurrentLineEdit == myGroupLine) {
SALOME_ListIteratorOfListIO anIt (aList);
for ( ; anIt.More(); anIt.Next()) {
- SMESH::SMESH_Group_var aGroup = SMESH::IObjectToInterface<SMESH::SMESH_Group>(anIt.Value());
- if (aRes && !aGroup->_is_nil()) {
- // check if mesh is the same
- if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
- SMESH::long_array_var anElements = aGroup->GetListOfID();
- int k = anElements->length();
- for (int i = 0; i < k; i++) {
- QList<QListWidgetItem*> found =
- myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly);
- QListWidgetItem* anItem;
- foreach(anItem, found) delete anItem;
- }
- }
- }
+ SMESH::SMESH_Group_var aGroup = SMESH::IObjectToInterface<SMESH::SMESH_Group>(anIt.Value());
+ if (aRes && !aGroup->_is_nil()) {
+ // check if mesh is the same
+ if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
+ SMESH::long_array_var anElements = aGroup->GetListOfID();
+ int k = anElements->length();
+ for (int i = 0; i < k; i++) {
+ QList<QListWidgetItem*> found =
+ myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly);
+ QListWidgetItem* anItem;
+ foreach(anItem, found) delete anItem;
+ }
+ }
+ }
}
}
}
int id = myElements->item(i)->text().toInt();
anArray[i] = id;
if (myElements->item(i)->isSelected())
- aSelected.append(id);
+ aSelected.append(id);
}
// sort & update list
std::sort(anArray.begin(), anArray.end());
anItem = new QListWidgetItem(QString::number(anArray[i]));
myElements->addItem(anItem);
if (aSelected.contains(anArray[i]))
- listItemsToSel.push_back(anItem);
+ listItemsToSel.push_back(anItem);
}
bool blocked = myElements->signalsBlocked();
myElements->blockSignals(true);
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr( "WRN_WARNING" ),
- tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
- arg(app->resourceMgr()->stringValue( "ExternalBrowser",
- platform)).
- arg(myHelpFileName));
+ tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
+ arg(app->resourceMgr()->stringValue( "ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
myCurrentLineEdit = myGeomGroupLine;
QAction* a = myGeomPopup->exec( QCursor::pos() );
if (!a || myActions[a] == DIRECT_GEOM_INDEX)
- setSelectionMode(7);
+ setSelectionMode(7);
}
else if (!isBtnOn)
{
{
mySelectionMode = -1;
if ( !myShapeByMeshOp ) {
- myShapeByMeshOp = new SMESHGUI_ShapeByMeshOp(true);
- connect(myShapeByMeshOp, SIGNAL(committed(SUIT_Operation*)),
- SLOT(onPublishShapeByMeshDlg(SUIT_Operation*)));
- connect(myShapeByMeshOp, SIGNAL(aborted(SUIT_Operation*)),
- SLOT(onCloseShapeByMeshDlg(SUIT_Operation*)));
+ myShapeByMeshOp = new SMESHGUI_ShapeByMeshOp(true);
+ connect(myShapeByMeshOp, SIGNAL(committed(SUIT_Operation*)),
+ SLOT(onPublishShapeByMeshDlg(SUIT_Operation*)));
+ connect(myShapeByMeshOp, SIGNAL(aborted(SUIT_Operation*)),
+ SLOT(onCloseShapeByMeshDlg(SUIT_Operation*)));
}
// set mesh object to SMESHGUI_ShapeByMeshOp and start it
if ( !myMesh->_is_nil() ) {
- myIsBusy = true;
+ myIsBusy = true;
hide(); // stop processing selection
- myIsBusy = false;
+ myIsBusy = false;
myShapeByMeshOp->setModule( mySMESHGUI );
myShapeByMeshOp->setStudy( 0 ); // it's really necessary
myShapeByMeshOp->SetMesh( myMesh );
QString ID = aGeomVar->GetStudyEntry();
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
if ( _PTR(SObject) aGeomSO = aStudy->FindObjectID( ID.toLatin1().data() )) {
- SALOME_ListIO anIOList;
- Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject
- ( aGeomSO->GetID().c_str(), "SMESH", aGeomSO->GetName().c_str() );
- anIOList.Append( anIO );
- mySelectionMgr->setSelectedObjects( anIOList, false );
- onObjectSelectionChanged();
+ SALOME_ListIO anIOList;
+ Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject
+ ( aGeomSO->GetID().c_str(), "SMESH", aGeomSO->GetName().c_str() );
+ anIOList.Append( anIO );
+ mySelectionMgr->setSelectedObjects( anIOList, false );
+ onObjectSelectionChanged();
}
}
}
void SMESHGUI_GroupDlg::setGroupColor( const SALOMEDS::Color& theColor )
{
QColor aQColor( (int)( theColor.R * 255.0 ),
- (int)( theColor.G * 255.0 ),
- (int)( theColor.B * 255.0 ) );
+ (int)( theColor.G * 255.0 ),
+ (int)( theColor.B * 255.0 ) );
setGroupQColor( aQColor );
}
SALOMEDS::Color aColor = SMESHGUI::getUniqueColor( aReservedColors );
aQColor.setRgb( (int)( aColor.R * 255.0 ),
- (int)( aColor.G * 255.0 ),
- (int)( aColor.B * 255.0 ) );
+ (int)( aColor.G * 255.0 ),
+ (int)( aColor.B * 255.0 ) );
}
QLabel* aColorLab = new QLabel(tr( "SMESH_CHECK_COLOR" ), aColorBox );
myColorBtn = new QtxColorButton(aColorBox);
myColorBtn->setSizePolicy( QSizePolicy::MinimumExpanding,
- myColorBtn->sizePolicy().verticalPolicy() );
+ myColorBtn->sizePolicy().verticalPolicy() );
aColorBoxLayout->addWidget(aColorLab);
aColorBoxLayout->addWidget(myColorBtn);
if ( theListGrp.isEmpty() )
{
SUIT_MessageBox::information( this, tr("SMESH_INSUFFICIENT_DATA"),
- tr("INCORRECT_ARGUMENTS") );
+ tr("INCORRECT_ARGUMENTS") );
return false;
}
if ( aMeshId == -1 )
{
SUIT_MessageBox::information(this, tr("SMESH_INSUFFICIENT_DATA"),
- tr("DIFF_MESHES"));
+ tr("DIFF_MESHES"));
return false;
}
if ( aGrpType == -1 )
{
SUIT_MessageBox::information(this, tr("SMESH_INSUFFICIENT_DATA"),
- tr("DIFF_TYPES"));
+ tr("DIFF_TYPES"));
return false;
}
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- platform)).
- arg(myHelpFileName));
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
else
{
SUIT_MessageBox::critical(this, tr("SMESH_ERROR"),
- tr("SMESH_OPERATION_FAILED"));
+ tr("SMESH_OPERATION_FAILED"));
return false;
}
}
else
{
SUIT_MessageBox::critical(this, tr("SMESH_ERROR"),
- tr("SMESH_OPERATION_FAILED"));
+ tr("SMESH_OPERATION_FAILED"));
return false;
}
}
else
{
SUIT_MessageBox::critical(this, tr("SMESH_ERROR"),
- tr("SMESH_OPERATION_FAILED"));
+ tr("SMESH_OPERATION_FAILED"));
return false;
}
}
else
{
SUIT_MessageBox::critical(this, tr("SMESH_ERROR"),
- tr("SMESH_OPERATION_FAILED"));
+ tr("SMESH_OPERATION_FAILED"));
return false;
}
}
namespace SMESH
{
SMESH::SMESH_Group_var AddGroup( SMESH::SMESH_Mesh_ptr theMesh,
- SMESH::ElementType theType,
- const QString& theGroupName )
+ SMESH::ElementType theType,
+ const QString& theGroupName )
{
SMESH::SMESH_Group_var aGroup;
try {
if ( !theMesh->_is_nil() )
- aGroup = theMesh->CreateGroup( theType, theGroupName.toLatin1().data() );
+ aGroup = theMesh->CreateGroup( theType, theGroupName.toLatin1().data() );
}
catch( const SALOME::SALOME_Exception& S_ex ) {
SalomeApp_Tools::QtCatchCorbaException( S_ex );
{
SMESHGUI_EXPORT
SMESH::SMESH_Group_var AddGroup( SMESH::SMESH_Mesh_ptr,
- SMESH::ElementType,
- const QString& );
+ SMESH::ElementType,
+ const QString& );
}
#endif // SMESHGUI_GROUPUTILS_H
}
void SMESHGUI_GenericHypothesisCreator::create( SMESH::SMESH_Hypothesis_ptr initParamsHyp,
- const QString& theHypName,
+ const QString& theHypName,
QWidget* parent, QObject* obj, const QString& slot )
{
MESSAGE( "Creation of hypothesis with initial params" );
}
void SMESHGUI_GenericHypothesisCreator::create( bool isAlgo,
- const QString& theHypName,
- QWidget* theParent, QObject* obj, const QString& slot )
+ const QString& theHypName,
+ QWidget* theParent, QObject* obj, const QString& slot )
{
MESSAGE( "Creation of hypothesis" );
}
void SMESHGUI_GenericHypothesisCreator::edit( SMESH::SMESH_Hypothesis_ptr theHypothesis,
- const QString& theHypName,
- QWidget* theParent, QObject* obj, const QString& slot )
+ const QString& theHypName,
+ QWidget* theParent, QObject* obj, const QString& slot )
{
if( CORBA::is_nil( theHypothesis ) )
return;
}
void SMESHGUI_GenericHypothesisCreator::editHypothesis( SMESH::SMESH_Hypothesis_ptr h,
- const QString& theHypName,
- QWidget* theParent,
+ const QString& theHypName,
+ QWidget* theParent,
QObject* obj, const QString& slot )
{
myHypName = theHypName;
case QVariant::Int:
{
SalomeApp_IntSpinBox* sb = new SalomeApp_IntSpinBox( GroupC1 );
- sb->setObjectName( (*anIt).myName );
+ sb->setObjectName( (*anIt).myName );
attuneStdWidget( sb, i );
sb->setValue( (*anIt).myValue.toInt() );
connect( sb, SIGNAL( valueChanged( int ) ), this, SLOT( onValueChanged() ) );
case QVariant::Double:
{
SalomeApp_DoubleSpinBox* sb = new SMESHGUI_SpinBox( GroupC1 );
- sb->setObjectName( (*anIt).myName );
+ sb->setObjectName( (*anIt).myName );
attuneStdWidget( sb, i );
sb->setValue( (*anIt).myValue.toDouble() );
connect( sb, SIGNAL( valueChanged( double ) ), this, SLOT( onValueChanged() ) );
if( listSOmesh.size() > 0 )
for( int i = 0; i < listSOmesh.size(); i++ )
{
- _PTR(SObject) submSO = listSOmesh[i];
- SMESH::SMESH_Mesh_var aMesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( submSO );
- SMESH::SMESH_subMesh_var aSubMesh = SMESH::SObjectToInterface<SMESH::SMESH_subMesh>( submSO );
- if( !aSubMesh->_is_nil() )
- aMesh = aSubMesh->GetFather();
- _PTR(SObject) meshSO = SMESH::FindSObject( aMesh );
- SMESH::ModifiedMesh( meshSO, false, aMesh->NbNodes()==0);
+ _PTR(SObject) submSO = listSOmesh[i];
+ SMESH::SMESH_Mesh_var aMesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( submSO );
+ SMESH::SMESH_subMesh_var aSubMesh = SMESH::SObjectToInterface<SMESH::SMESH_subMesh>( submSO );
+ if( !aSubMesh->_is_nil() )
+ aMesh = aSubMesh->GetFather();
+ _PTR(SObject) meshSO = SMESH::FindSObject( aMesh );
+ SMESH::ModifiedMesh( meshSO, false, aMesh->NbNodes()==0);
}
}
SMESHGUI::GetSMESHGUI()->updateObjBrowser( true, 0 );
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- platform)).
- arg(myHelpFileName));
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
}
HypothesisData::HypothesisData( const QString& theTypeName,
- const QString& thePluginName,
- const QString& theServerLibName,
- const QString& theClientLibName,
- const QString& theLabel,
- const QString& theIconId,
- const QList<int>& theDim,
- const bool theIsAux,
- const QStringList& theNeededHypos,
- const QStringList& theOptionalHypos,
- const QStringList& theInputTypes,
- const QStringList& theOutputTypes,
- const bool theIsNeedGeometry,
+ const QString& thePluginName,
+ const QString& theServerLibName,
+ const QString& theClientLibName,
+ const QString& theLabel,
+ const QString& theIconId,
+ const QList<int>& theDim,
+ const bool theIsAux,
+ const QStringList& theNeededHypos,
+ const QStringList& theOptionalHypos,
+ const QStringList& theInputTypes,
+ const QStringList& theOutputTypes,
+ const bool theIsNeedGeometry,
const bool supportSub)
: TypeName( theTypeName ),
PluginName( thePluginName ),
}
HypothesesSet::HypothesesSet( const QString& theSetName,
- const QStringList& theHypoList,
- const QStringList& theAlgoList )
+ const QStringList& theHypoList,
+ const QStringList& theAlgoList )
: myHypoSetName( theSetName ),
myHypoList( theHypoList ),
myAlgoList( theAlgoList ),
virtual ~SMESHGUI_GenericHypothesisCreator();
void create( SMESH::SMESH_Hypothesis_ptr,
- const QString&, QWidget*, QObject*, const QString& );
+ const QString&, QWidget*, QObject*, const QString& );
void create( bool, const QString&, QWidget*, QObject*, const QString& );
void edit( SMESH::SMESH_Hypothesis_ptr, const QString&, QWidget*, QObject*, const QString& );
void setInitParamsHypothesis(SMESH::SMESH_Hypothesis_ptr);
static QString stdParamValues( const ListOfStdParams& );
virtual void attuneStdWidget( QWidget*, const int ) const;
virtual QWidget* getCustomWidget( const StdParam&,
- QWidget*, const int ) const;
+ QWidget*, const int ) const;
virtual bool getParamFromCustomWidget( StdParam&, QWidget* ) const;
virtual void valueChanged( QWidget* );
virtual QString caption() const;
const QList<int>&, const bool,
const QStringList&, const QStringList&,
const QStringList&, const QStringList&,
- const bool=true, const bool supportSub=false );
+ const bool=true, const bool supportSub=false );
QString TypeName; //!< hypothesis type name
QString PluginName; //!< plugin name
QList<HypothesesSet*> myListOfHypothesesSets;
void processHypothesisStatus(const int theHypStatus,
- SMESH::SMESH_Hypothesis_ptr theHyp,
- const bool theIsAddition)
+ SMESH::SMESH_Hypothesis_ptr theHyp,
+ const bool theIsAddition)
{
if (theHypStatus > SMESH::HYP_OK) {
// get Hyp name
QString aHypName ("NULL Hypothesis");
if (!CORBA::is_nil(theHyp)) {
- _PTR(SObject) Shyp = SMESH::FindSObject(theHyp);
- if (Shyp)
- // name in study
- aHypName = Shyp->GetName().c_str();
- else
- // label in xml file
- aHypName = GetHypothesisData(theHyp->GetName())->Label;
+ _PTR(SObject) Shyp = SMESH::FindSObject(theHyp);
+ if (Shyp)
+ // name in study
+ aHypName = Shyp->GetName().c_str();
+ else
+ // label in xml file
+ aHypName = GetHypothesisData(theHyp->GetName())->Label;
}
// message
bool isFatal = (theHypStatus >= SMESH::HYP_UNKNOWN_FATAL);
QString aMsg;
if (theIsAddition)
- aMsg = (isFatal ? "SMESH_CANT_ADD_HYP" : "SMESH_ADD_HYP_WRN");
+ aMsg = (isFatal ? "SMESH_CANT_ADD_HYP" : "SMESH_ADD_HYP_WRN");
else
- aMsg = (isFatal ? "SMESH_CANT_RM_HYP" : "SMESH_RM_HYP_WRN");
+ aMsg = (isFatal ? "SMESH_CANT_RM_HYP" : "SMESH_RM_HYP_WRN");
aMsg = QObject::tr(aMsg.toLatin1().data()).arg(aHypName) +
- QObject::tr(QString("SMESH_HYP_%1").arg(theHypStatus).toLatin1().data());
+ QObject::tr(QString("SMESH_HYP_%1").arg(theHypStatus).toLatin1().data());
if ( theHypStatus == SMESH::HYP_HIDDEN_ALGO ) // PAL18501
aMsg = aMsg.arg( GetHypothesisData(theHyp->GetName())->Dim[0] );
SUIT_MessageBox::warning(SMESHGUI::desktop(),
- QObject::tr("SMESH_WRN_WARNING"),
- aMsg);
+ QObject::tr("SMESH_WRN_WARNING"),
+ aMsg);
}
}
QString HypsXml;
char* cenv = getenv("SMESH_MeshersList");
if (cenv)
- HypsXml.sprintf("%s", cenv);
+ HypsXml.sprintf("%s", cenv);
QStringList HypsXmlList = HypsXml.split(":", QString::SkipEmptyParts);
if (HypsXmlList.count() == 0) {
- SUIT_MessageBox::critical(SMESHGUI::desktop(),
- QObject::tr("SMESH_WRN_WARNING"),
- QObject::tr("MESHERS_FILE_NO_VARIABLE"));
- return;
+ SUIT_MessageBox::critical(SMESHGUI::desktop(),
+ QObject::tr("SMESH_WRN_WARNING"),
+ QObject::tr("MESHERS_FILE_NO_VARIABLE"));
+ return;
}
// loop on files in HypsXml
QString aNoAccessFiles;
for (int i = 0; i < HypsXmlList.count(); i++) {
- QString HypsXml = HypsXmlList[ i ];
+ QString HypsXml = HypsXmlList[ i ];
- // Find full path to the resource XML file
- QString xmlFile = resMgr->path("resources", "SMESH", HypsXml + ".xml");
+ // Find full path to the resource XML file
+ QString xmlFile = resMgr->path("resources", "SMESH", HypsXml + ".xml");
if ( xmlFile.isEmpty() ) // try PLUGIN resources
xmlFile = resMgr->path("resources", HypsXml, HypsXml + ".xml");
- QFile file (xmlFile);
- if (file.exists() && file.open(QIODevice::ReadOnly)) {
- file.close();
-
- SMESHGUI_XmlHandler* aXmlHandler = new SMESHGUI_XmlHandler();
- ASSERT(aXmlHandler);
-
- QXmlInputSource source (&file);
- QXmlSimpleReader reader;
- reader.setContentHandler(aXmlHandler);
- reader.setErrorHandler(aXmlHandler);
- bool ok = reader.parse(source);
- file.close();
- if (ok) {
- myHypothesesMap.unite( aXmlHandler->myHypothesesMap );
+ QFile file (xmlFile);
+ if (file.exists() && file.open(QIODevice::ReadOnly)) {
+ file.close();
+
+ SMESHGUI_XmlHandler* aXmlHandler = new SMESHGUI_XmlHandler();
+ ASSERT(aXmlHandler);
+
+ QXmlInputSource source (&file);
+ QXmlSimpleReader reader;
+ reader.setContentHandler(aXmlHandler);
+ reader.setErrorHandler(aXmlHandler);
+ bool ok = reader.parse(source);
+ file.close();
+ if (ok) {
+ myHypothesesMap.unite( aXmlHandler->myHypothesesMap );
myAlgorithmsMap.unite( aXmlHandler->myAlgorithmsMap );
- QList<HypothesesSet*>::iterator it, pos = myListOfHypothesesSets.begin();
- for ( it = aXmlHandler->myListOfHypothesesSets.begin();
- it != aXmlHandler->myListOfHypothesesSets.end();
- ++it ) {
- myListOfHypothesesSets.insert( pos, *it );
- }
- }
- else {
- SUIT_MessageBox::critical(SMESHGUI::desktop(),
- QObject::tr("INF_PARSE_ERROR"),
- QObject::tr(aXmlHandler->errorProtocol().toLatin1().data()));
- }
+ QList<HypothesesSet*>::iterator it, pos = myListOfHypothesesSets.begin();
+ for ( it = aXmlHandler->myListOfHypothesesSets.begin();
+ it != aXmlHandler->myListOfHypothesesSets.end();
+ ++it ) {
+ myListOfHypothesesSets.insert( pos, *it );
+ }
+ }
+ else {
+ SUIT_MessageBox::critical(SMESHGUI::desktop(),
+ QObject::tr("INF_PARSE_ERROR"),
+ QObject::tr(aXmlHandler->errorProtocol().toLatin1().data()));
+ }
delete aXmlHandler;
- }
- else {
- if (aNoAccessFiles.isEmpty())
- aNoAccessFiles = xmlFile;
- else
- aNoAccessFiles += ", " + xmlFile;
- }
+ }
+ else {
+ if (aNoAccessFiles.isEmpty())
+ aNoAccessFiles = xmlFile;
+ else
+ aNoAccessFiles += ", " + xmlFile;
+ }
} // end loop
if (!aNoAccessFiles.isEmpty()) {
- QString aMess = QObject::tr("MESHERS_FILE_CANT_OPEN") + " " + aNoAccessFiles + "\n";
- aMess += QObject::tr("MESHERS_FILE_CHECK_VARIABLE");
- wc.suspend();
- SUIT_MessageBox::warning(SMESHGUI::desktop(),
- QObject::tr("SMESH_WRN_WARNING"),
- aMess);
- wc.resume();
+ QString aMess = QObject::tr("MESHERS_FILE_CANT_OPEN") + " " + aNoAccessFiles + "\n";
+ aMess += QObject::tr("MESHERS_FILE_CHECK_VARIABLE");
+ wc.suspend();
+ SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ QObject::tr("SMESH_WRN_WARNING"),
+ aMess);
+ wc.resume();
}
}
}
for ( anIter = pMap.begin(); anIter != pMap.end(); anIter++ ) {
HypothesisData* aData = anIter.value();
if ( ( theDim < 0 || aData->Dim.contains( theDim ) ) && aData->IsAux == isAux) {
- if (checkGeometry) {
- if (aData->IsNeedGeometry == isNeedGeometry)
- aHypList.append(anIter.key());
- }
- else {
- aHypList.append(anIter.key());
- }
+ if (checkGeometry) {
+ if (aData->IsNeedGeometry == isNeedGeometry)
+ aHypList.append(anIter.key());
+ }
+ else {
+ aHypList.append(anIter.key());
+ }
}
}
return aHypList;
QList<HypothesesSet*>::iterator hypoSet;
for ( hypoSet = myListOfHypothesesSets.begin();
- hypoSet != myListOfHypothesesSets.end();
- ++hypoSet ) {
+ hypoSet != myListOfHypothesesSets.end();
+ ++hypoSet ) {
HypothesesSet* aSet = *hypoSet;
if ( aSet && aSet->count( true ) ) {
- aSetNameList.append( aSet->name() );
+ aSetNameList.append( aSet->name() );
}
}
{
QList<HypothesesSet*>::iterator hypoSet;
for ( hypoSet = myListOfHypothesesSets.begin();
- hypoSet != myListOfHypothesesSets.end();
- ++hypoSet ) {
+ hypoSet != myListOfHypothesesSets.end();
+ ++hypoSet ) {
HypothesesSet* aSet = *hypoSet;
if ( aSet && aSet->name() == theSetName )
- return aSet;
+ return aSet;
}
return 0;
}
// 3. Load Client Plugin Library
try {
- // load plugin library
- if(MYDEBUG) MESSAGE("Loading client meshers plugin library ...");
- LibHandle libHandle = LoadLib( aClientLibName.toLatin1().data() );
- if (!libHandle) {
- // report any error, if occured
- if ( MYDEBUG ) {
+ // load plugin library
+ if(MYDEBUG) MESSAGE("Loading client meshers plugin library ...");
+ LibHandle libHandle = LoadLib( aClientLibName.toLatin1().data() );
+ if (!libHandle) {
+ // report any error, if occured
+ if ( MYDEBUG ) {
#ifdef WIN32
- const char* anError = "Can't load client meshers plugin library";
+ const char* anError = "Can't load client meshers plugin library";
#else
- const char* anError = dlerror();
+ const char* anError = dlerror();
#endif
- MESSAGE(anError);
- }
- }
- else {
- // get method, returning hypothesis creator
- if(MYDEBUG) MESSAGE("Find GetHypothesisCreator() method ...");
- typedef SMESHGUI_GenericHypothesisCreator* (*GetHypothesisCreator) \
- ( const QString& );
- GetHypothesisCreator procHandle =
- (GetHypothesisCreator)GetProc(libHandle, "GetHypothesisCreator");
- if (!procHandle) {
- if(MYDEBUG) MESSAGE("bad hypothesis client plugin library");
- UnLoadLib(libHandle);
- }
- else {
- // get hypothesis creator
- if(MYDEBUG) MESSAGE("Get Hypothesis Creator for " << aHypType.toLatin1().data());
- aCreator = procHandle( aHypType );
- if (!aCreator) {
- if(MYDEBUG) MESSAGE("no such a hypothesis in this plugin");
- }
- else {
- // map hypothesis creator to a hypothesis name
+ MESSAGE(anError);
+ }
+ }
+ else {
+ // get method, returning hypothesis creator
+ if(MYDEBUG) MESSAGE("Find GetHypothesisCreator() method ...");
+ typedef SMESHGUI_GenericHypothesisCreator* (*GetHypothesisCreator) \
+ ( const QString& );
+ GetHypothesisCreator procHandle =
+ (GetHypothesisCreator)GetProc(libHandle, "GetHypothesisCreator");
+ if (!procHandle) {
+ if(MYDEBUG) MESSAGE("bad hypothesis client plugin library");
+ UnLoadLib(libHandle);
+ }
+ else {
+ // get hypothesis creator
+ if(MYDEBUG) MESSAGE("Get Hypothesis Creator for " << aHypType.toLatin1().data());
+ aCreator = procHandle( aHypType );
+ if (!aCreator) {
+ if(MYDEBUG) MESSAGE("no such a hypothesis in this plugin");
+ }
+ else {
+ // map hypothesis creator to a hypothesis name
// BUG 0020378
- //myHypCreatorMap[aHypType] = aCreator;
- }
- }
- }
+ //myHypCreatorMap[aHypType] = aCreator;
+ }
+ }
+ }
}
catch (const SALOME::SALOME_Exception& S_ex) {
- SalomeApp_Tools::QtCatchCorbaException(S_ex);
+ SalomeApp_Tools::QtCatchCorbaException(S_ex);
}
}
SMESH::SMESH_Hypothesis_ptr CreateHypothesis(const QString& aHypType,
- const QString& aHypName,
- const bool isAlgo)
+ const QString& aHypName,
+ const bool isAlgo)
{
if(MYDEBUG) MESSAGE("Create " << aHypType.toLatin1().data() <<
- " with name " << aHypName.toLatin1().data());
+ " with name " << aHypName.toLatin1().data());
HypothesisData* aHypData = GetHypothesisData(aHypType);
QString aServLib = aHypData->ServerLibName;
try {
SMESH::SMESH_Hypothesis_var aHypothesis;
aHypothesis = SMESHGUI::GetSMESHGen()->CreateHypothesis(aHypType.toLatin1().data(),
- aServLib.toLatin1().data());
+ aServLib.toLatin1().data());
if (!aHypothesis->_is_nil()) {
- _PTR(SObject) aHypSObject = SMESH::FindSObject(aHypothesis.in());
- if (aHypSObject) {
- if (!aHypName.isEmpty())
- SMESH::SetName(aHypSObject, aHypName);
- SMESHGUI::GetSMESHGUI()->updateObjBrowser();
- return aHypothesis._retn();
- }
+ _PTR(SObject) aHypSObject = SMESH::FindSObject(aHypothesis.in());
+ if (aHypSObject) {
+ if (!aHypName.isEmpty())
+ SMESH::SetName(aHypSObject, aHypName);
+ SMESHGUI::GetSMESHGUI()->updateObjBrowser();
+ return aHypothesis._retn();
+ }
}
} catch (const SALOME::SALOME_Exception & S_ex) {
SalomeApp_Tools::QtCatchCorbaException(S_ex);
_PTR(SObject) SM = SMESH::FindSObject(aMesh);
GEOM::GEOM_Object_var aShapeObject = SMESH::GetShapeOnMeshOrSubMesh(SM);
try {
- res = aMesh->AddHypothesis(aShapeObject, aHyp);
- if (res < SMESH::HYP_UNKNOWN_FATAL) {
- _PTR(SObject) aSH = SMESH::FindSObject(aHyp);
- if (SM && aSH) {
- SMESH::ModifiedMesh(SM, false, aMesh->NbNodes()==0);
- }
- }
- if (res > SMESH::HYP_OK) {
- wc.suspend();
- processHypothesisStatus(res, aHyp, true);
- wc.resume();
- }
+ res = aMesh->AddHypothesis(aShapeObject, aHyp);
+ if (res < SMESH::HYP_UNKNOWN_FATAL) {
+ _PTR(SObject) aSH = SMESH::FindSObject(aHyp);
+ if (SM && aSH) {
+ SMESH::ModifiedMesh(SM, false, aMesh->NbNodes()==0);
+ }
+ }
+ if (res > SMESH::HYP_OK) {
+ wc.suspend();
+ processHypothesisStatus(res, aHyp, true);
+ wc.resume();
+ }
}
catch(const SALOME::SALOME_Exception& S_ex) {
- wc.suspend();
- SalomeApp_Tools::QtCatchCorbaException(S_ex);
- res = SMESH::HYP_UNKNOWN_FATAL;
+ wc.suspend();
+ SalomeApp_Tools::QtCatchCorbaException(S_ex);
+ res = SMESH::HYP_UNKNOWN_FATAL;
}
}
return res < SMESH::HYP_UNKNOWN_FATAL;
if (!aSubMesh->_is_nil() && ! aHyp->_is_nil()) {
try {
- SMESH::SMESH_Mesh_var aMesh = aSubMesh->GetFather();
- _PTR(SObject) SsubM = SMESH::FindSObject(aSubMesh);
- GEOM::GEOM_Object_var aShapeObject = SMESH::GetShapeOnMeshOrSubMesh(SsubM);
- if (!aMesh->_is_nil() && SsubM && !aShapeObject->_is_nil()) {
- res = aMesh->AddHypothesis(aShapeObject, aHyp);
- if (res < SMESH::HYP_UNKNOWN_FATAL) {
+ SMESH::SMESH_Mesh_var aMesh = aSubMesh->GetFather();
+ _PTR(SObject) SsubM = SMESH::FindSObject(aSubMesh);
+ GEOM::GEOM_Object_var aShapeObject = SMESH::GetShapeOnMeshOrSubMesh(SsubM);
+ if (!aMesh->_is_nil() && SsubM && !aShapeObject->_is_nil()) {
+ res = aMesh->AddHypothesis(aShapeObject, aHyp);
+ if (res < SMESH::HYP_UNKNOWN_FATAL) {
_PTR(SObject) meshSO = SMESH::FindSObject(aMesh);
if (meshSO)
SMESH::ModifiedMesh(meshSO, false, aMesh->NbNodes()==0);
- }
- if (res > SMESH::HYP_OK) {
- wc.suspend();
- processHypothesisStatus(res, aHyp, true);
- wc.resume();
- }
- }
- else {
- SCRUTE(aHyp->_is_nil());
- SCRUTE(aMesh->_is_nil());
- SCRUTE(!SsubM);
- SCRUTE(aShapeObject->_is_nil());
- }
+ }
+ if (res > SMESH::HYP_OK) {
+ wc.suspend();
+ processHypothesisStatus(res, aHyp, true);
+ wc.resume();
+ }
+ }
+ else {
+ SCRUTE(aHyp->_is_nil());
+ SCRUTE(aMesh->_is_nil());
+ SCRUTE(!SsubM);
+ SCRUTE(aShapeObject->_is_nil());
+ }
}
catch(const SALOME::SALOME_Exception& S_ex) {
- wc.suspend();
- SalomeApp_Tools::QtCatchCorbaException(S_ex);
- res = SMESH::HYP_UNKNOWN_FATAL;
+ wc.suspend();
+ SalomeApp_Tools::QtCatchCorbaException(S_ex);
+ res = SMESH::HYP_UNKNOWN_FATAL;
}
}
else {
_PTR(Study) aStudy = GetActiveStudyDocument();
_PTR(SObject) aHypObj = aStudy->FindObjectID( IObject->getEntry() );
if( aHypObj )
- {
- _PTR(SObject) MorSM = SMESH::GetMeshOrSubmesh( aHypObj );
- _PTR(SObject) aRealHypo;
- if( aHypObj->ReferencedObject( aRealHypo ) )
- {
- SMESH_Hypothesis_var hypo = SMESH_Hypothesis::_narrow( SObjectToObject( aRealHypo ) );
- RemoveHypothesisOrAlgorithmOnMesh( MorSM, hypo );
- }
- else
- {
- SMESH_Hypothesis_var hypo = SMESH_Hypothesis::_narrow( SObjectToObject( aHypObj ) );
- SObjectList meshList = GetMeshesUsingAlgoOrHypothesis( hypo );
- for( int i = 0; i < meshList.size(); i++ )
- RemoveHypothesisOrAlgorithmOnMesh( meshList[ i ], hypo );
- }
- }
+ {
+ _PTR(SObject) MorSM = SMESH::GetMeshOrSubmesh( aHypObj );
+ _PTR(SObject) aRealHypo;
+ if( aHypObj->ReferencedObject( aRealHypo ) )
+ {
+ SMESH_Hypothesis_var hypo = SMESH_Hypothesis::_narrow( SObjectToObject( aRealHypo ) );
+ RemoveHypothesisOrAlgorithmOnMesh( MorSM, hypo );
+ }
+ else
+ {
+ SMESH_Hypothesis_var hypo = SMESH_Hypothesis::_narrow( SObjectToObject( aHypObj ) );
+ SObjectList meshList = GetMeshesUsingAlgoOrHypothesis( hypo );
+ for( int i = 0; i < meshList.size(); i++ )
+ RemoveHypothesisOrAlgorithmOnMesh( meshList[ i ], hypo );
+ }
+ }
}
catch(const SALOME::SALOME_Exception& S_ex)
{
- wc.suspend();
- SalomeApp_Tools::QtCatchCorbaException(S_ex);
- res = SMESH::HYP_UNKNOWN_FATAL;
+ wc.suspend();
+ SalomeApp_Tools::QtCatchCorbaException(S_ex);
+ res = SMESH::HYP_UNKNOWN_FATAL;
}
return res < SMESH::HYP_UNKNOWN_FATAL;
}
}
else if(!aMesh->HasShapeToMesh()){
res = aMesh->RemoveHypothesis(aShapeObject, anHyp);
- if (res < SMESH::HYP_UNKNOWN_FATAL) {
+ if (res < SMESH::HYP_UNKNOWN_FATAL) {
_PTR(SObject) meshSO = SMESH::FindSObject(aMesh);
if (meshSO)
SMESH::ModifiedMesh(meshSO, false, aMesh->NbNodes()==0);
}
}
} catch(const SALOME::SALOME_Exception& S_ex) {
- wc.suspend();
- SalomeApp_Tools::QtCatchCorbaException(S_ex);
- res = SMESH::HYP_UNKNOWN_FATAL;
+ wc.suspend();
+ SalomeApp_Tools::QtCatchCorbaException(S_ex);
+ res = SMESH::HYP_UNKNOWN_FATAL;
}
}
return res < SMESH::HYP_UNKNOWN_FATAL;
if (!AlgoOrHyp->_is_nil()) {
_PTR(SObject) SO_Hypothesis = SMESH::FindSObject(AlgoOrHyp);
if (SO_Hypothesis) {
- SObjectList listSO =
- SMESHGUI::activeStudy()->studyDS()->FindDependances(SO_Hypothesis);
-
- if(MYDEBUG) MESSAGE("SMESHGUI::GetMeshesUsingAlgoOrHypothesis(): dependency number ="<<listSO.size());
- for (unsigned int i = 0; i < listSO.size(); i++) {
- _PTR(SObject) SO = listSO[i];
- if (SO) {
- _PTR(SObject) aFather = SO->GetFather();
- if (aFather) {
- _PTR(SObject) SOfatherFather = aFather->GetFather();
- if (SOfatherFather) {
- if(MYDEBUG) MESSAGE("SMESHGUI::GetMeshesUsingAlgoOrHypothesis(): dependency added to list");
- index++;
- listSOmesh.resize(index);
- listSOmesh[index - 1] = SOfatherFather;
- }
- }
- }
- }
+ SObjectList listSO =
+ SMESHGUI::activeStudy()->studyDS()->FindDependances(SO_Hypothesis);
+
+ if(MYDEBUG) MESSAGE("SMESHGUI::GetMeshesUsingAlgoOrHypothesis(): dependency number ="<<listSO.size());
+ for (unsigned int i = 0; i < listSO.size(); i++) {
+ _PTR(SObject) SO = listSO[i];
+ if (SO) {
+ _PTR(SObject) aFather = SO->GetFather();
+ if (aFather) {
+ _PTR(SObject) SOfatherFather = aFather->GetFather();
+ if (SOfatherFather) {
+ if(MYDEBUG) MESSAGE("SMESHGUI::GetMeshesUsingAlgoOrHypothesis(): dependency added to list");
+ index++;
+ listSOmesh.resize(index);
+ listSOmesh[index - 1] = SOfatherFather;
+ }
+ }
+ }
+ }
}
}
if (MYDEBUG) MESSAGE("SMESHGUI::GetMeshesUsingAlgoOrHypothesis(): completed");
QStringList GetAvailableHypotheses( const bool,
const int = -1,
const bool = false,
- const bool = true);
+ const bool = true);
SMESHGUI_EXPORT
QStringList GetHypothesesSets();
SMESHGUI_EXPORT
bool IsAvailableHypothesis( const HypothesisData*,
- const QString&,
- bool& );
+ const QString&,
+ bool& );
SMESHGUI_EXPORT
bool IsCompatibleAlgorithm( const HypothesisData*,
- const HypothesisData* );
+ const HypothesisData* );
SMESHGUI_EXPORT
SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator( const QString& );
SMESHGUI_EXPORT
bool RemoveHypothesisOrAlgorithmOnMesh( _PTR(SObject),
- SMESH::SMESH_Hypothesis_ptr );
+ SMESH::SMESH_Hypothesis_ptr );
typedef std::vector<_PTR(SObject)> SObjectList;
SObjectList GetMeshesUsingAlgoOrHypothesis( SMESH::SMESH_Hypothesis_ptr );
// truncate extra ids
int ind = 0, nbId = 0;
while ( ind < input.length() ) {
- if ( input.at( ind ) != ' ' ) {
- if ( ++nbId > myMaxNbId ) {
- input.truncate( ind );
- break;
- }
- ind = input.indexOf( ' ', ind );
- if ( ind < 0 ) break;
- }
- ind++;
+ if ( input.at( ind ) != ' ' ) {
+ if ( ++nbId > myMaxNbId ) {
+ input.truncate( ind );
+ break;
+ }
+ ind = input.indexOf( ' ', ind );
+ if ( ind < 0 ) break;
+ }
+ ind++;
}
}
if ( pos > input.length() )
int nbSel = selected.Extent();
if (nbSel != 1) {
SUIT_MessageBox::warning(desktop(),
- tr("SMESH_WRN_WARNING"),
- tr("SMESH_WRN_NO_AVAILABLE_DATA"));
+ tr("SMESH_WRN_WARNING"),
+ tr("SMESH_WRN_NO_AVAILABLE_DATA"));
onCancel();
return;
}
myMesh = SMESH::GetMeshByIO(anIO);
if (myMesh->_is_nil()) {
SUIT_MessageBox::warning(desktop(),
- tr("SMESH_WRN_WARNING"),
- tr("SMESH_WRN_NO_AVAILABLE_DATA"));
+ tr("SMESH_WRN_WARNING"),
+ tr("SMESH_WRN_NO_AVAILABLE_DATA"));
onCancel();
return;
}
if (!compute2DMesh()) {
SUIT_MessageBox::warning(desktop(),
- tr("SMESH_WRN_WARNING"),
- tr("SMESH_WRN_COMPUTE_FAILED"));
+ tr("SMESH_WRN_WARNING"),
+ tr("SMESH_WRN_COMPUTE_FAILED"));
onCancel();
return;
}
myHypoSetButton->setText( tr( "HYPOTHESES_SETS" ) );
myHypoSetButton->setEnabled( false );
myHypoSetButton->setSizePolicy( QSizePolicy::MinimumExpanding,
- myHypoSetButton->sizePolicy().verticalPolicy() );
+ myHypoSetButton->sizePolicy().verticalPolicy() );
// Fill layout
QGridLayout* aLay = new QGridLayout( mainFrame() );
myGeomPopup->addAction( tr("DIRECT_GEOM_SELECTION") )->setData( DIRECT_GEOM_INDEX );
myGeomPopup->addAction( tr("GEOM_BY_MESH_ELEM_SELECTION") )->setData( GEOM_BY_MESH_INDEX );
connect( myGeomPopup, SIGNAL( triggered( QAction* ) ), SLOT( onGeomPopup( QAction* ) ) );
- connect( selBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) ));
+ connect( selBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) ));
}
}
else {
disconnect( selBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) ));
if ( myGeomPopup ) {
- delete myGeomPopup;
- myGeomPopup = 0;
+ delete myGeomPopup;
+ myGeomPopup = 0;
}
}
}
// edges
myNbEdge ->setText( QString("%1").arg( theInfo[SMDSEntity_Edge] +
- theInfo[SMDSEntity_Quad_Edge] ));
+ theInfo[SMDSEntity_Quad_Edge] ));
myNbLinEdge ->setText( QString("%1").arg( theInfo[SMDSEntity_Edge] ));
myNbQuadEdge ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Edge] ));
// faces
myNbFace ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] +
- theInfo[SMDSEntity_Quad_Triangle] +
- theInfo[SMDSEntity_Quadrangle] +
- theInfo[SMDSEntity_Quad_Quadrangle] +
- theInfo[SMDSEntity_Polygon] ));
+ theInfo[SMDSEntity_Quad_Triangle] +
+ theInfo[SMDSEntity_Quadrangle] +
+ theInfo[SMDSEntity_Quad_Quadrangle] +
+ theInfo[SMDSEntity_Polygon] ));
myNbLinFace ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] +
- theInfo[SMDSEntity_Quadrangle] +
- theInfo[SMDSEntity_Polygon] ));
+ theInfo[SMDSEntity_Quadrangle] +
+ theInfo[SMDSEntity_Polygon] ));
myNbQuadFace ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Triangle] +
- theInfo[SMDSEntity_Quad_Quadrangle] ));
+ theInfo[SMDSEntity_Quad_Quadrangle] ));
// volumes
myNbVolum ->setText( QString("%1").arg( theInfo[SMDSEntity_Tetra] +
- theInfo[SMDSEntity_Quad_Tetra] +
- theInfo[SMDSEntity_Pyramid] +
- theInfo[SMDSEntity_Quad_Pyramid] +
- theInfo[SMDSEntity_Hexa] +
- theInfo[SMDSEntity_Quad_Hexa] +
- theInfo[SMDSEntity_Penta] +
- theInfo[SMDSEntity_Quad_Penta] +
- theInfo[SMDSEntity_Polyhedra] ));
+ theInfo[SMDSEntity_Quad_Tetra] +
+ theInfo[SMDSEntity_Pyramid] +
+ theInfo[SMDSEntity_Quad_Pyramid] +
+ theInfo[SMDSEntity_Hexa] +
+ theInfo[SMDSEntity_Quad_Hexa] +
+ theInfo[SMDSEntity_Penta] +
+ theInfo[SMDSEntity_Quad_Penta] +
+ theInfo[SMDSEntity_Polyhedra] ));
myNbLinVolum ->setText( QString("%1").arg( theInfo[SMDSEntity_Tetra] +
- theInfo[SMDSEntity_Pyramid] +
- theInfo[SMDSEntity_Hexa] +
- theInfo[SMDSEntity_Penta] +
- theInfo[SMDSEntity_Polyhedra] ));
+ theInfo[SMDSEntity_Pyramid] +
+ theInfo[SMDSEntity_Hexa] +
+ theInfo[SMDSEntity_Penta] +
+ theInfo[SMDSEntity_Polyhedra] ));
myNbQuadVolum->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Tetra] +
- theInfo[SMDSEntity_Quad_Pyramid] +
- theInfo[SMDSEntity_Quad_Hexa] +
- theInfo[SMDSEntity_Quad_Penta] ));
+ theInfo[SMDSEntity_Quad_Pyramid] +
+ theInfo[SMDSEntity_Quad_Hexa] +
+ theInfo[SMDSEntity_Quad_Penta] ));
if ( myFull )
{
// triangles
myNbTrai ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] +
- theInfo[SMDSEntity_Quad_Triangle] ));
+ theInfo[SMDSEntity_Quad_Triangle] ));
myNbLinTrai ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] ));
myNbQuadTrai ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Triangle] ));
// quadrangles
myNbQuad ->setText( QString("%1").arg( theInfo[SMDSEntity_Quadrangle] +
- theInfo[SMDSEntity_Quad_Quadrangle] ));
+ theInfo[SMDSEntity_Quad_Quadrangle] ));
myNbLinQuad ->setText( QString("%1").arg( theInfo[SMDSEntity_Quadrangle] ));
myNbQuadQuad ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Quadrangle] ));
// poligones
// tetras
myNbTetra ->setText( QString("%1").arg( theInfo[SMDSEntity_Tetra] +
- theInfo[SMDSEntity_Quad_Tetra] ));
+ theInfo[SMDSEntity_Quad_Tetra] ));
myNbLinTetra ->setText( QString("%1").arg( theInfo[SMDSEntity_Tetra] ));
myNbQuadTetra->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Tetra] ));
// hexas
myNbHexa ->setText( QString("%1").arg( theInfo[SMDSEntity_Hexa] +
- theInfo[SMDSEntity_Quad_Hexa] ));
+ theInfo[SMDSEntity_Quad_Hexa] ));
myNbLinHexa ->setText( QString("%1").arg( theInfo[SMDSEntity_Hexa] ));
myNbQuadHexa ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Hexa] ));
// pyras
myNbPyra ->setText( QString("%1").arg( theInfo[SMDSEntity_Pyramid] +
- theInfo[SMDSEntity_Quad_Pyramid] ));
+ theInfo[SMDSEntity_Quad_Pyramid] ));
myNbLinPyra ->setText( QString("%1").arg( theInfo[SMDSEntity_Pyramid] ));
myNbQuadPyra ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Pyramid] ));
// prisms
myNbPrism ->setText( QString("%1").arg( theInfo[SMDSEntity_Penta] +
- theInfo[SMDSEntity_Quad_Penta] ));
+ theInfo[SMDSEntity_Quad_Penta] ));
myNbLinPrism ->setText( QString("%1").arg( theInfo[SMDSEntity_Penta] ));
myNbQuadPrism->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Penta] ));
// polyedres
//CORBA::Object_var anObject = aSO->GetObject();
CORBA::Object_var anObject = SMESH::SObjectToObject(aSO);
if (!CORBA::is_nil(anObject)) {
- SMESH::SMESH_IDSource_var anIDSource = SMESH::SMESH_IDSource::_narrow(anObject);
- if (!anIDSource->_is_nil()) {
- myWGStack->setCurrentWidget(myMeshWidget);
- setWindowTitle(tr("SMESH_MESHINFO_TITLE") + " [" + tr("SMESH_OBJECT_MESH") + "]");
- myMeshName->setText(aSO->GetName().c_str());
+ SMESH::SMESH_IDSource_var anIDSource = SMESH::SMESH_IDSource::_narrow(anObject);
+ if (!anIDSource->_is_nil()) {
+ myWGStack->setCurrentWidget(myMeshWidget);
+ setWindowTitle(tr("SMESH_MESHINFO_TITLE") + " [" + tr("SMESH_OBJECT_MESH") + "]");
+ myMeshName->setText(aSO->GetName().c_str());
- SMESH::long_array_var aMeshInfo = anIDSource->GetMeshInfo();
- myMeshInfoBox->SetMeshInfo( aMeshInfo );
+ SMESH::long_array_var aMeshInfo = anIDSource->GetMeshInfo();
+ myMeshInfoBox->SetMeshInfo( aMeshInfo );
- return;
- }
+ return;
+ }
}
}
}
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- platform)).
- arg(myHelpFileName));
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
SMESH::SObjectToInterface<SMESH::SMESH_subMesh>( pSubmesh );
bool editSubmesh = ( !sm->_is_nil() &&
SUIT_MessageBox::question( myDlg, tr( "SMESH_WARNING" ),
- tr( "EDIT_SUBMESH_QUESTION"),
- SUIT_MessageBox::Yes |
- SUIT_MessageBox::No,
- SUIT_MessageBox::No )
- == SUIT_MessageBox::Yes );
+ tr( "EDIT_SUBMESH_QUESTION"),
+ SUIT_MessageBox::Yes |
+ SUIT_MessageBox::No,
+ SUIT_MessageBox::No )
+ == SUIT_MessageBox::Yes );
if ( editSubmesh )
{
selectionMgr()->clearFilters();
aNewGeomGroupName += aName;
SALOMEDS::SObject_var aNewGroupSO =
geomGen->AddInStudy(aSMESHGen->GetCurrentStudy(), aGeomVar,
- aNewGeomGroupName.toLatin1().data(), mainGeom);
+ aNewGeomGroupName.toLatin1().data(), mainGeom);
}
}
}
const int ); // access to myAvailableHypData
void createHypothesis( const int, const int,
- const QString& );
+ const QString& );
bool createMesh( QString& );
bool createSubMesh( QString& );
ok = myNode2->isValid( msg, theMess ) && ok;
if( !ok ) {
if( theMess ) {
- QString str( tr( "SMESH_INCORRECT_INPUT" ) );
- if ( !msg.isEmpty() )
- str += "\n" + msg;
- SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
+ QString str( tr( "SMESH_INCORRECT_INPUT" ) );
+ if ( !msg.isEmpty() )
+ str += "\n" + msg;
+ SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
}
return false;
}
{
if (theMess)
SUIT_MessageBox::information(this, tr("SMESH_INSUFFICIENT_DATA"),
- tr("SMESHGUI_INVALID_PARAMETERS"));
+ tr("SMESHGUI_INVALID_PARAMETERS"));
return false;
}
if ( myName->text().isEmpty() ) {
if (theMess)
SUIT_MessageBox::information(this, tr("SMESH_INSUFFICIENT_DATA"),
- tr("SMESHGUI_INVALID_PARAMETERS"));
+ tr("SMESHGUI_INVALID_PARAMETERS"));
return false;
}
varIds->length(ids.count());
int i = 0;
for (QList<int>::iterator it = ids.begin(); it != ids.end(); ++it)
- varIds[i++] = *it;
+ varIds[i++] = *it;
myType == Type_2d
- ? myPattern->ApplyToMeshFaces (myMesh, varIds, getNode(false), myReverseChk->isChecked())
- : myPattern->ApplyToHexahedrons(myMesh, varIds, getNode(false), getNode(true));
+ ? myPattern->ApplyToMeshFaces (myMesh, varIds, getNode(false), myReverseChk->isChecked())
+ : myPattern->ApplyToHexahedrons(myMesh, varIds, getNode(false), getNode(true));
QStringList aParameters;
aParameters << myNode1->text();
if(myType == Type_3d )
- aParameters << myNode2->text();
+ aParameters << myNode2->text();
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
} else { // Applying a pattern to geometrical object
//mySelectionMgr->clearSelected();
bool autoUpdate = SMESHGUI::automaticUpdate();
if (!isRefine() && autoUpdate) {
- _PTR(SObject) aSO = SMESH::FindSObject(myMesh.in());
- SMESH_Actor* anActor = SMESH::FindActorByEntry(aSO->GetID().c_str());
- if (!anActor) {
- anActor = SMESH::CreateActor(aSO->GetStudy(), aSO->GetID().c_str());
- if (anActor) {
- SMESH::DisplayActor(SMESH::GetActiveWindow(), anActor);
- SMESH::FitAll();
- }
- }
+ _PTR(SObject) aSO = SMESH::FindSObject(myMesh.in());
+ SMESH_Actor* anActor = SMESH::FindActorByEntry(aSO->GetID().c_str());
+ if (!anActor) {
+ anActor = SMESH::CreateActor(aSO->GetStudy(), aSO->GetID().c_str());
+ if (anActor) {
+ SMESH::DisplayActor(SMESH::GetActiveWindow(), anActor);
+ SMESH::FitAll();
+ }
+ }
}
mySelectionMgr->clearSelected();
SMESH::UpdateView();
return true;
} else {
SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
- tr("SMESH_OPERATION_FAILED"));
+ tr("SMESH_OPERATION_FAILED"));
return false;
}
} catch (const SALOME::SALOME_Exception& S_ex) {
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- platform)).
- arg(myHelpFileName));
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
SALOME_ListIO aList;
mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
if (aList.Extent() != 1)
- return;
+ return;
// Retrieve mesh from selection
Handle(SALOME_InteractiveObject) anIO = aList.First();
SALOME_ListIO aList;
mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
if (aList.Extent() != 1)
- return;
+ return;
QString anIds;
if (!SMESH::GetNameOfSelectedElements(mySelector, aList.First(), anIds))
- anIds = "";
+ anIds = "";
myBusy = true;
mySelEdit[ Ids ]->setText(anIds);
SALOME_ListIO aList;
mySelectionMgr->selectedObjects(aList, SVTK_Viewer::Type());
if (aList.Extent() != 1)
- return;
+ return;
// Get geom object from selection
Handle(SALOME_InteractiveObject) anIO = aList.First();
QFile aFile(fName);
if (!aFile.open(QIODevice::ReadOnly)) {
SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
- tr("ERROR_OF_OPENING"));
+ tr("ERROR_OF_OPENING"));
return;
}
QByteArray aDataArray = aFile.readAll();
if (aDataArray.isEmpty()) {
SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
- tr("ERROR_OF_READING"));
+ tr("ERROR_OF_READING"));
return;
}
if (!CORBA::is_nil(myPattern)/* && getIds(ids)*/) {
SMESH::long_array_var keyPoints = myPattern->GetKeyPoints();
if (keyPoints->length()) {
- myNode1->setEnabled(true);
- myNode2->setEnabled(true);
- myNode1->setRange(1, keyPoints->length());
- myNode2->setRange(1, keyPoints->length());
- return;
+ myNode1->setEnabled(true);
+ myNode2->setEnabled(true);
+ myNode1->setRange(1, keyPoints->length());
+ myNode2->setRange(1, keyPoints->length());
+ return;
}
}
if (myType == Type_2d)
{
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(FaceSelection);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(FaceSelection);
}
else
{
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(CellSelection);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(CellSelection);
}
}
else {
} catch (const SALOME::SALOME_Exception& S_ex) {
SalomeApp_Tools::QtCatchCorbaException(S_ex);
SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
- tr("ERROR_OF_LOADING") );
+ tr("ERROR_OF_LOADING") );
return false;
}
}
varIds->length(ids.count());
int i = 0;
for (QList<int>::iterator it = ids.begin(); it != ids.end(); ++it)
- varIds[i++] = *it;
+ varIds[i++] = *it;
pnts = myType == Type_2d
- ? myPattern->ApplyToMeshFaces (myMesh, varIds, getNode(false), myReverseChk->isChecked())
- : myPattern->ApplyToHexahedrons(myMesh, varIds, getNode(false), getNode(true));
+ ? myPattern->ApplyToMeshFaces (myMesh, varIds, getNode(false), myReverseChk->isChecked())
+ : myPattern->ApplyToHexahedrons(myMesh, varIds, getNode(false), getNode(true));
} else {
pnts = myType == Type_2d
- ? myPattern->ApplyToFace (myGeomObj[ Object ], myGeomObj[ Vertex1 ], myReverseChk->isChecked())
+ ? myPattern->ApplyToFace (myGeomObj[ Object ], myGeomObj[ Vertex1 ], myReverseChk->isChecked())
: myPattern->ApplyTo3DBlock(myGeomObj[ Object ], myGeomObj[ Vertex1 ], myGeomObj[ Vertex2 ]);
}
for (int i = 0; i < aListId.count(); i++) {
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
if (e && e->GetType() == (myType == Type_2d ? SMDSAbs_Face : SMDSAbs_Volume))
- newIndices.Add(e->GetID());
+ newIndices.Add(e->GetID());
}
mySelector->AddOrRemoveIndex( anActor->getIO(), newIndices, false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
if(!CORBA::is_nil(anObj)){
SMESH_Mesh_var aMesh = SMESH_Mesh::_narrow(anObj);
if(!CORBA::is_nil(aMesh))
- return aMesh;
+ return aMesh;
SMESH_GroupBase_var aGroup = SMESH_GroupBase::_narrow(anObj);
if(!CORBA::is_nil(aGroup))
- return aGroup->GetMesh();
+ return aGroup->GetMesh();
SMESH_subMesh_var aSubMesh = SMESH_subMesh::_narrow(anObj);
if(!CORBA::is_nil(aSubMesh))
- return aSubMesh->GetFather();
+ return aSubMesh->GetFather();
}
return SMESH_Mesh::_nil();
}
QString name = baseName;
while ( !aStudy->FindObjectByName( name.toLatin1().data(), "SMESH" ).empty() ) {
int nb = 0;
- QStringList names = name.split("_", QString::KeepEmptyParts);
- if ( names.count() > 0 ) {
- bool ok;
- int index = names.last().toInt( &ok );
- if ( ok ) {
- nb = index;
- names.removeLast();
- }
- }
- names.append( QString::number( nb+1 ) );
- name = names.join( "_" );
+ QStringList names = name.split("_", QString::KeepEmptyParts);
+ if ( names.count() > 0 ) {
+ bool ok;
+ int index = names.last().toInt( &ok );
+ if ( ok ) {
+ nb = index;
+ names.removeLast();
+ }
+ }
+ names.append( QString::number( nb+1 ) );
+ name = names.join( "_" );
}
return name;
}
if (myId->text().isEmpty()) {
if (theMess)
SUIT_MessageBox::information(this, tr("SMESH_WARNING"),
- tr("NODE_ID_IS_NOT_DEFINED"));
+ tr("NODE_ID_IS_NOT_DEFINED"));
return false;
}
if( theMess ) {
QString str( tr( "SMESH_INCORRECT_INPUT" ) );
if ( !msg.isEmpty() )
- str += "\n" + msg;
+ str += "\n" + msg;
SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
}
return false;
SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO(myMeshActor->getIO());
if (aMesh->_is_nil()) {
SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
- tr("SMESHG_NO_MESH"));
+ tr("SMESHG_NO_MESH"));
return false;
}
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- platform)).
- arg(myHelpFileName));
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
myBusy = false;
if(const SMDS_MeshElement *anElem = aMesh->FindElement(theNewText.toInt())) {
- TColStd_MapOfInteger aListInd;
- aListInd.Add(anElem->GetID());
- mySelector->AddOrRemoveIndex(anIO,aListInd, false);
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->highlight(anIO,true,true);
-
- onSelectionDone();
+ TColStd_MapOfInteger aListInd;
+ aListInd.Add(anElem->GetID());
+ mySelector->AddOrRemoveIndex(anIO,aListInd, false);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->highlight(anIO,true,true);
+
+ onSelectionDone();
}
}
}
//=======================================================================
SMESHGUI_MultiEditDlg
::SMESHGUI_MultiEditDlg(SMESHGUI* theModule,
- const int theMode,
- const bool the3d2d):
+ const int theMode,
+ const bool the3d2d):
QDialog(SMESH::GetDesktop(theModule)),
mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
myToAllChk = new QCheckBox(tr("TO_ALL"), mySelGrp);
mySelGrpLayout->addWidget(myToAllChk, mySelGrpLayout->rowCount(), 0,
- 1, mySelGrpLayout->columnCount());
+ 1, mySelGrpLayout->columnCount());
// Split/Join criterion group
myCriterionGrp = new QGroupBox(tr("SPLIT_JOIN_CRITERION"), aMainGrp);
// skl 07.02.2006
SMDS_Mesh* aMesh = myActor->GetObject()->GetMesh();
if( myFilterType == SMESH::TriaFilter ||
- myFilterType == SMESH::QuadFilter ||
- myFilterType == SMESH::FaceFilter ) {
- SMDS_FaceIteratorPtr it = aMesh->facesIterator();
- while(it->more()) {
- const SMDS_MeshFace* f = it->next();
- if(myFilterType == SMESH::FaceFilter) {
- myIds.Add(f->GetID());
- }
- else if( myFilterType==SMESH::TriaFilter &&
- ( f->NbNodes()==3 || f->NbNodes()==6 ) ) {
- myIds.Add(f->GetID());
- }
- else if( myFilterType==SMESH::QuadFilter &&
- ( f->NbNodes()==4 || f->NbNodes()==8 ) ) {
- myIds.Add(f->GetID());
- }
- }
+ myFilterType == SMESH::QuadFilter ||
+ myFilterType == SMESH::FaceFilter ) {
+ SMDS_FaceIteratorPtr it = aMesh->facesIterator();
+ while(it->more()) {
+ const SMDS_MeshFace* f = it->next();
+ if(myFilterType == SMESH::FaceFilter) {
+ myIds.Add(f->GetID());
+ }
+ else if( myFilterType==SMESH::TriaFilter &&
+ ( f->NbNodes()==3 || f->NbNodes()==6 ) ) {
+ myIds.Add(f->GetID());
+ }
+ else if( myFilterType==SMESH::QuadFilter &&
+ ( f->NbNodes()==4 || f->NbNodes()==8 ) ) {
+ myIds.Add(f->GetID());
+ }
+ }
}
else if(myFilterType == SMESH::VolumeFilter) {
- SMDS_VolumeIteratorPtr it = aMesh->volumesIterator();
- while(it->more()) {
- const SMDS_MeshVolume* f = it->next();
- myIds.Add(f->GetID());
- }
+ SMDS_VolumeIteratorPtr it = aMesh->volumesIterator();
+ while(it->more()) {
+ const SMDS_MeshVolume* f = it->next();
+ myIds.Add(f->GetID());
+ }
}
/* commented by skl 07.02.2006
TVisualObjPtr aVisualObj = anActor->GetObject();
for (int i = 0, n = aGrid->GetNumberOfCells(); i < n; i++) {
vtkCell* aCell = aGrid->GetCell(i);
if (aCell != 0) {
- vtkTriangle* aTri = vtkTriangle::SafeDownCast(aCell);
- vtkQuad* aQua = vtkQuad::SafeDownCast(aCell);
- vtkPolygon* aPG = vtkPolygon::SafeDownCast(aCell);
+ vtkTriangle* aTri = vtkTriangle::SafeDownCast(aCell);
+ vtkQuad* aQua = vtkQuad::SafeDownCast(aCell);
+ vtkPolygon* aPG = vtkPolygon::SafeDownCast(aCell);
- vtkCell3D* a3d = vtkCell3D::SafeDownCast(aCell);
- vtkConvexPointSet* aPH = vtkConvexPointSet::SafeDownCast(aCell);
+ vtkCell3D* a3d = vtkCell3D::SafeDownCast(aCell);
+ vtkConvexPointSet* aPH = vtkConvexPointSet::SafeDownCast(aCell);
- if (aTri && myFilterType == SMESHGUI_TriaFilter ||
+ if (aTri && myFilterType == SMESHGUI_TriaFilter ||
aQua && myFilterType == SMESHGUI_QuadFilter ||
(aTri || aQua || aPG) && myFilterType == SMESHGUI_FaceFilter ||
(a3d || aPH) && myFilterType == SMESHGUI_VolumeFilter) {
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- platform)).
- arg(myHelpFileName));
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
if (aNbItems > 0) {
QStringList anElements = aListStr.split(" ", QString::SkipEmptyParts);
for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
- QList<QListWidgetItem*> items = myListBox->findItems(*it, Qt::MatchExactly);
- QListWidgetItem* anItem;
- foreach(anItem, items)
- anItem->setSelected(true);
+ QList<QListWidgetItem*> items = myListBox->findItems(*it, Qt::MatchExactly);
+ QListWidgetItem* anItem;
+ foreach(anItem, items)
+ anItem->setSelected(true);
}
}
myMesh = SMESH::GetMeshByIO(anIO);
if( theMess ) {
QString str( tr( "SMESH_INCORRECT_INPUT" ) );
if ( !msg.isEmpty() )
- str += "\n" + msg;
+ str += "\n" + msg;
SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
}
return false;
void setSelectionMode();
virtual bool isIdValid( const int ) const;
virtual bool process( SMESH::SMESH_MeshEditor_ptr,
- const SMESH::long_array& ) = 0;
+ const SMESH::long_array& ) = 0;
int entityType();
protected:
else if ( getSMESHGUI() == 0 )
{
SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
- tr( "NO_MODULE" ) );
+ tr( "NO_MODULE" ) );
return false;
}
else if ( isStudyLocked() )
platform = "application";
#endif
SUIT_MessageBox::warning( desktop(), tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- platform)).
- arg(myHelpFileName) );
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName) );
}
}
{
if ( theMess )
SUIT_MessageBox::warning( SMESHGUI::desktop(), tr( "WRN_WARNING" ),
- tr( "WRN_STUDY_LOCKED" ) );
+ tr( "WRN_STUDY_LOCKED" ) );
return true;
}
}
return theOtherOp && theOtherOp->inherits( "SMESHGUI_Operation" ) &&
( !anOps.contains( theOtherOp->metaObject()->className() ) ||
- anOps.contains( metaObject()->className() ) );
+ anOps.contains( metaObject()->className() ) );
return true;
}
QPoint aQPnt = mapCoords( aPoint.x, aPoint.y );
painter.drawPie( aQPnt.x() - Radius, aQPnt.y() - Radius,
- Radius * 2, Radius * 2, 0, 360 * 16 );
+ Radius * 2, Radius * 2, 0, 360 * 16 );
painter.drawText( aQPnt.x() + Shift, aQPnt.y() - Shift,
- QString::number( i+1 ) );
+ QString::number( i+1 ) );
}
// Draw lines
~SMESHGUI_PatternWidget();
void SetPoints( const PointVector&,
- const QVector<int>&,
- const ConnectivityVector& );
+ const QVector<int>&,
+ const ConnectivityVector& );
private:
PointVector myPoints;
connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) );
connect( mySMESHGUI, SIGNAL ( SignalDeactivateActiveDialog() ),
- this, SLOT( DeactivateActiveDialog() ) );
+ this, SLOT( DeactivateActiveDialog() ) );
/* to close dialog if study change */
connect( mySMESHGUI, SIGNAL ( SignalCloseAllDialogs() ),
- this, SLOT( ClickOnCancel() ) );
+ this, SLOT( ClickOnCancel() ) );
}
//=================================================================================
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
QColor titleColor = mgr->colorValue("SMESH", "scalar_bar_title_color",
- QColor(255, 255, 255));
+ QColor(255, 255, 255));
myTitleColorBtn->setColor(titleColor);
myTitleFontCombo->setCurrentIndex(0);
if (mgr->hasValue("SMESH", "scalar_bar_title_font")) {
myTitleItalicCheck->setChecked( f.italic() );
myTitleShadowCheck->setChecked( f.overline() );
}
-
+
QColor labelColor = mgr->colorValue("SMESH", "scalar_bar_label_color",
- QColor(255, 255, 255));
+ QColor(255, 255, 255));
myLabelsColorBtn->setColor(labelColor);
myLabelsFontCombo->setCurrentIndex(0);
if (mgr->hasValue("SMESH", "scalar_bar_label_font")) {
QString name = isHoriz ? "scalar_bar_horizontal_%1" : "scalar_bar_vertical_%1";
myIniX = mgr->doubleValue("SMESH", name.arg( "x" ),
- myHorizRadioBtn->isChecked() ? DEF_HOR_X : DEF_VER_X);
+ myHorizRadioBtn->isChecked() ? DEF_HOR_X : DEF_VER_X);
myIniY = mgr->doubleValue("SMESH", name.arg( "y" ),
- myHorizRadioBtn->isChecked() ? DEF_HOR_Y : DEF_VER_Y);
+ myHorizRadioBtn->isChecked() ? DEF_HOR_Y : DEF_VER_Y);
myIniW = mgr->doubleValue("SMESH", name.arg( "width" ),
- myHorizRadioBtn->isChecked() ? DEF_HOR_W : DEF_VER_W);
+ myHorizRadioBtn->isChecked() ? DEF_HOR_W : DEF_VER_W);
myIniH = mgr->doubleValue("SMESH", name.arg( "height" ),
- myHorizRadioBtn->isChecked() ? DEF_HOR_H : DEF_VER_H);
+ myHorizRadioBtn->isChecked() ? DEF_HOR_H : DEF_VER_H);
setOriginAndSize(myIniX, myIniY, myIniW, myIniH);
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- platform)).
- arg(myHelpFileName));
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
if( anIO->hasEntry() ) {
SMESH_Actor* anActor = SMESH::FindActorByEntry(anIO->getEntry());
if ( anActor && anActor->GetScalarBarActor() && anActor->GetControlMode() != SMESH_Actor::eNone ) {
- myActor = anActor;
- vtkScalarBarActor* myScalarBarActor = myActor->GetScalarBarActor();
-
- if ( myScalarBarActor->GetLookupTable() ) {
- vtkFloatingPointType *range = myScalarBarActor->GetLookupTable()->GetRange();
- myMinEdit->setText( QString::number( range[0],'g',12 ) );
- myMaxEdit->setText( QString::number( range[1],'g',12 ) );
- }
-
- vtkTextProperty* aTitleTextPrp = myScalarBarActor->GetTitleTextProperty();
- vtkFloatingPointType aTColor[3];
- aTitleTextPrp->GetColor( aTColor );
- myTitleColorBtn->setColor( QColor( (int)( aTColor[0]*255 ), (int)( aTColor[1]*255 ), (int)( aTColor[2]*255 ) ) );
- myTitleFontCombo->setCurrentIndex( aTitleTextPrp->GetFontFamily() );
- myTitleBoldCheck->setChecked( aTitleTextPrp->GetBold() );
- myTitleItalicCheck->setChecked( aTitleTextPrp->GetItalic() );
- myTitleShadowCheck->setChecked( aTitleTextPrp->GetShadow() );
-
- vtkTextProperty* aLabelsTextPrp = myScalarBarActor->GetLabelTextProperty();
- vtkFloatingPointType aLColor[3];
- aLabelsTextPrp->GetColor( aLColor );
- myLabelsColorBtn->setColor( QColor( (int)( aLColor[0]*255 ), (int)( aLColor[1]*255 ), (int)( aLColor[2]*255 ) ) );
- myLabelsFontCombo->setCurrentIndex( aLabelsTextPrp->GetFontFamily() );
- myLabelsBoldCheck->setChecked( aLabelsTextPrp->GetBold() );
- myLabelsItalicCheck->setChecked( aLabelsTextPrp->GetItalic() );
- myLabelsShadowCheck->setChecked( aLabelsTextPrp->GetShadow() );
-
- myLabelsSpin->setValue( myScalarBarActor->GetNumberOfLabels() );
- myColorsSpin->setValue( myScalarBarActor->GetMaximumNumberOfColors() );
-
- if ( myScalarBarActor->GetOrientation() == VTK_ORIENT_VERTICAL )
- myVertRadioBtn->setChecked( true );
- else
- myHorizRadioBtn->setChecked( true );
- myIniOrientation = myVertRadioBtn->isChecked();
-
- myIniX = myScalarBarActor->GetPosition()[0];
- myIniY = myScalarBarActor->GetPosition()[1];
- myIniW = myScalarBarActor->GetWidth();
- myIniH = myScalarBarActor->GetHeight();
- setOriginAndSize( myIniX, myIniY, myIniW, myIniH );
-
- myRangeGrp->setEnabled( true );
- myFontGrp->setEnabled( true );
- myLabColorGrp->setEnabled( true );
- myOrientationGrp->setEnabled( true );
- myOriginDimGrp->setEnabled( true );
- myOkBtn->setEnabled( true );
- myApplyBtn->setEnabled( true );
- return;
+ myActor = anActor;
+ vtkScalarBarActor* myScalarBarActor = myActor->GetScalarBarActor();
+
+ if ( myScalarBarActor->GetLookupTable() ) {
+ vtkFloatingPointType *range = myScalarBarActor->GetLookupTable()->GetRange();
+ myMinEdit->setText( QString::number( range[0],'g',12 ) );
+ myMaxEdit->setText( QString::number( range[1],'g',12 ) );
+ }
+
+ vtkTextProperty* aTitleTextPrp = myScalarBarActor->GetTitleTextProperty();
+ vtkFloatingPointType aTColor[3];
+ aTitleTextPrp->GetColor( aTColor );
+ myTitleColorBtn->setColor( QColor( (int)( aTColor[0]*255 ), (int)( aTColor[1]*255 ), (int)( aTColor[2]*255 ) ) );
+ myTitleFontCombo->setCurrentIndex( aTitleTextPrp->GetFontFamily() );
+ myTitleBoldCheck->setChecked( aTitleTextPrp->GetBold() );
+ myTitleItalicCheck->setChecked( aTitleTextPrp->GetItalic() );
+ myTitleShadowCheck->setChecked( aTitleTextPrp->GetShadow() );
+
+ vtkTextProperty* aLabelsTextPrp = myScalarBarActor->GetLabelTextProperty();
+ vtkFloatingPointType aLColor[3];
+ aLabelsTextPrp->GetColor( aLColor );
+ myLabelsColorBtn->setColor( QColor( (int)( aLColor[0]*255 ), (int)( aLColor[1]*255 ), (int)( aLColor[2]*255 ) ) );
+ myLabelsFontCombo->setCurrentIndex( aLabelsTextPrp->GetFontFamily() );
+ myLabelsBoldCheck->setChecked( aLabelsTextPrp->GetBold() );
+ myLabelsItalicCheck->setChecked( aLabelsTextPrp->GetItalic() );
+ myLabelsShadowCheck->setChecked( aLabelsTextPrp->GetShadow() );
+
+ myLabelsSpin->setValue( myScalarBarActor->GetNumberOfLabels() );
+ myColorsSpin->setValue( myScalarBarActor->GetMaximumNumberOfColors() );
+
+ if ( myScalarBarActor->GetOrientation() == VTK_ORIENT_VERTICAL )
+ myVertRadioBtn->setChecked( true );
+ else
+ myHorizRadioBtn->setChecked( true );
+ myIniOrientation = myVertRadioBtn->isChecked();
+
+ myIniX = myScalarBarActor->GetPosition()[0];
+ myIniY = myScalarBarActor->GetPosition()[1];
+ myIniW = myScalarBarActor->GetWidth();
+ myIniH = myScalarBarActor->GetHeight();
+ setOriginAndSize( myIniX, myIniY, myIniW, myIniH );
+
+ myRangeGrp->setEnabled( true );
+ myFontGrp->setEnabled( true );
+ myLabColorGrp->setEnabled( true );
+ myOrientationGrp->setEnabled( true );
+ myOriginDimGrp->setEnabled( true );
+ myOkBtn->setEnabled( true );
+ myApplyBtn->setEnabled( true );
+ return;
}
}
}
*/
//=================================================================================================
void SMESHGUI_Preferences_ScalarBarDlg::setOriginAndSize( const double x,
- const double y,
- const double w,
- const double h )
+ const double y,
+ const double w,
+ const double h )
{
blockSignals( true );
myXSpin->setValue( x );
setOriginAndSize( myIniX, myIniY, myIniW, myIniH );
else
setOriginAndSize( aOrientation ? DEF_VER_X : DEF_HOR_X,
- aOrientation ? DEF_VER_Y : DEF_HOR_Y,
- aOrientation ? DEF_VER_W : DEF_HOR_W,
- aOrientation ? DEF_VER_H : DEF_HOR_H );
+ aOrientation ? DEF_VER_Y : DEF_HOR_Y,
+ aOrientation ? DEF_VER_W : DEF_HOR_W,
+ aOrientation ? DEF_VER_H : DEF_HOR_H );
}
//=================================================================================================
void closeEvent( QCloseEvent* );
void setOriginAndSize( const double,
- const double,
- const double,
- const double );
+ const double,
+ const double,
+ const double );
void initScalarBarFromResources();
protected slots:
/* to close dialog if study change */
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
connect(myEditCurrentArgument, SIGNAL(textChanged(const QString&)),
- SLOT(onTextChange(const QString&)));
+ SLOT(onTextChange(const QString&)));
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(CellSelection);
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- platform)).
- arg(myHelpFileName));
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
for (int i = 0; i < aListId.count(); i++) {
- if(const SMDS_MeshElement *anElem = aMesh->FindElement(aListId[i].toInt())) {
- newIndices.Add(anElem->GetID());
- myNbOkElements++;
- }
+ if(const SMDS_MeshElement *anElem = aMesh->FindElement(aListId[i].toInt())) {
+ newIndices.Add(anElem->GetID());
+ myNbOkElements++;
+ }
}
mySelector->AddOrRemoveIndex(anIO,newIndices,false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->highlight(anIO,true,true);
+ aViewWindow->highlight(anIO,true,true);
}
}
case 0: /* default constructor */
{
if(send == SelectButtonC1A1) {
- LineEditC1A1->setFocus();
- myEditCurrentArgument = LineEditC1A1;
+ LineEditC1A1->setFocus();
+ myEditCurrentArgument = LineEditC1A1;
}
SelectionIntoArgument();
break;
{
if(myMesh->_is_nil()) {
SUIT_MessageBox::critical(this,
- tr("SMESH_ERROR"),
- tr("NO_MESH_SELECTED"));
+ tr("SMESH_ERROR"),
+ tr("NO_MESH_SELECTED"));
return;
}
if ( !myFilterDlg )
/* to close dialog if study change */
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
connect(myEditCurrentArgument, SIGNAL(textChanged(const QString&)),
- SLOT(onTextChange(const QString&)));
+ SLOT(onTextChange(const QString&)));
SMESH::SetPointRepresentation(true);
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- platform)).
- arg(myHelpFileName));
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
for (int i = 0; i < aListId.count(); i++) {
- if (const SMDS_MeshNode *aNode = aMesh->FindNode(aListId[i].toInt())) {
- newIndices.Add(aNode->GetID());
- myNbOkNodes++;
- }
+ if (const SMDS_MeshNode *aNode = aMesh->FindNode(aListId[i].toInt())) {
+ newIndices.Add(aNode->GetID());
+ myNbOkNodes++;
+ }
}
mySelector->AddOrRemoveIndex(anIO,newIndices,false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->highlight(anIO,true,true);
+ aViewWindow->highlight(anIO,true,true);
}
}
case 0: /* default constructor */
{
if(send == SelectButtonC1A1) {
- LineEditC1A1->setFocus();
- myEditCurrentArgument = LineEditC1A1;
+ LineEditC1A1->setFocus();
+ myEditCurrentArgument = LineEditC1A1;
}
SelectionIntoArgument();
break;
{
if(myMesh->_is_nil()) {
SUIT_MessageBox::critical(this,
- tr("SMESH_ERROR"),
- tr("NO_MESH_SELECTED"));
+ tr("SMESH_ERROR"),
+ tr("NO_MESH_SELECTED"));
return;
}
if ( !myFilterDlg )
setModal(false);
setAttribute(Qt::WA_DeleteOnClose, true);
setWindowTitle(unit == 0 ?
- tr("SMESH_RENUMBERING_NODES_TITLE") :
- tr("SMESH_RENUMBERING_ELEMENTS_TITLE"));
+ tr("SMESH_RENUMBERING_NODES_TITLE") :
+ tr("SMESH_RENUMBERING_ELEMENTS_TITLE"));
setSizeGripEnabled(true);
SUIT_ResourceMgr* resMgr = SMESH::GetResourceMgr( mySMESHGUI );
QPixmap image0(resMgr->loadPixmap("SMESH", unit == 0 ?
- tr("ICON_DLG_RENUMBERING_NODES") :
- tr("ICON_DLG_RENUMBERING_ELEMENTS")));
+ tr("ICON_DLG_RENUMBERING_NODES") :
+ tr("ICON_DLG_RENUMBERING_ELEMENTS")));
QPixmap image1(resMgr->loadPixmap("SMESH",tr("ICON_SELECT")));
QVBoxLayout* SMESHGUI_RenumberingDlgLayout = new QVBoxLayout(this);
/***************************************************************/
GroupConstructors = new QGroupBox(unit == 0 ?
- tr("SMESH_NODES") :
- tr("SMESH_ELEMENTS"),
- this);
+ tr("SMESH_NODES") :
+ tr("SMESH_ELEMENTS"),
+ this);
myHelpFileName = unit == 0 ?
"renumbering_nodes_and_elements_page.html#renumbering_nodes_anchor" :
"renumbering_nodes_and_elements_page.html#renumbering_elements_anchor";
bool isUnitsLabeled = false;
if (myUnit == 0 && anActor) {
- isUnitsLabeled = anActor->GetPointsLabeled();
- if (isUnitsLabeled) anActor->SetPointsLabeled(false);
+ isUnitsLabeled = anActor->GetPointsLabeled();
+ if (isUnitsLabeled) anActor->SetPointsLabeled(false);
}
else if (myUnit == 1 && anActor) {
- isUnitsLabeled = anActor->GetCellsLabeled();
- if (isUnitsLabeled) anActor->SetCellsLabeled(false);
+ isUnitsLabeled = anActor->GetCellsLabeled();
+ if (isUnitsLabeled) anActor->SetCellsLabeled(false);
}
SUIT_OverrideCursor aWaitCursor;
if (myUnit == 0) {
- aMeshEditor->RenumberNodes();
- if (isUnitsLabeled && anActor) anActor->SetPointsLabeled(true);
+ aMeshEditor->RenumberNodes();
+ if (isUnitsLabeled && anActor) anActor->SetPointsLabeled(true);
}
else if (myUnit == 1) {
- aMeshEditor->RenumberElements();
- if (isUnitsLabeled && anActor) anActor->SetCellsLabeled(true);
+ aMeshEditor->RenumberElements();
+ if (isUnitsLabeled && anActor) anActor->SetCellsLabeled(true);
}
}
catch(...) {
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- platform)).
- arg(myHelpFileName));
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
Handle(SALOME_InteractiveObject) IO = aList.First();
myMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IO);
if (myMesh->_is_nil())
- aString = "";
+ aString = "";
}
}
{
case 0: /* default constructor */
{
- if(send == SelectButton) {
- LineEditMesh->setFocus();
- myEditCurrentArgument = LineEditMesh;
- }
- SelectionIntoArgument();
- break;
+ if(send == SelectButton) {
+ LineEditMesh->setFocus();
+ myEditCurrentArgument = LineEditMesh;
+ }
+ SelectionIntoArgument();
+ break;
}
}
}
myIDs.clear();
myNbOkElements = 0;
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(aSelMode);
+ aViewWindow->SetSelectionMode(aSelMode);
}
myEditCurrentArgument = (QWidget*)LineEditElements;
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() ) {
if( CheckBoxMesh->isChecked() ) {
- if( GetConstructorId() == 0 )
- SMESH::ListOfGroups_var groups =
- aMeshEditor->RotationSweepObject1DMakeGroups(mySelectedObject, anAxis,
- anAngle, aNbSteps, aTolerance);
- else
- SMESH::ListOfGroups_var groups =
- aMeshEditor->RotationSweepObject2DMakeGroups(mySelectedObject, anAxis,
- anAngle, aNbSteps, aTolerance);
- }
- else
- SMESH::ListOfGroups_var groups =
- aMeshEditor->RotationSweepMakeGroups(anElementsId.inout(), anAxis,
- anAngle, aNbSteps, aTolerance);
+ if( GetConstructorId() == 0 )
+ SMESH::ListOfGroups_var groups =
+ aMeshEditor->RotationSweepObject1DMakeGroups(mySelectedObject, anAxis,
+ anAngle, aNbSteps, aTolerance);
+ else
+ SMESH::ListOfGroups_var groups =
+ aMeshEditor->RotationSweepObject2DMakeGroups(mySelectedObject, anAxis,
+ anAngle, aNbSteps, aTolerance);
+ }
+ else
+ SMESH::ListOfGroups_var groups =
+ aMeshEditor->RotationSweepMakeGroups(anElementsId.inout(), anAxis,
+ anAngle, aNbSteps, aTolerance);
}
else {
if( CheckBoxMesh->isChecked() ) {
- if( GetConstructorId() == 0 )
- aMeshEditor->RotationSweepObject1D(mySelectedObject, anAxis, anAngle, aNbSteps, aTolerance);
- else
- aMeshEditor->RotationSweepObject2D(mySelectedObject, anAxis, anAngle, aNbSteps, aTolerance);
- }
- else
- aMeshEditor->RotationSweep(anElementsId.inout(), anAxis, anAngle, aNbSteps, aTolerance);
+ if( GetConstructorId() == 0 )
+ aMeshEditor->RotationSweepObject1D(mySelectedObject, anAxis, anAngle, aNbSteps, aTolerance);
+ else
+ aMeshEditor->RotationSweepObject2D(mySelectedObject, anAxis, anAngle, aNbSteps, aTolerance);
+ }
+ else
+ aMeshEditor->RotationSweep(anElementsId.inout(), anAxis, anAngle, aNbSteps, aTolerance);
}
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- platform)).
- arg(myHelpFileName));
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
for (int i = 0; i < aListId.count(); i++) {
- const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
- if (e)
- newIndices.Add(e->GetID());
- myNbOkElements++;
+ const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
+ if (e)
+ newIndices.Add(e->GetID());
+ myNbOkElements++;
}
mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->highlight( myActor->getIO(), true, true );
+ aViewWindow->highlight( myActor->getIO(), true, true );
myElementsId = theNewText;
}
aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, IO, aString);
myElementsId = aString;
if (aNbUnits < 1)
- return;
+ return;
}
myNbOkElements = true;
} else {
SMESH::SetPointRepresentation(false);
if (CheckBoxMesh->isChecked()) {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(ActorSelection);
+ aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
} else {
int aConstructorId = GetConstructorId();
if (aConstructorId == 0)
- {
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(EdgeSelection);
- }
+ {
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(EdgeSelection);
+ }
else if (aConstructorId == 1)
- {
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(FaceSelection);
- }
+ {
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(FaceSelection);
+ }
}
} else if (send == SelectPointButton) {
myEditCurrentArgument = (QWidget*)SpinBox_X;
int aConstructorId = GetConstructorId();
if (aConstructorId == 0)
{
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(EdgeSelection);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(EdgeSelection);
}
else if (aConstructorId == 1)
{
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(FaceSelection);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(FaceSelection);
}
LineEditElements->setReadOnly(false);
bool SMESHGUI_RevolutionDlg::IsAxisOk()
{
return (SpinBox_DX->GetValue() != 0 ||
- SpinBox_DY->GetValue() != 0 ||
- SpinBox_DZ->GetValue() != 0);
+ SpinBox_DY->GetValue() != 0 ||
+ SpinBox_DZ->GetValue() != 0);
}
//=================================================================================
anElementsId->length(aListElementsId.count());
for (int i = 0; i < aListElementsId.count(); i++)
- anElementsId[i] = aListElementsId[i].toInt();
+ anElementsId[i] = aListElementsId[i].toInt();
SMESH::AxisStruct anAxis;
double aTolerance = SpinBox_Tolerance->GetValue();
if (GroupAngle->checkedId() == 1)
- anAngle = anAngle/aNbSteps;
+ anAngle = anAngle/aNbSteps;
try {
- SUIT_OverrideCursor aWaitCursor;
- SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
+ SUIT_OverrideCursor aWaitCursor;
+ SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
if( CheckBoxMesh->isChecked() ) {
- if( GetConstructorId() == 0 )
- aMeshEditor->RotationSweepObject1D(mySelectedObject, anAxis,
- anAngle, aNbSteps, aTolerance);
- else
- aMeshEditor->RotationSweepObject2D(mySelectedObject, anAxis,
- anAngle, aNbSteps, aTolerance);
- }
- else
- aMeshEditor->RotationSweep(anElementsId.inout(),
- anAxis,
- anAngle,
- aNbSteps,
- aTolerance);
- SMESH::MeshPreviewStruct_var aMeshPreviewStruct = aMeshEditor->GetPreviewData();
- mySimulation->SetData(aMeshPreviewStruct._retn());
+ if( GetConstructorId() == 0 )
+ aMeshEditor->RotationSweepObject1D(mySelectedObject, anAxis,
+ anAngle, aNbSteps, aTolerance);
+ else
+ aMeshEditor->RotationSweepObject2D(mySelectedObject, anAxis,
+ anAngle, aNbSteps, aTolerance);
+ }
+ else
+ aMeshEditor->RotationSweep(anElementsId.inout(),
+ anAxis,
+ anAngle,
+ aNbSteps,
+ aTolerance);
+ SMESH::MeshPreviewStruct_var aMeshPreviewStruct = aMeshEditor->GetPreviewData();
+ mySimulation->SetData(aMeshPreviewStruct._retn());
} catch (...) {}
}
else
{
if(myMesh->_is_nil()) {
SUIT_MessageBox::critical(this,
- tr("SMESH_ERROR"),
- tr("NO_MESH_SELECTED"));
+ tr("SMESH_ERROR"),
+ tr("NO_MESH_SELECTED"));
return;
}
if ( !myFilterDlg )
aMeshEditor->RotateObject(mySelectedObject, anAxis, anAngle, false);
else
aMeshEditor->Rotate(anElementsId, anAxis, anAngle, false);
- if( !myMesh->_is_nil())
- myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
+ if( !myMesh->_is_nil())
+ myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
break;
case COPY_ELEMS_BUTTON:
if ( makeGroups ) {
else
aMeshEditor->Rotate(anElementsId, anAxis, anAngle, true);
}
- if( !myMesh->_is_nil())
- myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
+ if( !myMesh->_is_nil())
+ myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
break;
case MAKE_MESH_BUTTON:
SMESH::SMESH_Mesh_var mesh;
else
mesh = aMeshEditor->RotateMakeMesh(anElementsId, anAxis, anAngle, makeGroups,
LineEditNewMesh->text().toLatin1().data());
- if( !mesh->_is_nil())
- mesh->SetParameters( aParameters.join(":").toLatin1().constData() );
+ if( !mesh->_is_nil())
+ mesh->SetParameters( aParameters.join(":").toLatin1().constData() );
}
} catch (...) {
}
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- platform)).
- arg(myHelpFileName));
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
for (int i = 0; i < aListId.count(); i++) {
- const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
- if (e)
- newIndices.Add(e->GetID());
- myNbOkElements++;
+ const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
+ if (e)
+ newIndices.Add(e->GetID());
+ myNbOkElements++;
}
mySelector->AddOrRemoveIndex( anIO, newIndices, false );
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->highlight( anIO, true, true );
+ aViewWindow->highlight( anIO, true, true );
myElementsId = theNewText;
}
myEditCurrentArgument = (QWidget*)LineEditElements;
SMESH::SetPointRepresentation(false);
if (CheckBoxMesh->isChecked()) {
- if ( aViewWindow )
- aViewWindow->SetSelectionMode(ActorSelection);
+ if ( aViewWindow )
+ aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
} else {
- if ( aViewWindow )
- aViewWindow->SetSelectionMode( CellSelection );
- }
+ if ( aViewWindow )
+ aViewWindow->SetSelectionMode( CellSelection );
+ }
} else if (send == SelectPointButton) {
myEditCurrentArgument = (QWidget*)SpinBox_X;
SMESH::SetPointRepresentation(true);
- if ( aViewWindow )
- aViewWindow->SetSelectionMode( NodeSelection );
+ if ( aViewWindow )
+ aViewWindow->SetSelectionMode( NodeSelection );
} else if (send == SelectVectorButton) {
myEditCurrentArgument = (QWidget*)SpinBox_DX;
SMESH::SetPointRepresentation(true);
- if ( aViewWindow )
- aViewWindow->SetSelectionMode( NodeSelection );
+ if ( aViewWindow )
+ aViewWindow->SetSelectionMode( NodeSelection );
}
break;
}
bool SMESHGUI_RotationDlg::IsAxisOk()
{
return (SpinBox_DX->GetValue() != 0 ||
- SpinBox_DY->GetValue() != 0 ||
- SpinBox_DZ->GetValue() != 0);
+ SpinBox_DY->GetValue() != 0 ||
+ SpinBox_DZ->GetValue() != 0);
}
//=================================================================================
{
if(myMesh->_is_nil()) {
SUIT_MessageBox::critical(this,
- tr("SMESH_ERROR"),
- tr("NO_MESH_SELECTED"));
+ tr("SMESH_ERROR"),
+ tr("NO_MESH_SELECTED"));
return;
}
if ( !myFilterDlg )
SMESH::SMESH_Mesh_var mesh = SMESH::GetMeshByIO(io); // m,sm,gr->m
if ( !mesh->_is_nil() ) {*/
_PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
- //FindSObject( mesh );
+ //FindSObject( mesh );
if ( so ) {
CORBA::Object_var obj = SMESH::SObjectToObject(so, SMESH::GetActiveStudyDocument());
if(!CORBA::is_nil(obj)){
SMESH_Actor* actor = SMESH::FindActorByEntry( ent.toLatin1().data() );
if ( actor && actor->hasIO() ) {
if(SVTK_ViewWindow* aViewWindow = SMESH::GetCurrentVtkView())
- return QVariant( aViewWindow->isVisible( actor->getIO() ) );
+ return QVariant( aViewWindow->isVisible( actor->getIO() ) );
}
}
return QVariant( false );
//! Select some nodes or elements in VTK
void addOrRemoveIndex( const Handle( SALOME_InteractiveObject )&,
- const TColStd_MapOfInteger&, const bool );
+ const TColStd_MapOfInteger&, const bool isModeShift);
SVTK_ViewWindow* viewWindow() const;
SVTK_Selector* selector() const;
LineEdit5->setEnabled(false);
if (!CheckBoxPolygons->isVisible())
- CheckBoxPolygons->show();
+ CheckBoxPolygons->show();
if (!CheckBoxPolyedrs->isVisible())
- CheckBoxPolyedrs->show();
+ CheckBoxPolyedrs->show();
myOk5 = true;
SMESH::SetPointRepresentation(false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(CellSelection);
+ aViewWindow->SetSelectionMode(CellSelection);
break;
}
}
LineEdit4->text().toLong(),
LineEdit5->text().toLong(),
LineEdit6->text().toLong(),
- toCreatePolygons,
- toCreatePolyedrs);
+ toCreatePolygons,
+ toCreatePolyedrs);
else if (aConstructorId == 1)
anError = aMeshEditor->SewConformFreeBorders(LineEdit1->text().toLong(),
LineEdit2->text().toLong(),
LineEdit3->text().toLong(),
LineEdit4->text().toLong(),
LineEdit6->text().toLong(),
- toCreatePolygons,
- toCreatePolyedrs);
+ toCreatePolygons,
+ toCreatePolyedrs);
else if (aConstructorId == 3) {
QStringList aListElementsId1 = LineEdit1->text().split(" ", QString::SkipEmptyParts);
QStringList aListElementsId2 = LineEdit4->text().split(" ", QString::SkipEmptyParts);
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- platform)).
- arg(myHelpFileName));
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
SMESH::SetPointRepresentation(true);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(NodeSelection);
+ aViewWindow->SetSelectionMode(NodeSelection);
const SMDS_MeshNode * n = aMesh->FindNode(theNewText.toInt());
if (n) {
- newIndices.Add(n->GetID());
- mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->highlight( myActor->getIO(), true, true );
-
+ newIndices.Add(n->GetID());
+ mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->highlight( myActor->getIO(), true, true );
+
if (send == LineEdit1)
myOk1 = true;
else if (send == LineEdit2)
SMESH::SetPointRepresentation(false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(CellSelection);
+ aViewWindow->SetSelectionMode(CellSelection);
QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
for (int i = 0; i < aListId.count(); i++) {
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
if (e)
- newIndices.Add(e->GetID());
-
+ newIndices.Add(e->GetID());
+
if (!isEvenOneExists)
isEvenOneExists = true;
}
mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->highlight( myActor->getIO(), true, true );
+ aViewWindow->highlight( myActor->getIO(), true, true );
if (isEvenOneExists) {
if (send == LineEdit1)
QLabel* anIdLabel = new QLabel( tr("ELEMENT_ID"), aMainGrp );
myElementId = new QLineEdit( aMainGrp );
myElementId->setValidator( new SMESHGUI_IdValidator( theParent,
- !myIsMultipleAllowed ? 1 : 0 ) ); // 0 for any number of entities
+ !myIsMultipleAllowed ? 1 : 0 ) ); // 0 for any number of entities
// shape name
QLabel* aNameLabel = new QLabel( tr("GEOMETRY_NAME"), aMainGrp );
int shapeDim = 0; // max dim with several shapes
//if ( /*mySelectionMgr*/ selectionMgr()->isOk(anIObj) ) // check that the mesh has a valid shape
{
- _PTR(SObject) aSO = SMESH::FindSObject(myMesh.in());
- GEOM::GEOM_Object_var mainShape = SMESH::GetGeom(aSO);
- if ( !mainShape->_is_nil() )
- {
- TopoDS_Shape aShape;
- if ( GEOMBase::GetShape(mainShape, aShape))
- {
- TopAbs_ShapeEnum types[4] = { TopAbs_EDGE, TopAbs_FACE, TopAbs_SHELL, TopAbs_SOLID };
- for ( int dim = 4; dim > 0; --dim ) {
- TopAbs_ShapeEnum type = types[ dim - 1 ];
- TopAbs_ShapeEnum avoid = ( type == TopAbs_SHELL ) ? TopAbs_SOLID : TopAbs_SHAPE;
- TopExp_Explorer exp( aShape, type, avoid );
- for ( ; nbShapes[ type ] < 2 && exp.More(); exp.Next() )
- ++nbShapes[ type ];
- if ( nbShapes[ type ] > 1 ) {
- shapeDim = dim;
- break;
- }
- }
- }
- }
+ _PTR(SObject) aSO = SMESH::FindSObject(myMesh.in());
+ GEOM::GEOM_Object_var mainShape = SMESH::GetGeom(aSO);
+ if ( !mainShape->_is_nil() )
+ {
+ TopoDS_Shape aShape;
+ if ( GEOMBase::GetShape(mainShape, aShape))
+ {
+ TopAbs_ShapeEnum types[4] = { TopAbs_EDGE, TopAbs_FACE, TopAbs_SHELL, TopAbs_SOLID };
+ for ( int dim = 4; dim > 0; --dim ) {
+ TopAbs_ShapeEnum type = types[ dim - 1 ];
+ TopAbs_ShapeEnum avoid = ( type == TopAbs_SHELL ) ? TopAbs_SOLID : TopAbs_SHAPE;
+ TopExp_Explorer exp( aShape, type, avoid );
+ for ( ; nbShapes[ type ] < 2 && exp.More(); exp.Next() )
+ ++nbShapes[ type ];
+ if ( nbShapes[ type ] > 1 ) {
+ shapeDim = dim;
+ break;
+ }
+ }
+ }
+ }
}
if (shapeDim > 0)
- {
- if ( nbShapes[ TopAbs_SHELL ] + nbShapes[ TopAbs_SOLID ] > 1 )
- shapeDim = 3;
- hasElement[ EDGE ] = shapeDim > 0 && myMesh->NbEdges();
- hasElement[ FACE ] = shapeDim > 1 && myMesh->NbFaces();
- hasElement[ VOLUME ] = shapeDim > 2 && myMesh->NbVolumes();
- }
+ {
+ if ( nbShapes[ TopAbs_SHELL ] + nbShapes[ TopAbs_SOLID ] > 1 )
+ shapeDim = 3;
+ hasElement[ EDGE ] = shapeDim > 0 && myMesh->NbEdges();
+ hasElement[ FACE ] = shapeDim > 1 && myMesh->NbFaces();
+ hasElement[ VOLUME ] = shapeDim > 2 && myMesh->NbVolumes();
+ }
myHasSolids = nbShapes[ TopAbs_SOLID ];
}
QStringList aListId = myDlg->myElementId->text().split( " ", QString::SkipEmptyParts);
if (aListId.count() == 1)
{
- int elemID = (aListId.first()).toInt();
- myGeomObj = GEOM::GEOM_Object::_duplicate(
- SMESHGUI::GetSMESHGen()->GetGeometryByMeshElement
- ( myMesh.in(), elemID, myDlg->myGeomName->text().toLatin1().constData()) );
+ int elemID = (aListId.first()).toInt();
+ myGeomObj = GEOM::GEOM_Object::_duplicate(
+ SMESHGUI::GetSMESHGen()->GetGeometryByMeshElement
+ ( myMesh.in(), elemID, myDlg->myGeomName->text().toLatin1().constData()) );
}
else
{
- GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
- _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
-
- if (geomGen->_is_nil() || !aStudy)
- return;
-
- GEOM::GEOM_IShapesOperations_var aShapesOp =
- geomGen->GetIShapesOperations(aStudy->StudyId());
- if (aShapesOp->_is_nil() )
- return;
-
- TopAbs_ShapeEnum aGroupType = TopAbs_SHAPE;
-
- std::map<double, GEOM::GEOM_Object_var> aGeomObjectsMap;
- GEOM::GEOM_Object_var aGeomObject;
-
- GEOM::GEOM_Object_var aMeshShape = myMesh->GetShapeToMesh();
-
- for ( int i = 0; i < aListId.count(); i++ )
- {
- aGeomObject =
- SMESHGUI::GetSMESHGen()->FindGeometryByMeshElement(myMesh.in(), aListId[i].toInt());
-
- if (aGeomObject->_is_nil()) continue;
-
- double anId = aShapesOp->GetSubShapeIndex(aMeshShape, aGeomObject);
- if (aShapesOp->IsDone() && aGeomObjectsMap.find(anId) == aGeomObjectsMap.end())
- {
- aGeomObjectsMap[anId] = aGeomObject;
-
- TopAbs_ShapeEnum aSubShapeType = (TopAbs_ShapeEnum)aGeomObject->GetShapeType();
- if (i == 0)
- aGroupType = aSubShapeType;
- else if (aSubShapeType != aGroupType)
- aGroupType = TopAbs_SHAPE;
- }
- }
-
- int aNumberOfGO = aGeomObjectsMap.size();
- if (aNumberOfGO == 1)
- myGeomObj = (*aGeomObjectsMap.begin()).second;
- else if (aNumberOfGO > 1)
- {
- GEOM::GEOM_IGroupOperations_var aGroupOp =
- geomGen->GetIGroupOperations(aStudy->StudyId());
- if(aGroupOp->_is_nil())
- return;
-
- GEOM::ListOfGO_var aGeomObjects = new GEOM::ListOfGO();
- aGeomObjects->length( aNumberOfGO );
-
- int i = 0;
- std::map<double, GEOM::GEOM_Object_var>::iterator anIter;
- for (anIter = aGeomObjectsMap.begin(); anIter!=aGeomObjectsMap.end(); anIter++)
- aGeomObjects[i++] = (*anIter).second;
-
- //create geometry group
- myGeomObj = aGroupOp->CreateGroup(aMeshShape, aGroupType);
- aGroupOp->UnionList(myGeomObj, aGeomObjects);
-
- if (!aGroupOp->IsDone())
- return;
- }
-
- // publish the GEOM object in study
- QString aNewGeomGroupName ( myDlg->myGeomName->text() );
-
- SALOMEDS::SObject_var aNewGroupSO =
- geomGen->AddInStudy(SMESHGUI::GetSMESHGen()->GetCurrentStudy(), myGeomObj,
- aNewGeomGroupName.toLatin1().data(), aMeshShape);
+ GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
+ _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
+
+ if (geomGen->_is_nil() || !aStudy)
+ return;
+
+ GEOM::GEOM_IShapesOperations_var aShapesOp =
+ geomGen->GetIShapesOperations(aStudy->StudyId());
+ if (aShapesOp->_is_nil() )
+ return;
+
+ TopAbs_ShapeEnum aGroupType = TopAbs_SHAPE;
+
+ std::map<double, GEOM::GEOM_Object_var> aGeomObjectsMap;
+ GEOM::GEOM_Object_var aGeomObject;
+
+ GEOM::GEOM_Object_var aMeshShape = myMesh->GetShapeToMesh();
+
+ for ( int i = 0; i < aListId.count(); i++ )
+ {
+ aGeomObject =
+ SMESHGUI::GetSMESHGen()->FindGeometryByMeshElement(myMesh.in(), aListId[i].toInt());
+
+ if (aGeomObject->_is_nil()) continue;
+
+ double anId = aShapesOp->GetSubShapeIndex(aMeshShape, aGeomObject);
+ if (aShapesOp->IsDone() && aGeomObjectsMap.find(anId) == aGeomObjectsMap.end())
+ {
+ aGeomObjectsMap[anId] = aGeomObject;
+
+ TopAbs_ShapeEnum aSubShapeType = (TopAbs_ShapeEnum)aGeomObject->GetShapeType();
+ if (i == 0)
+ aGroupType = aSubShapeType;
+ else if (aSubShapeType != aGroupType)
+ aGroupType = TopAbs_SHAPE;
+ }
+ }
+
+ int aNumberOfGO = aGeomObjectsMap.size();
+ if (aNumberOfGO == 1)
+ myGeomObj = (*aGeomObjectsMap.begin()).second;
+ else if (aNumberOfGO > 1)
+ {
+ GEOM::GEOM_IGroupOperations_var aGroupOp =
+ geomGen->GetIGroupOperations(aStudy->StudyId());
+ if(aGroupOp->_is_nil())
+ return;
+
+ GEOM::ListOfGO_var aGeomObjects = new GEOM::ListOfGO();
+ aGeomObjects->length( aNumberOfGO );
+
+ int i = 0;
+ std::map<double, GEOM::GEOM_Object_var>::iterator anIter;
+ for (anIter = aGeomObjectsMap.begin(); anIter!=aGeomObjectsMap.end(); anIter++)
+ aGeomObjects[i++] = (*anIter).second;
+
+ //create geometry group
+ myGeomObj = aGroupOp->CreateGroup(aMeshShape, aGroupType);
+ aGroupOp->UnionList(myGeomObj, aGeomObjects);
+
+ if (!aGroupOp->IsDone())
+ return;
+ }
+
+ // publish the GEOM object in study
+ QString aNewGeomGroupName ( myDlg->myGeomName->text() );
+
+ SALOMEDS::SObject_var aNewGroupSO =
+ geomGen->AddInStudy(SMESHGUI::GetSMESHGen()->GetCurrentStudy(), myGeomObj,
+ aNewGeomGroupName.toLatin1().data(), aMeshShape);
}
}
catch (const SALOME::SALOME_Exception& S_ex) {
aList.First(), aString);
if (nbElems > 0) {
if (!myIsMultipleAllowed && nbElems != 1 )
- return;
+ return;
setElementID( aString );
myDlg->setButtonEnabled( true, QtxDialog::OK );
}
{
if ( SMDS_Mesh* aMesh = actor->GetObject()->GetMesh() )
{
- SMDSAbs_ElementType type = SMDSAbs_Edge;
- switch ( myDlg->myElemTypeGroup->checkedId() ) {
- case EDGE : type = SMDSAbs_Edge; break;
- case FACE : type = SMDSAbs_Face; break;
- case VOLUME: type = SMDSAbs_Volume; break;
- default: return;
- }
- TColStd_MapOfInteger newIndices;
- QStringList aListId = theNewText.split( " ", QString::SkipEmptyParts);
- for ( int i = 0; i < aListId.count(); i++ ) {
- if ( const SMDS_MeshElement * e = aMesh->FindElement( aListId[ i ].toInt() ))
- if ( e->GetType() == type )
- newIndices.Add( e->GetID() );
- }
-
- if ( !newIndices.IsEmpty() )
- {
- if (!myIsMultipleAllowed && newIndices.Extent() != 1)
- return;
- if ( SVTK_Selector* s = selector() ) {
- s->AddOrRemoveIndex( actor->getIO(), newIndices, false );
- viewWindow()->highlight( actor->getIO(), true, true );
- myDlg->setButtonEnabled( true, QtxDialog::OK );
- }
- }
+ SMDSAbs_ElementType type = SMDSAbs_Edge;
+ switch ( myDlg->myElemTypeGroup->checkedId() ) {
+ case EDGE : type = SMDSAbs_Edge; break;
+ case FACE : type = SMDSAbs_Face; break;
+ case VOLUME: type = SMDSAbs_Volume; break;
+ default: return;
+ }
+ TColStd_MapOfInteger newIndices;
+ QStringList aListId = theNewText.split( " ", QString::SkipEmptyParts);
+ for ( int i = 0; i < aListId.count(); i++ ) {
+ if ( const SMDS_MeshElement * e = aMesh->FindElement( aListId[ i ].toInt() ))
+ if ( e->GetType() == type )
+ newIndices.Add( e->GetID() );
+ }
+
+ if ( !newIndices.IsEmpty() )
+ {
+ if (!myIsMultipleAllowed && newIndices.Extent() != 1)
+ return;
+ if ( SVTK_Selector* s = selector() ) {
+ s->AddOrRemoveIndex( actor->getIO(), newIndices, false );
+ viewWindow()->highlight( actor->getIO(), true, true );
+ myDlg->setButtonEnabled( true, QtxDialog::OK );
+ }
+ }
}
}
}
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- platform)).
- arg(myHelpFileName));
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
int id1, id2;
if ( !getNodeIds(myEdge->text(), id1, id2) )
- return;
+ return;
const SMDS_MeshNode* aNode1 = aMesh->FindNode( id1 );
const SMDS_MeshNode* aNode2 = aMesh->FindNode( id2 );
if ( !aNode1 || !aNode2 || aNode1 == aNode2 )
- return;
+ return;
// find a triangle and an edge index
const SMDS_MeshElement* tria1;
if ( findTriangles(aNode1,aNode2,tria1,tria2) )
{
- newIndices.Add(tria1->GetID());
-
- const SMDS_MeshNode* a3Nodes[3];
- SMDS_ElemIteratorPtr it;
- int edgeInd = 2, i;
- for (i = 0, it = tria1->nodesIterator(); it->more(); i++) {
- a3Nodes[ i ] = static_cast<const SMDS_MeshNode*>(it->next());
- if (i > 0 && ( a3Nodes[ i ] == aNode1 && a3Nodes[ i - 1] == aNode2 ||
- a3Nodes[ i ] == aNode2 && a3Nodes[ i - 1] == aNode1 ) ) {
- edgeInd = i - 1;
- break;
- }
- }
- newIndices.Add(-edgeInd-1);
-
- myOkBtn->setEnabled(true);
- myApplyBtn->setEnabled(true);
+ newIndices.Add(tria1->GetID());
+
+ const SMDS_MeshNode* a3Nodes[3];
+ SMDS_ElemIteratorPtr it;
+ int edgeInd = 2, i;
+ for (i = 0, it = tria1->nodesIterator(); it->more(); i++) {
+ a3Nodes[ i ] = static_cast<const SMDS_MeshNode*>(it->next());
+ if (i > 0 && ( a3Nodes[ i ] == aNode1 && a3Nodes[ i - 1] == aNode2 ||
+ a3Nodes[ i ] == aNode2 && a3Nodes[ i - 1] == aNode1 ) ) {
+ edgeInd = i - 1;
+ break;
+ }
+ }
+ newIndices.Add(-edgeInd-1);
+
+ myOkBtn->setEnabled(true);
+ myApplyBtn->setEnabled(true);
}
mySelector->AddOrRemoveIndex(anIO,newIndices, false);
SMESH::GetViewWindow(mySMESHGUI)->highlight( anIO, true, true );
{
const SMDS_MeshElement* tria[2];
if( SMESH::GetEdgeNodes( mySelector, aVisualObj, anId1, anId2 ) >= 1 &&
- findTriangles( aMesh->FindNode( anId1 ), aMesh->FindNode( anId2 ), tria[0],tria[1] ) )
+ findTriangles( aMesh->FindNode( anId1 ), aMesh->FindNode( anId2 ), tria[0],tria[1] ) )
{
- QString aText = QString("%1-%2").arg(anId1).arg(anId2);
- myEdge->setText(aText);
-
- myOkBtn->setEnabled(true);
- myApplyBtn->setEnabled(true);
+ QString aText = QString("%1-%2").arg(anId1).arg(anId2);
+ myEdge->setText(aText);
+
+ myOkBtn->setEnabled(true);
+ myApplyBtn->setEnabled(true);
}
else
{
- myEdge->clear();
+ myEdge->clear();
}
}
}
if (aMesh->_is_nil()) {
SUIT_MessageBox::information(SMESH::GetDesktop(mySMESHGUI),
- tr("SMESH_ERROR"),
- tr("SMESHG_NO_MESH"));
+ tr("SMESH_ERROR"),
+ tr("SMESHG_NO_MESH"));
return false;
}
if ( CheckBoxParametric->isChecked() ) {
if(CheckBoxMesh->isChecked())
- aResult = aMeshEditor->SmoothParametricObject(mySelectedObject, aNodesId.inout(),
- anIterationLimit, aMaxAspectRatio, aMethod);
- else
- aResult = aMeshEditor->SmoothParametric(anElementsId.inout(), aNodesId.inout(),
- anIterationLimit, aMaxAspectRatio, aMethod);
+ aResult = aMeshEditor->SmoothParametricObject(mySelectedObject, aNodesId.inout(),
+ anIterationLimit, aMaxAspectRatio, aMethod);
+ else
+ aResult = aMeshEditor->SmoothParametric(anElementsId.inout(), aNodesId.inout(),
+ anIterationLimit, aMaxAspectRatio, aMethod);
}
else {
if(CheckBoxMesh->isChecked())
- aResult = aMeshEditor->SmoothObject(mySelectedObject, aNodesId.inout(),
- anIterationLimit, aMaxAspectRatio, aMethod);
- else
- aResult = aMeshEditor->Smooth(anElementsId.inout(), aNodesId.inout(),
- anIterationLimit, aMaxAspectRatio, aMethod);
+ aResult = aMeshEditor->SmoothObject(mySelectedObject, aNodesId.inout(),
+ anIterationLimit, aMaxAspectRatio, aMethod);
+ else
+ aResult = aMeshEditor->Smooth(anElementsId.inout(), aNodesId.inout(),
+ anIterationLimit, aMaxAspectRatio, aMethod);
}
myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- platform)).
- arg(myHelpFileName));
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
const Handle(SALOME_InteractiveObject)& anIO = myActor->getIO();
TColStd_MapOfInteger newIndices;
for (int i = 0; i < aListId.count(); i++) {
- const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
- if (e)
- newIndices.Add(e->GetID());
- myNbOkElements++;
+ const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
+ if (e)
+ newIndices.Add(e->GetID());
+ myNbOkElements++;
}
mySelector->AddOrRemoveIndex(anIO, newIndices, false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->highlight( anIO, true, true );
+ aViewWindow->highlight( anIO, true, true );
myElementsId = theNewText;
} else if (send == LineEditNodes) {
TColStd_MapOfInteger newIndices;
for (int i = 0; i < aListId.count(); i++) {
- const SMDS_MeshNode * n = aMesh->FindNode(aListId[ i ].toInt());
- if (n)
- newIndices.Add(n->GetID());
- myNbOkNodes++;
+ const SMDS_MeshNode * n = aMesh->FindNode(aListId[ i ].toInt());
+ if (n)
+ newIndices.Add(n->GetID());
+ myNbOkNodes++;
}
mySelector->AddOrRemoveIndex(myActor->getIO(), newIndices, false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->highlight( myActor->getIO(), true, true );
+ aViewWindow->highlight( myActor->getIO(), true, true );
}
}
myEditCurrentArgument = LineEditElements;
SMESH::SetPointRepresentation(false);
if (CheckBoxMesh->isChecked()) {
- // mySelectionMgr->setSelectionModes(ActorSelection);
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(ActorSelection);
- mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
+ // mySelectionMgr->setSelectionModes(ActorSelection);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(ActorSelection);
+ mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
} else {
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(FaceSelection);
- }
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(FaceSelection);
+ }
} else if (send == SelectNodesButton) {
- LineEditNodes->clear();
+ LineEditNodes->clear();
myEditCurrentArgument = LineEditNodes;
SMESH::SetPointRepresentation(true);
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) {
- aViewWindow->SetSelectionMode(NodeSelection);
- }
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) {
+ aViewWindow->SetSelectionMode(NodeSelection);
+ }
}
myEditCurrentArgument->setFocus();
{
if(myMesh->_is_nil()) {
SUIT_MessageBox::critical(this,
- tr("SMESH_ERROR"),
- tr("NO_MESH_SELECTED"));
+ tr("SMESH_ERROR"),
+ tr("NO_MESH_SELECTED"));
return;
}
if ( !myFilterDlg )
// purpose :
//=================================================================================
void SMESHGUI_SpinBox::RangeStepAndValidator( double min,
- double max,
- double step,
- unsigned short precision )
+ double max,
+ double step,
+ unsigned short precision )
{
setPrecision(precision*(-1)); // PAL8769. Minus is for using 'g' double->string conversion specifier,
// see QtxDoubleSpinBox::mapValueToText( double v )
int aDimension = 0;
double aNbDimElements = 0;
if (aNbVolumes > 0) {
- aNbDimElements = aNbVolumes;
- aDimension = 3;
+ aNbDimElements = aNbVolumes;
+ aDimension = 3;
}
else if(aNbFaces > 0) {
- aNbDimElements = aNbFaces;
- aDimension = 2;
+ aNbDimElements = aNbFaces;
+ aDimension = 2;
}
else if(aNbEdges > 0) {
- aNbDimElements = aNbEdges;
- aDimension = 1;
+ aNbDimElements = aNbEdges;
+ aDimension = 1;
}
else if(aNbNodes > 0) {
- aNbDimElements = aNbNodes;
- aDimension = 0;
+ aNbDimElements = aNbNodes;
+ aDimension = 0;
}
// information about the mesh
aMeshSO->FindSubObject(SMESH::Tag_NodeGroups, anObj);
if (anObj) {
_PTR(ChildIterator) it = aStudy->NewChildIterator(anObj);
- if (it->More()) {
+ if (it->More()) {
anInfo.append(QString("Groups:<br><br>"));
hasGroup = true;
}
- for ( ; it->More(); it->Next()) {
+ for ( ; it->More(); it->Next()) {
_PTR(SObject) subObj = it->Value();
CORBA::Object_var anObject = SMESH::SObjectToObject(subObj);
- SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
- if (!aGroup->_is_nil()) {
+ SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
+ if (!aGroup->_is_nil()) {
anInfo.append(QString("- <b>%1</b><br>").arg(aGroup->GetName()));
anInfo.append(QString("%1<br>").arg("on nodes"));
anInfo.append(QString("%1<br>").arg(aGroup->Size()));
anInfo.append(QString("<br>"));
}
}
- }
+ }
}
// info about groups on edges
anInfo.append(QString("Groups:<br><br>"));
hasGroup = true;
}
- for ( ; it->More(); it->Next()) {
+ for ( ; it->More(); it->Next()) {
_PTR(SObject) subObj = it->Value();
CORBA::Object_var anObject = SMESH::SObjectToObject(subObj);
- SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
- if (!aGroup->_is_nil()) {
+ SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
+ if (!aGroup->_is_nil()) {
anInfo.append(QString("- <b>%1</b><br>").arg(aGroup->GetName()));
anInfo.append(QString("%1<br>").arg("on edges"));
anInfo.append(QString("%1<br>").arg(aGroup->Size()));
anInfo.append(QString("<br>"));
}
}
- }
+ }
}
// info about groups on faces
aMeshSO->FindSubObject(SMESH::Tag_FaceGroups, anObj);
if (anObj) {
_PTR(ChildIterator) it = aStudy->NewChildIterator(anObj);
- if (!hasGroup && it->More()) {
+ if (!hasGroup && it->More()) {
anInfo.append(QString("Groups:<br><br>"));
hasGroup = true;
}
- for ( ; it->More(); it->Next()) {
+ for ( ; it->More(); it->Next()) {
_PTR(SObject) subObj = it->Value();
CORBA::Object_var anObject = SMESH::SObjectToObject(subObj);
- SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
- if (!aGroup->_is_nil()) {
+ SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
+ if (!aGroup->_is_nil()) {
anInfo.append(QString("- <b>%1</b><br>").arg(aGroup->GetName()));
anInfo.append(QString("%1<br>").arg("on faces"));
anInfo.append(QString("%1<br>").arg(aGroup->Size()));
anInfo.append(QString("<br>"));
}
}
- }
+ }
}
// info about groups on volumes
aMeshSO->FindSubObject(SMESH::Tag_VolumeGroups, anObj);
if (anObj) {
_PTR(ChildIterator) it = aStudy->NewChildIterator(anObj);
- if (!hasGroup && it->More())
+ if (!hasGroup && it->More())
anInfo.append(QString("Groups:<br>"));
- for ( ; it->More(); it->Next()) {
+ for ( ; it->More(); it->Next()) {
_PTR(SObject) subObj = it->Value();
CORBA::Object_var anObject = SMESH::SObjectToObject(subObj);
- SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
- if (!aGroup->_is_nil()) {
+ SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
+ if (!aGroup->_is_nil()) {
anInfo.append(QString("- <b>%1</b><br>").arg(aGroup->GetName()));
anInfo.append(QString("%1<br>").arg("on volumes"));
anInfo.append(QString("%1<br>").arg(aGroup->Size()));
anInfo.append(QString("<br>"));
}
}
- }
+ }
}
myInfo->setText(anInfo);
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- platform)).
- arg(myHelpFileName));
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
SMESH::SetPointRepresentation(false);
if (!CheckBoxMesh->isChecked())
{
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(CellSelection);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(CellSelection);
}
}
else
aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, false );
- if( !myMesh->_is_nil())
- myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
+ if( !myMesh->_is_nil())
+ myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
break;
}
case COPY_ELEMS_BUTTON: {
else
aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, true);
}
- if( !myMesh->_is_nil())
- myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
+ if( !myMesh->_is_nil())
+ myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
break;
}
case MAKE_MESH_BUTTON: {
else
mesh = aMeshEditor->MirrorMakeMesh(anElementsId, aMirror, aMirrorType, makeGroups,
LineEditNewMesh->text().toLatin1().data());
- if( !mesh->_is_nil())
- mesh->SetParameters( aParameters.join(":").toLatin1().constData() );
+ if( !mesh->_is_nil())
+ mesh->SetParameters( aParameters.join(":").toLatin1().constData() );
break;
}
}
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- platform)).
- arg(myHelpFileName));
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
if (send == LineEditElements) {
for (int i = 0; i < aListId.count(); i++) {
- const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
- if (e)
- newIndices.Add(e->GetID());
- myNbOkElements++;
+ const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
+ if (e)
+ newIndices.Add(e->GetID());
+ myNbOkElements++;
}
mySelector->AddOrRemoveIndex( anIO, newIndices, false );
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->highlight( anIO, true, true );
+ aViewWindow->highlight( anIO, true, true );
myElementsId = theNewText;
}
SMESH::SetPointRepresentation(false);
if (CheckBoxMesh->isChecked()) {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(ActorSelection);
+ aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
} else {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(CellSelection);
+ aViewWindow->SetSelectionMode(CellSelection);
}
} else if (send == SelectPointButton) {
myEditCurrentArgument = (QWidget*)SpinBox_X;
{
if(myMesh->_is_nil()) {
SUIT_MessageBox::critical(this,
- tr("SMESH_ERROR"),
- tr("NO_MESH_SELECTED"));
+ tr("SMESH_ERROR"),
+ tr("NO_MESH_SELECTED"));
return;
}
if ( !myFilterDlg )
SMESH::SetPointRepresentation(false);
if (!CheckBoxMesh->isChecked())
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode( CellSelection );
+ aViewWindow->SetSelectionMode( CellSelection );
}
myEditCurrentArgument = (QWidget*)LineEditElements;
aMeshEditor->TranslateObject(mySelectedObject, aVector, false);
else
aMeshEditor->Translate(anElementsId, aVector, false);
- if( !myMesh->_is_nil())
- myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
+ if( !myMesh->_is_nil())
+ myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
break;
case COPY_ELEMS_BUTTON:
if ( makeGroups ) {
else
aMeshEditor->Translate(anElementsId, aVector, true);
}
- if( !myMesh->_is_nil())
- myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
+ if( !myMesh->_is_nil())
+ myMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
break;
case MAKE_MESH_BUTTON:
SMESH::SMESH_Mesh_var mesh;
else
mesh = aMeshEditor->TranslateMakeMesh(anElementsId, aVector, makeGroups,
LineEditNewMesh->text().toLatin1().data());
- if( !mesh->_is_nil())
- mesh->SetParameters( aParameters.join(":").toLatin1().constData() );
+ if( !mesh->_is_nil())
+ mesh->SetParameters( aParameters.join(":").toLatin1().constData() );
}
} catch (...) {
}
platform = "application";
#endif
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- platform)).
- arg(myHelpFileName));
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
if (send == LineEditElements) {
for (int i = 0; i < aListId.count(); i++) {
- const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
- if (e)
- newIndices.Add(e->GetID());
- myNbOkElements++;
+ const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
+ if (e)
+ newIndices.Add(e->GetID());
+ myNbOkElements++;
}
}
SMESH::SetPointRepresentation(false);
if (CheckBoxMesh->isChecked()) {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode( ActorSelection );
+ aViewWindow->SetSelectionMode( ActorSelection );
mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
} else {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode( CellSelection );
+ aViewWindow->SetSelectionMode( CellSelection );
}
} else if (send == SelectButton1) {
myEditCurrentArgument = (QWidget*)SpinBox1_1;
{
if(myMesh->_is_nil()) {
SUIT_MessageBox::critical(this,
- tr("SMESH_ERROR"),
- tr("NO_MESH_SELECTED"));
+ tr("SMESH_ERROR"),
+ tr("NO_MESH_SELECTED"));
return;
}
if ( !myFilterDlg )
LightApp_Application* app = (LightApp_Application*)( SUIT_Session::session()->activeApplication() );
if ( app )
app->onHelpContextModule( mySMESHGUI ? app->moduleName( mySMESHGUI->moduleName() ) :
- QString( "" ), myHelpFileName );
+ QString( "" ), myHelpFileName );
else {
QString platform;
#ifdef WIN32
platform = "application";
#endif
SUIT_MessageBox::warning( this, tr( "WRN_WARNING" ),
- tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
- arg( app->resourceMgr()->stringValue( "ExternalBrowser",
- platform ) ).
- arg( myHelpFileName ) );
+ tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
+ arg( app->resourceMgr()->stringValue( "ExternalBrowser",
+ platform ) ).
+ arg( myHelpFileName ) );
}
}
Handle(SALOME_InteractiveObject) IOS = It.Value();
SMESH_Actor* anActor = SMESH::FindActorByEntry( IOS->getEntry() );
if ( anActor )
- anActor->SetOpacity( opacity );
+ anActor->SetOpacity( opacity );
}
myViewWindow->Repaint();
}
if ( aList.Extent() == 1 ) {
Handle(SALOME_InteractiveObject) FirstIOS = aList.First();
if ( !FirstIOS.IsNull() ) {
- SMESH_Actor* anActor = SMESH::FindActorByEntry( FirstIOS->getEntry() );
- if ( anActor )
- opacity = int( anActor->GetOpacity() * 100. + 0.5 );
+ SMESH_Actor* anActor = SMESH::FindActorByEntry( FirstIOS->getEntry() );
+ if ( anActor )
+ opacity = int( anActor->GetOpacity() * 100. + 0.5 );
}
}
else if ( aList.Extent() > 1 ) {
SALOME_ListIteratorOfListIO It( aList );
int setOp = -1;
for ( ; It.More(); It.Next() ) {
- Handle(SALOME_InteractiveObject) IO = It.Value();
- if ( !IO.IsNull() ) {
- SMESH_Actor* anActor = SMESH::FindActorByEntry( IO->getEntry() );
- if ( anActor ) {
- int op = int( anActor->GetOpacity() * 100. + 0.5 );
- if ( setOp < 0 )
- setOp = op;
- else if ( setOp != op ) {
- setOp = 100;
- break;
- }
- }
- }
+ Handle(SALOME_InteractiveObject) IO = It.Value();
+ if ( !IO.IsNull() ) {
+ SMESH_Actor* anActor = SMESH::FindActorByEntry( IO->getEntry() );
+ if ( anActor ) {
+ int op = int( anActor->GetOpacity() * 100. + 0.5 );
+ if ( setOp < 0 )
+ setOp = op;
+ else if ( setOp != op ) {
+ setOp = 100;
+ break;
+ }
+ }
+ }
}
if ( setOp >= 0 )
- opacity = setOp;
+ opacity = setOp;
}
else {
}
if(theOwner){
const Handle(SALOME_InteractiveObject)& anIO = theOwner->IO();
if(!anIO.IsNull()){
- if(anIO->hasEntry()){
- _PTR(Study) aStudy = GetActiveStudyDocument();
- _PTR(SObject) aSObj = aStudy->FindObjectID(anIO->getEntry());
- anObj = SObjectToObject(aSObj,aStudy);
- }
+ if(anIO->hasEntry()){
+ _PTR(Study) aStudy = GetActiveStudyDocument();
+ _PTR(SObject) aSObj = aStudy->FindObjectID(anIO->getEntry());
+ anObj = SObjectToObject(aSObj,aStudy);
+ }
}
}
return anObj;
(SUIT_Session::session()->activeApplication());
if (app && !CORBA::is_nil(theObject)) {
if(_PTR(Study) aStudy = GetActiveStudyDocument()){
- CORBA::String_var anIOR = app->orb()->object_to_string(theObject);
- if (strcmp(anIOR.in(), "") != 0)
- return aStudy->FindObjectIOR(anIOR.in());
+ CORBA::String_var anIOR = app->orb()->object_to_string(theObject);
+ if (strcmp(anIOR.in(), "") != 0)
+ return aStudy->FindObjectIOR(anIOR.in());
}
}
return _PTR(SObject)();
if (theSObject) {
_PTR(GenericAttribute) anAttr;
if (theSObject->FindAttribute(anAttr, "AttributeIOR")) {
- _PTR(AttributeIOR) anIOR = anAttr;
- CORBA::String_var aVal = anIOR->Value().c_str();
- return app->orb()->string_to_object(aVal);
+ _PTR(AttributeIOR) anIOR = anAttr;
+ CORBA::String_var aVal = anIOR->Value().c_str();
+ return app->orb()->string_to_object(aVal);
}
}
return CORBA::Object::_nil();
{
if (!theIO.IsNull()) {
if (theIO->hasEntry()) {
- _PTR(Study) aStudy = GetActiveStudyDocument();
- _PTR(SObject) anObj = aStudy->FindObjectID(theIO->getEntry());
- return SObjectToObject(anObj,aStudy);
+ _PTR(Study) aStudy = GetActiveStudyDocument();
+ _PTR(SObject) anObj = aStudy->FindObjectID(theIO->getEntry());
+ return SObjectToObject(anObj,aStudy);
}
}
return CORBA::Object::_nil();
for (int i = 1; anIter->More(); anIter->Next(), i++) {
_PTR(SObject) aSObj = anIter->Value();
if (i >= 4) {
- _PTR(ChildIterator) anIter1 = aStudy->NewChildIterator(aSObj);
- for ( ; anIter1->More(); anIter1->Next()) {
- _PTR(SObject) aSObj1 = anIter1->Value();
- anAttr = aBuilder->FindOrCreateAttribute(aSObj1, "AttributePixMap");
- aPixmap = anAttr;
+ _PTR(ChildIterator) anIter1 = aStudy->NewChildIterator(aSObj);
+ for ( ; anIter1->More(); anIter1->Next()) {
+ _PTR(SObject) aSObj1 = anIter1->Value();
+ anAttr = aBuilder->FindOrCreateAttribute(aSObj1, "AttributePixMap");
+ aPixmap = anAttr;
if (theIsNotModif) {
aPixmap->SetPixMap("ICON_SMESH_TREE_MESH");
} else if ( isEmptyMesh ) {
} else {
aPixmap->SetPixMap("ICON_SMESH_TREE_MESH_PARTIAL");
}
- }
+ }
}
}
}
}
else {
SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- "application")).
- arg(theHelpFileName));
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ "application")).
+ arg(theHelpFileName));
}
}
{
CORBA::Object_var anObj = DataOwnerToObject(theDataOwner);
if(!CORBA::is_nil(anObj))
- return TInterface::_narrow(anObj);
+ return TInterface::_narrow(anObj);
return TInterface::_nil();
}
SMESHGUI_EXPORT
CORBA::Object_var SObjectToObject( _PTR(SObject),
- _PTR(Study) );
+ _PTR(Study) );
SMESHGUI_EXPORT
CORBA::Object_var SObjectToObject( _PTR(SObject) );
{
CORBA::Object_var anObj = SObjectToObject(theSObject);
if(!CORBA::is_nil(anObj))
- return TInterface::_narrow(anObj);
+ return TInterface::_narrow(anObj);
return TInterface::_nil();
}
{
CORBA::Object_var anObj = IObjectToObject(theIO);
if(!CORBA::is_nil(anObj))
- return TInterface::_narrow(anObj);
+ return TInterface::_narrow(anObj);
return TInterface::_nil();
}
{
CORBA::Object_var anObj = IORToObject( theIOR );
if ( !CORBA::is_nil( anObj ) )
- return TInterface::_narrow( anObj );
+ return TInterface::_narrow( anObj );
return TInterface::_nil();
}
for ( int iV = 0; iV < views.count(); ++iV ) {
if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(views[iV])) {
vtkRenderer *aRenderer = vtkWnd->getRenderer();
- VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+ VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
vtkActorCollection *actors = aCopy.GetActors();
for (int i = 0; i < actors->GetNumberOfItems(); ++i ) {
// size of actors changes inside the loop
for ( int iV = 0; iV < views.count(); ++iV ) {
if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(views[iV])) {
vtkRenderer *aRenderer = vtkWnd->getRenderer();
- VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+ VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
vtkActorCollection *actors = aCopy.GetActors();
for (int i = 0; i < actors->GetNumberOfItems(); ++i ) {
// size of actors changes inside the loop
// char* buf = new char[100*1024];
// delete [] buf;
SUIT_MessageBox::warning(SMESHGUI::desktop(), QObject::tr("SMESH_WRN_WARNING"),
- QObject::tr("SMESH_VISU_PROBLEM"));
+ QObject::tr("SMESH_VISU_PROBLEM"));
} catch (...) {
// no more memory at all: last resort
MESSAGE_BEGIN ( "SMESHGUI_VTKUtils::OnVisuException(), exception even at showing a message!!!" <<
- std::endl << "Try to remove all visual data..." );
+ std::endl << "Try to remove all visual data..." );
if (theVISU_MemoryReserve) {
delete theVISU_MemoryReserve;
theVISU_MemoryReserve = 0;
}
RemoveAllObjectsWithActors();
SUIT_MessageBox::warning(SMESHGUI::desktop(), QObject::tr("SMESH_WRN_WARNING"),
- QObject::tr("SMESH_VISU_PROBLEM_CLEAR"));
+ QObject::tr("SMESH_VISU_PROBLEM_CLEAR"));
MESSAGE_END ( "...done" );
}
}
#endif
TVisualObjCont::iterator anIter = VISUAL_OBJ_CONT.find(aKey);
if(anIter != VISUAL_OBJ_CONT.end()){
- aVisualObj = anIter->second;
+ aVisualObj = anIter->second;
}else{
SalomeApp_Application* app =
dynamic_cast<SalomeApp_Application*>( SMESHGUI::activeStudy()->application() );
- _PTR(Study) aStudy = SMESHGUI::activeStudy()->studyDS();
- _PTR(SObject) aSObj = aStudy->FindObjectID(theEntry);
- if(aSObj){
- _PTR(GenericAttribute) anAttr;
- if(aSObj->FindAttribute(anAttr,"AttributeIOR")){
- _PTR(AttributeIOR) anIOR = anAttr;
- CORBA::String_var aVal = anIOR->Value().c_str();
- CORBA::Object_var anObj = app->orb()->string_to_object( aVal.in() );
- if(!CORBA::is_nil(anObj)){
- //Try narrow to SMESH_Mesh interface
- SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow(anObj);
- if(!aMesh->_is_nil()){
- aVisualObj.reset(new SMESH_MeshObj(aMesh));
- TVisualObjCont::value_type aValue(aKey,aVisualObj);
- VISUAL_OBJ_CONT.insert(aValue);
- }
- //Try narrow to SMESH_Group interface
- SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObj);
- if(!aGroup->_is_nil()){
- _PTR(SObject) aFatherSObj = aSObj->GetFather();
- if(!aFatherSObj) return aVisualObj;
- aFatherSObj = aFatherSObj->GetFather();
- if(!aFatherSObj) return aVisualObj;
- CORBA::String_var anEntry = aFatherSObj->GetID().c_str();
- TVisualObjPtr aVisObj = GetVisualObj(theStudyId,anEntry.in());
- if(SMESH_MeshObj* aMeshObj = dynamic_cast<SMESH_MeshObj*>(aVisObj.get())){
- aVisualObj.reset(new SMESH_GroupObj(aGroup,aMeshObj));
- TVisualObjCont::value_type aValue(aKey,aVisualObj);
- VISUAL_OBJ_CONT.insert(aValue);
- }
- }
- //Try narrow to SMESH_subMesh interface
- SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow(anObj);
- if(!aSubMesh->_is_nil()){
- _PTR(SObject) aFatherSObj = aSObj->GetFather();
- if(!aFatherSObj) return aVisualObj;
- aFatherSObj = aFatherSObj->GetFather();
- if(!aFatherSObj) return aVisualObj;
- CORBA::String_var anEntry = aFatherSObj->GetID().c_str();
- TVisualObjPtr aVisObj = GetVisualObj(theStudyId,anEntry.in());
- if(SMESH_MeshObj* aMeshObj = dynamic_cast<SMESH_MeshObj*>(aVisObj.get())){
- aVisualObj.reset(new SMESH_subMeshObj(aSubMesh,aMeshObj));
- TVisualObjCont::value_type aValue(aKey,aVisualObj);
- VISUAL_OBJ_CONT.insert(aValue);
- }
- }
- }
- }
- }
+ _PTR(Study) aStudy = SMESHGUI::activeStudy()->studyDS();
+ _PTR(SObject) aSObj = aStudy->FindObjectID(theEntry);
+ if(aSObj){
+ _PTR(GenericAttribute) anAttr;
+ if(aSObj->FindAttribute(anAttr,"AttributeIOR")){
+ _PTR(AttributeIOR) anIOR = anAttr;
+ CORBA::String_var aVal = anIOR->Value().c_str();
+ CORBA::Object_var anObj = app->orb()->string_to_object( aVal.in() );
+ if(!CORBA::is_nil(anObj)){
+ //Try narrow to SMESH_Mesh interface
+ SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow(anObj);
+ if(!aMesh->_is_nil()){
+ aVisualObj.reset(new SMESH_MeshObj(aMesh));
+ TVisualObjCont::value_type aValue(aKey,aVisualObj);
+ VISUAL_OBJ_CONT.insert(aValue);
+ }
+ //Try narrow to SMESH_Group interface
+ SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObj);
+ if(!aGroup->_is_nil()){
+ _PTR(SObject) aFatherSObj = aSObj->GetFather();
+ if(!aFatherSObj) return aVisualObj;
+ aFatherSObj = aFatherSObj->GetFather();
+ if(!aFatherSObj) return aVisualObj;
+ CORBA::String_var anEntry = aFatherSObj->GetID().c_str();
+ TVisualObjPtr aVisObj = GetVisualObj(theStudyId,anEntry.in());
+ if(SMESH_MeshObj* aMeshObj = dynamic_cast<SMESH_MeshObj*>(aVisObj.get())){
+ aVisualObj.reset(new SMESH_GroupObj(aGroup,aMeshObj));
+ TVisualObjCont::value_type aValue(aKey,aVisualObj);
+ VISUAL_OBJ_CONT.insert(aValue);
+ }
+ }
+ //Try narrow to SMESH_subMesh interface
+ SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow(anObj);
+ if(!aSubMesh->_is_nil()){
+ _PTR(SObject) aFatherSObj = aSObj->GetFather();
+ if(!aFatherSObj) return aVisualObj;
+ aFatherSObj = aFatherSObj->GetFather();
+ if(!aFatherSObj) return aVisualObj;
+ CORBA::String_var anEntry = aFatherSObj->GetID().c_str();
+ TVisualObjPtr aVisObj = GetVisualObj(theStudyId,anEntry.in());
+ if(SMESH_MeshObj* aMeshObj = dynamic_cast<SMESH_MeshObj*>(aVisObj.get())){
+ aVisualObj.reset(new SMESH_subMeshObj(aSubMesh,aMeshObj));
+ TVisualObjCont::value_type aValue(aKey,aVisualObj);
+ VISUAL_OBJ_CONT.insert(aValue);
+ }
+ }
+ }
+ }
+ }
}
}catch(...){
INFOS("GetMeshObj - There is no SMESH_Mesh object for the SALOMEDS::Strudy and Entry!!!");
if ( usedMB * 10 > freeMB )
// even dont try to show
SUIT_MessageBox::warning(SMESHGUI::desktop(), QObject::tr("SMESH_WRN_WARNING"),
- QObject::tr("SMESH_NO_MESH_VISUALIZATION"));
+ QObject::tr("SMESH_NO_MESH_VISUALIZATION"));
else
// there is a chance to succeed
continu = SUIT_MessageBox::warning
QObject::tr("SMESH_WRN_WARNING"),
QObject::tr("SMESH_CONTINUE_MESH_VISUALIZATION"),
SUIT_MessageBox::Yes | SUIT_MessageBox::No,
- SUIT_MessageBox::Yes ) == SUIT_MessageBox::Yes;
+ SUIT_MessageBox::Yes ) == SUIT_MessageBox::Yes;
if ( !continu ) {
// remove the corresponding actors from all views
RemoveVisualObjectWithActors( theEntry );
if (anApp) {
if (SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(anApp->desktop()->activeWindow()))
- return aView;
+ return aView;
SUIT_ViewManager* aViewManager =
anApp->getViewManager(SVTK_Viewer::Type(), createIfNotFound);
SMESH_Actor* FindActorByEntry(SUIT_ViewWindow *theWindow,
- const char* theEntry)
+ const char* theEntry)
{
if(SVTK_ViewWindow* aViewWindow = GetVtkViewWindow(theWindow)){
vtkRenderer *aRenderer = aViewWindow->getRenderer();
vtkActorCollection *aCollection = aCopy.GetActors();
aCollection->InitTraversal();
while(vtkActor *anAct = aCollection->GetNextActor()){
- if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
- if(anActor->hasIO()){
- Handle(SALOME_InteractiveObject) anIO = anActor->getIO();
- if(anIO->hasEntry() && strcmp(anIO->getEntry(),theEntry) == 0){
- return anActor;
- }
- }
- }
+ if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
+ if(anActor->hasIO()){
+ Handle(SALOME_InteractiveObject) anIO = anActor->getIO();
+ if(anIO->hasEntry() && strcmp(anIO->getEntry(),theEntry) == 0){
+ return anActor;
+ }
+ }
+ }
}
}
return NULL;
CORBA::String_var anIOR = app->orb()->object_to_string( theObject );
_PTR(SObject) aSObject = aStudy->FindObjectIOR(anIOR.in());
if(aSObject){
- CORBA::String_var anEntry = aSObject->GetID().c_str();
- return FindActorByEntry(anEntry.in());
+ CORBA::String_var anEntry = aSObject->GetID().c_str();
+ return FindActorByEntry(anEntry.in());
}
}
return NULL;
SMESH_Actor* CreateActor(_PTR(Study) theStudy,
- const char* theEntry,
- int theIsClear)
+ const char* theEntry,
+ int theIsClear)
{
SMESH_Actor *anActor = NULL;
CORBA::Long anId = theStudy->StudyId();
if(TVisualObjPtr aVisualObj = GetVisualObj(anId,theEntry)){
_PTR(SObject) aSObj = theStudy->FindObjectID(theEntry);
if(aSObj){
- _PTR(GenericAttribute) anAttr;
- if(aSObj->FindAttribute(anAttr,"AttributeName")){
- _PTR(AttributeName) aName = anAttr;
- std::string aNameVal = aName->Value();
- anActor = SMESH_Actor::New(aVisualObj,theEntry,aNameVal.c_str(),theIsClear);
- }
-
- SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( SMESH::SObjectToObject( aSObj ));
- if(!CORBA::is_nil(aGroup))
- {
- SALOMEDS::Color aColor = aGroup->GetColor();
- if( !( aColor.R > 0 || aColor.G > 0 || aColor.B > 0 ) )
- {
- int r = 0, g = 0, b = 0;
- SMESH::GetColor( "SMESH", "fill_color", r, g, b, QColor( 0, 170, 255 ) );
- aColor.R = (float)r / 255.0;
- aColor.G = (float)g / 255.0;
- aColor.B = (float)b / 255.0;
- aGroup->SetColor( aColor );
- }
- if( aGroup->GetType() == SMESH::NODE )
- anActor->SetNodeColor( aColor.R, aColor.G, aColor.B );
- else if( aGroup->GetType() == SMESH::EDGE )
- anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B );
- else
- anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B );
- }
+ _PTR(GenericAttribute) anAttr;
+ if(aSObj->FindAttribute(anAttr,"AttributeName")){
+ _PTR(AttributeName) aName = anAttr;
+ std::string aNameVal = aName->Value();
+ anActor = SMESH_Actor::New(aVisualObj,theEntry,aNameVal.c_str(),theIsClear);
+ }
+
+ SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( SMESH::SObjectToObject( aSObj ));
+ if(!CORBA::is_nil(aGroup))
+ {
+ SALOMEDS::Color aColor = aGroup->GetColor();
+ if( !( aColor.R > 0 || aColor.G > 0 || aColor.B > 0 ) )
+ {
+ int r = 0, g = 0, b = 0;
+ SMESH::GetColor( "SMESH", "fill_color", r, g, b, QColor( 0, 170, 255 ) );
+ aColor.R = (float)r / 255.0;
+ aColor.G = (float)g / 255.0;
+ aColor.B = (float)b / 255.0;
+ aGroup->SetColor( aColor );
+ }
+ if( aGroup->GetType() == SMESH::NODE )
+ anActor->SetNodeColor( aColor.R, aColor.G, aColor.B );
+ else if( aGroup->GetType() == SMESH::EDGE )
+ anActor->SetEdgeColor( aColor.R, aColor.G, aColor.B );
+ else
+ anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B );
+ }
}
}
return anActor;
if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(theWnd)){
vtkWnd->RemoveActor(theActor);
if(theActor->hasIO()){
- Handle(SALOME_InteractiveObject) anIO = theActor->getIO();
- if(anIO->hasEntry()){
- std::string anEntry = anIO->getEntry();
- SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( vtkWnd->getViewManager()->study() );
- int aStudyId = aStudy->id();
- TVisualObjCont::key_type aKey(aStudyId,anEntry);
- VISUAL_OBJ_CONT.erase(aKey);
- }
+ Handle(SALOME_InteractiveObject) anIO = theActor->getIO();
+ if(anIO->hasEntry()){
+ std::string anEntry = anIO->getEntry();
+ SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( vtkWnd->getViewManager()->study() );
+ int aStudyId = aStudy->id();
+ TVisualObjCont::key_type aKey(aStudyId,anEntry);
+ VISUAL_OBJ_CONT.erase(aKey);
+ }
}
theActor->Delete();
vtkWnd->Repaint();
vtkActorCollection *aCollection = aCopy.GetActors();
aCollection->InitTraversal();
while(vtkActor *anAct = aCollection->GetNextActor())
- if(dynamic_cast<SMESH_Actor*>(anAct))
+ if(dynamic_cast<SMESH_Actor*>(anAct))
return false;
}
return true;
switch (theAction) {
case eDisplayAll: {
- while (vtkActor *anAct = aCollection->GetNextActor()) {
- if (SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)) {
- anActor->SetVisibility(true);
- }
- }
- break;
+ while (vtkActor *anAct = aCollection->GetNextActor()) {
+ if (SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)) {
+ anActor->SetVisibility(true);
+ }
+ }
+ break;
}
case eDisplayOnly:
case eEraseAll: {
- while (vtkActor *anAct = aCollection->GetNextActor()) {
- if (SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)) {
- anActor->SetVisibility(false);
- }
- }
+ while (vtkActor *anAct = aCollection->GetNextActor()) {
+ if (SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)) {
+ anActor->SetVisibility(false);
+ }
+ }
}
default: {
- if (SMESH_Actor *anActor = FindActorByEntry(theWnd,theEntry)) {
- switch (theAction) {
- case eDisplay:
- case eDisplayOnly:
- anActor->SetVisibility(true);
- if (theAction == eDisplayOnly) aRenderer->ResetCameraClippingRange();
- break;
- case eErase:
- anActor->SetVisibility(false);
- break;
- }
- } else {
- switch (theAction) {
- case eDisplay:
- case eDisplayOnly:
+ if (SMESH_Actor *anActor = FindActorByEntry(theWnd,theEntry)) {
+ switch (theAction) {
+ case eDisplay:
+ case eDisplayOnly:
+ anActor->SetVisibility(true);
+ if (theAction == eDisplayOnly) aRenderer->ResetCameraClippingRange();
+ break;
+ case eErase:
+ anActor->SetVisibility(false);
+ break;
+ }
+ } else {
+ switch (theAction) {
+ case eDisplay:
+ case eDisplayOnly:
{
SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(theWnd->getViewManager()->study());
_PTR(Study) aDocument = aStudy->studyDS();
}
break;
}
- }
- }
+ }
+ }
}
}
}
SALOME_ListIO selected; mgr->selectedObjects( selected );
if( selected.Extent() == 0){
- vtkRenderer* aRenderer = aWnd->getRenderer();
- VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
- vtkActorCollection *aCollection = aCopy.GetActors();
- aCollection->InitTraversal();
- while(vtkActor *anAct = aCollection->GetNextActor()){
- if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
- if(anActor->hasIO())
- if (!Update(anActor->getIO(),anActor->GetVisibility()))
+ vtkRenderer* aRenderer = aWnd->getRenderer();
+ VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+ vtkActorCollection *aCollection = aCopy.GetActors();
+ aCollection->InitTraversal();
+ while(vtkActor *anAct = aCollection->GetNextActor()){
+ if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
+ if(anActor->hasIO())
+ if (!Update(anActor->getIO(),anActor->GetVisibility()))
break; // avoid multiple warinings if visu failed
- }
- }
+ }
+ }
}else{
- SALOME_ListIteratorOfListIO anIter( selected );
- for( ; anIter.More(); anIter.Next()){
- Handle(SALOME_InteractiveObject) anIO = anIter.Value();
- if ( !Update(anIO,true) )
+ SALOME_ListIteratorOfListIO anIter( selected );
+ for( ; anIter.More(); anIter.Next()){
+ Handle(SALOME_InteractiveObject) anIO = anIter.Value();
+ if ( !Update(anIO,true) )
break; // avoid multiple warinings if visu failed
- }
+ }
}
RepaintCurrentView();
}
QColor aHiColor = mgr->colorValue( "SMESH", "selection_object_color", Qt::white ),
aSelColor = mgr->colorValue( "SMESH", "selection_element_color", Qt::yellow ),
- aPreColor = mgr->colorValue( "SMESH", "highlight_color", Qt::cyan );
+ aPreColor = mgr->colorValue( "SMESH", "highlight_color", Qt::cyan );
int SW = mgr->integerValue( "SMESH", "selection_width", 5 ),
PW = mgr->integerValue( "SMESH", "highlight_width", 5 );
double SP1 = mgr->doubleValue( "SMESH", "selection_precision_node", 0.025 ),
SP2 = mgr->doubleValue( "SMESH", "selection_precision_element", 0.001 ),
- SP3 = mgr->doubleValue( "SMESH", "selection_precision_object", 0.025 );
+ SP3 = mgr->doubleValue( "SMESH", "selection_precision_object", 0.025 );
for ( int i=0, n=views.count(); i<n; i++ ){
// update VTK viewer properties
if(SVTK_ViewWindow* aVtkView = GetVtkViewWindow( views[i] )){
- // mesh element selection
- aVtkView->SetSelectionProp(aSelColor.red()/255.,
- aSelColor.green()/255.,
- aSelColor.blue()/255.,
- SW );
- // tolerances
- aVtkView->SetSelectionTolerance(SP1, SP2, SP3);
-
- // pre-selection
- aVtkView->SetPreselectionProp(aPreColor.red()/255.,
- aPreColor.green()/255.,
- aPreColor.blue()/255.,
- PW);
- // update actors
- vtkRenderer* aRenderer = aVtkView->getRenderer();
- VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
- vtkActorCollection *aCollection = aCopy.GetActors();
- aCollection->InitTraversal();
- while(vtkActor *anAct = aCollection->GetNextActor()){
- if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
- anActor->SetHighlightColor(aHiColor.red()/255.,
- aHiColor.green()/255.,
- aHiColor.blue()/255.);
- anActor->SetPreHighlightColor(aPreColor.red()/255.,
- aPreColor.green()/255.,
- aPreColor.blue()/255.);
- }
- }
+ // mesh element selection
+ aVtkView->SetSelectionProp(aSelColor.red()/255.,
+ aSelColor.green()/255.,
+ aSelColor.blue()/255.,
+ SW );
+ // tolerances
+ aVtkView->SetSelectionTolerance(SP1, SP2, SP3);
+
+ // pre-selection
+ aVtkView->SetPreselectionProp(aPreColor.red()/255.,
+ aPreColor.green()/255.,
+ aPreColor.blue()/255.,
+ PW);
+ // update actors
+ vtkRenderer* aRenderer = aVtkView->getRenderer();
+ VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
+ vtkActorCollection *aCollection = aCopy.GetActors();
+ aCollection->InitTraversal();
+ while(vtkActor *anAct = aCollection->GetNextActor()){
+ if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
+ anActor->SetHighlightColor(aHiColor.red()/255.,
+ aHiColor.green()/255.,
+ aHiColor.blue()/255.);
+ anActor->SetPreHighlightColor(aPreColor.red()/255.,
+ aPreColor.green()/255.,
+ aPreColor.blue()/255.);
+ }
+ }
}
}
}
}
void SetFilter(const Handle(VTKViewer_Filter)& theFilter,
- SVTK_Selector* theSelector)
+ SVTK_Selector* theSelector)
{
if (theSelector)
theSelector->SetFilter(theFilter);
}
bool IsValid(SALOME_Actor* theActor, int theCellId,
- SVTK_Selector* theSelector)
+ SVTK_Selector* theSelector)
{
return theSelector->IsValid(theActor,theCellId);
}
vtkActorCollection *aCollection = aCopy.GetActors();
aCollection->InitTraversal();
while(vtkActor *anAct = aCollection->GetNextActor()){
- if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
- if(anActor->GetVisibility()){
- anActor->SetPointRepresentation(theIsVisible);
- }
- }
+ if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
+ if(anActor->GetVisibility()){
+ anActor->SetPointRepresentation(theIsVisible);
+ }
+ }
}
RepaintCurrentView();
}
vtkActorCollection *aCollection = aCopy.GetActors();
aCollection->InitTraversal();
while(vtkActor *anAct = aCollection->GetNextActor()){
- if(SALOME_Actor *anActor = dynamic_cast<SALOME_Actor*>(anAct)){
- if(anActor->GetVisibility()){
- anActor->SetPickable(anIsAllPickable);
- }
- }
+ if(SALOME_Actor *anActor = dynamic_cast<SALOME_Actor*>(anAct)){
+ if(anActor->GetVisibility()){
+ anActor->SetPickable(anIsAllPickable);
+ }
+ }
}
if(theActor)
- theActor->SetPickable(!anIsAllPickable);
+ theActor->SetPickable(!anIsAllPickable);
RepaintCurrentView();
}
}
//----------------------------------------------------------------------------
int GetNameOfSelectedNodes(SVTK_Selector* theSelector,
- const Handle(SALOME_InteractiveObject)& theIO,
- QString& theName)
+ const Handle(SALOME_InteractiveObject)& theIO,
+ QString& theName)
{
theName = "";
TColStd_IndexedMapOfInteger aMapIndex;
}
int GetNameOfSelectedElements(SVTK_Selector* theSelector,
- const Handle(SALOME_InteractiveObject)& theIO,
- QString& theName)
+ const Handle(SALOME_InteractiveObject)& theIO,
+ QString& theName)
{
theName = "";
TColStd_IndexedMapOfInteger aMapIndex;
int GetEdgeNodes(SVTK_Selector* theSelector,
- const TVisualObjPtr& theVisualObject,
- int& theId1,
- int& theId2)
+ const TVisualObjPtr& theVisualObject,
+ int& theId1,
+ int& theId2)
{
const SALOME_ListIO& selected = theSelector->StoredIObjects();
for ( int i = 1; i <= aMapIndex.Extent(); i++ ) {
int aVal = aMapIndex( i );
if ( aVal > 0 )
- anObjId = aVal;
+ anObjId = aVal;
else
- anEdgeNum = abs( aVal ) - 1;
+ anEdgeNum = abs( aVal ) - 1;
}
if ( anObjId == -1 || anEdgeNum == -1 )
//----------------------------------------------------------------------------
int GetNameOfSelectedNodes(LightApp_SelectionMgr *theMgr,
- const Handle(SALOME_InteractiveObject)& theIO,
- QString& theName)
+ const Handle(SALOME_InteractiveObject)& theIO,
+ QString& theName)
{
theName = "";
if(theIO->hasEntry()){
if(FindActorByEntry(theIO->getEntry())){
- TColStd_IndexedMapOfInteger aMapIndex;
- theMgr->GetIndexes(theIO,aMapIndex);
- for(int i = 1; i <= aMapIndex.Extent(); i++){
- theName += QString(" %1").arg(aMapIndex(i));
- }
- return aMapIndex.Extent();
+ TColStd_IndexedMapOfInteger aMapIndex;
+ theMgr->GetIndexes(theIO,aMapIndex);
+ for(int i = 1; i <= aMapIndex.Extent(); i++){
+ theName += QString(" %1").arg(aMapIndex(i));
+ }
+ return aMapIndex.Extent();
}
}
return -1;
int GetNameOfSelectedElements(LightApp_SelectionMgr *theMgr,
- const Handle(SALOME_InteractiveObject)& theIO,
- QString& theName)
+ const Handle(SALOME_InteractiveObject)& theIO,
+ QString& theName)
{
theName = "";
if(theIO->hasEntry()){
if(FindActorByEntry(theIO->getEntry())){
- TColStd_IndexedMapOfInteger aMapIndex;
- theMgr->GetIndexes(theIO,aMapIndex);
- typedef std::set<int> TIdContainer;
- TIdContainer anIdContainer;
- for( int i = 1; i <= aMapIndex.Extent(); i++)
- anIdContainer.insert(aMapIndex(i));
- TIdContainer::const_iterator anIter = anIdContainer.begin();
- for( ; anIter != anIdContainer.end(); anIter++){
- theName += QString(" %1").arg(*anIter);
- }
- return aMapIndex.Extent();
+ TColStd_IndexedMapOfInteger aMapIndex;
+ theMgr->GetIndexes(theIO,aMapIndex);
+ typedef std::set<int> TIdContainer;
+ TIdContainer anIdContainer;
+ for( int i = 1; i <= aMapIndex.Extent(); i++)
+ anIdContainer.insert(aMapIndex(i));
+ TIdContainer::const_iterator anIter = anIdContainer.begin();
+ for( ; anIter != anIdContainer.end(); anIter++){
+ theName += QString(" %1").arg(*anIter);
+ }
+ return aMapIndex.Extent();
}
}
return -1;
}
int GetSelected(LightApp_SelectionMgr* theMgr,
- TColStd_IndexedMapOfInteger& theMap,
- const bool theIsElement)
+ TColStd_IndexedMapOfInteger& theMap,
+ const bool theIsElement)
{
theMap.Clear();
SALOME_ListIO selected; theMgr->selectedObjects( selected );
{
Handle(SALOME_InteractiveObject) anIO = selected.First();
if ( anIO->hasEntry() ) {
- theMgr->GetIndexes( anIO, theMap );
+ theMgr->GetIndexes( anIO, theMap );
}
}
return theMap.Extent();
for ( int i = 1; i <= aMapIndex.Extent(); i++ ) {
int aVal = aMapIndex( i );
if ( aVal > 0 )
- anObjId = aVal;
+ anObjId = aVal;
else
- anEdgeNum = abs( aVal );
+ anEdgeNum = abs( aVal );
}
if ( anObjId == -1 || anEdgeNum == -1 )
//----------------------------------------------------------------------------
SMESHGUI_EXPORT
SVTK_ViewWindow* GetViewWindow( const SalomeApp_Module* = 0,
- bool = false );
+ bool = false );
SMESHGUI_EXPORT
SVTK_ViewWindow* FindVtkViewWindow( SUIT_ViewManager*, SUIT_ViewWindow* );
SMESHGUI_EXPORT
SMESHGUI_EXPORT
bool UpdateView( SUIT_ViewWindow*, EDisplaing, const char* = "" );
-SMESHGUI_EXPORT
+SMESHGUI_EXPORT
bool UpdateView( EDisplaing, const char* = "" );
SMESHGUI_EXPORT
//----------------------------------------------------------------------------
SMESHGUI_EXPORT
int GetNameOfSelectedNodes( SVTK_Selector*,
- const Handle(SALOME_InteractiveObject)&,
- QString& );
+ const Handle(SALOME_InteractiveObject)&,
+ QString& );
SMESHGUI_EXPORT
int GetNameOfSelectedElements( SVTK_Selector*,
- const Handle(SALOME_InteractiveObject)&,
- QString& );
+ const Handle(SALOME_InteractiveObject)&,
+ QString& );
SMESHGUI_EXPORT
int GetEdgeNodes( SVTK_Selector*, const TVisualObjPtr&, int&, int& );
//----------------------------------------------------------------------------
SMESHGUI_EXPORT
int GetNameOfSelectedNodes( LightApp_SelectionMgr*,
- const Handle(SALOME_InteractiveObject)&,
- QString& );
+ const Handle(SALOME_InteractiveObject)&,
+ QString& );
SMESHGUI_EXPORT
int GetNameOfSelectedNodes( LightApp_SelectionMgr*, QString& );
SMESHGUI_EXPORT
int GetNameOfSelectedElements( LightApp_SelectionMgr*,
- const Handle(SALOME_InteractiveObject)&,
- QString& );
+ const Handle(SALOME_InteractiveObject)&,
+ QString& );
SMESHGUI_EXPORT
int GetNameOfSelectedElements( LightApp_SelectionMgr*, QString& );
SMESHGUI_EXPORT
int GetSelected( LightApp_SelectionMgr*, TColStd_IndexedMapOfInteger&,
- const bool = true );
+ const bool = true );
SMESHGUI_EXPORT
int GetEdgeNodes( LightApp_SelectionMgr*, int&, int& );
{
SMESH::SetPointRepresentation(true);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode( NodeSelection );
+ aViewWindow->SetSelectionMode( NodeSelection );
break;
}
case 1:
{
SMESH::SetPointRepresentation(false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode( CellSelection );
+ aViewWindow->SetSelectionMode( CellSelection );
break;
}
}
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser",
- "application")).
- arg(myHelpFileName));
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ "application")).
+ arg(myHelpFileName));
}
}
for (int i = 0; i < aListId.count(); i++) {
const SMDS_MeshElement * e = RadioButtonNodes->isChecked()?
- aMesh->FindNode(aListId[ i ].toInt()):
- aMesh->FindElement(aListId[ i ].toInt());
+ aMesh->FindNode(aListId[ i ].toInt()):
+ aMesh->FindElement(aListId[ i ].toInt());
if (e)
- newIndices.Add(e->GetID());
+ newIndices.Add(e->GetID());
}
mySelector->AddOrRemoveIndex( anIO, newIndices, false );
anInfo+=tr("SMESH_FACE")+"<br>";
anInfo+="<b>" + tr("SMESH_MESHINFO_TYPE")+":</b> ";
if(!ef->IsPoly())
- anInfo+=(ef->IsQuadratic()?tr("SMESH_MESHINFO_ORDER2"):tr("SMESH_MESHINFO_ORDER1"))+" ";
+ anInfo+=(ef->IsQuadratic()?tr("SMESH_MESHINFO_ORDER2"):tr("SMESH_MESHINFO_ORDER1"))+" ";
switch(ef->NbNodes()) {
case 3:
case 6:
- {
- anInfo+=tr("SMESH_TRIANGLE");
- break;
- }
+ {
+ anInfo+=tr("SMESH_TRIANGLE");
+ break;
+ }
case 4:
case 8:
- {
- anInfo+=tr("SMESH_QUADRANGLE");
- break;
- }
+ {
+ anInfo+=tr("SMESH_QUADRANGLE");
+ break;
+ }
default:
- break;
+ break;
}
anInfo+="<br>";
} else if(e->GetType() == SMDSAbs_Volume) {
const SMDS_MeshVolume *ev = (SMDS_MeshVolume*) e;
SMDS_VolumeTool vt(ev);
if(vt.GetVolumeType() != SMDS_VolumeTool::POLYHEDA)
- anInfo+=(ev->IsQuadratic()?tr("SMESH_MESHINFO_ORDER2"):tr("SMESH_MESHINFO_ORDER1"))+" ";
+ anInfo+=(ev->IsQuadratic()?tr("SMESH_MESHINFO_ORDER2"):tr("SMESH_MESHINFO_ORDER1"))+" ";
switch(vt.GetVolumeType()) {
case SMDS_VolumeTool::TETRA:
case SMDS_VolumeTool::QUAD_TETRA:
- {
- anInfo+=tr("SMESH_TETRAS");
- break;
- }
+ {
+ anInfo+=tr("SMESH_TETRAS");
+ break;
+ }
case SMDS_VolumeTool::PYRAM:
case SMDS_VolumeTool::QUAD_PYRAM:
- {
- anInfo+=tr("SMESH_PYRAMID");
- break;
- }
+ {
+ anInfo+=tr("SMESH_PYRAMID");
+ break;
+ }
case SMDS_VolumeTool::PENTA:
case SMDS_VolumeTool::QUAD_PENTA:
- {
- anInfo+=tr("SMESH_PRISM");
- break;
- }
+ {
+ anInfo+=tr("SMESH_PRISM");
+ break;
+ }
case SMDS_VolumeTool::HEXA:
case SMDS_VolumeTool::QUAD_HEXA:
- {
- anInfo+=tr("SMESH_HEXAS");
- break;
- }
+ {
+ anInfo+=tr("SMESH_HEXAS");
+ break;
+ }
case SMDS_VolumeTool::POLYHEDA:
- {
- anInfo+=tr("SMESH_POLYEDRON");
- break;
- }
+ {
+ anInfo+=tr("SMESH_POLYEDRON");
+ break;
+ }
default:
- break;
+ break;
}
anInfo+="<br>";
}
const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*>( nodeIt->next() );
anXYZ.Add( gp_XYZ( node->X(), node->Y(), node->Z() ) );
if(e->GetType() != SMDSAbs_Node)
- aNodesInfo+=QString("<b>Node %1:</b><br>Id=%2, X=%3, Y=%4, Z=%5<br>").arg(nbNodes+1).arg(node->GetID()).arg(node->X()).arg(node->Y()).arg(node->Z());
+ aNodesInfo+=QString("<b>Node %1:</b><br>Id=%2, X=%3, Y=%4, Z=%5<br>").arg(nbNodes+1).arg(node->GetID()).arg(node->X()).arg(node->Y()).arg(node->Z());
// Calculate Connectivity
SMDS_ElemIteratorPtr it = node->GetInverseElementIterator();
if (it) {
- aNodesInfo+="<b>" + tr("CONNECTED_ELEMENTS") + ":</b>";
- while (it->more()) {
- const SMDS_MeshElement* elem = it->next();
- aNodesInfo+=QString(" %1").arg(elem->GetID());
- }
- if ( (nbNodes+1) != e->NbNodes())
- aNodesInfo+=QString("<br><br>");
+ aNodesInfo+="<b>" + tr("CONNECTED_ELEMENTS") + ":</b>";
+ while (it->more()) {
+ const SMDS_MeshElement* elem = it->next();
+ aNodesInfo+=QString(" %1").arg(elem->GetID());
+ }
+ if ( (nbNodes+1) != e->NbNodes())
+ aNodesInfo+=QString("<br><br>");
}
}
if(e->GetType() != SMDSAbs_Node)
{
MESSAGE("Loading Resources " << aResName.toLatin1().data());
SUIT_ResourceMgr* resMgr = SMESHGUI::resourceMgr();
- QString lang = resMgr->stringValue( resMgr->langSection(), "language", "en" );
+ QString lang = resMgr->stringValue( resMgr->langSection(), "language", "en" );
resMgr->loadTranslator( "resources", QString( "%1_msg_%2.qm" ).arg( aResName, lang ) );
resMgr->loadTranslator( "resources", QString( "%1_images.qm" ).arg( aResName, lang ) );
}
{
QString aHypos = isHypo ? atts.value("hypos") : atts.value("algos");
aHypos = aHypos.remove( ' ' );
- aHypoSet->set( !isHypo, aHypos.split( ',', QString::SkipEmptyParts ) );
+ aHypoSet->set( !isHypo, aHypos.split( ',', QString::SkipEmptyParts ) );
}
}
}
bool startDocument();
bool startElement( const QString&, const QString&,
- const QString&, const QXmlAttributes& );
+ const QString&, const QXmlAttributes& );
bool endElement( const QString&, const QString&, const QString& );
bool characters( const QString& );