Classes | Namespaces | Typedefs | Enumerator | Functions | Variables

Layout API
[Geometry Libraries]

This is an extremely primitive API for performing basic object layout. More...

Collaboration diagram for Layout API:


struct  layout::layout_info_t
struct  layout::object_t


namespace  layout


typedef std::vector< object_t > layout::vec_obj_t


void layout::layout_info_t::clear (void) throw ()
void layout::object_t::clear (void) throw ()
void layout::performLayout (const layout_info_t &info,vec_obj_t &objects)
 the only function in the 2D layout library!


eLayoutType layout::layout_info_t::type
float layout::layout_info_t::spacing
std::string layout::object_t::id
float layout::object_t::width
float layout::object_t::height
float layout::object_t::x
float layout::object_t::y

Detailed Description

This is an extremely primitive API for performing basic object layout.

I only have 2D layouts for now and have no plans for higher dimensions :)

This isn't much code but felt better abstracted to a general library rather than put in the application.

Typedef Documentation

typedef std::vector<object_t> layout::vec_obj_t

Definition at line 95 of file layout_2d.h.

Function Documentation

void layout::layout_info_t::clear ( void   )  throw () [inline, inherited]

Definition at line 68 of file layout_2d.h.

void layout::object_t::clear ( void   )  throw () [inline, inherited]

Definition at line 82 of file layout_2d.h.

void layout::performLayout ( const layout_info_t &  info,
vec_obj_t &  objects 

the only function in the 2D layout library!

Given the layout instructions (layout_info_t object), and the list of objects to be laid out (vec_obj_t vector), this routine calculates the proper position for each object.

  • On input, each object_t in the vector must have id, width and height set.
  • On output, each object_t will be provided with x/y coordinates.

Variable Documentation

eLayoutType layout::layout_info_t::type [inherited]

Definition at line 74 of file layout_2d.h.

float layout::layout_info_t::spacing [inherited]

Definition at line 75 of file layout_2d.h.

std::string layout::object_t::id [inherited]

Definition at line 88 of file layout_2d.h.

float layout::object_t::width [inherited]

Definition at line 89 of file layout_2d.h.

float layout::object_t::height [inherited]

Definition at line 90 of file layout_2d.h.

float layout::object_t::x [inherited]

Definition at line 91 of file layout_2d.h.

float layout::object_t::y [inherited]

Definition at line 92 of file layout_2d.h.