cherish
Public Member Functions | Protected Member Functions | List of all members
ProgramStroke Class Reference

An interface class that deals with entity::Stroke shader's state. More...

#include <ProgramStroke.h>

Inheritance diagram for ProgramStroke:
ProgramEntity2D

Public Member Functions

 ProgramStroke ()
 
void initialize (osg::StateSet *state, osg::Camera *camera, osg::MatrixTransform *t, bool isFogged)
 
void updateIsFogged (bool f)
 
bool getIsFogged () const
 
- Public Member Functions inherited from ProgramEntity2D
virtual void initialize (osg::StateSet *state, osg::Camera *camera, osg::MatrixTransform *t)
 
void updateTransform (osg::MatrixTransform *t)
 
osg::MatrixTransform * getTransform () const
 
osg::Camera * getCamera () const
 

Protected Member Functions

virtual bool addPresetShaders ()
 
virtual bool addPresetUniforms ()
 
- Protected Member Functions inherited from ProgramEntity2D
template<typename T >
bool addUniform (const std::string &name, osg::Uniform::Type type, T *updateCallback=0)
 
bool addUniformCanvasMatrix ()
 
template<typename T >
bool addUniform (const std::string &name, osg::Uniform::Type type, T value)
 

Additional Inherited Members

- Protected Attributes inherited from ProgramEntity2D
osg::observer_ptr< osg::StateSet > m_state
 
osg::observer_ptr< osg::Camera > m_camera
 
osg::observer_ptr< osg::MatrixTransform > m_transform
 

Detailed Description

An interface class that deals with entity::Stroke shader's state.

It is a part of entity::Canvas private members and is applyied to the stroke group, entity::Canvas::m_geodeStrokes. The main goal of the class is to provide an easy to use interface to program's modification, e.g., when isFogged parameter is changed from MainWindow::onStrokeFogFactor().

Constructor & Destructor Documentation

§ ProgramStroke()

ProgramStroke::ProgramStroke ( )

Constructor that also loads the shaders from files and set preset uniforms.

Member Function Documentation

§ initialize()

void ProgramStroke::initialize ( osg::StateSet *  state,
osg::Camera *  camera,
osg::MatrixTransform *  t,
bool  isFogged 
)

A method to initialize the internal variables for the future use, must be run right after the constructor.

§ updateIsFogged()

void ProgramStroke::updateIsFogged ( bool  f)

A method to update one of the uniforms of the state set - fog factor.


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