// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "SUIT_Desktop.h"
#include "SalomeApp_Study.h"
+#include "LightApp_Application.h"
#include "LightApp_SelectionMgr.h"
#include "SVTK_Selector.h"
#include "SVTK_ViewWindow.h"
+#include "VTKViewer_CellLocationsArray.h"
#include "SALOME_Actor.h"
#include "SALOME_ListIO.hxx"
// VTK Includes
#include <vtkCell.h>
#include <vtkIdList.h>
-#include <vtkIntArray.h>
#include <vtkCellArray.h>
#include <vtkUnsignedCharArray.h>
#include <vtkUnstructuredGrid.h>
#include <vtkDataSetMapper.h>
#include <vtkActorCollection.h>
#include <vtkRenderer.h>
+#include <vtkProperty.h>
// QT Includes
#include <qbuttongroup.h>
#include <qvalidator.h>
#include <qevent.h>
+#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
+
using namespace std;
aCells->InsertNextCell(anIdList);
aCellTypesArray->InsertNextValue(VTK_VERTEX);
- vtkIntArray* aCellLocationsArray = vtkIntArray::New();
+ VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
aCellLocationsArray->SetNumberOfComponents(1);
aCellLocationsArray->SetNumberOfTuples(1);
aCells->InitTraversal();
- vtkIdType npts;
+ vtkIdType npts = 0;
aCellLocationsArray->SetValue(0, aCells->GetTraversalLocation(npts));
aGrid->SetCells(aCellTypesArray, aCellLocationsArray, aCells);
vtkProperty* aProp = vtkProperty::New();
aProp->SetRepresentationToPoints();
- float anRGB[3];
+ vtkFloatingPointType anRGB[3];
GetColor( "SMESH", "node_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 255, 0 ) );
aProp->SetColor( anRGB[0], anRGB[1], anRGB[2] );
- float aPointSize = GetFloat( "SMESH:node_size", 3 );
+ vtkFloatingPointType aPointSize = GetFloat( "SMESH:node_size", 3 );
aProp->SetPointSize( aPointSize );
myPreviewActor->SetProperty( aProp );
GroupButtonsLayout->setAlignment(Qt::AlignTop);
GroupButtonsLayout->setSpacing(6);
GroupButtonsLayout->setMargin(11);
+ buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
+ buttonHelp->setText(tr("SMESH_BUT_HELP" ));
+ buttonHelp->setAutoDefault(TRUE);
+ GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
buttonCancel = new QPushButton(GroupButtons, "buttonCancel");
buttonCancel->setText(tr("SMESH_BUT_CLOSE" ));
buttonCancel->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonCancel, 0, 3);
+ GroupButtonsLayout->addWidget(buttonCancel, 0, 1);
buttonApply = new QPushButton(GroupButtons, "buttonApply");
buttonApply->setText(tr("SMESH_BUT_APPLY" ));
buttonApply->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonApply, 0, 1);
+ GroupButtonsLayout->addWidget(buttonApply, 0, 0);
QSpacerItem* spacer_9 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
- GroupButtonsLayout->addItem(spacer_9, 0, 2);
+ GroupButtonsLayout->addItem(spacer_9, 0, 3);
buttonOk = new QPushButton(GroupButtons, "buttonOk");
- buttonOk->setText(tr("SMESH_BUT_OK" ));
+ buttonOk->setText(tr("SMESH_BUT_APPLY_AND_CLOSE" ));
buttonOk->setAutoDefault(TRUE);
buttonOk->setDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonOk, 0, 0);
+ GroupButtonsLayout->addWidget(buttonOk, 0, 2);
SMESHGUI_NodesDlgLayout->addWidget(GroupButtons, 2, 0);
/***************************************************************/
GroupCoordinatesLayout->setAlignment(Qt::AlignTop);
GroupCoordinatesLayout->setSpacing(6);
GroupCoordinatesLayout->setMargin(11);
+
TextLabel_X = new QLabel(GroupCoordinates, "TextLabel_X");
+ TextLabel_X->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
TextLabel_X->setText(tr("SMESH_X" ));
GroupCoordinatesLayout->addWidget(TextLabel_X, 0, 0);
+
TextLabel_Y = new QLabel(GroupCoordinates, "TextLabel_Y");
+ //TextLabel_Y->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
+ TextLabel_Y->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
TextLabel_Y->setText(tr("SMESH_Y" ));
GroupCoordinatesLayout->addWidget(TextLabel_Y, 0, 2);
TextLabel_Z = new QLabel(GroupCoordinates, "TextLabel_Z");
+ //TextLabel_Z->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
+ TextLabel_Z->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
TextLabel_Z->setText(tr("SMESH_Z" ));
GroupCoordinatesLayout->addWidget(TextLabel_Z, 0, 4);
SMESHGUI_NodesDlgLayout->addWidget(GroupCoordinates, 1, 0);
+ myHelpFileName = "adding_nodes_and_elements_page.html#adding_nodes_anchor";
+
/* Initialisation and display */
Init();
}
step = 25.0;
/* min, max, step and decimals for spin boxes */
- SpinBox_X->RangeStepAndValidator(-999.999, +999.999, step, 3);
- SpinBox_Y->RangeStepAndValidator(-999.999, +999.999, step, 3);
- SpinBox_Z->RangeStepAndValidator(-999.999, +999.999, step, 3);
+ SpinBox_X->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ SpinBox_Y->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
+ SpinBox_Z->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
SpinBox_X->SetValue(0.0);
SpinBox_Y->SetValue(0.0);
SpinBox_Z->SetValue(0.0);
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(SpinBox_X, SIGNAL (valueChanged(double)), SLOT(ValueChangedInSpinBox(double)));
connect(SpinBox_Y, SIGNAL (valueChanged(double)), SLOT(ValueChangedInSpinBox(double)));
/* to close dialog if study frame change */
connect(mySMESHGUI, SIGNAL (SignalStudyFrameChanged()), SLOT(ClickOnCancel()));
- /* Move widget on the botton right corner of main widget */
- int x, y;
- mySMESHGUI->DefineDlgPosition(this, x, y);
- this->move(x, y);
this->show();
// set selection mode
reject();
}
+//=================================================================================
+// function : ClickOnHelp()
+// purpose :
+//=================================================================================
+void SMESHGUI_NodesDlg::ClickOnHelp()
+{
+ LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app)
+ app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
+ else {
+ QString platform;
+#ifdef WIN32
+ platform = "winapplication";
+#else
+ platform = "application";
+#endif
+ SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
+ QObject::tr("BUT_OK"));
+ }
+}
+
//=================================================================================
// function : SelectionIntoArgument()
// purpose : Called when selection as changed or other case
SelectionIntoArgument();
}
+
+//=================================================================================
+// function : keyPressEvent()
+// purpose :
+//=================================================================================
+void SMESHGUI_NodesDlg::keyPressEvent( QKeyEvent* e )
+{
+ QDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Key_F1 )
+ {
+ e->accept();
+ ClickOnHelp();
+ }
+}