6
#include "PrintConfig.hpp"
9
%name{Slic3r::Model} class Model {
14
%code%{ RETVAL = THIS; %};
16
%name{_add_object} Ref<ModelObject> add_object();
17
Ref<ModelObject> _add_object_clone(ModelObject* other)
18
%code%{ RETVAL = THIS->add_object(*other); %};
19
void delete_object(size_t idx);
22
Ref<ModelMaterial> get_material(t_model_material_id material_id)
24
RETVAL = THIS->get_material(material_id);
30
%name{add_material} Ref<ModelMaterial> add_material(t_model_material_id material_id);
31
Ref<ModelMaterial> add_material_clone(t_model_material_id material_id, ModelMaterial* other)
32
%code%{ RETVAL = THIS->add_material(material_id, *other); %};
33
bool has_material(t_model_material_id material_id) const
35
RETVAL = (THIS->get_material(material_id) != NULL);
37
void delete_material(t_model_material_id material_id);
38
void clear_materials();
40
std::vector<std::string> material_names() const
42
for (ModelMaterialMap::iterator i = THIS->materials.begin();
43
i != THIS->materials.end(); ++i)
45
RETVAL.push_back(i->first);
49
size_t material_count() const
50
%code%{ RETVAL = THIS->materials.size(); %};
52
// void duplicate_objects_grid(coordf_t x, coordf_t y, coordf_t distance);
53
// void duplicate_objects(size_t copies_num, coordf_t distance, const BoundingBox &bb);
54
// void arrange_objects(coordf_t distance, const BoundingBox &bb);
55
// void duplicate(size_t copies_num, coordf_t distance, const BoundingBox &bb);
56
bool has_objects_with_no_instances() const;
57
// void bounding_box(BoundingBox* bb) const;
58
// void center_instances_around_point(const Pointf &point);
59
// void align_instances_to_origin();
60
// void translate(coordf_t x, coordf_t y, coordf_t z);
61
// void mesh(TriangleMesh* mesh) const;
62
// void split_meshes();
63
// std::string get_material_name(t_model_material_id material_id);
65
ModelObjectPtrs* objects()
66
%code%{ RETVAL = &THIS->objects; %};
70
%name{Slic3r::Model::Material} class ModelMaterial {
72
%code%{ RETVAL = THIS->get_model(); %};
74
Ref<DynamicPrintConfig> config()
75
%code%{ RETVAL = &THIS->config; %};
77
std::string get_attribute(std::string name)
78
%code%{ if (THIS->attributes.find(name) != THIS->attributes.end()) RETVAL = THIS->attributes[name]; %};
80
void set_attribute(std::string name, std::string value)
81
%code%{ THIS->attributes[name] = value; %};
86
ModelMaterial::attributes()
89
for (t_model_material_attributes::const_iterator attr = THIS->attributes.begin(); attr != THIS->attributes.end(); ++attr) {
90
(void)hv_store( hv, attr->first.c_str(), attr->first.length(), newSVpv(attr->second.c_str(), attr->second.length()), 0 );
92
RETVAL = (SV*)newRV_noinc((SV*)hv);
100
%name{Slic3r::Model::Object} class ModelObject {
101
ModelVolumePtrs* volumes()
102
%code%{ RETVAL = &THIS->volumes; %};
104
ModelInstancePtrs* instances()
105
%code%{ RETVAL = &THIS->instances; %};
107
void invalidate_bounding_box();
109
Ref<BoundingBoxf3> _bounding_box(BoundingBoxf3* new_bbox = NULL)
111
if (NULL != new_bbox) {
112
THIS->_bounding_box = *new_bbox;
113
THIS->_bounding_box_valid = true;
116
if (!THIS->_bounding_box_valid) {
120
RETVAL = &THIS->_bounding_box;
123
%name{_add_volume} Ref<ModelVolume> add_volume(TriangleMesh* mesh)
124
%code%{ RETVAL = THIS->add_volume(*mesh); %};
125
Ref<ModelVolume> _add_volume_clone(ModelVolume* other)
126
%code%{ RETVAL = THIS->add_volume(*other); %};
128
void delete_volume(size_t idx);
129
void clear_volumes();
131
%name{_add_instance} Ref<ModelInstance> add_instance();
132
Ref<ModelInstance> _add_instance_clone(ModelInstance* other)
133
%code%{ RETVAL = THIS->add_instance(*other); %};
134
void delete_last_instance();
135
void clear_instances();
136
int instances_count()
137
%code%{ RETVAL = THIS->instances.size(); %};
139
std::string input_file()
140
%code%{ RETVAL = THIS->input_file; %};
141
void set_input_file(std::string value)
142
%code%{ THIS->input_file = value; %};
143
Ref<DynamicPrintConfig> config()
144
%code%{ RETVAL = &THIS->config; %};
147
%code%{ RETVAL = THIS->get_model(); %};
149
t_layer_height_ranges layer_height_ranges()
150
%code%{ RETVAL = THIS->layer_height_ranges; %};
151
void set_layer_height_ranges(t_layer_height_ranges ranges)
152
%code%{ THIS->layer_height_ranges = ranges; %};
154
Ref<Pointf> origin_translation()
155
%code%{ RETVAL = &THIS->origin_translation; %};
156
void set_origin_translation(Pointf* point)
157
%code%{ THIS->origin_translation = *point; %};
161
%name{Slic3r::Model::Volume} class ModelVolume {
162
Ref<ModelObject> object()
163
%code%{ RETVAL = THIS->get_object(); %};
165
t_model_material_id material_id();
166
void set_material_id(t_model_material_id material_id)
167
%code%{ THIS->material_id(material_id); %};
168
Ref<ModelMaterial> material();
170
Ref<TriangleMesh> mesh()
171
%code%{ RETVAL = &THIS->mesh; %};
174
%code%{ RETVAL = THIS->modifier; %};
175
void set_modifier(bool modifier)
176
%code%{ THIS->modifier = modifier; %};
180
%name{Slic3r::Model::Instance} class ModelInstance {
181
Ref<ModelObject> object()
182
%code%{ RETVAL = THIS->get_object(); %};
185
%code%{ RETVAL = THIS->rotation; %};
186
double scaling_factor()
187
%code%{ RETVAL = THIS->scaling_factor; %};
189
%code%{ RETVAL = &THIS->offset; %};
191
void set_rotation(double val)
192
%code%{ THIS->rotation = val; %};
193
void set_scaling_factor(double val)
194
%code%{ THIS->scaling_factor = val; %};
195
void set_offset(Pointf *offset)
196
%code%{ THIS->offset = *offset; %};