UNIVERS
15.3
UNIVERS base processing software API
|
#include <zqb_pixgrpmanager.hpp>
Public Member Functions | |
ZqbPixGrpManager (const char *szName=NULL) | |
ZqbPixGroup * | group (const char *szGrpName) |
ZqbPixGroup * | operator[] (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) | |
ZqbPixGroup * | group (const char *szGrpName) |
ZqbPixGroup * | operator[] (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 () |
ZqbName & | operator= (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 () |
ZqbName & | operator= (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 |
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:
ZqbPixGrpManager::ZqbPixGrpManager | ( | const char * | szName = NULL | ) |
Create empty pixel group manager.
ZqbPixGrpManager::ZqbPixGrpManager | ( | const char * | szName = NULL | ) |
Create empty pixel group manager.
|
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.
|
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.
|
inline |
Shortcut for group().
|
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.
|
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.
|
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.
|
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.
|
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.
|
protected |
Associative array of pixel groups.
|
protected |
Margin around groups on top level.
|
protected |
Space between groups on top level.
|
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.