COPASI API  4.40.278
CLColorDefinition Class Reference

#include <CLColorDefinition.h>

Inheritance diagram for CLColorDefinition:
[legend]

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 CDataObjectgetDataObject () const override
 
virtual const CObjectInterfacegetObject (const CCommonName &cn) const override
 
CDataContainergetObjectAncestor (const std::string &type) const
 
CDataModelgetObjectDataModel () const
 
virtual std::string getObjectDisplayName () const override
 
const CObjectInterfacegetObjectFromCN (const CCommonName &cn) const
 
const std::string & getObjectName () const
 
CDataContainergetObjectParent () const
 
const std::string & getObjectType () const
 
virtual const CObjectInterface::ObjectSetgetPrerequisites () const override
 
virtual const std::string getUnits () const
 
virtual const CValiditygetValidity () const override
 
virtual const CDataObjectgetValueObject () 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 CUndoObjectInterfaceinsert (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 CLColorDefinitionfromData (const CData &data, CUndoObjectInterface *pParent)
 
- Static Public Member Functions inherited from CDataObject
static CDataObjectfromData (const CData &data, CUndoObjectInterface *pParent)
 
static void sanitizeObjectName (std::string &name)
 
- Static Public Member Functions inherited from CObjectInterface
static const CDataObjectDataObject (const CObjectInterface *pInterface)
 
static CObjectInterfaceGetObjectFromCN (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

CLColorDefinitionoperator= (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)
 

Constructor & Destructor Documentation

◆ CLColorDefinition() [1/4]

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() [2/4]

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() [3/4]

CLColorDefinition::CLColorDefinition ( const CLColorDefinition source,
CDataContainer pParent = NULL 
)

Copy Contructor

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

◆ CLColorDefinition() [4/4]

CLColorDefinition::CLColorDefinition ( const ColorDefinition &  source,
CDataContainer pParent = NULL 
)

Constructor to generate object from the corresponding SBML object.

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

◆ ~CLColorDefinition()

CLColorDefinition::~CLColorDefinition ( )
virtual

Member Function Documentation

◆ applyData()

bool CLColorDefinition::applyData ( const CData data,
CUndoData::CChangeSet changes 
)
virtual

Apply the provided data to the object

Parameters
constCData & data
Returns
bool success

Reimplemented from CDataObject.

References fatalError.

◆ createValueString()

std::string CLColorDefinition::createValueString ( ) const

Creates a string the represents the current color value.

References mAlpha, mBlue, mGreen, and mRed.

Referenced by CCopasiXML::saveColorDefinition().

◆ fromData()

CLColorDefinition * CLColorDefinition::fromData ( const CData data,
CUndoObjectInterface pParent 
)
static

Static method to create a CDataObject based on the provided data

Parameters
constCData & data
Returns
CLColorDefinition * pDataObject

References CLColorDefinition(), and NO_PARENT.

◆ getAlpha()

unsigned char CLColorDefinition::getAlpha ( ) const

Returns the alpha color component.

References mAlpha.

Referenced by CLLayoutRenderer::draw_layout(), and CLLayoutRenderer::resolve_color().

◆ getBlue()

unsigned char CLColorDefinition::getBlue ( ) const

Returns the blue color component.

References mBlue.

Referenced by CLLayoutRenderer::draw_layout(), and CLLayoutRenderer::resolve_color().

◆ getGreen()

unsigned char CLColorDefinition::getGreen ( ) const

Returns the green color component.

References mGreen.

Referenced by CLLayoutRenderer::draw_layout(), and CLLayoutRenderer::resolve_color().

◆ getId()

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().

◆ getKey()

const std::string & CLColorDefinition::getKey ( ) const
virtual

Returns the key of the color definition.

Reimplemented from CDataObject.

References mKey.

◆ getRed()

unsigned char CLColorDefinition::getRed ( ) const

Returns the red color component.

References mRed.

Referenced by CLLayoutRenderer::draw_layout(), and CLLayoutRenderer::resolve_color().

◆ operator=()

CLColorDefinition& CLColorDefinition::operator= ( const CLColorDefinition source)
private

◆ setAlpha()

void CLColorDefinition::setAlpha ( unsigned char  c)

Sets alpha red color component.

References mAlpha.

◆ setBlue()

void CLColorDefinition::setBlue ( unsigned char  c)

Sets the blue color component.

References mBlue.

◆ setColorValue()

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().

◆ setGreen()

void CLColorDefinition::setGreen ( unsigned char  c)

Sets the green color component.

References mGreen.

◆ setId()

void CLColorDefinition::setId ( const std::string &  id)

Sets the id of the object.

References mId.

Referenced by ColorDefinitionHandler::processStart().

◆ setRed()

void CLColorDefinition::setRed ( unsigned char  c)

Sets the red color component.

References mRed.

◆ setRGBA()

void CLColorDefinition::setRGBA ( unsigned char  r,
unsigned char  g,
unsigned char  b,
unsigned char  a = 255 
)

Sets the red green, blue and alpha color component. The alpha value is optional and defaults to 255 if not given.

References mAlpha, mBlue, mGreen, and mRed.

◆ toData()

CData CLColorDefinition::toData ( ) const
virtual

Retrieve the data describing the object

Returns
CData data

Reimplemented from CDataObject.

References fatalError.

◆ toSBML()

ColorDefinition * CLColorDefinition::toSBML ( unsigned int  level,
unsigned int  version 
) const

Converts this object to the corresponding SBML object.

References mAlpha, mBlue, mGreen, mId, and mRed.

Referenced by CLRenderInformationBase::addSBMLAttributes().

Member Data Documentation

◆ mAlpha

unsigned char CLColorDefinition::mAlpha
protected

◆ mBlue

unsigned char CLColorDefinition::mBlue
protected

◆ mGreen

unsigned char CLColorDefinition::mGreen
protected

◆ mId

std::string CLColorDefinition::mId
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.

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

◆ mKey

std::string CLColorDefinition::mKey
protected

The color definition needs a key.

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

◆ mRed

unsigned char CLColorDefinition::mRed
protected

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