Blender  V2.93
Public Member Functions | List of all members
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 floatgetColor () const
 
const float getColorR () const
 
const float getColorG () const
 
const float getColorB () const
 
Vec3f getColorRGB () const
 
float getAlpha () const
 
const floatgetThickness () 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 58 of file Stroke.h.

Constructor & Destructor Documentation

◆ StrokeAttribute() [1/4]

Freestyle::StrokeAttribute::StrokeAttribute ( )

default constructor

Definition at line 40 of file Stroke.cpp.

◆ StrokeAttribute() [2/4]

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

Copy constructor

Definition at line 56 of file Stroke.cpp.

◆ 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 85 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 108 of file Stroke.cpp.

References isVisible(), and t.

◆ ~StrokeAttribute()

Freestyle::StrokeAttribute::~StrokeAttribute ( )
virtual

destructor

Definition at line 164 of file Stroke.cpp.

Member Function Documentation

◆ getAlpha()

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

Returns the alpha color component.

Definition at line 139 of file Stroke.h.

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

◆ getAttributeReal()

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

Returns an attribute of type real

Parameters
iNameThe name of the attribute

Definition at line 220 of file Stroke.cpp.

References Freestyle::a, G, and G_DEBUG_FREESTYLE.

◆ getAttributeVec2f()

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

Returns an attribute of type Vec2f

Parameters
iNameThe name of the attribute

Definition at line 239 of file Stroke.cpp.

References Freestyle::a, G, and G_DEBUG_FREESTYLE.

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

◆ getAttributeVec3f()

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

Returns an attribute of type Vec3f

Parameters
iNameThe name of the attribute

Definition at line 258 of file Stroke.cpp.

References Freestyle::a, G, and G_DEBUG_FREESTYLE.

◆ 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 109 of file Stroke.h.

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

◆ getColorB()

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

Returns the B color component.

Definition at line 127 of file Stroke.h.

Referenced by Freestyle::operator<<(), and Freestyle::TextStrokeRenderer::RenderStrokeRepBasic().

◆ getColorG()

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

Returns the G color component.

Definition at line 121 of file Stroke.h.

Referenced by Freestyle::operator<<(), and Freestyle::TextStrokeRenderer::RenderStrokeRepBasic().

◆ getColorR()

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

Returns the R color component.

Definition at line 115 of file Stroke.h.

Referenced by Freestyle::operator<<(), and Freestyle::TextStrokeRenderer::RenderStrokeRepBasic().

◆ getColorRGB()

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

Returns the RGB color components.

Definition at line 133 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 148 of file Stroke.h.

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

◆ getThicknessL()

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

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

Definition at line 160 of file Stroke.h.

Referenced by Freestyle::operator<<(), Freestyle::TextStrokeRenderer::RenderStrokeRepBasic(), and Freestyle::Stroke::ScaleThickness().

◆ getThicknessR()

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

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

Definition at line 154 of file Stroke.h.

Referenced by Freestyle::operator<<(), Freestyle::TextStrokeRenderer::RenderStrokeRepBasic(), and Freestyle::Stroke::ScaleThickness().

◆ 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 167 of file Stroke.h.

◆ isAttributeAvailableReal()

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

Checks whether the attribute iName is available

Definition at line 277 of file Stroke.cpp.

References Freestyle::a.

◆ isAttributeAvailableVec2f()

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

Checks whether the attribute iName is available

Definition at line 289 of file Stroke.cpp.

References Freestyle::a.

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

◆ isAttributeAvailableVec3f()

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

Checks whether the attribute iName is available

Definition at line 301 of file Stroke.cpp.

References Freestyle::a.

◆ isVisible()

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

Returns true if the strokevertex is visible, false otherwise

Definition at line 173 of file Stroke.h.

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

◆ operator=()

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

operator =

Definition at line 180 of file Stroke.cpp.

◆ setAlpha()

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

sets the attribute's alpha value.

Parameters
alphaThe new alpha value.

Definition at line 236 of file Stroke.h.

References alpha.

Referenced by Freestyle::StrokeShaders::MaterialColorShader::shade().

◆ 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 313 of file Stroke.cpp.

◆ 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 321 of file Stroke.cpp.

◆ 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 329 of file Stroke.cpp.

◆ setColor() [1/2]

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

sets the attribute's color.

Parameters
iRGBThe new RGB values.

Definition at line 225 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 214 of file Stroke.h.

References r.

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

◆ 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 257 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 247 of file Stroke.h.

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

◆ setVisible()

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

sets the visible flag. True means visible.

Definition at line 264 of file Stroke.h.


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