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

#include <CLPolygon.h>

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

Public Member Functions

void addElement (const CLRenderPoint *ls)
 
 CLPolygon (CCopasiContainer *pParent=NULL)
 
 CLPolygon (const CLPolygon &source, CCopasiContainer *pParent)
 
 CLPolygon (const sbmlPolygon &source, CCopasiContainer *pParent=NULL)
 
CLRenderCubicBeziercreateCubicBezier ()
 
CLRenderPointcreatePoint ()
 
CLRenderPointgetElement (size_t index)
 
const CLRenderPointgetElement (size_t index) const
 
const std::string & getKey () const
 
std::vector< CLRenderPoint * > * getListOfElements ()
 
const std::vector
< CLRenderPoint * > * 
getListOfElements () const
 
size_t getNumElements () const
 
void removeElement (size_t i)
 
sbmlPolygontoSBML (unsigned int level, unsigned int version) const
 
 ~CLPolygon ()
 
- Public Member Functions inherited from CLGraphicalPrimitive2D
virtual void addSBMLAttributes (GraphicalPrimitive2D *pPrimitive) const
 
 CLGraphicalPrimitive2D ()
 
 CLGraphicalPrimitive2D (const GraphicalPrimitive2D &source)
 
const std::string & getFillColor () const
 
FILL_RULE getFillRule () const
 
bool isSetFill () const
 
bool isSetFillRule () const
 
void setFillColor (const std::string &color)
 
void setFillRule (FILL_RULE rule)
 
- 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 mKey
 
std::vector< CLRenderPoint * > mListOfElements
 
- Protected Attributes inherited from CLGraphicalPrimitive2D
std::string mFill
 
FILL_RULE mFillRule
 
- 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

CLPolygonoperator= (const CLPolygon &source)
 

Additional Inherited Members

- Public Types inherited from CLGraphicalPrimitive2D
enum  FILL_RULE { UNSET, NONZERO, EVENODD, INHERIT }
 
- 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 CLPolygon.h.

Constructor & Destructor Documentation

CLPolygon::CLPolygon ( CCopasiContainer pParent = NULL)

Constructor.

Definition at line 23 of file CLPolygon.cpp.

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

23  :
25  CCopasiObject("Polygon", pParent),
26  mKey("")
27 {
28  this->mKey = CCopasiRootContainer::getKeyFactory()->add("Polygon", this);
29 }
std::string add(const std::string &prefix, CCopasiObject *pObject)
static CKeyFactory * getKeyFactory()
std::string mKey
Definition: CLPolygon.h:39
CLPolygon::CLPolygon ( const CLPolygon source,
CCopasiContainer pParent 
)

Copy constructor

Definition at line 34 of file CLPolygon.cpp.

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

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

Constructor to generate object from the corresponding SBML object.

CLPolygon::~CLPolygon ( )

Destructor.

Definition at line 86 of file CLPolygon.cpp.

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

87 {
89  size_t i, iMax = this->mListOfElements.size();
90 
91  for (i = 0; i < iMax; ++i)
92  {
93  delete this->mListOfElements[i];
94  }
95 }
bool remove(const std::string &key)
std::vector< CLRenderPoint * > mListOfElements
Definition: CLPolygon.h:34
static CKeyFactory * getKeyFactory()
std::string mKey
Definition: CLPolygon.h:39

Member Function Documentation

void CLPolygon::addElement ( const CLRenderPoint pLS)

Adds a copy of the given line segment to the list of line segements.

Definition at line 162 of file CLPolygon.cpp.

References mListOfElements.

163 {
164  if (dynamic_cast<const CLRenderCubicBezier*>(pLS))
165  {
166  this->mListOfElements.push_back(new CLRenderCubicBezier(*static_cast<const CLRenderCubicBezier*>(pLS)));
167  }
168  else
169  {
170  this->mListOfElements.push_back(new CLRenderPoint(*pLS));
171  }
172 }
std::vector< CLRenderPoint * > mListOfElements
Definition: CLPolygon.h:34
CLRenderCubicBezier * CLPolygon::createCubicBezier ( )

Creates a new cubicbezier object and adds it to the list of elements.

Creates a new cubicbezier object and adds it to the list of curve segments.

Definition at line 135 of file CLPolygon.cpp.

References mListOfElements.

136 {
137  this->mListOfElements.push_back(new CLRenderCubicBezier());
138  return static_cast<CLRenderCubicBezier*>(this->mListOfElements.back());
139 }
std::vector< CLRenderPoint * > mListOfElements
Definition: CLPolygon.h:34
CLRenderPoint * CLPolygon::createPoint ( )

Creates a new point object and adds it to the list of elements.

Creates a new point object and adds it to the list of curve segments.

Definition at line 125 of file CLPolygon.cpp.

References mListOfElements.

126 {
127  this->mListOfElements.push_back(new CLRenderPoint());
128  return this->mListOfElements.back();
129 }
std::vector< CLRenderPoint * > mListOfElements
Definition: CLPolygon.h:34
CLRenderPoint * CLPolygon::getElement ( size_t  index)

Returns a pointer to the point with with the given index or NULL if the index is invalid.

Returns a pointer to the line segement with with the given index or NULL if the index is invalid.

Definition at line 145 of file CLPolygon.cpp.

References mListOfElements.

Referenced by CLLayoutRenderer::draw_polygon().

146 {
147  return (index < this->mListOfElements.size()) ? (this->mListOfElements[index]) : NULL;
148 }
std::vector< CLRenderPoint * > mListOfElements
Definition: CLPolygon.h:34
const CLRenderPoint * CLPolygon::getElement ( size_t  index) const

Returns const a pointer to the line segement with with the given index or NULL if the index is invalid.

Definition at line 154 of file CLPolygon.cpp.

References mListOfElements.

155 {
156  return (index < this->mListOfElements.size()) ? (this->mListOfElements[index]) : NULL;
157 }
std::vector< CLRenderPoint * > mListOfElements
Definition: CLPolygon.h:34
const std::string & CLPolygon::getKey ( ) const
virtual

Returns the key string of the object.

Returns the key of the color definition.

Reimplemented from CCopasiObject.

Definition at line 191 of file CLPolygon.cpp.

References mKey.

192 {
193  return this->mKey;
194 }
std::string mKey
Definition: CLPolygon.h:39
std::vector< CLRenderPoint * > * CLPolygon::getListOfElements ( )

Returns a pointer to the list of curve segments.

Definition at line 108 of file CLPolygon.cpp.

References mListOfElements.

Referenced by getPath(), CCopasiXML::savePolygonElement(), and CCopasiXMLParser::PolygonElement::start().

109 {
110  return &(this->mListOfElements);
111 }
std::vector< CLRenderPoint * > mListOfElements
Definition: CLPolygon.h:34
const std::vector< CLRenderPoint * > * CLPolygon::getListOfElements ( ) const

Returns a const pointer to the list of curve segments.

Definition at line 116 of file CLPolygon.cpp.

References mListOfElements.

117 {
118  return &(this->mListOfElements);
119 }
std::vector< CLRenderPoint * > mListOfElements
Definition: CLPolygon.h:34
size_t CLPolygon::getNumElements ( ) const

Returns the number of line segments.

Definition at line 100 of file CLPolygon.cpp.

References mListOfElements.

Referenced by CLLayoutRenderer::draw_polygon().

101 {
102  return this->mListOfElements.size();
103 }
std::vector< CLRenderPoint * > mListOfElements
Definition: CLPolygon.h:34
CLPolygon& CLPolygon::operator= ( const CLPolygon source)
private
void CLPolygon::removeElement ( size_t  i)

Removes the curve segment with the given index.

Definition at line 177 of file CLPolygon.cpp.

References mListOfElements.

178 {
179  if (i < this->mListOfElements.size())
180  {
181  std::vector<CLRenderPoint*>::iterator it = this->mListOfElements.begin();
182  it += i;
183  delete *it;
184  this->mListOfElements.erase(it);
185  }
186 }
std::vector< CLRenderPoint * > mListOfElements
Definition: CLPolygon.h:34
Polygon * CLPolygon::toSBML ( unsigned int  level,
unsigned int  version 
) const

Converts this object to the corresponding SBML object.

Definition at line 199 of file CLPolygon.cpp.

References CLGraphicalPrimitive2D::addSBMLAttributes(), and mListOfElements.

200 {
201  Polygon* pPolygon = new Polygon(level, version);
202  this->addSBMLAttributes(pPolygon);
203  size_t i, iMax = this->mListOfElements.size();
204 
205  for (i = 0; i < iMax; ++i)
206  {
207  const RenderPoint* pP = this->mListOfElements[i]->toSBML(level, version);
208  pPolygon->addElement(pP);
209  delete pP;
210  }
211 
212  return pPolygon;
213 }
std::vector< CLRenderPoint * > mListOfElements
Definition: CLPolygon.h:34
virtual void addSBMLAttributes(GraphicalPrimitive2D *pPrimitive) const

Member Data Documentation

std::string CLPolygon::mKey
protected

key for the object.

Definition at line 39 of file CLPolygon.h.

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

std::vector<CLRenderPoint*> CLPolygon::mListOfElements
protected

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