SUAPI-CppWrapper
C++WrapperforSketchUpCAPI
Public Member Functions
CW::Model Class Reference

Public Member Functions

 Model (SUModelRef model_ref, bool release_on_destroy=true)
 
 Model (std::string file_path)
 
 Model (const Model &other)
 
Modeloperator= (const Model &other)
 
SUModelRef ref () const
 
 operator SUModelRef () const
 
 operator SUModelRef * ()
 
 operator bool () const
 
bool operator! () const
 
std::string version_string () const
 
Layer active_layer () const
 
bool add_definition (ComponentDefinition &definition)
 
bool add_definitions (std::vector< ComponentDefinition > &definitions)
 
std::vector< AttributeDictionaryattribute_dictionaries () const
 
AttributeDictionary attribute_dictionary (const std::string &dict_name) const
 
Axes axes () const
 
Classifications classifications () const
 
std::vector< ComponentDefinitiondefinitions () const
 
std::vector< ComponentDefinitiongroup_definitions () const
 
InstancePath instance_path (const String &persistent_id) const
 
Entities entities () const
 
TypedValue get_attribute (const AttributeDictionary &dict, const std::string &key, const TypedValue &default_value) const
 
TypedValue get_attribute (const std::string &dict_name, const std::string &key, const TypedValue &default_value) const
 
std::vector< Layerlayers () const
 
void add_layers (std::vector< Layer > &layers)
 
bool layer_exists (const Layer &layer) const
 
std::vector< Materialmaterials () const
 
void add_materials (std::vector< Material > &materials)
 
bool material_exists (const Material &material) const
 
String name () const
 
bool name (const String &name_string)
 
size_t num_faces () const
 
OptionsManager options ()
 
SUResult save (const std::string &file_path)
 
bool save_with_version (const std::string &file_path, SUModelVersion version)
 
bool set_attribute (AttributeDictionary &dict, const std::string &key, const TypedValue &value)
 
bool set_attribute (const std::string &dict_name, const std::string &key, const TypedValue &value)
 
ShadowInfo shadow_info ()
 
RenderingOptions rendering_options ()
 RenderingOptions.
 

Detailed Description

Definition at line 56 of file Model.hpp.

Constructor & Destructor Documentation

CW::Model::Model ( const Model other)

Copy Constructor

Definition at line 78 of file Model.cpp.

Member Function Documentation

bool CW::Model::add_definition ( ComponentDefinition definition)

Adds the Component Definition to the model

Parameters
definitionthe ComponentDefinition object to add to the model.
Returns
true if definition was succeffully added, false, if error.

Definition at line 147 of file Model.cpp.

void CW::Model::add_layers ( std::vector< Layer > &  layers)

Add layers to the model.

Parameters
layers- vector of layer objects to add. The layers must not be attached to any other model object.

Definition at line 362 of file Model.cpp.

void CW::Model::add_materials ( std::vector< Material > &  materials)

Add materials to the model.

Parameters
materials- vector of material objects which must not be attached to any other model object.

Definition at line 421 of file Model.cpp.

InstancePath CW::Model::instance_path ( const String persistent_id) const

Returns the InstancePath of the given persistent ID in this model.

Returns
InstancePath object of the given persistent ID.

Definition at line 276 of file Model.cpp.

bool CW::Model::layer_exists ( const Layer layer) const

Checks if the given layer is in the list of layers in this model. This is an expensive method, and is recommended to be used only in debugging.

Parameters
layer- the layer object to check
Returns
true if the layer is in the model.

Definition at line 382 of file Model.cpp.

bool CW::Model::material_exists ( const Material material) const

Checks if the given material is in the list of materials in this model. This is a very expensive method, and is recommended to be used only in debugging.

Parameters
material- the material object to check
Returns
true if the material is in the model.

Definition at line 441 of file Model.cpp.

bool CW::Model::operator! ( ) const

NOT operator. Checks if the SUModelRef is invalid.

Returns
true if the model is invalid

Definition at line 114 of file Model.cpp.

Model& CW::Model::operator= ( const Model other)

Copy Assignment Operator

SUModelRef CW::Model::ref ( ) const

Returns SUModelRef object for the Model.

Definition at line 91 of file Model.cpp.

std::string CW::Model::version_string ( ) const

Returns a string of the model version in the form "major.minor.build"

Definition at line 118 of file Model.cpp.


The documentation for this class was generated from the following files: