#include "SMESHGUI_RemoveNodesDlg.h"
#include "SMESHGUI_RemoveElementsDlg.h"
#include "SMESHGUI_MeshInfosDlg.h"
+#include "SMESHGUI_StandardMeshInfosDlg.h"
#include "SMESHGUI_Preferences_ColorDlg.h"
#include "SMESHGUI_Preferences_ScalarBarDlg.h"
#include "SMESHGUI_Preferences_SelectionDlg.h"
#include "SMESHGUI_SmoothingDlg.h"
#include "SMESHGUI_RenumberingDlg.h"
#include "SMESHGUI_ExtrusionDlg.h"
+#include "SMESHGUI_ExtrusionAlongPathDlg.h"
#include "SMESHGUI_RevolutionDlg.h"
#include "SMESHGUI_TranslationDlg.h"
#include "SMESHGUI_RotationDlg.h"
#include <vtkRenderWindow.h>
#include <vtkActorCollection.h>
#include <vtkScalarBarActor.h>
+#include <vtkUnstructuredGrid.h>
#include "utilities.h"
void ExportMeshToFile(QAD_Desktop * parent, int theCommandID);
- void SetViewMode(int theCommandID);
+ void SetDisplayMode(int theCommandID);
+
+ void SetDisplayEntity(int theCommandID);
void Control( int theCommandID );
SMESH::SMESH_Gen_ptr theComponentMesh,
int theCommandID)
{
- QString filter;
+ QStringList filter;
string myExtension;
if(theCommandID == 113){
- filter = QObject::tr("MED files (*.med)");
+ filter.append(QObject::tr("MED files (*.med)"));
+ filter.append(QObject::tr("All files (*)"));
}else if (theCommandID == 112){
- filter = QObject::tr("IDEAS files (*.unv)");
+ filter.append(QObject::tr("IDEAS files (*.unv)"));
}else if (theCommandID == 111){
- filter = QObject::tr("DAT files (*.dat)");
+ filter.append(QObject::tr("DAT files (*.dat)"));
}
QString filename = QAD_FileDlg::getFileName(parent,
"",
SMESH::SMESH_Mesh_var aMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(anIObject);
if ( !aMesh->_is_nil() ) {
QString aFilter, aTitle = QObject::tr("Export mesh");
+ QMap<QString, SMESH::MED_VERSION> aFilterMap;
switch ( theCommandID ) {
case 122:
- aFilter = QObject::tr("MED files (*.med)");
+ aFilterMap.insert( QObject::tr("MED 2.1 (*.med)"), SMESH::MED_V2_1 );
+ aFilterMap.insert( QObject::tr("MED 2.2 (*.med)"), SMESH::MED_V2_2 );
break;
case 121:
aFilter = QObject::tr("DAT files (*.dat)");
return;
}}
- QString aFilename = QAD_FileDlg::getFileName(parent, "", aFilter, aTitle, false);
+ QString aFilename;
+ SMESH::MED_VERSION aFormat;
+
+ if ( theCommandID != 122)
+ aFilename = QAD_FileDlg::getFileName(parent, "", aFilter, aTitle, false);
+ else
+ {
+ QStringList filters;
+ for ( QMap<QString, SMESH::MED_VERSION>::const_iterator it = aFilterMap.begin(); it != aFilterMap.end(); ++it )
+ filters.push_back( it.key() );
+
+ QAD_FileDlg* fd = new QAD_FileDlg( parent, false, true, true );
+ fd->setCaption( aTitle );
+ fd->setFilters( filters );
+ fd->exec();
+ aFilename = fd->selectedFile();
+ aFormat = aFilterMap[fd->selectedFilter()];
+ delete fd;
+ }
if ( !aFilename.isEmpty() ) {
// Check whether the file already exists and delete it if yes
QFile aFile( aFilename );
QAD_WaitCursor wc;
switch ( theCommandID ) {
case 122:
- aMesh->ExportMED( aFilename.latin1(), true ); // currently, automatic groups are always created
+ aMesh->ExportToMED( aFilename.latin1(), false, aFormat ); // currently, automatic groups are never created
break;
case 121:
aMesh->ExportDAT( aFilename.latin1() );
}
}
- void SetViewMode(int theCommandID){
+ inline void InverseEntityMode(unsigned int& theOutputMode,
+ unsigned int theMode)
+ {
+ bool anIsNotPresent = ~theOutputMode & theMode;
+ if(anIsNotPresent)
+ theOutputMode |= theMode;
+ else
+ theOutputMode &= ~theMode;
+ }
+
+ void SetDisplayEntity(int theCommandID){
+ SALOME_Selection *Sel = SALOME_Selection::Selection(SMESH::GetActiveStudy()->getSelection());
+ if(Sel->IObjectCount() >= 1){
+ SALOME_ListIteratorOfListIO It(Sel->StoredIObjects());
+ 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){
+ 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);
+ }
+ }
+ }
+ }
+ }
+
+ void SetDisplayMode(int theCommandID){
SALOME_Selection *Sel = SALOME_Selection::Selection(SMESH::GetActiveStudy()->getSelection());
if(Sel->IObjectCount() >= 1){
switch(theCommandID){
case 1134:{
SMESHGUI::GetSMESHGUI()->EmitSignalDeactivateDialog();
- SMESHGUI_ClippingDlg *aDlg =
- new SMESHGUI_ClippingDlg(QAD_Application::getDesktop(),"",false);
+ new SMESHGUI_ClippingDlg(QAD_Application::getDesktop(),"",false);
return;
}
case 1133:{
SMESHGUI::GetSMESHGUI()->EmitSignalDeactivateDialog();
- SMESHGUI_TransparencyDlg *aDlg =
- new SMESHGUI_TransparencyDlg(QAD_Application::getDesktop(),"",false);
+ new SMESHGUI_TransparencyDlg(QAD_Application::getDesktop(),"",false);
return;
}}
SALOME_ListIteratorOfListIO It(Sel->StoredIObjects());
switch ( theCommandID ){
case 6001:
aTitle = QObject::tr( "LENGTH_EDGES" );
- aControl = SMESH_Actor::eLengthEdges;
+ aControl = SMESH_Actor::eLength;
+ break;
+ case 6018:
+ aTitle = QObject::tr( "LENGTH2D_EDGES" );
+ aControl = SMESH_Actor::eLength2D;
break;
case 6002:
aTitle = QObject::tr( "FREE_EDGES" );
aTitle = QObject::tr( "MULTI_BORDERS" );
aControl = SMESH_Actor::eMultiConnection;
break;
+ case 6019:
+ aTitle = QObject::tr( "MULTI2D_BORDERS" );
+ aControl = SMESH_Actor::eMultiConnection2D;
+ break;
case 6011:
aTitle = QObject::tr( "AREA_ELEMENTS" );
aControl = SMESH_Actor::eArea;
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;
void OnEditDelete()
{
+ // VSR 17/11/04: check if all objects selected belong to SMESH component --> start
+ QString aParentComponent = ((SALOMEGUI_Desktop*)QAD_Application::getDesktop())->getComponentFromSelection();
+ if ( aParentComponent != QAD_Application::getDesktop()->getActiveComponent() ) {
+ QAD_MessageBox::warn1 ( QAD_Application::getDesktop(),
+ QObject::tr("ERR_ERROR"),
+ QObject::tr("NON_SMESH_OBJECTS_SELECTED").arg(QAD_Application::getDesktop()->getComponentUserName( "SMESH" )),
+ QObject::tr("BUT_OK") );
+ return;
+ }
+ // VSR 17/11/04: check if all objects selected belong to SMESH component <-- finish
if (QAD_MessageBox::warn2
(QAD_Application::getDesktop(),
QObject::tr("SMESH_WRN_WARNING"),
SALOME_Selection *Sel = SALOME_Selection::Selection(anActiveStudy->getSelection());
SALOME_ListIteratorOfListIO It(Sel->StoredIObjects());
+
+ aStudyBuilder->NewCommand(); // There is a transaction
for(; It.More(); It.Next()){
Handle(SALOME_InteractiveObject) IObject = It.Value();
if(IObject->hasEntry()){
/* Erase child graphical objects */
SALOMEDS::ChildIterator_var it = aStudy->NewChildIterator(SO);
- for(; it->More(); it->Next()){
+ for(it->InitEx(true); it->More(); it->Next()){
SALOMEDS::SObject_var CSO = it->Value();
if(CSO->FindAttribute(anAttr, "AttributeIOR")){
anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
} /* IObject->hasEntry() */
} /* more/next */
+ aStudyBuilder->CommitCommand();
/* Clear any previous selection */
Sel->ClearIObjects();
*
*/
//=============================================================================
-class CustomItem:public QCustomMenuItem
+class CustomItem : public QCustomMenuItem
{
- public:
- CustomItem(const QString & s, const QFont & f):string(s), font(f)
- {
- };
- ~CustomItem()
+public:
+ CustomItem(const QString& s, const QFont& f) : myString(s), myFont(f) {}
+ ~CustomItem() {}
+
+ void paint(QPainter* p, const QColorGroup& cg, bool act, bool /*enabled*/, int x, int y, int w, int h)
{
+ p->save();
+ p->fillRect( x, y, w, h, act ? cg.highlight() : cg.mid() );
+ p->setPen( act ? cg.highlightedText() : cg.buttonText() );
+ p->setFont( myFont );
+ p->drawText( x, y, w, h, AlignHCenter | AlignVCenter | ShowPrefix | DontClip | SingleLine, myString );
+ p->restore();
}
- void paint(QPainter * p, const QColorGroup & /*cg */ , bool /*act */ ,
- bool /*enabled */ , int x, int y, int w, int h)
+ QSize sizeHint()
{
- p->setFont(font);
- p->drawText(x, y, w, h,
- AlignHCenter | AlignVCenter | ShowPrefix | DontClip, string);
+ return QFontMetrics( myFont ).size( AlignHCenter | AlignVCenter | ShowPrefix | DontClip | SingleLine, myString );
}
- QSize sizeHint()
+ bool fullSpan() const
{
- return QFontMetrics(font).
- size(AlignHCenter | AlignVCenter | ShowPrefix | DontClip, string);
+ return true;
}
- private:
- QString string;
- QFont font;
+
+private:
+ QString myString;
+ QFont myFont;
};
//=============================================================================
case 1134: // Clipping
case 1133: // Tranparency
case 1132: // Colors / Size
- case 215:
- case 213:
- case 212:
- case 211:
- {
- ::SetViewMode(theCommandID);
- break;
- }
+
+ // Display Mode
+ case 215: // Nodes
+ case 213: // Nodes
+ case 212: // Nodes
+ case 211: // Nodes
+ ::SetDisplayMode(theCommandID);
+ break;
+
+ // Display Entity
+ case 217: // Edges
+ case 218: // Faces
+ case 219: // Volumes
+ case 220: // All Entity
+ ::SetDisplayEntity(theCommandID);
+ break;
case 214: // UPDATE
{
if (myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_NodesDlg *aDlg = new SMESHGUI_NodesDlg(parent, "", Sel);
+ new SMESHGUI_NodesDlg(parent, "", Sel);
}
else {
QAD_MessageBox::warn1(QAD_Application::getDesktop(),
if ( myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK )
{
EmitSignalDeactivateDialog();
- SMESHGUI_FilterDlg *aDlg = new SMESHGUI_FilterDlg( parent, SMESH::EDGE );
+ new SMESHGUI_FilterDlg( parent, SMESH::EDGE );
}
break;
}
if(checkLock(aStudy)) break;
SALOME_Selection *Sel = SALOME_Selection::Selection( myActiveStudy->getSelection() );
- SMESHGUI_MoveNodesDlg *aDlg = new SMESHGUI_MoveNodesDlg( parent, Sel );
+ new SMESHGUI_MoveNodesDlg( parent, Sel );
break;
}
}
CORBA::Long anId = aStudy->StudyId();
TVisualObjPtr aVisualObj = SMESH::GetVisualObj(anId,IObject->getEntry());
+ cout<<"myAutomaticUpdate - "<<myAutomaticUpdate<<endl;
if(myAutomaticUpdate && aVisualObj){
aVisualObj->Update();
SMESH_Actor* anActor = SMESH::FindActorByEntry(IObject->getEntry());
if (myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_AddSubMeshDlg *aDlg = new SMESHGUI_AddSubMeshDlg(parent, "", Sel);
+ new SMESHGUI_AddSubMeshDlg(parent, "", Sel);
}
else {
QAD_MessageBox::warn1(QAD_Application::getDesktop(),
if(checkLock(aStudy)) break;
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_InitMeshDlg *aDlg = new SMESHGUI_InitMeshDlg(parent, "", Sel);
+ new SMESHGUI_InitMeshDlg(parent, "", Sel);
break;
}
if(checkLock(aStudy)) break;
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_EditHypothesesDlg *aDlg = new SMESHGUI_EditHypothesesDlg(parent, "", Sel);
+ new SMESHGUI_EditHypothesesDlg(parent, "", Sel);
break;
}
if(checkLock(aStudy)) break;
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_EditHypothesesDlg *aDlg = new SMESHGUI_EditHypothesesDlg(parent, "", Sel);
+ new SMESHGUI_EditHypothesesDlg(parent, "", Sel);
break;
}
if(checkLock(aStudy)) break;
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_EditHypothesesDlg *aDlg = new SMESHGUI_EditHypothesesDlg(parent, "", Sel);
+ new SMESHGUI_EditHypothesesDlg(parent, "", Sel);
break;
}
if (myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_SmoothingDlg *aDlg = new SMESHGUI_SmoothingDlg(parent, "", Sel);
+ new SMESHGUI_SmoothingDlg(parent, "", Sel);
}
else {
QAD_MessageBox::warn1(QAD_Application::getDesktop(),
if (myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_ExtrusionDlg *aDlg = new SMESHGUI_ExtrusionDlg(parent, "", Sel);
+ new SMESHGUI_ExtrusionDlg(parent, "", Sel);
}
else {
QAD_MessageBox::warn1(QAD_Application::getDesktop(),
if (myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_RevolutionDlg *aDlg = new SMESHGUI_RevolutionDlg(parent, "", Sel);
+ new SMESHGUI_RevolutionDlg(parent, "", Sel);
}
else {
QAD_MessageBox::warn1(QAD_Application::getDesktop(),
}
break;
}
+ case 416: // Extrusion along a path
+ {
+ if(checkLock(aStudy)) break;
+ if (myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
+ EmitSignalDeactivateDialog();
+ SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
+ new SMESHGUI_ExtrusionAlongPathDlg(parent, Sel);
+ }
+ else {
+ QAD_MessageBox::warn1(QAD_Application::getDesktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
+ tr("SMESH_BUT_OK"));
+ }
+ break;
+ }
case 801: // CREATE GROUP
{
if(checkLock(aStudy)) break;
// 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);
+ 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);
+ 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);
+ 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);
+ SMESH::SMESH_Group_var aGroup = SMESH::AddGroup(aMesh, SMESH::VOLUME, aName + "_Volumes");
aGroup->Add(aVolumes.inout());
}
myActiveStudy->updateObjBrowser(true);
for ( ; It.More(); It.Next() ) {
Sel->ClearIObjects();
Sel->AddIObject( It.Value() );
- SMESHGUI_MeshInfosDlg *aDlg = new SMESHGUI_MeshInfosDlg(parent, "", false);
+ new SMESHGUI_MeshInfosDlg(parent, "", false);
}
// restore selection
Sel->ClearIObjects();
Sel->AddIObject( It.Value() );
}
else
- SMESHGUI_MeshInfosDlg *aDlg = new SMESHGUI_MeshInfosDlg(parent, "", false);
+ new SMESHGUI_MeshInfosDlg(parent, "", false);
break;
}
+ case 902: // STANDARD MESH INFOS
+ {
+ EmitSignalDeactivateDialog();
+ SALOME_Selection *Sel =
+ SALOME_Selection::Selection(myActiveStudy->getSelection());
+ if ( Sel->IObjectCount() > 1 ) { // a dlg for each IO
+ SALOME_ListIO IOs; IOs = Sel->StoredIObjects(); // list copy
+ SALOME_ListIteratorOfListIO It (IOs);
+ for ( ; It.More(); It.Next() ) {
+ Sel->ClearIObjects();
+ Sel->AddIObject( It.Value() );
+ new SMESHGUI_StandardMeshInfosDlg(parent, "", false);
+ }
+ // restore selection
+ Sel->ClearIObjects();
+ for (It.Initialize( IOs ) ; It.More(); It.Next() )
+ Sel->AddIObject( It.Value() );
+ }
+ else
+ new SMESHGUI_StandardMeshInfosDlg(parent, "", false);
+ break;
+ }
+
case 1001: // AUTOMATIC UPDATE PREFERENCES
{
parent->menuBar()->setItemChecked(1001, !parent->menuBar()->isItemChecked(1001));
break;
}
- case 1007:
+ case 10070:
{
( new SMESHGUI_PrecisionDlg( parent ) )->exec();
break;
}
+ case 10071:
+ {
+ parent->menuBar()->setItemChecked(10071, !parent->menuBar()->isItemChecked(10071));
+ if (parent->menuBar()->isItemChecked(10071)) {
+ QAD_CONFIG->addSetting("SMESH:DispayEntity","true");
+ }
+ else {
+ QAD_CONFIG->addSetting("SMESH:DispayEntity","false");
+ }
+ break;
+ }
case 1006:
{
SMESHGUI_Preferences_SelectionDlg* aDlg =
type = SMDSAbs_Volume; nbNodes = 8; break;
default:;
}
- SMESHGUI_AddMeshElementDlg *aDlg =
- new SMESHGUI_AddMeshElementDlg(parent, "", Sel, type, nbNodes);
+ new SMESHGUI_AddMeshElementDlg(parent, "", Sel, type, nbNodes);
}
else {
QAD_MessageBox::warn1(QAD_Application::getDesktop(),
if (myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_RemoveNodesDlg *aDlg = new SMESHGUI_RemoveNodesDlg(parent, "", Sel);
+ new SMESHGUI_RemoveNodesDlg(parent, "", Sel);
}
else {
QAD_MessageBox::warn1(QAD_Application::getDesktop(),
if (myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_RemoveElementsDlg *aDlg = new SMESHGUI_RemoveElementsDlg(parent, "", Sel);
+ new SMESHGUI_RemoveElementsDlg(parent, "", Sel);
}
else
{
if (myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_RenumberingDlg *aDlg = new SMESHGUI_RenumberingDlg(parent, "", Sel, 0);
+ new SMESHGUI_RenumberingDlg(parent, "", Sel, 0);
}
else
{
if (myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_RenumberingDlg *aDlg = new SMESHGUI_RenumberingDlg(parent, "", Sel, 1);
+ new SMESHGUI_RenumberingDlg(parent, "", Sel, 1);
}
else
{
if (myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_TranslationDlg *aDlg = new SMESHGUI_TranslationDlg(parent, "", Sel);
+ new SMESHGUI_TranslationDlg(parent, "", Sel);
}
else {
QAD_MessageBox::warn1(QAD_Application::getDesktop(),
if (myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_RotationDlg *aDlg = new SMESHGUI_RotationDlg(parent, "", Sel);
+ new SMESHGUI_RotationDlg(parent, "", Sel);
}
else {
QAD_MessageBox::warn1(QAD_Application::getDesktop(),
if (myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_SymmetryDlg *aDlg = new SMESHGUI_SymmetryDlg(parent, "", Sel);
+ new SMESHGUI_SymmetryDlg(parent, "", Sel);
}
else {
QAD_MessageBox::warn1(QAD_Application::getDesktop(),
if (myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_SewingDlg *aDlg = new SMESHGUI_SewingDlg(parent, "", Sel);
+ new SMESHGUI_SewingDlg(parent, "", Sel);
}
else {
QAD_MessageBox::warn1(QAD_Application::getDesktop(),
if (myActiveStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
EmitSignalDeactivateDialog();
SALOME_Selection *Sel = SALOME_Selection::Selection(myActiveStudy->getSelection());
- SMESHGUI_MergeNodesDlg *aDlg = new SMESHGUI_MergeNodesDlg(parent, "", Sel);
+ new SMESHGUI_MergeNodesDlg(parent, "", Sel);
}
else {
QAD_MessageBox::warn1(QAD_Application::getDesktop(),
{
if(checkLock(aStudy)) break;
EmitSignalDeactivateDialog();
- SMESHGUI_CreateHypothesesDlg *aDlg =
- new SMESHGUI_CreateHypothesesDlg (parent, "", FALSE, false);
+ new SMESHGUI_CreateHypothesesDlg (parent, "", FALSE, false);
break;
}
case 5010: // ALGO
{
if(checkLock(aStudy)) break;
EmitSignalDeactivateDialog();
- SMESHGUI_CreateHypothesesDlg *aDlg =
- new SMESHGUI_CreateHypothesesDlg (parent, "", FALSE, true);
+ new SMESHGUI_CreateHypothesesDlg (parent, "", FALSE, true);
break;
}
}
break;
- case 6016: // CONTROLS
+ case 6017: // CONTROLS
+ case 6016:
case 6015:
case 6014:
case 6013:
case 6012:
case 6011:
case 6001:
+ case 6018:
+ case 6019:
case 6002:
case 6003:
case 6004:
myAutomaticUpdate = false;
}
+ QString anIsDisplayEntity = QAD_CONFIG->getSetting("SMESH:DispayEntity");
+ if(anIsDisplayEntity.compare("true") == 0)
+ parent->menuBar()->setItemChecked(10071,true);
+ else
+ parent->menuBar()->setItemChecked(10071,false);
+
/* Selection */
SMESH::UpdateSelectionProp();
if ( topItem >= 0 ) {
if ( theParent == "Viewer" ) {
// set bold font for popup menu's TopLabel item (Viewer popup)
- QFont fnt = QApplication::font(); fnt.setBold( TRUE );
+ QFont fnt = popup->font(); fnt.setBold( TRUE );
popup->removeItem( QAD_TopLabel_Popup_ID );
popup->insertItem( new CustomItem( QString( IObject->getName() ), fnt ), QAD_TopLabel_Popup_ID, topItem );
}
if ( !aGeomGroup->_is_nil() ) // group linked on geometry
popup->removeItem( 803 ); // EDIT GROUP
- SMESH_Actor* ac = SMESH::FindActorByEntry(IObject->getEntry());
+ SMESH_Actor* anActor = SMESH::FindActorByEntry(IObject->getEntry());
// if object has actor
- if ( ac && studyFrame->getTypeView() == VIEW_VTK ) {
+ if ( anActor && studyFrame->getTypeView() == VIEW_VTK ) {
VTKViewer_RenderWindowInteractor* myRenderInter = SMESH::GetCurrentVtkView()->getRWInteractor();
if ( myRenderInter->isVisible( IObject ) ) {
popup->removeItem( QAD_Display_Popup_ID );
- popup->setItemChecked( 9010, ac->GetPointsLabeled() ); // Numbering / Display Nodes #
- popup->setItemChecked( 9011, ac->GetCellsLabeled() ); // Numbering / Display Elements #
- TVisualObjPtr aVisualObj = ac->GetObject();
- int aNbEdges = aVisualObj->GetNbEntities(SMESH::EDGE);
- int aNbFaces = aVisualObj->GetNbEntities(SMESH::FACE);
- int aNbVolumes = aVisualObj->GetNbEntities(SMESH::VOLUME);
+ popup->setItemChecked( 9010, anActor->GetPointsLabeled() ); // Numbering / Display Nodes #
+ popup->setItemChecked( 9011, anActor->GetCellsLabeled() ); // Numbering / Display Elements #
+ TVisualObjPtr aVisualObj = anActor->GetObject();
+ int aNbEdges = aVisualObj->GetNbEntities(SMDSAbs_Edge);
+ int aNbFaces = aVisualObj->GetNbEntities(SMDSAbs_Face);
+ int aNbVolumes = aVisualObj->GetNbEntities(SMDSAbs_Volume);
+
QMenuItem* mi = popup->findItem( 1131 );
if ( mi && mi->popup() ) {
- int prType = ac->GetRepresentation();
+ int prType = anActor->GetRepresentation();
// Display Mode / Wireframe
- if(!aNbFaces && !aNbVolumes && !aNbEdges){
+ if(aNbVolumes == 0 && aNbFaces == 0 && aNbEdges == 0){
mi->popup()->removeItem( 211 );
}else{
mi->popup()->setItemChecked( 211, prType == SMESH_Actor::eEdge );
}
// Display Mode / Shading
- if(!aNbFaces && !aNbVolumes){
+ if(aNbFaces == 0 && aNbVolumes == 0){
mi->popup()->removeItem( 212 );
}else{
mi->popup()->setItemChecked( 212, prType == SMESH_Actor::eSurface );
// Display Mode / Points
mi->popup()->setItemChecked( 215, prType == SMESH_Actor::ePoint );
// Display Mode / Shrink
- bool isShrunk = ac->IsShrunk();
- bool isShrunkable = ac->IsShrunkable();
+ bool isShrunk = anActor->IsShrunk();
+ bool isShrunkable = anActor->IsShrunkable();
mi->popup()->setItemChecked( 213, isShrunk );
mi->popup()->setItemEnabled( 213, prType != SMESH_Actor::ePoint && isShrunkable);
}
- // Scalar Bar
+
+ // Display Entity
+ mi = popup->findItem( 1135 );
+ int aIsSomething=0;
+ if (aNbVolumes>0) aIsSomething++;
+ if (aNbFaces>0) aIsSomething++;
+ if (aNbEdges>0) aIsSomething++;
+ if ( mi && (aIsSomething <= 1)){
+ popup->removeItem(1135);
+ }else if ( mi && mi->popup() ) {
+ QPopupMenu* aPopup = mi->popup();
+ unsigned int aMode = anActor->GetEntityMode();
+
+ bool aIsVolumesMode = aMode & SMESH_Actor::eVolumes;
+ bool aIsFacesMode = aMode & SMESH_Actor::eFaces;
+ bool aIsEdgesMode = aMode & SMESH_Actor::eEdges;
+
+ if(aNbVolumes == 0)
+ aPopup->removeItem( 219 );
+ else
+ aPopup->setItemChecked( 219, aIsVolumesMode );
+
+ if(aNbFaces == 0)
+ aPopup->removeItem( 218 );
+ else
+ aPopup->setItemChecked( 218, aIsFacesMode );
+
+
+ if(aNbEdges == 0)
+ aPopup->removeItem( 217 );
+ else
+ aPopup->setItemChecked( 217, aIsEdgesMode );
+
+
+ bool aIsRemove = (aNbVolumes == 0 || aIsVolumesMode);
+ aIsRemove &= (aNbFaces == 0 || aIsFacesMode);
+ aIsRemove &= (aNbEdges == 0 || aIsEdgesMode);
+
+ if(aIsRemove)
+ aPopup->removeItem( 220 );
+ }
+
+ // Controls
mi = popup->findItem( 2000 );
if ( mi && mi->popup() ) {
- SMESH_Actor::eControl cMode = ac->GetControlMode();
+ SMESH_Actor::eControl cMode = anActor->GetControlMode();
switch ( cMode ) {
- case SMESH_Actor::eLengthEdges:
+ case SMESH_Actor::eLength:
mi->popup()->setItemChecked( 6001, true ); break;
+ case SMESH_Actor::eLength2D:
+ mi->popup()->setItemChecked( 6018, true ); break;
case SMESH_Actor::eFreeEdges:
mi->popup()->setItemChecked( 6002, true );
mi->popup()->removeItem( 201 );
break;
case SMESH_Actor::eMultiConnection:
mi->popup()->setItemChecked( 6004, true ); break;
+ case SMESH_Actor::eMultiConnection2D:
+ mi->popup()->setItemChecked( 6019, true ); break;
case SMESH_Actor::eArea:
mi->popup()->setItemChecked( 6011, true ); break;
case SMESH_Actor::eTaper:
mi->popup()->setItemChecked( 6012, true ); break;
case SMESH_Actor::eAspectRatio:
mi->popup()->setItemChecked( 6013, true ); break;
+ case SMESH_Actor::eAspectRatio3D:
+ mi->popup()->setItemChecked( 6017, true ); break;
case SMESH_Actor::eMinimumAngle:
mi->popup()->setItemChecked( 6014, true ); break;
case SMESH_Actor::eWarping:
mi->popup()->removeItem( 201 );
break;
}
- TVisualObjPtr aVisualObj = ac->GetObject();
- if(!aNbEdges){
+ TVisualObjPtr aVisualObj = anActor->GetObject();
+ if(aNbEdges == 0){
mi->popup()->removeItem( 6001 );
mi->popup()->removeItem( 6003 );
mi->popup()->removeItem( 6004 );
}
- if(!aNbFaces){
+ if(aNbFaces == 0){
+ mi->popup()->removeItem( 6018 );
mi->popup()->removeItem( 6002 );
mi->popup()->removeItem( 6011 );
mi->popup()->removeItem( 6012 );
mi->popup()->removeItem( 6014 );
mi->popup()->removeItem( 6015 );
mi->popup()->removeItem( 6016 );
+ mi->popup()->removeItem( 6019 );
+ }
+ if(aNbVolumes == 0){
+ mi->popup()->removeItem( 6017 );
}
- if(!aNbFaces && !aNbEdges)
+ if(aNbFaces == 0 && aNbEdges == 0 && aNbVolumes == 0)
popup->removeItem( 2000 ); // Scalar Bar
}
}
popup->removeItem( 1134 ); // Clipping
popup->removeItem( 2000 ); // Scalar Bar
}
+ // VSR 03/02/05 - check if actor is empty ----- start -----
+ vtkUnstructuredGrid* vtkGrid = anActor->GetUnstructuredGrid();
+ if ( vtkGrid->GetNumberOfPoints() + vtkGrid->GetNumberOfCells() == 0 ) {
+ popup->removeItem( QAD_Display_Popup_ID );
+ popup->removeItem( QAD_DisplayOnly_Popup_ID );
+ popup->removeItem( QAD_Erase_Popup_ID );
+ }
+ // VSR 03/02/05 - check if actor is empty ----- finish -----
}
else {
// object doesn't have actor
int topItem = popup->indexOf( QAD_TopLabel_Popup_ID );
if ( topItem >= 0 ) {
// set bold font for popup menu's TopLabel item
- QFont fnt = QApplication::font(); fnt.setBold( TRUE );
+ QFont fnt = popup->font(); fnt.setBold( TRUE );
popup->removeItem( QAD_TopLabel_Popup_ID );
popup->insertItem( new CustomItem( QString("%1 ").arg( nbSel ) + type + "(s) ", fnt ), QAD_TopLabel_Popup_ID, topItem );
}