OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::PartPlateList::BedTextureInfo::TexturePart Class Reference

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

Collaboration diagram for Slic3r::GUI::PartPlateList::BedTextureInfo::TexturePart:

Public Member Functions

 TexturePart (float xx, float yy, float ww, float hh, std::string file)
void update_pos (float xx, float yy, float ww, float hh)
void update_file (std::string file)
void update_buffer ()
void reset ()

Public Attributes

float x
float y
float w
float h
std::string filename
GLTexture * texture { nullptr }
Vec2d offset
GLModel * buffer { nullptr }

Detailed Description

Constructor & Destructor Documentation

◆ TexturePart()

Slic3r::GUI::PartPlateList::BedTextureInfo::TexturePart::TexturePart ( float xx,
float yy,
float ww,
float hh,
std::string file )
inline
867 {
868 x = xx; y = yy;
869 w = ww; h = hh;
870 filename = file;
871 texture = nullptr;
872 buffer = nullptr;
873 offset = Vec2d(0, 0);
874 }
GLTexture * texture
Definition PartPlate.hpp:864
GLModel * buffer
Definition PartPlate.hpp:866
std::string filename
Definition PartPlate.hpp:863
Eigen::Matrix< double, 2, 1, Eigen::DontAlign > Vec2d
Definition Point.hpp:67

References buffer, filename, h, offset, texture, w, x, and y.

Member Function Documentation

◆ reset()

void Slic3r::GUI::PartPlateList::BedTextureInfo::TexturePart::reset ( )
8747{
8748 if (texture) {
8749 texture->reset();
8750 delete texture;
8751 }
8752 if (buffer)
8753 delete buffer;
8754}

References buffer, and texture.

◆ update_buffer()

void Slic3r::GUI::PartPlateList::BedTextureInfo::TexturePart::update_buffer ( )
8716{
8717 if (w == 0 || h == 0) {
8718 return;
8719 }
8720
8721 Pointfs rectangle;
8722 rectangle.push_back(Vec2d(x, y));
8723 rectangle.push_back(Vec2d(x+w, y));
8724 rectangle.push_back(Vec2d(x+w, y+h));
8725 rectangle.push_back(Vec2d(x, y+h));
8726 ExPolygon poly;
8727
8728 for (int i = 0; i < 4; i++) {
8729 const Vec2d & p = rectangle[i];
8730 for (auto& p : rectangle) {
8731 Vec2d pp = Vec2d(p.x() + offset.x(), p.y() + offset.y());
8732 poly.contour.append({ scale_(pp(0)), scale_(pp(1)) });
8733 }
8734 }
8735
8736 if (!buffer)
8737 buffer = new GLModel();
8738
8739 buffer->reset();
8740
8741 if (!init_model_from_poly(*buffer, poly, GROUND_Z + 0.02f)) {
8742 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ":Unable to create buffer triangles\n";
8743 }
8744}
static const float GROUND_Z
Definition 3DBed.cpp:49
#define scale_(val)
Definition libslic3r.h:106
void poly(std::vector< std::pair< Vec2d, Vec2d > > &out, std::initializer_list< Vec2d > p)
Definition DesignSketchTool.cpp:7751
bool init_model_from_poly(GLModel &model, const ExPolygon &poly, float z)
Definition 3DBed.cpp:54
std::vector< Vec2d > Pointfs
Definition Point.hpp:77

References buffer, GROUND_Z, h, Slic3r::GUI::init_model_from_poly(), offset, scale_, w, x, and y.

Here is the call graph for this function:

◆ update_file()

void Slic3r::GUI::PartPlateList::BedTextureInfo::TexturePart::update_file ( std::string file)
inline
882 {
883 filename = file;
884 }

References filename.

Referenced by Slic3r::GUI::PartPlateList::init_bed_type_info().

Here is the caller graph for this function:

◆ update_pos()

void Slic3r::GUI::PartPlateList::BedTextureInfo::TexturePart::update_pos ( float xx,
float yy,
float ww,
float hh )
inline
876 {
877 x = xx;
878 y = yy;
879 w = ww;
880 h = hh;
881 }

References h, w, x, and y.

Referenced by Slic3r::GUI::PartPlateList::init_bed_type_info().

Here is the caller graph for this function:

Member Data Documentation

◆ buffer

GLModel* Slic3r::GUI::PartPlateList::BedTextureInfo::TexturePart::buffer { nullptr }
866{ nullptr };

Referenced by TexturePart(), reset(), and update_buffer().

◆ filename

std::string Slic3r::GUI::PartPlateList::BedTextureInfo::TexturePart::filename

◆ h

float Slic3r::GUI::PartPlateList::BedTextureInfo::TexturePart::h

◆ offset

Vec2d Slic3r::GUI::PartPlateList::BedTextureInfo::TexturePart::offset

Referenced by TexturePart(), and update_buffer().

◆ texture

GLTexture* Slic3r::GUI::PartPlateList::BedTextureInfo::TexturePart::texture { nullptr }
864{ nullptr };

Referenced by TexturePart(), Slic3r::GUI::load_next_part_texture(), and reset().

◆ w

float Slic3r::GUI::PartPlateList::BedTextureInfo::TexturePart::w

◆ x

float Slic3r::GUI::PartPlateList::BedTextureInfo::TexturePart::x

◆ y

float Slic3r::GUI::PartPlateList::BedTextureInfo::TexturePart::y

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