38 #ifndef H_OGF_MESH_GFX_TOOLS_MESH_GROB_PAINT_TOOLS_H
39 #define H_OGF_MESH_GFX_TOOLS_MESH_GROB_PAINT_TOOLS_H
41 #include <OGF/mesh_gfx/common/common.h>
114 void set_value(
double value);
116 double get_value()
const {
126 bool get_accumulate()
const {
136 bool get_autorange()
const {
147 bool get_pick_vertices_only()
const {
148 return pick_vertices_only_;
158 bool get_xray_mode()
const {
163 void set_value_for_this_tool(
double value) {
167 void set_accumulate_for_this_tool(
bool value) {
171 void set_autorange_for_this_tool(
bool value) {
175 void set_pick_vertices_for_this_tool(
bool value) {
176 pick_vertices_only_ = value;
179 void set_xray_mode_for_this_tool(
bool value) {
195 bool get_painting_parameters(
198 MeshElementsFlags& where,
199 std::string& attribute_name,
203 void paint(
const RayPick& p_ndc);
209 bool pick_vertices_only_;
221 gom_attribute(category,
"paint")
222 gom_attribute(icon, "paint_rect")
223 gom_attribute(help, "paint attributes in rectangle")
224 gom_attribute(message, "btn1: paint; btn3: erase")
265 Image* mask =
nullptr
277 gom_attribute(category,
"paint")
278 gom_attribute(icon, "paint")
279 gom_attribute(help, "paint attributes")
280 gom_attribute(message, "btn1: paint; btn3: erase")
307 void set_width(
index_t value) {
315 void set_stroke_mode(
bool value) {
316 stroke_mode_ = value;
319 bool get_stroke_mode()
const {
345 gom_attribute(category,
"paint")
346 gom_attribute(icon, "paint_freeform")
347 gom_attribute(help, "paint attributes with free-form selection")
348 gom_attribute(message, "btn1: paint; btn3: erase")
383 gom_attribute(category,
"paint")
384 gom_attribute(icon, "paint_connected")
385 gom_attribute(help, "paint attributes on connected components")
386 gom_attribute(message, "btn1: paint; btn3: erase")
407 void set_fill_same_value(
bool x) {
408 fill_same_value_ = x;
411 bool get_fill_same_value()
const {
412 return fill_same_value_;
423 double get_tolerance()
const {
429 bool test(
double reference,
double value)
const {
430 return !fill_same_value_ ||
431 ::fabs(reference - value) <= tolerance_;
435 bool fill_same_value_;
444 gom_attribute(category,
"paint")
445 gom_attribute(icon, "pipette")
446 gom_attribute(help, "probe attributes")
447 gom_attribute(message, "btn1: probe attributes")
473 void probe(
const RayPick& p_ndc);
480 std::string message_;
488 gom_attribute(category,
"paint")
489 gom_attribute(icon, "ruler")
490 gom_attribute(help, "measures distances on a mesh")
517 void show_distance(
const RayPick& p_ndc);
Vector with aligned memory allocation.
Paint attributes in connected components.
MeshGrobPaintConnected(ToolsManager *parent)
MeshGrobPaintConnected constructor.
void set_tolerance(double value)
Tolerance used if fill_same_value os set.
void grab(const RayPick &p_ndc) override
A rect selection tool that paints attribute values in a mesh.
void grab(const RayPick &p_ndc) override
MeshGrobPaintRect(ToolsManager *parent)
MeshGrobPaint constructor.
void release(const RayPick &p_ndc) override
The event handler for mouse release events.
void drag(const RayPick &p_ndc) override
The event handler for mouse drag events.
A tool that paints attribute values in a mesh.
void release(const RayPick &p_ndc) override
The event handler for mouse release events.
void drag(const RayPick &p_ndc) override
The event handler for mouse drag events.
void grab(const RayPick &p_ndc) override
void for_each_stroke_quad(std::function< void(vec2, vec2, vec2, vec2)> doit)
Calls a user function for each quad of the stroke.
MeshGrobPaint(ToolsManager *parent)
MeshGrobPaint constructor.
A tool that probes attribute values in a mesh.
void grab(const RayPick &p_ndc) override
MeshGrobProbe(ToolsManager *parent)
MeshGrobPaint constructor.
void release(const RayPick &p_ndc) override
The event handler for mouse release events.
void drag(const RayPick &p_ndc) override
The event handler for mouse drag events.
A tool that measures distances.
void drag(const RayPick &p_ndc) override
The event handler for mouse drag events.
void release(const RayPick &p_ndc) override
The event handler for mouse release events.
void grab(const RayPick &p_ndc) override
MeshGrobRuler(ToolsManager *parent)
MeshGrobPaint constructor.
geo_index_t index_t
The type for storing and manipulating indices.
Global Graphite namespace.
PaintOp
A painting operation.
Represents the information related with a picking event.