scriptup 2024.0.5 → 2024.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/attribute_dictionaries.c +1 -1
- data/ext/color.c +3 -3
- data/ext/component_definition.c +2 -2
- data/ext/definition_list.c +1 -1
- data/ext/entity.c +4 -3
- data/ext/material.c +4 -7
- data/ext/utils.h +4 -4
- data/sketchup-sdk-win/binaries/layout/x64/LayOutAPI.dll +0 -0
- data/sketchup-sdk-win/binaries/layout/x64/LayOutAPI.lib +0 -0
- data/sketchup-sdk-win/binaries/layout/x64/LayOutControllers.dll +0 -0
- data/sketchup-sdk-win/binaries/layout/x64/LayOutModel.dll +0 -0
- data/sketchup-sdk-win/binaries/layout/x64/LayOutRTF.dll +0 -0
- data/sketchup-sdk-win/binaries/layout/x64/LayOutUtils.dll +0 -0
- data/sketchup-sdk-win/binaries/layout/x64/SketchUpCommonPreferences.dll +0 -0
- data/sketchup-sdk-win/binaries/layout/x64/SketchUpViewerAPI.dll +0 -0
- data/sketchup-sdk-win/binaries/layout/x64/SketchUpViewerAPI.lib +0 -0
- data/sketchup-sdk-win/binaries/layout/x64/pdflib.dll +0 -0
- data/sketchup-sdk-win/headers/LayOutAPI/application/application.h +117 -0
- data/sketchup-sdk-win/headers/LayOutAPI/common.h +22 -0
- data/sketchup-sdk-win/headers/LayOutAPI/geometry/geometry.h +78 -0
- data/sketchup-sdk-win/headers/LayOutAPI/initialize.h +36 -0
- data/sketchup-sdk-win/headers/LayOutAPI/layout.h +49 -0
- data/sketchup-sdk-win/headers/LayOutAPI/model/angulardimension.h +468 -0
- data/sketchup-sdk-win/headers/LayOutAPI/model/autotextdefinition.h +569 -0
- data/sketchup-sdk-win/headers/LayOutAPI/model/autotextdefinitionlist.h +79 -0
- data/sketchup-sdk-win/headers/LayOutAPI/model/connectionpoint.h +107 -0
- data/sketchup-sdk-win/headers/LayOutAPI/model/defs.h +42 -0
- data/sketchup-sdk-win/headers/LayOutAPI/model/dictionary.h +120 -0
- data/sketchup-sdk-win/headers/LayOutAPI/model/document.h +864 -0
- data/sketchup-sdk-win/headers/LayOutAPI/model/documentexportoptions.h +59 -0
- data/sketchup-sdk-win/headers/LayOutAPI/model/ellipse.h +78 -0
- data/sketchup-sdk-win/headers/LayOutAPI/model/entity.h +330 -0
- data/sketchup-sdk-win/headers/LayOutAPI/model/entityiterator.h +49 -0
- data/sketchup-sdk-win/headers/LayOutAPI/model/entitylist.h +114 -0
- data/sketchup-sdk-win/headers/LayOutAPI/model/formattedtext.h +397 -0
- data/sketchup-sdk-win/headers/LayOutAPI/model/grid.h +251 -0
- data/sketchup-sdk-win/headers/LayOutAPI/model/group.h +243 -0
- data/sketchup-sdk-win/headers/LayOutAPI/model/image.h +146 -0
- data/sketchup-sdk-win/headers/LayOutAPI/model/imagerep.h +109 -0
- data/sketchup-sdk-win/headers/LayOutAPI/model/label.h +332 -0
- data/sketchup-sdk-win/headers/LayOutAPI/model/layer.h +207 -0
- data/sketchup-sdk-win/headers/LayOutAPI/model/layerinstance.h +117 -0
- data/sketchup-sdk-win/headers/LayOutAPI/model/layerlist.h +69 -0
- data/sketchup-sdk-win/headers/LayOutAPI/model/lineardimension.h +456 -0
- data/sketchup-sdk-win/headers/LayOutAPI/model/page.h +261 -0
- data/sketchup-sdk-win/headers/LayOutAPI/model/pageinfo.h +372 -0
- data/sketchup-sdk-win/headers/LayOutAPI/model/pagelist.h +81 -0
- data/sketchup-sdk-win/headers/LayOutAPI/model/path.h +464 -0
- data/sketchup-sdk-win/headers/LayOutAPI/model/rectangle.h +240 -0
- data/sketchup-sdk-win/headers/LayOutAPI/model/referenceentity.h +120 -0
- data/sketchup-sdk-win/headers/LayOutAPI/model/sketchupmodel.h +624 -0
- data/sketchup-sdk-win/headers/LayOutAPI/model/skpfilereference.h +94 -0
- data/sketchup-sdk-win/headers/LayOutAPI/model/style.h +1080 -0
- data/sketchup-sdk-win/headers/LayOutAPI/model/table.h +470 -0
- data/sketchup-sdk-win/headers/LayOutAPI/model/typed_value.h +156 -0
- metadata +50 -2
@@ -0,0 +1,332 @@
|
|
1
|
+
// Copyright 2015 Trimble Navigation Ltd. All rights reserved.
|
2
|
+
// This file is intended for public distribution.
|
3
|
+
|
4
|
+
#ifndef LAYOUT_MODEL_LABEL_H_
|
5
|
+
#define LAYOUT_MODEL_LABEL_H_
|
6
|
+
|
7
|
+
#include <LayOutAPI/common.h>
|
8
|
+
#include <LayOutAPI/geometry/geometry.h>
|
9
|
+
#include <LayOutAPI/model/defs.h>
|
10
|
+
#include <LayOutAPI/model/formattedtext.h>
|
11
|
+
|
12
|
+
/**
|
13
|
+
@struct LOLabelRef
|
14
|
+
@brief References a label entity. A label consists of the label text (formatted
|
15
|
+
text entity) and the label leader (path entity). A label may be
|
16
|
+
connected to another entity via a \ref LOConnectionPointRef object.
|
17
|
+
*/
|
18
|
+
|
19
|
+
#ifdef __cplusplus
|
20
|
+
extern "C" {
|
21
|
+
#endif // __cplusplus
|
22
|
+
|
23
|
+
/**
|
24
|
+
@enum LOLabelLeaderLineType
|
25
|
+
@brief Defines the different types of leader lines for a label entity.
|
26
|
+
*/
|
27
|
+
typedef enum {
|
28
|
+
LOLabelLeaderLineType_SingleSegment = 0, ///< Single segment leader line.
|
29
|
+
LOLabelLeaderLineType_TwoSegment, ///< Two segment leader line.
|
30
|
+
LOLabelLeaderLineType_Bezier, ///< Curved Bezier leader line.
|
31
|
+
LOLabelLeaderLineType_Unknown, ///< Custom leader line.
|
32
|
+
LONumLabelLeaderLineTypes
|
33
|
+
} LOLabelLeaderLineType;
|
34
|
+
|
35
|
+
/**
|
36
|
+
@enum LOLabelTextConnectionType
|
37
|
+
@brief Defines the different types of label text connections for a label entity.
|
38
|
+
*/
|
39
|
+
typedef enum {
|
40
|
+
LOLabelTextConnectionType_NoConnection = 0, ///< Label text behaves disconnected.
|
41
|
+
LOLabelTextConnectionType_Automatic, ///< Automatically choses one of the other types based on
|
42
|
+
///< current label geometry.
|
43
|
+
LOLabelTextConnectionType_ReverseAutomatic, ///< Automatically choose the OPPOSITE of the type
|
44
|
+
///< indicated by
|
45
|
+
///< LOLabelTextConnectionType_Automatic.
|
46
|
+
LOLabelTextConnectionType_TopLeft, ///< Top-left corner of text.
|
47
|
+
LOLabelTextConnectionType_CenterLeft, ///< Vertical center of left side of text.
|
48
|
+
LOLabelTextConnectionType_BottomLeft, ///< Bottom-left corner of text.
|
49
|
+
LOLabelTextConnectionType_TopRight, ///< Top-right corner of text.
|
50
|
+
LOLabelTextConnectionType_CenterRight, ///< Vertical center of right side of text.
|
51
|
+
LOLabelTextConnectionType_BottomRight, ///< Bottom-right corner of text.
|
52
|
+
LONumLabelTextConnectionTypes
|
53
|
+
} LOLabelTextConnectionType;
|
54
|
+
|
55
|
+
/**
|
56
|
+
@brief Creates a new disconnected label object whose text is unbounded.
|
57
|
+
@param[out] label The label object.
|
58
|
+
@param[in] anchor_point The anchor point for the label text's position.
|
59
|
+
@param[in] anchor_type Defines which point of the label text is set by
|
60
|
+
anchor_point.
|
61
|
+
@param[in] plain_text The plain text to use for the label text.
|
62
|
+
@param[in] leader_line_type The type of leader line this label will have.
|
63
|
+
@param[in] target_point Where the label leader should point to.
|
64
|
+
@return
|
65
|
+
- \ref SU_ERROR_NONE on success
|
66
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if label is NULL
|
67
|
+
- \ref SU_ERROR_OVERWRITE_VALID if *label already refers to a valid object
|
68
|
+
- \ref SU_ERROR_NULL_POINTER_INPUT if anchor_point is NULL
|
69
|
+
- \ref SU_ERROR_NULL_POINTER_INPUT if plain_text is NULL
|
70
|
+
- \ref SU_ERROR_NULL_POINTER_INPUT if target_point is NULL
|
71
|
+
- \ref SU_ERROR_OUT_OF_RANGE if anchor_type is not a valid value
|
72
|
+
- \ref SU_ERROR_OUT_OF_RANGE if leader_line_type is not a valid value
|
73
|
+
- \ref SU_ERROR_GENERIC if plain_text is an empty string
|
74
|
+
*/
|
75
|
+
LO_RESULT LOLabelCreateAtPoint(
|
76
|
+
LOLabelRef* label, const LOPoint2D* anchor_point, LOFormattedTextAnchorType anchor_type,
|
77
|
+
const char* plain_text, LOLabelLeaderLineType leader_line_type, const LOPoint2D* target_point);
|
78
|
+
|
79
|
+
/**
|
80
|
+
@brief Creates a new disconnected label object whose text is bounded.
|
81
|
+
@param[out] label The label object.
|
82
|
+
@param[in] bounds The label text bounds.
|
83
|
+
@param[in] plain_text The plain text to use as the label text.
|
84
|
+
@param[in] leader_line_type The type of leader line this label will have.
|
85
|
+
@param[in] target_point Where the label leader should point to.
|
86
|
+
@return
|
87
|
+
- \ref SU_ERROR_NONE on success
|
88
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if label is NULL
|
89
|
+
- \ref SU_ERROR_OVERWRITE_VALID if *label already refers to a valid object
|
90
|
+
- \ref SU_ERROR_NULL_POINTER_INPUT if bounds is NULL
|
91
|
+
- \ref SU_ERROR_NULL_POINTER_INPUT if plain_text is NULL
|
92
|
+
- \ref SU_ERROR_NULL_POINTER_INPUT if target_point is NULL
|
93
|
+
- \ref SU_ERROR_GENERIC if plain_text is an empty string
|
94
|
+
- \ref SU_ERROR_OUT_OF_RANGE if bounds is zero sized
|
95
|
+
- \ref SU_ERROR_OUT_OF_RANGE if leader_line_type is not a valid value
|
96
|
+
*/
|
97
|
+
LO_RESULT LOLabelCreateWithBounds(
|
98
|
+
LOLabelRef* label, const LOAxisAlignedRect2D* bounds, const char* plain_text,
|
99
|
+
LOLabelLeaderLineType leader_line_type, const LOPoint2D* target_point);
|
100
|
+
|
101
|
+
/**
|
102
|
+
@brief Adds a reference to a label object.
|
103
|
+
@param[in] label The label object.
|
104
|
+
@return
|
105
|
+
- \ref SU_ERROR_NONE on success
|
106
|
+
- \ref SU_ERROR_INVALID_INPUT if label does not refer to a valid object
|
107
|
+
*/
|
108
|
+
LO_RESULT LOLabelAddReference(LOLabelRef label);
|
109
|
+
|
110
|
+
/**
|
111
|
+
@brief Releases a label object. The object will be invalidated if
|
112
|
+
releasing the last reference.
|
113
|
+
@param[in] label The label object.
|
114
|
+
@return
|
115
|
+
- \ref SU_ERROR_NONE on success
|
116
|
+
- \ref SU_ERROR_NULL_POINTER_INPUT if label is NULL
|
117
|
+
- \ref SU_ERROR_INVALID_INPUT if *label does not refer to a valid object
|
118
|
+
*/
|
119
|
+
LO_RESULT LOLabelRelease(LOLabelRef* label);
|
120
|
+
|
121
|
+
/**
|
122
|
+
@brief Converts from a \ref LOEntityRef to a \ref LOLabelRef.
|
123
|
+
This is essentially a downcast operation so the given \ref LOEntityRef
|
124
|
+
must be convertible to a \ref LOLabelRef.
|
125
|
+
@param[in] entity The entity object.
|
126
|
+
@return
|
127
|
+
- The converted \ref LOLabelRef if the downcast operation succeeds
|
128
|
+
- If not, the returned reference will be invalid
|
129
|
+
*/
|
130
|
+
LO_EXPORT LOLabelRef LOLabelFromEntity(LOEntityRef entity);
|
131
|
+
|
132
|
+
/**
|
133
|
+
@brief Converts from a \ref LOLabelRef to a \ref LOEntityRef.
|
134
|
+
This is essentially an upcast operation.
|
135
|
+
@param[in] label The label object.
|
136
|
+
@return
|
137
|
+
- The converted \ref LOEntityRef if label is a valid object
|
138
|
+
- If not, the returned reference will be invalid
|
139
|
+
*/
|
140
|
+
LO_EXPORT LOEntityRef LOLabelToEntity(LOLabelRef label);
|
141
|
+
|
142
|
+
/**
|
143
|
+
@brief Creates the entities that represent the label in its exploded form and
|
144
|
+
adds them to a \ref LOEntityListRef. It is NOT necessary to explicitly
|
145
|
+
release these entities, since \ref LOEntityListRef itself adds a
|
146
|
+
reference to the entities and will release them when they are removed
|
147
|
+
from the list or when the list is released.
|
148
|
+
@param[in] label The label object.
|
149
|
+
@param[in] entity_list The entity list object to add the new entities to.
|
150
|
+
@param[in] page_for_autotext The page that is currently being imported, exported,
|
151
|
+
or displayed. This must be a valid object if
|
152
|
+
auto-text tags should be substituted with their
|
153
|
+
display representations in the text that is
|
154
|
+
returned. Otherwise, this object may be invalid.
|
155
|
+
@return
|
156
|
+
- \ref SU_ERROR_NONE on success
|
157
|
+
- \ref SU_ERROR_INVALID_INPUT if label does not refer to a valid object
|
158
|
+
- \ref SU_ERROR_INVALID_INPUT if entity_list does not refer to a valid object
|
159
|
+
- \ref SU_ERROR_GENERIC if page_for_autotext is a valid object and does not
|
160
|
+
belong to the same document as label.
|
161
|
+
*/
|
162
|
+
LO_RESULT LOLabelGetExplodedEntities(
|
163
|
+
LOLabelRef label, LOEntityListRef entity_list, LOPageRef page_for_autotext);
|
164
|
+
|
165
|
+
/**
|
166
|
+
@brief Connects the label to the given connection point. The leader line will
|
167
|
+
be adjusted to point at the connection point. The label must be in the
|
168
|
+
same document as the connection point. If both the label and the
|
169
|
+
connection point's entity are on non-shared layers, they must be on the
|
170
|
+
same page.
|
171
|
+
@param[in] label The label object.
|
172
|
+
@param[in] connection_point The connection point object.
|
173
|
+
@return
|
174
|
+
- \ref SU_ERROR_NONE on success
|
175
|
+
- \ref SU_ERROR_INVALID_INPUT if label does not refer to a valid object
|
176
|
+
- \ref SU_ERROR_INVALID_INPUT if connection_point does not refer to a valid
|
177
|
+
object
|
178
|
+
- \ref SU_ERROR_LAYER_LOCKED if label is on a locked layer
|
179
|
+
- \ref SU_ERROR_ENTITY_LOCKED if label is locked
|
180
|
+
- \ref SU_ERROR_GENERIC if the label was unable to connect to the connection
|
181
|
+
point
|
182
|
+
*/
|
183
|
+
LO_RESULT LOLabelConnectTo(LOLabelRef label, LOConnectionPointRef connection_point);
|
184
|
+
|
185
|
+
/**
|
186
|
+
@brief Disconnects the label from its connection point. The leader line will
|
187
|
+
not be adjusted by disconnecting from a connection point.
|
188
|
+
@param[in] label The label object.
|
189
|
+
@return
|
190
|
+
- \ref SU_ERROR_NONE on success
|
191
|
+
- \ref SU_ERROR_INVALID_INPUT if label does not refer to a valid object
|
192
|
+
- \ref SU_ERROR_LAYER_LOCKED if label is on a locked layer
|
193
|
+
- \ref SU_ERROR_ENTITY_LOCKED if label is locked
|
194
|
+
*/
|
195
|
+
LO_RESULT LOLabelDisconnect(LOLabelRef label);
|
196
|
+
|
197
|
+
/**
|
198
|
+
@brief Creates a copy of the label text's \ref LOFormattedTextRef object.
|
199
|
+
@param[in] label The label object.
|
200
|
+
@param[out] text A copy of the formatted text object representing the label
|
201
|
+
text.
|
202
|
+
@return
|
203
|
+
- \ref SU_ERROR_NONE on success
|
204
|
+
- \ref SU_ERROR_INVALID_INPUT if label does not refer to a valid object
|
205
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if text is NULL
|
206
|
+
- \ref SU_ERROR_OVERWRITE_VALID if *text already refers to a valid object
|
207
|
+
*/
|
208
|
+
LO_RESULT LOLabelCreateLabelTextCopy(LOLabelRef label, LOFormattedTextRef* text);
|
209
|
+
|
210
|
+
/**
|
211
|
+
@brief Creates a copy of the label text's \ref LOFormattedTextRef object. This
|
212
|
+
copy will have all auto-text tags substituted with the display text. A
|
213
|
+
valid page object must be provided for page name/number auto-text to
|
214
|
+
be correctly substituted.
|
215
|
+
@param[in] label The label object.
|
216
|
+
@param[in] page The page object.
|
217
|
+
@param[out] text A copy of the formatted text object representing the label
|
218
|
+
display text.
|
219
|
+
@return
|
220
|
+
- \ref SU_ERROR_NONE on success
|
221
|
+
- \ref SU_ERROR_INVALID_INPUT if label does not refer to a valid object
|
222
|
+
- \ref SU_ERROR_GENERIC if page and label don't belong to the same document
|
223
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if text is NULL
|
224
|
+
- \ref SU_ERROR_OVERWRITE_VALID if *text already refers to a valid object
|
225
|
+
*/
|
226
|
+
LO_RESULT LOLabelCreateLabelDisplayTextCopy(
|
227
|
+
LOLabelRef label, LOPageRef page, LOFormattedTextRef* text);
|
228
|
+
|
229
|
+
/**
|
230
|
+
@brief Sets the text of a label from a \ref LOFormattedTextRef object. The
|
231
|
+
leader line will be adjusted to connect to the new label text if its
|
232
|
+
bounds are different.
|
233
|
+
@param[in] label The label object.
|
234
|
+
@param[in] text The formatted text object representing the label text.
|
235
|
+
@return
|
236
|
+
- \ref SU_ERROR_NONE on success
|
237
|
+
- \ref SU_ERROR_INVALID_INPUT if label does not refer to a valid object
|
238
|
+
- \ref SU_ERROR_LAYER_LOCKED if label is on a locked layer
|
239
|
+
- \ref SU_ERROR_ENTITY_LOCKED if label is locked
|
240
|
+
- \ref SU_ERROR_INVALID_INPUT if text does not refer to a valid object
|
241
|
+
*/
|
242
|
+
LO_RESULT LOLabelSetLabelText(LOLabelRef label, LOFormattedTextRef text);
|
243
|
+
|
244
|
+
/**
|
245
|
+
@brief Creates a copy of the label leader's \ref LOPathRef object.
|
246
|
+
@param[in] label The label object.
|
247
|
+
@param[out] path A copy of the path object representing the label leader.
|
248
|
+
@return
|
249
|
+
- \ref SU_ERROR_NONE on success
|
250
|
+
- \ref SU_ERROR_INVALID_INPUT if label does not refer to a valid object
|
251
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if path is NULL
|
252
|
+
- \ref SU_ERROR_OVERWRITE_VALID if *path already refers to a valid object
|
253
|
+
*/
|
254
|
+
LO_RESULT LOLabelCreateLeaderLineCopy(LOLabelRef label, LOPathRef* path);
|
255
|
+
|
256
|
+
/**
|
257
|
+
@brief Sets the leader line of a label from a \ref LOPathRef object. The label
|
258
|
+
text position will change to remain connected to the end point of the
|
259
|
+
leader line. The leader line type may change based on number and types
|
260
|
+
of points in the path.
|
261
|
+
@param[in] label The label object.
|
262
|
+
@param[in] path The path object representing the label leader.
|
263
|
+
@return
|
264
|
+
- \ref SU_ERROR_NONE on success
|
265
|
+
- \ref SU_ERROR_INVALID_INPUT if label does not refer to a valid object
|
266
|
+
- \ref SU_ERROR_INVALID_INPUT if path does not refer to a valid object
|
267
|
+
- \ref SU_ERROR_GENERIC if path contains less than two points
|
268
|
+
- \ref SU_ERROR_LAYER_LOCKED if label is on a locked layer
|
269
|
+
- \ref SU_ERROR_ENTITY_LOCKED if label is locked
|
270
|
+
*/
|
271
|
+
LO_RESULT LOLabelSetLeaderLine(LOLabelRef label, LOPathRef path);
|
272
|
+
|
273
|
+
/**
|
274
|
+
@brief Gets the type of leader line the label is using. If the leader line has
|
275
|
+
been customized, the type may be unknown.
|
276
|
+
@param[in] label The label object.
|
277
|
+
@param[out] leader_line_type The leader line type.
|
278
|
+
@return
|
279
|
+
- \ref SU_ERROR_NONE on success
|
280
|
+
- \ref SU_ERROR_INVALID_INPUT if label does not refer to a valid object
|
281
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if leader_line_type is NULL
|
282
|
+
*/
|
283
|
+
LO_RESULT LOLabelGetLeaderLineType(LOLabelRef label, LOLabelLeaderLineType* leader_line_type);
|
284
|
+
|
285
|
+
/**
|
286
|
+
@brief Sets the type of leader line the label is using. New control points will
|
287
|
+
be generated if changing to a two segment or bezier leader line type.
|
288
|
+
@param[in] label The label object.
|
289
|
+
@param[in] leader_line_type The leader line type.
|
290
|
+
@return
|
291
|
+
- \ref SU_ERROR_NONE on success
|
292
|
+
- \ref SU_ERROR_INVALID_INPUT if label does not refer to a valid object
|
293
|
+
- \ref SU_ERROR_OUT_OF_RANGE if leader_line_type is
|
294
|
+
LOLabelLeaderLineType_Unknown or not a valid leader line type
|
295
|
+
- \ref SU_ERROR_LAYER_LOCKED if label is on a locked layer
|
296
|
+
- \ref SU_ERROR_ENTITY_LOCKED if label is locked
|
297
|
+
*/
|
298
|
+
LO_RESULT LOLabelSetLeaderLineType(LOLabelRef label, LOLabelLeaderLineType leader_line_type);
|
299
|
+
|
300
|
+
/**
|
301
|
+
@brief Gets the type of connection between the label text and leader line.
|
302
|
+
@param[in] label The label object.
|
303
|
+
@param[out] text_connection_type The text connection type.
|
304
|
+
@return
|
305
|
+
- \ref SU_ERROR_NONE on success
|
306
|
+
- \ref SU_ERROR_INVALID_INPUT if label does not refer to a valid object
|
307
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if text_connection_type is NULL
|
308
|
+
*/
|
309
|
+
LO_RESULT LOLabelGetTextConnectionType(
|
310
|
+
LOLabelRef label, LOLabelTextConnectionType* text_connection_type);
|
311
|
+
|
312
|
+
/**
|
313
|
+
@brief Sets the type of connection between the label text and leader line. The
|
314
|
+
text position will change to account for a change in text connection
|
315
|
+
type.
|
316
|
+
@param[in] label The label object.
|
317
|
+
@param[in] text_connection_type The text connection type.
|
318
|
+
@return
|
319
|
+
- \ref SU_ERROR_NONE on success
|
320
|
+
- \ref SU_ERROR_INVALID_INPUT if label does not refer to a valid object
|
321
|
+
- \ref SU_ERROR_LAYER_LOCKED if label is on a locked layer
|
322
|
+
- \ref SU_ERROR_ENTITY_LOCKED
|
323
|
+
- \ref SU_ERROR_OUT_OF_RANGE if text_connection_type is not a valid value
|
324
|
+
*/
|
325
|
+
LO_RESULT LOLabelSetTextConnectionType(
|
326
|
+
LOLabelRef label, LOLabelTextConnectionType text_connection_type);
|
327
|
+
|
328
|
+
#ifdef __cplusplus
|
329
|
+
}
|
330
|
+
#endif // __cplusplus
|
331
|
+
|
332
|
+
#endif // LAYOUT_MODEL_LABEL_H_
|
@@ -0,0 +1,207 @@
|
|
1
|
+
// Copyright 2015 Trimble Navigation Ltd. All rights reserved.
|
2
|
+
// This file is intended for public distribution.
|
3
|
+
|
4
|
+
#ifndef LAYOUT_MODEL_LAYER_H_
|
5
|
+
#define LAYOUT_MODEL_LAYER_H_
|
6
|
+
|
7
|
+
#include <LayOutAPI/common.h>
|
8
|
+
#include <LayOutAPI/model/defs.h>
|
9
|
+
|
10
|
+
/**
|
11
|
+
@struct LOLayerRef
|
12
|
+
@brief References a layer definition. A layer definition specifies the
|
13
|
+
document-wide information about a layer. To access the entities on a
|
14
|
+
layer for a given page, use \ref LOLayerInstanceRef.
|
15
|
+
*/
|
16
|
+
|
17
|
+
/**
|
18
|
+
@enum LOShareLayerAction
|
19
|
+
@brief Defines the different ways to manage entities when sharing a layer.
|
20
|
+
*/
|
21
|
+
typedef enum {
|
22
|
+
LOShareLayerAction_Clear, ///< Delete all entities on the layer
|
23
|
+
LOShareLayerAction_KeepOnePage, ///< Keep the entities on the specified page
|
24
|
+
LOShareLayerAction_MergeAllPages, ///< Merge the entities from all pages
|
25
|
+
|
26
|
+
LONumShareLayerActions
|
27
|
+
} LOShareLayerAction;
|
28
|
+
|
29
|
+
/**
|
30
|
+
@enum LOUnshareLayerAction
|
31
|
+
@brief Defines the different ways to manage entities when making a layer
|
32
|
+
non-shared.
|
33
|
+
*/
|
34
|
+
typedef enum {
|
35
|
+
LOUnshareLayerAction_Clear, ///< Delete all entities on the layer
|
36
|
+
LOUnshareLayerAction_CopyToOnePage, ///< Copy entities to the specified page
|
37
|
+
LOUnshareLayerAction_CopyToAllPages, ///< Copy entities to all pages
|
38
|
+
|
39
|
+
LONumUnshareLayerActions
|
40
|
+
} LOUnshareLayerAction;
|
41
|
+
|
42
|
+
#ifdef __cplusplus
|
43
|
+
extern "C" {
|
44
|
+
#endif // __cplusplus
|
45
|
+
|
46
|
+
/**
|
47
|
+
@brief Gets the name of a layer.
|
48
|
+
@param[in] layer_definition The layer definition object.
|
49
|
+
@param[out] name The name of the layer.
|
50
|
+
@return
|
51
|
+
- \ref SU_ERROR_NONE on success
|
52
|
+
- \ref SU_ERROR_INVALID_INPUT if layer_definition does not refer to a valid
|
53
|
+
object
|
54
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if name is NULL
|
55
|
+
- \ref SU_ERROR_INVALID_OUTPUT if name does not refer to a valid object
|
56
|
+
*/
|
57
|
+
LO_RESULT LOLayerGetName(LOLayerRef layer_definition, SUStringRef* name);
|
58
|
+
|
59
|
+
/**
|
60
|
+
@brief Sets the name of a layer.
|
61
|
+
@param[in] layer_definition The layer definition object.
|
62
|
+
@param[in] name The new name for the layer.
|
63
|
+
@return
|
64
|
+
- \ref SU_ERROR_NONE on success
|
65
|
+
- \ref SU_ERROR_INVALID_INPUT if layer_definition does not refer to a valid
|
66
|
+
object
|
67
|
+
- \ref SU_ERROR_NULL_POINTER_INPUT if name is NULL
|
68
|
+
- \ref SU_ERROR_UNSUPPORTED if name is an empty string
|
69
|
+
*/
|
70
|
+
LO_RESULT LOLayerSetName(LOLayerRef layer_definition, const char* name);
|
71
|
+
|
72
|
+
/**
|
73
|
+
@brief Gets whether or not a layer is locked.
|
74
|
+
@param[in] layer_definition The layer definition object.
|
75
|
+
@param[out] is_locked Whether the layer is locked or not.
|
76
|
+
@return
|
77
|
+
- \ref SU_ERROR_NONE on success
|
78
|
+
- \ref SU_ERROR_INVALID_INPUT if layer_definition does not refer to a valid
|
79
|
+
object
|
80
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if is_locked is NULL
|
81
|
+
*/
|
82
|
+
LO_RESULT LOLayerGetLocked(LOLayerRef layer_definition, bool* is_locked);
|
83
|
+
|
84
|
+
/**
|
85
|
+
@brief Sets whether or not a layer is locked. When setting a layer to locked,
|
86
|
+
there must be at least one other unlocked and visible layer on every
|
87
|
+
page. If this is not the case, then the next layer will be automatically
|
88
|
+
unlocked and made visible on all pages as necessary to proceed with the
|
89
|
+
operation.
|
90
|
+
@param[in] layer_definition The layer definition object.
|
91
|
+
@param[in] is_locked Whether the layer should be locked or not.
|
92
|
+
@return
|
93
|
+
- \ref SU_ERROR_NONE on success
|
94
|
+
- \ref SU_ERROR_INVALID_INPUT if layer_definition does not refer to a valid
|
95
|
+
object
|
96
|
+
- \ref SU_ERROR_GENERIC if the layer could not be locked because it would
|
97
|
+
break the rule that there must be at least one unlocked, visible layer on
|
98
|
+
each page
|
99
|
+
*/
|
100
|
+
LO_RESULT LOLayerSetLocked(LOLayerRef layer_definition, bool is_locked);
|
101
|
+
|
102
|
+
/**
|
103
|
+
@brief Gets whether or not a layer is a shared layer.
|
104
|
+
@param[in] layer_definition The layer definition object.
|
105
|
+
@param[in] is_shared Whether the layer is shared or not.
|
106
|
+
@return
|
107
|
+
- \ref SU_ERROR_NONE on success
|
108
|
+
- \ref SU_ERROR_INVALID_INPUT if layer_definition does not refer to a valid
|
109
|
+
object
|
110
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if is_shared is NULL
|
111
|
+
*/
|
112
|
+
LO_RESULT LOLayerGetShared(LOLayerRef layer_definition, bool* is_shared);
|
113
|
+
|
114
|
+
/**
|
115
|
+
@brief Shares a layer. If action is \ref LOShareLayerAction_Clear or
|
116
|
+
\ref LOShareLayerAction_MergeAllPages, then page may be an invalid
|
117
|
+
object.
|
118
|
+
@param[in] layer_definition The layer definition object.
|
119
|
+
@param[in] page The the page to use when action is \ref
|
120
|
+
LOShareLayerAction_KeepOnePage.
|
121
|
+
@param[in] action The action to apply to existing entities on the
|
122
|
+
layer that is being shared.
|
123
|
+
@return
|
124
|
+
- \ref SU_ERROR_NONE on success
|
125
|
+
- \ref SU_ERROR_INVALID_INPUT if layer_definition does not refer to a valid
|
126
|
+
object
|
127
|
+
- \ref SU_ERROR_LAYER_LOCKED if layer_definition is a locked layer
|
128
|
+
- \ref SU_ERROR_GENERIC if page does not refer to a valid object and the
|
129
|
+
desired action requires a page
|
130
|
+
- \ref SU_ERROR_GENERIC if an error occured attempting to share the layer
|
131
|
+
- \ref SU_ERROR_OUT_OF_RANGE if action is not a valid value
|
132
|
+
*/
|
133
|
+
LO_RESULT LOLayerSetShared(LOLayerRef layer_definition, LOPageRef page, LOShareLayerAction action);
|
134
|
+
|
135
|
+
/**
|
136
|
+
@brief Unshares a layer. If action is \ref LOUnshareLayerAction_Clear or
|
137
|
+
\ref LOUnshareLayerAction_CopyToAllPages, then page may be an invalid
|
138
|
+
object.
|
139
|
+
@param[in] layer_definition The layer definition object.
|
140
|
+
@param[in] page The the page to use when action is
|
141
|
+
\ref LOUnshareLayerAction_CopyToOnePage.
|
142
|
+
@param[in] action The action to apply to existing entities on the
|
143
|
+
layer that is being unshared.
|
144
|
+
@return
|
145
|
+
- \ref SU_ERROR_NONE on success
|
146
|
+
- \ref SU_ERROR_INVALID_INPUT if layer_definition does not refer to a valid
|
147
|
+
object
|
148
|
+
- \ref SU_ERROR_LAYER_LOCKED if layer_definition is a locked layer
|
149
|
+
- \ref SU_ERROR_GENERIC if page does not refer to a valid object and the
|
150
|
+
desired action requires a page
|
151
|
+
- \ref SU_ERROR_GENERIC if an error occured attempting to unshare the layer
|
152
|
+
- \ref SU_ERROR_OUT_OF_RANGE if action is not a valid value
|
153
|
+
*/
|
154
|
+
LO_RESULT LOLayerSetNonShared(
|
155
|
+
LOLayerRef layer_definition, LOPageRef page, LOUnshareLayerAction action);
|
156
|
+
|
157
|
+
/**
|
158
|
+
@brief Gets the layer instance for the given layer definition on a given page.
|
159
|
+
If layer_definition specifies a shared layer, page may be an invalid
|
160
|
+
object.
|
161
|
+
@param[in] layer_definition The layer definition object.
|
162
|
+
@param[in] page The page object.
|
163
|
+
@param[out] layer_instance The layer instance object.
|
164
|
+
@return
|
165
|
+
- \ref SU_ERROR_NONE on success
|
166
|
+
- \ref SU_ERROR_INVALID_INPUT if layer_definition does not refer to a valid
|
167
|
+
object
|
168
|
+
- \ref SU_ERROR_INVALID_INPUT if page does not refer to a valid object and
|
169
|
+
layer_definition is not a shared layer
|
170
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if layer_instance is NULL
|
171
|
+
- \ref SU_ERROR_OVERWRITE_VALID if *layer_instance already refers to a valid object
|
172
|
+
- \ref SU_ERROR_GENERIC if an error occurred attempting to get the layer
|
173
|
+
instance
|
174
|
+
*/
|
175
|
+
LO_RESULT LOLayerGetLayerInstance(
|
176
|
+
LOLayerRef layer_definition, LOPageRef page, LOLayerInstanceRef* layer_instance);
|
177
|
+
|
178
|
+
/**
|
179
|
+
@brief Returns the index of this layer in the document.
|
180
|
+
@param[in] layer_definition The layer definition object.
|
181
|
+
@param[out] index The index of the layer in the document.
|
182
|
+
@return
|
183
|
+
- \ref SU_ERROR_NONE on success
|
184
|
+
- \ref SU_ERROR_INVALID_INPUT if layer_definition does not refer to a valid
|
185
|
+
object
|
186
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if index is NULL
|
187
|
+
*/
|
188
|
+
LO_RESULT LOLayerGetLayerIndex(LOLayerRef layer_definition, size_t* index);
|
189
|
+
|
190
|
+
/**
|
191
|
+
@brief Returns the document that this layer belongs to.
|
192
|
+
@since LayOut 2018, API 3.0
|
193
|
+
@param[in] layer_definition The layer definition object.
|
194
|
+
@param[out] document The document object.
|
195
|
+
@return
|
196
|
+
- \ref SU_ERROR_NONE on success
|
197
|
+
- \ref SU_ERROR_INVALID_INPUT if layer_definition does not refer to a valid
|
198
|
+
object
|
199
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if document is NULL
|
200
|
+
*/
|
201
|
+
LO_RESULT LOLayerGetDocument(LOLayerRef layer_definition, LODocumentRef* document);
|
202
|
+
|
203
|
+
#ifdef __cplusplus
|
204
|
+
} // end extern "C"
|
205
|
+
#endif // __cplusplus
|
206
|
+
|
207
|
+
#endif // LAYOUT_MODEL_LAYER_H_
|
@@ -0,0 +1,117 @@
|
|
1
|
+
// Copyright 2015 Trimble Navigation Ltd. All rights reserved.
|
2
|
+
// This file is intended for public distribution.
|
3
|
+
|
4
|
+
#ifndef LAYOUT_MODEL_LAYER_INSTANCE_H_
|
5
|
+
#define LAYOUT_MODEL_LAYER_INSTANCE_H_
|
6
|
+
|
7
|
+
#include <LayOutAPI/common.h>
|
8
|
+
#include <LayOutAPI/model/defs.h>
|
9
|
+
|
10
|
+
/**
|
11
|
+
@struct LOLayerInstanceRef
|
12
|
+
@brief References a layer instance. A layer instance provides access to the
|
13
|
+
entities that are drawn on a given layer, as well as the draw order of
|
14
|
+
those entities. Groups are not included in the list of entities
|
15
|
+
associated with a layer instance, since the group hierarchy has no
|
16
|
+
effect on entity draw order. Each page has one layer instance for each
|
17
|
+
layer in the document. Non-shared layer instances are unique per page,
|
18
|
+
while shared layer instances are shared across all pages of the
|
19
|
+
document.
|
20
|
+
*/
|
21
|
+
|
22
|
+
#ifdef __cplusplus
|
23
|
+
extern "C" {
|
24
|
+
#endif // __cplusplus
|
25
|
+
|
26
|
+
/**
|
27
|
+
@brief Gets the number of entities associated with a layer instance.
|
28
|
+
@param[in] layer_instance The layer instance object.
|
29
|
+
@param[out] number_of_entities The number of entities associated with the layer
|
30
|
+
instance.
|
31
|
+
@return
|
32
|
+
- \ref SU_ERROR_NONE on success
|
33
|
+
- \ref SU_ERROR_INVALID_INPUT if layer_instance does not refer to a valid object
|
34
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if number_of_entities is NULL
|
35
|
+
*/
|
36
|
+
LO_RESULT LOLayerInstanceGetNumberOfEntities(
|
37
|
+
LOLayerInstanceRef layer_instance, size_t* number_of_entities);
|
38
|
+
|
39
|
+
/**
|
40
|
+
@brief Gets the entity at the given index of a layer instance's draw order.
|
41
|
+
@param[in] layer_instance The layer instance object.
|
42
|
+
@param[in] index The index of the entity to get.
|
43
|
+
@param[out] entity The entity object.
|
44
|
+
@return
|
45
|
+
- \ref SU_ERROR_NONE on success
|
46
|
+
- \ref SU_ERROR_INVALID_INPUT if layer_instance does not refer to a valid object
|
47
|
+
- \ref SU_ERROR_OUT_OF_RANGE if index out of range
|
48
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if entity is NULL
|
49
|
+
- \ref SU_ERROR_OVERWRITE_VALID if *entity already refers to a valid object
|
50
|
+
*/
|
51
|
+
LO_RESULT LOLayerInstanceGetEntityAtIndex(
|
52
|
+
LOLayerInstanceRef layer_instance, size_t index, LOEntityRef* entity);
|
53
|
+
|
54
|
+
/**
|
55
|
+
@brief Gets the index of the given entity on the layer instance.
|
56
|
+
@since LayOut 2018, API 3.0
|
57
|
+
@param[in] layer_instance The layer instance object.
|
58
|
+
@param[in] entity The entity object.
|
59
|
+
@param[out] index The index of the entity.
|
60
|
+
@return
|
61
|
+
- \ref SU_ERROR_NONE on success
|
62
|
+
- \ref SU_ERROR_INVALID_INPUT if layer_instance does not refer to a valid object
|
63
|
+
- \ref SU_ERROR_INVALID_ARGUMENT if entity is not on layer_instance
|
64
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if index is NULL
|
65
|
+
*/
|
66
|
+
LO_RESULT LOLayerInstanceGetIndexOfEntity(
|
67
|
+
LOLayerInstanceRef layer_instance, LOEntityRef entity, size_t* index);
|
68
|
+
|
69
|
+
/**
|
70
|
+
@brief Populates a \ref LOEntityListRef with all the entities associated with a
|
71
|
+
layer instance, ordered by their draw order.
|
72
|
+
@param[in] layer_instance The layer instance object.
|
73
|
+
@param[out] entity_list The entity list to populate.
|
74
|
+
@return
|
75
|
+
- \ref SU_ERROR_NONE on success
|
76
|
+
- \ref SU_ERROR_INVALID_INPUT if layer_instance does not refer to a valid object
|
77
|
+
- \ref SU_ERROR_INVALID_INPUT if entity_list does not refer to a valid object
|
78
|
+
*/
|
79
|
+
LO_RESULT LOLayerInstanceGetEntities(
|
80
|
+
LOLayerInstanceRef layer_instance, LOEntityListRef entity_list);
|
81
|
+
|
82
|
+
/**
|
83
|
+
@brief Moves the entity to the specified index within a layer instance's draw
|
84
|
+
order. The entity must already belong to the layer instance that is
|
85
|
+
passed in.
|
86
|
+
@param[in] layer_instance The layer instance object.
|
87
|
+
@param[in] entity The entity object.
|
88
|
+
@param[in] index The index to move the entity to.
|
89
|
+
@return
|
90
|
+
- \ref SU_ERROR_NONE on success
|
91
|
+
- \ref SU_ERROR_INVALID_INPUT if layer_instance does not refer to a valid object
|
92
|
+
- \ref SU_ERROR_INVALID_INPUT if entity does not refer to a valid object
|
93
|
+
- \ref SU_ERROR_INVALID_INPUT if entity does not belong to the given layer
|
94
|
+
instance
|
95
|
+
- \ref SU_ERROR_OUT_OF_RANGE if index is out of range
|
96
|
+
*/
|
97
|
+
LO_RESULT LOLayerInstanceReorderEntity(
|
98
|
+
LOLayerInstanceRef layer_instance, LOEntityRef entity, size_t index);
|
99
|
+
|
100
|
+
/**
|
101
|
+
@brief Gets the layer definition that a layer instance is associated with.
|
102
|
+
@param[in] layer_instance The layer instance object.
|
103
|
+
@param[out] layer_definition The layer definition object.
|
104
|
+
@return
|
105
|
+
- \ref SU_ERROR_NONE on success
|
106
|
+
- \ref SU_ERROR_INVALID_INPUT if layer_instance does not refer to a valid object
|
107
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if layer_definition is NULL
|
108
|
+
- \ref SU_ERROR_OVERWRITE_VALID if *layer_definition already refers to a valid object
|
109
|
+
*/
|
110
|
+
LO_RESULT LOLayerInstanceGetLayerDefinition(
|
111
|
+
LOLayerInstanceRef layer_instance, LOLayerRef* layer_definition);
|
112
|
+
|
113
|
+
#ifdef __cplusplus
|
114
|
+
} // end extern "C"
|
115
|
+
#endif // __cplusplus
|
116
|
+
|
117
|
+
#endif // LAYOUT_MODEL_LAYER_INSTANCE_H_
|