36 #include <SketchUpAPI/model/entity.h> 38 #include "SUAPI-CppWrapper/model/TypedValue.hpp" 43 class AttributeDictionary;
86 Entity(
const Entity& other, SUEntityRef entity_ref = SU_INVALID);
103 operator SUEntityRef()
const;
110 operator SUEntityRef*();
117 SUEntityRef ref()
const;
275 static const size_t shift = (size_t)log2(1 +
sizeof(
CW::Entity));
276 return (
size_t)(k.
m_entity.ptr) >> shift;
bool m_attached
Indicates whether the Entity has been attached to a model.
TypedValue get_attribute(const std::string &dict_name, const std::string &key, const TypedValue &default_value=TypedValue()) const
Retrieves the value of an attribute in the entity's attribute dictionary.
Entity()
Constructor representing a null objject.
bool attached() const
Returns true if the entity is attached to another object.
friend bool operator==(const Entity &lhs, const Entity &rhs)
Equality operator for two entity objects.
friend bool operator!=(const Entity &lhs, const Entity &rhs)
Non-equality operator for two entity objects.
bool copy_attributes_from(const Entity &entity)
Copies attributes from another Entity object to this one.
std::vector< AttributeDictionary > attribute_dictionaries() const
Returns the AttributeDictionaries collection attached to the entity.
enum SURefType entity_type() const
Returns the type of the entity. See enum SURefType.
SUEntityRef m_entity
The C SUEntityRef that this class wraps.
int32_t entityID() const
Retrieve a unique ID assigned to an entity.
bool is_valid() const
Checks if the entity is valid.
bool add_dictionary(AttributeDictionary &dict)
Adds the AttributeDictionary to the Entity.
bool operator!() const
Returns true if this entity is not valid. Alias of !is_valid().
int64_t persistent_id() const
bool set_attribute(const std::string &dict_name, const std::string &key, const TypedValue &value)
Sets the value of an attribute in the given AttributeDictionary object.
AttributeDictionary attribute_dictionary(const std::string &name) const
Returns an attribute dictionary object with a given name that is attached to an Entity.
Entity & operator=(const Entity &other)
Copy assignment operator.