OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::meshsplit_detail::NeighborVisitor< NeighborIndex > Struct Template Reference

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

Collaboration diagram for Slic3r::meshsplit_detail::NeighborVisitor< NeighborIndex >:

Public Member Functions

 NeighborVisitor (const indexed_triangle_set &its, const NeighborIndex &neighbor_index)
 NeighborVisitor (const indexed_triangle_set &its, NeighborIndex &&aneighbor_index)
template<typename Visitor>
void visit (Visitor visitor)

Public Attributes

const indexed_triangle_set & its
const NeighborIndex & neighbor_index

Private Types

using stack_el = size_t

Private Member Functions

void push (const stack_el &s)
stack_el pop ()

Private Attributes

const NeighborIndex m_neighbor_index_data
std::vector< char > m_visited
std::vector< stack_el > m_facestack
size_t m_seed { 0 }

Detailed Description

template<class NeighborIndex>
struct Slic3r::meshsplit_detail::NeighborVisitor< NeighborIndex >

Member Typedef Documentation

◆ stack_el

template<class NeighborIndex>
using Slic3r::meshsplit_detail::NeighborVisitor< NeighborIndex >::stack_el = size_t
private

Constructor & Destructor Documentation

◆ NeighborVisitor() [1/2]

template<class NeighborIndex>
Slic3r::meshsplit_detail::NeighborVisitor< NeighborIndex >::NeighborVisitor ( const indexed_triangle_set & its,
const NeighborIndex & neighbor_index )
inline
49 :
51 m_visited.assign(its.indices.size(), false);
52 m_facestack.reserve(its.indices.size());
53 }
const NeighborIndex & neighbor_index
Definition MeshSplitImpl.hpp:90
std::vector< stack_el > m_facestack
Definition MeshSplitImpl.hpp:99
std::vector< char > m_visited
Definition MeshSplitImpl.hpp:96
const indexed_triangle_set & its
Definition MeshSplitImpl.hpp:89

References its, m_facestack, m_visited, and neighbor_index.

◆ NeighborVisitor() [2/2]

template<class NeighborIndex>
Slic3r::meshsplit_detail::NeighborVisitor< NeighborIndex >::NeighborVisitor ( const indexed_triangle_set & its,
NeighborIndex && aneighbor_index )
inline
54 :
56 m_visited.assign(its.indices.size(), false);
57 m_facestack.reserve(its.indices.size());
58 }
Definition MeshSplitImpl.hpp:48
const NeighborIndex m_neighbor_index_data
Definition MeshSplitImpl.hpp:94

References its, m_facestack, m_neighbor_index_data, m_visited, and neighbor_index.

Member Function Documentation

◆ pop()

template<class NeighborIndex>
stack_el Slic3r::meshsplit_detail::NeighborVisitor< NeighborIndex >::pop ( )
inlineprivate
101{ stack_el ret = m_facestack.back(); m_facestack.pop_back(); return ret; }
size_t stack_el
Definition MeshSplitImpl.hpp:98

References m_facestack.

Referenced by visit().

Here is the caller graph for this function:

◆ push()

template<class NeighborIndex>
void Slic3r::meshsplit_detail::NeighborVisitor< NeighborIndex >::push ( const stack_el & s)
inlineprivate
100{ m_facestack.emplace_back(s); }

References m_facestack.

Referenced by visit().

Here is the caller graph for this function:

◆ visit()

template<class NeighborIndex>
template<typename Visitor>
void Slic3r::meshsplit_detail::NeighborVisitor< NeighborIndex >::visit ( Visitor visitor)
inline
62 {
63 // find the next unvisited facet and push the index
64 auto facet = std::find(m_visited.begin() + m_seed, m_visited.end(), false);
65 m_seed = facet - m_visited.begin();
66
67 if (facet != m_visited.end()) {
68 // Skip this element in the next round.
69 auto idx = m_seed ++;
70 if (! visitor(idx))
71 return;
72 this->push(idx);
73 m_visited[idx] = true;
74 while (! m_facestack.empty()) {
75 size_t facet_idx = this->pop();
77 assert(neighbor_idx < int(m_visited.size()));
78 if (neighbor_idx >= 0 && !m_visited[neighbor_idx]) {
79 if (! visitor(size_t(neighbor_idx)))
80 return;
81 m_visited[neighbor_idx] = true;
83 }
84 }
85 }
86 }
87 }
void push(const stack_el &s)
Definition MeshSplitImpl.hpp:100
size_t m_seed
Definition MeshSplitImpl.hpp:104
stack_el pop()
Definition MeshSplitImpl.hpp:101

References m_facestack, m_seed, m_visited, neighbor_index, pop(), and push().

Referenced by Slic3r::its_is_splittable(), Slic3r::its_number_of_patches(), and Slic3r::its_split().

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

Member Data Documentation

◆ its

template<class NeighborIndex>
const indexed_triangle_set& Slic3r::meshsplit_detail::NeighborVisitor< NeighborIndex >::its

Referenced by NeighborVisitor(), and NeighborVisitor().

◆ m_facestack

template<class NeighborIndex>
std::vector<stack_el> Slic3r::meshsplit_detail::NeighborVisitor< NeighborIndex >::m_facestack
private

◆ m_neighbor_index_data

template<class NeighborIndex>
const NeighborIndex Slic3r::meshsplit_detail::NeighborVisitor< NeighborIndex >::m_neighbor_index_data
private

Referenced by NeighborVisitor().

◆ m_seed

template<class NeighborIndex>
size_t Slic3r::meshsplit_detail::NeighborVisitor< NeighborIndex >::m_seed { 0 }
private
104{ 0 };

Referenced by visit().

◆ m_visited

template<class NeighborIndex>
std::vector<char> Slic3r::meshsplit_detail::NeighborVisitor< NeighborIndex >::m_visited
private

◆ neighbor_index

template<class NeighborIndex>
const NeighborIndex& Slic3r::meshsplit_detail::NeighborVisitor< NeighborIndex >::neighbor_index

The documentation for this struct was generated from the following file: