Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Slic3r::GUI::Rect Class Reference

#include <src/slic3r/GUI/Gizmos/GLGizmosManager.hpp>

Public Member Functions

 Rect ()=default
 
 Rect (float left, float top, float right, float bottom)
 
bool operator== (const Rect &other) const
 
bool operator!= (const Rect &other) const
 
float get_left () const
 
void set_left (float left)
 
float get_top () const
 
void set_top (float top)
 
float get_right () const
 
void set_right (float right)
 
float get_bottom () const
 
void set_bottom (float bottom)
 
float get_width () const
 
float get_height () const
 

Private Attributes

float m_left { 0.0f }
 
float m_top { 0.0f }
 
float m_right { 0.0f }
 
float m_bottom { 0.0f }
 

Detailed Description

Constructor & Destructor Documentation

◆ Rect() [1/2]

Slic3r::GUI::Rect::Rect ( )
default

◆ Rect() [2/2]

Slic3r::GUI::Rect::Rect ( float  left,
float  top,
float  right,
float  bottom 
)
inline
35: m_left(left) , m_top(top) , m_right(right) , m_bottom(bottom) {}
float m_bottom
Definition GLGizmosManager.hpp:31
float m_right
Definition GLGizmosManager.hpp:30
float m_left
Definition GLGizmosManager.hpp:28
float m_top
Definition GLGizmosManager.hpp:29

Member Function Documentation

◆ get_bottom()

float Slic3r::GUI::Rect::get_bottom ( ) const
inline
55{ return m_bottom; }

References m_bottom.

Referenced by Slic3r::GUI::GLCanvas3D::_perform_layer_editing_action(), Slic3r::GUI::GLCanvas3D::LayersEditing::bar_rect_contains(), and Slic3r::GUI::GLCanvas3D::LayersEditing::get_cursor_z_relative().

+ Here is the caller graph for this function:

◆ get_height()

float Slic3r::GUI::Rect::get_height ( ) const
inline
59{ return m_top - m_bottom; }

References m_bottom, and m_top.

◆ get_left()

float Slic3r::GUI::Rect::get_left ( ) const
inline
46{ return m_left; }

References m_left.

Referenced by Slic3r::GUI::GLCanvas3D::LayersEditing::bar_rect_contains(), and Slic3r::GUI::GLCanvas3D::LayersEditing::get_cursor_z_relative().

+ Here is the caller graph for this function:

◆ get_right()

float Slic3r::GUI::Rect::get_right ( ) const
inline
52{ return m_right; }

References m_right.

Referenced by Slic3r::GUI::GLCanvas3D::LayersEditing::bar_rect_contains(), and Slic3r::GUI::GLCanvas3D::LayersEditing::get_cursor_z_relative().

+ Here is the caller graph for this function:

◆ get_top()

float Slic3r::GUI::Rect::get_top ( ) const
inline
49{ return m_top; }

References m_top.

Referenced by Slic3r::GUI::GLCanvas3D::_perform_layer_editing_action(), Slic3r::GUI::GLCanvas3D::LayersEditing::bar_rect_contains(), and Slic3r::GUI::GLCanvas3D::LayersEditing::get_cursor_z_relative().

+ Here is the caller graph for this function:

◆ get_width()

float Slic3r::GUI::Rect::get_width ( ) const
inline
58{ return m_right - m_left; }

References m_left, and m_right.

◆ operator!=()

bool Slic3r::GUI::Rect::operator!= ( const Rect other) const
inline
44{ return !operator==(other); }
bool operator==(const Rect &other) const
Definition GLGizmosManager.hpp:37

References operator==().

+ Here is the call graph for this function:

◆ operator==()

bool Slic3r::GUI::Rect::operator== ( const Rect other) const
inline
37 {
38 if (std::abs(m_left - other.m_left) > EPSILON) return false;
39 if (std::abs(m_top - other.m_top) > EPSILON) return false;
40 if (std::abs(m_right - other.m_right) > EPSILON) return false;
41 if (std::abs(m_bottom - other.m_bottom) > EPSILON) return false;
42 return true;
43 }
static constexpr double EPSILON
Definition libslic3r.h:51

References EPSILON, m_bottom, m_left, m_right, and m_top.

Referenced by operator!=().

+ Here is the caller graph for this function:

◆ set_bottom()

void Slic3r::GUI::Rect::set_bottom ( float  bottom)
inline
56{ m_bottom = bottom; }

References m_bottom.

◆ set_left()

void Slic3r::GUI::Rect::set_left ( float  left)
inline

References m_left.

◆ set_right()

void Slic3r::GUI::Rect::set_right ( float  right)
inline

References m_right.

◆ set_top()

void Slic3r::GUI::Rect::set_top ( float  top)
inline
50{ m_top = top; }

References m_top.

Member Data Documentation

◆ m_bottom

float Slic3r::GUI::Rect::m_bottom { 0.0f }
private

◆ m_left

float Slic3r::GUI::Rect::m_left { 0.0f }
private

◆ m_right

float Slic3r::GUI::Rect::m_right { 0.0f }
private

◆ m_top

float Slic3r::GUI::Rect::m_top { 0.0f }
private

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