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 {
125 double get_value2()
const {
135 bool get_accumulate()
const {
145 bool get_autorange()
const {
156 bool get_pick_vertices_only()
const {
157 return pick_vertices_only_;
167 bool get_xray_mode()
const {
188 void set_value_for_this_tool(
double value) {
192 void set_value2_for_this_tool(
double value) {
196 void set_accumulate_for_this_tool(
bool value) {
200 void set_autorange_for_this_tool(
bool value) {
204 void set_pick_vertices_for_this_tool(
bool value) {
205 pick_vertices_only_ = value;
208 void set_xray_mode_for_this_tool(
bool value) {
224 bool get_painting_parameters(
227 MeshElementsFlags& where,
228 std::string& attribute_name,
232 void paint(
const RayPick& p_ndc);
239 bool pick_vertices_only_;
251 gom_attribute(category,
"paint")
252 gom_attribute(icon, "paint_rect")
253 gom_attribute(help, "paint attributes in rectangle")
254 gom_attribute(message, "btn1: paint; btn2: probe; btn3: erase")
295 Image* mask =
nullptr
305 gom_attribute(category,
"paint")
306 gom_attribute(icon, "paint")
307 gom_attribute(help, "paint attributes")
308 gom_attribute(message, "btn1: paint; btn2: probe; btn3: erase")
335 void set_width(
index_t value) {
343 void set_stroke_mode(
bool value) {
344 stroke_mode_ = value;
347 bool get_stroke_mode()
const {
373 gom_attribute(category,
"paint")
374 gom_attribute(icon, "paint_freeform")
375 gom_attribute(help, "paint attributes with free-form selection")
376 gom_attribute(message, "btn1: paint; btn2: probe; btn3: erase")
411 gom_attribute(category,
"paint")
412 gom_attribute(icon, "paint_connected")
413 gom_attribute(help, "paint attributes on connected components")
414 gom_attribute(message, "btn1: paint; btn2: probe; btn3: erase")
435 void set_fill_same_value(
bool x) {
436 fill_same_value_ = x;
439 bool get_fill_same_value()
const {
440 return fill_same_value_;
451 double get_tolerance()
const {
457 bool test(
double reference,
double value)
const {
458 return !fill_same_value_ ||
459 ::fabs(reference - value) <= tolerance_;
463 bool fill_same_value_;
472 gom_attribute(category,
"paint")
473 gom_attribute(icon, "pipette")
474 gom_attribute(help, "probe attributes")
475 gom_attribute(message, "btn1: probe attributes")
505 set_probed_as_paint_ = x;
515 display_probed_on_release_ = x;
519 void probe(
const RayPick& p_ndc);
526 std::string message_;
527 bool set_probed_as_paint_;
528 bool display_probed_on_release_;
536 gom_attribute(category,
"paint")
537 gom_attribute(icon, "ruler")
538 gom_attribute(help, "measures distances on a mesh")
565 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
void set_probed_as_paint(bool x)
Sets the interaction mode between probe tool and paint tool.
MeshGrobProbe(ToolsManager *parent)
MeshGrobPaint constructor.
void release(const RayPick &p_ndc) override
The event handler for mouse release events.
void set_display_probed_on_release(bool x)
Sets the behavior when mouse button is release.
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.