forked from mcneel/opennurbs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
opennurbs_3dm_properties.h
186 lines (146 loc) · 4.77 KB
/
opennurbs_3dm_properties.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
/* $NoKeywords: $ */
/*
//
// Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
// OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
// McNeel & Associates.
//
// THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
// ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
// MERCHANTABILITY ARE HEREBY DISCLAIMED.
//
// For complete openNURBS copyright information see <http://www.opennurbs.org>.
//
////////////////////////////////////////////////////////////////
*/
#if !defined(OPENNURBS_3DM_PROPERTIES_INC_)
#define OPENNURBS_3DM_PROPERTIES_INC_
//////////////////////////////////////////////////////////////////////////////////////////
class ON_CLASS ON_3dmRevisionHistory
{
public:
/*
Default construction sets this = ON_3dmRevisionHistory::Empty
*/
ON_3dmRevisionHistory();
~ON_3dmRevisionHistory() = default;
ON_3dmRevisionHistory(const ON_3dmRevisionHistory&) = default;
ON_3dmRevisionHistory& operator=(const ON_3dmRevisionHistory&) = default;
/*
Description:
The Empty revision has a revision number zero,
all time values set to zero and all string
values empty.
*/
static const ON_3dmRevisionHistory Empty;
/*
Returns:
A revision history with
m_revision_count = 1
m_create_time = now
m_last_edit_time = now
m_sCreatedBy = current user
m_sLastEditedBy = current user
*/
static ON_3dmRevisionHistory FirstRevision();
int NewRevision(); // returns updated revision count
bool IsValid() const;
bool IsEmpty() const;
bool Read( ON_BinaryArchive& );
bool Write( ON_BinaryArchive& ) const;
void Dump( ON_TextLog& ) const;
/*
Returns:
true
if m_create_time is >= January 1, 1970
*/
bool CreateTimeIsSet() const;
/*
Returns:
true
if m_last_edit_time is >= January 1, 1970
*/
bool LastEditedTimeIsSet() const;
ON_wString m_sCreatedBy;
ON_wString m_sLastEditedBy;
struct tm m_create_time; // UCT create time
struct tm m_last_edit_time; // UCT las edited time
int m_revision_count = 0;
};
//////////////////////////////////////////////////////////////////////////////////////////
class ON_CLASS ON_3dmNotes
{
public:
ON_3dmNotes();
~ON_3dmNotes();
static const ON_3dmNotes Empty;
bool IsValid() const;
bool IsEmpty() const;
bool Read( ON_BinaryArchive& );
bool Write( ON_BinaryArchive& ) const;
void Dump(ON_TextLog&) const;
////////////////////////////////////////////////////////////////
//
// Interface - this information is serialized. Applications
// may want to derive a runtime class that has additional
// window and font information.
ON_wString m_notes;
bool m_bVisible; // true if notes window is showing
bool m_bHTML; // true if notes are in HTML
// last window position
int m_window_left;
int m_window_top;
int m_window_right;
int m_window_bottom;
};
//////////////////////////////////////////////////////////////////////////////////////////
class ON_CLASS ON_3dmApplication
{
// application that created the 3dm file
public:
ON_3dmApplication();
~ON_3dmApplication();
static const ON_3dmApplication Empty;
bool IsValid() const;
bool IsEmpty() const;
bool Read( ON_BinaryArchive& );
bool Write( ON_BinaryArchive& ) const;
void Dump( ON_TextLog& ) const;
ON_wString m_application_name; // short name like "Rhino 2.0"
ON_wString m_application_URL; // URL
ON_wString m_application_details; // whatever you want
};
//////////////////////////////////////////////////////////////////////////////////////////
class ON_CLASS ON_3dmProperties
{
public:
ON_3dmProperties() = default;
~ON_3dmProperties() = default;;
ON_3dmProperties(const ON_3dmProperties&) = default;
ON_3dmProperties& operator=(const ON_3dmProperties&) = default;
static const ON_3dmProperties Empty;
bool IsEmpty() const;
bool Read(
ON_BinaryArchive& archive
);
/*
Remarks:
If archive.ArchiveFileName() is not empty, that value is
written in place of m_3dmArchiveFullPathName in the 3dm archive.
If archive.ArchiveFileName() is empty, then m_3dmArchiveFullPathName
is written in the 3dm archive.
*/
bool Write(
ON_BinaryArchive& archive
) const;
void Dump( ON_TextLog& ) const;
ON_3dmRevisionHistory m_RevisionHistory;
ON_3dmNotes m_Notes;
ON_WindowsBitmap m_PreviewImage; // preview image of model
ON_3dmApplication m_Application; // application that created 3DM file
// name of .3dm archive when it was written. Used to find referenced files
// when the archive is moved or copied and then read.
ON_wString m_3dmArchiveFullPathName;
};
//////////////////////////////////////////////////////////////////////////////////////////
#endif