6 #ifndef CCopasiSpringLayout_H
7 #define CCopasiSpringLayout_H
44 std::vector<double>
min;
45 std::vector<double>
max;
50 names.push_back(
"repulsion");
51 values.push_back(100000.0);
54 isLog.push_back(
true);
57 names.push_back(
"edge length");
61 isLog.push_back(
false);
63 names.push_back(
"edge strength");
67 isLog.push_back(
true);
70 names.push_back(
"side edge length");
74 isLog.push_back(
false);
76 names.push_back(
"side edge strength");
80 isLog.push_back(
true);
83 names.push_back(
"2nd order edge strength");
87 isLog.push_back(
true);
90 names.push_back(
"compartment strength on species");
94 isLog.push_back(
true);
97 names.push_back(
"compartment strength on reactions");
101 isLog.push_back(
true);
129 virtual bool setState(
const std::vector<double> & vars);
151 const std::set<const CCompartment*>& compartments,
152 const std::set<const CReaction*>& reactions,
153 const std::set<const CMetab*>& metabs,
154 const std::set<const CMetab*>& sideMetabs,
155 Parameters* mParams = NULL
183 static inline double distance(
const double & x1,
const double & y1,
184 const double & x2,
const double & y2)
186 return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
191 const double & x2,
const double & y2,
const double &
max)
196 if (fabs(x1 - x2) > max)
return max;
198 if (fabs(y1 - y2) > max)
return max;
200 double tmp = sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
201 return tmp > max ? max : tmp;
281 #endif // CCopasiSpringLayout_H
bool initFromLayout(CLayout *layout, Parameters *ppp)
performs all initializations that are later needed to calculate the potential
std::vector< double > values
CCopasiSpringLayout(CLayout *layout, Parameters *ppp=NULL)
virtual const std::vector< UpdateAction > & getUpdateActions() const
std::vector< double > mInitialState
UpdateAction(Update_Enum action, CLBase *target, int index1=-1, int index2=-1, int index3=-1, int index4=-1)
double potSecondOrderEdge(const CLMetabReferenceGlyph &e1, const CLMetabReferenceGlyph &e2, double &dist) const
static double distance(const double &x1, const double &y1, const double &x2, const double &y2)
double potEdge(const CLMetabReferenceGlyph &e, const CLReactionGlyph &r) const
const CLGraphicalObject * source
double potSpeciesCompartment(const CLMetabGlyph &s, const CLCompartmentGlyph &c) const
std::vector< UpdateAction > mUpdateActions
this is the list of all update actions that have to be performed during setState(); ...
double potGeneralEdge(const CLReferenceGlyph &e, const CLGeneralGlyph &r) const
CLPoint borderProjection(CLGraphicalObject *go, const CLPoint &p, double d)
std::vector< double > defaultValues
void addPositionVariables(CLGraphicalObject *pGO)
create variables for the position of a species glyph
static CLayout * createLayout(CCopasiContainer *parent, const std::set< const CCompartment * > &compartments, const std::set< const CReaction * > &reactions, const std::set< const CMetab * > &metabs, const std::set< const CMetab * > &sideMetabs, Parameters *mParams=NULL)
void addCompartmentVariables(CLCompartmentGlyph *cg)
create variables for size and position of a compartment glyph
virtual double getPotential()
std::vector< CoordinateRelation > mFixedRelations
a list of fixed positon relations between objects. Should be constructed in initFromLayout() ...
double potReactionReaction(const CLReactionGlyph &a, const CLReactionGlyph &b) const
std::vector< bool > isLog
static double bound_distance(const double &x1, const double &y1, const double &x2, const double &y2, const double &max)
this describes one update action that has to be performed during setState()
double potReactionCompartment(const CLReactionGlyph &r, const CLCompartmentGlyph &c) const
CLGraphicalObject * target
std::map< CLBase *, CLCompartmentGlyph * > mCompartmentMap
this map contains information about the compartment glyph a given glyph is located in ...
double potSpeciesSpecies(const CLMetabGlyph &a, const CLMetabGlyph &b) const
virtual const std::vector< double > & getInitialValues() const
double potSpeciesReaction(const CLMetabGlyph &a, const CLReactionGlyph &b) const
void addReactionVariables(CLReactionGlyph *rg)
create variables for the position of a reaction glyph
std::vector< double > max
std::vector< std::string > names
std::vector< double > min
virtual bool setState(const std::vector< double > &vars)
CLCompartmentGlyph * findCompartmentForReactionNode(CLReactionGlyph &r)