BioInt  1.02.00
BioInt: An integrative biological object-oriented application framework and interpreter
BioPostScript.h
Go to the documentation of this file.
00001 #ifndef BIOPOSTSCRIPT_H
00002 #define BIOPOSTSCRIPT_H
00003 
00004 #include <map>
00005 #include "BioData.h"
00006 
00007 using namespace std;
00008 
00009 class BioPostScript  : public ofstream
00010 {
00011         private :
00012       void printDataFromShowData(BioData& bd,float startx,float starty);   
00013                       string psFile_;
00014                           map<string,string> psFonts_;
00015                       vector<double> multiPlotColors;
00016                       
00017                       double rangeMinX_;            double rangeMaxY_;
00018                       double rangeMaxX_;            double rangeMinY_;
00019                       bool XRANGESET;
00020                       bool YRANGESET;                      
00021 
00022                       bool CLOSECALLED;
00023        public :                         
00024                                   //Block parameters       //page parameters
00025                                 int block_[4];          int page_[4];
00026                                 float bgColor_[3];      float pBgColor_[3];
00027                         float bFontColor_[3];   float pFontColor_[3];
00028 
00029                      //block variables        //page variables
00030                       string font_;           string pFont_;
00031                       string alignment_;      string pAlignment_;
00032                       float lineGap_;         float pLineGap_;
00033                       float fontSize_;        float pFontSize_;
00034                       float x_,y_;            float px_,py_;
00035                                               int PAGEX1,PAGEY1,PAGEX2,PAGEY2;
00036                           bool BOLD;              bool pBOLD;
00037                           bool ITALIC;            bool pITALIC;
00038                       bool UNDERLINE;         bool pUNDERLINE;
00039                       bool INBLOCK;           bool pageBorder;
00040 
00041                       float bc[3];
00042        void setBlockBackgroundColor(int r,int g,int b);
00043        void UpdateForBlock(ifstream&,ofstream&);
00044        void UpdateForPage(ifstream&,ofstream&);
00045        void setBorder(int*,float*);
00046        void write(void);
00047        void setText(ofstream&,string,bool);
00048        void setBoldItalic(void);
00049 
00050        void showPieGraph(vector<double>,string="PIEGRAPH");
00051        void showPieGraph(vector<double>,vector<string>,string="PIEGRAPH");
00052        void showBarGraph (vector<double>,string="Bargraph",string="xtitle",string="ytitle",bool AS_IT_IS=0,bool=0);
00053        void showBarGraph (vector<double>,vector<string>,string="Bargraph",string="xtitle",string="ytitle",bool AS_IT_IS=0,bool=0);//added on 20-december'04
00054 
00055        void showLineGraph (vector<double>,vector<double>,double minx,double miny,double maxy,string="Linegraph",string="xtitle",string="ytitle",bool=0);
00056 //       void showLineGraph (vector<double>,vector<double>,string="LINEGRAPH",string="XTITLE",string="YTITLE",bool=0);
00057 
00058         public :
00059         BioPostScript(){}
00060         BioPostScript(string file);
00061        ~BioPostScript();
00062 
00063        void BioPostScriptClose();
00064 
00065        void setPostScriptFile(string filename);
00066 
00067        void setBlockBegin(int x,int y,int width,int height,int r=255,int g=255,int b=255,bool border=0,int r1=0,int g1=0,int b1=0);
00068        void setBlockEnd();
00069 
00070        void setFontColor(float,float,float);
00071        void setFont(string fontname);
00072        void setFontSize(float size);
00073 
00074        void setText(string text);
00075 
00076        void setAlign(string);
00077 
00078        void setStyle(const string font,float size,bool bold=0,bool italic=0,bool underline=0);
00079 
00080        //added on 16 march 2005
00081        void setUnderLine(bool YESorNO=0);
00082 
00083        void setPage(int,int,int,int,int=255,int=255,int=255,bool=0,int=0,int=0,int=0,bool=1);
00084        void setPageDefault(void);
00085 
00086        void setBreakLine(int n=1);
00087 
00088        void setText(string,float,float);
00089 
00090        void setBold(bool);
00091        void setItalic(bool);
00092 
00093        void setDefaults(void);
00094 
00095        void endPage(void);
00096 
00097        //Geometrics
00098        void setLine(float,float,float,float);
00099        //added on 12th Jan 2005
00100        void setPoint(int x1,int y1,float width=1.0);
00101        void setRectangle(int lowerLeftx,int lowerLefty,int width,int height,bool fill=0);
00102        void setCircle(int x1,int y1,int radius,bool fill=0);
00103        void setTriangle(int x1,int y1,int size, bool fill=0);
00104        void setLineWidth(float width=1.0);
00105        
00106        void setTics(float x,float y,float barLength,int sequenceLen,int howMany);                 
00107        void setTics(float x,float y,float barLength,int start,int sequenceLen,int howMany);       
00108        void setYTics(float x,float y,int offset);
00109        void setXTics(float x,float y,int offset);
00110        
00111        int  getHeight(int,float=10.0);
00112        int  getWidth(int,float=10.0,string="TIMES");
00113                               
00114        //Piegraphs
00115        void showPieGraph(BioData,string="PIEGRAPH");//added on 20-december'04
00116        void showMultiplePieGraphs(vector<BioData>,vector<string>);
00117        void showMultiplePieGraphs(vector<BioData>);
00118 
00119        //BarGraphs
00120        //the final bool value indicates if the "values" must be displayed or not
00121        //bool represents whether to display values in the graph or not.
00122 
00123        void showBarGraph (BioData,string title="Bargraph",string xtitle="xtitle",string ytitle="ytitle",bool AS_IT_IS=0,bool=0);
00124        void showBarGraph (BioData,int colno,string title="Bargraph",string xtitle="xtitle",string ytitle="ytitle",bool AS_IT_IS=0,bool=0);
00125        void showMultipleBarGraphs(vector<BioData>,vector<string> title,vector<string> xtitle,vector<string> ytitle,bool AS_IT_IS=0,bool=0);
00126        void showMultipleBarGraphs(vector<BioData>,bool AS_IT_IS=0,bool b=0);
00127 
00128 
00129        //Linegraph
00130 
00131        void showLineGraph (BioData,string title="Linegraph",string xtitle="xlabel",string ytitle="ylabel",bool s=0);
00132        void showLineGraph (BioData,vector<string> labels,string title="Linegraph",string xtitle="xlabel",string ytitle="ylabel",bool s=0);
00133        void showMultipleLineGraphs(vector<BioData>,vector<string> title,vector<string> xtitle,vector<string> ytitle,bool=0);
00134        void showMultipleLineGraphs(vector<BioData>,bool b=0);
00135 
00136        //Biodata related
00137        void showData (BioData& bd,float startx,float starty);
00138 
00139        //added on 29-apr-05
00140        void setXRange(double minx,double maxx);
00141        void setYRange(double miny,double maxy);
00142  
00143 };
00144                                     
00145 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines