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

#include <CLGradientBase.h>

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

Public Types

enum  SPREADMETHOD { PAD, REFLECT, REPEAT }
 
- Public Types inherited from CCopasiContainer
typedef std::multimap
< std::string, CCopasiObject * > 
objectMap
 
- 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
 

Public Member Functions

void addGradientStop (const CLGradientStop *pStop)
 
virtual void addSBMLAttributes (GradientBase *pBase) const
 
 CLGradientBase (const std::string &name, CCopasiContainer *pParent=NULL)
 
 CLGradientBase (const CLGradientBase &source, CCopasiContainer *pParent=NULL)
 
 CLGradientBase (const GradientBase &source, const std::string &name, CCopasiContainer *pParent=NULL)
 
CLGradientStopcreateGradientStop ()
 
CLGradientStopgetGradientStop (size_t i)
 
const CLGradientStopgetGradientStop (size_t i) const
 
const std::string & getId () const
 
const std::string & getKey () const
 
CCopasiVector< CLGradientStop > * getListOfGradientStops ()
 
const CCopasiVector
< CLGradientStop > * 
getListOfGradientStops () const
 
size_t getNumGradientStops () const
 
SPREADMETHOD getSpreadMethod () const
 
void setId (const std::string &id)
 
void setSpreadMethod (SPREADMETHOD method)
 
virtual ~CLGradientBase ()
 
- 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 CCopasiContainer
virtual bool add (CCopasiObject *pObject, const bool &adopt=true)
 
 CCopasiContainer (const std::string &name, const CCopasiContainer *pParent=NULL, const std::string &type="CN", const unsigned C_INT32 &flag=CCopasiObject::Container)
 
 CCopasiContainer (const CCopasiContainer &src, const CCopasiContainer *pParent=NULL)
 
virtual std::string getChildObjectUnits (const CCopasiObject *pObject) const
 
virtual const CObjectInterfacegetObject (const CCopasiObjectName &cn) const
 
virtual const objectMapgetObjects () const
 
virtual std::string getUnits () const
 
virtual const CCopasiObjectgetValueObject () const
 
virtual bool remove (CCopasiObject *pObject)
 
virtual ~CCopasiContainer ()
 
- 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
 
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
 
UpdateMethodgetUpdateMethod () 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

CCopasiVector< CLGradientStopmGradientStops
 
std::string mId
 
std::string mKey
 
SPREADMETHOD mSpreadMethod
 
- Protected Attributes inherited from CLBase
std::string mTag
 
- Protected Attributes inherited from CCopasiContainer
objectMap mObjects
 

Private Member Functions

CLGradientBaseoperator= (const CLGradientBase &source)
 

Additional Inherited Members

- 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 CCopasiContainer
static const std::vector
< CCopasiContainer * > 
EmptyList
 
- 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 CCopasiContainer
template<class CType >
CCopasiObjectaddMatrixReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
 
template<class CType >
CCopasiObjectaddObjectReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
 
template<class CType >
CCopasiObjectaddVectorReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
 
void initObjects ()
 
- 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 26 of file CLGradientBase.h.

Member Enumeration Documentation

Enumerator
PAD 
REFLECT 
REPEAT 

Definition at line 29 of file CLGradientBase.h.

Constructor & Destructor Documentation

CLGradientBase::CLGradientBase ( const std::string &  name,
CCopasiContainer pParent = NULL 
)

Constructor.

Definition at line 29 of file CLGradientBase.cpp.

29  :
30  CLBase(),
31  CCopasiContainer(name, pParent),
33  mKey(""),
34  mId("")
35 {
36 }
CLBase()
Definition: CLBase.h:36
std::string mKey
SPREADMETHOD mSpreadMethod
std::string mId
CLGradientBase::CLGradientBase ( const CLGradientBase source,
CCopasiContainer pParent = NULL 
)

Copy Constructor.

Definition at line 41 of file CLGradientBase.cpp.

41  :
42  CLBase(source),
43  CCopasiContainer(source, pParent),
45  mGradientStops(source.mGradientStops, this),
46  mKey(""),
47  mId(source.mId)
48 {
49 }
CLBase()
Definition: CLBase.h:36
CCopasiVector< CLGradientStop > mGradientStops
std::string mKey
SPREADMETHOD mSpreadMethod
std::string mId
CLGradientBase::CLGradientBase ( const GradientBase &  source,
const std::string &  name,
CCopasiContainer pParent = NULL 
)

Constructor to generate object from the corresponding SBML object.

Definition at line 54 of file CLGradientBase.cpp.

References addGradientStop(), mSpreadMethod, PAD, REFLECT, and REPEAT.

54  :
55  CLBase(),
56  CCopasiContainer(name, pParent),
57  mKey(""),
58  mId(source.getId())
59 {
60  switch (source.getSpreadMethod())
61  {
62  case GradientBase::REFLECT:
64  break;
65  case GradientBase::REPEAT:
67  break;
68  default:
70  break;
71  }
72 
73  size_t i, iMax = source.getNumGradientStops();
74 
75  for (i = 0; i < iMax; ++i)
76  {
77  CLGradientStop* pStop = new CLGradientStop(*source.getGradientStop((unsigned int) i));
78  this->addGradientStop(pStop);
79  delete pStop;
80  }
81 }
CLBase()
Definition: CLBase.h:36
void addGradientStop(const CLGradientStop *pStop)
std::string mKey
SPREADMETHOD mSpreadMethod
std::string mId
CLGradientBase::~CLGradientBase ( )
virtual

Destructor.

Definition at line 86 of file CLGradientBase.cpp.

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

87 {
89 }
bool remove(const std::string &key)
std::string mKey
static CKeyFactory * getKeyFactory()

Member Function Documentation

void CLGradientBase::addGradientStop ( const CLGradientStop pStop)

Adds a copy of the given GradientStop object.

Adds a copy of the given CLGradientStop object.

Definition at line 162 of file CLGradientBase.cpp.

References CCopasiVector< T >::add(), and mGradientStops.

Referenced by CLGradientBase(), and CCopasiXMLParser::GradientStopElement::start().

163 {
164  this->mGradientStops.add(new CLGradientStop(*pStop, this), true);
165 }
CCopasiVector< CLGradientStop > mGradientStops
virtual bool add(const CType &src)
void CLGradientBase::addSBMLAttributes ( GradientBase *  pBase) const
virtual

Adds gradient base attributes to the gradient passed as the argument.

Definition at line 194 of file CLGradientBase.cpp.

References mGradientStops, mId, mSpreadMethod, REFLECT, REPEAT, and CCopasiVector< T >::size().

Referenced by CLLinearGradient::toSBML(), and CLRadialGradient::toSBML().

195 {
196  pBase->setId(this->mId);
197 
198  switch (this->mSpreadMethod)
199  {
201  pBase->setSpreadMethod(GradientBase::REFLECT);
202  break;
204  pBase->setSpreadMethod(GradientBase::REPEAT);
205  break;
206  default:
207  pBase->setSpreadMethod(GradientBase::PAD);
208  break;
209  }
210 
211  size_t i, iMax = this->mGradientStops.size();
212 
213  for (i = 0; i < iMax; ++i)
214  {
215  pBase->addGradientStop(this->mGradientStops[i]->toSBML(pBase->getLevel(), pBase->getVersion()));
216  }
217 }
CCopasiVector< CLGradientStop > mGradientStops
virtual size_t size() const
SPREADMETHOD mSpreadMethod
std::string mId
CLGradientStop * CLGradientBase::createGradientStop ( )

Creates a new GradientStop.

Creates a new CLGradientStop.

Definition at line 152 of file CLGradientBase.cpp.

References CCopasiVector< T >::add(), and mGradientStops.

153 {
154  CLGradientStop* pStop = new CLGradientStop();
155  this->mGradientStops.add(pStop, true);
156  return pStop;
157 }
CCopasiVector< CLGradientStop > mGradientStops
virtual bool add(const CType &src)
CLGradientStop * CLGradientBase::getGradientStop ( size_t  i)

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

Definition at line 135 of file CLGradientBase.cpp.

References mGradientStops, and CCopasiVector< T >::size().

Referenced by CLGradientStops::CLGradientStops(), getLinearGradient(), getRadialGradient(), CLLayoutRenderer::map_gradient_color(), CCopasiXML::saveGradientElements(), and CLLayoutRenderer::update_colors().

136 {
137  return (i < this->mGradientStops.size()) ? (this->mGradientStops[i]) : NULL;
138 }
CCopasiVector< CLGradientStop > mGradientStops
virtual size_t size() const
const CLGradientStop * CLGradientBase::getGradientStop ( size_t  i) const

Returns a const pointer to the gradient stop with the given index or NULL if the index is invalid.

Definition at line 144 of file CLGradientBase.cpp.

References mGradientStops, and CCopasiVector< T >::size().

145 {
146  return (i < this->mGradientStops.size()) ? (this->mGradientStops[i]) : NULL;
147 }
CCopasiVector< CLGradientStop > mGradientStops
virtual size_t size() const
const std::string & CLGradientBase::getId ( ) const

Returns the id of the object.

Definition at line 178 of file CLGradientBase.cpp.

References mId.

Referenced by CLRenderResolver::fill_base_maps(), CLRenderFlattener::flatten(), and CCopasiXML::saveGradientAttributes().

179 {
180  return this->mId;
181 }
std::string mId
const std::string & CLGradientBase::getKey ( ) const
virtual

Returns the key of the color definition.

Reimplemented from CCopasiObject.

Definition at line 170 of file CLGradientBase.cpp.

References mKey.

171 {
172  return this->mKey;
173 }
std::string mKey
CCopasiVector< CLGradientStop > * CLGradientBase::getListOfGradientStops ( )

Returns a pointer to the gradient stop vector.

Definition at line 118 of file CLGradientBase.cpp.

References mGradientStops.

119 {
120  return &(this->mGradientStops);
121 }
CCopasiVector< CLGradientStop > mGradientStops
const CCopasiVector< CLGradientStop > * CLGradientBase::getListOfGradientStops ( ) const

Returns a const pointer to the gradient stop vector.

Definition at line 126 of file CLGradientBase.cpp.

References mGradientStops.

127 {
128  return &(this->mGradientStops);
129 }
CCopasiVector< CLGradientStop > mGradientStops
size_t CLGradientBase::getNumGradientStops ( ) const

Returns the number of gradient stops.

Definition at line 110 of file CLGradientBase.cpp.

References mGradientStops, and CCopasiVector< T >::size().

Referenced by CLGradientStops::CLGradientStops(), getLinearGradient(), getRadialGradient(), CLLayoutRenderer::map_gradient_color(), CCopasiXML::saveGradientElements(), and CLLayoutRenderer::update_colors().

111 {
112  return this->mGradientStops.size();
113 }
CCopasiVector< CLGradientStop > mGradientStops
virtual size_t size() const
CLGradientBase::SPREADMETHOD CLGradientBase::getSpreadMethod ( ) const

Returns the spreadmethod of the gradient.

Returns the spreadmethod of he gradient.

Definition at line 94 of file CLGradientBase.cpp.

References mSpreadMethod.

Referenced by getLinearGradient(), getRadialGradient(), CLLayoutRenderer::map_gradient_color(), and CCopasiXML::saveGradientAttributes().

95 {
96  return this->mSpreadMethod;
97 }
SPREADMETHOD mSpreadMethod
CLGradientBase& CLGradientBase::operator= ( const CLGradientBase source)
private
void CLGradientBase::setId ( const std::string &  id)

Sets the id of the object.

Definition at line 186 of file CLGradientBase.cpp.

References mId.

Referenced by CCopasiXMLParser::LinearGradientElement::start(), and CCopasiXMLParser::RadialGradientElement::start().

187 {
188  this->mId = id;
189 }
std::string mId
void CLGradientBase::setSpreadMethod ( CLGradientBase::SPREADMETHOD  method)

Sets the spread method.

Definition at line 102 of file CLGradientBase.cpp.

References mSpreadMethod.

Referenced by CCopasiXMLParser::LinearGradientElement::start(), and CCopasiXMLParser::RadialGradientElement::start().

103 {
104  this->mSpreadMethod = method;
105 }
SPREADMETHOD mSpreadMethod

Member Data Documentation

CCopasiVector<CLGradientStop> CLGradientBase::mGradientStops
protected
std::string CLGradientBase::mId
protected

The gradient base needs an id in addition to the key. The id corresponds to the id in the SBML render extension and it does not have to be globally unique. As a matter of fact, it is sometimes needed that gradient base of different render information have the same id.

Definition at line 55 of file CLGradientBase.h.

Referenced by addSBMLAttributes(), getId(), and setId().

std::string CLGradientBase::mKey
protected

key string for the gradient.

Definition at line 47 of file CLGradientBase.h.

Referenced by CLLinearGradient::CLLinearGradient(), CLRadialGradient::CLRadialGradient(), getKey(), and ~CLGradientBase().

SPREADMETHOD CLGradientBase::mSpreadMethod
protected

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