COPASI API  4.40.278
CLRenderResolver Class Reference

#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 CLColorDefinitiongetBackgroundColor () const
 
const CLColorDefinitiongetColorDefinition (const std::string &id) const
 
const CLGradientBasegetGradientBase (const std::string &id) const
 
const CLLineEndinggetLineEnding (const std::string &id) const
 
CDataModelgetObjectDataModel () const
 
void removeKeyFromMap (const std::string &key)
 
const CLStyleresolveStyle (const CLGraphicalObject *pObject) const
 
const CLStyleresolveStyleForKey (const std::string &key) const
 
const CLStyleresolveStyleForRole (const std::string &role) const
 
const CLStyleresolveStyleForType (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
 
CLColorDefinitionmpBackgroundColor
 
CLRenderInformationBasempRenderInformation
 
std::map< std::string, const CLStyle * > mRoleMap
 
std::map< std::string, const CLStyle * > mTypeMap
 

Private Member Functions

 CLRenderResolver (const CLRenderResolver &)
 
CLRenderResolveroperator= (const CLRenderResolver &)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ CLRenderResolver() [1/3]

CLRenderResolver::CLRenderResolver ( const CLRenderResolver )
inlineprivate

◆ CLRenderResolver() [2/3]

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() [3/3]

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::~CLRenderResolver ( )

Destructor.

References mpBackgroundColor, and mpRenderInformation.

Member Function Documentation

◆ addKeyToMap()

void CLRenderResolver::addKeyToMap ( const std::string &  key,
const CLStyle pStyle 
)

Adds the specified key to the list of styles

References mKeyMap, and removeKeyFromMap().

◆ fill_base_maps()

◆ fill_global_maps()

void CLRenderResolver::fill_global_maps ( const CLGlobalRenderInformation pRenderInformation)
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().

◆ fill_local_maps()

void CLRenderResolver::fill_local_maps ( const CLLocalRenderInformation pRenderInformation)
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().

◆ getBackgroundColor()

const CLColorDefinition * CLRenderResolver::getBackgroundColor ( ) const

Returns the background color.

References mpBackgroundColor.

Referenced by CLLayoutRenderer::draw_layout().

◆ getColorDefinition()

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().

◆ getGradientBase()

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().

◆ getLineEnding()

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().

◆ getObjectDataModel()

CDataModel * CLRenderResolver::getObjectDataModel ( ) const

Retrieve the COPASI Data Model

Returns
CDataModel * pObjectDataModel

References CDataObject::getObjectDataModel(), and mpRenderInformation.

◆ operator=()

CLRenderResolver& CLRenderResolver::operator= ( const CLRenderResolver )
inlineprivate

◆ removeKeyFromMap()

void CLRenderResolver::removeKeyFromMap ( const std::string &  key)

Removes the specified key, from the list of styles

References mKeyMap.

Referenced by addKeyToMap().

◆ resolveStyle()

◆ resolveStyleForKey()

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().

◆ resolveStyleForRole()

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().

◆ resolveStyleForType()

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().

◆ setBackgroundColor()

void CLRenderResolver::setBackgroundColor ( )
protected

◆ setDeducedObjectRoles()

void CLRenderResolver::setDeducedObjectRoles ( const std::map< const CLMetabReferenceGlyph *, std::string > &  deducedObjectRoles)

Sets the deduced object roles.

References mDeducedObjectRoles.

Referenced by CLLayoutRenderer::change_style().

Member Data Documentation

◆ mColorMap

std::map<std::string, const CLColorDefinition*> CLRenderResolver::mColorMap
protected

Map to store references to colord definitions based on id.

Referenced by fill_base_maps(), and getColorDefinition().

◆ mDeducedObjectRoles

std::map<const CLMetabReferenceGlyph*, std::string> CLRenderResolver::mDeducedObjectRoles
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().

◆ mGradientMap

std::map<std::string, const CLGradientBase*> CLRenderResolver::mGradientMap
protected

Map to store references to colord definitions based on id.

Referenced by fill_base_maps(), and getGradientBase().

◆ mKeyMap

std::map<std::string, const CLStyle*> CLRenderResolver::mKeyMap
protected

Map to store references to styles based on ids.

Referenced by addKeyToMap(), fill_local_maps(), removeKeyFromMap(), and resolveStyleForKey().

◆ mLineEndingMap

std::map<std::string, const CLLineEnding*> CLRenderResolver::mLineEndingMap
protected

Map to store references to color definitions based on id.

Referenced by fill_base_maps(), and getLineEnding().

◆ mLocal

bool CLRenderResolver::mLocal
protected

Flag that determines if the resolver is for a local or a global render information object. Currently it is not used at all.

◆ mpBackgroundColor

CLColorDefinition* CLRenderResolver::mpBackgroundColor
protected

◆ mpRenderInformation

CLRenderInformationBase* CLRenderResolver::mpRenderInformation
protected

The render information object. which is created by the flattener.

Referenced by CLRenderResolver(), getObjectDataModel(), setBackgroundColor(), and ~CLRenderResolver().

◆ mRoleMap

std::map<std::string, const CLStyle*> CLRenderResolver::mRoleMap
protected

Map to store references to styles based on roles.

Referenced by fill_global_maps(), fill_local_maps(), and resolveStyleForRole().

◆ mTypeMap

std::map<std::string, const CLStyle*> CLRenderResolver::mTypeMap
protected

Map to store references to styles based on types.

Referenced by fill_global_maps(), fill_local_maps(), and resolveStyleForType().


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