scriptup 2024.0.4 → 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,59 @@
|
|
1
|
+
// Copyright 2015-2023 Trimble Inc. All rights reserved.
|
2
|
+
// This file is intended for public distribution.
|
3
|
+
|
4
|
+
#ifndef LAYOUT_MODEL_DOCUMENTEXPORTOPTIONS_H_
|
5
|
+
#define LAYOUT_MODEL_DOCUMENTEXPORTOPTIONS_H_
|
6
|
+
|
7
|
+
/**
|
8
|
+
@brief Dictionary key to use when specifying the file location for export.
|
9
|
+
*/
|
10
|
+
const char* const LOExportOption_FileLocation = "lo_export_file_location";
|
11
|
+
|
12
|
+
/**
|
13
|
+
@brief Dictionary key to use when specifying the start page option for
|
14
|
+
\ref LODocumentExportToPDF or \ref LODocumentExportToImageSet.
|
15
|
+
*/
|
16
|
+
const char* const LOExportOption_StartPage = "start_page";
|
17
|
+
|
18
|
+
/**
|
19
|
+
@brief Dictionary key to use when specifying the end page option for
|
20
|
+
\ref LODocumentExportToPDF or \ref LODocumentExportToImageSet.
|
21
|
+
*/
|
22
|
+
const char* const LOExportOption_EndPage = "end_page";
|
23
|
+
|
24
|
+
/**
|
25
|
+
@brief Dictionary key to use when specifying the page range option for
|
26
|
+
\ref LODocumentExportToPDF or \ref LODocumentExportToImageSet.
|
27
|
+
The value stored with this key takes precedent over `"start_page"` and `"end_page"`.
|
28
|
+
@since LayOut 2024.0, API 9.0
|
29
|
+
*/
|
30
|
+
const char* const LOExportOption_PageRange = "page_range";
|
31
|
+
|
32
|
+
/**
|
33
|
+
@brief Dictionary key to use when specifying the output resolution option for
|
34
|
+
\ref LODocumentExportToPDF.
|
35
|
+
@deprecated This key is deprecated as of 2023.1. Set the output resolution of
|
36
|
+
images and viewports through the LOPageInfoSetImageOutputResolution
|
37
|
+
and LOPageInfoSetOutputResolution respectively.
|
38
|
+
*/
|
39
|
+
const char* const LOExportOption_OutputResolution = "output_resolution";
|
40
|
+
|
41
|
+
/**
|
42
|
+
@brief Dictionary key to use when specifying the compress images option for
|
43
|
+
\ref LODocumentExportToPDF.
|
44
|
+
*/
|
45
|
+
const char* const LOExportOption_CompressImages = "compress_images";
|
46
|
+
|
47
|
+
/**
|
48
|
+
@brief Dictionary key to use when specifying the image compression quality
|
49
|
+
option for \ref LODocumentExportToPDF.
|
50
|
+
*/
|
51
|
+
const char* const LOExportOption_ImageCompressionQuality = "compress_quality";
|
52
|
+
|
53
|
+
/**
|
54
|
+
@brief Dictionary key to use when specifying the image DPI option for
|
55
|
+
\ref LODocumentExportToImageSet.
|
56
|
+
*/
|
57
|
+
const char* const LOExportOption_DPI = "dpi";
|
58
|
+
|
59
|
+
#endif // #define LAYOUT_MODEL_DOCUMENTEXPORTOPTIONS_H_
|
@@ -0,0 +1,78 @@
|
|
1
|
+
// Copyright 2015 Trimble Navigation Ltd. All rights reserved.
|
2
|
+
// This file is intended for public distribution.
|
3
|
+
|
4
|
+
#ifndef LAYOUT_MODEL_ELLIPSE_H_
|
5
|
+
#define LAYOUT_MODEL_ELLIPSE_H_
|
6
|
+
|
7
|
+
#include <LayOutAPI/common.h>
|
8
|
+
#include <LayOutAPI/geometry/geometry.h>
|
9
|
+
#include <LayOutAPI/model/defs.h>
|
10
|
+
|
11
|
+
/**
|
12
|
+
@struct LOEllipseRef
|
13
|
+
@brief References a simple elliptical shape entity.
|
14
|
+
*/
|
15
|
+
|
16
|
+
#ifdef __cplusplus
|
17
|
+
extern "C" {
|
18
|
+
#endif // __cplusplus
|
19
|
+
|
20
|
+
/**
|
21
|
+
@brief Creates a new ellipse entity object.
|
22
|
+
@param[out] ellipse The newly created ellipse.
|
23
|
+
@param[in] bounds The bounds of the ellipse.
|
24
|
+
@return
|
25
|
+
- \ref SU_ERROR_NONE on success
|
26
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if ellipse is NULL
|
27
|
+
- \ref SU_ERROR_OVERWRITE_VALID if *ellipse already refers to a valid object
|
28
|
+
- \ref SU_ERROR_NULL_POINTER_INPUT if bounds is NULL
|
29
|
+
- \ref SU_ERROR_OUT_OF_RANGE if bounds are not greater than (0, 0)
|
30
|
+
*/
|
31
|
+
LO_RESULT LOEllipseCreate(LOEllipseRef* ellipse, const LOAxisAlignedRect2D* bounds);
|
32
|
+
|
33
|
+
/**
|
34
|
+
@brief Adds a reference to an ellipse object.
|
35
|
+
@param[in] ellipse The ellipse object.
|
36
|
+
@return
|
37
|
+
- \ref SU_ERROR_NONE on success
|
38
|
+
- \ref SU_ERROR_INVALID_INPUT if ellipse does not refer to a valid object
|
39
|
+
*/
|
40
|
+
LO_RESULT LOEllipseAddReference(LOEllipseRef ellipse);
|
41
|
+
|
42
|
+
/**
|
43
|
+
@brief Releases an ellipse object. The object will be invalidated if
|
44
|
+
releasing the last reference.
|
45
|
+
@param[in] ellipse The ellipse object.
|
46
|
+
@return
|
47
|
+
- \ref SU_ERROR_NONE on success
|
48
|
+
- \ref SU_ERROR_NULL_POINTER_INPUT if ellipse is NULL
|
49
|
+
- \ref SU_ERROR_INVALID_INPUT if *ellipse does not refer to a valid object
|
50
|
+
*/
|
51
|
+
LO_RESULT LOEllipseRelease(LOEllipseRef* ellipse);
|
52
|
+
|
53
|
+
/**
|
54
|
+
@brief Converts from a \ref LOEntityRef to a \ref LOEllipseRef.
|
55
|
+
This is essentially a downcast operation so the given \ref LOEntityRef
|
56
|
+
must be convertible to a \ref LOEllipseRef.
|
57
|
+
@param[in] entity The entity object.
|
58
|
+
@return
|
59
|
+
- The converted \ref LOEllipseRef if the downcast operation succeeds
|
60
|
+
- If not, the returned reference will be invalid
|
61
|
+
*/
|
62
|
+
LO_EXPORT LOEllipseRef LOEllipseFromEntity(LOEntityRef entity);
|
63
|
+
|
64
|
+
/**
|
65
|
+
@brief Converts from a \ref LOEllipseRef to a \ref LOEntityRef.
|
66
|
+
This is essentially an upcast operation.
|
67
|
+
@param[in] ellipse The ellipse object.
|
68
|
+
@return
|
69
|
+
- The converted \ref LOEntityRef if ellipse is a valid object
|
70
|
+
- If not, the returned reference will be invalid
|
71
|
+
*/
|
72
|
+
LO_EXPORT LOEntityRef LOEllipseToEntity(LOEllipseRef ellipse);
|
73
|
+
|
74
|
+
#ifdef __cplusplus
|
75
|
+
} // end extern "C"
|
76
|
+
#endif // __cplusplus
|
77
|
+
|
78
|
+
#endif // LAYOUT_MODEL_ELLIPSE_H_
|
@@ -0,0 +1,330 @@
|
|
1
|
+
// Copyright 2015-2022 Trimble Inc. All rights reserved.
|
2
|
+
// This file is intended for public distribution.
|
3
|
+
|
4
|
+
#ifndef LAYOUT_MODEL_ENTITY_H_
|
5
|
+
#define LAYOUT_MODEL_ENTITY_H_
|
6
|
+
|
7
|
+
#include <LayOutAPI/common.h>
|
8
|
+
#include <LayOutAPI/geometry/geometry.h>
|
9
|
+
#include <LayOutAPI/model/defs.h>
|
10
|
+
|
11
|
+
/**
|
12
|
+
@enum LOEntityType
|
13
|
+
@brief Defines the different types of entities that may exist in a document.
|
14
|
+
*/
|
15
|
+
typedef enum {
|
16
|
+
LOEntityType_FormattedText = 0, ///< The entity is a LOFormattedTextRef.
|
17
|
+
LOEntityType_Group, ///< The entity is a LOGroupRef.
|
18
|
+
LOEntityType_Image, ///< The entity is a LOImageRef.
|
19
|
+
LOEntityType_LinearDimension, ///< The entity is a LOLinearDimensionRef.
|
20
|
+
LOEntityType_Path, ///< The entity is a LOPathRef.
|
21
|
+
LOEntityType_Rectangle, ///< The entity is a LORectangleRef.
|
22
|
+
LOEntityType_SketchUpModel, ///< The entity is a LOSketchUpModelRef.
|
23
|
+
LOEntityType_Ellipse, ///< The entity is a LOEllipseRef.
|
24
|
+
LOEntityType_Label, ///< The entity is a LOLabelRef.
|
25
|
+
LOEntityType_Table, ///< The entity is a LOTableRef.
|
26
|
+
LOEntityType_AngularDimension, ///< The entity is a LOAngularDimensionRef.
|
27
|
+
LOEntityType_ReferenceEntity, ///< The entity is a LOReferenceEntityRef.
|
28
|
+
LONumEntityTypes
|
29
|
+
} LOEntityType;
|
30
|
+
|
31
|
+
/**
|
32
|
+
@struct LOEntityRef
|
33
|
+
@brief An entity is an object shown on a page of a LayOut document.
|
34
|
+
*/
|
35
|
+
|
36
|
+
#ifdef __cplusplus
|
37
|
+
extern "C" {
|
38
|
+
#endif // __cplusplus
|
39
|
+
|
40
|
+
/**
|
41
|
+
@brief Gets the bounds of an entity in the x and y axis of the page.
|
42
|
+
@return
|
43
|
+
@param[in] entity The entity object.
|
44
|
+
@param[out] bounds The bounds of the entity.
|
45
|
+
- \ref SU_ERROR_NONE on success
|
46
|
+
- \ref SU_ERROR_INVALID_INPUT if entity does not refer to a valid object
|
47
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if bounds is NULL
|
48
|
+
*/
|
49
|
+
LO_RESULT LOEntityGetAxisAlignedBounds(LOEntityRef entity, LOAxisAlignedRect2D* bounds);
|
50
|
+
|
51
|
+
/**
|
52
|
+
@brief Gets a rectangle that bounds an entity. The rectangle returned by this
|
53
|
+
function may not be aligned with the page axis if the entity has an
|
54
|
+
explicit transformation.
|
55
|
+
@param[in] entity The entity object.
|
56
|
+
@param[out] bounds The oriented bounds of the entity.
|
57
|
+
@return
|
58
|
+
- \ref SU_ERROR_NONE on success
|
59
|
+
- \ref SU_ERROR_INVALID_INPUT if entity does not refer to a valid object
|
60
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if bounds is NULL
|
61
|
+
*/
|
62
|
+
LO_RESULT LOEntityGetOrientedBounds(LOEntityRef entity, LOOrientedRect2D* bounds);
|
63
|
+
|
64
|
+
/**
|
65
|
+
@brief Gets whether or not an entity has an explicit transformation. The
|
66
|
+
following types of entities will always have an explicit transformation:
|
67
|
+
\ref LOFormattedTextRef, \ref LOImageRef, \ref LORectangleRef,
|
68
|
+
\ref LOSketchUpModelRef and \ref LOEllipseRef.
|
69
|
+
@param[in] entity The entity object.
|
70
|
+
@param[out] has_transform Whether the entity has an explicit transformation.
|
71
|
+
@return
|
72
|
+
- \ref SU_ERROR_NONE on success
|
73
|
+
- \ref SU_ERROR_INVALID_INPUT if entity does not refer to a valid object
|
74
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if has_transform is NULL
|
75
|
+
*/
|
76
|
+
LO_RESULT LOEntityHasExplicitTransform(LOEntityRef entity, bool* has_transform);
|
77
|
+
|
78
|
+
/**
|
79
|
+
@brief Gets the explicit transformation for an entity. This function is only
|
80
|
+
supported for entities that have an explicit transformation.
|
81
|
+
@return
|
82
|
+
- \ref SU_ERROR_NONE on success
|
83
|
+
- \ref SU_ERROR_INVALID_INPUT if entity does not refer to a valid object
|
84
|
+
- \ref SU_ERROR_NO_DATA if entity does not have an explicit transformation
|
85
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if transform_matrix is NULL
|
86
|
+
*/
|
87
|
+
LO_RESULT LOEntityGetExplicitTransform(LOEntityRef entity, LOTransformMatrix2D* transform_matrix);
|
88
|
+
|
89
|
+
/**
|
90
|
+
@brief Applies a transformation to an entity. This works for all types of
|
91
|
+
entities, regardless of whether or not they have an explicit
|
92
|
+
transformation. It even works on groups, in which case the
|
93
|
+
transformation is applied to everything inside the group.
|
94
|
+
@return
|
95
|
+
- \ref SU_ERROR_NONE on success
|
96
|
+
- \ref SU_ERROR_INVALID_INPUT if entity does not refer to a valid object
|
97
|
+
- \ref SU_ERROR_LAYER_LOCKED if entity is on a locked layer
|
98
|
+
- \ref SU_ERROR_ENTITY_LOCKED if entity is locked
|
99
|
+
- \ref SU_ERROR_NULL_POINTER_INPUT if transform_matrix is NULL
|
100
|
+
*/
|
101
|
+
LO_RESULT LOEntityApplyTransform(LOEntityRef entity, const LOTransformMatrix2D* transform_matrix);
|
102
|
+
|
103
|
+
/**
|
104
|
+
@brief Gets the untransformed bounds of an entity. This is the bounds of the
|
105
|
+
entity before its explicit transformation is applied. This function is
|
106
|
+
only supported for entities that have an explicit transformation.
|
107
|
+
@param[in] entity The entity object.
|
108
|
+
@param[out] bounds The untransformed bounds.
|
109
|
+
@return
|
110
|
+
- \ref SU_ERROR_NONE on success
|
111
|
+
- \ref SU_ERROR_INVALID_INPUT if entity does not refer to a valid object
|
112
|
+
- \ref SU_ERROR_NO_DATA if entity does not have an explicit transformation
|
113
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if bounds is NULL
|
114
|
+
*/
|
115
|
+
LO_RESULT LOEntityGetUntransformedBounds(LOEntityRef entity, LOAxisAlignedRect2D* bounds);
|
116
|
+
|
117
|
+
/**
|
118
|
+
@brief Sets the untransformed bounds of an entity. This is the bounds of the
|
119
|
+
entity before its explicit transformation is applied. This function is
|
120
|
+
only supported for entities that have an explicit transformation.
|
121
|
+
@param[in] entity The entity object.
|
122
|
+
@param[in] bounds The untransformed bounds.
|
123
|
+
@return
|
124
|
+
- \ref SU_ERROR_NONE on success
|
125
|
+
- \ref SU_ERROR_INVALID_INPUT if entity does not refer to a valid object
|
126
|
+
- \ref SU_ERROR_GENERIC if entity does not have an explicit transformation
|
127
|
+
- \ref SU_ERROR_LAYER_LOCKED if entity is on a locked layer
|
128
|
+
- \ref SU_ERROR_ENTITY_LOCKED if entity is locked
|
129
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if bounds is NULL
|
130
|
+
- \ref SU_ERROR_OUT_OF_RANGE if bounds is zero sized
|
131
|
+
*/
|
132
|
+
LO_RESULT LOEntitySetUntransformedBounds(LOEntityRef entity, const LOAxisAlignedRect2D* bounds);
|
133
|
+
|
134
|
+
/**
|
135
|
+
@brief Gets the entity type of an entity. This can be used to determine which
|
136
|
+
FromEntity function to use for casting the LOEntityRef object to its
|
137
|
+
specific entity object type.
|
138
|
+
@param[in] entity The entity object.
|
139
|
+
@param[out] entity_type The entity type.
|
140
|
+
@return
|
141
|
+
- \ref SU_ERROR_NONE on success
|
142
|
+
- \ref SU_ERROR_INVALID_INPUT if entity does not refer to a valid object
|
143
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if entity_type is NULL
|
144
|
+
*/
|
145
|
+
LO_RESULT LOEntityGetEntityType(LOEntityRef entity, LOEntityType* entity_type);
|
146
|
+
|
147
|
+
/**
|
148
|
+
@brief Gets the document that an entity belongs to.
|
149
|
+
@param[in] entity The entity object.
|
150
|
+
@param[out] document The document object.
|
151
|
+
@return
|
152
|
+
- \ref SU_ERROR_NONE on success
|
153
|
+
- \ref SU_ERROR_INVALID_INPUT if entity does not refer to a valid object
|
154
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if document is NULL
|
155
|
+
- \ref SU_ERROR_OVERWRITE_VALID if *document already refers to a valid object
|
156
|
+
- \ref SU_ERROR_NO_DATA if this entity is not in a document
|
157
|
+
*/
|
158
|
+
LO_RESULT LOEntityGetDocument(LOEntityRef entity, LODocumentRef* document);
|
159
|
+
|
160
|
+
/**
|
161
|
+
@brief Gets the layer instance that an entity is associated with. Note that
|
162
|
+
groups are never associated with a layer instance.
|
163
|
+
@param[in] entity The entity object.
|
164
|
+
@param[out] layer_instance The layer instance object.
|
165
|
+
@return
|
166
|
+
- \ref SU_ERROR_NONE on success
|
167
|
+
- \ref SU_ERROR_INVALID_INPUT if entity does not refer to a valid object
|
168
|
+
- \ref SU_ERROR_NO_DATA if this entity is not associated with a layer or does
|
169
|
+
not belong to a document
|
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
|
172
|
+
object
|
173
|
+
*/
|
174
|
+
LO_RESULT LOEntityGetLayerInstance(LOEntityRef entity, LOLayerInstanceRef* layer_instance);
|
175
|
+
|
176
|
+
/**
|
177
|
+
@brief Moves an entity to the given layer.
|
178
|
+
|
179
|
+
If the layer is non-shared and the entity is currently on a shared layer, pages must be valid and
|
180
|
+
populated with the pages to move the entity to. In all other cases, pages may be an invalid object.
|
181
|
+
The entity must belong to the same document as the the layer and the pages.
|
182
|
+
|
183
|
+
@bug In LayOut versions prior to LayOut 2024.0 this method would fail to move entities from
|
184
|
+
non-shared layers.
|
185
|
+
|
186
|
+
@param[in] entity The entity object.
|
187
|
+
@param[in] layer The layer definition object.
|
188
|
+
@param[in] pages The page list object.
|
189
|
+
@return
|
190
|
+
- \ref SU_ERROR_NONE on success
|
191
|
+
- \ref SU_ERROR_INVALID_INPUT if \p entity does not refer to a valid object
|
192
|
+
- \ref SU_ERROR_INVALID_INPUT if \p layer does not refer to a valid object
|
193
|
+
- \ref SU_ERROR_INVALID_INPUT if \p pages does not refer to a valid object and
|
194
|
+
\p layer is non-shared
|
195
|
+
- \ref SU_ERROR_INVALID_INPUT if \p pages is empty and \p layer is non-shared
|
196
|
+
- \ref SU_ERROR_INVALID_INPUT if \p pages contains the same page reference more
|
197
|
+
than once and \p layer is non-shared
|
198
|
+
- \ref SU_ERROR_GENERIC if \p entity, \p layer, and \p pages are not all in the same
|
199
|
+
document
|
200
|
+
- \ref SU_ERROR_LAYER_LOCKED if \p layer is locked or if \p entity is currently on a
|
201
|
+
locked layer
|
202
|
+
- \ref SU_ERROR_ENTITY_LOCKED if \p entity is locked
|
203
|
+
*/
|
204
|
+
LO_RESULT LOEntityMoveToLayer(LOEntityRef entity, LOLayerRef layer, LOPageListRef pages);
|
205
|
+
|
206
|
+
/**
|
207
|
+
@brief Gets the page that an entity belongs to. This function will only
|
208
|
+
succeed if the entity is on a non-shared layer.
|
209
|
+
@param[in] entity The entity object.
|
210
|
+
@param[out] page The page object.
|
211
|
+
@return
|
212
|
+
- \ref SU_ERROR_NONE on success
|
213
|
+
- \ref SU_ERROR_INVALID_INPUT if entity does not refer to a valid object
|
214
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if page is NULL
|
215
|
+
- \ref SU_ERROR_OVERWRITE_VALID if *page already refers to a valid object
|
216
|
+
- \ref SU_ERROR_NO_DATA if this entity is not in a document or is on a shared
|
217
|
+
layer
|
218
|
+
*/
|
219
|
+
LO_RESULT LOEntityGetPage(LOEntityRef entity, LOPageRef* page);
|
220
|
+
|
221
|
+
/**
|
222
|
+
@brief Gets whether or not this entity belongs to a group.
|
223
|
+
@param[in] entity The entity object.
|
224
|
+
@param[out] is_in_group Whether the entity is in a group.
|
225
|
+
@return
|
226
|
+
- \ref SU_ERROR_NONE on success
|
227
|
+
- \ref SU_ERROR_INVALID_INPUT if entity does not refer to a valid object
|
228
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if is_in_group is NULL
|
229
|
+
*/
|
230
|
+
LO_RESULT LOEntityIsInGroup(LOEntityRef entity, bool* is_in_group);
|
231
|
+
|
232
|
+
/**
|
233
|
+
@brief Gets the group that an entity belongs to.
|
234
|
+
@param[in] entity The entity object.
|
235
|
+
@param[out] group The group object.
|
236
|
+
@return
|
237
|
+
- \ref SU_ERROR_NONE on success
|
238
|
+
- \ref SU_ERROR_INVALID_INPUT if entity does not refer to a valid object
|
239
|
+
- \ref SU_ERROR_NO_DATA if entity is not in a group
|
240
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if group is NULL
|
241
|
+
- \ref SU_ERROR_OVERWRITE_VALID if *group already refers to a valid object
|
242
|
+
*/
|
243
|
+
LO_RESULT LOEntityGetContainingGroup(LOEntityRef entity, LOGroupRef* group);
|
244
|
+
|
245
|
+
/**
|
246
|
+
@brief Moves an entity into a group. If the entity is already in a group, it
|
247
|
+
will be removed from that group prior to being added to the new group.
|
248
|
+
If this action results in the old group containing only one entity, the
|
249
|
+
old group will be collapsed and the remaining entity will be moved to
|
250
|
+
the old group's parent.
|
251
|
+
@param[in] entity The entity object.
|
252
|
+
@param[in] group The group object.
|
253
|
+
@return
|
254
|
+
- \ref SU_ERROR_NONE on success
|
255
|
+
- \ref SU_ERROR_INVALID_INPUT if entity does not refer to a valid object
|
256
|
+
- \ref SU_ERROR_LAYER_LOCKED if entity is on a locked layer
|
257
|
+
- \ref SU_ERROR_ENTITY_LOCKED if entity is locked
|
258
|
+
- \ref SU_ERROR_INVALID_INPUT if group does not refer to a valid object
|
259
|
+
- \ref SU_ERROR_GENERIC if entity and group are not in the same document
|
260
|
+
- \ref SU_ERROR_GENERIC if entity and group belong to different pages, or if
|
261
|
+
one is shared and the other is not
|
262
|
+
*/
|
263
|
+
LO_RESULT LOEntityMoveToGroup(LOEntityRef entity, LOGroupRef group);
|
264
|
+
|
265
|
+
/**
|
266
|
+
@brief Gets the style of an entity.
|
267
|
+
@param[in] entity The entity object.
|
268
|
+
@param[out] style The style object.
|
269
|
+
@return
|
270
|
+
- \ref SU_ERROR_NONE on success
|
271
|
+
- \ref SU_ERROR_INVALID_INPUT if entity does not refer to a valid object
|
272
|
+
- \ref SU_ERROR_INVALID_OUTPUT if style does not refer to a valid object
|
273
|
+
- \ref SU_ERROR_NO_DATA if entity is a group, and thus has no style
|
274
|
+
*/
|
275
|
+
LO_RESULT LOEntityGetStyle(LOEntityRef entity, LOStyleRef style);
|
276
|
+
|
277
|
+
/**
|
278
|
+
@brief Sets the style of an entity.
|
279
|
+
@param[in] entity The entity object.
|
280
|
+
@param[out] style The style object.
|
281
|
+
@return
|
282
|
+
- \ref SU_ERROR_NONE on success
|
283
|
+
- \ref SU_ERROR_INVALID_INPUT if entity does not refer to a valid object
|
284
|
+
- \ref SU_ERROR_INVALID_INPUT if style does not refer to a valid object
|
285
|
+
- \ref SU_ERROR_LAYER_LOCKED if entity is on a locked layer
|
286
|
+
- \ref SU_ERROR_ENTITY_LOCKED if entity is locked
|
287
|
+
*/
|
288
|
+
LO_RESULT LOEntitySetStyle(LOEntityRef entity, LOStyleRef style);
|
289
|
+
/**
|
290
|
+
@brief Gets whether or not an entity is on a shared layer. This function
|
291
|
+
works for all entity types, including groups. Groups do not belong to a
|
292
|
+
specific layer, but their children are all on either a shared or
|
293
|
+
non-shared layer.
|
294
|
+
@param[in] entity The entity object.
|
295
|
+
@param[out] is_on_shared_layer Whether the entity is on a shared layer.
|
296
|
+
@return
|
297
|
+
- \ref SU_ERROR_NONE on success
|
298
|
+
- \ref SU_ERROR_INVALID_INPUT if entity does not refer to a valid object
|
299
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if is_on_shared_layer is NULL
|
300
|
+
- \ref SU_ERROR_NO_DATA if entity does not belong to a document
|
301
|
+
*/
|
302
|
+
LO_RESULT LOEntityIsOnSharedLayer(LOEntityRef entity, bool* is_on_shared_layer);
|
303
|
+
|
304
|
+
/**
|
305
|
+
@brief Gets whether an entity is locked.
|
306
|
+
@since LayOut 2018, API 3.0
|
307
|
+
@param[in] entity The entity object.
|
308
|
+
@param[out] is_locked Whether the entity is locked or unlocked.
|
309
|
+
@return
|
310
|
+
- \ref SU_ERROR_NONE on success
|
311
|
+
- \ref SU_ERROR_INVALID_INPUT if entity does not refer to a valid object
|
312
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if is_locked is NULL
|
313
|
+
*/
|
314
|
+
LO_RESULT LOEntityGetLocked(LOEntityRef entity, bool* is_locked);
|
315
|
+
|
316
|
+
/**
|
317
|
+
@brief Sets an entity to be locked or unlocked.
|
318
|
+
@since LayOut 2018, API 3.0
|
319
|
+
@param[in] entity The entity object.
|
320
|
+
@param[in] lock Whether the entity should be locked or unlocked.
|
321
|
+
@return
|
322
|
+
- \ref SU_ERROR_NONE on success
|
323
|
+
- \ref SU_ERROR_INVALID_INPUT if entity does not refer to a valid object
|
324
|
+
*/
|
325
|
+
LO_RESULT LOEntitySetLocked(LOEntityRef entity, bool lock);
|
326
|
+
|
327
|
+
#ifdef __cplusplus
|
328
|
+
} // end extern "C"
|
329
|
+
#endif // __cplusplus
|
330
|
+
#endif // LAYOUT_MODEL_ENTITY_H_
|
@@ -0,0 +1,49 @@
|
|
1
|
+
// Copyright 2015 Trimble Navigation Ltd. All rights reserved.
|
2
|
+
// This file is intended for public distribution.
|
3
|
+
|
4
|
+
#ifndef LAYOUT_MODEL_ENTITYITERATOR_H_
|
5
|
+
#define LAYOUT_MODEL_ENTITYITERATOR_H_
|
6
|
+
|
7
|
+
#include <LayOutAPI/common.h>
|
8
|
+
#include <LayOutAPI/model/defs.h>
|
9
|
+
|
10
|
+
/**
|
11
|
+
@struct LOEntityIteratorRef
|
12
|
+
@brief References an iterator for \ref LOEntityRef objects.
|
13
|
+
*/
|
14
|
+
|
15
|
+
#ifdef __cplusplus
|
16
|
+
extern "C" {
|
17
|
+
#endif // __cplusplus
|
18
|
+
|
19
|
+
/**
|
20
|
+
@brief Releases an entity iterator object. *entity_iterator will be set to
|
21
|
+
invalid by this function.
|
22
|
+
@param[in] entity_iterator The entity iterator object.
|
23
|
+
@return
|
24
|
+
- \ref SU_ERROR_NONE on success
|
25
|
+
- \ref SU_ERROR_NULL_POINTER_INPUT if entity_iterator is NULL
|
26
|
+
- \ref SU_ERROR_INVALID_INPUT if *entity_iterator does not refer to a valid
|
27
|
+
object
|
28
|
+
*/
|
29
|
+
LO_RESULT LOEntityIteratorRelease(LOEntityIteratorRef* entity_iterator);
|
30
|
+
|
31
|
+
/**
|
32
|
+
@brief Gets a reference to the current entity and increment the iterator.
|
33
|
+
entity will be set to an invalid object upon reaching the end of the
|
34
|
+
iterator.
|
35
|
+
@param[in] entity_iterator The entity iterator object.
|
36
|
+
@param[out] entity The entity object.
|
37
|
+
@return
|
38
|
+
- \ref SU_ERROR_NONE on success
|
39
|
+
- \ref SU_ERROR_INVALID_INPUT if entity_iterator does not refer to a valid
|
40
|
+
object
|
41
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if entity does not refer to a valid object
|
42
|
+
*/
|
43
|
+
LO_RESULT LOEntityIteratorNext(LOEntityIteratorRef entity_iterator, LOEntityRef* entity);
|
44
|
+
|
45
|
+
#ifdef __cplusplus
|
46
|
+
} // end extern "C"
|
47
|
+
#endif // __cplusplus
|
48
|
+
|
49
|
+
#endif // LAYOUT_MODEL_ENTITYITERATOR_H_
|
@@ -0,0 +1,114 @@
|
|
1
|
+
// Copyright 2015 Trimble Navigation Ltd. All rights reserved.
|
2
|
+
// This file is intended for public distribution.
|
3
|
+
|
4
|
+
#ifndef LAYOUT_MODEL_ENTITY_LIST_H_
|
5
|
+
#define LAYOUT_MODEL_ENTITY_LIST_H_
|
6
|
+
|
7
|
+
#include <LayOutAPI/common.h>
|
8
|
+
#include <LayOutAPI/model/defs.h>
|
9
|
+
|
10
|
+
/**
|
11
|
+
@struct LOEntityListRef
|
12
|
+
@brief References an ordered, indexable list of \ref LOEntityRef objects.
|
13
|
+
*/
|
14
|
+
|
15
|
+
#ifdef __cplusplus
|
16
|
+
extern "C" {
|
17
|
+
#endif // __cplusplus
|
18
|
+
|
19
|
+
/**
|
20
|
+
@brief Creates a new entity list object.
|
21
|
+
@param[out] entity_list The entity list object.
|
22
|
+
@return
|
23
|
+
- \ref SU_ERROR_NONE on success
|
24
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if entity_list is NULL
|
25
|
+
- \ref SU_ERROR_OVERWRITE_VALID if *entity_list already refers to a valid
|
26
|
+
object
|
27
|
+
*/
|
28
|
+
LO_RESULT LOEntityListCreate(LOEntityListRef* entity_list);
|
29
|
+
|
30
|
+
/**
|
31
|
+
@brief Releases an entity list object. *entity_list will be set to invalid by
|
32
|
+
this function.
|
33
|
+
@return
|
34
|
+
- \ref SU_ERROR_NONE on success
|
35
|
+
- \ref SU_ERROR_NULL_POINTER_INPUT if entity_list is NULL
|
36
|
+
- \ref SU_ERROR_INVALID_INPUT if *entity_list does not refer to a valid object
|
37
|
+
*/
|
38
|
+
LO_RESULT LOEntityListRelease(LOEntityListRef* entity_list);
|
39
|
+
|
40
|
+
/**
|
41
|
+
@brief Adds an entity to an entity list object.
|
42
|
+
@param[in] entity_list The entity list object.
|
43
|
+
@param[in] entity The entity object.
|
44
|
+
@return
|
45
|
+
- \ref SU_ERROR_NONE on success
|
46
|
+
- \ref SU_ERROR_INVALID_INPUT if entity_list does not refer to a valid object
|
47
|
+
- \ref SU_ERROR_INVALID_INPUT if entity does not refer to a valid object
|
48
|
+
*/
|
49
|
+
LO_RESULT LOEntityListAddEntity(LOEntityListRef entity_list, LOEntityRef entity);
|
50
|
+
|
51
|
+
/**
|
52
|
+
@brief Gets the number of entities in an entity list object.
|
53
|
+
@param[in] entity_list The entity list object.
|
54
|
+
@param[out] num_entities The number of entities in this list.
|
55
|
+
@return
|
56
|
+
- \ref SU_ERROR_NONE on success
|
57
|
+
- \ref SU_ERROR_INVALID_INPUT if entity_list does not refer to a valid object
|
58
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if num_entities is NULL
|
59
|
+
*/
|
60
|
+
LO_RESULT LOEntityListGetNumberOfEntities(LOEntityListRef entity_list, size_t* num_entities);
|
61
|
+
|
62
|
+
/**
|
63
|
+
@brief Gets the entity at the specified index in an entity list object.
|
64
|
+
@param[in] entity_list The entity list object.
|
65
|
+
@param[in] index The index of the entity to get.
|
66
|
+
@param[out] entity The entity object.
|
67
|
+
@return
|
68
|
+
- \ref SU_ERROR_NONE on success
|
69
|
+
- \ref SU_ERROR_INVALID_INPUT if entity_list does not refer to a valid object
|
70
|
+
- \ref SU_ERROR_OUT_OF_RANGE if index is out of range for this list
|
71
|
+
- \ref SU_ERROR_NULL_POINTER_OUTPUT if entity is NULL
|
72
|
+
- \ref SU_ERROR_OVERWRITE_VALID if *entity already refers to a valid object
|
73
|
+
*/
|
74
|
+
LO_RESULT LOEntityListGetEntityAtIndex(
|
75
|
+
LOEntityListRef entity_list, size_t index, LOEntityRef* entity);
|
76
|
+
|
77
|
+
/**
|
78
|
+
@brief Moves a list of entities to the given layer.
|
79
|
+
|
80
|
+
If the layer is non-shared and any entity is on a shared layer, pages must be valid and populated
|
81
|
+
with the pages to move the entities to. In all other cases, pages may be an invalid object. The
|
82
|
+
entities must belong to the same document as the layer and pages.
|
83
|
+
|
84
|
+
@bug In LayOut versions prior to LayOut 2024.0 this method would fail to move entities from
|
85
|
+
non-shared layers.
|
86
|
+
|
87
|
+
@param[in] entity_list The entity list object.
|
88
|
+
@param[in] layer The layer definition object.
|
89
|
+
@param[in] pages The page list object.
|
90
|
+
@return
|
91
|
+
- \ref SU_ERROR_NONE on success
|
92
|
+
- \ref SU_ERROR_INVALID_INPUT if \p entity_list does not refer to a valid object
|
93
|
+
- \ref SU_ERROR_INVALID_INPUT if \p entity_list is empty
|
94
|
+
- \ref SU_ERROR_INVALID_INPUT if \p entity_list contains the same entity reference more
|
95
|
+
than once
|
96
|
+
- \ref SU_ERROR_INVALID_INPUT if \p layer does not refer to a valid object
|
97
|
+
- \ref SU_ERROR_INVALID_INPUT if \p pages does not refer to a valid object and
|
98
|
+
\p layer is non-shared
|
99
|
+
- \ref SU_ERROR_INVALID_INPUT if \p pages is empty and \p layer is non-shared
|
100
|
+
- \ref SU_ERROR_INVALID_INPUT if \p pages contains the same page reference more
|
101
|
+
than once and \p layer is non-shared
|
102
|
+
- \ref SU_ERROR_GENERIC if any entity, \p layer, and \p pages are not all in the
|
103
|
+
same document
|
104
|
+
- \ref SU_ERROR_LAYER_LOCKED if \p layer is locked or if any entity is currently
|
105
|
+
on a locked layer
|
106
|
+
*/
|
107
|
+
LO_RESULT LOEntityListMoveToLayer(
|
108
|
+
LOEntityListRef entity_list, LOLayerRef layer, LOPageListRef pages);
|
109
|
+
|
110
|
+
#ifdef __cplusplus
|
111
|
+
} // end extern "C"
|
112
|
+
#endif // __cplusplus
|
113
|
+
|
114
|
+
#endif // LAYOUT_MODEL_ENTITY_LIST_H_
|