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>
115 void set_value(
double value);
117 double get_value()
const {
126 double get_value2()
const {
136 bool get_accumulate()
const {
146 bool get_autorange()
const {
157 bool get_pick_vertices_only()
const {
158 return pick_vertices_only_;
168 bool get_xray_mode()
const {
189 void set_value_for_this_tool(
double value) {
193 void set_value2_for_this_tool(
double value) {
197 void set_accumulate_for_this_tool(
bool value) {
201 void set_autorange_for_this_tool(
bool value) {
205 void set_pick_vertices_for_this_tool(
bool value) {
206 pick_vertices_only_ = value;
209 void set_xray_mode_for_this_tool(
bool value) {
225 bool get_painting_parameters(
228 MeshElementsFlags& where,
229 std::string& attribute_name,
233 void paint(
const RayPick& p_ndc);
240 bool pick_vertices_only_;
253 gom_attribute(category,
"paint")
254 gom_attribute(icon, "paint_rect")
255 gom_attribute(help, "paint attributes in rectangle")
256 gom_attribute(message, "btn1: paint; btn2: probe; btn3: erase")
297 Image* mask =
nullptr
307 gom_attribute(category,
"paint")
308 gom_attribute(icon, "paint")
309 gom_attribute(help, "paint attributes")
310 gom_attribute(message, "btn1: paint; btn2: probe; btn3: erase")
337 void set_width(
index_t value) {
345 void set_stroke_mode(
bool value) {
346 stroke_mode_ = value;
349 bool get_stroke_mode()
const {
375 gom_attribute(category,
"paint")
376 gom_attribute(icon, "paint_freeform")
377 gom_attribute(help, "paint attributes with free-form selection")
378 gom_attribute(message, "btn1: paint; btn2: probe; btn3: erase")
413 gom_attribute(category,
"paint")
414 gom_attribute(icon, "paint_connected")
415 gom_attribute(help, "paint attributes on connected components")
416 gom_attribute(message, "btn1: paint; btn2: probe; btn3: erase")
437 void set_fill_same_value(
bool x) {
438 fill_same_value_ = x;
441 bool get_fill_same_value()
const {
442 return fill_same_value_;
453 double get_tolerance()
const {
459 bool test(
double reference,
double value)
const {
460 return !fill_same_value_ ||
461 ::fabs(reference - value) <= tolerance_;
465 bool fill_same_value_;
474 gom_attribute(category,
"paint")
475 gom_attribute(icon, "pipette")
476 gom_attribute(help, "probe attributes")
477 gom_attribute(message, "btn1: probe attributes")
507 set_probed_as_paint_ = x;
517 display_probed_on_release_ = x;
521 void probe(
const RayPick& p_ndc);
528 std::string message_;
529 bool set_probed_as_paint_;
530 bool display_probed_on_release_;
538 gom_attribute(category,
"paint")
539 gom_attribute(icon, "ruler")
540 gom_attribute(help, "measures distances on a mesh")
567 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.
A Grob wrapper around Geogram's Mesh class.
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.