Changing the internal representation of Point / Pointf / Point3 / Pointf3 to Eigen Matrix types:

Changed the Point3 / Pointf3 to derive from the Eigen Vec3crd / Vec3d.
Replaced the Point::concide_with() method calls with == operator.
Reduced some compiler warnings.
This commit is contained in:
bubnikv 2018-08-15 13:51:40 +02:00
parent f34252a27b
commit 3b89717149
19 changed files with 187 additions and 174 deletions

View file

@ -280,7 +280,7 @@ const Transform3f& GLVolume::world_matrix() const
{
m_world_mat = Transform3f::Identity();
m_world_mat.translate(Vec3f(m_origin.x(), m_origin.y(), 0));
m_world_mat.rotate(Eigen::AngleAxisf(m_angle_z, Eigen::Vector3f::UnitZ()));
m_world_mat.rotate(Eigen::AngleAxisf(m_angle_z, Vec3f::UnitZ()));
m_world_mat.scale(m_scale_factor);
m_dirty = false;
}

View file

@ -1947,7 +1947,7 @@ void GLCanvas3D::set_auto_bed_shape()
// draw a default square bed around object center
const BoundingBoxf3& bbox = volumes_bounding_box();
coordf_t max_size = bbox.max_size();
const Pointf3& center = bbox.center();
const Pointf3 center = bbox.center();
Pointfs bed_shape;
bed_shape.reserve(4);
@ -3101,7 +3101,7 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
{
// The mouse_to_3d gets the Z coordinate from the Z buffer at the screen coordinate pos x, y,
// an converts the screen space coordinate to unscaled object space.
Pointf3 pos3d = (volume_idx == -1) ? Pointf3(DBL_MAX, DBL_MAX) : _mouse_to_3d(pos);
Pointf3 pos3d = (volume_idx == -1) ? Pointf3(DBL_MAX, DBL_MAX, DBL_MAX) : _mouse_to_3d(pos);
// Only accept the initial position, if it is inside the volume bounding box.
BoundingBoxf3 volume_bbox = m_volumes.volumes[volume_idx]->transformed_bounding_box();

View file

@ -891,10 +891,13 @@ void add_frequently_changed_parameters(wxWindow* parent, wxBoxSizer* sizer, wxFl
g_wiping_dialog_button->Bind(wxEVT_BUTTON, ([parent](wxCommandEvent& e)
{
auto &config = g_PresetBundle->project_config;
std::vector<double> init_matrix = (config.option<ConfigOptionFloats>("wiping_volumes_matrix"))->values;
std::vector<double> init_extruders = (config.option<ConfigOptionFloats>("wiping_volumes_extruders"))->values;
const std::vector<double> &init_matrix = (config.option<ConfigOptionFloats>("wiping_volumes_matrix"))->values;
const std::vector<double> &init_extruders = (config.option<ConfigOptionFloats>("wiping_volumes_extruders"))->values;
#pragma warning(push)
#pragma warning(disable:4244) // disable Visual Studio's warning: conversion from 'double' to 'float', possible loss of data
WipingDialog dlg(parent,std::vector<float>(init_matrix.begin(),init_matrix.end()),std::vector<float>(init_extruders.begin(),init_extruders.end()));
#pragma warning(pop)
if (dlg.ShowModal() == wxID_OK) {
std::vector<float> matrix = dlg.get_matrix();