00001 /* $NoKeywords: $ */ 00002 /* 00003 // 00004 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. 00005 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert 00006 // McNeel & Associates. 00007 // 00008 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. 00009 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF 00010 // MERCHANTABILITY ARE HEREBY DISCLAIMED. 00011 // 00012 // For complete openNURBS copyright information see <http://www.opennurbs.org>. 00013 // 00015 */ 00016 00017 #if !defined(OPENNURBS_3DM_SETTINGS_INC_) 00018 #define OPENNURBS_3DM_SETTINGS_INC_ 00019 00020 00022 // 00023 // units and tolerances 00024 // 00025 00026 class ON_CLASS ON_3dmUnitsAndTolerances 00027 { 00028 public: 00029 ON_3dmUnitsAndTolerances(); 00030 ON_3dmUnitsAndTolerances(const ON_3dmUnitsAndTolerances&); 00031 ~ON_3dmUnitsAndTolerances(); 00032 ON_3dmUnitsAndTolerances& operator=(const ON_3dmUnitsAndTolerances&); 00033 00034 void Default(); 00035 00036 bool Read( ON_BinaryArchive& ); 00037 bool Write( ON_BinaryArchive& ) const; 00038 00039 void Dump( ON_TextLog& ) const; 00040 00042 // Returns scale factor that needs to be applied to change from 00043 // the argument's unit system to m_unit_system. 00044 // When m_unit_system is not ON::custom_unit_system, 00045 // Scale(us) = ON::UnitScale(us,m_unit_system). When Scale(us) 00046 // When m_unit_system is ON::custom_unit_system, 00047 // Scale(us) = ON::UnitScale(us,ON::meters)*m_custom_unit_scale. 00048 double Scale( ON::unit_system ) const; 00049 00050 //ON::unit_system m_unit_system; 00051 ON_UnitSystem m_unit_system; 00052 00053 double m_absolute_tolerance; // in units (default = 1/100) 00054 double m_angle_tolerance; // in radians (default = 3 degrees) 00055 double m_relative_tolerance; // fraction >= 0 and < 1 (default = 1%) 00056 00057 ON::distance_display_mode m_distance_display_mode; 00058 int m_distance_display_precision; // decimal mode: number of decimal places 00059 // fractional modes: 00060 // denominator = (1/2)^m_distance_display_precision 00061 00063 // These settings apply when m_unit_system is ON::custom_unit_system 00064 // 00065 //double m_custom_unit_scale; // 1 meter = m_custom_unit_scale custom units 00066 //ON_wString m_custom_unit_name; // name of custom units 00067 }; 00068 00070 // 00071 // Model settings 00072 // render mesh defaults 00073 // viewports 00074 // construction planes 00075 // 00076 00077 class ON_CLASS ON_3dmAnnotationSettings 00078 { 00079 public: 00080 ON_3dmAnnotationSettings(); 00081 ~ON_3dmAnnotationSettings(); 00082 ON_3dmAnnotationSettings(const ON_3dmAnnotationSettings&); 00083 ON_3dmAnnotationSettings& operator=(const ON_3dmAnnotationSettings&); 00084 00085 void Default(); 00086 00087 bool Read( ON_BinaryArchive& ); 00088 bool Write( ON_BinaryArchive& ) const; 00089 00090 void Dump( ON_TextLog& text_log ) const; 00091 00092 // these are the running defaults for making dimensions 00093 // they are also the things written to the 3dm file as dimension settings 00094 double m_dimscale; // model size / plotted size 00095 double m_textheight; 00096 double m_dimexe; 00097 double m_dimexo; 00098 double m_arrowlength; 00099 double m_arrowwidth; 00100 double m_centermark; 00101 00102 /* 00103 Returns: 00104 Value of m_world_view_text_scale; 00105 */ 00106 double WorldViewTextScale() const; 00107 00108 /* 00109 Parameters: 00110 world_view_text_scale - [in] 00111 Sets value of m_world_view_text_scale. 00112 */ 00113 void SetWorldViewTextScale(double world_view_text_scale ); 00114 00115 /* 00116 Returns: 00117 Value of m_world_view_hatch_scale; 00118 */ 00119 double WorldViewHatchScale() const; 00120 00121 /* 00122 Parameters: 00123 world_view_hatch_scale - [in] 00124 Sets value of m_world_view_hatch_scale. 00125 */ 00126 void SetWorldViewHatchScale(double world_view_hatch_scale ); 00127 00128 00129 /* 00130 Returns: 00131 Value of m_bEnableAnnotationScaling; 00132 */ 00133 bool IsAnnotationScalingEnabled() const; 00134 00135 /* 00136 Parameters: 00137 bEnable - [in] 00138 Sets value of m_bEnableAnnotationScaling. 00139 */ 00140 void EnableAnnotationScaling( bool bEnable ); 00141 00142 /* 00143 Returns: 00144 Value of m_bEnableHatchScaling; 00145 */ 00146 bool IsHatchScalingEnabled() const; 00147 00148 /* 00149 Parameters: 00150 bEnable - [in] 00151 Sets value of m_bEnableHatchScaling. 00152 */ 00153 void EnableHatchScaling( bool bEnable ); 00154 00155 // Present but not used in V4 or V5 - removed 5 August 2010 to make room 00156 // for m_world_view_text_scale and m_bEnableAnnotationScaling 00158 //double m_dimdle; 00159 //double m_dimgap; 00160 private: 00161 // If m_bEnableAnnotationScaling is true, 00162 // and ON_Annotation2::m_annotative_scale is true, 00163 // and ON_Annotation2::m_type == ON::dtTextBlock, 00164 // and the text object is being displayed in a world 00165 // view (not a detail view and not a page view), 00166 // then the text will be scaled by m_world_view_text_scale. 00167 // The default is 1.0. Values <= 0.0 are not valid. 00168 float m_world_view_text_scale; 00169 float m_world_view_hatch_scale; 00170 00171 private: 00172 // If m_bEnableAnnotationScaling is false: 00173 // * m_world_view_text_scale is ignored. 00174 // * text is not scaled. 00175 // * ON_DimStyle::DimScale() determines the scale 00176 // applied to all other annotation objects in all 00177 // types of views. 00178 // * The value of ON_DetailView::m_page_per_model_ratio 00179 // is applied to all objects (annotation and geometry) 00180 // in the detail view. 00181 // 00182 // If m_bEnableAnnotationScaling is true: 00183 // * m_world_view_text_scale is used as described above. 00184 // * ON_DimStyle::DimScale() determines the scale 00185 // applied to all non text annotation objects in 00186 // world views. 00187 // * ON_DimStyle::DimScale() is ignored in page and 00188 // detail views. 00189 // * ON_DetailView::m_page_per_model_ratio is ingored 00190 // for annotation objects in detail views, other 00191 // geometry is scaled. 00192 // 00193 // Default is true. 00194 unsigned char m_bEnableAnnotationScaling; 00195 00196 unsigned char m_bEnableHatchScaling; 00197 00198 private: 00199 unsigned char m_reserved[6]; 00200 00201 public: 00202 00203 ON::unit_system m_dimunits; // units used to measure the dimension 00204 int m_arrowtype; // 0: filled narrow triangular arrow 00205 int m_angularunits; // 0: degrees, 1: radians 00206 int m_lengthformat; // 0: decimal, ... 00207 int m_angleformat; // 0: decimal degrees, ... 00208 int m_textalign; // 0: above line, 1: in line, 2: horizontal 00209 int m_resolution; // depends on m_lengthformat 00210 // for decimal, digits past the decimal point 00211 00212 ON_wString m_facename; // [LF_FACESIZE] // windows font name 00213 }; 00214 00216 // 00217 // ON_3dmConstructionPlaneGridDefaults 00218 // 00219 // Default settings used for construction plane grids 00220 class ON_CLASS ON_3dmConstructionPlaneGridDefaults 00221 { 00222 public: 00223 ON_3dmConstructionPlaneGridDefaults(); 00224 ~ON_3dmConstructionPlaneGridDefaults(); 00225 ON_3dmConstructionPlaneGridDefaults(const ON_3dmConstructionPlaneGridDefaults&); 00226 ON_3dmConstructionPlaneGridDefaults& operator=(const ON_3dmConstructionPlaneGridDefaults&); 00227 00228 void Default(); 00229 00230 bool Write( ON_BinaryArchive& ) const; 00231 bool Read( ON_BinaryArchive& ); 00232 00233 void Dump( ON_TextLog& text_log ) const; 00234 00235 double m_grid_spacing; // distance between grid lines 00236 double m_snap_spacing; // when "grid snap" is enabled, the 00237 // distance between snap points. Typically 00238 // this is the same distance as grid spacing. 00239 int m_grid_line_count; // number of grid lines in each direction 00240 int m_grid_thick_frequency; // thick line frequency 00241 // 0: none, 00242 // 1: all lines are thick, 00243 // 2: every other is thick, ... 00244 00245 ON_BOOL32 m_bShowGrid; 00246 ON_BOOL32 m_bShowGridAxes; 00247 ON_BOOL32 m_bShowWorldAxes; 00248 }; 00249 00251 // 00252 // ON_3dmConstructionPlane 00253 // 00254 class ON_CLASS ON_3dmConstructionPlane 00255 { 00256 public: 00257 ON_3dmConstructionPlane(); 00258 ~ON_3dmConstructionPlane(); 00259 00260 // default copy constructor and operator= work fine 00261 //ON_3dmConstructionPlane(const ON_3dmConstructionPlane&); 00262 //ON_3dmConstructionPlane& operator=(const ON_3dmConstructionPlane&); 00263 00264 void Default(); 00265 00266 bool Write( ON_BinaryArchive& ) const; 00267 bool Read( ON_BinaryArchive& ); 00268 00269 void Dump( ON_TextLog& text_log ) const; 00270 00271 ON_Plane m_plane; 00272 00273 // construction grid appearance 00274 double m_grid_spacing; // distance between grid lines 00275 double m_snap_spacing; // when "grid snap" is enabled, the 00276 // distance between snap points. Typically 00277 // this is the same distance as grid spacing. 00278 int m_grid_line_count; // number of grid lines in each direction 00279 int m_grid_thick_frequency; // thick line frequency 00280 // 0: none, 00281 // 1: all lines are thick, 00282 // 2: every other is thick, ... 00283 bool m_bDepthBuffer; // false=grid is always drawn behind 3d geometry 00284 // true=grid is drawn at its depth as a 3d plane 00285 // and grid lines obscure things behind the grid. 00286 00287 ON_wString m_name; 00288 }; 00289 00290 #if defined(ON_DLL_TEMPLATE) 00291 // This stuff is here because of a limitation in the way Microsoft 00292 // handles templates and DLLs. See Microsoft's knowledge base 00293 // article ID Q168958 for details. 00294 #pragma warning( push ) 00295 #pragma warning( disable : 4231 ) 00296 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_3dmConstructionPlane>; 00297 #pragma warning( pop ) 00298 #endif 00299 00301 // 00302 // ON_3dmViewPosition 00303 // 00304 class ON_CLASS ON_3dmViewPosition 00305 { 00306 public: 00307 // view window relative position and state in parent frame 00308 ON_3dmViewPosition(); 00309 ~ON_3dmViewPosition(); 00310 ON_3dmViewPosition(const ON_3dmViewPosition&); 00311 ON_3dmViewPosition& operator=(const ON_3dmViewPosition&); 00312 00313 void Default(); 00314 00315 bool Write( ON_BinaryArchive& ) const; 00316 bool Read( ON_BinaryArchive& ); 00317 00318 // relative position of view window in main frame 00319 // if m_floating_viewport>0, this is relative position of the view window 00320 // on the virtual screen (union of potentially multiple monitors) 00321 double m_wnd_left; // 0.0 to 1.0 00322 double m_wnd_right; 00323 double m_wnd_top; 00324 double m_wnd_bottom; 00325 ON_BOOL32 m_bMaximized; // true if view window is maximized 00326 00327 // m_floating_viewport is used to track floating viewport information. 00328 // 0 = the view is docked in the main application window. 00329 // >0 = the view is floating. When floating, this corresponds to the 00330 // number of monitors on on the user's computer when the file was saved 00331 unsigned char m_floating_viewport; 00332 private: 00333 // reserved for future use 00334 unsigned char m_reserved_1; 00335 unsigned char m_reserved_2; 00336 unsigned char m_reserved_3; 00337 }; 00338 00340 // 00341 // ON_3dmViewTraceImage 00342 // 00343 class ON_CLASS ON_3dmViewTraceImage 00344 { 00345 public: 00346 ON_3dmViewTraceImage(); 00347 ~ON_3dmViewTraceImage(); 00348 bool operator==( const ON_3dmViewTraceImage& ) const; 00349 bool operator!=( const ON_3dmViewTraceImage& ) const; 00350 00351 void Default(); 00352 00353 bool Write( ON_BinaryArchive& ) const; 00354 bool Read( ON_BinaryArchive& ); 00355 00356 // view window relative position and state in parent frame 00357 ON_Plane m_plane; 00358 double m_width; 00359 double m_height; 00360 00361 ON_wString m_bitmap_filename; 00362 bool m_bGrayScale; // true if image should be black and white 00363 bool m_bHidden; // true if image is currently hidden from view 00364 bool m_bFiltered; // true if image should be filtered (bilinear) before displayed. 00365 }; 00366 00367 00369 // 00370 // ON_3dmViewTraceImage 00371 // 00372 class ON_CLASS ON_3dmWallpaperImage 00373 { 00374 public: 00375 ON_3dmWallpaperImage(); 00376 ~ON_3dmWallpaperImage(); 00377 bool operator==( const ON_3dmWallpaperImage& ) const; 00378 bool operator!=( const ON_3dmWallpaperImage& ) const; 00379 00380 void Default(); 00381 00382 bool Write( ON_BinaryArchive& ) const; 00383 bool Read( ON_BinaryArchive& ); 00384 00385 ON_wString m_bitmap_filename; 00386 bool m_bGrayScale; // true if image should be black and white 00387 bool m_bHidden; // true if image is currently hidden from view 00388 }; 00389 00391 // 00392 // ON_3dmView 00393 // 00394 00395 class ON_CLASS ON_3dmPageSettings 00396 { 00397 public: 00398 ON_3dmPageSettings(); 00399 ~ON_3dmPageSettings(); 00400 00401 bool IsValid( ON_TextLog* text_log = 0 ) const; 00402 00403 void Default(); 00404 00405 int m_page_number; 00406 00407 // Overall size of the page in millimeters 00408 double m_width_mm; 00409 double m_height_mm; 00410 00411 // Page margins in millimeters 00412 double m_left_margin_mm; 00413 double m_right_margin_mm; 00414 double m_top_margin_mm; 00415 double m_bottom_margin_mm; 00416 00417 ON_wString m_printer_name; 00418 00419 bool Write(ON_BinaryArchive& archive) const; 00420 bool Read(ON_BinaryArchive& archive); 00421 }; 00422 00423 00424 class ON_CLASS ON_3dmView 00425 { 00426 public: 00427 ON_3dmView(); 00428 ~ON_3dmView(); 00429 00430 // The C++ default copy constructor and operator= work fine. 00431 // Do not provide customized versions. 00432 // NO // ON_3dmView(const ON_3dmView&); 00433 // NO // ON_3dmView& operator=(const ON_3dmView&); 00434 00435 void Default(); 00436 00437 bool Write( ON_BinaryArchive& ) const; 00438 bool Read( ON_BinaryArchive& ); 00439 00440 void Dump( ON_TextLog& text_log ) const; 00441 00442 bool IsValid( ON_TextLog* text_log = 0 ) const; 00443 00444 // view projection information 00445 ON_Viewport m_vp; 00446 00447 // clipping planes 00448 // Prior to Dec 14, 2010 m_clipping_planes was not saved with the view. 00449 // After Dec 14, 2010 m_clipping_planes is saved. 00450 ON_SimpleArray<ON_ClippingPlaneInfo> m_clipping_planes; 00451 00452 // If true, the the camera location, camera direction, 00453 // and lens angle should not be changed. 00454 // It is ok to adjust clipping planes. 00455 bool m_bLockedProjection; 00456 00458 // 00459 // target point 00460 // 00461 00462 /* 00463 Returns: 00464 Target point. This point is saved on m_vp.m_target_point. 00465 The default constructor sets the target point to 00466 ON_3dPoint::UnsetPoint. You must explicitly set the target 00467 point if you want to use it. 00468 Remarks: 00469 The target point is stored on m_vp.m_target_point. The 00470 value ON_3dmView.m_target is obsolete. This function always 00471 returns the value of m_vp.m_target_point. 00472 00473 */ 00474 ON_3dPoint TargetPoint() const; 00475 00476 /* 00477 Description: 00478 Sets the target point. 00479 Parameters: 00480 target_point - [in] 00481 When in double, the point m_vp.FrustumCenterPoint(ON_UNSET_VALUE) 00482 is a good choice. 00483 Remarks: 00484 This point is saved on m_vp.m_target_point. Using this function 00485 keeps the obsolete ON_3dmView.m_target value equal to 00486 m_vp.m_target_point. 00487 */ 00488 bool SetTargetPoint(ON_3dPoint target_point); 00489 00491 // OBSOLETE // 00492 // Use ON_3dmView::SetTargetPoint() and ON_3dmView::TargetPoint() // 00493 // functions to set and get the target point. The m_target member // 00494 // will be removed in V6. The only reason m_target is still here // 00495 // is to avoid breaking the public SDK. // 00496 /* OBSOLETE */ ON_3dPoint m_target; // OBSOLETE // 00497 // Hmm, did you notice that m_target is obsolete? Try using the // 00498 // SetTargetPoint() and TargetPoint() functions instead. // 00499 // OBSOLETE // 00501 00502 // 00504 00505 ON_wString m_name; // name on window 00506 00507 // If m_display_mode_id is nil, then use m_display_mode 00508 // to show one of the "standard" (wireframe, shaded, rendered) 00509 // display modes. If m_display_mode_id is not nil, then 00510 // ignore m_display_mode. 00511 ON_UUID m_display_mode_id; 00512 ON::display_mode m_display_mode; 00513 00514 // position of view in parent window 00515 // (relative display device coordinates) 00516 ON_3dmViewPosition m_position; 00517 00518 ON::view_type m_view_type; // model, page, or nested 00519 00520 // If m_view_type == ON::page_view_type, then the m_page_settings 00521 // records the page size. Otherwise, m_page_settings should 00522 // be ignored. 00523 ON_3dmPageSettings m_page_settings; 00524 00525 // construction plane 00526 ON_3dmConstructionPlane m_cplane; 00527 bool m_bShowConstructionGrid; 00528 bool m_bShowConstructionAxes; 00529 00530 // world axes icon 00531 bool m_bShowWorldAxes; 00532 00533 // tracing image 00534 ON_3dmViewTraceImage m_trace_image; 00535 00536 // wallpaper image 00537 ON_3dmWallpaperImage m_wallpaper_image; 00538 }; 00539 00540 #if defined(ON_DLL_TEMPLATE) 00541 // This stuff is here because of a limitation in the way Microsoft 00542 // handles templates and DLLs. See Microsoft's knowledge base 00543 // article ID Q168958 for details. 00544 #pragma warning( push ) 00545 #pragma warning( disable : 4231 ) 00546 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_3dmView>; 00547 #pragma warning( pop ) 00548 #endif 00549 00551 // 00552 // ON_3dmRenderSettings 00553 // 00554 00555 class ON_CLASS ON_3dmRenderSettings 00556 { 00557 public: 00558 ON_3dmRenderSettings(); 00559 ~ON_3dmRenderSettings(); 00560 ON_3dmRenderSettings(const ON_3dmRenderSettings&); 00561 ON_3dmRenderSettings& operator=(const ON_3dmRenderSettings&); 00562 00563 void Default(); 00564 00565 bool Write( ON_BinaryArchive& ) const; 00566 bool Read( ON_BinaryArchive& ); 00567 00568 void Dump( ON_TextLog& text_log ) const; 00569 00570 bool ScaleBackgroundToFit() const; 00571 void SetScaleBackgroundToFit( bool bScaleBackgroundToFit ); 00572 00574 // false: image pixel size = current viewport size 00575 // true: image pixel size = m_image_width X m_image_height pixels 00576 ON_BOOL32 m_bCustomImageSize; 00577 int m_image_width; // image width in pixels 00578 int m_image_height; // image height in pixels 00579 00580 private: 00581 bool m_bScaleBackgroundToFit; 00582 unsigned char m_reserved1[3]; 00583 public: 00584 00586 // Number of dots/inch (dots=pixels) to use when printing and 00587 // saving bitmaps. The default is 72.0 dots/inch. 00588 double m_image_dpi; 00590 // unit system to use when converting image pixel size and dpi 00591 // information into a print size. Default = inches 00592 ON::unit_system m_image_us; 00593 00594 ON_Color m_ambient_light; 00595 00596 int m_background_style; // 0 = solid color, 1 = "wallpaper" image, 2 = Gradient, 3 = Environment 00597 ON_Color m_background_color; // also Top color of gradient... 00598 ON_wString m_background_bitmap_filename; 00599 00600 ON_BOOL32 m_bUseHiddenLights; 00601 00602 ON_BOOL32 m_bDepthCue; 00603 ON_BOOL32 m_bFlatShade; 00604 00605 ON_BOOL32 m_bRenderBackfaces; 00606 ON_BOOL32 m_bRenderPoints; 00607 ON_BOOL32 m_bRenderCurves; 00608 ON_BOOL32 m_bRenderIsoparams; 00609 ON_BOOL32 m_bRenderMeshEdges; 00610 ON_BOOL32 m_bRenderAnnotation; 00611 00612 int m_antialias_style; // 0 = none, 1 = normal, 2 = best 00613 00614 int m_shadowmap_style; // 0 = none, 1 = normal, 2 = best 00615 int m_shadowmap_width; 00616 int m_shadowmap_height; 00617 double m_shadowmap_offset; 00618 00619 ON_Color m_background_bottom_color; 00620 00621 // Flags that are used to determine which render settings a render 00622 // plugin uses, and which ones the display pipeline should use. 00623 // Note: Render plugins set these, and they don't need to persist 00624 // in the document...Also, when set, they turn OFF their 00625 // corresponding setting in the Display Attributes Manager's 00626 // UI pages for "Rendered" mode. 00627 bool m_bUsesAmbientAttr; 00628 bool m_bUsesBackgroundAttr; 00629 bool m_bUsesBackfaceAttr; 00630 bool m_bUsesPointsAttr; 00631 bool m_bUsesCurvesAttr; 00632 bool m_bUsesIsoparmsAttr; 00633 bool m_bUsesMeshEdgesAttr; 00634 bool m_bUsesAnnotationAttr; 00635 bool m_bUsesHiddenLightsAttr; 00636 00637 private: 00638 unsigned char m_reserved2[3]; 00639 }; 00640 00641 00643 // 00644 // ON_EarthAnchorPoint 00645 // 00646 00647 class ON_CLASS ON_EarthAnchorPoint 00648 { 00649 public: 00650 ON_EarthAnchorPoint(); 00651 ~ON_EarthAnchorPoint(); 00652 00653 static 00654 int Compare( 00655 const ON_EarthAnchorPoint*, 00656 const ON_EarthAnchorPoint* 00657 ); 00658 00659 static 00660 int CompareEarthLocation( 00661 const ON_EarthAnchorPoint*, 00662 const ON_EarthAnchorPoint* 00663 ); 00664 00665 static 00666 int CompareModelDirection( 00667 const ON_EarthAnchorPoint*, 00668 const ON_EarthAnchorPoint* 00669 ); 00670 00671 static 00672 int CompareIdentification( 00673 const ON_EarthAnchorPoint*, 00674 const ON_EarthAnchorPoint* 00675 ); 00676 00677 void Default(); 00678 bool Read( ON_BinaryArchive& ); 00679 bool Write( ON_BinaryArchive& ) const; 00680 00681 // Point on the Earth 00682 // Latitude (degrees): +90 = north pole, 0 = equator, -90 = south pole 00683 // Longitude (degrees): 0 = prime meridian (Greenwich meridian) 00684 // Elevation (meters): 00685 double m_earth_basepoint_latitude; // in decimal degrees 00686 double m_earth_basepoint_longitude; // in decimal degrees 00687 double m_earth_basepoint_elevation; // in meters 00688 int m_earth_basepoint_elevation_zero; // 0 = ground level 00689 // 1 = mean sea level 00690 // 2 = center of earth 00691 00692 // Corresponding model point in model coordinates. 00693 ON_3dPoint m_model_basepoint; // in model coordinates 00694 00695 // Earth directions in model coordinates 00696 ON_3dVector m_model_north; // in model coordinates 00697 ON_3dVector m_model_east; // in model coordinates 00698 00699 // Identification information about this location 00700 ON_UUID m_id; // unique id for this anchor point 00701 ON_wString m_name; 00702 ON_wString m_description; 00703 ON_wString m_url; 00704 ON_wString m_url_tag; // UI link text for m_url 00705 00706 /* 00707 Parameters: 00708 model_compass - [out] 00709 A plane in model coordinates whose xaxis points East, 00710 yaxis points North and zaxis points up. The origin 00711 is set to m_model_basepoint. 00712 */ 00713 bool GetModelCompass( 00714 ON_Plane& model_compass 00715 ) const; 00716 00717 /* 00718 Description: 00719 Get a transformation from model coordinates to earth coordinates. 00720 This transformation assumes the model is small enough that 00721 the curvature of the earth can be ignored. 00722 Parameters: 00723 model_unit_system - [in] 00724 model_to_earth - [out] 00725 Transformation from model coordinates to earth locations 00726 (degrees latitude,degrees longitude,elevation in meters) 00727 Remarks: 00728 If M is a point in model coordinates and E = model_to_earth*M, 00729 then 00730 E.x = latitude in decimal degrees 00731 E.y = longitude in decimal degrees 00732 E.z = elevation in meters above mean sea level 00733 00734 Because the earth is not flat, there is a small amount of error 00735 when using a linear transformation to calculate oblate spherical 00736 coordinates. This error is small. If the distance from P to M 00737 is d meters, then the approximation error is 00738 00739 latitude error <= 00740 longitude error <= 00741 elevation error <= 6379000*((1 + (d/6356000)^2)-1) meters 00742 00743 In particular, if every point in the model is within 1000 meters of 00744 the m_model_basepoint, then the maximum approximation errors are 00745 00746 latitude error <= 00747 longitude error <= 00748 elevation error <= 8 centimeters 00749 */ 00750 bool GetModelToEarthXform( 00751 const ON_UnitSystem& model_unit_system, 00752 ON_Xform& model_to_earth 00753 ) const; 00754 }; 00755 00756 00757 00758 class ON_CLASS ON_3dmIOSettings 00759 { 00760 public: 00761 ON_3dmIOSettings(); 00762 00763 void Default(); 00764 00765 bool Read(ON_BinaryArchive&); 00766 bool Write(ON_BinaryArchive&) const; 00767 00768 // bitmaps associated with rendering materials 00769 bool m_bSaveTextureBitmapsInFile; 00770 00771 // As of 7 February 2012, the m_idef_link_update setting 00772 // controls if, when and how linked and linked_and_embedded 00773 // instance defintions are updated when the source archive 00774 // that was used to create the idef has changed. 00775 int m_idef_link_update; 00776 // 1 = prompt - ask the user if the idef should be updated. 00777 // 2 = always update - no prompting 00778 // 3 = never update - no prompting 00779 // Any value not equal to 1,2 or 3 shall be treated as 1. 00780 }; 00781 00783 // 00784 // ON_3dmSettings 00785 // 00786 00787 class ON_CLASS ON_3dmSettings 00788 { 00789 public: 00790 ON_3dmSettings(); 00791 ~ON_3dmSettings(); 00792 00793 // C++ copy constructor and operator= work fine. 00794 // Do not provide custom versions. 00795 // NO // ON_3dmSettings(const ON_3dmSettings&); 00796 // NO // ON_3dmSettings& operator=(const ON_3dmSettings&); 00797 00798 void Default(); 00799 00800 bool Read(ON_BinaryArchive&); 00801 bool Write(ON_BinaryArchive&) const; 00802 00803 void Dump( ON_TextLog& ) const; 00804 00805 // model URL (can be empty) 00806 ON_wString m_model_URL; 00807 00808 // Model basepoint is used when the file is read as 00809 // an instance definition and is the point that is 00810 // mapped to the origin in the instance definition. 00811 ON_3dPoint m_model_basepoint; 00812 00813 00814 // If set, this is the model's location on the earth. 00815 // This information is used when the model is used 00816 // with GIS information. 00817 ON_EarthAnchorPoint m_earth_anchor_point; 00818 00819 // Model space tolerances and unit system 00820 ON_3dmUnitsAndTolerances m_ModelUnitsAndTolerances; 00821 00822 // Page space (printing/paper) tolerances and unit system 00823 ON_3dmUnitsAndTolerances m_PageUnitsAndTolerances; 00824 00825 // settings used for automatically created rendering meshes 00826 ON_MeshParameters m_RenderMeshSettings; 00827 00828 // saved custom settings 00829 ON_MeshParameters m_CustomRenderMeshSettings; 00830 00831 // settings used for automatically created analysis meshes 00832 ON_MeshParameters m_AnalysisMeshSettings; 00833 00834 // settings used when annotation objects are created 00835 ON_3dmAnnotationSettings m_AnnotationSettings; 00836 00837 ON_ClassArray<ON_3dmConstructionPlane> m_named_cplanes; 00838 ON_ClassArray<ON_3dmView> m_named_views; 00839 ON_ClassArray<ON_3dmView> m_views; // current viewports 00840 ON_UUID m_active_view_id; // id of "active" viewport 00841 00842 // These fields determine what layer, material, color, line style, and 00843 // wire density are used for new objects. 00844 int m_current_layer_index; 00845 00846 int m_current_material_index; 00847 ON::object_material_source m_current_material_source; 00848 00849 ON_Color m_current_color; 00850 ON::object_color_source m_current_color_source; 00851 00852 ON_Color m_current_plot_color; 00853 ON::plot_color_source m_current_plot_color_source; 00854 00855 int m_current_linetype_index; 00856 ON::object_linetype_source m_current_linetype_source; 00857 00858 int m_current_font_index; 00859 00860 int m_current_dimstyle_index; 00861 00862 // Surface wireframe density 00863 // 00864 // @untitled table 00865 // 0 boundary + "knot" wires 00866 // 1 boundary + "knot" wires + 1 interior wire if no interior "knots" 00867 // N>=2 boundry + "knot" wires + (N-1) interior wires 00868 int m_current_wire_density; 00869 00870 ON_3dmRenderSettings m_RenderSettings; 00871 00872 // default settings for construction plane grids 00873 ON_3dmConstructionPlaneGridDefaults m_GridDefaults; 00874 00875 // World scale factor to apply to non-solid linetypes 00876 // for model display. For plotting, the linetype settings 00877 // are used without scaling. 00878 double m_linetype_display_scale; 00879 00880 // Plugins that were loaded when the file was saved. 00881 ON_ClassArray<ON_PlugInRef> m_plugin_list; 00882 00883 ON_3dmIOSettings m_IO_settings; 00884 private: 00885 bool Read_v1(ON_BinaryArchive&); 00886 bool Read_v2(ON_BinaryArchive&); 00887 bool Write_v1(ON_BinaryArchive&) const; 00888 bool Write_v2(ON_BinaryArchive&) const; 00889 }; 00890 00891 #endif