wxShapeFramework  1.13.0 beta
wxSFAutoLayout Class Reference

Class implements automatic diagram layout. The class allows to automatically layout shapes included in diagram manager/shape canvas/list of shapes by using several pre-defined layouting algorithms. The class should be used as it is. More...

#include <AutoLayout.h>

List of all members.

Public Member Functions

 wxSFAutoLayout ()
 Constructor.
 ~wxSFAutoLayout ()
 Destructor.
void Layout (ShapeList &shapes, const wxString &algname)
 Layout shapes included in given list.
void Layout (wxSFDiagramManager &manager, const wxString &algname)
 Layout shapes included in given diagram manager.
void Layout (wxSFShapeCanvas *canvas, const wxString &algname)
 Layout shapes included in given shape canvas.
wxArrayString GetRegisteredAlgorithms ()
 Get string list containing names of registered layouting algorithms.
wxSFLayoutAlgorithmGetAlgorithm (const wxString &algname)
 Get pointer to registered layouting algorithm.

Static Public Member Functions

static bool RegisterLayoutAlgorithm (const wxString &algname, wxSFLayoutAlgorithm *alg)
 Register custom layouting algorithm (class derived from wxSFLayoutAlgorithm).
static void CleanUp ()
 Clean up registered layouting algorithms. Must be called at application deinitialization if wxSFAutoLayout were used in the program.

Protected Member Functions

void InitializeAllAlgorithms ()
 Register all pre-defined layouting algorithms. The function is called from wxSFAutoLayout class constructor.
void UpdateCanvas (wxSFShapeCanvas *canvas)
 Update given shape canvas.

Static Protected Attributes

static LayoutAlgoritmMap m_mapAlgorithms

Detailed Description

Class implements automatic diagram layout. The class allows to automatically layout shapes included in diagram manager/shape canvas/list of shapes by using several pre-defined layouting algorithms. The class should be used as it is.


Constructor & Destructor Documentation


Member Function Documentation

static void wxSFAutoLayout::CleanUp ( ) [static]

Clean up registered layouting algorithms. Must be called at application deinitialization if wxSFAutoLayout were used in the program.

wxSFLayoutAlgorithm* wxSFAutoLayout::GetAlgorithm ( const wxString &  algname) [inline]

Get pointer to registered layouting algorithm.

Parameters:
algnameAlgorithm name
Returns:
Pointer to class encapsulating selected layouting algorithm if registered, otherwise NULL

Get string list containing names of registered layouting algorithms.

Returns:
List of registered algorithm names.

Register all pre-defined layouting algorithms. The function is called from wxSFAutoLayout class constructor.

void wxSFAutoLayout::Layout ( ShapeList &  shapes,
const wxString &  algname 
)

Layout shapes included in given list.

Parameters:
shapesList of shapes
algnameAlgorithm name
void wxSFAutoLayout::Layout ( wxSFDiagramManager manager,
const wxString &  algname 
)

Layout shapes included in given diagram manager.

Parameters:
managerReference to diagram manager
algnameAlgorithm name
void wxSFAutoLayout::Layout ( wxSFShapeCanvas canvas,
const wxString &  algname 
)

Layout shapes included in given shape canvas.

Parameters:
canvasPointer to shape canvas
algname
static bool wxSFAutoLayout::RegisterLayoutAlgorithm ( const wxString &  algname,
wxSFLayoutAlgorithm alg 
) [static]

Register custom layouting algorithm (class derived from wxSFLayoutAlgorithm).

Parameters:
algnameAlgorithm name
algPointer to class encapsulating the layouting algorithm
Returns:
TRUE if the algorithm was successfuly registered, otherwise FALSE
void wxSFAutoLayout::UpdateCanvas ( wxSFShapeCanvas canvas) [protected]

Update given shape canvas.

Parameters:
canvas

Member Data Documentation

LayoutAlgoritmMap wxSFAutoLayout::m_mapAlgorithms [static, protected]

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