Public Types | Public Member Functions | Protected Member Functions

cyber::editor::modes::EditingMode Class Reference

#include <EditingMode.h>

Inheritance diagram for cyber::editor::modes::EditingMode:
cyber::editor::modes::FreeLook cyber::editor::modes::PolyEditingMode cyber::editor::modes::AmbientLights cyber::editor::modes::FixedBlocks

List of all members.

Public Types

enum  ModeKey { NONE = 0, FREE_LOOK = 1, FIXED_BLOCKS = 2, AMBIENT_LIGHTS = 3 }

Public Member Functions

 EditingMode (ModeKey key)
virtual ~EditingMode (void)
ModeKey get_mode_key () const
bool is_active () const
renderer::ConfigRepositoryget_cfg () const
commands::CommandProcessorget_cmds () const
world::ResourceManagerget_rm () const
world::WorldDescget_world_desc () const
Selectionget_selection () const
fl7::Shellget_shell () const
bool activate (renderer::ConfigRepository *cfg, commands::CommandProcessor *cmds, world::WorldDesc *world_desc, Selection *selection, fl7::Shell *shell)
bool deactivate ()
bool perform (float time)
bool render (float time)

Protected Member Functions

virtual bool _activate ()=0
virtual bool _deactivate ()=0
virtual bool _perform (float time)=0
virtual bool _render (float time)=0
ml7::Vector2 mouse2world () const
ml7::Vector3 mouse3world () const
ml7::Vector2 snap2grid (const ml7::Vector2 &p)
ml7::Vector3 snap3grid (const ml7::Vector3 &p)

Detailed Description

The abstract base class to substantiate different editing modes.


Member Enumeration Documentation

Enumerator:
NONE 
FREE_LOOK 
FIXED_BLOCKS 
AMBIENT_LIGHTS 

Constructor & Destructor Documentation

cyber::editor::modes::EditingMode::EditingMode ( ModeKey  key  ) 

Explicit constructor.

cyber::editor::modes::EditingMode::~EditingMode ( void   )  [virtual]

Destructor.


Member Function Documentation

virtual bool cyber::editor::modes::EditingMode::_activate (  )  [protected, pure virtual]
virtual bool cyber::editor::modes::EditingMode::_deactivate (  )  [protected, pure virtual]
virtual bool cyber::editor::modes::EditingMode::_perform ( float  time  )  [protected, pure virtual]
virtual bool cyber::editor::modes::EditingMode::_render ( float  time  )  [protected, pure virtual]
bool cyber::editor::modes::EditingMode::activate ( renderer::ConfigRepository cfg,
commands::CommandProcessor cmds,
world::WorldDesc world_desc,
Selection selection,
fl7::Shell shell 
)

Activates this editing mode.

bool cyber::editor::modes::EditingMode::deactivate (  ) 

Deactivates this editing mode.

renderer::ConfigRepository* cyber::editor::modes::EditingMode::get_cfg (  )  const [inline]

Returns the config structure.

commands::CommandProcessor* cyber::editor::modes::EditingMode::get_cmds (  )  const [inline]

Returns the editing command processor.

ModeKey cyber::editor::modes::EditingMode::get_mode_key (  )  const [inline]

Returns the editing mode key.

world::ResourceManager* cyber::editor::modes::EditingMode::get_rm (  )  const [inline]

Returns the resource manager.

Selection* cyber::editor::modes::EditingMode::get_selection (  )  const [inline]

Returns the currently selected object descriptions.

fl7::Shell* cyber::editor::modes::EditingMode::get_shell (  )  const [inline]

Returns the shell for user interaction.

world::WorldDesc* cyber::editor::modes::EditingMode::get_world_desc (  )  const [inline]

Returns the world description to edit.

bool cyber::editor::modes::EditingMode::is_active (  )  const [inline]

Returns the flag specifying whether this editing mode is currently active.

ml7::Vector2 cyber::editor::modes::EditingMode::mouse2world (  )  const [protected]

Transforms the current mouse position into 2d-world-space.

ml7::Vector3 cyber::editor::modes::EditingMode::mouse3world (  )  const [protected]

Transforms the current mouse position into 3d-world-space.

bool cyber::editor::modes::EditingMode::perform ( float  time  ) 

Performs editing actions.

bool cyber::editor::modes::EditingMode::render ( float  time  ) 

Draws mode specific editing tools.

ml7::Vector2 cyber::editor::modes::EditingMode::snap2grid ( const ml7::Vector2 p  )  [protected]

Lets the given 2d-coordinate in world-space snap to the grid.

ml7::Vector3 cyber::editor::modes::EditingMode::snap3grid ( const ml7::Vector3 p  )  [protected]

Lets the given 3d-coordinate in world-space snap to the grid.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines