3 #include "common/common.hpp"
4 #include "canvas_mesh.hpp"
5 #include "canvas/appearance.hpp"
6 #include "util/uuid.hpp"
11 #include "background.hpp"
23 Color background_top_color;
24 Color background_bottom_color;
25 Color get_layer_color(
int layer)
const;
27 bool show_solder_mask =
true;
28 bool show_silkscreen =
true;
29 bool show_substrate =
true;
30 bool show_models =
true;
31 bool show_dnp_models =
false;
32 bool show_solder_paste =
true;
33 bool use_layer_colors =
false;
34 Color solder_mask_color = {0, .5, 0};
35 Color substrate_color = {.2, .15, 0};
37 float highlight_intensity = .5;
39 float cam_azimuth = 90;
40 float cam_elevation = 45;
41 float cam_distance = 20;
46 enum class Projection { PERSP, ORTHO };
47 Projection projection = Projection::PERSP;
52 : x(ix), y(iy), z(iz), nx(inx), ny(iny), nz(inz), r(ir), g(ig), b(ib), _pad(0)
66 } __attribute__((packed));
70 ModelTransform(
float ix,
float iy,
float a,
bool flip,
bool highlight)
71 : x(ix), y(iy), angle(a), flags(flip | (highlight << 1))
85 } __attribute__((packed));
87 void clear_3d_models();
101 void resize_buffers();
103 enum class RenderBackground { YES, NO };
104 void render(RenderBackground mode = RenderBackground::YES);
105 virtual int a_get_scale_factor()
const;
107 void prepare_packages();
109 unsigned int num_samples = 1;
111 const class Board *brd =
nullptr;
113 std::set<UUID> packages_highlight;
115 void load_3d_model(
const std::string &filename,
const std::string &filename_abs);
117 std::map<std::string, std::string> get_model_filenames(
class IPool &pool);
119 std::mutex models_loading_mutex;
121 void update_max_package_height();
124 float get_layer_offset(
int layer)
const;
125 float get_layer_thickness(
int layer)
const;
126 bool layer_is_visible(
int layer)
const;
128 std::pair<glm::vec3, glm::vec3> bbox;
132 GLuint depthrenderbuffer;
136 glm::vec3 cam_normal;
138 float package_height_max = 0;
139 std::vector<FaceVertex> face_vertex_buffer;
140 std::vector<unsigned int> face_index_buffer;
144 ModelInfo(
size_t o,
size_t n) : face_index_offset(o), count(n)
147 const size_t face_index_offset;
151 std::map<std::string, ModelInfo> models;
153 std::vector<ModelTransform> package_transforms;
156 std::map<std::pair<std::string, bool>, std::pair<size_t, size_t>>
157 package_transform_idxs;
160 float get_magic_number()
const;
Definition: appearance.hpp:7
Definition: background.hpp:5
Definition: canvas3d_base.hpp:49
Definition: canvas3d_base.hpp:15
Definition: canvas_mesh.hpp:8
Definition: common.hpp:234
zip_uint8_t uint8_t
zip_uint8_t typedef.
Definition: zip.hpp:78
zip_uint16_t uint16_t
zip_uint16_t typedef.
Definition: zip.hpp:88