Game Develop Core: gd::Layout Class Reference

| Game Develop Core Core library for developing platforms and tools compatible with Game Develop.

- Main Page
- Modules
- Classes

- Class List
- Class Index
- Class Hierarchy

All Classes Files Functions Variables Typedefs Enumerations Macros Groups Pages
Public Member Functions | Public Attributes | List of all members
gd::Layout Class Reference
Platform Definition ( Classes defining the common concepts used by all platforms )

Represent a layout ( also called a scene ) of a project. More...

`#include <Layout.h>`

Inheritance diagram for gd::Layout:
[legend]

## Public Member Functions

| Layout (const Layout &)
Layout & | operator= (const Layout &rhs)
Layout * | Clone () const
void | UpdateAutomatismsSharedData (gd::Project &project)
const gd::LayoutEditorCanvasOptions & | GetAssociatedLayoutEditorCanvasOptions () const
gd::LayoutEditorCanvasOptions & | GetAssociatedLayoutEditorCanvasOptions ()
BaseProfiler * | GetProfiler () const
void | SetProfiler (BaseProfiler *profiler_)
Common properties
Members functions related to common properties of layouts
void | SetName (const std::string &name_)
const std::string & | GetName () const
const std::string & | GetMangledName () const
void | SetBackgroundColor (unsigned int r, unsigned int g, unsigned int b)
unsigned int | GetBackgroundColorRed () const
unsigned int | GetBackgroundColorGreen () const
unsigned int | GetBackgroundColorBlue () const
const std::string & | GetWindowDefaultTitle () const
void | SetWindowDefaultTitle (const std::string &title_)
Layout's initial instances
Members functions related to initial instances of objects created at the layout start up
const gd::InitialInstancesContainer & | GetInitialInstances () const
gd::InitialInstancesContainer & | GetInitialInstances ()
Layout's events
Members functions related to events management.
const std::vector < boost::shared_ptr < gd::BaseEvent > > & | GetEvents () const
std::vector< boost::shared_ptr < gd::BaseEvent > > & | GetEvents ()
Layout objects groups management
Members functions related to layout objects groups management.
std::vector< ObjectGroup > & | GetObjectGroups ()
const std::vector< ObjectGroup > & | GetObjectGroups () const
Variable management
Members functions related to layout variables management.
const gd::VariablesContainer & | GetVariables () const
gd::VariablesContainer & | GetVariables ()
Layout layers management
Members functions related to layout layers management.
bool | HasLayerNamed (const std::string &name) const
Layer & | GetLayer (const std::string &name)
const Layer & | GetLayer (const std::string &name) const
Layer & | GetLayer (unsigned int index)
const Layer & | GetLayer (unsigned int index) const
unsigned int | GetLayerPosition (const std::string &name) const
unsigned int | GetLayersCount () const
void | InsertNewLayer (const std::string &name, unsigned int position)
void | InsertLayer (const Layer &theLayer, unsigned int position)
void | RemoveLayer (const std::string &name)
void | SwapLayers (unsigned int firstLayerIndex, unsigned int secondLayerIndex)
Other properties
void | DisableInputWhenFocusIsLost (bool disable=true)
bool | IsInputDisabledWhenFocusIsLost ()
void | SetStandardSortMethod (bool enable=true)
bool | StandardSortMethod () const
void | SetStopSoundsOnStartup (bool enable=true)
bool | StopSoundsOnStartup () const
void | SetOpenGLFOV (float oglFOV_)
float | GetOpenGLFOV () const
void | SetOpenGLZNear (float oglZNear_)
float | GetOpenGLZNear () const
void | SetOpenGLZFar (float oglZFar_)
float | GetOpenGLZFar () const
Saving and loading
Members functions related to saving and loading the object.
void | SaveToXml (TiXmlElement *element) const
void | LoadFromXml (gd::Project &project, const TiXmlElement *element)
Events compilation and bitcode management

Members functions related to managing the compilation of events and the resulting bitcodes.

See Also
  CodeCompilationHelpers

void | SetCompilationNeeded ()
void | SetCompilationNotNeeded ()
bool | CompilationNeeded ()
const std::string & | GetCompiledEventsFile () const
void | SetCompiledEventsFile (const std::string &file)
Changes notification
Members functions used to notify the editor ( mainly SceneEditorCanvas ) that changes have been made and that refreshing should be made.
bool | RefreshNeeded () const
void | SetRefreshNeeded ()
void | SetRefreshNotNeeded ()
Public Member Functions inherited from gd::ClassWithObjects
| ClassWithObjects ()
| Default constructor creating a container without any objects.
bool | HasObjectNamed (const std::string &name) const
| Return true if object called name exists.
Object & | GetObject (const std::string &name)
| Return a reference to the object called name.
const gd::Object & | GetObject (const std::string &name) const
| Return a reference to the object called name.
Object & | GetObject (unsigned int index)
| Return a reference to the object at position index in the objects list.
const gd::Object & | GetObject (unsigned int index) const
| Return a reference to the object at position index in the objects list.
unsigned int | GetObjectPosition (const std::string &name) const
| Return the position of the object called name in the objects list. More...
unsigned int | GetObjectsCount () const
| Return the number of object.
void | InsertNewObject (gd::Project &project, const std::string &objectType, const std::string &name, unsigned int position)
| Add a new empty object of type objectType called name at the specified position in the layout list. More...
void | InsertObject (const gd::Object &object, unsigned int position)
| Must add a new object constructed from the layout passed as parameter. More...
void | RemoveObject (const std::string &name)
| Delete an object. More...
void | SwapObjects (unsigned int firstObjectIndex, unsigned int secondObjectIndex)
| Swap the position of the specified objects.
std::vector< boost::shared_ptr < gd::Object > > & | GetObjects ()
const std::vector < boost::shared_ptr < gd::Object > > & | GetObjects () const
void | SaveObjectsToXml (TiXmlElement *element) const
| Save the objects to xml.
void | LoadObjectsFromXml (gd::Project &project, const TiXmlElement *element)
| Load the objects from xml.

## Public Attributes

std::map< std::string, boost::shared_ptr < gd::AutomatismsSharedData > > | automatismsInitialSharedDatas
| Initial shared datas of automatisms.

## Additional Inherited Members

Protected Attributes inherited from gd::ClassWithObjects
std::vector< boost::shared_ptr < gd::Object > > | initialObjects
| Objects contained.

## Detailed Description

Represent a layout ( also called a scene ) of a project.

## Member Function Documentation

Layout* gd::Layout::Clone | ( | ) |  | const

inline

Must return a pointer to a copy of the layout. A such method is needed as the IDE may want to store copies of some layouts and so need a way to do polymorphic copies.

Typical implementation example:

return new MyLayout(*this);

bool gd::Layout::CompilationNeeded | ( | ) |  |

inline

Return true if a compilation is needed. This method is usually called by SceneEditorCanvas when (re)loading a scene so as to know if it should launch compilation.

void gd::Layout::DisableInputWhenFocusIsLost | ( | bool | disable = `true`) |  |

inline

Set if the input must be disabled when window lost focus.

const gd::LayoutEditorCanvasOptions& gd::Layout::GetAssociatedLayoutEditorCanvasOptions | ( | ) |  | const

inline

Return the settings associated to the layout.

See Also
  gd::LayoutEditorCanvasOptions

gd::LayoutEditorCanvasOptions& gd::Layout::GetAssociatedLayoutEditorCanvasOptions | ( | ) |  |

inline

Return the settings associated to the layout.

See Also
  gd::LayoutEditorCanvasOptions

unsigned int gd::Layout::GetBackgroundColorBlue | ( | ) |  | const

inline

Get the background color blue component

unsigned int gd::Layout::GetBackgroundColorGreen | ( | ) |  | const

inline

Get the background color green component

unsigned int gd::Layout::GetBackgroundColorRed | ( | ) |  | const

inline

Get the background color red component

const std::vector<boost::shared_ptr<gd::BaseEvent> >& gd::Layout::GetEvents | ( | ) |  | const

inline

Get the events of the layout

std::vector<boost::shared_ptr<gd::BaseEvent> >& gd::Layout::GetEvents | ( | ) |  |

inline

Get the events of the layout

const gd::InitialInstancesContainer& gd::Layout::GetInitialInstances | ( | ) |  | const

inline

Return the container storing initial instances.

gd::InitialInstancesContainer& gd::Layout::GetInitialInstances | ( | ) |  |

inline

Return the container storing initial instances.

gd::Layer & gd::Layout::GetLayer | ( | const std::string & | name) |  |

Must return a reference to the layer called "name".

const gd::Layer & gd::Layout::GetLayer | ( | const std::string & | name) |  | const

Must return a reference to the layer called "name".

gd::Layer & gd::Layout::GetLayer | ( | unsigned int | index) |  |

Must return a reference to the layer at position "index" in the layers list

const gd::Layer & gd::Layout::GetLayer | ( | unsigned int | index) |  | const

Must return a reference to the layer at position "index" in the layers list

unsigned int gd::Layout::GetLayerPosition | ( | const std::string & | name) |  | const

Must return the position of the layer called "name" in the layers list

unsigned int gd::Layout::GetLayersCount | ( | ) |  | const

Must return the number of layers.

const std::string& gd::Layout::GetMangledName | ( | ) |  | const

inline

Return the name of the layout mangled by SceneNameMangler.

const std::string& gd::Layout::GetName | ( | ) |  | const

inline

Return the name of the layout.

std::vector<ObjectGroup>& gd::Layout::GetObjectGroups | ( | ) |  |

inline

Return a reference to the vector containing the layout's objects groups.

const std::vector<ObjectGroup>& gd::Layout::GetObjectGroups | ( | ) |  | const

inline

Return a const reference to the vector containing the layout's objects groups.

float gd::Layout::GetOpenGLFOV | ( | ) |  | const

inline

Get OpenGL default field of view

float gd::Layout::GetOpenGLZFar | ( | ) |  | const

inline

Get OpenGL far clipping plan

float gd::Layout::GetOpenGLZNear | ( | ) |  | const

inline

Get OpenGL near clipping plan

BaseProfiler* gd::Layout::GetProfiler | ( | ) |  | const

inline

Get the profiler associated with the scene. Can be NULL.

const gd::VariablesContainer& gd::Layout::GetVariables | ( | ) |  | const

inline

Provide access to the gd::VariablesContainer member containing the layout variables

See Also
  gd::VariablesContainer

gd::VariablesContainer& gd::Layout::GetVariables | ( | ) |  |

inline

Provide access to the gd::VariablesContainer member containing the layout variables

See Also
  gd::VariablesContainer

const std::string& gd::Layout::GetWindowDefaultTitle | ( | ) |  | const

inline

Get scene window default title

bool gd::Layout::HasLayerNamed | ( | const std::string & | name) |  | const

Must return true if the layer called "name" exists.

void gd::Layout::InsertLayer | ( | const Layer & | theLayer,
|  | unsigned int | position
| ) |  |

Must add a new the layer constructed from the layout passed as parameter.

Note
  No pointer or reference must be kept on the layer passed as parameter.

Parameters

  theLayer | The the layer that must be copied and inserted into the project
  position | Insertion position. Even if the position is invalid, the layer must be inserted at the end of the layers list.

void gd::Layout::InsertNewLayer | ( | const std::string & | name,
|  | unsigned int | position
| ) |  |

Must add a new empty the layer sheet called "name" at the specified position in the layout list.

bool gd::Layout::IsInputDisabledWhenFocusIsLost | ( | ) |  |

inline

Return true if the input must be disabled when window lost focus.

void gd::Layout::LoadFromXml | ( | gd::Project & | project,
|  | const TiXmlElement * | element
| ) |  |

Called to load the layout from a TiXmlElement.

bool gd::Layout::RefreshNeeded | ( | ) |  | const

inline

Return true if important changes have been made and so the editors must reload the scene. ( Important changes may refers to objects modified, properties updated, objects groups modified, variables modified )

void gd::Layout::RemoveLayer | ( | const std::string & | name) |  |

Must delete the layer named "name".

void gd::Layout::SaveToXml | ( | TiXmlElement * | element) |  | const

Called to save the layout to a TiXmlElement.

void gd::Layout::SetBackgroundColor | ( | unsigned int | r,
|  | unsigned int | g,
|  | unsigned int | b
| ) |  |

inline

Set the background color

void gd::Layout::SetCompilationNeeded | ( | ) |  |

inline

Set that the events need to be compiled.

Note
  The compilation is not launched at this time. It will for example occur when triggered by SceneEditorCanvas or if you manually add a task to the code compiler ( see CodeCompilationHelpers ).

See Also
  ChangesNotifier
  CodeCompilationHelpers

void gd::Layout::SetCompilationNotNeeded | ( | ) |  |

inline

Must be called when compilation of events is over and so events are not considered "modified" anymore.

void gd::Layout::SetName | ( | const std::string & | name_) |  |

Change the name of the layout with the name passed as parameter.

void gd::Layout::SetOpenGLFOV | ( | float | oglFOV_) |  |

inline

Set OpenGL default field of view

void gd::Layout::SetOpenGLZFar | ( | float | oglZFar_) |  |

inline

Set OpenGL far clipping plan

void gd::Layout::SetOpenGLZNear | ( | float | oglZNear_) |  |

inline

Set OpenGL near clipping plan

void gd::Layout::SetProfiler | ( | BaseProfiler * | profiler_) |  |

inline

Set the profiler associated with the scene. Can be NULL.

void gd::Layout::SetRefreshNeeded | ( | ) |  |

inline

Must be called when some important changes have been made and so the editors must reload the scene

See Also
  Scene::RefreshNeeded

void gd::Layout::SetRefreshNotNeeded | ( | ) |  |

inline

Must be called when the editor ( i.e: SceneEditorCanvas ) managing the scene has reloaded it.

void gd::Layout::SetStandardSortMethod | ( | bool | enable = `true`) |  |

inline

Set if the objects z-order are sorted using the standard method

void gd::Layout::SetStopSoundsOnStartup | ( | bool | enable = `true`) |  |

inline

Set if the scene must stop all the sounds being played when it is launched.

void gd::Layout::SetWindowDefaultTitle | ( | const std::string & | title_) |  |

inline

Set scene window default title

bool gd::Layout::StandardSortMethod | ( | ) |  | const

inline

Return true if the objects z-order are sorted using the standard method

bool gd::Layout::StopSoundsOnStartup | ( | ) |  | const

inline

Return true if the scene must stop all the sounds being played when it is launched

void gd::Layout::SwapLayers | ( | unsigned int | firstLayerIndex,
|  | unsigned int | secondLayerIndex
| ) |  |

Must swap the position of the specified layers.

void gd::Layout::UpdateAutomatismsSharedData | ( | gd::Project & | project) |  |

Make sure that the scene had an instance of shared data for every automatism of every object that can be used on the scene ( i.e. the objects of the scene and the global objects )

Must be called when an automatism have been added/deleted or when a scene have been added to a project.

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

- Layout.h
- Layout.cpp