Plot2d_ViewManager.h \
Plot2d_ViewModel.h \
Plot2d_ViewWindow.h \
+ Plot2d_Algorithm.h \
+ Plot2d_NormalizeAlgorithm.h \
Plot2d_SetupCurveDlg.h \
Plot2d_ToolTip.h \
Plot2d_SetupCurveScaleDlg.h
Plot2d_ViewManager.cxx \
Plot2d_ViewModel.cxx \
Plot2d_ViewWindow.cxx \
+ Plot2d_Algorithm.cxx \
+ Plot2d_NormalizeAlgorithm.cxx \
Plot2d_SetupCurveDlg.cxx \
Plot2d_SetupCurveScaleDlg.cxx \
Plot2d_ToolTip.cxx
Plot2d_ViewModel_moc.cxx \
Plot2d_ViewWindow_moc.cxx \
Plot2d_SetupCurveDlg_moc.cxx \
+ Plot2d_Algorithm_moc.cxx \
+ Plot2d_NormalizeAlgorithm_moc.cxx \
Plot2d_SetupCurveScaleDlg_moc.cxx \
Plot2d_ToolTip_moc.cxx
resources/plot2d_settings.png \
resources/plot2d_splines.png \
resources/plot2d_analitic_curve.png \
+ resources/plot2d_lmax_normalization.png \
+ resources/plot2d_lmin_normalization.png \
+ resources/plot2d_rmax_normalization.png \
+ resources/plot2d_rmin_normalization.png \
resources/plot2d_zoom.png
nodist_salomeres_DATA = \
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE\r
+//\r
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,\r
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS\r
+//\r
+// This library is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU Lesser General Public\r
+// License as published by the Free Software Foundation; either\r
+// version 2.1 of the License.\r
+//\r
+// This library is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+// Lesser General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU Lesser General Public\r
+// License along with this library; if not, write to the Free Software\r
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+//\r
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com\r
+//\r
+// File : Plot2d_Algorithm.cxx\r
+\r
+#include "Plot2d_Algorithm.h"\r
+\r
+/*!\r
+ Constructor\r
+*/\r
+Plot2d_Algorithm::Plot2d_Algorithm(QObject *parent) :\r
+ QObject(parent),\r
+ myDataChanged(false)\r
+{\r
+}\r
+\r
+/*!\r
+ Destructor\r
+*/\r
+Plot2d_Algorithm::~Plot2d_Algorithm()\r
+{\r
+}\r
+\r
+/*!\r
+ Sets input data values\r
+*/\r
+void Plot2d_Algorithm::setInput(AlgoPlot2dInputData theInuptData)\r
+{\r
+ clear();\r
+ myInuptData = theInuptData;\r
+ myDataChanged = true;\r
+}\r
+\r
+/*!\r
+ Gets result data values\r
+*/\r
+AlgoPlot2dOutputData Plot2d_Algorithm::getOutput()\r
+{\r
+ return myResultData;\r
+}\r
+\r
+/*!\r
+ Check the data values changed\r
+*/\r
+bool Plot2d_Algorithm::isDataChanged()\r
+{\r
+ return myDataChanged;\r
+}\r
+\r
+\r
+void Plot2d_Algorithm::clear() {\r
+ myDataChanged=false;\r
+ myInuptData.clear();\r
+ myResultData.clear();\r
+}
\ No newline at end of file
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE\r
+//\r
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,\r
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS\r
+//\r
+// This library is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU Lesser General Public\r
+// License as published by the Free Software Foundation; either\r
+// version 2.1 of the License.\r
+//\r
+// This library is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+// Lesser General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU Lesser General Public\r
+// License along with this library; if not, write to the Free Software\r
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+//\r
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com\r
+//\r
+// File : Plot2d_Algorithm.h\r
+\r
+#ifndef PLOT2D_ALGORITHM_H\r
+#define PLOT2D_ALGORITHM_H\r
+\r
+#include "Plot2d.h"\r
+\r
+#include <QPair>\r
+#include <QList>\r
+#include <QMap>\r
+\r
+class Plot2d_Object;\r
+\r
+typedef QList< QPair<double,double> > AlgoPlot2dItem;\r
+typedef QList<Plot2d_Object*> AlgoPlot2dInputData;\r
+typedef QMap<Plot2d_Object*,AlgoPlot2dItem> AlgoPlot2dOutputData;\r
+\r
+class PLOT2D_EXPORT Plot2d_Algorithm : public QObject {\r
+ Q_OBJECT\r
+public:\r
+ Plot2d_Algorithm(QObject *parent = 0);\r
+ ~Plot2d_Algorithm();\r
+\r
+ void setInput(AlgoPlot2dInputData);\r
+ AlgoPlot2dOutputData getOutput();\r
+ virtual void execute() = 0;\r
+ virtual void clear();\r
+\r
+ bool isDataChanged();\r
+\r
+protected:\r
+ AlgoPlot2dInputData myInuptData;\r
+ AlgoPlot2dOutputData myResultData;\r
+ bool myDataChanged;\r
+};\r
+\r
+#endif //PLOT2D_ALGORITHM_H\r
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE\r
+//\r
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,\r
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS\r
+//\r
+// This library is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU Lesser General Public\r
+// License as published by the Free Software Foundation; either\r
+// version 2.1 of the License.\r
+//\r
+// This library is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+// Lesser General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU Lesser General Public\r
+// License along with this library; if not, write to the Free Software\r
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+//\r
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com\r
+//\r
+// File : Plot2d_NormalizeAlgorithm.cxx\r
+\r
+#include "Plot2d_NormalizeAlgorithm.h"\r
+#include <QMap>\r
+#include <algorithm>\r
+#include "Plot2d_Object.h"\r
+\r
+/*!\r
+ Constructor\r
+*/\r
+Plot2d_NormalizeAlgorithm::Plot2d_NormalizeAlgorithm(QObject *parent) :\r
+ Plot2d_Algorithm(parent),\r
+ myNormalizationMode(NormalizeNone)\r
+{\r
+}\r
+\r
+/*!\r
+ Destructor\r
+*/\r
+Plot2d_NormalizeAlgorithm::~Plot2d_NormalizeAlgorithm()\r
+{\r
+}\r
+\r
+/*!\r
+ Sets normalozation mode\r
+*/\r
+void Plot2d_NormalizeAlgorithm::setNormalizationMode(NormalizationMode theMode) {\r
+ if(myNormalizationMode != theMode) {\r
+ myNormalizationMode = theMode;\r
+ myDataChanged = true;\r
+ }\r
+}\r
+\r
+/*!\r
+ Gets normalozation mode\r
+*/\r
+Plot2d_NormalizeAlgorithm::NormalizationMode Plot2d_NormalizeAlgorithm::getNormalizationMode()const {\r
+ return myNormalizationMode;\r
+}\r
+\r
+/*!\r
+ Gets k normalization coefficient\r
+*/\r
+double Plot2d_NormalizeAlgorithm::getKkoef(Plot2d_Object* theObj) \r
+{\r
+ QMap<Plot2d_Object*,double>::iterator it = myKkoefs.find(theObj);\r
+ if(it != myKkoefs.end())\r
+ return it.value();\r
+ return 0;\r
+}\r
+\r
+/*!\r
+ Gets b normalization coefficient\r
+*/\r
+double Plot2d_NormalizeAlgorithm::getBkoef(Plot2d_Object* theObj)\r
+{\r
+ QMap<Plot2d_Object*,double>::iterator it = myBkoefs.find(theObj);\r
+ if(it != myBkoefs.end())\r
+ return it.value();\r
+ return 0;\r
+\r
+}\r
+\r
+void Plot2d_NormalizeAlgorithm::execute() {\r
+ if (!isDataChanged() || myInuptData.isEmpty())\r
+ return;\r
+\r
+ if (myNormalizationMode != NormalizeNone) {\r
+ QList<double> yMinLst, yMaxLst;\r
+ QList<double> aKkoefs,aBkoefs;\r
+ double _pMin, _pMax;\r
+ for (int i = 0; i < myInuptData.size(); ++i) {\r
+ QList<double> aTmpItemValues;\r
+ Plot2d_Object* object = myInuptData.at(i);\r
+ double *x, *y;\r
+ long nb = object->getData( &x, &y );\r
+ for (int j = 0; j < nb; ++j) {\r
+ aTmpItemValues<<object->getPoint(j).y;\r
+ }\r
+ delete x;\r
+ delete y;\r
+ yMaxLst<<*(std::max_element(aTmpItemValues.begin(), aTmpItemValues.end()));\r
+ yMinLst<<*(std::min_element(aTmpItemValues.begin(), aTmpItemValues.end()));\r
+ }\r
+ _pMin = *(std::min_element(yMinLst.begin(), yMinLst.end()));\r
+ _pMax = *(std::max_element(yMaxLst.begin(), yMaxLst.end()));\r
+\r
+ double pMin, pMax, kKoef, bKoef, yMin, yMax;\r
+ switch( getNormalizationMode() ) {\r
+ case NormalizeToMin:\r
+ pMin = _pMin;\r
+ for (int i = 0; i < yMaxLst.size(); ++i) {\r
+ yMin = yMinLst.at(i);\r
+ yMax = yMaxLst.at(i); \r
+ pMax = yMax;\r
+ kKoef = (pMax - pMin)/(yMax - yMin);\r
+ bKoef = pMin - kKoef * yMin;\r
+ aBkoefs<<bKoef;\r
+ aKkoefs<<kKoef;\r
+ }\r
+ break;\r
+ case NormalizeToMax:\r
+ pMax = _pMax;\r
+ for (int i = 0; i < yMaxLst.size(); ++i) {\r
+ yMin = yMinLst.at(i);\r
+ yMax = yMaxLst.at(i); \r
+ pMin = yMin;\r
+ kKoef = (pMax - pMin)/(yMax - yMin);\r
+ bKoef = pMin - kKoef * yMin;\r
+ aBkoefs<<bKoef;\r
+ aKkoefs<<kKoef;\r
+ }\r
+ break;\r
+ case NormalizeToMinMax:\r
+ pMax = _pMax;\r
+ pMin = _pMin;\r
+ for (int i = 0; i < yMaxLst.size(); ++i) {\r
+ yMin = yMinLst.at(i);\r
+ yMax = yMaxLst.at(i); \r
+ kKoef = (pMax - pMin)/(yMax - yMin);\r
+ bKoef = pMin - kKoef * yMin;\r
+ aBkoefs<<bKoef;\r
+ aKkoefs<<kKoef;\r
+ }\r
+ break;\r
+ }\r
+\r
+ for (int i = 0; i < myInuptData.size(); ++i) {\r
+ double yOld,xOld,yNew;\r
+ AlgoPlot2dItem tmpItem;\r
+ for (int j = 0; j < myInuptData.at(i)->nbPoints(); ++j) {\r
+ yOld = myInuptData.at(i)->getPoint(j).y;\r
+ xOld = myInuptData.at(i)->getPoint(j).x;\r
+ yNew = aKkoefs.at(i) * yOld + aBkoefs.at(i);\r
+ tmpItem.append( qMakePair(xOld, yNew) );\r
+ }\r
+ myResultData.insert(myInuptData.at(i),tmpItem);\r
+ myKkoefs.insert(myInuptData.at(i),aKkoefs.at(i));\r
+ myBkoefs.insert(myInuptData.at(i),aBkoefs.at(i));\r
+ }\r
+ } else {\r
+ for (int i = 0; i < myInuptData.size(); ++i) {\r
+ double yOld,xOld;\r
+ AlgoPlot2dItem tmpItem;\r
+ for (int j = 0; j < myInuptData.at(i)->nbPoints(); ++j) {\r
+ yOld = myInuptData.at(i)->getPoint(j).y;\r
+ xOld = myInuptData.at(i)->getPoint(j).x;\r
+ tmpItem.append( qMakePair(xOld, yOld) );\r
+ }\r
+ myResultData.insert(myInuptData.at(i),tmpItem);\r
+ }\r
+\r
+ }\r
+ myDataChanged = false; \r
+}\r
+\r
+\r
+void Plot2d_NormalizeAlgorithm::clear() {\r
+ Plot2d_Algorithm::clear();\r
+ myBkoefs.clear();\r
+ myKkoefs.clear();\r
+}
\ No newline at end of file
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE\r
+//\r
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,\r
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS\r
+//\r
+// This library is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU Lesser General Public\r
+// License as published by the Free Software Foundation; either\r
+// version 2.1 of the License.\r
+//\r
+// This library is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+// Lesser General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU Lesser General Public\r
+// License along with this library; if not, write to the Free Software\r
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+//\r
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com\r
+//\r
+// File : Plot2d_NormalizeAlgorithm.h\r
+\r
+#ifndef PLOT2D_NORMALIZEALGORITHM_H\r
+#define PLOT2D_NORMALIZEALGORITHM_H\r
+\r
+#include "Plot2d.h"\r
+#include "Plot2d_Algorithm.h"\r
+#include <QList>\r
+\r
+class Plot2d_Object;\r
+\r
+class PLOT2D_EXPORT Plot2d_NormalizeAlgorithm : public Plot2d_Algorithm {\r
+ Q_OBJECT\r
+public:\r
+ Plot2d_NormalizeAlgorithm(QObject *parent);\r
+ ~Plot2d_NormalizeAlgorithm();\r
+\r
+ enum NormalizationMode { NormalizeToMin, NormalizeToMax, NormalizeToMinMax, NormalizeNone };\r
+\r
+ void setNormalizationMode(NormalizationMode);\r
+ NormalizationMode getNormalizationMode() const;\r
+ double getKkoef(Plot2d_Object*);\r
+ double getBkoef(Plot2d_Object*);\r
+ virtual void execute();\r
+ virtual void clear();\r
+\r
+private: \r
+ NormalizationMode myNormalizationMode;\r
+ QMap<Plot2d_Object*, double> myBkoefs;\r
+ QMap<Plot2d_Object*, double> myKkoefs;\r
+};\r
+\r
+#endif //PLOT2D_NORMALIZEALGORITHM_H\r
return myPoints;
}
+/*!
+ Gets points by index.
+*/
+
+Plot2d_Point& Plot2d_Object::getPoint(int index) {
+ return myPoints[index];
+}
+
/*!
Gets object's data : abscissas of points
*/
void clearAllPoints();
pointList getPointList() const;
void setPointList( const pointList& points );
+ Plot2d_Point& getPoint(int index);
void setData( const double*, const double*,
long, const QStringList& = QStringList() );
QLabel* aBGLab = new QLabel( tr( "PLOT2D_BACKGROUND_COLOR_LBL" ), this );
myBackgroundBtn = new QtxColorButton( this );
+ // normalize mode
+ QGroupBox* aNormalizeGrp = new QGroupBox( tr( "PLOT2D_NORMALIZE_TLT" ), this );
+ QGridLayout* aNormalizeLayout = new QGridLayout( aNormalizeGrp );
+ aNormalizeLayout->setMargin( MARGIN_SIZE ); aNormalizeLayout->setSpacing( SPACING_SIZE );
+ aNormalizeGrp->setLayout( aNormalizeLayout );
+ QLabel* aYLeftLab = new QLabel( tr( "PLOT2D_NORMALIZE_LEFT_AXIS" ), aNormalizeGrp );
+ myNormLMinCheck = new QCheckBox( tr( "PLOT2D_NORMALIZE_MODE_MIN" ), aNormalizeGrp );
+ myNormLMaxCheck = new QCheckBox( tr( "PLOT2D_NORMALIZE_MODE_MAX" ), aNormalizeGrp );
+ QLabel* aYRightLab = new QLabel( tr( "PLOT2D_NORMALIZE_RIGHT_AXIS" ), aNormalizeGrp );
+ myNormRMinCheck = new QCheckBox( tr( "PLOT2D_NORMALIZE_MODE_MIN" ), aNormalizeGrp );
+ myNormRMaxCheck = new QCheckBox( tr( "PLOT2D_NORMALIZE_MODE_MAX" ), aNormalizeGrp );
+
+ aNormalizeLayout->addWidget( aYLeftLab, 0, 0 );
+ aNormalizeLayout->addWidget( myNormLMaxCheck, 0, 1 );
+ aNormalizeLayout->addWidget( myNormLMinCheck, 0, 2 );
+ aNormalizeLayout->addWidget( aYRightLab, 1, 0 );
+ aNormalizeLayout->addWidget( myNormRMaxCheck, 1, 1 );
+ aNormalizeLayout->addWidget( myNormRMinCheck, 1, 2 );
+
// scale mode
QGroupBox* aScaleGrp = new QGroupBox( tr( "PLOT2D_SCALE_TLT" ), this );
QGridLayout* aScaleLayout = new QGridLayout( aScaleGrp );
myYMinGridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
aGridLayoutY->addWidget( myYGridCheck, 0, 0 );
- aGridLayoutY->addWidget( aYMajLbl, 0, 1 );
+ aGridLayoutY->addWidget( aYMajLbl, 0, 1 );
aGridLayoutY->addWidget( myYGridSpin, 0, 2 );
aGridLayoutY->addWidget( myYMinGridCheck, 1, 0 );
aGridLayoutY->addWidget( aYMinLbl, 1, 1 );
bgLayout->addWidget( myBackgroundBtn ); bgLayout->addStretch();
topLayout->addWidget( aBGLab, 3, 2 );
topLayout->addLayout( bgLayout, 3, 3 );
- topLayout->addWidget( aScaleGrp, 4, 0, 1, 4 );
- topLayout->addWidget( aTabWidget, 5, 0, 1, 4 );
- topLayout->addWidget( myDefCheck, 6, 0, 1, 4 );
- topLayout->setRowStretch( 6, 5 );
+ topLayout->addWidget( aNormalizeGrp, 4, 0, 1, 4 );
+ topLayout->addWidget( aScaleGrp, 5, 0, 1, 4 );
+ topLayout->addWidget( aTabWidget, 6, 0, 1, 4 );
+ topLayout->addWidget( myDefCheck, 7, 0, 1, 4 );
+ topLayout->setRowStretch( 7, 5 );
- topLayout->addLayout( btnLayout, 7, 0, 1, 4 );
+ topLayout->addLayout( btnLayout, 8, 0, 1, 4 );
if ( !showDefCheck )
myDefCheck->hide();
connect( myYGridCheck, SIGNAL( clicked() ), this, SLOT( onYGridMajorChecked() ) );
connect( myXMinGridCheck, SIGNAL( clicked() ), this, SLOT( onXGridMinorChecked() ) );
connect( myYMinGridCheck, SIGNAL( clicked() ), this, SLOT( onYGridMinorChecked() ) );
+ connect( myNormLMaxCheck, SIGNAL( clicked() ), this, SLOT( onNormLMaxChecked() ) );
+ connect( myNormLMinCheck, SIGNAL( clicked() ), this, SLOT( onNormLMinChecked() ) );
+ connect( myNormRMaxCheck, SIGNAL( clicked() ), this, SLOT( onNormRMaxChecked() ) );
+ connect( myNormRMinCheck, SIGNAL( clicked() ), this, SLOT( onNormRMinChecked() ) );
+
connect( myOkBtn, SIGNAL( clicked() ), this, SLOT( accept() ) );
connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
onXGridMajorChecked();
onYGridMajorChecked();
onXGridMinorChecked();
+ onNormLMaxChecked();
+ onNormLMinChecked();
+ onNormRMaxChecked();
+ onNormRMinChecked();
if ( mySecondAxisY ) {
onY2TitleChecked();
onY2GridMajorChecked();
return myCurveCombo->currentIndex();
}
+/*!
+ \brief Set normalization to maximum by left Y axis.
+ \param type normalizatoin type: true,false
+ \sa getMaxNormMode()
+*/
+void Plot2d_SetupViewDlg::setLMaxNormMode( const bool type )
+{
+ myNormLMaxCheck->setChecked( type );
+}
+
+/*!
+ \brief Check if normalization to maximum by left Y axis sets.
+ \return curve normalizatoin type: true,false
+ \sa setMaxNormMode()
+*/
+bool Plot2d_SetupViewDlg::getLMaxNormMode()
+{
+ return myNormLMaxCheck->isChecked();
+}
+
+/*!
+ \brief Set normalization to minimum by left Y axis.
+ \param type normalizatoin type: true,false
+ \sa getMinNormMode()
+*/
+void Plot2d_SetupViewDlg::setLMinNormMode( const bool type )
+{
+ myNormLMinCheck->setChecked( type );
+}
+
+/*!
+ \brief Check if normalization to minimum by left Y axis sets.
+ \return curve normalizatoin type: true,false
+ \sa setMinNormMode()
+*/
+bool Plot2d_SetupViewDlg::getLMinNormMode()
+{
+ return myNormLMinCheck->isChecked();
+}
+
+/*!
+ \brief Set normalization to maximum by right Y axis.
+ \param type normalizatoin type: true,false
+ \sa getMaxNormMode()
+*/
+void Plot2d_SetupViewDlg::setRMaxNormMode( const bool type )
+{
+ myNormRMaxCheck->setChecked( type );
+}
+
+/*!
+ \brief Check if normalization to maximum by right Y axis sets.
+ \return curve normalizatoin type: true,false
+ \sa setMaxNormMode()
+*/
+bool Plot2d_SetupViewDlg::getRMaxNormMode()
+{
+ return myNormRMaxCheck->isChecked();
+}
+
+/*!
+ \brief Set normalization to minimum by right Y axis.
+ \param type normalizatoin type: true,false
+ \sa getMinNormMode()
+*/
+void Plot2d_SetupViewDlg::setRMinNormMode( const bool type )
+{
+ myNormRMinCheck->setChecked( type );
+}
+
+/*!
+ \brief Check if normalization to minimum by right Y axis sets.
+ \return curve normalizatoin type: true,false
+ \sa setMinNormMode()
+*/
+bool Plot2d_SetupViewDlg::getRMinNormMode()
+{
+ return myNormRMinCheck->isChecked();
+}
+
/*!
\brief Set legend attribute.
\param if \c true legend is shown
{
}
+/*!
+ \brief Called when user clicks "Left Y Axis: Normalize to maximum" check box.
+*/
+void Plot2d_SetupViewDlg::onNormLMaxChecked()
+{
+}
+
+/*!
+ \brief Called when user clicks "Left Y Axis: Normalize to minimum" check box.
+*/
+void Plot2d_SetupViewDlg::onNormLMinChecked()
+{
+}
+
+/*!
+ \brief Called when user clicks "Right Y Axis: Normalize to maximum" check box.
+*/
+void Plot2d_SetupViewDlg::onNormRMaxChecked()
+{
+}
+
+/*!
+ \brief Called when user clicks "Right Y Axis: Normalize to minimum" check box.
+*/
+void Plot2d_SetupViewDlg::onNormRMinChecked()
+{
+}
+
/*!
\brief Get "Set settings as default" check box value.
\return \c true if "Set settings as default" check box is on
void setCurveType( const int );
int getCurveType();
+ bool getLMaxNormMode();
+ void setLMaxNormMode(const bool);
+ bool getLMinNormMode();
+ void setLMinNormMode(const bool);
+ bool getRMaxNormMode();
+ void setRMaxNormMode(const bool);
+ bool getRMinNormMode();
+ void setRMinNormMode(const bool);
+
void setLegend( bool, int, const QFont&, const QColor& );
bool isLegendEnabled();
int getLegendPos();
void onXGridMinorChecked();
void onYGridMinorChecked();
void onY2GridMinorChecked();
+ void onNormLMaxChecked();
+ void onNormLMinChecked();
+ void onNormRMaxChecked();
+ void onNormRMinChecked();
void onHelp();
private:
QSpinBox* myMarkerSpin;
QComboBox* myXModeCombo;
QComboBox* myYModeCombo;
+ QCheckBox* myNormLMaxCheck;
+ QCheckBox* myNormLMinCheck;
+ QCheckBox* myNormRMaxCheck;
+ QCheckBox* myNormRMinCheck;
QComboBox* myY2ModeCombo;
QCheckBox* myDefCheck;
QPushButton* myOkBtn;
myXGridMinorEnabled( false ), myYGridMinorEnabled( false ), myY2GridMinorEnabled( false ),
myXGridMaxMajor( 8 ), myYGridMaxMajor( 8 ), myY2GridMaxMajor( 8 ),
myXGridMaxMinor( 5 ), myYGridMaxMinor( 5 ), myY2GridMaxMinor( 5 ),
- myXMode( 0 ), myYMode( 0 ), mySecondY( false ), myIsDefTitle( true )
+ myXMode( 0 ), myYMode( 0 ),myNormLMin(false), myNormLMax(false), myNormRMin(false), myNormRMax(false),
+ mySecondY( false ), myIsDefTitle( true )
{
setObjectName( title );
+ myRNormAlgo = new Plot2d_NormalizeAlgorithm(this);
+ myLNormAlgo = new Plot2d_NormalizeAlgorithm(this);
/* Plot 2d View */
QVBoxLayout* aLayout = new QVBoxLayout( this );
myPlot = new Plot2d_Plot2d( this );
setHorScaleMode( qMax( 0, qMin( 1, resMgr->integerValue( "Plot2d", "HorScaleMode", myXMode ) ) ), false );
setVerScaleMode( qMax( 0, qMin( 1, resMgr->integerValue( "Plot2d", "VerScaleMode", myYMode ) ) ), false );
+ setNormLMinMode( resMgr->booleanValue( "Plot2d", "VerNormLMinMode", myNormLMin ) );
+ setNormLMaxMode( resMgr->booleanValue( "Plot2d", "VerNormLMaxMode", myNormLMax ) );
+ setNormRMinMode( resMgr->booleanValue( "Plot2d", "VerNormRMinMode", myNormRMin ) );
+ setNormRMaxMode( resMgr->booleanValue( "Plot2d", "VerNormRMaxMode", myNormRMax ) );
}
/*!
}
resMgr->setValue( "Plot2d", "VerScaleMode", myYMode );
+ resMgr->setValue( "Plot2d", "VerNormLMinMode", myNormLMin );
+ resMgr->setValue( "Plot2d", "VerNormLMaxMode", myNormLMax );
+ resMgr->setValue( "Plot2d", "VerNormRMinMode", myNormRMin );
+ resMgr->setValue( "Plot2d", "VerNormRMaxMode", myNormRMax );
}
/*!
updateObject( curve, update );
}
+void Plot2d_ViewFrame::processFiltering(bool update)
+{
+ CurveDict aCurves = getCurves();
+ AlgoPlot2dInputData aLData, aRData;
+ CurveDict::iterator it;
+ for ( it = aCurves.begin(); it != aCurves.end(); it++ ) {
+ Plot2d_Object* objItem = it.value();
+ if (objItem->getYAxis() == QwtPlot::yRight)
+ aRData.append(objItem);
+ else
+ aLData.append(objItem);
+ }
+
+// Normalization by left Y axis
+ if (!myNormLMin && !myNormLMax)
+ myLNormAlgo->setNormalizationMode(Plot2d_NormalizeAlgorithm::NormalizeNone);
+ if(myNormLMin && myNormLMax)
+ myLNormAlgo->setNormalizationMode(Plot2d_NormalizeAlgorithm::NormalizeToMinMax);
+ else if(myNormLMin)
+ myLNormAlgo->setNormalizationMode(Plot2d_NormalizeAlgorithm::NormalizeToMin);
+ else if(myNormLMax)
+ myLNormAlgo->setNormalizationMode(Plot2d_NormalizeAlgorithm::NormalizeToMax);
+
+ myLNormAlgo->setInput(aLData);
+ myLNormAlgo->execute();
+
+// Normalization by right Y axis
+ if (!myNormRMin && !myNormRMax)
+ myRNormAlgo->setNormalizationMode(Plot2d_NormalizeAlgorithm::NormalizeNone);
+ if(myNormRMin && myNormRMax)
+ myRNormAlgo->setNormalizationMode(Plot2d_NormalizeAlgorithm::NormalizeToMinMax);
+ else if(myNormRMin)
+ myRNormAlgo->setNormalizationMode(Plot2d_NormalizeAlgorithm::NormalizeToMin);
+ else if(myNormRMax)
+ myRNormAlgo->setNormalizationMode(Plot2d_NormalizeAlgorithm::NormalizeToMax);
+
+ myRNormAlgo->setInput(aRData);
+ myRNormAlgo->execute();
+
+ for ( it = aCurves.begin(); it != aCurves.end(); it++) {
+ QwtPlotCurve* item = it.key();
+ Plot2d_Object* objItem = it.value();
+ updatePlotItem(objItem, item);
+ }
+ if(update)
+ myPlot->replot();
+}
+
/*!
Gets lsit of displayed curves
*/
object->autoFill( myPlot );
if ( hasPlotObject( object ) ) {
+ processFiltering(update);
updateObject( object, update );
}
else {
Plot2d_Curve* aCurve = dynamic_cast<Plot2d_Curve*>( object );
if ( aCurve ) {
aCurve->setMarkerSize( myMarkerSize );
- aCurve->updatePlotItem( anItem );
+ processFiltering(update);
+ updatePlotItem( aCurve, anItem );
setCurveType( getPlotCurve( aCurve ), myCurveType );
}
}
QwtPlotItem* anItem = getPlotObject( object );
if ( !anItem )
return;
- object->updatePlotItem( anItem );
+ updatePlotItem(object, anItem );
anItem->setVisible( true );
if ( update )
myPlot->replot();
dlg->setMarkerSize( myMarkerSize );
dlg->setBackgroundColor( myBackground );
dlg->setScaleMode(myXMode, myYMode);
+ dlg->setLMinNormMode(myNormLMin);
+ dlg->setLMaxNormMode(myNormLMax);
+ dlg->setRMinNormMode(myNormRMin);
+ dlg->setRMaxNormMode(myNormRMax);
//
dlg->setMajorGrid( myXGridMajorEnabled, myPlot->axisMaxMajor( QwtPlot::xBottom ),
myYGridMajorEnabled, myPlot->axisMaxMajor( QwtPlot::yLeft ),
if ( myYMode != dlg->getYScaleMode() ) {
setVerScaleMode( dlg->getYScaleMode() );
}
+ if ( myNormLMin != dlg->getLMinNormMode() ) {
+ setNormLMinMode( dlg->getLMinNormMode() );
+ }
+ if ( myNormLMax != dlg->getLMaxNormMode() ) {
+ setNormLMaxMode( dlg->getLMaxNormMode() );
+ }
+ if ( myNormRMin != dlg->getRMinNormMode() ) {
+ setNormRMinMode( dlg->getRMinNormMode() );
+ }
+ if ( myNormRMax != dlg->getRMaxNormMode() ) {
+ setNormRMaxMode( dlg->getRMaxNormMode() );
+ }
+
// update view
myPlot->replot();
// update preferences
return myYMode;
}
+/*!
+ Sets normalization mode to the global maximum by left Y axis
+*/
+void Plot2d_ViewFrame::setNormLMaxMode( bool mode, bool update )
+{
+ if ( myNormLMax == mode )
+ return;
+
+ myNormLMax = mode;
+ processFiltering(true);
+ if ( update )
+ fitAll();
+ emit vpNormLModeChanged();
+}
+
+/*!
+ Gets normalization mode to the global maximum by left Y axis
+*/
+bool Plot2d_ViewFrame::getNormLMaxMode() const
+{
+ return myNormLMax;
+}
+
+/*!
+ Sets normalization mode to the global minimum by left Y axis
+*/
+void Plot2d_ViewFrame::setNormLMinMode( bool mode, bool update )
+{
+ if ( myNormLMin == mode )
+ return;
+
+ myNormLMin = mode;
+ processFiltering(true);
+ if ( update )
+ fitAll();
+ emit vpNormLModeChanged();
+}
+
+/*!
+ Gets normalization mode to the global minimum by left Y axis
+*/
+bool Plot2d_ViewFrame::getNormLMinMode() const
+{
+ return myNormLMax;
+}
+
+/*!
+ Sets normalization mode to the global maximum by right Y axis
+*/
+void Plot2d_ViewFrame::setNormRMaxMode( bool mode, bool update )
+{
+ if ( myNormRMax == mode )
+ return;
+
+ myNormRMax = mode;
+ processFiltering(true);
+ if ( update )
+ fitAll();
+ emit vpNormRModeChanged();
+}
+
+/*!
+ Gets normalization mode to the global maximum by right Y axis
+*/
+bool Plot2d_ViewFrame::getNormRMaxMode() const
+{
+ return myNormRMax;
+}
+
+/*!
+ Sets normalization mode to the global minimum by right Y axis
+*/
+void Plot2d_ViewFrame::setNormRMinMode( bool mode, bool update )
+{
+ if ( myNormRMin == mode )
+ return;
+
+ myNormRMin = mode;
+ processFiltering(true);
+ if ( update )
+ fitAll();
+ emit vpNormRModeChanged();
+}
+
+/*!
+ Gets normalization mode to the global minimum by right Y axis
+*/
+bool Plot2d_ViewFrame::getNormRMinMode() const
+{
+ return myNormRMax;
+}
+
/*!
Return, scale mode for horizontal axis
*/
return (myYMode == 0 ? true : false);
}
+/*!
+ Return \c True if curves are normalize to the global maximum by left Y axis
+*/
+bool Plot2d_ViewFrame::isNormLMaxMode()
+{
+ return (myNormLMax ? true : false);
+}
+
+/*!
+ Return \c True if curves are normalize to the global minimum by left Y axis
+*/
+bool Plot2d_ViewFrame::isNormLMinMode()
+{
+ return (myNormLMin ? true : false);
+}
+
+/*!
+ Return \c True if curves are normalize to the global maximum by right Y axis
+*/
+bool Plot2d_ViewFrame::isNormRMaxMode()
+{
+ return (myNormRMax ? true : false);
+}
+
+/*!
+ Return \c True if curves are normalize to the global minimum by right Y axis
+*/
+bool Plot2d_ViewFrame::isNormRMinMode()
+{
+ return (myNormRMin ? true : false);
+}
+
/*!
Return \c True if legend is shown
*/
myPlot->replot();
}
+/*
+ Update plot item
+*/
+void Plot2d_ViewFrame::updatePlotItem(Plot2d_Object* theObject, QwtPlotItem* theItem) {
+ theObject->updatePlotItem( theItem );
+ Plot2d_Curve* c = dynamic_cast<Plot2d_Curve*>(theObject);
+ QwtPlotCurve* cu = dynamic_cast<QwtPlotCurve*>(theItem);
+ Plot2d_NormalizeAlgorithm* aNormAlgo;
+ if(c && cu) {
+ if(c->getYAxis() == QwtPlot::yRight)
+ aNormAlgo = myRNormAlgo;
+ else
+ aNormAlgo = myLNormAlgo;
+ if(aNormAlgo->getNormalizationMode() != Plot2d_NormalizeAlgorithm::NormalizeNone) {
+ AlgoPlot2dOutputData aResultData = aNormAlgo->getOutput();
+ AlgoPlot2dOutputData::iterator itTmp = aResultData.find(theObject);
+ double *xNew,*yNew;
+ int size = itTmp.value().size();
+ xNew = new double[size];
+ yNew = new double[size];
+ int j = 0;
+ for (; j < size; ++j) {
+ xNew[j] = itTmp.value().at(j).first;
+ yNew[j] = itTmp.value().at(j).second;
+ }
+ cu->setData(xNew, yNew,j);
+ delete xNew;
+ delete yNew;
+ if(aNormAlgo->getNormalizationMode() != Plot2d_NormalizeAlgorithm::NormalizeNone) {
+ QString name = c->getName().isEmpty() ? c->getVerTitle() : c->getName();
+ name = name + QString("(B=%1, K=%2)");
+ name = name.arg(aNormAlgo->getBkoef(c)).arg(aNormAlgo->getKkoef(c));
+ cu->setTitle(name);
+ }
+ }
+ }
+}
+
/**
*
*/
#ifndef DISABLE_PYCONSOLE
#include "Plot2d_AnaliticCurve.h"
#endif
+#include "Plot2d_NormalizeAlgorithm.h"
#include <QWidget>
#include <QMultiHash>
int getCurves( curveList& ) const;
CurveDict getCurves() const;
void updateCurve( Plot2d_Curve*, bool = false );
+ void processFiltering(bool = false);
/* objects operations */
void displayObject( Plot2d_Object*, bool = false );
int getHorScaleMode() const;
void setVerScaleMode( const int, bool = true );
int getVerScaleMode() const;
+ void setNormLMaxMode( bool, bool = true);
+ bool getNormLMaxMode()const;
+ void setNormLMinMode( bool, bool = true);
+ bool getNormLMinMode()const;
+ void setNormRMaxMode( bool, bool = true);
+ bool getNormRMaxMode()const;
+ void setNormRMinMode( bool, bool = true);
+ bool getNormRMinMode()const;
+
bool isModeHorLinear();
bool isModeVerLinear();
+ bool isNormLMaxMode();
+ bool isNormLMinMode();
+ bool isNormRMaxMode();
+ bool isNormRMinMode();
+
bool isLegendShow() const;
// Protection against QwtCurve::drawLines() bug in Qwt 0.4.x:
QwtPlotItem* getPlotObject( Plot2d_Object* ) const;
QwtPlotCurve* getPlotCurve( Plot2d_Curve* ) const;
Plot2d_Plot2d* getPlot() const { return myPlot; }
+
+ void updatePlotItem(Plot2d_Object*, QwtPlotItem*);
protected:
int testOperation( const QMouseEvent& );
void readPreferences();
signals:
void vpModeHorChanged();
void vpModeVerChanged();
+ void vpNormLModeChanged();
+ void vpNormRModeChanged();
void vpCurveChanged();
void contextMenuRequested( QContextMenuEvent* );
void legendClicked( QwtPlotItem* );
int myXGridMaxMajor, myYGridMaxMajor, myY2GridMaxMajor;
int myXGridMaxMinor, myYGridMaxMinor, myY2GridMaxMinor;
int myXMode, myYMode;
+ bool myNormLMin, myNormLMax, myNormRMin, myNormRMax;
double myXDistance, myYDistance, myYDistance2;
bool mySecondY;
ObjectDict myObjects;
#ifndef DISABLE_PYCONSOLE
AnaliticCurveList myAnaliticCurves;
#endif
+ Plot2d_NormalizeAlgorithm* myLNormAlgo;
+ Plot2d_NormalizeAlgorithm* myRNormAlgo;
bool myIsDefTitle;
};
connect( myViewFrame, SIGNAL( vpModeHorChanged() ), this, SLOT( onChangeHorMode() ) );
connect( myViewFrame, SIGNAL( vpModeVerChanged() ), this, SLOT( onChangeVerMode() ) );
+ connect( myViewFrame, SIGNAL( vpNormLModeChanged() ), this, SLOT( onChangeNormLMode() ) );
+ connect( myViewFrame, SIGNAL( vpNormRModeChanged() ), this, SLOT( onChangeNormRMode() ) );
connect( myViewFrame, SIGNAL( vpCurveChanged() ), this, SLOT( onChangeCurveMode() ) );
connect( myViewFrame, SIGNAL( contextMenuRequested( QContextMenuEvent* ) ),
this, SIGNAL( contextMenuRequested( QContextMenuEvent* ) ) );
curTypePopup->addAction( mgr->action( CurvLinesId ) );
curTypePopup->addAction( mgr->action( CurvSplinesId ) );
+ //Normalization type
+ QMenu* normTypePopup = thePopup->addMenu( tr( "NORMALIZATION_TYPE_POPUP" ) );
+ normTypePopup->addAction( mgr->action( PModeNormLMinId ) );
+ normTypePopup->addAction( mgr->action( PModeNormLMaxId ) );
+ normTypePopup->addSeparator();
+ normTypePopup->addAction( mgr->action( PModeNormRMinId ) );
+ normTypePopup->addAction( mgr->action( PModeNormRMaxId ) );
+
+
// legend
thePopup->addAction( mgr->action( LegendId ) );
aVerGroup->addAction( mgr->action( PModeYLinearId ) );
aVerGroup->addAction( mgr->action( PModeYLogarithmicId ) );
- // 7. Legend
+ // 7. Normalization mode operations
+
+ // 7.1. Normalize to the global minimum by left Y axis
+ aAction = new QtxAction( tr( "TOT_PLOT2D_NORMALIZE_MODE_LMIN" ),
+ aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_NORMALIZE_MODE_LMIN" ) ),
+ tr( "MEN_PLOT2D_NORMALIZE_MODE_LMIN" ),
+ 0, this );
+ aAction->setStatusTip( tr( "PRP_PLOT2D_NORMALIZE_MODE_LMIN" ) );
+ connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewNormLMode() ) );
+ aAction->setCheckable( true );
+ mgr->registerAction( aAction, PModeNormLMinId );
+
+ // 7.2. Normalize to the global maximum by right Y axis
+ aAction = new QtxAction( tr( "TOT_PLOT2D_NORMALIZE_MODE_LMAX" ),
+ aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_NORMALIZE_MODE_LMAX" ) ),
+ tr( "MEN_PLOT2D_NORMALIZE_MODE_LMAX" ),
+ 0, this );
+ aAction->setStatusTip( tr( "PRP_PLOT2D_NORMALIZE_MODE_LMAX" ) );
+ connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewNormLMode() ) );
+ aAction->setCheckable( true );
+ mgr->registerAction( aAction, PModeNormLMaxId );
+
+ // 7.3. Normalize to the global minimum by right Y axis
+ aAction = new QtxAction( tr( "TOT_PLOT2D_NORMALIZE_MODE_RMIN" ),
+ aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_NORMALIZE_MODE_RMIN" ) ),
+ tr( "MEN_PLOT2D_NORMALIZE_MODE_RMIN" ),
+ 0, this );
+ aAction->setStatusTip( tr( "PRP_PLOT2D_NORMALIZE_MODE_RMIN" ) );
+ connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewNormRMode() ) );
+ aAction->setCheckable( true );
+ mgr->registerAction( aAction, PModeNormRMinId );
+
+ // 7.4. Normalize to the global maximum by left Y axis
+ aAction = new QtxAction( tr( "TOT_PLOT2D_NORMALIZE_MODE_RMAX" ),
+ aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_NORMALIZE_MODE_RMAX" ) ),
+ tr( "MEN_PLOT2D_NORMALIZE_MODE_RMAX" ),
+ 0, this );
+ aAction->setStatusTip( tr( "PRP_PLOT2D_NORMALIZE_MODE_RMAX" ) );
+ connect( aAction, SIGNAL( triggered( bool ) ), this, SLOT( onViewNormRMode() ) );
+ aAction->setCheckable( true );
+ mgr->registerAction( aAction, PModeNormRMaxId );
+
+ // 8. Legend
aAction = new QtxAction( tr( "TOT_PLOT2D_SHOW_LEGEND" ),
aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_SHOW_LEGEND" ) ),
tr( "MEN_PLOT2D_SHOW_LEGEND" ),
aAction->setCheckable( true );
mgr->registerAction( aAction, LegendId );
- // 8. Settings
+ // 9. Settings
aAction = new QtxAction( tr( "TOT_PLOT2D_SETTINGS" ),
aResMgr->loadPixmap( "Plot2d", tr( "ICON_PLOT2D_SETTINGS" ) ),
tr( "MEN_PLOT2D_SETTINGS" ),
onChangeCurveMode();
onChangeHorMode();
onChangeVerMode();
+ onChangeNormLMode();
+ onChangeNormRMode();
onChangeLegendMode();
}
mgr->append( CurvLinesId, myToolBar );
mgr->append( CurvSplinesId, myToolBar );
mgr->append( toolMgr()->separator(), myToolBar );
+ mgr->append( PModeNormLMaxId, myToolBar );
+ mgr->append( PModeNormLMinId, myToolBar );
+ mgr->append( toolMgr()->separator(), myToolBar );
+ mgr->append( PModeNormRMaxId, myToolBar );
+ mgr->append( PModeNormRMinId, myToolBar );
+ mgr->append( toolMgr()->separator(), myToolBar );
mgr->append( PModeXLinearId, myToolBar );
mgr->append( PModeXLogarithmicId, myToolBar );
mgr->append( toolMgr()->separator(), myToolBar );
toolMgr()->action( GlobalPanId )->setEnabled( aHorLinear && aVerLinear );
}
+/*!
+ \brief Called when the normalization mode (by left Y axis) for curves is changed.
+*/
+void Plot2d_ViewWindow::onChangeNormLMode()
+{
+ bool aNormMax = myViewFrame->isNormLMaxMode();
+ bool aNormMin = myViewFrame->isNormLMinMode();
+
+ if ( aNormMax )
+ toolMgr()->action( PModeNormLMaxId )->setChecked( true );
+ else
+ toolMgr()->action( PModeNormLMaxId )->setChecked( false );
+ if ( aNormMin )
+ toolMgr()->action( PModeNormLMinId )->setChecked( true );
+ else
+ toolMgr()->action( PModeNormLMinId )->setChecked( false );
+}
+
+/*!
+ \brief Called when the normalization mode (by left Y axis) for curves is changed.
+*/
+void Plot2d_ViewWindow::onChangeNormRMode()
+{
+ bool aNormMax = myViewFrame->isNormRMaxMode();
+ bool aNormMin = myViewFrame->isNormRMinMode();
+
+ if ( aNormMax )
+ toolMgr()->action( PModeNormRMaxId )->setChecked( true );
+ else
+ toolMgr()->action( PModeNormRMaxId )->setChecked( false );
+ if ( aNormMin )
+ toolMgr()->action( PModeNormRMinId )->setChecked( true );
+ else
+ toolMgr()->action( PModeNormRMinId )->setChecked( false );
+}
+
/*!
\brief Called when the curve type is changed.
*/
myViewFrame->setVerScaleMode( toolMgr()->action( PModeYLinearId )->isChecked() ? 0 : 1 );
}
+/*!
+ \brief Called when normalization mode action (by left Y axis) is activated.
+*/
+
+void Plot2d_ViewWindow::onViewNormLMode()
+{
+ myViewFrame->setNormLMaxMode( toolMgr()->action( PModeNormLMaxId )->isChecked() ? true : false );
+ myViewFrame->setNormLMinMode( toolMgr()->action( PModeNormLMinId )->isChecked() ? true : false );
+}
+
+/*!
+ \brief Called when normalization mode action (by right Y axis) is activated.
+*/
+
+void Plot2d_ViewWindow::onViewNormRMode()
+{
+ myViewFrame->setNormRMaxMode( toolMgr()->action( PModeNormRMaxId )->isChecked() ? true : false );
+ myViewFrame->setNormRMinMode( toolMgr()->action( PModeNormRMinId )->isChecked() ? true : false );
+}
+
/*!
\brief Called when the "Show legend" action is activated.
*/
MoveOpId, PanId, GlobalPanId,
PModeXLinearId, PModeXLogarithmicId,
PModeYLinearId, PModeYLogarithmicId,
+ PModeNormLMaxId, PModeNormLMinId,
+ PModeNormRMaxId, PModeNormRMinId,
CurvPointsId, CurvLinesId, CurvSplinesId,
LegendId,
CurvSettingsId,
void onChangeVerMode();
void onChangeCurveMode();
void onChangeLegendMode();
+ void onChangeNormLMode();
+ void onChangeNormRMode();
+
void onFitAll();
void onFitRect();
void onGlobalPanning();
void onViewHorMode();
void onViewVerMode();
+ void onViewNormLMode();
+ void onViewNormRMode();
void onLegend();
void onCurves();