<ul>
<li>\b H (horisontal) - the values of this column will correspond to
X-coordinates of the curve.</li>
-<li>\b V (vertical) - the values of this column will correspond to
-Y-coordinates of the curve.</li>
+<li>\b V (vertical left) - the values of this column will correspond to
+Y-coordinates of the curve to be attached to the left vertical axis of
+the Plot2d viewer.</li>
+<li>\b V2 (vertical right) - the values of this column will correspond to
+Y-coordinates of the curve to be attached to the right vertical axis of
+the Plot2d viewer.</li>
+\note If there are several curves attached both to left and right
+vertical axes, they will be indicated by the following icons in the
+legend:
+\image html axis_bottom_left.png
+<br>
+\image html axis_bottom_right.png
</ul>
The column \b Assigned allows to represent the values assigned to the
-points of the curve (possible for V-rows only). Any row, even
+points of the curve (possible for V- and V2-rows only). Any row, even
coinciding with the current or empty (no values assigned), can be
represented. All values are indicated with tool tips over the
corresponding curve points in the Plot2d viewer.
/*!
* Creates a curve on the basis of points, whose values are taken from the table.
* \param theTable Table containing the data for construction of curves.
- * \param HRow Index of the row in the table: abscissa of the point.
- * \param VRow Index of the row in the table: ordinate of the point.
+ * \param theHRow Index of the row in the table: abscissa of the point.
+ * \param theVRow Index of the row in the table: ordinate of the point.
*/
Curve CreateCurve(in Table theTable, in long theHRow, in long theVRow);
* Creates a curve on the basis of points, whose values are taken from the table.
* Each point has also assigned value, that will be shown as tooltip in Plot2d
* \param theTable Table containing the data for construction of curves.
- * \param HRow Index of the row in the table: abscissa of the point.
- * \param VRow Index of the row in the table: ordinate of the point.
- * \param ZRow Index of the row in the table: assigned value (so-called as Z).
+ * \param theHRow Index of the row in the table: abscissa of the point.
+ * \param theVRow Index of the row in the table: ordinate of the point.
+ * \param theZRow Index of the row in the table: assigned value (so-called as Z).
*/
Curve CreateCurveWithZ( in Table theTable, in long theHRow, in long theVRow, in long theZRow );
+ /*!
+ * Creates a curve on the basis of points, whose values are taken from the table.
+ * Each point has also assigned value, that will be shown as tooltip in Plot2d.
+ * The curve can be displayed using right axis of Plot2d view.
+ * \param theTable Table containing the data for construction of curves.
+ * \param theHRow Index of the row in the table: abscissa of the point.
+ * \param theVRow Index of the row in the table: ordinate of the point.
+ * \param theZRow Index of the row in the table: assigned value (so-called as Z).
+ * \param theIsV2 Flag allowed to display the curve using right axis of Plot2d view.
+ */
+ Curve CreateCurveWithZExt( in Table theTable, in long theHRow, in long theVRow, in long theZRow,
+ in boolean theIsV2 );
+
/*!
* Creates a presentation form containing an array of references to the curves.
*/
return myVisuGen->CreateCurveWithZ(theTable,theHRow,theVRow,theZRow);
}
+ Curve_ptr VISU_Gen_i::CreateCurveWithZExt(Table_ptr theTable,
+ CORBA::Long theHRow,
+ CORBA::Long theVRow,
+ CORBA::Long theZRow,
+ CORBA::Boolean theIsV2)
+ {
+ return myVisuGen->CreateCurveWithZExt(theTable,theHRow,theVRow,theZRow,theIsV2);
+ }
Container_ptr VISU_Gen_i::CreateContainer(){
return myVisuGen->CreateContainer();
virtual Table_ptr CreateTable(const char* theTableEntry);
virtual Curve_ptr CreateCurve(Table_ptr theTable, CORBA::Long theHRow, CORBA::Long theVRow);
virtual Curve_ptr CreateCurveWithZ(Table_ptr theTable, CORBA::Long theHRow, CORBA::Long theVRow, CORBA::Long theZRow);
+ virtual Curve_ptr CreateCurveWithZExt(Table_ptr theTable, CORBA::Long theHRow, CORBA::Long theVRow, CORBA::Long theZRow,
+ CORBA::Boolean theIsV2);
virtual Container_ptr CreateContainer();
virtual Animation_ptr CreateAnimation(View3D_ptr theView3d);
virtual Evolution_ptr CreateEvolution(XYPlot_ptr theXYPlot);
// if study is not locked - create new container, create curves and insert them
// into container, then plot container if current viewer is of VIEW_PLOT2D type
int horIndex;
- QList<int> verIndices, zIndices;
- aDlg->getCurvesSource( horIndex, verIndices, zIndices );
+ QList<int> verIndices, ver1Indices, ver2Indices, zIndices;
+ aDlg->getCurvesSource( horIndex, ver1Indices, ver2Indices, zIndices );
+ verIndices = ver1Indices + ver2Indices;
if( horIndex >= 0 && verIndices.count() > 0 ){
CORBA::Object_var aContainerObj = GetVisuGen(this)->CreateContainer();
if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainerObj).in())){
for( int i = 0; i < verIndices.count(); i++ ){
+ bool isV2 = ver2Indices.contains(verIndices[i]);
VISU::Curve_var aCurveObject =
- GetVisuGen(this)->CreateCurveWithZ(aTable->_this(), horIndex+1, verIndices[i]+1, zIndices[i]+1 );
+ GetVisuGen(this)->CreateCurveWithZExt(aTable->_this(), horIndex+1, verIndices[i]+1, zIndices[i]+1, isV2 );
if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurveObject).in())){
bool isAuto;
int marker, line, lineWidth;
// if study is not locked - create new table and container objects, create curves
// and insert them into container, then plot container if current viewer is of VIEW_PLOT2D type
int horIndex;
- QList<int> verIndices, zIndices;
- aDlg->getCurvesSource( horIndex, verIndices, zIndices );
+ QList<int> verIndices, ver1Indices, ver2Indices, zIndices;
+ aDlg->getCurvesSource( horIndex, verIndices, ver2Indices, zIndices );
+ verIndices = ver1Indices + ver2Indices;
if ( horIndex >= 0 && verIndices.count() > 0 ) {
VISU::Table_var aTableObject = GetVisuGen(this)->CreateTable(aSObject->GetID().c_str());
if(!CORBA::is_nil(aTableObject)){
VISU::Container_var aContainerObject = GetVisuGen(this)->CreateContainer();
VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainerObject).in());
for ( int i = 0; i < verIndices.count(); i++ ) {
- VISU::Curve_var aCurveObject = GetVisuGen(this)->CreateCurveWithZ
- ( aTableObject, horIndex+1, verIndices[i]+1, zIndices[i]+1 );
+ bool isV2 = ver2Indices.contains(verIndices[i]);
+ VISU::Curve_var aCurveObject = GetVisuGen(this)->CreateCurveWithZExt
+ ( aTableObject, horIndex+1, verIndices[i]+1, zIndices[i]+1, isV2 );
if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurveObject).in())){
bool isAuto;
int marker, line, lineWidth;
labUnit->setFont( font );
labAttr->setFont( font );
- frameLayout->addWidget( labAxis, 0, 0, 1, 2 );
+ frameLayout->addWidget( labAxis, 0, 0, 1, 3 );
lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
- frameLayout->addWidget( lin, 0, 2 );
+ frameLayout->addWidget( lin, 0, 3 );
- frameLayout->addWidget( labAssigned, 0, 3 );
+ frameLayout->addWidget( labAssigned, 0, 4 );
lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
- frameLayout->addWidget( lin, 0, 4 );
+ frameLayout->addWidget( lin, 0, 5 );
- frameLayout->addWidget( labData, 0, 5 );
+ frameLayout->addWidget( labData, 0, 6 );
lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
- frameLayout->addWidget( lin, 0, 6 );
- frameLayout->addWidget( labUnit, 0, 7 );
+ frameLayout->addWidget( lin, 0, 7 );
+ frameLayout->addWidget( labUnit, 0, 8 );
lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
- frameLayout->addWidget( lin, 0, 8 );
- frameLayout->addWidget( labAttr, 0, 9, 1, 5 );
- //frameLayout->setColStretch( 14, 5 );
+ frameLayout->addWidget( lin, 0, 9 );
+ frameLayout->addWidget( labAttr, 0, 10, 1, 5 );
+ //frameLayout->setColStretch( 15, 5 );
lin = new QFrame( frame ); lin->setFrameStyle( QFrame::HLine | QFrame::Sunken );
- frameLayout->addWidget( lin, 1, 0, 1, 15 );
+ frameLayout->addWidget( lin, 1, 0, 1, 16 );
int row = 2;
_PTR(GenericAttribute) anAttr;
item->createWidgets( frame, rows );
frameLayout->addWidget( item->myHBtn, row, 0 );
frameLayout->addWidget( item->myVBtn, row, 1 );
- frameLayout->addWidget( item->myAssigned, row, 3 );
+ frameLayout->addWidget( item->myV2Btn, row, 2 );
+ frameLayout->addWidget( item->myAssigned, row, 4 );
- frameLayout->addWidget( item->myTitleLab, row, 5 );
+ frameLayout->addWidget( item->myTitleLab, row, 6 );
if ( rowTitles.size() > 0 )
item->myTitleLab->setText( QString( rowTitles[ i ].c_str() ) );
- frameLayout->addWidget( item->myUnitLab, row, 7 );
+ frameLayout->addWidget( item->myUnitLab, row, 8 );
if ( rowUnits.size() > 0 )
item->myUnitLab->setText( QString( rowUnits[ i ].c_str() ) );
- frameLayout->addWidget( item->myAutoCheck, row, 9 );
- frameLayout->addWidget( item->myLineCombo, row, 10 );
- frameLayout->addWidget( item->myLineSpin, row, 11 );
- frameLayout->addWidget( item->myMarkerCombo, row, 12 );
- frameLayout->addWidget( item->myColorBtn, row, 13 );
+ frameLayout->addWidget( item->myAutoCheck, row, 10 );
+ frameLayout->addWidget( item->myLineCombo, row, 11 );
+ frameLayout->addWidget( item->myLineSpin, row, 12 );
+ frameLayout->addWidget( item->myMarkerCombo, row, 13 );
+ frameLayout->addWidget( item->myColorBtn, row, 14 );
connect( item, SIGNAL( horToggled( bool ) ), this, SLOT( onHBtnToggled( bool ) ) );
connect( item, SIGNAL( verToggled( bool ) ), this, SLOT( onVBtnToggled( bool ) ) );
+ connect( item, SIGNAL( ver2Toggled( bool ) ), this, SLOT( onV2BtnToggled( bool ) ) );
myItems.append( item );
row++;
}
item->createWidgets( frame, rows );
frameLayout->addWidget( item->myHBtn, row, 0 );
frameLayout->addWidget( item->myVBtn, row, 1 );
- frameLayout->addWidget( item->myAssigned, row, 3 );
+ frameLayout->addWidget( item->myV2Btn, row, 2 );
+ frameLayout->addWidget( item->myAssigned, row, 4 );
- frameLayout->addWidget( item->myTitleLab, row, 5 );
+ frameLayout->addWidget( item->myTitleLab, row, 6 );
if ( rowTitles.size() > 0 )
item->myTitleLab->setText( QString( rowTitles[ i ].c_str() ) );
- frameLayout->addWidget( item->myUnitLab, row, 7 );
+ frameLayout->addWidget( item->myUnitLab, row, 8 );
if ( rowUnits.size() > 0 )
item->myUnitLab->setText( QString( rowUnits[ i ].c_str() ) );
- frameLayout->addWidget( item->myAutoCheck, row, 9 );
- frameLayout->addWidget( item->myLineCombo, row, 10 );
- frameLayout->addWidget( item->myLineSpin, row, 11 );
- frameLayout->addWidget( item->myMarkerCombo, row, 12 );
- frameLayout->addWidget( item->myColorBtn, row, 13 );
+ frameLayout->addWidget( item->myAutoCheck, row, 10 );
+ frameLayout->addWidget( item->myLineCombo, row, 11 );
+ frameLayout->addWidget( item->myLineSpin, row, 12 );
+ frameLayout->addWidget( item->myMarkerCombo, row, 13 );
+ frameLayout->addWidget( item->myColorBtn, row, 14 );
connect( item, SIGNAL( horToggled( bool ) ), this, SLOT( onHBtnToggled( bool ) ) );
connect( item, SIGNAL( verToggled( bool ) ), this, SLOT( onVBtnToggled( bool ) ) );
+ connect( item, SIGNAL( ver2Toggled( bool ) ), this, SLOT( onV2BtnToggled( bool ) ) );
myItems.append( item );
row++;
}
}
}
lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
- frameLayout->addWidget( lin, 2, 2, row, 1 );
+ frameLayout->addWidget( lin, 2, 3, row, 1 );
lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
- frameLayout->addWidget( lin, 2, 4, row, 1 );
+ frameLayout->addWidget( lin, 2, 5, row, 1 );
lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
- frameLayout->addWidget( lin, 2, 6, row, 1 );
+ frameLayout->addWidget( lin, 2, 7, row, 1 );
//frameLayout->setRowStretch( row+1, 5 );
myView->setWidget( frame );
Gets curves info ( indexes of row data in the table for horizontal and verical axes )
*/
void VisuGUI_SetupPlot2dDlg::getCurvesSource( int& horIndex, QList<int>& verIndexes,
- QList<int>& zIndices )
+ QList<int>& ver2Indexes, QList<int>& zIndices )
{
/* collecting horizontal and vertical axis items */
horIndex = -1;
if ( myItems.at( i )->isHorizontalOn() ) {
horIndex = i;
}
- else if ( myItems.at( i )->isVerticalOn() ) {
- verIndexes.append( i );
+ else {
+ if ( myItems.at( i )->isVerticalOn() ) {
+ verIndexes.append( i );
+ }
+ else if ( myItems.at( i )->isVertical2On() ) {
+ ver2Indexes.append( i );
+ }
zIndices.append( myItems.at( i )->assigned() );
}
-
}
}
/*!
/* collecting horizontal and vertical axis items */
int horIndex;
int i, j;
- QList<int> verIndex, zIndices;
- getCurvesSource( horIndex, verIndex, zIndices );
- if ( horIndex < 0 || verIndex.isEmpty() ) /* no curves can be created */
+ QList<int> verIndex, ver2Index, zIndices;
+ getCurvesSource( horIndex, verIndex, ver2Index, zIndices );
+ if ( horIndex < 0 || verIndex.isEmpty() && ver2Index.isEmpty() ) /* no curves can be created */
return;
/* Try table of integer */
}
enableControls();
}
+/*!
+ Slot, called when any <V2> button is clicked
+*/
+void VisuGUI_SetupPlot2dDlg::onV2BtnToggled( bool on )
+{
+ VisuGUI_ItemContainer* item = ( VisuGUI_ItemContainer* )sender();
+ QList<VisuGUI_ItemContainer*> itemList;
+ //itemList.setAutoDelete( false );
+ item->myAssigned->setEnabled( on );
+ int i;
+ if ( on ) {
+ int totalOn = 0;
+ for ( i = 0; i < myItems.count(); i++ ) {
+ if ( myItems.at( i ) != item && !myItems.at( i )->isHorizontalOn() ) {
+ if ( myItems.at( i )->myUnitLab->text() == item->myUnitLab->text() ) {
+ if ( myItems.at( i )->isVertical2On() )
+ totalOn++;
+ else
+ itemList.append( myItems.at( i ) );
+ }
+ else {
+ myItems.at( i )->setVertical2On( false );
+ }
+ }
+ }
+ if ( totalOn == 0 && !itemList.isEmpty() &&
+ SUIT_MessageBox::information( this,
+ this->windowTitle(),
+ tr( "QUE_WANT_SAME_UNITS" ),
+ tr( "BUT_YES" ),
+ tr( "BUT_NO" ),
+ 1, 1 ) == 0 )
+ {
+ for ( i = 0; i < itemList.count(); i++ ) {
+ itemList.at( i )->blockSignals( true );
+ itemList.at( i )->setVertical2On( true );
+ itemList.at( i )->blockSignals( false );
+ }
+ }
+ }
+ enableControls();
+}
/*!
Slot, called when <Help> button is clicked
*/
}
}
for ( int i = 0; i < myItems.count(); i++ ) {
- if ( myItems.at( i )->isVerticalOn() )
+ bool isVOn = myItems.at( i )->isVerticalOn() || myItems.at( i )->isVertical2On();
+ if ( isVOn )
bVSet = true;
- myItems.at( i )->enableWidgets( bHSet && myItems.at( i )->isVerticalOn() );
+ myItems.at( i )->enableWidgets( bHSet && isVOn );
}
myOkBtn->setEnabled( bHSet && bVSet );
}
myVBtn->setCheckable( true );
myVBtn->setChecked( false );
+ myV2Btn = new QToolButton( parentWidget );
+ myV2Btn->setText( tr( "V2" ) );
+ myV2Btn->setCheckable( true );
+ myV2Btn->setChecked( false );
+
myTitleLab = new QLabel( parentWidget );
myUnitLab = new QLabel( parentWidget );
myUnitLab->setAlignment( Qt::AlignCenter);
//connect( myColorBtn, SIGNAL( clicked() ), this, SLOT( onColorChanged() ) );
connect( myHBtn, SIGNAL( toggled( bool ) ), this, SLOT( onHVToggled( bool ) ) );
connect( myVBtn, SIGNAL( toggled( bool ) ), this, SLOT( onHVToggled( bool ) ) );
+ connect( myV2Btn, SIGNAL( toggled( bool ) ), this, SLOT( onHVToggled( bool ) ) );
setColor( QColor( 0, 0, 0 ) );
updateState();
}
return myHBtn->isChecked();
}
/*!
- Sets vertical button's state on
+ Sets first vertical button's state on
*/
void VisuGUI_ItemContainer::setVerticalOn( bool on )
{
myVBtn->setChecked( on );
}
/*!
- Gets vertical button's state
+ Gets first vertical button's state
*/
bool VisuGUI_ItemContainer::isVerticalOn() const
{
return myVBtn->isChecked();
}
+/*!
+ Sets second vertical button's state on
+*/
+void VisuGUI_ItemContainer::setVertical2On( bool on )
+{
+ myV2Btn->setChecked( on );
+}
+/*!
+ Gets second vertical button's state
+*/
+bool VisuGUI_ItemContainer::isVertical2On() const
+{
+ return myV2Btn->isChecked();
+}
/*!
Sets item AutoAssign flag state
*/
if ( myVBtn->isChecked() ) {
// blockSignals( true );
myVBtn->setChecked( false );
+// blockSignals( false );
+ }
+ else if ( myV2Btn->isChecked() ) {
+// blockSignals( true );
+ myV2Btn->setChecked( false );
// blockSignals( false );
}
}
emit horToggled( on );
}
- else {
+ else if ( snd == myVBtn ) {
if ( on ) {
if ( myHBtn->isChecked() ) {
// blockSignals( true );
myHBtn->setChecked( false );
+// blockSignals( false );
+ }
+ else if ( myV2Btn->isChecked() ) {
+// blockSignals( true );
+ myV2Btn->setChecked( false );
// blockSignals( false );
}
}
emit verToggled( on );
}
+ else {
+ if ( on ) {
+ if ( myHBtn->isChecked() ) {
+// blockSignals( true );
+ myHBtn->setChecked( false );
+// blockSignals( false );
+ }
+ else if ( myVBtn->isChecked() ) {
+// blockSignals( true );
+ myVBtn->setChecked( false );
+// blockSignals( false );
+ }
+ }
+ emit ver2Toggled( on );
+ }
}
/*!
*/
int VisuGUI_ItemContainer::assigned() const
{
- if( isVerticalOn() )
+ if( isVerticalOn() || isVertical2On() )
return myAssigned->currentIndex()-1;
else
return -1;
~VisuGUI_SetupPlot2dDlg();
void getCurves( QList<Plot2d_Curve*>& container );
- void getCurvesSource( int& horIndex, QList<int>& verIndexes, QList<int>& zIndexes );
+ void getCurvesSource( int& horIndex, QList<int>& verIndexes, QList<int>& ver2Indexes, QList<int>& zIndexes );
bool getCurveAttributes( const int vIndex, bool& isAuto, int& marker, int& line, int& lineWidth, QColor& color);
private:
private slots:
void onHBtnToggled( bool );
void onVBtnToggled( bool );
+ void onV2BtnToggled( bool );
void onHelp();
void enableControls();
bool isHorizontalOn() const;
void setVerticalOn( bool on );
bool isVerticalOn() const;
+ void setVertical2On( bool on );
+ bool isVertical2On() const;
bool isAutoAssign() const;
void setAutoAssign( bool on );
void setLine( const int line, const int width );
void autoClicked();
void horToggled( bool );
void verToggled( bool );
+ void ver2Toggled( bool );
public slots:
void onAutoChanged();
bool myEnabled;
QToolButton* myHBtn;
QToolButton* myVBtn;
+ QToolButton* myV2Btn;
QLabel* myTitleLab;
QLabel* myUnitLab;
QCheckBox* myAutoCheck;
if(Curve_i* aServant = dynamic_cast<Curve_i*>(GetServant(anObj).in()))
{
bool withZ = aServant->GetZRow()>0;
+ bool isV2 = aServant->GetIsV2();
theStr << thePrefix << "aName2ObjectMap['" << aName << "'] = visu.CreateCurve";
- if( withZ )
+ if( isV2 )
+ theStr << "WithZExt";
+ else if( withZ )
theStr << "WithZ";
theStr << "(" <<
theArgumentName<< // table
- ", "<<aServant->GetHRow()<< // H row
- ", "<<aServant->GetVRow(); // V row
- if( withZ )
+ ", "<<aServant->GetHRow()<< // H row
+ ", "<<aServant->GetVRow(); // V row
+ if( withZ || isV2 )
theStr << ", " << aServant->GetZRow(); // Z row
+ if( isV2 )
+ theStr << ", " << aServant->GetIsV2(); // right axis
theStr << ", '"<<aServant->GetTitle()<<"'"; // title
SALOMEDS::Color aColor = aServant->GetColor();
CORBA::Long theHRow,
CORBA::Long theVRow)
{
- return CreateCurveWithZ( theTable, theHRow, theVRow, 0 );
+ return CreateCurveWithZExt( theTable, theHRow, theVRow, 0, false );
}
CORBA::Long theHRow,
CORBA::Long theVRow,
CORBA::Long theZRow)
+ {
+ return CreateCurveWithZExt( theTable, theHRow, theVRow, theZRow, false );
+ }
+
+
+ //---------------------------------------------------------------
+ Curve_ptr
+ VISU_Gen_i
+ ::CreateCurveWithZExt(Table_ptr theTable,
+ CORBA::Long theHRow,
+ CORBA::Long theVRow,
+ CORBA::Long theZRow,
+ CORBA::Boolean theIsV2)
{
if(myStudyDocument->GetProperties()->IsLocked())
return Curve::_nil();
Mutex mt(myMutex);
PortableServer::POA_ptr aPOA = GetPOA();
Table_i* pTable = dynamic_cast<Table_i*>(aPOA->reference_to_servant(theTable));
- Curve_i* pPresent = new Curve_i(myStudyDocument,pTable,theHRow,theVRow,theZRow);
+ Curve_i* pPresent = new Curve_i(myStudyDocument,pTable,theHRow,theVRow,theZRow,theIsV2);
if(pPresent->Create() != NULL)
return pPresent->_this();
else{
}
-
//---------------------------------------------------------------
Container_ptr
VISU_Gen_i
CreateCurve(Table_ptr theTable,
CORBA::Long theHRow,
CORBA::Long theVRow);
+
virtual
Curve_ptr
CreateCurveWithZ(Table_ptr theTable,
- CORBA::Long theHRow,
- CORBA::Long theVRow,
- CORBA::Long theZRow);
+ CORBA::Long theHRow,
+ CORBA::Long theVRow,
+ CORBA::Long theZRow);
+
+ virtual
+ Curve_ptr
+ CreateCurveWithZExt(Table_ptr theTable,
+ CORBA::Long theHRow,
+ CORBA::Long theVRow,
+ CORBA::Long theZRow,
+ CORBA::Boolean theIsV2);
virtual
Container_ptr
*/
VISU::Curve_i::Curve_i( SALOMEDS::Study_ptr theStudy, Table_i* theTable,
CORBA::Long theHRow, CORBA::Long theVRow,
- CORBA::Long theZRow )
+ CORBA::Long theZRow, CORBA::Boolean theIsV2 )
: PrsObject_i(theStudy), myTable( theTable ), myHRow( theHRow ),
- myVRow( theVRow ), myZRow( theZRow )
+ myVRow( theVRow ), myZRow( theZRow ), myIsV2( theIsV2 )
{
myAuto = true;
myLine = VISU::Curve::SOLIDLINE;
SPlot2d_Curve* VISU::Curve_i::CreatePresentation()
{
SPlot2d_Curve* crv = new SPlot2d_Curve();
+ crv->setYAxis( myIsV2 ? QwtPlot::yRight : QwtPlot::yLeft );
crv->setHorTitle( GetHorTitle().c_str() );
string tlt = GetTitle();
if ( tlt.length() <= 0 )
bool ok = false;
QString z_str = VISU::Storable::FindValue(theMap,"myZRow", &ok);
myZRow = ok ? z_str.toInt() : 0;
+ ok = false;
+ QString v2_str = VISU::Storable::FindValue(theMap,"myIsV2", &ok);
+ myIsV2 = ok ? v2_str.toInt() : false;
myColor.R = VISU::Storable::FindValue(theMap,"myColor.R").toDouble();
myColor.G = VISU::Storable::FindValue(theMap,"myColor.G").toDouble();
Storable::DataToStream( theStr, "myHRow", myHRow );
Storable::DataToStream( theStr, "myVRow", myVRow );
Storable::DataToStream( theStr, "myZRow", myZRow );
+ Storable::DataToStream( theStr, "myIsV2", myIsV2 );
Storable::DataToStream( theStr, "myColor.R", myColor.R );
Storable::DataToStream( theStr, "myColor.G", myColor.G );
Storable::DataToStream( theStr, "myColor.B", myColor.B );
SALOMEDS::Study_var aStudy = theSObject->GetStudy();
VISU::Table_i* pTable = GetTable(aStudy, theSObject->GetFather());
if( pTable != NULL ) {
- VISU::Curve_i* pResent = new VISU::Curve_i( aStudy, pTable, 0, 0, 0 );
+ VISU::Curve_i* pResent = new VISU::Curve_i( aStudy, pTable, 0, 0, 0, false );
return pResent->Restore( theMap, theSObject);
}
return NULL;
Curve_i( const Curve_i& );
public:
Curve_i( SALOMEDS::Study_ptr theStudy, Table_i* theTable,
- CORBA::Long theHRow, CORBA::Long theVRow, CORBA::Long theZRow );
+ CORBA::Long theHRow, CORBA::Long theVRow, CORBA::Long theZRow,
+ CORBA::Boolean theIsV2 );
virtual ~Curve_i();
virtual VISU::VISUType GetType() { return VISU::TCURVE;};
int myHRow;
int myVRow;
int myZRow;
+ bool myIsV2;
struct SALOMEDS::Color myColor;
VISU::Curve::MarkerType myMarker;
VISU::Curve::LineType myLine;
int GetHRow() const { return myHRow;}
int GetVRow() const { return myVRow;}
int GetZRow() const { return myZRow;}
+ int GetIsV2() const { return myIsV2;}
virtual Storable* Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr theSO);
visu_succcessive_animation.py visu_apply_properties.py visu_apply_properties_successive.py \
batchmode_visu_view.py visu_cache.py visu_pointmap3d.py visu_view3d_parameters.py visu_evolution.py \
VISU_Example_01.py VISU_Example_02.py VISU_Example_03.py VISU_Example_04.py \
- VISU_Example_05.py VISU_Example_06.py VISU_Example_07.py VISU_Example_08.py
+ VISU_Example_05.py VISU_Example_06.py VISU_Example_07.py VISU_Example_08.py \
+ VISU_Example_09.py
nodist_salomescript_DATA = libVISU_Swig.py
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Displaying curves attached to different Y axes of Plot2d view
+#
+import salome
+import time
+import SALOMEDS
+import VISU
+
+sleep_delay = 1
+
+# >>> Getting study builder
+myStudy = salome.myStudy
+myBuilder = myStudy.NewBuilder()
+
+# >>> Getting (loading) VISU component
+myVisu = salome.lcc.FindOrLoadComponent("FactoryServer", "VISU")
+myComponent = myStudy.FindComponent("VISU")
+myVisu.SetCurrentStudy(myStudy)
+if not myComponent:
+ myComponent = myBuilder.NewComponent("VISU")
+ aName = myBuilder.FindOrCreateAttribute(myComponent, "AttributeName")
+ aName.SetValue( salome.sg.getComponentUserName("VISU") )
+
+ A2 = myBuilder.FindOrCreateAttribute(myComponent, "AttributePixMap");
+ aPixmap = A2._narrow(SALOMEDS.AttributePixMap);
+ aPixmap.SetPixMap( "ICON_OBJBROWSER_Visu" );
+
+ myBuilder.DefineComponentInstance(myComponent,myVisu)
+
+# >>> Creating object with Table
+aTableObject = myBuilder.NewObject(myComponent)
+aTableName = myBuilder.FindOrCreateAttribute(aTableObject, "AttributeName")
+aTableName.SetValue("TestTable")
+aTable = myBuilder.FindOrCreateAttribute(aTableObject, "AttributeTableOfReal")
+
+aTable.AddRow([0,1,2,3,4,5,6,7,8,9,10])
+aTable.AddRow([2000,1900,1800,1700,1600,1500,1400,1300,1200,1100,1000])
+aTable.AddRow([1.0,1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.5,6.0])
+aTable.SetTitle("Test table")
+aTable.SetRowTitle(1,"Time")
+aTable.SetRowUnit(1,"s")
+aTable.SetRowTitle(2,"Mass")
+aTable.SetRowUnit(2,"kg")
+aTable.SetRowTitle(3,"Temperature")
+aTable.SetRowUnit(3,"K")
+
+# >>> Create table of integer
+aVisuTable = myVisu.CreateTable(aTableObject.GetID())
+
+# >>> Create curve attached to the left axis
+aCurve1 = myVisu.CreateCurveWithZExt(aVisuTable, 1, 2, 0, False)
+
+# >>> Create curve attached to the right axis
+aCurve2 = myVisu.CreateCurveWithZExt(aVisuTable, 1, 3, 1, True)
+
+# >>> Create container and insert curves
+aContainer = myVisu.CreateContainer()
+aContainer.AddCurve(aCurve1)
+aContainer.AddCurve(aCurve2)
+
+# >>> Create XY plot and display container
+myViewManager = myVisu.GetViewManager();
+myView = myViewManager.CreateXYPlot();
+myView.SetTitle("The viewer for curves")
+myView.Display(aContainer)
+
+# >>> Update Object Browser
+salome.sg.updateObjBrowser(1)
curve.SetLine( theLineType, theLineWidth )
pass
return curve
+
+def CreateCurveWithZ( theTable, theHRow, theVRow, theZRow, theTitle, theColor, theMarker, theLineType, theLineWidth ):
+ if theTitle is None: return
+ curve = myLocalVisu.CreateCurveWithZ( theTable, theHRow, theVRow, theZRow );
+ if curve:
+ curve.SetTitle( theTitle )
+ curve.SetColor( theColor )
+ curve.SetMarker( theMarker )
+ curve.SetLine( theLineType, theLineWidth )
+ pass
+ return curve
+
+def CreateCurveWithZExt( theTable, theHRow, theVRow, theZRow, theIsV2, theTitle, theColor, theMarker, theLineType, theLineWidth ):
+ if theTitle is None: return
+ curve = myLocalVisu.CreateCurveWithZExt( theTable, theHRow, theVRow, theZRow, theIsV2 );
+ if curve:
+ curve.SetTitle( theTitle )
+ curve.SetColor( theColor )
+ curve.SetMarker( theMarker )
+ curve.SetLine( theLineType, theLineWidth )
+ pass
+ return curve