studio::Duckmatic Class Reference

#include <duckmatic.h>

Inheritance diagram for studio::Duckmatic:

studio::WorkArea

List of all members.

Public Types

typedef std::map< synfig::GUID,
etl::smart_ptr< synfig::Point > > 
DuckDataMap
typedef studio::DuckMap DuckMap
typedef studio::Duck Duck
typedef Duck::Type Type
typedef std::list< float > GuideList

Public Member Functions

 Duckmatic ()
virtual ~Duckmatic ()
sigc::signal< void > & signal_duck_selection_changed ()
sigc::signal< void > & signal_strokes_changed ()
sigc::signal< void > & signal_grid_changed ()
sigc::signal< void > & signal_sketch_saved ()
GuideListget_guide_list_x ()
GuideListget_guide_list_y ()
const GuideListget_guide_list_x () const
const GuideListget_guide_list_y () const
void set_guide_snap (bool x=true)
bool get_guide_snap () const
void toggle_guide_snap ()
void set_grid_snap (bool x=true)
 Sets the state of the grid snap flag.
bool get_grid_snap () const
 Gets the state of the grid snap flag.
void enable_grid_snap ()
void disable_grid_snap ()
void toggle_grid_snap ()
synfig::Point snap_point_to_grid (const synfig::Point &x, float radius=0.1) const
bool get_show_persistent_strokes () const
void set_show_persistent_strokes (bool x)
void set_grid_size (const synfig::Vector &s)
 Sets the size of the grid.
const synfig::Vector & get_grid_size () const
 Returns the size of the grid.
const synfig::Time & get_time () const
bool get_axis_lock () const
void set_axis_lock (bool x)
void set_time (synfig::Time x)
bool is_duck_group_selectable (const etl::handle< Duck > &x) const
DuckList get_duck_list () const
const std::list< etl::handle
< Bezier > > & 
bezier_list () const
const std::list< etl::handle
< Stroke > > & 
stroke_list () const
const std::list< etl::handle
< Stroke > > & 
persistent_stroke_list () const
std::list< etl::handle< Stroke > > & persistent_stroke_list ()
etl::handle< Duckget_selected_duck () const
DuckList get_selected_ducks () const
bool duck_is_selected (const etl::handle< Duck > &duck) const
 Returns true if the given duck is currently selected.
void refresh_selected_ducks ()
void clear_selected_ducks ()
int count_selected_ducks () const
void toggle_select_duck (const etl::handle< Duck > &duck)
void select_duck (const etl::handle< Duck > &duck)
void toggle_select_ducks_in_box (const synfig::Vector &tl, const synfig::Vector &br)
void select_ducks_in_box (const synfig::Vector &tl, const synfig::Vector &br)
void unselect_duck (const etl::handle< Duck > &duck)
void start_duck_drag (const synfig::Vector &offset)
void translate_selected_ducks (const synfig::Vector &vector)
bool end_duck_drag ()
void signal_edited_selected_ducks ()
void signal_user_click_selected_ducks (int button)
etl::handle< Duckfind_similar_duck (etl::handle< Duck > duck)
etl::handle< Duckadd_similar_duck (etl::handle< Duck > duck)
void add_stroke (etl::smart_ptr< std::list< synfig::Point > > stroke_point_list, const synfig::Color &color=synfig::Color(0, 0, 0))
void add_persistent_stroke (etl::smart_ptr< std::list< synfig::Point > > stroke_point_list, const synfig::Color &color=synfig::Color(0, 0, 0))
void clear_persistent_strokes ()
void add_duck (const etl::handle< Duck > &duck)
void add_bezier (const etl::handle< Bezier > &bezier)
void erase_duck (const etl::handle< Duck > &duck)
void erase_bezier (const etl::handle< Bezier > &bezier)
etl::handle< Ducklast_duck () const
 Returns the last duck added.
etl::handle< Bezierlast_bezier () const
etl::handle< Duckfind_duck (synfig::Point pos, synfig::Real radius=0, Duck::Type type=Duck::TYPE_DEFAULT)
GuideList::iterator find_guide_x (synfig::Point pos, float radius=0.1)
GuideList::iterator find_guide_y (synfig::Point pos, float radius=0.1)
GuideList::const_iterator find_guide_x (synfig::Point pos, float radius=0.1) const
GuideList::const_iterator find_guide_y (synfig::Point pos, float radius=0.1) const
etl::handle< Bezierfind_bezier (synfig::Point pos, synfig::Real radius=0, float *location=0)
etl::handle< Bezierfind_bezier (synfig::Point pos, synfig::Real scale, synfig::Real radius, float *location=0)
bool add_to_ducks (const synfigapp::ValueDesc &value_desc, etl::handle< CanvasView > canvas_view, const synfig::TransformStack &transform_stack_, synfig::ParamDesc *param_desc=0, int multiple=0)
void set_type_mask (Type x)
Type get_type_mask () const
void select_all_ducks ()
void unselect_all_ducks ()
void clear_ducks ()
bool save_sketch (const synfig::String &filename) const
bool load_sketch (const synfig::String &filename)
const synfig::String & get_sketch_filename () const
void set_duck_dragger (etl::handle< DuckDrag_Base > x)
etl::handle< DuckDrag_Baseget_duck_dragger () const
void clear_duck_dragger ()

Protected Attributes

etl::handle< Bezierselected_bezier
synfig::Time cur_time
bool grid_snap
 This flag is set if operations should snap to the grid.
bool guide_snap
synfig::Vector grid_size
 This vector describes the grid size.
bool show_persistent_strokes
bool axis_lock

Friends

class DuckDrag_Base
class DuckDrag_Translate
class Push

Classes

struct  Bezier
class  Push
struct  Stroke


Detailed Description

This class helps organize any of the devices displayed in the work area that the user may want to interact with. This includes ducks, beziers, and strokes

Note:
At some point I'll probably rename this class to "DuckOMatic".

Member Typedef Documentation

typedef std::map<synfig::GUID,etl::smart_ptr<synfig::Point> > studio::Duckmatic::DuckDataMap

typedef std::list<float> studio::Duckmatic::GuideList


Constructor & Destructor Documentation

Duckmatic::Duckmatic (  ) 

References axis_lock, and clear_duck_dragger().

Duckmatic::~Duckmatic (  )  [virtual]

References clear_ducks().


Member Function Documentation

sigc::signal<void>& studio::Duckmatic::signal_duck_selection_changed (  )  [inline]

sigc::signal<void>& studio::Duckmatic::signal_strokes_changed (  )  [inline]

sigc::signal<void>& studio::Duckmatic::signal_grid_changed (  )  [inline]

sigc::signal<void>& studio::Duckmatic::signal_sketch_saved (  )  [inline]

GuideList& studio::Duckmatic::get_guide_list_x (  )  [inline]

GuideList& studio::Duckmatic::get_guide_list_y (  )  [inline]

const GuideList& studio::Duckmatic::get_guide_list_x (  )  const [inline]

const GuideList& studio::Duckmatic::get_guide_list_y (  )  const [inline]

void Duckmatic::set_guide_snap ( bool  x = true  ) 

bool studio::Duckmatic::get_guide_snap (  )  const [inline]

void studio::Duckmatic::toggle_guide_snap (  )  [inline]

void Duckmatic::set_grid_snap ( bool  x = true  ) 

Sets the state of the grid snap flag.

References grid_snap, and signal_grid_changed().

Referenced by disable_grid_snap(), enable_grid_snap(), studio::WorkArea::load_meta_data(), and toggle_grid_snap().

bool studio::Duckmatic::get_grid_snap (  )  const [inline]

Gets the state of the grid snap flag.

References grid_snap.

Referenced by studio::WorkArea::save_meta_data(), and snap_point_to_grid().

void studio::Duckmatic::enable_grid_snap (  )  [inline]

References set_grid_snap().

void studio::Duckmatic::disable_grid_snap (  )  [inline]

References set_grid_snap().

void studio::Duckmatic::toggle_grid_snap (  )  [inline]

Reimplemented in studio::WorkArea.

References grid_snap, and set_grid_snap().

Referenced by studio::WorkArea::toggle_grid_snap().

Point Duckmatic::snap_point_to_grid ( const synfig::Point &  x,
float  radius = 0.1 
) const

bool studio::Duckmatic::get_show_persistent_strokes (  )  const [inline]

void Duckmatic::set_show_persistent_strokes ( bool  x  ) 

void Duckmatic::set_grid_size ( const synfig::Vector &  s  ) 

Sets the size of the grid.

Reimplemented in studio::WorkArea.

References grid_size, and signal_grid_changed().

Referenced by studio::WorkArea::set_grid_size().

const synfig::Vector& studio::Duckmatic::get_grid_size (  )  const [inline]

const synfig::Time& studio::Duckmatic::get_time (  )  const [inline]

bool studio::Duckmatic::get_axis_lock (  )  const [inline]

References axis_lock.

void studio::Duckmatic::set_axis_lock ( bool  x  )  [inline]

References axis_lock.

void studio::Duckmatic::set_time ( synfig::Time  x  )  [inline]

References cur_time.

bool Duckmatic::is_duck_group_selectable ( const etl::handle< Duck > &  x  )  const

DuckList Duckmatic::get_duck_list (  )  const

const std::list<etl::handle<Bezier> >& studio::Duckmatic::bezier_list (  )  const [inline]

Referenced by find_bezier().

const std::list<etl::handle<Stroke> >& studio::Duckmatic::stroke_list (  )  const [inline]

const std::list<etl::handle<Stroke> >& studio::Duckmatic::persistent_stroke_list (  )  const [inline]

std::list<etl::handle<Stroke> >& studio::Duckmatic::persistent_stroke_list (  )  [inline]

etl::handle< Duckmatic::Duck > Duckmatic::get_selected_duck (  )  const

Todo:
We should modify this to support multiple selections

DuckList Duckmatic::get_selected_ducks (  )  const

bool Duckmatic::duck_is_selected ( const etl::handle< Duck > &  duck  )  const

Returns true if the given duck is currently selected.

Referenced by toggle_select_duck().

void Duckmatic::refresh_selected_ducks (  ) 

void Duckmatic::clear_selected_ducks (  ) 

int Duckmatic::count_selected_ducks (  )  const

void Duckmatic::toggle_select_duck ( const etl::handle< Duck > &  duck  ) 

void Duckmatic::select_duck ( const etl::handle< Duck > &  duck  ) 

void Duckmatic::toggle_select_ducks_in_box ( const synfig::Vector &  tl,
const synfig::Vector &  br 
)

void Duckmatic::select_ducks_in_box ( const synfig::Vector &  tl,
const synfig::Vector &  br 
)

void Duckmatic::unselect_duck ( const etl::handle< Duck > &  duck  ) 

void Duckmatic::start_duck_drag ( const synfig::Vector &  offset  ) 

References find_duck().

void Duckmatic::translate_selected_ducks ( const synfig::Vector &  vector  ) 

bool Duckmatic::end_duck_drag (  ) 

void Duckmatic::signal_edited_selected_ducks (  ) 

void Duckmatic::signal_user_click_selected_ducks ( int  button  ) 

etl::handle< Duckmatic::Duck > Duckmatic::find_similar_duck ( etl::handle< Duck duck  ) 

Referenced by add_similar_duck().

etl::handle< Duckmatic::Duck > Duckmatic::add_similar_duck ( etl::handle< Duck duck  ) 

References add_duck(), and find_similar_duck().

Referenced by add_to_ducks().

void Duckmatic::add_stroke ( etl::smart_ptr< std::list< synfig::Point > >  stroke_point_list,
const synfig::Color &  color = synfig::Color(0,0,0) 
)

Referenced by add_persistent_stroke().

void Duckmatic::add_persistent_stroke ( etl::smart_ptr< std::list< synfig::Point > >  stroke_point_list,
const synfig::Color &  color = synfig::Color(0,0,0) 
)

References add_stroke().

Referenced by load_sketch().

void Duckmatic::clear_persistent_strokes (  ) 

void Duckmatic::add_duck ( const etl::handle< Duck > &  duck  ) 

void Duckmatic::add_bezier ( const etl::handle< Bezier > &  bezier  ) 

Referenced by add_to_ducks().

void Duckmatic::erase_duck ( const etl::handle< Duck > &  duck  ) 

void Duckmatic::erase_bezier ( const etl::handle< Bezier > &  bezier  ) 

etl::handle< Duckmatic::Duck > Duckmatic::last_duck (  )  const

Returns the last duck added.

Referenced by add_to_ducks().

etl::handle< Duckmatic::Bezier > Duckmatic::last_bezier (  )  const

Referenced by add_to_ducks().

etl::handle< Duckmatic::Duck > Duckmatic::find_duck ( synfig::Point  pos,
synfig::Real  radius = 0,
Duck::Type  type = Duck::TYPE_DEFAULT 
)

Note:
parameter is in canvas coordinates
A radius of "zero" will have an unlimited radius

References get_type_mask(), studio::Duck::TYPE_DEFAULT, studio::Duck::TYPE_RADIUS, studio::Duck::TYPE_TANGENT, and studio::Duck::TYPE_VERTEX.

Referenced by studio::DuckDrag_Translate::begin_duck_drag(), and start_duck_drag().

Duckmatic::GuideList::iterator Duckmatic::find_guide_x ( synfig::Point  pos,
float  radius = 0.1 
)

Referenced by find_guide_x(), and snap_point_to_grid().

Duckmatic::GuideList::iterator Duckmatic::find_guide_y ( synfig::Point  pos,
float  radius = 0.1 
)

Referenced by find_guide_y(), and snap_point_to_grid().

GuideList::const_iterator studio::Duckmatic::find_guide_x ( synfig::Point  pos,
float  radius = 0.1 
) const [inline]

References find_guide_x().

GuideList::const_iterator studio::Duckmatic::find_guide_y ( synfig::Point  pos,
float  radius = 0.1 
) const [inline]

References find_guide_y().

etl::handle< Duckmatic::Bezier > Duckmatic::find_bezier ( synfig::Point  pos,
synfig::Real  radius = 0,
float *  location = 0 
)

Note:
parameter is in canvas coordinates
A radius of "zero" will have an unlimited radius
Note:
parameter is in canvas coordinates
A radius of "zero" will have an unlimited radius

etl::handle< Duckmatic::Bezier > Duckmatic::find_bezier ( synfig::Point  pos,
synfig::Real  scale,
synfig::Real  radius,
float *  location = 0 
)

References bezier_list().

bool Duckmatic::add_to_ducks ( const synfigapp::ValueDesc value_desc,
etl::handle< CanvasView canvas_view,
const synfig::TransformStack &  transform_stack_,
synfig::ParamDesc *  param_desc = 0,
int  multiple = 0 
)

void studio::Duckmatic::set_type_mask ( Type  x  )  [inline]

Todo:
This needs to be documented further.

Type studio::Duckmatic::get_type_mask (  )  const [inline]

void Duckmatic::select_all_ducks (  ) 

void Duckmatic::unselect_all_ducks (  ) 

References unselect_duck().

void Duckmatic::clear_ducks (  ) 

References show_persistent_strokes.

Referenced by ~Duckmatic().

bool Duckmatic::save_sketch ( const synfig::String &  filename  )  const

bool Duckmatic::load_sketch ( const synfig::String &  filename  ) 

const synfig::String& studio::Duckmatic::get_sketch_filename (  )  const [inline]

void studio::Duckmatic::set_duck_dragger ( etl::handle< DuckDrag_Base x  )  [inline]

etl::handle<DuckDrag_Base> studio::Duckmatic::get_duck_dragger (  )  const [inline]

void studio::Duckmatic::clear_duck_dragger (  )  [inline]

References DuckDrag_Translate.

Referenced by Duckmatic().


Friends And Related Function Documentation

friend class DuckDrag_Base [friend]

friend class DuckDrag_Translate [friend]

Referenced by clear_duck_dragger().

friend class Push [friend]


Member Data Documentation

etl::handle<Bezier> studio::Duckmatic::selected_bezier [protected]

synfig::Time studio::Duckmatic::cur_time [protected]

bool studio::Duckmatic::grid_snap [protected]

This flag is set if operations should snap to the grid.

Todo:
perhaps there should be two of these flags, one for each axis?
See also:
show_grid, grid_size

Referenced by get_grid_snap(), set_grid_snap(), and toggle_grid_snap().

synfig::Vector studio::Duckmatic::grid_size [protected]

This vector describes the grid size.

See also:
grid_snap, show_grid

Referenced by get_grid_size(), and set_grid_size().

bool studio::Duckmatic::axis_lock [protected]


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

Generated on Fri Jul 31 00:03:26 2009 for synfig-studio by  doxygen 1.5.6