00001 00005 class GraphBasics 00006 00007 { 00008 Os out; 00009 ColorScale scale; 00010 bool pen_up; 00011 int spdim; 00012 FieldPlotType plot_type; 00013 String nameofset; 00014 SetOfNo(real) drawlinebuf, 00015 movelinebuf, 00016 pointbuf; 00017 real current_value, 00018 last_value, 00019 max_arrowlen; 00020 Ptv(real) scalingfactors; 00021 00022 void addPointToList 00023 ( 00024 SetOfNo(real)& buf, 00025 const Ptv(real)& point 00026 ); 00027 00028 void flushLineBuf 00029 ( 00030 SetOfNo(real)& buf, 00031 const bool empty_list 00032 ); 00033 00034 void flushPointBuf(); 00035 void writeLineBuf (); 00036 void writePointBuf (); 00037 void writePlotSpec (); 00038 void writeValue(); 00039 bool penIsUp () const { return pen_up; } 00040 bool penIsDown () const { return notbool(pen_up); } 00041 void endOfDataSet (); 00042 00043 public: 00044 GraphBasics 00045 ( 00046 const String& filename, 00047 const int spacedim = 3, 00048 const FieldPlotType pltype = UNSPECIFIED, 00049 const char* name_of_data_set = "NONAME", 00050 const Format_type format = ASCII 00051 ); 00052 00053 ~GraphBasics (); 00054 00055 00056 void penUp() { pen_up = true; } 00057 void penDown() { pen_up = false; } 00058 00059 void move (const Ptv(real)& to); 00060 void move (const real x, const real y, const real z); 00061 void move (const real x, const real y); 00062 00063 void drawLine (const Ptv(real)& from, const Ptv(real)& to); 00064 void drawLine 00065 ( 00066 const real xfrom, 00067 const real yfrom, 00068 const real zfrom, 00069 const real xto, 00070 const real yto, 00071 const real zto 00072 ); 00073 void drawLine 00074 ( 00075 const real xfrom, 00076 const real yfrom, 00077 const real xto, 00078 const real yto 00079 ); 00080 00081 00082 void drawLine (const Ptv(real)& to); 00083 void drawLine (const real x, const real y, const real z); 00084 void drawLine (const real x, const real y); 00085 00086 void fillPolygon (const Ptv(real) points[], const int npoints); 00087 00088 void markPoint (const Ptv(real)& point); 00089 void markPoint (const real x, const real y, const real z); 00090 void markPoint (const real x, const real y); 00091 00092 void writeText 00093 ( 00094 const char* text, 00095 const Ptv(real)* start_pt = NULL, 00096 const Ptv(real)* end_pt = NULL 00097 ); 00098 00099 void drawArrow 00100 ( 00101 const Ptv(real)& start_pt, 00102 const Ptv(real)& vector 00103 ); 00104 void drawArrow 00105 ( 00106 const real start_pt_x, 00107 const real start_pt_y, 00108 const real start_pt_z, 00109 const real vector_x, 00110 const real vector_y, 00111 const real vector_z 00112 ); 00113 void drawArrow 00114 ( 00115 const real start_pt_x, 00116 const real start_pt_y, 00117 const real vector_x, 00118 const real vector_y 00119 ); 00120 void setValue (const real value); 00121 void setMaxArrowLen (const real length); 00122 00123 00124 00125 void setColorScale 00126 ( 00127 const real min_value, 00128 const Color& low, 00129 const real max_value, 00130 const Color& high 00131 ); 00132 00133 00134 void setColorScale 00135 ( 00136 const real min_value, 00137 const real r_low, 00138 const real g_low, 00139 const real b_low, 00140 const real max_value, 00141 const real r_high, 00142 const real g_high, 00143 const real b_high 00144 ); 00145 00146 00147 void setCoordinateScalingFactors 00148 ( 00149 const real xfactor = 1, 00150 const real yfactor = 1, 00151 const real zfactor = 1 00152 ); 00153 00154 int getDim () const {return spdim;} 00155 00156 void close (); 00157 }; 00158 00159