LayOut C API
|
#include <LayOutAPI/common.h>
#include <LayOutAPI/geometry/geometry.h>
#include <LayOutAPI/model/defs.h>
#include <SketchUpAPI/model/defs.h>
Go to the source code of this file.
Enumerations | |
enum | LOSketchUpModelRenderMode { LOSketchUpModelRenderMode_Raster = 0, LOSketchUpModelRenderMode_Hybrid, LOSketchUpModelRenderMode_Vector, LONumSketchUpModelRenderModes } |
Defines the different rendering modes available for a SketchUp model. More... | |
enum | LOSketchUpModelStandardView { LOSketchUpModelStandardView_Top = 0, LOSketchUpModelStandardView_RelativeTop, LOSketchUpModelStandardView_Bottom, LOSketchUpModelStandardView_RelativeBottom, LOSketchUpModelStandardView_Front, LOSketchUpModelStandardView_Back, LOSketchUpModelStandardView_Left, LOSketchUpModelStandardView_Right, LOSketchUpModelStandardView_Iso, LONumSketchUpModelStandardViews } |
Defines the standard views available for a SketchUp model. Relative views are not necessarily aligned to the corresponding axes like regular views, but rather they maintain the alignment from the previous position of the camera. More... | |
Functions | |
LO_RESULT | LOSketchUpModelCreate (LOSketchUpModelRef *model, const char *path, const LOAxisAlignedRect2D *bounds) |
Creates a new SketchUp model object with the specified bounds that references the specified SketchUp file. More... | |
LO_RESULT | LOSketchUpModelAddReference (LOSketchUpModelRef model) |
Adds a reference to a SketchUp model object. More... | |
LO_RESULT | LOSketchUpModelRelease (LOSketchUpModelRef *model) |
Releases a SketchUp model object. The object will be invalidated if releasing the last reference. More... | |
LO_EXPORT LOSketchUpModelRef | LOSketchUpModelFromEntity (LOEntityRef entity) |
Converts from a LOEntityRef to a LOSketchUpModelRef. This is essentially a downcast operation so the given LOEntityRef must be convertible to a LOSketchUpModelRef. More... | |
LO_EXPORT LOEntityRef | LOSketchUpModelToEntity (LOSketchUpModelRef model) |
Converts from a LOSketchUpModelRef to a LOEntityRef. This is essentially an upcast operation. More... | |
LO_RESULT | LOSketchUpModelGetModel (LOSketchUpModelRef model, SUModelRef *sumodel) |
Gets the SUModelRef representation of the SketchUp model. More... | |
LO_RESULT | LOSketchUpModelGetRenderMode (LOSketchUpModelRef model, LOSketchUpModelRenderMode *render_mode) |
Gets the render mode of the SketchUp model. More... | |
LO_RESULT | LOSketchUpModelSetRenderMode (LOSketchUpModelRef model, LOSketchUpModelRenderMode render_mode) |
Sets the render mode of the SketchUp model. More... | |
LO_RESULT | LOSketchUpModelRender (LOSketchUpModelRef model) |
Renders the SketchUp model. If the model belongs to a LODocumentRef, then the render will be performed at the resolution set in document.page_info (see LODocumentRef and LOPageInfoRef). Otherwise, the render will be performed at Low resolution. More... | |
LO_RESULT | LOSketchUpModelIsRenderNeeded (LOSketchUpModelRef model, bool *render_needed) |
Gets the status indicating whether the SketchUp model needs to be rendered. More... | |
LO_RESULT | LOSketchUpModelGetNumberOfAvailableScenes (LOSketchUpModelRef model, size_t *number_of_scenes) |
Gets the number of scenes that are available for a SketchUp model. Use this to determine the size of the array that should be passed to LOSketchUpModelGetAvailableScenes. More... | |
LO_RESULT | LOSketchUpModelGetAvailableScenes (LOSketchUpModelRef model, size_t len, SUStringRef scenes[], size_t *count) |
Gets the array of scenes that are available for a SketchUp model. The first scene returned will always be the default scene, called "Last saved SketchUp View". More... | |
LO_RESULT | LOSketchUpModelGetCurrentScene (LOSketchUpModelRef model, size_t *scene_index, bool *scene_modified) |
Gets the most recently selected scene of the SketchUp model. More... | |
LO_RESULT | LOSketchUpModelSetCurrentScene (LOSketchUpModelRef model, size_t scene_index) |
Sets the scene of the SketchUp model. More... | |
LO_RESULT | LOSketchUpModelGetCameraModified (LOSketchUpModelRef model, bool *modified) |
Gets whether the SketchUp model's camera has been modified. More... | |
LO_RESULT | LOSketchUpModelResetCamera (LOSketchUpModelRef model) |
Resets the SketchUp model's camera to the scene's setting. More... | |
LO_RESULT | LOSketchUpModelGetEffectsModified (LOSketchUpModelRef model, bool *modified) |
Gets whether the SketchUp model's shadow or fog effects have been modified. More... | |
LO_RESULT | LOSketchUpModelResetEffects (LOSketchUpModelRef model) |
Resets the SketchUp model's shadow and fog effects to the scene's settings. More... | |
LO_RESULT | LOSketchUpModelGetStyleModified (LOSketchUpModelRef model, bool *modified) |
Gets whether the SketchUp model's style has been modified. More... | |
LO_RESULT | LOSketchUpModelResetStyle (LOSketchUpModelRef model) |
Resets the SketchUp model's style to the scene's setting. More... | |
LO_RESULT | LOSketchUpModelGetLayersModified (LOSketchUpModelRef model, bool *modified) |
Gets whether the SketchUp model's layers have been modified. More... | |
LO_RESULT | LOSketchUpModelResetLayers (LOSketchUpModelRef model) |
Resets the SketchUp model's layers to the scene's setting. More... | |
LO_RESULT | LOSketchUpModelGetDisplayBackground (LOSketchUpModelRef model, bool *display_background) |
Gets the status of whether or not the background is displayed for the SketchUp model. This setting only applies when the render mode is LOSketchUpModelRenderMode_Vector. More... | |
LO_RESULT | LOSketchUpModelSetDisplayBackground (LOSketchUpModelRef model, bool display_background) |
Sets the status of whether or not the background is displayed for the SketchUp model. This setting only applies when the render mode is LOSketchUpModelRenderMode_Vector. More... | |
LO_RESULT | LOSketchUpModelGetLineWeight (LOSketchUpModelRef model, double *line_weight) |
Gets the line weight in points for the SketchUp model. More... | |
LO_RESULT | LOSketchUpModelSetLineWeight (LOSketchUpModelRef model, double line_weight) |
Sets the line weight in points for the SketchUp model. More... | |
LO_RESULT | LOSketchUpModelGetDashScale (LOSketchUpModelRef model, double *dash_scale) |
Gets the scale for dashes in the SketchUp model. A scale value of 0.0 means the dashes are scaled based on the line weight. More... | |
LO_RESULT | LOSketchUpModelSetDashScale (LOSketchUpModelRef model, double dash_scale) |
Sets the scale for dashes in the SketchUp model. A scale value of 0.0 or lower will "auto" scale the dashes based on the line weight. More... | |
LO_RESULT | LOSketchUpModelGetPerspective (LOSketchUpModelRef model, bool *perspective) |
Gets whether or not the view is rendered in perspective mode. More... | |
LO_RESULT | LOSketchUpModelSetPerspective (LOSketchUpModelRef model, bool perspective) |
Sets whether or not the view is rendered in perspective mode. More... | |
LO_RESULT | LOSketchUpModelGetStandardView (LOSketchUpModelRef model, LOSketchUpModelStandardView *view) |
Gets the standard view that a SketchUp model is currently set to. More... | |
LO_RESULT | LOSketchUpModelSetStandardView (LOSketchUpModelRef model, LOSketchUpModelStandardView view) |
Sets a SketchUp model to use a standard view. More... | |
LO_RESULT | LOSketchUpModelGetScale (LOSketchUpModelRef model, double *scale) |
Gets the scale of a SketchUp model. This is only valid to call for models that are rendered in orthographic (non-perspective) mode. More... | |
LO_RESULT | LOSketchUpModelSetScale (LOSketchUpModelRef model, double scale) |
Sets the scale of a SketchUp model. This is only valid to call for models that are rendered in orthographic (non-perspective) mode. More... | |
LO_RESULT | LOSketchUpModelGetPreserveScaleOnResize (LOSketchUpModelRef model, bool *preserve_scale) |
Gets whether or not the scale is preserved when the SketchUp model is resized. More... | |
LO_RESULT | LOSketchUpModelSetPreserveScaleOnResize (LOSketchUpModelRef model, bool preserve_scale) |
Sets whether or not the scale is preserved when the SketchUp model is resized. More... | |
LO_RESULT | LOSketchUpModelConvertModelPointToPaperPoint (LOSketchUpModelRef model, const LOPoint3D *model_point, LOPoint2D *paper_point) |
Converts a 3D model space point in the SketchUp model to a 2D paper space point on the page. More... | |
LO_RESULT | LOSketchUpModelGetClipMask (LOSketchUpModelRef model, LOEntityRef *clip_mask) |
Returns any clip mask assigned to the SketchUp model. More... | |
LO_RESULT | LOSketchUpModelSetClipMask (LOSketchUpModelRef model, LOEntityRef clip_mask) |
Sets the clip mask of the SketchUp model. A clip mask defines a region of the entity that is visible. This allows you to crop with arbitrary shapes. This operation will replace any clip mask that is already assigned to this model. The entity being used must not be already part of a document or group. The clip mask entity must be either a rectangle, ellipse or a path. More... | |
LO_RESULT | LOSketchUpModelGetExplodedEntities (LOSketchUpModelRef model, LOEntityListRef entity_list) |
Creates the entities that represent the SketchUp model in its exploded form and adds them to a LOEntityListRef. It is NOT necessary to explicitly release these entities, since LOEntityListRef itself adds a reference to the entities and will release them when they are removed from the list or when the list is released. NOTE The behavior of this method changed in API 3.0 - an exploded raster-rendered model will now wrap the LOImageRef in a LOGroupRef. More... | |
Defines the standard views available for a SketchUp model. Relative views are not necessarily aligned to the corresponding axes like regular views, but rather they maintain the alignment from the previous position of the camera.
LO_RESULT LOSketchUpModelAddReference | ( | LOSketchUpModelRef | model | ) |
Adds a reference to a SketchUp model object.
[in] | model | The SketchUp model object. |
LO_RESULT LOSketchUpModelConvertModelPointToPaperPoint | ( | LOSketchUpModelRef | model, |
const LOPoint3D * | model_point, | ||
LOPoint2D * | paper_point | ||
) |
Converts a 3D model space point in the SketchUp model to a 2D paper space point on the page.
[in] | model | The SketchUp model object. |
[in] | model_point | The 3D model space point. |
[out] | paper_point | The 2D paper space point. |
LO_RESULT LOSketchUpModelCreate | ( | LOSketchUpModelRef * | model, |
const char * | path, | ||
const LOAxisAlignedRect2D * | bounds | ||
) |
Creates a new SketchUp model object with the specified bounds that references the specified SketchUp file.
[out] | model | The SketchUp model object. |
[in] | path | The path to the SketchUp file. |
[in] | bounds | The starting dimensions of the SketchUp model. |
LO_EXPORT LOSketchUpModelRef LOSketchUpModelFromEntity | ( | LOEntityRef | entity | ) |
Converts from a LOEntityRef to a LOSketchUpModelRef. This is essentially a downcast operation so the given LOEntityRef must be convertible to a LOSketchUpModelRef.
[in] | entity | The entity object. |
LO_RESULT LOSketchUpModelGetAvailableScenes | ( | LOSketchUpModelRef | model, |
size_t | len, | ||
SUStringRef | scenes[], | ||
size_t * | count | ||
) |
Gets the array of scenes that are available for a SketchUp model. The first scene returned will always be the default scene, called "Last saved SketchUp View".
[in] | model | The SketchUp model object. |
[in] | len | The maximum number of scenes to retrieve. |
[out] | scenes | The names of the scenes retrieved. |
[out] | count | The number of scenes retrieved. |
LO_RESULT LOSketchUpModelGetCameraModified | ( | LOSketchUpModelRef | model, |
bool * | modified | ||
) |
Gets whether the SketchUp model's camera has been modified.
[in] | model | The SketchUp model object. |
[out] | modified | Indicates whether or not the camera has been modified in LayOut. |
LO_RESULT LOSketchUpModelGetClipMask | ( | LOSketchUpModelRef | model, |
LOEntityRef * | clip_mask | ||
) |
Returns any clip mask assigned to the SketchUp model.
[in] | model | The SketchUp model object. |
[out] | clip_mask | The clip mask of the SketchUp model. |
LO_RESULT LOSketchUpModelGetCurrentScene | ( | LOSketchUpModelRef | model, |
size_t * | scene_index, | ||
bool * | scene_modified | ||
) |
Gets the most recently selected scene of the SketchUp model.
[in] | model | The SketchUp model object. |
[out] | scene_index | The index of the SketchUp model's scene. This is an index into the list of available scenes returned by LOSketchUpModelGetAvailableScenes. |
[out] | scene_modified | Indicates whether or not the scene has been modified in LayOut. |
LO_RESULT LOSketchUpModelGetDashScale | ( | LOSketchUpModelRef | model, |
double * | dash_scale | ||
) |
Gets the scale for dashes in the SketchUp model. A scale value of 0.0 means the dashes are scaled based on the line weight.
[in] | model | The SketchUp model object. |
[out] | dash_scale | Dash scale. Will be in the range [0, 10]. |
LO_RESULT LOSketchUpModelGetDisplayBackground | ( | LOSketchUpModelRef | model, |
bool * | display_background | ||
) |
Gets the status of whether or not the background is displayed for the SketchUp model. This setting only applies when the render mode is LOSketchUpModelRenderMode_Vector.
[in] | model | The SketchUp model object. |
[out] | display_background | True if the background is displayed. |
LO_RESULT LOSketchUpModelGetEffectsModified | ( | LOSketchUpModelRef | model, |
bool * | modified | ||
) |
Gets whether the SketchUp model's shadow or fog effects have been modified.
[in] | model | The SketchUp model object. |
[out] | modified | Indicates whether or not the shadow or fog effects have been modified in LayOut. |
LO_RESULT LOSketchUpModelGetExplodedEntities | ( | LOSketchUpModelRef | model, |
LOEntityListRef | entity_list | ||
) |
Creates the entities that represent the SketchUp model in its exploded form and adds them to a LOEntityListRef. It is NOT necessary to explicitly release these entities, since LOEntityListRef itself adds a reference to the entities and will release them when they are removed from the list or when the list is released. NOTE The behavior of this method changed in API 3.0 - an exploded raster-rendered model will now wrap the LOImageRef in a LOGroupRef.
[in] | model | The SketchUp model object. |
[in] | entity_list | The entity list object to add the new entities to. |
LO_RESULT LOSketchUpModelGetLayersModified | ( | LOSketchUpModelRef | model, |
bool * | modified | ||
) |
Gets whether the SketchUp model's layers have been modified.
[in] | model | The SketchUp model object. |
[out] | modified | Indicates whether or not the tag have been modified in LayOut. |
LO_RESULT LOSketchUpModelGetLineWeight | ( | LOSketchUpModelRef | model, |
double * | line_weight | ||
) |
Gets the line weight in points for the SketchUp model.
[in] | model | The SketchUp model object. |
[out] | line_weight | Line weight in points. |
LO_RESULT LOSketchUpModelGetModel | ( | LOSketchUpModelRef | model, |
SUModelRef * | sumodel | ||
) |
Gets the SUModelRef representation of the SketchUp model.
[in] | model | The SketchUp model object. |
[out] | sumodel | The model reference object. |
LO_RESULT LOSketchUpModelGetNumberOfAvailableScenes | ( | LOSketchUpModelRef | model, |
size_t * | number_of_scenes | ||
) |
Gets the number of scenes that are available for a SketchUp model. Use this to determine the size of the array that should be passed to LOSketchUpModelGetAvailableScenes.
[in] | model | The SketchUp model object. |
[out] | number_of_scenes | The number of scenes. |
LO_RESULT LOSketchUpModelGetPerspective | ( | LOSketchUpModelRef | model, |
bool * | perspective | ||
) |
Gets whether or not the view is rendered in perspective mode.
[in] | model | The SketchUp model object. |
[out] | perspective | Whether or not the view is rendered in perspective mode. |
LO_RESULT LOSketchUpModelGetPreserveScaleOnResize | ( | LOSketchUpModelRef | model, |
bool * | preserve_scale | ||
) |
Gets whether or not the scale is preserved when the SketchUp model is resized.
[in] | model | The SketchUp model object. |
[out] | preserve_scale | True if the scale is preserved on resize. |
LO_RESULT LOSketchUpModelGetRenderMode | ( | LOSketchUpModelRef | model, |
LOSketchUpModelRenderMode * | render_mode | ||
) |
Gets the render mode of the SketchUp model.
[in] | model | The SketchUp model object. |
[out] | render_mode | The render mode of the SketchUp model. |
LO_RESULT LOSketchUpModelGetScale | ( | LOSketchUpModelRef | model, |
double * | scale | ||
) |
Gets the scale of a SketchUp model. This is only valid to call for models that are rendered in orthographic (non-perspective) mode.
[in] | model | The SketchUp model object. |
[out] | scale | The SketchUp model's scale. |
LO_RESULT LOSketchUpModelGetStandardView | ( | LOSketchUpModelRef | model, |
LOSketchUpModelStandardView * | view | ||
) |
Gets the standard view that a SketchUp model is currently set to.
[in] | model | The SketchUp model object. |
[out] | view | The standard view that the SketchUp model is currently set to. |
LO_RESULT LOSketchUpModelGetStyleModified | ( | LOSketchUpModelRef | model, |
bool * | modified | ||
) |
Gets whether the SketchUp model's style has been modified.
[in] | model | The SketchUp model object. |
[out] | modified | Indicates whether or not the style has been modified in LayOut. |
LO_RESULT LOSketchUpModelIsRenderNeeded | ( | LOSketchUpModelRef | model, |
bool * | render_needed | ||
) |
Gets the status indicating whether the SketchUp model needs to be rendered.
[in] | model | The SketchUp model object. |
[out] | render_needed | True if the SketchUp model needs to be rendered. |
LO_RESULT LOSketchUpModelRelease | ( | LOSketchUpModelRef * | model | ) |
Releases a SketchUp model object. The object will be invalidated if releasing the last reference.
[in] | model | The SketchUp model object. |
LO_RESULT LOSketchUpModelRender | ( | LOSketchUpModelRef | model | ) |
Renders the SketchUp model. If the model belongs to a LODocumentRef, then the render will be performed at the resolution set in document.page_info (see LODocumentRef and LOPageInfoRef). Otherwise, the render will be performed at Low resolution.
[in] | model | The SketchUp model object. |
LO_RESULT LOSketchUpModelResetCamera | ( | LOSketchUpModelRef | model | ) |
Resets the SketchUp model's camera to the scene's setting.
[in] | model | The SketchUp model object. |
LO_RESULT LOSketchUpModelResetEffects | ( | LOSketchUpModelRef | model | ) |
Resets the SketchUp model's shadow and fog effects to the scene's settings.
[in] | model | The SketchUp model object. |
LO_RESULT LOSketchUpModelResetLayers | ( | LOSketchUpModelRef | model | ) |
Resets the SketchUp model's layers to the scene's setting.
[in] | model | The SketchUp model object. |
LO_RESULT LOSketchUpModelResetStyle | ( | LOSketchUpModelRef | model | ) |
Resets the SketchUp model's style to the scene's setting.
[in] | model | The SketchUp model object. |
LO_RESULT LOSketchUpModelSetClipMask | ( | LOSketchUpModelRef | model, |
LOEntityRef | clip_mask | ||
) |
Sets the clip mask of the SketchUp model. A clip mask defines a region of the entity that is visible. This allows you to crop with arbitrary shapes. This operation will replace any clip mask that is already assigned to this model. The entity being used must not be already part of a document or group. The clip mask entity must be either a rectangle, ellipse or a path.
[in] | model | The SketchUp model object. |
[in] | clip_mask | The new clip mask for the SketchUp model. |
LO_RESULT LOSketchUpModelSetCurrentScene | ( | LOSketchUpModelRef | model, |
size_t | scene_index | ||
) |
Sets the scene of the SketchUp model.
[in] | model | The SketchUp model object. |
[in] | scene_index | The index of the scene. This is an index into the list of available scenes returned by LOSketchUpModelGetAvailableScenes. |
LO_RESULT LOSketchUpModelSetDashScale | ( | LOSketchUpModelRef | model, |
double | dash_scale | ||
) |
Sets the scale for dashes in the SketchUp model. A scale value of 0.0 or lower will "auto" scale the dashes based on the line weight.
[in] | model | The SketchUp model object. |
[in] | dash_scale | Dash scale. A value less than zero will be set to 0. |
LO_RESULT LOSketchUpModelSetDisplayBackground | ( | LOSketchUpModelRef | model, |
bool | display_background | ||
) |
Sets the status of whether or not the background is displayed for the SketchUp model. This setting only applies when the render mode is LOSketchUpModelRenderMode_Vector.
[in] | model | The SketchUp model object. |
[in] | display_background | True if the background should be displayed. |
LO_RESULT LOSketchUpModelSetLineWeight | ( | LOSketchUpModelRef | model, |
double | line_weight | ||
) |
Sets the line weight in points for the SketchUp model.
[in] | model | The SketchUp model object. |
[in] | line_weight | Line weight in points. |
LO_RESULT LOSketchUpModelSetPerspective | ( | LOSketchUpModelRef | model, |
bool | perspective | ||
) |
Sets whether or not the view is rendered in perspective mode.
[in] | model | The SketchUp model object. |
[in] | perspective | Whether or not the view should be rendered in perspective mode. |
LO_RESULT LOSketchUpModelSetPreserveScaleOnResize | ( | LOSketchUpModelRef | model, |
bool | preserve_scale | ||
) |
Sets whether or not the scale is preserved when the SketchUp model is resized.
[in] | model | The SketchUp model object. |
[in] | preserve_scale | True if the scale should be preserved on resize. |
LO_RESULT LOSketchUpModelSetRenderMode | ( | LOSketchUpModelRef | model, |
LOSketchUpModelRenderMode | render_mode | ||
) |
Sets the render mode of the SketchUp model.
[in] | model | The SketchUp model object. |
[in] | render_mode | The new render mode for the SketchUp model. |
LO_RESULT LOSketchUpModelSetScale | ( | LOSketchUpModelRef | model, |
double | scale | ||
) |
Sets the scale of a SketchUp model. This is only valid to call for models that are rendered in orthographic (non-perspective) mode.
[in] | model | The SketchUp model object. |
[in] | scale | The new scale for the SketchUp model. |
LO_RESULT LOSketchUpModelSetStandardView | ( | LOSketchUpModelRef | model, |
LOSketchUpModelStandardView | view | ||
) |
Sets a SketchUp model to use a standard view.
[in] | model | The SketchUp model object. |
[in] | view | The standard view to use.
|
LO_EXPORT LOEntityRef LOSketchUpModelToEntity | ( | LOSketchUpModelRef | model | ) |
Converts from a LOSketchUpModelRef to a LOEntityRef. This is essentially an upcast operation.
[in] | model | The SketchUp model object. |