Changeset 5355
- Timestamp:
- 26/07/10 11:51:20 (6 weeks ago)
- Location:
- trunk/Code/qtiplot
- Files:
-
- 3 modified
-
3rdparty/liborigin/OPJFile.cpp (modified) (1 diff)
-
3rdparty/liborigin/OPJFile.h (modified) (27 diffs)
-
qtiplot/src/importOPJ.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Code/qtiplot/3rdparty/liborigin/OPJFile.cpp
r944 r5355 35 35 #include <algorithm> //required for std::swap 36 36 #include "OPJFile.h" 37 38 using std::vector; 39 using std::string; 37 40 38 41 const char* colTypeNames[] = {"X", "Y", "Z", "XErr", "YErr", "Label", "None"}; -
trunk/Code/qtiplot/3rdparty/liborigin/OPJFile.h
r944 r5355 41 41 #include "tree.hh" 42 42 43 using namespace std; 43 // Russell Taylor, 23/07/10: Remove evil import - caused clash with std::tr1::function 44 //using namespace std; 44 45 45 46 struct rect { … … 72 73 enum Title {Name, Label, Both}; 73 74 74 st ring name;75 st ring label;75 std::string name; 76 std::string label; 76 77 int objectID; 77 78 bool bHidden; … … 82 83 double modification_date; // Julian date/time 83 84 84 originWindow(st ring _name="",string _label="", bool _bHidden=false)85 originWindow(std::string _name="", std::string _label="", bool _bHidden=false) 85 86 : name(_name) 86 87 , label(_label) … … 95 96 int type; // 0 - double, 1 - string 96 97 double d; 97 st ring s;98 std::string s; 98 99 originData(double _d) 99 100 : d(_d) … … 111 112 112 113 struct spreadColumn { 113 st ring name;114 std::string name; 114 115 ColumnType type; 115 116 int value_type;//Numeric = 0, Text = 1, Date = 2, Time = 3, Month = 4, Day = 5, Text&Numeric = 6 … … 118 119 int decimal_places; 119 120 int numeric_display_type;//Default Decimal Digits=0, Decimal Places=1, Significant Digits=2 120 st ring command;121 st ring comment;121 std::string command; 122 std::string comment; 122 123 int width; 123 124 int index; 124 vector <originData> odata;125 spreadColumn(st ring _name="", int _index=0)125 std::vector <originData> odata; 126 spreadColumn(std::string _name="", int _index=0) 126 127 : name(_name) 127 128 , index(_index) … … 141 142 bool bLoose; 142 143 bool bMultisheet; 143 vector <spreadColumn> column;144 spreadSheet(st ring _name="")144 std::vector <spreadColumn> column; 145 spreadSheet(std::string _name="") 145 146 : originWindow(_name) 146 147 , bLoose(true) … … 152 153 int maxRows; 153 154 bool bLoose; 154 vector <spreadSheet> sheet;155 excel(st ring _name="",string _label="", int _maxRows=0, bool _bHidden=false, bool _bLoose=true)155 std::vector <spreadSheet> sheet; 156 excel(std::string _name="", std::string _label="", int _maxRows=0, bool _bHidden=false, bool _bLoose=true) 156 157 : originWindow(_name, _label, _bHidden) 157 158 , maxRows(_maxRows) … … 170 171 int decimal_places; 171 172 int numeric_display_type;//Default Decimal Digits=0, Decimal Places=1, Significant Digits=2 172 st ring command;173 std::string command; 173 174 int width; 174 175 int index; 175 176 ViewType view; 176 177 HeaderViewType header; 177 vector <double> data;178 matrix(st ring _name="", int _index=0)178 std::vector <double> data; 179 matrix(std::string _name="", int _index=0) 179 180 : originWindow(_name) 180 181 , index(_index) … … 191 192 192 193 struct function { 193 st ring name;194 std::string name; 194 195 int type;//Normal = 0, Polar = 1 195 st ring formula;196 std::string formula; 196 197 double begin; 197 198 double end; 198 199 int points; 199 200 int index; 200 function(st ring _name="", int _index=0)201 function(std::string _name="", int _index=0) 201 202 : name(_name) 202 203 , index(_index) … … 211 212 212 213 struct text { 213 st ring txt;214 std::string txt; 214 215 rect clientRect; 215 216 int color; … … 220 221 int attach; 221 222 222 text(const st ring& _txt="")223 text(const std::string& _txt="") 223 224 : txt(_txt) 224 225 {}; 225 text(const st ring& _txt, const rect& _clientRect, int _color, int _fontsize, int _rotation, int _tab, int _border_type, int _attach)226 text(const std::string& _txt, const rect& _clientRect, int _color, int _fontsize, int _rotation, int _tab, int _border_type, int _attach) 226 227 : txt(_txt) 227 228 , clientRect(_clientRect) … … 271 272 unsigned char arrow_angle; 272 273 bool arrow_closed; 273 st ring endXColName;274 st ring endYColName;274 std::string endXColName; 275 std::string endYColName; 275 276 276 277 int position; 277 st ring angleColName;278 st ring magnitudeColName;278 std::string angleColName; 279 std::string magnitudeColName; 279 280 float multiplier; 280 281 int const_angle; … … 292 293 struct graphCurve { 293 294 int type; 294 st ring dataName;295 st ring xColName;296 st ring yColName;295 std::string dataName; 296 std::string xColName; 297 std::string yColName; 297 298 int line_color; 298 299 int line_style; … … 373 374 int fontsize; 374 375 bool fontbold; 375 st ring dataName;376 st ring colName;376 std::string dataName; 377 std::string colName; 377 378 int rotation; 378 379 }; … … 457 458 double histogram_end; 458 459 459 vector<text> texts;460 vector<line> lines;461 vector<bitmap> bitmaps;462 vector<graphCurve> curve;460 std::vector<text> texts; 461 std::vector<line> lines; 462 std::vector<bitmap> bitmaps; 463 std::vector<graphCurve> curve; 463 464 }; 464 465 … … 477 478 478 479 struct graph : public originWindow { 479 vector<graphLayer> layer;480 std::vector<graphLayer> layer; 480 481 unsigned short width; 481 482 unsigned short height; 482 483 483 graph(st ring _name="")484 graph(std::string _name="") 484 485 : originWindow(_name) 485 486 {}; … … 487 488 488 489 struct note : public originWindow { 489 st ring text;490 note(st ring _name="")490 std::string text; 491 note(std::string _name="") 491 492 : originWindow(_name) 492 493 {}; … … 495 496 struct projectNode { 496 497 int type; // 0 - object, 1 - folder 497 st ring name;498 std::string name; 498 499 double creation_date; // Julian date/time 499 500 double modification_date; // Julian date/time 500 501 501 projectNode(st ring _name="", int _type=0, double _creation_date=0.0, double _modification_date=0.0)502 projectNode(std::string _name="", int _type=0, double _creation_date=0.0, double _modification_date=0.0) 502 503 : name(_name) 503 504 , type(_type) … … 579 580 matrix::HeaderViewType matrixHeaderViewType(int m) const { return MATRIX[m].header; } //!< get header view type of matrix m 580 581 double matrixData(int m, int c, int r) const { return MATRIX[m].data[r*MATRIX[m].nr_cols+c]; } //!< get data of row r of column c of matrix m 581 vector<double> matrixData(int m) const { return MATRIX[m].data; } //!< get data of matrix m582 std::vector<double> matrixData(int m) const { return MATRIX[m].data; } //!< get data of matrix m 582 583 583 584 //function properties … … 633 634 text layerYAxisTitle(int s, int l) const { return GRAPH[s].layer[l].yAxis.label; } //!< get label of Y-axis of layer l of graph s 634 635 text layerLegend(int s, int l) const { return GRAPH[s].layer[l].legend; } //!< get legend of layer l of graph s 635 vector<text> layerTexts(int s, int l) const { return GRAPH[s].layer[l].texts; } //!< get texts of layer l of graph s636 vector<line> layerLines(int s, int l) const { return GRAPH[s].layer[l].lines; } //!< get lines of layer l of graph s637 vector<bitmap> layerBitmaps(int s, int l) const { return GRAPH[s].layer[l].bitmaps; } //!< get bitmaps of layer l of graph s636 std::vector<text> layerTexts(int s, int l) const { return GRAPH[s].layer[l].texts; } //!< get texts of layer l of graph s 637 std::vector<line> layerLines(int s, int l) const { return GRAPH[s].layer[l].lines; } //!< get lines of layer l of graph s 638 std::vector<bitmap> layerBitmaps(int s, int l) const { return GRAPH[s].layer[l].bitmaps; } //!< get bitmaps of layer l of graph s 638 639 graphAxisBreak layerXBreak(int s, int l) const { return GRAPH[s].layer[l].xAxisBreak; } //!< get break of horizontal axis of layer l of graph s 639 640 graphAxisBreak layerYBreak(int s, int l) const { return GRAPH[s].layer[l].yAxisBreak; } //!< get break of vertical axis of layer l of graph s … … 644 645 return graphLayerRange(GRAPH[s].layer[l].yAxis.min, GRAPH[s].layer[l].yAxis.max, GRAPH[s].layer[l].yAxis.step); 645 646 } //!< get Y-range of layer l of graph s 646 vector<int> layerXTicks(int s, int l) const {647 vector<int> tick;647 std::vector<int> layerXTicks(int s, int l) const { 648 std::vector<int> tick; 648 649 tick.push_back(GRAPH[s].layer[l].xAxis.majorTicks); 649 650 tick.push_back(GRAPH[s].layer[l].xAxis.minorTicks); 650 651 return tick; 651 652 } //!< get X-axis ticks of layer l of graph s 652 vector<int> layerYTicks(int s, int l) const {653 vector<int> tick;653 std::vector<int> layerYTicks(int s, int l) const { 654 std::vector<int> tick; 654 655 tick.push_back(GRAPH[s].layer[l].yAxis.majorTicks); 655 656 tick.push_back(GRAPH[s].layer[l].yAxis.minorTicks); 656 657 return tick; 657 658 } //!< get Y-axis ticks of layer l of graph s 658 vector<graphGrid> layerGrid(int s, int l) const {659 vector<graphGrid> grid;659 std::vector<graphGrid> layerGrid(int s, int l) const { 660 std::vector<graphGrid> grid; 660 661 grid.push_back(GRAPH[s].layer[l].xAxis.majorGrid); 661 662 grid.push_back(GRAPH[s].layer[l].xAxis.minorGrid); … … 664 665 return grid; 665 666 } //!< get grid of layer l of graph s 666 vector<graphAxisFormat> layerAxisFormat(int s, int l) const {667 vector<graphAxisFormat> format;667 std::vector<graphAxisFormat> layerAxisFormat(int s, int l) const { 668 std::vector<graphAxisFormat> format; 668 669 format.push_back(GRAPH[s].layer[l].yAxis.formatAxis[0]); //bottom 669 670 format.push_back(GRAPH[s].layer[l].yAxis.formatAxis[1]); //top … … 672 673 return format; 673 674 } //!< get title and format of axes of layer l of graph s 674 vector<graphAxisTick> layerAxisTickLabels(int s, int l) const {675 vector<graphAxisTick> tick;675 std::vector<graphAxisTick> layerAxisTickLabels(int s, int l) const { 676 std::vector<graphAxisTick> tick; 676 677 tick.push_back(GRAPH[s].layer[l].yAxis.tickAxis[0]); //bottom 677 678 tick.push_back(GRAPH[s].layer[l].yAxis.tickAxis[1]); //top … … 680 681 return tick; 681 682 } //!< get tick labels of axes of layer l of graph s 682 vector<double> layerHistogram(int s, int l) const {683 vector<double> range;683 std::vector<double> layerHistogram(int s, int l) const { 684 std::vector<double> range; 684 685 range.push_back(GRAPH[s].layer[l].histogram_bin); 685 686 range.push_back(GRAPH[s].layer[l].histogram_begin); … … 740 741 int compareMatrixnames(char *sname) const; //!< returns matching matrix index 741 742 int compareFunctionnames(const char *sname) const; //!< returns matching function index 742 vector<string> findDataByIndex(int index) const;743 st ring findObjectByIndex(int index);743 std::vector<std::string> findDataByIndex(int index) const; 744 std::string findObjectByIndex(int index); 744 745 void readSpreadInfo(FILE *fopj, FILE *fdebug); 745 746 void readExcelInfo(FILE *f, FILE *debug); … … 760 761 int dataIndex; 761 762 int objectIndex; 762 st ring resultsLog;763 vector <spreadSheet> SPREADSHEET;764 vector <matrix> MATRIX;765 vector <excel> EXCEL;766 vector <function> FUNCTION;767 vector <graph> GRAPH;768 vector <note> NOTE;763 std::string resultsLog; 764 std::vector <spreadSheet> SPREADSHEET; 765 std::vector <matrix> MATRIX; 766 std::vector <excel> EXCEL; 767 std::vector <function> FUNCTION; 768 std::vector <graph> GRAPH; 769 std::vector <note> NOTE; 769 770 tree <projectNode> projectTree; 770 771 }; -
trunk/Code/qtiplot/qtiplot/src/importOPJ.cpp
r944 r5355 55 55 56 56 #include <gsl/gsl_math.h> 57 58 using std::vector; 57 59 58 60 #define OBJECTXOFFSET 200
