OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::DragShape Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/DragCanvas.hpp>

Inheritance diagram for Slic3r::GUI::DragShape:
Collaboration diagram for Slic3r::GUI::DragShape:

Public Member Functions

 DragShape (const wxBitmap &bitmap, int index)
 ~DragShape ()
wxPoint GetPosition () const
void SetPosition (const wxPoint &pos)
const wxBitmap & GetBitmap () const
void SetBitmap (const wxBitmap &bitmap)
int get_index ()
bool hit_test (const wxPoint &pt) const
void paint (wxDC &dc, bool highlight=false)

Protected Attributes

wxPoint m_pos
wxBitmap m_bitmap
int m_index

Detailed Description

Constructor & Destructor Documentation

◆ DragShape()

Slic3r::GUI::DragShape::DragShape ( const wxBitmap & bitmap,
int index )
242 : m_bitmap(bitmap)
243 , m_pos(wxPoint(0,0))
244 , m_index(index)
245{
246}
wxPoint m_pos
Definition DragCanvas.hpp:40
wxBitmap m_bitmap
Definition DragCanvas.hpp:41
int m_index
Definition DragCanvas.hpp:42

References DragShape(), m_bitmap, m_index, and m_pos.

Referenced by DragShape().

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

◆ ~DragShape()

Slic3r::GUI::DragShape::~DragShape ( )
inline
26{}

Member Function Documentation

◆ get_index()

int Slic3r::GUI::DragShape::get_index ( )
inline
34{ return m_index; }

References m_index.

◆ GetBitmap()

const wxBitmap & Slic3r::GUI::DragShape::GetBitmap ( ) const
inline
31{ return m_bitmap; }

References m_bitmap.

◆ GetPosition()

wxPoint Slic3r::GUI::DragShape::GetPosition ( ) const
inline
28{ return m_pos; }

References m_pos.

◆ hit_test()

bool Slic3r::GUI::DragShape::hit_test ( const wxPoint & pt) const
249{
250 wxRect rect(wxRect(m_pos.x, m_pos.y, m_bitmap.GetWidth(), m_bitmap.GetHeight()));
251 return rect.Contains(pt.x, pt.y);
252}

References m_bitmap, and m_pos.

◆ paint()

void Slic3r::GUI::DragShape::paint ( wxDC & dc,
bool highlight = false )
255{
256 dc.DrawBitmap(m_bitmap, m_pos);
257 if (highlight)
258 {
259 dc.SetPen(*wxWHITE_PEN);
260 dc.SetBrush(*wxTRANSPARENT_BRUSH);
261 dc.DrawRectangle(m_pos.x, m_pos.y, m_bitmap.GetWidth(), m_bitmap.GetHeight());
262 }
263}
static void highlight(wxString &str)
Definition EditGCodeDialog.cpp:470

References Slic3r::GUI::highlight(), m_bitmap, and m_pos.

Here is the call graph for this function:

◆ SetBitmap()

void Slic3r::GUI::DragShape::SetBitmap ( const wxBitmap & bitmap)
inline
32{ m_bitmap = bitmap; }

References m_bitmap.

◆ SetPosition()

void Slic3r::GUI::DragShape::SetPosition ( const wxPoint & pos)
inline
29{ m_pos = pos; }
Vec3d pos(const Pt &p)
Definition ReprojectPointsOnMesh.hpp:16

References m_pos.

Member Data Documentation

◆ m_bitmap

wxBitmap Slic3r::GUI::DragShape::m_bitmap
protected

◆ m_index

int Slic3r::GUI::DragShape::m_index
protected

Referenced by DragShape(), and get_index().

◆ m_pos

wxPoint Slic3r::GUI::DragShape::m_pos
protected

The documentation for this class was generated from the following files:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/DragCanvas.hpp
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/DragCanvas.cpp