xoreos  0.0.5
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Engines::NWN::Scrollbar Class Reference

A NWN scrollbar model. More...

#include <scrollbar.h>

Inheritance diagram for Engines::NWN::Scrollbar:
Inheritance graph
[legend]
Collaboration diagram for Engines::NWN::Scrollbar:
Collaboration graph
[legend]

Classes

struct  Quad
 

Public Types

enum  Type { kTypeVertical, kTypeHorizontal }
 
- Public Types inherited from Graphics::GUIElement
enum  GUIElementType { kGUIElementFront = kRenderableTypeGUIFront, kGUIElementBack = kRenderableTypeGUIBack, kGUIElementConsole = kRenderableTypeConsole }
 

Public Member Functions

 Scrollbar (Type type)
 
 ~Scrollbar ()
 
void setPosition (float x, float y, float z)
 Set the current position of the scrollbar. More...
 
void getPosition (float &x, float &y, float &z) const
 Get the current position of the scrollbar. More...
 
bool isIn (float x, float y) const
 Is the point within the scrollbar? More...
 
void setLength (float length)
 Set the scrollbar length. More...
 
float getWidth () const
 Get the scrollbar's width. More...
 
float getHeight () const
 Get the scrollbar's height. More...
 
void calculateDistance ()
 Calculate the object's distance. More...
 
void render (Graphics::RenderPass pass)
 Render the object. More...
 
- Public Member Functions inherited from Graphics::GUIElement
 GUIElement (GUIElementType type)
 
 ~GUIElement ()
 
- Public Member Functions inherited from Graphics::Renderable
 Renderable (RenderableType type)
 
 ~Renderable ()
 
bool operator< (const Queueable &q) const
 
virtual void advanceTime (float dt)
 Advance time (used by renderables with animations). More...
 
virtual void renderImmediate (const glm::mat4 &parentTransform)
 For shader based systems, don't sort anything, render this right_now. More...
 
virtual void queueRender (const glm::mat4 &parentTransform)
 Queue the object for later rendering. More...
 
double getDistance () const
 Get the distance of the object from the viewer. More...
 
uint32 getID () const
 Get the object's unique ID. More...
 
bool isClickable () const
 Is the object clickable? More...
 
void setClickable (bool clickable)
 Set the object's clickable state. More...
 
const Common::UStringgetTag () const
 Get the object's tag. More...
 
void setTag (const Common::UString &tag)
 Set the object's tag. More...
 
bool isVisible () const
 Is the object visible? More...
 
virtual void show ()
 Show the object. More...
 
virtual void hide ()
 Hide the object. More...
 
virtual bool isIn (float x, float y, float z) const
 Is that point within the object? More...
 
virtual bool isIn (float x1, float y1, float z1, float x2, float y2, float z2) const
 Does the line from x1.y1.z1 to x2.y2.z2 intersect with the object? More...
 
- Public Member Functions inherited from Graphics::Queueable
 Queueable ()
 
virtual ~Queueable ()
 

Private Member Functions

void createV ()
 Create a vertical scrollbar. More...
 
void createH ()
 Create a horizontal scrollbar. More...
 

Private Attributes

Type _type
 
float _x
 
float _y
 
float _z
 
float _length
 
std::vector< Quad_quads
 
Graphics::Aurora::TextureHandle _texture
 

Additional Inherited Members

- Protected Member Functions inherited from Graphics::Renderable
void resort ()
 
void lockFrame ()
 
void unlockFrame ()
 
void lockFrameIfVisible ()
 
void unlockFrameIfVisible ()
 
- Protected Member Functions inherited from Graphics::Queueable
bool isInQueue (QueueType queue) const
 
void addToQueue (QueueType queue)
 
void removeFromQueue (QueueType queue)
 
void lockQueue (QueueType queue)
 
void unlockQueue (QueueType queue)
 
void sortQueue (QueueType queue)
 
- Protected Attributes inherited from Graphics::Renderable
QueueType _queueExists
 
QueueType _queueVisible
 
uint32 _id
 
bool _clickable
 
Common::UString _tag
 
double _distance
 The distance of the object from the viewer. More...
 

Detailed Description

A NWN scrollbar model.

Definition at line 43 of file scrollbar.h.

Member Enumeration Documentation

◆ Type

Enumerator
kTypeVertical 

Vertical scrollbar.

kTypeHorizontal 

Horizontal scrollbar.

Definition at line 45 of file scrollbar.h.

Constructor & Destructor Documentation

◆ Scrollbar()

Engines::NWN::Scrollbar::Scrollbar ( Type  type)

Definition at line 38 of file scrollbar.cpp.

References _texture, setLength(), and TextureMan.

Here is the call graph for this function:

◆ ~Scrollbar()

Engines::NWN::Scrollbar::~Scrollbar ( )

Definition at line 45 of file scrollbar.cpp.

References Graphics::Renderable::hide().

Here is the call graph for this function:

Member Function Documentation

◆ calculateDistance()

void Engines::NWN::Scrollbar::calculateDistance ( )
virtual

Calculate the object's distance.

Implements Graphics::Renderable.

Definition at line 108 of file scrollbar.cpp.

References Graphics::Renderable::_distance, and _z.

Referenced by setPosition().

Here is the caller graph for this function:

◆ createH()

void Engines::NWN::Scrollbar::createH ( )
private

Create a horizontal scrollbar.

Definition at line 131 of file scrollbar.cpp.

References _length, _quads, and MIN().

Referenced by setLength().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createV()

void Engines::NWN::Scrollbar::createV ( )
private

Create a vertical scrollbar.

Definition at line 187 of file scrollbar.cpp.

References _length, _quads, and MIN().

Referenced by setLength().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getHeight()

float Engines::NWN::Scrollbar::getHeight ( ) const

Get the scrollbar's height.

Definition at line 99 of file scrollbar.cpp.

References _length, _type, kTypeHorizontal, and kTypeVertical.

Referenced by Engines::NWN::WidgetScrollbar::getHeight(), and isIn().

Here is the caller graph for this function:

◆ getPosition()

void Engines::NWN::Scrollbar::getPosition ( float &  x,
float &  y,
float &  z 
) const

Get the current position of the scrollbar.

Definition at line 61 of file scrollbar.cpp.

References _x, _y, and _z.

Referenced by Engines::NWN::WidgetScrollbar::getBarPosition().

Here is the caller graph for this function:

◆ getWidth()

float Engines::NWN::Scrollbar::getWidth ( ) const

Get the scrollbar's width.

Definition at line 90 of file scrollbar.cpp.

References _length, _type, kTypeHorizontal, and kTypeVertical.

Referenced by Engines::NWN::WidgetScrollbar::getWidth(), and isIn().

Here is the caller graph for this function:

◆ isIn()

bool Engines::NWN::Scrollbar::isIn ( float  x,
float  y 
) const
virtual

Is the point within the scrollbar?

Reimplemented from Graphics::Renderable.

Definition at line 67 of file scrollbar.cpp.

References _x, _y, getHeight(), and getWidth().

Here is the call graph for this function:

◆ render()

void Engines::NWN::Scrollbar::render ( Graphics::RenderPass  pass)
virtual

Render the object.

Implements Graphics::Renderable.

Definition at line 112 of file scrollbar.cpp.

References _quads, _texture, _x, _y, _z, Graphics::kRenderPassTransparent, pass, and TextureMan.

◆ setLength()

void Engines::NWN::Scrollbar::setLength ( float  length)

Set the scrollbar length.

Definition at line 76 of file scrollbar.cpp.

References _length, _type, createH(), createV(), GfxMan, kTypeHorizontal, kTypeVertical, and MAX().

Referenced by Scrollbar(), and Engines::NWN::WidgetScrollbar::setLength().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setPosition()

void Engines::NWN::Scrollbar::setPosition ( float  x,
float  y,
float  z 
)

Set the current position of the scrollbar.

Definition at line 49 of file scrollbar.cpp.

References _x, _y, _z, calculateDistance(), and GfxMan.

Referenced by Engines::NWN::WidgetScrollbar::setState().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _length

float Engines::NWN::Scrollbar::_length
private

Definition at line 84 of file scrollbar.h.

Referenced by createH(), createV(), getHeight(), getWidth(), and setLength().

◆ _quads

std::vector<Quad> Engines::NWN::Scrollbar::_quads
private

Definition at line 86 of file scrollbar.h.

Referenced by createH(), createV(), and render().

◆ _texture

Graphics::Aurora::TextureHandle Engines::NWN::Scrollbar::_texture
private

Definition at line 88 of file scrollbar.h.

Referenced by render(), and Scrollbar().

◆ _type

Type Engines::NWN::Scrollbar::_type
private

Definition at line 78 of file scrollbar.h.

Referenced by getHeight(), getWidth(), and setLength().

◆ _x

float Engines::NWN::Scrollbar::_x
private

Definition at line 80 of file scrollbar.h.

Referenced by getPosition(), isIn(), render(), and setPosition().

◆ _y

float Engines::NWN::Scrollbar::_y
private

Definition at line 81 of file scrollbar.h.

Referenced by getPosition(), isIn(), render(), and setPosition().

◆ _z

float Engines::NWN::Scrollbar::_z
private

Definition at line 82 of file scrollbar.h.

Referenced by calculateDistance(), getPosition(), render(), and setPosition().


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