Skyscraper 2.0
SBS::ButtonPanel Class Reference

#include <buttonpanel.h>

Inheritance diagram for SBS::ButtonPanel:
Collaboration diagram for SBS::ButtonPanel:

Public Member Functions

 ButtonPanel (Object *parent, int index, const std::string &texture, int rows, int columns, const std::string &direction, Real CenterX, Real CenterZ, Real buttonwidth, Real buttonheight, Real spacingX, Real spacingY, Real voffset, Real tw, Real th, bool autosize=true)
 
 ~ButtonPanel ()
 
ControlAddButton (const std::string &sound, const std::string &texture, const std::string &texture_lit, int row, int column, const std::string &type, Real width, Real height, Real hoffset=0, Real voffset=0)
 
ControlAddControl (const std::string &sound, int row, int column, Real bwidth, Real bheight, Real hoffset, Real voffset, int selection_position, std::vector< std::string > &action_names, std::vector< std::string > &textures)
 
void Enabled (bool value)
 
bool AddWall (const std::string &name, const std::string &texture, Real thickness, Real x1, Real z1, Real x2, Real z2, Real height1, Real height2, Real voffset1, Real voffset2, Real tw, Real th, bool autosize)
 
void ChangeLight (int floor, bool value)
 
void ChangeAllLights (bool value)
 
ControlGetFloorButton (int floor)
 
ControlGetControl (int index)
 
ControlGetControl (const std::string &name)
 
void RemoveControl (Control *control)
 
int GetControlCount ()
 
void SetControls (const std::string &action_name)
 
- Public Member Functions inherited from SBS::Object
 Object (Object *parent)
 
virtual ~Object ()
 
void SetValues (const std::string &type, const std::string &name, bool is_permanent, bool is_movable=true)
 
bool IsPermanent ()
 
bool IsMovable ()
 
const std::string & GetType ()
 
int GetNumber ()
 
void AddChild (Object *object)
 
ObjectGetChild (int index)
 
int GetChildrenCount ()
 
void RemoveChild (Object *object)
 
SceneNodeGetSceneNode ()
 
void ShowBoundingBox (bool value)
 
virtual void Move (const Vector3 &vector, Real speed=1.0)
 
virtual void Move (Real X, Real Y, Real Z, Real speed=1.0)
 
virtual void SetPosition (const Vector3 &position)
 
void SetPositionRelative (const Vector3 &position)
 
virtual void SetPosition (Real X, Real Y, Real Z)
 
void SetPositionRelative (Real X, Real Y, Real Z)
 
virtual void SetPositionY (Real value)
 
virtual Vector3 GetPosition (bool relative=false)
 
virtual void Rotate (const Vector3 &vector, Real speed=1.0)
 
virtual void Rotate (Real X, Real Y, Real Z, Real speed=1.0)
 
virtual void SetRotation (const Vector3 &rotation)
 
virtual void SetRotation (Real X, Real Y, Real Z)
 
virtual Vector3 GetRotation ()
 
Quaternion GetOrientation (bool relative=false)
 
void SetOrientation (const Quaternion &q, bool relative=false)
 
virtual void OnMove (bool parent)
 
virtual void OnRotate (bool parent)
 
virtual void OnClick (Vector3 &position, bool shift, bool ctrl, bool alt, bool right)
 
virtual void OnUnclick (bool right)
 
virtual void OnHit ()
 
void NotifyMove (bool parent=false)
 
void NotifyRotate (bool parent=false)
 
virtual void ResetState ()
 
void ChangeParent (Object *new_parent)
 
bool IsGlobal ()
 
void Init (bool children=true)
 
virtual void OnInit ()
 
virtual void Loop ()
 
void RegisterLoop (Object *object)
 
void UnregisterLoop (Object *object)
 
std::string GetNameBase ()
 
template<typename T >
bool IsType ()
 
template<typename T >
T * ConvertTo ()
 
- Public Member Functions inherited from SBS::ObjectBase
 ObjectBase (Object *parent)
 
virtual ~ObjectBase ()
 
ObjectGetParent ()
 
SBSGetRoot ()
 
void SetName (const std::string &name)
 
const std::string & GetName ()
 
std::string GetNameBase ()
 
virtual void Report (const std::string &message)
 
virtual bool ReportError (const std::string &message)
 

Public Attributes

int Index
 
std::string Direction
 
Real Width
 
Real Height
 
Real ButtonWidth
 
Real ButtonHeight
 
Real SpacingX
 
Real SpacingY
 
int Rows
 
int Columns
 
bool IsEnabled
 
- Public Attributes inherited from SBS::Object
std::string command
 
std::string command_processed
 
std::string context
 
int linenum
 
std::string includefile
 
bool parent_deleting
 

Private Attributes

MeshObjectmesh
 
Actionoff_action
 
std::vector< Control * > controls
 
std::vector< Action * > action_list
 

Additional Inherited Members

- Protected Member Functions inherited from SBS::Object
void EnableLoop (bool value)
 
void LoopChildren ()
 
bool SelfDestruct ()
 
- Protected Attributes inherited from SBS::ObjectBase
SBSsbs
 

Detailed Description

Definition at line 29 of file buttonpanel.h.

Constructor & Destructor Documentation

◆ ButtonPanel()

SBS::ButtonPanel::ButtonPanel ( Object * parent,
int index,
const std::string & texture,
int rows,
int columns,
const std::string & direction,
Real CenterX,
Real CenterZ,
Real buttonwidth,
Real buttonheight,
Real spacingX,
Real spacingY,
Real voffset,
Real tw,
Real th,
bool autosize = true )

◆ ~ButtonPanel()

SBS::ButtonPanel::~ButtonPanel ( )

Member Function Documentation

◆ AddButton()

Control * SBS::ButtonPanel::AddButton ( const std::string & sound,
const std::string & texture,
const std::string & texture_lit,
int row,
int column,
const std::string & type,
Real width,
Real height,
Real hoffset = 0,
Real voffset = 0 )

◆ AddControl()

Control * SBS::ButtonPanel::AddControl ( const std::string & sound,
int row,
int column,
Real bwidth,
Real bheight,
Real hoffset,
Real voffset,
int selection_position,
std::vector< std::string > & action_names,
std::vector< std::string > & textures )

◆ AddWall()

bool SBS::ButtonPanel::AddWall ( const std::string & name,
const std::string & texture,
Real thickness,
Real x1,
Real z1,
Real x2,
Real z2,
Real height1,
Real height2,
Real voffset1,
Real voffset2,
Real tw,
Real th,
bool autosize )

Definition at line 269 of file buttonpanel.cpp.

References SBS::SBS::AddWallMain(), SBS::MeshObject::CreateWallObject(), mesh, and SBS::ObjectBase::sbs.

Referenced by ButtonPanel().

Here is the call graph for this function:

◆ ChangeAllLights()

void SBS::ButtonPanel::ChangeAllLights ( bool value)

Definition at line 287 of file buttonpanel.cpp.

References controls.

◆ ChangeLight()

void SBS::ButtonPanel::ChangeLight ( int floor,
bool value )

Definition at line 277 of file buttonpanel.cpp.

References controls.

◆ Enabled()

void SBS::ButtonPanel::Enabled ( bool value)
virtual

Reimplemented from SBS::Object.

Definition at line 253 of file buttonpanel.cpp.

References controls, SBS::MeshObject::Enabled(), IsEnabled, and mesh.

Referenced by SBS::CallStation::Enabled().

Here is the call graph for this function:

◆ GetControl() [1/2]

Control * SBS::ButtonPanel::GetControl ( const std::string & name)

Definition at line 312 of file buttonpanel.cpp.

References controls.

◆ GetControl() [2/2]

Control * SBS::ButtonPanel::GetControl ( int index)

◆ GetControlCount()

int SBS::ButtonPanel::GetControlCount ( )

Definition at line 340 of file buttonpanel.cpp.

References controls.

◆ GetFloorButton()

Control * SBS::ButtonPanel::GetFloorButton ( int floor)

Definition at line 297 of file buttonpanel.cpp.

References GetControl(), and SBS::ToString().

Here is the call graph for this function:

◆ RemoveControl()

void SBS::ButtonPanel::RemoveControl ( Control * control)

Definition at line 327 of file buttonpanel.cpp.

References controls.

◆ SetControls()

void SBS::ButtonPanel::SetControls ( const std::string & action_name)

Definition at line 345 of file buttonpanel.cpp.

References controls, and SBS::Control::FindActionPosition().

Here is the call graph for this function:

Member Data Documentation

◆ action_list

std::vector<Action*> SBS::ButtonPanel::action_list
private

Definition at line 66 of file buttonpanel.h.

Referenced by AddControl(), and ~ButtonPanel().

◆ ButtonHeight

Real SBS::ButtonPanel::ButtonHeight

Definition at line 38 of file buttonpanel.h.

Referenced by AddControl(), and ButtonPanel().

◆ ButtonWidth

Real SBS::ButtonPanel::ButtonWidth

Definition at line 37 of file buttonpanel.h.

Referenced by AddControl(), and ButtonPanel().

◆ Columns

int SBS::ButtonPanel::Columns

Definition at line 42 of file buttonpanel.h.

Referenced by ButtonPanel().

◆ controls

std::vector<Control*> SBS::ButtonPanel::controls
private

◆ Direction

std::string SBS::ButtonPanel::Direction

Definition at line 34 of file buttonpanel.h.

Referenced by AddControl(), ButtonPanel(), and SBS::CallStation::ReportElevator().

◆ Height

Real SBS::ButtonPanel::Height

Definition at line 36 of file buttonpanel.h.

Referenced by AddControl(), and ButtonPanel().

◆ Index

int SBS::ButtonPanel::Index

Definition at line 33 of file buttonpanel.h.

Referenced by ButtonPanel().

◆ IsEnabled

bool SBS::ButtonPanel::IsEnabled

Definition at line 43 of file buttonpanel.h.

Referenced by ButtonPanel(), and Enabled().

◆ mesh

MeshObject* SBS::ButtonPanel::mesh
private

Definition at line 63 of file buttonpanel.h.

Referenced by AddWall(), ButtonPanel(), Enabled(), and ~ButtonPanel().

◆ off_action

Action* SBS::ButtonPanel::off_action
private

Definition at line 64 of file buttonpanel.h.

Referenced by AddControl(), and ButtonPanel().

◆ Rows

int SBS::ButtonPanel::Rows

Definition at line 41 of file buttonpanel.h.

Referenced by ButtonPanel().

◆ SpacingX

Real SBS::ButtonPanel::SpacingX

Definition at line 39 of file buttonpanel.h.

Referenced by AddControl(), and ButtonPanel().

◆ SpacingY

Real SBS::ButtonPanel::SpacingY

Definition at line 40 of file buttonpanel.h.

Referenced by AddControl(), and ButtonPanel().

◆ Width

Real SBS::ButtonPanel::Width

Definition at line 35 of file buttonpanel.h.

Referenced by AddControl(), and ButtonPanel().


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