#include "VISU_ViewManager_i.hh"
#include "VISU_Actor.h"
+#include "LightApp_Application.h"
#include "SalomeApp_Application.h"
#include "SVTK_ViewWindow.h"
#include "SVTK_ViewModel.h"
#include "SUIT_Desktop.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
+#include "SUIT_ResourceMgr.h"
#include "QtxDblSpinBox.h"
TopLayout->setSpacing(6);
TopLayout->setMargin(11);
- QHBox* aOffsetsPane = new QHBox (this);
- aOffsetsPane->setSpacing(6);
+ QHBox* anOffsetsPane = new QHBox (this);
+ anOffsetsPane->setSpacing(6);
- new QLabel ("dX:", aOffsetsPane);
- myDxEdt = new QtxDblSpinBox (aOffsetsPane, "myDxEdt");
+ new QLabel ("dX:", anOffsetsPane);
+ myDxEdt = new QtxDblSpinBox (anOffsetsPane, "myDxEdt");
myDxEdt->setRange(-MAXVAL, MAXVAL);
- new QLabel("dY:", aOffsetsPane);
- myDyEdt = new QtxDblSpinBox (aOffsetsPane, "myDyEdt");
+ new QLabel("dY:", anOffsetsPane);
+ myDyEdt = new QtxDblSpinBox (anOffsetsPane, "myDyEdt");
myDyEdt->setRange(-MAXVAL, MAXVAL);
- new QLabel("dZ:", aOffsetsPane);
- myDzEdt = new QtxDblSpinBox (aOffsetsPane, "myDzEdt");
+ new QLabel("dZ:", anOffsetsPane);
+ myDzEdt = new QtxDblSpinBox (anOffsetsPane, "myDzEdt");
myDzEdt->setRange(-MAXVAL, MAXVAL);
- QPushButton* aResetBtn = new QPushButton(tr("BTN_RESET"), aOffsetsPane);
+ QPushButton* aResetBtn = new QPushButton(tr("BTN_RESET"), anOffsetsPane);
connect(aResetBtn, SIGNAL(clicked()), this, SLOT(onReset()));
- TopLayout->addWidget(aOffsetsPane);
+ TopLayout->addWidget(anOffsetsPane);
if (!VISU::GetCStudy(VISU::GetAppStudy(theModule))->GetProperties()->IsLocked()) {
mySaveChk = new QCheckBox ("Save to presentation", this);
QPushButton* buttonCancel = new QPushButton(tr("&Cancel") , GroupButtons, "buttonCancel");
buttonCancel->setAutoDefault(TRUE);
GroupButtonsLayout->addWidget(buttonCancel, 0, 4);
+ GroupButtonsLayout->addItem(new QSpacerItem(5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 5);
+
+ QPushButton* buttonHelp = new QPushButton(tr("&Help") , GroupButtons, "buttonHelp");
+ buttonHelp->setAutoDefault(TRUE);
+ GroupButtonsLayout->addWidget(buttonHelp, 0, 6);
TopLayout->addWidget(GroupButtons);
connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(onApply()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(onHelp()));
}
void VisuGUI_OffsetDlg::addPresentation (VISU::Prs3d_i* thePrs)
{
myPrsList.append(thePrs);
- OffsetStruct aOffs;
- thePrs->GetOffset(aOffs.myOffset);
- myOldOffsets.append(aOffs);
+ CORBA::Float anOffset[3];
+ thePrs->GetOffset(anOffset[0],anOffset[1],anOffset[2]);
+ OffsetStruct anOffs(anOffset[0],anOffset[1],anOffset[2]);
+ myOldOffsets.append(anOffs);
if (myPrsList.count() == 1) {
- setOffset(aOffs.myOffset);
+ setOffset(anOffs.myOffset);
} else if (myPrsList.count() == 2) {
- float aOffset[3];
- aOffset[0] = aOffset[1] = aOffset[2] = 0;
- setOffset(aOffset);
+ OffsetStruct anOffs;
+ setOffset(anOffs.myOffset);
}
}
-void VisuGUI_OffsetDlg::setOffset (const float* theOffset)
+void VisuGUI_OffsetDlg::setOffset (const vtkFloatingPointType* theOffset)
{
myDxEdt->setValue(theOffset[0]);
myDyEdt->setValue(theOffset[1]);
myDzEdt->setValue(theOffset[2]);
}
-void VisuGUI_OffsetDlg::getOffset (float* theOffset) const
+void VisuGUI_OffsetDlg::getOffset (vtkFloatingPointType* theOffset) const
{
theOffset[0] = myDxEdt->value();
theOffset[1] = myDyEdt->value();
return false;
}
-void VisuGUI_OffsetDlg::updateOffset (VISU::Prs3d_i* thePrs, float* theOffset)
+void VisuGUI_OffsetDlg::updateOffset (VISU::Prs3d_i* thePrs, vtkFloatingPointType* theOffset)
{
if (myPrsList.count() == 0) return;
- if (isToSave()) thePrs->SetOffset(theOffset);
+ if (isToSave()) thePrs->SetOffset(theOffset[0],theOffset[1],theOffset[2]);
ViewManagerList aViewManagerList;
SalomeApp_Application* anApp = myModule->getApp();
void VisuGUI_OffsetDlg::accept()
{
- float aOffset[3];
- getOffset(aOffset);
+ vtkFloatingPointType anOffset[3];
+ getOffset(anOffset);
for (int i = 0; i < myPrsList.count(); i++) {
- updateOffset(myPrsList.at(i), aOffset);
+ updateOffset(myPrsList.at(i), anOffset);
}
QDialog::accept();
}
void VisuGUI_OffsetDlg::onApply()
{
- float aOffset[3];
- getOffset(aOffset);
+ vtkFloatingPointType anOffset[3];
+ getOffset(anOffset);
for (int i = 0; i < myPrsList.count(); i++) {
- updateOffset(myPrsList.at(i), aOffset);
+ updateOffset(myPrsList.at(i), anOffset);
+ }
+}
+
+void VisuGUI_OffsetDlg::onHelp()
+{
+ QString aHelpFileName = "/files/scaling_presentations.htm";
+ LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app)
+ app->onHelpContextModule(myModule ? app->moduleName(myModule->moduleName()) : QString(""), aHelpFileName);
+ else {
+ SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
+ QObject::tr("BUT_OK"));
}
}