Blender V5.3
blender::ed::greasepencil::segment::Segment Class Reference

#include <grease_pencil_segments_intern.hh>

Public Member Functions

constexpr Segment ()=default
bool is_loop () const
bool has_intersection (Side side) const
int2 edge (Side side) const
int wrap_index (int i) const
IndexRange point_range () const
int points_num () const
template<typename Fn>
void foreach_point (Fn &&fn) const

Static Public Member Functions

static Segment from_curve (int curve_i, IndexRange points, bool cyclic)
static Segment from_intersections (int curve_i, IndexRange points, const std::optional< int > point_start, const std::optional< int > point_end, const std::optional< float > factor_start, const std::optional< float > factor_end, const std::optional< int > inter_index_start, const std::optional< int > inter_index_end)

Public Attributes

int curve = -1
IndexRange src_points
int points [2] = {-1, -1}
bool full_wrap_loop = false
float intersection_factor [2] = {0.0f, 0.0f}
int intersection_index [2] = {-1, -1}

Detailed Description

Structure describing a curve segment (a point range in a curve) with end intersection points. A Segment can go past the end of the source curve and loop back to the start.

Definition at line 25 of file grease_pencil_segments_intern.hh.

Constructor & Destructor Documentation

◆ Segment()

blender::ed::greasepencil::segment::Segment::Segment ( )
constexprdefault

Member Function Documentation

◆ edge()

int2 blender::ed::greasepencil::segment::Segment::edge ( Side side) const

Definition at line 44 of file grease_pencil_segments_geom.cc.

References points, and wrap_index().

Referenced by Segment().

◆ foreach_point()

template<typename Fn>
void blender::ed::greasepencil::segment::Segment::foreach_point ( Fn && fn) const

Definition at line 76 of file grease_pencil_segments_intern.hh.

References blender::IndexRange::index_range(), point_range(), and wrap_index().

Referenced by Segment().

◆ from_curve()

◆ from_intersections()

Segment blender::ed::greasepencil::segment::Segment::from_intersections ( int curve_i,
IndexRange points,
const std::optional< int > point_start,
const std::optional< int > point_end,
const std::optional< float > factor_start,
const std::optional< float > factor_end,
const std::optional< int > inter_index_start,
const std::optional< int > inter_index_end )
static

◆ has_intersection()

bool blender::ed::greasepencil::segment::Segment::has_intersection ( Side side) const

Definition at line 39 of file grease_pencil_segments_geom.cc.

References intersection_index.

Referenced by point_range(), and Segment().

◆ is_loop()

bool blender::ed::greasepencil::segment::Segment::is_loop ( ) const

Definition at line 34 of file grease_pencil_segments_geom.cc.

References full_wrap_loop.

Referenced by point_range(), and Segment().

◆ point_range()

◆ points_num()

int blender::ed::greasepencil::segment::Segment::points_num ( ) const

Definition at line 95 of file grease_pencil_segments_geom.cc.

References point_range(), and blender::IndexRange::size().

Referenced by Segment().

◆ wrap_index()

int blender::ed::greasepencil::segment::Segment::wrap_index ( int i) const

Member Data Documentation

◆ curve

int blender::ed::greasepencil::segment::Segment::curve = -1

◆ full_wrap_loop

bool blender::ed::greasepencil::segment::Segment::full_wrap_loop = false

Definition at line 40 of file grease_pencil_segments_intern.hh.

Referenced by is_loop().

◆ intersection_factor

float blender::ed::greasepencil::segment::Segment::intersection_factor[2] = {0.0f, 0.0f}

◆ intersection_index

int blender::ed::greasepencil::segment::Segment::intersection_index[2] = {-1, -1}

◆ points

int blender::ed::greasepencil::segment::Segment::points[2] = {-1, -1}

◆ src_points

IndexRange blender::ed::greasepencil::segment::Segment::src_points

Definition at line 32 of file grease_pencil_segments_intern.hh.

Referenced by point_range(), and wrap_index().


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