Rhino C++ API  8.11
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
ON_BinaryArchive Class Referenceabstract

< use for generic serialization of binary data More...

#include <opennurbs_archive.h>

Inheritance diagram for ON_BinaryArchive:
ON_BinaryArchiveBuffer ON_BinaryFile ON_Read3dmBufferArchive ON_Write3dmBufferArchive

Public Types

enum  eStorageDeviceError : unsigned int {
  eStorageDeviceError::None = 0, eStorageDeviceError::WriteFailed = 0xFFFFFFF1, eStorageDeviceError::SeekFailedDuringWriting = 0xFFFFFFF2, eStorageDeviceError::ReadFailed = 0xFFFFFFF8,
  eStorageDeviceError::SeekFailedDuringReading = 0xFFFFFFF9, eStorageDeviceError::UnknownDeviceError = 0xFFFFFFFFU
}
 

Public Member Functions

 ON_BinaryArchive (ON::archive_mode)
 
virtual ~ON_BinaryArchive ()
 
ON_3dmArchiveTableType Active3dmTable () const
 
bool AddManifestMapItem (const class ON_ManifestMapItem &map_item)
 
const class ON_3dmPropertiesArchive3dmProperties () const
 
const class ON_3dmSettingsArchive3dmSettings () const
 
const ON_StringArchive3dmStartSectionComment () const
 
const ON_3dmArchiveTableStatus Archive3dmTableStatus (ON_3dmArchiveTableType table_type)
 
int Archive3dmVersion () const
 
bool ArchiveContains3dmTable (ON_3dmArchiveTableType table) const
 
const ON_DimStyleArchiveCurrentDimStyle () const
 
const ON_UUID ArchiveCurrentDimStyleId () const
 
const int ArchiveCurrentDimStyleIndex () const
 
const ON_wStringArchiveDirectoryName () const
 
const wchar_t * ArchiveDirectoryNameAsPointer () const
 
bool ArchiveFileMoved () const
 
const ON_wStringArchiveFileName () const
 
const wchar_t * ArchiveFileNameAsPointer () const
 
const ON_wStringArchiveFullPath () const
 
const wchar_t * ArchiveFullPathAsPointer () const
 
unsigned int ArchiveOpenNURBSVersion () const
 
ON::RuntimeEnvironment ArchiveRuntimeEnvironment () const
 
const ON_wStringArchiveSavedAsFullPath () const
 
const wchar_t * ArchiveSavedAsFullPathPointer () const
 
size_t ArchiveStartOffset () const
 
const ON_TextStyleArchiveTextStyleFromArchiveTextStyleIndex (int archive_text_style_index) const
 
virtual bool AtEnd () const =0
 
unsigned int BadCRCCount () const
 
bool BeginRead3dmAnonymousChunk (int *version)
 
bool BeginRead3dmBigChunk (unsigned int *, ON__INT64 *)
 
bool BeginRead3dmBitmapTable ()
 
bool BeginRead3dmChunk (unsigned int expected_tcode, int *major_version, int *minor_version)
 
bool BeginRead3dmDimStyleTable ()
 
bool BeginRead3dmGroupTable ()
 
bool BeginRead3dmHatchPatternTable ()
 
bool BeginRead3dmHistoryRecordTable ()
 
bool BeginRead3dmInstanceDefinitionTable ()
 
bool BeginRead3dmLayerTable ()
 
bool BeginRead3dmLightTable ()
 
bool BeginRead3dmLinetypeTable ()
 
bool BeginRead3dmMaterialTable ()
 
bool BeginRead3dmObjectTable ()
 
bool BeginRead3dmTextureMappingTable ()
 
bool BeginRead3dmUserTable (ON_UUID &plugin_id, bool *bLastSavedAsGoo, int *archive_3dm_version, unsigned int *archive_opennurbs_version)
 
bool BeginReadDictionary (ON_UUID *dictionary_id, unsigned int *version, ON_wString &dictionary_name)
 
int BeginReadDictionaryEntry (int *de_type, ON_wString &entry_name)
 
bool BeginWrite3dmAnonymousChunk (int version)
 
bool BeginWrite3dmBigChunk (ON__UINT32 typecode, ON__INT64 value)
 
bool BeginWrite3dmBitmapTable ()
 
bool BeginWrite3dmChunk (unsigned int tcode, int major_version, int minor_version)
 
bool BeginWrite3dmChunk (unsigned int, int)
 
bool BeginWrite3dmDimStyleTable ()
 
bool BeginWrite3dmGroupTable ()
 
bool BeginWrite3dmHatchPatternTable ()
 
bool BeginWrite3dmHistoryRecordTable ()
 
bool BeginWrite3dmInstanceDefinitionTable ()
 
bool BeginWrite3dmLayerTable ()
 
bool BeginWrite3dmLightTable ()
 
bool BeginWrite3dmLinetypeTable ()
 
bool BeginWrite3dmMaterialTable ()
 
bool BeginWrite3dmObjectTable ()
 
bool BeginWrite3dmTextureMappingTable ()
 
bool BeginWrite3dmUserTable (const ON_UUID &)
 
bool BeginWrite3dmUserTable (ON_UUID plugin_id, bool bSavingGoo, int goo_3dm_version, unsigned int goo_opennurbs_version)
 
bool BeginWriteDictionary (ON_UUID dictionary_id, unsigned int version, const wchar_t *dictionary_name)
 
bool BeginWriteDictionaryEntry (int de_type, const wchar_t *entry_name)
 
bool CheckForRemappedIds () const
 
bool ChunkBoundaryCheck () const
 
void ClearModelSerialNumber ()
 
unsigned int CriticalErrorCount () const
 
ON__UINT64 CurrentPosition () const
 
unsigned int Dump3dmChunk (ON_TextLog &text_log, int recursion_depth=0)
 
bool EnableCRCCalculation (bool bEnable)
 
void EnableSave3dmAnalysisMeshes (unsigned int object_type_flags, bool bSave3dmAnalysisMeshes)
 
void EnableSave3dmRenderMeshes (unsigned int object_type_flags, bool bSave3dmRenderMeshes)
 
ON::endian Endian () const
 endian-ness of cpu More...
 
bool EndRead3dmBitmapTable ()
 
bool EndRead3dmChunk ()
 
bool EndRead3dmChunk (bool bSupressPartiallyReadChunkWarning)
 
bool EndRead3dmDimStyleTable ()
 
bool EndRead3dmGroupTable ()
 
bool EndRead3dmHatchPatternTable ()
 
bool EndRead3dmHistoryRecordTable ()
 
bool EndRead3dmInstanceDefinitionTable ()
 
bool EndRead3dmLayerTable ()
 
bool EndRead3dmLightTable ()
 
bool EndRead3dmLinetypeTable ()
 
bool EndRead3dmMaterialTable ()
 
bool EndRead3dmObjectTable ()
 
bool EndRead3dmTextureMappingTable ()
 
bool EndRead3dmUserTable ()
 
bool EndReadDictionary ()
 
bool EndReadDictionaryEntry ()
 
bool EndWrite3dmBitmapTable ()
 
bool EndWrite3dmChunk ()
 updates length in chunk header More...
 
bool EndWrite3dmDimStyleTable ()
 
bool EndWrite3dmGroupTable ()
 
bool EndWrite3dmHatchPatternTable ()
 
bool EndWrite3dmHistoryRecordTable ()
 
bool EndWrite3dmInstanceDefinitionTable ()
 
bool EndWrite3dmLayerTable ()
 
bool EndWrite3dmLightTable ()
 
bool EndWrite3dmLinetypeTable ()
 
bool EndWrite3dmMaterialTable ()
 
bool EndWrite3dmObjectTable ()
 
bool EndWrite3dmTextureMappingTable ()
 
bool EndWrite3dmUserTable ()
 
bool EndWriteDictionary ()
 
bool EndWriteDictionaryEntry ()
 
bool FindTableInDamagedArchive (unsigned int tcode_table, unsigned int tcode_record, ON_UUID class_uuid, int min_length_data)
 
ON_3dmArchiveTableType FirstFailed3dmTable () const
 
virtual bool Flush ()=0
 
int GetCurrentChunk (ON_3DM_BIG_CHUNK &big_chunk) const
 
int GetCurrentChunk (ON_3DM_CHUNK &chunk) const
 
unsigned int InstanceDefinitionModelSerialNumber () const
 
void IntentionallyWriteCorrupt3dmStartSectionForExpertTesting ()
 
bool Internal_Read3dmDimStyleOverrides (class ON_Annotation &annotation, bool bFromDimStyleTable)
 
bool Internal_Write3dmDimStyleOverrides (const class ON_Annotation &annotation, const class ON_DimStyle *dim_style_overrides)
 
virtual int LoadUserDataApplication (ON_UUID application_id)
 
const class ON_ComponentManifestManifest () const
 
const class ON_ManifestMapManifestMap () const
 
ON::archive_mode Mode () const
 
unsigned int ModelSerialNumber () const
 
bool ObjectHasUserDataToWrite (const class ON_Object *object) const
 
 ON_DEPRECATED_MSG ("ON_BinaryArchive::ReadSize is deprecated because it truncates to 32-bits.\n" " - If you are updating existing code use 'ReadInt' instead.\n" " - Else if you need to write a 64-bit size_t please call 'ReadBigSize'") bool ReadSize(size_t *)
 < Read a single 32 bit size_t More...
 
 ON_DEPRECATED_MSG ("ON_BinaryArchive::WriteSize is deprecated because it truncates to 32-bits.\n" " - If you are updating existing code use 'WriteInt' instead.\n" " - Else if you need to write a 64-bit size_t please call 'WriteBigSize'") bool WriteSize(size_t)
 < Write a single 32 bit size_t More...
 
bool PeekAt3dmBigChunkType (ON__UINT32 *typecode, ON__INT64 *big_value)
 
bool PeekAt3dmChunkType (unsigned int *, int *)
 
ON_3dmArchiveTableType Previous3dmTable () const
 
bool Read3dmAnonymousUserTable (int archive_3dm_version, unsigned int archive_opennurbs_version, ON_3dmGoo &goo)
 
int Read3dmBitmap (class ON_Bitmap **)
 
bool Read3dmChunkVersion (int *, int *)
 
int Read3dmDimStyle (class ON_DimStyle **ppDimStyle)
 
bool Read3dmEndMark (size_t *)
 
bool Read3dmGoo (ON_3dmGoo &)
 Call to read "goo". More...
 
int Read3dmGroup (class ON_Group **)
 
int Read3dmHatchPattern (class ON_HatchPattern **)
 
int Read3dmHistoryRecord (class ON_HistoryRecord *&)
 
int Read3dmInstanceDefinition (class ON_InstanceDefinition **)
 
int Read3dmLayer (ON_Layer **)
 
int Read3dmLight (class ON_Light **light, class ON_3dmObjectAttributes *attributes)
 
int Read3dmLinetype (class ON_Linetype **)
 
int Read3dmMaterial (class ON_Material **)
 
int Read3dmModelGeometry (class ON_ModelGeometryComponent **model_geometry, unsigned int object_filter=0)
 Call either Read3dmModelGeometry or Read3dmObject. More...
 
int Read3dmModelGeometryForExperts (bool bManageGeometry, bool bManageAttributes, class ON_ModelGeometryComponent **model_geometry, unsigned int object_filter)
 
int Read3dmModelLight (class ON_ModelGeometryComponent **model_light)
 Call either Read3dmModelLight or Read3dmLight. More...
 
int Read3dmObject (ON_Object **model_object, ON_3dmObjectAttributes *attributes, unsigned int object_filter=0)
 
bool Read3dmProperties (class ON_3dmProperties &)
 
bool Read3dmReferencedComponentId (ON_ModelComponent::Type component_type, ON_UUID *component_id)
 
bool Read3dmReferencedComponentIndex (ON_ModelComponent::Type component_type, int *component_index)
 
bool Read3dmReferencedComponentIndexArray (ON_ModelComponent::Type component_type, ON_SimpleArray< int > &component_index_array)
 
bool Read3dmSettings (class ON_3dmSettings &)
 
bool Read3dmStartSection (int *version, ON_String &sStartSectionComment)
 
int Read3dmTextureMapping (class ON_TextureMapping **)
 
bool ReadArc (ON_Arc &)
 
bool ReadArray (ON_ClassArray< class ON_ObjRef > &)
 
bool ReadArray (ON_ClassArray< ON_MappingRef > &)
 
bool ReadArray (ON_ClassArray< ON_MaterialRef > &)
 
bool ReadArray (ON_ClassArray< ON_String > &)
 
bool ReadArray (ON_ClassArray< ON_wString > &)
 
bool ReadArray (ON_ObjectArray< class ON_Layer > &)
 
bool ReadArray (ON_SimpleArray< bool > &)
 
bool ReadArray (ON_SimpleArray< char > &)
 
bool ReadArray (ON_SimpleArray< class ON_ClippingPlaneInfo > &)
 
bool ReadArray (ON_SimpleArray< class ON_Layer * > &)
 
bool ReadArray (ON_SimpleArray< class ON_ObjRef_IRefID > &)
 
bool ReadArray (ON_SimpleArray< double > &)
 
bool ReadArray (ON_SimpleArray< float > &)
 
bool ReadArray (ON_SimpleArray< ON_2dPoint > &)
 
bool ReadArray (ON_SimpleArray< ON_2dVector > &)
 
bool ReadArray (ON_SimpleArray< ON_2fPoint > &)
 
bool ReadArray (ON_SimpleArray< ON_2fVector > &)
 
bool ReadArray (ON_SimpleArray< ON_3dPoint > &)
 
bool ReadArray (ON_SimpleArray< ON_3dVector > &)
 
bool ReadArray (ON_SimpleArray< ON_3fPoint > &)
 
bool ReadArray (ON_SimpleArray< ON_3fVector > &)
 
bool ReadArray (ON_SimpleArray< ON_4dPoint > &)
 
bool ReadArray (ON_SimpleArray< ON_4fPoint > &)
 
bool ReadArray (ON_SimpleArray< ON__INT16 > &)
 
bool ReadArray (ON_SimpleArray< ON__INT32 > &)
 
bool ReadArray (ON_SimpleArray< ON__INT8 > &)
 
bool ReadArray (ON_SimpleArray< ON__UINT16 > &)
 
bool ReadArray (ON_SimpleArray< ON__UINT32 > &)
 
bool ReadArray (ON_SimpleArray< ON__UINT8 > &)
 
bool ReadArray (ON_SimpleArray< ON_Color > &)
 
bool ReadArray (ON_SimpleArray< ON_DisplayMaterialRef > &)
 
bool ReadArray (ON_SimpleArray< ON_LinetypeSegment > &)
 
bool ReadArray (ON_SimpleArray< ON_MappingChannel > &)
 
bool ReadArray (ON_SimpleArray< ON_SurfaceCurvature > &)
 
bool ReadArray (ON_SimpleArray< ON_UUID > &)
 
bool ReadArray (ON_SimpleArray< ON_UuidIndex > &)
 
bool ReadArray (ON_SimpleArray< ON_UuidPtr > &)
 
bool ReadArray (ON_SimpleArray< ON_Xform > &)
 
bool ReadBigInt (ON__INT64 *)
 
bool ReadBigInt (ON__UINT64 *)
 
bool ReadBigInt (size_t, ON__INT64 *)
 
bool ReadBigInt (size_t, ON__UINT64 *)
 
bool ReadBigSize (size_t *)
 64 bits More...
 
bool ReadBigTime (time_t *)
 UCT seconds since 1 January 1970 (64 bits) More...
 
bool ReadBool (bool *)
 
bool ReadBoundingBox (ON_BoundingBox &)
 
ON__UINT64 ReadBuffer (ON__UINT64 sizeof_buffer, void *buffer)
 
bool ReadByte (size_t, void *)
 must fail if mode is not read or readwrite More...
 
bool ReadChar (char *)
 
bool ReadChar (ON__INT8 *)
 
bool ReadChar (ON__UINT8 *)
 
bool ReadChar (size_t, char *)
 
bool ReadChar (size_t, ON__INT8 *)
 
bool ReadChar (size_t, ON__UINT8 *)
 
bool ReadCircle (ON_Circle &)
 
bool ReadColor (ON_4fColor &)
 
bool ReadColor (ON_Color &)
 
bool ReadComponentIndex (ON_COMPONENT_INDEX &)
 
bool ReadCompressedBuffer (size_t sizeof__outbuffer, void *outbuffer, bool *bFailedCRC)
 
bool ReadCompressedBufferSize (size_t *sizeof__outbuffer)
 
bool ReadDisplayMaterialRef (ON_DisplayMaterialRef &)
 
bool ReadDouble (double *)
 
bool ReadDouble (size_t, double *)
 
bool ReadFloat (float *)
 
bool ReadFloat (size_t, float *)
 
bool ReadInt (ON__INT32 *)
 
bool ReadInt (ON__UINT32 *)
 
bool ReadInt (size_t, ON__INT32 *)
 
bool ReadInt (size_t, ON__UINT32 *)
 
bool ReadInterval (ON_Interval &)
 
bool ReadLine (ON_Line &)
 
bool ReadLinetypeSegment (ON_LinetypeSegment &)
 
bool ReadLong (long *)
 
bool ReadLong (size_t, long *)
 
bool ReadLong (size_t, unsigned long *)
 
bool ReadLong (unsigned long *)
 
bool ReadMode () const
 
bool ReadModelComponentAttributes (ON_ModelComponent &model_component, unsigned int *attributes_filter)
 
int ReadObject (ON_Object &object)
 
int ReadObject (ON_Object **ppObject)
 
bool ReadObjectUserData (ON_Object &object)
 
bool ReadPlane (ON_Plane &)
 
bool ReadPlaneEquation (ON_PlaneEquation &)
 
bool ReadPoint (ON_2dPoint &)
 
bool ReadPoint (ON_3dPoint &)
 
bool ReadPoint (ON_4dPoint &)
 
bool ReadShort (ON__INT16 *)
 
bool ReadShort (ON__UINT16 *)
 
bool ReadShort (size_t, ON__INT16 *)
 
bool ReadShort (size_t, ON__UINT16 *)
 
bool ReadString (ON_String &sUTF8)
 
bool ReadString (ON_wString &s)
 
bool ReadString (size_t str_array_count, char *str_array)
 
bool ReadString (size_t str_array_count, unsigned char *str_array)
 
bool ReadString (size_t str_array_count, unsigned short *str_array)
 
bool ReadStringSize (size_t *str_array_count)
 
bool ReadStringUTF16ElementCount (size_t *string_utf16_element_count)
 
bool ReadStringUTF8ElementCount (size_t *string_utf8_element_count)
 
bool ReadTime (struct tm &)
 
bool ReadUuid (ON_UUID &)
 
bool ReadV1_TCODE_ANNOTATION (unsigned int, ON_Object **, ON_3dmObjectAttributes *)
 
bool ReadV1_TCODE_LEGACY_CRV (ON_Object **, ON_3dmObjectAttributes *)
 
bool ReadV1_TCODE_LEGACY_FAC (ON_Object **, ON_3dmObjectAttributes *)
 
bool ReadV1_TCODE_LEGACY_SHL (ON_Object **, ON_3dmObjectAttributes *)
 
bool ReadV1_TCODE_MESH_OBJECT (ON_Object **, ON_3dmObjectAttributes *)
 
bool ReadV1_TCODE_RH_POINT (ON_Object **, ON_3dmObjectAttributes *)
 helpers for reading V1 objects More...
 
bool ReadV1_TCODE_RHINOIO_OBJECT_BREP (ON_Object **, ON_3dmObjectAttributes *)
 
bool ReadV1_TCODE_RHINOIO_OBJECT_NURBS_CURVE (ON_Object **, ON_3dmObjectAttributes *)
 
bool ReadV1_TCODE_RHINOIO_OBJECT_NURBS_SURFACE (ON_Object **, ON_3dmObjectAttributes *)
 
bool ReadVector (ON_2dVector &)
 
bool ReadVector (ON_3dVector &)
 
bool ReadWideString (ON_wString &wide_string)
 
bool ReadXform (ON_Xform &)
 
bool ReferencedComponentIdMapping () const
 
bool ReferencedComponentIndexMapping () const
 
unsigned int ReferenceModelSerialNumber () const
 
bool Save3dmAnalysisMesh (ON::object_type object_type) const
 
unsigned int Save3dmAnalysisMeshObjectTypeFlags () const
 
bool Save3dmPreviewImage () const
 
bool Save3dmRenderMesh (ON::object_type object_type) const
 
unsigned int Save3dmRenderMeshObjectTypeFlags () const
 
bool Seek3dmChunkFromCurrentPosition (unsigned int)
 
bool Seek3dmChunkFromStart (unsigned int)
 
bool SeekBackward (ON__UINT64 bytes_backward)
 
bool SeekForward (ON__UINT64 bytes_forward)
 
bool SeekFromStart (ON__UINT64 bytes_from_start)
 
bool SetArchive3dmVersion (int)
 
void SetArchiveFullPath (const wchar_t *archive_directory_name, const wchar_t *archive_file_name)
 
void SetArchiveFullPath (const wchar_t *archive_full_path)
 
void SetCheckForRemappedIds (bool bCheckForRemappedIds)
 
void SetChunkBoundaryCheck (bool bChunkBoundaryCheck)
 
void SetModelSerialNumber (unsigned int model_serial_number, unsigned int reference_model_serial_number, unsigned int instance_definition_model_serial_number)
 
bool SetOpenNURBS3dmVersion (unsigned int v)
 
void SetReferencedComponentIdMapping (bool bEnableReferenceComponentIdMapping)
 
void SetReferencedComponentIndexMapping (bool bEnableReferenceComponentIndexMapping)
 
void SetSave3dmPreviewImage (bool bSave3dmPreviewImage)
 
bool SetShouldSerializeUserDataDefault (bool bSerialize)
 
bool SetShouldSerializeUserDataItem (ON_UUID application_id, ON_UUID item_id, bool bSerializeUserDataItem)
 
void SetStorageDeviceError (ON_BinaryArchive::eStorageDeviceError storage_device_error)
 
void SetStorageDeviceError (unsigned int storage_device_error)
 
void SetUseBufferCompression (bool bUseBufferCompression)
 
bool ShouldSerializeAllUserData () const
 
bool ShouldSerializeNoUserData () const
 
bool ShouldSerializeSomeUserData () const
 
bool ShouldSerializeUserDataDefault () const
 
bool ShouldSerializeUserDataItem (ON_UUID application_id, ON_UUID item_id) const
 
bool ShouldWriteUserDataItem (const class ON_Object *object, const class ON_UserData *object_user_data) const
 
size_t SizeofChunkLength () const
 
unsigned int StorageDeviceError () const
 
bool UnsetMode () const
 
bool UpdateManifestMapItemDestination (const class ON_ManifestMapItem &map_item)
 
bool UseBufferCompression () const
 
bool Write3dmAnonymousUserTable (const class ON_3dmGoo &)
 
bool Write3dmAnonymousUserTableRecord (ON_UUID plugin_id, int goo_3dm_version, unsigned int goo_opennurbs_version, const class ON_3dmGoo &goo)
 
bool Write3dmBitmap (const class ON_Bitmap &)
 
bool Write3dmChunkVersion (int, int)
 
bool Write3dmDimStyle (const class ON_DimStyle &)
 
bool Write3dmDimStyleComponent (const class ON_ModelComponent *model_component)
 
bool Write3dmDimStyleComponent (const class ON_ModelComponentReference &model_component_reference)
 
bool Write3dmEndMark ()
 
bool Write3dmGoo (const ON_3dmGoo &)
 call to write "goo" More...
 
bool Write3dmGroup (const class ON_Group &)
 
bool Write3dmGroupComponent (const class ON_ModelComponent *model_component)
 
bool Write3dmGroupComponent (const class ON_ModelComponentReference &model_component_reference)
 
bool Write3dmHatchPattern (const class ON_HatchPattern &)
 
bool Write3dmHatchPatternComponent (const class ON_ModelComponent *model_component)
 
bool Write3dmHatchPatternComponent (const class ON_ModelComponentReference &model_component_reference)
 
bool Write3dmHistoryRecord (const class ON_HistoryRecord &)
 
bool Write3dmHistoryRecordComponent (const class ON_ModelComponent *model_component)
 
bool Write3dmHistoryRecordComponent (const class ON_ModelComponentReference &model_component_reference)
 
bool Write3dmImageComponent (const class ON_ModelComponent *model_component)
 
bool Write3dmImageComponent (const class ON_ModelComponentReference &model_component_reference)
 
bool Write3dmInstanceDefinition (const class ON_InstanceDefinition &)
 
bool Write3dmInstanceDefinitionComponent (const class ON_ModelComponent *model_component)
 
bool Write3dmInstanceDefinitionComponent (const class ON_ModelComponentReference &model_component_reference)
 
bool Write3dmLayer (const ON_Layer &)
 
bool Write3dmLayerComponent (const class ON_ModelComponent *model_component)
 
bool Write3dmLayerComponent (const class ON_ModelComponentReference &model_component_reference)
 
bool Write3dmLight (const class ON_Light &, const class ON_3dmObjectAttributes *)
 
bool Write3dmLinePatternComponent (const class ON_ModelComponent *model_component)
 
bool Write3dmLinePatternComponent (const class ON_ModelComponentReference &model_component_reference)
 
bool Write3dmLinetype (const class ON_Linetype &line_pattern)
 
bool Write3dmMaterial (const class ON_Material &)
 
bool Write3dmMaterialComponent (const class ON_ModelComponent *model_component)
 
bool Write3dmMaterialComponent (const class ON_ModelComponentReference &model_component_reference)
 
bool Write3dmModelGeometryComponent (const class ON_ModelComponentReference &model_component_reference)
 
bool Write3dmModelGeometryComponent (const class ON_ModelGeometryComponent *model_geometry)
 
bool Write3dmModelLightComponent (const class ON_ModelComponentReference &model_component_reference)
 
bool Write3dmModelLightComponent (const class ON_ModelGeometryComponent *model_light)
 
bool Write3dmObject (const ON_Object &, const ON_3dmObjectAttributes *)
 
bool Write3dmProperties (const class ON_3dmProperties &)
 
bool Write3dmReferencedComponentId (const ON_ModelComponent &model_component)
 
bool Write3dmReferencedComponentId (ON_ModelComponent::Type component_type, ON_UUID model_component_id)
 
bool Write3dmReferencedComponentIndex (const ON_ModelComponent &model_component)
 
bool Write3dmReferencedComponentIndex (ON_ModelComponent::Type component_type, int model_component_index)
 
bool Write3dmReferencedComponentIndex (ON_ModelComponent::Type component_type, ON_UUID model_component_id)
 
bool Write3dmSettings (const class ON_3dmSettings &)
 
bool Write3dmStartSection (int version, const char *sStartSectionComment)
 
bool Write3dmTextureMapping (const class ON_TextureMapping &)
 
bool Write3dmTextureMappingComponent (const class ON_ModelComponent *model_component)
 
bool Write3dmTextureMappingComponent (const class ON_ModelComponentReference &model_component_reference)
 
bool WriteArc (const ON_Arc &)
 
bool WriteArray (const ON_ClassArray< class ON_ObjRef > &)
 
bool WriteArray (const ON_ClassArray< ON_MappingRef > &)
 
bool WriteArray (const ON_ClassArray< ON_MaterialRef > &)
 
bool WriteArray (const ON_ClassArray< ON_String > &)
 
bool WriteArray (const ON_ClassArray< ON_wString > &)
 
bool WriteArray (const ON_SimpleArray< bool > &)
 
bool WriteArray (const ON_SimpleArray< char > &)
 
bool WriteArray (const ON_SimpleArray< class ON_ClippingPlaneInfo > &)
 
bool WriteArray (const ON_SimpleArray< class ON_ObjRef_IRefID > &)
 
bool WriteArray (const ON_SimpleArray< double > &)
 
bool WriteArray (const ON_SimpleArray< float > &)
 
bool WriteArray (const ON_SimpleArray< ON_2dPoint > &)
 
bool WriteArray (const ON_SimpleArray< ON_2dVector > &)
 
bool WriteArray (const ON_SimpleArray< ON_2fPoint > &)
 
bool WriteArray (const ON_SimpleArray< ON_2fVector > &)
 
bool WriteArray (const ON_SimpleArray< ON_3dPoint > &)
 
bool WriteArray (const ON_SimpleArray< ON_3dVector > &)
 
bool WriteArray (const ON_SimpleArray< ON_3fPoint > &)
 
bool WriteArray (const ON_SimpleArray< ON_3fVector > &)
 
bool WriteArray (const ON_SimpleArray< ON_4dPoint > &)
 
bool WriteArray (const ON_SimpleArray< ON_4fPoint > &)
 
bool WriteArray (const ON_SimpleArray< ON__INT16 > &)
 
bool WriteArray (const ON_SimpleArray< ON__INT32 > &)
 
bool WriteArray (const ON_SimpleArray< ON__INT8 > &)
 
bool WriteArray (const ON_SimpleArray< ON__UINT16 > &)
 
bool WriteArray (const ON_SimpleArray< ON__UINT32 > &)
 
bool WriteArray (const ON_SimpleArray< ON__UINT8 > &)
 
bool WriteArray (const ON_SimpleArray< ON_Color > &)
 
bool WriteArray (const ON_SimpleArray< ON_DisplayMaterialRef > &)
 
bool WriteArray (const ON_SimpleArray< ON_LinetypeSegment > &)
 
bool WriteArray (const ON_SimpleArray< ON_MappingChannel > &)
 
bool WriteArray (const ON_SimpleArray< ON_SurfaceCurvature > &)
 
bool WriteArray (const ON_SimpleArray< ON_UUID > &)
 
bool WriteArray (const ON_SimpleArray< ON_UuidIndex > &)
 
bool WriteArray (const ON_SimpleArray< ON_UuidPtr > &)
 
bool WriteArray (const ON_SimpleArray< ON_Xform > &)
 
bool WriteArray (int count, const class ON_Layer *)
 
bool WriteArray (int count, const class ON_Layer *const *)
 
bool WriteBigInt (ON__INT64)
 
bool WriteBigInt (ON__UINT64)
 
bool WriteBigInt (size_t, const ON__INT64 *)
 
bool WriteBigInt (size_t, const ON__UINT64 *)
 
bool WriteBigSize (size_t)
 64 bits More...
 
bool WriteBigTime (time_t)
 UCT seconds since 1 January 1970 (64 bits) More...
 
bool WriteBool (bool)
 
bool WriteBoolFalse ()
 
bool WriteBoolTrue ()
 
bool WriteBoundingBox (const ON_BoundingBox &)
 
bool WriteByte (size_t, const void *)
 must fail if mode is not write or readwrite More...
 
bool WriteChar (char)
 
bool WriteChar (ON__INT8)
 
bool WriteChar (ON__UINT8)
 
bool WriteChar (size_t, const char *)
 
bool WriteChar (size_t, const ON__INT8 *)
 
bool WriteChar (size_t, const ON__UINT8 *)
 
bool WriteCircle (const ON_Circle &)
 
bool WriteColor (const ON_4fColor &)
 
bool WriteColor (const ON_Color &)
 
bool WriteComponentIndex (const ON_COMPONENT_INDEX &)
 
bool WriteCompressedBuffer (size_t sizeof__inbuffer, const void *inbuffer)
 
bool WriteDisplayMaterialRef (const ON_DisplayMaterialRef &)
 
bool WriteDouble (double)
 
bool WriteDouble (size_t, const double *)
 
bool WriteFloat (float)
 
bool WriteFloat (size_t, const float *)
 
bool WriteInt (ON__INT32)
 
bool WriteInt (ON__UINT32)
 
bool WriteInt (size_t, const ON__INT32 *)
 
bool WriteInt (size_t, const ON__UINT32 *)
 
bool WriteInterval (const ON_Interval &)
 
bool WriteLine (const ON_Line &)
 
bool WriteLinetypeSegment (const ON_LinetypeSegment &)
 
bool WriteLong (long)
 
bool WriteLong (size_t, const long *)
 
bool WriteLong (size_t, const unsigned long *)
 
bool WriteLong (unsigned long)
 
bool WriteMode () const
 
bool WriteModelComponentAttributes (const class ON_ModelComponent &model_component, unsigned int attributes_filter)
 
bool WriteModelComponentName (const ON_ModelComponent &model_component)
 
bool WriteObject (const ON_Object &)
 writes object definition More...
 
bool WriteObject (const ON_Object *)
 writes object definition More...
 
bool WriteObjectUserData (const ON_Object &object)
 
bool WritePlane (const ON_Plane &)
 
bool WritePlaneEquation (const ON_PlaneEquation &)
 
bool WritePoint (const ON_2dPoint &)
 
bool WritePoint (const ON_3dPoint &)
 
bool WritePoint (const ON_4dPoint &)
 
bool WriteShort (ON__INT16)
 
bool WriteShort (ON__UINT16)
 
bool WriteShort (size_t, const ON__INT16 *)
 
bool WriteShort (size_t, const ON__UINT16 *)
 
bool WriteString (const char *sUTF8)
 
bool WriteString (const ON_String &sUTF8)
 
bool WriteString (const ON_wString &s)
 
bool WriteString (const unsigned char *sUTF8)
 
bool WriteTime (const struct tm &)
 
bool WriteUTF16String (const unsigned short *sUTF16)
 
bool WriteUuid (const ON_UUID &)
 
bool WriteVector (const ON_2dVector &)
 
bool WriteVector (const ON_3dVector &)
 
bool WriteWideString (const ON_wString &wide_string)
 
bool WriteWideString (const wchar_t *sWideChar, int sWideChar_count)
 
bool WriteXform (const ON_Xform &)
 

Static Public Member Functions

static bool ArchiveContains3dmTable (ON_3dmArchiveTableType table, unsigned int archive_3dm_version, unsigned int opennurbs_library_version)
 
static unsigned int ArchiveOpenNURBSVersionToWrite (unsigned int archive_3dm_version, unsigned int opennurbs_version)
 
static int CurrentArchiveVersion ()
 
static char * ON_TypecodeParse (unsigned int tcode, char *typecode_name, size_t max_length)
 
static ON_BinaryArchive::eStorageDeviceError StorageDeviceErrorFromUnsigned (unsigned int storage_device_error_as_unsigned)
 
static ON_ModelComponent::Type TableComponentType (ON_3dmArchiveTableType table_type)
 
static bool ToggleByteOrder (size_t, size_t, const void *, void *)
 
static const char * TypecodeName (unsigned int tcode)
 

Protected Member Functions

unsigned int ErrorMessageMask () const
 
virtual ON__UINT64 Internal_CurrentPositionOverride () const =0
 
virtual size_t Internal_ReadOverride (size_t, void *)=0
 
virtual bool Internal_SeekFromCurrentPositionOverride (int)=0
 
virtual bool Internal_SeekToStartOverride ()=0
 
virtual size_t Internal_WriteOverride (size_t, const void *)=0
 
bool MaskReadError (ON__UINT64 sizeof_request, ON__UINT64 sizeof_read) const
 

Friends

void ON_SetBinaryArchiveOpenNURBSVersion (ON_BinaryArchive &, unsigned int)
 

Detailed Description

< use for generic serialization of binary data

Member Enumeration Documentation

◆ eStorageDeviceError

enum ON_BinaryArchive::eStorageDeviceError : unsigned int
strong
Enumerator
None 
WriteFailed 

writing to device failed

values from 1 through 0xFFFFFFF0 are used for IO device specific exceptions that terminate reading or writing.

SeekFailedDuringWriting 

virtual Seek() failed during writing

ReadFailed 

reading from device failed

SeekFailedDuringReading 

virtual Seek() failed during reading

UnknownDeviceError 

Constructor & Destructor Documentation

◆ ON_BinaryArchive()

ON_BinaryArchive::ON_BinaryArchive ( ON::archive_mode  )

◆ ~ON_BinaryArchive()

virtual ON_BinaryArchive::~ON_BinaryArchive ( )
virtual

Member Function Documentation

◆ Active3dmTable()

ON_3dmArchiveTableType ON_BinaryArchive::Active3dmTable ( ) const

Returns: If a 3dm archive is being read or written, the value of the archive section (table) being read is returned. ON_3dmArchiveTableType::Unset is returned if a table is not actively being read or written. Remarks: Use ON_BinaryArchive::Mode() to determine if a binary archive is being read or written. Use ON_BinaryArchive::Previous3dmTable() to determine the most recent table that was successfully read and finished.

◆ AddManifestMapItem()

bool ON_BinaryArchive::AddManifestMapItem ( const class ON_ManifestMapItem map_item)

◆ Archive3dmProperties()

const class ON_3dmProperties& ON_BinaryArchive::Archive3dmProperties ( ) const

Returns: A copy of the ON_3dmProperties information written to or read from the archive. If this function is called before Write3dmProperties() or Read3dmProperties(), it returns ON_3dmProperties:Empty;

◆ Archive3dmSettings()

const class ON_3dmSettings& ON_BinaryArchive::Archive3dmSettings ( ) const

Returns: A copy of the ON_3dmSettings information written to or read from the archive. If this function is called before Write3dmSettings() or Read3dmSettings(), it returns ON_3dmSettings:Default;

◆ Archive3dmStartSectionComment()

const ON_String& ON_BinaryArchive::Archive3dmStartSectionComment ( ) const

Returns: A copy of the start section comment written to or read from the archive. If this function is called before Write3dmStartSection() or Read3dmStartSection(), it returns ON_String:EmptyString;

◆ Archive3dmTableStatus()

const ON_3dmArchiveTableStatus ON_BinaryArchive::Archive3dmTableStatus ( ON_3dmArchiveTableType  table_type)

◆ Archive3dmVersion()

int ON_BinaryArchive::Archive3dmVersion ( ) const

Description: If a 3dm archive is being read or written, then this is the version of the 3dm archive format (1, 2, 3, 4, 5, 50, 60, ...). Returns: @untitle table 0 a 3dm archive is not being read/written 1 a version 1 3dm archive is being read/written 2 a version 2 3dm archive is being read/written 3 a version 3 3dm archive is being read/written 4 a version 4 3dm archive is being read/written 5 an old version 5 3dm archive is being read 50 a version 5 3dm archive is being read/written 60 a version 6 3dm archive is being read/written 70 a version 7 3dm archive is being read/written ... See Also: ON_BinaryArchive::ArchiveOpenNURBSVersion

◆ ArchiveContains3dmTable() [1/2]

bool ON_BinaryArchive::ArchiveContains3dmTable ( ON_3dmArchiveTableType  table) const

Description: As time passes, more tables have been added to 3dm archives. Parameters: table - [in] Returns: True if this archive has the specified table

◆ ArchiveContains3dmTable() [2/2]

static bool ON_BinaryArchive::ArchiveContains3dmTable ( ON_3dmArchiveTableType  table,
unsigned int  archive_3dm_version,
unsigned int  opennurbs_library_version 
)
static

Parameters: archive_3dm_version - [in] 1,2,3,4,5,50,60,70,... opennurbs_library_version - [in] a number > 100000000

◆ ArchiveCurrentDimStyle()

const ON_DimStyle& ON_BinaryArchive::ArchiveCurrentDimStyle ( ) const

◆ ArchiveCurrentDimStyleId()

const ON_UUID ON_BinaryArchive::ArchiveCurrentDimStyleId ( ) const

◆ ArchiveCurrentDimStyleIndex()

const int ON_BinaryArchive::ArchiveCurrentDimStyleIndex ( ) const

◆ ArchiveDirectoryName()

const ON_wString& ON_BinaryArchive::ArchiveDirectoryName ( ) const

◆ ArchiveDirectoryNameAsPointer()

const wchar_t* ON_BinaryArchive::ArchiveDirectoryNameAsPointer ( ) const

◆ ArchiveFileMoved()

bool ON_BinaryArchive::ArchiveFileMoved ( ) const

Returns: true if the 3dm archive being read is not in the same file system location as where is was saved.

◆ ArchiveFileName()

const ON_wString& ON_BinaryArchive::ArchiveFileName ( ) const

◆ ArchiveFileNameAsPointer()

const wchar_t* ON_BinaryArchive::ArchiveFileNameAsPointer ( ) const

◆ ArchiveFullPath()

const ON_wString& ON_BinaryArchive::ArchiveFullPath ( ) const

◆ ArchiveFullPathAsPointer()

const wchar_t* ON_BinaryArchive::ArchiveFullPathAsPointer ( ) const

◆ ArchiveOpenNURBSVersion()

unsigned int ON_BinaryArchive::ArchiveOpenNURBSVersion ( ) const

Description: If a 3dm archive is being read, then this is the version of openNURBS that was used to write the archive. This value is only available after ON_BinaryArchive::Read3dmProperties is called. See Also: ON_BinaryArchive::Archive3dmVersion ON_BinaryArchive::Read3dmProperties Returns: Version of openNURBS used to write the archive. The openNURBS version is the value returned by ON::Version. See Also: ON::Version ON_BinaryArchive::Read3dmProperties ON_BinaryArchive::Archive3dmVersion Remarks: This value is rarely needed. You probably want to use ON_BinaryArchive::Archive3dmVersion.

◆ ArchiveOpenNURBSVersionToWrite()

static unsigned int ON_BinaryArchive::ArchiveOpenNURBSVersionToWrite ( unsigned int  archive_3dm_version,
unsigned int  opennurbs_version 
)
static

Description: If a 3dm archive is being written to a version 2,3,4 or 50 format, then new format opennurbs version numbers need to be saved in the old YYYYMMDDN format. This function returns the value that should be written in the file. Parameters: archive_3dm_version - [in] Version of the file that is being written (2, 3, 4, 50, 60, ...) opennurbs_version - [in] opennurbs version number Returns: Value to save in the file.

◆ ArchiveRuntimeEnvironment()

ON::RuntimeEnvironment ON_BinaryArchive::ArchiveRuntimeEnvironment ( ) const

Returns: The runtime environment where the archive was created. Remarks: When reading an archive, compare the values of ON_BinaryArchive::ArchiveRuntimeEnvironment() and ON::CurrentRuntimeEnvironment() to determine if adjustments need to be made to resources provided by runtime environments, like fonts.

◆ ArchiveSavedAsFullPath()

const ON_wString& ON_BinaryArchive::ArchiveSavedAsFullPath ( ) const

◆ ArchiveSavedAsFullPathPointer()

const wchar_t* ON_BinaryArchive::ArchiveSavedAsFullPathPointer ( ) const

◆ ArchiveStartOffset()

size_t ON_BinaryArchive::ArchiveStartOffset ( ) const

Description: When a 3dm archive is saved from an MFC application that supports Windows linking/embedding, the first 5kb to 1mb of the file contains information that is put there by MFC. ArchiveStartOffset() returns the offset into the file where the 3dm archive actually begins. The call to ON_BinaryArchive::Read3dmStartSection() calculates this offset and stores the value in m_3dm_start_section_offset. Returns: Offset into the binary "file" where the actual 3dm archive begins. Remarks: Generally, this value can be ignored. This function is a diagnostice tool that is used to analyzed damaged files.

◆ ArchiveTextStyleFromArchiveTextStyleIndex()

const ON_TextStyle* ON_BinaryArchive::ArchiveTextStyleFromArchiveTextStyleIndex ( int  archive_text_style_index) const

Description: When reading version 5 and earlier files that contain a text style table, this function can be used to get the archive text style from the archive text style index. This function is used when reading V5 and pre August 2016 V6 ON_DimStyle information.

◆ AtEnd()

virtual bool ON_BinaryArchive::AtEnd ( ) const
pure virtual

Returns: True if current position is at the end of the archive.

Implemented in ON_Write3dmBufferArchive, ON_Read3dmBufferArchive, ON_BinaryArchiveBuffer, and ON_BinaryFile.

◆ BadCRCCount()

unsigned int ON_BinaryArchive::BadCRCCount ( ) const

Returns: Number of chunks read with a bad CRC

◆ BeginRead3dmAnonymousChunk()

bool ON_BinaryArchive::BeginRead3dmAnonymousChunk ( int *  version)

Description: Calls BeginWRead3dmChunk(TCODE_ANONYMOUS_CHUNK,&major_version,&minor_version), checks that 1 == major_version, minor_version >= 0 and returns the value of minor_version as version. Parameters: version - [out]

◆ BeginRead3dmBigChunk()

bool ON_BinaryArchive::BeginRead3dmBigChunk ( unsigned int *  ,
ON__INT64  
)
Deprecated:
use BeginRead3dmBigChunk bool BeginRead3dmChunk( unsigned int*, ///< typecode from opennurbs_3dm.h int* ///< value );

When the end of the 3dm file is reached, BeginReadChunk() will return true with a typecode of TCODE_ENDOFFILE.

◆ BeginRead3dmBitmapTable()

bool ON_BinaryArchive::BeginRead3dmBitmapTable ( )

◆ BeginRead3dmChunk()

bool ON_BinaryArchive::BeginRead3dmChunk ( unsigned int  expected_tcode,
int *  major_version,
int *  minor_version 
)

Description: Begins reading a chunk that must be in the archive at this location. Parameters: expected_tcode - [in] chunk's typecode from opennurbs_3dm.h major_version - [out] minor_version - [out] Returns: True if beginning of the chunk was read. In this case You must call EndRead3dmChunk(), even if something goes wrong while you attempt to read the interior of the chunk. False if the chunk did not exist at the current location in the file.

◆ BeginRead3dmDimStyleTable()

bool ON_BinaryArchive::BeginRead3dmDimStyleTable ( )

◆ BeginRead3dmGroupTable()

bool ON_BinaryArchive::BeginRead3dmGroupTable ( )

◆ BeginRead3dmHatchPatternTable()

bool ON_BinaryArchive::BeginRead3dmHatchPatternTable ( )

◆ BeginRead3dmHistoryRecordTable()

bool ON_BinaryArchive::BeginRead3dmHistoryRecordTable ( )

◆ BeginRead3dmInstanceDefinitionTable()

bool ON_BinaryArchive::BeginRead3dmInstanceDefinitionTable ( )

◆ BeginRead3dmLayerTable()

bool ON_BinaryArchive::BeginRead3dmLayerTable ( )

◆ BeginRead3dmLightTable()

bool ON_BinaryArchive::BeginRead3dmLightTable ( )

◆ BeginRead3dmLinetypeTable()

bool ON_BinaryArchive::BeginRead3dmLinetypeTable ( )

◆ BeginRead3dmMaterialTable()

bool ON_BinaryArchive::BeginRead3dmMaterialTable ( )

◆ BeginRead3dmObjectTable()

bool ON_BinaryArchive::BeginRead3dmObjectTable ( )

◆ BeginRead3dmTextureMappingTable()

bool ON_BinaryArchive::BeginRead3dmTextureMappingTable ( )

◆ BeginRead3dmUserTable()

bool ON_BinaryArchive::BeginRead3dmUserTable ( ON_UUID plugin_id,
bool *  bLastSavedAsGoo,
int *  archive_3dm_version,
unsigned int *  archive_opennurbs_version 
)

Parameters: plugin_id - [out] id of plug-in that wrote the user table bLastSavedAsGoo - [out] True if this table was saved into this archive as goo because the plug-in was not present at the time of the save. archive_3dm_version - [out] Version of the archive the plug-in wrote to. When bLastSavedAsGoo is true, this number can be different from Archive3dmVersion(). archive_opennurbs_version - [out] Version of opennurbs the plug-in used to write the archive.
When bLastSavedAsGoo is true, this number can be different from ArchiveOpenNURBSVersion().
Returns: False when there are no more user tables or an IO error occurs.

◆ BeginReadDictionary()

bool ON_BinaryArchive::BeginReadDictionary ( ON_UUID dictionary_id,
unsigned int *  version,
ON_wString dictionary_name 
)

◆ BeginReadDictionaryEntry()

int ON_BinaryArchive::BeginReadDictionaryEntry ( int *  de_type,
ON_wString entry_name 
)

Description: Begin reading a dictionary entry. Parameters: de_type - [out] entry_name - [out] Returns: 0: serious IO error 1: success read information and then call EndReadDictionaryEntry() 2: at end of dictionary

◆ BeginWrite3dmAnonymousChunk()

bool ON_BinaryArchive::BeginWrite3dmAnonymousChunk ( int  version)

Description: If version >= 0, calls BeginWrite3dmChunk(TCODE_ANONYMOUS_CHUNK,1,version).

◆ BeginWrite3dmBigChunk()

bool ON_BinaryArchive::BeginWrite3dmBigChunk ( ON__UINT32  typecode,
ON__INT64  value 
)

◆ BeginWrite3dmBitmapTable()

bool ON_BinaryArchive::BeginWrite3dmBitmapTable ( )

Step 4: REQUIRED - Write/Read bitmap table (it can be empty)

◆ BeginWrite3dmChunk() [1/2]

bool ON_BinaryArchive::BeginWrite3dmChunk ( unsigned int  tcode,
int  major_version,
int  minor_version 
)

Description: Begins writing a chunk. Parameters: tcode - [in] chunk's typecode from opennurbs_3dm.h. This cannot be a short tcode. major_version - [in] ( >= 1) minor_version - [in] ( >= 0 ) Returns: True if input was valid and chunk was started. In this case You must call EndWrite3dmChunk(), even if something goes wrong while you attempt to write the contents of the chunk. False if input was not valid or the write failed.

◆ BeginWrite3dmChunk() [2/2]

bool ON_BinaryArchive::BeginWrite3dmChunk ( unsigned int  ,
int   
)

Low level tools to Write/Read chunks. See opennurbs_3dm.h for details about the structure of chunks. Every chunk must begin with a call to BeginWrite/ReadChunk(). If BeginWriteChunk()/BeginReadChunk() returns true, then you must call EndWrite/ReadChunk() or cease using the archive. Description: Writes a chunk header containing 4 byte typecode and value.

Parameters: typecode - [in] a TCODE_* number from opennurbs_3dm.h value - [in] if (typecode&TCODE_SHORT) is nonzero, then this is the value to be saved. Otherwise, pass a zero and the EndWrite3dmChunk() call will store the length of the chunk.

Returns: true if write was successful.

◆ BeginWrite3dmDimStyleTable()

bool ON_BinaryArchive::BeginWrite3dmDimStyleTable ( )

Step 11: REQUIRED - Write/Read dimstyle table (it can be empty)

◆ BeginWrite3dmGroupTable()

bool ON_BinaryArchive::BeginWrite3dmGroupTable ( )

Step 9: REQUIRED - Write/Read group table (it can be empty)

◆ BeginWrite3dmHatchPatternTable()

bool ON_BinaryArchive::BeginWrite3dmHatchPatternTable ( )

Step 13: REQUIRED - Write/Read hatch pattern table (it can be empty)

◆ BeginWrite3dmHistoryRecordTable()

bool ON_BinaryArchive::BeginWrite3dmHistoryRecordTable ( )

Step 16: REQUIRED - Write/Read history record table (it can be empty)

◆ BeginWrite3dmInstanceDefinitionTable()

bool ON_BinaryArchive::BeginWrite3dmInstanceDefinitionTable ( )

Step 14: REQUIRED - Write/Read instance definition table (it can be empty)

◆ BeginWrite3dmLayerTable()

bool ON_BinaryArchive::BeginWrite3dmLayerTable ( )

Step 8: REQUIRED - Write/Read layer table (it can be empty)

◆ BeginWrite3dmLightTable()

bool ON_BinaryArchive::BeginWrite3dmLightTable ( )

Step 12: REQUIRED - Write/Read render light table (it can be empty)

◆ BeginWrite3dmLinetypeTable()

bool ON_BinaryArchive::BeginWrite3dmLinetypeTable ( )

Step 7: REQUIRED - Write/Read linetype table (it can be empty)

◆ BeginWrite3dmMaterialTable()

bool ON_BinaryArchive::BeginWrite3dmMaterialTable ( )

Step 6: REQUIRED - Write/Read render material table (it can be empty)

◆ BeginWrite3dmObjectTable()

bool ON_BinaryArchive::BeginWrite3dmObjectTable ( )

Step 15: REQUIRED - Write/Read geometry and annotation table (it can be empty)

◆ BeginWrite3dmTextureMappingTable()

bool ON_BinaryArchive::BeginWrite3dmTextureMappingTable ( )

Step 5: REQUIRED - Write/Read texture mapping table (it can be empty)

◆ BeginWrite3dmUserTable() [1/2]

bool ON_BinaryArchive::BeginWrite3dmUserTable ( const ON_UUID )
Deprecated:
use BeginWrite3dmUserTable(plugin_id, bSavingGoo, 3dm_version, opennurbs_version)

◆ BeginWrite3dmUserTable() [2/2]

bool ON_BinaryArchive::BeginWrite3dmUserTable ( ON_UUID  plugin_id,
bool  bSavingGoo,
int  goo_3dm_version,
unsigned int  goo_opennurbs_version 
)

Step 17: OPTIONAL - Write/Read 0 or more user tables Description: Write the user table header information that must precede the user table information written by a plug-in. Parameters: plugin_id - [in] bSavingGoo - [in] Set to false if a plug-in will be used to write the user table. Set to true if a user table written by a missing plug-in is being resaved. In this case, goo_3dm_version and goo_opennurbs_version must also be set. In practice, you should use Write3dmAnonymousUserTableRecord() to handle writing "goo" and use this function only when the plug-in in present. goo_3dm_version - [in] If bSavingGoo is false, this parameter must be zero and ON_BinaryArchive::Archive3dmVersion() will be used. If bSavingGoo is true, this parameter must be the version of the 3dm archive (1,2,3,4,5,50,...) the plug-in code used to write the user table. goo_opennurbs_version - [in] If bSavingGoo is false, this parameter must be zero and ON_BinaryArchive::ArchiveOpenNURBSVersion() will be used. If bSavingGoo is true, this parameter must be the version of the opennurbs the plug-in code used to write the user table. Returns: True if the the user information can be written. False if user information should not be written.

◆ BeginWriteDictionary()

bool ON_BinaryArchive::BeginWriteDictionary ( ON_UUID  dictionary_id,
unsigned int  version,
const wchar_t *  dictionary_name 
)

Tools for dictionary IO (used in .NET) Description: Begins writing a dictionary. Parameters: dictionary_id - [in] version - [in] It is suggested that you use ON_VersionNumberConstruct() to create a version number. dictionary_name - [in] You may pass nullptr. Remarks: Begins a new chunk with tcode TCODE_DICTIONARY and then writes a TCODE_DICTIONARY_ID chunk containing the id, version and name. After calling this function, you may either write entries by calling BeginWriteDictionaryEntry(); write entry definition... EndWriteDictionaryEntry(); or you may finish writing the dictionary by calling EndWriteDictionary();

◆ BeginWriteDictionaryEntry()

bool ON_BinaryArchive::BeginWriteDictionaryEntry ( int  de_type,
const wchar_t *  entry_name 
)

Description: Begins writing a dictionary entry. Parameters: de_type - [in] entry_name - [in] Returns: true Entry header was written and you must call EndWriteDictionary() after writing the entry data. false Failed to write entry header. Do not call EndWriteDictionary(). Remarks: Begins a new chunk with tcode TCODE_DICTIONARY_ENTRY, then writes the int, and then writes the string.

◆ CheckForRemappedIds()

bool ON_BinaryArchive::CheckForRemappedIds ( ) const

Returns: True if the archive is reading in a situation where component ids may get remapped.

◆ ChunkBoundaryCheck()

bool ON_BinaryArchive::ChunkBoundaryCheck ( ) const

Returns: true: All read, write, and seek operations check to make sure they stay within the current chunk boundary.

◆ ClearModelSerialNumber()

void ON_BinaryArchive::ClearModelSerialNumber ( )

Description: Clear() information set by SetModelSerialNumber() do not modify ON_ModelComponent model serial number information when the classes are read.

◆ CriticalErrorCount()

unsigned int ON_BinaryArchive::CriticalErrorCount ( ) const

Returns: Number of critical errors

◆ CurrentArchiveVersion()

static int ON_BinaryArchive::CurrentArchiveVersion ( )
static

Remarks: In a stable commercially released Rhino version N, CurrentArchiveVersion() = 10*N. In "early" Rhino N WIP, CurrentArchiveVersion() = 10*(N-1). In "later" Rhino N WIP, CurrentArchiveVersion() = 10*N. Returns: The current 3dm archive version that is saved by Rhino.

◆ CurrentPosition()

ON__UINT64 ON_BinaryArchive::CurrentPosition ( ) const

Returns: Number of bytes from start of archive to the current position.

◆ Dump3dmChunk()

unsigned int ON_BinaryArchive::Dump3dmChunk ( ON_TextLog text_log,
int  recursion_depth = 0 
)

Description: Expert user function for studying contents of a file. The primary use is as an aid to help dig through files that have been damaged (bad disks, transmission errors, etc.) If an error is found, a line that begins with the word "ERROR" is printed. Parameters: text_log - [in] place to print information recursion_depth - [in] simply a counter to aid in debugging. Returns: 0 if something went wrong, otherwise the typecode of the chunk that was just studied.

◆ EnableCRCCalculation()

bool ON_BinaryArchive::EnableCRCCalculation ( bool  bEnable)

Description: Expert user function to control CRC calculation while reading and writing. Typically this is used when seeking around and reading/writing information in non-serial order. Parameters: bEnable - [in] Returns: Current state of CRC calculation. Use the returned value to restore the CRC calculation setting after you are finished doing your fancy pants expert IO.

◆ EnableSave3dmAnalysisMeshes()

void ON_BinaryArchive::EnableSave3dmAnalysisMeshes ( unsigned int  object_type_flags,
bool  bSave3dmAnalysisMeshes 
)

Description: Specify which types of objects (ON_Brep, ON_Extrusion, ON_SubD, ...) save analysis meshes in the 3dm file.

Parameters: object_type_flags - [in] The bits in object_type_flags correspond to ON::object_type values and identify the object types the setting will be applied to.

Remarks: Saving analysis meshes increases file size, sometimes dramatically.

Creating ON_Brep analysis meshes is often slow. Disable saving ON_Brep analysis meshes when IO speed or file size is a critical issue, the time expense of recreating the ON_Brep meshes when the file is read is acceptable, and the file will be read by Rhino. Enable when the file size is not an issue or the file will be used by other applications that may not be able to create meshes.

Creating ON_Extrusion meshes is fast. Disable when IO speed or file size is an issue and the file will be read by Rhino. Enable when the file will be used by other applications that may not be able to create meshes.

Creating ON_SubD meshes is fast. Disable when IO speed or file size is an issue and the file will be read by Rhino. Enable when the file will be used by other applications that may not be able to create meshes.

◆ EnableSave3dmRenderMeshes()

void ON_BinaryArchive::EnableSave3dmRenderMeshes ( unsigned int  object_type_flags,
bool  bSave3dmRenderMeshes 
)

3DM Interface - ignore if not reading/writing a 3DM file this is here so that the infrastructure for writing 3dm archives is available for any type of serialization device. Description: Specify which types of objects (ON_Brep, ON_Extrusion, ON_SubD, ...) save render meshes in the 3dm file.

Parameters: object_type_flags - [in] The bits in object_type_flags correspond to ON::object_type values and identify the object types the setting will be applied to.

Remarks: Saving render meshes increases file size, sometimes dramatically.

Creating ON_Brep analysis meshes is often slow. Disable saving ON_Brep analysis meshes when IO speed or file size is a critical issue, the time expense of recreating the ON_Brep meshes when the file is read is acceptable, and the file will be read by Rhino. Enable when the file size is not an issue or the file will be used by other applications that may not be able to create meshes.

Creating ON_Extrusion meshes is fast. Disable when IO speed or file size is an issue and the file will be read by Rhino. Enable when the file will be used by other applications that may not be able to create meshes.

Creating ON_SubD meshes is fast. Disable when IO speed or file size is an issue and the file will be read by Rhino. Enable when the file will be used by other applications that may not be able to create meshes.

◆ Endian()

ON::endian ON_BinaryArchive::Endian ( ) const

endian-ness of cpu

Returns: Endian-ness of the cpu reading this file. Remarks: 3dm files are always saved with little endian byte order.

◆ EndRead3dmBitmapTable()

bool ON_BinaryArchive::EndRead3dmBitmapTable ( )

◆ EndRead3dmChunk() [1/2]

bool ON_BinaryArchive::EndRead3dmChunk ( )

Description: Calling this will skip rest of stuff in chunk if it was only partially read. Parameters: bSupressPartiallyReadChunkWarning - [in] Generally, a call to ON_WARNING is made when a chunk is partially read. If bSupressPartiallyReadChunkWarning is true, then no warning is issued for partially read chunks.

◆ EndRead3dmChunk() [2/2]

bool ON_BinaryArchive::EndRead3dmChunk ( bool  bSupressPartiallyReadChunkWarning)

◆ EndRead3dmDimStyleTable()

bool ON_BinaryArchive::EndRead3dmDimStyleTable ( )

◆ EndRead3dmGroupTable()

bool ON_BinaryArchive::EndRead3dmGroupTable ( )

◆ EndRead3dmHatchPatternTable()

bool ON_BinaryArchive::EndRead3dmHatchPatternTable ( )

◆ EndRead3dmHistoryRecordTable()

bool ON_BinaryArchive::EndRead3dmHistoryRecordTable ( )

◆ EndRead3dmInstanceDefinitionTable()

bool ON_BinaryArchive::EndRead3dmInstanceDefinitionTable ( )

◆ EndRead3dmLayerTable()

bool ON_BinaryArchive::EndRead3dmLayerTable ( )

◆ EndRead3dmLightTable()

bool ON_BinaryArchive::EndRead3dmLightTable ( )

◆ EndRead3dmLinetypeTable()

bool ON_BinaryArchive::EndRead3dmLinetypeTable ( )

◆ EndRead3dmMaterialTable()

bool ON_BinaryArchive::EndRead3dmMaterialTable ( )

◆ EndRead3dmObjectTable()

bool ON_BinaryArchive::EndRead3dmObjectTable ( )

◆ EndRead3dmTextureMappingTable()

bool ON_BinaryArchive::EndRead3dmTextureMappingTable ( )

◆ EndRead3dmUserTable()

bool ON_BinaryArchive::EndRead3dmUserTable ( )

◆ EndReadDictionary()

bool ON_BinaryArchive::EndReadDictionary ( )

◆ EndReadDictionaryEntry()

bool ON_BinaryArchive::EndReadDictionaryEntry ( )

◆ EndWrite3dmBitmapTable()

bool ON_BinaryArchive::EndWrite3dmBitmapTable ( )

◆ EndWrite3dmChunk()

bool ON_BinaryArchive::EndWrite3dmChunk ( )

updates length in chunk header

◆ EndWrite3dmDimStyleTable()

bool ON_BinaryArchive::EndWrite3dmDimStyleTable ( )

◆ EndWrite3dmGroupTable()

bool ON_BinaryArchive::EndWrite3dmGroupTable ( )

◆ EndWrite3dmHatchPatternTable()

bool ON_BinaryArchive::EndWrite3dmHatchPatternTable ( )

◆ EndWrite3dmHistoryRecordTable()

bool ON_BinaryArchive::EndWrite3dmHistoryRecordTable ( )

◆ EndWrite3dmInstanceDefinitionTable()

bool ON_BinaryArchive::EndWrite3dmInstanceDefinitionTable ( )

◆ EndWrite3dmLayerTable()

bool ON_BinaryArchive::EndWrite3dmLayerTable ( )

◆ EndWrite3dmLightTable()

bool ON_BinaryArchive::EndWrite3dmLightTable ( )

◆ EndWrite3dmLinetypeTable()

bool ON_BinaryArchive::EndWrite3dmLinetypeTable ( )

◆ EndWrite3dmMaterialTable()

bool ON_BinaryArchive::EndWrite3dmMaterialTable ( )

◆ EndWrite3dmObjectTable()

bool ON_BinaryArchive::EndWrite3dmObjectTable ( )

◆ EndWrite3dmTextureMappingTable()

bool ON_BinaryArchive::EndWrite3dmTextureMappingTable ( )

◆ EndWrite3dmUserTable()

bool ON_BinaryArchive::EndWrite3dmUserTable ( )

◆ EndWriteDictionary()

bool ON_BinaryArchive::EndWriteDictionary ( )

Description: Begins writing a dictionary entry. Parameters: de_type - [in] entry_name - [in] Returns: true Entry header was written and you must call EndWriteDictionary() after writing the entry data. false Failed to write entry header. Do not call EndWriteDictionary(). Remarks: Begins a new chunk with tcode TCODE_DICTIONARY_ENTRY, then writes the int, and then writes the string.

◆ EndWriteDictionaryEntry()

bool ON_BinaryArchive::EndWriteDictionaryEntry ( )

◆ ErrorMessageMask()

unsigned int ON_BinaryArchive::ErrorMessageMask ( ) const
protected

◆ FindTableInDamagedArchive()

bool ON_BinaryArchive::FindTableInDamagedArchive ( unsigned int  tcode_table,
unsigned int  tcode_record,
ON_UUID  class_uuid,
int  min_length_data 
)

Description: Expert user function for reading damaged files. The search starts at the beginning of the file. Parameters: tcode_table - [in] typecode of the table tcode_record - [in] typecode of the record class_uuid - [in] id of the opennurbs class in the record min_length_data - [in] minimum size of the opennurbs class data Returns: True if the table start is found. In this case the current position of the archive is at the start of the table and the standared BeginRead3dm...Table() function can be used. False if the table start is not found.

◆ FirstFailed3dmTable()

ON_3dmArchiveTableType ON_BinaryArchive::FirstFailed3dmTable ( ) const

Returns: If a 3dm archive is being read or written and a failure occurs, the first archive section (table) that failed to read or write is returned.

◆ Flush()

virtual bool ON_BinaryArchive::Flush ( )
pure virtual

Description: Force Write() to flush any buffered data to physical archive. Returns: True if successful or if there is nothing to flush. False if information could not be flushed.

Implemented in ON_Write3dmBufferArchive, ON_Read3dmBufferArchive, ON_BinaryArchiveBuffer, and ON_BinaryFile.

◆ GetCurrentChunk() [1/2]

int ON_BinaryArchive::GetCurrentChunk ( ON_3DM_BIG_CHUNK big_chunk) const

◆ GetCurrentChunk() [2/2]

int ON_BinaryArchive::GetCurrentChunk ( ON_3DM_CHUNK chunk) const

Description: Expert user function for reading damaged files. Parameters: chunk - [out] current chunk. Returns: Level of the chunk or 0 if there is no current chunk.

◆ InstanceDefinitionModelSerialNumber()

unsigned int ON_BinaryArchive::InstanceDefinitionModelSerialNumber ( ) const

◆ IntentionallyWriteCorrupt3dmStartSectionForExpertTesting()

void ON_BinaryArchive::IntentionallyWriteCorrupt3dmStartSectionForExpertTesting ( )

Step 1: REQUIRED - Write/Read Start Section Description: In rare cases, experts testing handling of corrupt 3dm files need to write a 3dm archive that is corrupt. In this rare testing situation, those experts should call IntentionallyWriteCorrupt3dmStartSectionForExpertTesting() exactly one time before they begin writing the file. The 32 byte identifier will replace the 1st 3 spaces with a capital X to mimic a file that became corrupt while residing on storage media.

◆ Internal_CurrentPositionOverride()

virtual ON__UINT64 ON_BinaryArchive::Internal_CurrentPositionOverride ( ) const
protectedpure virtual

◆ Internal_Read3dmDimStyleOverrides()

bool ON_BinaryArchive::Internal_Read3dmDimStyleOverrides ( class ON_Annotation annotation,
bool  bFromDimStyleTable 
)

Internal_Read3dmDimStyleOverrides() is a public function on ON_BinaryArchive because it must be called from ON_Annotation::Internal_ReadAnnotation(). There is no other reason to call this function.

◆ Internal_ReadOverride()

virtual size_t ON_BinaryArchive::Internal_ReadOverride ( size_t  ,
void *   
)
protectedpure virtual

Remarks: In some unusual situations when reading old or damaged files, a read may fail. Call MaskReadError( ON__UINT64 sizeof_request, ON__UINT64 sizeof_read ) before calling ON_ERROR().

Implemented in ON_Write3dmBufferArchive, ON_Read3dmBufferArchive, ON_BinaryArchiveBuffer, and ON_BinaryFile.

◆ Internal_SeekFromCurrentPositionOverride()

virtual bool ON_BinaryArchive::Internal_SeekFromCurrentPositionOverride ( int  )
protectedpure virtual

◆ Internal_SeekToStartOverride()

virtual bool ON_BinaryArchive::Internal_SeekToStartOverride ( )
protectedpure virtual

◆ Internal_Write3dmDimStyleOverrides()

bool ON_BinaryArchive::Internal_Write3dmDimStyleOverrides ( const class ON_Annotation annotation,
const class ON_DimStyle dim_style_overrides 
)

Internal_Write3dmDimStyleOverrides() is a public function on ON_BinaryArchive because it must be called from ON_Annotation::Internal_WriteAnnotation(). There is no other reason to call this function.

◆ Internal_WriteOverride()

virtual size_t ON_BinaryArchive::Internal_WriteOverride ( size_t  ,
const void *   
)
protectedpure virtual

◆ LoadUserDataApplication()

virtual int ON_BinaryArchive::LoadUserDataApplication ( ON_UUID  application_id)
virtual

Description: When ON_BinaryArchive::ReadObject() encounters userdata and the user data class id is not present, LoadUserDataApplication is called to load the application that created user data. Returns: 0 - could not load the application 1 - successfully loaded the application 2 - the application was already loaded

◆ Manifest()

const class ON_ComponentManifest& ON_BinaryArchive::Manifest ( ) const

Reading and writing operations fill in the manifest. ON_ComponentManifest query tools can be used to look up model and archive index and id information.

The component and manifest id values are always identical during reading and writing.

When writing, the component indices are model indices and the manifest indices are the archive indices that were written in the file.

When reading, the component indices are "index" values read from the archive and the manifest indices are the order they were read. When files are valid, these indices are the same.

After reading is complete, the application can use ON_ComponentManifest::UpdateManifestItem() to convert the component index and id values to model index and id values.

◆ ManifestMap()

const class ON_ManifestMap& ON_BinaryArchive::ManifestMap ( ) const

◆ MaskReadError()

bool ON_BinaryArchive::MaskReadError ( ON__UINT64  sizeof_request,
ON__UINT64  sizeof_read 
) const
protected

Parameters: sizeof_request - [in] value of count parameter passed to virtual Read() function. sizeof_read - [in] number of bytes actually read by the virtual Read() function. Returns: True if a call to Read() is permitted to ask for more bytes than are left in the file. This value varies as the file is read and must be checked at each failure.

◆ Mode()

ON::archive_mode ON_BinaryArchive::Mode ( ) const

Returns: Archive read/write mode

◆ ModelSerialNumber()

unsigned int ON_BinaryArchive::ModelSerialNumber ( ) const

◆ ObjectHasUserDataToWrite()

bool ON_BinaryArchive::ObjectHasUserDataToWrite ( const class ON_Object object) const

Description: Determine if an object has user data that should be written. Parameters: object - [in] Returns: True if object has user data that should be written.

◆ ON_DEPRECATED_MSG() [1/2]

ON_BinaryArchive::ON_DEPRECATED_MSG ( "ON_BinaryArchive::ReadSize is deprecated because it truncates to 32-bits.\n" " - If you are updating existing code use 'ReadInt' instead.\n" " - Else if you need to write a 64-bit size_t please call 'ReadBigSize'"  )

< Read a single 32 bit size_t

◆ ON_DEPRECATED_MSG() [2/2]

ON_BinaryArchive::ON_DEPRECATED_MSG ( "ON_BinaryArchive::WriteSize is deprecated because it truncates to 32-bits.\n" " - If you are updating existing code use 'WriteInt' instead.\n" " - Else if you need to write a 64-bit size_t please call 'WriteBigSize'"  )

< Write a single 32 bit size_t

◆ ON_TypecodeParse()

static char* ON_BinaryArchive::ON_TypecodeParse ( unsigned int  tcode,
char *  typecode_name,
size_t  max_length 
)
static

◆ PeekAt3dmBigChunkType()

bool ON_BinaryArchive::PeekAt3dmBigChunkType ( ON__UINT32 typecode,
ON__INT64 big_value 
)
Parameters
typecodedoes not change file position

◆ PeekAt3dmChunkType()

bool ON_BinaryArchive::PeekAt3dmChunkType ( unsigned int *  ,
int *   
)
Deprecated:
use PeekAt3dmBigChunkType

◆ Previous3dmTable()

ON_3dmArchiveTableType ON_BinaryArchive::Previous3dmTable ( ) const

Returns: If a 3dm archive is being read or written, the value of the most recently read or written archive section (table) is returned. Remarks: Use ON_BinaryArchive::Mode() to determine if a binary archive is being read or written.

◆ Read3dmAnonymousUserTable()

bool ON_BinaryArchive::Read3dmAnonymousUserTable ( int  archive_3dm_version,
unsigned int  archive_opennurbs_version,
ON_3dmGoo goo 
)

Description: If the plug-in that wrote the user table is not present and you need to read and resave the user table, then use Read3dmAnonymousUserTable() to load the information into "goo". If you do not need to resave the information, then simply call EndRead3dmUserTable() to skip over this table.

◆ Read3dmBitmap()

int ON_BinaryArchive::Read3dmBitmap ( class ON_Bitmap **  )

◆ Read3dmChunkVersion()

bool ON_BinaryArchive::Read3dmChunkVersion ( int *  ,
int *   
)

◆ Read3dmDimStyle()

int ON_BinaryArchive::Read3dmDimStyle ( class ON_DimStyle **  ppDimStyle)

Description: Reads annotation dimension styles from dimension style table. If the dimension style definition is read, a dimension style is created by calling new ON_DimStyle(), initialized with values stored in the archive, and returned.

Parameters: ppDimStyle - If the dimstyle definition is read, a dimstyle is created by calling new ON_DimStyle(), initialized with values stored in the archive, and a pointer to the new dimstyle is returned in *ppDimStyle.

Returns:

@untitled table 0 at the end of the dimension style table 1 dimension style definition was successfully read -1 archive is corrupt at this point

Example: Calls to Read3dmDimStyle need to be bracketed by calls to BeginRead3dmDimStyleTable() / EndRead3dmDimStyleTable().

    archive.BeginRead3dmDimStyleTable();
    int rc = 1;
    ON_DimStyle* pDimStyle;
    while(rc==1)
    { ///<
      pDimStyle = 0;
      archive.Read3dmDimStyle(&pDimStyle);
      if ( pDimStyle )
        do something with pDimStyle
    } ///<
    archive.EndRead3dmDimStyleTable();

◆ Read3dmEndMark()

bool ON_BinaryArchive::Read3dmEndMark ( size_t *  )

Description: Checks for a TCODE_ENDOFFILE chunk at the current position. If it finds one, it reads it and returns the number of bytes in the archive. Comparing this number with the current file position can help detect files that have been damaged by losing sections.

Parameters: sizeof_archive - [out] number of bytes written to archive

Returns: true if successful, false if unable to find or read a TCODE_ENDOFFILE chunk.

◆ Read3dmGoo()

bool ON_BinaryArchive::Read3dmGoo ( ON_3dmGoo )

Call to read "goo".

◆ Read3dmGroup()

int ON_BinaryArchive::Read3dmGroup ( class ON_Group **  )

Description: Reads groups from group table. If the group definition is read, a group is created by calling new ON_Group(), initialized with values stored in the archive, and returned.

Parameters: ppGroup - If the group definition is read, a group is created by calling new ON_Group(), initialized with values stored in the archive, and a pointer to the new group is returned in *ppGroup.

Returns:

@untitled table 0 at the end of the group table 1 group definition was successfully read -1 archive is corrupt at this point

Example: Calls to Read3dmGroup need to be bracketed by calls to BeginRead3dmGroupTable() / EndRead3dmGroupTable().

    archive.BeginRead3dmGroupTable();
    ON_Group* pGroup;
    int rc = 1;
    while(rc==1)
    { ///<
      pGroup = 0;
      archive.Read3dmGroup(&pGroup);
      if ( pGroup )
        do something with pGroup
    } ///<
    archive.EndRead3dmGroupTable();

◆ Read3dmHatchPattern()

int ON_BinaryArchive::Read3dmHatchPattern ( class ON_HatchPattern **  )

◆ Read3dmHistoryRecord()

int ON_BinaryArchive::Read3dmHistoryRecord ( class ON_HistoryRecord *&  )

Returns: 0 at end of object table 1 if object is read -1 if file is corrupt

◆ Read3dmInstanceDefinition()

int ON_BinaryArchive::Read3dmInstanceDefinition ( class ON_InstanceDefinition **  )

Description: Reads instance definitions from instance definition table.

Parameters: ppInstanceDefinition - If an instance definition is read, an instance definition is created by calling new ON_InstanceDefinition(), initialized with values stored in the archive, and a pointer to the new instance definition is returned in *ppInstanceDefinition.

Returns:

@untitled table 0 at the end of the instance definition table 1 instance definition was successfully read -1 archive is corrupt at this point

Example: Calls to Read3dmInstanceDefinition need to be bracketed by calls to BeginRead3dmInstanceDefinitionTable() / EndRead3dmInstanceDefinitionTable().

    archive.BeginRead3dmInstanceDefinitionTable();
    int rc = 1;
    ON_InstanceDefinition* pInstanceDefinition;
    while(rc==1)
    { 
      pInstanceDefinition = 0;
      archive.Read3dmInstanceDefinition(&pInstanceDefinition);
      if ( pInstanceDefinition )
        do something with pInstanceDefinition
    } 
    archive.EndRead3dmInstanceDefinitionTable();

◆ Read3dmLayer()

int ON_BinaryArchive::Read3dmLayer ( ON_Layer **  )

◆ Read3dmLight()

int ON_BinaryArchive::Read3dmLight ( class ON_Light **  light,
class ON_3dmObjectAttributes attributes 
)

◆ Read3dmLinetype()

int ON_BinaryArchive::Read3dmLinetype ( class ON_Linetype **  )

◆ Read3dmMaterial()

int ON_BinaryArchive::Read3dmMaterial ( class ON_Material **  )

◆ Read3dmModelGeometry()

int ON_BinaryArchive::Read3dmModelGeometry ( class ON_ModelGeometryComponent **  model_geometry,
unsigned int  object_filter = 0 
)

Call either Read3dmModelGeometry or Read3dmObject.

Parameters: model_geometry - [out] ON_ModelGeometryComponent returned here. nullptr returned at end of the table. object_filter - [in] optional filter made by setting ON::object_type bits Returns: 0 at end of object table 1 if object is read 2 if object is skipped because it does not match filter -1 if file is corrupt

◆ Read3dmModelGeometryForExperts()

int ON_BinaryArchive::Read3dmModelGeometryForExperts ( bool  bManageGeometry,
bool  bManageAttributes,
class ON_ModelGeometryComponent **  model_geometry,
unsigned int  object_filter 
)

Parameters: bManageGeometry - [in] true: model_geometry will reference count and delete the ON_Geometry pointer. false: The caller must delete the ON_Geometry pointer. bManageAttributes - [in] true: model_geometry will reference count and delete the ON_3dmObjectAttributes pointer. false: The caller must delete the ON_3dmObjectAttributes pointer. model_geometry - [out] ON_ModelGeometryComponent returned here. nullptr returned at end of the table. object_filter - [in] optional filter made by setting ON::object_type bits 0 = no filter. Returns: 0 at end of object table 1 if object is read 2 if object is skipped because it does not match filter -1 if file is corrupt

◆ Read3dmModelLight()

int ON_BinaryArchive::Read3dmModelLight ( class ON_ModelGeometryComponent **  model_light)

Call either Read3dmModelLight or Read3dmLight.

Parameters: model_light - [out] ON_ModelGeometryComponent returned here. nullptr returned at end of the table. object_filter - [in] optional filter made by setting ON::object_type bits Returns: 0 at end of object table 1 if object is read 2 if object is skipped because it does not match filter -1 if file is corrupt

◆ Read3dmObject()

int ON_BinaryArchive::Read3dmObject ( ON_Object **  model_object,
ON_3dmObjectAttributes attributes,
unsigned int  object_filter = 0 
)

Parameters: model_object - [out] nullptr returned at end of the table. attributes - [out] If not nullptr, then attributes are returned here object_filter - [in] optional filter made by setting ON::object_type bits Returns: 0 at end of object table 1 if object is read 2 if object is skipped because it does not match filter -1 if file is corrupt

◆ Read3dmProperties()

bool ON_BinaryArchive::Read3dmProperties ( class ON_3dmProperties )

◆ Read3dmReferencedComponentId()

bool ON_BinaryArchive::Read3dmReferencedComponentId ( ON_ModelComponent::Type  component_type,
ON_UUID component_id 
)

Description: When reading 3dm archives, the model component ID in the archive and in the destination model are often identical, but sometimes different. For example, the when the same template is used to create multiple models and files and the models from those files are merged into a single file, there will be ID collisions. For components that are identified by name, like layers and dimension styles, this is not a problem. For components like instance definitions that have a more complicated set of merging rules, it is critical that references to instance definition ids be updated from values in the archive to values in the model. uses to adjust and write a model component Id. Parameters: component_type - [in] Type of the referenced component. component_id - [out] component reference ID Returns: false - catestrophic read failure.

◆ Read3dmReferencedComponentIndex()

bool ON_BinaryArchive::Read3dmReferencedComponentIndex ( ON_ModelComponent::Type  component_type,
int *  component_index 
)

Description: When reading 3dm archives, model component indexes in the archive and in the destination model are typically different. This function basically reads and reverses the steps that WriteArchiveComponentIndex() uses to adjust and write a model component index. Parameters: component_type - [in] Type of the referenced component. component_index - [out] component reference index Returns: false - catestrophic read failure.

◆ Read3dmReferencedComponentIndexArray()

bool ON_BinaryArchive::Read3dmReferencedComponentIndexArray ( ON_ModelComponent::Type  component_type,
ON_SimpleArray< int > &  component_index_array 
)

◆ Read3dmSettings()

bool ON_BinaryArchive::Read3dmSettings ( class ON_3dmSettings )

◆ Read3dmStartSection()

bool ON_BinaryArchive::Read3dmStartSection ( int *  version,
ON_String sStartSectionComment 
)

Parameters: version - [out] .3dm file version (2, 3, 4, 5, 50, 60) sStartSectionComment - [out] UTF-8 encoded string passed to Write3dmStartSection() destination_manifest - [in] manifest of the destination model

◆ Read3dmTextureMapping()

int ON_BinaryArchive::Read3dmTextureMapping ( class ON_TextureMapping **  )

◆ ReadArc()

bool ON_BinaryArchive::ReadArc ( ON_Arc )

◆ ReadArray() [1/38]

bool ON_BinaryArchive::ReadArray ( ON_ClassArray< class ON_ObjRef > &  )

◆ ReadArray() [2/38]

bool ON_BinaryArchive::ReadArray ( ON_ClassArray< ON_MappingRef > &  )

◆ ReadArray() [3/38]

bool ON_BinaryArchive::ReadArray ( ON_ClassArray< ON_MaterialRef > &  )

◆ ReadArray() [4/38]

bool ON_BinaryArchive::ReadArray ( ON_ClassArray< ON_String > &  )

◆ ReadArray() [5/38]

bool ON_BinaryArchive::ReadArray ( ON_ClassArray< ON_wString > &  )

◆ ReadArray() [6/38]

bool ON_BinaryArchive::ReadArray ( ON_ObjectArray< class ON_Layer > &  )

◆ ReadArray() [7/38]

bool ON_BinaryArchive::ReadArray ( ON_SimpleArray< bool > &  )

◆ ReadArray() [8/38]

bool ON_BinaryArchive::ReadArray ( ON_SimpleArray< char > &  )

◆ ReadArray() [9/38]

bool ON_BinaryArchive::ReadArray ( ON_SimpleArray< class ON_ClippingPlaneInfo > &  )

◆ ReadArray() [10/38]

bool ON_BinaryArchive::ReadArray ( ON_SimpleArray< class ON_Layer * > &  )

◆ ReadArray() [11/38]

bool ON_BinaryArchive::ReadArray ( ON_SimpleArray< class ON_ObjRef_IRefID > &  )

◆ ReadArray() [12/38]

bool ON_BinaryArchive::ReadArray ( ON_SimpleArray< double > &  )

◆ ReadArray() [13/38]

bool ON_BinaryArchive::ReadArray ( ON_SimpleArray< float > &  )

◆ ReadArray() [14/38]

bool ON_BinaryArchive::ReadArray ( ON_SimpleArray< ON_2dPoint > &  )

◆ ReadArray() [15/38]

bool ON_BinaryArchive::ReadArray ( ON_SimpleArray< ON_2dVector > &  )

◆ ReadArray() [16/38]

bool ON_BinaryArchive::ReadArray ( ON_SimpleArray< ON_2fPoint > &  )

◆ ReadArray() [17/38]

bool ON_BinaryArchive::ReadArray ( ON_SimpleArray< ON_2fVector > &  )

◆ ReadArray() [18/38]

bool ON_BinaryArchive::ReadArray ( ON_SimpleArray< ON_3dPoint > &  )

◆ ReadArray() [19/38]

bool ON_BinaryArchive::ReadArray ( ON_SimpleArray< ON_3dVector > &  )

◆ ReadArray() [20/38]

bool ON_BinaryArchive::ReadArray ( ON_SimpleArray< ON_3fPoint > &  )

◆ ReadArray() [21/38]

bool ON_BinaryArchive::ReadArray ( ON_SimpleArray< ON_3fVector > &  )

◆ ReadArray() [22/38]

bool ON_BinaryArchive::ReadArray ( ON_SimpleArray< ON_4dPoint > &  )

◆ ReadArray() [23/38]

bool ON_BinaryArchive::ReadArray ( ON_SimpleArray< ON_4fPoint > &  )

◆ ReadArray() [24/38]

bool ON_BinaryArchive::ReadArray ( ON_SimpleArray< ON__INT16 > &  )

◆ ReadArray() [25/38]

bool ON_BinaryArchive::ReadArray ( ON_SimpleArray< ON__INT32 > &  )

◆ ReadArray() [26/38]

bool ON_BinaryArchive::ReadArray ( ON_SimpleArray< ON__INT8 > &  )

◆ ReadArray() [27/38]

bool ON_BinaryArchive::ReadArray ( ON_SimpleArray< ON__UINT16 > &  )

◆ ReadArray() [28/38]

bool ON_BinaryArchive::ReadArray ( ON_SimpleArray< ON__UINT32 > &  )

◆ ReadArray() [29/38]

bool ON_BinaryArchive::ReadArray ( ON_SimpleArray< ON__UINT8 > &  )

◆ ReadArray() [30/38]

bool ON_BinaryArchive::ReadArray ( ON_SimpleArray< ON_Color > &  )

◆ ReadArray() [31/38]

bool ON_BinaryArchive::ReadArray ( ON_SimpleArray< ON_DisplayMaterialRef > &  )

◆ ReadArray() [32/38]

bool ON_BinaryArchive::ReadArray ( ON_SimpleArray< ON_LinetypeSegment > &  )

◆ ReadArray() [33/38]

bool ON_BinaryArchive::ReadArray ( ON_SimpleArray< ON_MappingChannel > &  )

◆ ReadArray() [34/38]

bool ON_BinaryArchive::ReadArray ( ON_SimpleArray< ON_SurfaceCurvature > &  )

◆ ReadArray() [35/38]

bool ON_BinaryArchive::ReadArray ( ON_SimpleArray< ON_UUID > &  )

◆ ReadArray() [36/38]

bool ON_BinaryArchive::ReadArray ( ON_SimpleArray< ON_UuidIndex > &  )

◆ ReadArray() [37/38]

bool ON_BinaryArchive::ReadArray ( ON_SimpleArray< ON_UuidPtr > &  )

◆ ReadArray() [38/38]

bool ON_BinaryArchive::ReadArray ( ON_SimpleArray< ON_Xform > &  )

◆ ReadBigInt() [1/4]

bool ON_BinaryArchive::ReadBigInt ( ON__INT64 )

◆ ReadBigInt() [2/4]

bool ON_BinaryArchive::ReadBigInt ( ON__UINT64 )

◆ ReadBigInt() [3/4]

bool ON_BinaryArchive::ReadBigInt ( size_t  ,
ON__INT64  
)

◆ ReadBigInt() [4/4]

bool ON_BinaryArchive::ReadBigInt ( size_t  ,
ON__UINT64  
)

◆ ReadBigSize()

bool ON_BinaryArchive::ReadBigSize ( size_t *  )

64 bits

◆ ReadBigTime()

bool ON_BinaryArchive::ReadBigTime ( time_t *  )

UCT seconds since 1 January 1970 (64 bits)

◆ ReadBool()

bool ON_BinaryArchive::ReadBool ( bool *  )

◆ ReadBoundingBox()

bool ON_BinaryArchive::ReadBoundingBox ( ON_BoundingBox )

◆ ReadBuffer()

ON__UINT64 ON_BinaryArchive::ReadBuffer ( ON__UINT64  sizeof_buffer,
void *  buffer 
)

Description: Expert user function that uses Read() to load a buffer. Parameters: sizeof_buffer - [in] number of bytes to attempt to read. buffer - [out] read bytes are stored in this buffer Returns: Number of bytes actually read, which may be less than sizeof_buffer if the end of file is encountered.

◆ ReadByte()

bool ON_BinaryArchive::ReadByte ( size_t  ,
void *   
)

must fail if mode is not read or readwrite

◆ ReadChar() [1/6]

bool ON_BinaryArchive::ReadChar ( char *  )

◆ ReadChar() [2/6]

bool ON_BinaryArchive::ReadChar ( ON__INT8 )

◆ ReadChar() [3/6]

bool ON_BinaryArchive::ReadChar ( ON__UINT8 )

◆ ReadChar() [4/6]

bool ON_BinaryArchive::ReadChar ( size_t  ,
char *   
)

◆ ReadChar() [5/6]

bool ON_BinaryArchive::ReadChar ( size_t  ,
ON__INT8  
)

◆ ReadChar() [6/6]

bool ON_BinaryArchive::ReadChar ( size_t  ,
ON__UINT8  
)

◆ ReadCircle()

bool ON_BinaryArchive::ReadCircle ( ON_Circle )

◆ ReadColor() [1/2]

bool ON_BinaryArchive::ReadColor ( ON_4fColor )

◆ ReadColor() [2/2]

bool ON_BinaryArchive::ReadColor ( ON_Color )

◆ ReadComponentIndex()

bool ON_BinaryArchive::ReadComponentIndex ( ON_COMPONENT_INDEX )

◆ ReadCompressedBuffer()

bool ON_BinaryArchive::ReadCompressedBuffer ( size_t  sizeof__outbuffer,
void *  outbuffer,
bool *  bFailedCRC 
)

Description: Read compressed information from an archive and uncompress it. Parameters: sizeof__outbuffer - [in] size of the uncompressed buffer in bytes outbuffer - [out] uncompressed buffer returned here bFailedCRC - [out] true if cyclic redundancy check fails on uncompressed buffer

Example:

    size_t sizeof_buffer = 0;
    ReadCompressedBufferSize(&sizeof_buffer);
    buffer = ...; ///< something with sizeof_buffer bytes.
    int bFailedCRC = false;
    bool ok = ReadCompressedBuffer( sizeof_buffer, buffer, &bFailedCRC );

Returns: True if read was successful. You need to check the value of bFailedCRC to see if the information that was read is valid. Remarks: Write your archive write/read code as if compression is always enabled. Do not vary what get written or read based on the value of UseBufferCompression().

◆ ReadCompressedBufferSize()

bool ON_BinaryArchive::ReadCompressedBufferSize ( size_t *  sizeof__outbuffer)

ReadCompressedBuffer()/WriteCompressedBuffer() use zlib 1.1.3 to inflate/deflate the data buffer. Care must be used to get an endian independent file.
See ON_Mesh::Read()/ON_Mesh::Write() for an example of an endian independent use of compression. See also ToggleByteOrder() and Endian().

To read data archived by WriteCompressedBuffer( sizeof_buffer, buffer ) do something like:

size_t sizeof_buffer = 0; ReadCompressedBufferSize(&sizeof_buffer); buffer = something with sizeof_buffer bytes. int bFailedCRC = false; bool ok = ReadCompressedBuffer( sizeof_buffer, buffer, &bFailedCRC ); Description: Red the size of a compressed buffer. Parameters: sizeof__outbuffer - [out] size of the uncompressed buffer in bytes Returns: True if read was successful.

◆ ReadDisplayMaterialRef()

bool ON_BinaryArchive::ReadDisplayMaterialRef ( ON_DisplayMaterialRef )

◆ ReadDouble() [1/2]

bool ON_BinaryArchive::ReadDouble ( double *  )

◆ ReadDouble() [2/2]

bool ON_BinaryArchive::ReadDouble ( size_t  ,
double *   
)

◆ ReadFloat() [1/2]

bool ON_BinaryArchive::ReadFloat ( float *  )

◆ ReadFloat() [2/2]

bool ON_BinaryArchive::ReadFloat ( size_t  ,
float *   
)

◆ ReadInt() [1/4]

bool ON_BinaryArchive::ReadInt ( ON__INT32 )

◆ ReadInt() [2/4]

bool ON_BinaryArchive::ReadInt ( ON__UINT32 )

◆ ReadInt() [3/4]

bool ON_BinaryArchive::ReadInt ( size_t  ,
ON__INT32  
)

◆ ReadInt() [4/4]

bool ON_BinaryArchive::ReadInt ( size_t  ,
ON__UINT32  
)

◆ ReadInterval()

bool ON_BinaryArchive::ReadInterval ( ON_Interval )

◆ ReadLine()

bool ON_BinaryArchive::ReadLine ( ON_Line )

◆ ReadLinetypeSegment()

bool ON_BinaryArchive::ReadLinetypeSegment ( ON_LinetypeSegment )

◆ ReadLong() [1/4]

bool ON_BinaryArchive::ReadLong ( long *  )

◆ ReadLong() [2/4]

bool ON_BinaryArchive::ReadLong ( size_t  ,
long *   
)

◆ ReadLong() [3/4]

bool ON_BinaryArchive::ReadLong ( size_t  ,
unsigned long *   
)

◆ ReadLong() [4/4]

bool ON_BinaryArchive::ReadLong ( unsigned long *  )

◆ ReadMode()

bool ON_BinaryArchive::ReadMode ( ) const

Returns: True if Mode() is an archive reading mode.

◆ ReadModelComponentAttributes()

bool ON_BinaryArchive::ReadModelComponentAttributes ( ON_ModelComponent model_component,
unsigned int *  attributes_filter 
)

Description: Reads the attributes the Write() function writes. Parameters: model_component - [in/out] component_filter - [out] A bitfield that reports which attributes were read. If the corresponding component on model_component is locked, the read value is discarded. Returns: false: critical failure. true: reading can continue.
Remarks: If locked attributes are read, thire values are ignored.

◆ ReadObject() [1/2]

int ON_BinaryArchive::ReadObject ( ON_Object object)

Description: Reads and object from a 3dm archive. Parameters: object - [in] The value of object.ON_ClassId()->Uuid() must exactly match the class uuid in of the next object in the archive. Returns: 0: failure - unable to read object because of file IO problems. 1: success 2: unable to read object because the class id in the archive did not match pObject->ClassId.

◆ ReadObject() [2/2]

int ON_BinaryArchive::ReadObject ( ON_Object **  ppObject)

Read/Write classes derived from ON_Object Description: Reads and object from a 3dm archive; Parameters: ppObject - [out] object is allocated and a pointer to the allocated object is returned as *ppObject; Returns: 0: failure - unable to read object because of file IO problems 1: success 3: unable to read object because it's UUID is not registered this could happen in cases where old code is attempting to read new objects.

◆ ReadObjectUserData()

bool ON_BinaryArchive::ReadObjectUserData ( ON_Object object)

Description: Low level tool to read user data and attach it to the object. This function should never be called directly. Parameters: object - [in/out] Returns: True if successful.

◆ ReadPlane()

bool ON_BinaryArchive::ReadPlane ( ON_Plane )

◆ ReadPlaneEquation()

bool ON_BinaryArchive::ReadPlaneEquation ( ON_PlaneEquation )

◆ ReadPoint() [1/3]

bool ON_BinaryArchive::ReadPoint ( ON_2dPoint )

◆ ReadPoint() [2/3]

bool ON_BinaryArchive::ReadPoint ( ON_3dPoint )

◆ ReadPoint() [3/3]

bool ON_BinaryArchive::ReadPoint ( ON_4dPoint )

◆ ReadShort() [1/4]

bool ON_BinaryArchive::ReadShort ( ON__INT16 )

◆ ReadShort() [2/4]

bool ON_BinaryArchive::ReadShort ( ON__UINT16 )

◆ ReadShort() [3/4]

bool ON_BinaryArchive::ReadShort ( size_t  ,
ON__INT16  
)

◆ ReadShort() [4/4]

bool ON_BinaryArchive::ReadShort ( size_t  ,
ON__UINT16  
)

◆ ReadString() [1/5]

bool ON_BinaryArchive::ReadString ( ON_String sUTF8)

◆ ReadString() [2/5]

bool ON_BinaryArchive::ReadString ( ON_wString s)

◆ ReadString() [3/5]

bool ON_BinaryArchive::ReadString ( size_t  str_array_count,
char *  str_array 
)

Parameters: str_array_count - [in] Number of char elements in str_array[], including the null terminator. The value of str_array_count is returned by ReadCharStringElementCount(). str_array - [in/out] Pass in an array with at least str_array_count elements. If true is returned and str_array_count > 0, then str_array[str_array_count-1] = 0. All strings with char elements written by Rhino are UTF-8 encoded unicode strings.

◆ ReadString() [4/5]

bool ON_BinaryArchive::ReadString ( size_t  str_array_count,
unsigned char *  str_array 
)

Parameters: str_array_count - [in] Number of unsigned char elements in str_array[], including the null terminator. The value of str_array_count is returned by ReadCharStringElementCount(). str_array - [in/out] Pass in an array with at least str_array_count elements. If true is returned and str_array_count > 0, then str_array[str_array_count-1] = 0. All strings with unsigned char elements written by Rhino are UTF-8 encoded unicode strings.

◆ ReadString() [5/5]

bool ON_BinaryArchive::ReadString ( size_t  str_array_count,
unsigned short *  str_array 
)

Parameters: str_array_count - [in] Number of unsigned short elements in str_array[], including the null terminator. The value of str_array_count is returned by ReadWideCharStringElementCount(). str_array - [in/out] Pass in an array with at least str_array_count elements. If true is returned and str_array_count > 0, then str_array[str_array_count-1] = 0. All strings with unsigned short elements written by Rhino are UTF-16 encoded unicode strings.

◆ ReadStringSize()

bool ON_BinaryArchive::ReadStringSize ( size_t *  str_array_count)

Parameters: str_array_count - [out] Number of elements in the string array. All ON_BinaryArchive string WriteString() functions write a null terminator to the file and the null terminator is included in the count. This means that if a string has a non-zero element, then str_array_count >= 2. Remarks: Modify your code to use ReadStringUTF8ElementCount() when reading UTF-8 encoded strings and ReadStringUTF16ElementCount() when reading UTF-16 encoded strings.

Deprecated:
Use either ReadStringUTF8ElementCount() or ReadStringUTF16ElementCount()

◆ ReadStringUTF16ElementCount()

bool ON_BinaryArchive::ReadStringUTF16ElementCount ( size_t *  string_utf16_element_count)

Parameters: string_utf16_element_count - [out] Number of elements in the string array. All ON_BinaryArchive string WriteString() functions write a null terminator to the file and the null terminator is included in string_element_count. This means that if opennurbs wrote the string, either string_element_count = 0 or string_element_count >= 2.

◆ ReadStringUTF8ElementCount()

bool ON_BinaryArchive::ReadStringUTF8ElementCount ( size_t *  string_utf8_element_count)

Parameters: string_utf8_element_count - [out] Number of bytes in the string array. All ON_BinaryArchive string WriteString() functions write a null terminator to the file and the null terminator is included in string_element_count. This means that if opennurbs wrote the string, either string_element_count = 0 or string_element_count >= 2.

◆ ReadTime()

bool ON_BinaryArchive::ReadTime ( struct tm &  )

All times are stored in coordinated universal time ( a.k.a GMT, UTC ). Use ANSI C time() and gmtime() calls.

◆ ReadUuid()

bool ON_BinaryArchive::ReadUuid ( ON_UUID )

◆ ReadV1_TCODE_ANNOTATION()

bool ON_BinaryArchive::ReadV1_TCODE_ANNOTATION ( unsigned int  ,
ON_Object **  ,
ON_3dmObjectAttributes  
)

◆ ReadV1_TCODE_LEGACY_CRV()

bool ON_BinaryArchive::ReadV1_TCODE_LEGACY_CRV ( ON_Object **  ,
ON_3dmObjectAttributes  
)

◆ ReadV1_TCODE_LEGACY_FAC()

bool ON_BinaryArchive::ReadV1_TCODE_LEGACY_FAC ( ON_Object **  ,
ON_3dmObjectAttributes  
)

◆ ReadV1_TCODE_LEGACY_SHL()

bool ON_BinaryArchive::ReadV1_TCODE_LEGACY_SHL ( ON_Object **  ,
ON_3dmObjectAttributes  
)

◆ ReadV1_TCODE_MESH_OBJECT()

bool ON_BinaryArchive::ReadV1_TCODE_MESH_OBJECT ( ON_Object **  ,
ON_3dmObjectAttributes  
)

◆ ReadV1_TCODE_RH_POINT()

bool ON_BinaryArchive::ReadV1_TCODE_RH_POINT ( ON_Object **  ,
ON_3dmObjectAttributes  
)

helpers for reading V1 objects

◆ ReadV1_TCODE_RHINOIO_OBJECT_BREP()

bool ON_BinaryArchive::ReadV1_TCODE_RHINOIO_OBJECT_BREP ( ON_Object **  ,
ON_3dmObjectAttributes  
)

◆ ReadV1_TCODE_RHINOIO_OBJECT_NURBS_CURVE()

bool ON_BinaryArchive::ReadV1_TCODE_RHINOIO_OBJECT_NURBS_CURVE ( ON_Object **  ,
ON_3dmObjectAttributes  
)

◆ ReadV1_TCODE_RHINOIO_OBJECT_NURBS_SURFACE()

bool ON_BinaryArchive::ReadV1_TCODE_RHINOIO_OBJECT_NURBS_SURFACE ( ON_Object **  ,
ON_3dmObjectAttributes  
)

◆ ReadVector() [1/2]

bool ON_BinaryArchive::ReadVector ( ON_2dVector )

◆ ReadVector() [2/2]

bool ON_BinaryArchive::ReadVector ( ON_3dVector )

◆ ReadWideString()

bool ON_BinaryArchive::ReadWideString ( ON_wString wide_string)

Description: Read a wide string written with the WriteWideString() function.

◆ ReadXform()

bool ON_BinaryArchive::ReadXform ( ON_Xform )

◆ ReferencedComponentIdMapping()

bool ON_BinaryArchive::ReferencedComponentIdMapping ( ) const

Returns: True: (default state) Read3dmReferencedComponentId() and Write3dmReferencedComponentId() will automatically adjust components Id references so they are valid. False: (uncommon) Read3dmReferencedComponentId() and Write3dmReferencedComponentId() will not adjust components Id references so they are valid.

◆ ReferencedComponentIndexMapping()

bool ON_BinaryArchive::ReferencedComponentIndexMapping ( ) const

Returns: True: (default state) Read3dmReferencedComponentIndex() and Write3dmReferencedComponentIndex() will automatically adjust components index references so they are valid. False: (uncommon) Read3dmReferencedComponentIndex() and Write3dmReferencedComponentIndex() will not adjust components index references so they are valid.

◆ ReferenceModelSerialNumber()

unsigned int ON_BinaryArchive::ReferenceModelSerialNumber ( ) const

◆ Save3dmAnalysisMesh()

bool ON_BinaryArchive::Save3dmAnalysisMesh ( ON::object_type  object_type) const

Parameters: object_type - [in] Returns: true if analysis meshes for the specified object type will be saved in the .3dm file.

◆ Save3dmAnalysisMeshObjectTypeFlags()

unsigned int ON_BinaryArchive::Save3dmAnalysisMeshObjectTypeFlags ( ) const

Description: Specify which types of objects (ON_Brep, ON_Extrusion, ON_SubD, ...) save analysis meshes in the 3dm file. Returns: The bits in the return value correspond to ON::object_type values and identify the object types save analysis meshes in the 3dm file.

◆ Save3dmPreviewImage()

bool ON_BinaryArchive::Save3dmPreviewImage ( ) const

Returns: true: (default) If a preview image is included in the ON_3dmProperties information, it will be saved. false: A preview imae, if it exists, will not be saved in the 3dm archive. This reduces archive size. When Save3dmPreviewImage() is false, generating a preview image can be skipped.

◆ Save3dmRenderMesh()

bool ON_BinaryArchive::Save3dmRenderMesh ( ON::object_type  object_type) const

Parameters: object_type - [in] Returns: true if render meshes for the specified object type will be saved in the .3dm file.

◆ Save3dmRenderMeshObjectTypeFlags()

unsigned int ON_BinaryArchive::Save3dmRenderMeshObjectTypeFlags ( ) const

Description: Specify which types of objects (ON_Brep, ON_Extrusion, ON_SubD, ...) save render meshes in the 3dm file. Returns: The bits in the return value correspond to ON::object_type values and identify the object types save analysis meshes in the 3dm file.

◆ Seek3dmChunkFromCurrentPosition()

bool ON_BinaryArchive::Seek3dmChunkFromCurrentPosition ( unsigned int  )

◆ Seek3dmChunkFromStart()

bool ON_BinaryArchive::Seek3dmChunkFromStart ( unsigned int  )

◆ SeekBackward()

bool ON_BinaryArchive::SeekBackward ( ON__UINT64  bytes_backward)

Description: Decrease the archive's current position by bytes_backward from the current position. Parameters: bytes_backward - [in] Returns: True: successful False: failure

◆ SeekForward()

bool ON_BinaryArchive::SeekForward ( ON__UINT64  bytes_forward)

Description: Increase the archive's current position by bytes_forward from the current position. Parameters: bytes_forward - [in] Returns: True: successful False: failure

◆ SeekFromStart()

bool ON_BinaryArchive::SeekFromStart ( ON__UINT64  bytes_from_start)

Description: Set current position to bytes_from_start many bytes from the start of the archive. Parameters: bytes_from_start - [in] Returns: True: successful False: failure Remarks: Similar to fseek( ,SEEK_SET)

◆ SetArchive3dmVersion()

bool ON_BinaryArchive::SetArchive3dmVersion ( int  )

◆ SetArchiveFullPath() [1/2]

void ON_BinaryArchive::SetArchiveFullPath ( const wchar_t *  archive_directory_name,
const wchar_t *  archive_file_name 
)

Parameters: archive_directory_name - [in] full path file being written archive_file_name - [in] name of file being written

◆ SetArchiveFullPath() [2/2]

void ON_BinaryArchive::SetArchiveFullPath ( const wchar_t *  archive_full_path)

Parameters: archive_full_path - [in] full path to file being read or written

◆ SetCheckForRemappedIds()

void ON_BinaryArchive::SetCheckForRemappedIds ( bool  bCheckForRemappedIds)

Parameters: bCheckForRemappedIds - [in] true if the archive is reading in a situation where component ids may get remapped.

◆ SetChunkBoundaryCheck()

void ON_BinaryArchive::SetChunkBoundaryCheck ( bool  bChunkBoundaryCheck)

Parameters: bChunkBoundaryCheck - [in] true: All read, write, and seek operations check to make sure they stay within the current chunk boundary.

◆ SetModelSerialNumber()

void ON_BinaryArchive::SetModelSerialNumber ( unsigned int  model_serial_number,
unsigned int  reference_model_serial_number,
unsigned int  instance_definition_model_serial_number 
)

Description: Specify model serial number attributes to assign to ON_ModelComponent classes when they are read.

◆ SetOpenNURBS3dmVersion()

bool ON_BinaryArchive::SetOpenNURBS3dmVersion ( unsigned int  v)

◆ SetReferencedComponentIdMapping()

void ON_BinaryArchive::SetReferencedComponentIdMapping ( bool  bEnableReferenceComponentIdMapping)

Description: Set the archive's ReferencedComponentIdMapping() state. Parameters: bEnableReferenceComponentIdMapping - [in] True: (default state) Read3dmReferencedComponentId() and Write3dmReferencedComponentId() will automatically adjust components Id references so they are valid. False: (uncommon) Read3dmReferencedComponentId() and Write3dmReferencedComponentId() will not adjust components Id references so they are valid. This is only used with the component being read or written is not the model but is a copy of one in a different model (linked instance definitions being the common situation).

◆ SetReferencedComponentIndexMapping()

void ON_BinaryArchive::SetReferencedComponentIndexMapping ( bool  bEnableReferenceComponentIndexMapping)

Description: Set the archive's ReferencedComponentIndexMapping() state. Parameters: bEnableReferenceComponentIndexMapping - [in] True: (default state) Read3dmReferencedComponentIndex() and Write3dmReferencedComponentIndex() will automatically adjust components index references so they are valid. False: (uncommon) Read3dmReferencedComponentIndex() and Write3dmReferencedComponentIndex() will not adjust components index references so they are valid. This is only used with the component being read or written is not the model but is a copy of one in a different model (linked instance definitions being the common situation).

◆ SetSave3dmPreviewImage()

void ON_BinaryArchive::SetSave3dmPreviewImage ( bool  bSave3dmPreviewImage)

◆ SetShouldSerializeUserDataDefault()

bool ON_BinaryArchive::SetShouldSerializeUserDataDefault ( bool  bSerialize)

Description: Specify the serialization option for object user data and user tables that are not explicitly set by SetShouldSerializeUserDataItem(). Parameters: bSerialize - [in] Remarks: If no setting is specified, all user data is read and written.

◆ SetShouldSerializeUserDataItem()

bool ON_BinaryArchive::SetShouldSerializeUserDataItem ( ON_UUID  application_id,
ON_UUID  item_id,
bool  bSerializeUserDataItem 
)

Description: Specify if an application's (plug-in's) object user data or user table should be read or written. Parameters: application_id - [in] The application id (often a plug-in id) for the object user data or user table. item_id - [in] item_id identifies which user data items should be read or written.

  • To determine if a specific type of object user data should be read or written, pass the value of ON_UserData.m_userdata_uuid.
  • To determine if the user table for the application should be read or written, pass application_id.
  • To determine if all object user data and the user table for the application should be read or written, pass nil. bSerializeUserDataItem - [in] True to enable reading and writing of the specified item. False to disable reading and writing of the specified item. Returns: True if the input was valid and the setting was applied. This function will not apply any settings after reading or writing begins.

◆ SetStorageDeviceError() [1/2]

void ON_BinaryArchive::SetStorageDeviceError ( ON_BinaryArchive::eStorageDeviceError  storage_device_error)

Description: A non-zero storage device error terminates reading or writing. See the ON_BinaryArchive::eStorageDeviceError for values. Parameter: storage_device_error - [in] A non-zero code that identifies an error the terminates reading or writing.
See ON_BinaryArchive::CriticalErrorCodes for values Remarks: Once set, the storage_device_error value cannot be changed.

◆ SetStorageDeviceError() [2/2]

void ON_BinaryArchive::SetStorageDeviceError ( unsigned int  storage_device_error)

◆ SetUseBufferCompression()

void ON_BinaryArchive::SetUseBufferCompression ( bool  bUseBufferCompression)

Description: Control when some information, like preview images and mesh information, is compressed when writing 3dm archives. The default is true. In special situations when the storage media is extremely fast and large file size is not a concern, disabling buffer compression can reduce file write time. Parameters: bUseBufferCompression - [in] Remarks: The default is true.

◆ ShouldSerializeAllUserData()

bool ON_BinaryArchive::ShouldSerializeAllUserData ( ) const

Returns: True if all user data and user tables should be read or written. False if some or no user data or user tables should be read or written. Remarks: AllUserDataSerializationIsEnabled() = (false == ShouldSerializeNoUserData() && false == ShouldSerializeSomeUserData())

◆ ShouldSerializeNoUserData()

bool ON_BinaryArchive::ShouldSerializeNoUserData ( ) const

Returns: True if no user data and user tables should be read or written. False if some or all user data or user tables should be read or written. Remarks: SerializeNoUserData() = (false == ShouldSerializeAllUserData() && false == ShouldSerializeSomeUserData())

◆ ShouldSerializeSomeUserData()

bool ON_BinaryArchive::ShouldSerializeSomeUserData ( ) const

Returns: True if some but not all user data or user tables should be read or written. False if all user data or no user data should be read or written. Remarks: SerializeSomeUserData() = (false == ShouldSerializeAllUserData() && false == ShouldSerializeNoUserData())

Use ShouldSerializeUserDataItem(application_id,item_id) to determine if a specific object user data or user table should be read or written.

◆ ShouldSerializeUserDataDefault()

bool ON_BinaryArchive::ShouldSerializeUserDataDefault ( ) const

◆ ShouldSerializeUserDataItem()

bool ON_BinaryArchive::ShouldSerializeUserDataItem ( ON_UUID  application_id,
ON_UUID  item_id 
) const

Description: Determine if an application's (plug-in's) object user data or user table should be read or written. Parameters: application_id - [in] The application id (often a plug-in id) for the object user data or user table. item_id - [in] item_id identifies which user data items should be read or written.

  • To determine if a specific type of object user data should be read or written, pass the value of ON_UserData.m_userdata_uuid.
  • To determine if the user table for the application should be read or written, pass application_id.
  • To determine if all object user data and the user table for the application should be read or written, pass nil. Returns: True if the identified user data or user table should be read or written.

◆ ShouldWriteUserDataItem()

bool ON_BinaryArchive::ShouldWriteUserDataItem ( const class ON_Object object,
const class ON_UserData object_user_data 
) const

◆ SizeofChunkLength()

size_t ON_BinaryArchive::SizeofChunkLength ( ) const

◆ StorageDeviceError()

unsigned int ON_BinaryArchive::StorageDeviceError ( ) const

Description: An error terminated reading or writing Returns: 0: no error terminiated reading or writing !=0: See the ON_BinaryArchive::DeviceErrorType for values

◆ StorageDeviceErrorFromUnsigned()

static ON_BinaryArchive::eStorageDeviceError ON_BinaryArchive::StorageDeviceErrorFromUnsigned ( unsigned int  storage_device_error_as_unsigned)
static

◆ TableComponentType()

static ON_ModelComponent::Type ON_BinaryArchive::TableComponentType ( ON_3dmArchiveTableType  table_type)
static

◆ ToggleByteOrder()

static bool ON_BinaryArchive::ToggleByteOrder ( size_t  ,
size_t  ,
const void *  ,
void *   
)
static

Description: Tool for swapping bytes when doing I/O on using big endian CPUs. Remarks: 3dm files are always saved with little endian byte order. See Also: ON_BinaryArchive::Endian

◆ TypecodeName()

static const char* ON_BinaryArchive::TypecodeName ( unsigned int  tcode)
static

◆ UnsetMode()

bool ON_BinaryArchive::UnsetMode ( ) const

Returns: True if Mode() is not set to a valid read or write mode.

◆ UpdateManifestMapItemDestination()

bool ON_BinaryArchive::UpdateManifestMapItemDestination ( const class ON_ManifestMapItem map_item)

Description: When an application is reading an archive and changes the index or id of a model component as it is added to the model, then it needs to update the manifest map item destination settings. Parameters: map_item - [in] The source type, index and id match what was read from the 3dm archive. The destination index and id are the values assigned by the application reading the 3dm archive.

◆ UseBufferCompression()

bool ON_BinaryArchive::UseBufferCompression ( ) const

Returns: true: (default) Some information, including preview images and mesh information is compressed when writing 3dm archives. This reduces, sometimes dramatically, the size of the 3dm archive. false: No compression is performed. This increases, sometimes dramatically, the size of the 3dm archive. In special situations when the storage media is extremely fast and large file size is not a concern, disabling buffer compression can reduce file write time.

◆ Write3dmAnonymousUserTable()

bool ON_BinaryArchive::Write3dmAnonymousUserTable ( const class ON_3dmGoo )
Deprecated:
use Write3dmAnonymousUserTableRecord(plugin_id, ..., goo)

◆ Write3dmAnonymousUserTableRecord()

bool ON_BinaryArchive::Write3dmAnonymousUserTableRecord ( ON_UUID  plugin_id,
int  goo_3dm_version,
unsigned int  goo_opennurbs_version,
const class ON_3dmGoo goo 
)

Description: If Read3dmAnaonymousUserTable() was used to read ON_3dmGoo because a plug-in was not present, then use Write3dmAnonymousUserTableRecord() to put than information back into the archive. Write3dmAnonymousUserTableRecord() writes the entire record. Do NOT call BeginWrite3dmUserTable() / EndWrite3dmUserTable() when using Write3dmAnonymousUserTableRecord(). Parameters: plugin_id - [in] goo_version - [in] The version of the archive (1,2,3,4,5,50,...) that was used when the plug-in wrote the user table. goo_opennurbs_version - [in] The version of opennurbs ( YYYMMDDN ) that was used when the plug-in wrote the user table. goo - [in] Returns: True if the goo was written. False if skipped because it could not be robustly saved.

◆ Write3dmBitmap()

bool ON_BinaryArchive::Write3dmBitmap ( const class ON_Bitmap )

◆ Write3dmChunkVersion()

bool ON_BinaryArchive::Write3dmChunkVersion ( int  ,
int   
)

A chunk version is a single byte that encodes a major.minor version number. Useful when creating I/O code for 3dm chunks that may change in the future. Increment the minor version number if new information is added to the end of the chunk. Increment the major version if the format of the chunk changes in some other way.

◆ Write3dmDimStyle()

bool ON_BinaryArchive::Write3dmDimStyle ( const class ON_DimStyle )

◆ Write3dmDimStyleComponent() [1/2]

bool ON_BinaryArchive::Write3dmDimStyleComponent ( const class ON_ModelComponent model_component)

◆ Write3dmDimStyleComponent() [2/2]

bool ON_BinaryArchive::Write3dmDimStyleComponent ( const class ON_ModelComponentReference model_component_reference)

◆ Write3dmEndMark()

bool ON_BinaryArchive::Write3dmEndMark ( )

Step 18: REQUIRED when writing / OPTIONAL when reading Write end of file marker. This information is primarily used when debugging files to make sure the end of the file hasn't been cut off. Description: Writes a TCODE_ENDOFFILE chunk that contains the number of bytes in the archive.

Returns: true if successful, false if unable to write to archive.

◆ Write3dmGoo()

bool ON_BinaryArchive::Write3dmGoo ( const ON_3dmGoo )

call to write "goo"

◆ Write3dmGroup()

bool ON_BinaryArchive::Write3dmGroup ( const class ON_Group )

◆ Write3dmGroupComponent() [1/2]

bool ON_BinaryArchive::Write3dmGroupComponent ( const class ON_ModelComponent model_component)

◆ Write3dmGroupComponent() [2/2]

bool ON_BinaryArchive::Write3dmGroupComponent ( const class ON_ModelComponentReference model_component_reference)

◆ Write3dmHatchPattern()

bool ON_BinaryArchive::Write3dmHatchPattern ( const class ON_HatchPattern )

◆ Write3dmHatchPatternComponent() [1/2]

bool ON_BinaryArchive::Write3dmHatchPatternComponent ( const class ON_ModelComponent model_component)

◆ Write3dmHatchPatternComponent() [2/2]

bool ON_BinaryArchive::Write3dmHatchPatternComponent ( const class ON_ModelComponentReference model_component_reference)

◆ Write3dmHistoryRecord()

bool ON_BinaryArchive::Write3dmHistoryRecord ( const class ON_HistoryRecord )

◆ Write3dmHistoryRecordComponent() [1/2]

bool ON_BinaryArchive::Write3dmHistoryRecordComponent ( const class ON_ModelComponent model_component)

◆ Write3dmHistoryRecordComponent() [2/2]

bool ON_BinaryArchive::Write3dmHistoryRecordComponent ( const class ON_ModelComponentReference model_component_reference)

◆ Write3dmImageComponent() [1/2]

bool ON_BinaryArchive::Write3dmImageComponent ( const class ON_ModelComponent model_component)

◆ Write3dmImageComponent() [2/2]

bool ON_BinaryArchive::Write3dmImageComponent ( const class ON_ModelComponentReference model_component_reference)

◆ Write3dmInstanceDefinition()

bool ON_BinaryArchive::Write3dmInstanceDefinition ( const class ON_InstanceDefinition )

◆ Write3dmInstanceDefinitionComponent() [1/2]

bool ON_BinaryArchive::Write3dmInstanceDefinitionComponent ( const class ON_ModelComponent model_component)

◆ Write3dmInstanceDefinitionComponent() [2/2]

bool ON_BinaryArchive::Write3dmInstanceDefinitionComponent ( const class ON_ModelComponentReference model_component_reference)

◆ Write3dmLayer()

bool ON_BinaryArchive::Write3dmLayer ( const ON_Layer )

◆ Write3dmLayerComponent() [1/2]

bool ON_BinaryArchive::Write3dmLayerComponent ( const class ON_ModelComponent model_component)

◆ Write3dmLayerComponent() [2/2]

bool ON_BinaryArchive::Write3dmLayerComponent ( const class ON_ModelComponentReference model_component_reference)

◆ Write3dmLight()

bool ON_BinaryArchive::Write3dmLight ( const class ON_Light ,
const class ON_3dmObjectAttributes  
)

◆ Write3dmLinePatternComponent() [1/2]

bool ON_BinaryArchive::Write3dmLinePatternComponent ( const class ON_ModelComponent model_component)

◆ Write3dmLinePatternComponent() [2/2]

bool ON_BinaryArchive::Write3dmLinePatternComponent ( const class ON_ModelComponentReference model_component_reference)

◆ Write3dmLinetype()

bool ON_BinaryArchive::Write3dmLinetype ( const class ON_Linetype line_pattern)

◆ Write3dmMaterial()

bool ON_BinaryArchive::Write3dmMaterial ( const class ON_Material )

◆ Write3dmMaterialComponent() [1/2]

bool ON_BinaryArchive::Write3dmMaterialComponent ( const class ON_ModelComponent model_component)

◆ Write3dmMaterialComponent() [2/2]

bool ON_BinaryArchive::Write3dmMaterialComponent ( const class ON_ModelComponentReference model_component_reference)

◆ Write3dmModelGeometryComponent() [1/2]

bool ON_BinaryArchive::Write3dmModelGeometryComponent ( const class ON_ModelComponentReference model_component_reference)

◆ Write3dmModelGeometryComponent() [2/2]

bool ON_BinaryArchive::Write3dmModelGeometryComponent ( const class ON_ModelGeometryComponent model_geometry)

◆ Write3dmModelLightComponent() [1/2]

bool ON_BinaryArchive::Write3dmModelLightComponent ( const class ON_ModelComponentReference model_component_reference)

◆ Write3dmModelLightComponent() [2/2]

bool ON_BinaryArchive::Write3dmModelLightComponent ( const class ON_ModelGeometryComponent model_light)

◆ Write3dmObject()

bool ON_BinaryArchive::Write3dmObject ( const ON_Object ,
const ON_3dmObjectAttributes  
)

◆ Write3dmProperties()

bool ON_BinaryArchive::Write3dmProperties ( const class ON_3dmProperties )

Step 2: REQUIRED - Write/Read properties table

◆ Write3dmReferencedComponentId() [1/2]

bool ON_BinaryArchive::Write3dmReferencedComponentId ( const ON_ModelComponent model_component)

◆ Write3dmReferencedComponentId() [2/2]

bool ON_BinaryArchive::Write3dmReferencedComponentId ( ON_ModelComponent::Type  component_type,
ON_UUID  model_component_id 
)

Description: WriteComponentId converts the model ID into an archive ID and writes the archive Id value. Generally, the ID of the component in the model is identical to the ID of the component in the archive. In rare situations this is not the case. Remarks: During writing, the m_manifest member stores the model ID as the "Component" value and the 3dm archive ID as the "Manifest" value.

◆ Write3dmReferencedComponentIndex() [1/3]

bool ON_BinaryArchive::Write3dmReferencedComponentIndex ( const ON_ModelComponent model_component)

Description: When writing archives, the index of the component in the model is often different than the index of the component in the archive. WriteComponentIndex converts the model id or index into an archive index and writes the archive index value. Remarks: During writing, the m_manifest member stores the model id and index as the "Component" value and the 3dm archive id index as the "Manifest" value.

◆ Write3dmReferencedComponentIndex() [2/3]

bool ON_BinaryArchive::Write3dmReferencedComponentIndex ( ON_ModelComponent::Type  component_type,
int  model_component_index 
)

Description: When writing archives, the index of the component in the model is often different than the index of the component in the archive. WriteComponentIndex converts the model id or index into an archive index and writes the archive index value. Remarks: During writing, the m_manifest member stores the model id and index as the "Component" value and the 3dm archive id index as the "Manifest" value.

◆ Write3dmReferencedComponentIndex() [3/3]

bool ON_BinaryArchive::Write3dmReferencedComponentIndex ( ON_ModelComponent::Type  component_type,
ON_UUID  model_component_id 
)

Description: When writing archives, the index of the component in the model is often different than the index of the component in the archive. WriteComponentIndex converts the model id or index into an archive index and writes the archive index value. Remarks: During writing, the m_manifest member stores the model id and index as the "Component" value and the 3dm archive id index as the "Manifest" value.

◆ Write3dmSettings()

bool ON_BinaryArchive::Write3dmSettings ( const class ON_3dmSettings )

Step 3: REQUIRED - Write/Read settings table

◆ Write3dmStartSection()

bool ON_BinaryArchive::Write3dmStartSection ( int  version,
const char *  sStartSectionComment 
)

Parameters: version - [in] 0, 2, 3, 4, 5, 50 or 60 (5 is treated as 50)

If version is 0, then the value of ON_BinaryArchive::CurrentArchiveVersion() is used.

Use either 0 or the value of ON_BinaryArchive::CurrentArchiveVersion() for the version parameter when you want your code to write the most up to date file version.

sStartSectionComment - [in] nullptr or a UTF-8 encoded string with application name, et cetera. This information is primarily used when debugging files that contain problems. McNeel and Associates stores application name, application version, compile date, and the OS in use when file was written.

◆ Write3dmTextureMapping()

bool ON_BinaryArchive::Write3dmTextureMapping ( const class ON_TextureMapping )

◆ Write3dmTextureMappingComponent() [1/2]

bool ON_BinaryArchive::Write3dmTextureMappingComponent ( const class ON_ModelComponent model_component)

◆ Write3dmTextureMappingComponent() [2/2]

bool ON_BinaryArchive::Write3dmTextureMappingComponent ( const class ON_ModelComponentReference model_component_reference)

◆ WriteArc()

bool ON_BinaryArchive::WriteArc ( const ON_Arc )

◆ WriteArray() [1/38]

bool ON_BinaryArchive::WriteArray ( const ON_ClassArray< class ON_ObjRef > &  )

◆ WriteArray() [2/38]

bool ON_BinaryArchive::WriteArray ( const ON_ClassArray< ON_MappingRef > &  )

◆ WriteArray() [3/38]

bool ON_BinaryArchive::WriteArray ( const ON_ClassArray< ON_MaterialRef > &  )

◆ WriteArray() [4/38]

bool ON_BinaryArchive::WriteArray ( const ON_ClassArray< ON_String > &  )

◆ WriteArray() [5/38]

bool ON_BinaryArchive::WriteArray ( const ON_ClassArray< ON_wString > &  )

◆ WriteArray() [6/38]

bool ON_BinaryArchive::WriteArray ( const ON_SimpleArray< bool > &  )

◆ WriteArray() [7/38]

bool ON_BinaryArchive::WriteArray ( const ON_SimpleArray< char > &  )

◆ WriteArray() [8/38]

bool ON_BinaryArchive::WriteArray ( const ON_SimpleArray< class ON_ClippingPlaneInfo > &  )

◆ WriteArray() [9/38]

bool ON_BinaryArchive::WriteArray ( const ON_SimpleArray< class ON_ObjRef_IRefID > &  )

◆ WriteArray() [10/38]

bool ON_BinaryArchive::WriteArray ( const ON_SimpleArray< double > &  )

◆ WriteArray() [11/38]

bool ON_BinaryArchive::WriteArray ( const ON_SimpleArray< float > &  )

◆ WriteArray() [12/38]

bool ON_BinaryArchive::WriteArray ( const ON_SimpleArray< ON_2dPoint > &  )

◆ WriteArray() [13/38]

bool ON_BinaryArchive::WriteArray ( const ON_SimpleArray< ON_2dVector > &  )

◆ WriteArray() [14/38]

bool ON_BinaryArchive::WriteArray ( const ON_SimpleArray< ON_2fPoint > &  )

◆ WriteArray() [15/38]

bool ON_BinaryArchive::WriteArray ( const ON_SimpleArray< ON_2fVector > &  )

◆ WriteArray() [16/38]

bool ON_BinaryArchive::WriteArray ( const ON_SimpleArray< ON_3dPoint > &  )

◆ WriteArray() [17/38]

bool ON_BinaryArchive::WriteArray ( const ON_SimpleArray< ON_3dVector > &  )

◆ WriteArray() [18/38]

bool ON_BinaryArchive::WriteArray ( const ON_SimpleArray< ON_3fPoint > &  )

◆ WriteArray() [19/38]

bool ON_BinaryArchive::WriteArray ( const ON_SimpleArray< ON_3fVector > &  )

◆ WriteArray() [20/38]

bool ON_BinaryArchive::WriteArray ( const ON_SimpleArray< ON_4dPoint > &  )

◆ WriteArray() [21/38]

bool ON_BinaryArchive::WriteArray ( const ON_SimpleArray< ON_4fPoint > &  )

◆ WriteArray() [22/38]

bool ON_BinaryArchive::WriteArray ( const ON_SimpleArray< ON__INT16 > &  )

◆ WriteArray() [23/38]

bool ON_BinaryArchive::WriteArray ( const ON_SimpleArray< ON__INT32 > &  )

◆ WriteArray() [24/38]

bool ON_BinaryArchive::WriteArray ( const ON_SimpleArray< ON__INT8 > &  )

◆ WriteArray() [25/38]

bool ON_BinaryArchive::WriteArray ( const ON_SimpleArray< ON__UINT16 > &  )

◆ WriteArray() [26/38]

bool ON_BinaryArchive::WriteArray ( const ON_SimpleArray< ON__UINT32 > &  )

◆ WriteArray() [27/38]

bool ON_BinaryArchive::WriteArray ( const ON_SimpleArray< ON__UINT8 > &  )

◆ WriteArray() [28/38]

bool ON_BinaryArchive::WriteArray ( const ON_SimpleArray< ON_Color > &  )

◆ WriteArray() [29/38]

bool ON_BinaryArchive::WriteArray ( const ON_SimpleArray< ON_DisplayMaterialRef > &  )

◆ WriteArray() [30/38]

bool ON_BinaryArchive::WriteArray ( const ON_SimpleArray< ON_LinetypeSegment > &  )

◆ WriteArray() [31/38]

bool ON_BinaryArchive::WriteArray ( const ON_SimpleArray< ON_MappingChannel > &  )

◆ WriteArray() [32/38]

bool ON_BinaryArchive::WriteArray ( const ON_SimpleArray< ON_SurfaceCurvature > &  )

◆ WriteArray() [33/38]

bool ON_BinaryArchive::WriteArray ( const ON_SimpleArray< ON_UUID > &  )

◆ WriteArray() [34/38]

bool ON_BinaryArchive::WriteArray ( const ON_SimpleArray< ON_UuidIndex > &  )

◆ WriteArray() [35/38]

bool ON_BinaryArchive::WriteArray ( const ON_SimpleArray< ON_UuidPtr > &  )

◆ WriteArray() [36/38]

bool ON_BinaryArchive::WriteArray ( const ON_SimpleArray< ON_Xform > &  )

◆ WriteArray() [37/38]

bool ON_BinaryArchive::WriteArray ( int  count,
const class ON_Layer  
)

◆ WriteArray() [38/38]

bool ON_BinaryArchive::WriteArray ( int  count,
const class ON_Layer *const *   
)

◆ WriteBigInt() [1/4]

bool ON_BinaryArchive::WriteBigInt ( ON__INT64  )

◆ WriteBigInt() [2/4]

bool ON_BinaryArchive::WriteBigInt ( ON__UINT64  )

◆ WriteBigInt() [3/4]

bool ON_BinaryArchive::WriteBigInt ( size_t  ,
const ON__INT64  
)

◆ WriteBigInt() [4/4]

bool ON_BinaryArchive::WriteBigInt ( size_t  ,
const ON__UINT64  
)

◆ WriteBigSize()

bool ON_BinaryArchive::WriteBigSize ( size_t  )

64 bits

◆ WriteBigTime()

bool ON_BinaryArchive::WriteBigTime ( time_t  )

UCT seconds since 1 January 1970 (64 bits)

◆ WriteBool()

bool ON_BinaryArchive::WriteBool ( bool  )

◆ WriteBoolFalse()

bool ON_BinaryArchive::WriteBoolFalse ( )

◆ WriteBoolTrue()

bool ON_BinaryArchive::WriteBoolTrue ( )

◆ WriteBoundingBox()

bool ON_BinaryArchive::WriteBoundingBox ( const ON_BoundingBox )

◆ WriteByte()

bool ON_BinaryArchive::WriteByte ( size_t  ,
const void *   
)

must fail if mode is not write or readwrite

◆ WriteChar() [1/6]

bool ON_BinaryArchive::WriteChar ( char  )

◆ WriteChar() [2/6]

bool ON_BinaryArchive::WriteChar ( ON__INT8  )

◆ WriteChar() [3/6]

bool ON_BinaryArchive::WriteChar ( ON__UINT8  )

◆ WriteChar() [4/6]

bool ON_BinaryArchive::WriteChar ( size_t  ,
const char *   
)

◆ WriteChar() [5/6]

bool ON_BinaryArchive::WriteChar ( size_t  ,
const ON__INT8  
)

◆ WriteChar() [6/6]

bool ON_BinaryArchive::WriteChar ( size_t  ,
const ON__UINT8  
)

◆ WriteCircle()

bool ON_BinaryArchive::WriteCircle ( const ON_Circle )

◆ WriteColor() [1/2]

bool ON_BinaryArchive::WriteColor ( const ON_4fColor )

◆ WriteColor() [2/2]

bool ON_BinaryArchive::WriteColor ( const ON_Color )

◆ WriteComponentIndex()

bool ON_BinaryArchive::WriteComponentIndex ( const ON_COMPONENT_INDEX )

◆ WriteCompressedBuffer()

bool ON_BinaryArchive::WriteCompressedBuffer ( size_t  sizeof__inbuffer,
const void *  inbuffer 
)

Description: Compress buffer and write the compressed information to the archive. Parameters: sizeof__inbuffer - [in] size of the uncompressed buffer in bytes inbuffer - [in] uncompressed buffer Returns: True if write was successful. Remarks: Write your archive write/read code as if compression is always enabled. Do not vary what get written or read based on the value of UseBufferCompression().

◆ WriteDisplayMaterialRef()

bool ON_BinaryArchive::WriteDisplayMaterialRef ( const ON_DisplayMaterialRef )

◆ WriteDouble() [1/2]

bool ON_BinaryArchive::WriteDouble ( double  )

◆ WriteDouble() [2/2]

bool ON_BinaryArchive::WriteDouble ( size_t  ,
const double *   
)

◆ WriteFloat() [1/2]

bool ON_BinaryArchive::WriteFloat ( float  )

◆ WriteFloat() [2/2]

bool ON_BinaryArchive::WriteFloat ( size_t  ,
const float *   
)

◆ WriteInt() [1/4]

bool ON_BinaryArchive::WriteInt ( ON__INT32  )

◆ WriteInt() [2/4]

bool ON_BinaryArchive::WriteInt ( ON__UINT32  )

◆ WriteInt() [3/4]

bool ON_BinaryArchive::WriteInt ( size_t  ,
const ON__INT32  
)

◆ WriteInt() [4/4]

bool ON_BinaryArchive::WriteInt ( size_t  ,
const ON__UINT32  
)

◆ WriteInterval()

bool ON_BinaryArchive::WriteInterval ( const ON_Interval )

◆ WriteLine()

bool ON_BinaryArchive::WriteLine ( const ON_Line )

◆ WriteLinetypeSegment()

bool ON_BinaryArchive::WriteLinetypeSegment ( const ON_LinetypeSegment )

◆ WriteLong() [1/4]

bool ON_BinaryArchive::WriteLong ( long  )

◆ WriteLong() [2/4]

bool ON_BinaryArchive::WriteLong ( size_t  ,
const long *   
)

◆ WriteLong() [3/4]

bool ON_BinaryArchive::WriteLong ( size_t  ,
const unsigned long *   
)

◆ WriteLong() [4/4]

bool ON_BinaryArchive::WriteLong ( unsigned long  )

◆ WriteMode()

bool ON_BinaryArchive::WriteMode ( ) const

Returns: True if Mode() is an archive writing mode.

◆ WriteModelComponentAttributes()

bool ON_BinaryArchive::WriteModelComponentAttributes ( const class ON_ModelComponent model_component,
unsigned int  attributes_filter 
)

Description: Writes the attributes identified by the component_filter parameter. Parameters: model_component - [in] attributes_filter - [in] A bitfield that determines which attributes will be written. Returns: false: critical failure. true: writing can continue.

◆ WriteModelComponentName()

bool ON_BinaryArchive::WriteModelComponentName ( const ON_ModelComponent model_component)

◆ WriteObject() [1/2]

bool ON_BinaryArchive::WriteObject ( const ON_Object )

writes object definition

◆ WriteObject() [2/2]

bool ON_BinaryArchive::WriteObject ( const ON_Object )

writes object definition

◆ WriteObjectUserData()

bool ON_BinaryArchive::WriteObjectUserData ( const ON_Object object)

Description: Low level tool to writes user data attached to the object. This function should never be called directly. Parameters: object - [in] Returns: True if successful.

◆ WritePlane()

bool ON_BinaryArchive::WritePlane ( const ON_Plane )

◆ WritePlaneEquation()

bool ON_BinaryArchive::WritePlaneEquation ( const ON_PlaneEquation )

◆ WritePoint() [1/3]

bool ON_BinaryArchive::WritePoint ( const ON_2dPoint )

◆ WritePoint() [2/3]

bool ON_BinaryArchive::WritePoint ( const ON_3dPoint )

◆ WritePoint() [3/3]

bool ON_BinaryArchive::WritePoint ( const ON_4dPoint )

◆ WriteShort() [1/4]

bool ON_BinaryArchive::WriteShort ( ON__INT16  )

◆ WriteShort() [2/4]

bool ON_BinaryArchive::WriteShort ( ON__UINT16  )

◆ WriteShort() [3/4]

bool ON_BinaryArchive::WriteShort ( size_t  ,
const ON__INT16  
)

◆ WriteShort() [4/4]

bool ON_BinaryArchive::WriteShort ( size_t  ,
const ON__UINT16  
)

◆ WriteString() [1/4]

bool ON_BinaryArchive::WriteString ( const char *  sUTF8)

Parameters: sUTF8 - [in] A null terminated UTF-8 encoded unicode string. Remarks: To read a string written with WriteString(const char*), call ReadStringUTF8ElementCount(&string_utf8_element_count) to get the number of char elements written in the file, obtain a buffer with at least string_utf8_element_count char elements and then call ReadString(string_utf8_element_count,buffer) to read the char elements.

If 0 == sUTF8 or 0 == SUTF8[0], a 4 byte int with value = 0 is written, otherwise a 4 byte int with value = strlen + 1 is written, followed by the string, followed by the null terminator.

◆ WriteString() [2/4]

bool ON_BinaryArchive::WriteString ( const ON_String sUTF8)

◆ WriteString() [3/4]

bool ON_BinaryArchive::WriteString ( const ON_wString s)

◆ WriteString() [4/4]

bool ON_BinaryArchive::WriteString ( const unsigned char *  sUTF8)

Parameters: sUTF8 - [in] A null terminated UTF-8 encoded unicode string. Remarks: To read a string written with WriteString(const unsigned char*), call ReadStringUTF8ElementCount(&string_utf8_element_count) to get the number of unsigned char elements written in the file, obtain a buffer with at least string_utf8_element_count unsigned char elements and then call ReadString(string_utf8_element_count,buffer) to read the unsigned charelements.

If 0 == sUTF8 or 0 == SUTF8[0], a 4 byte int with value = 0 is written, otherwise a 4 byte int with value = strlen + 1 is written, followed by the string, followed by the null terminator.

◆ WriteTime()

bool ON_BinaryArchive::WriteTime ( const struct tm &  )

All times are stored in universal coordinated time ( a.k.a GMT, UCT ). Use ANSI C time() and gmtime() calls.

◆ WriteUTF16String()

bool ON_BinaryArchive::WriteUTF16String ( const unsigned short *  sUTF16)

Parameters: sUTF16 - [in] A null terminated UTF-16 encoded unicode string. Remarks: To read a string written with WriteString(const unsigned short*), call ReadStringUTF16ElementCount(&string_utf16_element_count) to get the number of unsigned short elements written in the file, obtain a buffer with at least string_utf16_element_count unsigned short elements and then call ReadString(string_utf16_element_count,buffer) to read the unsigned short elements.

If 0 == sUTF8 or 0 == SUTF8[0], a 4 byte int with value = 0 is written, otherwise a 4 byte int with value = strlen + 1 is written, followed by the string, followed by the null terminator.

◆ WriteUuid()

bool ON_BinaryArchive::WriteUuid ( const ON_UUID )

◆ WriteVector() [1/2]

bool ON_BinaryArchive::WriteVector ( const ON_2dVector )

◆ WriteVector() [2/2]

bool ON_BinaryArchive::WriteVector ( const ON_3dVector )

◆ WriteWideString() [1/2]

bool ON_BinaryArchive::WriteWideString ( const ON_wString wide_string)

Description: Write a wide string as a UTF-8 encoded string.

◆ WriteWideString() [2/2]

bool ON_BinaryArchive::WriteWideString ( const wchar_t *  sWideChar,
int  sWideChar_count 
)

Description: Write a wide string as a UTF-8 encoded string.

◆ WriteXform()

bool ON_BinaryArchive::WriteXform ( const ON_Xform )

Friends And Related Function Documentation

◆ ON_SetBinaryArchiveOpenNURBSVersion

void ON_SetBinaryArchiveOpenNURBSVersion ( ON_BinaryArchive ,
unsigned int   
)
friend

When a 3DM archive is read, m_3dm_opennurbs_version records the version of OpenNURBS used to create the archive. Otherwise, m_3dm_opennurbs_version is zero.

Read3dmProperties() sets this to the version of OpenNURBS that was used to write file file. If the file was created using a version of OpenNURBS before 200012210, this number will be zero.

Write3dmProperties() stores the value returned by ON::Version() in the archive's properties table.

Used int ON_3dmProperties::Read() to set ON_BinaryArchive.m_3dm_opennurbs_version Do not call directly.