COPASI API  4.40.278
CLayout Class Reference

#include <CLayout.h>

Inheritance diagram for CLayout:
[legend]

Public Member Functions

void addCompartmentGlyph (CLCompartmentGlyph *glyph)
 
void addGeneralGlyph (CLGeneralGlyph *glyph)
 
void addLocalRenderInformation (CLLocalRenderInformation *pRenderInfo)
 
void addMetaboliteGlyph (CLMetabGlyph *glyph)
 
void addReactionGlyph (CLReactionGlyph *glyph)
 
void addTextGlyph (CLTextGlyph *glyph)
 
virtual bool applyData (const CData &data, CUndoData::CChangeSet &changes)
 
void calculateAndAssignBounds ()
 
CLBoundingBox calculateBoundingBox () const
 
 CLayout (const CLayout &src, const CDataContainer *pParent)
 
 CLayout (const Layout &sbml, std::map< std::string, std::string > &layoutmap, const CDataContainer *pParent=NO_PARENT)
 
 CLayout (const std::string &name="Layout", const CDataContainer *pParent=NO_PARENT)
 
void exportToDotFile (std::ostream &os) const
 
void exportToSBML (Layout *layout, const std::map< const CDataObject *, SBase * > &copasimodelmap, std::map< std::string, const SBase * > &sbmlIDs, const std::map< std::string, std::string > &globalKeyToIdMap) const
 
const CLDimensionsgetDimensions () const
 
virtual const std::string & getKey () const
 
CDataVector< CLCompartmentGlyph > & getListOfCompartmentGlyphs ()
 
const CDataVector< CLCompartmentGlyph > & getListOfCompartmentGlyphs () const
 
CDataVector< CLGeneralGlyph > & getListOfGeneralGlyphs ()
 
const CDataVector< CLGeneralGlyph > & getListOfGeneralGlyphs () const
 
CDataVector< CLLocalRenderInformation > & getListOfLocalRenderInformationObjects ()
 
const CDataVector< CLLocalRenderInformation > & getListOfLocalRenderInformationObjects () const
 
CDataVector< CLMetabGlyph > & getListOfMetaboliteGlyphs ()
 
const CDataVector< CLMetabGlyph > & getListOfMetaboliteGlyphs () const
 
CDataVector< CLReactionGlyph > & getListOfReactionGlyphs ()
 
const CDataVector< CLReactionGlyph > & getListOfReactionGlyphs () const
 
CDataVector< CLTextGlyph > & getListOfTextGlyphs ()
 
const CDataVector< CLTextGlyph > & getListOfTextGlyphs () const
 
CLLocalRenderInformationgetRenderInformation (size_t index)
 
const CLLocalRenderInformationgetRenderInformation (size_t index) const
 
virtual void moveBy (const CLPoint &p)
 
void print (std::ostream *ostream) const
 
virtual void scale (const double &scaleFactor)
 
void setDimensions (const CLDimensions &d)
 
virtual CData toData () const
 
 ~CLayout ()
 
- 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 CObjectInterfacegetObject (const CCommonName &cn) const override
 
virtual objectMapgetObjects ()
 
virtual const objectMapgetObjects () const
 
virtual const std::string getUnits () const override
 
virtual const CDataObjectgetValueObject () const override
 
virtual CUndoObjectInterfaceinsert (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 CDataObjectgetDataObject () 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 CValiditygetValidity () 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 CLayoutfromData (const CData &data, CUndoObjectInterface *pParent)
 
- Static Public Member Functions inherited from CDataContainer
static CDataContainerfromData (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 Member Functions

 CLayout (const CLayout &src)
 
void writeDotEdge (std::ostream &os, const std::string &id1, const std::string &id2, int t=0) const
 
void writeDotNode (std::ostream &os, const std::string &id, const std::string &label, int t=0) const
 
- 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

CLDimensions mDimensions
 
std::string mKey
 
CDataVector< CLCompartmentGlyphmvCompartments
 
CDataVector< CLGeneralGlyphmvGraphicalObjects
 
CDataVector< CLTextGlyphmvLabels
 
CDataVector< CLLocalRenderInformationmvLocalRenderInformationObjects
 
CDataVector< CLMetabGlyphmvMetabs
 
CDataVector< CLReactionGlyphmvReactions
 
- 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 CLayout &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
 

Detailed Description

This class describes a reaction network layout. Its structure is exactly corresponding to the sbml layout extension

Constructor & Destructor Documentation

◆ CLayout() [1/4]

CLayout::CLayout ( const CLayout src)
protected

Referenced by fromData().

◆ CLayout() [2/4]

CLayout::CLayout ( const std::string &  name = "Layout",
const CDataContainer pParent = NO_PARENT 
)

◆ CLayout() [3/4]

◆ CLayout() [4/4]

CLayout::CLayout ( const Layout &  sbml,
std::map< std::string, std::string > &  layoutmap,
const CDataContainer pParent = NO_PARENT 
)

constructor from libsbml object. Does not read the whole libsbml tree. Additional work is done in SBMLDocumentLoader

References mKey, and CDataObject::setObjectName().

◆ ~CLayout()

CLayout::~CLayout ( )

Member Function Documentation

◆ addCompartmentGlyph()

void CLayout::addCompartmentGlyph ( CLCompartmentGlyph glyph)

add Glyph to layout. The layout takes ownership of the glyph.

References CDataVector< CType >::add(), and mvCompartments.

Referenced by CCopasiSpringLayout::createLayout(), SBMLDocumentLoader::createLayout(), and CompartmentGlyphHandler::processStart().

◆ addGeneralGlyph()

void CLayout::addGeneralGlyph ( CLGeneralGlyph glyph)

◆ addLocalRenderInformation()

void CLayout::addLocalRenderInformation ( CLLocalRenderInformation pRenderInfo)

add local render information to layout. The layout takes ownership of the object.

References CDataVector< CType >::add(), and mvLocalRenderInformationObjects.

Referenced by SBMLDocumentLoader::createLayout(), and CXMLParserData::createRenderInformation().

◆ addMetaboliteGlyph()

void CLayout::addMetaboliteGlyph ( CLMetabGlyph glyph)

add Glyph to layout. The layout takes ownership of the glyph.

References CDataVector< CType >::add(), and mvMetabs.

Referenced by CCopasiSpringLayout::createLayout(), SBMLDocumentLoader::createLayout(), and MetaboliteGlyphHandler::processStart().

◆ addReactionGlyph()

void CLayout::addReactionGlyph ( CLReactionGlyph glyph)

add Glyph to layout. The layout takes ownership of the glyph.

References CDataVector< CType >::add(), and mvReactions.

Referenced by CCopasiSpringLayout::createLayout(), SBMLDocumentLoader::createLayout(), and ReactionGlyphHandler::processStart().

◆ addTextGlyph()

void CLayout::addTextGlyph ( CLTextGlyph glyph)

add Glyph to layout. The layout takes ownership of the glyph.

References CDataVector< CType >::add(), and mvLabels.

Referenced by CCopasiSpringLayout::createLayout(), SBMLDocumentLoader::createLayout(), and TextGlyphHandler::processStart().

◆ applyData()

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

Apply the provided data to the object

Parameters
constCData & data
Returns
bool success

Reimplemented from CDataContainer.

References fatalError.

◆ calculateAndAssignBounds()

void CLayout::calculateAndAssignBounds ( )

Calculates the Bounding Box, moves the layout to the origin and assigns it to the layout.

References calculateBoundingBox(), CLBoundingBox::getDimensions(), CLBoundingBox::getPosition(), CLPoint::getX(), CLPoint::getY(), CLPoint::getZ(), moveBy(), and setDimensions().

Referenced by CCopasiSpringLayout::finalizeState().

◆ calculateBoundingBox()

CLBoundingBox CLayout::calculateBoundingBox ( ) const

This methods calculates the bounding box of the layout. It traverses all layout objects and looks for the minimal and maximal x and y values that occur in the layout. These values are returned in the form of a bounding box where the minimal values are stored in the position and the maxima are given as the minimal values plus the corresponding dimension.

References CLCurve::calculateBoundingBox(), CLGraphicalObject::getBoundingBox(), CLGlyphWithCurve::getCurve(), CLBoundingBox::getDimensions(), CLDimensions::getHeight(), getListOfCompartmentGlyphs(), getListOfGeneralGlyphs(), getListOfMetaboliteGlyphs(), CLReactionGlyph::getListOfMetabReferenceGlyphs(), getListOfReactionGlyphs(), CLGeneralGlyph::getListOfReferenceGlyphs(), getListOfTextGlyphs(), CLCurve::getNumCurveSegments(), CLBoundingBox::getPosition(), CLDimensions::getWidth(), CLPoint::getX(), CLPoint::getY(), max, and CDataVector< CType >::size().

Referenced by calculateAndAssignBounds(), and CCopasiSpringLayout::createLayout().

◆ exportToDotFile()

◆ exportToSBML()

◆ fromData()

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

Static method to create a CDataObject based on the provided data

Parameters
constCData & data
Returns
CLayout * pDataObject

References CLayout(), CData::getProperty(), NO_PARENT, CData::OBJECT_NAME, and CDataValue::toString().

◆ getDimensions()

const CLDimensions& CLayout::getDimensions ( ) const
inline

◆ getKey()

virtual const std::string& CLayout::getKey ( ) const
inlinevirtual

Retrieves the key of the layout

Reimplemented from CDataObject.

References mKey.

Referenced by exportToDotFile(), exportToSBML(), and CCopasiXML::saveLayoutList().

◆ getListOfCompartmentGlyphs() [1/2]

CDataVector<CLCompartmentGlyph>& CLayout::getListOfCompartmentGlyphs ( )
inline

References mvCompartments.

◆ getListOfCompartmentGlyphs() [2/2]

◆ getListOfGeneralGlyphs() [1/2]

CDataVector<CLGeneralGlyph>& CLayout::getListOfGeneralGlyphs ( )
inline

References mvGraphicalObjects.

◆ getListOfGeneralGlyphs() [2/2]

◆ getListOfLocalRenderInformationObjects() [1/2]

CDataVector<CLLocalRenderInformation>& CLayout::getListOfLocalRenderInformationObjects ( )
inline

Returns a reference to the list of local render information objects.

References mvLocalRenderInformationObjects.

◆ getListOfLocalRenderInformationObjects() [2/2]

const CDataVector<CLLocalRenderInformation>& CLayout::getListOfLocalRenderInformationObjects ( ) const
inline

Returns a const reference to the list of local render information objects.

References mvLocalRenderInformationObjects.

Referenced by CLLayoutRenderer::change_style(), SBMLDocumentLoader::createLayout(), CXMLParserData::createRenderInformation(), and CCopasiXML::saveLayoutList().

◆ getListOfMetaboliteGlyphs() [1/2]

CDataVector<CLMetabGlyph>& CLayout::getListOfMetaboliteGlyphs ( )
inline

References mvMetabs.

◆ getListOfMetaboliteGlyphs() [2/2]

◆ getListOfReactionGlyphs() [1/2]

CDataVector<CLReactionGlyph>& CLayout::getListOfReactionGlyphs ( )
inline

References mvReactions.

◆ getListOfReactionGlyphs() [2/2]

◆ getListOfTextGlyphs() [1/2]

CDataVector<CLTextGlyph>& CLayout::getListOfTextGlyphs ( )
inline

References mvLabels.

◆ getListOfTextGlyphs() [2/2]

◆ getRenderInformation() [1/2]

CLLocalRenderInformation * CLayout::getRenderInformation ( size_t  index)

Returns a pointer to the local render information with the given index or NULL if the index is invalid.

References mvLocalRenderInformationObjects, and CDataVector< CType >::size().

◆ getRenderInformation() [2/2]

const CLLocalRenderInformation * CLayout::getRenderInformation ( size_t  index) const

Returns a const pointer to the local render information with the given index or NULL if the index is invalid.

References mvLocalRenderInformationObjects, and CDataVector< CType >::size().

◆ moveBy()

◆ print()

void CLayout::print ( std::ostream *  ostream) const
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.

Parameters
std::ostream* ostream

Reimplemented from CDataObject.

◆ scale()

virtual void CLayout::scale ( const double &  scaleFactor)
inlinevirtual

References CLDimensions::scale().

◆ setDimensions()

void CLayout::setDimensions ( const CLDimensions d)
inline

◆ toData()

CData CLayout::toData ( ) const
virtual

Retrieve the data describing the object

Returns
CData data

Reimplemented from CDataContainer.

References fatalError.

◆ writeDotEdge()

void CLayout::writeDotEdge ( std::ostream &  os,
const std::string &  id1,
const std::string &  id2,
int  t = 0 
) const
protected

Referenced by exportToDotFile().

◆ writeDotNode()

void CLayout::writeDotNode ( std::ostream &  os,
const std::string &  id,
const std::string &  label,
int  t = 0 
) const
protected

Referenced by exportToDotFile().

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const CLayout g 
)
friend

insert operator

Member Data Documentation

◆ mDimensions

CLDimensions CLayout::mDimensions
protected

◆ mKey

std::string CLayout::mKey
protected

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

◆ mvCompartments

◆ mvGraphicalObjects

CDataVector<CLGeneralGlyph> CLayout::mvGraphicalObjects
protected

◆ mvLabels

CDataVector<CLTextGlyph> CLayout::mvLabels
protected

◆ mvLocalRenderInformationObjects

◆ mvMetabs

◆ mvReactions


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