Ported PrintObject::total_layer_count() to XS
This commit is contained in:
parent
c7f5753a28
commit
eb23990d6d
@ -32,14 +32,6 @@ sub support_layers {
|
|||||||
return [ map $self->get_support_layer($_), 0..($self->support_layer_count - 1) ];
|
return [ map $self->get_support_layer($_), 0..($self->support_layer_count - 1) ];
|
||||||
}
|
}
|
||||||
|
|
||||||
# this is the *total* layer count (including support layers)
|
|
||||||
# this value is not supposed to be compared with $layer->id
|
|
||||||
# since they have different semantics
|
|
||||||
sub total_layer_count {
|
|
||||||
my $self = shift;
|
|
||||||
return $self->layer_count + $self->support_layer_count;
|
|
||||||
}
|
|
||||||
|
|
||||||
# this should be idempotent
|
# this should be idempotent
|
||||||
sub slice {
|
sub slice {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
@ -114,13 +114,14 @@ class PrintObject
|
|||||||
// adds region_id, too, if necessary
|
// adds region_id, too, if necessary
|
||||||
void add_region_volume(int region_id, int volume_id);
|
void add_region_volume(int region_id, int volume_id);
|
||||||
|
|
||||||
size_t layer_count();
|
size_t total_layer_count() const;
|
||||||
|
size_t layer_count() const;
|
||||||
void clear_layers();
|
void clear_layers();
|
||||||
Layer* get_layer(int idx);
|
Layer* get_layer(int idx);
|
||||||
Layer* add_layer(int id, coordf_t height, coordf_t print_z, coordf_t slice_z);
|
Layer* add_layer(int id, coordf_t height, coordf_t print_z, coordf_t slice_z);
|
||||||
void delete_layer(int idx);
|
void delete_layer(int idx);
|
||||||
|
|
||||||
size_t support_layer_count();
|
size_t support_layer_count() const;
|
||||||
void clear_support_layers();
|
void clear_support_layers();
|
||||||
SupportLayer* get_support_layer(int idx);
|
SupportLayer* get_support_layer(int idx);
|
||||||
SupportLayer* add_support_layer(int id, coordf_t height, coordf_t print_z, coordf_t slice_z);
|
SupportLayer* add_support_layer(int id, coordf_t height, coordf_t print_z, coordf_t slice_z);
|
||||||
|
@ -131,8 +131,17 @@ PrintObject::add_region_volume(int region_id, int volume_id)
|
|||||||
region_volumes[region_id].push_back(volume_id);
|
region_volumes[region_id].push_back(volume_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* This is the *total* layer count (including support layers)
|
||||||
|
this value is not supposed to be compared with Layer::id
|
||||||
|
since they have different semantics */
|
||||||
size_t
|
size_t
|
||||||
PrintObject::layer_count()
|
PrintObject::total_layer_count() const
|
||||||
|
{
|
||||||
|
return this->layer_count() + this->support_layer_count();
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t
|
||||||
|
PrintObject::layer_count() const
|
||||||
{
|
{
|
||||||
return this->layers.size();
|
return this->layers.size();
|
||||||
}
|
}
|
||||||
@ -167,7 +176,7 @@ PrintObject::delete_layer(int idx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
size_t
|
size_t
|
||||||
PrintObject::support_layer_count()
|
PrintObject::support_layer_count() const
|
||||||
{
|
{
|
||||||
return this->support_layers.size();
|
return this->support_layers.size();
|
||||||
}
|
}
|
||||||
|
@ -88,6 +88,7 @@ _constant()
|
|||||||
void set_layer_height_ranges(t_layer_height_ranges layer_height_ranges)
|
void set_layer_height_ranges(t_layer_height_ranges layer_height_ranges)
|
||||||
%code%{ THIS->layer_height_ranges = layer_height_ranges; %};
|
%code%{ THIS->layer_height_ranges = layer_height_ranges; %};
|
||||||
|
|
||||||
|
size_t total_layer_count();
|
||||||
size_t layer_count();
|
size_t layer_count();
|
||||||
void clear_layers();
|
void clear_layers();
|
||||||
Ref<Layer> get_layer(int idx);
|
Ref<Layer> get_layer(int idx);
|
||||||
|
Loading…
Reference in New Issue
Block a user