SUAPI-CppWrapper
C++WrapperforSketchUpCAPI
Public Member Functions
CW::Face Class Reference
+ Inheritance diagram for CW::Face:

Public Member Functions

 Face ()
 
 Face (std::vector< Point3D > &outer_loop)
 
 Face (std::vector< Point3D > &outer_loop, LoopInput &loop_input)
 
 Face (SUFaceRef face, bool attached=true)
 
 Face (const Face &other)
 
 ~Face ()
 
Faceoperator= (const Face &other)
 
SUFaceRef ref () const
 
 operator SUFaceRef () const
 
 operator bool () const
 
bool operator! () const
 
double area () const
 
void add_inner_loop (std::vector< Point3D > &points, LoopInput &loop_input)
 
Material back_material () const
 
Material back_material (const Material &material)
 
FacePointClass classify_point (const Point3D &point)
 
std::vector< Edgeedges ()
 
Vector3D get_texture_projection (const bool frontside) const
 
std::vector< Loopinner_loops () const
 
std::vector< Looploops () const
 
Vector3D normal () const
 
Loop outer_loop () const
 
Plane3D plane () const
 
Facereverse ()
 
std::vector< Vertexvertices () const
 
- Public Member Functions inherited from CW::DrawingElement
 DrawingElement (SUDrawingElementRef drawing_element, bool attached=true)
 
 DrawingElement (const DrawingElement &other, SUDrawingElementRef element_ref=SU_INVALID)
 
 DrawingElement ()
 
DrawingElementoperator= (const DrawingElement &other)
 
SUDrawingElementRef ref () const
 
 operator SUDrawingElementRef () const
 
 operator SUDrawingElementRef * ()
 
BoundingBox3D bounds ()
 
bool copy_properties_from (const DrawingElement &element)
 
bool casts_shadows () const
 
bool casts_shadows (bool casts_shadows)
 
bool hidden () const
 
bool hidden (bool hidden)
 
Layer layer () const
 
bool layer (Layer &layer)
 
Material material () const
 
bool material (const Material &material)
 
bool receive_shadows () const
 
bool receive_shadows (bool receive_shadows)
 
- Public Member Functions inherited from CW::Entity
 Entity ()
 Constructor representing a null objject.
 
 Entity (SUEntityRef entity, bool attached=true)
 Creates a new Entity object. More...
 
 Entity (const Entity &other, SUEntityRef entity_ref=SU_INVALID)
 Copy constructor with an optional parameter for the entity reference. More...
 
 ~Entity ()
 Destructor. More...
 
Entityoperator= (const Entity &other)
 Copy assignment operator.
 
 operator SUEntityRef () const
 
 operator SUEntityRef * ()
 
SUEntityRef ref () const
 
bool attached () const
 Returns true if the entity is attached to another object.
 
void attached (bool attach)
 Method lets the object know that it has been attached to a model. This is important as it will let the object know that it does not need to "release" the object. More...
 
std::vector< AttributeDictionaryattribute_dictionaries () const
 Returns the AttributeDictionaries collection attached to the entity. More...
 
AttributeDictionary attribute_dictionary (const std::string &name) const
 Returns an attribute dictionary object with a given name that is attached to an Entity. More...
 
bool add_dictionary (AttributeDictionary &dict)
 Adds the AttributeDictionary to the Entity. More...
 
bool copy_attributes_from (const Entity &entity)
 Copies attributes from another Entity object to this one. More...
 
bool is_valid () const
 Checks if the entity is valid. More...
 
bool operator! () const
 Returns true if this entity is not valid. Alias of !is_valid().
 
int32_t entityID () const
 Retrieve a unique ID assigned to an entity. More...
 
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. More...
 
TypedValue get_attribute (const AttributeDictionary &dict, const std::string &key, const TypedValue &default_value=TypedValue()) const
 Retrieves the value of an attribute in the entity's attribute dictionary. More...
 
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. More...
 
bool set_attribute (AttributeDictionary &dict, const std::string &key, const TypedValue &value)
 Sets the value of an attribute in the given AttributeDictionary object. More...
 
enum SURefType entity_type () const
 Returns the type of the entity. See enum SURefType.
 
Model model () const
 
Entities parent () const
 
int64_t persistent_id () const
 

Additional Inherited Members

- Protected Attributes inherited from CW::Entity
SUEntityRef m_entity
 The C SUEntityRef that this class wraps.
 
bool m_attached
 Indicates whether the Entity has been attached to a model.
 

Detailed Description

Definition at line 62 of file Face.hpp.

Constructor & Destructor Documentation

CW::Face::Face ( )

Constructor for creating a null object.

Definition at line 93 of file Face.cpp.

CW::Face::Face ( const Face other)

Copy constructor

The code below causes errors as the face has not been attached to an object yet. Add the inner loops std::vector<Loop> inner_loops = other.inner_loops(); std::vector<std::vector<Point3D>> inner_loops_points; inner_loops_points.reserve(inner_loops.size()); for (size_t i=0; i < inner_loops.size(); ++i) { std::vector<Point3D> inner_points = inner_loops[i].points(); LoopInput inner_loop_input = inner_loops[i].loop_input(); add_inner_loop(inner_points, inner_loop_input); }

Definition at line 114 of file Face.cpp.

CW::Face::~Face ( )

Destructor

Definition at line 134 of file Face.cpp.

Member Function Documentation

void CW::Face::add_inner_loop ( std::vector< Point3D > &  points,
LoopInput loop_input 
)

Adds an inner loop to the face.

Parameters
points- a vector of points representing the vertices of the inner loop.
loop_input- the loop input object with details about the edges

Definition at line 187 of file Face.cpp.

std::vector< Loop > CW::Face::inner_loops ( ) const

NOT POSSIBLE WITH C API -

See also
class MaterialInput

Definition at line 315 of file Face.cpp.

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

NOT operator. Checks if the object is valid.

Returns
true if the curve is invalid

Definition at line 168 of file Face.cpp.

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

Copy assignment operator

Definition at line 146 of file Face.cpp.

Face & CW::Face::reverse ( )

NOT POSSIBLE WITH C API -

See also
class MaterialInput

Definition at line 384 of file Face.cpp.

std::vector< Vertex > CW::Face::vertices ( ) const

NOT POSSIBLE WITH C API -

See also
class MaterialInput

NOT POSSIBLE WITH C API -

See also
class MaterialInput bool Face::set_texture_projection(const Vector3D& vector, bool frontside) {}

bool Face::set_texture_projection(bool remove, bool frontside) {}

Definition at line 408 of file Face.cpp.


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