#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/Gizmos/GLGizmoAlignment.hpp>
Classes | |
| struct | ObjectInfo |
Public Types | |
| enum class | AlignType { NONE = -1 , CENTER_X , CENTER_Y , CENTER_Z , Y_MAX , Y_MIN , X_MAX , X_MIN , Z_MAX , Z_MIN , DISTRIBUTE_X , DISTRIBUTE_Y , DISTRIBUTE_Z } |
Public Member Functions | |
| GLGizmoAlignment (GLCanvas3D &canvas) | |
| ~GLGizmoAlignment ()=default | |
| bool | align_objects (AlignType type, bool align_parent=false) |
| bool | distribute_objects (AlignType type) |
| bool | align_to_center (AlignType type, bool align_parent=false) |
| bool | align_to_y_max (bool align_parent=false) |
| bool | align_to_y_min (bool align_parent=false) |
| bool | align_to_x_max (bool align_parent=false) |
| bool | align_to_x_min (bool align_parent=false) |
| bool | align_to_z_max (bool align_parent=false) |
| bool | align_to_z_min (bool align_parent=false) |
| bool | distribute_x () |
| bool | distribute_y () |
| bool | distribute_z () |
| bool | can_align (AlignType type, bool align_parent=false) const |
| bool | can_distribute (AlignType type) const |
| void | set_object_cs (bool flag) |
| Matrix3d | reference_basis (bool align_parent) const |
| std::vector< ObjectInfo > | get_selected_objects_info (BoundingBoxf3 &big_bb, const Matrix3d &basis) const |
| double | get_current_coord (std::string operation_name, BoundingBoxf3 &bbox) |
| Vec3d | generate_displacement (std::string operation_name, double offset) |
| bool | is_parts_selection (bool align_parent) const |
| std::vector< const GLVolume * > | get_selected_part_volumes () const |
| BoundingBoxf3 | get_items_box (const Matrix3d &basis) const |
| BoundingBoxf3 | get_parent_box (const Matrix3d &basis) const |
| size_t | get_items_count (AlignType type, bool align_parent, std::string *why_not=nullptr) const |
Private Member Functions | |
| template<typename GetCoordFunc, typename SetCoordFunc> | |
| bool | align_objects_generic (GetCoordFunc get_coord, SetCoordFunc set_coord, const std::string &operation_name, bool align_parent=false) |
| template<typename GetCoordFunc> | |
| bool | distribute_objects_generic (GetCoordFunc get_coord, int axis, const std::string &operation_name) |
| Selection & | get_selection () const |
| bool | take_snapshot (const std::string &name) |
| void | apply_transformation (int obj_idx, int inst_idx, const Vec3d &displacement) |
| void | finish_operation (bool force_volume_move=false) |
Private Attributes | |
| GLCanvas3D & | m_canvas |
| bool | m_object_cs {false} |
|
strong |
|
explicit |
|
default |
| bool Slic3r::GUI::GLGizmoAlignment::align_objects | ( | AlignType | type, |
| bool | align_parent = false ) |
References align_to_center(), align_to_x_max(), align_to_x_min(), align_to_y_max(), align_to_y_min(), align_to_z_max(), align_to_z_min(), can_align(), CENTER_X, CENTER_Y, CENTER_Z, X_MAX, X_MIN, Y_MAX, Y_MIN, Z_MAX, and Z_MIN.
Referenced by Slic3r::GUI::MenuFactory::append_menu_item_align_distribute().
|
private |
References apply_transformation(), finish_operation(), generate_displacement(), get_current_coord(), get_items_box(), get_parent_box(), get_selected_objects_info(), get_selected_part_volumes(), get_selection(), is_parts_selection(), Slic3r::BoundingBoxBase< PointType, std::vector< PointType > >::max, Slic3r::BoundingBoxBase< PointType, std::vector< PointType > >::min, reference_basis(), Slic3r::GUI::Selection::setup_cache(), take_snapshot(), and Slic3r::GUI::Selection::translate().
Referenced by align_to_x_max(), align_to_x_min(), align_to_y_max(), align_to_y_min(), align_to_z_max(), and align_to_z_min().
| bool Slic3r::GUI::GLGizmoAlignment::align_to_center | ( | AlignType | type, |
| bool | align_parent = false ) |
References apply_transformation(), CENTER_X, CENTER_Y, finish_operation(), generate_displacement(), get_current_coord(), get_items_box(), get_parent_box(), get_selected_objects_info(), get_selected_part_volumes(), get_selection(), is_parts_selection(), Slic3r::offset(), reference_basis(), Slic3r::GUI::Selection::setup_cache(), take_snapshot(), and Slic3r::GUI::Selection::translate().
Referenced by align_objects().
| bool Slic3r::GUI::GLGizmoAlignment::align_to_x_max | ( | bool | align_parent = false | ) |
References align_objects_generic(), Slic3r::GUI::GLGizmoAlignment::ObjectInfo::bbox, and Slic3r::BoundingBoxBase< PointType, std::vector< PointType > >::max.
Referenced by align_objects().
| bool Slic3r::GUI::GLGizmoAlignment::align_to_x_min | ( | bool | align_parent = false | ) |
References align_objects_generic(), Slic3r::GUI::GLGizmoAlignment::ObjectInfo::bbox, and Slic3r::BoundingBoxBase< PointType, std::vector< PointType > >::min.
Referenced by align_objects().
| bool Slic3r::GUI::GLGizmoAlignment::align_to_y_max | ( | bool | align_parent = false | ) |
References align_objects_generic(), Slic3r::GUI::GLGizmoAlignment::ObjectInfo::bbox, and Slic3r::BoundingBoxBase< PointType, std::vector< PointType > >::max.
Referenced by align_objects().
| bool Slic3r::GUI::GLGizmoAlignment::align_to_y_min | ( | bool | align_parent = false | ) |
References align_objects_generic(), Slic3r::GUI::GLGizmoAlignment::ObjectInfo::bbox, and Slic3r::BoundingBoxBase< PointType, std::vector< PointType > >::min.
Referenced by align_objects().
| bool Slic3r::GUI::GLGizmoAlignment::align_to_z_max | ( | bool | align_parent = false | ) |
References align_objects_generic(), Slic3r::GUI::GLGizmoAlignment::ObjectInfo::bbox, and Slic3r::BoundingBoxBase< PointType, std::vector< PointType > >::max.
Referenced by align_objects().
| bool Slic3r::GUI::GLGizmoAlignment::align_to_z_min | ( | bool | align_parent = false | ) |
References align_objects_generic(), Slic3r::GUI::GLGizmoAlignment::ObjectInfo::bbox, and Slic3r::BoundingBoxBase< PointType, std::vector< PointType > >::min.
Referenced by align_objects().
|
private |
References get_selection(), and Slic3r::GUI::Selection::translate().
Referenced by align_objects_generic(), align_to_center(), and distribute_objects_generic().
| bool Slic3r::GUI::GLGizmoAlignment::can_align | ( | AlignType | type, |
| bool | align_parent = false ) const |
References get_items_count().
Referenced by align_objects(), and Slic3r::GUI::MenuFactory::append_menu_item_align_distribute().
| bool Slic3r::GUI::GLGizmoAlignment::can_distribute | ( | AlignType | type | ) | const |
References DISTRIBUTE_X, DISTRIBUTE_Y, DISTRIBUTE_Z, and get_items_count().
Referenced by Slic3r::GUI::MenuFactory::append_menu_item_align_distribute(), and distribute_objects().
| bool Slic3r::GUI::GLGizmoAlignment::distribute_objects | ( | AlignType | type | ) |
References can_distribute(), DISTRIBUTE_X, distribute_x(), DISTRIBUTE_Y, distribute_y(), DISTRIBUTE_Z, and distribute_z().
Referenced by Slic3r::GUI::MenuFactory::append_menu_item_align_distribute().
|
private |
References apply_transformation(), Slic3r::BoundingBox3Base< PointType >::center(), finish_operation(), get_items_box(), get_selected_objects_info(), get_selected_part_volumes(), get_selection(), Slic3r::GLVolume::instance_idx(), is_parts_selection(), Slic3r::BoundingBoxBase< PointType, std::vector< PointType > >::max, Slic3r::BoundingBoxBase< PointType, std::vector< PointType > >::min, Slic3r::GLVolume::object_idx(), Slic3r::offset(), reference_basis(), Slic3r::GUI::Selection::setup_cache(), take_snapshot(), Slic3r::GUI::Selection::translate(), and Slic3r::GLVolume::volume_idx().
Referenced by distribute_x(), distribute_y(), and distribute_z().
| bool Slic3r::GUI::GLGizmoAlignment::distribute_x | ( | ) |
References Slic3r::GUI::GLGizmoAlignment::ObjectInfo::center, and distribute_objects_generic().
Referenced by distribute_objects().
| bool Slic3r::GUI::GLGizmoAlignment::distribute_y | ( | ) |
References Slic3r::GUI::GLGizmoAlignment::ObjectInfo::center, and distribute_objects_generic().
Referenced by distribute_objects().
| bool Slic3r::GUI::GLGizmoAlignment::distribute_z | ( | ) |
References Slic3r::GUI::GLGizmoAlignment::ObjectInfo::center, and distribute_objects_generic().
Referenced by distribute_objects().
|
private |
References get_selection(), m_canvas, and Slic3r::GUI::Selection::synchronize_unselected_volumes().
Referenced by align_objects_generic(), align_to_center(), and distribute_objects_generic().
| Vec3d Slic3r::GUI::GLGizmoAlignment::generate_displacement | ( | std::string | operation_name, |
| double | offset ) |
References Slic3r::offset().
Referenced by align_objects_generic(), and align_to_center().
| double Slic3r::GUI::GLGizmoAlignment::get_current_coord | ( | std::string | operation_name, |
| BoundingBoxf3 & | bbox ) |
References Slic3r::BoundingBox3Base< PointType >::center(), Slic3r::BoundingBoxBase< PointType, std::vector< PointType > >::max, and Slic3r::BoundingBoxBase< PointType, std::vector< PointType > >::min.
Referenced by align_objects_generic(), and align_to_center().
| BoundingBoxf3 Slic3r::GUI::GLGizmoAlignment::get_items_box | ( | const Matrix3d & | basis | ) | const |
References get_selected_objects_info(), get_selected_part_volumes(), is_parts_selection(), and Slic3r::BoundingBox3Base< PointType >::merge().
Referenced by align_objects_generic(), align_to_center(), distribute_objects_generic(), and Slic3r::GUI::GLGizmoMove3D::render_align_preview().
| size_t Slic3r::GUI::GLGizmoAlignment::get_items_count | ( | AlignType | type, |
| bool | align_parent, | ||
| std::string * | why_not = nullptr ) const |
References _u8L, CENTER_Z, count, DISTRIBUTE_Z, Slic3r::GUI::PartPlateList::find_instance(), Slic3r::GUI::Selection::get_content(), Slic3r::GUI::Selection::get_mode(), Slic3r::GUI::Selection::get_model(), get_selected_part_volumes(), get_selection(), Slic3r::GUI::Selection::Instance, is_parts_selection(), Slic3r::Model::objects, Z_MAX, and Z_MIN.
Referenced by can_align(), can_distribute(), and Slic3r::GUI::GLGizmoMove3D::render_align_preview().
| BoundingBoxf3 Slic3r::GUI::GLGizmoAlignment::get_parent_box | ( | const Matrix3d & | basis | ) | const |
References Slic3r::GUI::PartPlateList::find_instance(), Slic3r::GUI::Selection::get_content(), Slic3r::GUI::Selection::get_instance_idx(), Slic3r::GUI::Selection::get_model(), Slic3r::GUI::Selection::get_object_idx(), Slic3r::GUI::PartPlateList::get_plate(), Slic3r::GUI::PartPlate::get_plate_box(), get_selected_objects_info(), get_selection(), Slic3r::ModelObject::instances, is_parts_selection(), Slic3r::BoundingBoxBase< PointType, std::vector< PointType > >::max, Slic3r::BoundingBoxBase< PointType, std::vector< PointType > >::min, and Slic3r::Model::objects.
Referenced by align_objects_generic(), align_to_center(), and Slic3r::GUI::GLGizmoMove3D::render_align_preview().
| std::vector< GLGizmoAlignment::ObjectInfo > Slic3r::GUI::GLGizmoAlignment::get_selected_objects_info | ( | BoundingBoxf3 & | big_bb, |
| const Matrix3d & | basis ) const |
References Slic3r::GUI::Selection::get_content(), Slic3r::GUI::Selection::get_model(), get_selection(), Slic3r::ModelObject::instances, Slic3r::GUI::Selection::is_empty(), Slic3r::BoundingBox3Base< PointType >::merge(), and Slic3r::Model::objects.
Referenced by align_objects_generic(), align_to_center(), distribute_objects_generic(), get_items_box(), and get_parent_box().
| std::vector< const GLVolume * > Slic3r::GUI::GLGizmoAlignment::get_selected_part_volumes | ( | ) | const |
References Slic3r::GUI::Selection::get_mode(), Slic3r::GUI::Selection::get_model(), Slic3r::GUI::Selection::get_object_idx(), get_selection(), Slic3r::GUI::Selection::get_volume(), Slic3r::GUI::Selection::get_volume_idxs(), Slic3r::ModelObject::is_cut(), is_parts_selection(), Slic3r::Model::objects, Slic3r::GUI::Selection::Volume, Slic3r::GLVolume::volume_idx(), and Slic3r::ModelObject::volumes.
Referenced by align_objects_generic(), align_to_center(), distribute_objects_generic(), get_items_box(), and get_items_count().
|
private |
References m_canvas.
Referenced by align_objects_generic(), align_to_center(), apply_transformation(), distribute_objects_generic(), finish_operation(), get_items_count(), get_parent_box(), get_selected_objects_info(), get_selected_part_volumes(), is_parts_selection(), and reference_basis().
| bool Slic3r::GUI::GLGizmoAlignment::is_parts_selection | ( | bool | align_parent | ) | const |
References Slic3r::GUI::Selection::get_content(), Slic3r::GUI::Selection::get_mode(), get_selection(), and Slic3r::GUI::Selection::Volume.
Referenced by align_objects_generic(), align_to_center(), distribute_objects_generic(), get_items_box(), get_items_count(), get_parent_box(), get_selected_part_volumes(), and reference_basis().
| Matrix3d Slic3r::GUI::GLGizmoAlignment::reference_basis | ( | bool | align_parent | ) | const |
References Slic3r::GUI::Selection::get_first_volume(), Slic3r::GLVolume::get_instance_transformation(), get_selection(), Slic3r::GUI::Selection::is_empty(), is_parts_selection(), m_object_cs, and Slic3r::Geometry::Transformation::reset_scaling_factor().
Referenced by align_objects_generic(), align_to_center(), distribute_objects_generic(), and Slic3r::GUI::GLGizmoMove3D::render_align_preview().
|
inline |
References m_object_cs.
|
private |
Referenced by align_objects_generic(), align_to_center(), and distribute_objects_generic().
|
private |
Referenced by GLGizmoAlignment(), finish_operation(), and get_selection().
|
private |
Referenced by reference_basis(), and set_object_cs().