ComputerGraphik TU WIEN
Classes | Public Member Functions | Protected Attributes | List of all members
SelectorBase Class Referenceabstract

Base class for selectors. More...

#include <selectorBase.hpp>

Inheritance diagram for SelectorBase:
SceneObject SelectorGPU SelectorQuadTree SelectorSimple

Classes

class  EffectObject
 

Public Member Functions

 SelectorBase (const std::string &name, Scene *scene)
 
 ~SelectorBase ()
 
void reset ()
 set up EffectObject More...
 
void draw () const
 draw selectable object ids into a texture More...
 
void update (double deltaT)
 empty function More...
 
virtual void changeMode ()=0
 debug, change mode More...
 
virtual void pickObject (const glm::ivec2 &mouse)=0
 select closest object to mouse More...
 
int getBufferWidth () const
 
int getBufferHeight () const
 
size_t getLastSelected () const
 
size_t getLastDistance () const
 
- Public Member Functions inherited from SceneObject
 SceneObject (std::shared_ptr< SceneObject > &effectParent, const glm::mat4 &modelMatrix=glm::mat4(1))
 
 SceneObject (const std::string &name, Scene *scene=0, Model *model=0, const glm::mat4 &modelMatrix=glm::mat4(1))
 
virtual ~SceneObject ()
 
ModelgetModel () const
 
ShadergetShader () const
 
glm::mat4 getModelMatrix () const
 
glm::mat4 getGlobalModelMatrix () const
 
std::string getName () const
 
std::shared_ptr< SceneObjectgetParent () const
 
void setAnimationTime (double time)
 
bool setAnimation (const Animation &anim)
 
bool delChild (size_t idx)
 
bool getChild (size_t idx, std::shared_ptr< SceneObject > &child) const
 
bool addChild (std::shared_ptr< SceneObject > &child)
 
bool remEffect (const std::string &name)
 
SceneObjectgetEffect (const std::string &name) const
 
bool addEffect (const std::string &name, std::unique_ptr< SceneObject > &effect)
 
bool doNotRender ()
 
bool getIsVolSun ()
 
virtual bool animate (double time)
 
virtual void setShader (Shader *val)
 

Protected Attributes

int width
 width of screen More...
 
int height
 height of screen More...
 
GLuint idBuffer
 frame buffer More...
 
GLuint idTexture
 texture of rendered object indices More...
 
size_t lastDistance
 distance after pickObject() call More...
 
size_t lastSelected
 selected object id after pickObject() call More...
 
- Protected Attributes inherited from SceneObject
GLuint vao
 
Scenescene
 
Modelmodel
 
Shadershader
 
glm::mat4 modelMatrix
 
std::string name
 
std::weak_ptr< SceneObjectparent
 
std::vector< std::shared_ptr< SceneObject > > childs
 
std::map< std::string, std::unique_ptr< SceneObject > > effectChilds
 
size_t animIDX
 
Animation animation
 
bool norender
 
bool isVolSun
 

Additional Inherited Members

- Public Types inherited from SceneObject
typedef std::vector< std::pair< double, glm::mat4 > > Animation
 

Detailed Description

Base class for selectors.

Responsible for pick buffer drawing and interface.

See also
SelectorQuadTree
Author
Adam

Constructor & Destructor Documentation

SelectorBase::SelectorBase ( const std::string &  name,
Scene scene 
)
Todo:
, allow resize?
SelectorBase::~SelectorBase ( )

Member Function Documentation

virtual void SelectorBase::changeMode ( )
pure virtual

debug, change mode

Implemented in SelectorQuadTree, SelectorGPU, and SelectorSimple.

void SelectorBase::draw ( ) const
virtual

draw selectable object ids into a texture

Reimplemented from SceneObject.

int SelectorBase::getBufferHeight ( ) const
inline
int SelectorBase::getBufferWidth ( ) const
inline
size_t SelectorBase::getLastDistance ( ) const
inline
size_t SelectorBase::getLastSelected ( ) const
inline
virtual void SelectorBase::pickObject ( const glm::ivec2 &  mouse)
pure virtual

select closest object to mouse

Implemented in SelectorQuadTree, SelectorGPU, and SelectorSimple.

void SelectorBase::reset ( )
virtual

set up EffectObject

Todo:
Add instanced effect.

Reimplemented from SceneObject.

void SelectorBase::update ( double  deltaT)
virtual

empty function

Reimplemented from SceneObject.

Reimplemented in SelectorQuadTree.

Member Data Documentation

int SelectorBase::height
protected

height of screen

GLuint SelectorBase::idBuffer
protected

frame buffer

GLuint SelectorBase::idTexture
protected

texture of rendered object indices

size_t SelectorBase::lastDistance
protected

distance after pickObject() call

size_t SelectorBase::lastSelected
protected

selected object id after pickObject() call

int SelectorBase::width
protected

width of screen


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