Skyscraper 2.0
SBS::Object Class Reference

#include <object.h>

Inheritance diagram for SBS::Object:
Collaboration diagram for SBS::Object:

Public Member Functions

 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)
 
virtual void Enabled (bool value)
 
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

std::string command
 
std::string command_processed
 
std::string context
 
int linenum
 
std::string includefile
 
bool parent_deleting
 

Protected Member Functions

void EnableLoop (bool value)
 
void LoopChildren ()
 
bool SelfDestruct ()
 

Private Member Functions

void NotifyChildren (bool move, bool rotate)
 
void InitChildren ()
 

Private Attributes

bool Permanent
 
std::string Type
 
int Number
 
std::vector< Object * > children
 
SceneNodenode
 
bool values_set
 
bool initialized
 
std::vector< Object * > runloops
 
bool loop_enabled
 

Additional Inherited Members

- Protected Attributes inherited from SBS::ObjectBase
SBSsbs
 

Detailed Description

Definition at line 55 of file object.h.

Constructor & Destructor Documentation

◆ Object()

SBS::Object::Object ( Object * parent)

Definition at line 91 of file object.cpp.

References initialized, linenum, loop_enabled, node, Number, parent_deleting, Permanent, SBS::SBS::RegisterObject(), SBS::ObjectBase::sbs, and values_set.

Here is the call graph for this function:

◆ ~Object()

Member Function Documentation

◆ AddChild()

void SBS::Object::AddChild ( Object * object)

Definition at line 189 of file object.cpp.

References SBS::SceneNode::AddChild(), children, GetSceneNode(), node, and SBS::ObjectBase::sbs.

Referenced by ChangeParent(), and SetValues().

Here is the call graph for this function:

◆ ChangeParent()

◆ ConvertTo()

template<typename T >
T * SBS::Object::ConvertTo ( )
inline

Definition at line 119 of file object.h.

Referenced by SBS::CustomObject::Loop(), SBS::Model::Loop(), and SBS::Primitive::Loop().

◆ Enabled()

◆ EnableLoop()

◆ GetChild()

Object * SBS::Object::GetChild ( int index)

Definition at line 225 of file object.cpp.

References children.

Referenced by Skyscraper::ObjectInfo::AddChildren().

◆ GetChildrenCount()

int SBS::Object::GetChildrenCount ( )

Definition at line 234 of file object.cpp.

References children.

Referenced by Skyscraper::ObjectInfo::AddChildren(), InitChildren(), NotifyChildren(), and RemoveChild().

◆ GetNameBase()

◆ GetNumber()

◆ GetOrientation()

Quaternion SBS::Object::GetOrientation ( bool relative = false)

◆ GetPosition()

Vector3 SBS::Object::GetPosition ( bool relative = false)
virtual

Reimplemented in SBS::Camera.

Definition at line 321 of file object.cpp.

References SBS::SceneNode::GetPosition(), and node.

Referenced by SBS::Floor::AddDirectionalIndicator(), SBS::Shaft::Level::AddDoor(), SBS::Stairwell::Level::AddDoor(), SBS::Utility::AddDoorwayWalls(), SBS::ElevatorCar::AddElevatorIDSigns(), SBS::Floor::AddFloorIndicator(), SBS::SBS::AddFloorMain(), SBS::ElevatorCar::AddFloorSigns(), SBS::Elevator::AddRails(), SBS::SBS::AddWallMain(), SBS::Elevator::BeyondDecelMarker(), ChangeParent(), SBS::Camera::ClickedObject(), SBS::Elevator::CreateCounterweight(), SBS::Elevator::CreateElevator(), SBS::Shaft::Level::Cut(), SBS::Stairwell::Level::Cut(), SBS::Shaft::CutFloors(), SBS::Stairwell::CutFloors(), SBS::DoorWrapper::DoorWrapper(), SBS::CustomObject::Drop(), SBS::Model::Drop(), SBS::Primitive::Drop(), SBS::Door::FinishDoor(), SBS::ElevatorDoor::FinishDoors(), SBS::Polygon::GetAbsolutePlane(), SBS::Trigger::GetBounds(), SBS::Elevator::GetCarOffset(), SBS::Utility::GetDoorwayExtents(), SBS::ElevatorCar::GetFloor(), SBS::Sound::GetNearestReverbPosition(), SBS::ElevatorCar::GetNearestServicedFloor(), SBS::ElevatorDoor::GetShaftDoorAltitude(), SBS::DoorLock::GetSide(), SBS::MeshObject::HitBeam(), SBS::MeshObject::InBoundingBox(), SBS::Polygon::IntersectRay(), SBS::ElevatorCar::IsInCar(), SBS::Trigger::IsInside(), SBS::ElevatorCar::IsLeveled(), SBS::Elevator::IsManuallyStopped(), SBS::Trigger::IsOutside(), SBS::MeshObject::IsVisible(), SBS::CustomObject::Loop(), SBS::Model::Loop(), SBS::Primitive::Loop(), SBS::Vehicle::Loop(), Skyscraper::CameraTextureControl::Loop(), Skyscraper::editelevator::Loop(), Skyscraper::EngineManager::Loop(), Skyscraper::MoveObject::Loop(), Skyscraper::SoundManager::Loop(), SBS::DoorComponent::MoveDoors(), SBS::Elevator::MoveElevatorToFloor(), SBS::Elevator::MoveObjects(), SBS::ElevatorDoor::MoveSound(), SBS::Escalator::MoveSteps(), SBS::MovingWalkway::MoveSteps(), SBS::Reverb::OnMove(), SBS::Sound::OnMove(), SBS::DynamicMesh::Mesh::Prepare(), SBS::CallStation::ReportElevator(), SBS::DoorComponent::Reset(), SBS::Action::Run(), Skyscraper::ScriptProcessor::CommandsSection::Run(), SBS::ElevatorCar::SetFloor(), SetPositionY(), Skyscraper::EngineContext::StartSim(), and SBS::DynamicMesh::Mesh::UpdateVertices().

Here is the call graph for this function:

◆ GetRotation()

Vector3 SBS::Object::GetRotation ( )
virtual

Reimplemented in SBS::Camera.

Definition at line 367 of file object.cpp.

References SBS::SceneNode::GetRotation(), and node.

Referenced by SBS::Camera::GetCameraState(), Skyscraper::CameraTextureControl::Loop(), SBS::RevolvingDoor::RevolvingDoor(), Rotate(), and SBS::Camera::SetCameraState().

Here is the call graph for this function:

◆ GetSceneNode()

◆ GetType()

◆ Init()

void SBS::Object::Init ( bool children = true)

Definition at line 492 of file object.cpp.

References children, InitChildren(), initialized, and OnInit().

Referenced by SBS::Primitive::Attach(), SBS::CustomObject::Finish(), InitChildren(), SBS::Model::Model(), and Skyscraper::EngineContext::Run().

Here is the call graph for this function:

◆ InitChildren()

void SBS::Object::InitChildren ( )
private

Definition at line 508 of file object.cpp.

References children, GetChildrenCount(), and Init().

Referenced by Init().

Here is the call graph for this function:

◆ IsGlobal()

bool SBS::Object::IsGlobal ( )

Definition at line 482 of file object.cpp.

References GetNumber(), Number, and SBS::ObjectBase::Parent.

Referenced by SBS::CustomObject::CustomObject(), SBS::Model::Model(), and SBS::Primitive::Primitive().

Here is the call graph for this function:

◆ IsMovable()

bool SBS::Object::IsMovable ( )

Definition at line 172 of file object.cpp.

References node.

◆ IsPermanent()

bool SBS::Object::IsPermanent ( )

Definition at line 166 of file object.cpp.

References Permanent.

Referenced by SBS::SBS::DeleteObject(), and Skyscraper::ObjectInfo::Loop().

◆ IsType()

template<typename T >
bool SBS::Object::IsType ( )
inline

Definition at line 113 of file object.h.

◆ Loop()

◆ LoopChildren()

◆ Move() [1/2]

◆ Move() [2/2]

void SBS::Object::Move ( Real X,
Real Y,
Real Z,
Real speed = 1.0 )
virtual

Definition at line 268 of file object.cpp.

References Move().

Here is the call graph for this function:

◆ NotifyChildren()

void SBS::Object::NotifyChildren ( bool move,
bool rotate )
private

Definition at line 425 of file object.cpp.

References children, GetChildrenCount(), and SBS_PROFILE.

Referenced by NotifyMove(), and NotifyRotate().

Here is the call graph for this function:

◆ NotifyMove()

void SBS::Object::NotifyMove ( bool parent = false)

Definition at line 393 of file object.cpp.

References node, NotifyChildren(), OnMove(), and SBS::SceneNode::Update().

Referenced by Move(), SetPosition(), SetPositionRelative(), and SBS::Camera::Sync().

Here is the call graph for this function:

◆ NotifyRotate()

void SBS::Object::NotifyRotate ( bool parent = false)

Definition at line 409 of file object.cpp.

References node, NotifyChildren(), OnRotate(), and SBS::SceneNode::Update().

Referenced by ChangeParent(), SetRotation(), and SBS::Camera::Sync().

Here is the call graph for this function:

◆ OnClick()

virtual void SBS::Object::OnClick ( Vector3 & position,
bool shift,
bool ctrl,
bool alt,
bool right )
inlinevirtual

◆ OnHit()

virtual void SBS::Object::OnHit ( )
inlinevirtual

Reimplemented in SBS::DoorWrapper, SBS::RevolvingDoor, and SBS::Step.

Definition at line 99 of file object.h.

Referenced by SBS::Camera::Loop().

◆ OnInit()

virtual void SBS::Object::OnInit ( )
inlinevirtual

Reimplemented in SBS::Elevator, SBS::ElevatorCar, SBS::Model, SBS::Shaft, and SBS::Stairwell.

Definition at line 106 of file object.h.

Referenced by Init().

◆ OnMove()

virtual void SBS::Object::OnMove ( bool parent)
inlinevirtual

Reimplemented in SBS::Camera, SBS::MeshObject, SBS::Reverb, SBS::Sound, and SBS::Vehicle.

Definition at line 95 of file object.h.

Referenced by NotifyMove().

◆ OnRotate()

virtual void SBS::Object::OnRotate ( bool parent)
inlinevirtual

Reimplemented in SBS::Camera, SBS::MeshObject, and SBS::Sound.

Definition at line 96 of file object.h.

Referenced by NotifyRotate().

◆ OnUnclick()

virtual void SBS::Object::OnUnclick ( bool right)
inlinevirtual

Reimplemented in SBS::Control.

Definition at line 98 of file object.h.

Referenced by SBS::Camera::UnclickedObject().

◆ RegisterLoop()

void SBS::Object::RegisterLoop ( Object * object)

Definition at line 543 of file object.cpp.

References runloops.

Referenced by EnableLoop().

◆ RemoveChild()

void SBS::Object::RemoveChild ( Object * object)

Definition at line 205 of file object.cpp.

References children, GetChildrenCount(), GetSceneNode(), node, and SBS::SceneNode::RemoveChild().

Referenced by ChangeParent(), and ~Object().

Here is the call graph for this function:

◆ ResetState()

virtual void SBS::Object::ResetState ( )
inlinevirtual

◆ Rotate() [1/2]

void SBS::Object::Rotate ( const Vector3 & vector,
Real speed = 1.0 )
virtual

◆ Rotate() [2/2]

void SBS::Object::Rotate ( Real X,
Real Y,
Real Z,
Real speed = 1.0 )
virtual

Definition at line 361 of file object.cpp.

References Rotate().

Here is the call graph for this function:

◆ SelfDestruct()

bool SBS::Object::SelfDestruct ( )
protected

Definition at line 589 of file object.cpp.

References SBS::SBS::DeleteObject(), Number, SBS::ObjectBase::Report(), SBS::ObjectBase::sbs, and SBS::ToString().

Referenced by SBS::Model::OnClick().

Here is the call graph for this function:

◆ SetOrientation()

void SBS::Object::SetOrientation ( const Quaternion & q,
bool relative = false )

Definition at line 385 of file object.cpp.

References node, and SBS::SceneNode::SetOrientation().

Here is the call graph for this function:

◆ SetPosition() [1/2]

◆ SetPosition() [2/2]

void SBS::Object::SetPosition ( Real X,
Real Y,
Real Z )
virtual

Definition at line 301 of file object.cpp.

References SetPosition().

Here is the call graph for this function:

◆ SetPositionRelative() [1/2]

void SBS::Object::SetPositionRelative ( const Vector3 & position)

Definition at line 287 of file object.cpp.

References node, NotifyMove(), and SBS::SceneNode::SetPositionRelative().

Referenced by Skyscraper::ScriptProcessor::CommandsSection::Run(), SBS::ElevatorCar::SetHeight(), and SetPositionRelative().

Here is the call graph for this function:

◆ SetPositionRelative() [2/2]

void SBS::Object::SetPositionRelative ( Real X,
Real Y,
Real Z )

Definition at line 307 of file object.cpp.

References SetPositionRelative().

Here is the call graph for this function:

◆ SetPositionY()

◆ SetRotation() [1/2]

◆ SetRotation() [2/2]

void SBS::Object::SetRotation ( Real X,
Real Y,
Real Z )
virtual

Definition at line 347 of file object.cpp.

References SetRotation().

Here is the call graph for this function:

◆ SetValues()

void SBS::Object::SetValues ( const std::string & type,
const std::string & name,
bool is_permanent,
bool is_movable = true )

Definition at line 144 of file object.cpp.

References AddChild(), SBS::ObjectBase::Name, node, SBS::ObjectBase::Parent, Permanent, Type, and values_set.

Referenced by SBS::ButtonPanel::ButtonPanel(), SBS::CallStation::CallStation(), SBS::Camera::Camera(), SBS::CameraTexture::CameraTexture(), SBS::Control::Control(), SBS::ControllerManager::ControllerManager(), SBS::Vehicle::CreateChassis(), SBS::MeshObject::CreateWallObject(), SBS::CustomObject::CustomObject(), SBS::DirectionalIndicator::DirectionalIndicator(), SBS::DispatchController::DispatchController(), SBS::Door::Door(), SBS::DoorManager::DoorManager(), SBS::DoorWrapper::DoorWrapper(), SBS::DoorWrapper::DoorWrapper(), SBS::Elevator::Elevator(), SBS::ElevatorCar::ElevatorCar(), SBS::ElevatorDoor::ElevatorDoor(), SBS::ElevatorManager::ElevatorManager(), SBS::Escalator::Escalator(), SBS::Floor::Floor(), SBS::FloorIndicator::FloorIndicator(), SBS::FloorManager::FloorManager(), SBS::GeometryController::GeometryController(), SBS::Indicator::Indicator(), SBS::Shaft::Level::Level(), SBS::Stairwell::Level::Level(), SBS::Light::Light(), SBS::Map::Map(), SBS::MeshObject::MeshObject(), SBS::Model::Model(), SBS::MovingWalkway::MovingWalkway(), SBS::Person::Person(), SBS::Primitive::Primitive(), SBS::Reverb::Reverb(), SBS::RevolvingDoor::RevolvingDoor(), SBS::RevolvingDoorManager::RevolvingDoorManager(), SBS::Shaft::Shaft(), SBS::ShaftManager::ShaftManager(), SBS::Sound::Sound(), SBS::SoundSystem::SoundSystem(), SBS::SoundSystem::SoundSystem(), SBS::Stairwell::Stairwell(), SBS::StairwellManager::StairwellManager(), SBS::TimerObject::TimerObject(), SBS::Trigger::Trigger(), SBS::Vehicle::Vehicle(), and SBS::VehicleManager::VehicleManager().

Here is the call graph for this function:

◆ ShowBoundingBox()

void SBS::Object::ShowBoundingBox ( bool value)

Definition at line 245 of file object.cpp.

References node, and SBS::SceneNode::ShowBoundingBox().

Here is the call graph for this function:

◆ UnregisterLoop()

void SBS::Object::UnregisterLoop ( Object * object)

Definition at line 556 of file object.cpp.

References runloops.

Referenced by EnableLoop().

Member Data Documentation

◆ children

std::vector<Object*> SBS::Object::children
private

◆ command

std::string SBS::Object::command

Definition at line 59 of file object.h.

Referenced by SBS::Camera::ClickedObject(), and Skyscraper::ObjectInfo::Loop().

◆ command_processed

std::string SBS::Object::command_processed

Definition at line 60 of file object.h.

Referenced by SBS::Camera::ClickedObject(), and Skyscraper::ObjectInfo::Loop().

◆ context

std::string SBS::Object::context

Definition at line 61 of file object.h.

Referenced by Skyscraper::ObjectInfo::Loop().

◆ includefile

std::string SBS::Object::includefile

Definition at line 63 of file object.h.

Referenced by Skyscraper::ObjectInfo::Loop().

◆ initialized

bool SBS::Object::initialized
private

Definition at line 140 of file object.h.

Referenced by Init(), and Object().

◆ linenum

int SBS::Object::linenum

Definition at line 62 of file object.h.

Referenced by SBS::Camera::ClickedObject(), Skyscraper::ObjectInfo::Loop(), and Object().

◆ loop_enabled

bool SBS::Object::loop_enabled
private

Definition at line 142 of file object.h.

Referenced by EnableLoop(), and Object().

◆ node

◆ Number

int SBS::Object::Number
private

Definition at line 136 of file object.h.

Referenced by ChangeParent(), GetNumber(), IsGlobal(), Object(), SelfDestruct(), and ~Object().

◆ parent_deleting

◆ Permanent

bool SBS::Object::Permanent
private

Definition at line 134 of file object.h.

Referenced by IsPermanent(), Object(), and SetValues().

◆ runloops

std::vector<Object*> SBS::Object::runloops
private

Definition at line 141 of file object.h.

Referenced by LoopChildren(), RegisterLoop(), and UnregisterLoop().

◆ Type

std::string SBS::Object::Type
private

Definition at line 135 of file object.h.

Referenced by GetType(), SetValues(), and SBS::ElevatorDoor::Timer::Timer().

◆ values_set

bool SBS::Object::values_set
private

Definition at line 139 of file object.h.

Referenced by Object(), and SetValues().


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