00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00015
00016
00017 #if !defined(OPENNURBS_DIMSTYLE_INC_)
00018 #define OPENNURBS_DIMSTYLE_INC_
00019
00020 class ON_CLASS ON_DimStyle : public ON_Object
00021 {
00022 ON_OBJECT_DECLARE(ON_DimStyle);
00023
00024 public:
00025 enum eArrowType
00026 {
00027 solidtriangle = 0,
00028 dot = 1,
00029 tick = 2,
00030 shorttriangle = 3,
00031 arrow = 4,
00032 rectangle = 5,
00033 longtriangle = 6,
00034 longertriangle = 7,
00035 };
00036
00037 ON_DimStyle();
00038 ~ON_DimStyle();
00039
00040
00041 ON_DimStyle& operator=( const ON_3dmAnnotationSettings& src);
00042
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066 ON_BOOL32 IsValid( ON_TextLog* text_log = NULL ) const;
00067
00068
00069 void Dump( ON_TextLog& ) const;
00070
00071
00072 ON_BOOL32 Write(
00073 ON_BinaryArchive&
00074 ) const;
00075
00076
00077 ON_BOOL32 Read(
00078 ON_BinaryArchive&
00079 );
00080
00081 void EmergencyDestroy();
00082
00083
00084 ON_UUID ModelObjectId() const;
00085
00086
00088
00089
00090
00091 void SetName( const wchar_t* );
00092 void SetName( const char* );
00093
00094 void GetName( ON_wString& ) const;
00095 const wchar_t* Name() const;
00096
00097 void SetIndex(int);
00098 int Index() const;
00099
00100 void SetDefaults();
00101 void SetDefaultsNoExtension();
00102
00103
00104 double ExtExtension() const;
00105 void SetExtExtension( const double);
00106
00107 double ExtOffset() const;
00108 void SetExtOffset( const double);
00109
00110 double ArrowSize() const;
00111 void SetArrowSize( const double);
00112
00113 double LeaderArrowSize() const;
00114 void SetLeaderArrowSize( const double);
00115
00116 double CenterMark() const;
00117 void SetCenterMark( const double);
00118
00119 int TextAlignment() const;
00120 void SetTextAlignment( ON::eTextDisplayMode);
00121
00122 int ArrowType() const;
00123 void SetArrowType( eArrowType);
00124
00125 int LeaderArrowType() const;
00126 void SetLeaderArrowType( eArrowType);
00127
00128 int AngularUnits() const;
00129 void SetAngularUnits( int);
00130
00131 int LengthFormat() const;
00132 void SetLengthFormat( int);
00133
00134 int AngleFormat() const;
00135 void SetAngleFormat( int);
00136
00137 int LengthResolution() const;
00138 void SetLengthResolution( int);
00139
00140 int AngleResolution() const;
00141 void SetAngleResolution( int);
00142
00143 int FontIndex() const;
00144 virtual void SetFontIndex( int index);
00145
00146 double TextGap() const;
00147 void SetTextGap( double gap);
00148
00149 double TextHeight() const;
00150 void SetTextHeight( double height);
00151
00152
00153 double LengthFactor() const;
00154 ON_DEPRECATED void SetLengthactor( double);
00155 void SetLengthFactor( double);
00156
00157 bool Alternate() const;
00158 void SetAlternate( bool);
00159
00160 double AlternateLengthFactor() const;
00161 ON_DEPRECATED void SetAlternateLengthactor( double);
00162 void SetAlternateLengthFactor( double);
00163
00164 int AlternateLengthFormat() const;
00165 void SetAlternateLengthFormat( int);
00166
00167 int AlternateLengthResolution() const;
00168 void SetAlternateLengthResolution( int);
00169
00170 int AlternateAngleFormat() const;
00171 void SetAlternateAngleFormat( int);
00172
00173 int AlternateAngleResolution() const;
00174 void SetAlternateAngleResolution( int);
00175
00176 void GetPrefix( ON_wString& ) const;
00177 const wchar_t* Prefix() const;
00178 void SetPrefix( const wchar_t*);
00179 void SetPrefix( wchar_t*);
00180
00181 void GetSuffix( ON_wString& ) const;
00182 const wchar_t* Suffix() const;
00183 void SetSuffix( const wchar_t*);
00184 void SetSuffix( wchar_t*);
00185
00186 void GetAlternatePrefix( ON_wString& ) const;
00187 const wchar_t* AlternatePrefix() const;
00188 void SetAlternatePrefix( const wchar_t*);
00189 void SetAlternatePrefix( wchar_t*);
00190
00191 void GetAlternateSuffix( ON_wString& ) const;
00192 const wchar_t* AlternateSuffix() const;
00193 void SetAlternateSuffix( const wchar_t*);
00194 void SetAlternateSuffix( wchar_t*);
00195
00196 bool SuppressExtension1() const;
00197 void SetSuppressExtension1( bool);
00198
00199 bool SuppressExtension2() const;
00200 void SetSuppressExtension2( bool);
00201
00202
00203 ON_DEPRECATED void Composite( const ON_DimStyle& override);
00204
00205
00206
00207 enum eField
00208 {
00209 fn_name = 0,
00210 fn_index = 1,
00211 fn_extextension = 2,
00212 fn_extoffset = 3,
00213 fn_arrowsize = 4,
00214 fn_centermark = 5,
00215 fn_textgap = 6,
00216 fn_textheight = 7,
00217 fn_textalign = 8,
00218 fn_arrowtype = 9,
00219 fn_angularunits = 10,
00220 fn_lengthformat = 11,
00221 fn_angleformat = 12,
00222 fn_angleresolution = 13,
00223 fn_lengthresolution = 14,
00224 fn_fontindex = 15,
00225 fn_lengthfactor = 16,
00226 fn_bAlternate = 17,
00227 fn_alternate_lengthfactor = 18,
00228 fn_alternate_lengthformat = 19,
00229 fn_alternate_lengthresolution = 20,
00230 fn_alternate_angleformat = 21,
00231 fn_alternate_angleresolution = 22,
00232 fn_prefix = 23,
00233 fn_suffix = 24,
00234 fn_alternate_prefix = 25,
00235 fn_alternate_suffix = 26,
00236 fn_dimextension = 27,
00237 fn_leaderarrowsize = 28,
00238 fn_leaderarrowtype = 29,
00239 fn_suppressextension1 = 30,
00240 fn_suppressextension2 = 31,
00241 fn_last = 32,
00242
00243
00244
00245 fn_overall_scale = 33,
00246 fn_ext_line_color_source = 34,
00247 fn_dim_line_color_source = 35,
00248 fn_arrow_color_source = 36,
00249 fn_text_color_source = 37,
00250 fn_ext_line_color = 38,
00251 fn_dim_line_color = 39,
00252 fn_arrow_color = 40,
00253 fn_text_color = 41,
00254 fn_ext_line_plot_color_source = 42,
00255 fn_dim_line_plot_color_source = 43,
00256 fn_arrow_plot_color_source = 44,
00257 fn_text_plot_color_source = 45,
00258 fn_ext_line_plot_color = 46,
00259 fn_dim_line_plot_color = 47,
00260 fn_arrow_plot_color = 48,
00261 fn_text_plot_color = 49,
00262 fn_ext_line_plot_weight_source = 50,
00263 fn_dim_line_plot_weight_source = 51,
00264 fn_ext_line_plot_weight_mm = 52,
00265 fn_dim_line_plot_weight_mm = 53,
00266 fn_tolerance_style = 54,
00267 fn_tolerance_resolution = 55,
00268 fn_tolerance_upper_value = 56,
00269 fn_tolerance_lower_value = 57,
00270 fn_tolerance_height_scale = 58,
00271 fn_baseline_spacing = 59,
00272
00273
00274
00275 fn_draw_mask = 60,
00276 fn_mask_color_source = 61,
00277 fn_mask_color = 62,
00278 fn_mask_border = 63,
00279
00280
00281
00282 fn_dimscale = 64,
00283 fn_dimscale_source = 65,
00284
00285
00286
00287
00288 fn_really_last = 0xFFFF
00289 };
00290
00291
00292
00293 ON_DEPRECATED void InvalidateField( eField field);
00294 ON_DEPRECATED void InvalidateAllFields();
00295 ON_DEPRECATED void ValidateField( eField field);
00296 ON_DEPRECATED bool IsFieldValid( eField) const;
00297
00298
00299 double DimExtension() const;
00300 void SetDimExtension( const double);
00301
00302
00303
00304
00305
00306
00307 bool IsFieldOverride( eField field_id) const;
00308
00309
00310 void SetFieldOverride( ON_DimStyle::eField field_id, bool bOverride);
00311
00312
00313 bool HasOverrides() const;
00314
00315
00316
00317
00318
00319 bool OverrideFields( const ON_DimStyle& source, const ON_DimStyle& parent);
00320
00321
00322
00323
00324
00325
00326 bool InheritFields( const ON_DimStyle& parent);
00327
00328
00329 bool IsChildDimstyle() const;
00330
00331
00332
00333 bool IsChildOf( const ON_UUID& parent_uuid) const;
00334 bool IsChildOf( ON_UUID& parent_uuid) const;
00335
00336 ON_UUID ParentId() const;
00337
00338
00339 void SetParentId( ON_UUID parent_uuid);
00340 ON_DEPRECATED void SetParent( ON_UUID& parent_uuid);
00341
00342
00343
00344
00345
00346
00347
00348
00349 int ToleranceStyle() const;
00350 int ToleranceResolution() const;
00351 double ToleranceUpperValue() const;
00352 double ToleranceLowerValue() const;
00353 double ToleranceHeightScale() const;
00354
00355 double BaselineSpacing() const;
00356
00357 void SetToleranceStyle( int style);
00358 void SetToleranceResolution( int resolution);
00359 void SetToleranceUpperValue( double upper_value);
00360 void SetToleranceLowerValue( double lower_value);
00361 void SetToleranceHeightScale( double scale);
00362
00363 void SetBaselineSpacing( double spacing = false);
00364
00365
00366 bool DrawTextMask() const;
00367 void SetDrawTextMask(bool bDraw);
00368
00369
00370
00371
00372 int MaskColorSource() const;
00373 void SetMaskColorSource(int source);
00374
00375 ON_Color MaskColor() const;
00376
00377 void SetMaskColor(ON_Color color);
00378
00379
00380 void SetDimScaleSource(int source);
00381 int DimScaleSource() const;
00382 void SetDimScale(double scale);
00383 double DimScale() const;
00384
00385
00386
00387
00388 double MaskOffsetFactor() const;
00389
00390 void Scale( double scale);
00391
00392
00393
00394 void SetSourceDimstyle(ON_UUID source_uuid);
00395 ON_UUID SourceDimstyle() const;
00396
00397
00398 static int DefaultToleranceStyle();
00399 static int DefaultToleranceResolution();
00400 static double DefaultToleranceUpperValue();
00401 static double DefaultToleranceLowerValue();
00402 static double DefaultToleranceHeightScale();
00403 static double DefaultBaselineSpacing();
00404 static bool DefaultDrawTextMask();
00405 static int DefaultMaskColorSource();
00406 static ON_Color DefaultMaskColor();
00407 static double DefaultDimScale();
00408 static int DefaultDimScaleSource();
00409
00410 bool CompareFields(const ON_DimStyle& other) const;
00411
00412 public:
00413 ON_wString m_dimstyle_name;
00414 int m_dimstyle_index;
00415 ON_UUID m_dimstyle_id;
00416
00417 double m_extextension;
00418 double m_extoffset;
00419 double m_arrowsize;
00420 double m_centermark;
00421 double m_textgap;
00422 double m_textheight;
00423 int m_textalign;
00424 int m_arrowtype;
00425 int m_angularunits;
00426 int m_lengthformat;
00427 int m_angleformat;
00428 int m_angleresolution;
00429 int m_lengthresolution;
00430
00431 int m_fontindex;
00432
00433
00434 double m_lengthfactor;
00435 bool m_bAlternate;
00436
00437 double m_alternate_lengthfactor;
00438 int m_alternate_lengthformat;
00439 int m_alternate_lengthresolution;
00440
00441 int m_alternate_angleformat;
00442 int m_alternate_angleresolution;
00443 ON_wString m_prefix;
00444 ON_wString m_suffix;
00445 ON_wString m_alternate_prefix;
00446 ON_wString m_alternate_suffix;
00447
00448 private:
00449 unsigned int m_valid;
00450 public:
00451
00452
00453 double m_dimextension;
00454
00455
00456 double m_leaderarrowsize;
00457 int m_leaderarrowtype;
00458 bool m_bSuppressExtension1;
00459 bool m_bSuppressExtension2;
00460
00461
00462
00463
00464 class ON_DimStyleExtra* DimStyleExtension();
00465 const class ON_DimStyleExtra* DimStyleExtension() const;
00466 };
00467
00468 #endif
00469