UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ZqbPixGrpManager Class Reference

#include <zqb_pixgrpmanager.hpp>

Inheritance diagram for ZqbPixGrpManager:
ZqbAutoName ZqbAutoName ZqbName ZqbName ZqbName ZqbName

Public Member Functions

 ZqbPixGrpManager (const char *szName=NULL)
 
ZqbPixGroupgroup (const char *szGrpName)
 
ZqbPixGroupoperator[] (const char *szGrpName)
 
bool known (const char *szGrpName) const
 
void resetGroupsOrder ()
 
void resetGroupsWeight ()
 
void setGroupsWeight (const char *szParent, const char *szGrpName1,...)
 
void setGroupsOrder (const char *szParent, const char *szGrpName1,...)
 
int placeGroups (int iStart, int iSize)
 
void setSpace (int iSpace)
 
int getSpace () const
 
void setMargin (int iMargin)
 
int getMargin () const
 
 ZqbPixGrpManager (const char *szName=NULL)
 
ZqbPixGroupgroup (const char *szGrpName)
 
ZqbPixGroupoperator[] (const char *szGrpName)
 
bool known (const char *szGrpName) const
 
void resetGroupsOrder ()
 
void resetGroupsWeight ()
 
void setGroupsWeight (const char *szParent, const char *szGrpName1,...)
 
void setGroupsOrder (const char *szParent, const char *szGrpName1,...)
 
void setGroupsOrder (const char *szParent, std::vector< std::string > grpNames)
 
int placeGroups (int iStart, int iSize)
 
void setSpace (int iSpace)
 
int getSpace () const
 
void setMargin (int iMargin)
 
int getMargin () const
 
- Public Member Functions inherited from ZqbAutoName
 ZqbAutoName (int *pCounter, const char *szRoot, const char *szCustomName=NULL)
 
virtual ~ZqbAutoName ()
 
 ZqbAutoName (int *pCounter, const char *szRoot, const char *szCustomName=NULL)
 
virtual ~ZqbAutoName ()
 
- Public Member Functions inherited from ZqbName
 ZqbName (const char *szRoot, const char *szCustomName=NULL)
 
 ZqbName (const ZqbName &name)
 
virtual ~ZqbName ()
 
ZqbNameoperator= (const ZqbName &name)
 
virtual const char * getName () const
 
virtual const char * getType () const
 
bool hasName (const char *szString) const
 
 ZqbName (const char *szRoot, const char *szCustomName=NULL)
 
 ZqbName (const ZqbName &name)
 
virtual ~ZqbName ()
 
ZqbNameoperator= (const ZqbName &name)
 
virtual const char * getName () const
 
virtual const char * getType () const
 
bool hasName (const char *szString) const
 

Protected Member Functions

int propPlacement (const ZqbPixGroupsOrder &rGroups, int iStart, int iSize, int iSpace, int iMargin)
 
int placeGroups (const char *szParent, const ZqbPixGroupsOrder &rGroups, int iStart, int iSize, int iSpace, int iMargin)
 
void filterGroups (const char *szFilter, const ZqbPixGroupsOrder &rAllGroups, ZqbPixGroupsOrder *pFilteredGroups, ZqbPixGroupsOrder *pOtherGroups=NULL)
 
int propPlacement (const ZqbPixGroupsOrder &rGroups, int iStart, int iSize, int iSpace, int iMargin)
 
int placeGroups (const char *szParent, const ZqbPixGroupsOrder &rGroups, int iStart, int iSize, int iSpace, int iMargin)
 
void filterGroups (const char *szFilter, const ZqbPixGroupsOrder &rAllGroups, ZqbPixGroupsOrder *pFilteredGroups, ZqbPixGroupsOrder *pOtherGroups=NULL)
 

Protected Attributes

ZqbPixGroups m_Groups
 
ZqbPixGroupsOrder m_Order
 
int m_iSpace
 
int m_iMargin
 
- Protected Attributes inherited from ZqbName
char * m_szName
 
char * m_szRoot
 

Detailed Description

Class provides container for pixel groups. It allows to manage groups and place them in given pixel coordinate range.

Place of pixel groups is performed in the whole size which is mentioned as the-whole-size-pixel-group (TWSPG). TWSPG is subdivided on sub-ranges regarding next factors:

For deep understanding and program debugging it's possible to define variable ZQBPGM_DEBUG just before running the program. This variable is interpreted as a set of one character flags. Each flag switches on debug messages about particulary placement action:

Constructor & Destructor Documentation

ZqbPixGrpManager::ZqbPixGrpManager ( const char *  szName = NULL)

Create empty pixel group manager.

ZqbPixGrpManager::ZqbPixGrpManager ( const char *  szName = NULL)

Create empty pixel group manager.

Member Function Documentation

void ZqbPixGrpManager::filterGroups ( const char *  szFilter,
const ZqbPixGroupsOrder &  rAllGroups,
ZqbPixGroupsOrder *  pFilteredGroups,
ZqbPixGroupsOrder *  pOtherGroups = NULL 
)
protected

Compose array of groups with the same parent given by szFilter argument. NULL filter means all groups should be mentioned. Optionally rest groups may be composed into another array.

void ZqbPixGrpManager::filterGroups ( const char *  szFilter,
const ZqbPixGroupsOrder &  rAllGroups,
ZqbPixGroupsOrder *  pFilteredGroups,
ZqbPixGroupsOrder *  pOtherGroups = NULL 
)
protected

Compose array of groups with the same parent given by szFilter argument. NULL filter means all groups should be mentioned. Optionally rest groups may be composed into another array.

int ZqbPixGrpManager::getMargin ( ) const

Get number of pixels placed before first and after last group.

int ZqbPixGrpManager::getMargin ( ) const

Get number of pixels placed before first and after last group.

int ZqbPixGrpManager::getSpace ( ) const

Get number of pixels placed between top level children groups.

int ZqbPixGrpManager::getSpace ( ) const

Get number of pixels placed between top level children groups.

ZqbPixGroup* ZqbPixGrpManager::group ( const char *  szGrpName)

Return pointer to pixel group object which is created dynamically if such name is not exist. By default created group has the-whole-size-parent-group "" (TWSPG) and unit weight.

ZqbPixGroup* ZqbPixGrpManager::group ( const char *  szGrpName)

Return pointer to pixel group object which is created dynamically if such name is not exist. By default created group has the-whole-size-parent-group "" (TWSPG) and unit weight.

bool ZqbPixGrpManager::known ( const char *  szGrpName) const

Return true if group is registered in the manager and false otherwise.

bool ZqbPixGrpManager::known ( const char *  szGrpName) const

Return true if group is registered in the manager and false otherwise.

ZqbPixGroup* ZqbPixGrpManager::operator[] ( const char *  szGrpName)
inline

Shortcut for group().

ZqbPixGroup* ZqbPixGrpManager::operator[] ( const char *  szGrpName)
inline

Shortcut for group().

int ZqbPixGrpManager::placeGroups ( int  iStart,
int  iSize 
)

Calculation of geometry for all groups inside given range of pixels iStart..iStart+iSize-1. Returns 0 in success or negative number of pixels which should be added to place all groups properly.

int ZqbPixGrpManager::placeGroups ( int  iStart,
int  iSize 
)

Calculation of geometry for all groups inside given range of pixels iStart..iStart+iSize-1. Returns 0 in success or negative number of pixels which should be added to place all groups properly.

int ZqbPixGrpManager::placeGroups ( const char *  szParent,
const ZqbPixGroupsOrder &  rGroups,
int  iStart,
int  iSize,
int  iSpace,
int  iMargin 
)
protected

Place groups filtered by common parent. Calls for propPlacement() placement method for brother group placement. The method calls itself in case of some of groups among rGroups don't have the same szParent. Return minimum value among all propPlacement() calls.

int ZqbPixGrpManager::placeGroups ( const char *  szParent,
const ZqbPixGroupsOrder &  rGroups,
int  iStart,
int  iSize,
int  iSpace,
int  iMargin 
)
protected

Place groups filtered by common parent. Calls for propPlacement() placement method for brother group placement. The method calls itself in case of some of groups among rGroups don't have the same szParent. Return minimum value among all propPlacement() calls.

int ZqbPixGrpManager::propPlacement ( const ZqbPixGroupsOrder &  rGroups,
int  iStart,
int  iSize,
int  iSpace,
int  iMargin 
)
protected

Implementation of proportional placement algorithm of pixel groups in given pixel range [iStart,iStart+iSize-1] with given space between groups (iSpace) and margins (iMargin) at the start and at the end of target pixel range. Returns number of free pixels. If this value is negative then not all groups are placed properly.

int ZqbPixGrpManager::propPlacement ( const ZqbPixGroupsOrder &  rGroups,
int  iStart,
int  iSize,
int  iSpace,
int  iMargin 
)
protected

Implementation of proportional placement algorithm of pixel groups in given pixel range [iStart,iStart+iSize-1] with given space between groups (iSpace) and margins (iMargin) at the start and at the end of target pixel range. Returns number of free pixels. If this value is negative then not all groups are placed properly.

void ZqbPixGrpManager::resetGroupsOrder ( )

Remove all order relations between groups. This means all groups will obtain the same TWSPG as a parent.

void ZqbPixGrpManager::resetGroupsOrder ( )

Remove all order relations between groups. This means all groups will obtain the same TWSPG as a parent.

void ZqbPixGrpManager::resetGroupsWeight ( )

Remove all order relations between groups and assign 1.0 as their weights. This means all groups will obtain the same TWSPG as a parent. All groups will be affected, not only included in order list.

void ZqbPixGrpManager::resetGroupsWeight ( )

Remove all order relations between groups and assign 1.0 as their weights. This means all groups will obtain the same TWSPG as a parent. All groups will be affected, not only included in order list.

void ZqbPixGrpManager::setGroupsOrder ( const char *  szParent,
const char *  szGrpName1,
  ... 
)

Add several groups as related with the common parent one. Order of groups is important because it defines the order of regions on the screen. Weights are not changed.

void ZqbPixGrpManager::setGroupsOrder ( const char *  szParent,
const char *  szGrpName1,
  ... 
)

Add several groups as related with the common parent one. Order of groups is important because it defines the order of regions on the screen. Weights are not changed.

void ZqbPixGrpManager::setGroupsOrder ( const char *  szParent,
std::vector< std::string >  grpNames 
)

Add several groups as related with the common parent one. Order of groups is important because it defines the order of regions on the screen. Weights are not changed.

void ZqbPixGrpManager::setGroupsWeight ( const char *  szParent,
const char *  szGrpName1,
  ... 
)

Add several groups with weights as related with the common parent one. Order of groups is important because it defines the order of regions on the screen.

Example: setGroupsWeight("", "group1", 1.0, "group2", 2.0, NULL); Meaning: group2 elapses twice more space than group1.

void ZqbPixGrpManager::setGroupsWeight ( const char *  szParent,
const char *  szGrpName1,
  ... 
)

Add several groups with weights as related with the common parent one. Order of groups is important because it defines the order of regions on the screen.

Example: setGroupsWeight("", "group1", 1.0, "group2", 2.0, NULL); Meaning: group2 elapses twice more space than group1.

void ZqbPixGrpManager::setMargin ( int  iMargin)

Assign number of pixels placed before first and after last group.

void ZqbPixGrpManager::setMargin ( int  iMargin)

Assign number of pixels placed before first and after last group.

void ZqbPixGrpManager::setSpace ( int  iSpace)

Assign number of pixels placed between top level children groups.

void ZqbPixGrpManager::setSpace ( int  iSpace)

Assign number of pixels placed between top level children groups.

Member Data Documentation

ZqbPixGroups ZqbPixGrpManager::m_Groups
protected

Associative array of pixel groups.

int ZqbPixGrpManager::m_iMargin
protected

Margin around groups on top level.

int ZqbPixGrpManager::m_iSpace
protected

Space between groups on top level.

ZqbPixGroupsOrder ZqbPixGrpManager::m_Order
protected

The array lists groups in their order from less coordinate to greater one. In conjunction with relations between groups, group weights and hints its possible to place groups.


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