COPASI API
4.40.278
|
#include <CLColorDefinition.h>
Public Member Functions | |
virtual bool | applyData (const CData &data, CUndoData::CChangeSet &changes) |
CLColorDefinition (CDataContainer *pParent=NULL) | |
CLColorDefinition (const CLColorDefinition &source, CDataContainer *pParent=NULL) | |
CLColorDefinition (const ColorDefinition &source, CDataContainer *pParent=NULL) | |
CLColorDefinition (unsigned char r, unsigned char g, unsigned char b, unsigned char a=255, CDataContainer *pParent=NULL) | |
std::string | createValueString () const |
unsigned char | getAlpha () const |
unsigned char | getBlue () const |
unsigned char | getGreen () const |
const std::string & | getId () const |
const std::string & | getKey () const |
unsigned char | getRed () const |
void | setAlpha (unsigned char c) |
void | setBlue (unsigned char c) |
bool | setColorValue (const std::string &valueString) |
void | setGreen (unsigned char c) |
void | setId (const std::string &id) |
void | setRed (unsigned char c) |
void | setRGBA (unsigned char r, unsigned char g, unsigned char b, unsigned char a=255) |
virtual CData | toData () const |
ColorDefinition * | toSBML (unsigned int level, unsigned int version) const |
virtual | ~CLColorDefinition () |
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 CDataObject | |
void | addIssue (const CIssue &issue) |
void | addReference (const CDataContainer *pReference) |
virtual void | calculateValue () override |
CDataObject (const CDataObject &src, const CDataContainer *pParent=NULL) | |
virtual void | createUndoData (CUndoData &undoData, const CUndoData::Type &type, const CData &oldData=CData(), const CCore::Framework &framework=CCore::Framework::ParticleNumbers) const override |
virtual void | destruct () override |
virtual CCommonName | getCN () const override |
virtual const CDataObject * | getDataObject () const override |
virtual const CObjectInterface * | getObject (const CCommonName &cn) const override |
CDataContainer * | getObjectAncestor (const std::string &type) const |
CDataModel * | getObjectDataModel () const |
virtual std::string | getObjectDisplayName () const override |
const CObjectInterface * | getObjectFromCN (const CCommonName &cn) const |
const std::string & | getObjectName () const |
CDataContainer * | getObjectParent () const |
const std::string & | getObjectType () const |
virtual const CObjectInterface::ObjectSet & | getPrerequisites () const override |
virtual const std::string | getUnits () const |
virtual const CValidity & | getValidity () const override |
virtual const CDataObject * | getValueObject () const |
virtual void * | getValuePointer () const override |
bool | hasFlag (const Flag &flag) const |
virtual bool | isPrerequisiteForContext (const CObjectInterface *pObject, const CCore::SimulationContextFlag &context, const CObjectInterface::ObjectSet &changedObjects) const override |
bool | prerequisitsContains (const DataObjectSet &objects) const |
virtual void | print (std::ostream *ostream) const override |
void | removeIssue (const CIssue &issue) |
void | removeReference (const CDataContainer *pReference) |
bool | setObjectName (const std::string &name) |
virtual bool | setObjectParent (const CDataContainer *pParent) |
void | validityChanged (const CValidity &changedValidity) override |
void | validityRemoved (const CValidity &changedValidity) |
virtual | ~CDataObject () |
Public Member Functions inherited from CObjectInterface | |
CObjectInterface () | |
CObjectInterface (const CObjectInterface &src) | |
virtual | ~CObjectInterface () |
Public Member Functions inherited from CUndoObjectInterface | |
CUndoObjectInterface () | |
CUndoObjectInterface (const CUndoObjectInterface &src) | |
bool | generateUuid () |
const xg::Guid & | getUuid () const |
virtual CUndoObjectInterface * | insert (const CData &data) |
bool | setUuid (const std::string &uuid) |
bool | setUuid (const xg::Guid &uuid) |
virtual void | updateIndex (const size_t &index, const CUndoObjectInterface *pUndoObject) |
virtual | ~CUndoObjectInterface () |
Static Public Member Functions | |
static CLColorDefinition * | fromData (const CData &data, CUndoObjectInterface *pParent) |
Static Public Member Functions inherited from CDataObject | |
static CDataObject * | fromData (const CData &data, CUndoObjectInterface *pParent) |
static void | sanitizeObjectName (std::string &name) |
Static Public Member Functions inherited from CObjectInterface | |
static const CDataObject * | DataObject (const CObjectInterface *pInterface) |
static CObjectInterface * | GetObjectFromCN (const ContainerList &listOfContainer, const CCommonName &objName) |
Static Public Member Functions inherited from CUndoObjectInterface | |
template<class CType > | |
static CType * | fromData (const CData &, CUndoObjectInterface *) |
Protected Attributes | |
unsigned char | mAlpha |
unsigned char | mBlue |
unsigned char | mGreen |
std::string | mId |
std::string | mKey |
unsigned char | mRed |
Protected Attributes inherited from CLBase | |
std::string | mTag |
Protected Attributes inherited from CDataObject | |
ObjectSet | mPrerequisits |
std::set< CDataContainer * > | mReferences |
Protected Attributes inherited from CObjectInterface | |
CValidity | mValidity |
Private Member Functions | |
CLColorDefinition & | operator= (const CLColorDefinition &source) |
Additional Inherited Members | |
Public Types inherited from CDataObject | |
typedef std::set< const CDataObject * > | DataObjectSet |
enum | Flag { Container , Vector , Matrix , NameVector , Reference , ValueBool , ValueInt , ValueInt64 , ValueDbl , NonUniqueName , StaticString , ValueString , Separator , DisplayName , ModelEntity , Array , DataModel , Root , Gui , __SIZE } |
Public Types inherited from CObjectInterface | |
typedef std::vector< const CDataContainer * > | ContainerList |
typedef std::set< const CObjectInterface * > | ObjectSet |
Protected Member Functions inherited from CDataObject | |
CDataObject () | |
CDataObject (const std::string &name, const CDataContainer *pParent=static_cast< CDataContainer * >((void *) 0), const std::string &type="CN", const CFlags< Flag > &flag=CFlags< Flag >::None) | |
CLColorDefinition::CLColorDefinition | ( | CDataContainer * | pParent = NULL | ) |
Contructor which sets the ColorDefinition to completely opaque black.
Contructor which sets the CLColorDefinition to completely opaque black.
References CKeyFactory::add(), CRootContainer::getKeyFactory(), and mKey.
Referenced by fromData().
CLColorDefinition::CLColorDefinition | ( | unsigned char | r, |
unsigned char | g, | ||
unsigned char | b, | ||
unsigned char | a = 255 , |
||
CDataContainer * | pParent = NULL |
||
) |
Constructor which sets the ColorDefinition to the given RGBA values.
Constructor which sets the CLColorDefinition to the given RGBA values.
References CKeyFactory::add(), CRootContainer::getKeyFactory(), and mKey.
CLColorDefinition::CLColorDefinition | ( | const CLColorDefinition & | source, |
CDataContainer * | pParent = NULL |
||
) |
Copy Contructor
References CKeyFactory::add(), CRootContainer::getKeyFactory(), and mKey.
CLColorDefinition::CLColorDefinition | ( | const ColorDefinition & | source, |
CDataContainer * | pParent = NULL |
||
) |
Constructor to generate object from the corresponding SBML object.
References CKeyFactory::add(), CRootContainer::getKeyFactory(), and mKey.
|
virtual |
Dtor.
References CRootContainer::getKeyFactory(), mKey, and CKeyFactory::remove().
|
virtual |
Apply the provided data to the object
const | CData & data |
Reimplemented from CDataObject.
References fatalError.
std::string CLColorDefinition::createValueString | ( | ) | const |
Creates a string the represents the current color value.
References mAlpha, mBlue, mGreen, and mRed.
Referenced by CCopasiXML::saveColorDefinition().
|
static |
Static method to create a CDataObject based on the provided data
const | CData & data |
References CLColorDefinition(), and NO_PARENT.
unsigned char CLColorDefinition::getAlpha | ( | ) | const |
Returns the alpha color component.
References mAlpha.
Referenced by CLLayoutRenderer::draw_layout(), and CLLayoutRenderer::resolve_color().
unsigned char CLColorDefinition::getBlue | ( | ) | const |
Returns the blue color component.
References mBlue.
Referenced by CLLayoutRenderer::draw_layout(), and CLLayoutRenderer::resolve_color().
unsigned char CLColorDefinition::getGreen | ( | ) | const |
Returns the green color component.
References mGreen.
Referenced by CLLayoutRenderer::draw_layout(), and CLLayoutRenderer::resolve_color().
const std::string & CLColorDefinition::getId | ( | ) | const |
Returns the id of the object.
References mId.
Referenced by CLRenderResolver::fill_base_maps(), CLRenderFlattener::flatten(), and CCopasiXML::saveColorDefinition().
|
virtual |
unsigned char CLColorDefinition::getRed | ( | ) | const |
Returns the red color component.
References mRed.
Referenced by CLLayoutRenderer::draw_layout(), and CLLayoutRenderer::resolve_color().
|
private |
void CLColorDefinition::setAlpha | ( | unsigned char | c | ) |
Sets alpha red color component.
References mAlpha.
void CLColorDefinition::setBlue | ( | unsigned char | c | ) |
Sets the blue color component.
References mBlue.
bool CLColorDefinition::setColorValue | ( | const std::string & | valueString | ) |
Sets the color value from a given string. If the string is not a valid value string, the color value is set to black and false is returned.
References mAlpha, mBlue, mGreen, and mRed.
Referenced by ColorDefinitionHandler::processStart(), CLLayoutRenderer::resolve_color(), and CLRenderResolver::setBackgroundColor().
void CLColorDefinition::setGreen | ( | unsigned char | c | ) |
Sets the green color component.
References mGreen.
void CLColorDefinition::setId | ( | const std::string & | id | ) |
void CLColorDefinition::setRed | ( | unsigned char | c | ) |
Sets the red color component.
References mRed.
void CLColorDefinition::setRGBA | ( | unsigned char | r, |
unsigned char | g, | ||
unsigned char | b, | ||
unsigned char | a = 255 |
||
) |
|
virtual |
Retrieve the data describing the object
Reimplemented from CDataObject.
References fatalError.
ColorDefinition * CLColorDefinition::toSBML | ( | unsigned int | level, |
unsigned int | version | ||
) | const |
|
protected |
Referenced by createValueString(), getAlpha(), setAlpha(), setColorValue(), setRGBA(), and toSBML().
|
protected |
Referenced by createValueString(), getBlue(), setBlue(), setColorValue(), setRGBA(), and toSBML().
|
protected |
Referenced by createValueString(), getGreen(), setColorValue(), setGreen(), setRGBA(), and toSBML().
|
protected |
The color definition 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 color definitions of different render information have the same id.
|
protected |
The color definition needs a key.
Referenced by CLColorDefinition(), getKey(), and ~CLColorDefinition().
|
protected |
Referenced by createValueString(), getRed(), setColorValue(), setRed(), setRGBA(), and toSBML().