COPASI API
4.16.103
|
#include <CLRenderResolver.h>
Public Member Functions | |
CLRenderResolver (const CLLocalRenderInformation &renderInformation, const CCopasiVector< CLLocalRenderInformation > &localList, const CCopasiVector< CLGlobalRenderInformation > &globalList) | |
CLRenderResolver (const CLGlobalRenderInformation &renderInformation, const CCopasiVector< 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 |
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.
Definition at line 47 of file CLRenderResolver.h.
|
inlineprivate |
Definition at line 108 of file CLRenderResolver.h.
CLRenderResolver::CLRenderResolver | ( | const CLLocalRenderInformation & | renderInformation, |
const CCopasiVector< CLLocalRenderInformation > & | localList, | ||
const CCopasiVector< 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.
Definition at line 27 of file CLRenderResolver.cpp.
References fill_base_maps(), fill_local_maps(), mpRenderInformation, and setBackgroundColor().
CLRenderResolver::CLRenderResolver | ( | const CLGlobalRenderInformation & | renderInformation, |
const CCopasiVector< 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.
Definition at line 73 of file CLRenderResolver.cpp.
References fill_base_maps(), fill_global_maps(), mpRenderInformation, and setBackgroundColor().
CLRenderResolver::~CLRenderResolver | ( | ) |
Destructor.
Definition at line 85 of file CLRenderResolver.cpp.
References mpBackgroundColor, and mpRenderInformation.
|
protected |
This method fills the color, gradient and line ending maps for a render information object.
Definition at line 99 of file CLRenderResolver.cpp.
References CLRenderInformationBase::getColorDefinition(), CLRenderInformationBase::getGradientDefinition(), CLLineEnding::getId(), CLGradientBase::getId(), CLColorDefinition::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.
Definition at line 134 of file CLRenderResolver.cpp.
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.
Definition at line 169 of file CLRenderResolver.cpp.
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.
Definition at line 436 of file CLRenderResolver.cpp.
References mpBackgroundColor.
Referenced by CLLayoutRenderer::draw_layout().
const CLColorDefinition * CLRenderResolver::getColorDefinition | ( | const std::string & | id | ) | const |
Returns the color definition for a given id.
Definition at line 404 of file CLRenderResolver.cpp.
References mColorMap, and pResult.
Referenced by getColor(), CLLayoutRenderer::resolve_color(), and setBackgroundColor().
const CLGradientBase * CLRenderResolver::getGradientBase | ( | const std::string & | id | ) | const |
Returns the gradient definition for a given id.
Definition at line 388 of file CLRenderResolver.cpp.
References mGradientMap, and pResult.
Referenced by getBrush(), getColor(), and CLLayoutRenderer::update_textures_and_colors().
const CLLineEnding * CLRenderResolver::getLineEnding | ( | const std::string & | id | ) | const |
Returns the line ending for a given id.
Definition at line 420 of file CLRenderResolver.cpp.
References mLineEndingMap, and pResult.
Referenced by CQRenderConverter::applyStyle(), fillItemFromRenderCurve(), CLLayoutRenderer::map_arrow_head(), and CLLayoutRenderer::update_textures_and_colors().
|
inlineprivate |
Definition at line 109 of file CLRenderResolver.h.
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.
Definition at line 219 of file CLRenderResolver.cpp.
References CLMetabReferenceGlyph::ACTIVATOR, CLGraphicalObject::getKey(), CLGraphicalObject::getObjectRole(), CLReferenceGlyph::getRole(), CLMetabReferenceGlyph::getRole(), CLMetabReferenceGlyph::INHIBITOR, mDeducedObjectRoles, CLMetabReferenceGlyph::MODIFIER, pResult, CLMetabReferenceGlyph::PRODUCT, resolveStyleForKey(), resolveStyleForRole(), resolveStyleForType(), CLMetabReferenceGlyph::SIDEPRODUCT, CLMetabReferenceGlyph::SIDESUBSTRATE, and CLMetabReferenceGlyph::SUBSTRATE.
Referenced by CQConnectionGraphicsItem::CQConnectionGraphicsItem(), and 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.
Definition at line 372 of file CLRenderResolver.cpp.
References mKeyMap, and pResult.
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.
Definition at line 328 of file CLRenderResolver.cpp.
References mRoleMap, and pResult.
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.
Definition at line 345 of file CLRenderResolver.cpp.
References mTypeMap, and pResult.
Referenced by resolveStyle().
|
protected |
Sets the background color from the given render information.
Definition at line 40 of file CLRenderResolver.cpp.
References CLRenderInformationBase::getBackgroundColor(), getColorDefinition(), mpBackgroundColor, mpRenderInformation, and CLColorDefinition::setColorValue().
Referenced by CLRenderResolver().
void CLRenderResolver::setDeducedObjectRoles | ( | const std::map< const CLMetabReferenceGlyph *, std::string > & | deducedObjectRoles | ) |
Sets the deduced object roles.
Definition at line 444 of file CLRenderResolver.cpp.
References mDeducedObjectRoles.
Referenced by CLLayoutRenderer::change_style().
|
protected |
Map to store references to colord definitions based on id.
Definition at line 83 of file CLRenderResolver.h.
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.
Definition at line 102 of file CLRenderResolver.h.
Referenced by resolveStyle(), and setDeducedObjectRoles().
|
protected |
Map to store references to colord definitions based on id.
Definition at line 88 of file CLRenderResolver.h.
Referenced by fill_base_maps(), and getGradientBase().
|
protected |
Map to store references to styles based on ids.
Definition at line 68 of file CLRenderResolver.h.
Referenced by fill_local_maps(), and resolveStyleForKey().
|
protected |
Map to store references to color definitions based on id.
Definition at line 93 of file CLRenderResolver.h.
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.
Definition at line 61 of file CLRenderResolver.h.
|
protected |
Definition at line 95 of file CLRenderResolver.h.
Referenced by getBackgroundColor(), setBackgroundColor(), and ~CLRenderResolver().
|
protected |
The render information object. which is created by the flattener.
Definition at line 54 of file CLRenderResolver.h.
Referenced by CLRenderResolver(), setBackgroundColor(), and ~CLRenderResolver().
|
protected |
Map to store references to styles based on roles.
Definition at line 73 of file CLRenderResolver.h.
Referenced by fill_global_maps(), fill_local_maps(), and resolveStyleForRole().
|
protected |
Map to store references to styles based on types.
Definition at line 78 of file CLRenderResolver.h.
Referenced by fill_global_maps(), fill_local_maps(), and resolveStyleForType().