OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::ClippingPlane Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/MeshUtils.hpp>

Collaboration diagram for Slic3r::GUI::ClippingPlane:

Public Member Functions

 ClippingPlane ()
 ClippingPlane (const Vec3d &direction, double offset)
bool operator== (const ClippingPlane &cp) const
bool operator!= (const ClippingPlane &cp) const
double distance (const Vec3d &pt) const
bool is_point_clipped (const Vec3d &point) const
void set_normal (const Vec3d &normal)
void set_offset (double offset)
double get_offset () const
Vec3d get_normal () const
void invert_normal ()
ClippingPlane inverted_normal () const
bool is_active () const
const std::array< double, 4 > & get_data () const
template<class Archive>
void serialize (Archive &ar)

Static Public Member Functions

static ClippingPlane ClipsNothing ()

Private Attributes

std::array< double, 4 > m_data

Detailed Description

Constructor & Destructor Documentation

◆ ClippingPlane() [1/2]

Slic3r::GUI::ClippingPlane::ClippingPlane ( )
inline
41 {
42 *this = ClipsNothing();
43 }
static ClippingPlane ClipsNothing()
Definition MeshUtils.hpp:73

References ClipsNothing().

Referenced by ClipsNothing(), inverted_normal(), operator!=(), and operator==().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ClippingPlane() [2/2]

Slic3r::GUI::ClippingPlane::ClippingPlane ( const Vec3d & direction,
double offset )
inline
45 {
46 set_normal(direction);
48 }
void set_offset(double offset)
Definition MeshUtils.hpp:67
void set_normal(const Vec3d &normal)
Definition MeshUtils.hpp:61
Slic3r::Polygons offset(const Slic3r::Polygon &polygon, const float delta, JoinType joinType, double miterLimit)
Definition ClipperUtils.cpp:582

References Slic3r::offset(), set_normal(), and set_offset().

Here is the call graph for this function:

Member Function Documentation

◆ ClipsNothing()

ClippingPlane Slic3r::GUI::ClippingPlane::ClipsNothing ( )
inlinestatic
73{ return ClippingPlane(Vec3d(0., 0., 1.), DBL_MAX); }
ClippingPlane()
Definition MeshUtils.hpp:41
Eigen::Matrix< double, 3, 1, Eigen::DontAlign > Vec3d
Definition Point.hpp:68

References ClippingPlane().

Referenced by ClippingPlane(), Slic3r::GUI::GLCanvas3D::_get_section_view_plane(), Slic3r::GUI::GLCanvas3D::_render_objects(), Slic3r::GUI::GLCanvas3D::_render_section_view_caps(), Slic3r::GUI::CommonGizmosDataObjects::ObjectClipper::get_clipping_plane(), Slic3r::GUI::GLGizmosManager::get_clipping_plane(), Slic3r::GUI::GLCanvas3D::get_raycaster_clipping_plane(), Slic3r::GUI::MeshClipper::recalculate_triangles(), and Slic3r::GUI::CommonGizmosDataObjects::InstancesHider::render_cut().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ distance()

double Slic3r::GUI::ClippingPlane::distance ( const Vec3d & pt) const
inline
55 {
56 // FIXME: this fails: assert(is_approx(get_normal().norm(), 1.));
57 return (-get_normal().dot(pt) + m_data[3]);
58 }
Vec3d get_normal() const
Definition MeshUtils.hpp:69
std::array< double, 4 > m_data
Definition MeshUtils.hpp:38
T dot(const boost::geometry::model::d2::point_xy< T > &v1, const boost::geometry::model::d2::point_xy< T > &v2)
Definition ExtrusionSimulator.cpp:154

References Slic3r::dot(), get_normal(), and m_data.

Referenced by Slic3r::GUI::GLCanvas3D::_render_section_view_caps(), and is_point_clipped().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_data()

const std::array< double, 4 > & Slic3r::GUI::ClippingPlane::get_data ( ) const
inline
74{ return m_data; }

References m_data.

Referenced by Slic3r::GUI::GLGizmosManager::get_clipping_plane(), and Slic3r::GUI::GLGizmoPainterBase::get_clipping_plane_data().

Here is the caller graph for this function:

◆ get_normal()

Vec3d Slic3r::GUI::ClippingPlane::get_normal ( ) const
inline
69{ return Vec3d(m_data[0], m_data[1], m_data[2]); }

References m_data.

Referenced by Slic3r::GUI::GLCanvas3D::_render_section_view_caps(), distance(), Slic3r::GUI::GLGizmosManager::get_clipping_plane(), inverted_normal(), Slic3r::GUI::CommonGizmosDataObjects::InstancesHider::render_cut(), Slic3r::GUI::GCodeViewer::set_clipping_plane(), and Slic3r::GUI::GLGizmoCut3D::unproject_on_cut_plane().

Here is the caller graph for this function:

◆ get_offset()

double Slic3r::GUI::ClippingPlane::get_offset ( ) const
inline
68{ return m_data[3]; }

References m_data.

Referenced by inverted_normal(), Slic3r::GUI::GCodeViewer::set_clipping_plane(), and Slic3r::GUI::GLGizmoCut3D::unproject_on_cut_plane().

Here is the caller graph for this function:

◆ invert_normal()

void Slic3r::GUI::ClippingPlane::invert_normal ( )
inline
70{ m_data[0] *= -1.0; m_data[1] *= -1.0; m_data[2] *= -1.0; }

References m_data.

◆ inverted_normal()

ClippingPlane Slic3r::GUI::ClippingPlane::inverted_normal ( ) const
inline
71{ return ClippingPlane(-get_normal(), get_offset()); }
double get_offset() const
Definition MeshUtils.hpp:68

References ClippingPlane(), get_normal(), and get_offset().

Here is the call graph for this function:

◆ is_active()

bool Slic3r::GUI::ClippingPlane::is_active ( ) const
inline
72{ return m_data[3] != DBL_MAX; }

References m_data.

Referenced by Slic3r::GUI::GLCanvas3D::_render_section_view_caps(), and Slic3r::GUI::GCodeViewer::set_clipping_plane().

Here is the caller graph for this function:

◆ is_point_clipped()

bool Slic3r::GUI::ClippingPlane::is_point_clipped ( const Vec3d & point) const
inline
60{ return distance(point) < 0.; }
double distance(const Vec3d &pt) const
Definition MeshUtils.hpp:55

References distance().

Referenced by Slic3r::GUI::MeshRaycaster::closest_hit(), Slic3r::GUI::MeshRaycaster::get_unobscured_idxs(), and Slic3r::GUI::MeshRaycaster::unproject_on_mesh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator!=()

bool Slic3r::GUI::ClippingPlane::operator!= ( const ClippingPlane & cp) const
inline
53{ return ! (*this==cp); }

References ClippingPlane().

Here is the call graph for this function:

◆ operator==()

bool Slic3r::GUI::ClippingPlane::operator== ( const ClippingPlane & cp) const
inline
50 {
51 return m_data[0]==cp.m_data[0] && m_data[1]==cp.m_data[1] && m_data[2]==cp.m_data[2] && m_data[3]==cp.m_data[3];
52 }

References ClippingPlane(), and m_data.

Here is the call graph for this function:

◆ serialize()

template<class Archive>
void Slic3r::GUI::ClippingPlane::serialize ( Archive & ar)
inline
78 {
79 ar( m_data[0], m_data[1], m_data[2], m_data[3] );
80 }

References m_data.

◆ set_normal()

void Slic3r::GUI::ClippingPlane::set_normal ( const Vec3d & normal)
inline
61 {
62 const Vec3d norm_dir = normal.normalized();
63 m_data[0] = norm_dir.x();
64 m_data[1] = norm_dir.y();
65 m_data[2] = norm_dir.z();
66 }
Point normal(Point pt, double scale)
Definition TreeSupport.cpp:112

References m_data, and Slic3r::normal().

Referenced by ClippingPlane(), and Slic3r::GUI::CommonGizmosDataObjects::InstancesHider::render_cut().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_offset()

void Slic3r::GUI::ClippingPlane::set_offset ( double offset)
inline
67{ m_data[3] = offset; }

References m_data, and Slic3r::offset().

Referenced by ClippingPlane().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_data

std::array<double, 4> Slic3r::GUI::ClippingPlane::m_data
private

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