COPASI API
4.40.278
|
#include <CLRenderResolver.h>
Public Member Functions | |
void | addKeyToMap (const std::string &key, const CLStyle *pStyle) |
CLRenderResolver (const CLGlobalRenderInformation &renderInformation, const CDataVector< CLGlobalRenderInformation > &globalList) | |
CLRenderResolver (const CLLocalRenderInformation &renderInformation, const CDataVector< CLLocalRenderInformation > &localList, const CDataVector< CLGlobalRenderInformation > &globalList) | |
const CLColorDefinition * | getBackgroundColor () const |
const CLColorDefinition * | getColorDefinition (const std::string &id) const |
const CLGradientBase * | getGradientBase (const std::string &id) const |
const CLLineEnding * | getLineEnding (const std::string &id) const |
CDataModel * | getObjectDataModel () const |
void | removeKeyFromMap (const std::string &key) |
const CLStyle * | resolveStyle (const CLGraphicalObject *pObject) const |
const CLStyle * | resolveStyleForKey (const std::string &key) const |
const CLStyle * | resolveStyleForRole (const std::string &role) const |
const CLStyle * | resolveStyleForType (const std::string &type) const |
void | setDeducedObjectRoles (const std::map< const CLMetabReferenceGlyph *, std::string > &deducedObjectRoles) |
~CLRenderResolver () | |
Protected Member Functions | |
void | fill_base_maps (const CLRenderInformationBase *pRenderInformation) |
void | fill_global_maps (const CLGlobalRenderInformation *pRenderInformation) |
void | fill_local_maps (const CLLocalRenderInformation *pRenderInformation) |
void | setBackgroundColor () |
Protected Attributes | |
std::map< std::string, const CLColorDefinition * > | mColorMap |
std::map< const CLMetabReferenceGlyph *, std::string > | mDeducedObjectRoles |
std::map< std::string, const CLGradientBase * > | mGradientMap |
std::map< std::string, const CLStyle * > | mKeyMap |
std::map< std::string, const CLLineEnding * > | mLineEndingMap |
bool | mLocal |
CLColorDefinition * | mpBackgroundColor |
CLRenderInformationBase * | mpRenderInformation |
std::map< std::string, const CLStyle * > | mRoleMap |
std::map< std::string, const CLStyle * > | mTypeMap |
Private Member Functions | |
CLRenderResolver (const CLRenderResolver &) | |
CLRenderResolver & | operator= (const CLRenderResolver &) |
Display list could be used to cache the styles. For styles with only relative coordinates, a display list for a unit box can be created. The display list only has to be scaled and translated. For styles with only absolute coordinates, a display list can be created, this display list may only be translated, but not scaled later on. Styles that use relative and absolute coordinates are more difficult. Here the bounding box has to be known in order to draw the elements. We could still create one display list per use of the style if that would to create to many display lists. Another optimization option for this would be to collect all usages of the style where the boundinng box has the same size into one. Display lists for line endings could also be useful, the same restriction as for styles apply here.
|
inlineprivate |
CLRenderResolver::CLRenderResolver | ( | const CLLocalRenderInformation & | renderInformation, |
const CDataVector< CLLocalRenderInformation > & | localList, | ||
const CDataVector< CLGlobalRenderInformation > & | globalList | ||
) |
Constructor that takes a local render information object as the argument as well as a list of local and a list of global render information objects that are needed to resolve external references.
References fill_base_maps(), fill_local_maps(), mpRenderInformation, and setBackgroundColor().
CLRenderResolver::CLRenderResolver | ( | const CLGlobalRenderInformation & | renderInformation, |
const CDataVector< CLGlobalRenderInformation > & | globalList | ||
) |
Constructor that takes a global render information object as the argument and a list of additional global render information objects that might be needed to resolve external references. means it should contain all information from referenced render information objects.
References fill_base_maps(), fill_global_maps(), mpRenderInformation, and setBackgroundColor().
CLRenderResolver::~CLRenderResolver | ( | ) |
Destructor.
References mpBackgroundColor, and mpRenderInformation.
void CLRenderResolver::addKeyToMap | ( | const std::string & | key, |
const CLStyle * | pStyle | ||
) |
Adds the specified key to the list of styles
References mKeyMap, and removeKeyFromMap().
|
protected |
This method fills the color, gradient and line ending maps for a render information object.
References CLRenderInformationBase::getColorDefinition(), CLRenderInformationBase::getGradientDefinition(), CLColorDefinition::getId(), CLGradientBase::getId(), CLLineEnding::getId(), CLRenderInformationBase::getLineEnding(), CLRenderInformationBase::getNumColorDefinitions(), CLRenderInformationBase::getNumGradientDefinitions(), CLRenderInformationBase::getNumLineEndings(), mColorMap, mGradientMap, and mLineEndingMap.
Referenced by CLRenderResolver().
|
protected |
This method fills the type and role maps for a global render information object.
References CLGlobalRenderInformation::getNumStyles(), CLStyle::getRoleList(), CLGlobalRenderInformation::getStyle(), CLStyle::getTypeList(), mRoleMap, and mTypeMap.
Referenced by CLRenderResolver().
|
protected |
This method fills the type, role and id maps for a local render information object.
References CLLocalStyle::getKeyList(), CLLocalRenderInformation::getNumStyles(), CLStyle::getRoleList(), CLLocalRenderInformation::getStyle(), CLStyle::getTypeList(), mKeyMap, mRoleMap, and mTypeMap.
Referenced by CLRenderResolver().
const CLColorDefinition * CLRenderResolver::getBackgroundColor | ( | ) | const |
Returns the background color.
References mpBackgroundColor.
Referenced by CLLayoutRenderer::draw_layout().
const CLColorDefinition * CLRenderResolver::getColorDefinition | ( | const std::string & | id | ) | const |
Returns the color definition for a given id.
References mColorMap.
Referenced by CLLayoutRenderer::resolve_color(), and setBackgroundColor().
const CLGradientBase * CLRenderResolver::getGradientBase | ( | const std::string & | id | ) | const |
Returns the gradient definition for a given id.
References mGradientMap.
Referenced by CLLayoutRenderer::update_textures_and_colors().
const CLLineEnding * CLRenderResolver::getLineEnding | ( | const std::string & | id | ) | const |
Returns the line ending for a given id.
References mLineEndingMap.
Referenced by CLLayoutRenderer::map_arrow_head(), and CLLayoutRenderer::update_textures_and_colors().
CDataModel * CLRenderResolver::getObjectDataModel | ( | ) | const |
Retrieve the COPASI Data Model
References CDataObject::getObjectDataModel(), and mpRenderInformation.
|
inlineprivate |
void CLRenderResolver::removeKeyFromMap | ( | const std::string & | key | ) |
const CLStyle * CLRenderResolver::resolveStyle | ( | const CLGraphicalObject * | pObject | ) | const |
Method that tries to find the style for the given graphical object that fits best. If no style is found NULL is returned.
References CLMetabReferenceGlyph::ACTIVATOR, CLGraphicalObject::getKey(), CLGraphicalObject::getObjectRole(), CLReferenceGlyph::getRole(), CLMetabReferenceGlyph::getRole(), CLMetabReferenceGlyph::INHIBITOR, mDeducedObjectRoles, CLMetabReferenceGlyph::MODIFIER, CLMetabReferenceGlyph::PRODUCT, resolveStyleForKey(), resolveStyleForRole(), resolveStyleForType(), CLMetabReferenceGlyph::SIDEPRODUCT, CLMetabReferenceGlyph::SIDESUBSTRATE, and CLMetabReferenceGlyph::SUBSTRATE.
Referenced by CLLayoutRenderer::update_style_information().
const CLStyle * CLRenderResolver::resolveStyleForKey | ( | const std::string & | key | ) | const |
Method that tries to find the style for the given key. If no style is found NULL is returned.
References mKeyMap.
Referenced by resolveStyle().
const CLStyle * CLRenderResolver::resolveStyleForRole | ( | const std::string & | role | ) | const |
Method that tries to find the style for the given role. If no style is found NULL is returned.
References mRoleMap.
Referenced by resolveStyle().
const CLStyle * CLRenderResolver::resolveStyleForType | ( | const std::string & | type | ) | const |
Method that tries to find the style for the given type. If no style is found NULL is returned.
References mTypeMap.
Referenced by resolveStyle().
|
protected |
Sets the background color from the given render information.
References CLRenderInformationBase::getBackgroundColor(), getColorDefinition(), mpBackgroundColor, mpRenderInformation, CLRenderInformationBase::setBackgroundColor(), and CLColorDefinition::setColorValue().
Referenced by CLRenderResolver().
void CLRenderResolver::setDeducedObjectRoles | ( | const std::map< const CLMetabReferenceGlyph *, std::string > & | deducedObjectRoles | ) |
Sets the deduced object roles.
References mDeducedObjectRoles.
Referenced by CLLayoutRenderer::change_style().
|
protected |
Map to store references to colord definitions based on id.
Referenced by fill_base_maps(), and getColorDefinition().
|
protected |
Map to store object roles that were deduced by the renderer and are used to suplement the layout information in case a default stylesheet is used.
Referenced by resolveStyle(), and setDeducedObjectRoles().
|
protected |
Map to store references to colord definitions based on id.
Referenced by fill_base_maps(), and getGradientBase().
|
protected |
Map to store references to styles based on ids.
Referenced by addKeyToMap(), fill_local_maps(), removeKeyFromMap(), and resolveStyleForKey().
|
protected |
Map to store references to color definitions based on id.
Referenced by fill_base_maps(), and getLineEnding().
|
protected |
Flag that determines if the resolver is for a local or a global render information object. Currently it is not used at all.
|
protected |
Referenced by getBackgroundColor(), setBackgroundColor(), and ~CLRenderResolver().
|
protected |
The render information object. which is created by the flattener.
Referenced by CLRenderResolver(), getObjectDataModel(), setBackgroundColor(), and ~CLRenderResolver().
|
protected |
Map to store references to styles based on roles.
Referenced by fill_global_maps(), fill_local_maps(), and resolveStyleForRole().
|
protected |
Map to store references to styles based on types.
Referenced by fill_global_maps(), fill_local_maps(), and resolveStyleForType().