00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 #ifndef INC_MI32_LABLSTYL_H
00055 #define INC_MI32_LABLSTYL_H
00056
00057 #ifndef INC_MI32_ELEMSTYL_H
00058 #include <mi32/elemstyl.h>
00059 #endif
00060
00061 #ifndef INC_RVC_STYLE_H
00062 #include <rvc/style.h>
00063 #endif
00064
00065 #ifndef INC_MI32_MG2ENUMS_H
00066 #include <mi32/mg2enums.h>
00067 #endif
00068
00069 struct SMLCONTEXT;
00070
00071
00072
00073 class LABELFRAMEPARMS {
00074 public:
00075 enum FRAMESHAPE {
00076 FRAMESHAPE_None = 0,
00077 FRAMESHAPE_Rectangle,
00078 FRAMESHAPE_RoundedRectangle,
00079 FRAMESHAPE_Ellipse,
00080 FRAMESHAPE_Circle
00081 };
00082
00083
00084 LABELFRAMEPARMS (
00085 ) :
00086 m_FrameShape(FRAMESHAPE_None),
00087 m_Margin(0.0),
00088 m_bCartoonBalloonLeaders(false),
00089 m_TMargin(0.0),
00090 m_BMargin(0.0),
00091 m_LMargin(0.0),
00092 m_RMargin(0.0),
00093 m_Arrow(0)
00094 {
00095 }
00096
00097
00098 LABELFRAMEPARMS (
00099 const LABELFRAMEPARMS& rhs
00100 ) { Copy(rhs); }
00101
00102
00103 ~LABELFRAMEPARMS() {}
00104
00105
00106 LABELFRAMEPARMS& operator= (
00107 const LABELFRAMEPARMS& rhs
00108 ) { if (this != &rhs) { Copy(rhs); } return (*this); }
00109
00110 static const SERIALIZER::ITEMDEF* SerialGetItemDef ();
00111
00112
00113 void Copy (
00114 const LABELFRAMEPARMS& rhs
00115 );
00116
00117 bool GetCartoonBalloonLeaders (
00118 ) const {
00119 return m_bCartoonBalloonLeaders;
00120 }
00121
00122 FRAMESHAPE GetFrameShape (
00123 ) const {
00124 return m_FrameShape;
00125 }
00126
00127 const POLYSTYLE& GetFrameStyle (
00128 ) const {
00129 return m_FrameStyle;
00130 }
00131
00132 const LINESTYLE& GetLeaderStyle (
00133 ) const {
00134 return m_LeaderStyle;
00135 }
00136
00137
00138 double GetMargin (
00139 ) const {
00140 return m_Margin;
00141 }
00142
00143 double GetTopMargin (
00144 ) const {
00145 return m_TMargin + m_Margin;
00146 }
00147
00148 double GetBottomMargin (
00149 ) const {
00150 return m_BMargin + m_Margin;
00151 }
00152
00153 double GetLeftMargin (
00154 ) const {
00155 return m_LMargin + m_Margin;
00156 }
00157
00158 double GetRightMargin (
00159 ) const {
00160 return m_RMargin + m_Margin;
00161 }
00162
00163 void SetCartoonBalloonLeaders (
00164 bool value
00165 ) {
00166 m_bCartoonBalloonLeaders = value;
00167 }
00168
00169 void SetFrameShape (
00170 FRAMESHAPE shape
00171 ) {
00172 m_FrameShape = shape;
00173 }
00174
00175 void SetFrameStyle (
00176 const POLYSTYLE& style
00177 ) {
00178 m_FrameStyle = style;
00179 }
00180
00181 void SetLeaderStyle (
00182 const LINESTYLE& style
00183 ) {
00184 m_LeaderStyle = style;
00185 }
00186
00187 void SetMargin (
00188 double margin
00189 ) {
00190 m_Margin = margin;
00191 }
00192
00193 void SetTopMargin (
00194 double margin
00195 ) {
00196 m_TMargin = margin;
00197 }
00198
00199 void SetBottomMargin (
00200 double margin
00201 ) {
00202 m_BMargin = margin;
00203 }
00204
00205 void SetLeftMargin (
00206 double margin
00207 ) {
00208 m_LMargin = margin;
00209 }
00210
00211 void SetRightMargin (
00212 double margin
00213 ) {
00214 m_RMargin = margin;
00215 }
00216
00217 bool UsesTransparency (
00218 ) const {
00219 if (m_FrameShape != FRAMESHAPE_None && m_FrameStyle.UsesTransparency()) return (true);
00220 return (m_LeaderStyle.UsesTransparency());
00221 }
00222
00223 private:
00224 #ifndef GENERATING_DOXYGEN_OUTPUT
00225 POLYSTYLE m_FrameStyle;
00226 LINESTYLE m_LeaderStyle;
00227 FRAMESHAPE m_FrameShape;
00228 double m_Margin;
00229 bool m_bCartoonBalloonLeaders;
00230 double m_TMargin;
00231 double m_BMargin;
00232 double m_LMargin;
00233 double m_RMargin;
00234 int m_Arrow;
00235
00236 friend class SML_LABELFRAMEPARMS;
00237 #endif // GENERATING_DOXYGEN_OUTPUT
00238 };
00239
00240
00241 class LABELSTYLE : public LABELFRAMEPARMS {
00242 public:
00243
00244
00245 LABELSTYLE (
00246 ) :
00247 LABELFRAMEPARMS(),
00248 m_DesignScale(0.0),
00249 m_bClipUnderPass(false),
00250 m_BaselineFlag(MGD::BASELINE_Straight)
00251 {
00252 }
00253
00254
00255 LABELSTYLE (
00256 const LABELFRAMEPARMS& rhs
00257 ) :
00258 LABELFRAMEPARMS(rhs),
00259 m_DesignScale(0.0),
00260 m_bClipUnderPass(false),
00261 m_BaselineFlag(MGD::BASELINE_Straight)
00262 {
00263 }
00264
00265
00266 LABELSTYLE (
00267 const LABELSTYLE& rhs
00268 ): LABELFRAMEPARMS(rhs) { MyCopy(rhs); }
00269
00270
00271 ~LABELSTYLE() {}
00272
00273
00274 LABELSTYLE& operator= (
00275 const LABELSTYLE& rhs
00276 ) { if (this != &rhs) { MyCopy(rhs); } return (*this); }
00277
00278
00279 MGD::BASELINE GetBaselineFlag (
00280 ) const {
00281 return m_BaselineFlag;
00282 }
00283
00284 const RVC::STYLE::LINEPATTERN& GetBorderPattern (
00285 ) const {
00286 return m_BorderPattern;
00287 }
00288
00289 bool GetClipUnderPass (
00290 ) const {
00291 return m_bClipUnderPass;
00292 }
00293
00294 double GetDesignScale (
00295 ) const {
00296 return m_DesignScale;
00297 }
00298
00299 const RVC::STYLE::BASEPATTERN& GetFramePattern (
00300 ) const {
00301 if (GetFrameStyle().StyleFlags & STYLEFLAG_UseHatchPatt) return m_FramePatternH;
00302 return m_FramePatternB;
00303 }
00304
00305 const RVC::STYLE::LINEPATTERN& GetLeaderPattern (
00306 ) const {
00307 return m_LeaderPattern;
00308 }
00309
00310 const TEXTSTYLE& GetTextStyle (
00311 ) const {
00312 return m_TextStyle;
00313 }
00314
00315 void SetBaselineFlag (
00316 MGD::BASELINE flags
00317 ) {
00318 m_BaselineFlag = flags;
00319 }
00320
00321 void SetBorderPattern (
00322 const RVC::STYLE::LINEPATTERN& pattern
00323 ) {
00324 m_BorderPattern = pattern;
00325 }
00326
00327 void SetClipUnderPass (
00328 bool state
00329 ) {
00330 m_bClipUnderPass = state;
00331 }
00332
00333 void SetDesignScale (
00334 double scale
00335 ) {
00336 m_DesignScale = scale;
00337 }
00338
00339 void SetFramePattern (
00340 const RVC::STYLE::BITMAPPATTERN& pattern
00341 ) {
00342 m_FramePatternB = pattern;
00343 }
00344
00345 void SetFramePattern (
00346 const RVC::STYLE::HATCHPATTERN& pattern
00347 ) {
00348 m_FramePatternH = pattern;
00349 }
00350
00351 void SetLeaderPattern (
00352 const RVC::STYLE::LINEPATTERN& pattern
00353 ) {
00354 m_LeaderPattern = pattern;
00355 }
00356
00357 void SetTextStyle (
00358 const TEXTSTYLE& style
00359 ) {
00360 m_TextStyle = style;
00361 }
00362
00363
00364 bool UsesAntialiasing (
00365 ) const {
00366 return (m_TextStyle.UsesAntialiasing());
00367 }
00368
00369
00370
00371
00372 bool UsesTransparency (
00373 ) const {
00374 return (m_TextStyle.UsesTransparency() || LABELFRAMEPARMS::UsesTransparency());
00375 }
00376
00377 private:
00378 #ifndef GENERATING_DOXYGEN_OUTPUT
00379 TEXTSTYLE m_TextStyle;
00380 double m_DesignScale;
00381 RVC::STYLE::BITMAPPATTERN m_FramePatternB;
00382 RVC::STYLE::HATCHPATTERN m_FramePatternH;
00383 RVC::STYLE::LINEPATTERN m_BorderPattern;
00384 RVC::STYLE::LINEPATTERN m_LeaderPattern;
00385 bool m_bClipUnderPass;
00386 MGD::BASELINE m_BaselineFlag;
00387 friend class SML_LABELSTYLE;
00388
00389
00390 void MyCopy (
00391 const LABELSTYLE& rhs
00392 );
00393 #endif // GENERATING_DOXYGEN_OUTPUT
00394 };
00395
00396 PREVENT_MEMFUNC(LABELSTYLE)
00397
00398 #endif