Rumba C++ SDK
maquina::BrushSculptPlugin Class Reference

Base class for the sculpt brush plug-ins. More...

#include <BrushSculptPlugin.h>

Inheritance diagram for maquina::BrushSculptPlugin:
maquina::BrushPlugin maquina::ToolPlugin maquina::NodePlugin

Classes

class  BrushSculptUserData
 The base sculpt brush data. More...
 

Public Member Functions

 BrushSculptPlugin (Node *node)
 
virtual std::shared_ptr< BrushSculptUserDatauser_data (const SparseBufferV3f &delta_points, const BrushPlugin::GeometryData &geometry, const BufferConstM33f &vertex_space, const std::shared_ptr< SceneConst > &reference)
 Create a BrushSculptUserData object for a geometry. More...
 
virtual SceneConst delta_points ()
 Get the current delta points from the deformer. More...
 
virtual void set_delta_points (const SceneConst &)
 Set delta points to the deformer. More...
 
virtual SceneConst vertex_space ()
 Return a scene with for every geometries, an array of vertex space rotation matrices. More...
 
virtual SceneConst reference ()
 Return the reference scene (as it with no modification, no animation) More...
 
virtual bool preserve_edges ()
 Return true if the sculpt weight on edge vertices must be 0 or false if nothing special must be done on edges. More...
 
void deactivate () override
 
void stroke_begin (int modifiers) override
 Called when the stroke is beginning. More...
 
void stroke_update (bool first, bool finished) override
 Called when the brush moves or have been released. More...
 
- Public Member Functions inherited from maquina::BrushPlugin
 BrushPlugin (Node *node)
 
BrushPlugin operator= (const BrushPlugin &)=delete
 
void activate () override
 From ToolPlugin. More...
 
void on_mouse_press (const CameraContext &camera, const InteractionContext &interaction) override
 
void on_mouse_move (const CameraContext &camera, const InteractionContext &interaction) override
 
void on_mouse_release (const CameraContext &camera, const InteractionContext &interaction) override
 
bool override_selection () override
 
bool track_mouse () override
 
bool manipulates () override
 
virtual void update_weights (bool first, const Imath::M44f &previous_brush_matrix)
 Update the brush weights. More...
 
virtual bool do_update_weights ()
 Does the weights have to be updated at every stroke_update() ? More...
 
virtual float weight (float)
 Convert a distance in weight. More...
 
virtual void update_brush_matrix (const CameraContext &camera, const InteractionContext &interaction, bool &visible, Imath::M44f &brush_matrix, bool on_press)
 Update the brush position and visibility. More...
 
virtual float radius ()
 Get the brush radius. More...
 
void set_radius (float radius)
 Set the brush radius. More...
 
virtual float flow ()
 Get the brush accumulation flow. More...
 
virtual bool multi_objects ()
 Get the multi objects state. More...
 
virtual bool fast_geodesic ()
 Get the geodesic state. More...
 
virtual SceneConst scene ()
 Get the displayed scene. More...
 
virtual BrushType brush_type ()
 Get the brush type. More...
 
gsl::span< GeometryDatageometry_data ()
 Return the brush's geometry data. More...
 
Imath::V3f hit_pos_world () const
 Return the brush position in world space. More...
 
const Imath::V3fhit_normal_world () const
 Return the brush normal in world space. More...
 
Imath::V3f hit_pos_world_orig () const
 Returns the world space brush position at the beginning of the stroke. More...
 
const Imath::V3fhit_normal_world_orig () const
 Return the brush normal in world space at the beginning of the stroke. More...
 
const Imath::M44fbrush_matrix () const
 Return the brush matrix which transforms from the brush local space to the world space. More...
 
const Imath::M44fbrush_matrix_orig () const
 Return the brush matrix which transforms from the brush local space to the world space at the beginning of the stroke. More...
 
bool is_brush_visible () const
 Returns true is the brush is visible. More...
 
bool is_pressed () const
 Returns true is the brush is pressed by the user. More...
 
- Public Member Functions inherited from maquina::ToolPlugin
 ToolPlugin (Node *node)
 
virtual bool on_key_press (int32_t key, int32_t modifiers)
 Called when a key is pressed while the tool is active. More...
 
virtual bool on_key_release (int32_t key, int32_t modifiers)
 Called when a key is released while the tool is active. More...
 
virtual Array get_help (const char *tool)
 
virtual Array get_status (const char *tool)
 
- Public Member Functions inherited from maquina::NodePlugin
 NodePlugin (Node *node)
 
virtual ~NodePlugin ()
 
virtual void on_first_init (bool)
 Perform the one shot initialization tasks for this node. More...
 
virtual void on_delete (bool)
 Prepare the node to be deleted. More...
 
virtual void on_add_to_document ()
 Callback called when the node is added to the document. More...
 
virtual void on_remove_from_document ()
 Callback called when the node is removed from the document. More...
 
virtual void on_input_connection (const Plug &, const Plug &, bool)
 Callback called when an a connection has been done between an output plug and a plug of this node as input. More...
 
virtual void on_output_connection (const Plug &, const Plug &, bool)
 Callback called when an a connection has been done between a plug of this node as output and an input plug. More...
 
virtual void on_input_disconnection (const Plug &, const Plug &)
 Callback called when an a connection has been broken between an output plug and a plug of this node as input. More...
 
virtual void on_output_disconnection (const Plug &, const Plug &)
 Callback called when an a connection has been broken between a plug of this node as output and an input plug. More...
 
virtual void relationship (NodeSet &set) const
 Return the node relationships. More...
 
virtual std::shared_ptr< NodeDelegatenode_delegate () const
 Return a node delegate for this node. More...
 
Node node () const
 Returns the Node interface for this object. More...
 
virtual std::string selection_path () const
 Returns the node delegate path to use to select that node. More...
 

Additional Inherited Members

- Public Types inherited from maquina::BrushPlugin
enum  BrushType { BrushType::surface = 0, BrushType::geodesic, BrushType::volume }
 The different brush types. More...
 

Detailed Description

Base class for the sculpt brush plug-ins.

The sculpt brush modifies the sparse vertex delta stored in the Sculpt node's "delta_points" plug. At the beginning of the stroke, a BrushSculptUserData derived object must be created and returned by the sculpt_geometry_user_data() method. This object will contain the data and the sculpt callback to update the delta of the vertices in reference space. The reference space is the mesh in its initial position (ref pose).

Constructor & Destructor Documentation

◆ BrushSculptPlugin()

maquina::BrushSculptPlugin::BrushSculptPlugin ( Node node)

Member Function Documentation

◆ deactivate()

void maquina::BrushSculptPlugin::deactivate ( )
overridevirtual

Reimplemented from maquina::BrushPlugin.

◆ delta_points()

virtual SceneConst maquina::BrushSculptPlugin::delta_points ( )
inlinevirtual

Get the current delta points from the deformer.

◆ preserve_edges()

virtual bool maquina::BrushSculptPlugin::preserve_edges ( )
inlinevirtual

Return true if the sculpt weight on edge vertices must be 0 or false if nothing special must be done on edges.

◆ reference()

virtual SceneConst maquina::BrushSculptPlugin::reference ( )
inlinevirtual

Return the reference scene (as it with no modification, no animation)

◆ set_delta_points()

virtual void maquina::BrushSculptPlugin::set_delta_points ( const SceneConst )
inlinevirtual

Set delta points to the deformer.

◆ stroke_begin()

void maquina::BrushSculptPlugin::stroke_begin ( int  modifiers)
overridevirtual

Called when the stroke is beginning.

Called by BrushPlugin::on_mouse_move. To be implemented by the plug-in.

Reimplemented from maquina::BrushPlugin.

◆ stroke_update()

void maquina::BrushSculptPlugin::stroke_update ( bool  first,
bool  finished 
)
overridevirtual

Called when the brush moves or have been released.

finished is true if the stroke is over.

Called by BrushPlugin::on_mouse_press and BrushPlugin::on_mouse_move. To be implemented by the plug-in.

Reimplemented from maquina::BrushPlugin.

◆ user_data()

virtual std::shared_ptr<BrushSculptUserData> maquina::BrushSculptPlugin::user_data ( const SparseBufferV3f delta_points,
const BrushPlugin::GeometryData geometry,
const BufferConstM33f vertex_space,
const std::shared_ptr< SceneConst > &  reference 
)
inlinevirtual

Create a BrushSculptUserData object for a geometry.

This method is implemented by the plug-in and is called by the BrushSculptPlugin object during the stroke_begin(). It must create and return a BrushSculptUserData derived object with all the needed data and the sculpting callback. It can return nullptr if no sculpting will be performed on this geometry.

◆ vertex_space()

virtual SceneConst maquina::BrushSculptPlugin::vertex_space ( )
inlinevirtual

Return a scene with for every geometries, an array of vertex space rotation matrices.


The documentation for this class was generated from the following file: