Blender V5.3
blender::ed::sculpt_paint::GreasePencilPaintStroke Struct Referencefinal

Inherits blender::ed::sculpt_paint::PaintStroke.

Public Member Functions

 GreasePencilPaintStroke (bContext *C, wmOperator *op, const wmEvent *event, PaintMode mode)
Common Paint Operator Functions
std::optional< float3 > get_location (float2 mouse, bool force_original) override
bool test_start (wmOperator *op, float2 mouse) override
void update_step (wmOperator *op, const StrokeStep &stroke_step) override
void redraw (bool final) override
bool test_cancel () override
void done (bool is_cancel, bool stroke_started) override
Public Member Functions inherited from blender::ed::sculpt_paint::PaintStroke
 PaintStroke ()=delete
virtual ~PaintStroke ()=default
wmOperatorStatus modal (bContext *C, wmOperator *op, const wmEvent *event)
wmOperatorStatus exec (bContext *C, wmOperator *op)
void cancel (bContext *C)
void finish (bContext *C)
bool stroke_flipped () const
bool stroke_inverted () const
float stroke_distance () const
Public Member Functions inherited from blender::blender::NonCopyable
 NonCopyable (const NonCopyable &other)=delete
NonCopyable & operator= (const NonCopyable &other)=delete
 NonCopyable ()=default
 NonCopyable (NonCopyable &&other)=default
NonCopyable & operator= (NonCopyable &&other)=default
Public Member Functions inherited from blender::blender::NonMovable
 NonMovable (NonMovable &&other)=delete
NonMovable & operator= (NonMovable &&other)=delete
 NonMovable ()=default
 NonMovable (const NonMovable &other)=default
NonMovable & operator= (const NonMovable &other)=default

Additional Inherited Members

Public Attributes inherited from blender::ed::sculpt_paint::PaintStroke
bContext * evil_C = nullptr
ViewContext vc = {}
Depsgraph * depsgraph = nullptr
Object * object = nullptr
Scene * scene = nullptr
Paint * paint = nullptr
PaintMode paint_mode = PaintMode::Invalid
Brush * brush = nullptr
UnifiedPaintSettings * ups = nullptr
float2 last_mouse_position = float2(0.0f, 0.0f)
bool constrain_line = false
float2 constrained_pos = float2(0.0f, 0.0f)
Protected Member Functions inherited from blender::ed::sculpt_paint::PaintStroke
 PaintStroke (bContext *C, wmOperator *op, const wmEvent *event, PaintMode mode)
Protected Attributes inherited from blender::ed::sculpt_paint::PaintStroke
std::unique_ptr< PaintModeData > mode_data_ = nullptr

Detailed Description

Definition at line 84 of file draw_ops.cc.

Constructor & Destructor Documentation

◆ GreasePencilPaintStroke()

blender::ed::sculpt_paint::GreasePencilPaintStroke::GreasePencilPaintStroke ( bContext * C,
wmOperator * op,
const wmEvent * event,
PaintMode mode )
inline

Definition at line 85 of file draw_ops.cc.

References C, and blender::ed::sculpt_paint::PaintStroke::PaintStroke().

Member Function Documentation

◆ done()

void blender::ed::sculpt_paint::GreasePencilPaintStroke::done ( bool is_cancel,
bool stroke_started )
overridevirtual

Callback function for cleaning up and finalizing data after a stroke has finished.

Parameters
is_cancelSome paint modes support cancelling a stroke and returning to the initial state. This parameter indicates this case so that appropriate cleanup actions can be taken.
stroke_startedWhether the stroke started. Subclasses can use this to determine if undo steps should be created. See \test_start.

Implements blender::ed::sculpt_paint::PaintStroke.

Definition at line 229 of file draw_ops.cc.

References blender::ed::sculpt_paint::PaintStroke::evil_C, blender::ed::sculpt_paint::PaintStroke::mode_data_, and blender::ed::sculpt_paint::GreasePencilStrokeOperation::on_stroke_done().

◆ get_location()

std::optional< float3 > blender::ed::sculpt_paint::GreasePencilPaintStroke::get_location ( float2 mouse,
bool force_original )
overridevirtual

Callback function to retrieve the object space coordinates based on screen space coordinates.

Returns
whether a value was actually found & the value in location is usable

Implements blender::ed::sculpt_paint::PaintStroke.

Definition at line 98 of file draw_ops.cc.

◆ redraw()

void blender::ed::sculpt_paint::GreasePencilPaintStroke::redraw ( bool final)
overridevirtual

Callback function for performing necessary redraw functions based on the stroke.

Implements blender::ed::sculpt_paint::PaintStroke.

Definition at line 219 of file draw_ops.cc.

References blender::CTX_wm_region(), blender::ED_region_tag_redraw(), and blender::ed::sculpt_paint::PaintStroke::evil_C.

◆ test_cancel()

bool blender::ed::sculpt_paint::GreasePencilPaintStroke::test_cancel ( )
overridevirtual

Callback function for dynamically determining if a stroke can be cancelled.

Implements blender::ed::sculpt_paint::PaintStroke.

Definition at line 224 of file draw_ops.cc.

◆ test_start()

bool blender::ed::sculpt_paint::GreasePencilPaintStroke::test_start ( wmOperator * op,
float2 mouse )
overridevirtual

Callback function to determine whether a stroke has started, and performing initialization.

In many cases, this is a check to whether the stroke is over the active mesh.

Implements blender::ed::sculpt_paint::PaintStroke.

Definition at line 193 of file draw_ops.cc.

◆ update_step()


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