* \param VRow 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).
+ */
+ Curve CreateCurveWithZ( in Table theTable, in long theHRow, in long theVRow, in long theZRow );
/*!
* Creates a presentation form containing an array of references to the curves.
return myVisuGen->CreateCurve(theTable,theHRow,theVRow);
}
+ Curve_ptr VISU_Gen_i::CreateCurveWithZ(Table_ptr theTable,
+ CORBA::Long theHRow,
+ CORBA::Long theVRow,
+ CORBA::Long theZRow)
+ {
+ return myVisuGen->CreateCurveWithZ(theTable,theHRow,theVRow,theZRow);
+ }
+
Container_ptr VISU_Gen_i::CreateContainer(){
return myVisuGen->CreateContainer();
//Create Digital Presentation
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 Container_ptr CreateContainer();
virtual Animation_ptr CreateAnimation(View3D_ptr theView3d);
msgid "AXIS_LBL"
msgstr "Axis"
+msgid "ASSIGNED"
+msgstr "Assigned"
+
#: VisuGUI_SetupPlot2dDlg.cxx:69
msgid "DATA_LBL"
msgstr "Data"
// 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;
- QValueList<int> verIndices;
- dlg->getCurvesSource( horIndex, verIndices );
+ QValueList<int> verIndices, zIndices;
+ dlg->getCurvesSource( horIndex, verIndices, zIndices );
if ( horIndex >= 0 && verIndices.count() > 0 ) {
CORBA::Object_var aContainer = GetVisuGen(this)->CreateContainer();
if( !CORBA::is_nil( aContainer ) ) {
if ( pContainer ) {
for ( int i = 0; i < verIndices.count(); i++ ) {
CORBA::Object_var aNewCurve =
- GetVisuGen(this)->CreateCurve( table->_this(), horIndex+1, verIndices[i]+1 );
+ GetVisuGen(this)->CreateCurveWithZ( table->_this(), horIndex+1, verIndices[i]+1, zIndices[i]+1 );
if( !CORBA::is_nil( aNewCurve ) ) {
VISU::Curve_i* pCrv =
dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aNewCurve).in());
// 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;
- QValueList<int> verIndices;
- dlg->getCurvesSource( horIndex, verIndices );
+ QValueList<int> verIndices, zIndices;
+ dlg->getCurvesSource( horIndex, verIndices, zIndices );
if ( horIndex >= 0 && verIndices.count() > 0 ) {
CORBA::Object_var aTable = GetVisuGen(this)->CreateTable( SO->GetID().c_str() );
CORBA::Object_var aContainer = GetVisuGen(this)->CreateContainer();
if ( pContainer && pTable ) {
for ( int i = 0; i < verIndices.count(); i++ ) {
- CORBA::Object_var aNewCurve = GetVisuGen(this)->CreateCurve
- ( pTable->_this(), horIndex+1, verIndices[i]+1 );
+ CORBA::Object_var aNewCurve = GetVisuGen(this)->CreateCurveWithZ
+ ( pTable->_this(), horIndex+1, verIndices[i]+1, zIndices[i]+1 );
if( !CORBA::is_nil( aNewCurve ) ) {
VISU::Curve_i* pCrv = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aNewCurve).in());
if ( pCrv ) {
QFrame* lin;
QLabel* labAxis = new QLabel( tr( "AXIS_LBL" ), frame );
+ QLabel* labAssigned = new QLabel( tr( "ASSIGNED" ), frame );
QLabel* labData = new QLabel( tr( "DATA_LBL" ), frame );
QLabel* labUnit = new QLabel( tr( "UNITS_LBL" ), frame );
QLabel* labAttr = new QLabel( tr( "ATTRIBUTES_LBL" ), frame );
labAxis->setAlignment( AlignCenter );
+ labAssigned->setAlignment( AlignCenter );
labData->setAlignment( AlignCenter );
labUnit->setAlignment( AlignCenter );
labAttr->setAlignment( AlignCenter );
QFont font = labAxis->font(); font.setBold( true );
labAxis->setFont( font );
+ labAssigned->setFont( font );
labData->setFont( font );
labUnit->setFont( font );
labAttr->setFont( font );
frameLayout->addMultiCellWidget( labAxis, 0, 0, 0, 1 );
lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
frameLayout->addWidget( lin, 0, 2 );
- frameLayout->addWidget( labData, 0, 3 );
+
+ frameLayout->addWidget( labAssigned, 0, 3 );
lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
frameLayout->addWidget( lin, 0, 4 );
- frameLayout->addWidget( labUnit, 0, 5 );
+
+ frameLayout->addWidget( labData, 0, 5 );
lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
frameLayout->addWidget( lin, 0, 6 );
- frameLayout->addMultiCellWidget( labAttr, 0, 0, 7, 11 );
- frameLayout->setColStretch( 12, 5 );
+ frameLayout->addWidget( labUnit, 0, 7 );
+ lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
+ frameLayout->addWidget( lin, 0, 8 );
+ frameLayout->addMultiCellWidget( labAttr, 0, 0, 9, 13 );
+ frameLayout->setColStretch( 14, 5 );
lin = new QFrame( frame ); lin->setFrameStyle( QFrame::HLine | QFrame::Sunken );
- frameLayout->addMultiCellWidget( lin, 1, 1, 0, 12 );
+ frameLayout->addMultiCellWidget( lin, 1, 1, 0, 14 );
int row = 2;
_PTR(GenericAttribute) anAttr;
int nbRows = tblIntAttr->GetNbRows() ;
vector<string> rowTitles = tblIntAttr->GetRowTitles();
vector<string> rowUnits = tblIntAttr->GetRowUnits();
+ QStringList rows;
+ for ( int i = 0; i < nbRows; i++ )
+ rows.append( rowTitles[i] );
+
for ( int i = 0; i < nbRows; i++ ) {
VisuGUI_ItemContainer* item = new VisuGUI_ItemContainer( this );
- item->createWidgets( frame );
+ item->createWidgets( frame, rows );
frameLayout->addWidget( item->myHBtn, row, 0 );
frameLayout->addWidget( item->myVBtn, row, 1 );
- frameLayout->addWidget( item->myTitleLab, row, 3 );
+ frameLayout->addWidget( item->myAssigned, row, 3 );
+
+ frameLayout->addWidget( item->myTitleLab, row, 5 );
if ( rowTitles.size() > 0 )
item->myTitleLab->setText( QString( rowTitles[ i ].c_str() ) );
- frameLayout->addWidget( item->myUnitLab, row, 5 );
+ frameLayout->addWidget( item->myUnitLab, row, 7 );
if ( rowUnits.size() > 0 )
item->myUnitLab->setText( QString( rowUnits[ i ].c_str() ) );
- frameLayout->addWidget( item->myAutoCheck, row, 7 );
- frameLayout->addWidget( item->myLineCombo, row, 8 );
- frameLayout->addWidget( item->myLineSpin, row, 9 );
- frameLayout->addWidget( item->myMarkerCombo, row, 10 );
- frameLayout->addWidget( item->myColorBtn, row, 11 );
+ 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 );
connect( item, SIGNAL( horToggled( bool ) ), this, SLOT( onHBtnToggled( bool ) ) );
connect( item, SIGNAL( verToggled( bool ) ), this, SLOT( onVBtnToggled( bool ) ) );
myItems.append( item );
int nbRows = tblRealAttr->GetNbRows() ;
vector<string> rowTitles = tblRealAttr->GetRowTitles();
vector<string> rowUnits = tblRealAttr->GetRowUnits();
+ QStringList rows;
+ for ( int i = 0; i < nbRows; i++ )
+ rows.append( rowTitles[i] );
+
for ( int i = 0; i < nbRows; i++ ) {
VisuGUI_ItemContainer* item = new VisuGUI_ItemContainer( this );
- item->createWidgets( frame );
+ item->createWidgets( frame, rows );
frameLayout->addWidget( item->myHBtn, row, 0 );
frameLayout->addWidget( item->myVBtn, row, 1 );
- frameLayout->addWidget( item->myTitleLab, row, 3 );
+ frameLayout->addWidget( item->myAssigned, row, 3 );
+
+ frameLayout->addWidget( item->myTitleLab, row, 5 );
if ( rowTitles.size() > 0 )
item->myTitleLab->setText( QString( rowTitles[ i ].c_str() ) );
- frameLayout->addWidget( item->myUnitLab, row, 5 );
+ frameLayout->addWidget( item->myUnitLab, row, 7 );
if ( rowUnits.size() > 0 )
item->myUnitLab->setText( QString( rowUnits[ i ].c_str() ) );
- frameLayout->addWidget( item->myAutoCheck, row, 7 );
- frameLayout->addWidget( item->myLineCombo, row, 8 );
- frameLayout->addWidget( item->myLineSpin, row, 9 );
- frameLayout->addWidget( item->myMarkerCombo, row, 10 );
- frameLayout->addWidget( item->myColorBtn, row, 11 );
+ 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 );
connect( item, SIGNAL( horToggled( bool ) ), this, SLOT( onHBtnToggled( bool ) ) );
connect( item, SIGNAL( verToggled( bool ) ), this, SLOT( onVBtnToggled( bool ) ) );
myItems.append( item );
/*!
Gets curves info ( indexes of row data in the table for horizontal and verical axes )
*/
-void VisuGUI_SetupPlot2dDlg::getCurvesSource( int& horIndex, QValueList<int>& verIndexes )
+void VisuGUI_SetupPlot2dDlg::getCurvesSource( int& horIndex, QValueList<int>& verIndexes,
+ QValueList<int>& zIndices )
{
/* collecting horizontal and vertical axis items */
horIndex = -1;
}
else if ( myItems.at( i )->isVerticalOn() ) {
verIndexes.append( i );
+ zIndices.append( myItems.at( i )->assigned() );
}
+
}
}
/*!
/* collecting horizontal and vertical axis items */
int horIndex;
int i, j;
- QValueList<int> verIndex;
- getCurvesSource( horIndex, verIndex );
+ QValueList<int> verIndex, zIndices;
+ getCurvesSource( horIndex, verIndex, zIndices );
if ( horIndex < 0 || verIndex.isEmpty() ) /* no curves can be created */
return;
if ( nbPoints > 0 ) {
double* xList = new double[ nbPoints ];
double* yList = new double[ nbPoints ];
+ QStringList zList;
for ( j = 1; j <= nbCols; j++ ) {
if ( tblIntAttr->HasValue( horIndex+1, j ) && tblIntAttr->HasValue( verIndex[i]+1, j ) ) {
xList[j-1] = tblIntAttr->GetValue( horIndex +1, j );
yList[j-1] = tblIntAttr->GetValue( verIndex[i]+1, j );
+ zList.append( QString( "%1" ).arg( tblIntAttr->GetValue( zIndices[i]+1, j ) ) );
}
}
- curve->setData( xList, yList, nbPoints );
+ curve->setData( xList, yList, nbPoints, zList );
}
// curve attributes
curve->setLine( (Plot2d_Curve::LineType)myItems.at( verIndex[i] )->getLine(), myItems.at( verIndex[i] )->getLineWidth() );
if ( nbPoints > 0 ) {
double* xList = new double[ nbPoints ];
double* yList = new double[ nbPoints ];
+ QStringList zList;
for ( j = 1; j <= nbCols; j++ ) {
if ( tblRealAttr->HasValue( horIndex+1, j ) && tblRealAttr->HasValue( verIndex[i]+1, j ) ) {
xList[j-1] = tblRealAttr->GetValue( horIndex +1, j );
yList[j-1] = tblRealAttr->GetValue( verIndex[i]+1, j );
+ zList.append( QString( "%1" ).arg( tblIntAttr->GetValue( zIndices[i]+1, j ) ) );
}
}
- curve->setData( xList, yList, nbPoints );
+ curve->setData( xList, yList, nbPoints, zList );
}
// curve attributes
curve->setLine( (Plot2d_Curve::LineType)myItems.at( verIndex[i] )->getLine(), myItems.at( verIndex[i] )->getLineWidth() );
VisuGUI_ItemContainer* item = ( VisuGUI_ItemContainer* )sender();
QPtrList<VisuGUI_ItemContainer> itemList;
itemList.setAutoDelete( false );
+ item->myAssigned->setEnabled( on );
int i;
if ( on ) {
int totalOn = 0;
/*!
Creates widgets
*/
-void VisuGUI_ItemContainer::createWidgets( QWidget* parentWidget )
+void VisuGUI_ItemContainer::createWidgets( QWidget* parentWidget, const QStringList& lst )
{
myHBtn = new QToolButton( parentWidget );
myHBtn->setText( tr( "H" ) );
myColorBtn = new QToolButton( parentWidget );
myColorBtn->setMinimumWidth( 20 );
+
+ myAssigned = new QComboBox( false, parentWidget );
+ myAssigned->insertItem( "" );
+ QStringList::const_iterator anIt = lst.begin(), aLast = lst.end();
+ for( ; anIt!=aLast; anIt++ )
+ myAssigned->insertItem( *anIt );
+ myAssigned->setEnabled( false );
connect( myAutoCheck, SIGNAL( clicked() ), this, SLOT( onAutoChanged() ) );
connect( myColorBtn, SIGNAL( clicked() ), this, SLOT( onColorChanged() ) );
emit verToggled( on );
}
}
+
+/*!
+ \return index of assigned row (0, if there is no assigned row)
+*/
+int VisuGUI_ItemContainer::assigned() const
+{
+ if( isVerticalOn() )
+ return myAssigned->currentItem()-1;
+ else
+ return -1;
+}
~VisuGUI_SetupPlot2dDlg();
void getCurves( QPtrList<Plot2d_Curve>& container );
- void getCurvesSource( int& horIndex, QValueList<int>& verIndexes );
+ void getCurvesSource( int& horIndex, QValueList<int>& verIndexes, QValueList<int>& zIndexes );
bool getCurveAttributes( const int vIndex, bool& isAuto, int& marker, int& line, int& lineWidth, QColor& color);
private:
public:
VisuGUI_ItemContainer( QObject* parent = 0, const char* name = 0 );
- void createWidgets( QWidget* parentWidget );
+ void createWidgets( QWidget* parentWidget, const QStringList& );
void enableWidgets( bool enable );
void setHorizontalOn( bool on );
int getMarker() const;
void setColor( const QColor& color );
QColor getColor() const;
+ int assigned() const;
protected:
void updateState();
QCheckBox* myAutoCheck;
QComboBox* myLineCombo;
QSpinBox* myLineSpin;
- QComboBox* myMarkerCombo;
+ QComboBox* myMarkerCombo, *myAssigned;
QToolButton* myColorBtn;
};
plotCurve->setVerUnits( theCurve->GetVerUnits().c_str() );
double* xList = 0;
double* yList = 0;
- int nbPoints = theCurve->GetData( xList, yList );
+ QStringList zList;
+ int nbPoints = theCurve->GetData( xList, yList, zList );
if ( nbPoints > 0 && xList && yList ) {
- plotCurve->setData( xList, yList, nbPoints );
+ plotCurve->setData( xList, yList, nbPoints, zList );
}
if ( !theCurve->IsAuto() ) {
plotCurve->setLine( (Plot2d_Curve::LineType)theCurve->GetLine(), theCurve->GetLineWidth() );
case VISU::TCURVE:
if(Curve_i* aServant = dynamic_cast<Curve_i*>(GetServant(anObj).in()))
{
- theStr << thePrefix << "aName2ObjectMap['" << aName << "'] = visu.CreateCurve(" <<
+ bool withZ = aServant->GetZRow()>0;
+
+ theStr << thePrefix << "aName2ObjectMap['" << aName << "'] = visu.CreateCurve";
+ if( withZ )
+ theStr << "WithZ";
+ theStr << "(" <<
theArgumentName<< // table
","<<aServant->GetHRow()<< // H row
- ","<<aServant->GetVRow()<< // V row
- ",'"<<aServant->GetTitle()<<"'"; // title
+ ","<<aServant->GetVRow(); // V row
+ if( withZ )
+ theStr << "," << aServant->GetZRow(); // Z row
+
+ theStr << ",'"<<aServant->GetTitle()<<"'"; // title
SALOMEDS::Color aColor = aServant->GetColor();
theStr << ",SALOMEDS.Color("<<
aColor.R<<","<<aColor.G<<","<<aColor.B<<")"; // color
Curve_ptr VISU_Gen_i::CreateCurve(Table_ptr theTable,
CORBA::Long theHRow,
CORBA::Long theVRow)
+ {
+ return CreateCurveWithZ( theTable, theHRow, theVRow, 0 );
+ }
+
+ Curve_ptr VISU_Gen_i::CreateCurveWithZ(Table_ptr theTable,
+ CORBA::Long theHRow,
+ CORBA::Long theVRow,
+ CORBA::Long theZRow)
{
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);
+ Curve_i* pPresent = new Curve_i(myStudyDocument,pTable,theHRow,theVRow,theZRow);
if(pPresent->Create() != NULL)
return pPresent->_this();
else{
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
Container_ptr
Constructor
NB : theHRow, theVRow are the indexes of rows in the Table object and numbered from the 1 to GetNbRows()
*/
-VISU::Curve_i::Curve_i(SALOMEDS::Study_ptr theStudy, Table_i* theTable, CORBA::Long theHRow, CORBA::Long theVRow )
- : PrsObject_i(theStudy), myTable( theTable ), myHRow( theHRow ), myVRow( theVRow )
+VISU::Curve_i::Curve_i( SALOMEDS::Study_ptr theStudy, Table_i* theTable,
+ CORBA::Long theHRow, CORBA::Long theVRow,
+ CORBA::Long theZRow )
+: PrsObject_i(theStudy), myTable( theTable ), myHRow( theHRow ),
+ myVRow( theVRow ), myZRow( theZRow )
{
myAuto = true;
myLine = VISU::Curve::SOLIDLINE;
/*!
Gets curve data
*/
-int VISU::Curve_i::GetData( double*& theHorList, double*& theVerList )
+int VISU::Curve_i::GetData( double*& theHorList, double*& theVerList, QStringList& zList )
{
theHorList = 0; theVerList = 0;
// getting table SObject by it's entry
SALOMEDS::GenericAttribute_var anAttr;
SALOMEDS::AttributeTableOfInteger_var anInt;
SALOMEDS::AttributeTableOfReal_var aReal;
+
+ QString tip = "%1: %2", z_data;
+
if ( !SO->_is_nil() ) {
if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfInteger" ) ) {
anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr );
- int nbCols = anInt->GetNbColumns() ;
+ int nbCols = anInt->GetNbColumns(), nbRows = anInt->GetNbRows();
if ( nbCols > 0 && myHRow > 0 && myHRow <= anInt->GetNbRows() && myVRow > 0 && myVRow <= anInt->GetNbRows() ) {
int nbPoints = 0;
for ( int j = 1; j <= nbCols; j++ ) {
theHorList = new double[ nbPoints ];
theVerList = new double[ nbPoints ];
int k = 0;
+
+ SALOMEDS::StringSeq_var rowTitles = anInt->GetRowTitles();
+
for ( int j = 1; j <= nbCols; j++ ) {
if ( anInt->HasValue( myHRow, j ) && anInt->HasValue( myVRow, j ) ) {
theHorList[k] = anInt->GetValue( myHRow, j );
theVerList[k] = anInt->GetValue( myVRow, j );
+
+ z_data = tip.arg( GetHorTitle().c_str() ).arg( theHorList[k] ) + "\n";
+ z_data += tip.arg( GetVerTitle().c_str() ).arg( theVerList[k] );
+
+ if( myZRow>0 && myZRow<=nbRows && anInt->HasValue( myZRow, j ) )
+ {
+ string title;
+ title = rowTitles[ myZRow-1 ];
+ z_data += "\n" + tip.arg( title.c_str() ).arg( anInt->GetValue( myZRow, j ) );
+ }
+ zList.append( z_data );
k++;
}
}
}
else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) {
aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr );
- int nbCols = aReal->GetNbColumns() ;
+ int nbCols = aReal->GetNbColumns(), nbRows = aReal->GetNbRows();
if ( nbCols > 0 && myHRow > 0 && myHRow <= aReal->GetNbRows() && myVRow > 0 && myVRow <= aReal->GetNbRows() ) {
int nbPoints = 0;
for ( int j = 1; j <= nbCols; j++ ) {
theHorList = new double[ nbPoints ];
theVerList = new double[ nbPoints ];
int k = 0;
+
+ SALOMEDS::StringSeq_var rowTitles = aReal->GetRowTitles();
+
for ( int j = 1; j <= nbCols; j++ ) {
if ( aReal->HasValue( myHRow, j ) && aReal->HasValue( myVRow, j ) ) {
theHorList[k] = aReal->GetValue( myHRow, j );
theVerList[k] = aReal->GetValue( myVRow, j );
+
+ z_data = tip.arg( GetHorTitle().c_str() ).arg( theHorList[k] ) + "\n";
+ z_data += tip.arg( GetVerTitle().c_str() ).arg( theVerList[k] );
+
+ if( myZRow>0 && myZRow<=nbRows && aReal->HasValue( myZRow, j ) )
+ {
+ string title;
+ title = rowTitles[ myZRow-1 ];
+ z_data += "\n" + tip.arg( title.c_str() ).arg( aReal->GetValue( myZRow, j ) );
+ }
+ zList.append( z_data );
k++;
}
}
crv->setVerUnits( GetVerUnits().c_str() );
double* xList = 0;
double* yList = 0;
- int nbPoints = GetData( xList, yList );
+ QStringList zList;
+ int nbPoints = GetData( xList, yList, zList );
if ( nbPoints > 0 && xList && yList ) {
- crv->setData( xList, yList, nbPoints );
+ crv->setData( xList, yList, nbPoints, zList );
}
//cout << "********** Number of points: " << nbPoints <<endl;
//for ( int i =0 ; i < nbPoints; i++ ) {
myName = VISU::Storable::FindValue(theMap,"myName").latin1();
myHRow = VISU::Storable::FindValue(theMap,"myHRow").toInt();
myVRow = VISU::Storable::FindValue(theMap,"myVRow").toInt();
+ bool ok = false;
+ QString z_str = VISU::Storable::FindValue(theMap,"myZRow", &ok);
+ myZRow = ok ? z_str.toInt() : 0;
+
myColor.R = VISU::Storable::FindValue(theMap,"myColor.R").toDouble();
myColor.G = VISU::Storable::FindValue(theMap,"myColor.G").toDouble();
myColor.B = VISU::Storable::FindValue(theMap,"myColor.B").toDouble();
Storable::DataToStream( theStr, "myName", myName.c_str() );
Storable::DataToStream( theStr, "myHRow", myHRow );
Storable::DataToStream( theStr, "myVRow", myVRow );
+ Storable::DataToStream( theStr, "myZRow", myZRow );
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 );
+ VISU::Curve_i* pResent = new VISU::Curve_i( aStudy, pTable, 0, 0, 0 );
return pResent->Restore( theMap, theSObject);
}
return NULL;
Curve_i();
Curve_i( const Curve_i& );
public:
- Curve_i( SALOMEDS::Study_ptr theStudy, Table_i* theTable, CORBA::Long theHRow, CORBA::Long theVRow );
+ Curve_i( SALOMEDS::Study_ptr theStudy, Table_i* theTable,
+ CORBA::Long theHRow, CORBA::Long theVRow, CORBA::Long theZRow );
virtual ~Curve_i();
virtual VISU::VISUType GetType() { return VISU::TCURVE;};
Table_i* myTable;
int myHRow;
int myVRow;
+ int myZRow;
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;}
virtual Storable* Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr theSO);
virtual std::string GetVerTitle();
virtual std::string GetHorUnits();
virtual std::string GetVerUnits();
- virtual int GetData( double*& theHorList, double*& theVerList );
+ virtual int GetData( double*& theHorList, double*& theVerList, QStringList& );
virtual SPlot2d_Curve* CreatePresentation();
};
aSPlot2dC->setVerUnits( theCurve->GetVerUnits().c_str() );
double* xList = 0;
double* yList = 0;
- int nbPoints = theCurve->GetData( xList, yList );
+ QStringList zList;
+ int nbPoints = theCurve->GetData( xList, yList, zList );
if (nbPoints > 0 && xList && yList) {
- aSPlot2dC->setData( xList, yList, nbPoints );
+ aSPlot2dC->setData( xList, yList, nbPoints, zList );
}
if (!theCurve->IsAuto()) {
aSPlot2dC->setLine((Plot2d_Curve::LineType)theCurve->GetLine(),
aSPlot2dC->setVerUnits( theCurve->GetVerUnits().c_str() );
double* xList = 0;
double* yList = 0;
- int nbPoints = theCurve->GetData( xList, yList );
+ QStringList zList;
+ int nbPoints = theCurve->GetData( xList, yList, zList );
if ( nbPoints > 0 && xList && yList ) {
- aSPlot2dC->setData( xList, yList, nbPoints );
+ aSPlot2dC->setData( xList, yList, nbPoints, zList );
}
if ( !theCurve->IsAuto() ) {
aSPlot2dC->setLine((Plot2d_Curve::LineType)theCurve->GetLine(), theCurve->GetLineWidth());