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>

Public Member Functions

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

Static Public Member Functions

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

Protected Member Functions

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

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

◆ wxSFAutoLayout()

wxSFAutoLayout::wxSFAutoLayout ( )

Constructor.

◆ ~wxSFAutoLayout()

wxSFAutoLayout::~wxSFAutoLayout ( )

Destructor.

Member Function Documentation

◆ CleanUp()

static void wxSFAutoLayout::CleanUp ( )
static

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

◆ GetAlgorithm()

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

◆ GetRegisteredAlgorithms()

wxArrayString wxSFAutoLayout::GetRegisteredAlgorithms ( )

Get string list containing names of registered layouting algorithms.

Returns
List of registered algorithm names.

◆ InitializeAllAlgorithms()

void wxSFAutoLayout::InitializeAllAlgorithms ( )
protected

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

◆ Layout() [1/3]

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

Layout shapes included in given list.

Parameters
shapesList of shapes
algnameAlgorithm name

◆ Layout() [2/3]

void wxSFAutoLayout::Layout ( wxSFDiagramManager manager,
const wxString &  algname 
)

Layout shapes included in given diagram manager.

Parameters
managerReference to diagram manager
algnameAlgorithm name

◆ Layout() [3/3]

void wxSFAutoLayout::Layout ( wxSFShapeCanvas canvas,
const wxString &  algname 
)

Layout shapes included in given shape canvas.

Parameters
canvasPointer to shape canvas
algname

◆ RegisterLayoutAlgorithm()

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

◆ UpdateCanvas()

void wxSFAutoLayout::UpdateCanvas ( wxSFShapeCanvas canvas)
protected

Update given shape canvas.

Parameters
canvas

Member Data Documentation

◆ m_mapAlgorithms

LayoutAlgoritmMap wxSFAutoLayout::m_mapAlgorithms
staticprotected

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