Envision
A visual programming IDE for object-oriented languages
|
Public Member Functions | |
ModelRenderer () | |
virtual | ~ModelRenderer () |
QPair< int, VisualizationGroup::ItemConstructor > | bestVisualizationForContext (Item *parent, Model::Node *, int purpose=-1, int semanticZoomLevel=-1) |
int | getCoarserSemanticZoomLevel (int currentSemanticZoomLevel) |
int | getFinerSemanticZoomLevel (int currentSemanticZoomLevel) |
bool | hasVisualization (int nodeTypeId, int purpose=0, int semanticZoomLevel=0) |
Returns whether a specific visualization has been registered for nodes of type nodeTypeId and the provided purpose. More... | |
int | numRegisteredPurposes () const |
int | numRegisteredSemanticZoomLevels () const |
int | purposeId (QString name) |
QString | purposeName (int purpose) |
void | registerGroup (int nodeTypeId, int purpose, int semanticZoomLevel, VisualizationGroup *group) |
void | registerGroup (int nodeTypeId, VisualizationGroup *group) |
int | registerSemanticZoomLevel (const QString &name, int orderingNumber) |
void | registerVisualization (int nodeTypeId, int purpose, int semanticZoomLevel, VisualizationGroup::ItemConstructor visualization, int itemTypeId) |
void | registerVisualization (int nodeTypeId, int purpose, VisualizationGroup::ItemConstructor visualization, int itemTypeId) |
void | registerVisualization (int nodeTypeId, QString purpose, QString semanticZoomLevel, VisualizationGroup::ItemConstructor visualization, int itemTypeId) |
void | registerVisualization (int nodeTypeId, QString purpose, VisualizationGroup::ItemConstructor visualization, int itemTypeId) |
void | registerVisualization (int nodeTypeId, VisualizationGroup::ItemConstructor visualization, int itemTypeId) |
int | registerVisualizationPurpose (const QString &name) |
Item * | render (Item *parent, Model::Node *node, int purpose=-1, int semanticZoomLevel=-1) |
Returns an Item which has a parent parent and is a rendering of node. More... | |
int | semanticZoomLevelId (QString name) |
QString | semanticZoomLevelName (int semanticZoomLevel) |
bool | sync (Item *&item, Item *parent, Model::Node *node) |
(Re)renders an item in the context of a parent item. More... | |
Static Public Member Functions | |
static QImage | renderToImage (Model::Node *aNode) |
static void | renderToSVG (Model::Node *aNode, QString path) |
Private Member Functions | |
QPair< int, VisualizationGroup::ItemConstructor > | basicStrategy (Item *parent, Model::Node *node, int purpose, int semanticZoomLevel, std::function< QVector< VisualizationGroup * >((int, int, int))> option1, std::function< QVector< VisualizationGroup * >((int, int, int))> option2, std::function< QVector< VisualizationGroup * >((int, int, int))> option3) |
Returns a visualization that is most suitable for the given parameter values. More... | |
QPair< int, VisualizationGroup::ItemConstructor > | visualizationChoiceStrategyTypeOverPurposeOverSemanticZoomLevel (Item *parent, Model::Node *node, int purpose, int semanticZoomLevel) |
QPair< int, VisualizationGroup::ItemConstructor > | visualizationChoiceStrategyTypeOverSemanticZoomLevelOverPurpose (Item *parent, Model::Node *node, int purpose, int semanticZoomLevel) |
Private Attributes | |
QVector< QString > | purposes_ |
QVector< QString > | semanticZoomLevels_ |
SzLevelOrderingManager | szLevelOrderingManager_ |
int | visualizationChoiceStrategy_ {VISUALIZATION_CHOICE_STRATEGY_TYPE_OVER_SEMANTIC_ZOOM_LEVEL_OVER_PURPOSE} |
VisualizationGroupsManager | visualizationGroupsManager_ |
Static Private Attributes | |
static const int | VISUALIZATION_CHOICE_STRATEGY_TYPE_OVER_PURPOSE_OVER_SEMANTIC_ZOOM_LEVEL = 2 |
static const int | VISUALIZATION_CHOICE_STRATEGY_TYPE_OVER_SEMANTIC_ZOOM_LEVEL_OVER_PURPOSE = 1 |
Visualization::ModelRenderer::ModelRenderer | ( | ) |
|
virtual |
|
private |
Returns a visualization that is most suitable for the given parameter values.
It uses a priority based approach that first searches for a match according to a function provided as option1. If no match was found it proceeds with option2 then with option3.
QPair< int, VisualizationGroup::ItemConstructor > Visualization::ModelRenderer::bestVisualizationForContext | ( | Item * | parent, |
Model::Node * | node, | ||
int | purpose = -1 , |
||
int | semanticZoomLevel = -1 |
||
) |
int Visualization::ModelRenderer::getCoarserSemanticZoomLevel | ( | int | currentSemanticZoomLevel | ) |
int Visualization::ModelRenderer::getFinerSemanticZoomLevel | ( | int | currentSemanticZoomLevel | ) |
bool Visualization::ModelRenderer::hasVisualization | ( | int | nodeTypeId, |
int | purpose = 0 , |
||
int | semanticZoomLevel = 0 |
||
) |
Returns whether a specific visualization has been registered for nodes of type nodeTypeId and the provided purpose.
|
inline |
|
inline |
|
inline |
|
inline |
void Visualization::ModelRenderer::registerGroup | ( | int | nodeTypeId, |
int | purpose, | ||
int | semanticZoomLevel, | ||
VisualizationGroup * | group | ||
) |
|
inline |
int Visualization::ModelRenderer::registerSemanticZoomLevel | ( | const QString & | name, |
int | orderingNumber | ||
) |
void Visualization::ModelRenderer::registerVisualization | ( | int | nodeTypeId, |
int | purpose, | ||
int | semanticZoomLevel, | ||
VisualizationGroup::ItemConstructor | visualization, | ||
int | itemTypeId | ||
) |
|
inline |
|
inline |
|
inline |
|
inline |
int Visualization::ModelRenderer::registerVisualizationPurpose | ( | const QString & | name | ) |
Item * Visualization::ModelRenderer::render | ( | Item * | parent, |
Model::Node * | node, | ||
int | purpose = -1 , |
||
int | semanticZoomLevel = -1 |
||
) |
Returns an Item which has a parent parent and is a rendering of node.
If purpose is specified (purpose >= 0) it is used as the target purpose when determining an appropriate visualization. Otherwise the purpose of parent is used. If parent is nullptr the default purpose is used.
|
static |
|
static |
|
inline |
|
inline |
bool Visualization::ModelRenderer::sync | ( | Item *& | item, |
Item * | parent, | ||
Model::Node * | node | ||
) |
(Re)renders an item in the context of a parent item.
Returns true is the item was destroyed or rerendered. If nothing happened to the item, the return value is false.
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticprivate |
|
staticprivate |
|
private |
|
private |