Blender  V3.3
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 44 of file Stroke.h.

Constructor & Destructor Documentation

◆ StrokeAttribute() [1/4]

Freestyle::StrokeAttribute::StrokeAttribute ( )

default constructor

Definition at line 26 of file Stroke.cpp.

◆ StrokeAttribute() [2/4]

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

Copy constructor

Definition at line 42 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 71 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 94 of file Stroke.cpp.

References isVisible(), and t.

◆ ~StrokeAttribute()

Freestyle::StrokeAttribute::~StrokeAttribute ( )
virtual

destructor

Definition at line 150 of file Stroke.cpp.

Member Function Documentation

◆ getAlpha()

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

Returns the alpha color component.

Definition at line 125 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 206 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 225 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 244 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 95 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 113 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 107 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 101 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 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

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

Definition at line 146 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 140 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 153 of file Stroke.h.

◆ isAttributeAvailableReal()

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

Checks whether the attribute iName is available

Definition at line 263 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 275 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 287 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 159 of file Stroke.h.

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

◆ operator=()

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

operator =

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

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 299 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 307 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 315 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 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 usdtokens::b(), usdtokens::g(), and 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 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(), and Freestyle::CalligraphicShader::shade().

◆ setVisible()

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

sets the visible flag. True means visible.

Definition at line 250 of file Stroke.h.


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