OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::Emboss::ProjectScale Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/Emboss.hpp>

Inheritance diagram for Slic3r::Emboss::ProjectScale:
Collaboration diagram for Slic3r::Emboss::ProjectScale:

Public Member Functions

 ProjectScale (std::unique_ptr< IProjection > core, double scale)
std::pair< Vec3d, Vec3d > create_front_back (const Point &p) const override
 convert 2d point to 3d points
Vec3d project (const Vec3d &point) const override
 Move point with respect to projection direction e.g. Orthogonal projection will move with point by direction e.g. Spherical projection need to use center of projection.
std::optional< Vec2d > unproject (const Vec3d &p, double *depth=nullptr) const override
 Back projection.

Private Attributes

std::unique_ptr< IProjection > core
double m_scale

Detailed Description

Constructor & Destructor Documentation

◆ ProjectScale()

Slic3r::Emboss::ProjectScale::ProjectScale ( std::unique_ptr< IProjection > core,
double scale )
inline
361 : core(std::move(core)), m_scale(scale)
362 {}
int scale(const int val)
Definition WipeTowerDialog.cpp:58
double m_scale
Definition Emboss.hpp:358
std::unique_ptr< IProjection > core
Definition Emboss.hpp:357

References core, m_scale, and scale().

Here is the call graph for this function:

Member Function Documentation

◆ create_front_back()

std::pair< Vec3d, Vec3d > Slic3r::Emboss::ProjectScale::create_front_back ( const Point & p) const
inlineoverridevirtual

convert 2d point to 3d points

Parameters
p2d coordinate
Returns
first - front spatial point second - back spatial point

Implements Slic3r::Emboss::IProjection.

366 {
367 auto res = core->create_front_back(p);
368 return std::make_pair(res.first * m_scale, res.second * m_scale);
369 }

References core, and m_scale.

◆ project()

Vec3d Slic3r::Emboss::ProjectScale::project ( const Vec3d & point) const
inlineoverridevirtual

Move point with respect to projection direction e.g. Orthogonal projection will move with point by direction e.g. Spherical projection need to use center of projection.

Parameters
pointSpatial point coordinate
Returns
Projected spatial point

Implements Slic3r::Emboss::IProject3d.

370 {
371 return core->project(point);
372 }

References core.

◆ unproject()

std::optional< Vec2d > Slic3r::Emboss::ProjectScale::unproject ( const Vec3d & p,
double * depth = nullptr ) const
inlineoverridevirtual

Back projection.

Parameters
pPoint to project
depth[optional] Depth of 2d projected point. Be careful number is in 2d scale
Returns
Uprojected point when it is possible

Implements Slic3r::Emboss::IProjection.

373 {
374 auto res = core->unproject(p / m_scale, depth);
375 if (depth != nullptr) *depth *= m_scale;
376 return res;
377 }

References core, and m_scale.

Member Data Documentation

◆ core

std::unique_ptr<IProjection> Slic3r::Emboss::ProjectScale::core
private

◆ m_scale

double Slic3r::Emboss::ProjectScale::m_scale
private

The documentation for this class was generated from the following file:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/Emboss.hpp