Blender V4.5
Freestyle::StrokeAttribute Class Reference

#include <Stroke.h>

Public Member Functions

 StrokeAttribute ()
 StrokeAttribute (const StrokeAttribute &iBrother)
 StrokeAttribute (float iRColor, float iGColor, float iBColor, float iAlpha, float iRThickness, float iLThickness)
 StrokeAttribute (const StrokeAttribute &a1, const StrokeAttribute &a2, float t)
virtual ~StrokeAttribute ()
StrokeAttributeoperator= (const StrokeAttribute &iBrother)
const float * getColor () const
const float getColorR () const
const float getColorG () const
const float getColorB () const
Vec3f getColorRGB () const
float getAlpha () const
const float * getThickness () const
const float getThicknessR () const
const float getThicknessL () const
Vec2f getThicknessRL () const
bool isVisible () const
float getAttributeReal (const char *iName) const
Vec2f getAttributeVec2f (const char *iName) const
Vec3f getAttributeVec3f (const char *iName) const
bool isAttributeAvailableReal (const char *iName) const
bool isAttributeAvailableVec2f (const char *iName) const
bool isAttributeAvailableVec3f (const char *iName) const
void setColor (float r, float g, float b)
void setColor (const Vec3f &iRGB)
void setAlpha (float alpha)
void setThickness (float tr, float tl)
void setThickness (const Vec2f &tRL)
void setVisible (bool iVisible)
void setAttributeReal (const char *iName, float att)
void setAttributeVec2f (const char *iName, const Vec2f &att)
void setAttributeVec3f (const char *iName, const Vec3f &att)

Detailed Description

Class to define an attribute associated to a Stroke Vertex. This attribute stores the color, alpha and thickness values for a Stroke Vertex.

Definition at line 44 of file Stroke.h.

Constructor & Destructor Documentation

◆ StrokeAttribute() [1/4]

Freestyle::StrokeAttribute::StrokeAttribute ( )

default constructor

Definition at line 28 of file Stroke.cpp.

References i.

Referenced by operator=(), StrokeAttribute(), StrokeAttribute(), StrokeAttribute_init(), and Freestyle::StrokeVertex::StrokeVertex().

◆ StrokeAttribute() [2/4]

Freestyle::StrokeAttribute::StrokeAttribute ( const StrokeAttribute & iBrother)

Copy constructor

Definition at line 44 of file Stroke.cpp.

References i, and StrokeAttribute().

◆ StrokeAttribute() [3/4]

Freestyle::StrokeAttribute::StrokeAttribute ( float iRColor,
float iGColor,
float iBColor,
float iAlpha,
float iRThickness,
float iLThickness )

Builds a stroke vertex attribute from a set of parameters.

Parameters
iRColorThe Red Component value.
iGColorThe Green Component value.
iBColorThe Blue Component value.
iAlphaThe transparency value
iRThicknessThe thickness of the stroke on the right
iLThicknessThe Thickness of the stroke on the left

Definition at line 73 of file Stroke.cpp.

◆ StrokeAttribute() [4/4]

Freestyle::StrokeAttribute::StrokeAttribute ( const StrokeAttribute & a1,
const StrokeAttribute & a2,
float t )

Interpolation constructor. Builds a StrokeAttribute from two StrokeAttributes and an interpolation parameter.

Parameters
a1The first Attribute.
a2The second parameter.
tThe interpolation parameter.

Definition at line 96 of file Stroke.cpp.

References i, isVisible(), and StrokeAttribute().

◆ ~StrokeAttribute()

Freestyle::StrokeAttribute::~StrokeAttribute ( )
virtual

destructor

Definition at line 152 of file Stroke.cpp.

Member Function Documentation

◆ getAlpha()

float Freestyle::StrokeAttribute::getAlpha ( ) const
inline

◆ getAttributeReal()

float Freestyle::StrokeAttribute::getAttributeReal ( const char * iName) const

Returns an attribute of type real

Parameters
iNameThe name of the attribute

Definition at line 208 of file Stroke.cpp.

References G, and G_DEBUG_FREESTYLE.

Referenced by StrokeAttribute_get_attribute_real().

◆ getAttributeVec2f()

Vec2f Freestyle::StrokeAttribute::getAttributeVec2f ( const char * iName) const

Returns an attribute of type Vec2f

Parameters
iNameThe name of the attribute

Definition at line 227 of file Stroke.cpp.

References G, and G_DEBUG_FREESTYLE.

Referenced by Freestyle::Strip::createStrip(), and StrokeAttribute_get_attribute_vec2().

◆ getAttributeVec3f()

Vec3f Freestyle::StrokeAttribute::getAttributeVec3f ( const char * iName) const

Returns an attribute of type Vec3f

Parameters
iNameThe name of the attribute

Definition at line 246 of file Stroke.cpp.

References G, and G_DEBUG_FREESTYLE.

Referenced by StrokeAttribute_get_attribute_vec3().

◆ getColor()

const float * Freestyle::StrokeAttribute::getColor ( ) const
inline

Returns the attribute's color.

Returns
The array of 3 floats containing the R,G,B values of the attribute's color.

Definition at line 95 of file Stroke.h.

Referenced by Freestyle::Strip::setVertexColor().

◆ getColorB()

const float Freestyle::StrokeAttribute::getColorB ( ) const
inline

◆ getColorG()

const float Freestyle::StrokeAttribute::getColorG ( ) const
inline

◆ getColorR()

const float Freestyle::StrokeAttribute::getColorR ( ) const
inline

◆ getColorRGB()

Vec3f Freestyle::StrokeAttribute::getColorRGB ( ) const
inline

Returns the RGB color components.

Definition at line 119 of file Stroke.h.

Referenced by Freestyle::Strip::computeTexCoordWithTips(), and Freestyle::Strip::setVertexColor().

◆ getThickness()

const float * Freestyle::StrokeAttribute::getThickness ( ) const
inline

Returns the attribute's thickness.

Returns
an array of 2 floats. the first value is the thickness on the right of the vertex when following the stroke, the second one is the thickness on the left.

Definition at line 134 of file Stroke.h.

Referenced by Freestyle::Strip::createStrip().

◆ getThicknessL()

const float Freestyle::StrokeAttribute::getThicknessL ( ) const
inline

◆ getThicknessR()

const float Freestyle::StrokeAttribute::getThicknessR ( ) const
inline

◆ getThicknessRL()

Vec2f Freestyle::StrokeAttribute::getThicknessRL ( ) const
inline

Returns the thickness on the right and on the left of the vertex when following the stroke.

Definition at line 153 of file Stroke.h.

◆ isAttributeAvailableReal()

bool Freestyle::StrokeAttribute::isAttributeAvailableReal ( const char * iName) const

Checks whether the attribute iName is available

Definition at line 265 of file Stroke.cpp.

Referenced by StrokeAttribute_has_attribute_real().

◆ isAttributeAvailableVec2f()

bool Freestyle::StrokeAttribute::isAttributeAvailableVec2f ( const char * iName) const

Checks whether the attribute iName is available

Definition at line 277 of file Stroke.cpp.

Referenced by Freestyle::Strip::createStrip(), and StrokeAttribute_has_attribute_vec2().

◆ isAttributeAvailableVec3f()

bool Freestyle::StrokeAttribute::isAttributeAvailableVec3f ( const char * iName) const

Checks whether the attribute iName is available

Definition at line 289 of file Stroke.cpp.

Referenced by StrokeAttribute_has_attribute_vec3().

◆ isVisible()

bool Freestyle::StrokeAttribute::isVisible ( ) const
inline

Returns true if the strokevertex is visible, false otherwise

Definition at line 159 of file Stroke.h.

Referenced by Freestyle::operator<<(), StrokeAttribute(), and StrokeAttribute_visible_get().

◆ operator=()

StrokeAttribute & Freestyle::StrokeAttribute::operator= ( const StrokeAttribute & iBrother)

operator =

Definition at line 168 of file Stroke.cpp.

References i, and StrokeAttribute().

◆ setAlpha()

void Freestyle::StrokeAttribute::setAlpha ( float alpha)
inline

sets the attribute's alpha value.

Parameters
alphaThe new alpha value.

Definition at line 222 of file Stroke.h.

Referenced by Freestyle::StrokeShaders::MaterialColorShader::shade(), and StrokeAttribute_alpha_set().

◆ setAttributeReal()

void Freestyle::StrokeAttribute::setAttributeReal ( const char * iName,
float att )

Adds a user defined attribute of type real If there is no attribute of name iName, it is added. Otherwise, the new value replaces the old one.

Parameters
iNameThe name of the attribute
attThe attribute's value

Definition at line 301 of file Stroke.cpp.

Referenced by StrokeAttribute_set_attribute_real().

◆ setAttributeVec2f()

void Freestyle::StrokeAttribute::setAttributeVec2f ( const char * iName,
const Vec2f & att )

Adds a user defined attribute of type Vec2f If there is no attribute of name iName, it is added. Otherwise, the new value replaces the old one.

Parameters
iNameThe name of the attribute
attThe attribute's value

Definition at line 309 of file Stroke.cpp.

Referenced by StrokeAttribute_set_attribute_vec2().

◆ setAttributeVec3f()

void Freestyle::StrokeAttribute::setAttributeVec3f ( const char * iName,
const Vec3f & att )

Adds a user defined attribute of type Vec3f If there is no attribute of name iName, it is added. Otherwise, the new value replaces the old one.

Parameters
iNameThe name of the attribute
attThe attribute's value

Definition at line 317 of file Stroke.cpp.

Referenced by StrokeAttribute_set_attribute_vec3().

◆ setColor() [1/2]

void Freestyle::StrokeAttribute::setColor ( const Vec3f & iRGB)
inline

sets the attribute's color.

Parameters
iRGBThe new RGB values.

Definition at line 211 of file Stroke.h.

◆ setColor() [2/2]

void Freestyle::StrokeAttribute::setColor ( float r,
float g,
float b )
inline

sets the attribute's color.

Parameters
rThe new R value.
gThe new G value.
bThe new B value.

Definition at line 200 of file Stroke.h.

References b.

Referenced by Freestyle::CalligraphicShader::shade(), Freestyle::StrokeShaders::MaterialColorShader::shade(), StrokeAttribute_color_set(), StrokeAttribute_mathutils_set(), and StrokeAttribute_mathutils_set_index().

◆ setThickness() [1/2]

void Freestyle::StrokeAttribute::setThickness ( const Vec2f & tRL)
inline

sets the attribute's thickness.

Parameters
tRLThe thickness on the right and on the left of the vertex when following the stroke.

Definition at line 243 of file Stroke.h.

◆ setThickness() [2/2]

void Freestyle::StrokeAttribute::setThickness ( float tr,
float tl )
inline

sets the attribute's thickness.

Parameters
trThe thickness on the right of the vertex when following the stroke.
tlThe thickness on the left of the vertex when following the stroke.

Definition at line 233 of file Stroke.h.

Referenced by Freestyle::Stroke::ScaleThickness(), Freestyle::CalligraphicShader::shade(), StrokeAttribute_mathutils_set(), StrokeAttribute_mathutils_set_index(), and StrokeAttribute_thickness_set().

◆ setVisible()

void Freestyle::StrokeAttribute::setVisible ( bool iVisible)
inline

sets the visible flag. True means visible.

Definition at line 250 of file Stroke.h.

Referenced by StrokeAttribute_visible_set().


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