thplot-cvs Mailing List for thplot (Page 2)
Status: Pre-Alpha
Brought to you by:
apeden
You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(26) |
Jul
(34) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|---|
|
From: Tony P. <ap...@us...> - 2002-07-03 13:24:53
|
Update of /cvsroot/thplot/thplot/src/Gui
In directory usw-pr-cvs1:/tmp/cvs-serv24168/src/Gui
Modified Files:
ParameterSelect.cpp ParameterSelect.h
Log Message:
Allow multiple selection in available and dependents lists, do duplicate seleciton checking.
Index: ParameterSelect.cpp
===================================================================
RCS file: /cvsroot/thplot/thplot/src/Gui/ParameterSelect.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** ParameterSelect.cpp 2 Jul 2002 17:21:44 -0000 1.3
--- ParameterSelect.cpp 3 Jul 2002 13:24:50 -0000 1.4
***************
*** 55,58 ****
--- 55,59 ----
run=true;
dep_names.clear();
+ dup_check.clear();
ind_name = "";
selected=false;
***************
*** 81,85 ****
avbox->align(FL_ALIGN_TOP|FL_ALIGN_INSIDE|FL_ALIGN_LEFT);
! available = new Fl_Select_Browser( avbox->x()+offset,
avbox->y()+line_height,
avbox->w()-2*offset,
--- 82,86 ----
avbox->align(FL_ALIGN_TOP|FL_ALIGN_INSIDE|FL_ALIGN_LEFT);
! available = new Fl_Multi_Browser( avbox->x()+offset,
avbox->y()+line_height,
avbox->w()-2*offset,
***************
*** 112,116 ****
! dependent = new Fl_Select_Browser( depbox->x()+offset,
depbox->y()+line_height,
depbox->w()-2*offset,
--- 113,117 ----
! dependent = new Fl_Multi_Browser( depbox->x()+offset,
depbox->y()+line_height,
depbox->w()-2*offset,
***************
*** 170,181 ****
void ParameterSelect::available_callback(Fl_Widget* flw) {
! if ( available->value() ) {
! if( !ind_selected ) {
! independent->add( available->text(available->value()) );
! ind_selected=true;
! } else {
! dependent->add( available->text(available->value()) );
}
! }
}
--- 171,189 ----
void ParameterSelect::available_callback(Fl_Widget* flw) {
! for(int i=1;i<=available->size();i++) {
! if( available->selected(i) ) {
! if( !ind_selected ) {
! independent->add( available->text(i) );
! ind_selected=true;
! dup_check[available->text(i)]=1;
! } else {
! if( dup_check[available->text(i)] == 0) {
! dup_check[available->text(i)]=1;
! dependent->add( available->text(i) );
! }
! }
! available->deselect(i);
}
! }
}
***************
*** 183,186 ****
--- 191,195 ----
void ParameterSelect::independent_callback(Fl_Widget* flw) {
if ( independent->value() ) {
+ dup_check[ independent->text(independent->value()) ]=0;
independent->remove( independent->value() );
ind_selected=false;
***************
*** 189,194 ****
void ParameterSelect::dependent_callback(Fl_Widget* flw) {
! if ( dependent->value() ) {
! dependent->remove( dependent->value() );
! }
}
--- 198,207 ----
void ParameterSelect::dependent_callback(Fl_Widget* flw) {
! for(int i=1;i<=available->size();i++) {
! if ( dependent->selected(i) ) {
! dup_check[dependent->text(i)]=0;
! dependent->remove( i );
!
! }
! }
}
Index: ParameterSelect.h
===================================================================
RCS file: /cvsroot/thplot/thplot/src/Gui/ParameterSelect.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** ParameterSelect.h 2 Jul 2002 17:21:44 -0000 1.2
--- ParameterSelect.h 3 Jul 2002 13:24:50 -0000 1.3
***************
*** 30,40 ****
#define PARAMETERSELECT_H
#include <FL/Fl_Window.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Select_Browser.H>
#include <FL/Fl_Button.h>
#include <FL/Fl_Return_Button.h>
- #include <vector>
- #include <string>
#include <Main/Globals.h>
--- 30,43 ----
#define PARAMETERSELECT_H
+ #include <vector>
+ #include <map>
+ #include <string>
+
#include <FL/Fl_Window.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Select_Browser.H>
+ #include <FL/Fl_Multi_Browser.H>
#include <FL/Fl_Button.h>
#include <FL/Fl_Return_Button.h>
#include <Main/Globals.h>
***************
*** 83,86 ****
--- 86,90 ----
bool selected;
int Nitems;
+ map<string,int> dup_check;
string ind_name;
ParamList dep_names;
***************
*** 88,92 ****
Fl_Window *window;
Fl_Box *avbox, *indbox, *depbox;
! Fl_Select_Browser *available, *independent, *dependent;
Fl_Button* cancel_button;
--- 92,97 ----
Fl_Window *window;
Fl_Box *avbox, *indbox, *depbox;
! Fl_Multi_Browser *available, *dependent;
! Fl_Select_Browser *independent;
Fl_Button* cancel_button;
|
|
From: Tony P. <ap...@us...> - 2002-07-03 13:23:44
|
Update of /cvsroot/thplot/thplot/src/Draw
In directory usw-pr-cvs1:/tmp/cvs-serv23792/src/Draw
Modified Files:
Axis.cpp Axis.h
Log Message:
Improved placement of titles and tick marks, code cleanup.
Index: Axis.cpp
===================================================================
RCS file: /cvsroot/thplot/thplot/src/Draw/Axis.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** Axis.cpp 2 Jul 2002 17:20:42 -0000 1.3
--- Axis.cpp 3 Jul 2002 13:23:40 -0000 1.4
***************
*** 55,58 ****
--- 55,59 ----
tickFont = new OGLFT::Grayscale( fontfile.c_str(), 9 );
titleFont->setForegroundColor(0,0,0);
+ titleFont->setHorizontalJustification(OGLFT::Face::CENTER);
tickFont->setForegroundColor(0,0,0);
if( !titleFont->isValid() ) {
***************
*** 133,138 ****
value = min;
for(i=0;i<=length;i+=20) {
! snprintf(tmp,80,"%5.2f",value);
! drawStringWCentered(tmp,parent->getX()+i,parent->getY()-7);
value += 2*delta;
}
--- 134,143 ----
value = min;
for(i=0;i<=length;i+=20) {
! snprintf(tmp,80,"%g",value);
! tickFont->setHorizontalJustification(OGLFT::Face::CENTER);
! tickFont->setVerticalJustification(OGLFT::Face::TOP);
! tickFont->draw( parent->getX()+i,
! parent->getY()-hashLength-2,
! tmp );
value += 2*delta;
}
***************
*** 140,145 ****
value = min;
for(i=0;i<=length;i+=20) {
! snprintf(tmp,80,"%5.2f",value);
! drawStringHCentered(tmp,parent->getX()-15,parent->getY()+i);
value += 2*delta;
}
--- 145,154 ----
value = min;
for(i=0;i<=length;i+=20) {
! snprintf(tmp,80,"%g",value);
! tickFont->setVerticalJustification(OGLFT::Face::MIDDLE);
! tickFont->setHorizontalJustification(OGLFT::Face::RIGHT);
! tickFont->draw( parent->getX()-hashLength-5,
! parent->getY()+i,
! tmp );
value += 2*delta;
}
***************
*** 163,172 ****
titleFont->setStringRotation(-90);
#endif
! titleFont->draw(float(parent->getX())-20,float(parent->getY()+length/2),
! tmps.c_str() );
titleFont->setStringRotation(0);
} else {
! titleFont->draw(float(parent->getX()+length/2),float(parent->getY()-15),
! tmps.c_str() );
}
--- 172,183 ----
titleFont->setStringRotation(-90);
#endif
! titleFont->draw(float(parent->getX())-20,
! float(parent->getY()+length/2),
! tmps.c_str() );
titleFont->setStringRotation(0);
} else {
! titleFont->draw(float(parent->getX()+length/2),
! float(parent->getY()-15),
! tmps.c_str() );
}
***************
*** 174,188 ****
return true;
}
!
!
! void Axis::drawStringWCentered(string msg, float x, float y) {
! tickFont->setHorizontalJustification(OGLFT::Face::CENTER);
! tickFont->draw( x,y,msg.c_str() );
! }
!
! void Axis::drawStringHCentered(string msg, float x, float y) {
! tickFont->setVerticalJustification(OGLFT::Face::MIDDLE);
! tickFont->draw( x,y,msg.c_str() );
! }
!
!
--- 185,187 ----
return true;
}
!
Index: Axis.h
===================================================================
RCS file: /cvsroot/thplot/thplot/src/Draw/Axis.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** Axis.h 2 Jul 2002 17:20:42 -0000 1.3
--- Axis.h 3 Jul 2002 13:23:40 -0000 1.4
***************
*** 72,78 ****
int fntPointSize;
- void drawStringWCentered(string msg, float x, float y);
- void drawStringHCentered(string msg, float x, float y);
-
};
--- 72,75 ----
|
|
From: Tony P. <ap...@us...> - 2002-07-02 17:23:48
|
Update of /cvsroot/thplot/thplot/tests In directory usw-pr-cvs1:/tmp/cvs-serv12069 Removed Files: pstest.cpp Log Message: Removed since it is no longer possible to run the parameter select dialog outside of the main program. --- pstest.cpp DELETED --- |
|
From: Tony P. <ap...@us...> - 2002-07-02 17:22:15
|
Update of /cvsroot/thplot/thplot In directory usw-pr-cvs1:/tmp/cvs-serv11698 Modified Files: configure.in Log Message: incremented version number Index: configure.in =================================================================== RCS file: /cvsroot/thplot/thplot/configure.in,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** configure.in 30 Jun 2002 14:24:13 -0000 1.2 --- configure.in 2 Jul 2002 17:22:11 -0000 1.3 *************** *** 4,8 **** AC_PREREQ(2.13) ! AM_INIT_AUTOMAKE(thplot, 0.12.3) AM_CONFIG_HEADER(config.h) --- 4,8 ---- AC_PREREQ(2.13) ! AM_INIT_AUTOMAKE(thplot, 0.12.4) AM_CONFIG_HEADER(config.h) |
|
From: Tony P. <ap...@us...> - 2002-07-02 17:21:47
|
Update of /cvsroot/thplot/thplot/src/Gui In directory usw-pr-cvs1:/tmp/cvs-serv11461/src/Gui Modified Files: ParameterSelect.cpp ParameterSelect.h Log Message: New parameter select dialog. Index: ParameterSelect.cpp =================================================================== RCS file: /cvsroot/thplot/thplot/src/Gui/ParameterSelect.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ParameterSelect.cpp 30 Jun 2002 14:37:44 -0000 1.2 --- ParameterSelect.cpp 2 Jul 2002 17:21:44 -0000 1.3 *************** *** 1,24 **** /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! Header: ParameterSelect.cpp Author: Tony Peden Date started: 6/15/02 ! ------------- Copyright (C) 2002 Tony Peden (ap...@ea...) ----------- ! This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. ! This program 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 General Public License for more details. ! You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! Further information about the GNU General Public License can also be found on the world wide web at http://www.gnu.org. --- 1,24 ---- /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! Header: ParameterSelect.cpp Author: Tony Peden Date started: 6/15/02 ! ------------- Copyright (C) 2002 Tony Peden (ap...@ea...) ----------- ! This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. ! This program 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 General Public License for more details. ! You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! Further information about the GNU General Public License can also be found on the world wide web at http://www.gnu.org. *************** *** 27,118 **** #include <FL/Fl.h> #include <Gui/ParameterSelect.h> ! ParameterSelect::ParameterSelect(Globals *g){ global=g; window=NULL; ! flmb=NULL; ok_button=NULL; cancel_button=NULL; run=true; Nitems=0; - Nselected=0; } ! ! ParameterSelect::~ParameterSelect(void) { delete ok_button; delete cancel_button; ! delete flmb; } ! bool ParameterSelect::showDialog(csvData *data) { run=true; ! selected.clear(); Nitems=0; int offset=5; int buttonw=80; ! int buttonh=30; ! int w = 200; ! int h = 300; ! int x = global->getMainWindow()->x() + global->getMainWindow()->w()/2 - w/2; ! int y = global->getMainWindow()->y() + global->getMainWindow()->h()/2 - h/2; ! window = new Fl_Window(x,y,200,300,"Select Parameters to Plot"); ! ! int pswinw=window->w(); ! int pswinh=window->h(); // origin is upper-left corner ! flmb = new Fl_Multi_Browser(offset,offset, ! pswinw - offset, ! pswinh - buttonh - 3*offset, ! 0); ! cancel_button = new Fl_Button(pswinw - buttonw - offset, pswinh - buttonh - offset, buttonw,buttonh, "&Cancel" ); ! cancel_button->callback(static_cancel_callback,this); ! ! ok_button = new Fl_Return_Button(offset, ! pswinh - buttonh - offset, ! buttonw,buttonh, ! "OK"); ok_button->callback(static_ok_callback,this); ! window->end(); ! Nitems=data->getNumParameters(); for(int i=0;i<Nitems;i++) { ! flmb->add( data->getName(i).c_str() ); } ! window->show(); ! while(run) { Fl::wait(); } window->hide(); return true; ! } ! void ParameterSelect::cancel_callback(Fl_Widget* flw) { cout << "In Cancel callback" << endl; run=false; ! selected.clear(); ! } void ParameterSelect::ok_callback(Fl_Widget* flw) { cout << "In OK callback" << endl; ! Nselected=0; ! for(int i=1;i<=Nitems;i++) { ! if(flmb->selected(i)) { ! Nselected++; ! selected.push_back(i); ! } } run=false; - - } ! string ParameterSelect::getSelected(int idx) { ! return string( flmb->text(selected[idx]) ); ! } ! --- 27,194 ---- #include <FL/Fl.h> + #include <FL/fl_draw.h> + #include <Gui/ParameterSelect.h> ! ParameterSelect::ParameterSelect(Globals *g) { global=g; window=NULL; ! available=NULL; ! independent=NULL; ! dependent=NULL; ok_button=NULL; cancel_button=NULL; run=true; + ind_selected=false; + selected=false; Nitems=0; } ! ! ParameterSelect::~ParameterSelect(void) { delete ok_button; delete cancel_button; ! delete available; } ! bool ParameterSelect::showDialog(csvData *data) { run=true; ! dep_names.clear(); ! ind_name = ""; ! selected=false; ! ind_selected=false; Nitems=0; int offset=5; + int boxw=200; + int line_height = 20; int buttonw=80; ! int buttonh=2*offset+line_height; ! int pswinw = 4*offset + 2*boxw + 10; ! int pswinh = 16*line_height + buttonh + 5*offset; ! int x = global->getMainWindow()->x() + ! global->getMainWindow()->w()/2 - pswinw/2; ! int y = global->getMainWindow()->y() + ! global->getMainWindow()->h()/2 - pswinh/2; ! window = new Fl_Window(x,y,pswinw,pswinh,"Select Parameters to Plot"); // origin is upper-left corner ! avbox = new Fl_Box( FL_ENGRAVED_FRAME, ! offset, ! offset, ! boxw, ! 16*line_height+2*offset, ! "Available Parameters"); ! avbox->align(FL_ALIGN_TOP|FL_ALIGN_INSIDE|FL_ALIGN_LEFT); ! ! available = new Fl_Select_Browser( avbox->x()+offset, ! avbox->y()+line_height, ! avbox->w()-2*offset, ! avbox->h()-line_height-offset, ! ""); ! available->callback( static_available_callback,this ); ! ! indbox = new Fl_Box( FL_ENGRAVED_FRAME, ! avbox->x()+avbox->w()+20, ! avbox->y(), ! avbox->w(), ! 2*line_height+2*offset, ! "Selected Independent"); ! indbox->align(FL_ALIGN_TOP|FL_ALIGN_INSIDE|FL_ALIGN_LEFT); ! ! independent = new Fl_Select_Browser( indbox->x()+offset, ! indbox->y()+line_height, ! indbox->w()-2*offset, ! line_height, ! ""); ! independent->callback( static_independent_callback, this ); ! ! depbox = new Fl_Box( FL_ENGRAVED_FRAME, ! indbox->x(), ! indbox->y() + indbox->h() + 3*offset, ! indbox->w(), ! 13*line_height+offset, ! "Selected Dependents"); ! depbox->align(FL_ALIGN_TOP|FL_ALIGN_INSIDE|FL_ALIGN_LEFT); ! ! ! dependent = new Fl_Select_Browser( depbox->x()+offset, ! depbox->y()+line_height, ! depbox->w()-2*offset, ! 12*line_height, ! "" ); ! dependent->callback( static_dependent_callback, this ); ! cancel_button = new Fl_Button(pswinw - buttonw - offset, pswinh - buttonh - offset, buttonw,buttonh, "&Cancel" ); ! cancel_button->callback(static_cancel_callback,this); ! ! ok_button = new Fl_Return_Button( pswinw - 2*buttonw - 2*offset, ! pswinh - buttonh - offset, ! buttonw,buttonh, ! "OK"); ok_button->callback(static_ok_callback,this); ! window->end(); ! Nitems=data->getNumParameters(); for(int i=0;i<Nitems;i++) { ! available->add( data->getName(i).c_str() ); } ! window->show(); ! while(run) { ! Fl::wait(); ! } window->hide(); return true; ! } ! void ParameterSelect::cancel_callback(Fl_Widget* flw) { cout << "In Cancel callback" << endl; run=false; ! ind_name = ""; ! dep_names.clear(); ! } void ParameterSelect::ok_callback(Fl_Widget* flw) { cout << "In OK callback" << endl; ! ! if ( independent->size() ) { ! ind_name = independent->text( 1 ); ! cout << ind_name << ", " << dependent->size() << endl; ! for(int i=1;i<=dependent->size();i++) { ! if(dependent->text(i) ) { ! dep_names.push_back( dependent->text(i) ); ! selected=true; ! } ! } } run=false; + } ! void ParameterSelect::available_callback(Fl_Widget* flw) { ! if ( available->value() ) { ! if( !ind_selected ) { ! independent->add( available->text(available->value()) ); ! ind_selected=true; ! } else { ! dependent->add( available->text(available->value()) ); ! } ! } ! } ! ! ! void ParameterSelect::independent_callback(Fl_Widget* flw) { ! if ( independent->value() ) { ! independent->remove( independent->value() ); ! ind_selected=false; ! } ! } ! ! void ParameterSelect::dependent_callback(Fl_Widget* flw) { ! if ( dependent->value() ) { ! dependent->remove( dependent->value() ); ! } ! } Index: ParameterSelect.h =================================================================== RCS file: /cvsroot/thplot/thplot/src/Gui/ParameterSelect.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** ParameterSelect.h 22 Jun 2002 11:57:08 -0000 1.1.1.1 --- ParameterSelect.h 2 Jul 2002 17:21:44 -0000 1.2 *************** *** 31,35 **** #include <FL/Fl_Window.H> ! #include <FL/Fl_Multi_Browser.H> #include <FL/Fl_Button.h> #include <FL/Fl_Return_Button.h> --- 31,36 ---- #include <FL/Fl_Window.H> ! #include <FL/Fl_Box.H> ! #include <FL/Fl_Select_Browser.H> #include <FL/Fl_Button.h> #include <FL/Fl_Return_Button.h> *************** *** 45,50 **** ~ParameterSelect(void); ! // typedef vector<string> ParamList; ! // ParamList& getParameters(void); static void static_ok_callback(Fl_Widget *flw, void *d) { ((ParameterSelect*)d)->ok_callback(flw); --- 46,69 ---- ~ParameterSelect(void); ! ! string getSelectedIndependent(void) { return ind_name; } ! ParamList getSelectedDependents(void) { return dep_names; } ! bool selectionAvailable(void) { return selected; } ! ! static void static_available_callback(Fl_Widget *flw, void *d) { ! ((ParameterSelect*)d)->available_callback(flw); ! } ! void available_callback(Fl_Widget* flw); ! ! static void static_independent_callback(Fl_Widget *flw, void *d) { ! ((ParameterSelect*)d)->independent_callback(flw); ! } ! void independent_callback(Fl_Widget* flw); ! ! static void static_dependent_callback(Fl_Widget *flw, void *d) { ! ((ParameterSelect*)d)->dependent_callback(flw); ! } ! void dependent_callback(Fl_Widget* flw); ! static void static_ok_callback(Fl_Widget *flw, void *d) { ((ParameterSelect*)d)->ok_callback(flw); *************** *** 58,72 **** bool showDialog(csvData *data); - int getNSelected(void) { return Nselected; } - string getSelected(int idx); - private: bool run; ! int Nitems,Nselected; ! vector<int> selected; Globals *global; Fl_Window *window; ! Fl_Multi_Browser* flmb; Fl_Button* cancel_button; Fl_Return_Button* ok_button; --- 77,93 ---- bool showDialog(csvData *data); private: bool run; ! bool ind_selected; ! bool selected; ! int Nitems; ! string ind_name; ! ParamList dep_names; Globals *global; Fl_Window *window; ! Fl_Box *avbox, *indbox, *depbox; ! Fl_Select_Browser *available, *independent, *dependent; ! Fl_Button* cancel_button; Fl_Return_Button* ok_button; |
|
From: Tony P. <ap...@us...> - 2002-07-02 17:20:46
|
Update of /cvsroot/thplot/thplot/src/Gui
In directory usw-pr-cvs1:/tmp/cvs-serv11105/src/Gui
Modified Files:
MainWindow.cpp
Log Message:
Changes to support plotting multiple curves.
Index: MainWindow.cpp
===================================================================
RCS file: /cvsroot/thplot/thplot/src/Gui/MainWindow.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** MainWindow.cpp 22 Jun 2002 11:57:08 -0000 1.1.1.1
--- MainWindow.cpp 2 Jul 2002 17:20:42 -0000 1.2
***************
*** 79,85 ****
ps = new ParameterSelect(global);
ps->showDialog(csvdata);
! if(ps->getNSelected() > 1) {
glw->getPlot()->getGrid(0)->setData(csvdata,
! ps->getSelected(0),ps->getSelected(1));
Fl::redraw();
}
--- 79,87 ----
ps = new ParameterSelect(global);
ps->showDialog(csvdata);
! if( ps->selectionAvailable() ) {
! cout << "Calling setData()" << endl;
glw->getPlot()->getGrid(0)->setData(csvdata,
! ps->getSelectedIndependent(),
! ps->getSelectedDependents() );
Fl::redraw();
}
|
|
From: Tony P. <ap...@us...> - 2002-07-02 17:20:46
|
Update of /cvsroot/thplot/thplot/src/Draw
In directory usw-pr-cvs1:/tmp/cvs-serv11105/src/Draw
Modified Files:
Axis.cpp Axis.h Curve.cpp Curve.h Grid.cpp Grid.h
Log Message:
Changes to support plotting multiple curves.
Index: Axis.cpp
===================================================================
RCS file: /cvsroot/thplot/thplot/src/Draw/Axis.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** Axis.cpp 30 Jun 2002 14:36:10 -0000 1.2
--- Axis.cpp 2 Jul 2002 17:20:42 -0000 1.3
***************
*** 65,69 ****
Axis::~Axis(void){}
! bool Axis::DrawGL(double min, double max, double delta, string pname ) {
float x2, y2;
int i;
--- 65,69 ----
Axis::~Axis(void){}
! bool Axis::DrawGL(double min, double max, double delta, ParamList& pnames ) {
float x2, y2;
int i;
***************
*** 147,151 ****
}
! if(titleson && !pname.empty() ) {
if(vertical) {
#ifndef IS_CYGWIN
--- 147,160 ----
}
! if(titleson && !pnames.empty() ) {
! string tmps;
! tmps="";
! cout << "pnames.size(): " << pnames.size() << endl;
! for(unsigned j=0;j<pnames.size();j++) {
! tmps += pnames[j];
! if ( j < pnames.size()-1 ) {
! tmps += ", ";
! }
! }
if(vertical) {
#ifndef IS_CYGWIN
***************
*** 155,163 ****
#endif
titleFont->draw(float(parent->getX())-20,float(parent->getY()+length/2),
! pname.c_str() );
titleFont->setStringRotation(0);
} else {
titleFont->draw(float(parent->getX()+length/2),float(parent->getY()-15),
! pname.c_str() );
}
--- 164,172 ----
#endif
titleFont->draw(float(parent->getX())-20,float(parent->getY()+length/2),
! tmps.c_str() );
titleFont->setStringRotation(0);
} else {
titleFont->draw(float(parent->getX()+length/2),float(parent->getY()-15),
! tmps.c_str() );
}
Index: Axis.h
===================================================================
RCS file: /cvsroot/thplot/thplot/src/Draw/Axis.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** Axis.h 30 Jun 2002 14:36:10 -0000 1.2
--- Axis.h 2 Jul 2002 17:20:42 -0000 1.3
***************
*** 48,52 ****
void tickLabels(bool enable) { labelson = enable; }
void setWidth(float w) { width = w; }
! bool DrawGL( double min, double max, double delta, string pname);
void setAxisLabel(string al) { axisLabel = al; }
string getAxisLabel(void) { return axisLabel; }
--- 48,52 ----
void tickLabels(bool enable) { labelson = enable; }
void setWidth(float w) { width = w; }
! bool DrawGL( double min, double max, double delta, ParamList& pnames);
void setAxisLabel(string al) { axisLabel = al; }
string getAxisLabel(void) { return axisLabel; }
Index: Curve.cpp
===================================================================
RCS file: /cvsroot/thplot/thplot/src/Draw/Curve.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** Curve.cpp 22 Jun 2002 11:57:11 -0000 1.1.1.1
--- Curve.cpp 2 Jul 2002 17:20:42 -0000 1.2
***************
*** 28,34 ****
#include <Data/csvData.h>
! Curve::Curve(Globals *g, Grid *p){
global=g;
parent=p;
lines=true;
symbols=true;
--- 28,35 ----
#include <Data/csvData.h>
! Curve::Curve(Globals *g, Grid *p, int idx){
global=g;
parent=p;
+ index=idx;
lines=true;
symbols=true;
***************
*** 43,47 ****
double x,y;
d = parent->getData();
! iDep = d->getParameterIdx( parent->getDepName() );
iIndep = d->getParameterIdx( parent->getIndepName() );
--- 44,48 ----
double x,y;
d = parent->getData();
! iDep = d->getParameterIdx( parent->getDepName(index) );
iIndep = d->getParameterIdx( parent->getIndepName() );
Index: Curve.h
===================================================================
RCS file: /cvsroot/thplot/thplot/src/Draw/Curve.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** Curve.h 22 Jun 2002 11:57:11 -0000 1.1.1.1
--- Curve.h 2 Jul 2002 17:20:42 -0000 1.2
***************
*** 35,39 ****
class Curve {
public:
! Curve(Globals *g, Grid *p );
~Curve(void);
--- 35,39 ----
class Curve {
public:
! Curve(Globals *g, Grid *p, int idx );
~Curve(void);
***************
*** 47,50 ****
--- 47,51 ----
Grid *parent;
csvData *data;
+ int index;
string ind_pname, dep_pname;
bool lines, symbols;
Index: Grid.cpp
===================================================================
RCS file: /cvsroot/thplot/thplot/src/Draw/Grid.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** Grid.cpp 30 Jun 2002 14:36:44 -0000 1.3
--- Grid.cpp 2 Jul 2002 17:20:42 -0000 1.4
***************
*** 43,51 ****
}
! void Grid::setData(csvData *d, string indep_name, string dep_name) {
! data = d;
! indep = indep_name;
! dep = dep_name;
! curves.push_back( new Curve(global,this) );
}
--- 43,57 ----
}
! void Grid::setData(csvData *d, string independent, ParamList dependents) {
! if( d != NULL ) {
! data = d;
! indep_names.clear();
! indep_names.push_back(independent);
! dep_names = dependents;
! curves.clear();
! for ( unsigned i=0;i<dependents.size();i++) {
! curves.push_back( new Curve(global,this,i) );
! }
! }
}
***************
*** 62,87 ****
if(independent) {
if( data != NULL ) {
! as.setMax( data->getMax(indep) );
! as.setMin( data->getMin(indep) );
as.setNdiv( independent->getNticks() );
indep_min = as.getASMin();
indep_max = as.getASMax();
! indep2grid = w/(indep_max - indep_min);
! independent->DrawGL(indep_min, indep_max,as.getASDelta(), indep );
} else {
! independent->DrawGL(0,0,0,"");
}
}
if(dependent) {
if( data != NULL ) {
! as.setMax( data->getMax(dep) );
! as.setMin( data->getMin(dep) );
as.setNdiv( dependent->getNticks() );
dep_min = as.getASMin();
dep_max = as.getASMax();
dep2grid = h/(dep_max - dep_min);
! dependent->DrawGL(dep_min, dep_max, as.getASDelta(),dep);
} else {
! dependent->DrawGL(0,0,0,"");
}
}
--- 68,103 ----
if(independent) {
if( data != NULL ) {
! as.setMax( data->getMax( indep_names[0] ) );
! as.setMin( data->getMin( indep_names[0] ) );
as.setNdiv( independent->getNticks() );
indep_min = as.getASMin();
indep_max = as.getASMax();
! indep2grid = w/(indep_max - indep_min);
!
! independent->DrawGL(indep_min, indep_max,as.getASDelta(), indep_names );
} else {
! independent->DrawGL(0,0,0,indep_names);
}
}
if(dependent) {
if( data != NULL ) {
! float min, max;
! min=data->getMin( dep_names[0] );
! max=data->getMax( dep_names[0] );
! for(unsigned i=1;i<dep_names.size();i++) {
! if( data->getMin( dep_names[i] ) < min )
! min = data->getMin( dep_names[i] );
! if( data->getMax( dep_names[i] ) > max )
! max = data->getMax( dep_names[i] );
! }
! as.setMax( max );
! as.setMin( min );
as.setNdiv( dependent->getNticks() );
dep_min = as.getASMin();
dep_max = as.getASMax();
dep2grid = h/(dep_max - dep_min);
! dependent->DrawGL(dep_min, dep_max, as.getASDelta(),dep_names);
} else {
! dependent->DrawGL(0,0,0,dep_names);
}
}
Index: Grid.h
===================================================================
RCS file: /cvsroot/thplot/thplot/src/Draw/Grid.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** Grid.h 22 Jun 2002 11:57:09 -0000 1.1.1.1
--- Grid.h 2 Jul 2002 17:20:42 -0000 1.2
***************
*** 39,43 ****
double getW(void) { return w; }
double getH(void) { return h; }
! void setData(csvData* d, string independent, string dependent);
void clearData(void);
csvData* getData(void) { return data; }
--- 39,43 ----
double getW(void) { return w; }
double getH(void) { return h; }
! void setData(csvData* d, string independent, ParamList dependents);
void clearData(void);
csvData* getData(void) { return data; }
***************
*** 48,53 ****
double convertIndepCoord(double icoord);
double convertDepCoord(double dcoord);
! string getIndepName(void) { return indep; }
! string getDepName(void) { return dep; }
bool DrawGL(void);
--- 48,53 ----
double convertIndepCoord(double icoord);
double convertDepCoord(double dcoord);
! string getIndepName(void) { return indep_names[0]; }
! string getDepName(int idx) { return dep_names[idx]; }
bool DrawGL(void);
***************
*** 65,69 ****
CurveList curves;
! string indep,dep;
double indep2grid,indep_max,indep_min;
double dep2grid,dep_max,dep_min;
--- 65,71 ----
CurveList curves;
! ParamList indep_names;
! ParamList dep_names;
!
double indep2grid,indep_max,indep_min;
double dep2grid,dep_max,dep_min;
|
|
From: Tony P. <ap...@us...> - 2002-07-02 17:20:46
|
Update of /cvsroot/thplot/thplot/src/Main
In directory usw-pr-cvs1:/tmp/cvs-serv11105/src/Main
Modified Files:
Globals.h
Log Message:
Changes to support plotting multiple curves.
Index: Globals.h
===================================================================
RCS file: /cvsroot/thplot/thplot/src/Main/Globals.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** Globals.h 22 Jun 2002 11:57:11 -0000 1.1.1.1
--- Globals.h 2 Jul 2002 17:20:42 -0000 1.2
***************
*** 28,34 ****
--- 28,39 ----
#define GLOBAL_H
+ #include <string>
+ #include <vector>
+
#include <FL/Fl_Gl_Window.h>
typedef enum { letter, legal, tabloid, A3, A4 } PaperSizes;
+
+ typedef vector<string> ParamList;
class Globals {
|
|
From: Tony P. <ap...@us...> - 2002-07-01 21:35:18
|
Update of /cvsroot/thplot/thplot In directory usw-pr-cvs1:/tmp/cvs-serv18202 Removed Files: config.h.in Log Message: Generated file, removed from CVS. ***** Bogus filespec: config.h.in |
|
From: Tony P. <ap...@us...> - 2002-06-30 14:57:18
|
Update of /cvsroot/thplot/thplot In directory usw-pr-cvs1:/tmp/cvs-serv30114 Modified Files: acconfig.h Log Message: undef IS_CYGWIN rather than define 0 ***** Bogus filespec: acconfig.h |
|
From: Tony P. <ap...@us...> - 2002-06-30 14:46:58
|
Update of /cvsroot/thplot/thplot/src/Util In directory usw-pr-cvs1:/tmp/cvs-serv26858 Added Files: OGLFT.cpp OGLFT.h Log Message: Source code from OGLFT, a library for rendering fonts in OpenGL ***** Bogus filespec: OGLFT.cpp ***** Bogus filespec: OGLFT.h |
|
From: Tony P. <ap...@us...> - 2002-06-30 14:45:02
|
Update of /cvsroot/thplot/thplot In directory usw-pr-cvs1:/tmp/cvs-serv26166 Modified Files: README Log Message: Updated for freetype lib requirement, added notes on Cygwin ***** Bogus filespec: README |
|
From: Tony P. <ap...@us...> - 2002-06-30 14:40:51
|
Update of /cvsroot/thplot/thplot/src/Util In directory usw-pr-cvs1:/tmp/cvs-serv24525 Modified Files: Makefile.am Log Message: Additions for OGLFT ***** Bogus filespec: Makefile.am |
|
From: Tony P. <ap...@us...> - 2002-06-30 14:39:26
|
Update of /cvsroot/thplot/thplot/src/Main In directory usw-pr-cvs1:/tmp/cvs-serv24212 Modified Files: Makefile.am Log Message: Update comment. ***** Bogus filespec: Makefile.am |
|
From: Tony P. <ap...@us...> - 2002-06-30 14:38:39
|
Update of /cvsroot/thplot/thplot/src/Gui In directory usw-pr-cvs1:/tmp/cvs-serv23763 Modified Files: glWindow.cpp Log Message: Adjusted OpenGL mode of Fl_Gl_Window ***** Bogus filespec: glWindow.cpp |
|
From: Tony P. <ap...@us...> - 2002-06-30 14:37:46
|
Update of /cvsroot/thplot/thplot/src/Gui In directory usw-pr-cvs1:/tmp/cvs-serv23518 Modified Files: ParameterSelect.cpp Log Message: Changed intial position of dialog, now opens in middle of main window ***** Bogus filespec: ParameterSelect.cpp |
|
From: Tony P. <ap...@us...> - 2002-06-30 14:36:47
|
Update of /cvsroot/thplot/thplot/src/Draw In directory usw-pr-cvs1:/tmp/cvs-serv23194 Modified Files: Grid.cpp Log Message: Now pass parameter name to Axis::DrawGL ***** Bogus filespec: Grid.cpp |
|
From: Tony P. <ap...@us...> - 2002-06-30 14:36:13
|
Update of /cvsroot/thplot/thplot/src/Draw In directory usw-pr-cvs1:/tmp/cvs-serv22728 Modified Files: Axis.h Axis.cpp Log Message: Changed font code to use OGLFT rather than fltk native. Needed because fltk fonts can't be rotated. ***** Bogus filespec: Axis.h ***** Bogus filespec: Axis.cpp |
|
From: Tony P. <ap...@us...> - 2002-06-30 14:32:41
|
Update of /cvsroot/thplot/thplot/tests In directory usw-pr-cvs1:/tmp/cvs-serv21512 Modified Files: Makefile.am Log Message: Changed target so that test programs do not get installed by 'make install' ***** Bogus filespec: Makefile.am |
|
From: Tony P. <ap...@us...> - 2002-06-30 14:31:27
|
Update of /cvsroot/thplot/thplot/tests In directory usw-pr-cvs1:/tmp/cvs-serv21218 Removed Files: Makefile.in Log Message: Removing generated files from CVS ***** Bogus filespec: Makefile.in |
|
From: Tony P. <ap...@us...> - 2002-06-30 14:30:00
|
Update of /cvsroot/thplot/thplot/src/Util In directory usw-pr-cvs1:/tmp/cvs-serv20730 Removed Files: Makefile.in Log Message: Removing generated files from CVS ***** Bogus filespec: Makefile.in |
|
From: Tony P. <ap...@us...> - 2002-06-30 14:28:47
|
Update of /cvsroot/thplot/thplot/src/Main In directory usw-pr-cvs1:/tmp/cvs-serv20245/Main Removed Files: Makefile.in Log Message: Removing generated files from CVS ***** Bogus filespec: Makefile.in |
|
From: Tony P. <ap...@us...> - 2002-06-30 14:28:46
|
Update of /cvsroot/thplot/thplot/src/Data In directory usw-pr-cvs1:/tmp/cvs-serv20245/Data Removed Files: Makefile.in Log Message: Removing generated files from CVS ***** Bogus filespec: Makefile.in |
|
From: Tony P. <ap...@us...> - 2002-06-30 14:28:46
|
Update of /cvsroot/thplot/thplot/src In directory usw-pr-cvs1:/tmp/cvs-serv20245 Removed Files: Makefile.in Log Message: Removing generated files from CVS ***** Bogus filespec: Makefile.in |
|
From: Tony P. <ap...@us...> - 2002-06-30 14:28:46
|
Update of /cvsroot/thplot/thplot/src/Gui In directory usw-pr-cvs1:/tmp/cvs-serv20245/Gui Removed Files: Makefile.in Log Message: Removing generated files from CVS ***** Bogus filespec: Makefile.in |