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_solder_paste =
true;
32 bool use_layer_colors =
false;
33 Color solder_mask_color = {0, .5, 0};
34 Color substrate_color = {.2, .15, 0};
36 float highlight_intensity = .5;
38 float cam_azimuth = 90;
39 float cam_elevation = 45;
40 float cam_distance = 20;
45 enum class Projection { PERSP, ORTHO };
46 Projection projection = Projection::PERSP;
51 : x(ix), y(iy), z(iz), r(ir), g(ig), b(ib), _pad(0)
62 } __attribute__((packed));
66 ModelTransform(
float ix,
float iy,
float a,
bool flip,
bool highlight)
67 : x(ix), y(iy), angle(a), flags(flip | (highlight << 1))
81 } __attribute__((packed));
83 void clear_3d_models();
96 float get_layer_offset(
int layer)
const;
97 float get_layer_thickness(
int layer)
const;
98 bool layer_is_visible(
int layer)
const;
100 void resize_buffers();
102 enum class RenderBackground { YES, NO };
103 void render(RenderBackground mode = RenderBackground::YES);
104 virtual int a_get_scale_factor()
const;
106 void prepare_packages();
111 GLuint depthrenderbuffer;
112 unsigned int num_samples = 1;
116 glm::vec3 cam_normal;
118 const class Board *brd =
nullptr;
120 std::pair<glm::vec3, glm::vec3> bbox;
121 float package_height_max = 0;
123 std::set<UUID> packages_highlight;
125 void load_3d_model(
const std::string &filename,
const std::string &filename_abs);
127 std::map<std::string, std::string> get_model_filenames(
class Pool &pool);
129 std::mutex models_loading_mutex;
130 std::vector<FaceVertex> face_vertex_buffer;
131 std::vector<unsigned int> face_index_buffer;
132 std::map<std::string, std::pair<size_t, size_t>> models;
135 std::vector<ModelTransform> package_transforms;
138 std::map<std::string, std::pair<size_t, size_t>>
139 package_transform_idxs;