Changeset 5355

Show
Ignore:
Timestamp:
26/07/10 11:51:20 (6 weeks ago)
Author:
Russell Taylor
Message:

Eliminate heinous import of entire standard library in Origin header file, which causes a clash with a type in tr1 when trying to compile using VS2010. Re #1389.

Location:
trunk/Code/qtiplot
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/Code/qtiplot/3rdparty/liborigin/OPJFile.cpp

    r944 r5355  
    3535#include <algorithm> //required for std::swap 
    3636#include "OPJFile.h" 
     37 
     38using std::vector; 
     39using std::string; 
    3740 
    3841const char* colTypeNames[] = {"X", "Y", "Z", "XErr", "YErr", "Label", "None"}; 
  • trunk/Code/qtiplot/3rdparty/liborigin/OPJFile.h

    r944 r5355  
    4141#include "tree.hh" 
    4242 
    43 using namespace std; 
     43// Russell Taylor, 23/07/10: Remove evil import - caused clash with std::tr1::function 
     44//using namespace std; 
    4445 
    4546struct rect { 
     
    7273        enum Title {Name, Label, Both}; 
    7374 
    74         string name; 
    75         string label; 
     75        std::string name; 
     76        std::string label; 
    7677        int objectID; 
    7778        bool bHidden; 
     
    8283        double modification_date; // Julian date/time 
    8384 
    84         originWindow(string _name="", string _label="", bool _bHidden=false) 
     85        originWindow(std::string _name="", std::string _label="", bool _bHidden=false) 
    8586        :       name(_name) 
    8687        ,       label(_label) 
     
    9596        int type; // 0 - double, 1 - string 
    9697        double d; 
    97         string s; 
     98        std::string s; 
    9899        originData(double _d) 
    99100        :       d(_d) 
     
    111112 
    112113struct spreadColumn { 
    113         string name; 
     114        std::string name; 
    114115        ColumnType type; 
    115116        int value_type;//Numeric = 0, Text = 1, Date = 2, Time = 3, Month = 4, Day = 5, Text&Numeric = 6 
     
    118119        int decimal_places; 
    119120        int numeric_display_type;//Default Decimal Digits=0, Decimal Places=1, Significant Digits=2 
    120         string command; 
    121         string comment; 
     121        std::string command; 
     122        std::string comment; 
    122123        int width; 
    123124        int index; 
    124         vector <originData> odata; 
    125         spreadColumn(string _name="", int _index=0) 
     125        std::vector <originData> odata; 
     126        spreadColumn(std::string _name="", int _index=0) 
    126127        :       name(_name) 
    127128        ,       index(_index) 
     
    141142        bool bLoose; 
    142143        bool bMultisheet; 
    143         vector <spreadColumn> column; 
    144         spreadSheet(string _name="") 
     144        std::vector <spreadColumn> column; 
     145        spreadSheet(std::string _name="") 
    145146        :       originWindow(_name) 
    146147        ,       bLoose(true) 
     
    152153        int maxRows; 
    153154        bool bLoose; 
    154         vector <spreadSheet> sheet; 
    155         excel(string _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) 
    156157        :       originWindow(_name, _label, _bHidden) 
    157158        ,       maxRows(_maxRows) 
     
    170171        int decimal_places; 
    171172        int numeric_display_type;//Default Decimal Digits=0, Decimal Places=1, Significant Digits=2 
    172         string command; 
     173        std::string command; 
    173174        int width; 
    174175        int index; 
    175176        ViewType view; 
    176177        HeaderViewType header; 
    177         vector <double> data; 
    178         matrix(string _name="", int _index=0) 
     178        std::vector <double> data; 
     179        matrix(std::string _name="", int _index=0) 
    179180        :       originWindow(_name) 
    180181        ,       index(_index) 
     
    191192 
    192193struct function { 
    193         string name; 
     194        std::string name; 
    194195        int type;//Normal = 0, Polar = 1 
    195         string formula; 
     196        std::string formula; 
    196197        double begin; 
    197198        double end; 
    198199        int points; 
    199200        int index; 
    200         function(string _name="", int _index=0) 
     201        function(std::string _name="", int _index=0) 
    201202        :       name(_name) 
    202203        ,       index(_index) 
     
    211212 
    212213struct text { 
    213         string txt; 
     214        std::string txt; 
    214215        rect clientRect; 
    215216        int color; 
     
    220221        int attach; 
    221222 
    222         text(const string& _txt="") 
     223        text(const std::string& _txt="") 
    223224                :       txt(_txt) 
    224225        {}; 
    225         text(const string& _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) 
    226227                :       txt(_txt) 
    227228                ,       clientRect(_clientRect) 
     
    271272        unsigned char arrow_angle; 
    272273        bool arrow_closed; 
    273         string endXColName; 
    274         string endYColName; 
     274        std::string endXColName; 
     275        std::string endYColName; 
    275276 
    276277        int position; 
    277         string angleColName; 
    278         string magnitudeColName; 
     278        std::string angleColName; 
     279        std::string magnitudeColName; 
    279280        float multiplier; 
    280281        int const_angle; 
     
    292293struct graphCurve { 
    293294        int type; 
    294         string dataName; 
    295         string xColName; 
    296         string yColName; 
     295        std::string dataName; 
     296        std::string xColName; 
     297        std::string yColName; 
    297298        int line_color; 
    298299        int line_style; 
     
    373374        int fontsize; 
    374375        bool fontbold; 
    375         string dataName; 
    376         string colName; 
     376        std::string dataName; 
     377        std::string colName; 
    377378        int rotation; 
    378379}; 
     
    457458        double histogram_end; 
    458459 
    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; 
    463464}; 
    464465 
     
    477478 
    478479struct graph : public originWindow { 
    479         vector<graphLayer> layer; 
     480        std::vector<graphLayer> layer; 
    480481        unsigned short width; 
    481482        unsigned short height; 
    482483 
    483         graph(string _name="") 
     484        graph(std::string _name="") 
    484485        :       originWindow(_name) 
    485486        {}; 
     
    487488 
    488489struct note : public originWindow { 
    489         string text; 
    490         note(string _name="") 
     490        std::string text; 
     491        note(std::string _name="") 
    491492        :       originWindow(_name) 
    492493        {}; 
     
    495496struct projectNode { 
    496497        int type; // 0 - object, 1 - folder 
    497         string name; 
     498        std::string name; 
    498499        double creation_date;     // Julian date/time 
    499500        double modification_date; // Julian date/time 
    500501 
    501         projectNode(string _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) 
    502503        :       name(_name) 
    503504        ,       type(_type) 
     
    579580        matrix::HeaderViewType matrixHeaderViewType(int m) const { return MATRIX[m].header; }   //!< get header view type of matrix m 
    580581        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 m 
     582        std::vector<double> matrixData(int m) const { return MATRIX[m].data; }  //!< get data of matrix m 
    582583 
    583584        //function properties 
     
    633634        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 
    634635        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 s 
    636         vector<line> layerLines(int s, int l) const { return GRAPH[s].layer[l].lines; } //!< get lines of layer l of graph s 
    637         vector<bitmap> layerBitmaps(int s, int l) const { return GRAPH[s].layer[l].bitmaps; } //!< get bitmaps of layer l of graph s 
     636        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 
    638639        graphAxisBreak layerXBreak(int s, int l) const { return GRAPH[s].layer[l].xAxisBreak; } //!< get break of horizontal axis of layer l of graph s 
    639640        graphAxisBreak layerYBreak(int s, int l) const { return GRAPH[s].layer[l].yAxisBreak; } //!< get break of vertical axis of layer l of graph s 
     
    644645                return graphLayerRange(GRAPH[s].layer[l].yAxis.min, GRAPH[s].layer[l].yAxis.max, GRAPH[s].layer[l].yAxis.step); 
    645646        } //!< 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; 
    648649                tick.push_back(GRAPH[s].layer[l].xAxis.majorTicks); 
    649650                tick.push_back(GRAPH[s].layer[l].xAxis.minorTicks); 
    650651                return tick; 
    651652        } //!< 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; 
    654655                tick.push_back(GRAPH[s].layer[l].yAxis.majorTicks); 
    655656                tick.push_back(GRAPH[s].layer[l].yAxis.minorTicks); 
    656657                return tick; 
    657658        } //!< 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; 
    660661                grid.push_back(GRAPH[s].layer[l].xAxis.majorGrid); 
    661662                grid.push_back(GRAPH[s].layer[l].xAxis.minorGrid); 
     
    664665                return grid; 
    665666        } //!< 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; 
    668669                format.push_back(GRAPH[s].layer[l].yAxis.formatAxis[0]); //bottom 
    669670                format.push_back(GRAPH[s].layer[l].yAxis.formatAxis[1]); //top 
     
    672673                return format; 
    673674        } //!< 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; 
    676677                tick.push_back(GRAPH[s].layer[l].yAxis.tickAxis[0]); //bottom 
    677678                tick.push_back(GRAPH[s].layer[l].yAxis.tickAxis[1]); //top 
     
    680681                return tick; 
    681682        } //!< 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; 
    684685                range.push_back(GRAPH[s].layer[l].histogram_bin); 
    685686                range.push_back(GRAPH[s].layer[l].histogram_begin); 
     
    740741        int compareMatrixnames(char *sname) const;                              //!< returns matching matrix index 
    741742        int compareFunctionnames(const char *sname) const;                              //!< returns matching function index 
    742         vector<string> findDataByIndex(int index) const; 
    743         string findObjectByIndex(int index); 
     743        std::vector<std::string> findDataByIndex(int index) const; 
     744        std::string findObjectByIndex(int index); 
    744745        void readSpreadInfo(FILE *fopj, FILE *fdebug); 
    745746        void readExcelInfo(FILE *f, FILE *debug); 
     
    760761        int dataIndex; 
    761762        int objectIndex; 
    762         string 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; 
    769770        tree <projectNode> projectTree; 
    770771}; 
  • trunk/Code/qtiplot/qtiplot/src/importOPJ.cpp

    r944 r5355  
    5555 
    5656#include <gsl/gsl_math.h> 
     57 
     58using std::vector; 
    5759 
    5860#define OBJECTXOFFSET 200