opennurbs_extensions.h
Go to the documentation of this file.
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 
00018 #if !defined(OPENNURBS_EXTENSIONS_INC_)
00019 #define OPENNURBS_EXTENSIONS_INC_
00020 
00021 /*
00022 Description:
00023   Used to store user data information in an ONX_Model.
00024 */
00025 class ON_CLASS ONX_Model_UserData
00026 {
00027 public:
00028 #if defined(ON_DLL_EXPORTS) || defined(ON_DLL_IMPORTS)
00029   // See comments at the top of opennurbs_extensions.cpp for details.
00030 
00031   // new/delete
00032   void* operator new(size_t);
00033   void  operator delete(void*);
00034 
00035   // array new/delete
00036   void* operator new[] (size_t);
00037   void  operator delete[] (void*);
00038 
00039   // in place new/delete
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; // reference counts used to avoid expensive object copying
00057 
00058 public:
00059   int m_usertable_3dm_version ;
00060   int m_usertable_opennurbs_version;
00061 };
00062 
00063 /*
00064 Description:
00065   Used to store geometry table object definition and attributes in an ONX_Model.
00066 */
00067 class ON_CLASS ONX_Model_Object
00068 {
00069 public:
00070 #if defined(ON_DLL_EXPORTS) || defined(ON_DLL_IMPORTS)
00071   // See comments at the top of opennurbs_extensions.cpp for details.
00072 
00073   // new/delete
00074   void* operator new(size_t);
00075   void  operator delete(void*);
00076 
00077   // array new/delete
00078   void* operator new[] (size_t);
00079   void  operator delete[] (void*);
00080 
00081   // in place new/delete
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   // If m_bDeleteObject is true, then m_object will be deleted when
00094   // the last ONX_Model_Object that refers to it is destroyed.  The
00095   // default value of m_bDeleteObject is false.
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; // reference counts used to avoid expensive object copying
00103 };
00104 
00105 /*
00106 Description:
00107   Used to store render light table light definition and attributes in an ONX_Model.
00108 */
00109 class ON_CLASS ONX_Model_RenderLight
00110 {
00111 public:
00112 #if defined(ON_DLL_EXPORTS) || defined(ON_DLL_IMPORTS)
00113   // See comments at the top of opennurbs_extensions.cpp for details.
00114 
00115   // new/delete
00116   void* operator new(size_t);
00117   void  operator delete(void*);
00118 
00119   // array new/delete
00120   void* operator new[] (size_t);
00121   void  operator delete[] (void*);
00122 
00123   // in place new/delete
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 // This stuff is here because of a limitation in the way Microsoft
00139 // handles templates and DLLs.  See Microsoft's knowledge base 
00140 // article ID Q168958 for details.
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 Description:
00170   Pedegodgical example of all the things in an OpenNURBS 3dm archive.
00171   The openNURBS examples use ONX_Model to store the information
00172   read from 3dm archives.  Please study example_read.cpp for
00173   details.
00174 */
00175 class ON_CLASS ONX_Model
00176 {
00177 public:
00178 #if defined(ON_DLL_EXPORTS) || defined(ON_DLL_IMPORTS)
00179   // See comments at the top of opennurbs_extensions.cpp for details.
00180 
00181   // new/delete
00182   void* operator new(size_t);
00183   void  operator delete(void*);
00184 
00185   // array new/delete
00186   void* operator new[] (size_t);
00187   void  operator delete[] (void*);
00188 
00189   // in place new/delete
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   Description:
00199     Destroys contents of this model and leaves it ready to be reused.
00200   */
00201   void Destroy();
00202 
00203   /*
00204   Description:
00205     Reads an openNURBS archive and saves the information in this model
00206   Parameters:
00207     archive - [in] archive to read from
00208     error_log - [out] any archive reading errors are logged here.
00209   Returns:
00210     true if archive is read with no error.  False if errors occur.
00211     Error details are logged in error_log.  If crc errors are in
00212     the archive, then m_crc_error_count is set to the number of
00213     errors.
00214   Example:
00215 
00216             // for ASCII file names
00217             const char* sFileName = ....;
00218             FILE* fp = ON::OpenFile( sFileName, "rb");
00219 
00220             // for UNICODE file names
00221             const wchar_t* wsFileName = ....;
00222             FILE* fp = ON::OpenFile( wsFileName, L"rb");
00223 
00224             bool bModelRead = false;
00225             bool bModelIsValid = false;
00226 
00227             ON_TextLog error_log;
00228             ONX_Model model;
00229 
00230             if ( 0 != fp )
00231             {
00232               ON_BinaryFile archive( ON::read3dm, fp );
00233               bModelRead = model.read( archive, error_log );
00234               ON::CloseFile( fp );
00235             }
00236 
00237             if ( bModelRead )
00238             {
00239               bModelIsValid = model.Validate(error_log);
00240             }
00241 
00242   See Also:
00243     ONX_Model::IsValid
00244     ONX_Model::Write
00245     ONX_Model::m_crc_error_count
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   Description:
00264     Writes contents of this model to an openNURBS archive.
00265     It is a good practice to call Polish() before calling 
00266     Write so that your file has all the "fluff" that makes it
00267     complete.  If the model is not valid, then Write will refuse
00268     to write it.
00269 
00270   Parameters:
00271     archive - [in]
00272       archive to write to
00273 
00274     version - [in] 
00275       Version of the openNURBS archive to write.
00276         0 default value and suggested.
00277            When 0 is passed in, the value of ON_BinaryArchive::CurrentArchiveVersion()
00278            is used.
00279         2, 3, 4
00280           If you pass in one of these values, some information 
00281           in current data structures will not be saved in the
00282           file. 
00283           Rhino 2.x can read version 2 files.
00284           Rhino 3.x can read version 2 and 3 files.
00285           Rhino 4.x can read version 2, 3 and 4 files.
00286           Rhino 5.x can read version 2, 3, 4, 5 and 50 files.
00287           Rhino 5.x writes version 50 files.
00288 
00289     sStartSectionComment - [in] 
00290       Brief desciption of your app, today's date, etc.
00291 
00292     error_log - [out]
00293       any archive writing errors are logged here.
00294 
00295   Returns:
00296     True if archive is written with no error. 
00297     False if errors occur.
00298     Error details are logged in error_log.
00299 
00300   Example:
00301 
00302             model = ...;
00303 
00304             model.Polish(); // fill in defaults as needed.
00305 
00306             ON_TextLog error_log;
00307             if ( !model.IsValid( error_log ) )
00308             {
00309               // try to repair the model
00310               model.Audit(true);
00311             }
00312 
00313             if ( model.IsValid( error_log ) )
00314             {
00315 
00316               // for ASCII file names
00317               const char* sFileName = ....;
00318               FILE* fp = ON::OpenFile( sFileName, "wb");
00319 
00320               // for UNICODE file names
00321               const wchar_t* wsFileName = ....;
00322               FILE* fp = ON::OpenFile( wsFileName, L"wb");
00323 
00324               bool ok = false;
00325               if ( 0 != fp )
00326               {
00327                 const char* sStartSectionComment = "...";
00328                 int version = 5; // 2, 3, 4 or 5 are valid
00329                 ON_BinaryFile archive( ON::write3dm, fp );
00330                 ok = model.write( archive, 
00331                                   version, 
00332                                   sStartSectionComment, 
00333                                   error_log );
00334                 ON::CloseFile( fp );
00335               }
00336            }
00337 
00338   See Also:
00339     ONX_Model::Polish
00340     ONX_Model::IsValid
00341     ONX_Model::Read
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   Description:
00366     Check a model to make sure it is valid.
00367   Parameters:
00368     text_log - [in] if not NULL and errors are found,
00369                     a description of the problem is put in
00370                     this text_log.
00371   Returns:
00372     True if the model is valid.
00373   */
00374   bool IsValid( ON_TextLog* text_log = NULL ) const;
00375 
00376   /*
00377   Description:
00378     Quickly fills in the little details, like making sure there is 
00379     at least one layer and table indices make sense.  
00380     For a full blown check and repair, call Audit(true).
00381   See Also:
00382     ONX_Model::Audit
00383   */
00384   virtual
00385   void Polish();
00386 
00387   /*
00388   Description:
00389     Check a model to make sure it is valid and, if possible
00390     and requrested, attempt to repair.
00391   Parameters:
00392     bAttemptRepair - [in] if true and a problem is found,
00393          the problem is repaired.
00394     repair_count - [out] number of successful repairs.
00395     text_log - [in] if not NULL and errors are found,
00396                     a description of the problem is put in
00397                     this text_log.
00398     warnings - [out]
00399         If problems were found, warning ids are appended to this list.
00400           @untitled table
00401            1      m_material_table[] flaws
00402            2      layer table is not perfect.
00403            3      some m_object_table[].m_attributes.m_uuid was nil or not unique.
00404            4      some m_object_table[].IsValid() is false
00405            5      some m_idef_table[] has an invalid or duplicate name
00406            6      warning some m_idef_table[].m_object_uuid[] is not valid
00407            7      warning some m_object_table[].m_object is null
00408            8      warning some m_object_table[].m_object->IsValid() is false
00409            9      warning some m_object_table[].m_attributes is not valid
00410           10      linetype table is not perfect.
00411           11      lineset table is not perfect.
00412           12      some m_idef_table[].m_uuid was nil or not unique.
00413           13      some m_texture_mapping_table[i].m_mapping_id was nil or not unique.
00414           14      some m_material_table[i].m_material_id was nil or not unique.
00415           15      some m_light_table[i].m_light_id was nil or not unique.
00416   Returns:
00417     True if model is valid and false if the model has serious 
00418     @untitled table
00419     <0      model has serious errors
00420     =0      model is ok
00421     >0      number of problems that were found.
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   // BEGIN model definitions
00434   //
00435 
00436   // start section information
00437   int m_3dm_file_version;
00438   int m_3dm_opennurbs_version;
00439   ON_String m_sStartSectionComments;
00440 
00441   // Properties include revision history, notes, information about
00442   // the applicaton that created the file, and an option preview image.
00443   ON_3dmProperties m_properties;
00444 
00445   // Settings include tolerance, and unit system, and defaults used
00446   // for creating views and objects.
00447   ON_3dmSettings   m_settings;
00448 
00449   // Tables in an openNURBS archive
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   // The id index fields are used to lookup objects by id
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   // length of archive returned by ON_BinaryArchive::Read3dmEndMark()
00472   size_t m_file_length;
00473 
00474   // Number of crc errors found during archive reading.
00475   // If > 0, then the archive is corrupt.
00476   int m_crc_error_count;
00477 
00478   //
00479   // END model definitions
00480   //
00482 
00483   /*
00484   Returns:
00485     Bounding box of every object in m_object_table[].
00486   */
00487   ON_BoundingBox BoundingBox() const;
00488 
00489   /*
00490   Description:
00491     Get render material from object attributes.
00492   Parameters:
00493     attributes - [in] object attributes.
00494     material - [out] render material
00495   */
00496   void GetRenderMaterial( 
00497         const ON_3dmObjectAttributes& attributes,
00498         ON_Material& material 
00499         ) const;
00500 
00501   /*
00502   Description:
00503     Get render material from object_index.
00504   Parameters:
00505     object_index - [in] m_object_table[] index
00506     material - [out] render material
00507   */
00508   void GetRenderMaterial( 
00509         int object_index,
00510         ON_Material& material 
00511         ) const;
00512 
00513   /*
00514   Description:
00515     Get linetype from object attributes.
00516   Parameters:
00517     attributes - [in] object attributes.
00518     linetype - [out] linetype
00519   */
00520   void GetLinetype( 
00521         const ON_3dmObjectAttributes& attributes,
00522         ON_Linetype& linetype 
00523         ) const;
00524 
00525   /*
00526   Description:
00527     Get linetype from object_index.
00528   Parameters:
00529     object_index - [in] m_object_table[] index
00530     linetype - [out] linetype
00531   */
00532   void GetLinetype(
00533         int object_index,
00534         ON_Linetype& linetype 
00535         ) const;
00536 
00537   /*
00538   Description:
00539     Get wireframe drawing color from object attributes.
00540   Parameters:
00541     attributes - [in] object attributes.
00542   Returns:
00543     Wireframe drawing color.
00544   */
00545   ON_Color WireframeColor(const ON_3dmObjectAttributes& attributes) const;
00546 
00547   /*
00548   Description:
00549     Get wireframe drawing color from object attributes.
00550   Parameters:
00551     object_index - [in] m_object_table[] index
00552   Returns:
00553     Wireframe drawing color.
00554   */
00555   ON_Color WireframeColor(int object_index) const;
00556 
00557   /* 
00558   Description:
00559     Get index of object in m_object_table from object_uuid.
00560   Parameters:
00561     object_uuid - [in] object uuid.
00562   Returns:
00563     Index of the object or -1 if it is not found.
00564   */
00565   virtual
00566   int ObjectIndex( 
00567     ON_UUID object_uuid 
00568     ) const;
00569 
00570   /* 
00571   Description:
00572     Get instance definition from instance definition table.
00573   Parameters:
00574     idef_uuid - [in] instance definition uuid.
00575   Example:
00576 
00577           ON_XModel model = ...;
00578           ..
00579           ON_InstanceRef* pIRef = ..;
00580           ON_UUID idef_uuid = pIRef->m_instance_definition_uuid;
00581           int idef_index = model.IDefIndex( idef_uuid );
00582           if ( idef_index >= 0 )
00583           {
00584             const ON_InstanceDefinition& idef = model.m_idef_table[idef_index];
00585             ...
00586           }
00587 
00588   Returns:
00589     Index of the instance definition or -1 if it is not found.
00590   */
00591   virtual
00592   int IDefIndex( 
00593     ON_UUID idef_uuid 
00594     ) const;
00595 
00596   /* 
00597   Description:
00598     Get instance definition index from instance definition name.
00599   Parameters:
00600     idef_name - [in] name to search for
00601   Returns:
00602     Index of the instance definition or -1 if it is not found.
00603   */
00604   virtual
00605   int IDefIndex( 
00606     const wchar_t* idef_name
00607     ) const;
00608 
00609   /* 
00610   Description:
00611     Get instance definition name that is not currently in use.
00612   */
00613   virtual
00614   void GetUnusedIDefName( ON_wString& idef_name ) const;
00615 
00616   /* 
00617   Description:
00618     See if the instance reference iref refers to an instance
00619     definition.
00620   Parameters:
00621     iref - [in]
00622     idef_uuid - [in] id of idef we are looking for
00623   Returns:
00624     @untitled table
00625      0         iref does not use idef
00626      1         iref directly references idef
00627     >1         iref has a nested reference to idef (nesting depth returned)
00628     -1         iref.m_instance_definition_uuid is not valid
00629     -2         invalid idef found
00630   */
00631   virtual
00632   int UsesIDef( 
00633         const ON_InstanceRef& iref,
00634         ON_UUID idef_uuid
00635         ) const;
00636 
00637   /* 
00638   Description:
00639     Get layer definition from layer table.
00640   Parameters:
00641     layer_name - [in] name to search for
00642   Example:
00643 
00644           ON_XModel model = ...;
00645           ..
00646           ON_InstanceRef* pIRef = ..;
00647           ON_UUID idef_uuid = pIRef->m_instance_definition_uuid;
00648           int layer_index = model.IDefIndex( idef_uuid );
00649           if ( idef_index >= 0 )
00650           {
00651             const ON_InstanceDefinition& idef = model.m_idef_table[idef_index];
00652             ...
00653           }
00654 
00655   Returns:
00656     Index of the layer or -1 if it is not found.
00657   */
00658   virtual
00659   int LayerIndex( 
00660     const wchar_t* layer_name
00661     ) const;
00662 
00663   /* 
00664   Description:
00665     Get layer name that is not currently in use.
00666   */
00667   virtual
00668   void GetUnusedLayerName( ON_wString& layer_name ) const;
00669 
00671   //
00672   // BEGIN model document level user string tools
00673   //
00674 
00675   /*
00676   Description:
00677     Attach a user string to the document.
00678   Parameters:
00679     key - [in] id used to retrieve this string.
00680     string_value - [in] 
00681       If NULL, the string with this id will be removed.
00682   Returns:
00683     True if successful.
00684   */
00685   bool SetDocumentUserString( 
00686     const wchar_t* key, 
00687     const wchar_t* string_value 
00688     );
00689 
00690   /*
00691   Description:
00692     Get user string from the document.
00693   Parameters:
00694     key - [in] id used to retrieve the string.
00695     string_value - [out]
00696   Returns:
00697     True if a string with id was found.
00698   */
00699   bool GetDocumentUserString( 
00700     const wchar_t* key, 
00701     ON_wString& string_value 
00702     ) const;
00703 
00704   /*
00705   Description:
00706     Get a list of all user strings in the document.
00707   Parameters:
00708     user_strings - [out]
00709       user strings are appended to this list.
00710   Returns:
00711     Number of elements appended to the user_strings list.
00712   */
00713   int GetDocumentUserStrings( ON_ClassArray<ON_UserString>& user_strings ) const;
00714 
00715   //
00716   // END model document level user string tools
00717   //
00719 
00720 
00722   //
00723   // BEGIN model text dump tools
00724   //
00725 
00726   // text dump of entire model
00727   void Dump( ON_TextLog& ) const;
00728   
00729   // text dump of model properties and settings
00730   void DumpSummary( ON_TextLog& ) const;
00731 
00732   // text dump of bitmap table
00733   void DumpBitmapTable( ON_TextLog& ) const; 
00734 
00735   // text dump of texture mapping table
00736   void DumpTextureMappingTable( ON_TextLog& ) const; 
00737 
00738   // text dump of render material table
00739   void DumpMaterialTable( ON_TextLog& ) const; 
00740 
00741   // text dump of line type table
00742   void DumpLinetypeTable( ON_TextLog& ) const; 
00743 
00744   // text dump of layer table
00745   void DumpLayerTable( ON_TextLog& ) const;
00746 
00747   // text dump of light table
00748   void DumpLightTable( ON_TextLog& ) const;
00749 
00750   // text dump of group table
00751   void DumpGroupTable( ON_TextLog& ) const;
00752 
00753   // text dump of font table
00754   void DumpFontTable( ON_TextLog& ) const;
00755 
00756   // text dump of dimstyle table
00757   void DumpDimStyleTable( ON_TextLog& ) const;
00758 
00759   // text dump of hatch pattern table
00760   void DumpHatchPatternTable( ON_TextLog& ) const;
00761 
00762   // text dump of instance definition table
00763   void DumpIDefTable( ON_TextLog& ) const;
00764 
00765   // text dump of object table
00766   void DumpObjectTable( ON_TextLog& ) const;
00767 
00768   // text dump of object table
00769   void DumpHistoryRecordTable( ON_TextLog& ) const;
00770 
00771   // text dump of user data table
00772   void DumpUserDataTable( ON_TextLog& ) const;
00773 
00774   //
00775   // END model text dump tools
00776   //
00778 
00779   /*
00780   Description:
00781     Destroys cached searching and bounding box information.  Call
00782     if you modify the m_object_table or m_idef_table.
00783   */
00784   void DestroyCache();
00785 
00787   //
00788   // BEGIN Render Development Toolkit (RDK) information
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   // END Render Development Toolkit (RDK) information
00797   //
00799 
00800 
00801 private:
00802   // prohibit use of copy construction and operator=
00803   ONX_Model(const ONX_Model&);
00804   ONX_Model& operator=(const ONX_Model&);
00805 
00806 private:
00807 
00808   // This bounding box contains all objects in the object table.
00809   ON_BoundingBox m__object_table_bbox;
00810 };
00811 
00812 /*
00813 Description:
00814   Tests a string to see if it is valid as a name for a layer,
00815   object, material, linetype, instance definition, etc.
00816 Parameters:
00817   name - [in] string to test
00818 Returns:
00819   True if the string is a valid name.
00820 */
00821 ON_DECL
00822 bool ONX_IsValidName( 
00823           const wchar_t* name 
00824           );
00825 
00826 #endif


pcl
Author(s): Open Perception
autogenerated on Wed Aug 26 2015 15:27:01