COPASI API  4.16.103
Public Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
CLRenderCurve Class Reference

#include <CLRenderCurve.h>

Inheritance diagram for CLRenderCurve:
Inheritance graph
[legend]
Collaboration diagram for CLRenderCurve:
Collaboration graph
[legend]

Public Member Functions

void addCurveElement (const CLRenderPoint *cs)
 
 CLRenderCurve (CCopasiContainer *pParent=NULL)
 
 CLRenderCurve (const CLRenderCurve &source, CCopasiContainer *pParent=NULL)
 
 CLRenderCurve (const RenderCurve &source, CCopasiContainer *pParent=NULL)
 
CLRenderCubicBeziercreateCubicBezier ()
 
CLRenderPointcreatePoint ()
 
const CLRenderPointgetCurveElement (size_t index) const
 
CLRenderPointgetCurveElement (size_t index)
 
const std::string & getEndHead () const
 
const std::string & getKey () const
 
const std::vector
< CLRenderPoint * > * 
getListOfCurveElements () const
 
std::vector< CLRenderPoint * > * getListOfCurveElements ()
 
size_t getNumElements () const
 
const std::string & getStartHead () const
 
bool isSetEndHead () const
 
bool isSetStartHead () const
 
void removeCurveElement (size_t i)
 
void setEndHead (const std::string &endHead)
 
void setStartHead (const std::string &startHead)
 
RenderCurve * toSBML (unsigned int level, unsigned int version) const
 
 ~CLRenderCurve ()
 
- Public Member Functions inherited from CLGraphicalPrimitive1D
virtual void addSBMLAttributes (GraphicalPrimitive1D *pPrimitive) const
 
 CLGraphicalPrimitive1D ()
 
 CLGraphicalPrimitive1D (const GraphicalPrimitive1D &source)
 
const std::vector< unsigned int > & getDashArray () const
 
const std::string & getStroke () const
 
double getStrokeWidth () const
 
bool isSetDashArray () const
 
bool isSetStroke () const
 
bool isSetStrokeWidth () const
 
void parseDashArray (const std::string &s)
 
void setDashArray (const std::vector< unsigned int > &array)
 
void setStroke (const std::string &key)
 
void setStrokeWidth (double width)
 
- Public Member Functions inherited from CLTransformation2D
 CLTransformation2D ()
 
 CLTransformation2D (const double m[6])
 
 CLTransformation2D (const Transformation2D &source)
 
std::string get2DTransformationString () const
 
const double * getMatrix2D () const
 
virtual void parseTransformation (const std::string &transformationString)
 
void setMatrix (const double m[12])
 
void setMatrix2D (const double m[6])
 
- Public Member Functions inherited from CLTransformation
 CLTransformation ()
 
 CLTransformation (const double matrix[12])
 
std::string get3DTransformationString () const
 
virtual const double * getMatrix () const
 
bool is2DTransformation () const
 
bool isIdentityMatrix () const
 
bool isSetMatrix () const
 
void setMatrix (const double m[12])
 
- Public Member Functions inherited from CLBase
 CLBase ()
 
 CLBase (const CLBase &b)
 
 CLBase (const SBase &)
 
const std::string & getTag () const
 
bool hasTag () const
 
virtual void moveBy (const CLPoint &)
 
void setTag (const std::string &tag)
 
virtual ~CLBase ()
 
- Public Member Functions inherited from CCopasiObject
void addDirectDependency (const CCopasiObject *pObject)
 
 CCopasiObject (const CCopasiObject &src, const CCopasiContainer *pParent=NULL)
 
void clearDirectDependencies ()
 
void clearRefresh ()
 
bool dependsOn (DataObjectSet candidates, const DataObjectSet &context=DataObjectSet()) const
 
void getAllDependencies (DataObjectSet &dependencies, const DataObjectSet &context) const
 
virtual CCopasiObjectName getCN () const
 
virtual const DataObjectSetgetDirectDependencies (const DataObjectSet &context=DataObjectSet()) const
 
virtual const CObjectInterfacegetObject (const CCopasiObjectName &cn) const
 
CCopasiContainergetObjectAncestor (const std::string &type) const
 
CCopasiDataModelgetObjectDataModel ()
 
const CCopasiDataModelgetObjectDataModel () const
 
virtual std::string getObjectDisplayName (bool regular=true, bool richtext=false) const
 
const std::string & getObjectName () const
 
CCopasiContainergetObjectParent () const
 
const std::string & getObjectType () const
 
virtual const
CObjectInterface::ObjectSet
getPrerequisites () const
 
virtual RefreshgetRefresh () const
 
virtual std::string getUnits () const
 
UpdateMethodgetUpdateMethod () const
 
virtual const CCopasiObjectgetValueObject () const
 
virtual voidgetValuePointer () const
 
bool hasCircularDependencies (DataObjectSet &candidates, DataObjectSet &verified, const DataObjectSet &context) const
 
bool hasUpdateMethod () const
 
bool isArray () const
 
bool isContainer () const
 
bool isDataModel () const
 
bool isMatrix () const
 
bool isNameVector () const
 
bool isNonUniqueName () const
 
virtual bool isPrerequisiteForContext (const CObjectInterface *pObject, const CMath::SimulationContextFlag &context, const CObjectInterface::ObjectSet &changedObjects) const
 
bool isReference () const
 
bool isRoot () const
 
bool isSeparator () const
 
bool isStaticString () const
 
bool isValueBool () const
 
bool isValueDbl () const
 
bool isValueInt () const
 
bool isValueInt64 () const
 
bool isValueString () const
 
bool isVector () const
 
virtual bool mustBeDeleted (const DataObjectSet &deletedObjects) const
 
virtual void print (std::ostream *ostream) const
 
void removeDirectDependency (const CCopasiObject *pObject)
 
void setDirectDependencies (const DataObjectSet &directDependencies)
 
bool setObjectName (const std::string &name)
 
virtual bool setObjectParent (const CCopasiContainer *pParent)
 
void setObjectValue (const C_FLOAT64 &value)
 
void setObjectValue (const C_INT32 &value)
 
void setObjectValue (const bool &value)
 
template<class CType >
void setRefresh (CType *pType, void(CType::*method)(void))
 
template<class CType >
void setUpdateMethod (CType *pType, void(CType::*method)(const C_FLOAT64 &))
 
template<class CType >
void setUpdateMethod (CType *pType, void(CType::*method)(const C_INT32 &))
 
template<class CType >
void setUpdateMethod (CType *pType, void(CType::*method)(const bool &))
 
virtual ~CCopasiObject ()
 
- Public Member Functions inherited from CObjectInterface
 CObjectInterface ()
 
virtual ~CObjectInterface ()
 

Protected Attributes

std::string mEndHead
 
std::string mKey
 
std::vector< CLRenderPoint * > mListOfElements
 
std::string mStartHead
 
- Protected Attributes inherited from CLGraphicalPrimitive1D
std::string mStroke
 
std::vector< unsigned int > mStrokeDashArray
 
double mStrokeWidth
 
- Protected Attributes inherited from CLTransformation2D
double mMatrix2D [6]
 
- Protected Attributes inherited from CLTransformation
double mMatrix [12]
 
- Protected Attributes inherited from CLBase
std::string mTag
 

Private Member Functions

CLRenderCurveoperator= (const CLRenderCurve &source)
 

Friends

class Group
 

Additional Inherited Members

- Public Types inherited from CCopasiObject
typedef std::set< const
CCopasiObject * > 
DataObjectSet
 
typedef std::vector< Refresh * > DataUpdateSequence
 
- Public Types inherited from CObjectInterface
typedef std::set< const
CObjectInterface * > 
ObjectSet
 
typedef std::vector
< CObjectInterface * > 
UpdateSequence
 
- Static Public Member Functions inherited from CLTransformation2D
static const double * getIdentityMatrix2D ()
 
- Static Public Member Functions inherited from CLTransformation
static const double * getIdentityMatrix ()
 
- Static Public Member Functions inherited from CCopasiObject
static std::vector< Refresh * > buildUpdateSequence (const DataObjectSet &objects, const DataObjectSet &uptoDateObjects, const DataObjectSet &context=DataObjectSet())
 
static void setRenameHandler (CRenameHandler *rh)
 
- Static Public Attributes inherited from CLTransformation2D
static const double IDENTITY2D [6] = {1.0, 0.0, 0.0, 1.0, 0.0, 0.0}
 
- Static Public Attributes inherited from CLTransformation
static const double IDENTITY3D [12] = {1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0}
 
- Protected Types inherited from CCopasiObject
enum  Flag {
  Container = 0x1, Vector = 0x2, Matrix = 0x4, NameVector = 0x8,
  Reference = 0x10, ValueBool = 0x20, ValueInt = 0x40, ValueInt64 = 0x80,
  ValueDbl = 0x100, NonUniqueName = 0x200, StaticString = 0x400, ValueString = 0x800,
  Separator = 0x1000, ModelEntity = 0x2000, Array = 0x4000, DataModel = 0x8000,
  Root = 0x10000, Gui = 0x20000
}
 
- Protected Member Functions inherited from CLTransformation2D
virtual void addSBMLAttributes (Transformation2D *pTransformation) const
 
void updateMatrix2D ()
 
void updateMatrix3D ()
 
- Protected Member Functions inherited from CCopasiObject
 CCopasiObject ()
 
 CCopasiObject (const std::string &name, const CCopasiContainer *pParent=NULL, const std::string &type="CN", const unsigned C_INT32 &flag=0)
 
- Static Protected Attributes inherited from CCopasiObject
static CRenameHandlersmpRenameHandler = NULL
 

Detailed Description

Definition at line 27 of file CLRenderCurve.h.

Constructor & Destructor Documentation

CLRenderCurve::CLRenderCurve ( CCopasiContainer pParent = NULL)

Constructor.

Definition at line 22 of file CLRenderCurve.cpp.

References CKeyFactory::add(), CCopasiRootContainer::getKeyFactory(), and mKey.

22  :
24  CCopasiObject("RenderCurve", pParent),
25  mStartHead(""),
26  mEndHead(""),
27  mKey("")
28 {
29  this->mKey = CCopasiRootContainer::getKeyFactory()->add("RenderCurve", this);
30 }
std::string add(const std::string &prefix, CCopasiObject *pObject)
std::string mStartHead
Definition: CLRenderCurve.h:34
static CKeyFactory * getKeyFactory()
std::string mKey
Definition: CLRenderCurve.h:41
std::string mEndHead
Definition: CLRenderCurve.h:35
CLRenderCurve::CLRenderCurve ( const CLRenderCurve source,
CCopasiContainer pParent = NULL 
)

Copy Constructor

Copy constructor

Definition at line 35 of file CLRenderCurve.cpp.

References CKeyFactory::add(), CCopasiRootContainer::getKeyFactory(), mKey, and mListOfElements.

35  :
36  CLGraphicalPrimitive1D(source),
37  CCopasiObject(source, pParent),
38  mStartHead(source.mStartHead),
39  mEndHead(source.mEndHead),
40  mKey("")
41 {
42  this->mKey = CCopasiRootContainer::getKeyFactory()->add("RenderCurve", this);
43  size_t i, iMax = source.mListOfElements.size();
44 
45  for (i = 0; i < iMax; ++i)
46  {
47  if (dynamic_cast<const CLRenderCubicBezier*>(source.mListOfElements[i]))
48  {
49  this->mListOfElements.push_back(new CLRenderCubicBezier(*static_cast<const CLRenderCubicBezier*>(source.mListOfElements[i])));
50  }
51  else
52  {
53  this->mListOfElements.push_back(new CLRenderPoint(*source.mListOfElements[i]));
54  }
55  }
56 }
std::string add(const std::string &prefix, CCopasiObject *pObject)
std::string mStartHead
Definition: CLRenderCurve.h:34
static CKeyFactory * getKeyFactory()
std::vector< CLRenderPoint * > mListOfElements
Definition: CLRenderCurve.h:36
std::string mKey
Definition: CLRenderCurve.h:41
std::string mEndHead
Definition: CLRenderCurve.h:35
CLRenderCurve::CLRenderCurve ( const RenderCurve &  source,
CCopasiContainer pParent = NULL 
)

Constructor to generate object from the corresponding SBML object.

Definition at line 61 of file CLRenderCurve.cpp.

References CKeyFactory::add(), CCopasiRootContainer::getKeyFactory(), mKey, and mListOfElements.

61  :
62  CLGraphicalPrimitive1D(source),
63  CCopasiObject("RenderCurve", pParent),
64  mStartHead(source.getStartHead()),
65  mEndHead(source.getEndHead()),
66  mKey("")
67 {
68  this->mKey = CCopasiRootContainer::getKeyFactory()->add("RenderCurve", this);
69  size_t i, iMax = source.getNumElements();
70 
71  for (i = 0; i < iMax; ++i)
72  {
73  CLRenderPoint* pElement = NULL;
74 
75  if (dynamic_cast<const RenderCubicBezier*>(source.getElement((unsigned int) i)))
76  {
77  pElement = new CLRenderCubicBezier(*static_cast<const RenderCubicBezier*>(source.getElement((unsigned int) i)));
78  }
79  else
80  {
81  pElement = new CLRenderPoint(*source.getElement((unsigned int) i));
82  }
83 
84  this->mListOfElements.push_back(pElement);
85  }
86 }
std::string add(const std::string &prefix, CCopasiObject *pObject)
std::string mStartHead
Definition: CLRenderCurve.h:34
static CKeyFactory * getKeyFactory()
std::vector< CLRenderPoint * > mListOfElements
Definition: CLRenderCurve.h:36
std::string mKey
Definition: CLRenderCurve.h:41
std::string mEndHead
Definition: CLRenderCurve.h:35
CLRenderCurve::~CLRenderCurve ( )

Destructor

Definition at line 91 of file CLRenderCurve.cpp.

References CCopasiRootContainer::getKeyFactory(), mKey, mListOfElements, and CKeyFactory::remove().

92 {
94  size_t i, iMax = this->mListOfElements.size();
95 
96  for (i = 0; i < iMax; ++i)
97  {
98  delete this->mListOfElements[i];
99  }
100 }
bool remove(const std::string &key)
static CKeyFactory * getKeyFactory()
std::vector< CLRenderPoint * > mListOfElements
Definition: CLRenderCurve.h:36
std::string mKey
Definition: CLRenderCurve.h:41

Member Function Documentation

void CLRenderCurve::addCurveElement ( const CLRenderPoint pCS)

Adds a copy of the given curve segment to the end of the list of curve segments.

Definition at line 184 of file CLRenderCurve.cpp.

References mListOfElements.

185 {
186  if (dynamic_cast<const CLRenderCubicBezier*>(pCS))
187  {
188  this->mListOfElements.push_back(new CLRenderCubicBezier(*static_cast<const CLRenderCubicBezier*>(pCS)));
189  }
190  else
191  {
192  this->mListOfElements.push_back(new CLRenderPoint(*pCS));
193  }
194 }
std::vector< CLRenderPoint * > mListOfElements
Definition: CLRenderCurve.h:36
CLRenderCubicBezier * CLRenderCurve::createCubicBezier ( )

Creates a new bezier element. The element is added to the curve.

Creates a new cubic bezier curve segment.

Definition at line 145 of file CLRenderCurve.cpp.

References mListOfElements.

146 {
148  this->mListOfElements.push_back(pCS);
149  return pCS;
150 }
std::vector< CLRenderPoint * > mListOfElements
Definition: CLRenderCurve.h:36
CLRenderPoint * CLRenderCurve::createPoint ( )

Creates a new point element. The element is added to the curve.

Creates a new curve segment.

Definition at line 155 of file CLRenderCurve.cpp.

References mListOfElements.

156 {
157  CLRenderPoint* pCS = new CLRenderPoint();
158  this->mListOfElements.push_back(pCS);
159  return pCS;
160 }
std::vector< CLRenderPoint * > mListOfElements
Definition: CLRenderCurve.h:36
const CLRenderPoint * CLRenderCurve::getCurveElement ( size_t  index) const

Returns a const pointer to the curve segment with the given index or NULL if the id is invalid.

Definition at line 166 of file CLRenderCurve.cpp.

References mListOfElements.

Referenced by CLLayoutRenderer::draw_curve().

167 {
168  return (index < this->mListOfElements.size()) ? (this->mListOfElements[index]) : NULL;
169 }
std::vector< CLRenderPoint * > mListOfElements
Definition: CLRenderCurve.h:36
CLRenderPoint * CLRenderCurve::getCurveElement ( size_t  index)

Returns a pointer to the curve segment with the given index or NULL if the id is invalid.

Definition at line 175 of file CLRenderCurve.cpp.

References mListOfElements.

176 {
177  return (index < this->mListOfElements.size()) ? (this->mListOfElements[index]) : NULL;
178 }
std::vector< CLRenderPoint * > mListOfElements
Definition: CLRenderCurve.h:36
const std::string & CLRenderCurve::getEndHead ( ) const

Returns the id of the end head.

Definition at line 129 of file CLRenderCurve.cpp.

References mEndHead.

Referenced by fillItemFromRenderCurve(), and CLLayoutRenderer::update_textures_and_colors().

130 {
131  return this->mEndHead;
132 }
std::string mEndHead
Definition: CLRenderCurve.h:35
const std::string & CLRenderCurve::getKey ( ) const
virtual

Returns the key string of the object.

Returns the key of the color definition.

Reimplemented from CCopasiObject.

Definition at line 245 of file CLRenderCurve.cpp.

References mKey.

246 {
247  return this->mKey;
248 }
std::string mKey
Definition: CLRenderCurve.h:41
const std::vector< CLRenderPoint * > * CLRenderCurve::getListOfCurveElements ( ) const

Returns a const pointer to the list of curve segments.

Definition at line 213 of file CLRenderCurve.cpp.

References mListOfElements.

Referenced by getPath(), and CCopasiXMLParser::RenderCurveElement::start().

214 {
215  return &(this->mListOfElements);
216 }
std::vector< CLRenderPoint * > mListOfElements
Definition: CLRenderCurve.h:36
std::vector< CLRenderPoint * > * CLRenderCurve::getListOfCurveElements ( )

Returns a pointer to the list of curve segments.

Definition at line 221 of file CLRenderCurve.cpp.

References mListOfElements.

222 {
223  return &(this->mListOfElements);
224 }
std::vector< CLRenderPoint * > mListOfElements
Definition: CLRenderCurve.h:36
size_t CLRenderCurve::getNumElements ( ) const

Returns the number of curve segments.

Definition at line 137 of file CLRenderCurve.cpp.

References mListOfElements.

Referenced by CLLayoutRenderer::draw_curve().

138 {
139  return this->mListOfElements.size();
140 }
std::vector< CLRenderPoint * > mListOfElements
Definition: CLRenderCurve.h:36
const std::string & CLRenderCurve::getStartHead ( ) const

Returns the id of the start head.

Definition at line 121 of file CLRenderCurve.cpp.

References mStartHead.

Referenced by fillItemFromRenderCurve(), and CLLayoutRenderer::update_textures_and_colors().

122 {
123  return this->mStartHead;
124 }
std::string mStartHead
Definition: CLRenderCurve.h:34
bool CLRenderCurve::isSetEndHead ( ) const

Returns true if the start head is set or false otherwise.

Definition at line 237 of file CLRenderCurve.cpp.

References mEndHead.

Referenced by fillItemFromRenderCurve(), and CLLayoutRenderer::update_textures_and_colors().

238 {
239  return (!this->mEndHead.empty() && this->mEndHead != "none");
240 }
std::string mEndHead
Definition: CLRenderCurve.h:35
bool CLRenderCurve::isSetStartHead ( ) const

Returns true if the start head is set or false otherwise.

Definition at line 229 of file CLRenderCurve.cpp.

References mStartHead.

Referenced by fillItemFromRenderCurve(), and CLLayoutRenderer::update_textures_and_colors().

230 {
231  return (!this->mStartHead.empty() && this->mStartHead != "none");
232 }
std::string mStartHead
Definition: CLRenderCurve.h:34
CLRenderCurve& CLRenderCurve::operator= ( const CLRenderCurve source)
private
void CLRenderCurve::removeCurveElement ( size_t  i)

Removes the curve segment with the given index.

Definition at line 199 of file CLRenderCurve.cpp.

References mListOfElements.

200 {
201  if (i < this->mListOfElements.size())
202  {
203  std::vector<CLRenderPoint*>::iterator it = this->mListOfElements.begin();
204  it += i;
205  delete *it;
206  this->mListOfElements.erase(it);
207  }
208 }
std::vector< CLRenderPoint * > mListOfElements
Definition: CLRenderCurve.h:36
void CLRenderCurve::setEndHead ( const std::string &  endHead)

Sets the id of the end head.

Definition at line 113 of file CLRenderCurve.cpp.

References mEndHead.

Referenced by CCopasiXMLParser::RenderCurveElement::start().

114 {
115  this->mEndHead = endHead;
116 }
std::string mEndHead
Definition: CLRenderCurve.h:35
void CLRenderCurve::setStartHead ( const std::string &  startHead)

Sets the id of the start head.

Definition at line 105 of file CLRenderCurve.cpp.

References mStartHead.

Referenced by CCopasiXMLParser::RenderCurveElement::start().

106 {
107  this->mStartHead = startHead;
108 }
std::string mStartHead
Definition: CLRenderCurve.h:34
RenderCurve * CLRenderCurve::toSBML ( unsigned int  level,
unsigned int  version 
) const

Converts this object to the corresponding SBML object.

Definition at line 253 of file CLRenderCurve.cpp.

References CLGraphicalPrimitive1D::addSBMLAttributes(), mEndHead, mListOfElements, and mStartHead.

254 {
255  RenderCurve* pCurve = new RenderCurve(level, version);
256  this->addSBMLAttributes(pCurve);
257  pCurve->setStartHead(this->mStartHead);
258  pCurve->setEndHead(this->mEndHead);
259  size_t i, iMax = this->mListOfElements.size();
260 
261  for (i = 0; i < iMax; ++i)
262  {
263  const RenderPoint* pP = this->mListOfElements[i]->toSBML(level, version);
264  pCurve->addElement(pP);
265  delete pP;
266  }
267 
268  return pCurve;
269 }
std::string mStartHead
Definition: CLRenderCurve.h:34
std::vector< CLRenderPoint * > mListOfElements
Definition: CLRenderCurve.h:36
std::string mEndHead
Definition: CLRenderCurve.h:35
virtual void addSBMLAttributes(GraphicalPrimitive1D *pPrimitive) const

Friends And Related Function Documentation

friend class Group
friend

Definition at line 155 of file CLRenderCurve.h.

Member Data Documentation

std::string CLRenderCurve::mEndHead
protected

Definition at line 35 of file CLRenderCurve.h.

Referenced by getEndHead(), isSetEndHead(), setEndHead(), and toSBML().

std::string CLRenderCurve::mKey
protected

key for the object.

Definition at line 41 of file CLRenderCurve.h.

Referenced by CLRenderCurve(), getKey(), and ~CLRenderCurve().

std::vector<CLRenderPoint*> CLRenderCurve::mListOfElements
protected
std::string CLRenderCurve::mStartHead
protected

Definition at line 34 of file CLRenderCurve.h.

Referenced by getStartHead(), isSetStartHead(), setStartHead(), and toSBML().


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