COPASI API  4.16.103
Public Member Functions | Protected Attributes | Friends | List of all members
CLBoundingBox Class Reference

#include <CLBase.h>

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

Public Member Functions

 CLBoundingBox ()
 
 CLBoundingBox (const CLPoint &p, const CLDimensions &d)
 
 CLBoundingBox (const BoundingBox &bb)
 
CLPoint getCenter () const
 
const CLDimensionsgetDimensions () const
 
CLDimensionsgetDimensions ()
 
const CLPointgetPosition () const
 
CLPointgetPosition ()
 
BoundingBox getSBMLBoundingBox () const
 
virtual void moveBy (const CLPoint &p)
 
void scale (const double &scaleFactor)
 
void setDimensions (const CLDimensions &d)
 
void setPosition (const CLPoint &p)
 
- 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 ()
 

Protected Attributes

CLDimensions mDimensions
 
CLPoint mPosition
 
- Protected Attributes inherited from CLBase
std::string mTag
 

Friends

std::ostream & operator<< (std::ostream &os, const CLBoundingBox &bb)
 

Detailed Description

This class describes a bounding box.

Definition at line 244 of file CLBase.h.

Constructor & Destructor Documentation

CLBoundingBox::CLBoundingBox ( )
inline

Definition at line 254 of file CLBase.h.

255  : mPosition(), mDimensions() {};
CLPoint mPosition
Definition: CLBase.h:248
CLDimensions mDimensions
Definition: CLBase.h:250
CLBoundingBox::CLBoundingBox ( const CLPoint p,
const CLDimensions d 
)
inline

Definition at line 257 of file CLBase.h.

258  : mPosition(p), mDimensions(d) {};
CLPoint mPosition
Definition: CLBase.h:248
CLDimensions mDimensions
Definition: CLBase.h:250
CLBoundingBox::CLBoundingBox ( const BoundingBox &  bb)

constructor from libsbml object

Definition at line 55 of file CLBase.cpp.

56  : mPosition(*bb.getPosition()),
57  mDimensions(*bb.getDimensions())
58 {}
CLPoint mPosition
Definition: CLBase.h:248
CLDimensions mDimensions
Definition: CLBase.h:250

Member Function Documentation

CLPoint CLBoundingBox::getCenter ( ) const
inline

Definition at line 269 of file CLBase.h.

References CLDimensions::getHeight(), CLDimensions::getWidth(), CLPoint::getX(), CLPoint::getY(), mDimensions, and mPosition.

Referenced by CCopasiSpringLayout::borderProjection(), and CCopasiSpringLayout::finalizeState().

269 {return CLPoint(mPosition.getX() + 0.5 * mDimensions.getWidth(), mPosition.getY() + 0.5 * mDimensions.getHeight());};
const C_FLOAT64 & getWidth() const
Definition: CLBase.h:211
const C_FLOAT64 & getX() const
Definition: CLBase.h:83
Definition: CLBase.h:54
const C_FLOAT64 & getY() const
Definition: CLBase.h:84
const C_FLOAT64 & getHeight() const
Definition: CLBase.h:212
CLPoint mPosition
Definition: CLBase.h:248
CLDimensions mDimensions
Definition: CLBase.h:250
const CLDimensions& CLBoundingBox::getDimensions ( ) const
inline
CLDimensions& CLBoundingBox::getDimensions ( )
inline

Definition at line 270 of file CLBase.h.

References mDimensions.

270 {return mDimensions;};
CLDimensions mDimensions
Definition: CLBase.h:250
const CLPoint& CLBoundingBox::getPosition ( ) const
inline
CLPoint& CLBoundingBox::getPosition ( )
inline

Definition at line 268 of file CLBase.h.

References mPosition.

268 {return mPosition;};
CLPoint mPosition
Definition: CLBase.h:248
BoundingBox CLBoundingBox::getSBMLBoundingBox ( ) const

convert to sbml bounding box

Definition at line 60 of file CLBase.cpp.

References CLDimensions::getHeight(), CLDimensions::getWidth(), CLPoint::getX(), CLPoint::getY(), mDimensions, and mPosition.

Referenced by CLGraphicalObject::exportToSBML().

61 {
62  return BoundingBox(new LayoutPkgNamespaces(), "", mPosition.getX(), mPosition.getY(),
64 }
const C_FLOAT64 & getWidth() const
Definition: CLBase.h:211
const C_FLOAT64 & getX() const
Definition: CLBase.h:83
const C_FLOAT64 & getY() const
Definition: CLBase.h:84
const C_FLOAT64 & getHeight() const
Definition: CLBase.h:212
CLPoint mPosition
Definition: CLBase.h:248
CLDimensions mDimensions
Definition: CLBase.h:250
virtual void CLBoundingBox::moveBy ( const CLPoint p)
inlinevirtual

Reimplemented from CLBase.

Definition at line 275 of file CLBase.h.

References CLPoint::moveBy(), and mPosition.

Referenced by CLGraphicalObject::moveBy().

276  {
277  mPosition.moveBy(p);
278  };
virtual void moveBy(const CLPoint &p)
Definition: CLBase.h:120
CLPoint mPosition
Definition: CLBase.h:248
void CLBoundingBox::scale ( const double &  scaleFactor)
inline

Definition at line 285 of file CLBase.h.

References mDimensions, mPosition, CLPoint::scale(), and CLDimensions::scale().

Referenced by CGraphNode::scale().

285 {mPosition.scale(scaleFactor); mDimensions.scale(scaleFactor);}
void scale(const double &scaleFactor)
Definition: CLBase.h:95
void scale(const double &scaleFactor)
Definition: CLBase.h:223
CLPoint mPosition
Definition: CLBase.h:248
CLDimensions mDimensions
Definition: CLBase.h:250
void CLBoundingBox::setDimensions ( const CLDimensions d)
inline

Definition at line 273 of file CLBase.h.

References mDimensions.

Referenced by CLabel::adaptToHeight(), CLGraphicalObject::setDimensions(), and CCopasiXMLParser::BoundingBoxElement::start().

273 {mDimensions = d;};
CLDimensions mDimensions
Definition: CLBase.h:250
void CLBoundingBox::setPosition ( const CLPoint p)
inline

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const CLBoundingBox bb 
)
friend

insert operator

Definition at line 80 of file CLBase.cpp.

81 {
82  os << "[" << bb.mPosition << bb.mDimensions << "]";
83  return os;
84 }
CLPoint mPosition
Definition: CLBase.h:248
CLDimensions mDimensions
Definition: CLBase.h:250

Member Data Documentation

CLDimensions CLBoundingBox::mDimensions
protected

Definition at line 250 of file CLBase.h.

Referenced by getCenter(), getDimensions(), getSBMLBoundingBox(), operator<<(), scale(), and setDimensions().

CLPoint CLBoundingBox::mPosition
protected

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