COPASI API  4.16.103
CGraphNode.cpp
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/layoutUI/CGraphNode.cpp,v $
3 // $Revision: 1.12 $
4 // $Name: $
5 // $Author: ssahle $
6 // $Date: 2012/04/22 14:51:17 $
7 // End CVS Header
8 
9 // Copyright (C) 2012 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., University of Heidelberg, and The University
11 // of Manchester.
12 // All rights reserved.
13 
14 // Copyright (C) 2008 by Pedro Mendes, Virginia Tech Intellectual
15 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
16 // and The University of Manchester.
17 // All rights reserved.
18 
19 // Copyright (C) 2001 - 2007 by Pedro Mendes, Virginia Tech Intellectual
20 // Properties, Inc. and EML Research, gGmbH.
21 // All rights reserved.
22 
23 #include <cmath>
24 
25 #include "copasi.h"
26 
27 #include "CGraphNode.h"
28 #include "CVisParameters.h"
29 #include "layout/CLBase.h"
30 
31 CGraphNode::CGraphNode(const std::string & name,
32  const CCopasiContainer * pParent)
33  : CLMetabGlyph(name, pParent)
34  , msize(CVisParameters::DEFAULT_NODE_SIZE)
35  , morigNodeKey("")
36  , mObjectKey("")
37  , mLabelText("")
38 {
39 }
40 
42  const CCopasiContainer * pParent)
43  : CLMetabGlyph(src, pParent)
44  , msize(CVisParameters::DEFAULT_NODE_SIZE)
45  , morigNodeKey(src.getKey())
46  , mObjectKey(src.getModelObjectKey())
47  , mLabelText("")
48 {
49 }
50 
52  const CCopasiContainer * pParent)
53  : CLMetabGlyph(src, pParent)
54  , msize(src.msize)
55  , morigNodeKey(src.morigNodeKey)
56  , mObjectKey(src.mObjectKey)
57  , mLabelText(src.mLabelText)
58 {
59 }
60 
62 {
63  this->msize = newSize;
64  // now change corresponding end point(s) of attached curves)
65 }
66 
67 std::ostream & operator<<(std::ostream &os, const CGraphNode & gn)
68 {
69  os << "node key: " << gn.morigNodeKey << " size: " << gn.msize << std::endl;
70  os << "object key: " << gn.mObjectKey << std::endl;
71  os << "bounding box: " << gn.mBBox << std::endl;
72  os << "label: " << gn.mLabelText << std::endl;
73  //for (int i=0;i<gn.mConnectedCurveIndices.size();i++)
74  // os << gn.mConnectedCurveIndices[i] << std::endl;;
75 
76  return os;
77 }
78 
79 void CGraphNode::setLabelText(std::string name)
80 {
81  this->mLabelText = name;
82 }
CGraphNode(const std::string &name="GraphNode", const CCopasiContainer *pParent=NULL)
Definition: CGraphNode.cpp:31
std::string mLabelText
Definition: CGraphNode.h:35
std::ostream & operator<<(std::ostream &os, const CGraphNode &gn)
Definition: CGraphNode.cpp:67
void setLabelText(std::string name)
Definition: CGraphNode.cpp:79
CLBoundingBox mBBox
C_FLOAT64 msize
Definition: CGraphNode.h:31
std::string morigNodeKey
Definition: CGraphNode.h:32
void setSize(C_FLOAT64 newSize)
Definition: CGraphNode.cpp:61
#define C_FLOAT64
Definition: copasi.h:92
std::string mObjectKey
Definition: CGraphNode.h:33