COPASI API
4.40.278
|
#include <SBMLDocumentLoader.h>
Static Public Member Functions | |
static void | combineMaps (const std::map< std::string, std::string > &sourceMap, std::map< std::string, std::string > &destMap) |
static void | convertLayoutObjectIds (CLLocalStyle &style, const std::map< std::string, std::string > &idToKeyMap) |
static void | convertLayoutObjectKeys (LocalStyle &style, const std::map< std::string, std::string > &keyToIdMap) |
static void | convertPropertyIds (CLTransformation2D *pObject, const std::map< std::string, std::string > &colorIdToKeyMap, const std::map< std::string, std::string > &gradientIdToKeyMap, const std::map< std::string, std::string > &lineEndingIdToKeyMap) |
template<typename RENDER_INFORMATION > | |
static void | convertRenderInformationReferencesIds (CDataVector< RENDER_INFORMATION > &list, const std::map< std::string, std::string > &idToKeyMap) |
template<typename RENDER_INFORMATION > | |
static void | convertRenderInformationReferencesKeys (ListOf &list, const std::map< std::string, std::string > &keyToIdMap) |
static CLayout * | createLayout (const Layout &sbmlLayout, const std::map< std::string, std::string > &modelmap, std::map< std::string, std::string > &layoutmap, const std::map< std::string, std::string > &globalIdToKeyMap, const CDataContainer *pParent=NO_PARENT) |
static void | readListOfLayouts (CListOfLayouts &lol, const ListOf &sbmlList, const std::map< const CDataObject *, SBase * > &copasimodelmap) |
Static Protected Member Functions | |
static void | postprocessTextGlyph (const TextGlyph &sbml, const std::map< std::string, std::string > &layoutmap) |
|
static |
converts references to color keys, gradient keys and/or line ending keys in graphical primitives to references to the corresponding Ids. template<typename RENDER_INFORMATION> static void convertPropertyKeys(RENDER_INFORMATION* pObject, const std::map<std::string,std::string>& colorKeyToIdMap, const std::map<std::string,std::string>& gradientKeyToIdMap, const std::map<std::string,std::string>& lineEndingKeyToIdMap); converts references to color keys, gradient keys and/or line ending keys in graphical primitives to references to the corresponding Ids. static void convertPropertyKeys(Transformation2D* pObject, const std::map<std::string,std::string>& colorKeyToIdMap, const std::map<std::string,std::string>& gradientKeyToIdMap, const std::map<std::string,std::string>& lineEndingKeyToIdMap); converts references to color ids in gradient stops to references to the corresponding keys. static void convertColorKeys(GradientBase& gradient, const std::map<std::string,std::string>& colorKeyToIdMap); Adds all elements of the source map into the dest map if an element with the same key does not already exist in the dest map.
converts references to color keys, gradient keys and/or line ending keys in graphical primitives to references to the corresponding Ids. void SBMLDocumentLoader::convertPropertyKeys(Transformation2D* pObject, const std::map<std::string,std::string>& colorKeyToIdMap, const std::map<std::string,std::string>& gradientKeyToIdMap, const std::map<std::string,std::string>& lineEndingKeyToIdMap) { GraphicalPrimitive1D* pGP1=dynamic_cast<GraphicalPrimitive1D*>(pObject); if(pGP1 != NULL) { std::map<std::string,std::string>::const_iterator pos; fix the stroke color std::string s=pGP1->getStroke(); if(s.find_first_not_of(" \t\n\r") != std::string::npos && s != "none" && s[0] != '#') { pos=colorKeyToIdMap.find(s); check if we found the color, else it must be a gradient if(pos==colorKeyToIdMap.end()) { pos=gradientKeyToIdMap.find(s); assert(pos != gradientKeyToIdMap.end()); pGP1->setStroke(pos->second); } else { pGP1->setStroke(pos->second); } } GraphicalPrimitive2D* pGP2=dynamic_cast<GraphicalPrimitive2D*>(pObject); if(pGP2 != NULL) { fix the fill color std::string s=pGP2->getFillColor(); if(s.find_first_not_of(" \t\n\r") != std::string::npos && s != "none" && s[0] != '#') { pos=colorKeyToIdMap.find(s); check if we found the color, else it must be a gradient if(pos==colorKeyToIdMap.end()) { pos=gradientKeyToIdMap.find(s); assert(pos != gradientKeyToIdMap.end()); pGP2->setFillColor(pos->second); } else { pGP2->setFillColor(pos->second); } } Group* pG=dynamic_cast<Group*>(pObject); if(pG != NULL) { fix the line endings s=pG->getStartHead(); if(s.find_first_not_of(" \t\n\r") != std::string::npos && s != "none") { pos=lineEndingKeyToIdMap.find(s); assert(pos != lineEndingKeyToIdMap.end()); pG->setStartHead(pos->second); } s=pG->getEndHead(); if(s.find_first_not_of(" \t\n\r") != std::string::npos && s != "none") { pos=lineEndingKeyToIdMap.find(s); assert(pos != lineEndingKeyToIdMap.end()); pG->setEndHead(pos->second); } call this method for all children size_t i,iMax=pG->getNumElements(); for(i=0; i < iMax; ++i) { SBMLDocumentLoader::convertPropertyKeys(dynamic_cast<Transformation2D*>(pG->getElement(i)),colorKeyToIdMap,gradientKeyToIdMap,lineEndingKeyToIdMap); } } } else { RenderCurve* pC=dynamic_cast<RenderCurve*>(pObject); if(pC != NULL) { fix the line endings s=pC->getStartHead(); if(s.find_first_not_of(" \t\n\r") != std::string::npos && s != "none") { pos=lineEndingKeyToIdMap.find(s); assert(pos != lineEndingKeyToIdMap.end()); pC->setStartHead(pos->second); } s=pC->getEndHead(); if(s.find_first_not_of(" \t\n\r") != std::string::npos && s != "none") { pos=lineEndingKeyToIdMap.find(s); assert(pos != lineEndingKeyToIdMap.end()); pC->setEndHead(pos->second); } } } } } converts references to color ids in gradient stops to references to the corresponding keys. void SBMLDocumentLoader::convertColorKeys(GradientBase& gradient, const std::map<std::string,std::string>& colorKeyToIdMap) { size_t i,iMax=gradient.getNumGradientStops(); GradientStop* pStop=NULL; std::map<std::string,std::string>::const_iterator pos; for(i=0; i < iMax; ++i) { pStop=gradient.getGradientStop(i); std::string color=pStop->getStopColor(); if(color.find_first_not_of(" \t\n\r") != std::string::npos && color != "none" && color[0] != '#') { pos=colorKeyToIdMap.find(color); assert(pos!=colorKeyToIdMap.end()); pStop->setStopColor(pos->second); } } } Adds all elements of the source map into the dest map if an element with the same key does not already exist in the dest map.
|
static |
Converts references to ids of layout objects to the corresponding key.
References CLLocalStyle::getKeyList(), and CLLocalStyle::setKeyList().
Referenced by createLayout().
|
static |
Converts references to keys of layout objects to the corresponding id.
converts references to color ids, gradient ids and/or line ending ids in graphical primitives to references to the corresponding keys. void SBMLDocumentLoader::convertPropertyIds(CLTransformation2D* pObject, const std::map<std::string,std::string>& colorIdToKeyMap, const std::map<std::string,std::string>& gradientIdToKeyMap, const std::map<std::string,std::string>& lineEndingIdToKeyMap) { CLGraphicalPrimitive1D* pGP1=dynamic_cast<CLGraphicalPrimitive1D*>(pObject); if(pGP1 != NULL) { std::map<std::string,std::string>::const_iterator pos; fix the stroke color std::string s=pGP1->getStroke(); if(s.find_first_not_of(" \t\n\r") != std::string::npos && s != "none" && s[0] != '#') { pos=colorIdToKeyMap.find(s); check if we found the color, else it must be a gradient if(pos==colorIdToKeyMap.end()) { pos=gradientIdToKeyMap.find(s); assert(pos != gradientIdToKeyMap.end()); pGP1->setStroke(pos->second); } else { pGP1->setStroke(pos->second); } } CLGraphicalPrimitive2D* pGP2=dynamic_cast<CLGraphicalPrimitive2D*>(pObject); if(pGP2 != NULL) { fix the fill color std::string s=pGP2->getFillColor(); if(s.find_first_not_of(" \t\n\r") != std::string::npos && s != "none" && s[0] != '#') { pos=colorIdToKeyMap.find(s); check if we found the color, else it must be a gradient if(pos==colorIdToKeyMap.end()) { pos=gradientIdToKeyMap.find(s); assert(pos != gradientIdToKeyMap.end()); pGP2->setFillColor(pos->second); } else { pGP2->setFillColor(pos->second); } } CLGroup* pG=dynamic_cast<CLGroup*>(pObject); if(pG != NULL) { fix the line endings s=pG->getStartHead(); if(s.find_first_not_of(" \t\n\r") != std::string::npos && s != "none") { pos=lineEndingIdToKeyMap.find(s); assert(pos != lineEndingIdToKeyMap.end()); pG->setStartHead(pos->second); } s=pG->getEndHead(); if(s.find_first_not_of(" \t\n\r") != std::string::npos && s != "none") { pos=lineEndingIdToKeyMap.find(s); assert(pos != lineEndingIdToKeyMap.end()); pG->setEndHead(pos->second); } call this method for all children size_t i,iMax=pG->getNumElements(); for(i=0; i < iMax; ++i) { SBMLDocumentLoader::convertPropertyIds(dynamic_cast<CLTransformation2D*>(pG->getElement(i)),colorIdToKeyMap,gradientIdToKeyMap,lineEndingIdToKeyMap); } } } else { CLRenderCurve* pC=dynamic_cast<CLRenderCurve*>(pObject); if(pC != NULL) { fix the line endings s=pC->getStartHead(); if(s.find_first_not_of(" \t\n\r") != std::string::npos && s != "none") { pos=lineEndingIdToKeyMap.find(s); assert(pos != lineEndingIdToKeyMap.end()); pC->setStartHead(pos->second); } s=pC->getEndHead(); if(s.find_first_not_of(" \t\n\r") != std::string::npos && s != "none") { pos=lineEndingIdToKeyMap.find(s); assert(pos != lineEndingIdToKeyMap.end()); pC->setEndHead(pos->second); } } } } } converts references to color ids in gradient stops to references to the corresponding keys. void SBMLDocumentLoader::convertColorIds(CLGradientBase& gradient, const std::map<std::string,std::string>& colorIdToKeyMap) { size_t i,iMax=gradient.getNumGradientStops(); CLGradientStop* pStop=NULL; std::map<std::string,std::string>::const_iterator pos; for(i=0; i < iMax; ++i) { pStop=gradient.getGradientStop(i); std::string color=pStop->getStopColor(); if(color.find_first_not_of(" \t\n\r") != std::string::npos && color != "none" && color[0] != '#') { pos=colorIdToKeyMap.find(color); assert(pos!=colorIdToKeyMap.end()); pStop->setStopColor(pos->second); } } } Converts references to keys of layout objects to the corresponding id.
Referenced by CLayout::exportToSBML().
|
static |
converts references to color ids, gradient ids and/or line ending ids in graphical primitives to references to the corresponding keys.
|
inlinestatic |
converts the sbml id for render render information objects into the corresponding copasi key where they are used in a reference. This is used for the import from SBML.
References CDataVector< CType >::size().
|
inlinestatic |
converts references to color ids in gradient stops to references to the corresponding keys. static void convertColorIds(CLGradientBase& gradient, const std::map<std::string,std::string>& colorIdToKeyMap); converts the copasi key for global render information objects into the corresponding sbml id where they are used in a reference. This is used for the SBML export.
|
static |
References CLayout::addCompartmentGlyph(), CLayout::addGeneralGlyph(), CLayout::addLocalRenderInformation(), CLayout::addMetaboliteGlyph(), CLayout::addReactionGlyph(), CLayout::addTextGlyph(), C_INT32, convertLayoutObjectIds(), CLRenderInformationBase::getKey(), CLayout::getListOfLocalRenderInformationObjects(), CLLocalRenderInformation::getNumStyles(), CLLocalRenderInformation::getStyle(), and postprocessTextGlyph().
Referenced by readListOfLayouts().
|
staticprotected |
resolves the graphical object reference of the text glyph
References CKeyFactory::get(), CRootContainer::getKeyFactory(), and CLTextGlyph::setGraphicalObjectKey().
Referenced by createLayout().
|
static |