* This enumeration contains a set of available animation modes.
*/
enum AnimationMode{ PARALLEL, /*!< parallel mode of animation. */
- SUCCCESSIVE /*!< succcessive mode of animation. */
+ SUCCESSIVE /*!< succcessive mode of animation. */
};
/*! Defines the field which will be used as a base for generation of the animation.
#define VISU_GUITOOLS_EXPORT
#endif
-#endif
\ No newline at end of file
+#endif
//----------------------------------------------------------------------------
void
VisuGUI
-::OnTimeAnimation(int theMode)
+::OnTimeAnimation(VISU::Animation::AnimationMode theMode)
{
if (!VISU::GetActiveViewWindow<SVTK_ViewWindow>(this))
return;
VisuGUI::
OnParallelTimeAnimation()
{
- OnTimeAnimation(0);
+ OnTimeAnimation(VISU::Animation::PARALLEL);
}
void
VisuGUI::
OnSucccessiveTimeAnimation()
{
- OnTimeAnimation(1);
+ OnTimeAnimation(VISU::Animation::SUCCESSIVE);
}
//----------------------------------------------------------------------------
addPreference( tr( "Full MED loading" ), importGr, LightApp_Preferences::Bool, "VISU", "full_med_loading" );
addPreference( tr( "Build at once" ), importGr, LightApp_Preferences::Bool, "VISU", "build_at_once" );
addPreference( tr( "Build fields" ), importGr, LightApp_Preferences::Bool, "VISU", "build_fields" );
- addPreference( tr( "Build min/max" ), importGr, LightApp_Preferences::Bool, "VISU", "build_min_max" );
addPreference( tr( "Build groups" ), importGr, LightApp_Preferences::Bool, "VISU", "build_groups" );
addPreference( tr( "Close dialog at finish" ), importGr, LightApp_Preferences::Bool, "VISU", "close_at_finish" );
int aValue = aResourceMgr->integerValue("VISU","BuildDefaultPrs3d",0);
if (!aValue) {
VisuGUI_Plot3DDlg* aDlg = new VisuGUI_Plot3DDlg(this);
- aDlg->initFromPrsObject(aPrs3d);
+ aDlg->initFromPrsObject(aPrs3d, true);
int aOrient = aCutPrs->GetOrientationType(); // Plot3d has the same orientation type
double aRotX = aCutPrs->GetRotateX();
double aRotY = aCutPrs->GetRotateY();
protected:
virtual LightApp_Selection* createSelection() const;
- void OnTimeAnimation(int theMode);
+ void OnTimeAnimation(VISU::Animation::AnimationMode theMode);
private:
void createActions();
myBuildFieldsButton->setPaletteBackgroundColor( Qt::red );
connect( myBuildFieldsCheckBox, SIGNAL( clicked() ), this, SLOT( onBuildCheckBoxClicked() ) );
- myBuildMinMaxCheckBox = new QCheckBox( tr( "BUILD_MINMAX" ), myProgressBox );
- myBuildMinMaxCheckBox->setChecked( aResourceMgr->booleanValue( "VISU", "build_min_max", true ) );
- myBuildMinMaxButton = new QPushButton( myProgressBox );
- myBuildMinMaxButton->setEnabled( false );
- myBuildMinMaxButton->setFixedSize( 30, 30 );
- myBuildMinMaxButton->setPaletteBackgroundColor( Qt::red );
- connect( myBuildMinMaxCheckBox, SIGNAL( clicked() ), this, SLOT( onBuildCheckBoxClicked() ) );
-
myBuildGroupsCheckBox = new QCheckBox( tr( "BUILD_GROUPS" ), myProgressBox );
myBuildGroupsCheckBox->setChecked( aResourceMgr->booleanValue( "VISU", "build_groups", true ) );
myBuildGroupsButton = new QPushButton( myProgressBox );
aProgressLayout->addWidget( myBuildEntitiesButton, 0, 1 );
aProgressLayout->addWidget( myBuildFieldsCheckBox, 1, 0 );
aProgressLayout->addWidget( myBuildFieldsButton, 1, 1 );
- aProgressLayout->addWidget( myBuildMinMaxCheckBox, 2, 0 );
- aProgressLayout->addWidget( myBuildMinMaxButton, 2, 1 );
- aProgressLayout->addWidget( myBuildGroupsCheckBox, 3, 0 );
- aProgressLayout->addWidget( myBuildGroupsButton, 3, 1 );
+ aProgressLayout->addWidget( myBuildGroupsCheckBox, 2, 0 );
+ aProgressLayout->addWidget( myBuildGroupsButton, 2, 1 );
// Time
myTimeBox = new QGroupBox( tr( "IMPORT_TIME" ), this );
tr("BUT_OK"));
onClose();
}else{
- myResult->SetBuildFields( myBuildFieldsCheckBox->isChecked(), myBuildMinMaxCheckBox->isChecked() );
+ myResult->SetBuildFields( myBuildFieldsCheckBox->isChecked(), true );
myResult->SetBuildGroups( myBuildGroupsCheckBox->isChecked() );
//setModal( false );
bool isGroupsDone = myResult->IsGroupsDone();
updateButton( myBuildEntitiesButton, isEntitiesDone );
- updateButton( myBuildFieldsButton, isFieldsDone );
- updateButton( myBuildMinMaxButton, isMinMaxDone );
+ updateButton( myBuildFieldsButton, isFieldsDone && isMinMaxDone);
updateButton( myBuildGroupsButton, isGroupsDone );
}
else if( aCheckBox == myBuildFieldsCheckBox )
{
myBuildFieldsButton->setPaletteBackgroundColor( aColor );
- if( !anIsChecked && myBuildMinMaxCheckBox->isChecked() )
- myBuildMinMaxCheckBox->animateClick();
- }
- else if( aCheckBox == myBuildMinMaxCheckBox )
- {
- myBuildMinMaxButton->setPaletteBackgroundColor( aColor );
- if( anIsChecked && !myBuildFieldsCheckBox->isChecked() )
- myBuildFieldsCheckBox->animateClick();
}
else if( aCheckBox == myBuildGroupsCheckBox )
myBuildGroupsButton->setPaletteBackgroundColor( aColor );
QCheckBox* myBuildFieldsCheckBox;
QPushButton* myBuildFieldsButton;
- QCheckBox* myBuildMinMaxCheckBox;
- QPushButton* myBuildMinMaxButton;
-
QCheckBox* myBuildGroupsCheckBox;
QPushButton* myBuildGroupsButton;
using namespace std;
VisuGUI_CutLinesDlg::VisuGUI_CutLinesDlg (SalomeApp_Module* theModule)
- : VisuGUI_Prs3dDlg(theModule),
- myPreviewActor(0),myPreviewActorGlyphs(0)
+ : VisuGUI_ScalarBarBaseDlg(theModule),
+ myPreviewActor(0),
+ myPreviewActorGlyphs(0)
{
setCaption("Cut Lines Definition");
setSizeGripEnabled(true);
myTabBox->addTab( aLinesPane, tr("LBL_LINES_CUT") );
- myScalarPane = new VisuGUI_ScalarBarPane(this, false);
- myScalarPane->setMargin( 5 );
myInputPane = new VisuGUI_InputPane(VISU::TCUTLINES, theModule, this);
- myTabBox->addTab(myScalarPane, "Scalar Bar");
+ myTabBox->addTab(GetScalarPane(), "Scalar Bar");
myTabBox->addTab(myInputPane, "Input");
aMainLayout->addWidget(myTabBox);
}
//------------------------------------------------------------------------------
-void VisuGUI_CutLinesDlg::initFromPrsObject (VISU::ColoredPrs3d_i* thePrs, bool theInit)
+void VisuGUI_CutLinesDlg::initFromPrsObject ( VISU::ColoredPrs3d_i* thePrs,
+ bool theInit )
{
if( theInit )
myPrsCopy = VISU::TSameAsFactory<VISU::TCUTLINES>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
- myScalarPane->initFromPrsObject(myPrsCopy);
+ VisuGUI_ScalarBarBaseDlg::initFromPrsObject(myPrsCopy, theInit);
myRotXSpn->setValue(myPrsCopy->GetRotateX()*180./PI);
myRotYSpn->setValue(myPrsCopy->GetRotateY()*180./PI);
//------------------------------------------------------------------------------
int VisuGUI_CutLinesDlg::storeToPrsObject (VISU::ColoredPrs3d_i* thePrs)
{
- if(!myInputPane->check() || !myScalarPane->check())
+ if(!myInputPane->check() || !GetScalarPane()->check())
return 0;
int anIsOk = myInputPane->storeToPrsObject( myPrsCopy );
- anIsOk &= myScalarPane->storeToPrsObject( myPrsCopy );
+ anIsOk &= GetScalarPane()->storeToPrsObject( myPrsCopy );
myPrsCopy->SetOrientation(getOrientaion(),
myRotXSpn->value()*PI/180.,
void VisuGUI_CutLinesDlg::deletePlanes()
{
if (myPreviewActor == 0) return;
- SVTK_ViewWindow* aView;
vtkRenderer* aRend = myPreviewActor->GetRenderer();
vtkRenderer* aRendGlyphs = myPreviewActorGlyphs->GetRenderer();
if(aRendGlyphs && aWnd2)
myPreviewActorGlyphs->RemoveFromRender(aRendGlyphs);
-// Bug IPAL11962: preview is still in the viewer, if viewer not active.
-// if (aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>()){
-// aView->RemoveActor(myPreviewActor);
-// aView->RemoveActor(myPreviewActorGlyphs);
-// }
-
myPreviewActor->Delete();
myPreviewActorGlyphs->Delete();
myPreviewActor = 0;
void VisuGUI_CutLinesDlg::updateGlyphs(bool update){
if (myPreviewActorGlyphs == 0 ) return;
const vtkFloatingPointType *aDirLn = myCutLines->GetSpecificPL()->GetRealDirLn();
- const vtkFloatingPointType *aBasePnt = myCutLines->GetSpecificPL()->GetBasePnt();
vtkFloatingPointType aSecondPnt[3];
vtkFloatingPointType aBoundCenter[3];
void VisuGUI_CutLinesDlg::accept()
{
- myScalarPane->deletePreview();
- deletePlanes();
- QDialog::accept();
+ VisuGUI_ScalarBarBaseDlg::accept();
}
void VisuGUI_CutLinesDlg::reject()
{
- myScalarPane->deletePreview();
- deletePlanes();
- QDialog::reject();
+ VisuGUI_ScalarBarBaseDlg::reject();
}
void VisuGUI_CutLinesDlg::onPreviewCheck (bool thePreview)
}
}
-void VisuGUI_CutLinesDlg::onHelp()
-{
- QString aHelpFileName = "/files/cut_lines_presentation.htm";
- LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
- if (app) {
- VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
- app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
- }
- 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(aHelpFileName),
- QObject::tr("BUT_OK"));
- }
-}
-
-//jfa tmp:void VisuGUI_CutLinesDlg::onWindowActivated (SUIT_ViewWindow* theWnd)
-//jfa tmp:{
-//jfa tmp: if (theWnd != myStudyWnd)
-//jfa tmp: reject();
-//jfa tmp:}
-
-void VisuGUI_CutLinesDlg::keyPressEvent( QKeyEvent* e )
+QString VisuGUI_CutLinesDlg::GetContextHelpFilePath()
{
- QDialog::keyPressEvent( e );
- if ( e->isAccepted() )
- return;
-
- if ( e->key() == Key_F1 )
- {
- e->accept();
- onHelp();
- }
+ return "/files/cut_lines_presentation.htm";
}
class CutLines_i;
}
-class VisuGUI_CutLinesDlg: public VisuGUI_Prs3dDlg
+class VisuGUI_CutLinesDlg: public VisuGUI_ScalarBarBaseDlg
{
Q_OBJECT
VisuGUI_CutLinesDlg (SalomeApp_Module* theModule);
~VisuGUI_CutLinesDlg();
- virtual void initFromPrsObject(VISU::ColoredPrs3d_i* thePrs, bool theInit = true);
+ virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
+ bool theInit );
+
virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
bool isGenerateTable() { return myCreateTable->isChecked(); }
bool isGenerateCurves() { return myCreateTable->isChecked() && myCurvesCheck->isChecked(); }
-private:
- void keyPressEvent( QKeyEvent* e );
-
+protected:
+ virtual QString GetContextHelpFilePath();
+
protected slots:
void accept();
void reject();
void onAllCurvesInvertedCheck(bool theInvert);
void onRotation (double theValue);
void onPlanePos (const QString& theValue);
- void onHelp();
- //jfa tmp:void onWindowActivated (SUIT_ViewWindow*);
private:
void createPlanes();
SALOME::GenericObjPtr<VISU::CutLines_i> myCutLines;
QTabWidget* myTabBox;
- VisuGUI_ScalarBarPane* myScalarPane;
VisuGUI_InputPane* myInputPane;
VISU::CutPlanes::Orientation getOrientaion (bool IsBasePlane = true);
Constructor
*/
VisuGUI_CutPlanesDlg::VisuGUI_CutPlanesDlg (SalomeApp_Module* theModule)
- : VisuGUI_Prs3dDlg(theModule)
+ : VisuGUI_ScalarBarBaseDlg(theModule)
{
setCaption("Cut Planes Definition");
setSizeGripEnabled(true);
myTabBox = new QTabWidget(this);
myCutPane = new VisuGUI_CutPlanesPane(this/*, myMgr*/);
myTabBox->addTab(myCutPane, "Cut Planes");
- myScalarPane = new VisuGUI_ScalarBarPane(this, false);
- myScalarPane->setMargin(5);
myInputPane = new VisuGUI_InputPane(VISU::TCUTPLANES, theModule, this);
- myTabBox->addTab(myScalarPane, "Scalar Bar");
+ myTabBox->addTab(GetScalarPane(), "Scalar Bar");
myTabBox->addTab(myInputPane, "Input");
TopLayout->addWidget(myTabBox);
connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(onHelp()));
- //connect(myMgr, SIGNAL(closeAllViews()), this, SLOT(reject()));
- //connect(VisuGUI::application()->desktop(),
- // SIGNAL(windowActivated(SUIT_ViewWindow*)),
- // this, SLOT(onWindowActivated(SUIT_ViewWindow*)));
}
VisuGUI_CutPlanesDlg::~VisuGUI_CutPlanesDlg()
{}
-void VisuGUI_CutPlanesDlg::initFromPrsObject (VISU::ColoredPrs3d_i* thePrs, bool theInit)
+void VisuGUI_CutPlanesDlg::initFromPrsObject ( VISU::ColoredPrs3d_i* thePrs,
+ bool theInit )
{
if( theInit )
myPrsCopy = VISU::TSameAsFactory<VISU::TCUTPLANES>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
- myScalarPane->initFromPrsObject( myPrsCopy );
+ VisuGUI_ScalarBarBaseDlg::initFromPrsObject(myPrsCopy, theInit);
+
+ myCutPane->initFromPrsObject(myPrsCopy);
if( !theInit )
return;
- myScalarPane->initFromPrsObject(myPrsCopy);
- myCutPane->initFromPrsObject(myPrsCopy);
-
myInputPane->initFromPrsObject( myPrsCopy );
myTabBox->setCurrentPage( 0 );
}
int VisuGUI_CutPlanesDlg::storeToPrsObject (VISU::ColoredPrs3d_i* thePrs)
{
- if(!myInputPane->check() || !myScalarPane->check())
+ if(!myInputPane->check() || !GetScalarPane()->check())
return 0;
int anIsOk = myInputPane->storeToPrsObject(myPrsCopy);
- anIsOk &= myScalarPane->storeToPrsObject(myPrsCopy);
+ anIsOk &= GetScalarPane()->storeToPrsObject(myPrsCopy);
anIsOk &= myCutPane->storeToPrsObject(myPrsCopy);
VISU::TSameAsFactory<VISU::TCUTPLANES>().Copy(myPrsCopy, thePrs);
void VisuGUI_CutPlanesDlg::accept()
{
- //if ( !VisuGUI::CheckActiveStudyLock() ) {
- // reject();
- // return;
- //}
- if (myScalarPane->check())
- {
- myScalarPane->deletePreview();
- QDialog::accept();
- }
+ VisuGUI_ScalarBarBaseDlg::accept();
}
-void VisuGUI_CutPlanesDlg::reject() {
- myScalarPane->deletePreview();
- QDialog::reject();
+void VisuGUI_CutPlanesDlg::reject()
+{
+ VisuGUI_ScalarBarBaseDlg::reject();
}
-void VisuGUI_CutPlanesDlg::onHelp()
+QString VisuGUI_CutPlanesDlg::GetContextHelpFilePath()
{
- QString aHelpFileName = "/files/cut_lines_resentation.htm";
- LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
- if (app) {
- VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
- app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
- }
- 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(aHelpFileName),
- QObject::tr("BUT_OK"));
- }
+ return "/files/cut_lines_resentation.htm";
}
-//void VisuGUI_CutPlanesDlg::onWindowActivated (SUIT_ViewWindow* theWnd)
-//{
-// if (theWnd != myStudyWnd)
-// reject();
-//}
-
//###################################################################
QWidget* VisuGUI_NumEditItem::createEditor() const
editline->setValidator(dvalidator);
return editline;
}
-
-void VisuGUI_CutPlanesDlg::keyPressEvent( QKeyEvent* e )
-{
- QDialog::keyPressEvent( e );
- if ( e->isAccepted() )
- return;
-
- if ( e->key() == Key_F1 )
- {
- e->accept();
- onHelp();
- }
-}
void createPlanes();
void deletePlanes();
-
QLabel* LabelRot1;
QLabel* LabelRot2;
QSpinBox* nbPlan;
SALOME_Actor* myPreviewActor;
private slots:
-//VSR: 08/06/06: void editScalarBar();
void orientationChanged( int );
void DrawTable();
void setDefault( int all = -1);
};
-class VisuGUI_CutPlanesDlg : public VisuGUI_Prs3dDlg
+class VisuGUI_CutPlanesDlg : public VisuGUI_ScalarBarBaseDlg
{
Q_OBJECT
VisuGUI_CutPlanesDlg (SalomeApp_Module* theModule);
~VisuGUI_CutPlanesDlg();
- virtual void initFromPrsObject(VISU::ColoredPrs3d_i* thePrs, bool theInit = true);
+ virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
+ bool theInit );
+
virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
-private:
- void keyPressEvent( QKeyEvent* e );
-
+protected:
+ virtual QString GetContextHelpFilePath();
+
protected slots:
void accept();
void reject();
-//VSR: 08/06/06: void onWindowActivated (SUIT_ViewWindow*);
- void onHelp();
private:
QTabWidget* myTabBox;
VisuGUI_CutPlanesPane* myCutPane;
- VisuGUI_ScalarBarPane* myScalarPane;
VisuGUI_InputPane* myInputPane;
SALOME::GenericObjPtr<VISU::CutPlanes_i> myPrsCopy;
};
* Constructor
*/
VisuGUI_DeformedShapeDlg::VisuGUI_DeformedShapeDlg (SalomeApp_Module* theModule)
- : VisuGUI_Prs3dDlg(theModule)
+ : VisuGUI_ScalarBarBaseDlg(theModule)
{
setCaption(tr("DLG_TITLE"));
setSizeGripEnabled(TRUE);
myTabBox->addTab(aBox, tr("DEFORMED_SHAPE_TAB"));
// Scalar bar pane
- myScalarPane = new VisuGUI_ScalarBarPane (this, false);
- myScalarPane->setMargin(5);
myInputPane = new VisuGUI_InputPane(VISU::TDEFORMEDSHAPE, theModule, this);
- myTabBox->addTab(myScalarPane, tr("SCALAR_BAR_TAB"));
+ myTabBox->addTab(GetScalarPane(), tr("SCALAR_BAR_TAB"));
myTabBox->addTab(myInputPane, tr("INPUT_TAB"));
// Buttons
VisuGUI_DeformedShapeDlg::~VisuGUI_DeformedShapeDlg()
{}
-void VisuGUI_DeformedShapeDlg::initFromPrsObject (VISU::ColoredPrs3d_i* thePrs, bool theInit)
+void VisuGUI_DeformedShapeDlg::initFromPrsObject ( VISU::ColoredPrs3d_i* thePrs,
+ bool theInit )
{
if( theInit )
myPrsCopy = VISU::TSameAsFactory<VISU::TDEFORMEDSHAPE>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
- myScalarPane->initFromPrsObject( myPrsCopy );
+ VisuGUI_ScalarBarBaseDlg::initFromPrsObject(myPrsCopy, theInit);
setFactor(myPrsCopy->GetScale());
UseMagn->setChecked(myPrsCopy->IsColored());
int VisuGUI_DeformedShapeDlg::storeToPrsObject(VISU::ColoredPrs3d_i* thePrs)
{
- if(!myInputPane->check() || !myScalarPane->check())
+ if(!myInputPane->check() || !GetScalarPane()->check())
return 0;
int anIsOk = myInputPane->storeToPrsObject( myPrsCopy );
- anIsOk &= myScalarPane->storeToPrsObject( myPrsCopy );
+ anIsOk &= GetScalarPane()->storeToPrsObject( myPrsCopy );
myPrsCopy->SetScale(getFactor());
myPrsCopy->ShowColored(isColored());
return anIsOk;
}
-void VisuGUI_DeformedShapeDlg::accept() {
- if (myScalarPane->check())
- {
- myScalarPane->deletePreview();
- QDialog::accept();
- }
-}
-
-void VisuGUI_DeformedShapeDlg::reject()
+void VisuGUI_DeformedShapeDlg::accept()
{
- myScalarPane->deletePreview();
- QDialog::reject();
+ VisuGUI_ScalarBarBaseDlg::accept();
}
-void VisuGUI_DeformedShapeDlg::onHelp()
+void VisuGUI_DeformedShapeDlg::reject()
{
- QString aHelpFileName = "/files/deformed_shape_presentation.htm";
- LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
- if (app) {
- VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
- app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
- }
- 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(aHelpFileName),
- QObject::tr("BUT_OK"));
- }
+ VisuGUI_ScalarBarBaseDlg::reject();
}
-void VisuGUI_DeformedShapeDlg::keyPressEvent( QKeyEvent* e )
+QString VisuGUI_DeformedShapeDlg::GetContextHelpFilePath()
{
- QDialog::keyPressEvent( e );
- if ( e->isAccepted() )
- return;
-
- if ( e->key() == Key_F1 )
- {
- e->accept();
- onHelp();
- }
+ return "/files/deformed_shape_presentation.htm";
}
class DeformedShape_i;
}
-class VisuGUI_DeformedShapeDlg : public VisuGUI_Prs3dDlg
+class VisuGUI_DeformedShapeDlg : public VisuGUI_ScalarBarBaseDlg
{
Q_OBJECT
bool isColored()
{ return UseMagn->isChecked(); }
- virtual void initFromPrsObject(VISU::ColoredPrs3d_i* thePrs, bool theInit = true);
+ virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
+ bool theInit );
+
virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
-private:
- void keyPressEvent( QKeyEvent* e );
+protected:
+ virtual QString GetContextHelpFilePath();
protected slots:
void accept();
void reject();
- void onHelp();
- private:
+private:
QtxDblSpinBox* ScalFact;
QCheckBox* UseMagn;
QTabWidget* myTabBox;
- VisuGUI_ScalarBarPane* myScalarPane;
VisuGUI_InputPane* myInputPane;
SALOME::GenericObjPtr<VISU::DeformedShape_i> myPrsCopy;
};
using namespace std;
-VisuGUI_GaussScalarBarPane::VisuGUI_GaussScalarBarPane (QWidget * parent, bool SetPref):
+VisuGUI_GaussScalarBarPane::VisuGUI_GaussScalarBarPane (QWidget * parent):
QVBox(parent)
{
myVerX = 0.01; myVerY = 0.10; myVerW = 0.10; myVerH = 0.80;
//TopLayout->addWidget( DimGroup );
- // Save check box ===========================================================
QHBox* aSaveBox = new QHBox(this);
- if (!SetPref) {
- CBSave = new QCheckBox (tr("SAVE_DEFAULT_CHK"), aSaveBox, "CBSave");
- //TopLayout->addWidget(CBSave);
- }
- else {
- CBSave = 0;
- }
myTextBtn = new QPushButton("Text properties...", aSaveBox);
myTextDlg = new VisuGUI_TextPrefDlg(this);
- myTextDlg->setTitleVisible(!SetPref);
+ myTextDlg->setTitleVisible(true);
// signals and slots connections ===========================================
connect( RBFieldRange, SIGNAL( clicked() ), this, SLOT( fieldRangeClicked() ) );
bool isScalarMode = (aNbComp > 1);
myModeCombo->clear();
myModeCombo->insertItem("<Modulus>");
- const VISU::PField& aField = thePrs->GetField();
+ VISU::PField aField = thePrs->GetField();
const VISU::TNames& aCompNames = aField->myCompNames;
const VISU::TNames& aUnitNames = aField->myUnitNames;
for(int i = 0; i < aNbComp; i++){
thePrs->SetNbColors(ColorSpin->value());
thePrs->SetLabels(LabelSpin->value());
- //if (isToSave()) storeToResources();
-
if (myIsStoreTextProp) {
// "Title"
thePrs->SetTitle(myTextDlg->getTitleText().latin1());
return LabelSpin->value();
}
-bool VisuGUI_GaussScalarBarPane::isToSave() {
- return CBSave ? CBSave->isChecked() : false;
-}
-
void VisuGUI_GaussScalarBarPane::onTextPref()
{
myIsStoreTextProp = myTextDlg->exec();
/*!
* Constructor
*/
-VisuGUI_GaussPointsDlg::VisuGUI_GaussPointsDlg(SalomeApp_Module* theModule, bool SetPref):
+VisuGUI_GaussPointsDlg::VisuGUI_GaussPointsDlg(SalomeApp_Module* theModule):
VisuGUI_Prs3dDlg(theModule)
{
- setName("VisuGUI_ScalarBarDlg");
- setCaption(SetPref ? tr("DLG_PREF_TITLE") : tr("DLG_PROP_TITLE"));
+ setName("VisuGUI_GaussPointsDlg");
+ setCaption(tr("DLG_PROP_TITLE"));
setSizeGripEnabled(TRUE);
QVBoxLayout* TopLayout = new QVBoxLayout(this);
aDefShapeLayout->addWidget( myScaleSpinBox, 0, 1 );
// Scalar Bar pane
- myScalarPane = new VisuGUI_GaussScalarBarPane(this, SetPref);
+ myScalarPane = new VisuGUI_GaussScalarBarPane(this);
myScalarPane->setMargin(5);
// Input pane
VisuGUI_GaussPointsDlg::~VisuGUI_GaussPointsDlg()
{}
-void VisuGUI_GaussPointsDlg::initFromPrsObject(VISU::ColoredPrs3d_i* thePrs, bool theInit)
+void VisuGUI_GaussPointsDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
+ bool theInit )
{
if( theInit )
myPrsCopy = VISU::TSameAsFactory<VISU::TGAUSSPOINTS>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
if( (bool)myPrsCopy && myPrimitiveBox->getPrimitiveType() == VISU_OpenGLPointSpriteMapper::GeomSphere )
{
int aNumberOfFaces = myPrimitiveBox->getFaceNumber();
- int aNumberOfPoints = ( (vtkPolyData*)myPrsCopy->GetSpecificPL()->GetInput() )->GetNumberOfCells();
+ int aNumberOfPoints = myPrsCopy->GetSpecificPL()->GetInput()->GetNumberOfCells();
if( aNumberOfFaces * aNumberOfPoints > myPrimitiveBox->getFaceLimit() )
{
}
//if( myScalarPane->check() )
- QDialog::accept();
+ VisuGUI_Prs3dDlg::accept();
}
-void VisuGUI_GaussPointsDlg::onHelp()
+QString VisuGUI_GaussPointsDlg::GetContextHelpFilePath()
{
- QString aHelpFileName = "types_of_gauss_points_presentations.htm";
- LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
- if (app)
- app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName);
- 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(aHelpFileName),
- QObject::tr("BUT_OK"));
- }
-}
-
-void VisuGUI_GaussPointsDlg::keyPressEvent( QKeyEvent* e )
-{
- QDialog::keyPressEvent( e );
- if ( e->isAccepted() )
- return;
-
- if ( e->key() == Key_F1 )
- {
- e->accept();
- onHelp();
- }
+ return "types_of_gauss_points_presentations.htm";
}
Q_OBJECT
public:
- VisuGUI_GaussScalarBarPane(QWidget* parent, bool SetPref);
+ VisuGUI_GaussScalarBarPane(QWidget* parent);
~VisuGUI_GaussScalarBarPane() {};
int getOrientation();
double getHeight();
int getNbColors();
int getNbLabels();
- bool isToSave();
void initFromPrsObject(VISU::GaussPoints_i* thePrs);
int storeToPrsObject(VISU::GaussPoints_i* thePrs);
QLabel* LabelLabel;
QSpinBox* LabelSpin;
- QCheckBox* CBSave;
QLabel* myModeLbl;
QComboBox* myModeCombo;
QPushButton* myTextBtn;
Q_OBJECT
public:
- VisuGUI_GaussPointsDlg (SalomeApp_Module* theModule, bool SetPref = FALSE);
+ VisuGUI_GaussPointsDlg (SalomeApp_Module* theModule);
~VisuGUI_GaussPointsDlg();
//! Initializing dialog from the Gauss Points presentation.
- virtual void initFromPrsObject(VISU::ColoredPrs3d_i* thePrs, bool theInit = true);
+ virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
+ bool theInit );
//! Update Gauss Points presentation using parameters from the dialog.
virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
-private:
- void keyPressEvent( QKeyEvent* e );
-
+protected:
+ virtual QString GetContextHelpFilePath();
+
protected slots:
void onToggleDefShape( bool );
- void onHelp();
-
void accept();
private:
using namespace std;
-VisuGUI_IsoSurfPane::VisuGUI_IsoSurfPane (QWidget* parent)
- : QVBox(parent)
+VisuGUI_IsoSurfPane::VisuGUI_IsoSurfPane (QWidget* parent,
+ VisuGUI_ScalarBarPane* theScalarPane)
+ : QVBox(parent),
+ myScalarPane(theScalarPane)
{
QFrame* TopGroup = new QFrame( this, "TopGroup" );
TopGroup->setFrameStyle(QFrame::Box | QFrame::Sunken);
LabelMax->setBuddy(MaxIso);
TopGroupLayout->addWidget( MaxIso, 2, 1 );
-
-// CBUpdate = new QCheckBox ( tr( "Update scalar bar with these values" ), TopGroup);
-// CBUpdate->setSizePolicy( QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed) );
-// TopGroupLayout->addMultiCellWidget( CBUpdate, 4, 4, 0, 1);
-// CBUpdate->setChecked(false);
QPushButton* aUpdateBtn = new QPushButton( "Update scalar bar range with these values", TopGroup);
TopGroupLayout->addMultiCellWidget( aUpdateBtn, 3, 3, 0, 1);
connect( aUpdateBtn, SIGNAL( clicked() ), this, SLOT(onCBUpdate() ) );
-
-// CBLog = new QCheckBox ( tr( "Logarithmic scaling" ), TopGroup);
-// CBLog->setSizePolicy( QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed) );
-// TopGroupLayout->addMultiCellWidget( CBLog, 3, 3, 0, 1);
}
void VisuGUI_IsoSurfPane::initFromPrsObject (VISU::IsoSurfaces_i* thePrs)
NbrIso->setValue(thePrs->GetNbSurfaces());
MinIso->setText(QString::number(thePrs->GetSubMin()));
MaxIso->setText(QString::number(thePrs->GetSubMax()));
-// switch(thePrs->GetScaling()){
-// case VISU::LOGARITHMIC :
-// CBLog->setChecked(true);
-// break;
-// default:
-// CBLog->setChecked(false);
-// }
}
int VisuGUI_IsoSurfPane::storeToPrsObject (VISU::IsoSurfaces_i* thePrs)
thePrs->SetNbSurfaces(NbrIso->value());
thePrs->SetSubRange(MinIso->text().toDouble(), MaxIso->text().toDouble());
return 1;
-// if (CBUpdate->isChecked())
-// {
-// thePrs->SetRange(MinIso->text().toDouble(), MaxIso->text().toDouble());
-// if (CBLog->isChecked())
-// thePrs->SetScaling(VISU::LOGARITHMIC);
-// else
-// thePrs->SetScaling(VISU::LINEAR);
-// }
}
void VisuGUI_IsoSurfPane::onCBUpdate()
{
- // if (CBUpdate->isChecked()) {
myScalarPane->setRange(MinIso->text().toDouble(), MaxIso->text().toDouble(), true);
- // }
-// CBLog->setDisabled(false);
-// else CBLog->setDisabled(true);
}
bool VisuGUI_IsoSurfPane::check()
tr("MSG_MINMAX_VALUES"),
tr("BUT_OK"));
return false;
- } // else if (/* CBUpdate->isChecked() && CBLog->isChecked() && */
-// (MinIso->text().toDouble() <=0 || MaxIso->text().toDouble() <=0) ) {
-// SUIT_MessageBox::warn1( this,
-// tr("WRN_VISU"),
-// tr("WRN_LOGARITHMIC_RANGE_ISOSURF"),
-// tr("BUT_OK"));
-// return false;
-// }
+ }
return true;
}
Constructor
*/
VisuGUI_IsoSurfacesDlg::VisuGUI_IsoSurfacesDlg (SalomeApp_Module* theModule)
- : VisuGUI_Prs3dDlg(theModule)
+ : VisuGUI_ScalarBarBaseDlg(theModule)
{
setCaption(tr("DEFINE_ISOSURFACES"));
setSizeGripEnabled( TRUE );
TopLayout->setMargin(11);
myTabBox = new QTabWidget(this);
- myIsoPane = new VisuGUI_IsoSurfPane(this);
+ myIsoPane = new VisuGUI_IsoSurfPane(this, GetScalarPane());
myIsoPane->setMargin( 5 );
myTabBox->addTab(myIsoPane, "Iso Surface");
- myScalarPane = new VisuGUI_ScalarBarPane(this, false);
- myIsoPane->setScalarBarPane(myScalarPane);
- myScalarPane->setMargin( 5 );
myInputPane = new VisuGUI_InputPane(VISU::TISOSURFACES, theModule, this);
- myTabBox->addTab(myScalarPane, "Scalar Bar");
+ myTabBox->addTab(GetScalarPane(), "Scalar Bar");
myTabBox->addTab(myInputPane, "Input");
TopLayout->addWidget(myTabBox);
void VisuGUI_IsoSurfacesDlg::accept()
{
- if (myIsoPane->check() && myScalarPane->check())
- {
- myScalarPane->deletePreview();
- QDialog::accept();
- }
-}
-
-void VisuGUI_IsoSurfacesDlg::reject()
-{
- myScalarPane->deletePreview();
- QDialog::reject();
+ if ( myIsoPane->check() )
+ VisuGUI_ScalarBarBaseDlg::accept();
}
-void VisuGUI_IsoSurfacesDlg::initFromPrsObject(VISU::ColoredPrs3d_i* thePrs, bool theInit)
+void VisuGUI_IsoSurfacesDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
+ bool theInit )
{
if( theInit )
myPrsCopy = VISU::TSameAsFactory<VISU::TISOSURFACES>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
- myScalarPane->initFromPrsObject(myPrsCopy);
+ VisuGUI_ScalarBarBaseDlg::initFromPrsObject(myPrsCopy, theInit);
+
myIsoPane->initFromPrsObject(myPrsCopy);
if( !theInit )
int VisuGUI_IsoSurfacesDlg::storeToPrsObject(VISU::ColoredPrs3d_i* thePrs)
{
- if(!myInputPane->check() || !myScalarPane->check())
+ if(!myInputPane->check() || !GetScalarPane()->check())
return 0;
int anIsOk = myInputPane->storeToPrsObject( myPrsCopy );
- anIsOk &= myScalarPane->storeToPrsObject( myPrsCopy );
+ anIsOk &= GetScalarPane()->storeToPrsObject( myPrsCopy );
anIsOk &= myIsoPane->storeToPrsObject( myPrsCopy );
VISU::TSameAsFactory<VISU::TISOSURFACES>().Copy(myPrsCopy, thePrs);
return anIsOk;
}
-void VisuGUI_IsoSurfacesDlg::onHelp()
+QString VisuGUI_IsoSurfacesDlg::GetContextHelpFilePath()
{
- QString aHelpFileName = "/files/iso_surfaces_presentation.htm";
- LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
- if (app) {
- VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
- app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
- }
- 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(aHelpFileName),
- QObject::tr("BUT_OK"));
- }
-}
-
-void VisuGUI_IsoSurfacesDlg::keyPressEvent( QKeyEvent* e )
-{
- QDialog::keyPressEvent( e );
- if ( e->isAccepted() )
- return;
-
- if ( e->key() == Key_F1 )
- {
- e->accept();
- onHelp();
- }
+ return "/files/iso_surfaces_presentation.htm";
}
Q_OBJECT;
public:
- VisuGUI_IsoSurfPane (QWidget* parent);
+ VisuGUI_IsoSurfPane (QWidget* parent,
+ VisuGUI_ScalarBarPane* theScalarPane);
~VisuGUI_IsoSurfPane() {};
void initFromPrsObject(VISU::IsoSurfaces_i* thePrs);
int storeToPrsObject(VISU::IsoSurfaces_i* thePrs);
- void setScalarBarPane(VisuGUI_ScalarBarPane* theScalarPane) {myScalarPane = theScalarPane;}
- VisuGUI_ScalarBarPane* getScalarBarPane() {return myScalarPane;}
-
bool check();
protected slots:
};
-class VisuGUI_IsoSurfacesDlg : public VisuGUI_Prs3dDlg
+class VisuGUI_IsoSurfacesDlg : public VisuGUI_ScalarBarBaseDlg
{
Q_OBJECT;
VisuGUI_IsoSurfacesDlg (SalomeApp_Module* theModule);
~VisuGUI_IsoSurfacesDlg();
- virtual void initFromPrsObject(VISU::ColoredPrs3d_i* thePrs, bool theInit = true);
+ virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
+ bool theInit );
+
virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
- private:
- void keyPressEvent( QKeyEvent* e );
+ protected:
+ virtual QString GetContextHelpFilePath();
protected slots:
void accept();
- void reject();
- void onHelp();
private:
QTabWidget* myTabBox;
VisuGUI_IsoSurfPane* myIsoPane;
- VisuGUI_ScalarBarPane* myScalarPane;
VisuGUI_InputPane* myInputPane;
SALOME::GenericObjPtr<VISU::IsoSurfaces_i> myPrsCopy;
//purpose :
//=======================================================================
VisuGUI_Plot3DDlg::VisuGUI_Plot3DDlg (SalomeApp_Module* theModule)
- : VisuGUI_Prs3dDlg(theModule)
+ : VisuGUI_ScalarBarBaseDlg(theModule)
{
setCaption(tr("TITLE"));
setSizeGripEnabled(TRUE);
myIsoPane = new VisuGUI_Plot3DPane (this);
myIsoPane->setMargin(5);
myTabBox->addTab(myIsoPane, tr("PLOT3D_TAB_TITLE"));
- myScalarPane = new VisuGUI_ScalarBarPane (this, false);
- myScalarPane->setMargin(5);
myInputPane = new VisuGUI_InputPane(VISU::TPLOT3D, theModule, this);
- myTabBox->addTab(myScalarPane, tr("SCALAR_BAR_TAB_TITLE"));
+ myTabBox->addTab(GetScalarPane(), tr("SCALAR_BAR_TAB_TITLE"));
myTabBox->addTab(myInputPane, tr("INPUT_TAB_TITLE"));
TopLayout->addWidget(myTabBox);
//=======================================================================
void VisuGUI_Plot3DDlg::accept()
{
- if (myIsoPane->check() && myScalarPane->check())
- {
- myScalarPane->deletePreview();
- QDialog::accept();
- }
+ if (myIsoPane->check() && GetScalarPane()->check())
+ VisuGUI_ScalarBarBaseDlg::accept();
}
//=======================================================================
//=======================================================================
void VisuGUI_Plot3DDlg::reject()
{
- myIsoPane->check(); // hide preview
- myScalarPane->deletePreview();
-
- QDialog::reject();
+ VisuGUI_ScalarBarBaseDlg::reject();
}
//=======================================================================
//function : initFromPrsObject
//purpose :
//=======================================================================
-void VisuGUI_Plot3DDlg::initFromPrsObject(VISU::ColoredPrs3d_i* thePrs, bool theInit)
+void VisuGUI_Plot3DDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
+ bool theInit )
{
if( theInit )
myPrsCopy = VISU::TSameAsFactory<VISU::TPLOT3D>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
- myScalarPane->initFromPrsObject(myPrsCopy);
+ VisuGUI_ScalarBarBaseDlg::initFromPrsObject(myPrsCopy, theInit);
+
myIsoPane->initFromPrsObject(myPrsCopy);
if( !theInit )
//=======================================================================
int VisuGUI_Plot3DDlg::storeToPrsObject (VISU::ColoredPrs3d_i* thePrs)
{
- if(!myInputPane->check() || !myScalarPane->check())
+ if(!myInputPane->check() || !GetScalarPane()->check())
return 0;
int anIsOk = myInputPane->storeToPrsObject( myPrsCopy );
- anIsOk &= myScalarPane->storeToPrsObject( myPrsCopy );
+ anIsOk &= GetScalarPane()->storeToPrsObject( myPrsCopy );
anIsOk &= myIsoPane->storeToPrsObject( myPrsCopy );
VISU::TSameAsFactory<VISU::TPLOT3D>().Copy(myPrsCopy, thePrs);
//function : onHelp
//purpose :
//=======================================================================
-void VisuGUI_Plot3DDlg::onHelp()
+QString VisuGUI_Plot3DDlg::GetContextHelpFilePath()
{
- QString aHelpFileName = "plot_3d_presentation.htm";
- LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
- if (app) {
- VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
- app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
- }
- 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(aHelpFileName),
- QObject::tr("BUT_OK"));
- }
+ return "plot_3d_presentation.htm";
}
//=======================================================================
{
myIsoPane->setPlane(theOrientation, theXRotation, theYRotation, thePlanePos);
}
-
-//=================================================================================
-// function : keyPressEvent()
-// purpose :
-//=================================================================================
-void VisuGUI_Plot3DDlg::keyPressEvent( QKeyEvent* e )
-{
- QDialog::keyPressEvent( e );
- if ( e->isAccepted() )
- return;
-
- if ( e->key() == Key_F1 )
- {
- e->accept();
- onHelp();
- }
-}
};
-class VisuGUI_Plot3DDlg : public VisuGUI_Prs3dDlg
+class VisuGUI_Plot3DDlg : public VisuGUI_ScalarBarBaseDlg
{
Q_OBJECT
VisuGUI_Plot3DDlg (SalomeApp_Module* theModule);
~VisuGUI_Plot3DDlg();
- virtual void initFromPrsObject(VISU::ColoredPrs3d_i* thePrs, bool theInit = true);
+ virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
+ bool theInit );
+
virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
void setPlane(int theOrientation, double theXRotation, double theYRotation, double thePlanePos);
- private:
- void keyPressEvent( QKeyEvent* e );
-
+ protected:
+ virtual QString GetContextHelpFilePath();
+
protected slots:
void accept();
void reject();
- void onHelp();
private:
QTabWidget* myTabBox;
VisuGUI_Plot3DPane* myIsoPane;
- VisuGUI_ScalarBarPane* myScalarPane;
VisuGUI_InputPane* myInputPane;
SALOME::GenericObjPtr<VISU::Plot3D_i> myPrsCopy;
//-----------------------------------------------------------------------
// Text Preferences Dialog
//-----------------------------------------------------------------------
-
/*!
Constructor
*/
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(onHelp()));
}
+
+//----------------------------------------------------------------------------
QString VisuGUI_TextPrefDlg::getTitleText()
{
return myTitleEdt->text();
}
+
+//----------------------------------------------------------------------------
void VisuGUI_TextPrefDlg::setTitleText(QString theText)
{
myTitleEdt->setText(theText);
}
+
+//----------------------------------------------------------------------------
void VisuGUI_TextPrefDlg::setTitleVisible(bool isVisible)
{
if(isVisible)
myTitleEdt->hide();
}
+
+//----------------------------------------------------------------------------
void VisuGUI_TextPrefDlg::onHelp()
{
QString aHelpFileName = "/files/scalar_map_presentation.htm";
}
}
+
+//----------------------------------------------------------------------------
void VisuGUI_TextPrefDlg::storeBeginValues()
{
myTitle = myTitleEdt->text();
myLabelFont->GetData(myColors[1], myComboVals[1], myCheckVals[3], myCheckVals[4], myCheckVals[5]);
}
+
+//----------------------------------------------------------------------------
/*!
Called when <Cancel> button is clicked, restore begin values
*/
QDialog::reject();
}
+
+
+//----------------------------------------------------------------------------
/*!
Called when <Ok> button is clicked, store begin values
*/
QDialog::accept();
}
+
+//----------------------------------------------------------------------------
/*!
Provides help on F1 button click
*/
//-----------------------------------------------------------------------
// Scalar Bar Pane
//-----------------------------------------------------------------------
-
/*!
Constructor
*/
-VisuGUI_ScalarBarPane::VisuGUI_ScalarBarPane (QWidget * parent, bool SetPref):
- QVBox(parent), myPreviewActor(0)
+VisuGUI_ScalarBarPane::VisuGUI_ScalarBarPane (QWidget * parent):
+ QVBox(parent),
+ myPreviewActor(0),
+ myScalarMap(NULL),
+ myScalarMapPL(NULL)
{
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
QString propertyName;
myHorW = aResourceMgr->doubleValue("VISU", propertyName + "width", 0.);
myHorH = aResourceMgr->doubleValue("VISU", propertyName + "height",0.);
- Imin = 0.0; Imax = 0.0; /*Fmin = 0.0; Fmax = 0.0;*/ Rmin = 0.0; Rmax = 0.0;
- myRangeMode = -1;
-
setSpacing(6);
//setMargin(11);
// Save check box ===========================================================
QHBox* aSaveBox = new QHBox(this);
- if (!SetPref) {
- CBSave = new QCheckBox (tr("SAVE_DEFAULT_CHK"), aSaveBox, "CBSave");
- //TopLayout->addWidget(CBSave);
- }
- else {
- CBSave = 0;
- }
myTextBtn = new QPushButton("Text properties...", aSaveBox);
myTextDlg = new VisuGUI_TextPrefDlg(this);
- myTextDlg->setTitleVisible(!SetPref);
+ myTextDlg->setTitleVisible(TRUE);
QGroupBox* CheckGroup = new QGroupBox("", this, "CheckGroup");
CheckGroup->setColumnLayout(0, Qt::Vertical );
myBusy = false;
}
-/**
- * Initializes dialog box values from resources
- */
-void VisuGUI_ScalarBarPane::initFromResources() {
- int sbCol=64,sbLab=5,orient=0;
- float sbX1=0.01,sbY1=0.1,sbW=0.1,sbH=0.8;
- float sbVmin=0., sbVmax=0.;
- bool sbRange=false;
- QString aString;
-
- SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
-
- bool anIsArrangeBar = aResourceMgr->booleanValue("VISU", "scalar_bars_default_position", 0);
- int aPlace = 1;
- if (anIsArrangeBar){
- aPlace = aResourceMgr->integerValue("VISU", "scalar_bar_position_num",0);
- }
-
- int aScalarMode = aResourceMgr->integerValue("VISU", "scalar_bar_mode", 0);
- myModeCombo->setCurrentItem(aScalarMode);
-
- orient = aResourceMgr->integerValue("VISU", "scalar_bar_orientation", orient);
- if(orient != 0){
- orient=1;
- sbX1=0.2;
- sbY1=0.01;
- sbW=0.6;
- sbH=0.12;
- }
-
- QString propertyName = QString( "scalar_bar_%1_" ).arg( orient == 0 ? "vertical" : "horizontal" );
-
- sbX1 = aResourceMgr->doubleValue("VISU", propertyName + "x", sbX1);
- sbY1 = aResourceMgr->doubleValue("VISU", propertyName + "y", sbY1);
-
- sbW = aResourceMgr->doubleValue("VISU", propertyName + "width", sbW);
- sbH = aResourceMgr->doubleValue("VISU", propertyName + "height",sbH);
-
- if(orient){
- sbY1 += sbH*(aPlace-1);
- } else {
- sbX1 += sbW*(aPlace-1);
- }
- sbCol = aResourceMgr->integerValue("VISU" ,"scalar_bar_num_colors", sbCol);
- sbLab = aResourceMgr->integerValue("VISU", "scalar_bar_num_labels", sbLab);
-
- int rangeType = aResourceMgr->integerValue("VISU" , "scalar_range_type", 0);
- if (rangeType == 1) sbRange = true;
- sbVmin = aResourceMgr->doubleValue("VISU", "scalar_range_min", sbVmin);
- sbVmax = aResourceMgr->doubleValue("VISU", "scalar_range_max", sbVmax);
-
- bool isLog = aResourceMgr->booleanValue("VISU", "scalar_bar_logarithmic", false);
- setLogarithmic(isLog);
-
- if((sbX1 < 0.) || (sbY1 < 0.) ||
- ((sbX1+sbW) > 1.) || ((sbY1+sbH) > 1.)) {
- if(orient == 0) {
- sbX1=0.01;
- sbY1=0.1;
- sbW=0.1;
- sbH=0.8;
- } else {
- sbX1=0.2;
- sbY1=0.01;
- sbW=0.6;
- sbH=0.12;
- }
- }
- if(sbCol < 2) sbCol=2;
- if(sbCol > 64) sbCol=64;
- if(sbLab < 2) sbLab=2;
- if(sbLab > 65) sbLab=65;
-
- if(sbVmin > sbVmax) {
- sbVmin=0.;
- sbVmax=0.;
- }
-
- setRange( sbVmin, sbVmax, /*0.0, 0.0,*/ sbRange );
- setPosAndSize( sbX1, sbY1, sbW, sbH, orient == 0);
- setScalarBarData( sbCol, sbLab );
-
- // "Title"
- bool isBold = false, isItalic = false, isShadow = false;
- int aFontFamily = VTK_ARIAL;
-
- if ( aResourceMgr->hasValue( "VISU", "scalar_bar_title_font" ) )
- {
- QFont f = aResourceMgr->fontValue( "VISU", "scalar_bar_title_font" );
-
- if ( f.family() == "Arial" )
- aFontFamily = VTK_ARIAL;
- else if ( f.family() == "Courier" )
- aFontFamily = VTK_COURIER;
- else if ( f.family() == "Times" )
- aFontFamily = VTK_TIMES;
-
- isBold = f.bold();
- isItalic = f.italic();
- isShadow = f.underline();
- }
-
- QColor aTextColor = aResourceMgr->colorValue( "VISU", "scalar_bar_title_color", QColor( 255, 255, 255 ) );
-
- myTextDlg->myTitleFont->SetData(aTextColor, aFontFamily, isBold, isItalic, isShadow);
-
- // "Labels"
- isBold = isItalic = isShadow = false;
- aFontFamily = VTK_ARIAL;
- if ( aResourceMgr->hasValue( "VISU", "scalar_bar_label_font" ) )
- {
- QFont f = aResourceMgr->fontValue( "VISU", "scalar_bar_label_font" );
-
- if ( f.family() == "Arial" )
- aFontFamily = VTK_ARIAL;
- else if ( f.family() == "Courier" )
- aFontFamily = VTK_COURIER;
- else if ( f.family() == "Times" )
- aFontFamily = VTK_TIMES;
-
- isBold = f.bold();
- isItalic = f.italic();
- isShadow = f.underline();
- }
-
- aTextColor = aResourceMgr->colorValue( "VISU", "scalar_bar_label_color", QColor( 255, 255, 255 ) );
-
- myTextDlg->myLabelFont->SetData(aTextColor, aFontFamily, isBold, isItalic, isShadow);
+//----------------------------------------------------------------------------
+VisuGUI_ScalarBarPane::~VisuGUI_ScalarBarPane()
+{
+ deleteScalarBar();
+ if (SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
+ aViewWindow->Repaint();
}
-/**
- * Stores dialog values to resources
- */
-void VisuGUI_ScalarBarPane::storeToResources() {
- int orient = (RBvert->isChecked())? 0 : 1;
- float sbX1 = XSpin->value();
- float sbY1 = YSpin->value();
- float sbW = WidthSpin->value();
- float sbH = HeightSpin->value();
- int sbCol = ColorSpin->value();
- int sbLab = LabelSpin->value();
-
- if((sbX1 < 0.) || (sbY1 < 0.) || ((sbX1+sbW) > 1.) || ((sbY1+sbH) > 1.)) {
- if(orient == 0) {
- sbX1=0.01;
- sbY1=0.1;
- sbW=0.17;
- sbH=0.8;
- } else {
- sbX1=0.2;
- sbY1=0.01;
- sbW=0.6;
- sbH=0.12;
- }
- }
-
- bool sbRange = RBIrange->isChecked();
- float sbVmin = (float)(MinEdit->text().toDouble());
- float sbVmax = (float)(MaxEdit->text().toDouble());
-
- if(sbVmin > sbVmax) {
- sbVmin=0.;
- sbVmax=0.;
- }
-
- SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
-
- aResourceMgr->setValue("VISU", "scalar_bar_orientation", orient);
-
- QString propertyName = QString( "scalar_bar_%1_" ).arg( orient == 0 ? "vertical" : "horizontal" );
-
- aResourceMgr->setValue("VISU", propertyName + "x", sbX1);
- aResourceMgr->setValue("VISU", propertyName + "y", sbY1);
- aResourceMgr->setValue("VISU", propertyName + "width", sbW);
- aResourceMgr->setValue("VISU", propertyName + "height", sbH);
-
- aResourceMgr->setValue("VISU", "scalar_bar_num_colors", sbCol);
- aResourceMgr->setValue("VISU", "scalar_bar_num_labels", sbLab);
-
- if(sbRange)
- {
- aResourceMgr->setValue("VISU", "scalar_range_type", 1);
- aResourceMgr->setValue("VISU", "scalar_range_min" ,sbVmin);
- aResourceMgr->setValue("VISU", "scalar_range_max" ,sbVmax);
- }
- else
- aResourceMgr->setValue("VISU", "scalar_range_type", 0);
-
- aResourceMgr->setValue("VISU", "scalar_bar_logarithmic", isLogarithmic());
-
- ////
-
- if (myIsStoreTextProp) {
- // "Title"
- QColor aTitleColor (255, 255, 255);
- int aTitleFontFamily = VTK_ARIAL;
- bool isTitleBold = false;
- bool isTitleItalic = false;
- bool isTitleShadow = false;
-
- myTextDlg->myTitleFont->GetData(aTitleColor, aTitleFontFamily,
- isTitleBold, isTitleItalic, isTitleShadow);
-
- QFont aTitleFont;
-
- aTitleFont.setBold(isTitleBold);
- aTitleFont.setItalic(isTitleItalic);
- aTitleFont.setUnderline(isTitleShadow);
-
- QString titleFontFamily;
- switch (aTitleFontFamily) {
- case VTK_ARIAL:
- titleFontFamily = "Arial";
- break;
- case VTK_COURIER:
- titleFontFamily = "Courier";
- break;
- case VTK_TIMES:
- titleFontFamily = "Times";
- break;
- }
- aTitleFont.setFamily(titleFontFamily);
-
- aResourceMgr->setValue("VISU", "scalar_bar_title_font", aTitleFont);
-
- aResourceMgr->setValue("VISU", "scalar_bar_title_color", aTitleColor);
-
- // "Label"
- QColor aLabelColor (255, 255, 255);
- int aLabelFontFamily = VTK_ARIAL;
- bool isLabelBold = false;
- bool isLabelItalic = false;
- bool isLabelShadow = false;
-
- myTextDlg->myLabelFont->GetData(aLabelColor, aLabelFontFamily,
- isLabelBold, isLabelItalic, isLabelShadow);
-
-
- QFont aLabelFont;
-
- aLabelFont.setBold(isLabelBold);
- aLabelFont.setItalic(isLabelItalic);
- aLabelFont.setUnderline(isLabelShadow);
-
- QString labelFontFamily;
- switch (aLabelFontFamily) {
- case VTK_ARIAL:
- labelFontFamily = "Arial";
- break;
- case VTK_COURIER:
- labelFontFamily = "Courier";
- break;
- case VTK_TIMES:
- labelFontFamily = "Times";
- break;
- }
-
- aLabelFont.setFamily(labelFontFamily);
-
- aResourceMgr->setValue("VISU", "scalar_bar_label_font", aLabelFont);
-
- aResourceMgr->setValue("VISU", "scalar_bar_label_color", aLabelColor);
- }
-}
+//----------------------------------------------------------------------------
/**
* Initialise dialog box from presentation object
*/
void VisuGUI_ScalarBarPane::initFromPrsObject(VISU::ColoredPrs3d_i* thePrs)
{
- initFromResources();
myScalarMap = dynamic_cast<VISU::ScalarMap_i*>(thePrs);
+
if( !myScalarMap )
return;
- myTitle = myScalarMap->GetTitle();
- setPosAndSize( myScalarMap->GetPosX(),
- myScalarMap->GetPosY(),
- myScalarMap->GetWidth(),
- myScalarMap->GetHeight(),
- myScalarMap->GetBarOrientation());
switch(myScalarMap->GetScaling()){
case VISU::LOGARITHMIC :
setLogarithmic(true);
default:
setLogarithmic(false);
}
- CORBA::Double aRange[2] = {myScalarMap->GetSourceMin(), myScalarMap->GetSourceMax()};
- Rmin = aRange[0]; Rmax = aRange[1];
- setRange( myScalarMap->GetMin(), myScalarMap->GetMax(),
- /*0.0, 0.0,*/ myScalarMap->IsRangeFixed() );
- setScalarBarData( myScalarMap->GetNbColors(), myScalarMap->GetLabels() );
// Update myModeCombo
const VISU::PField& aField = myScalarMap->GetScalarField();
myModeCombo->insertItem(aComponent);
}
- //
+
myModeCombo->setCurrentItem(myScalarMap->GetScalarMode());
- if (aNbComp==1){
+ if(aNbComp == 1)
myModeCombo->setCurrentItem(1);
- }
- //
+
myModeLbl->setEnabled(isScalarMode);
myModeCombo->setEnabled(isScalarMode);
+ setRange( myScalarMap->GetMin(), myScalarMap->GetMax(), myScalarMap->IsRangeFixed() );
+
+ setScalarBarData( myScalarMap->GetNbColors(), myScalarMap->GetLabels() );
+
// "Title"
- myTextDlg->setTitleText(QString(myScalarMap->GetTitle()));
+ CORBA::String_var aTitle = myScalarMap->GetTitle();
+ myTextDlg->setTitleText(aTitle.in());
+ myTitle = aTitle.in();
vtkFloatingPointType R, G, B;
myScalarMap->GetTitleColor(&R, &G, &B);
+ setPosAndSize( myScalarMap->GetPosX(),
+ myScalarMap->GetPosY(),
+ myScalarMap->GetWidth(),
+ myScalarMap->GetHeight(),
+ myScalarMap->GetBarOrientation());
+
myTextDlg->myTitleFont->SetData(QColor((int)(R*255.), (int)(G*255.), (int)(B*255.)),
myScalarMap->GetTitFontType(),
myScalarMap->IsBoldTitle(),
}
}
+
+
+//----------------------------------------------------------------------------
/*! Slot update preview of scalar bar, if preview is checked
*/
void VisuGUI_ScalarBarPane::updatePreview()
}
}
+
+//----------------------------------------------------------------------------
/*! Creating preview scalar bar
*/
void VisuGUI_ScalarBarPane::createScalarBar()
myBusy = false;
}
+
+
+//----------------------------------------------------------------------------
/*! Deleting preview scalar bar
*/
void VisuGUI_ScalarBarPane::deleteScalarBar()
myScalarMapPL = 0;
}
}
-/*! public: Deleting preview scalar bar
- */
-void VisuGUI_ScalarBarPane::deletePreview()
-{
- deleteScalarBar();
- if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
- vf->Repaint();
-}
+
+
+//----------------------------------------------------------------------------
/**
* Store values to presentation object
*/
myScalarMap->SetNbColors(ColorSpin->value());
myScalarMap->SetLabels(LabelSpin->value());
- if (isToSave()) storeToResources();
-
if (myIsStoreTextProp) {
// "Title"
myScalarMap->SetTitle(myTextDlg->getTitleText().latin1());
return 1;
}
+
+//----------------------------------------------------------------------------
/*!
Called when orientation is changed
*/
updatePreview();
}
+
+//----------------------------------------------------------------------------
/*!
Called when Range mode is changed
*/
void VisuGUI_ScalarBarPane::changeRange( int )
{
- int mode = -1;
- if ( RBFrange->isChecked() )
- mode = 0;
- if ( RBIrange->isChecked() )
- mode = 1;
- if ( myRangeMode == mode )
- return;
- //MinSpin->setMaxValue( Fmin );
- //MaxSpin->setMinValue( Fmax );
if ( RBFrange->isChecked() ) {
- //MinLabel->setEnabled( false );
MinEdit->setEnabled( false );
- //MaxLabel->setEnabled( false );
MaxEdit->setEnabled( false );
- if ( mode != -1 ) {
- Imin = MinEdit->text().toDouble();
- Imax = MaxEdit->text().toDouble();
- }
- MinEdit->setText( QString::number( Rmin ) );
- MaxEdit->setText( QString::number( Rmax ) );
- }
- else {
- //MinLabel->setEnabled( true );
+ } else {
MinEdit->setEnabled( true );
- //MaxLabel->setEnabled( true );
MaxEdit->setEnabled( true );
- MinEdit->setText( QString::number( Imin ) );
- MaxEdit->setText( QString::number( Imax ) );
}
- myRangeMode = mode;
- updatePreview();
+
+ changeScalarMode(myModeCombo->currentItem());
}
+
+//----------------------------------------------------------------------------
/*!
Called when X,Y position is changed
*/
updatePreview();
}
+
+//----------------------------------------------------------------------------
/*!
Called when scalar mode is changed
*/
{
if ( myScalarMap ) {
if ( RBFrange->isChecked() ) {
- int aMode = myScalarMap->GetScalarMode();
- myScalarMap->SetScalarMode(theMode);
- CORBA::Double aRange[2] = {myScalarMap->GetSourceMin(), myScalarMap->GetSourceMax()};
- MinEdit->setText( QString::number( aRange[0] ) );
- MaxEdit->setText( QString::number( aRange[1] ) );
- myScalarMap->SetScalarMode(aMode);
+ MinEdit->setText( QString::number( myScalarMap->GetComponentMin(theMode) ) );
+ MaxEdit->setText( QString::number( myScalarMap->GetComponentMax(theMode) ) );
}
}
updatePreview();
}
+
+//----------------------------------------------------------------------------
/*!
Sets default values and range mode
*/
-void VisuGUI_ScalarBarPane::setRange( double imin, double imax/*, double fmin, double fmax*/, bool sbRange )
+void VisuGUI_ScalarBarPane::setRange( double imin, double imax, bool sbRange )
{
- Imin = imin; Imax = imax;// Fmin = fmin; Fmax = fmax;
- if ( RBIrange->isChecked() ) {
- MinEdit->setText( QString::number( Imin ) );
- MaxEdit->setText( QString::number( Imax ) );
- }
- else {
- MinEdit->setText( QString::number( Rmin ) );
- MaxEdit->setText( QString::number( Rmax ) );
- }
- myRangeMode = -1;
+ MinEdit->setText( QString::number( imin ) );
+ MaxEdit->setText( QString::number( imax ) );
+
if( sbRange )
RBIrange->setChecked( true );
else
RBFrange->setChecked( true );
+
changeRange( 0 );
}
-/*!
- Sets default values and range mode
-*/
-void VisuGUI_ScalarBarPane::setDefaultRange(double imin, double imax){
- Rmin = imin;
- Rmax = imax;
-}
+//----------------------------------------------------------------------------
/*!
Sets and gets parameters
*/
return RBIrange->isChecked();
}
+
+//----------------------------------------------------------------------------
double VisuGUI_ScalarBarPane::getMin() {
return MinEdit->text().toDouble();
}
+
+//----------------------------------------------------------------------------
double VisuGUI_ScalarBarPane::getMax() {
return MaxEdit->text().toDouble();
}
+
+//----------------------------------------------------------------------------
double VisuGUI_ScalarBarPane::getX() {
return XSpin->value();
}
+
+//----------------------------------------------------------------------------
double VisuGUI_ScalarBarPane::getY() {
return YSpin->value();
}
+
+//----------------------------------------------------------------------------
double VisuGUI_ScalarBarPane::getWidth() {
return WidthSpin->value();
}
+
+//----------------------------------------------------------------------------
double VisuGUI_ScalarBarPane::getHeight() {
return HeightSpin->value();
}
+
+//----------------------------------------------------------------------------
int VisuGUI_ScalarBarPane::getNbColors() {
return ColorSpin->value();
}
+
+//----------------------------------------------------------------------------
int VisuGUI_ScalarBarPane::getNbLabels() {
return LabelSpin->value();
}
+
+//----------------------------------------------------------------------------
bool VisuGUI_ScalarBarPane::isLogarithmic() {
return CBLog->isChecked();
}
+
+//----------------------------------------------------------------------------
void VisuGUI_ScalarBarPane::setLogarithmic( bool on ) {
CBLog->setChecked( on );
}
-bool VisuGUI_ScalarBarPane::isToSave() {
- return CBSave ? CBSave->isChecked() : false;
-}
+//----------------------------------------------------------------------------
/*!
Sets size and position
*/
changeDefaults( 0 );
}
+
+//----------------------------------------------------------------------------
/*!
Sets colors and labels number
*/
LabelSpin->setValue( labels );
}
+
+//----------------------------------------------------------------------------
/*!
Gets orientation
*/
return 0;
}
+
+//----------------------------------------------------------------------------
/*!
Called when <OK> button is clicked, validates data and closes dialog
*/
return false;
}
}
+
// check if logarithmic mode is on and check imposed range to not contain negative values
if ( CBLog->isChecked() ) {
- if ( RBIrange->isChecked() ) {
- if ( (minVal > 0) && (maxVal > 0) ) {
- // nothing to do
- }
- else {
+ if ( minVal <= 0.0 || maxVal <= 0.0 ) {
+ if ( RBIrange->isChecked() ) {
SUIT_MessageBox::warn1( this,
- tr("WRN_VISU"),
- tr("WRN_LOGARITHMIC_RANGE"),
- tr("BUT_OK"));
- return false;
- }
- }
- else {
- if ( Rmin > 0 && Rmax > 0 ) {
- // nothing to do
- }
- else {
+ tr("WRN_VISU"),
+ tr("WRN_LOGARITHMIC_RANGE"),
+ tr("BUT_OK"));
+ } else {
SUIT_MessageBox::warn1( this,
- tr("WRN_VISU"),
- tr("WRN_LOGARITHMIC_FIELD_RANGE"),
- tr("BUT_OK"));
- RBIrange->setChecked(1);
+ tr("WRN_VISU"),
+ tr("WRN_LOGARITHMIC_FIELD_RANGE"),
+ tr("BUT_OK"));
+ RBIrange->setChecked(true);
changeRange(1);
- //MinEdit->setText( QString::number( Rmin ) );
- //MaxEdit->setText( QString::number( Rmax ) );
- return false;
}
+ return false;
}
}
return true;
}
+
+//----------------------------------------------------------------------------
void VisuGUI_ScalarBarPane::onTextPref()
{
myTextDlg->storeBeginValues();
updatePreview();
}
+
+//----------------------------------------------------------------------------
void VisuGUI_ScalarBarPane::onPreviewCheck (bool thePreview)
{
if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
}
}
-VisuGUI_Prs3dDlg::VisuGUI_Prs3dDlg( SalomeApp_Module* theModule )
- : QDialog( VISU::GetDesktop( theModule ), 0, false,
- WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
+
+//----------------------------------------------------------------------------
+VisuGUI_Prs3dDlg::VisuGUI_Prs3dDlg( SalomeApp_Module* theModule ) :
+ QDialog( VISU::GetDesktop( theModule ), 0, false,
+ WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
+{}
+
+
+//----------------------------------------------------------------------------
+/*!
+ Called when <Help> button is clicked, shows the corresponding help page in defined browser
+*/
+void VisuGUI_Prs3dDlg::onHelp()
{
+ QString aHelpFileName = GetContextHelpFilePath();
+ LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app) {
+ VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
+ app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->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"));
+ }
}
-void VisuGUI_Prs3dDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs, bool theInit )
+
+//----------------------------------------------------------------------------
+void VisuGUI_Prs3dDlg::keyPressEvent( QKeyEvent* e )
{
+ QDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Key_F1 ) {
+ e->accept();
+ onHelp();
+ }
}
-int VisuGUI_Prs3dDlg::storeToPrsObject( VISU::ColoredPrs3d_i* thePrs )
+
+//----------------------------------------------------------------------------
+VisuGUI_ScalarBarBaseDlg::VisuGUI_ScalarBarBaseDlg( SalomeApp_Module* theModule ) :
+ VisuGUI_Prs3dDlg( theModule )
+{
+ myScalarPane = new VisuGUI_ScalarBarPane(this);
+ myScalarPane->setMargin( 5 );
+}
+
+
+VisuGUI_ScalarBarBaseDlg::~VisuGUI_ScalarBarBaseDlg()
{
- return 1;
}
+
+
+
+//----------------------------------------------------------------------------
+void VisuGUI_ScalarBarBaseDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
+ bool theInit )
+{
+ myScalarPane->initFromPrsObject( thePrs );
+}
+
+
+//----------------------------------------------------------------------------
+/*!
+ Called when <OK> button is clicked, validates data and closes dialog
+*/
+void VisuGUI_ScalarBarBaseDlg::accept()
+{
+ if (GetScalarPane()->check())
+ VisuGUI_Prs3dDlg::accept();
+}
+
+
+//----------------------------------------------------------------------------
+/*!
+ Called when <Cancel> button is clicked, remove preview and closes dialog
+*/
+void VisuGUI_ScalarBarBaseDlg::reject()
+{
+ VisuGUI_Prs3dDlg::reject();
+}
+
+
+//----------------------------------------------------------------------------
+VisuGUI_ScalarBarPane* VisuGUI_ScalarBarBaseDlg::GetScalarPane()
+{
+ return myScalarPane;
+}
+
+
+//----------------------------------------------------------------------------
#include <qvbox.h>
#include "SALOME_GenericObjPointer.hh"
+#include "VISU_ColoredPrs3d_i.hh"
class QButtonGroup;
class QGroupBox;
class ScalarMap_i;
}
+
+//----------------------------------------------------------------------------
class VisuGUI_TextPrefDlg: public QDialog
{
Q_OBJECT;
};
+//----------------------------------------------------------------------------
class VisuGUI_ScalarBarPane : public QVBox
{
Q_OBJECT;
public:
- VisuGUI_ScalarBarPane(QWidget* parent, bool SetPref);
- ~VisuGUI_ScalarBarPane() {};
+ VisuGUI_ScalarBarPane(QWidget* parent);
+ ~VisuGUI_ScalarBarPane();
- void setRange( double imin, double imax, /*double fmin, double fmax,*/ bool sbRange );
+ void setRange( double imin, double imax, bool sbRange );
void setDefaultRange(double imin, double imax);
int getOrientation();
void setPosAndSize( double x, double y, double w, double h, bool vert );
int getNbLabels();
bool isLogarithmic();
void setLogarithmic( bool on );
- bool isToSave();
-
- void initFromResources();
- void storeToResources();
void initFromPrsObject(VISU::ColoredPrs3d_i* thePrs);
+
int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
bool check();
- void deletePreview();
protected:
QButtonGroup* RangeGroup;
QSpinBox* ColorSpin;
QSpinBox* LabelSpin;
- QCheckBox* CBSave;
QCheckBox* CBLog;
QLabel* myModeLbl;
QComboBox* myModeCombo;
QPushButton* myTextBtn;
VisuGUI_TextPrefDlg* myTextDlg;
- double Imin, Imax, /* Fmin, Fmax,*/ Rmin, Rmax;
double myHorX, myHorY, myHorW, myHorH;
double myVerX, myVerY, myVerW, myVerH;
- int myRangeMode;
- bool myIsStoreTextProp;
+ bool myIsStoreTextProp;
private slots:
void changeDefaults( int );
bool myBusy;
};
+
+//----------------------------------------------------------------------------
class VisuGUI_Prs3dDlg : public QDialog
{
Q_OBJECT;
VisuGUI_Prs3dDlg( SalomeApp_Module* theModule );
~VisuGUI_Prs3dDlg() {}
- virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs, bool theInit = true );
- virtual int storeToPrsObject( VISU::ColoredPrs3d_i* thePrs );
+ virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
+ bool theInit ) = 0;
+
+ virtual int storeToPrsObject( VISU::ColoredPrs3d_i* thePrs ) = 0;
+
+ protected:
+ virtual QString GetContextHelpFilePath() = 0;
+
+ protected slots:
+ void onHelp();
+
+ private:
+ void keyPressEvent( QKeyEvent* e );
+};
+
+
+//----------------------------------------------------------------------------
+class VisuGUI_ScalarBarBaseDlg : public VisuGUI_Prs3dDlg
+{
+ Q_OBJECT;
+
+ public:
+ VisuGUI_ScalarBarBaseDlg( SalomeApp_Module* theModule );
+ ~VisuGUI_ScalarBarBaseDlg();
+
+ virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
+ bool theInit );
+ protected slots:
+ void accept();
+ void reject();
+
+ protected:
+ VisuGUI_ScalarBarPane* GetScalarPane();
+
+ private:
+ VisuGUI_ScalarBarPane* myScalarPane;
};
+
+//----------------------------------------------------------------------------
+
#endif
isModal = 0;
TDlg* aDlg = new TDlg (theModule);
- aDlg->initFromPrsObject(aPrs3d);
+ aDlg->initFromPrsObject(aPrs3d, true);
if (runAndWait(aDlg,isModal)) {
if (!(aDlg->storeToPrsObject(aPrs3d))) {
delete aDlg;
if (!aValue) {
if (TDlg* aDlg = new TDlg(theModule)) { // dialog box in creation mode
- aDlg->initFromPrsObject(aPrs3d);
+ aDlg->initFromPrsObject(aPrs3d, true);
if (runAndWait(aDlg,IsDlgModal) && (aDlg->storeToPrsObject(aPrs3d))) {
if(aResourceMgr->booleanValue("VISU","display_only",false)){
if(SPlot2d_Viewer* aPlot2d = GetPlot2dViewer(theModule, false)) aPlot2d->EraseAll();
/*!
Constructor
*/
-VisuGUI_ScalarBarDlg::VisuGUI_ScalarBarDlg (SalomeApp_Module* theModule, bool SetPref)
- : VisuGUI_Prs3dDlg(theModule)
+VisuGUI_ScalarBarDlg::VisuGUI_ScalarBarDlg (SalomeApp_Module* theModule)
+ : VisuGUI_ScalarBarBaseDlg(theModule)
{
setName("VisuGUI_ScalarBarDlg");
- setCaption(SetPref ? tr("DLG_PREF_TITLE") : tr("DLG_PROP_TITLE"));
+ setCaption(tr("DLG_PROP_TITLE"));
setSizeGripEnabled(TRUE);
QVBoxLayout* TopLayout = new QVBoxLayout(this);
TopLayout->setMargin(11);
myTabBox = new QTabWidget(this);
- myScalarPane = new VisuGUI_ScalarBarPane(this, SetPref);
- myScalarPane->setMargin( 5 );
myInputPane = new VisuGUI_InputPane(VISU::TSCALARMAP, theModule, this);
- myTabBox->addTab(myScalarPane, "Scalar Bar");
+ myTabBox->addTab(GetScalarPane(), "Scalar Bar");
myTabBox->addTab(myInputPane, "Input");
TopLayout->addWidget(myTabBox);
VisuGUI_ScalarBarDlg::~VisuGUI_ScalarBarDlg()
{}
-/*!
- Called when <OK> button is clicked, validates data and closes dialog
-*/
-void VisuGUI_ScalarBarDlg::accept()
-{
- if (myScalarPane->check())
- {
- myScalarPane->deletePreview();
- QDialog::accept();
- }
-}
-
-/*!
- Called when <Cancel> button is clicked, remove preview and closes dialog
-*/
-void VisuGUI_ScalarBarDlg::reject()
-{
- myScalarPane->deletePreview();
- QDialog::reject();
-}
-
/*!
Called when <Help> button is clicked, shows the corresponding help page in defined browser
*/
-void VisuGUI_ScalarBarDlg::onHelp()
+QString VisuGUI_ScalarBarDlg::GetContextHelpFilePath()
{
- QString aHelpFileName = "/files/scalar_map_presentation.htm";
- LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
- if (app) {
- VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
- app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->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"));
- }
+ return "/files/scalar_map_presentation.htm";
}
/*!
Initialize dialog from the presentation
*/
-void VisuGUI_ScalarBarDlg::initFromPrsObject(VISU::ColoredPrs3d_i* thePrs, bool theInit)
+void VisuGUI_ScalarBarDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
+ bool theInit )
{
if( theInit )
myPrsCopy = VISU::TSameAsFactory<VISU::TSCALARMAP>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
- myScalarPane->initFromPrsObject( myPrsCopy );
-
+ VisuGUI_ScalarBarBaseDlg::initFromPrsObject(myPrsCopy, theInit);
+
if( !theInit )
return;
*/
int VisuGUI_ScalarBarDlg::storeToPrsObject(VISU::ColoredPrs3d_i* thePrs)
{
- if(!myInputPane->check() || !myScalarPane->check())
+ if(!myInputPane->check() || !GetScalarPane()->check())
return 0;
int anIsOk = myInputPane->storeToPrsObject( myPrsCopy );
- anIsOk &= myScalarPane->storeToPrsObject( myPrsCopy );
+ anIsOk &= GetScalarPane()->storeToPrsObject( myPrsCopy );
VISU::TSameAsFactory<VISU::TSCALARMAP>().Copy(myPrsCopy, thePrs);
return anIsOk;
}
-
-/*!
- Provides help on F1 button click
-*/
-void VisuGUI_ScalarBarDlg::keyPressEvent( QKeyEvent* e )
-{
- QDialog::keyPressEvent( e );
- if ( e->isAccepted() )
- return;
-
- if ( e->key() == Key_F1 )
- {
- e->accept();
- onHelp();
- }
-}
class ScalarMap_i;
}
-class VisuGUI_ScalarBarDlg : public VisuGUI_Prs3dDlg
+class VisuGUI_ScalarBarDlg : public VisuGUI_ScalarBarBaseDlg
{
Q_OBJECT;
public:
- VisuGUI_ScalarBarDlg (SalomeApp_Module* theModule, bool SetPref = FALSE);
+ VisuGUI_ScalarBarDlg (SalomeApp_Module* theModule);
~VisuGUI_ScalarBarDlg();
- bool isToSave() {return myScalarPane->isToSave();}
+ virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
+ bool theInit );
- void initFromResources() {myScalarPane->initFromResources();}
- void storeToResources() {myScalarPane->storeToResources();}
-
- virtual void initFromPrsObject(VISU::ColoredPrs3d_i* thePrs, bool theInit = true);
virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
- private:
- void keyPressEvent( QKeyEvent* e );
-
- protected slots:
- void accept();
- void reject();
- void onHelp();
+ protected:
+ virtual QString GetContextHelpFilePath();
protected:
- VisuGUI_ScalarBarPane* myScalarPane;
VisuGUI_InputPane* myInputPane;
QTabWidget* myTabBox;
* Constructor
*/
VisuGUI_ScalarMapOnDeformedShapeDlg::VisuGUI_ScalarMapOnDeformedShapeDlg (SalomeApp_Module* theModule)
- : VisuGUI_Prs3dDlg(theModule),
+ : VisuGUI_ScalarBarBaseDlg(theModule),
myIsAnimation(false),
myUpdateScalars(true),
myVisuGUI(theModule)
myTabBox->addTab(aBox, tr("SCALAR_MAP_ON_DEFORMED_SHAPE_TAB"));
// Scalar bar pane
- myScalarPane = new VisuGUI_ScalarBarPane (this, false);
- myScalarPane->setMargin(5);
myInputPane = new VisuGUI_InputPane(VISU::TSCALARMAPONDEFORMEDSHAPE, theModule, this);
- myTabBox->addTab(myScalarPane, tr("SCALAR_BAR_TAB"));
+ myTabBox->addTab(GetScalarPane(), tr("SCALAR_BAR_TAB"));
myTabBox->addTab(myInputPane, tr("INPUT_TAB"));
// Buttons
VisuGUI_ScalarMapOnDeformedShapeDlg::~VisuGUI_ScalarMapOnDeformedShapeDlg()
{}
-void VisuGUI_ScalarMapOnDeformedShapeDlg::initFromPrsObject(VISU::ColoredPrs3d_i* thePrs, bool theInit)
+void VisuGUI_ScalarMapOnDeformedShapeDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
+ bool theInit )
{
if( theInit )
- myPrsCopy = VISU::TSameAsFactory<VISU::TSCALARMAPONDEFORMEDSHAPE>().Create(thePrs,
- VISU::ColoredPrs3d_i::EDoNotPublish);
-
+ myPrsCopy = VISU::TSameAsFactory<VISU::TSCALARMAPONDEFORMEDSHAPE>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
setFactor(myPrsCopy->GetScale());
myTimeStampsCombo->setDisabled(myIsAnimation);
-
CORBA::String_var aFieldName(myPrsCopy->GetScalarFieldName());
QString aIteration = GetFloatValueOfTimeStamp(myPrsCopy->GetScalarEntity(),
- aFieldName.in(),
- myPrsCopy->GetScalarTimeStampNumber());
+ aFieldName.in(),
+ myPrsCopy->GetScalarTimeStampNumber());
if (myEntity2Fields.size() == 0)
{
// find all fields and time stamps on it
myTimeStampsCombo->setCurrentText(aIteration);
SetScalarField( false );
- myScalarPane->initFromPrsObject(myPrsCopy);
+ VisuGUI_ScalarBarBaseDlg::initFromPrsObject(myPrsCopy, theInit);
if( !theInit )
return;
VisuGUI_ScalarMapOnDeformedShapeDlg
::storeToPrsObject(VISU::ColoredPrs3d_i* thePrs)
{
- if(!myInputPane->check() || !myScalarPane->check())
+ if(!myInputPane->check() || !GetScalarPane()->check())
return 0;
int anIsOk = myInputPane->storeToPrsObject( myPrsCopy );
- anIsOk &= myScalarPane->storeToPrsObject( myPrsCopy );
+ anIsOk &= GetScalarPane()->storeToPrsObject( myPrsCopy );
myPrsCopy->SetScale(getFactor());
const bool save_scalar_pane )
{
if( save_scalar_pane )
- myScalarPane->storeToPrsObject(myPrsCopy);
+ GetScalarPane()->storeToPrsObject(myPrsCopy);
QString aFieldName;
void VisuGUI_ScalarMapOnDeformedShapeDlg::accept()
{
- if (myScalarPane->check()){
- myScalarPane->deletePreview();
- QDialog::accept();
- }
+ VisuGUI_ScalarBarBaseDlg::accept();
}
void VisuGUI_ScalarMapOnDeformedShapeDlg::reject()
{
- myScalarPane->deletePreview();
- QDialog::reject();
+ VisuGUI_ScalarBarBaseDlg::reject();
}
-void VisuGUI_ScalarMapOnDeformedShapeDlg::onHelp()
+QString VisuGUI_ScalarMapOnDeformedShapeDlg::GetContextHelpFilePath()
{
- QString aHelpFileName = "scalar_map_on_deformed_shape_presentation.htm";
- LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
- if (app)
- app->onHelpContextModule(myVisuGUI ? app->moduleName(myVisuGUI->moduleName()) : QString(""), aHelpFileName);
- 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(aHelpFileName),
- QObject::tr("BUT_OK"));
- }
+ return "scalar_map_on_deformed_shape_presentation.htm";
}
void VisuGUI_ScalarMapOnDeformedShapeDlg::AddAllFieldNames(){
}
void VisuGUI_ScalarMapOnDeformedShapeDlg::UpdateScalarField(){
- myScalarPane->initFromPrsObject(myPrsCopy);
+ GetScalarPane()->initFromPrsObject(myPrsCopy);
}
QString
}
return aTime;
}
-
-void VisuGUI_ScalarMapOnDeformedShapeDlg::keyPressEvent( QKeyEvent* e )
-{
- QDialog::keyPressEvent( e );
- if ( e->isAccepted() )
- return;
-
- if ( e->key() == Key_F1 )
- {
- e->accept();
- onHelp();
- }
-}
class ScalarMapOnDeformedShape_i;
}
-class VisuGUI_ScalarMapOnDeformedShapeDlg : public VisuGUI_Prs3dDlg
+class VisuGUI_ScalarMapOnDeformedShapeDlg : public VisuGUI_ScalarBarBaseDlg
{
Q_OBJECT
void setFactor(double theFactor)
{ ScalFact->setValue(theFactor); }
- virtual void initFromPrsObject(VISU::ColoredPrs3d_i* thePrs, bool theInit = true);
+ virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
+ bool theInit );
+
virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
int getCurrentScalarFieldNamePos();
VISU::Entity getCurrentScalarEntity();
void SetScalarField(int theIter,QString theFieldName=QString(""), const bool = true );
-private:
- void keyPressEvent( QKeyEvent* e );
+protected:
+ virtual QString GetContextHelpFilePath();
protected slots:
void accept();
void reject();
- void onHelp();
private slots:
void onFieldChanged(int i=0);
using namespace std;
VisuGUI_StreamLinesDlg::VisuGUI_StreamLinesDlg (SalomeApp_Module* theModule)
- : VisuGUI_Prs3dDlg(theModule),
+ : VisuGUI_ScalarBarBaseDlg(theModule),
myVisuGUI(theModule)
{
setCaption(tr("DLG_TITLE"));
TopLayout->addWidget( SelColor, 5, 1);
myTabBox->addTab(aTopBox, "Stream Lines");
- myScalarPane = new VisuGUI_ScalarBarPane(this, false);
- myScalarPane->setMargin( 5 );
myInputPane = new VisuGUI_InputPane(VISU::TSTREAMLINES, theModule, this);
- myTabBox->addTab(myScalarPane, "Scalar Bar");
+ myTabBox->addTab(GetScalarPane(), "Scalar Bar");
myTabBox->addTab(myInputPane, "Input");
aBoxLayout->addWidget(myTabBox);
VisuGUI_StreamLinesDlg::~VisuGUI_StreamLinesDlg()
{}
-void VisuGUI_StreamLinesDlg::initFromPrsObject (VISU::ColoredPrs3d_i* thePrs, bool theInit)
+void VisuGUI_StreamLinesDlg::initFromPrsObject ( VISU::ColoredPrs3d_i* thePrs,
+ bool theInit )
{
if( theInit )
myPrsCopy = VISU::TSameAsFactory<VISU::TSTREAMLINES>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
- myScalarPane->initFromPrsObject( myPrsCopy );
+ VisuGUI_ScalarBarBaseDlg::initFromPrsObject(myPrsCopy, theInit);
static int aNbOfSteps = 30;
VISU_StreamLinesPL* aStreamLinesPL = myPrsCopy->GetSpecificPL();
int VisuGUI_StreamLinesDlg::storeToPrsObject (VISU::ColoredPrs3d_i* thePrs)
{
- if(!myInputPane->check() || !myScalarPane->check())
+ if(!myInputPane->check() || !GetScalarPane()->check())
return 0;
int anIsOk = myInputPane->storeToPrsObject( myPrsCopy );
- anIsOk &= myScalarPane->storeToPrsObject( myPrsCopy );
+ anIsOk &= GetScalarPane()->storeToPrsObject( myPrsCopy );
if (anIsOk) {
myPrsCopy->ShowColored(myUseScalar->isChecked());
myPntPercent->value(),
aDirection);
}
- //if (!isAccepted)
- // SUIT_MessageBox::warn1(VisuGUI::application()->desktop(), tr("WRN_VISU"),
- // tr("ERR_CANT_BUILD_PRESENTATION"),
- // tr("BUT_OK"));
VISU::TSameAsFactory<VISU::TSTREAMLINES>().Copy(myPrsCopy, thePrs);
return VISU::Mesh::_nil();
}
-void VisuGUI_StreamLinesDlg::accept() {
- if (myScalarPane->check())
- {
- myScalarPane->deletePreview();
- QDialog::accept();
- }
+void VisuGUI_StreamLinesDlg::accept()
+{
+ VisuGUI_ScalarBarBaseDlg::accept();
}
void VisuGUI_StreamLinesDlg::reject()
{
- myScalarPane->deletePreview();
- QDialog::reject();
+ VisuGUI_ScalarBarBaseDlg::reject();
}
-void VisuGUI_StreamLinesDlg::onHelp()
+QString VisuGUI_StreamLinesDlg::GetContextHelpFilePath()
{
- QString aHelpFileName = "/files/stream_lines_presentation.htm";
- LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
- if (app)
- app->onHelpContextModule(myVisuGUI ? app->moduleName(myVisuGUI->moduleName()) : QString(""), aHelpFileName);
- 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(aHelpFileName),
- QObject::tr("BUT_OK"));
- }
-}
-
-void VisuGUI_StreamLinesDlg::keyPressEvent( QKeyEvent* e )
-{
- QDialog::keyPressEvent( e );
- if ( e->isAccepted() )
- return;
-
- if ( e->key() == Key_F1 )
- {
- e->accept();
- onHelp();
- }
+ return "/files/stream_lines_presentation.htm";
}
class StreamLines_i;
}
-class VisuGUI_StreamLinesDlg: public VisuGUI_Prs3dDlg
+class VisuGUI_StreamLinesDlg: public VisuGUI_ScalarBarBaseDlg
{
Q_OBJECT
public:
VisuGUI_StreamLinesDlg (SalomeApp_Module* theModule);
~VisuGUI_StreamLinesDlg();
- virtual void initFromPrsObject(VISU::ColoredPrs3d_i* thePrs, bool theInit = true);
+ virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
+ bool theInit );
+
virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
void setColor( QColor color );
void enableMagnColor( bool enable );
-private:
- void keyPressEvent( QKeyEvent* e );
+protected:
+ virtual QString GetContextHelpFilePath();
protected slots:
void accept();
void reject();
- void onHelp();
private slots:
-//VSR: 08/06/06: void onSelectionActive(bool theActive);
void StepLengthChanged(double theValue);
void IntegrationStepChanged(double theValue);
void PropagationTimeChanged(double theValue);
QComboBox* mySrcCombo;
QTabWidget* myTabBox;
- VisuGUI_ScalarBarPane* myScalarPane;
VisuGUI_InputPane* myInputPane;
QValueList<VISU::Prs3d_var> myPrsList;
double aMaxTime = myAnimator->getMaxTime();
double aMinTime = myAnimator->getMinTime();
double aStep;
- if ( myAnimator->getAnimationMode() == 0 )
+ if ( myAnimator->getAnimationMode() == VISU::Animation::PARALLEL )
aStep = (aMaxTime - aMinTime) / (myAnimator->getFieldData(0).myNbTimes - 1);
else { // succcessive animation mode
std::pair<int,long> aLastFieldFrame(myAnimator->getNbFields() - 1,
_PTR(SObject) aSO = myAnimator->getFieldData(i).myField;
VISU::Storable::TRestoringMap aRestoringMap = VISU::Storable::GetStorableMap(aSO);
QString aFieldName(aRestoringMap["myName"]);
- if ( myAnimator->getAnimationMode() == 0 )
+ if ( myAnimator->getAnimationMode() == VISU::Animation::PARALLEL )
aFieldNames.append(aFieldName);
- else if ( myAnimator->getAnimationMode() == 1 ) {
+ else if ( myAnimator->getAnimationMode() == VISU::Animation::SUCCESSIVE ) {
_PTR(SObject) aSObject = aSO->GetFather()->GetFather()->GetFather();
VISU::Storable::TRestoringMap aRestoringMap = VISU::Storable::GetStorableMap(aSObject);
QString aFileName(aRestoringMap["myInitFileName"]);
}
myFieldLst->insertStringList(aFieldNames);
- if ( myAnimator->getAnimationMode() == 0 ) {
+ if ( myAnimator->getAnimationMode() == VISU::Animation::PARALLEL ) {
myFieldLst->setSelected(0, true);
connect( myFieldLst, SIGNAL( highlighted(int) ),
this, SLOT( onFieldChange(int) ) );
}
- else if ( myAnimator->getAnimationMode() == 1 )
+ else if ( myAnimator->getAnimationMode() == VISU::Animation::SUCCESSIVE )
myFieldLst->setSelectionMode(QListBox::NoSelection);
QVBox* aSetupBox = new QVBox(aPropFrame);
connect( myPropBtn, SIGNAL( clicked() ),
this, SLOT( onPreferencesDlg() ) );
- if (myAnimator->getNbFields() > 1 && myAnimator->getAnimationMode() == 0) {
- myArrangeBtn = new QPushButton("Arrange...", aSetupBox);
- connect( myArrangeBtn, SIGNAL( clicked() ), this, SLOT( onArrangeDlg() ) );
+ if (myAnimator->getNbFields() > 1 ) {
+ if( myAnimator->getAnimationMode() == VISU::Animation::PARALLEL ) {
+ myArrangeBtn = new QPushButton("Arrange...", aSetupBox);
+ connect( myArrangeBtn, SIGNAL( clicked() ), this, SLOT( onArrangeDlg() ) );
+ }
}
onFieldChange(0);
aMainLayout->addWidget(aPropFrame);
bool anEnableItems = false;
bool anEnableGP = false;
VISU::VISUType aPrsType;
- if ( myAnimator->getAnimationMode() == 0 ) { // parallel animation mode
+ if ( myAnimator->getAnimationMode() == VISU::Animation::PARALLEL ) { // parallel animation mode
FieldData& aData = myAnimator->getFieldData(theIndex);
_PTR(SObject) aSObject = aData.myField;
aPrsType = aData.myPrsType;
}
- else if ( myAnimator->getAnimationMode() == 1 ) { // succcessive animation mode
+ else if ( myAnimator->getAnimationMode() == VISU::Animation::SUCCESSIVE ) { // succcessive animation mode
for (int i = 0; i < myAnimator->getNbFields(); i++) {
_PTR(SObject) aSO = myAnimator->getFieldData(i).myField;
int aType = myComboId2TypeId[theIndex];
for (int i = 0; i < myAnimator->getNbFields(); i++) {
- FieldData& aData = ( myAnimator->getAnimationMode() == 0 ) ?
+ FieldData& aData = ( myAnimator->getAnimationMode() == VISU::Animation::PARALLEL ) ?
myAnimator->getFieldData(myFieldLst->currentItem()) :
myAnimator->getFieldData(i);
}
myAnimator->clearData(aData);
- if ( myAnimator->getAnimationMode() == 0 ) // parallel animation mode
+ if ( myAnimator->getAnimationMode() == VISU::Animation::PARALLEL ) // parallel animation mode
break;
}
//myPropBtn->setEnabled(aData.myPrsType != VISU::TSCALARMAP);
VISU_TimeAnimation* theAnimator)
{
TDialog* aDlg = new TDialog(theModule);
- aDlg->initFromPrsObject(dynamic_cast<TPrs3d*>(theData.myPrs[0]));
+ TPrs3d* aPrs3d = dynamic_cast<TPrs3d*>(theData.myPrs[0]);
+ aDlg->initFromPrsObject(aPrs3d, true);
if (aDlg->exec() && aDlg->storeToPrsObject(dynamic_cast<TPrs3d*>(theData.myPrs[0]))) {
- for (int i = 1; i < theData.myNbFrames; i++)
- theData.myPrs[i]->SameAs(theData.myPrs[0]);
- if ( theAnimator->getAnimationMode() == 1 ) {
- for (int i = 1; i < theAnimator->getNbFields(); i++) {
- for (int j = 0; j < theAnimator->getFieldData(i).myNbFrames; j++)
- theAnimator->getFieldData(i).myPrs[j]->SameAs(theData.myPrs[0]);
+
+ for (long aFrameId = 1; aFrameId < theData.myNbFrames; aFrameId++){
+ VISU::ColoredPrs3d_i* aPrs3d = theData.myPrs[aFrameId];
+ aPrs3d->SameAs(theData.myPrs[0]);
+ }
+
+ if ( theAnimator->getAnimationMode() == VISU::Animation::SUCCESSIVE ) {
+ for (int aFieldId = 1; aFieldId < theAnimator->getNbFields(); aFieldId++) {
+ FieldData& aFieldData = theAnimator->getFieldData(aFieldId);
+ for (long aFrameId = 0; aFrameId < aFieldData.myNbFrames; aFrameId++) {
+ VISU::ColoredPrs3d_i* aPrs3d = aFieldData.myPrs[aFrameId];
+ std::string aTitle = aPrs3d->GetCTitle();
+ aPrs3d->SameAs(theData.myPrs[0]);
+ aPrs3d->SetTitle(aTitle.c_str());
+ }
}
}
}
{
SUIT_OverrideCursor c;
- int id = ( myAnimator->getAnimationMode() == 0 ) ? myFieldLst->currentItem() : 0;
- FieldData& aData = myAnimator->getFieldData(id);
- if (aData.myPrs.empty())
- myAnimator->generatePresentations(id);
+ VISU::Animation::AnimationMode aMode = myAnimator->getAnimationMode();
+ int aRefFieldId = ( aMode == VISU::Animation::PARALLEL ) ? myFieldLst->currentItem() : 0;
+ FieldData& aData = myAnimator->getFieldData(aRefFieldId);
+ if (aData.myPrs.empty())
+ myAnimator->generatePresentations(aRefFieldId);
- if ( myAnimator->getAnimationMode() == 1 ) {
+ if ( myAnimator->getAnimationMode() == VISU::Animation::SUCCESSIVE ) {
for (int i = 0; i < myAnimator->getNbFields(); i++) {
- if ( i != id && myAnimator->getFieldData(i).myPrs.empty() ) myAnimator->generatePresentations(i);
+ if ( i != aRefFieldId && myAnimator->getFieldData(i).myPrs.empty() )
+ myAnimator->generatePresentations(i);
}
}
switch (aType) {
case TSCALARMAP_ITEM: //Scalar Map
c.suspend();
- EditPrs<VISU::ScalarMap_i,VisuGUI_ScalarBarDlg>(myModule,aData,myAnimator);
+ EditPrs<VISU::ScalarMap_i, VisuGUI_ScalarBarDlg>(myModule, aData, myAnimator);
break;
case TISOSURFACES_ITEM: //Iso Surfaces
c.suspend();
- EditPrs<VISU::IsoSurfaces_i,VisuGUI_IsoSurfacesDlg>(myModule,aData,myAnimator);
+ EditPrs<VISU::IsoSurfaces_i, VisuGUI_IsoSurfacesDlg>(myModule, aData, myAnimator);
break;
case TCUTPLANES_ITEM: //Cut Planes
c.suspend();
- EditPrs<VISU::CutPlanes_i,VisuGUI_CutPlanesDlg>(myModule,aData,myAnimator);
+ EditPrs<VISU::CutPlanes_i, VisuGUI_CutPlanesDlg>(myModule, aData, myAnimator);
break;
case TCUTLINES_ITEM: //Cut Lines
c.suspend();
- EditPrs<VISU::CutLines_i,VisuGUI_CutLinesDlg>(myModule,aData,myAnimator);
+ EditPrs<VISU::CutLines_i, VisuGUI_CutLinesDlg>(myModule, aData, myAnimator);
break;
case TPLOT3D_ITEM: //Plot 3D
c.suspend();
- EditPrs<VISU::Plot3D_i,VisuGUI_Plot3DDlg>(myModule,aData,myAnimator);
+ EditPrs<VISU::Plot3D_i, VisuGUI_Plot3DDlg>(myModule, aData, myAnimator);
break;
case TDEFORMEDSHAPE_ITEM: //Deformed Shape
c.suspend();
- EditPrs<VISU::DeformedShape_i,VisuGUI_DeformedShapeDlg>(myModule,aData,myAnimator);
+ EditPrs<VISU::DeformedShape_i, VisuGUI_DeformedShapeDlg>(myModule, aData, myAnimator);
break;
case TSCALARMAPONDEFORMEDSHAPE_ITEM: //Scalar Map on Deformed Shape
c.suspend();
typedef VisuGUI_ScalarMapOnDeformedShapeDlg DLG;
typedef VISU::ScalarMapOnDeformedShape_i TYPE;
DLG* aDlg = new DLG (myModule);
- aDlg->initFromPrsObject(dynamic_cast<TYPE*>(aData.myPrs[0]));
+ TYPE* aPrs3d = dynamic_cast<TYPE*>(aData.myPrs[0]);
+ aDlg->initFromPrsObject(aPrs3d, true);
if (aDlg->exec() && aDlg->storeToPrsObject(aData.myPrs[0])) {
for (int i = 1; i < aData.myNbFrames; i++){
aData.myPrs[i]->SameAs(aData.myPrs[0]);
break;
case TVECTORS_ITEM: //Vectors
c.suspend();
- EditPrs<VISU::Vectors_i,VisuGUI_VectorsDlg>(myModule,aData,myAnimator);
+ EditPrs<VISU::Vectors_i, VisuGUI_VectorsDlg>(myModule, aData, myAnimator);
break;
case TSTREAMLINES_ITEM: //Stream Lines
c.suspend();
- EditPrs<VISU::StreamLines_i,VisuGUI_StreamLinesDlg>(myModule,aData,myAnimator);
+ EditPrs<VISU::StreamLines_i, VisuGUI_StreamLinesDlg>(myModule, aData, myAnimator);
break;
case TGAUSSPOINTS_ITEM: //Gauss Points
c.suspend();
- EditPrs<VISU::GaussPoints_i,VisuGUI_GaussPointsDlg>(myModule,aData,myAnimator);
+ EditPrs<VISU::GaussPoints_i, VisuGUI_GaussPointsDlg>(myModule, aData, myAnimator);
break;
}
}
//------------------------------------------------------------------------
void SetupDlg::onRangeCheck (bool theCheck)
{
-// for (int i = 0; i < myAnimator->getNbFields(); i++)
-// myAnimator->clearData(myAnimator->getFieldData(i));
-
myMinVal->setEnabled(theCheck);
myMaxVal->setEnabled(theCheck);
if (!theCheck)
myAnimator->setAnimationRange(0, 0);
- else {
- // if (myMinVal->value() < myMaxVal->value())
+ else
myAnimator->setAnimationRange(myMinVal->value(), myMaxVal->value());
-// else if (myMinVal->value() > myMaxVal->value())
-// myAnimator->setAnimationRange(myMaxVal->value(), myMinVal->value());
-// else // equal case
-// myAnimator->setAnimationRange(0, 0);
- }
}
//------------------------------------------------------------------------
static QPixmap MYpausePixmap(pauseIco);
-VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, _PTR(Study) theStudy, int theMode) :
+VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule,
+ _PTR(Study) theStudy,
+ VISU::Animation::AnimationMode theMode) :
QDialog(VISU::GetDesktop(theModule),
"VisuGUI_TimeAnimationDlg",
false,
myModule(theModule),
mySetupDlg(NULL)
{
- if ( theMode == 0 )
+ if ( theMode == VISU::Animation::PARALLEL )
setCaption(tr("PARALLEL_ANIMATION"));
- else if ( theMode == 1 )
+ else
setCaption(tr("SUCCESSIVE_ANIMATION"));
setSizeGripEnabled( TRUE );
{
myAnimator->restoreFromStudy(theAnimation);
mySaveBtn->setEnabled(myAnimator->isSavedInStudy());
- if ( myAnimator->getAnimationMode() == 1 )
+ if ( myAnimator->getAnimationMode() == VISU::Animation::SUCCESSIVE )
setCaption(tr("SUCCESSIVE_ANIMATION"));
}
#include "VTKViewer.h"
+// IDL headers
+#include "SALOMEconfig.h"
+#include CORBA_SERVER_HEADER(VISU_Gen)
+
#include <qdialog.h>
#include <qbuttongroup.h>
#include <qwidgetstack.h>
{
Q_OBJECT
public:
- VisuGUI_TimeAnimationDlg(VisuGUI* theModule, _PTR(Study) theStudy, int theMode=0);
+ VisuGUI_TimeAnimationDlg(VisuGUI* theModule,
+ _PTR(Study) theStudy,
+ VISU::Animation::AnimationMode theMode = VISU::Animation::PARALLEL);
~VisuGUI_TimeAnimationDlg();
bool addField(_PTR(SObject) theField);
Constructor
*/
VisuGUI_VectorsDlg::VisuGUI_VectorsDlg (SalomeApp_Module* theModule)
- : VisuGUI_Prs3dDlg(theModule)
+ : VisuGUI_ScalarBarBaseDlg(theModule)
{
setCaption(tr("DLG_TITLE"));
setSizeGripEnabled(TRUE);
// top layout
myTabBox->addTab(aBox, "Vectors");
- myScalarPane = new VisuGUI_ScalarBarPane(this, false);
- myScalarPane->setMargin( 5 );
myInputPane = new VisuGUI_InputPane(VISU::TVECTORS, theModule, this);
- myTabBox->addTab(myScalarPane, "Scalar Bar");
+ myTabBox->addTab(GetScalarPane(), "Scalar Bar");
myTabBox->addTab(myInputPane, "Input");
TopLayout->addWidget( myTabBox );
VisuGUI_VectorsDlg::~VisuGUI_VectorsDlg()
{}
-void VisuGUI_VectorsDlg::initFromPrsObject(VISU::ColoredPrs3d_i* thePrs, bool theInit) {
+void VisuGUI_VectorsDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
+ bool theInit )
+{
if( theInit )
myPrsCopy = VISU::TSameAsFactory<VISU::TVECTORS>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
- myScalarPane->initFromPrsObject( myPrsCopy );
+ VisuGUI_ScalarBarBaseDlg::initFromPrsObject(myPrsCopy, theInit);
setScaleFactor(myPrsCopy->GetScale());
setLineWidth((int)myPrsCopy->GetLineWidth());
int VisuGUI_VectorsDlg::storeToPrsObject(VISU::ColoredPrs3d_i* thePrs)
{
- if(!myInputPane->check() || !myScalarPane->check())
+ if(!myInputPane->check() || !GetScalarPane()->check())
return 0;
int anIsOk = myInputPane->storeToPrsObject( myPrsCopy );
- anIsOk &= myScalarPane->storeToPrsObject( myPrsCopy );
+ anIsOk &= GetScalarPane()->storeToPrsObject( myPrsCopy );
myPrsCopy->SetScale(getScaleFactor());
myPrsCopy->SetLineWidth(getLineWidth());
}
-void VisuGUI_VectorsDlg::accept() {
- if (myScalarPane->check())
- {
- myScalarPane->deletePreview();
- QDialog::accept();
- }
-}
-
-void VisuGUI_VectorsDlg::reject()
+QString VisuGUI_VectorsDlg::GetContextHelpFilePath()
{
- myScalarPane->deletePreview();
- QDialog::reject();
-}
-
-void VisuGUI_VectorsDlg::onHelp()
-{
- QString aHelpFileName = "/files/vectors_presentation.htm";
- LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
- if (app) {
- VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
- app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
- }
- 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(aHelpFileName),
- QObject::tr("BUT_OK"));
- }
-}
-
-void VisuGUI_VectorsDlg::keyPressEvent( QKeyEvent* e )
-{
- QDialog::keyPressEvent( e );
- if ( e->isAccepted() )
- return;
-
- if ( e->key() == Key_F1 )
- {
- e->accept();
- onHelp();
- }
+ return "/files/vectors_presentation.htm";
}
class Vectors_i;
}
-class VisuGUI_VectorsDlg : public VisuGUI_Prs3dDlg
+class VisuGUI_VectorsDlg : public VisuGUI_ScalarBarBaseDlg
{
Q_OBJECT
VISU::Vectors::GlyphPos getGlyphPos();
void enableMagnColor( bool enable );
- virtual void initFromPrsObject(VISU::ColoredPrs3d_i* thePrs, bool theInit = true);
- virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
+ virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
+ bool theInit );
-private:
- void keyPressEvent( QKeyEvent* e );
-
+ virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
protected slots:
- void accept();
- void reject();
- void onHelp();
+ virtual QString GetContextHelpFilePath();
private:
QGroupBox* TopGroup;
//---------------------------------------------------------------
-#ifndef WNT
- inline
-#endif
VISU_Actor*
UpdateViewer(VisuGUI* theModule,
VISU::Prs3d_i* thePrs,
bool theDispOnly = false,
- const bool theIsHighlight = false);
+ const bool theIsHighlight = false);
//---------------------------------------------------------------
{}
//! Initialize smart pointer to given object (TSGenericObj must be complete).
- template<class TSGenericObj>
+ template<class TGenObj>
explicit
- GenericObjPtr(TSGenericObj* thePointer):
+ GenericObjPtr(TGenObj* thePointer):
myPointer(thePointer)
{
this->Register();
this->Register();
}
+ /*!
+ Initialize smart pointer with a new reference to the same object
+ referenced by given smart pointer.
+ */
+ template<class TGenObj>
+ GenericObjPtr(const GenericObjPtr<TGenObj>& thePointer):
+ myPointer(thePointer.get())
+ {
+ this->Register();
+ }
+
//! Destroy smart pointer and remove the reference to its object.
~GenericObjPtr()
{
Assign object to reference. This removes any reference to an old
object.
*/
+ template<class TGenObj>
GenericObjPtr&
- operator=(TGenericObj* thePointer)
+ operator=(TGenObj* thePointer)
{
GenericObjPtr aTmp(thePointer);
aTmp.swap(*this);
return *this;
}
+ /*!
+ Assign object to reference. This removes any reference to an old
+ object.
+ */
+ template<class TGenObj>
+ GenericObjPtr&
+ operator=(const GenericObjPtr<TGenObj>& thePointer)
+ {
+ GenericObjPtr aTmp(thePointer);
+ aTmp.swap(*this);
+ return *this;
+ }
+
//! Get the contained pointer.
virtual
TGenericObj*
break;
VISU::ColoredPrs3dHolder::BasicInput_var anInput = aPrs3d->GetBasicInput();
if(IsSameField(theInput, anInput))
- return aPrs3d.get();
+ return aPrs3d;
}
}
- return VISU::TPrs3dPtr();
+ return NULL;
}
}
}
+//---------------------------------------------------------------
+namespace VISU
+{
+ //---------------------------------------------------------------
+ vtkFloatingPointType
+ TMinMaxController
+ ::GetComponentMin(vtkIdType theCompID)
+ {
+ return VTK_LARGE_FLOAT;
+ }
+
+
+ //---------------------------------------------------------------
+ vtkFloatingPointType
+ TMinMaxController
+ ::GetComponentMax(vtkIdType theCompID)
+ {
+ return -VTK_LARGE_FLOAT;
+ }
+
+
+ //---------------------------------------------------------------
+ struct TSimpleMinMaxController: virtual TVTKMinMaxController
+ {
+ VISU::PField myField;
+
+ TSimpleMinMaxController(VISU::PField theField)
+ {
+ myField = theField;
+ }
+
+ virtual
+ vtkFloatingPointType
+ GetComponentMin(vtkIdType theCompID)
+ {
+ if(myField){
+ TMinMax aMinMax = myField->GetMinMax(theCompID);
+ return aMinMax.first;
+ }
+ return TMinMaxController::GetComponentMin(theCompID);
+ }
+
+ virtual
+ vtkFloatingPointType
+ GetComponentMax(vtkIdType theCompID)
+ {
+ if(myField){
+ TMinMax aMinMax = myField->GetMinMax(theCompID);
+ return aMinMax.second;
+ }
+ return TMinMaxController::GetComponentMax(theCompID);
+ }
+ };
+
+
+ //---------------------------------------------------------------
+ PMinMaxController
+ CreateDefaultMinMaxController(VISU::ColoredPrs3d_i* theColoredPrs3d)
+ {
+ PField aField = theColoredPrs3d->GetScalarField();
+ return PMinMaxController(new TSimpleMinMaxController(aField));
+ }
+
+
+ //---------------------------------------------------------------
+}
+
+
//---------------------------------------------------------------
VISU::ColoredPrs3d_i::
ColoredPrs3d_i(EPublishInStudyMode thePublishInStudyMode) :
::~ColoredPrs3d_i()
{}
+//---------------------------------------------------------------
+void
+VISU::ColoredPrs3d_i
+::Register()
+{
+ TSuperClass::Register();
+}
+
+//---------------------------------------------------------------
+void
+VISU::ColoredPrs3d_i
+::Destroy()
+{
+ TSuperClass::Destroy();
+}
+
//---------------------------------------------------------------
void
VISU::ColoredPrs3d_i
//----------------------------------------------------------------------------
-const VISU::PField&
+VISU::PField
VISU::ColoredPrs3d_i
-::GetField() const
+::GetField()
{
return myField;
}
//----------------------------------------------------------------------------
-const VISU::PField&
+VISU::PField
VISU::ColoredPrs3d_i
-::GetScalarField() const
+::GetScalarField()
{
return myField;
}
+//----------------------------------------------------------------------------
+VISU::PMinMaxController
+VISU::ColoredPrs3d_i
+::GetMinMaxController()
+{
+ return myMinMaxController;
+}
+
+
+//----------------------------------------------------------------------------
+void
+VISU::ColoredPrs3d_i
+::SetMinMaxController(const VISU::PMinMaxController& theController)
+{
+ myMinMaxController = theController;
+
+ if(!IsRangeFixed())
+ SetSourceRange();
+}
+
+
//----------------------------------------------------------------------------
CORBA::Long
VISU::ColoredPrs3d_i
{
if(const ColoredPrs3d_i* aPrs3d = dynamic_cast<const ColoredPrs3d_i*>(theOrigin)){
ColoredPrs3d_i* anOrigin = const_cast<ColoredPrs3d_i*>(aPrs3d);
-
+
bool anIsCreatNew = OnSetInput(false);
if(anIsCreatNew)
Build(ESameAs);
SetNbColors(anOrigin->GetNbColors());
SetBarOrientation(anOrigin->GetBarOrientation());
- // "SetRange" function changes "myIsFixedRange" attribute,
- // so, it is necessary pay a special attention if "this" equal to "theOrigin"
+ SetMinMaxController(anOrigin->GetMinMaxController());
+
if(anOrigin->IsRangeFixed())
SetRange(anOrigin->GetMin(), anOrigin->GetMax());
else
ProcessVoidEvent(new TVoidMemFunEvent<VISU_ColoredPL>
(GetSpecificPL(), &VISU_ColoredPL::SetSourceRange));
}else{
- TMinMax aTMinMax = GetField()->GetMinMax(GetScalarMode());
- vtkFloatingPointType aScalarRange[2] = {aTMinMax.first, aTMinMax.second};
+ vtkFloatingPointType aScalarRange[2] = {GetSourceMin(), GetSourceMax()};
ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ColoredPL, vtkFloatingPointType*>
(GetSpecificPL(), &VISU_ColoredPL::SetScalarRange, aScalarRange));
}
vtkFloatingPointType aRange[2];
GetSpecificPL()->GetSourceRange(aRange);
return aRange[0];
- }else{
- TMinMax aTMinMax = GetField()->GetMinMax(GetScalarMode());
- return aTMinMax.first;
}
+ return GetComponentMin(GetScalarMode());
}
//----------------------------------------------------------------------------
vtkFloatingPointType aRange[2];
GetSpecificPL()->GetSourceRange(aRange);
return aRange[1];
- }else{
- TMinMax aTMinMax = GetField()->GetMinMax(GetScalarMode());
- return aTMinMax.second;
}
+ return GetComponentMax(GetScalarMode());
+}
+
+//----------------------------------------------------------------------------
+CORBA::Double
+VISU::ColoredPrs3d_i
+::GetComponentMin(vtkIdType theCompID)
+{
+ if(PMinMaxController aMinMaxController = GetMinMaxController())
+ return aMinMaxController->GetComponentMin(theCompID);
+
+ TMinMax aTMinMax = GetField()->GetMinMax(theCompID);
+ return aTMinMax.first;
+}
+
+//----------------------------------------------------------------------------
+vtkFloatingPointType
+VISU::ColoredPrs3d_i
+::GetComponentMax(vtkIdType theCompID)
+{
+ if(PMinMaxController aMinMaxController = GetMinMaxController())
+ return aMinMaxController->GetComponentMax(theCompID);
+
+ TMinMax aTMinMax = GetField()->GetMinMax(theCompID);
+ return aTMinMax.second;
}
//----------------------------------------------------------------------------
#include "VISU_Prs3d_i.hh"
#include "VISU_Result_i.hh"
#include "VISU_BoostSignals.h"
+#include "SALOME_GenericObjPointer.hh"
class VISU_ColoredPL;
namespace VISU
{
+ //----------------------------------------------------------------------------
+ struct TMinMaxController
+ {
+ virtual
+ vtkFloatingPointType
+ GetComponentMin(vtkIdType theCompID);
+
+ virtual
+ vtkFloatingPointType
+ GetComponentMax(vtkIdType theCompID);
+
+ virtual
+ void
+ Register() = 0;
+
+ virtual
+ void
+ Destroy() = 0;
+ };
+ typedef SALOME::GenericObjPtr<TMinMaxController> PMinMaxController;
+
+
+ //----------------------------------------------------------------------------
+ struct TVTKMinMaxController: virtual TMinMaxController,
+ virtual vtkObjectBase
+ {
+ virtual
+ void
+ Register()
+ {
+ vtkObjectBase::Register(NULL);
+ }
+
+ virtual
+ void
+ Destroy()
+ {
+ vtkObjectBase::Delete();
+ }
+ };
+
+
+ //----------------------------------------------------------------------------
+ class ColoredPrs3d_i;
+
+ PMinMaxController
+ CreateDefaultMinMaxController(VISU::ColoredPrs3d_i* theColoredPrs3d);
+
+
//----------------------------------------------------------------------------
class VISU_I_EXPORT ColoredPrs3d_i : public virtual POA_VISU::ColoredPrs3d,
+ public virtual TMinMaxController,
public virtual TResultObserver,
public virtual Prs3d_i
{
virtual
~ColoredPrs3d_i();
+ virtual
+ void
+ Register();
+
+ virtual
+ void
+ Destroy();
+
virtual
void
RemoveFromStudy();
GetCFieldName() const;
virtual
- const VISU::PField&
- GetField() const;
+ VISU::PField
+ GetField();
virtual
void
GetTimeStampIndexByNumber( CORBA::Long theNumber );
virtual
- const VISU::PField&
- GetScalarField() const;
+ VISU::PField
+ GetScalarField();
+
+ VISU::PMinMaxController
+ GetMinMaxController();
+
+ void
+ SetMinMaxController(const VISU::PMinMaxController& theController);
virtual
CORBA::Long
void
SetRange(CORBA::Double theMin, CORBA::Double theMax);
+ virtual
+ vtkFloatingPointType
+ GetComponentMin(vtkIdType theCompID);
+
+ virtual
+ vtkFloatingPointType
+ GetComponentMax(vtkIdType theCompID);
+
virtual
CORBA::Double
GetSourceMin();
bool myIsTimeStampFixed;
PField myField;
+ PMinMaxController myMinMaxController;
EPublishInStudyMode myPublishInStudyMode;
std::string myHolderEntry;
bool myIsFixedRange;
};
+
//----------------------------------------------------------------------------
template<class TColoredPrs3d>
Storable*
TColoredPrs3d* aColoredPrs3d = new TColoredPrs3d(ColoredPrs3d_i::EDoNotPublish);
return aColoredPrs3d->Restore(theSObject, theMap);
}
+
+
//----------------------------------------------------------------------------
}
theEntity,
theFieldName,
theTimeStampNumber);
- const VISU::PField aField = anInput->GetField(theMeshName,
- (VISU::TEntity)theEntity,
- theFieldName);
+ VISU::PField aField = anInput->GetField(theMeshName,
+ (VISU::TEntity)theEntity,
+ theFieldName);
if(aField->myNbComp <= 1)
return 0;
//---------------------------------------------------------------
-const VISU::PField&
+VISU::PField
VISU::ScalarMapOnDeformedShape_i
-::GetScalarField() const
+::GetScalarField()
{
return myScalarField;
}
GetScalarTimeStampNumber();
virtual
- const VISU::PField&
- GetScalarField() const;
+ VISU::PField
+ GetScalarField();
private:
VISU_ScalarMapOnDeformedShapePL *myScalarMapOnDeformedShapePL;
#include "CASCatch.hxx"
#endif
-using namespace std;
-namespace VISU {
- class ExecutionState {
+//------------------------------------------------------------------------
+namespace VISU
+{
+ //------------------------------------------------------------------------
+ class ExecutionState
+ {
bool myIsActive;
QMutex myIsActiveMutex;
public:
return state;
}
};
+
+
+ //------------------------------------------------------------------------
+ struct TCompositeMinMaxController : virtual TVTKMinMaxController
+ {
+ typedef std::vector<VISU::PMinMaxController> TMinMaxContainer;
+ TMinMaxContainer myMinMaxContainer;
+
+ void
+ AddController(VISU::PMinMaxController theMinMaxController)
+ {
+ myMinMaxContainer.push_back(theMinMaxController);
+ }
+
+ virtual
+ vtkFloatingPointType
+ GetComponentMin(vtkIdType theCompID)
+ {
+ vtkFloatingPointType aMin = TMinMaxController::GetComponentMin(theCompID);
+ if(!myMinMaxContainer.empty()){
+ for(size_t anId = 0; anId < myMinMaxContainer.size(); anId++){
+ VISU::PMinMaxController aMinMaxController = myMinMaxContainer[anId];
+ aMin = std::min(aMin, aMinMaxController->GetComponentMin(theCompID));
+ }
+ }
+ return aMin;
+ }
+
+ virtual
+ vtkFloatingPointType
+ GetComponentMax(vtkIdType theCompID)
+ {
+ vtkFloatingPointType aMax = TMinMaxController::GetComponentMax(theCompID);
+ if(!myMinMaxContainer.empty()){
+ for(size_t anId = 0; anId < myMinMaxContainer.size(); anId++){
+ VISU::PMinMaxController aMinMaxController = myMinMaxContainer[anId];
+ aMax = std::max(aMax, aMinMaxController->GetComponentMax(theCompID));
+ }
+ }
+ return aMax;
+ }
+ };
+
+ typedef SALOME::GenericObjPtr<TCompositeMinMaxController> PCompositeMinMaxController;
}
//------------------------------------------------------------------------
connect( myView, SIGNAL( destroyed() ), this, SLOT( onViewDeleted() ) );
}
- myAnimationMode = 0;
+ myAnimationMode = VISU::Animation::PARALLEL;
myTimeMinVal = 0;
myTimeMaxVal = 0;
myTimeMin = 0;
aNewData.myNbTimes = VISU::Storable::FindValue(aMap,"myNbTimeStamps").toLong();
- if ( myAnimationMode == 0 ) { // parallel animation mode
+ if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode
if ( aNewData.myNbTimes < 2 )
return false;
if ( !myFieldsLst.isEmpty() && myFieldsLst.first().myNbTimes != aNewData.myNbTimes )
CORBA::Double theTimeMin,
CORBA::Double theTimeMax)
{
- double aMin = VTK_LARGE_FLOAT, aMax = -VTK_LARGE_FLOAT;
-
_PTR(ChildIterator) anIter = theStudy->NewChildIterator(theData.myField);
anIter->Next(); // First is reference on support
try{
#endif
if(aPresent->Apply(false)){
- anIsCreated = true;
theData.myPrs[aFrameId++] = aPresent;
- aMin = std::min(aPresent->GetMin(), aMin);
- aMax = std::max(aPresent->GetMax(), aMax);
+ anIsCreated = true;
}
#ifdef NO_CAS_CATCH
}catch(Standard_Failure) {
if(!anIsCreated)
aPresent->_remove_ref();
}
+
theData.myNbFrames = aFrameId;
- if (theData.myPrsType != VISU::TGAUSSPOINTS){
- int aRangeType = VISU::GetResourceMgr()->integerValue("VISU" , "scalar_range_type", 0);
- if( aRangeType != 1 ){
- for(long aFrameId = 0; aFrameId < theData.myNbFrames; aFrameId++) {
- if (VISU::ScalarMap_i* aPrs = dynamic_cast<VISU::ScalarMap_i*>(theData.myPrs[aFrameId])){
- aPrs->SetRange(aMin, aMax);
- aPrs->SetOffset(theData.myOffset);
- }
+ if (theData.myPrsType != VISU::TGAUSSPOINTS) {
+ for(long aFrameId = 0; aFrameId < theData.myNbFrames; aFrameId++) {
+ if (VISU::ScalarMap_i* aPrs = dynamic_cast<VISU::ScalarMap_i*>(theData.myPrs[aFrameId])){
+ aPrs->SetOffset(theData.myOffset);
}
}
- if (theData.myPrsType == VISU::TISOSURFACES)
- for (long aFrameId = 0; aFrameId < theData.myNbFrames; aFrameId++)
- if (VISU::IsoSurfaces_i* aPrs = dynamic_cast<VISU::IsoSurfaces_i*>(theData.myPrs[aFrameId]))
- aPrs->SetSubRange(aMin, aMax);
}
}
}
return;
}
- if ( myAnimationMode == 1 ) { // succcessive animation mode
+ if ( myAnimationMode == VISU::Animation::SUCCESSIVE ) { // successive animation mode
if ( isRangeDefined() ) {
if ( myFieldsAbsFrames.size() == getNbFields() )
myFieldsAbsFrames.clear();
else
myFieldsAbsFrames.push_back(aData.myNbFrames);
}
- if ((theFieldNum == getNbFields() - 1) && aData.myPrsType != VISU::TGAUSSPOINTS){
- double aMin = getMinFieldsValue(myFieldsLst);
- double aMax = getMaxFieldsValue(myFieldsLst);
- for (int i = 0; i < getNbFields(); i++)
- for(long aFrameId = 0; aFrameId < myFieldsLst[i].myNbFrames; aFrameId++)
- if (aData.myPrsType == VISU::TISOSURFACES) {
- if (VISU::IsoSurfaces_i* aPrs = dynamic_cast<VISU::IsoSurfaces_i*>(myFieldsLst[i].myPrs[aFrameId]))
- aPrs->SetSubRange(aMin, aMax);
+
+ if (theFieldNum == getNbFields() - 1) {
+ if ( aData.myPrsType != VISU::TGAUSSPOINTS) {
+
+ // Initialize the MinMax controller
+ VISU::PCompositeMinMaxController aMinMaxController(new VISU::TCompositeMinMaxController());
+ if ( myAnimationMode == VISU::Animation::PARALLEL ) {
+ FieldData& aFieldData = getFieldData(theFieldNum);
+ VISU::ColoredPrs3d_i* aPrs3d = aFieldData.myPrs[0];
+ aMinMaxController->AddController(VISU::CreateDefaultMinMaxController(aPrs3d));
+ } else {
+ for (int aFieldId = 0; aFieldId < getNbFields(); aFieldId++) {
+ FieldData& aFieldData = getFieldData(aFieldId);
+ VISU::ColoredPrs3d_i* aPrs3d = aFieldData.myPrs[0];
+ aMinMaxController->AddController(VISU::CreateDefaultMinMaxController(aPrs3d));
}
- else
- if (VISU::ScalarMap_i* aPrs = dynamic_cast<VISU::ScalarMap_i*>(myFieldsLst[i].myPrs[aFrameId]))
- aPrs->SetRange(aMin, aMax);
+ }
+
+ double aMin = getMinFieldsValue(myFieldsLst);
+ double aMax = getMaxFieldsValue(myFieldsLst);
+
+ for (int aFieldId = 0; aFieldId < getNbFields(); aFieldId++) {
+ FieldData& aFieldData = getFieldData(aFieldId);
+ for (long aFrameId = 0; aFrameId < aFieldData.myNbFrames; aFrameId++) {
+ VISU::ColoredPrs3d_i* aPrs3d = aFieldData.myPrs[aFrameId];
+ aPrs3d->SetMinMaxController(aMinMaxController);
+ if (VISU::IsoSurfaces_i* anIsoSurfaces = dynamic_cast<VISU::IsoSurfaces_i*>(aPrs3d))
+ anIsoSurfaces->SetSubRange(aMin, aMax);
+ }
+ }
+ }
}
}
}
aData.myPrs[j]->SetOffset(aData.myOffset);
aActor = aData.myPrs[j]->CreateActor();
myView->AddActor(aActor);
- bool condition = ( myAnimationMode == 0 ) ? (j == 0) : (j == 0 && i == 0);
+ bool condition = ( myAnimationMode == VISU::Animation::PARALLEL ) ? (j == 0) : (j == 0 && i == 0);
if(condition)
aActor->VisibilityOn();
else
int aFieldId;
long aFrameId;
- if ( myAnimationMode == 0 ) { // parallel animation mode
+ if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode
for (i = 0; i < getNbFields(); i++)
if (myFieldsLst[i].myActors[myFrame] != 0)
visibilityOff(i, myFrame);
myFrame++;
- if ( myAnimationMode == 0 ) { // parallel animation mode
+ if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode
for (i = 0; i < getNbFields(); i++)
if (myFieldsLst[i].myActors[myFrame] != 0)
myFieldsLst[i].myActors[myFrame]->VisibilityOn();
int aFieldId;
long aFrameId;
- if ( myAnimationMode == 0 ) { // parallel animation mode
+ if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode
for (i = 0; i < getNbFields(); i++)
if (myFieldsLst[i].myActors[myFrame] != 0)
visibilityOff(i, myFrame);
myFrame--;
- if ( myAnimationMode == 0 ) { // parallel animation mode
+ if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode
for (i = 0; i < getNbFields(); i++)
if (myFieldsLst[i].myActors[myFrame] != 0)
myFieldsLst[i].myActors[myFrame]->VisibilityOn();
}
stopAnimation();
int i;
- if ( myAnimationMode == 0 ) { // parallel animation mode
+ if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode
for (i = 0; i < getNbFields(); i++)
if(!myFieldsLst[i].myActors.empty())
if (myFieldsLst[i].myActors[myFrame] != 0)
myFrame = 0;
int imax;
- if ( myAnimationMode == 0 ) // parallel animation mode
+ if ( myAnimationMode == VISU::Animation::PARALLEL ) // parallel animation mode
imax = getNbFields();
else //succcessive animation mode
imax = 1;
int aFieldId;
long aFrameId;
- if ( myAnimationMode == 0 ) { // parallel animation mode
+ if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode
for (i = 0; i < getNbFields(); i++)
if (myFieldsLst[i].myActors[myFrame] != 0)
visibilityOff(i, myFrame);
myFrame = getNbFrames() - 1; //myFieldsLst[0].myNbFrames-1;
- if ( myAnimationMode == 0 ) { // parallel animation mode
+ if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode
for (i = 0; i < getNbFields(); i++)
if (myFieldsLst[i].myActors[myFrame] != 0)
myFieldsLst[i].myActors[myFrame]->VisibilityOn();
int aFieldId;
long aFrameId;
- if ( myAnimationMode == 0 ) { // parallel animation mode
+ if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode
for (i = 0; i < getNbFields(); i++)
if (myFieldsLst[i].myActors[myFrame] != 0)
visibilityOff(i, myFrame);
myFrame = theFrame;
- if ( myAnimationMode == 0 ) { // parallel animation mode
+ if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode
for (i = 0; i < getNbFields(); i++)
if (myFieldsLst[i].myActors[myFrame] != 0)
myFieldsLst[i].myActors[myFrame]->VisibilityOn();
//------------------------------------------------------------------------
CORBA::Long VISU_TimeAnimation::getNbFrames() {
- if ( myAnimationMode == 0 ) // parallel animation mode
+ if ( myAnimationMode == VISU::Animation::PARALLEL ) // parallel animation mode
return (getNbFields() > 0)? myFieldsLst[0].myNbFrames : 0;
else //succcessive animation mode
return (getNbFields() > 0 && !myFieldsAbsFrames.empty()) ? myFieldsAbsFrames[myFieldsAbsFrames.size()-1] : 0;
if ( getNbFields() > 0 ) {
int aFieldId = theFieldTimeStamp.first;
long aFrameNum = theFieldTimeStamp.second + 1;
- if ( myAnimationMode == 0 ) { // parallel animation mode
+ if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode
if ( aFrameNum <= myFieldsAbsFrames[0] )
aRes = aFrameNum;
}
std::pair<int,long> aRes;
if ( getNbFields() > 0 && theFrame < getNbFrames() ) {
theFrame = theFrame + 1;
- if ( myAnimationMode == 0 ) { // parallel animation mode
+ if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode
aRes.first = 0;
aRes.second = theFrame - 1;
}
QString aFile(myDumpPath);
QString aName;
- if ( myAnimationMode == 0 ) // parallel animation mode
+ if ( myAnimationMode == VISU::Animation::PARALLEL ) // parallel animation mode
aName = QString("%1").arg(myFieldsLst[theFieldId].myTiming[myFrame]);
else // successive animation mode
aName = QString("%1").arg(myFieldsLst[theFieldId].myTiming[getRelativeFrameNumber(myFrame).second]);
myFileIndex = 0;
QValueList<int> anIndexList;
- if ( myAnimationMode == 0 ) // parallel animation mode
+ if ( myAnimationMode == VISU::Animation::PARALLEL ) // parallel animation mode
parallelAnimation( isDumping, anIndexList );
else //succcessive animation mode
succcessiveAnimation( isDumping, anIndexList );
myTimeMaxVal,
myAnimationMode);
- string anEntry = VISU::CreateAttributes(myStudy,aSComponentEntry.c_str(),"","",
- GenerateName(),"",aComment,true);
+ string anEntry = VISU::CreateAttributes(myStudy,
+ aSComponentEntry.c_str(),
+ VISU::NO_ICON,
+ VISU::NO_IOR,
+ GenerateName(),
+ VISU::NO_PERFSITENT_REF,
+ aComment,
+ true);
myAnimEntry = anEntry.c_str();
_PTR(SObject) aAnimSObject = myStudy->FindObjectID(anEntry.c_str());
for (int i = 0; i < getNbFields(); i++) {
FieldData& aData = myFieldsLst[i];
- if ( aData.myPrs.front() ) {
+ if (aData.myPrs.empty()) {
+ generatePresentations(i);
+ }
+ if ( !aData.myPrs.empty() ) {
_PTR(SObject) newObj = aStudyBuilder->NewObject(aAnimSObject);
aStudyBuilder->Addreference(newObj, aData.myField);
- if (aData.myPrs.empty()) {
- generatePresentations(i);
- }
ostringstream strOut;
aData.myPrs[0]->ToStream(strOut);
string aPrsComment = strOut.str();
string aPrsMyComment = aData.myPrs[0]->GetComment();
if(aPrsMyComment == "PRSMERGER")
aPrsMyComment = "SCALARMAP";
- VISU::CreateAttributes(myStudy, newObj->GetID().c_str(),"","",
- aPrsMyComment.c_str(),"",aPrsComment.c_str(),true);
+ VISU::CreateAttributes(myStudy,
+ newObj->GetID().c_str(),
+ VISU::NO_ICON,
+ VISU::NO_IOR,
+ aPrsMyComment.c_str(),
+ VISU::NO_PERFSITENT_REF,
+ aPrsComment.c_str(),
+ true);
}
}
aStudyBuilder->CommitCommand();
aPrsName->SetValue(aPrsNameTxt);
} else {
- VISU::CreateAttributes(myStudy, aRefObj->GetID().c_str(),"","",
- aPrsNameTxt.c_str(),"",aPrsComment.c_str(),true);
+ VISU::CreateAttributes(myStudy,
+ aRefObj->GetID().c_str(),
+ VISU::NO_ICON,
+ VISU::NO_IOR,
+ aPrsNameTxt.c_str(),
+ VISU::NO_PERFSITENT_REF,
+ aPrsComment.c_str(),
+ true);
}
}
aStudyBuilder->CommitCommand();
bool isExist;
myTimeMinVal = VISU::Storable::FindValue(aMap,"myTimeMinVal",&isExist).toDouble();
myTimeMaxVal = VISU::Storable::FindValue(aMap,"myTimeMaxVal",&isExist).toDouble();
- myAnimationMode = VISU::Storable::FindValue(aMap,"myMode",&isExist).toInt();
+ myAnimationMode = VISU::Animation::AnimationMode(VISU::Storable::FindValue(aMap,"myMode",&isExist).toInt());
_PTR(ChildIterator) anIter = myStudy->NewChildIterator(aAnimSObject);
for (anIter->Init(); anIter->More(); anIter->Next()) {
if (VISU::ScalarMap_i* aPrs = dynamic_cast<VISU::ScalarMap_i*>(aData.myPrs[i]))
anIsFixedRange = aPrs->IsRangeFixed();
}
- //jfa 03.08.2005:aData.myPrs[i]->SameAs(aData.myPrs[0]);
- aData.myPrs[i]->SameAs(aData.myPrs[0]);//jfa 03.08.2005
+ aData.myPrs[i]->SameAs(aData.myPrs[0]);
}
}
string aStr = aAnimSObject->GetID();
if ( !aPrs_i )
throw SALOME_Exception(LOCALIZED("Error : invalid dynamic cast of the given presentation to VISU::ColoredPrs3d_i"));
- if ( myAnimationMode == 0 ) { // parallel animation mode
+ if ( myAnimationMode == VISU::Animation::PARALLEL ) { // parallel animation mode
FieldData& aData = myFieldsLst[theFieldNum];
if ( aData.myPrs.empty() )
aData.myPrs[i]->SameAs(aPrs_i);
}
}
- else if ( myAnimationMode == 1 ) { // successive animation mode
+ else if ( myAnimationMode == VISU::Animation::SUCCESSIVE ) { // successive animation mode
for (int f = 0; f < getNbFields(); f++) {
FieldData& aData = myFieldsLst[f];
void saveAnimation();
bool isSavedInStudy() const { return !myAnimEntry.isEmpty(); }
- void setAnimationMode(int theMode) { myAnimationMode = theMode; }
- int getAnimationMode() { return myAnimationMode; }
+ void setAnimationMode(VISU::Animation::AnimationMode theMode) { myAnimationMode = theMode; }
+ VISU::Animation::AnimationMode getAnimationMode() { return myAnimationMode; }
void ApplyProperties(CORBA::Long theFieldNum, VISU::ColoredPrs3d_ptr thePrs) throw (SALOME::SALOME_Exception);
bool myCleaningMemoryAtEachFrame;
_PTR(Study) myStudy;
- int myAnimationMode;
+ VISU::Animation::AnimationMode myAnimationMode;
double myTimeMinVal, myTimeMaxVal; //!< Range of time stams, set by user
double myTimeMin , myTimeMax ; //!< Range of time stams, available for animation
QString myDumpPath;