COPASI API  4.40.278
CCellDesignerImporter Class Reference

#include <CCellDesignerImporter.h>

Public Member Functions

 CCellDesignerImporter (SBMLDocument *pDocument=0)
 
bool createBiUniCurve (ReactionAnnotation &ranno, ReactionGlyph *pRGlyph, LocalStyle *pReactionStyle)
 creates a curve connecting two substrates to one product More...
 
bool createProduct (std::vector< Point > &productPoints, ReactionGlyph *pRGlyph, LocalStyle *pReactionStyle, ReactionAnnotation &ranno)
 
bool createSubstrate (std::vector< Point > &reactantPoints, ReactionGlyph *pRGlyph, LocalStyle *pReactionStyle, ReactionAnnotation &ranno)
 
bool createUniBiCurve (ReactionAnnotation &ranno, ReactionGlyph *pRGlyph, LocalStyle *pReactionStyle)
 creates a curve connecting one substrate to two products More...
 
bool createUniUniCurve (ReactionAnnotation &ranno, ReactionGlyph *pRGlyph, LocalStyle *pReactionStyle)
 creates a curve connecting one substrate to one product More...
 
void enforceSquare (const ConnectScheme &connectScheme, Point &p, const Point &pStart, const Point &pEnd, int &directionCount, bool isLast, const std::vector< Point > &points)
 
const Layout * getLayout () const
 
const SBMLDocument * getSBMLDocument () const
 
void removeCurrentLayout ()
 
void setProductStyle (const std::string &id, LocalStyle *pReactionStyle)
 
void setSBMLDocument (SBMLDocument *pDocument)
 

Static Public Member Functions

static double determineVersion (const XMLNode *pNode)
 
static const XMLNode * findCellDesignerAnnotation (SBMLDocument *pDocument, const XMLNode *pAnnotation)
 
static std::pair< bool, std::string > findCellDesignerNamespace (const SBMLDocument *pDocument)
 

Protected Member Functions

void addDependency (const std::string &parent, const std::string &child)
 
bool addProteinModifications (RenderGroup *pGroup, const BoundingBox &bounds, const std::vector< ProteinModification > &modifications, const std::vector< SpeciesModification > &speciesModifications, const std::string &stroke_color)
 adds the given protein modifications to the given group More...
 
void checkLinkAnchor (LinkTarget &link, const Point &p)
 
void checkLinkAnchors (LinkTarget &substrate, LinkTarget &product)
 
bool convertCellDesignerLayout (const XMLNode *pCellDesignerAnnotation)
 
bool convertCompartmentAnnotations ()
 
bool convertReactionAnnotation (Reaction *pReaction, const Model *pModel)
 
bool convertReactionAnnotations ()
 
bool convertSpeciesAnnotations ()
 
bool createCatalysisStyles ()
 
bool createCompartmentGlyph (const CompartmentAlias &ca)
 
bool createCompartmentGlyphs (const XMLNode *pLoCA)
 
bool createCompartmentStyle (const CompartmentAlias &ca, const CompartmentGlyph *pCGlyph)
 
bool createDefaultActivatorStyle ()
 
bool createDefaultInhibitorStyle ()
 
bool createDefaultModifierStyle ()
 
bool createDefaultProductStyle ()
 
bool createDefaultReactionGlyphStyle ()
 
bool createDefaultStyles ()
 
bool createDefaultSubstrateStyle ()
 
bool createPrimitive (RenderGroup *pGroup, const SpeciesIdentity &si, const BoundingBox &bounds, const Point &offset, double stroke_width, const std::string &stroke_color, const std::string &fill_color, const std::string &text="")
 
bool createProteinModification (RenderGroup *pGroup, SPECIES_MODIFICATION_TYPE type, const BoundingBox &bounds, const std::string &stroke_color, double angle=0.0)
 
bool createSpeciesGlyph (const SpeciesAlias &sa)
 
bool createSpeciesGlyphs (const XMLNode *pLoSA)
 
bool createSpeciesReferenceGlyphs (ReactionGlyph *pRGlyph, const std::vector< LinkTarget > &link, std::map< SpeciesReferenceGlyph *, Point > &startsMap, bool reactants)
 
bool createSpeciesStyles ()
 
LocalStyle * createStyleFromLine (Line &line, const std::string &glyphId)
 
bool createTextGlyphStyle (double size, Text::TEXT_ANCHOR hAlign, Text::TEXT_ANCHOR vAlign, const std::string &objectReference)
 
std::string createUniqueId (const std::string &prefix)
 
bool findOrCreateColorDefinition (const Paint &paint, std::string &id)
 
bool findOrCreateColorDefinition (const std::string &color_string, std::string &id)
 
std::string findRootElementId (const std::string &id) const
 
std::string getColorString (const std::string &color_id) const
 
bool handleExtraReactionElements (ReactionGlyph *pRGlyph, ReactionAnnotation &ranno, bool substrate)
 
bool handleIncludedSpecies (const XMLNode *pNode)
 
bool handleModificationLinks (ReactionGlyph *pRGlyph, ReactionAnnotation &ranno)
 
bool parseProteins (const XMLNode *pNode)
 
bool setSpeciesGlyphId (SpeciesReferenceGlyph *pGlyph, const LinkTarget &link)
 
bool setSpeciesReferenceId (SpeciesReferenceGlyph *pGlyph, const LinkTarget &link, const std::string &reactionId)
 

Static Protected Member Functions

static void addAllPositions (std::vector< POSITION > &v)
 
static double angle (const Point &v)
 
static Point calculateAbsoluteValue (const Point &p, const Point &p1, const Point &p2, const Point &p3)
 
static SPECIES_CLASS classToEnum (std::string cl)
 
static std::string cleanString (const std::string &text)
 cleanString replaces sequences within the given text string More...
 
static CONNECTION_POLICY connectionPolicyToEnum (std::string s)
 
template<typename ITERATOR >
static bool createLineSegments (Curve *pCurve, ITERATOR start, ITERATOR end)
 
static bool createOrthogonal (const Point &v1, Point &v2)
 
static DIRECTION_VALUE directionToEnum (std::string s)
 
static double distance (const Point &p1, const Point &p2)
 
static const XMLNode * findChildNode (const XMLNode *pNode, const std::string &prefix, const std::string &name, bool recursive=false)
 
static POSITION findShortestConnection (const Point &p, std::vector< POSITION > &pos, const BoundingBox &box)
 
static bool findShortestConnection (std::vector< POSITION > &pos1, std::vector< POSITION > &pos2, const BoundingBox &box1, const BoundingBox &box2)
 
static Point getPositionPoint (const BoundingBox &box, POSITION position)
 
static bool isDefaultOrEmpty (const Line &line)
 
static MODIFICATION_LINK_TYPE modificationLinkTypeToEnum (std::string s)
 
static MODIFICATION_TYPE modificationTypeToEnum (std::string s)
 
static PAINT_SCHEME paintSchemeToEnum (std::string s)
 
static bool parseBounds (const XMLNode *pNode, BoundingBox &box)
 
static bool parseBoxSize (const XMLNode *pNode, Dimensions &d)
 
static bool parseCompartmentAlias (const XMLNode *pNode, CompartmentAlias &ca, const Dimensions &layout_dimensions)
 
static bool parseCompartmentAnnotation (const XMLNode *pNode, CompartmentAnnotation &anno)
 
static bool parseConnectScheme (const XMLNode *pNode, ConnectScheme &scheme)
 
static bool parseDoubleLine (const XMLNode *pNode, DoubleLine &dl)
 
static bool parseEditPoints (const XMLNode *pNode, EditPoints &editpoints)
 
static bool parseExtraLink (const XMLNode *pNode, ReactantLink &l)
 
static bool parseExtraLinks (const XMLNode *pNode, std::vector< ReactantLink > &rlinks)
 
static bool parseLine (const XMLNode *pNode, Line &line)
 
static bool parseLineDirection (const XMLNode *pNode, LineDirection &d)
 
static bool parseLinkTarget (const XMLNode *pNode, LinkTarget &l)
 
static bool parseModelDisplay (const XMLNode *pNode, Dimensions &d)
 
static bool parsePaint (const XMLNode *pNode, Paint &p)
 
static bool parsePoint (const XMLNode *pNode, Point &p)
 
static bool parsePointsString (const std::string &s, std::vector< Point > &points)
 
static bool parseProteinModification (const XMLNode *pNode, ProteinModification &mod)
 
static bool parseReactionAnnotation (const XMLNode *pNode, ReactionAnnotation &ranno)
 
static bool parseReactionElements (const XMLNode *pNode, std::vector< LinkTarget > &elements)
 
static bool parseReactionModification (const XMLNode *pNode, ReactionModification &mod)
 
static bool parseReactionModifications (const XMLNode *pNode, std::vector< ReactionModification > &rmods)
 
static bool parseSpeciesAlias (const XMLNode *pNode, SpeciesAlias &sa)
 
static bool parseSpeciesAnnotation (const XMLNode *pNode, SpeciesAnnotation &anno)
 
static bool parseSpeciesIdentity (const XMLNode *pNode, SpeciesIdentity &identity)
 
static bool parseSpeciesModification (const XMLNode *pNode, SpeciesModification &mod)
 
static bool parseSpeciesState (const XMLNode *pNode, SpeciesState &state)
 
static bool parseUsualView (const XMLNode *pNode, UsualView &view)
 
static POSITION_TO_COMPARTMENT positionToCompartmentToEnum (std::string s)
 
static POSITION positionToEnum (std::string pos)
 
static REACTION_TYPE reactionTypeToEnum (std::string s)
 
static void replaceStringInPlace (std::string &subject, const std::string &search, const std::string &replace)
 
static void rotate (const Point &p, double a, Point &r)
 
static SPECIES_MODIFICATION_TYPE speciesModificationTypeToEnum (std::string cl)
 
static bool splitString (const std::string &s, std::vector< std::string > &parts, const std::string &splitChars)
 

Protected Attributes

std::map< std::string, BoundingBox > mCDBounds
 
std::map< std::string, GraphicalObject * > mCDIdToLayoutElement
 
std::map< std::string, std::string > mColorStringMap
 
std::map< const CompartmentGlyph *, CompartmentAliasmCompartmentAliasMap
 
std::map< std::string, CompartmentAnnotationmCompartmentAnnotationMap
 
std::map< const CompartmentGlyph *, Point > mCompartmentNamePointMap
 
std::list< CCopasiNode< std::string > * > mComplexDependencies
 
std::string mFont
 
std::map< std::string, const SBase * > mIdMap
 
std::map< std::string, std::pair< std::string, SpeciesIdentity > > mIncludedSpeciesNameMap
 
std::multimap< std::string, GraphicalObject * > mModelIdToLayoutElement
 
std::map< MODIFICATION_LINK_TYPE, LocalStyle * > mModificationLinkStyleMap
 
SBMLDocument * mpDocument
 
Layout * mpLayout
 
LocalRenderInformation * mpLocalRenderInfo
 
Model * mpModel
 
std::map< std::string, ProteinmProteinInformationMap
 
std::map< std::string, SpeciesAliasmSpeciesAliases
 
std::map< const SpeciesGlyph *, SpeciesAliasmSpeciesAliasMap
 
std::map< std::string, SpeciesAnnotationmSpeciesAnnotationMap
 

Detailed Description

This class converts CellDesigner layout information into SBML layout. Maybe later versions will also be able to handle the render information part.

Constructor & Destructor Documentation

◆ CCellDesignerImporter()

CCellDesignerImporter::CCellDesignerImporter ( SBMLDocument *  pDocument = 0)

Constructor that takes a pointer to an SBMLDocument. The SBMLDocument will not be copied and it will not be owned by the importer. If the pointer is not NULL, the class will try to directly convert the CellDesigner layout if there is one.

References setSBMLDocument().

Member Function Documentation

◆ addAllPositions()

static void CCellDesignerImporter::addAllPositions ( std::vector< POSITION > &  v)
staticprotected

Adds all possible POSITION enums to the given vector. The vector is cleared first.

◆ addDependency()

void CCellDesignerImporter::addDependency ( const std::string &  parent,
const std::string &  child 
)
protected

◆ addProteinModifications()

bool CCellDesignerImporter::addProteinModifications ( RenderGroup *  pGroup,
const BoundingBox &  bounds,
const std::vector< ProteinModification > &  modifications,
const std::vector< SpeciesModification > &  speciesModifications,
const std::string &  stroke_color 
)
protected

adds the given protein modifications to the given group

Parameters
pGroupthe render group to add the modification to
boundsthe bounds of the element
modificationslist of angles where to attach the modifications
speciesModificationslist of modification types
stroke_colorthe stroke color
Returns
status information as to whether or not the operation was successful

Create a primitive that corresponds to the given class The promitive is created in the given group object. The complete primitive is translated by the given offset.

If creation of the primitive fails, false is returned.

References createProteinModification(), and getTypeFrom().

Referenced by createPrimitive().

◆ angle()

static double CCellDesignerImporter::angle ( const Point &  v)
staticprotected

Calculates the angle between the given vector and the positive x axis. The result is returned in radians.

Referenced by createProteinModification().

◆ calculateAbsoluteValue()

static Point CCellDesignerImporter::calculateAbsoluteValue ( const Point &  p,
const Point &  p1,
const Point &  p2,
const Point &  p3 
)
staticprotected

Calculates the absolute position for point p based on the three other points (p1,p2,p3) given. The formula for that is: p1 + p.x * (p2 - p1) + p.y * (p3 - p1)

Referenced by createBiUniCurve(), and createUniUniCurve().

◆ checkLinkAnchor()

void CCellDesignerImporter::checkLinkAnchor ( LinkTarget link,
const Point &  p 
)
protected

Checks if the given ReactantLink object has a valid linkAnchor If not, we try to determine the best anchor be finding the one that is closest to the given point.

Referenced by createBiUniCurve(), and createUniBiCurve().

◆ checkLinkAnchors()

void CCellDesignerImporter::checkLinkAnchors ( LinkTarget substrate,
LinkTarget product 
)
protected

Checks if the given ReactantLink objects have valid linkAnchors If not, we try to determine the best anchor be finding the ones that give the shortest connection between the two objects

Referenced by createUniUniCurve().

◆ classToEnum()

SPECIES_CLASS CCellDesignerImporter::classToEnum ( std::string  cl)
staticprotected

◆ cleanString()

static std::string CCellDesignerImporter::cleanString ( const std::string &  text)
staticprotected

cleanString replaces sequences within the given text string

Parameters
textthe string to be cleaned
Returns
the cleaned string

Referenced by convertCompartmentAnnotations(), convertSpeciesAnnotations(), and createPrimitive().

◆ connectionPolicyToEnum()

CONNECTION_POLICY CCellDesignerImporter::connectionPolicyToEnum ( std::string  s)
staticprotected

Converts the given connection policy string to the corresponding enum. If there is no enum that corresponds to the string, POLICY_UNDEFINED is returned.

References POLICY_DIRECT, POLICY_SQUARE, and POLICY_UNDEFINED.

Referenced by parseConnectScheme().

◆ convertCellDesignerLayout()

◆ convertCompartmentAnnotations()

bool CCellDesignerImporter::convertCompartmentAnnotations ( )
protected

Traverses the compartments of the model and looks for CellDesigner annotations. These are used to create text glyphs associated with compartments.

References cleanString(), createTextGlyphStyle(), createUniqueId(), FAIL_WITH_ERROR, findCellDesignerAnnotation(), getCenter(), mCompartmentAliasMap, mCompartmentAnnotationMap, mCompartmentNamePointMap, mIdMap, mModelIdToLayoutElement, CompartmentAnnotation::mName, mpDocument, mpLayout, mpModel, and parseCompartmentAnnotation().

Referenced by convertCellDesignerLayout().

◆ convertReactionAnnotation()

◆ convertReactionAnnotations()

bool CCellDesignerImporter::convertReactionAnnotations ( )
protected

Traverses the reactions of the model and looks for CellDesigner annotations. These are used to create reaction glyphs.

References convertReactionAnnotation(), FAIL_WITH_ERROR_AND_RETURN, mpDocument, and mpModel.

Referenced by convertCellDesignerLayout().

◆ convertSpeciesAnnotations()

bool CCellDesignerImporter::convertSpeciesAnnotations ( )
protected

◆ createBiUniCurve()

bool CCellDesignerImporter::createBiUniCurve ( ReactionAnnotation ranno,
ReactionGlyph *  pRGlyph,
LocalStyle *  pReactionStyle 
)

creates a curve connecting two substrates to one product

Parameters
rannothe reaction annotation
pRGlyphthe reaction glyph
pReactionStylethe style of the current reaction
Returns
status whether creation worked or not

References calculateAbsoluteValue(), checkLinkAnchor(), COULD_NOT_CREATE, createUniqueId(), distance(), FAIL_WITH_ERROR, getPositionPoint(), ReactionAnnotation::mBaseProducts, ReactionAnnotation::mBaseReactants, mCDBounds, ReactionAnnotation::mEditPoints, mIdMap, EditPoints::mOmittedShapeIndex, EditPoints::mPoints, EditPoints::mTShapeIndex, POSITION_UNDEFINED, setSpeciesGlyphId(), and setSpeciesReferenceId().

Referenced by convertReactionAnnotation().

◆ createCatalysisStyles()

bool CCellDesignerImporter::createCatalysisStyles ( )
protected

Create style for catalysis.

◆ createCompartmentGlyph()

bool CCellDesignerImporter::createCompartmentGlyph ( const CompartmentAlias ca)
protected

◆ createCompartmentGlyphs()

bool CCellDesignerImporter::createCompartmentGlyphs ( const XMLNode *  pLoCA)
protected

Creates the compartment glyphs from the given node that represents the listOfCompartmentAliases.

References createCompartmentGlyph(), FAIL_WITH_ERROR, mpLayout, and parseCompartmentAlias().

Referenced by convertCellDesignerLayout().

◆ createCompartmentStyle()

bool CCellDesignerImporter::createCompartmentStyle ( const CompartmentAlias ca,
const CompartmentGlyph *  pCGlyph 
)
protected

This method creates a new local style based on the passed in CompartmentAlias object. The style is associated with the object via the given id. If Creating the style fails, false is returned.

Referenced by createCompartmentGlyph().

◆ createDefaultActivatorStyle()

bool CCellDesignerImporter::createDefaultActivatorStyle ( )
protected

Create default style for activators.

◆ createDefaultInhibitorStyle()

bool CCellDesignerImporter::createDefaultInhibitorStyle ( )
protected

Create default style for inhibitors.

◆ createDefaultModifierStyle()

bool CCellDesignerImporter::createDefaultModifierStyle ( )
protected

Create default style for modifiers.

◆ createDefaultProductStyle()

bool CCellDesignerImporter::createDefaultProductStyle ( )
protected

Create default style for products.

◆ createDefaultReactionGlyphStyle()

bool CCellDesignerImporter::createDefaultReactionGlyphStyle ( )
protected

Create default style for reaction glyphs.

◆ createDefaultStyles()

bool CCellDesignerImporter::createDefaultStyles ( )
protected

TODO right now, we use default styles for species reference glyphs TODO and reaction glyphs. TODO These are created here. TODO later we have to create individual styles based on the type of reaction TODO and the color set in the CellDesigner annotation.

Referenced by convertCellDesignerLayout().

◆ createDefaultSubstrateStyle()

bool CCellDesignerImporter::createDefaultSubstrateStyle ( )
protected

Create default style for substrates.

◆ createLineSegments()

template<typename ITERATOR >
static bool CCellDesignerImporter::createLineSegments ( Curve *  pCurve,
ITERATOR  start,
ITERATOR  end 
)
inlinestaticprotected

This method takes a pointer to a curve object as well as a start iterator and an end iterator which both iterate over a data structure that contains points. For each point pair, a line segment is created and added to curve. The new curve segments are added to the end of the curve.

If no error occurs, true is returned, else false is returned.

Referenced by createProduct(), and createSubstrate().

◆ createOrthogonal()

static bool CCellDesignerImporter::createOrthogonal ( const Point &  v1,
Point &  v2 
)
staticprotected

Creates a vector that is orthogonal to the given first vector. If there is a problem, false is returned.

Referenced by createUniUniCurve().

◆ createPrimitive()

bool CCellDesignerImporter::createPrimitive ( RenderGroup *  pGroup,
const SpeciesIdentity si,
const BoundingBox &  bounds,
const Point &  offset,
double  stroke_width,
const std::string &  stroke_color,
const std::string &  fill_color,
const std::string &  text = "" 
)
protected

◆ createProduct()

bool CCellDesignerImporter::createProduct ( std::vector< Point > &  productPoints,
ReactionGlyph *  pRGlyph,
LocalStyle *  pReactionStyle,
ReactionAnnotation ranno 
)

◆ createProteinModification()

bool CCellDesignerImporter::createProteinModification ( RenderGroup *  pGroup,
SPECIES_MODIFICATION_TYPE  type,
const BoundingBox &  bounds,
const std::string &  stroke_color,
double  angle = 0.0 
)
protected

◆ createSpeciesGlyph()

bool CCellDesignerImporter::createSpeciesGlyph ( const SpeciesAlias sa)
protected

◆ createSpeciesGlyphs()

bool CCellDesignerImporter::createSpeciesGlyphs ( const XMLNode *  pLoSA)
protected

Creates the species glyphs from the given node that represents the listOfSpeciesAliases.

References createSpeciesGlyph(), FAIL_WITH_ERROR, and parseSpeciesAlias().

Referenced by convertCellDesignerLayout().

◆ createSpeciesReferenceGlyphs()

bool CCellDesignerImporter::createSpeciesReferenceGlyphs ( ReactionGlyph *  pRGlyph,
const std::vector< LinkTarget > &  links,
std::map< SpeciesReferenceGlyph *, Point > &  startsMap,
bool  reactants 
)
protected

Takes a node that contains a number of baseReactants or baseProducts and creates species reference glyphs for each one.

References createUniqueId(), FAIL_WITH_ERROR, findRootElementId(), getPositionPoint(), LinkTarget::mAlias, mCDBounds, mCDIdToLayoutElement, mIdMap, mpModel, LinkTarget::mPosition, LinkTarget::mSpecies, and POSITION_UNDEFINED.

◆ createSpeciesStyles()

◆ createStyleFromLine()

LocalStyle * CCellDesignerImporter::createStyleFromLine ( Line line,
const std::string &  glyphId 
)
protected

◆ createSubstrate()

bool CCellDesignerImporter::createSubstrate ( std::vector< Point > &  reactantPoints,
ReactionGlyph *  pRGlyph,
LocalStyle *  pReactionStyle,
ReactionAnnotation ranno 
)

◆ createTextGlyphStyle()

bool CCellDesignerImporter::createTextGlyphStyle ( double  size,
Text::TEXT_ANCHOR  hAlign,
Text::TEXT_ANCHOR  vAlign,
const std::string &  objectReference 
)
protected

This method creates a new local style based on the passed in SpeciesAlias object. The style is associated with the object via the given id. If Creating the style fails, false is returned. bool createSpeciesStyle(const SpeciesAlias& sa,const std::string& objectReference); Creates a local style for a certain text glyph. The style is associated with the text glyph via the id of the text glyph.

Referenced by convertCompartmentAnnotations(), and convertSpeciesAnnotations().

◆ createUniBiCurve()

bool CCellDesignerImporter::createUniBiCurve ( ReactionAnnotation ranno,
ReactionGlyph *  pRGlyph,
LocalStyle *  pReactionStyle 
)

creates a curve connecting one substrate to two products

Parameters
rannothe reaction annotation
pRGlyphthe reaction glyph
pReactionStylethe style of the current reaction
Returns
status whether creation worked or not

Looks for CellDesigner annotation in the given reaction and ries to convert the information in that annotation into a ReactionGlyph.

References checkLinkAnchor(), COULD_NOT_CREATE, createUniqueId(), distance(), FAIL_WITH_ERROR, getPositionPoint(), ReactionAnnotation::mBaseProducts, ReactionAnnotation::mBaseReactants, mCDBounds, ReactionAnnotation::mEditPoints, mIdMap, EditPoints::mOmittedShapeIndex, EditPoints::mPoints, EditPoints::mTShapeIndex, POSITION_UNDEFINED, setSpeciesGlyphId(), and setSpeciesReferenceId().

Referenced by convertReactionAnnotation().

◆ createUniqueId()

◆ createUniUniCurve()

bool CCellDesignerImporter::createUniUniCurve ( ReactionAnnotation ranno,
ReactionGlyph *  pRGlyph,
LocalStyle *  pReactionStyle 
)

creates a curve connecting one substrate to one product

Parameters
rannothe reaction annotation
pRGlyphthe reaction glyph
pReactionStylethe style of the current reaction
Returns
status whether creation worked or not

References calculateAbsoluteValue(), checkLinkAnchors(), createOrthogonal(), createProduct(), createSubstrate(), distance(), enforceSquare(), FAIL_WITH_ERROR, getPositionPoint(), ReactionAnnotation::mBaseProducts, ReactionAnnotation::mBaseReactants, mCDBounds, ReactionAnnotation::mConnectScheme, ReactionAnnotation::mEditPoints, EditPoints::mPoints, ConnectScheme::mRectangleIndex, and POSITION_UNDEFINED.

Referenced by convertReactionAnnotation().

◆ determineVersion()

static double CCellDesignerImporter::determineVersion ( const XMLNode *  pNode)
static

Tries to find the version number of CellDesigner that was used to write this annotation. The node should be the CellDesigner annotation of the model. If the version number is not found or could not be parsed, we return -1.

Referenced by convertCellDesignerLayout().

◆ directionToEnum()

DIRECTION_VALUE CCellDesignerImporter::directionToEnum ( std::string  s)
staticprotected

Converts the given direction string to the corresponding enum. If there is no enum that corresponds to the string, DIRECTION_UNDEFINED is returned.

References DIRECTION_HORIZONTAL, DIRECTION_UNDEFINED, DIRECTION_UNKNOWN, and DIRECTION_VERTICAL.

Referenced by parseLineDirection().

◆ distance()

static double CCellDesignerImporter::distance ( const Point &  p1,
const Point &  p2 
)
staticprotected

Calculate the distance between the two points.

Referenced by createBiUniCurve(), createUniBiCurve(), and createUniUniCurve().

◆ enforceSquare()

void CCellDesignerImporter::enforceSquare ( const ConnectScheme connectScheme,
Point &  p,
const Point &  pStart,
const Point &  pEnd,
int &  directionCount,
bool  isLast,
const std::vector< Point > &  points 
)

◆ findCellDesignerAnnotation()

const XMLNode * CCellDesignerImporter::findCellDesignerAnnotation ( SBMLDocument *  pDocument,
const XMLNode *  pAnnotation 
)
static

Goes through the SBMLDocument and tries to find a CellDesigner annotation. If one is found, a const pointer to the corresponding XMLNode is returned. If the current SBMLDocument is NULL or if no CellDesigner annotation is found, NULL is returned.

Goes through the SBMLDocument and tries to find a CellDesigner annotation. If one is found, a const pointer to the corresponding XMLNode is returned. If the current SBMLDocument is NULL or if no CellDesigner annotation is found, ULL is returned.

References findCellDesignerNamespace().

Referenced by convertCompartmentAnnotations(), convertReactionAnnotation(), convertSpeciesAnnotations(), and setSBMLDocument().

◆ findCellDesignerNamespace()

std::pair< bool, std::string > CCellDesignerImporter::findCellDesignerNamespace ( const SBMLDocument *  pDocument)
static

This method searches for the CellDesigner namespace in the annotation to the model as well as the annotation to the document. The method returns a pair of bool and string. The bool determines if the namespace was found and the string specifies the prefix for the namespace.

Referenced by findCellDesignerAnnotation().

◆ findChildNode()

const XMLNode * CCellDesignerImporter::findChildNode ( const XMLNode *  pNode,
const std::string &  prefix,
const std::string &  name,
bool  recursive = false 
)
staticprotected

Goes through the children of the given node which represents a list of protein definitions and collects the names for them. These names are converted to text glyphs for the proteins. Goes through the children of the given node which represents a list of protein definitions and collects the names for them. These names are converted to text glyphs for the proteins. Goes through the children of the given node which represents a list of protein definitions and collects the names for them. These names are converted to text glyphs for the proteins. Searches for a child with a certain name and a certain prefix in the tree based on pNode. The first child that fits the name and the prefix or NULL is returned. If recursive is true, the tree is searched recursively.

Searches for a child with a certain name and a certain prefix in the tree based on pNode. The first child that fits the name and the prefix or NULL is returned. If recursive is true, the tree is searched recursively.

Referenced by convertCellDesignerLayout(), parseCompartmentAnnotation(), parseConnectScheme(), parseExtraLink(), parseLinkTarget(), parseProteins(), parseReactionAnnotation(), parseReactionModification(), parseSpeciesAnnotation(), parseSpeciesIdentity(), and parseSpeciesState().

◆ findOrCreateColorDefinition() [1/2]

bool CCellDesignerImporter::findOrCreateColorDefinition ( const Paint paint,
std::string &  id 
)
protected

◆ findOrCreateColorDefinition() [2/2]

bool CCellDesignerImporter::findOrCreateColorDefinition ( const std::string &  color_string,
std::string &  id 
)
protected

Check if a color with the given color string already exists. If so, the id of the color is set on the given id string. If the color does not exist yet, a color definition for it is created and the id of the newly created color is returned in the id string. If color creation fails, false is returned by the method.

Referenced by createSpeciesStyles(), and createStyleFromLine().

◆ findRootElementId()

std::string CCellDesignerImporter::findRootElementId ( const std::string &  id) const
protected

Tries to find the name for the given species identity. If the name was found, it is returned in the name argument. If something goes wrong, false is returned. Goes through the dependency graph and tries to find the root element for the given species alias id.

Referenced by createSpeciesReferenceGlyphs().

◆ findShortestConnection() [1/2]

static POSITION CCellDesignerImporter::findShortestConnection ( const Point &  p,
std::vector< POSITION > &  pos,
const BoundingBox &  box 
)
staticprotected

Finds the shortest connection between the given point and the object which is defined by its connection positions and its bounding box. If the method fails, e.g. because one of the vectors is empty or the bounding box contains values we can't use for calculations (inf,NAN), POSITION_UNDEFINED

◆ findShortestConnection() [2/2]

static bool CCellDesignerImporter::findShortestConnection ( std::vector< POSITION > &  pos1,
std::vector< POSITION > &  pos2,
const BoundingBox &  box1,
const BoundingBox &  box2 
)
staticprotected

Finds the shortest connection between two objects given the potential connection positions for each object and the bounding boxes for each object. The result is returned in the original vectors as position values. If the method fails, e.g. because one of the vectors is empty or the bounding box contains values we can't use for calculations (inf,NAN), false is returned.

◆ getColorString()

std::string CCellDesignerImporter::getColorString ( const std::string &  color_id) const
protected

Returns the color string for the given color id or an empty string if the color id was not found.

◆ getLayout()

const Layout * CCellDesignerImporter::getLayout ( ) const

Method to return the layout object. Since the layout object is owned by the importer, the caller should make a copy of the layout.

References mpLayout.

◆ getPositionPoint()

Point CCellDesignerImporter::getPositionPoint ( const BoundingBox &  box,
POSITION  position 
)
staticprotected

Takes a bounding box and a position string and returns the position on the bounding box that corresponds to the given position.

Takes a bounding box and a position string and retirns the position on the bounding box that corresponds to the given position.

References POSITION_E, POSITION_ENE, POSITION_ESE, POSITION_N, POSITION_NE, POSITION_NNE, POSITION_NNW, POSITION_NW, POSITION_S, POSITION_SE, POSITION_SSE, POSITION_SSW, POSITION_SW, POSITION_W, POSITION_WNW, and POSITION_WSW.

Referenced by createBiUniCurve(), createSpeciesReferenceGlyphs(), createUniBiCurve(), and createUniUniCurve().

◆ getSBMLDocument()

const SBMLDocument * CCellDesignerImporter::getSBMLDocument ( ) const

Method to return a const pointer to the SBMLDocument.

References mpDocument.

◆ handleExtraReactionElements()

bool CCellDesignerImporter::handleExtraReactionElements ( ReactionGlyph *  pRGlyph,
ReactionAnnotation ranno,
bool  substrate 
)
protected

Creates the structures for the extra product links. If processing fails, false is returned;

Referenced by convertReactionAnnotation().

◆ handleIncludedSpecies()

bool CCellDesignerImporter::handleIncludedSpecies ( const XMLNode *  pNode)
protected

Tries to parse the CellDesigner species in the listOfincludedSpecies. If parsing fails, false is returned.

Referenced by convertCellDesignerLayout().

◆ handleModificationLinks()

bool CCellDesignerImporter::handleModificationLinks ( ReactionGlyph *  pRGlyph,
ReactionAnnotation ranno 
)
protected

Creates the structures for the modification links in a reaction. If processing fails, false is returned;

Referenced by convertReactionAnnotation().

◆ isDefaultOrEmpty()

bool CCellDesignerImporter::isDefaultOrEmpty ( const Line line)
staticprotected

References Line::mColor, and Line::mWidth.

Referenced by createStyleFromLine().

◆ modificationLinkTypeToEnum()

◆ modificationTypeToEnum()

MODIFICATION_TYPE CCellDesignerImporter::modificationTypeToEnum ( std::string  s)
staticprotected

◆ paintSchemeToEnum()

PAINT_SCHEME CCellDesignerImporter::paintSchemeToEnum ( std::string  s)
staticprotected

Converts the given paint scheme string to the corresponding PAINT_SCHEME enum value. If no enum is found, PAINT_UNDEFINED is returned.

References PAINT_COLOR, PAINT_GRADIENT, and PAINT_UNDEFINED.

◆ parseBounds()

static bool CCellDesignerImporter::parseBounds ( const XMLNode *  pNode,
BoundingBox &  box 
)
staticprotected

Parse the data in the given node assuming that this is a node that represents a point and therefore contains an "x" and a "y" attribute. The data is stored in the given point object. If parsing fails, false is returned.

◆ parseBoxSize()

static bool CCellDesignerImporter::parseBoxSize ( const XMLNode *  pNode,
Dimensions &  d 
)
staticprotected

Parses the given node and stored the information in the width and height attribute in the given dimensions object. If parsinf fails, false is returned.

◆ parseCompartmentAlias()

static bool CCellDesignerImporter::parseCompartmentAlias ( const XMLNode *  pNode,
CompartmentAlias ca,
const Dimensions &  layout_dimensions 
)
staticprotected

Parses the data in the given node which represents a compartment alias and stores it in the given CompartmentAlias structure. If parsing fails, false is returned.

Referenced by createCompartmentGlyphs().

◆ parseCompartmentAnnotation()

bool CCellDesignerImporter::parseCompartmentAnnotation ( const XMLNode *  pNode,
CompartmentAnnotation anno 
)
staticprotected

Tries to parse the compartment annotation in the given node and stores the data in the given CompartmentAnnotation structure. If parsing fails, false is returned.

References findChildNode(), and CompartmentAnnotation::mName.

Referenced by convertCompartmentAnnotations().

◆ parseConnectScheme()

bool CCellDesignerImporter::parseConnectScheme ( const XMLNode *  pNode,
ConnectScheme scheme 
)
staticprotected

Tries to parse the connection scheme in the given node and stores the data in the given ConnectionScheme structure. If parsing fails, false is returned.

References connectionPolicyToEnum(), FAIL_WITH_ERROR, findChildNode(), ConnectScheme::mLineDirections, ConnectScheme::mPolicy, ConnectScheme::mRectangleIndex, parseLineDirection(), and POLICY_UNDEFINED.

Referenced by parseReactionAnnotation(), and parseReactionModification().

◆ parseDoubleLine()

static bool CCellDesignerImporter::parseDoubleLine ( const XMLNode *  pNode,
DoubleLine dl 
)
staticprotected

Parses the given XMLNode which represents a double line element. The parsed data is stored in the given DoubleLine structure. If parsing fails, false is returned.

◆ parseEditPoints()

bool CCellDesignerImporter::parseEditPoints ( const XMLNode *  pNode,
EditPoints editpoints 
)
staticprotected

Tries to parse the edit points in the given node and stores the data in the given vector of Points. If parsing fails, false is returned.

References FAIL_WITH_ERROR, EditPoints::mNum0, EditPoints::mNum1, EditPoints::mNum2, EditPoints::mOmittedShapeIndex, EditPoints::mPoints, EditPoints::mTShapeIndex, and parsePointsString().

Referenced by parseReactionAnnotation().

◆ parseExtraLink()

bool CCellDesignerImporter::parseExtraLink ( const XMLNode *  pNode,
ReactantLink l 
)
staticprotected

Tries to parse the reactant link in the given node and stores the data in the given vector of ReactionLink structure. If parsing fails, false is returned.

Tries to parse the wreactant link in the given node and stores the data in the given vector of ReactionLink structure. If parsing fails, false is returned.

References FAIL_WITH_ERROR, findChildNode(), ReactantLink::mAlias, ReactantLink::mLine, ReactantLink::mPosition, ReactantLink::mReactant, ReactantLink::mTargetLineIndex, parseLine(), POSITION_UNDEFINED, positionToEnum(), and splitString().

Referenced by parseExtraLinks().

◆ parseExtraLinks()

bool CCellDesignerImporter::parseExtraLinks ( const XMLNode *  pNode,
std::vector< ReactantLink > &  rlinks 
)
staticprotected

Tries to parse the extra reactant links in the given node and stores the data in the given vector of ReactantLinks structure. If parsing fails, false is returned.

References FAIL_WITH_ERROR, and parseExtraLink().

Referenced by parseReactionAnnotation().

◆ parseLine()

bool CCellDesignerImporter::parseLine ( const XMLNode *  pNode,
Line line 
)
staticprotected

Tries to parse the line data in the given node and stores the data in the given Line structure. If parsing fails, false is returned.

References FAIL_WITH_ERROR, Line::mColor, Line::mCurve, and Line::mWidth.

Referenced by parseExtraLink(), parseReactionAnnotation(), and parseReactionModification().

◆ parseLineDirection()

bool CCellDesignerImporter::parseLineDirection ( const XMLNode *  pNode,
LineDirection d 
)
staticprotected

Tries to parse the line direction in the given node and stores the data in the given vector of LineDirection structure. If parsing fails, false is returned.

References DIRECTION_UNDEFINED, directionToEnum(), FAIL_WITH_ERROR, LineDirection::mArm, LineDirection::mIndex, and LineDirection::mValue.

Referenced by parseConnectScheme().

◆ parseLinkTarget()

bool CCellDesignerImporter::parseLinkTarget ( const XMLNode *  pNode,
LinkTarget l 
)
staticprotected

Tries to parse the link target in the given node and stores the data in the given vector of LinkTarget structure. If parsing fails, false is returned.

References FAIL_WITH_ERROR, findChildNode(), LinkTarget::mAlias, LinkTarget::mPosition, LinkTarget::mSpecies, POSITION_UNDEFINED, and positionToEnum().

Referenced by parseReactionElements(), and parseReactionModification().

◆ parseModelDisplay()

static bool CCellDesignerImporter::parseModelDisplay ( const XMLNode *  pNode,
Dimensions &  d 
)
staticprotected

Parses the modelDisplay data in the given XMLNode and stores the result in the given Dimensions structure. If parsing fails, false is returned.

Referenced by convertCellDesignerLayout().

◆ parsePaint()

static bool CCellDesignerImporter::parsePaint ( const XMLNode *  pNode,
Paint p 
)
staticprotected

Parses the paint data in the given XMLNode and stores the result in the given Paint structure. If parsing fails, false is returned.

◆ parsePoint()

static bool CCellDesignerImporter::parsePoint ( const XMLNode *  pNode,
Point &  p 
)
staticprotected

Parse the data in the given node assuming that this is a node that represents a point and therefore contains an "x" and a "y" attribute. The data is stored in the given point object. If parsing fails, false is returned.

◆ parsePointsString()

static bool CCellDesignerImporter::parsePointsString ( const std::string &  s,
std::vector< Point > &  points 
)
staticprotected

Tries to parse the w2D points in the given string and stores the data in the given vector of Points. If parsing fails, false is returned.

Referenced by parseEditPoints(), and parseReactionModification().

◆ parseProteinModification()

bool CCellDesignerImporter::parseProteinModification ( const XMLNode *  pNode,
ProteinModification mod 
)
staticprotected

Tries to parse the protein modification in the given node and stores the data in the given ProteinModification structure. If parsing fails, false is returned.

References FAIL_WITH_ERROR, ProteinModification::mAngle, ProteinModification::mId, and ProteinModification::mName.

Referenced by parseProteins().

◆ parseProteins()

bool CCellDesignerImporter::parseProteins ( const XMLNode *  pNode)
protected

Goes through the children of the given node which represents a list of protein definitions and check the types. If the type is RECEPTOR, ION_CHANNEL or TRUNCATED, store that information.

Goes through the children of the given node which represents a list of protein definitions and collects the names for them. These names are converted to text glyphs for the proteins. bool CCellDesignerImporter::parseGeneNames(const XMLNode* pNode) { bool result=true; if(pNode != NULL && pNode->getName() == "listOfGenes") { std::string prefix=pNode->getPrefix(); unsigned int i,iMax=pNode->getNumChildren(); const XMLNode* pChild=NULL; for(i=0;i<iMax;++i) { pChild=&pNode->getChild(i); if(pChild != NULL && pChild->getPrefix() == prefix && pChild->getName() == "gene" && pChild->getAttributes().hasAttribute("id") && pChild->getAttributes().hasAttribute("name")) { std::string id=pChild->getAttributes().getValue("id"); assert(!id.empty()); std::string name=pChild->getAttributes().getValue("name"); assert(!name.empty()); this->mGeneNameMap.insert(std::pair<std::string,std::string>(id,name)); } } } return result; } Goes through the children of the given node which represents a list of protein definitions and collects the names for them. These names are converted to text glyphs for the proteins. bool CCellDesignerImporter::parseRNANames(const XMLNode* pNode) { bool result=true; if(pNode != NULL && pNode->getName() == "listOfRNAs") { std::string prefix=pNode->getPrefix(); unsigned int i,iMax=pNode->getNumChildren(); const XMLNode* pChild=NULL; for(i=0;i<iMax;++i) { pChild=&pNode->getChild(i); if(pChild != NULL && pChild->getPrefix() == prefix && pChild->getName() == "RNA" && pChild->getAttributes().hasAttribute("id") && pChild->getAttributes().hasAttribute("name")) { std::string id=pChild->getAttributes().getValue("id"); assert(!id.empty()); std::string name=pChild->getAttributes().getValue("name"); assert(!name.empty()); this->mRNANameMap.insert(std::pair<std::string,std::string>(id,name)); } } } return result; } Goes through the children of the given node which represents a list of protein definitions and collects the names for them. These names are converted to text glyphs for the proteins. bool CCellDesignerImporter::parseASRNANames(const XMLNode* pNode) { bool result=true; if(pNode != NULL && pNode->getName() == "listOfAntisenseRNAs") { std::string prefix=pNode->getPrefix(); unsigned int i,iMax=pNode->getNumChildren(); const XMLNode* pChild=NULL; for(i=0;i<iMax;++i) { pChild=&pNode->getChild(i); if(pChild != NULL && pChild->getPrefix() == prefix && pChild->getName() == "AntisenseRNA" && pChild->getAttributes().hasAttribute("id") && pChild->getAttributes().hasAttribute("name")) { std::string id=pChild->getAttributes().getValue("id"); assert(!id.empty()); std::string name=pChild->getAttributes().getValue("name"); assert(!name.empty()); this->mASRNANameMap.insert(std::pair<std::string,std::string>(id,name)); } } } return result; } Goes through the children of the given node which represents a list of protein definitions and check the types. If the type is RECEPTOR, ION_CHANNEL or TRUNCATED, store that information.

References classToEnum(), FAIL_WITH_ERROR, findChildNode(), Protein::mId, Protein::mModifications, Protein::mName, mProteinInformationMap, Protein::mType, parseProteinModification(), and UNDEFINED_CLASS.

Referenced by convertCellDesignerLayout().

◆ parseReactionAnnotation()

◆ parseReactionElements()

bool CCellDesignerImporter::parseReactionElements ( const XMLNode *  pNode,
std::vector< LinkTarget > &  elements 
)
staticprotected

Tries to parse the reaction elements (baseReactants or baseProducts) in the given node and stores the data in the given ReactionAnnotation structure. If parsing fails, false is returned.

Tries to parse the reaction elements (baseReamctants or baseProducts) in the given node and stores the data in the given ReactionAnnotation structure. If parsing fails, false is returned.

References FAIL_WITH_ERROR, and parseLinkTarget().

Referenced by parseReactionAnnotation().

◆ parseReactionModification()

◆ parseReactionModifications()

bool CCellDesignerImporter::parseReactionModifications ( const XMLNode *  pNode,
std::vector< ReactionModification > &  rmods 
)
staticprotected

Tries to parse the reaction modifications in the given node and stores the data in the given vector of ReactionModifications. If parsing fails, false is returned.

References FAIL_WITH_ERROR, and parseReactionModification().

Referenced by parseReactionAnnotation().

◆ parseSpeciesAlias()

static bool CCellDesignerImporter::parseSpeciesAlias ( const XMLNode *  pNode,
SpeciesAlias sa 
)
staticprotected

Parses the data in the given node which represents a species (or ComplexSpecies) alias and stores it in the given SpeciesAlias structure. If parsing fails, false is returned.

Referenced by createSpeciesGlyphs().

◆ parseSpeciesAnnotation()

bool CCellDesignerImporter::parseSpeciesAnnotation ( const XMLNode *  pNode,
SpeciesAnnotation anno 
)
staticprotected

Tries to parse the species annotation in the given node and stores the data in the given SpeciesAnnotation structure. If parsing fails, false is returned.

References FAIL_WITH_ERROR, findChildNode(), SpeciesAnnotation::mIdentity, and parseSpeciesIdentity().

Referenced by convertSpeciesAnnotations().

◆ parseSpeciesIdentity()

bool CCellDesignerImporter::parseSpeciesIdentity ( const XMLNode *  pNode,
SpeciesIdentity identity 
)
staticprotected

Parses the node which represents a speciesIdentity node and fills the given SpeciesIdentity structure with the data. If the parsing fails, false is returned.

Parses the node which represents a speciesIdentity node and fills the given SpeciesIdentity structure with the data. If the parsinf fails, false is returned.

References classToEnum(), COMPLEX_CLASS, FAIL_WITH_ERROR, findChildNode(), ION_CLASS, SpeciesIdentity::mHypothetical, SpeciesIdentity::mNameOrReference, SpeciesIdentity::mSpeciesClass, SpeciesIdentity::mState, parseSpeciesState(), PROTEIN_CLASS, and SIMPLE_MOLECULE_CLASS.

Referenced by parseSpeciesAnnotation().

◆ parseSpeciesModification()

bool CCellDesignerImporter::parseSpeciesModification ( const XMLNode *  pNode,
SpeciesModification mod 
)
staticprotected

Parses the node which represents a modification ion a species node and fills the given SpeciesModification structure with the data. If the parsing fails, false is returned.

References FAIL_WITH_ERROR, SpeciesModification::mResidue, SpeciesModification::mType, speciesModificationTypeToEnum(), and UNDEFINED_MOD_TYPE.

Referenced by parseSpeciesState().

◆ parseSpeciesState()

bool CCellDesignerImporter::parseSpeciesState ( const XMLNode *  pNode,
SpeciesState state 
)
staticprotected

Parses the node which represents the state in a speciesIdentity node and fills the given SpeciesState structure with the data. If the parsing fails, false is returned.

References FAIL_WITH_ERROR, findChildNode(), SpeciesState::mModifications, and parseSpeciesModification().

Referenced by parseSpeciesIdentity().

◆ parseUsualView()

static bool CCellDesignerImporter::parseUsualView ( const XMLNode *  pNode,
UsualView view 
)
staticprotected

Parses the data in the given node which represents a UsualView object and stores the parsed data in the given UsualView structure. If parsinf fails, false is returned.

◆ positionToCompartmentToEnum()

POSITION_TO_COMPARTMENT CCellDesignerImporter::positionToCompartmentToEnum ( std::string  s)
staticprotected

Converts the given position to compartment string to the corresponding enum. If there is no enum that corresponds to the string, UNDEFINED_POSITION is returned.

References INNER_SURFACE, INSIDE, INSIDE_MEMBRANE, OUTER_SURFACE, TRANSMEMBRANE, and UNDEFINED_POSITION.

◆ positionToEnum()

POSITION CCellDesignerImporter::positionToEnum ( std::string  pos)
staticprotected

◆ reactionTypeToEnum()

◆ removeCurrentLayout()

void CCellDesignerImporter::removeCurrentLayout ( )

removes the current layout

References mpDocument, mpLayout, and mpModel.

Referenced by convertCellDesignerLayout(), and setSBMLDocument().

◆ replaceStringInPlace()

static void CCellDesignerImporter::replaceStringInPlace ( std::string &  subject,
const std::string &  search,
const std::string &  replace 
)
staticprotected

◆ rotate()

static void CCellDesignerImporter::rotate ( const Point &  p,
double  a,
Point &  r 
)
staticprotected

Calculates the position of point p after rotation by angle a around the origin. The angle is given in radians. The result is returned in r.

Referenced by createProteinModification().

◆ setProductStyle()

void CCellDesignerImporter::setProductStyle ( const std::string &  id,
LocalStyle *  pReactionStyle 
)

References createUniqueId(), max, and mpLocalRenderInfo.

Referenced by createProduct().

◆ setSBMLDocument()

void CCellDesignerImporter::setSBMLDocument ( SBMLDocument *  pDocument)

Method to set the SBMLDocument. If the pointer is not NULL, the class will try to directly convert the CellDesigner layout if there is one.

References convertCellDesignerLayout(), findCellDesignerAnnotation(), mpDocument, mpModel, and removeCurrentLayout().

Referenced by CCellDesignerImporter().

◆ setSpeciesGlyphId()

bool CCellDesignerImporter::setSpeciesGlyphId ( SpeciesReferenceGlyph *  pGlyph,
const LinkTarget link 
)
protected

Tries to set the species glyph id in the given species reference glyph.

Referenced by createBiUniCurve(), createProduct(), createSubstrate(), and createUniBiCurve().

◆ setSpeciesReferenceId()

bool CCellDesignerImporter::setSpeciesReferenceId ( SpeciesReferenceGlyph *  pGlyph,
const LinkTarget link,
const std::string &  reactionId 
)
protected

Tries to set the species reference id on the given SPeciesReferenceGlyph.

Referenced by createBiUniCurve(), createProduct(), createSubstrate(), and createUniBiCurve().

◆ speciesModificationTypeToEnum()

static SPECIES_MODIFICATION_TYPE CCellDesignerImporter::speciesModificationTypeToEnum ( std::string  cl)
staticprotected

◆ splitString()

static bool CCellDesignerImporter::splitString ( const std::string &  s,
std::vector< std::string > &  parts,
const std::string &  splitChars 
)
staticprotected

Splits the given string at each character occurs in splitChars. The parts generated are stored in the given vector. The vector is cleared by the method. If something goes wrong false is returned.

Referenced by parseExtraLink(), and parseReactionModification().

Member Data Documentation

◆ mCDBounds

std::map<std::string, BoundingBox> CCellDesignerImporter::mCDBounds
protected

◆ mCDIdToLayoutElement

std::map<std::string, GraphicalObject*> CCellDesignerImporter::mCDIdToLayoutElement
protected

◆ mColorStringMap

std::map<std::string, std::string> CCellDesignerImporter::mColorStringMap
protected

◆ mCompartmentAliasMap

std::map<const CompartmentGlyph*, CompartmentAlias> CCellDesignerImporter::mCompartmentAliasMap
protected

◆ mCompartmentAnnotationMap

std::map<std::string, CompartmentAnnotation> CCellDesignerImporter::mCompartmentAnnotationMap
protected

a map that stores the compartment annotation with each compartment.

Referenced by convertCellDesignerLayout(), and convertCompartmentAnnotations().

◆ mCompartmentNamePointMap

std::map<const CompartmentGlyph*, Point> CCellDesignerImporter::mCompartmentNamePointMap
protected

◆ mComplexDependencies

std::list<CCopasiNode<std::string>*> CCellDesignerImporter::mComplexDependencies
protected

◆ mFont

std::string CCellDesignerImporter::mFont
protected

the font to be used for text glyphs

Referenced by createPrimitive(), and createProteinModification().

◆ mIdMap

◆ mIncludedSpeciesNameMap

std::map<std::string, std::pair<std::string, SpeciesIdentity> > CCellDesignerImporter::mIncludedSpeciesNameMap
protected

a map that stores the name of a CellDesigner species with its id.

Referenced by createSpeciesStyles().

◆ mModelIdToLayoutElement

std::multimap<std::string, GraphicalObject*> CCellDesignerImporter::mModelIdToLayoutElement
protected

◆ mModificationLinkStyleMap

std::map<MODIFICATION_LINK_TYPE, LocalStyle*> CCellDesignerImporter::mModificationLinkStyleMap
protected

a map that associated a modifier type with the corresponding style.

◆ mpDocument

◆ mpLayout

◆ mpLocalRenderInfo

LocalRenderInformation* CCellDesignerImporter::mpLocalRenderInfo
protected

◆ mpModel

◆ mProteinInformationMap

std::map<std::string, Protein> CCellDesignerImporter::mProteinInformationMap
protected

◆ mSpeciesAliases

std::map<std::string, SpeciesAlias> CCellDesignerImporter::mSpeciesAliases
protected

a map that associates the parsed alias data with the id of the species alias or complex species alias

Referenced by convertCellDesignerLayout(), createSpeciesGlyph(), and createSpeciesStyles().

◆ mSpeciesAliasMap

std::map<const SpeciesGlyph*, SpeciesAlias> CCellDesignerImporter::mSpeciesAliasMap
protected

◆ mSpeciesAnnotationMap

std::map<std::string, SpeciesAnnotation> CCellDesignerImporter::mSpeciesAnnotationMap
protected

a map that stores the species annotation with each species.

Referenced by convertCellDesignerLayout(), convertSpeciesAnnotations(), and createSpeciesStyles().


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