libvcad_compilers — compiler classes
-
class CompilerBase
- #include <compiler_base.h>
Subclassed by ColorInkjetCompiler, MaterialInkjetCompiler, SlicerProjectCompiler
Public Functions
-
void cancel()
-
virtual void compile() = 0
-
CompilerBase() = default
-
void set_progress_callback(const std::function<void(double)> &progress_callback)
-
virtual std::vector<std::string> supported_attributes() const = 0
-
virtual ~CompilerBase() = default
-
void cancel()
-
class MaterialInkjetCompiler : public CompilerBase
- #include <material_inkjet_compiler.h>
Public Functions
-
virtual void compile() override
-
std::unordered_map<uint8_t, size_t> material_voxel_counts() const
-
std::tuple<size_t, size_t, size_t> resolution() const
-
void set_fallback_material_id(uint8_t material_id)
Sets the fallback material ID used for voxels where VOLUME_FRACTIONS is undefined.
Only used when strict mode is off.
- Parameters:
material_id – The fallback material ID (default is 0, the void material).
-
void set_strict_mode(bool strict)
Enables or disables strict mode.
When strict mode is on, the compiler throws a std::runtime_error if any inside voxel is missing the required VOLUME_FRACTIONS attribute. When off (default), the fallback material is used instead.
-
virtual std::vector<std::string> supported_attributes() const override
Private Members
-
uint8_t m_fallback_material_id = 0
-
std::string m_file_prefix
-
double m_liquid_keep_out_distance
-
std::shared_ptr<MaterialDefs> m_material_defs
-
std::unordered_map<uint8_t, size_t> m_material_voxel_counts
-
std::string m_output_directory
-
bool m_strict_mode = false
-
glm::vec3 m_voxel_size
-
size_t m_x_resolution = 0
-
size_t m_y_resolution = 0
-
size_t m_z_resolution = 0
-
virtual void compile() override
-
class ColorInkjetCompiler : public CompilerBase
- #include <color_inkjet_compiler.h>
Public Functions
-
virtual void compile() override
-
std::tuple<size_t, size_t, size_t> resolution() const
-
void set_fallback_color(glm::vec4 color)
Sets the fallback RGBA color used for voxels where COLOR_RGBA is undefined.
Each component is in [0, 1]. Only used when strict mode is off.
- Parameters:
color – The fallback sRGBA color (default is fully transparent: 0,0,0,0).
-
void set_strict_mode(bool strict)
Enables or disables strict mode.
When strict mode is on, the compiler throws a std::runtime_error if any inside voxel is missing the required COLOR_RGBA attribute. When off (default), the fallback color is used instead.
-
virtual std::vector<std::string> supported_attributes() const override
-
virtual void compile() override
-
class SlicerProjectCompiler : public CompilerBase
- #include <slicer_project_compiler.h>
Public Functions
-
virtual void compile() override
-
inline virtual std::vector<std::string> supported_attributes() const override
Private Functions
-
size_t add_extruder(int temperature, int flow_rate)
-
void add_setting_entry_to_xml(pugi::xml_node &parent_node, const std::string &attribute, double min_value, double max_value, size_t num_steps, const std::unordered_map<std::string, std::pair<double, double>> &min_max_map)
-
std::unordered_map<std::string, std::pair<double, double>> compute_attribute_ranges(const std::unordered_map<std::string, bool> &attribute_type_map)
-
vtkSmartPointer<vtkImageData> compute_filtered_image_data(const std::unordered_map<std::string, std::pair<double, double>> &attribute_ranges_map, const std::unordered_map<std::string, bool> &attribute_type_map)
Private Members
-
std::vector<std::pair<int, int>> m_extruders
-
std::string m_filament_profile_path
-
std::vector<std::string> m_ignored_attributes
-
glm::vec3 m_max_coord
-
glm::vec3 m_min_coord
-
size_t m_num_regions
-
std::string m_output_file_path
-
std::string m_printer_profile_path
-
std::vector<std::pair<std::optional<double>, std::optional<AttributeSamples>>> m_sample_array
-
size_t m_size_x
-
size_t m_size_y
-
size_t m_size_z
-
glm::vec3 m_voxel_size
Private Static Functions
-
static std::unordered_map<std::string, bool> compute_attribute_type_map(const std::vector<std::string> &attributes)
-
virtual void compile() override