OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
EmbossJob.cpp File Reference
#include "EmbossJob.hpp"
#include <optional>
#include "libslic3r/Point.hpp"
#include "slic3r/GUI/Jobs/Job.hpp"
#include <exception>
#include "libslic3r/ExPolygon.hpp"
#include "libslic3r/Emboss.hpp"
#include <cstddef>
#include <cassert>
#include "libslic3r/Polygon.hpp"
#include "libslic3r/Config.hpp"
#include "libslic3r/Geometry.hpp"
#include <memory>
#include "slic3r/GUI/SurfaceDrag.hpp"
#include <Eigen/Geometry>
#include "libslic3r/BoundingBox.hpp"
#include "libslic3r/EmbossShape.hpp"
#include <cmath>
#include <math.h>
#include "libslic3r/TriangleMesh.hpp"
#include "libslic3r/Utils.hpp"
#include <functional>
#include <limits>
#include <algorithm>
#include <cstdint>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <boost/log/trivial.hpp>
#include <libslic3r/Model.hpp>
#include <libslic3r/Format/OBJ.hpp>
#include <libslic3r/CutSurface.hpp>
#include <libslic3r/BuildVolume.hpp>
#include <libslic3r/SLA/ReprojectPointsOnMesh.hpp>
#include <vector>
#include <utility>
#include <wx/dataview.h>
#include "libslic3r/libslic3r.h"
#include "slic3r/GUI/Plater.hpp"
#include "slic3r/GUI/GLCanvas3D.hpp"
#include "slic3r/GUI/GUI_ObjectList.hpp"
#include "slic3r/GUI/GUI.hpp"
#include "slic3r/GUI/GUI_App.hpp"
#include "slic3r/GUI/Selection.hpp"
#include "slic3r/GUI/CameraUtils.hpp"
#include "slic3r/GUI/Jobs/Worker.hpp"
#include "slic3r/Utils/UndoRedo.hpp"
#include "slic3r/Utils/RaycastManager.hpp"
#include "libslic3r/CutUtils.hpp"
#include "libslic3r/MultiMaterialSegmentation.hpp"
#include "libslic3r/ObjectID.hpp"
#include "slic3r/GUI/Camera.hpp"
#include "slic3r/GUI/Gizmos/GLGizmosManager.hpp"
#include "slic3r/GUI/I18N.hpp"

Go to the source code of this file.

Classes

struct  anonymous_namespace{EmbossJob.cpp}::DataCreateVolume
 Hold neccessary data to create ModelVolume in job Volume is created on the surface of existing volume in object. NOTE: EmbossDataBase::font_file doesn't have to be valid !!! More...
class  anonymous_namespace{EmbossJob.cpp}::CreateVolumeJob
 Create new TextVolume on the surface of ModelObject Should not be stopped NOTE: EmbossDataBase::font_file doesn't have to be valid !!! More...
struct  anonymous_namespace{EmbossJob.cpp}::DataCreateObject
 Hold neccessary data to create ModelObject in job Object is placed on bed under screen coor OR to center of scene when it is out of bed shape. More...
class  anonymous_namespace{EmbossJob.cpp}::CreateObjectJob
 Create new TextObject on the platter Should not be stopped. More...
struct  anonymous_namespace{EmbossJob.cpp}::CreateSurfaceVolumeData
 Hold neccessary data to create(cut) volume from surface object in job. More...
class  anonymous_namespace{EmbossJob.cpp}::CreateSurfaceVolumeJob
 Cut surface from object and create cutted volume Should not be stopped. More...
class  anonymous_namespace{EmbossJob.cpp}::JobException

Namespaces

namespace  Slic3r
 |/ Copyright (c) Prusa Research 2020 - 2023 Enrico Turri @enricoturri1966 |/ |/ PrusaSlicer is released under the terms of the AGPLv3 or higher |/
namespace  anonymous_namespace{EmbossJob.cpp}
 private namespace implementation
namespace  Slic3r::GUI
namespace  Slic3r::GUI::Emboss

Functions

bool anonymous_namespace{EmbossJob.cpp}::check (const DataBase &input, bool check_fontfile=true, bool use_surface=false)
 Assert check of inputs data.
bool anonymous_namespace{EmbossJob.cpp}::check (GLGizmosManager::EType gizmo)
bool anonymous_namespace{EmbossJob.cpp}::check (const CreateVolumeParams &input)
bool anonymous_namespace{EmbossJob.cpp}::check (const DataCreateVolume &input, bool is_main_thread=false)
bool anonymous_namespace{EmbossJob.cpp}::check (const DataCreateObject &input)
bool anonymous_namespace{EmbossJob.cpp}::check (const DataUpdate &input, bool is_main_thread=false, bool use_surface=false)
bool anonymous_namespace{EmbossJob.cpp}::check (const CreateSurfaceVolumeData &input, bool is_main_thread=false)
bool anonymous_namespace{EmbossJob.cpp}::check (const UpdateSurfaceVolumeData &input, bool is_main_thread=false)
template<typename Fnc>
static ExPolygons anonymous_namespace{EmbossJob.cpp}::create_shape (DataBase &input, Fnc was_canceled)
template<typename Fnc>
TriangleMesh anonymous_namespace{EmbossJob.cpp}::try_create_mesh (DataBase &input, const Fnc &was_canceled)
 Try to create mesh from text.
template<typename Fnc>
TriangleMesh anonymous_namespace{EmbossJob.cpp}::create_mesh (DataBase &input, const Fnc &was_canceled, Job::Ctl &ctl)
TriangleMesh anonymous_namespace{EmbossJob.cpp}::create_default_mesh ()
 Create default mesh for embossed text.
void anonymous_namespace{EmbossJob.cpp}::update_volume (TriangleMesh &&mesh, const DataUpdate &data, const Transform3d *tr=nullptr)
 Must be called on main thread.
void anonymous_namespace{EmbossJob.cpp}::update_name_in_list (const ObjectList &object_list, const ModelVolume &volume)
 Update name in right panel.
void anonymous_namespace{EmbossJob.cpp}::create_volume (TriangleMesh &&mesh, const ObjectID &object_id, const ModelVolumeType type, const std::optional< Transform3d > &trmat, const DataBase &data, GLGizmosManager::EType gizmo)
 Add new volume to object.
OrthoProject anonymous_namespace{EmbossJob.cpp}::create_projection_for_cut (Transform3d tr, double shape_scale, const std::pair< float, float > &z_range)
 Create projection for cut surface from mesh.
OrthoProject3d anonymous_namespace{EmbossJob.cpp}::create_emboss_projection (bool is_outside, float emboss, Transform3d tr, SurfaceCut &cut)
 Create tranformation for emboss Cutted surface.
template<typename Fnc>
TriangleMesh anonymous_namespace{EmbossJob.cpp}::cut_surface (DataBase &input1, const SurfaceVolumeData &input2, const Fnc &was_canceled)
 Cut surface into triangle mesh.
SurfaceVolumeData::ModelSources anonymous_namespace{EmbossJob.cpp}::create_sources (const ModelVolumePtrs &volumes, std::optional< size_t > text_volume_id={})
 Copied triangles from object to be able create mesh for cut surface from.
void anonymous_namespace{EmbossJob.cpp}::create_message (const std::string &message)
bool anonymous_namespace{EmbossJob.cpp}::process (std::exception_ptr &eptr)
bool anonymous_namespace{EmbossJob.cpp}::finalize (bool canceled, std::exception_ptr &eptr, const DataBase &input)
auto anonymous_namespace{EmbossJob.cpp}::was_canceled (const Job::Ctl &ctl, const DataBase &base)
bool anonymous_namespace{EmbossJob.cpp}::is_valid (ModelVolumeType volume_type)
 Check if volume type is possible use for new text volume.
bool anonymous_namespace{EmbossJob.cpp}::start_create_volume_job (Worker &worker, const ModelObject &object, const std::optional< Transform3d > &volume_tr, DataBasePtr data, ModelVolumeType volume_type, GLGizmosManager::EType gizmo)
 Start job for add new volume to object with given transformation.
const GLVolume * anonymous_namespace{EmbossJob.cpp}::find_closest (const Selection &selection, const Vec2d &screen_center, const Camera &camera, const ModelObjectPtrs &objects, Vec2d *closest_center)
 Find volume in selected objects with closest convex hull to screen center.
bool anonymous_namespace{EmbossJob.cpp}::start_create_object_job (const CreateVolumeParams &input, DataBasePtr emboss_data, const Vec2d &coor)
 Start job for add object with text into scene.
bool anonymous_namespace{EmbossJob.cpp}::start_create_volume_on_surface_job (CreateVolumeParams &input, DataBasePtr data, const Vec2d &screen_coor, bool try_no_coor)
 Start job to create volume on the surface of object.
SurfaceVolumeData::ModelSources Slic3r::GUI::Emboss::create_volume_sources (const ModelVolume &volume)
 Copied triangles from object to be able create mesh for cut surface from.
bool Slic3r::GUI::Emboss::start_create_volume (CreateVolumeParams &input, DataBasePtr data, const Vec2d &mouse_pos)
 Create new volume on position of mouse cursor.
bool Slic3r::GUI::Emboss::start_create_volume_without_position (CreateVolumeParams &input, DataBasePtr data)
 Same as previous function but without mouse position Need to suggest position or put near the selection.
bool Slic3r::GUI::Emboss::start_update_volume (DataUpdate &&data, const ModelVolume &volume, const Selection &selection, RaycastManager &raycaster)
 Start job for update embossed volume.
template<typename Fnc>
ExPolygons anonymous_namespace{EmbossJob.cpp}::create_shape (DataBase &input, Fnc was_canceled)
std::vector< BoundingBoxes > anonymous_namespace{EmbossJob.cpp}::create_line_bounds (const ExPolygonsWithIds &shapes, size_t count_lines=0)
template<typename Fnc>
TriangleMesh anonymous_namespace{EmbossJob.cpp}::create_mesh_per_glyph (DataBase &input, Fnc was_canceled)
indexed_triangle_set anonymous_namespace{EmbossJob.cpp}::cut_surface_to_its (const ExPolygons &shapes, const Transform3d &tr, const SurfaceVolumeData::ModelSources &sources, DataBase &input, std::function< bool()> was_canceled)
TriangleMesh anonymous_namespace{EmbossJob.cpp}::cut_per_glyph_surface (DataBase &input1, const SurfaceVolumeData &input2, std::function< bool()> was_canceled)

Variables

constexpr float anonymous_namespace{EmbossJob.cpp}::SAFE_SURFACE_OFFSET = 0.015f
constexpr float anonymous_namespace{EmbossJob.cpp}::safe_extension = 1.0f

Class Documentation

◆ anonymous_namespace{EmbossJob.cpp}::DataCreateVolume

struct anonymous_namespace{EmbossJob.cpp}::DataCreateVolume

Hold neccessary data to create ModelVolume in job Volume is created on the surface of existing volume in object. NOTE: EmbossDataBase::font_file doesn't have to be valid !!!

Collaboration diagram for anonymous_namespace{EmbossJob.cpp}::DataCreateVolume:
Class Members
DataBasePtr base
EType gizmo
ObjectID object_id
optional< Transform3d > trmat
ModelVolumeType volume_type

◆ anonymous_namespace{EmbossJob.cpp}::DataCreateObject

struct anonymous_namespace{EmbossJob.cpp}::DataCreateObject

Hold neccessary data to create ModelObject in job Object is placed on bed under screen coor OR to center of scene when it is out of bed shape.

Collaboration diagram for anonymous_namespace{EmbossJob.cpp}::DataCreateObject:
Class Members
optional< float > angle = {}
DataBasePtr base
vector< Vec2d > bed_shape
Camera camera
EType gizmo
Vec2d screen_coor