COPASI API
4.40.278
|
#include <CLGraphicalObject.h>
Public Member Functions | |
virtual bool | applyData (const CData &data, CUndoData::CChangeSet &changes) |
CLGraphicalObject (const CLGraphicalObject &src, const CDataContainer *pParent) | |
CLGraphicalObject (const GraphicalObject &sbml, std::map< std::string, std::string > &layoutmap, const CDataContainer *pParent=NO_PARENT) | |
CLGraphicalObject (const std::string &name="GraphicalObject", const CDataContainer *pParent=NO_PARENT) | |
virtual CLGraphicalObject * | clone () const |
virtual void | exportToSBML (GraphicalObject *sbmlobject, const std::map< const CDataObject *, SBase * > &copasimodelmap, std::map< std::string, const SBase * > &sbmlIDs) const |
CLBoundingBox & | getBoundingBox () |
const CLBoundingBox & | getBoundingBox () const |
const CLDimensions & | getDimensions () const |
const C_FLOAT64 & | getHeight () const |
virtual const std::string & | getKey () const |
CDataObject * | getModelObject () const |
std::string | getModelObjectDisplayName (bool regular=true, bool richtext=false) const |
const std::string & | getModelObjectKey () const |
std::string | getModelObjectName () const |
const std::string & | getObjectRole () const |
const CLPoint & | getPosition () const |
const C_FLOAT64 & | getWidth () const |
const C_FLOAT64 & | getX () const |
const C_FLOAT64 & | getY () const |
bool | hasValidModelReference () const |
virtual void | moveBy (const CLPoint &p) |
CLGraphicalObject & | operator= (const CLGraphicalObject &rhs) |
void | print (std::ostream *ostream) const |
void | setBoundingBox (const CLBoundingBox &bb) |
void | setDimensions (const CLDimensions &d) |
void | setHeight (const C_FLOAT64 &h) |
void | setModelObjectKey (const std::string &k) |
void | setObjectRole (const std::string &role) |
void | setPosition (const CLPoint &p) |
void | setWidth (const C_FLOAT64 &w) |
void | setX (const C_FLOAT64 &x) |
void | setY (const C_FLOAT64 &y) |
virtual CData | toData () const |
~CLGraphicalObject () | |
Public Member Functions inherited from CLBase | |
CLBase () | |
CLBase (const CLBase &b) | |
CLBase (const SBase &) | |
const std::string & | getTag () const |
bool | hasTag () const |
void | setTag (const std::string &tag) |
virtual | ~CLBase () |
Public Member Functions inherited from CDataContainer | |
virtual bool | add (CDataObject *pObject, const bool &adopt=true) |
virtual bool | appendDeletedDependentData (CUndoData &undoData) const |
CDataContainer (const CDataContainer &src, const CDataContainer *pParent) | |
CDataContainer (const std::string &name, const CDataContainer *pParent=NO_PARENT, const std::string &type="CN", const CFlags< Flag > &flag=CFlags< Flag >::None) | |
virtual void | createUndoData (CUndoData &undoData, const CUndoData::Type &type, const CData &oldData=CData(), const CCore::Framework &framework=CCore::Framework::ParticleNumbers) const override |
virtual std::string | getChildObjectUnits (const CDataObject *pObject) const |
void | getDescendants (CDataObject::DataObjectSet &descendants, const bool &recursive=false) const |
virtual size_t | getIndex (const CDataObject *pObject) const |
virtual const CObjectInterface * | getObject (const CCommonName &cn) const override |
virtual objectMap & | getObjects () |
virtual const objectMap & | getObjects () const |
virtual const std::string | getUnits () const override |
virtual const CDataObject * | getValueObject () const override |
virtual CUndoObjectInterface * | insert (const CData &data) override |
void | objectRenamed (CDataObject *pObject, const std::string &oldName) |
virtual bool | remove (CDataObject *pObject) |
virtual | ~CDataContainer () |
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 | destruct () override |
virtual CCommonName | getCN () const override |
virtual const CDataObject * | getDataObject () 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 CValidity & | getValidity () const override |
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 |
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 |
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 CLGraphicalObject * | fromData (const CData &data, CUndoObjectInterface *pParent) |
Static Public Member Functions inherited from CDataContainer | |
static CDataContainer * | 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 Member Functions | |
CLGraphicalObject (const CLGraphicalObject &src) | |
Protected Member Functions inherited from CDataContainer | |
template<class CType > | |
CDataMatrixReference< CType > * | addMatrixReference (const std::string &name, CType &reference, const CFlags< Flag > &flag=CFlags< Flag >::None) |
template<class CType > | |
CDataObjectReference< CType > * | addObjectReference (const std::string &name, CType &reference, const CFlags< Flag > &flag=CFlags< Flag >::None) |
template<class CType > | |
CDataVectorReference< CType > * | addVectorReference (const std::string &name, CType &reference, const CFlags< Flag > &flag=CFlags< Flag >::None) |
CDataContainer (const CDataContainer &src) | |
void | initObjects () |
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) | |
Protected Attributes | |
CLBoundingBox | mBBox |
std::string | mKey |
std::string | mModelObjectKey |
std::string | mObjectRole |
Protected Attributes inherited from CLBase | |
std::string | mTag |
Protected Attributes inherited from CDataContainer | |
objectMap | mObjects |
Protected Attributes inherited from CDataObject | |
ObjectSet | mPrerequisits |
std::set< CDataContainer * > | mReferences |
Protected Attributes inherited from CObjectInterface | |
CValidity | mValidity |
Friends | |
std::ostream & | operator<< (std::ostream &os, const CLGraphicalObject &g) |
Additional Inherited Members | |
Public Types inherited from CDataContainer | |
typedef CDataObjectMap | objectMap |
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 |
Static Public Attributes inherited from CDataContainer | |
static const CObjectInterface::ContainerList | EmptyList |
This is the base class for the layout objects in copasi. It is a CDataObject. It also has a key (which is used if one layout object refers to another one) It provides the mechanism for refering to a copasi model object by key. This needs to be specialized in the derived classes
|
protected |
Referenced by clone(), and fromData().
CLGraphicalObject::CLGraphicalObject | ( | const std::string & | name = "GraphicalObject" , |
const CDataContainer * | pParent = NO_PARENT |
||
) |
CLGraphicalObject::CLGraphicalObject | ( | const CLGraphicalObject & | src, |
const CDataContainer * | pParent | ||
) |
CLGraphicalObject::CLGraphicalObject | ( | const GraphicalObject & | sbml, |
std::map< std::string, std::string > & | layoutmap, | ||
const CDataContainer * | pParent = NO_PARENT |
||
) |
constructor from libsbml object
References mKey, and mObjectRole.
CLGraphicalObject::~CLGraphicalObject | ( | ) |
References CRootContainer::getKeyFactory(), mKey, and CKeyFactory::remove().
|
virtual |
Apply the provided data to the object
const | CData & data |
Reimplemented from CDataContainer.
Reimplemented in CLReactionGlyph, CLGeneralGlyph, CLMetabReferenceGlyph, CLReferenceGlyph, CLTextGlyph, CLCompartmentGlyph, and CLMetabGlyph.
References fatalError.
|
inlinevirtual |
Reimplemented in CLReactionGlyph, CLGeneralGlyph, CLMetabReferenceGlyph, CLReferenceGlyph, CLTextGlyph, CLCompartmentGlyph, and CLMetabGlyph.
References CLGraphicalObject().
|
virtual |
This method writes the information of the copasi layout object into the corresponding sbml object
References CSBMLExporter::createUniqueId(), CLBoundingBox::getSBMLBoundingBox(), mBBox, and mObjectRole.
Referenced by CLCompartmentGlyph::exportToSBML(), CLGeneralGlyph::exportToSBML(), CLReactionGlyph::exportToSBML(), CLReferenceGlyph::exportToSBML(), CLMetabGlyph::exportToSBML(), CLMetabReferenceGlyph::exportToSBML(), and CLTextGlyph::exportToSBML().
|
static |
Static method to create a CDataObject based on the provided data
const | CData & data |
References CLGraphicalObject(), CData::getProperty(), NO_PARENT, CData::OBJECT_NAME, and CDataValue::toString().
|
inline |
References mBBox.
|
inline |
References mBBox.
Referenced by CCopasiSpringLayout::borderProjection(), CLayout::calculateBoundingBox(), CLLayoutRenderer::draw_layout(), CCopasiSpringLayout::finalizeState(), CLLayoutRenderer::getObjectsAt(), CLLayoutRenderer::getObjectsInBoundingBox(), CLLayoutRenderer::move_graphical_object(), compareGraphicalObjectsBySize::operator()(), CCopasiSpringLayout::randomize(), and CCopasiXML::saveLayoutList().
|
inline |
References CLBoundingBox::getDimensions(), and mBBox.
Referenced by CCopasiSpringLayout::finalizeState(), randomlyPlaceGlyphInCompartmentGlyph(), and randomlyPlaceGlyphInDimensions().
|
inline |
References CLBoundingBox::getDimensions(), CLDimensions::getHeight(), and mBBox.
Referenced by CCopasiSpringLayout::addCompartmentVariables(), CCopasiSpringLayout::addReactionVariables(), CCopasiSpringLayout::borderProjection(), CCopasiSpringLayout::potEdge(), CCopasiSpringLayout::potGeneralEdge(), CCopasiSpringLayout::potReactionCompartment(), CCopasiSpringLayout::potReactionReaction(), CCopasiSpringLayout::potSecondOrderEdge(), CCopasiSpringLayout::potSpeciesCompartment(), CCopasiSpringLayout::potSpeciesReaction(), and CCopasiSpringLayout::potSpeciesSpecies().
|
inlinevirtual |
Retrieves the key of the layout object
Reimplemented from CDataObject.
References mKey.
Referenced by CLLocalStyle::appliesTo(), CLayout::CLayout(), CCopasiSpringLayout::createLayout(), CLayout::exportToSBML(), CLLocalRenderInformation::getStyleForGraphicalObject(), MetaboliteReferenceGlyphHandler::processStart(), StyleHandler::processStart(), TextGlyphHandler::processStart(), CLRenderResolver::resolveStyle(), CCopasiXML::saveLayoutList(), tagKey(), and CLLayoutRenderer::update_associations().
CDataObject * CLGraphicalObject::getModelObject | ( | ) | const |
References CKeyFactory::get(), CRootContainer::getKeyFactory(), hasValidModelReference(), and mModelObjectKey.
Referenced by CCopasiSpringLayout::createLayout(), CLLayoutRenderer::draw_layout(), CLCompartmentGlyph::exportToSBML(), CLGeneralGlyph::exportToSBML(), CLReactionGlyph::exportToSBML(), CLMetabGlyph::exportToSBML(), CLTextGlyph::exportToSBML(), getModelObjectDisplayName(), getModelObjectName(), and CCopasiSpringLayout::randomize().
std::string CLGraphicalObject::getModelObjectDisplayName | ( | bool | regular = true , |
bool | richtext = false |
||
) | const |
if the graphical object refers to a model object this method will return the display name of that object.
References getModelObject(), and CDataObject::getObjectName().
Referenced by CLTextGlyph::getText().
|
inline |
References mModelObjectKey.
Referenced by CCopasiXML::saveLayoutList(), CLLayoutRenderer::setDeduceSpeciesReferenceRoles(), and CLLayoutRenderer::update_associations().
std::string CLGraphicalObject::getModelObjectName | ( | ) | const |
if the graphical object refers to a model object this method will return the name of that object.
References getModelObject(), and CDataObject::getObjectName().
const std::string & CLGraphicalObject::getObjectRole | ( | ) | const |
Method to read the object role of an object.
References mObjectRole.
Referenced by CLStyle::appliesTo(), CLGlobalRenderInformation::getStyleForGraphicalObject(), CLLocalRenderInformation::getStyleForGraphicalObject(), CLRenderResolver::resolveStyle(), CCopasiXML::saveLayoutList(), and CLLayoutRenderer::setDeduceSpeciesReferenceRoles().
|
inline |
References CLBoundingBox::getPosition(), and mBBox.
Referenced by CCopasiSpringLayout::finalizeState(), CCopasiSpringLayout::initFromLayout(), and randomlyPlaceGlyphInCompartmentGlyph().
|
inline |
References CLBoundingBox::getDimensions(), CLDimensions::getWidth(), and mBBox.
Referenced by CCopasiSpringLayout::addCompartmentVariables(), CCopasiSpringLayout::addReactionVariables(), CCopasiSpringLayout::borderProjection(), CCopasiSpringLayout::potEdge(), CCopasiSpringLayout::potGeneralEdge(), CCopasiSpringLayout::potReactionCompartment(), CCopasiSpringLayout::potReactionReaction(), CCopasiSpringLayout::potSecondOrderEdge(), CCopasiSpringLayout::potSpeciesCompartment(), CCopasiSpringLayout::potSpeciesReaction(), and CCopasiSpringLayout::potSpeciesSpecies().
|
inline |
References CLBoundingBox::getPosition(), CLPoint::getX(), and mBBox.
Referenced by CCopasiSpringLayout::addCompartmentVariables(), CCopasiSpringLayout::addPositionVariables(), CCopasiSpringLayout::addReactionVariables(), placeTextGlyphs(), CCopasiSpringLayout::potEdge(), CCopasiSpringLayout::potGeneralEdge(), CCopasiSpringLayout::potReactionCompartment(), CCopasiSpringLayout::potReactionReaction(), CCopasiSpringLayout::potSecondOrderEdge(), CCopasiSpringLayout::potSpeciesCompartment(), CCopasiSpringLayout::potSpeciesReaction(), and CCopasiSpringLayout::potSpeciesSpecies().
|
inline |
References CLBoundingBox::getPosition(), CLPoint::getY(), and mBBox.
Referenced by CCopasiSpringLayout::addCompartmentVariables(), CCopasiSpringLayout::addPositionVariables(), CCopasiSpringLayout::addReactionVariables(), placeTextGlyphs(), CCopasiSpringLayout::potEdge(), CCopasiSpringLayout::potGeneralEdge(), CCopasiSpringLayout::potReactionCompartment(), CCopasiSpringLayout::potReactionReaction(), CCopasiSpringLayout::potSecondOrderEdge(), CCopasiSpringLayout::potSpeciesCompartment(), CCopasiSpringLayout::potSpeciesReaction(), and CCopasiSpringLayout::potSpeciesSpecies().
bool CLGraphicalObject::hasValidModelReference | ( | ) | const |
This method is used for the export of several layout elements. Layout elements can reference model elements, but when a referenced model element is deleted, the layout is not infomred about this yet, so we end up with dangling references. If the key belongs to an object in the same datamodel, true is returned, else false is returned.
This method is used for the export of several layout elements. Layout elements can reference model elements, but when a referenced model element is deleted, the layout is not infomred about this yet, so we end up with dnagling references. In order to not write these dangling references to file, we check if the reference belongs to a valid object in the same datamodel. If not, we issue a warning. This warning is only issued once during a save process.
If the key belongs to an object in the same datamodel, true is returned, else false is returned.
References CKeyFactory::get(), CRootContainer::getKeyFactory(), CDataObject::getObjectParent(), and mModelObjectKey.
Referenced by getModelObject(), and CCopasiXML::saveLayoutList().
|
virtual |
Reimplemented from CLBase.
Reimplemented in CLReactionGlyph, CLGeneralGlyph, and CLGlyphWithCurve.
References mBBox, and CLBoundingBox::moveBy().
Referenced by CLayout::moveBy(), and CLGlyphWithCurve::moveBy().
CLGraphicalObject & CLGraphicalObject::operator= | ( | const CLGraphicalObject & | rhs | ) |
The assignment operator does not copy the key.
References CDataObject::getObjectName(), mBBox, mModelObjectKey, mObjectRole, and CDataObject::setObjectName().
Referenced by CLCompartmentGlyph::operator=(), CLGlyphWithCurve::operator=(), CLMetabGlyph::operator=(), and CLTextGlyph::operator=().
|
virtual |
This is the output method for any object. The default implementation provided with CDataObject uses the ostream operator<< of the object to print the object.To override this default behavior one needs to reimplement the virtual print function.
std::ostream | * ostream |
Reimplemented from CDataObject.
Reimplemented in CLReactionGlyph, CLGeneralGlyph, CLMetabReferenceGlyph, CLReferenceGlyph, and CLGlyphWithCurve.
|
inline |
|
inline |
References mBBox, and CLBoundingBox::setDimensions().
Referenced by CCopasiSpringLayout::createLayout().
|
inline |
References CLBoundingBox::getDimensions(), mBBox, and CLDimensions::setHeight().
|
inline |
References mModelObjectKey.
Referenced by CLCompartmentGlyph::CLCompartmentGlyph(), CLGeneralGlyph::CLGeneralGlyph(), CLMetabGlyph::CLMetabGlyph(), CLMetabReferenceGlyph::CLMetabReferenceGlyph(), CLReactionGlyph::CLReactionGlyph(), CLReferenceGlyph::CLReferenceGlyph(), CLTextGlyph::CLTextGlyph(), CLayoutInitializer::createCompartmentGlyph(), CCopasiSpringLayout::createLayout(), CLayoutInitializer::createMetabGlyph(), CLayoutInitializer::createReactionGlyph(), CompartmentGlyphHandler::processStart(), MetaboliteGlyphHandler::processStart(), ReactionGlyphHandler::processStart(), and TextGlyphHandler::processStart().
void CLGraphicalObject::setObjectRole | ( | const std::string & | role | ) |
Method to set the role of a graphical object.
References mObjectRole.
Referenced by CCopasiSpringLayout::createLayout(), AdditionalGraphicalObjectHandler::processStart(), CompartmentGlyphHandler::processStart(), MetaboliteGlyphHandler::processStart(), MetaboliteReferenceGlyphHandler::processStart(), ReactionGlyphHandler::processStart(), and TextGlyphHandler::processStart().
|
inline |
|
inline |
References CLBoundingBox::getDimensions(), mBBox, and CLDimensions::setWidth().
|
inline |
References CLBoundingBox::getPosition(), mBBox, and CLPoint::setX().
|
inline |
References CLBoundingBox::getPosition(), mBBox, and CLPoint::setY().
|
virtual |
Retrieve the data describing the object
Reimplemented from CDataContainer.
Reimplemented in CLReactionGlyph, CLGeneralGlyph, CLMetabReferenceGlyph, CLReferenceGlyph, CLTextGlyph, CLCompartmentGlyph, and CLMetabGlyph.
References fatalError.
|
friend |
insert operator
|
protected |
Referenced by exportToSBML(), getBoundingBox(), getDimensions(), getHeight(), getPosition(), getWidth(), getX(), getY(), moveBy(), operator=(), setBoundingBox(), setDimensions(), setHeight(), setPosition(), setWidth(), setX(), and setY().
|
protected |
The key of the layout object itself
Referenced by CLGraphicalObject(), getKey(), and ~CLGraphicalObject().
|
protected |
The key of an object of the COPASI model. This is not used in this base class. It is provided as a service for the derived classes
Referenced by getModelObject(), getModelObjectKey(), hasValidModelReference(), operator=(), and setModelObjectKey().
|
protected |
Referenced by CLGraphicalObject(), exportToSBML(), getObjectRole(), operator=(), and setObjectRole().