1 /* $NoKeywords: $ */
2 /*
3 //
4 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
5 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
6 // McNeel & Associates.
7 //
8 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
9 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
10 // MERCHANTABILITY ARE HEREBY DISCLAIMED.
11 //
12 // For complete openNURBS copyright information see <http://www.opennurbs.org>.
13 //
14 ////////////////////////////////////////////////////////////////
15 */
16 
17 
18 #if !defined(OPENNURBS_EXTENSIONS_INC_)
19 #define OPENNURBS_EXTENSIONS_INC_
20 
21 /*
22 Description:
23   Used to store user data information in an ONX_Model.
24 */
25 class ON_CLASS ONX_Model_UserData
26 {
27 public:
28 #if defined(ON_DLL_EXPORTS) || defined(ON_DLL_IMPORTS)
29   // See comments at the top of opennurbs_extensions.cpp for details.
30 
31   // new/delete
32   void* operator new(size_t);
33   void  operator delete(void*);
34 
35   // array new/delete
36   void* operator new[] (size_t);
37   void  operator delete[] (void*);
38 
39   // in place new/delete
40   void* operator new(size_t,void*);
41   void  operator delete(void*,void*);
42 #endif
43 
44   ONX_Model_UserData();
45   ~ONX_Model_UserData();
46   ONX_Model_UserData(const ONX_Model_UserData&);
47   ONX_Model_UserData& operator=(const ONX_Model_UserData&);
48 
49   void Dump( ON_TextLog& ) const;
50 
51   ON_UUID  m_uuid;
52   ON_3dmGoo m_goo;
53 
54 private:
55   void Destroy();
56   unsigned int* m_ref_count; // reference counts used to avoid expensive object copying
57 
58 public:
59   int m_usertable_3dm_version ;
60   int m_usertable_opennurbs_version;
61 };
62 
63 /*
64 Description:
65   Used to store geometry table object definition and attributes in an ONX_Model.
66 */
67 class ON_CLASS ONX_Model_Object
68 {
69 public:
70 #if defined(ON_DLL_EXPORTS) || defined(ON_DLL_IMPORTS)
71   // See comments at the top of opennurbs_extensions.cpp for details.
72 
73   // new/delete
74   void* operator new(size_t);
75   void  operator delete(void*);
76 
77   // array new/delete
78   void* operator new[] (size_t);
79   void  operator delete[] (void*);
80 
81   // in place new/delete
82   void* operator new(size_t,void*);
83   void  operator delete(void*,void*);
84 #endif
85 
86   ONX_Model_Object();
87   ~ONX_Model_Object();
88   ONX_Model_Object(const ONX_Model_Object&);
89   ONX_Model_Object& operator=(const ONX_Model_Object&);
90 
91   void Dump( ON_TextLog& ) const;
92 
93   // If m_bDeleteObject is true, then m_object will be deleted when
94   // the last ONX_Model_Object that refers to it is destroyed.  The
95   // default value of m_bDeleteObject is false.
96   bool m_bDeleteObject;
97   const ON_Object* m_object;
98   ON_3dmObjectAttributes m_attributes;
99 
100 private:
101   void Destroy();
102   unsigned int* m_ref_count; // reference counts used to avoid expensive object copying
103 };
104 
105 /*
106 Description:
107   Used to store render light table light definition and attributes in an ONX_Model.
108 */
109 class ON_CLASS ONX_Model_RenderLight
110 {
111 public:
112 #if defined(ON_DLL_EXPORTS) || defined(ON_DLL_IMPORTS)
113   // See comments at the top of opennurbs_extensions.cpp for details.
114 
115   // new/delete
116   void* operator new(size_t);
117   void  operator delete(void*);
118 
119   // array new/delete
120   void* operator new[] (size_t);
121   void  operator delete[] (void*);
122 
123   // in place new/delete
124   void* operator new(size_t,void*);
125   void  operator delete(void*,void*);
126 #endif
127 
128   ONX_Model_RenderLight();
129   ~ONX_Model_RenderLight();
130   ONX_Model_RenderLight(const ONX_Model_RenderLight&);
131   ONX_Model_RenderLight& operator=(const ONX_Model_RenderLight&);
132 
133   ON_Light m_light;
134   ON_3dmObjectAttributes m_attributes;
135 };
136 
137 #if defined(ON_DLL_TEMPLATE)
138 // This stuff is here because of a limitation in the way Microsoft
139 // handles templates and DLLs.  See Microsoft's knowledge base
140 // article ID Q168958 for details.
141 #pragma warning( push )
142 #pragma warning( disable : 4231 )
143 
144 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_Bitmap*>;
145 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_Linetype>;
146 ON_DLL_TEMPLATE template class ON_CLASS ON_ObjectArray<ON_Linetype>;
147 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_Layer>;
148 ON_DLL_TEMPLATE template class ON_CLASS ON_ObjectArray<ON_Layer>;
149 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_Group>;
150 ON_DLL_TEMPLATE template class ON_CLASS ON_ObjectArray<ON_Group>;
151 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_Font>;
152 ON_DLL_TEMPLATE template class ON_CLASS ON_ObjectArray<ON_Font>;
153 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_DimStyle>;
154 ON_DLL_TEMPLATE template class ON_CLASS ON_ObjectArray<ON_DimStyle>;
155 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ONX_Model_RenderLight>;
156 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_HatchPattern>;
157 ON_DLL_TEMPLATE template class ON_CLASS ON_ObjectArray<ON_HatchPattern>;
158 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_InstanceDefinition>;
159 ON_DLL_TEMPLATE template class ON_CLASS ON_ObjectArray<ON_InstanceDefinition>;
160 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ONX_Model_Object>;
161 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ONX_Model_UserData>;
162 ON_DLL_TEMPLATE template class ON_CLASS ON_SimpleArray<ON_HistoryRecord*>;
163 
164 #pragma warning( pop )
165 #endif
166 
167 
168 /*
169 Description:
170   Pedegodgical example of all the things in an OpenNURBS 3dm archive.
171   The openNURBS examples use ONX_Model to store the information
172   read from 3dm archives.  Please study example_read.cpp for
173   details.
174 */
175 class ON_CLASS ONX_Model
176 {
177 public:
178 #if defined(ON_DLL_EXPORTS) || defined(ON_DLL_IMPORTS)
179   // See comments at the top of opennurbs_extensions.cpp for details.
180 
181   // new/delete
182   void* operator new(size_t);
183   void  operator delete(void*);
184 
185   // array new/delete
186   void* operator new[] (size_t);
187   void  operator delete[] (void*);
188 
189   // in place new/delete
190   void* operator new(size_t,void*);
191   void  operator delete(void*,void*);
192 #endif
193 
194   ONX_Model();
195   virtual ~ONX_Model();
196 
197   /*
198   Description:
199     Destroys contents of this model and leaves it ready to be reused.
200   */
201   void Destroy();
202 
203   /*
204   Description:
205     Reads an openNURBS archive and saves the information in this model
206   Parameters:
207     archive - [in] archive to read from
208     error_log - [out] any archive reading errors are logged here.
209   Returns:
210     true if archive is read with no error.  False if errors occur.
211     Error details are logged in error_log.  If crc errors are in
212     the archive, then m_crc_error_count is set to the number of
213     errors.
214   Example:
215 
216             // for ASCII file names
217             const char* sFileName = ....;
218             FILE* fp = ON::OpenFile( sFileName, "rb");
219 
220             // for UNICODE file names
221             const wchar_t* wsFileName = ....;
222             FILE* fp = ON::OpenFile( wsFileName, L"rb");
223 
224             bool bModelRead = false;
225             bool bModelIsValid = false;
226 
227             ON_TextLog error_log;
228             ONX_Model model;
229 
230             if ( 0 != fp )
231             {
232               ON_BinaryFile archive( ON::read3dm, fp );
233               bModelRead = model.read( archive, error_log );
234               ON::CloseFile( fp );
235             }
236 
237             if ( bModelRead )
238             {
239               bModelIsValid = model.Validate(error_log);
240             }
241 
242   See Also:
243     ONX_Model::IsValid
244     ONX_Model::Write
245     ONX_Model::m_crc_error_count
246   */
247   bool Read(
248          ON_BinaryArchive& archive,
249          ON_TextLog* error_log = NULL
250          );
251 
252   bool Read(
253          const char* filename,
254          ON_TextLog* error_log = NULL
255          );
256 
257   bool Read(
258          const wchar_t* filename,
259          ON_TextLog* error_log = NULL
260          );
261 
262   /*
263   Description:
264     Writes contents of this model to an openNURBS archive.
265     It is a good practice to call Polish() before calling
266     Write so that your file has all the "fluff" that makes it
267     complete.  If the model is not valid, then Write will refuse
268     to write it.
269 
270   Parameters:
271     archive - [in]
272       archive to write to
273 
274     version - [in]
275       Version of the openNURBS archive to write.
276         0 default value and suggested.
277            When 0 is passed in, the value of ON_BinaryArchive::CurrentArchiveVersion()
278            is used.
279         2, 3, 4
280           If you pass in one of these values, some information
281           in current data structures will not be saved in the
282           file.
283           Rhino 2.x can read version 2 files.
284           Rhino 3.x can read version 2 and 3 files.
285           Rhino 4.x can read version 2, 3 and 4 files.
286           Rhino 5.x can read version 2, 3, 4, 5 and 50 files.
287           Rhino 5.x writes version 50 files.
288 
289     sStartSectionComment - [in]
290       Brief desciption of your app, today's date, etc.
291 
292     error_log - [out]
293       any archive writing errors are logged here.
294 
295   Returns:
296     True if archive is written with no error.
297     False if errors occur.
298     Error details are logged in error_log.
299 
300   Example:
301 
302             model = ...;
303 
304             model.Polish(); // fill in defaults as needed.
305 
306             ON_TextLog error_log;
307             if ( !model.IsValid( error_log ) )
308             {
309               // try to repair the model
310               model.Audit(true);
311             }
312 
313             if ( model.IsValid( error_log ) )
314             {
315 
316               // for ASCII file names
317               const char* sFileName = ....;
318               FILE* fp = ON::OpenFile( sFileName, "wb");
319 
320               // for UNICODE file names
321               const wchar_t* wsFileName = ....;
322               FILE* fp = ON::OpenFile( wsFileName, L"wb");
323 
324               bool ok = false;
325               if ( 0 != fp )
326               {
327                 const char* sStartSectionComment = "...";
328                 int version = 5; // 2, 3, 4 or 5 are valid
329                 ON_BinaryFile archive( ON::write3dm, fp );
330                 ok = model.write( archive,
331                                   version,
332                                   sStartSectionComment,
333                                   error_log );
334                 ON::CloseFile( fp );
335               }
336            }
337 
338   See Also:
339     ONX_Model::Polish
340     ONX_Model::IsValid
341     ONX_Model::Read
342   */
343   bool Write(
344          ON_BinaryArchive& archive,
345          int version = 0,
346          const char* sStartSectionComment = NULL,
347          ON_TextLog* error_log = NULL
348          );
349 
350   bool Write(
351          const char* filename,
352          int version = 0,
353          const char* sStartSectionComment = NULL,
354          ON_TextLog* error_log = NULL
355          );
356 
357   bool Write(
358          const wchar_t* filename,
359          int version = 0,
360          const char* sStartSectionComment = NULL,
361          ON_TextLog* error_log = NULL
362          );
363 
364   /*
365   Description:
366     Check a model to make sure it is valid.
367   Parameters:
368     text_log - [in] if not NULL and errors are found,
369                     a description of the problem is put in
370                     this text_log.
371   Returns:
372     True if the model is valid.
373   */
374   bool IsValid( ON_TextLog* text_log = NULL ) const;
375 
376   /*
377   Description:
378     Quickly fills in the little details, like making sure there is
379     at least one layer and table indices make sense.
380     For a full blown check and repair, call Audit(true).
381   See Also:
382     ONX_Model::Audit
383   */
384   virtual
385   void Polish();
386 
387   /*
388   Description:
389     Check a model to make sure it is valid and, if possible
390     and requrested, attempt to repair.
391   Parameters:
392     bAttemptRepair - [in] if true and a problem is found,
393          the problem is repaired.
394     repair_count - [out] number of successful repairs.
395     text_log - [in] if not NULL and errors are found,
396                     a description of the problem is put in
397                     this text_log.
398     warnings - [out]
399         If problems were found, warning ids are appended to this list.
400           @untitled table
401            1      m_material_table[] flaws
402            2      layer table is not perfect.
403            3      some m_object_table[].m_attributes.m_uuid was nil or not unique.
404            4      some m_object_table[].IsValid() is false
405            5      some m_idef_table[] has an invalid or duplicate name
406            6      warning some m_idef_table[].m_object_uuid[] is not valid
407            7      warning some m_object_table[].m_object is null
408            8      warning some m_object_table[].m_object->IsValid() is false
409            9      warning some m_object_table[].m_attributes is not valid
410           10      linetype table is not perfect.
411           11      lineset table is not perfect.
412           12      some m_idef_table[].m_uuid was nil or not unique.
413           13      some m_texture_mapping_table[i].m_mapping_id was nil or not unique.
414           14      some m_material_table[i].m_material_id was nil or not unique.
415           15      some m_light_table[i].m_light_id was nil or not unique.
416   Returns:
417     True if model is valid and false if the model has serious
418     @untitled table
419     <0      model has serious errors
420     =0      model is ok
421     >0      number of problems that were found.
422   */
423   virtual
424   int Audit(
425         bool bAttemptRepair,
426         int* repair_count,
427         ON_TextLog* text_log,
428         ON_SimpleArray<int>* warnings
429         );
430 
431   /////////////////////////////////////////////////////////////////////
432   //
433   // BEGIN model definitions
434   //
435 
436   // start section information
437   int m_3dm_file_version;
438   int m_3dm_opennurbs_version;
439   ON_String m_sStartSectionComments;
440 
441   // Properties include revision history, notes, information about
442   // the applicaton that created the file, and an option preview image.
443   ON_3dmProperties m_properties;
444 
445   // Settings include tolerance, and unit system, and defaults used
446   // for creating views and objects.
447   ON_3dmSettings   m_settings;
448 
449   // Tables in an openNURBS archive
450   ON_SimpleArray<ON_Bitmap*>            m_bitmap_table;
451   ON_ObjectArray<ON_TextureMapping>     m_mapping_table;
452   ON_ObjectArray<ON_Material>           m_material_table;
453   ON_ObjectArray<ON_Linetype>           m_linetype_table;
454   ON_ObjectArray<ON_Layer>              m_layer_table;
455   ON_ObjectArray<ON_Group>              m_group_table;
456   ON_ObjectArray<ON_Font>               m_font_table;
457   ON_ObjectArray<ON_DimStyle>           m_dimstyle_table;
458   ON_ClassArray<ONX_Model_RenderLight>  m_light_table;
459   ON_ObjectArray<ON_HatchPattern>       m_hatch_pattern_table;
460   ON_ObjectArray<ON_InstanceDefinition> m_idef_table;
461   ON_ClassArray<ONX_Model_Object>       m_object_table;
462   ON_SimpleArray<ON_HistoryRecord*>     m_history_record_table;
463   ON_ClassArray<ONX_Model_UserData>     m_userdata_table;
464 
465   // The id index fields are used to lookup objects by id
466   ON_UuidIndexList m_mapping_id_index;
467   ON_UuidIndexList m_material_id_index;
468   ON_UuidIndexList m_object_id_index;
469   ON_UuidIndexList m_idef_id_index;
470 
471   // length of archive returned by ON_BinaryArchive::Read3dmEndMark()
472   size_t m_file_length;
473 
474   // Number of crc errors found during archive reading.
475   // If > 0, then the archive is corrupt.
476   int m_crc_error_count;
477 
478   //
479   // END model definitions
480   //
481   /////////////////////////////////////////////////////////////////////
482 
483   /*
484   Returns:
485     Bounding box of every object in m_object_table[].
486   */
487   ON_BoundingBox BoundingBox() const;
488 
489   /*
490   Description:
491     Get render material from object attributes.
492   Parameters:
493     attributes - [in] object attributes.
494     material - [out] render material
495   */
496   void GetRenderMaterial(
497         const ON_3dmObjectAttributes& attributes,
498         ON_Material& material
499         ) const;
500 
501   /*
502   Description:
503     Get render material from object_index.
504   Parameters:
505     object_index - [in] m_object_table[] index
506     material - [out] render material
507   */
508   void GetRenderMaterial(
509         int object_index,
510         ON_Material& material
511         ) const;
512 
513   /*
514   Description:
515     Get linetype from object attributes.
516   Parameters:
517     attributes - [in] object attributes.
518     linetype - [out] linetype
519   */
520   void GetLinetype(
521         const ON_3dmObjectAttributes& attributes,
522         ON_Linetype& linetype
523         ) const;
524 
525   /*
526   Description:
527     Get linetype from object_index.
528   Parameters:
529     object_index - [in] m_object_table[] index
530     linetype - [out] linetype
531   */
532   void GetLinetype(
533         int object_index,
534         ON_Linetype& linetype
535         ) const;
536 
537   /*
538   Description:
539     Get wireframe drawing color from object attributes.
540   Parameters:
541     attributes - [in] object attributes.
542   Returns:
543     Wireframe drawing color.
544   */
545   ON_Color WireframeColor(const ON_3dmObjectAttributes& attributes) const;
546 
547   /*
548   Description:
549     Get wireframe drawing color from object attributes.
550   Parameters:
551     object_index - [in] m_object_table[] index
552   Returns:
553     Wireframe drawing color.
554   */
555   ON_Color WireframeColor(int object_index) const;
556 
557   /*
558   Description:
559     Get index of object in m_object_table from object_uuid.
560   Parameters:
561     object_uuid - [in] object uuid.
562   Returns:
563     Index of the object or -1 if it is not found.
564   */
565   virtual
566   int ObjectIndex(
567     ON_UUID object_uuid
568     ) const;
569 
570   /*
571   Description:
572     Get instance definition from instance definition table.
573   Parameters:
574     idef_uuid - [in] instance definition uuid.
575   Example:
576 
577           ON_XModel model = ...;
578           ..
579           ON_InstanceRef* pIRef = ..;
580           ON_UUID idef_uuid = pIRef->m_instance_definition_uuid;
581           int idef_index = model.IDefIndex( idef_uuid );
582           if ( idef_index >= 0 )
583           {
584             const ON_InstanceDefinition& idef = model.m_idef_table[idef_index];
585             ...
586           }
587 
588   Returns:
589     Index of the instance definition or -1 if it is not found.
590   */
591   virtual
592   int IDefIndex(
593     ON_UUID idef_uuid
594     ) const;
595 
596   /*
597   Description:
598     Get instance definition index from instance definition name.
599   Parameters:
600     idef_name - [in] name to search for
601   Returns:
602     Index of the instance definition or -1 if it is not found.
603   */
604   virtual
605   int IDefIndex(
606     const wchar_t* idef_name
607     ) const;
608 
609   /*
610   Description:
611     Get instance definition name that is not currently in use.
612   */
613   virtual
614   void GetUnusedIDefName( ON_wString& idef_name ) const;
615 
616   /*
617   Description:
618     See if the instance reference iref refers to an instance
619     definition.
620   Parameters:
621     iref - [in]
622     idef_uuid - [in] id of idef we are looking for
623   Returns:
624     @untitled table
625      0         iref does not use idef
626      1         iref directly references idef
627     >1         iref has a nested reference to idef (nesting depth returned)
628     -1         iref.m_instance_definition_uuid is not valid
629     -2         invalid idef found
630   */
631   virtual
632   int UsesIDef(
633         const ON_InstanceRef& iref,
634         ON_UUID idef_uuid
635         ) const;
636 
637   /*
638   Description:
639     Get layer definition from layer table.
640   Parameters:
641     layer_name - [in] name to search for
642   Example:
643 
644           ON_XModel model = ...;
645           ..
646           ON_InstanceRef* pIRef = ..;
647           ON_UUID idef_uuid = pIRef->m_instance_definition_uuid;
648           int layer_index = model.IDefIndex( idef_uuid );
649           if ( idef_index >= 0 )
650           {
651             const ON_InstanceDefinition& idef = model.m_idef_table[idef_index];
652             ...
653           }
654 
655   Returns:
656     Index of the layer or -1 if it is not found.
657   */
658   virtual
659   int LayerIndex(
660     const wchar_t* layer_name
661     ) const;
662 
663   /*
664   Description:
665     Get layer name that is not currently in use.
666   */
667   virtual
668   void GetUnusedLayerName( ON_wString& layer_name ) const;
669 
670   /////////////////////////////////////////////////////////////////////
671   //
672   // BEGIN model document level user string tools
673   //
674 
675   /*
676   Description:
677     Attach a user string to the document.
678   Parameters:
679     key - [in] id used to retrieve this string.
680     string_value - [in]
681       If NULL, the string with this id will be removed.
682   Returns:
683     True if successful.
684   */
685   bool SetDocumentUserString(
686     const wchar_t* key,
687     const wchar_t* string_value
688     );
689 
690   /*
691   Description:
692     Get user string from the document.
693   Parameters:
694     key - [in] id used to retrieve the string.
695     string_value - [out]
696   Returns:
697     True if a string with id was found.
698   */
699   bool GetDocumentUserString(
700     const wchar_t* key,
701     ON_wString& string_value
702     ) const;
703 
704   /*
705   Description:
706     Get a list of all user strings in the document.
707   Parameters:
708     user_strings - [out]
709       user strings are appended to this list.
710   Returns:
711     Number of elements appended to the user_strings list.
712   */
713   int GetDocumentUserStrings( ON_ClassArray<ON_UserString>& user_strings ) const;
714 
715   //
716   // END model document level user string tools
717   //
718   /////////////////////////////////////////////////////////////////////
719 
720 
721   /////////////////////////////////////////////////////////////////////
722   //
723   // BEGIN model text dump tools
724   //
725 
726   // text dump of entire model
727   void Dump( ON_TextLog& ) const;
728 
729   // text dump of model properties and settings
730   void DumpSummary( ON_TextLog& ) const;
731 
732   // text dump of bitmap table
733   void DumpBitmapTable( ON_TextLog& ) const;
734 
735   // text dump of texture mapping table
736   void DumpTextureMappingTable( ON_TextLog& ) const;
737 
738   // text dump of render material table
739   void DumpMaterialTable( ON_TextLog& ) const;
740 
741   // text dump of line type table
742   void DumpLinetypeTable( ON_TextLog& ) const;
743 
744   // text dump of layer table
745   void DumpLayerTable( ON_TextLog& ) const;
746 
747   // text dump of light table
748   void DumpLightTable( ON_TextLog& ) const;
749 
750   // text dump of group table
751   void DumpGroupTable( ON_TextLog& ) const;
752 
753   // text dump of font table
754   void DumpFontTable( ON_TextLog& ) const;
755 
756   // text dump of dimstyle table
757   void DumpDimStyleTable( ON_TextLog& ) const;
758 
759   // text dump of hatch pattern table
760   void DumpHatchPatternTable( ON_TextLog& ) const;
761 
762   // text dump of instance definition table
763   void DumpIDefTable( ON_TextLog& ) const;
764 
765   // text dump of object table
766   void DumpObjectTable( ON_TextLog& ) const;
767 
768   // text dump of object table
769   void DumpHistoryRecordTable( ON_TextLog& ) const;
770 
771   // text dump of user data table
772   void DumpUserDataTable( ON_TextLog& ) const;
773 
774   //
775   // END model text dump tools
776   //
777   /////////////////////////////////////////////////////////////////////
778 
779   /*
780   Description:
781     Destroys cached searching and bounding box information.  Call
782     if you modify the m_object_table or m_idef_table.
783   */
784   void DestroyCache();
785 
786   /////////////////////////////////////////////////////////////////////
787   //
788   // BEGIN Render Development Toolkit (RDK) information
789   //
790   static bool IsRDKDocumentInformation(const ONX_Model_UserData& docud);
791   static bool GetRDKDocumentInformation(const ONX_Model_UserData& docud,ON_wString& rdk_xml_document_data);
792 
793   static bool IsRDKObjectInformation(const ON_UserData& objectud);
794   static bool GetRDKObjectInformation(const ON_Object& object,ON_wString& rdk_xml_object_data);
795   //
796   // END Render Development Toolkit (RDK) information
797   //
798   /////////////////////////////////////////////////////////////////////
799 
800 
801 private:
802   // prohibit use of copy construction and operator=
803   ONX_Model(const ONX_Model&);
804   ONX_Model& operator=(const ONX_Model&);
805 
806 private:
807 
808   // This bounding box contains all objects in the object table.
809   ON_BoundingBox m__object_table_bbox;
810 };
811 
812 /*
813 Description:
814   Tests a string to see if it is valid as a name for a layer,
815   object, material, linetype, instance definition, etc.
816 Parameters:
817   name - [in] string to test
818 Returns:
819   True if the string is a valid name.
820 */
821 ON_DECL
822 bool ONX_IsValidName(
823           const wchar_t* name
824           );
825 
826 #endif
827