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

#include <CLBase.h>

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

Public Member Functions

 CLPoint ()
 
 CLPoint (const C_FLOAT64 &x, const C_FLOAT64 &y, const C_FLOAT64 &z=0.0)
 
 CLPoint (const Point &p)
 
C_FLOAT64 dot (const CLPoint &rhs) const
 
Point getSBMLPoint () const
 
const C_FLOAT64getX () const
 
C_FLOAT64getX ()
 
const C_FLOAT64getY () const
 
C_FLOAT64getY ()
 
const C_FLOAT64getZ () const
 
C_FLOAT64getZ ()
 
bool isEmpty () const
 
virtual void moveBy (const CLPoint &p)
 
CLPoint operator* (const double &rhs) const
 
CLPoint operator+ (const CLPoint &rhs) const
 
CLPoint operator- (const CLPoint &rhs) const
 
bool operator< (const CLPoint &rhs) const
 
bool operator== (const CLPoint &rhs) const
 
void scale (const double &scaleFactor)
 
void setX (const C_FLOAT64 &x)
 
void setY (const C_FLOAT64 &y)
 
void setZ (const C_FLOAT64 &z)
 
- 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

C_FLOAT64 mX
 
C_FLOAT64 mY
 
C_FLOAT64 mZ
 
- Protected Attributes inherited from CLBase
std::string mTag
 

Friends

std::ostream & operator<< (std::ostream &os, const CLPoint &p)
 

Detailed Description

This class describes a Point in a layout It is 2-dimensional at the moment

Definition at line 54 of file CLBase.h.

Constructor & Destructor Documentation

CLPoint::CLPoint ( )
inline

Definition at line 63 of file CLBase.h.

Referenced by operator*(), operator+(), and operator-().

63  :
64  mX(0.0)
65  , mY(0.0)
66  , mZ(0.0)
67  {};
C_FLOAT64 mZ
Definition: CLBase.h:59
C_FLOAT64 mY
Definition: CLBase.h:58
C_FLOAT64 mX
Definition: CLBase.h:58
CLPoint::CLPoint ( const C_FLOAT64 x,
const C_FLOAT64 y,
const C_FLOAT64 z = 0.0 
)
inline

Definition at line 69 of file CLBase.h.

72  :
73  mX(x)
74  , mY(y)
75  , mZ(z)
76  {};
C_FLOAT64 mZ
Definition: CLBase.h:59
C_FLOAT64 mY
Definition: CLBase.h:58
C_FLOAT64 mX
Definition: CLBase.h:58
CLPoint::CLPoint ( const Point &  p)

constructor from libsbml object

Definition at line 23 of file CLBase.cpp.

23  :
24  mX(p.getXOffset())
25  , mY(p.getYOffset())
26  , mZ(p.getZOffset())
27 {}
C_FLOAT64 mZ
Definition: CLBase.h:59
C_FLOAT64 mY
Definition: CLBase.h:58
C_FLOAT64 mX
Definition: CLBase.h:58

Member Function Documentation

C_FLOAT64 CLPoint::dot ( const CLPoint rhs) const
inline

Definition at line 135 of file CLBase.h.

References mX, mY, and mZ.

Referenced by CCopasiSpringLayout::finalizeState().

136  {
137  return this->mX * rhs.mX + this->mY * rhs.mY
138  + this->mZ * rhs.mZ
139  ;
140  };
C_FLOAT64 mZ
Definition: CLBase.h:59
C_FLOAT64 mY
Definition: CLBase.h:58
C_FLOAT64 mX
Definition: CLBase.h:58
Point CLPoint::getSBMLPoint ( ) const

convert to sbml point

Definition at line 29 of file CLBase.cpp.

References mX, mY, and mZ.

30 {
31  Point p(new LayoutPkgNamespaces(), mX, mY, mZ);
32  return p;
33 }
C_FLOAT64 mZ
Definition: CLBase.h:59
C_FLOAT64 mY
Definition: CLBase.h:58
C_FLOAT64 mX
Definition: CLBase.h:58
const C_FLOAT64& CLPoint::getX ( ) const
inline

Definition at line 83 of file CLBase.h.

References mX.

Referenced by CQGLNetworkPainter::adaptCurveForCircle(), CQGLNetworkPainter::adaptCurveForRectangles(), addToPath(), adjustPosition(), CCopasiSpringLayout::borderProjection(), CLLayoutRenderer::calculate_intersection(), CQGLLayoutPainter::calculateAndAssignBounds(), CLayout::calculateAndAssignBounds(), CQGLNetworkPainter::calculateAngle(), CLayout::calculateBoundingBox(), CLCurve::calculateBoundingBox(), CQGLNetworkPainter::checkCurve(), CLLayoutRenderer::convert_to_absolute(), CQLabelGraphicsItem::CQLabelGraphicsItem(), CQGLNetworkPainter::createGraph(), CLLayoutRenderer::distance(), CLLayoutRenderer::draw_cap(), CLLayoutRenderer::draw_curve(), CLLayoutRenderer::draw_datapoints(), CLLayoutRenderer::draw_ellipse(), CLLayoutRenderer::draw_group(), CLLayoutRenderer::draw_layout(), CLLayoutRenderer::draw_polygon(), CLLayoutRenderer::draw_selection_box(), CLLayoutRenderer::draw_text(), CQGLNetworkPainter::drawArrow(), CQGLNetworkPainter::drawEdge(), fillItemFromCurve(), fillItemFromEllipse(), fillItemFromImage(), fillItemFromRectangle(), fillItemFromText(), CCopasiSpringLayout::finalizeState(), CQGLNetworkPainter::fitToScreen(), CLBoundingBox::getCenter(), CLLayoutRenderer::getCurveBoundingBox(), getLinearGradient(), CLLayoutRenderer::getObjectsAt(), CLLayoutRenderer::getObjectsInBoundingBox(), CQConnectionGraphicsItem::getPath(), getPath(), CQGLNetworkPainter::getPointNearCircle(), CQGLNetworkPainter::getPointOnCircle(), CQGLNetworkPainter::getPointOnRectangle(), getRadialGradient(), CLBoundingBox::getSBMLBoundingBox(), CLGraphicalObject::getX(), CGraphCurve::invertOrderOfPoints(), CLLayoutRenderer::is_curve_segment_visible(), CLLayoutRenderer::isSegmentHit(), CLLayoutRenderer::map_arrow_head(), CQGLLayoutPainter::mouseMoveEvent(), CQGLLayoutPainter::mouseReleaseEvent(), CLLayoutRenderer::move_curve_object(), CLLayoutRenderer::move_graphical_object(), CLLayoutRenderer::move_reaction_glyph(), CLLayoutRenderer::move_species_glyph(), moveToPoint(), randomlyPlaceGlyphInCompartmentGlyph(), CQLayoutMainWindow::saveImage(), CCopasiXML::savePosition(), CLabel::scalePosition(), CArrow::scalePosition(), CQGLNetworkPainter::setGraphSize(), CQGLNetworkPainter::setNodeSize(), CQGLViewport::slotHValueChanged(), CLLineEnding::toSBML(), CQGLViewport::updateScrollbars(), and CQGLNetworkPainter::zoom().

83 {return mX;};
C_FLOAT64 mX
Definition: CLBase.h:58
C_FLOAT64& CLPoint::getX ( )
inline

Definition at line 87 of file CLBase.h.

References mX.

87 {return mX;};
C_FLOAT64 mX
Definition: CLBase.h:58
const C_FLOAT64& CLPoint::getY ( ) const
inline

Definition at line 84 of file CLBase.h.

References mY.

Referenced by CQGLNetworkPainter::adaptCurveForCircle(), CQGLNetworkPainter::adaptCurveForRectangles(), addToPath(), adjustPosition(), CCopasiSpringLayout::borderProjection(), CLLayoutRenderer::calculate_intersection(), CQGLLayoutPainter::calculateAndAssignBounds(), CLayout::calculateAndAssignBounds(), CQGLNetworkPainter::calculateAngle(), CLayout::calculateBoundingBox(), CLCurve::calculateBoundingBox(), CQGLNetworkPainter::checkCurve(), CLLayoutRenderer::convert_to_absolute(), CQLabelGraphicsItem::CQLabelGraphicsItem(), CQGLNetworkPainter::createGraph(), CLLayoutRenderer::distance(), CLLayoutRenderer::draw_cap(), CLLayoutRenderer::draw_curve(), CLLayoutRenderer::draw_datapoints(), CLLayoutRenderer::draw_ellipse(), CLLayoutRenderer::draw_group(), CLLayoutRenderer::draw_layout(), CLLayoutRenderer::draw_polygon(), CLLayoutRenderer::draw_selection_box(), CLLayoutRenderer::draw_text(), CQGLNetworkPainter::drawArrow(), CQGLNetworkPainter::drawEdge(), fillItemFromCurve(), fillItemFromEllipse(), fillItemFromImage(), fillItemFromRectangle(), fillItemFromText(), CCopasiSpringLayout::finalizeState(), CQGLNetworkPainter::fitToScreen(), CLBoundingBox::getCenter(), CLLayoutRenderer::getCurveBoundingBox(), getLinearGradient(), CLLayoutRenderer::getObjectsAt(), CLLayoutRenderer::getObjectsInBoundingBox(), CQConnectionGraphicsItem::getPath(), getPath(), CQGLNetworkPainter::getPointNearCircle(), CQGLNetworkPainter::getPointOnCircle(), CQGLNetworkPainter::getPointOnRectangle(), getRadialGradient(), CLBoundingBox::getSBMLBoundingBox(), CLGraphicalObject::getY(), CGraphCurve::invertOrderOfPoints(), CLLayoutRenderer::is_curve_segment_visible(), CLLayoutRenderer::isSegmentHit(), CLLayoutRenderer::map_arrow_head(), CQGLLayoutPainter::mouseMoveEvent(), CQGLLayoutPainter::mouseReleaseEvent(), CLLayoutRenderer::move_curve_object(), CLLayoutRenderer::move_graphical_object(), CLLayoutRenderer::move_reaction_glyph(), CLLayoutRenderer::move_species_glyph(), moveToPoint(), randomlyPlaceGlyphInCompartmentGlyph(), CQLayoutMainWindow::saveImage(), CCopasiXML::savePosition(), CLabel::scalePosition(), CArrow::scalePosition(), CQGLNetworkPainter::setGraphSize(), CQGLNetworkPainter::setNodeSize(), CQGLViewport::slotVValueChanged(), CLLineEnding::toSBML(), CQGLViewport::updateScrollbars(), and CQGLNetworkPainter::zoom().

84 {return mY;};
C_FLOAT64 mY
Definition: CLBase.h:58
C_FLOAT64& CLPoint::getY ( )
inline

Definition at line 88 of file CLBase.h.

References mY.

88 {return mY;};
C_FLOAT64 mY
Definition: CLBase.h:58
const C_FLOAT64& CLPoint::getZ ( ) const
inline
C_FLOAT64& CLPoint::getZ ( )
inline

Definition at line 89 of file CLBase.h.

References mZ.

89 {return mZ;};
C_FLOAT64 mZ
Definition: CLBase.h:59
bool CLPoint::isEmpty ( ) const
inline

Definition at line 163 of file CLBase.h.

References mX, mY, and mZ.

Referenced by CLayout::moveBy().

164  {
165  return mX == 0
166  && mY == 0
167  && mZ == 0
168  ;
169  }
C_FLOAT64 mZ
Definition: CLBase.h:59
C_FLOAT64 mY
Definition: CLBase.h:58
C_FLOAT64 mX
Definition: CLBase.h:58
virtual void CLPoint::moveBy ( const CLPoint p)
inlinevirtual

Reimplemented from CLBase.

Definition at line 120 of file CLBase.h.

References mX, mY, and mZ.

Referenced by CLCurve::moveBy(), and CLBoundingBox::moveBy().

121  {
122  mX += p.mX;
123  mY += p.mY;
124  mZ += p.mZ;
125  };
C_FLOAT64 mZ
Definition: CLBase.h:59
C_FLOAT64 mY
Definition: CLBase.h:58
C_FLOAT64 mX
Definition: CLBase.h:58
CLPoint CLPoint::operator* ( const double &  rhs) const
inline

Definition at line 127 of file CLBase.h.

References CLPoint(), mX, mY, and mZ.

128  {
129  return CLPoint(this->mX * rhs,
130  this->mY * rhs
131  , this->mZ * rhs
132  );
133  };
C_FLOAT64 mZ
Definition: CLBase.h:59
C_FLOAT64 mY
Definition: CLBase.h:58
C_FLOAT64 mX
Definition: CLBase.h:58
CLPoint()
Definition: CLBase.h:63
CLPoint CLPoint::operator+ ( const CLPoint rhs) const
inline

Definition at line 112 of file CLBase.h.

References CLPoint(), mX, mY, and mZ.

113  {
114  return CLPoint(this->mX + rhs.mX,
115  this->mY + rhs.mY
116  , this->mZ + rhs.mZ
117  );
118  };
C_FLOAT64 mZ
Definition: CLBase.h:59
C_FLOAT64 mY
Definition: CLBase.h:58
C_FLOAT64 mX
Definition: CLBase.h:58
CLPoint()
Definition: CLBase.h:63
CLPoint CLPoint::operator- ( const CLPoint rhs) const
inline

Definition at line 104 of file CLBase.h.

References CLPoint(), mX, mY, and mZ.

105  {
106  return CLPoint(this->mX - rhs.mX,
107  this->mY - rhs.mY
108  , this->mZ - rhs.mZ
109  );
110  };
C_FLOAT64 mZ
Definition: CLBase.h:59
C_FLOAT64 mY
Definition: CLBase.h:58
C_FLOAT64 mX
Definition: CLBase.h:58
CLPoint()
Definition: CLBase.h:63
bool CLPoint::operator< ( const CLPoint rhs) const
inline

Definition at line 143 of file CLBase.h.

References mX, mY, and mZ.

144  {
145  if (mX == rhs.mX)
146  if (mY == rhs.mY)
147  {
148  return (mZ < rhs.mZ);
149  }
150  else
151  {
152  return (mY < rhs.mY);
153  }
154  else
155  return (mX < rhs.mX);
156  };
C_FLOAT64 mZ
Definition: CLBase.h:59
C_FLOAT64 mY
Definition: CLBase.h:58
C_FLOAT64 mX
Definition: CLBase.h:58
bool CLPoint::operator== ( const CLPoint rhs) const
inline

Definition at line 97 of file CLBase.h.

References mX, mY, and mZ.

98  {
99  bool result = (mX == rhs.mX) && (mY == rhs.mY);
100  result &= mZ == rhs.mZ;
101  return result;
102  };
C_FLOAT64 mZ
Definition: CLBase.h:59
C_FLOAT64 mY
Definition: CLBase.h:58
C_FLOAT64 mX
Definition: CLBase.h:58
void CLPoint::scale ( const double &  scaleFactor)
inline

Definition at line 95 of file CLBase.h.

References mX, and mY.

Referenced by CCopasiSpringLayout::finalizeState(), CLLineSegment::scale(), and CLBoundingBox::scale().

95 {mX *= scaleFactor; mY *= scaleFactor;}
C_FLOAT64 mY
Definition: CLBase.h:58
C_FLOAT64 mX
Definition: CLBase.h:58
void CLPoint::setX ( const C_FLOAT64 x)
inline
void CLPoint::setY ( const C_FLOAT64 y)
inline
void CLPoint::setZ ( const C_FLOAT64 z)
inline

Definition at line 93 of file CLBase.h.

References mZ.

Referenced by CLLayoutRenderer::is_curve_segment_visible().

93 {mZ = z;};
C_FLOAT64 mZ
Definition: CLBase.h:59

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const CLPoint p 
)
friend

insert operator

Definition at line 68 of file CLBase.cpp.

69 {
70  os << "(x=" << p.mX << ", y=" << p.mY << ")";
71  return os;
72 }
C_FLOAT64 mY
Definition: CLBase.h:58
C_FLOAT64 mX
Definition: CLBase.h:58

Member Data Documentation

C_FLOAT64 CLPoint::mX
protected
C_FLOAT64 CLPoint::mY
protected
C_FLOAT64 CLPoint::mZ
protected

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