12 #ifndef __SBNW_NETWORK_H_ 13 #define __SBNW_NETWORK_H_ 26 #include "autolayoutSBML.h" 28 #include "sbml/SBMLTypes.h" 29 #include "sbml/packages/layout/common/LayoutExtensionTypes.h" 36 namespace LibsbmlDraw {
44 std::string eltTypeToStr(
const NetworkEltType t);
46 void dumpEltType(std::ostream& os,
const NetworkEltType t, uint32 ind);
49 inline bool typeMatchEither(
const NetworkEltType a,
const NetworkEltType b,
const NetworkEltType z) {
60 bool haveDefaultCompartmentId();
62 void setDefaultCompartmentId(
const std::string&
id);
64 std::string getDefaultCompartmentId();
68 class SubCurve :
public RxnBezier {
71 RxnCurveType getRole()
const {
72 return RXN_CURVE_SUBSTRATE;
75 Point getCentroidCP()
const {
return c2; }
77 bool isStartNodeSide()
const {
return true; }
79 virtual bool hasArrowhead()
const {
return true; }
81 ArrowheadStyle getArrowheadStyle()
const;
84 virtual Arrowhead* getArrowhead() {
85 Arrowhead* result =
new SubstrateArrowhead();
86 transformArrowhead(*result);
93 class PrdCurve :
public RxnBezier {
96 RxnCurveType getRole()
const {
97 return RXN_CURVE_PRODUCT;
100 Point getCentroidCP()
const {
return c1; }
102 bool isStartNodeSide()
const {
return false; }
104 virtual bool hasArrowhead()
const {
return true; }
106 ArrowheadStyle getArrowheadStyle()
const;
109 virtual Arrowhead* getArrowhead() {
110 Arrowhead* result =
new ProductArrowhead();
111 transformArrowhead(*result);
118 class ActCurve :
public RxnBezier {
121 RxnCurveType getRole()
const {
122 return RXN_CURVE_ACTIVATOR;
125 Point getCentroidCP()
const {
return c2; }
127 bool isStartNodeSide()
const {
return true; }
129 virtual bool hasArrowhead()
const {
return true; }
131 ArrowheadStyle getArrowheadStyle()
const;
134 virtual Arrowhead* getArrowhead() {
135 Arrowhead* result =
new ActivatorArrowhead();
136 transformArrowhead(*result);
143 class InhCurve :
public RxnBezier {
146 RxnCurveType getRole()
const {
147 return RXN_CURVE_INHIBITOR;
150 Point getCentroidCP()
const {
return c2; }
152 bool isStartNodeSide()
const {
return true; }
154 virtual bool hasArrowhead()
const {
return true; }
156 ArrowheadStyle getArrowheadStyle()
const;
159 virtual Arrowhead* getArrowhead() {
160 Arrowhead* result =
new InhibitorArrowhead();
161 transformArrowhead(*result);
168 class ModCurve :
public RxnBezier {
171 RxnCurveType getRole()
const {
172 return RXN_CURVE_MODIFIER;
175 Point getCentroidCP()
const {
return c2; }
177 bool isStartNodeSide()
const {
return true; }
179 virtual bool hasArrowhead()
const {
return true; }
181 ArrowheadStyle getArrowheadStyle()
const;
184 virtual Arrowhead* getArrowhead() {
185 Arrowhead* result =
new ModifierArrowhead();
186 transformArrowhead(*result);
191 extern ArrowheadStyle sub_arrow_style_;
192 inline ArrowheadStyle ArrowheadStyleLookup(
const SubCurve* ) {
193 return sub_arrow_style_;
196 extern ArrowheadStyle prod_arrow_style_;
197 inline ArrowheadStyle ArrowheadStyleLookup(
const PrdCurve* ) {
198 return prod_arrow_style_;
201 extern ArrowheadStyle act_arrow_style_;
202 inline ArrowheadStyle ArrowheadStyleLookup(
const ActCurve* ) {
203 return act_arrow_style_;
206 extern ArrowheadStyle inh_arrow_style_;
207 inline ArrowheadStyle ArrowheadStyleLookup(
const InhCurve* ) {
208 return inh_arrow_style_;
211 extern ArrowheadStyle mod_arrow_style_;
212 inline ArrowheadStyle ArrowheadStyleLookup(
const ModCurve* ) {
213 return mod_arrow_style_;
224 class NetworkElement {
233 : _pset(0), _v(0,0), _deg(0), _ldeg(0), _lock(0), networkEltBytePattern_(0x1199) {}
236 NetworkEltType getType()
const {
return _type; }
238 bool hasNetworkElementBase() {
239 if(networkEltBytePattern_ == 0x1199)
246 void set_degree(uint64 deg) { _deg = deg; }
247 virtual uint64 degree()
const {
return _deg; }
248 virtual uint64& degree() {
return _deg; }
251 virtual void resetActivity();
254 void addDelta(
const Point& d);
257 void capDelta(
const Real cap);
260 virtual void capDelta2(
const Real cap2);
263 virtual void doMotion(
const Real scale);
266 virtual void setCentroid(
const Point& p);
267 virtual void setGlobalCentroid(
const Point& p);
268 void setCentroid(
Real x,
Real y) { setCentroid(Point(x,y)); }
270 virtual bool isCentroidSet()
const {
return _pset; }
273 virtual Point getCentroid(COORD_SYSTEM coord = COORD_SYSTEM_LOCAL)
const;
278 Point getMin(COORD_SYSTEM coord = COORD_SYSTEM_LOCAL)
const {
return getExtents(coord).getMin(); }
279 Point getMax(COORD_SYSTEM coord = COORD_SYSTEM_LOCAL)
const {
return getExtents(coord).getMax(); }
281 Real getMinX(COORD_SYSTEM coord = COORD_SYSTEM_LOCAL)
const {
return getExtents(coord).getMin().x; }
282 Real getMaxX(COORD_SYSTEM coord = COORD_SYSTEM_LOCAL)
const {
return getExtents(coord).getMax().x; }
283 Real getMinY(COORD_SYSTEM coord = COORD_SYSTEM_LOCAL)
const {
return getExtents(coord).getMin().y; }
284 Real getMaxY(COORD_SYSTEM coord = COORD_SYSTEM_LOCAL)
const {
return getExtents(coord).getMax().y; }
287 Real getWidth(COORD_SYSTEM coord = COORD_SYSTEM_LOCAL)
const { AT(getMaxX(coord) >= getMinX(coord));
return getMaxX(coord) - getMinX(coord); }
288 Real getHeight(COORD_SYSTEM coord = COORD_SYSTEM_LOCAL)
const { AT(getMaxY(coord) >= getMinY(coord));
return getMaxY(coord) - getMinY(coord); }
291 Real getGlobalWidth()
const { AT(getMaxX() >= getMinX());
return (getMaxX() - getMinX())*tf_.scaleFactor(); }
292 Real getGlobalHeight()
const { AT(getMaxY() >= getMinY());
return (getMaxY() - getMinY())*tf_.scaleFactor(); }
296 virtual Box getExtents(COORD_SYSTEM coord = COORD_SYSTEM_LOCAL)
const {
298 case COORD_SYSTEM_LOCAL:
299 return getLocalExtents();
300 case COORD_SYSTEM_GLOBAL:
301 return tf_*getLocalExtents();
303 AN(0,
"Unknown coord system");
304 return getLocalExtents();
310 virtual Box getLocalExtents()
const {
316 void setExtents(
const Box& b) { _ext = b; recalcCentroid(); }
318 Box getBoundingBox()
const {
return getExtents(); }
321 virtual void applyTransform(
const Affine2d& t) {
322 _ext = xformBox(_ext, t);
323 _p = xformPoint(_p, t);
326 virtual void applyDisplacement(
const Point& d) {
332 void recalcCentroid() { _p = (_ext.getMin() + _ext.getMax())*0.5; }
335 virtual void recalcExtents() = 0;
338 void lock() { _lock = 1; }
341 void unlock() { _lock = 0; }
344 bool isLocked()
const {
return _lock; }
346 NetworkEltShape getShape()
const {
return _shape; }
349 virtual bool isContainer()
const = 0;
352 Real radius()
const {
return _r; }
355 Real distance(
const NetworkElement& e)
const;
358 bool overlap(
const NetworkElement& e)
const;
362 Point forceVec(
const NetworkElement& e)
const;
365 Point centroidDisplacementFrom(
const NetworkElement& e)
const;
368 void forceVec_(
const NetworkElement& e, Point& p)
const;
370 virtual void dump(std::ostream& os, uint32 ind) = 0;
373 virtual void dumpForces(std::ostream& os, uint32 ind)
const = 0;
375 virtual Affine2d getTransform()
const {
return tf_; }
377 virtual void setTransform(
const Affine2d& tf,
bool recurse =
true) { tf_ = tf; }
379 virtual Affine2d getInverseTransform()
const {
return itf_; }
381 virtual void setInverseTransform(
const Affine2d& itf,
bool recurse =
true) { itf_ = itf; }
399 NetworkEltShape _shape;
401 NetworkEltType _type;
409 long networkEltBytePattern_;
416 class Node :
public NetworkElement {
421 _shape = ELT_SHAPE_RECT;
423 _type = NET_ELT_TYPE_SPEC;
424 _ext = Box(0,0,40,20);
425 bytepattern = 0xc455;
432 void setName(
const std::string& name);
435 const std::string& getName()
const;
438 const std::string& getId()
const;
441 void setId(
const std::string&
id);
444 const std::string& getGlyph()
const;
447 void setGlyph(
const std::string&
id);
452 uint32& numUses() {
return _numUses; }
453 uint32 numUses()
const {
return _numUses; }
457 bool isAlias()
const {
return _isAlias; }
460 bool isCommonInstance(
const Node* other)
const;
463 void setAlias(
bool b) { _isAlias = b; }
465 int alias(Network* net);
467 int getSubgraphIndex()
const {
469 SBNW_THROW(InvalidParameterException,
"No subgraph index set",
"Network::getSubgraphIndex");
473 void setSubgraphIndex(
int v) { isub_ = v; }
475 bool isSetSubgraphIndex() {
return isub_ < 0; }
477 void clearSubgraphIndex() { isub_ = -1; }
479 bool excludeFromSubgraphEnum()
const {
return exsub_; }
481 bool setExcludeFromSubgraphEnum() {
return exsub_ =
true; }
483 void clearExcludeFromSubgraphEnum() { exsub_ =
false; }
488 Point getUpperLeftCorner()
const;
490 Point getLowerRightCorner()
const;
492 void recalcExtents() {
493 Real width = _ext.width();
494 Real height = _ext.height();
495 Point del(0.5*width, 0.5*height);
497 _ext = Box(_p - del, _p + del);
498 _r = _ext.maxDim()*0.5;
502 void setWidth(
Real w);
505 void setHeight(
Real h);
508 void affectGlobalWidth(
Real w);
511 void affectGlobalHeight(
Real h);
513 void set_i(
size_t i) { i_ = i; }
514 size_t get_i()
const {
return i_; }
518 bool isContainer()
const {
return false; }
523 void dump(std::ostream& os, uint32 ind);
526 void dumpForces(std::ostream& os, uint32 ind)
const;
530 bool doByteCheck() {
if(bytepattern == 0xc455)
return true;
else return false; }
535 std::string _name, _id;
552 inline Node* CastToNode(
void* p) {
553 NetworkElement* e = (NetworkElement*)p;
554 AN(e->hasNetworkElementBase(),
"Runtime type check failed");
556 AN(dynamic_cast<Node*>(e),
"Runtime type check failed");
557 return dynamic_cast<Node*>(e);
566 RXN_ROLE_SIDESUBSTRATE,
567 RXN_ROLE_SIDEPRODUCT,
573 class RxnCurveFactory {
575 static RxnBezier* CreateCurve(RxnRoleType role);
580 class Reaction :
public NetworkElement {
583 typedef std::pair<Node*, RxnRoleType> SpeciesElt;
585 typedef std::vector< SpeciesElt > NodeVec;
589 typedef std::vector<RxnBezier*> CurveVec;
592 typedef NodeVec::iterator NodeIt;
593 typedef NodeVec::const_iterator ConstNodeIt;
598 typedef CurveVec::iterator CurveIt;
599 typedef CurveVec::const_iterator ConstCurveIt;
601 NodeIt NodesBegin() {
return _spec.begin(); }
602 NodeIt NodesEnd() {
return _spec.end(); }
604 ConstNodeIt NodesBegin()
const {
return _spec.begin(); }
605 ConstNodeIt NodesEnd()
const {
return _spec.end(); }
607 CurveIt CurvesBegin() {
return _curv.begin(); }
608 CurveIt CurvesEnd() {
return _curv.end(); }
610 ConstCurveIt CurvesBegin()
const {
return _curv.begin(); }
611 ConstCurveIt CurvesEnd()
const {
return _curv.end(); }
617 _shape = ELT_SHAPE_ROUND;
618 _type = NET_ELT_TYPE_RXN;
619 bytepattern = 0xff83;
622 void hierarchRelease();
627 const std::string& getId()
const {
return _id; }
630 void setId(
const std::string&
id) { _id = id; }
632 void setName(
const std::string& name) { name_ = name; }
637 uint64 numSpecies()
const {
return _spec.size(); }
640 void addSpeciesRef(Node* n, RxnRoleType role);
643 void removeNode(Node* n);
646 Node* findSpeciesById(
const std::string&
id);
649 bool hasSpecies(
const Node* n)
const;
652 uint64 degree(
const Node* n);
654 RxnRoleType getSpeciesRole(
size_t i) {
return _spec.at(i).second; }
656 RxnRoleType getSpeciesRole(Node* n);
658 Node* getSpecies(
size_t i) {
return _spec.at(i).first; }
664 void substituteSpeciesById(
const std::string&
id, Node* spec);
668 void substituteSpeciesByIdwRole(
const std::string&
id, Node* spec, RxnRoleType role);
672 void substituteSpecies(Node* before, Node* after);
675 CurveVec& getCurves();
679 size_t getNumCurves() { curveGuard();
return _curv.size(); }
683 RxnBezier* getCurve(
size_t i) { curveGuard();
return _curv.at(i); }
686 NodeVec& getSpec() {
return _spec; }
687 const NodeVec& getSpec()
const {
return _spec; }
690 void forceRecalcCentroid();
695 void rebuildCurves();
697 Real calcArrowGap(RxnBezier* c, Node* n);
703 void recalcCurveCPs();
711 bool isContainer()
const {
return false; }
714 void recalcExtents() {
716 _ext = Box(_p - Point(_r,_r), _p + Point(_r,_r));
719 virtual Box getLocalExtents()
const {
720 return Box(getCentroid() - Point(5, 5), getCentroid() + Point(5, 5));
723 virtual void applyTransform(
const Affine2d& t) {
724 NetworkElement::applyTransform(t);
725 for(CurveIt i = CurvesBegin(); i != CurvesEnd(); ++i) {
726 (*i)->applyTransform(t);
730 virtual void setTransform(
const Affine2d& tf,
bool recurse =
true) {
732 for(CurveIt i = CurvesBegin(); i != CurvesEnd(); ++i) {
733 (*i)->setTransform(tf);
737 virtual void setInverseTransform(
const Affine2d& itf,
bool recurse =
true) {
739 for(CurveIt i = CurvesBegin(); i != CurvesEnd(); ++i) {
740 (*i)->setInverseTransform(itf);
745 void dump(std::ostream& os, uint32 ind);
748 void dumpForces(std::ostream& os, uint32 ind)
const;
750 bool doByteCheck() {
if(bytepattern == 0xff83)
return true;
else return false; }
752 void clearDirtyFlag() { _cdirty =
false; }
755 RxnBezier* addCurve(RxnRoleType role) {
756 _curv.push_back(RxnCurveFactory::CreateCurve(role));
757 _curv.back()->setTransform(itf_);
758 _curv.back()->setInverseTransform(itf_);
772 void recompCentroid();
775 void doCentroidCalc();
778 if(_cdirty && _spec.size()) {
808 inline Reaction* CastToReaction(
void* p) {
809 NetworkElement* e = (NetworkElement*)p;
810 AN(e->hasNetworkElementBase(),
"Runtime type check failed");
811 AN(dynamic_cast<Reaction*>(e),
"Runtime type check failed");
812 return dynamic_cast<Reaction*>(e);
818 COMP_EDGE_TYPE_BOTTOM,
820 } CompartmentEdgeType;
824 class Compartment :
public NetworkElement {
830 typedef std::vector<LibsbmlDraw::NetworkElement*> EltVec;
832 typedef EltVec::iterator EltIt;
833 typedef EltVec::const_iterator ConstEltIt;
835 EltIt EltsBegin() {
return _elt.begin(); }
836 EltIt EltsEnd() {
return _elt.end(); }
838 ConstEltIt EltsBegin()
const {
return _elt.begin(); }
839 ConstEltIt EltsEnd()
const {
return _elt.end(); }
841 LibsbmlDraw::NetworkElement* getElt(
const uint64 i) {
return _elt.at(i); }
843 const LibsbmlDraw::NetworkElement* getElt(
const uint64 i)
const {
return _elt.at(i); }
845 uint64 getNElts()
const {
return _elt.size(); }
848 : _ra(50.*50.), _E(10.), _res(0.25), bytepattern(0xffae11), NetworkElement() {
849 _shape = ELT_SHAPE_RECT;
850 _type = NET_ELT_TYPE_COMP;
854 const std::string& getId()
const {
return _id; }
857 void setId(
const std::string&
id) { _id = id; }
860 void setName(
const std::string& name) { name_ = name; }
863 const std::string& getGlyph()
const {
return _gly; }
866 void setGlyph(
const std::string& glyph) { _gly = glyph; }
868 void setCentroid(
const Point& p) {
869 AN(0,
"setCentroid should not be called on a compt");
873 void recalcExtents() {
874 _r = _ext.maxDim()*0.5;
875 _p = (_ext.getMin() + _ext.getMax())*0.5;
881 void addElt(NetworkElement* e);
883 bool containsElt(
const NetworkElement* e)
const;
886 void removeElt(NetworkElement* e);
889 void setRestExtents(
const Box& ext);
892 void resizeEnclose(
double padding = 0);
898 Real restArea()
const {
return _ra; }
900 void setMin(
const Point& p) { _ext.setMin(p); }
901 void setMax(
const Point& p) { _ext.setMax(p); }
903 virtual Point getCentroid(COORD_SYSTEM coord = COORD_SYSTEM_LOCAL)
const {
return getExtents(coord).getCenter(); }
908 virtual void resetActivity();
916 void applyBoundaryForce(
const Real fx1,
const Real fy1,
const Real fx2,
const Real fy2);
923 void doInternalForce(NetworkElement* e,
const Real f,
const Real t);
926 void doInternalForceAll(
const Real f,
const Real t);
929 void doMotion(
const Real scale);
931 void capDelta2(
const Real cap2);
933 bool isContainer()
const {
return true; }
936 bool contains(
const NetworkElement* e)
const;
939 bool empty()
const {
return _elt.size() ? false :
true; }
942 void dump(std::ostream& os, uint32 ind);
945 void dumpForces(std::ostream& os, uint32 ind)
const;
947 bool doByteCheck() {
if(bytepattern == 0xffae11)
return true;
else return false; }
965 Real _fx1, _fy1, _fx2, _fy2;
969 uint64_t bytepattern;
974 class Network :
public Compartment {
979 typedef std::vector<Node*> NodeVec;
981 typedef std::vector<LibsbmlDraw::Reaction*> RxnVec;
983 typedef std::vector<LibsbmlDraw::Compartment*> CompVec;
986 typedef NodeVec::iterator NodeIt;
987 typedef NodeVec::const_iterator ConstNodeIt;
989 typedef RxnVec::iterator RxnIt;
990 typedef RxnVec::const_iterator ConstRxnIt;
992 typedef CompVec::iterator CompIt;
993 typedef CompVec::const_iterator ConstCompIt;
998 bytepattern = 0x3355;
999 layoutspecified_ =
false;
1005 void hierarchRelease();
1010 void addNode(Node* n);
1014 void removeNode(Node* n);
1017 void connectNode(Node* n, Reaction* r, RxnRoleType role);
1020 bool isNodeConnected(Node* n, Reaction* r)
const;
1023 Node* findNodeById(
const std::string&
id);
1024 const Node* findNodeById(
const std::string&
id)
const;
1027 std::string getUniqueId()
const;
1029 std::string getUniqueGlyphId(
const Node& src)
const;
1032 std::size_t getUniqueIndex()
const;
1035 Node* findNodeByGlyph(
const std::string& gly);
1037 Node* getNodeAt(
const size_t i) {
return _nodes.at(i); }
1039 Node* getUniqueNodeAt(
const size_t n);
1041 size_t getNumInstances(
const Node* u);
1044 Node* getInstance(
const Node* u,
const size_t n);
1046 bool containsNode(
const Node* n)
const;
1048 bool containsReaction(
const Reaction* r)
const;
1050 typedef std::vector<Reaction*> AttachedRxnList;
1052 AttachedRxnList getConnectedReactions(
const Node* n);
1054 typedef std::vector<RxnBezier*> AttachedCurveList;
1056 AttachedCurveList getAttachedCurves(
const Node* n);
1058 int getNumSubgraphs();
1061 void enumerateSubgraphs();
1064 void propagateSubgraphIndex(Node* x,
int isub);
1066 void clearSubgraphInfo();
1068 void clearExcludeFromSubgraphEnum();
1071 Reaction* findReactionById(
const std::string&
id);
1073 Reaction* getRxnAt(
const size_t i) {
return _rxn.at(i); }
1076 void resetUsageInfo();
1079 const std::string& getId()
const {
return _id; }
1081 void setId(
const std::string&
id) { _id = id; }
1083 bool isSetId()
const {
return _id.size(); }
1085 bool isLayoutSpecified()
const {
return layoutspecified_; }
1087 void setLayoutSpecified(
bool value) {
1088 layoutspecified_ = value;
1094 void addReaction(Reaction* rxn);
1097 void removeReaction(Reaction* r);
1102 void addCompartment(Compartment* c) { _comp.push_back(c); addElt(c); }
1107 Compartment* findCompById(
const std::string&
id);
1112 Compartment* findCompByGlyph(
const std::string& gly);
1114 Compartment* getCompAt(
const size_t i) {
return _comp.at(i); }
1116 Compartment* findContainingCompartment(
const NetworkElement* e);
1120 uint64 getTotalNumComps()
const {
return _comp.size(); }
1123 uint64 getTotalNumPts()
const {
return _nodes.size() + _rxn.size(); }
1126 uint64 getTotalNumRxns()
const {
return _rxn.size(); }
1129 uint64 getTotalNumNodes()
const {
return _nodes.size(); }
1131 uint64 getNumUniqueNodes()
const;
1133 Box getBoundingBox()
const;
1135 void fitToWindow(
const Box& w);
1137 void applyTransform(
const Affine2d& t);
1139 void setTransform(
const Affine2d& t,
bool recurse =
true);
1141 void setInverseTransform(
const Affine2d& it,
bool recurse =
true);
1143 void applyDisplacement(
const Point& d);
1146 void elideEmptyComps();
1149 void randomizePositions(
const Box& bounds);
1152 void rebuildCurves();
1156 void recalcCurveCPs();
1159 void recenterJunctions();
1162 void resetActivity();
1174 void capDeltas(
const Real cap);
1179 void updatePositions(
const Real scale);
1182 void updateExtents();
1185 void resizeCompsEnclose(
double padding = 0);
1188 void autosizeComps();
1192 Point pmean()
const;
1196 Point center()
const;
1200 Box getExtents()
const;
1205 void recenter(
const Point& p);
1213 Point pvariance()
const;
1218 void dump(std::ostream& os, uint32 ind);
1221 void dumpEltForces(std::ostream& os, uint32 ind)
const;
1223 Node* getNodeAtIndex(
int index) {
return _nodes[index]; }
1227 NodeIt NodesBegin() {
return _nodes.begin(); }
1228 NodeIt NodesEnd() {
return _nodes.end(); }
1230 ConstNodeIt NodesBegin()
const {
return _nodes.begin(); }
1231 ConstNodeIt NodesEnd()
const {
return _nodes.end(); }
1233 RxnIt RxnsBegin() {
return _rxn.begin(); }
1234 RxnIt RxnsEnd() {
return _rxn.end(); }
1236 ConstRxnIt RxnsBegin()
const {
return _rxn.begin(); }
1237 ConstRxnIt RxnsEnd()
const {
return _rxn.end(); }
1239 CompIt CompsBegin() {
return _comp.begin(); }
1240 CompIt CompsEnd() {
return _comp.end(); }
1242 ConstCompIt CompsBegin()
const {
return _comp.begin(); }
1243 ConstCompIt CompsEnd()
const {
return _comp.end(); }
1245 bool doByteCheck()
const {
if(bytepattern == 0x3355)
return true;
else return false; }
1248 void removeReactionsForNode(Node* n);
1258 bool layoutspecified_;
1265 inline Network* CastToNetwork(
void* p) {
1266 NetworkElement* e = (NetworkElement*)p;
1267 AN(e->hasNetworkElementBase(),
"Runtime type check failed");
1268 return dynamic_cast<Network*>(e);
1279 Network* networkFromLayout(
const Layout& lay,
const Model& mod);
1286 Network* networkFromModel(
const Model& mod);
1290 int layout_getNumFloatingSpecies(
const Layout& lay,
const Model& mod);
SAGITTARIUS_REAL Real
Make Real visible to C. Consider letting Real lie in top namespace.
Definition: SagittariusCommon.h:112