All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Luminous::Fill Class Reference

Defines the fill parameters for drawn objects. More...

#include <Luminous/Style.hpp>

Public Member Functions

void clear ()
 Clear the style to default values (black)
 
const Radiant::Colorcolor () const
 Get the fill color. More...
 
 Fill ()
 Create a default fill (black)
 
 Fill (Fill &&f)
 Move constructor. More...
 
 Fill (const Fill &f)
 Copy constructor. More...
 
bool hasTextures () const
 Does the style contain any textures. More...
 
bool hasTranslucentTextures () const
 Does the style contain translucent textures. More...
 
Filloperator= (Fill &&f)
 Move assignment operator. More...
 
Filloperator= (const Fill &f)
 Assignment operator. More...
 
const Luminous::Programprogram () const
 Shader program to be used for fill. More...
 
void removeShaderUniform (const QByteArray &name)
 Remove shader uniform. More...
 
void setColor (const Radiant::Color &c)
 Sets the color of the fill. More...
 
void setDefaultProgram ()
 Sets the fill program to default. More...
 
void setProgram (const Luminous::Program &program)
 Sets the shader program. More...
 
template<typename T >
void setShaderUniform (const QByteArray &name, const T &value)
 Add shader uniform. More...
 
void setTexture (const Luminous::Texture &texture)
 Sets default fill texture. More...
 
void setTexture (const QByteArray &name, const Texture &texture)
 Sets fill texture with name. More...
 
const Luminous::Texturetexture (const QByteArray &name)
 Returns the texture tied to given name. More...
 
const std::map< QByteArray,
const Texture * > * 
textures () const
 Returns the mapping from names to fill textures.
 
const std::map< QByteArray,
ShaderUniform > * 
uniforms () const
 Returns the mapping from names to shader uniforms.
 

Friends

class Style
 

Detailed Description

Defines the fill parameters for drawn objects.

See Also
Stroke

Constructor & Destructor Documentation

Luminous::Fill::Fill ( Fill &&  f)
inline

Move constructor.

Parameters
ffill to move
Luminous::Fill::Fill ( const Fill f)
inline

Copy constructor.

Parameters
ffill to copy

Member Function Documentation

const Radiant::Color& Luminous::Fill::color ( ) const
inline

Get the fill color.

Returns
fill color
bool Luminous::Fill::hasTextures ( ) const
inline

Does the style contain any textures.

Returns
true if the style has textures; otherwise false
bool Luminous::Fill::hasTranslucentTextures ( ) const
inline

Does the style contain translucent textures.

Translucent textures cause that any drawing operations using the style will not be re-ordered for performance.

Returns
true if the style has translucent textures; otherwise false
Fill& Luminous::Fill::operator= ( Fill &&  f)
inline

Move assignment operator.

Parameters
ffill to move
Returns
reference to this
Fill& Luminous::Fill::operator= ( const Fill f)
inline

Assignment operator.

Parameters
ffill to copy
Returns
reference to this
const Luminous::Program* Luminous::Fill::program ( ) const
inline

Shader program to be used for fill.

Returns
fill shader program
void Luminous::Fill::removeShaderUniform ( const QByteArray &  name)
inline

Remove shader uniform.

Parameters
nameName of the uniform to be removed
void Luminous::Fill::setColor ( const Radiant::Color c)
inline

Sets the color of the fill.

Parameters
cfill color
void Luminous::Fill::setDefaultProgram ( )
inline

Sets the fill program to default.

This function sets the fill shader to the default Cornerstone shader.

void Luminous::Fill::setProgram ( const Luminous::Program program)
inline

Sets the shader program.

Parameters
programProgram to use
template<typename T >
void Luminous::Fill::setShaderUniform ( const QByteArray &  name,
const T &  value 
)
inline

Add shader uniform.

Parameters
nameName for the uniform
valueValue of the uniform
void Luminous::Fill::setTexture ( const Luminous::Texture texture)
inline

Sets default fill texture.

Internally this ties the given texture to the identifier "tex".

Parameters
textureTexture to be used for filling
void Luminous::Fill::setTexture ( const QByteArray &  name,
const Texture texture 
)
inline

Sets fill texture with name.

Parameters
nameName to use in shader to refer to texture
textureTexture to be tied with the name
const Texture * Luminous::Fill::texture ( const QByteArray &  name)
inline

Returns the texture tied to given name.

Parameters
nameName to search from textures
Returns
Pointer to texture or nullptr if not found.