Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Slic3r::sla::BoxIndex Class Reference

#include <src/libslic3r/SLA/SpatIndex.hpp>

+ Collaboration diagram for Slic3r::sla::BoxIndex:

Classes

class  Impl
 

Public Types

enum  QueryType { qtIntersects , qtWithin }
 

Public Member Functions

 BoxIndex ()
 
 ~BoxIndex ()
 
 BoxIndex (const BoxIndex &)
 
 BoxIndex (BoxIndex &&)
 
BoxIndexoperator= (const BoxIndex &)
 
BoxIndexoperator= (BoxIndex &&)
 
void insert (const BoxIndexEl &)
 
void insert (const BoundingBox &bb, unsigned idx)
 
bool remove (const BoxIndexEl &)
 
std::vector< BoxIndexElquery (const BoundingBox &, QueryType qt)
 
size_t size () const
 
bool empty () const
 
void foreach (std::function< void(const BoxIndexEl &el)> fn)
 

Private Attributes

std::unique_ptr< Implm_impl
 

Detailed Description


Class Documentation

◆ Slic3r::sla::BoxIndex::Impl

class Slic3r::sla::BoxIndex::Impl
Class Members
typedef rtree< BoxIndexEl, rstar< 16, 4 > > BoostIndex
Class Members
BoostIndex m_store

Member Enumeration Documentation

◆ QueryType

Enumerator
qtIntersects 
qtWithin 
@ qtWithin
Definition SpatIndex.hpp:83
@ qtIntersects
Definition SpatIndex.hpp:83

Constructor & Destructor Documentation

◆ BoxIndex() [1/3]

Slic3r::sla::BoxIndex::BoxIndex ( )
105: m_impl(new Impl()) {}
std::unique_ptr< Impl > m_impl
Definition SpatIndex.hpp:64

◆ ~BoxIndex()

Slic3r::sla::BoxIndex::~BoxIndex ( )
106{}

◆ BoxIndex() [2/3]

Slic3r::sla::BoxIndex::BoxIndex ( const BoxIndex cpy)
108: m_impl(new Impl(*cpy.m_impl)) {}

◆ BoxIndex() [3/3]

Slic3r::sla::BoxIndex::BoxIndex ( BoxIndex &&  cpy)
109: m_impl(std::move(cpy.m_impl)) {}

Member Function Documentation

◆ empty()

bool Slic3r::sla::BoxIndex::empty ( ) const
inline
89{ return size() == 0; }
size_t size() const
Definition SpatIndex.cpp:151

References size().

+ Here is the call graph for this function:

◆ foreach()

void Slic3r::sla::BoxIndex::foreach ( std::function< void(const BoxIndexEl &el)>  fn)
157{
158 for(auto& el : m_impl->m_store) fn(el);
159}

References m_impl.

◆ insert() [1/2]

void Slic3r::sla::BoxIndex::insert ( const BoundingBox bb,
unsigned  idx 
)
inline
77 {
78 insert(std::make_pair(bb, unsigned(idx)));
79 }
void insert(const BoxIndexEl &)
Definition SpatIndex.cpp:123

References insert().

+ Here is the call graph for this function:

◆ insert() [2/2]

void Slic3r::sla::BoxIndex::insert ( const BoxIndexEl el)
124{
125 m_impl->m_store.insert(el);
126}

References m_impl.

Referenced by Slic3r::sla::anonymous_namespace{Pad.cpp}::Intersector::add(), and insert().

+ Here is the caller graph for this function:

◆ operator=() [1/2]

BoxIndex & Slic3r::sla::BoxIndex::operator= ( BoxIndex &&  cpy)
118{
119 m_impl.swap(cpy.m_impl);
120 return *this;
121}

References m_impl.

◆ operator=() [2/2]

BoxIndex & Slic3r::sla::BoxIndex::operator= ( const BoxIndex cpy)
112{
113 m_impl.reset(new Impl(*cpy.m_impl));
114 return *this;
115}

References m_impl.

◆ query()

std::vector< BoxIndexEl > Slic3r::sla::BoxIndex::query ( const BoundingBox qrbb,
BoxIndex::QueryType  qt 
)
135{
136 namespace bgi = boost::geometry::index;
137
138 std::vector<BoxIndexEl> ret; ret.reserve(m_impl->m_store.size());
139
140 switch (qt) {
141 case qtIntersects:
142 m_impl->m_store.query(bgi::intersects(qrbb), std::back_inserter(ret));
143 break;
144 case qtWithin:
145 m_impl->m_store.query(bgi::within(qrbb), std::back_inserter(ret));
146 }
147
148 return ret;
149}

References m_impl, qtIntersects, and qtWithin.

Referenced by Slic3r::sla::anonymous_namespace{Pad.cpp}::Intersector::intersects().

+ Here is the caller graph for this function:

◆ remove()

bool Slic3r::sla::BoxIndex::remove ( const BoxIndexEl el)
129{
130 return m_impl->m_store.remove(el) == 1;
131}

References m_impl.

◆ size()

size_t Slic3r::sla::BoxIndex::size ( ) const
152{
153 return m_impl->m_store.size();
154}

References m_impl.

Referenced by Slic3r::sla::anonymous_namespace{Pad.cpp}::Intersector::add(), and empty().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_impl

std::unique_ptr<Impl> Slic3r::sla::BoxIndex::m_impl
private

The documentation for this class was generated from the following files: