16 #if !defined(ON_ARCHIVE_INC_) 17 #define ON_ARCHIVE_INC_ 25 typedef void (*ON_Buffer_ErrorHandler)(
class ON_Buffer*);
50 void EmergencyDestroy();
71 ON__UINT64 Size()
const;
79 ON__UINT32 CRC32( ON__UINT32 current_remainder )
const;
91 ON__UINT64 CurrentPosition()
const;
102 ON__UINT64 Write( ON__UINT64 size,
const void* buffer );
123 ON__UINT64 Read( ON__UINT64 size,
void* buffer );
127 seek_from_beginning_of_file = 0,
128 seek_from_current_position = 1,
129 seek_from_end_of_file = 2
168 bool SeekFromStart( ON__INT64 offset );
183 bool SeekFromCurrentPosition( ON__INT64 offset );
198 bool SeekFromEnd( ON__INT64 offset );
211 bool ChangeSize( ON__UINT64 buffer_size );
230 bool IsValid(
const ON_TextLog* text_log )
const;
238 ON__UINT32 LastError()
const;
240 void ClearLastError();
242 ON_Buffer_ErrorHandler ErrorHandler()
const;
244 void SetErrorHandler(ON_Buffer_ErrorHandler error_handler);
286 bool Compress(
ON_Buffer& compressed_buffer )
const;
314 bool Uncompress(
ON_Buffer& uncompressed_buffer )
const;
318 ON__UINT64 m_buffer_size;
319 ON__UINT64 m_current_position;
321 struct ON_BUFFER_SEGMENT* m_first_segment;
322 struct ON_BUFFER_SEGMENT* m_last_segment;
323 struct ON_BUFFER_SEGMENT* m_current_segment;
324 bool SetCurrentSegment(
bool);
327 ON_Buffer_ErrorHandler m_error_handler;
329 ON__UINT32 m_last_error;
330 unsigned char m_reserved[12];
349 unsigned int m_typecode;
352 ON__UINT16 m_do_crc16;
354 ON__UINT32 m_do_crc32;
367 ON__UINT64 m_start_offset=0;
371 ON__UINT64 m_end_offset=0;
391 ON__UINT64 Length()
const;
401 ON__UINT64 LengthRemaining(
402 ON__UINT64 current_position
411 ON__UINT64 SizeofCRC()
const;
413 ON__INT64 m_big_value=0;
414 ON__UINT32 m_typecode=0;
415 ON__UINT8 m_bLongChunk=0;
418 ON__UINT8 m_reserved1=0;
419 ON__UINT8 m_reserved2=0;
420 ON__UINT8 m_reserved3=0;
424 ON__UINT8 m_do_crc16=0;
425 ON__UINT8 m_do_crc32=0;
426 ON__UINT16 m_crc16=0;
427 ON__UINT32 m_crc32=0;
430 bool ON_IsLongChunkTypecode(ON__UINT32 typecode);
432 bool ON_IsShortChunkTypecode(ON__UINT32 typecode);
434 #if defined(ON_DLL_TEMPLATE) 476 unsigned int m_precedence;
483 #if defined(ON_DLL_TEMPLATE) 506 UnsetComponentIndex = ON_UNSET_INT_INDEX
518 unsigned int ItemCount()
const;
530 unsigned int TotalComponentCount(
545 unsigned int ActiveAndDeletedComponentCount(
560 unsigned int ActiveComponentCount(
574 unsigned int DeletedComponentCount(
578 unsigned int SystemComponentCount(
590 int ComponentIndexLimit(
624 bool bResolveIdAndNameCollisions,
654 ON__UINT64 component_serial_number,
686 ON__UINT64 component_serial_number,
690 const wchar_t* candidate_name,
696 ON__UINT64 component_serial_number,
699 const wchar_t* original_name,
723 const wchar_t* component_name
766 ON__UINT64 component_runtime_serial_number
778 ON__UINT64 component_runtime_serial_number
788 const wchar_t* candidate_name,
805 ON__UINT64 new_component_runtime_serial_number,
806 const wchar_t* candidate_name,
810 bool RemoveComponent(
814 bool RemoveComponent(
815 ON__UINT64 component_runtime_serial_number
818 bool RemoveComponent(
822 bool RemoveIndexedComponent(
827 bool RemoveAllComponents(
829 bool bResetManifestIndex
871 const wchar_t* candidate_name,
872 const wchar_t* base_name,
873 const wchar_t* suffix_separator,
874 unsigned int suffix0,
875 unsigned int* suffix_value
908 bool NameIsAvailable(
951 ON__UINT64 component_runtime_serial_number
1011 unsigned int unsigned_item_index
1021 int system_item_index
1068 ON__UINT64 ManifestContentVersionNumber()
const;
1074 bool bResolveIdAndNameCollisions,
1075 const wchar_t* candidate_name,
1080 class ON_ComponentManifestImpl* Impl()
const;
1081 mutable class ON_ComponentManifestImpl* m_impl =
nullptr;
1089 static int CompareComponentType(
1094 static int CompareId(
1099 static int CompareNameHash(
1104 static int CompareIndex(
1123 ON__UINT64 m_component_runtime_serial_number,
1137 ON__UINT64 m_component_runtime_serial_number,
1154 bool IsValid()
const;
1161 bool IsUnset()
const;
1169 bool IsDeleted()
const;
1175 bool IsSystemComponent()
const;
1184 void SetComponentType(
1204 ON__UINT64 ComponentRuntimeSerialNumber()
const;
1206 void SetComponentRuntimeSerialNumber(
1207 ON__UINT64 component_runtime_serial_number
1233 friend class ON_ComponentManifestImpl;
1235 void Internal_SetDeletedState(
1240 ON__UINT32 m_status_bits = 0;
1242 ON__UINT8 m_reserved1 = 0;
1243 ON__UINT16 m_reserved2 = 0;
1244 ON__UINT32 m_reserved3 = 0;
1245 int m_index = ON_UNSET_INT_INDEX;
1246 ON__UINT64 m_component_runtime_serial_number = 0;
1271 static int CompareTypeAndSourceIdAndIndex(
1276 static int CompareTypeAndDestinationIdAndIndex(
1281 static int CompareTypeAndSourceIndex(
1286 static int CompareTypeAndDestinationIndex(
1295 static ON__UINT32 SourceIdHash32(
1296 const ON_UUID& source_component_id
1303 static ON__UINT32 SourceIndexHash32(
1305 int source_component_index
1317 bool SourceAndDestinationAreSet()
const;
1319 bool SourceOrDestinationIsUnset()
const;
1328 bool SourceIsSet()
const;
1330 bool SourceIsUnset()
const;
1339 bool DestinationIsSet()
const;
1341 bool DestinationIsUnset()
const;
1348 bool DestinationInManifest(
1357 bool SourceInManifest(
1364 const ON_UUID& SourceId()
const;
1365 const ON_UUID& DestinationId()
const;
1366 int SourceIndex()
const;
1367 int DestinationIndex()
const;
1369 bool ClearSourceIdentification();
1371 bool ClearDestinationIdentification();
1384 bool SetSourceIdentification(
1401 bool SetDestinationIdentification(
1404 int destination_index
1416 bool SetSourceIdentification(
1429 bool SetDestinationIdentification(
1443 bool SetSourceIdentification(
1456 bool SetDestinationIdentification(
1469 bool SetSourceIdentification(
1482 bool SetDestinationIdentification(
1487 bool Internal_SetSourceOrDestinationIdentification(
1488 unsigned int which_identification,
1497 unsigned int m_reserved = 0;
1499 int m_source_index = ON_UNSET_INT_INDEX;
1500 int m_destination_index = ON_UNSET_INT_INDEX;
1502 ON_UUID m_source_id = ON_nil_uuid;
1503 ON_UUID m_destination_id = ON_nil_uuid;
1533 ON_ManifestMap& operator=(const ON_ManifestMap&);
1536 static const ON_ManifestMap Empty;
1551 bool UpdatetMapItemDestination(
1561 int source_component_index
1564 bool GetAndValidateDestinationIndex(
1566 int source_component_index,
1568 int* destination_component_index
1571 bool GetAndValidateDestinationIndex(
1573 const
ON_UUID& source_component_id,
1575 int* destination_component_index
1578 bool GetAndValidateDestinationId(
1580 const
ON_UUID& source_component_id,
1582 ON_UUID* destination_component_id
1589 bool IsEmpty() const;
1595 bool IsNotEmpty() const;
1603 unsigned int MapItemCount() const;
1606 class ON_ManifestMapImpl* Impl();
1607 class ON_ManifestMapImpl* m_impl =
nullptr;
1611 enum class ON_3dmArchiveTableType :
unsigned int 1621 start_section = 0x00000001U,
1623 properties_table = 0x00000002U,
1624 settings_table = 0x00000004U,
1625 bitmap_table = 0x00000008U,
1626 texture_mapping_table = 0x00000010U,
1627 material_table = 0x00000020U,
1628 linetype_table = 0x00000040U,
1629 layer_table = 0x00000080U,
1630 group_table = 0x00000100U,
1631 text_style_table = 0x00000200U,
1632 leader_style_table = 0x00000400U,
1633 dimension_style_table = 0x00000800U,
1634 light_table = 0x00001000U,
1635 hatchpattern_table = 0x00002000U,
1636 instance_definition_table = 0x00004000U,
1637 object_table = 0x00008000U,
1638 historyrecord_table = 0x00010000U,
1639 user_table = 0x00020000U,
1642 end_mark = 0x40000000U
1665 ON::active_space ViewContext()
const;
1667 void SetViewContext(
1671 ON::LengthUnitSystem ModelLengthUnitSystem()
const;
1673 void SetModelLengthUnitSystem(
1674 ON::LengthUnitSystem model_length_unit_system
1677 ON::LengthUnitSystem PageLengthUnitSystem()
const;
1679 void SetPageLengthUnitSystem(
1680 ON::LengthUnitSystem page_length_unit_system
1691 void SetReferencedAnnotationSettings(
1700 void SetManagedAnnotationSettings(
1708 bool AnnotationSettingsAreSet()
const;
1726 void SetReferencedDimStyle(
1729 int V5_3dm_archive_index
1737 void SetManagedDimStyle(
1740 int V5_3dm_archive_index
1743 void UpdateReferencedDimStyle(
1752 bool DimStyleIsSet()
const;
1759 ON_UUID ParentDimStyleId()
const;
1766 int V5_ArchiveDimStyleIndex()
const;
1776 bool IsOverrideDimStyle()
const;
1786 void SetReferencedBinaryArchive(
1794 bool BinaryArchiveIsSet()
const;
1801 const class ON_DimStyle* m_parent_dim_style =
nullptr;
1802 class ON_DimStyle* m_managed_parent_dim_style =
nullptr;
1804 const class ON_DimStyle* m_override_dim_style =
nullptr;
1805 class ON_DimStyle* m_managed_override_dim_style =
nullptr;
1809 ON::active_space m_view_context = ON::active_space::no_space;
1810 ON::LengthUnitSystem m_model_length_unit_system = ON::LengthUnitSystem::None;
1811 ON::LengthUnitSystem m_page_length_unit_system = ON::LengthUnitSystem::None;
1814 int m_V5_3dm_archive_dim_style_index = ON_UNSET_INT_INDEX;
1818 void Internal_Destroy();
1832 ON_3dmArchiveTableType m_table_type = ON_3dmArchiveTableType::Unset;
1835 unsigned int m_item_count = 0;
1841 unsigned int m_crc_error_count = 0;
1847 unsigned int m_critical_error_count = 0;
1852 unsigned int m_recoverable_error_count = 0;
1854 enum class TableState :
unsigned int 1874 ON__UINT64 Internal_CurrentPositionOverride(
1878 bool Internal_SeekFromCurrentPositionOverride(
1883 bool Internal_SeekToStartOverride(
1892 bool AtEnd()
const = 0;
1899 ON__UINT64 CurrentPosition()
const;
1913 ON__UINT64 bytes_from_start
1926 ON__UINT64 bytes_forward
1939 ON__UINT64 bytes_backward
1943 bool Internal_SeekCur(
1960 bool ToggleByteOrder(
1968 const char* TypecodeName(
unsigned int tcode );
1971 char* ON_TypecodeParse(
unsigned int tcode,
char* typecode_name,
size_t max_length );
1979 ON::endian Endian()
const;
1981 bool ReadByte(
size_t,
void* );
1983 bool WriteByte(
size_t,
const void* );
1995 ON__UINT64 ReadBuffer( ON__UINT64 sizeof_buffer,
void* buffer );
2009 bool EnableCRCCalculation(
bool bEnable );
2036 bool ReadCompressedBufferSize(
size_t* sizeof__outbuffer );
2062 bool ReadCompressedBuffer(
2063 size_t sizeof__outbuffer,
2080 bool WriteCompressedBuffer(
2081 size_t sizeof__inbuffer,
2082 const void* inbuffer
2085 bool ReadBool(
bool* );
2165 bool ReadBigSize(
size_t* );
2167 bool ReadBigTime( time_t* );
2229 bool ReadTime(
struct tm& );
2243 ON_DEPRECATED_MSG(
"Use either ReadStringUTF8ElementCount() or ReadStringUTF16ElementCount()")
2244 bool ReadStringSize(
2245 size_t* str_array_count
2257 bool ReadStringUTF8ElementCount(
2258 size_t* string_utf8_element_count
2270 bool ReadStringUTF16ElementCount(
2271 size_t* string_utf16_element_count
2289 size_t str_array_count,
2307 size_t str_array_count,
2308 unsigned char* str_array
2325 size_t str_array_count,
2326 unsigned short* str_array
2333 bool ReadComponentIndex( ON_COMPONENT_INDEX& );
2370 bool WriteBool(
bool );
2372 #if defined(ON_COMPILER_MSC) && defined(NDEBUG) 2374 __declspec(noinline)
2376 bool WriteBoolTrue();
2378 #if defined(ON_COMPILER_MSC) && defined(NDEBUG) 2380 __declspec(noinline)
2382 bool WriteBoolFalse();
2390 const unsigned char*
2405 const unsigned short*
2450 const unsigned long*
2462 bool WriteBigSize(
size_t );
2464 bool WriteBigTime( time_t );
2503 bool WriteXform(
const ON_Xform&);
2509 bool WriteLine(
const ON_Line&);
2511 bool WriteArc(
const ON_Arc&);
2517 bool WriteUuid(
const ON_UUID& );
2519 bool WriteDisplayMaterialRef(
const ON_DisplayMaterialRef& );
2521 bool WriteLinetypeSegment(
const ON_LinetypeSegment& );
2525 bool WriteTime(
const struct tm& );
2568 const unsigned char* sUTF8
2589 bool WriteUTF16String(
2590 const unsigned short* sUTF16
2597 bool WriteWideString(
2598 const wchar_t* sWideChar,
2606 bool WriteWideString(
2607 const ON_wString& wide_string
2614 bool ReadWideString(
2615 ON_wString& wide_string
2618 bool WriteString(
const ON_String& sUTF8 );
2620 bool WriteString(
const ON_wString& s);
2622 bool WriteComponentIndex(
const ON_COMPONENT_INDEX& );
2659 bool WriteArray(
int count,
const class ON_Layer* );
2660 bool WriteArray(
int count,
const class ON_Layer*
const* );
2706 bool Internal_WriteObject(
2709 bool Internal_WriteV5AnnotationObject(
2713 bool Internal_WriteV2AnnotationObject(
2714 const class ON_OBSOLETE_V5_Annotation& V5_annotation,
2757 void EnableSave3dmRenderMeshes(
2758 unsigned int object_type_flags,
2759 bool bSave3dmRenderMeshes
2770 unsigned int Save3dmRenderMeshObjectTypeFlags()
const;
2779 bool Save3dmRenderMesh(
2780 ON::object_type object_type
2811 void EnableSave3dmAnalysisMeshes(
2812 unsigned int object_type_flags,
2813 bool bSave3dmAnalysisMeshes
2816 void SetSave3dmPreviewImage(
2817 bool bSave3dmPreviewImage
2829 bool Save3dmPreviewImage()
const;
2842 void SetUseBufferCompression(
2843 bool bUseBufferCompression
2858 bool UseBufferCompression()
const;
2869 unsigned int Save3dmAnalysisMeshObjectTypeFlags()
const;
2878 bool Save3dmAnalysisMesh(
2879 ON::object_type object_type
2890 bool ShouldSerializeAllUserData()
const;
2899 bool ShouldSerializeNoUserData()
const;
2913 bool ShouldSerializeSomeUserData()
const;
2934 bool ShouldSerializeUserDataItem(
2935 ON_UUID application_id,
2948 bool SetShouldSerializeUserDataDefault(
2952 bool ShouldSerializeUserDataDefault()
const;
2979 bool SetShouldSerializeUserDataItem(
2980 ON_UUID application_id,
2982 bool bSerializeUserDataItem
2993 bool ObjectHasUserDataToWrite(
2997 bool ShouldWriteUserDataItem(
3011 static int CurrentArchiveVersion();
3021 bool ArchiveContains3dmTable(
3022 ON_3dmArchiveTableType table
3032 static bool ArchiveContains3dmTable(
3033 ON_3dmArchiveTableType table,
3034 unsigned int archive_3dm_version,
3035 unsigned int opennurbs_library_version
3038 bool WriteModelComponentName(
3065 bool Write3dmStartSection(
3067 const char* sStartSectionComment
3079 bool Read3dmStartSection(
3081 ON_String& sStartSectionComment
3090 const ON_String& Archive3dmStartSectionComment()
const;
3095 bool Write3dmProperties(
3098 bool Read3dmProperties(
3113 bool Write3dmSettings(
3116 bool Read3dmSettings(
3131 bool BeginWrite3dmBitmapTable();
3132 bool Write3dmImageComponent(
3135 bool Write3dmImageComponent(
3138 bool Write3dmBitmap(
const class ON_Bitmap& );
3139 bool EndWrite3dmBitmapTable();
3141 bool BeginRead3dmBitmapTable();
3146 bool EndRead3dmBitmapTable();
3151 bool BeginWrite3dmTextureMappingTable();
3152 bool Write3dmTextureMappingComponent(
3155 bool Write3dmTextureMappingComponent(
3159 bool EndWrite3dmTextureMappingTable();
3161 bool BeginRead3dmTextureMappingTable();
3162 int Read3dmTextureMapping(
3165 bool EndRead3dmTextureMappingTable();
3170 bool BeginWrite3dmMaterialTable();
3171 bool Write3dmMaterialComponent(
3174 bool Write3dmMaterialComponent(
3177 bool Write3dmMaterial(
const class ON_Material& );
3178 bool EndWrite3dmMaterialTable();
3180 bool BeginRead3dmMaterialTable();
3181 int Read3dmMaterial(
3184 bool EndRead3dmMaterialTable();
3189 bool BeginWrite3dmLinetypeTable();
3190 bool Write3dmLinePatternComponent(
3193 bool Write3dmLinePatternComponent(
3196 bool Write3dmLinetype(
3199 bool EndWrite3dmLinetypeTable();
3201 bool BeginRead3dmLinetypeTable();
3202 int Read3dmLinetype(
3205 bool EndRead3dmLinetypeTable();
3210 bool BeginWrite3dmLayerTable();
3211 bool Write3dmLayerComponent(
3214 bool Write3dmLayerComponent(
3217 bool Write3dmLayer(
const ON_Layer& );
3218 bool EndWrite3dmLayerTable();
3220 bool BeginRead3dmLayerTable();
3224 bool EndRead3dmLayerTable();
3229 bool BeginWrite3dmGroupTable();
3230 bool Write3dmGroupComponent(
3233 bool Write3dmGroupComponent(
3236 bool Write3dmGroup(
const class ON_Group& );
3237 bool EndWrite3dmGroupTable();
3239 bool BeginRead3dmGroupTable();
3280 bool EndRead3dmGroupTable();
3303 bool Internal_Write3dmTextStyle(
3322 int Internal_Read3dmTextStyle(
3330 bool BeginWrite3dmDimStyleTable();
3332 bool Write3dmDimStyleComponent(
3335 bool Write3dmDimStyleComponent(
3338 bool Write3dmDimStyle(
const class ON_DimStyle& );
3340 bool EndWrite3dmDimStyleTable();
3343 bool Internal_Write3dmDimStyle(
const class ON_DimStyle&,
bool bUpdateManifest );
3346 bool BeginRead3dmDimStyleTable();
3384 int Read3dmDimStyle(
3389 int Internal_Read3dmDimStyle(
3393 void Internal_ConvertTextStylesToDimStyles();
3395 double Internal_ArchiveModelSpaceTextScale()
const;
3397 const ON_DimStyle* Internal_ArchiveCurrentDimStyle();
3400 bool EndRead3dmDimStyleTable();
3408 bool Internal_Read3dmDimStyleOverrides(
3410 bool bFromDimStyleTable
3419 bool Internal_Write3dmDimStyleOverrides(
3428 bool BeginWrite3dmLightTable();
3429 bool Write3dmModelLightComponent(
3432 bool Write3dmModelLightComponent(
3439 bool EndWrite3dmLightTable();
3441 bool BeginRead3dmLightTable();
3457 int Read3dmModelLight(
3466 bool EndRead3dmLightTable();
3472 bool BeginWrite3dmHatchPatternTable();
3473 bool Write3dmHatchPatternComponent(
3476 bool Write3dmHatchPatternComponent(
3480 bool EndWrite3dmHatchPatternTable();
3482 bool BeginRead3dmHatchPatternTable();
3484 bool EndRead3dmHatchPatternTable();
3489 bool BeginWrite3dmInstanceDefinitionTable();
3490 bool Write3dmInstanceDefinitionComponent(
3493 bool Write3dmInstanceDefinitionComponent(
3497 bool EndWrite3dmInstanceDefinitionTable();
3499 bool BeginRead3dmInstanceDefinitionTable();
3535 int Read3dmInstanceDefinition(
3539 bool EndRead3dmInstanceDefinitionTable();
3544 bool BeginWrite3dmObjectTable();
3545 bool Write3dmModelGeometryComponent(
3548 bool Write3dmModelGeometryComponent(
3551 bool Write3dmObject(
3555 bool EndWrite3dmObjectTable();
3557 bool BeginRead3dmObjectTable();
3573 int Read3dmModelGeometry(
3575 unsigned int object_filter = 0
3598 int Read3dmModelGeometryForExperts(
3599 bool bManageGeometry,
3600 bool bManageAttributes,
3602 unsigned int object_filter
3622 unsigned int object_filter = 0
3640 bool EndRead3dmObjectTable();
3645 bool BeginWrite3dmHistoryRecordTable();
3646 bool Write3dmHistoryRecordComponent(
3649 bool Write3dmHistoryRecordComponent(
3652 bool Write3dmHistoryRecord(
3655 bool EndWrite3dmHistoryRecordTable();
3657 bool BeginRead3dmHistoryRecordTable();
3665 int Read3dmHistoryRecord(
3668 bool EndRead3dmHistoryRecordTable();
3704 bool BeginWrite3dmUserTable(
3707 int goo_3dm_version,
3708 unsigned int goo_opennurbs_version
3711 bool EndWrite3dmUserTable();
3734 bool Write3dmAnonymousUserTableRecord(
3736 int goo_3dm_version,
3737 unsigned int goo_opennurbs_version,
3741 ON_DEPRECATED_MSG(
"use BeginWrite3dmUserTable(plugin_id, bSavingGoo, 3dm_version, opennurbs_version)")
3742 bool BeginWrite3dmUserTable( const ON_UUID& );
3744 ON_DEPRECATED_MSG("use Write3dmAnonymousUserTableRecord(plugin_id, ..., goo)")
3745 bool Write3dmAnonymousUserTable( const class
ON_3dmGoo& );
3764 bool BeginRead3dmUserTable(
3766 bool* bLastSavedAsGoo,
3767 int* archive_3dm_version,
3768 unsigned int* archive_opennurbs_version
3779 bool Read3dmAnonymousUserTable(
3780 int archive_3dm_version,
3781 unsigned int archive_opennurbs_version,
3785 bool EndRead3dmUserTable();
3800 bool Write3dmEndMark();
3815 bool Read3dmEndMark(
3839 bool BeginWrite3dmChunk(
3844 bool BeginWrite3dmBigChunk(
3845 ON__UINT32 typecode,
3862 bool BeginWrite3dmChunk(
3872 bool BeginWrite3dmAnonymousChunk(
3878 bool EndWrite3dmChunk();
3880 bool Write3dmGoo( const ON_3dmGoo& );
3890 bool BeginRead3dmBigChunk(
3907 bool BeginRead3dmChunk(
3908 unsigned int expected_tcode,
3921 bool BeginRead3dmAnonymousChunk(
3934 bool EndRead3dmChunk();
3935 bool EndRead3dmChunk(
bool bSupressPartiallyReadChunkWarning);
3964 bool BeginWriteDictionary(
3965 ON_UUID dictionary_id,
3966 unsigned int version,
3967 const
wchar_t* dictionary_name
3985 bool EndWriteDictionary();
4003 bool BeginWriteDictionaryEntry(
4005 const
wchar_t* entry_name
4007 bool EndWriteDictionaryEntry();
4009 bool BeginReadDictionary(
4010 ON_UUID* dictionary_id,
4011 unsigned int* version,
4012 ON_wString& dictionary_name
4014 bool EndReadDictionary();
4028 int BeginReadDictionaryEntry(
4030 ON_wString& entry_name
4032 bool EndReadDictionaryEntry();
4034 bool Read3dmGoo( ON_3dmGoo& );
4036 ON_DEPRECATED_MSG("use PeekAt3dmBigChunkType")
4037 bool PeekAt3dmChunkType(
4042 bool PeekAt3dmBigChunkType(
4043 ON__UINT32* typecode,
4044 ON__INT64* big_value
4047 bool Seek3dmChunkFromStart(
4055 bool Seek3dmChunkFromCurrentPosition(
4070 bool Write3dmChunkVersion(
4074 bool Read3dmChunkVersion(
4089 bool WriteObjectUserData( const
ON_Object&
object );
4101 bool ReadObjectUserData(
ON_Object&
object );
4121 int Archive3dmVersion() const;
4143 unsigned int ArchiveOpenNURBSVersion() const;
4156 ON::RuntimeEnvironment ArchiveRuntimeEnvironment() const;
4158 const
ON_DimStyle& ArchiveCurrentDimStyle() const;
4159 const
int ArchiveCurrentDimStyleIndex() const;
4160 const ON_UUID ArchiveCurrentDimStyleId() const;
4176 static
unsigned int ArchiveOpenNURBSVersionToWrite(
4177 unsigned int archive_3dm_version,
4178 unsigned int opennurbs_version
4197 size_t ArchiveStartOffset() const;
4226 bool FindTableInDamagedArchive(
4227 unsigned int tcode_table,
4228 unsigned int tcode_record,
4251 int recursion_depth = 0
4261 WriteFailed = 0xFFFFFFF1,
4262 SeekFailedDuringWriting = 0xFFFFFFF2,
4263 ReadFailed = 0xFFFFFFF8,
4264 SeekFailedDuringReading = 0xFFFFFFF9,
4265 UnknownDeviceError = 0xFFFFFFFFU
4269 unsigned int storage_device_error_as_unsigned
4279 unsigned int StorageDeviceError()
const;
4288 size_t Read(
size_t,
void*);
4290 virtual size_t Internal_ReadOverride(
size_t,
void* ) = 0;
4299 size_t Write(
size_t,
const void* );
4301 virtual size_t Internal_WriteOverride(
size_t,
const void* ) = 0;
4311 virtual bool Flush() = 0;
4324 int LoadUserDataApplication(
4325 ON_UUID application_id
4328 bool SetArchive3dmVersion(
int);
4342 void SetStorageDeviceError(
4345 void SetStorageDeviceError(
4346 unsigned int storage_device_error
4351 bool WriteInt8(
size_t,
const ON__INT8* );
4352 bool ReadInt8(
size_t, ON__INT8* );
4355 bool WriteInt16(
size_t,
const ON__INT16* );
4356 bool ReadInt16(
size_t, ON__INT16* );
4359 bool WriteInt32(
size_t,
const ON__INT32* );
4360 bool ReadInt32(
size_t, ON__INT32* );
4363 bool WriteInt64(
size_t,
const ON__INT64* );
4364 bool ReadInt64(
size_t, ON__INT64* );
4366 bool BeginWrite3dmTable(
4369 bool EndWrite3dmTable(
4372 bool BeginRead3dmTable(
4375 bool EndRead3dmTable(
4379 bool Read3dmV1Layer( ON_Layer*& );
4388 int Read3dmV1Object(
4398 bool Read3dmV1AttributesOrMaterial(
4403 class ON__3dmV1_XDATA* = 0
4405 bool Read3dmV1String( ON_String& );
4406 int Read3dmV1LayerIndex(
const char* )
const;
4421 void UpdateCRC(
size_t,
const void* );
4424 int m_3dm_version = 0;
4427 int m_3dm_v1_layer_index = 0;
4428 int m_3dm_v1_material_index = 0;
4434 unsigned int ErrorMessageMask()
const;
4446 bool MaskReadError( ON__UINT64 sizeof_request, ON__UINT64 sizeof_read )
const;
4461 friend void ON_SetBinaryArchiveOpenNURBSVersion(
ON_BinaryArchive&,
unsigned int);
4462 unsigned int m_3dm_opennurbs_version = 0;
4464 ON::RuntimeEnvironment m_archive_runtime_environment = ON::RuntimeEnvironment::Unset;
4470 size_t m_3dm_start_section_offset = 0;
4476 ON_3dmArchiveTableType m_3dm_previous_table = ON_3dmArchiveTableType::Unset;
4477 ON_3dmArchiveTableType m_3dm_active_table = ON_3dmArchiveTableType::Unset;
4479 ON_3dmArchiveTableType m_3dm_first_failed_table = ON_3dmArchiveTableType::Unset;
4481 int m_user_data_depth = 0;
4484 class ON_3dmTableStatusLink* m_3dm_table_status_list =
nullptr;
4487 bool Internal_Write3dmUpdateManifest(
4490 bool Internal_Write3dmLightOrGeometryUpdateManifest(
4492 ON_UUID component_id,
4493 int component_index,
4494 const ON_wString & component_name
4496 bool Internal_Read3dmUpdateManifest(
4499 bool Internal_Read3dmLightOrGeometryUpdateManifest(
4501 ON_UUID component_id,
4502 int component_index,
4503 const ON_wString & component_name
4507 bool Internal_IncrementCurrentPosition(
4510 bool Internal_DecrementCurrentPosition(
4513 ON__UINT64 m_current_positionX = 0;
4519 void Internal_ReportCRCError();
4521 unsigned int m_crc_error_count = 0;
4527 void Internal_ReportCriticalError();
4532 unsigned int m_critical_error_count = 0;
4537 unsigned int m_storage_device_error = 0;
4561 unsigned int m_error_message_mask = 0;
4565 ON__UINT64 m_3dm_end_mark_length = 0;
4568 ON::archive_mode expected_mode,
4569 ON_3dmArchiveTableType table
4572 ON_3dmArchiveTableType table,
4575 void Internal_Increment3dmTableItemCount();
4576 bool Read3dmTableRecord(
4577 ON_3dmArchiveTableType table,
4580 bool Internal_Begin3dmTableRecord(
4581 ON_3dmArchiveTableType table
4589 ON::archive_mode Mode()
const;
4595 bool ReadMode()
const;
4601 bool WriteMode()
const;
4607 bool UnsetMode()
const;
4621 ON_3dmArchiveTableType Active3dmTable()
const;
4624 ON_3dmArchiveTableType table_type
4635 ON_3dmArchiveTableType Previous3dmTable()
const;
4643 ON_3dmArchiveTableType FirstFailed3dmTable()
const;
4649 unsigned int BadCRCCount()
const;
4655 unsigned int CriticalErrorCount()
const;
4658 ON_3dmArchiveTableType table_type
4663 ON_3dmArchiveTableType TableTypeFromTypecode(
unsigned int );
4668 bool PushBigChunk( ON__UINT32 typecode, ON__INT64 value );
4670 bool WriteChunkTypecode( ON__UINT32 );
4671 bool ReadChunkTypecode( ON__UINT32* );
4672 bool WriteChunkValue( ON__UINT32 typecode, ON__INT64 );
4673 bool WriteChunkLength( ON__UINT64 );
4674 bool ReadChunkValue( ON__UINT32 typecode, ON__INT64* value64 );
4675 bool FindMisplacedTable(
4676 ON__UINT64 filelength,
4677 const ON__UINT32 table_tocde,
4678 const ON__UINT32 table_record_record,
4679 const ON_UUID class_uuid,
4680 const ON__UINT64 min_length_data
4683 bool ReadObjectUserDataAnonymousChunk(
4684 const ON__UINT64 length_TCODE_ANONYMOUS_CHUNK,
4685 const int archive_3dm_version,
4686 const unsigned int archive_opennurbs_version,
4690 size_t SizeofChunkLength()
const;
4693 bool WriteEOFSizeOfFile( ON__UINT64 );
4694 bool ReadEOFSizeOfFile( ON__UINT64* );
4696 bool m_bDoChunkCRC =
false;
4698 bool m_bChunkBoundaryCheck =
false;
4707 bool ChunkBoundaryCheck()
const;
4716 void SetChunkBoundaryCheck(
4717 bool bChunkBoundaryCheck
4722 class ON_CompressorImplementation* m_compressor =
nullptr;
4723 class ON_CompressorImplementation& Compressor();
4726 size_t WriteDeflate(
4734 bool CompressionInit();
4735 void CompressionEnd();
4740 const ON::endian m_endian = ON::Endian();
4742 const ON::archive_mode m_mode = ON::archive_mode::unset_archive_mode;
4758 void SortUserDataFilter();
4766 ON__UINT32 m_save_3dm_render_mesh_flags = 0xFFFFFFFFU;
4767 ON__UINT32 m_save_3dm_analysis_mesh_flags = 0xFFFFFFFFU;
4769 bool m_bSave3dmPreviewImage =
true;
4771 bool m_bUseBufferCompression =
true;
4773 bool m_bReservedA =
false;
4774 bool m_bReservedB =
false;
4775 bool m_bReservedC =
false;
4776 bool m_bReservedD =
false;
4777 bool m_bReservedE =
false;
4778 bool m_bReservedF =
false;
4786 void SetModelSerialNumber(
4787 unsigned int model_serial_number,
4788 unsigned int reference_model_serial_number,
4789 unsigned int instance_definition_model_serial_number
4796 void ClearModelSerialNumber();
4797 unsigned int ModelSerialNumber()
const;
4798 unsigned int ReferenceModelSerialNumber()
const;
4799 unsigned int InstanceDefinitionModelSerialNumber()
const;
4812 bool WriteModelComponentAttributes(
4814 unsigned int attributes_filter
4832 bool ReadModelComponentAttributes(
4834 unsigned int* attributes_filter
4848 bool Write3dmReferencedComponentIndex(
4850 int model_component_index
4864 bool Write3dmReferencedComponentIndex(
4866 ON_UUID model_component_id
4880 bool Write3dmReferencedComponentIndex(
4898 bool Read3dmReferencedComponentIndex(
4900 int* component_index
4903 bool Read3dmReferencedComponentIndexArray(
4917 bool ReferencedComponentIndexMapping()
const;
4933 void SetReferencedComponentIndexMapping(
4934 bool bEnableReferenceComponentIndexMapping
4949 bool Write3dmReferencedComponentId(
4951 ON_UUID model_component_id
4954 bool Write3dmReferencedComponentId(
4979 bool Read3dmReferencedComponentId(
4981 ON_UUID* component_id
4993 bool ReferencedComponentIdMapping()
const;
5009 void SetReferencedComponentIdMapping(
5010 bool bEnableReferenceComponentIdMapping
5036 bool AddManifestMapItem(
5051 bool UpdateManifestMapItemDestination(
5077 bool m_bReferencedComponentIndexMapping =
true;
5085 bool m_bReferencedComponentIdMapping =
true;
5090 ON_wString m_archive_file_name;
5091 ON_wString m_archive_directory_name;
5092 ON_wString m_archive_full_path;
5100 ON_wString m_archive_saved_as_full_path;
5108 bool m_b3dmArchiveMoved =
false;
5111 const ON_wString& ArchiveFileName()
const;
5112 const ON_wString& ArchiveDirectoryName()
const;
5113 const ON_wString& ArchiveFullPath()
const;
5114 const ON_wString& ArchiveSavedAsFullPath()
const;
5116 const wchar_t* ArchiveFileNameAsPointer()
const;
5117 const wchar_t* ArchiveDirectoryNameAsPointer()
const;
5118 const wchar_t* ArchiveFullPathAsPointer()
const;
5119 const wchar_t* ArchiveSavedAsFullPathPointer()
const;
5126 bool ArchiveFileMoved()
const;
5133 void SetArchiveFullPath(
5134 const wchar_t* archive_full_path
5144 void SetArchiveFullPath(
5145 const wchar_t* archive_directory_name,
5146 const wchar_t* archive_file_name
5150 bool m_SetModelComponentSerialNumbers =
false;
5151 unsigned int m_model_serial_number = 0;
5152 unsigned int m_reference_model_serial_number = 0;
5153 unsigned int m_instance_definition_model_serial_number = 0;
5154 unsigned int m_reserved1 = 0;
5155 ON__UINT_PTR m_reserved2 = 0;
5163 struct ON__3dmV1LayerIndex* m_V1_layer_list =
nullptr;
5171 #pragma ON_PRAGMA_WARNING_PUSH 5172 #pragma ON_PRAGMA_WARNING_DISABLE_MSC( 4251 ) 5191 bool m_bLegacyOverrideDimStylesInArchive =
false;
5193 const ON_DimStyle* m_archive_current_dim_style =
nullptr;
5208 unsigned int m_archive_dim_style_table_status = 0;
5212 unsigned int m_archive_dim_style_table_read_index = ON_UNSET_UINT_INDEX;
5214 #pragma ON_PRAGMA_WARNING_POP 5224 const ON_TextStyle* ArchiveTextStyleFromArchiveTextStyleIndex(
5225 int archive_text_style_index
5251 unsigned int m_typecode;
5253 unsigned char* m_goo;
5263 ON::archive_mode archive_mode
5278 ON::archive_mode archive_mode,
5291 ON::archive_mode archive_mode,
5292 const wchar_t* file_system_path
5304 ON::archive_mode archive_mode,
5305 const char* file_system_path
5312 ON__UINT64 Internal_CurrentPositionOverride()
const override;
5313 bool Internal_SeekFromCurrentPositionOverride(
int byte_offset)
override;
5314 bool Internal_SeekToStartOverride()
override;
5318 bool AtEnd()
const override;
5322 size_t Internal_ReadOverride(
size_t,
void* )
override;
5323 size_t Internal_WriteOverride(
size_t,
const void* )
override;
5324 bool Flush()
override;
5339 void EnableMemoryBuffer(
5347 bool FileIsOpen()
const;
5353 FILE* m_fp =
nullptr;
5354 bool m_bCloseFileInDestructor =
false;
5362 size_t m_memory_buffer_capacity = 0;
5363 size_t m_memory_buffer_size = 0;
5364 size_t m_memory_buffer_ptr = 0;
5365 unsigned char* m_memory_buffer =
nullptr;
5412 ON__UINT64 Internal_CurrentPositionOverride()
const override;
5413 bool Internal_SeekFromCurrentPositionOverride(
int byte_offset)
override;
5414 bool Internal_SeekToStartOverride()
override;
5418 bool AtEnd()
const override;
5422 size_t Internal_ReadOverride(
size_t,
void* )
override;
5423 size_t Internal_WriteOverride(
size_t,
const void* )
override;
5424 bool Flush()
override;
5461 size_t sizeof_buffer,
5464 int archive_3dm_version,
5465 unsigned int archive_opennurbs_version
5474 size_t SizeOfBuffer()
const;
5480 const void* Buffer()
const;
5484 ON__UINT64 Internal_CurrentPositionOverride()
const override;
5485 bool Internal_SeekFromCurrentPositionOverride(
int byte_offset)
override;
5486 bool Internal_SeekToStartOverride()
override;
5490 bool AtEnd()
const override;
5494 size_t Internal_ReadOverride(
size_t,
void* )
override;
5495 size_t Internal_WriteOverride(
size_t,
const void* )
override;
5496 bool Flush()
override;
5500 const unsigned char* m_buffer;
5501 size_t m_sizeof_buffer;
5502 size_t m_buffer_position;
5503 ON__INT_PTR m_reserved1;
5504 ON__INT_PTR m_reserved2;
5505 ON__INT_PTR m_reserved3;
5506 ON__INT_PTR m_reserved4;
5537 size_t initial_sizeof_buffer,
5538 size_t max_sizeof_buffer,
5539 int archive_3dm_version,
5540 unsigned int archive_opennurbs_version
5549 size_t SizeOfArchive()
const;
5555 size_t SizeOfBuffer()
const;
5566 const void* Buffer()
const;
5575 void* HarvestBuffer();
5579 ON__UINT64 Internal_CurrentPositionOverride()
const override;
5580 bool Internal_SeekFromCurrentPositionOverride(
int byte_offset)
override;
5581 bool Internal_SeekToStartOverride()
override;
5585 bool AtEnd()
const override;
5589 size_t Internal_ReadOverride(
size_t,
void* )
override;
5590 size_t Internal_WriteOverride(
size_t,
const void* )
override;
5591 bool Flush()
override;
5594 void AllocBuffer(
size_t);
5596 unsigned char* m_buffer;
5597 size_t m_sizeof_buffer;
5598 const size_t m_max_sizeof_buffer;
5599 size_t m_sizeof_archive;
5600 size_t m_buffer_position;
5601 ON__INT_PTR m_reserved1;
5602 ON__INT_PTR m_reserved2;
5603 ON__INT_PTR m_reserved3;
5604 ON__INT_PTR m_reserved4;
5647 bool ON_WriteOneObjectArchive(
5654 bool ON_WriteOneObjectArchive(
5655 const wchar_t* filename,
5660 bool ON_WriteMultipleObjectArchive(
5667 bool ON_WriteMultipleObjectArchive(
5670 size_t object_list_count,
5674 bool ON_WriteMultipleObjectArchive(
5675 const wchar_t* filename,
5677 size_t object_list_count,
5709 const ON_wString& FilePath()
const;
5712 unsigned int Number()
const;
5716 FILE* m_fp =
nullptr;
5717 unsigned int m_N = 0;
5718 ON_wString m_file_path;
Definition: opennurbs_annotationbase.h:23
Definition: opennurbs_plane.h:507
Definition: opennurbs_fpoint.h:556
Definition: opennurbs_material.h:25
Definition: opennurbs_fpoint.h:832
Definition: opennurbs_hatch.h:327
ON_UUID is a 16 byte universally unique identifier.
Definition: opennurbs_uuid.h:32
Definition: opennurbs_point.h:1933
Definition: opennurbs_object_history.h:71
An ON_Arc is a subcurve of 3d circle.
Definition: opennurbs_arc.h:33
The ON_ModelComponent class is a base class for all components in a model and manages the index...
Definition: opennurbs_model_component.h:24
Definition: opennurbs_3dm_properties.h:139
ON_ManifestIdentificationMap is used to record a map from a source manifest to a destination manifest...
Definition: opennurbs_archive.h:1464
Definition: opennurbs_mapchan.h:167
TableState
Definition: opennurbs_archive.h:1771
Objects can have per viewport display properties that override a viewport's default display propertie...
Definition: opennurbs_linestyle.h:45
Definition: opennurbs_array.h:36
static const ON_NameHash UnsetNameHash
Definition: opennurbs_string.h:3444
Definition: opennurbs_3dm_settings.h:1184
An ON_InstanceDefinition defines the geometry used by instance references.
Definition: opennurbs_instance.h:139
Definition: opennurbs_fpoint.h:211
Definition: opennurbs_light.h:20
Definition: opennurbs_group.h:20
ON_Object array is used to store lists of classes that are derived from ON_Object. It differs from ON_ClassArray in that the virtual ON_Object::MemoryRelocate function is called when growing the dynamic array requires changing the location of the memory buffer used to store the elements in the array.
Definition: opennurbs_array.h:725
Definition: opennurbs_string.h:2020
Definition: opennurbs_dimensionstyle.h:218
Definition: opennurbs_archive.h:337
ON_Circle is a circle in 3d. The cirle is represented by a radius and an orthonormal frame of the pla...
Definition: opennurbs_circle.h:32
Context for an annotation object. This context is required when converting current annotation objects...
Definition: opennurbs_archive.h:1592
Definition: opennurbs_color.h:24
ON_3dmObjectAttributes uses ON_MappingChannel to record which texture mapping function to use when ap...
Definition: opennurbs_mapchan.h:36
Definition: opennurbs_point.h:277
Definition: opennurbs_objref.h:100
Definition: opennurbs_archive.h:27
Definition: opennurbs_layer.h:20
class ON_LinetypeSegment
Definition: opennurbs_linestyle.h:88
Definition: opennurbs_archive.h:5060
Definition: opennurbs_3dm_settings.h:110
static const ON_String EmptyString
Definition: opennurbs_string.h:862
Definition: opennurbs_point.h:648
Definition: opennurbs_bounding_box.h:25
Definition: opennurbs_archive.h:5251
Definition: opennurbs_string.h:852
Definition: opennurbs_archive.h:1044
Definition: opennurbs_archive.h:5079
Definition: opennurbs_bitmap.h:28
Definition: opennurbs_archive.h:1739
Type
The ON_ModelComponent::Type enum has a value for each explicit component type and two special values...
Definition: opennurbs_model_component.h:52
Definition: opennurbs_archive.h:434
Definition: opennurbs_archive.h:5321
Definition: opennurbs_archive.h:5497
Definition: opennurbs_archive.h:478
ON_3dmObjectAttributes uses ON_MaterialRef to record which rendering material and mappings a renderin...
Definition: opennurbs_mapchan.h:89
Definition: opennurbs_texture_mapping.h:37
Definition: opennurbs_line.h:20
Definition: opennurbs_text_style.h:19
Definition: opennurbs_archive.h:5187
eStorageDeviceError
Definition: opennurbs_archive.h:4097
Top level OpenNURBS objects have geometry and attributes. The geometry is stored in some class derive...
Definition: opennurbs_3dm_attributes.h:41
Used to store geometry table object definition and attributes in an ONX_Model.
Definition: opennurbs_model_geometry.h:22
Pure virtual base class for all classes that must provide runtime class id or support object level 3D...
Definition: opennurbs_object.h:460
An ON_NameHash is designed to help search for and compare attribute names like the ON_ModelComponent...
Definition: opennurbs_string.h:3434
class ON_Linetype
Definition: opennurbs_linetype.h:42
Definition: opennurbs_array.h:409
Definition: opennurbs_textlog.h:20
Definition: opennurbs_archive.h:1783
Definition: opennurbs_userdata.h:20
Definition: opennurbs_fpoint.h:38
Definition: opennurbs_model_component.h:1622
Definition: opennurbs_objref.h:163
Definition: opennurbs_point.h:460
Definition: opennurbs_archive.h:352
Definition: opennurbs_archive.h:1212
Definition: opennurbs_plane.h:20
Definition: opennurbs_fpoint.h:385
Typically the vector portion is a unit vector and m_d = -(x*P.x + y*P.y + z*P.z) for a point P on the...
Definition: opennurbs_point.h:1433
Definition: opennurbs_point.h:839
Definition: opennurbs_point.h:1152
Definition: opennurbs_point.h:46