00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include "TeVisual.h"
00024
00025 TeBaseVisualParams::TeBaseVisualParams(TeGeomRep rep, const string& visualType) :
00026 symbId_ (TePolyTypeFill),
00027 color_ (255,0,0),
00028 transparency_ (0),
00029 width_ (0),
00030 contourSymbId_ (TeLnTypeContinuous),
00031 contourColor_(0,255,255),
00032 contourTransparency_ (0),
00033 contourWidth_ (1),
00034 sizeValue_ (0),
00035 ptAngle_ (0),
00036 family_ ("Verdana"),
00037 bold_ (false),
00038 italic_(false),
00039 alignmentVert_(0),
00040 alignmentHoriz_(0),
00041 tabSize_(6),
00042 lineSpace_(1),
00043 fixedSize_(false),
00044 visualType_(visualType),
00045 geomRep_(rep)
00046 {
00047 switch (rep)
00048 {
00049 case TePOLYGONS:
00050 case TeCELLS:
00051 symbId_= TePolyTypeFill;
00052 contourSymbId_= TeLnTypeContinuous;
00053 break;
00054 case TeLINES:
00055 symbId_= TeLnTypeContinuous;
00056 width_ = 1;
00057 break;
00058 case TePOINTS:
00059 case TeNODES:
00060 symbId_= TePtTypeBox;
00061 sizeValue_ = 3;
00062 break;
00063 case TeTEXT:
00064 sizeValue_= 12;
00065 break;
00066 default:
00067 break;
00068 }
00069 }
00070
00071
00072 TeBaseVisualParams::TeBaseVisualParams(const TeBaseVisualParams& other)
00073 {
00074 symbId_ = other.symbId_;
00075 color_ = other.color_;
00076 transparency_ = other.transparency_;
00077 width_ = other.width_;
00078
00079 contourSymbId_ = other.contourSymbId_;
00080 contourColor_ = other.contourColor_;
00081 contourTransparency_ = other.contourTransparency_;
00082 contourWidth_ = other.contourWidth_;
00083
00084 sizeValue_ = other.sizeValue_;
00085 ptAngle_ = other.ptAngle_;
00086
00087 family_ = other.family_;
00088 bold_ = other.bold_;
00089 italic_ = other.italic_;
00090 fixedSize_ = other.fixedSize_;
00091 alignmentVert_ = other.alignmentVert_;
00092 alignmentHoriz_ = other.alignmentHoriz_;
00093 tabSize_ = other.tabSize_;
00094 lineSpace_ = other.lineSpace_;
00095
00096 visualType_ = other.visualType_;
00097 geomRep_ = other.geomRep_;
00098 }
00099
00100
00101 TeBaseVisualParams&
00102 TeBaseVisualParams::operator=(const TeBaseVisualParams& vis)
00103 {
00104 if ( this != &vis )
00105 {
00106 symbId_ = vis.symbId_;
00107 color_ = vis.color_;
00108 transparency_ = vis.transparency_;
00109 width_ = vis.width_;
00110
00111 contourSymbId_ = vis.contourSymbId_;
00112 contourColor_ = vis.contourColor_;
00113 contourTransparency_ = vis.contourTransparency_;
00114 contourWidth_ = vis.contourWidth_;
00115
00116 sizeValue_ = vis.sizeValue_;
00117 ptAngle_ = vis.ptAngle_;
00118
00119 family_ = vis.family_;
00120 bold_ = vis.bold_;
00121 italic_ = vis.italic_;
00122 fixedSize_ = vis.fixedSize_;
00123 alignmentVert_ = vis.alignmentVert_;
00124 alignmentHoriz_ = vis.alignmentHoriz_;
00125 tabSize_ = vis.tabSize_;
00126 lineSpace_ = vis.lineSpace_;
00127
00128 visualType_ = vis.visualType_;
00129 geomRep_ = vis.geomRep_;
00130 }
00131 return *this;
00132 }
00133
00134
00135 bool
00136 TeBaseVisualParams::operator== (const TeBaseVisualParams& vis)
00137 {
00138 return ( symbId_ == vis.symbId_ &&
00139 color_ == vis.color_ &&
00140 transparency_ == vis.transparency_ &&
00141 width_ == vis.width_ &&
00142 contourSymbId_ == vis.contourSymbId_ &&
00143 contourColor_ == vis.contourColor_ &&
00144 contourTransparency_ == vis.contourTransparency_ &&
00145 contourWidth_ == vis.contourWidth_ &&
00146 sizeValue_ == vis.sizeValue_ &&
00147 ptAngle_ == vis.ptAngle_ &&
00148 family_ == vis.family_ &&
00149 bold_ == vis.bold_ &&
00150 italic_ == vis.italic_ &&
00151 fixedSize_ == vis.fixedSize_ &&
00152 alignmentVert_ == vis.alignmentVert_ &&
00153 alignmentHoriz_ == vis.alignmentHoriz_ &&
00154 tabSize_ == vis.tabSize_ &&
00155 lineSpace_ == vis.lineSpace_ &&
00156 visualType_ == vis.visualType_ &&
00157 geomRep_ == vis.geomRep_);
00158 }
00159
00160
00161 void
00162 TeBaseVisualParams::clear()
00163 {
00164 symbId_ = TePolyTypeFill;
00165 color_ = TeColor(255,0,0);
00166 transparency_=0;
00167 width_ = 0;
00168 contourSymbId_ = TeLnTypeContinuous;
00169 contourColor_ = TeColor (0,255,255);
00170 contourTransparency_ = 0;
00171 contourWidth_ = 1;
00172 sizeValue_ = 0;
00173 ptAngle_ = 0;
00174 family_ = "Verdana";
00175 bold_ = false;
00176 italic_ = false;
00177 alignmentVert_ = 0;
00178 alignmentHoriz_ = 0;
00179 tabSize_ = 6;
00180 lineSpace_ = 1;
00181 fixedSize_ = false;
00182 geomRep_ = TePOLYGONS;
00183 visualType_="tevisual";
00184 }
00185
00186
00187 void
00188 TeBaseVisualParams::setBasic (TeBaseVisualParams &vis)
00189 {
00190 symbId_ = vis.symbId_;
00191 color_ = vis.color_;
00192 transparency_ = vis.transparency_;
00193 width_ = vis.width_;
00194
00195 contourSymbId_ = vis.contourSymbId_;
00196 contourColor_ = vis.contourColor_;
00197 contourTransparency_ = vis.contourTransparency_;
00198 contourWidth_ = vis.contourWidth_;
00199
00200 sizeValue_ = vis.sizeValue_;
00201 ptAngle_ = vis.ptAngle_;
00202
00203 family_ = vis.family_;
00204 bold_ = vis.bold_;
00205 italic_ = vis.italic_;
00206 fixedSize_ = vis.fixedSize_;
00207 alignmentVert_ = vis.alignmentVert_;
00208 alignmentHoriz_ = vis.alignmentHoriz_;
00209 tabSize_ = vis.tabSize_;
00210 lineSpace_ = vis.lineSpace_;
00211 geomRep_ = vis.geomRep_;
00212 visualType_="tevisual";
00213 }
00214
00215
00216
00217 TeVisual::TeVisual(TeGeomRep rep) :
00218 params_ (TeBaseVisualParams(rep, "tevisual"))
00219 {
00220 }
00221
00222
00223 TeVisual::TeVisual(const TeVisual& other)
00224 {
00225 params_ = other.params_;
00226 }
00227
00228
00229 TeVisual&
00230 TeVisual::operator=(const TeVisual& vis)
00231 {
00232 if ( this != &vis )
00233 params_ = vis.params_;
00234 return *this;
00235 }
00236
00237
00238 bool
00239 TeVisual::operator== (const TeVisual& vis)
00240 {
00241 return ( params_ == vis.params_);
00242 }
00243
00244
00245 void
00246 TeVisual::clear()
00247 {
00248 params_.clear();
00249 }
00250
00251
00252 void
00253 TeVisual::setBasic (TeVisual &vis)
00254 {
00255 params_.setBasic(vis.params_);
00256 }
00257
00258