28 #ifndef GeometryInput_hpp 29 #define GeometryInput_hpp 35 #include <unordered_map> 37 #include <SketchUpAPI/geometry.h> 38 #include <SketchUpAPI/model/entities.h> 40 #include "SUAPI-CppWrapper/Geometry.hpp" 70 SUGeometryInputRef m_geometry_input;
74 SUModelRef m_target_model;
76 size_t m_vertex_index = 0;
79 static std::unordered_map<SUGeometryInputRef, size_t> num_objects_;
84 static SUGeometryInputRef create_geometry_input();
107 SUGeometryInputRef
ref()
const;
125 size_t add_face(
const Face &face,
bool copy_material_layer =
true);
132 size_t add_face(
const std::vector<Loop>& loops);
134 size_t add_faces(
const std::vector<Face>& faces,
bool copy_material_layer =
true);
141 size_t add_edges(
const std::vector<Edge>& edges);
159 void set_vertices(
const std::vector<SUPoint3D>& points);
168 size_t add_edge(
size_t vertex0_index,
size_t vertex1_index);
183 void edge_soft(
size_t edge_index,
bool soft);
216 size_t add_curve(
const std::vector<size_t>& edge_indices);
230 std::pair<size_t, size_t>
add_arc_curve(
size_t start_point,
size_t end_point,
const Point3D& center,
const Vector3D& normal,
size_t num_segments);
292 std::array<size_t, 5>
counts()
const;
305 template <>
struct hash<SUGeometryInputRef>
307 size_t operator()(
const SUGeometryInputRef& k)
const 309 static const size_t shift = (size_t)log2(1 +
sizeof(SUGeometryInputRef));
310 return (
size_t)(k.ptr) >> shift;