Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00015
00016
00017
00018 #if !defined(OPENNURBS_EXTENSIONS_INC_)
00019 #define OPENNURBS_EXTENSIONS_INC_
00020
00021
00022
00023
00024
00025 class ON_CLASS ONX_Model_UserData
00026 {
00027 public:
00028 #if defined(ON_DLL_EXPORTS) || defined(ON_DLL_IMPORTS)
00029
00030
00031
00032 void* operator new(size_t);
00033 void operator delete(void*);
00034
00035
00036 void* operator new[] (size_t);
00037 void operator delete[] (void*);
00038
00039
00040 void* operator new(size_t,void*);
00041 void operator delete(void*,void*);
00042 #endif
00043
00044 ONX_Model_UserData();
00045 ~ONX_Model_UserData();
00046 ONX_Model_UserData(const ONX_Model_UserData&);
00047 ONX_Model_UserData& operator=(const ONX_Model_UserData&);
00048
00049 void Dump( ON_TextLog& ) const;
00050
00051 ON_UUID m_uuid;
00052 ON_3dmGoo m_goo;
00053
00054 private:
00055 void Destroy();
00056 unsigned int* m_ref_count;
00057
00058 public:
00059 int m_usertable_3dm_version ;
00060 int m_usertable_opennurbs_version;
00061 };
00062
00063
00064
00065
00066
00067 class ON_CLASS ONX_Model_Object
00068 {
00069 public:
00070 #if defined(ON_DLL_EXPORTS) || defined(ON_DLL_IMPORTS)
00071
00072
00073
00074 void* operator new(size_t);
00075 void operator delete(void*);
00076
00077
00078 void* operator new[] (size_t);
00079 void operator delete[] (void*);
00080
00081
00082 void* operator new(size_t,void*);
00083 void operator delete(void*,void*);
00084 #endif
00085
00086 ONX_Model_Object();
00087 ~ONX_Model_Object();
00088 ONX_Model_Object(const ONX_Model_Object&);
00089 ONX_Model_Object& operator=(const ONX_Model_Object&);
00090
00091 void Dump( ON_TextLog& ) const;
00092
00093
00094
00095
00096 bool m_bDeleteObject;
00097 const ON_Object* m_object;
00098 ON_3dmObjectAttributes m_attributes;
00099
00100 private:
00101 void Destroy();
00102 unsigned int* m_ref_count;
00103 };
00104
00105
00106
00107
00108
00109 class ON_CLASS ONX_Model_RenderLight
00110 {
00111 public:
00112 #if defined(ON_DLL_EXPORTS) || defined(ON_DLL_IMPORTS)
00113
00114
00115
00116 void* operator new(size_t);
00117 void operator delete(void*);
00118
00119
00120 void* operator new[] (size_t);
00121 void operator delete[] (void*);
00122
00123
00124 void* operator new(size_t,void*);
00125 void operator delete(void*,void*);
00126 #endif
00127
00128 ONX_Model_RenderLight();
00129 ~ONX_Model_RenderLight();
00130 ONX_Model_RenderLight(const ONX_Model_RenderLight&);
00131 ONX_Model_RenderLight& operator=(const ONX_Model_RenderLight&);
00132
00133 ON_Light m_light;
00134 ON_3dmObjectAttributes m_attributes;
00135 };
00136
00137 #if defined(ON_DLL_TEMPLATE)
00138
00139
00140
00141 #pragma warning( push )
00142 #pragma warning( disable : 4231 )
00143
00144 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_Bitmap*>;
00145 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_Linetype>;
00146 ON_DLL_TEMPLATE template class ON_CLASS ON_ObjectArray<ON_Linetype>;
00147 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_Layer>;
00148 ON_DLL_TEMPLATE template class ON_CLASS ON_ObjectArray<ON_Layer>;
00149 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_Group>;
00150 ON_DLL_TEMPLATE template class ON_CLASS ON_ObjectArray<ON_Group>;
00151 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_Font>;
00152 ON_DLL_TEMPLATE template class ON_CLASS ON_ObjectArray<ON_Font>;
00153 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_DimStyle>;
00154 ON_DLL_TEMPLATE template class ON_CLASS ON_ObjectArray<ON_DimStyle>;
00155 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ONX_Model_RenderLight>;
00156 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_HatchPattern>;
00157 ON_DLL_TEMPLATE template class ON_CLASS ON_ObjectArray<ON_HatchPattern>;
00158 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_InstanceDefinition>;
00159 ON_DLL_TEMPLATE template class ON_CLASS ON_ObjectArray<ON_InstanceDefinition>;
00160 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ONX_Model_Object>;
00161 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ONX_Model_UserData>;
00162 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_HistoryRecord*>;
00163
00164 #pragma warning( pop )
00165 #endif
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175 class ON_CLASS ONX_Model
00176 {
00177 public:
00178 #if defined(ON_DLL_EXPORTS) || defined(ON_DLL_IMPORTS)
00179
00180
00181
00182 void* operator new(size_t);
00183 void operator delete(void*);
00184
00185
00186 void* operator new[] (size_t);
00187 void operator delete[] (void*);
00188
00189
00190 void* operator new(size_t,void*);
00191 void operator delete(void*,void*);
00192 #endif
00193
00194 ONX_Model();
00195 virtual ~ONX_Model();
00196
00197
00198
00199
00200
00201 void Destroy();
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247 bool Read(
00248 ON_BinaryArchive& archive,
00249 ON_TextLog* error_log = NULL
00250 );
00251
00252 bool Read(
00253 const char* filename,
00254 ON_TextLog* error_log = NULL
00255 );
00256
00257 bool Read(
00258 const wchar_t* filename,
00259 ON_TextLog* error_log = NULL
00260 );
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343 bool Write(
00344 ON_BinaryArchive& archive,
00345 int version = 0,
00346 const char* sStartSectionComment = NULL,
00347 ON_TextLog* error_log = NULL
00348 );
00349
00350 bool Write(
00351 const char* filename,
00352 int version = 0,
00353 const char* sStartSectionComment = NULL,
00354 ON_TextLog* error_log = NULL
00355 );
00356
00357 bool Write(
00358 const wchar_t* filename,
00359 int version = 0,
00360 const char* sStartSectionComment = NULL,
00361 ON_TextLog* error_log = NULL
00362 );
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374 bool IsValid( ON_TextLog* text_log = NULL ) const;
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384 virtual
00385 void Polish();
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423 virtual
00424 int Audit(
00425 bool bAttemptRepair,
00426 int* repair_count,
00427 ON_TextLog* text_log,
00428 ON_SimpleArray<int>* warnings
00429 );
00430
00432
00433
00434
00435
00436
00437 int m_3dm_file_version;
00438 int m_3dm_opennurbs_version;
00439 ON_String m_sStartSectionComments;
00440
00441
00442
00443 ON_3dmProperties m_properties;
00444
00445
00446
00447 ON_3dmSettings m_settings;
00448
00449
00450 ON_SimpleArray<ON_Bitmap*> m_bitmap_table;
00451 ON_ObjectArray<ON_TextureMapping> m_mapping_table;
00452 ON_ObjectArray<ON_Material> m_material_table;
00453 ON_ObjectArray<ON_Linetype> m_linetype_table;
00454 ON_ObjectArray<ON_Layer> m_layer_table;
00455 ON_ObjectArray<ON_Group> m_group_table;
00456 ON_ObjectArray<ON_Font> m_font_table;
00457 ON_ObjectArray<ON_DimStyle> m_dimstyle_table;
00458 ON_ClassArray<ONX_Model_RenderLight> m_light_table;
00459 ON_ObjectArray<ON_HatchPattern> m_hatch_pattern_table;
00460 ON_ObjectArray<ON_InstanceDefinition> m_idef_table;
00461 ON_ClassArray<ONX_Model_Object> m_object_table;
00462 ON_SimpleArray<ON_HistoryRecord*> m_history_record_table;
00463 ON_ClassArray<ONX_Model_UserData> m_userdata_table;
00464
00465
00466 ON_UuidIndexList m_mapping_id_index;
00467 ON_UuidIndexList m_material_id_index;
00468 ON_UuidIndexList m_object_id_index;
00469 ON_UuidIndexList m_idef_id_index;
00470
00471
00472 size_t m_file_length;
00473
00474
00475
00476 int m_crc_error_count;
00477
00478
00479
00480
00482
00483
00484
00485
00486
00487 ON_BoundingBox BoundingBox() const;
00488
00489
00490
00491
00492
00493
00494
00495
00496 void GetRenderMaterial(
00497 const ON_3dmObjectAttributes& attributes,
00498 ON_Material& material
00499 ) const;
00500
00501
00502
00503
00504
00505
00506
00507
00508 void GetRenderMaterial(
00509 int object_index,
00510 ON_Material& material
00511 ) const;
00512
00513
00514
00515
00516
00517
00518
00519
00520 void GetLinetype(
00521 const ON_3dmObjectAttributes& attributes,
00522 ON_Linetype& linetype
00523 ) const;
00524
00525
00526
00527
00528
00529
00530
00531
00532 void GetLinetype(
00533 int object_index,
00534 ON_Linetype& linetype
00535 ) const;
00536
00537
00538
00539
00540
00541
00542
00543
00544
00545 ON_Color WireframeColor(const ON_3dmObjectAttributes& attributes) const;
00546
00547
00548
00549
00550
00551
00552
00553
00554
00555 ON_Color WireframeColor(int object_index) const;
00556
00557
00558
00559
00560
00561
00562
00563
00564
00565 virtual
00566 int ObjectIndex(
00567 ON_UUID object_uuid
00568 ) const;
00569
00570
00571
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586
00587
00588
00589
00590
00591 virtual
00592 int IDefIndex(
00593 ON_UUID idef_uuid
00594 ) const;
00595
00596
00597
00598
00599
00600
00601
00602
00603
00604 virtual
00605 int IDefIndex(
00606 const wchar_t* idef_name
00607 ) const;
00608
00609
00610
00611
00612
00613 virtual
00614 void GetUnusedIDefName( ON_wString& idef_name ) const;
00615
00616
00617
00618
00619
00620
00621
00622
00623
00624
00625
00626
00627
00628
00629
00630
00631 virtual
00632 int UsesIDef(
00633 const ON_InstanceRef& iref,
00634 ON_UUID idef_uuid
00635 ) const;
00636
00637
00638
00639
00640
00641
00642
00643
00644
00645
00646
00647
00648
00649
00650
00651
00652
00653
00654
00655
00656
00657
00658 virtual
00659 int LayerIndex(
00660 const wchar_t* layer_name
00661 ) const;
00662
00663
00664
00665
00666
00667 virtual
00668 void GetUnusedLayerName( ON_wString& layer_name ) const;
00669
00671
00672
00673
00674
00675
00676
00677
00678
00679
00680
00681
00682
00683
00684
00685 bool SetDocumentUserString(
00686 const wchar_t* key,
00687 const wchar_t* string_value
00688 );
00689
00690
00691
00692
00693
00694
00695
00696
00697
00698
00699 bool GetDocumentUserString(
00700 const wchar_t* key,
00701 ON_wString& string_value
00702 ) const;
00703
00704
00705
00706
00707
00708
00709
00710
00711
00712
00713 int GetDocumentUserStrings( ON_ClassArray<ON_UserString>& user_strings ) const;
00714
00715
00716
00717
00719
00720
00722
00723
00724
00725
00726
00727 void Dump( ON_TextLog& ) const;
00728
00729
00730 void DumpSummary( ON_TextLog& ) const;
00731
00732
00733 void DumpBitmapTable( ON_TextLog& ) const;
00734
00735
00736 void DumpTextureMappingTable( ON_TextLog& ) const;
00737
00738
00739 void DumpMaterialTable( ON_TextLog& ) const;
00740
00741
00742 void DumpLinetypeTable( ON_TextLog& ) const;
00743
00744
00745 void DumpLayerTable( ON_TextLog& ) const;
00746
00747
00748 void DumpLightTable( ON_TextLog& ) const;
00749
00750
00751 void DumpGroupTable( ON_TextLog& ) const;
00752
00753
00754 void DumpFontTable( ON_TextLog& ) const;
00755
00756
00757 void DumpDimStyleTable( ON_TextLog& ) const;
00758
00759
00760 void DumpHatchPatternTable( ON_TextLog& ) const;
00761
00762
00763 void DumpIDefTable( ON_TextLog& ) const;
00764
00765
00766 void DumpObjectTable( ON_TextLog& ) const;
00767
00768
00769 void DumpHistoryRecordTable( ON_TextLog& ) const;
00770
00771
00772 void DumpUserDataTable( ON_TextLog& ) const;
00773
00774
00775
00776
00778
00779
00780
00781
00782
00783
00784 void DestroyCache();
00785
00787
00788
00789
00790 static bool IsRDKDocumentInformation(const ONX_Model_UserData& docud);
00791 static bool GetRDKDocumentInformation(const ONX_Model_UserData& docud,ON_wString& rdk_xml_document_data);
00792
00793 static bool IsRDKObjectInformation(const ON_UserData& objectud);
00794 static bool GetRDKObjectInformation(const ON_Object& object,ON_wString& rdk_xml_object_data);
00795
00796
00797
00799
00800
00801 private:
00802
00803 ONX_Model(const ONX_Model&);
00804 ONX_Model& operator=(const ONX_Model&);
00805
00806 private:
00807
00808
00809 ON_BoundingBox m__object_table_bbox;
00810 };
00811
00812
00813
00814
00815
00816
00817
00818
00819
00820
00821 ON_DECL
00822 bool ONX_IsValidName(
00823 const wchar_t* name
00824 );
00825
00826 #endif