OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::BoundingBoxf Class Reference

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

Inheritance diagram for Slic3r::BoundingBoxf:
Collaboration diagram for Slic3r::BoundingBoxf:

Public Types

using PointsType

Public Member Functions

 BoundingBoxf ()
 BoundingBoxf (const Vec2d &pmin, const Vec2d &pmax)
 BoundingBoxf (const std::vector< Vec2d > &points)
void reset ()
void merge (const Vec2d &point)
void scale (double factor)
Vec2d size () const
double radius () const
double area () const
void translate (coordf_t x, coordf_t y)
void offset (coordf_t delta)
BoundingBoxBase< Vec2d, PointsType > inflated (coordf_t delta) const throw ()
Vec2d center () const
bool contains (const Vec2d &point) const
bool overlap (const BoundingBoxBase< Vec2d, PointsType > &other) const
Vec2d operator[] (size_t idx) const
bool operator== (const BoundingBoxBase< Vec2d, PointsType > &rhs)
bool operator!= (const BoundingBoxBase< Vec2d, PointsType > &rhs)

Public Attributes

Vec2d min
Vec2d max
bool defined

Static Private Member Functions

static void construct (BoundingBoxType &out, It from, It to)

Detailed Description

Member Typedef Documentation

◆ PointsType

using Slic3r::BoundingBoxBase< Vec2d, std::vector<Vec2d> >::PointsType
inherited

Constructor & Destructor Documentation

◆ BoundingBoxf() [1/3]

Slic3r::BoundingBoxf::BoundingBoxf ( )
inline
BoundingBoxBase()
Definition BoundingBox.hpp:24

References Slic3r::BoundingBoxBase< Vec2d >::BoundingBoxBase().

Here is the call graph for this function:

◆ BoundingBoxf() [2/3]

Slic3r::BoundingBoxf::BoundingBoxf ( const Vec2d & pmin,
const Vec2d & pmax )
inline
260: BoundingBoxBase<Vec2d>(pmin, pmax) {}

References Slic3r::BoundingBoxBase< Vec2d >::BoundingBoxBase().

Here is the call graph for this function:

◆ BoundingBoxf() [3/3]

Slic3r::BoundingBoxf::BoundingBoxf ( const std::vector< Vec2d > & points)
inline
261: BoundingBoxBase<Vec2d>(points) {}

References Slic3r::BoundingBoxBase< Vec2d >::BoundingBoxBase().

Here is the call graph for this function:

Member Function Documentation

◆ area()

double Slic3r::BoundingBoxBase< Vec2d, std::vector<Vec2d> >::area ( ) const
inlineinherited
45{ return double(this->max(0) - this->min(0)) * (this->max(1) - this->min(1)); } // BBS
Definition BoundingBox.hpp:17
Vec2d max
Definition BoundingBox.hpp:21
Vec2d min
Definition BoundingBox.hpp:20

◆ center()

template Vec2d Slic3r::BoundingBoxBase< Vec2d, std::vector<Vec2d> >::center ( ) const
inherited
229{
230 return (this->min + this->max) / 2;
231}

◆ construct()

template void Slic3r::BoundingBoxBase< Vec2d, std::vector<Vec2d> >::construct< 1, BoundingBox, Points::const_iterator > ( BoundingBoxType & out,
It from,
It to )
inlinestaticprivateinherited
100 {
101 if (from != to) {
102 auto it = from;
104 out.max = out.min;
105 for (++ it; it != to; ++ it) {
106 auto vec = it->template cast<typename PointType::Scalar>();
107 out.min = out.min.cwiseMin(vec);
108 out.max = out.max.cwiseMax(vec);
109 }
110 out.defined = IncludeBoundary || (out.min.x() < out.max.x() && out.min.y() < out.max.y());
111 }
112 }
bool defined
Definition BoundingBox.hpp:22
auto cast(const BoundingBoxBase< Tin > &b)
Definition BoundingBox.hpp:299

◆ contains()

bool Slic3r::BoundingBoxBase< Vec2d, std::vector<Vec2d> >::contains ( const Vec2d & point) const
inlineinherited
51 {
52 return point.x() >= this->min.x() && point.x() <= this->max.x()
53 && point.y() >= this->min.y() && point.y() <= this->max.y();
54 }

◆ inflated()

BoundingBoxBase< Vec2d, PointsType > Slic3r::BoundingBoxBase< Vec2d, std::vector<Vec2d> >::inflated ( coordf_t delta) const
throw ( )
inlineinherited
void offset(coordf_t delta)
Definition BoundingBox.cpp:209

◆ merge()

void Slic3r::BoundingBoxBase< Vec2d, std::vector<Vec2d> >::merge ( const Vec2d & point)
inherited
76{
77 if (this->defined) {
78 this->min = this->min.cwiseMin(point);
79 this->max = this->max.cwiseMax(point);
80 } else {
81 this->min = point;
82 this->max = point;
83 this->defined = true;
84 }
85}

◆ offset()

template void Slic3r::BoundingBoxBase< Vec2d, std::vector<Vec2d> >::offset ( coordf_t delta)
inherited
210{
212 this->min -= v;
213 this->max += v;
214}

◆ operator!=()

bool Slic3r::BoundingBoxBase< Vec2d, std::vector<Vec2d> >::operator!= ( const BoundingBoxBase< Vec2d, PointsType > & rhs)
inlineinherited
83{ return ! (*this == rhs); }

◆ operator==()

bool Slic3r::BoundingBoxBase< Vec2d, std::vector<Vec2d> >::operator== ( const BoundingBoxBase< Vec2d, PointsType > & rhs)
inlineinherited
82{ return this->min == rhs.min && this->max == rhs.max; }

◆ operator[]()

Vec2d Slic3r::BoundingBoxBase< Vec2d, std::vector<Vec2d> >::operator[] ( size_t idx) const
inlineinherited
62 {
63 switch (idx) {
64 case 0:
65 return min;
66 break;
67 case 1:
68 return PointType(max(0), min(1));
69 break;
70 case 2:
71 return max;
72 break;
73 case 3:
74 return PointType(min(0), max(1));
75 break;
76 default:
77 return PointType();
78 break;
79 }
80 return PointType();
81 }

◆ overlap()

bool Slic3r::BoundingBoxBase< Vec2d, std::vector<Vec2d> >::overlap ( const BoundingBoxBase< Vec2d, PointsType > & other) const
inlineinherited
58 {
59 return ! (this->max.x() < other.min.x() || this->min.x() > other.max.x() ||
60 this->max.y() < other.min.y() || this->min.y() > other.max.y());
61 }

◆ radius()

template double Slic3r::BoundingBoxBase< Vec2d, std::vector<Vec2d> >::radius ( ) const
inherited
195{
196 assert(this->defined);
197 return 0.5 * (this->max - this->min).template cast<double>().norm();
198}

◆ reset()

void Slic3r::BoundingBoxBase< Vec2d, std::vector<Vec2d> >::reset ( )
inlineinherited
38{ this->defined = false; this->min = PointType::Zero(); this->max = PointType::Zero(); }

◆ scale()

template void Slic3r::BoundingBoxBase< Vec2d, std::vector<Vec2d> >::scale ( double factor)
inherited
66{
67 this->min *= factor;
68 this->max *= factor;
69}

◆ size()

template Vec2d Slic3r::BoundingBoxBase< Vec2d, std::vector<Vec2d> >::size ( ) const
inherited
179{
180 return this->max - this->min;
181}

◆ translate()

void Slic3r::BoundingBoxBase< Vec2d, std::vector<Vec2d> >::translate ( coordf_t x,
coordf_t y )
inlineinherited
46{ assert(this->defined); PointType v(x, y); this->min += v; this->max += v; }

Member Data Documentation

◆ defined

bool Slic3r::BoundingBoxBase< Vec2d, std::vector<Vec2d> >::defined
inherited

◆ max

Vec2d Slic3r::BoundingBoxBase< Vec2d, std::vector<Vec2d> >::max
inherited

◆ min

Vec2d Slic3r::BoundingBoxBase< Vec2d, std::vector<Vec2d> >::min
inherited

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