SPH
Public Member Functions | List of all members
IColorizer Class Referenceabstract

Interface for objects assigning colors to particles. More...

#include <Colorizer.h>

Inheritance diagram for IColorizer:
Polymorphic IdColorizerTemplate< AggregateIdColorizer > IdColorizerTemplate< IndexColorizer > IdColorizerTemplate< ParticleIdColorizer > IdColorizerTemplate< ComponentIdColorizer > TypedColorizer< Float > TypedColorizer< Vector > BeautyColorizer BoundaryColorizer CorotatingVelocityColorizer DamageActivationColorizer DensityPerturbationColorizer DirectionColorizer EnergyColorizer IdColorizerTemplate< TDerived > StressColorizer SummedDensityColorizer TypedColorizer< Type > UvwColorizer

Public Member Functions

virtual bool hasData (const Storage &storage) const =0
 Checks if the storage constains all data necessary to initialize the colorizer. More...
 
virtual void initialize (const Storage &storage, const RefEnum ref)=0
 Initialize the colorizer before by getting necessary quantities from storage. More...
 
virtual bool isInitialized () const =0
 Checks if the colorizer has been initialized. More...
 
virtual Rgba evalColor (const Size idx) const =0
 Returns the color of idx-th particle. More...
 
virtual Optional< float > evalScalar (const Size UNUSED(idx)) const
 Returns the scalar representation of the colorized quantity for idx-th particle. More...
 
virtual Optional< VectorevalVector (const Size UNUSED(idx)) const
 Returns the vector representation of the colorized quantity for idx-th particle. More...
 
virtual Optional< ParticlegetParticle (const Size idx) const =0
 Returns the original value of the displayed quantity. More...
 
virtual Optional< PalettegetPalette () const =0
 Returns recommended palette for drawing this colorizer. More...
 
virtual void setPalette (const Palette &newPalette)=0
 Modifies the palette used by ths colorizer. More...
 
virtual std::string name () const =0
 Returns the name of the colorizer. More...
 
- Public Member Functions inherited from Polymorphic
virtual ~Polymorphic ()
 

Detailed Description

Interface for objects assigning colors to particles.

Used to add a layer of abstraction between quantity values and displayed colors, allowing to visualize various information that isn't directly stored as quantity, like relative values of quantitiees, angular dependence of velocities, etc. Usually though, one wants to display raw quantity values, which can be accomplished by TypedColorizer.

Definition at line 34 of file Colorizer.h.

Member Function Documentation

◆ evalColor()

virtual Rgba IColorizer::evalColor ( const Size  idx) const
pure virtual

◆ evalScalar()

virtual Optional<float> IColorizer::evalScalar ( const Size   UNUSEDidx) const
inlinevirtual

Returns the scalar representation of the colorized quantity for idx-th particle.

If there is no reasonable scalar representation (boundary particles, for example), returns NOTHING

Definition at line 57 of file Colorizer.h.

◆ evalVector()

virtual Optional<Vector> IColorizer::evalVector ( const Size   UNUSEDidx) const
inlinevirtual

Returns the vector representation of the colorized quantity for idx-th particle.

If there is no reasonable vector representation (which is true for any non-vector quantity) or the function is not defined, return NOTHING.

Reimplemented in GravityColorizer, EnergyColorizer, and StressColorizer.

Definition at line 65 of file Colorizer.h.

◆ getPalette()

virtual Optional<Palette> IColorizer::getPalette ( ) const
pure virtual

◆ getParticle()

virtual Optional<Particle> IColorizer::getParticle ( const Size  idx) const
pure virtual

◆ hasData()

virtual bool IColorizer::hasData ( const Storage storage) const
pure virtual

◆ initialize()

virtual void IColorizer::initialize ( const Storage storage,
const RefEnum  ref 
)
pure virtual

Initialize the colorizer before by getting necessary quantities from storage.

Can only be called if hasData returns true. Must be called before evalColor is called, every time step as ArrayViews taken from storage might be invalidated.

Parameters
storageParticle storage containing source data to be drawn.
refSpecifies how the object refereneces the data required for evaluation; either the buffers are copied and stored in the colorizer, or only references to the the storage are kept.

Implemented in MaterialColorizer, IndexColorizer, ComponentIdColorizer, ParticleIdColorizer, BoundaryColorizer, UvwColorizer, RadiusColorizer, BeautyColorizer, DamageActivationColorizer, TemperatureColorizer, EnergyColorizer, StressColorizer, SummedDensityColorizer, DensityPerturbationColorizer, CorotatingVelocityColorizer, DirectionColorizer, AccelerationColorizer, VelocityColorizer, TypedColorizer< Type >, TypedColorizer< Float >, and TypedColorizer< Vector >.

◆ isInitialized()

virtual bool IColorizer::isInitialized ( ) const
pure virtual

◆ name()

virtual std::string IColorizer::name ( ) const
pure virtual

◆ setPalette()

virtual void IColorizer::setPalette ( const Palette newPalette)
pure virtual

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