Blender V4.3
blender::bke::GreasePencilComponent Class Reference

#include <BKE_geometry_set.hh>

Inherits blender::bke::GeometryComponent.

Public Member Functions

std::optional< AttributeAccessorattributes () const final
 
std::optional< MutableAttributeAccessorattributes_for_write () final
 
Geometry Component Implementation
 GreasePencilComponent ()
 
 ~GreasePencilComponent ()
 
GeometryComponentPtr copy () const override
 
void clear () override
 
bool has_grease_pencil () const
 
void replace (GreasePencil *grease_pencil, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
 
GreasePencilrelease ()
 
const GreasePencilget () const
 
GreasePencilget_for_write ()
 
bool is_empty () const final
 
bool owns_direct_data () const override
 
void ensure_owns_direct_data () override
 
- Public Member Functions inherited from blender::bke::GeometryComponent
virtual ~GeometryComponent ()=default
 
 GeometryComponent (Type type)
 
int attribute_domain_size (AttrDomain domain) const
 
virtual void count_memory (MemoryCounter &memory) const
 
Type type () const
 
- Public Member Functions inherited from blender::ImplicitSharingInfo
virtual ~ImplicitSharingInfo ()
 
bool is_mutable () const
 
bool is_expired () const
 
void add_user () const
 
void add_weak_user () const
 
void tag_ensured_mutable () const
 
int64_t version () const
 
int strong_users () const
 
void remove_user_and_delete_if_last () const
 
void remove_weak_user_and_delete_if_last () const
 

Static Public Attributes

static constexpr GeometryComponent::Type static_type = Type::GreasePencil
 

Additional Inherited Members

- Public Types inherited from blender::bke::GeometryComponent
enum class  Type {
  Mesh = 0 , PointCloud = 1 , Instance = 2 , Volume = 3 ,
  Curve = 4 , Edit = 5 , GreasePencil = 6
}
 
- Static Public Member Functions inherited from blender::bke::GeometryComponent
static GeometryComponentPtr create (Type component_type)
 

Detailed Description

A geometry component that stores GreasePencil data. The attributes on this component are only on the layer domain. Each individual layer represents a CurvesGeometry with its own curve and point domain. See #CurveComponent.

Definition at line 770 of file BKE_geometry_set.hh.

Constructor & Destructor Documentation

◆ GreasePencilComponent()

blender::bke::GreasePencilComponent::GreasePencilComponent ( )

Definition at line 19 of file geometry_component_grease_pencil.cc.

Referenced by copy().

◆ ~GreasePencilComponent()

blender::bke::GreasePencilComponent::~GreasePencilComponent ( )

Definition at line 21 of file geometry_component_grease_pencil.cc.

References clear().

Member Function Documentation

◆ attributes()

std::optional< AttributeAccessor > blender::bke::GreasePencilComponent::attributes ( ) const
finalvirtual

Get access to the attributes in this geometry component. May return none if the geometry does not support the attribute system.

Reimplemented from blender::bke::GeometryComponent.

Definition at line 192 of file geometry_component_grease_pencil.cc.

References blender::bke::get_grease_pencil_accessor_functions_ref().

◆ attributes_for_write()

std::optional< MutableAttributeAccessor > blender::bke::GreasePencilComponent::attributes_for_write ( )
finalvirtual

◆ clear()

void blender::bke::GreasePencilComponent::clear ( )
overridevirtual

◆ copy()

GeometryComponentPtr blender::bke::GreasePencilComponent::copy ( ) const
overridevirtual

Copies the component. The returned component only has a single user and is therefor mutable.

Implements blender::bke::GeometryComponent.

Definition at line 26 of file geometry_component_grease_pencil.cc.

References BKE_grease_pencil_copy_for_eval(), GreasePencilComponent(), and blender::bke::Owned.

◆ ensure_owns_direct_data()

void blender::bke::GreasePencilComponent::ensure_owns_direct_data ( )
overridevirtual

◆ get()

◆ get_for_write()

◆ has_grease_pencil()

bool blender::bke::GreasePencilComponent::has_grease_pencil ( ) const

◆ is_empty()

bool blender::bke::GreasePencilComponent::is_empty ( ) const
finalvirtual

Reimplemented from blender::bke::GeometryComponent.

Definition at line 83 of file geometry_component_grease_pencil.cc.

◆ owns_direct_data()

bool blender::bke::GreasePencilComponent::owns_direct_data ( ) const
overridevirtual

◆ release()

GreasePencil * blender::bke::GreasePencilComponent::release ( )

Return the Grease Pencil data and clear the component. The caller takes over responsibility for freeing the Grease Pencil data (if the component was responsible before).

Definition at line 60 of file geometry_component_grease_pencil.cc.

References BLI_assert, and blender::ImplicitSharingInfo::is_mutable().

◆ replace()

void blender::bke::GreasePencilComponent::replace ( GreasePencil * grease_pencil,
GeometryOwnershipType ownership = GeometryOwnershipType::Owned )

Clear the component and replace it with the new grease_pencil data.

Definition at line 52 of file geometry_component_grease_pencil.cc.

References BLI_assert, clear(), and blender::ImplicitSharingInfo::is_mutable().

Referenced by blender::bke::GeometrySet::replace_grease_pencil().

Member Data Documentation

◆ static_type

GeometryComponent::Type blender::bke::GreasePencilComponent::static_type = Type::GreasePencil
inlinestaticconstexpr

Definition at line 801 of file BKE_geometry_set.hh.


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