OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::EdgeGrid::Contour Class Reference

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

Collaboration diagram for Slic3r::EdgeGrid::Contour:

Public Member Functions

 Contour ()=default
 Contour (const Slic3r::Point *begin, const Slic3r::Point *end, bool open)
 Contour (const Slic3r::Point *data, size_t size, bool open)
 Contour (const Points &pts, bool open)
const Slic3r::Point * begin () const
const Slic3r::Point * end () const
bool open () const
bool closed () const
const Slic3r::Point & front () const
const Slic3r::Point & back () const
const Slic3r::Point & segment_start (size_t idx) const
const Slic3r::Point & segment_end (size_t idx) const
const Slic3r::Point & segment_prev (size_t idx) const
const size_t segment_idx_prev (size_t idx) const
const size_t segment_idx_next (size_t idx) const
size_t num_segments () const
Line get_segment (size_t idx) const
Lines get_segments () const

Private Member Functions

size_t size () const

Private Attributes

const Slic3r::Point * m_begin { nullptr }
const Slic3r::Point * m_end { nullptr }
bool m_open { false }

Detailed Description

Constructor & Destructor Documentation

◆ Contour() [1/4]

Slic3r::EdgeGrid::Contour::Contour ( )
default

Referenced by Contour(), and Contour().

Here is the caller graph for this function:

◆ Contour() [2/4]

Slic3r::EdgeGrid::Contour::Contour ( const Slic3r::Point * begin,
const Slic3r::Point * end,
bool open )
inline
const Slic3r::Point * end() const
Definition EdgeGrid.hpp:35
bool m_open
Definition EdgeGrid.hpp:100
const Slic3r::Point * m_end
Definition EdgeGrid.hpp:99
bool open() const
Definition EdgeGrid.hpp:36
const Slic3r::Point * m_begin
Definition EdgeGrid.hpp:98
const Slic3r::Point * begin() const
Definition EdgeGrid.hpp:34

References begin(), end(), m_begin, m_end, m_open, and open().

Here is the call graph for this function:

◆ Contour() [3/4]

Slic3r::EdgeGrid::Contour::Contour ( const Slic3r::Point * data,
size_t size,
bool open )
inline
31: Contour(data, data + size, open) {}
size_t size() const
Definition EdgeGrid.hpp:96

References Contour(), open(), and size().

Here is the call graph for this function:

◆ Contour() [4/4]

Slic3r::EdgeGrid::Contour::Contour ( const Points & pts,
bool open )
inline
32: Contour(pts.data(), pts.size(), open) {}

References Contour(), open(), and size().

Here is the call graph for this function:

Member Function Documentation

◆ back()

const Slic3r::Point & Slic3r::EdgeGrid::Contour::back ( ) const
inline
40{ return *(m_end - 1); }

References m_end.

Referenced by get_segments().

Here is the caller graph for this function:

◆ begin()

const Slic3r::Point * Slic3r::EdgeGrid::Contour::begin ( ) const
inline
34{ return m_begin; }

References m_begin.

Referenced by Contour(), and get_segments().

Here is the caller graph for this function:

◆ closed()

bool Slic3r::EdgeGrid::Contour::closed ( ) const
inline
37{ return !m_open; }

References m_open.

◆ end()

const Slic3r::Point * Slic3r::EdgeGrid::Contour::end ( ) const
inline
35{ return m_end; }

References m_end.

Referenced by Contour(), and get_segments().

Here is the caller graph for this function:

◆ front()

const Slic3r::Point & Slic3r::EdgeGrid::Contour::front ( ) const
inline
39{ return *m_begin; }

References m_begin.

Referenced by get_segments().

Here is the caller graph for this function:

◆ get_segment()

Line Slic3r::EdgeGrid::Contour::get_segment ( size_t idx) const
inline
79 {
80 assert(idx < this->num_segments());
81 return Line(this->segment_start(idx), this->segment_end(idx));
82 }
size_t num_segments() const
Definition EdgeGrid.hpp:76
const Slic3r::Point & segment_end(size_t idx) const
Definition EdgeGrid.hpp:49
const Slic3r::Point & segment_start(size_t idx) const
Definition EdgeGrid.hpp:43

References num_segments(), segment_end(), and segment_start().

Here is the call graph for this function:

◆ get_segments()

Lines Slic3r::EdgeGrid::Contour::get_segments ( ) const
inline
85 {
86 Lines lines;
87 lines.reserve(this->num_segments());
88 if (this->num_segments() > 2) {
89 for (auto it = this->begin(); it != this->end() - 1; ++it) lines.push_back(Line(*it, *(it + 1)));
90 if (!m_open) lines.push_back(Line(this->back(), this->front()));
91 }
92 return lines;
93 }
const Slic3r::Point & back() const
Definition EdgeGrid.hpp:40
const Slic3r::Point & front() const
Definition EdgeGrid.hpp:39
std::vector< Line > Lines
Definition Line.hpp:20

References back(), begin(), end(), front(), m_open, and num_segments().

Here is the call graph for this function:

◆ num_segments()

size_t Slic3r::EdgeGrid::Contour::num_segments ( ) const
inline
76{ return this->size() - (m_open ? 1 : 0); }

References m_open, and size().

Referenced by get_segment(), get_segments(), segment_end(), segment_idx_next(), segment_idx_prev(), segment_prev(), and segment_start().

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

◆ open()

bool Slic3r::EdgeGrid::Contour::open ( ) const
inline
36{ return m_open; }

References m_open.

Referenced by Contour(), Contour(), and Contour().

Here is the caller graph for this function:

◆ segment_end()

const Slic3r::Point & Slic3r::EdgeGrid::Contour::segment_end ( size_t idx) const
inline
49 {
50 assert(idx < this->num_segments());
51 const Slic3r::Point *ptr = m_begin + idx + 1;
52 return ptr == m_end ? *m_begin : *ptr;
53 }

References m_begin, m_end, and num_segments().

Referenced by get_segment(), Slic3r::EdgeGrid::Grid::has_intersecting_edges(), and Slic3r::EdgeGrid::Grid::intersecting_edges().

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

◆ segment_idx_next()

const size_t Slic3r::EdgeGrid::Contour::segment_idx_next ( size_t idx) const
inline
70 {
71 assert(idx < this->num_segments());
72 ++ idx;
73 return m_begin + idx == m_end ? 0 : idx;
74 }

References m_begin, m_end, and num_segments().

Here is the call graph for this function:

◆ segment_idx_prev()

const size_t Slic3r::EdgeGrid::Contour::segment_idx_prev ( size_t idx) const
inline
63 {
64 assert(idx < this->num_segments());
65 assert(idx > 0 || ! m_open);
66 return (idx == 0 ? this->size() : idx) - 1;
67 }

References m_open, num_segments(), and size().

Here is the call graph for this function:

◆ segment_prev()

const Slic3r::Point & Slic3r::EdgeGrid::Contour::segment_prev ( size_t idx) const
inline
56 {
57 assert(idx < this->num_segments());
58 assert(idx > 0 || ! m_open);
59 return idx == 0 ? m_end[-1] : m_begin[idx - 1];
60 }

References m_begin, m_end, m_open, and num_segments().

Here is the call graph for this function:

◆ segment_start()

const Slic3r::Point & Slic3r::EdgeGrid::Contour::segment_start ( size_t idx) const
inline
43 {
44 assert(idx < this->num_segments());
45 return m_begin[idx];
46 }

References m_begin, and num_segments().

Referenced by get_segment(), Slic3r::EdgeGrid::Grid::has_intersecting_edges(), and Slic3r::EdgeGrid::Grid::intersecting_edges().

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

◆ size()

size_t Slic3r::EdgeGrid::Contour::size ( ) const
inlineprivate
96{ return m_end - m_begin; }

References m_begin, and m_end.

Referenced by Contour(), Contour(), num_segments(), and segment_idx_prev().

Here is the caller graph for this function:

Member Data Documentation

◆ m_begin

const Slic3r::Point* Slic3r::EdgeGrid::Contour::m_begin { nullptr }
private

◆ m_end

const Slic3r::Point* Slic3r::EdgeGrid::Contour::m_end { nullptr }
private
99{ nullptr };

Referenced by Contour(), back(), end(), segment_end(), segment_idx_next(), segment_prev(), and size().

◆ m_open

bool Slic3r::EdgeGrid::Contour::m_open { false }
private

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