COPASI API  4.16.103
Public Types | Public Member Functions | Protected Attributes | List of all members
CLGraphicalPrimitive2D Class Reference

#include <CLGraphicalPrimitive2D.h>

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

Public Types

enum  FILL_RULE { UNSET, NONZERO, EVENODD, INHERIT }
 

Public Member Functions

virtual void addSBMLAttributes (GraphicalPrimitive2D *pPrimitive) const
 
 CLGraphicalPrimitive2D ()
 
 CLGraphicalPrimitive2D (const GraphicalPrimitive2D &source)
 
const std::string & getFillColor () const
 
FILL_RULE getFillRule () const
 
bool isSetFill () const
 
bool isSetFillRule () const
 
void setFillColor (const std::string &color)
 
void setFillRule (FILL_RULE rule)
 
- Public Member Functions inherited from CLGraphicalPrimitive1D
virtual void addSBMLAttributes (GraphicalPrimitive1D *pPrimitive) const
 
 CLGraphicalPrimitive1D ()
 
 CLGraphicalPrimitive1D (const GraphicalPrimitive1D &source)
 
const std::vector< unsigned int > & getDashArray () const
 
const std::string & getStroke () const
 
double getStrokeWidth () const
 
bool isSetDashArray () const
 
bool isSetStroke () const
 
bool isSetStrokeWidth () const
 
void parseDashArray (const std::string &s)
 
void setDashArray (const std::vector< unsigned int > &array)
 
void setStroke (const std::string &key)
 
void setStrokeWidth (double width)
 
- Public Member Functions inherited from CLTransformation2D
 CLTransformation2D ()
 
 CLTransformation2D (const double m[6])
 
 CLTransformation2D (const Transformation2D &source)
 
std::string get2DTransformationString () const
 
const double * getMatrix2D () const
 
virtual void parseTransformation (const std::string &transformationString)
 
void setMatrix (const double m[12])
 
void setMatrix2D (const double m[6])
 
- Public Member Functions inherited from CLTransformation
 CLTransformation ()
 
 CLTransformation (const double matrix[12])
 
std::string get3DTransformationString () const
 
virtual const double * getMatrix () const
 
bool is2DTransformation () const
 
bool isIdentityMatrix () const
 
bool isSetMatrix () const
 
void setMatrix (const double m[12])
 
- 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 ()
 

Protected Attributes

std::string mFill
 
FILL_RULE mFillRule
 
- Protected Attributes inherited from CLGraphicalPrimitive1D
std::string mStroke
 
std::vector< unsigned int > mStrokeDashArray
 
double mStrokeWidth
 
- Protected Attributes inherited from CLTransformation2D
double mMatrix2D [6]
 
- Protected Attributes inherited from CLTransformation
double mMatrix [12]
 
- Protected Attributes inherited from CLBase
std::string mTag
 

Additional Inherited Members

- Static Public Member Functions inherited from CLTransformation2D
static const double * getIdentityMatrix2D ()
 
- Static Public Member Functions inherited from CLTransformation
static const double * getIdentityMatrix ()
 
- Static Public Attributes inherited from CLTransformation2D
static const double IDENTITY2D [6] = {1.0, 0.0, 0.0, 1.0, 0.0, 0.0}
 
- Static Public Attributes inherited from CLTransformation
static const double IDENTITY3D [12] = {1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0}
 
- Protected Member Functions inherited from CLTransformation2D
virtual void addSBMLAttributes (Transformation2D *pTransformation) const
 
void updateMatrix2D ()
 
void updateMatrix3D ()
 

Detailed Description

Definition at line 24 of file CLGraphicalPrimitive2D.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

CLGraphicalPrimitive2D::CLGraphicalPrimitive2D ( )
CLGraphicalPrimitive2D::CLGraphicalPrimitive2D ( const GraphicalPrimitive2D &  source)

Constructor to generate object from the corresponding SBML object.

Definition at line 30 of file CLGraphicalPrimitive2D.cpp.

References EVENODD, INHERIT, NONZERO, setFillRule(), and UNSET.

30  :
31  CLGraphicalPrimitive1D(source),
32  mFill(source.getFillColor())
33 {
34  switch (source.getFillRule())
35  {
36  case GraphicalPrimitive2D::UNSET:
38  break;
39  case GraphicalPrimitive2D::NONZERO:
41  break;
42  case GraphicalPrimitive2D::EVENODD:
44  break;
45  case GraphicalPrimitive2D::INHERIT:
47  break;
48  }
49 }
void setFillRule(FILL_RULE rule)

Member Function Documentation

void CLGraphicalPrimitive2D::addSBMLAttributes ( GraphicalPrimitive2D *  pPrimitive) const
virtual

Adds the attributes for a 2d graphical primitive object to the passed in. object.

Definition at line 103 of file CLGraphicalPrimitive2D.cpp.

References CLGraphicalPrimitive1D::addSBMLAttributes(), EVENODD, INHERIT, mFill, mFillRule, NONZERO, and UNSET.

Referenced by CLLineEnding::toSBML(), CLPolygon::toSBML(), CLEllipse::toSBML(), CLRectangle::toSBML(), and CLGroup::toSBML().

104 {
106  pPrimitive->setFillColor(this->mFill);
107 
108  switch (this->mFillRule)
109  {
111  pPrimitive->setFillRule(GraphicalPrimitive2D::UNSET);
112  break;
114  pPrimitive->setFillRule(GraphicalPrimitive2D::NONZERO);
115  break;
117  pPrimitive->setFillRule(GraphicalPrimitive2D::EVENODD);
118  break;
120  pPrimitive->setFillRule(GraphicalPrimitive2D::INHERIT);
121  break;
122  }
123 }
virtual void addSBMLAttributes(GraphicalPrimitive1D *pPrimitive) const
const std::string & CLGraphicalPrimitive2D::getFillColor ( ) const

Returns the fill color.

Definition at line 70 of file CLGraphicalPrimitive2D.cpp.

References mFill.

Referenced by CLLayoutRenderer::extract_2d_attributes(), getBrush(), CCopasiXML::save2DAttributes(), and CLLayoutRenderer::update_textures_and_colors().

71 {
72  return this->mFill;
73 }
CLGraphicalPrimitive2D::FILL_RULE CLGraphicalPrimitive2D::getFillRule ( ) const

Returns the fill rule.

Definition at line 78 of file CLGraphicalPrimitive2D.cpp.

References mFillRule.

Referenced by addLineEndingToItem(), CLLayoutRenderer::extract_2d_attributes(), fillItemFromPolygon(), and CCopasiXML::save2DAttributes().

79 {
80  return this->mFillRule;
81 }
bool CLGraphicalPrimitive2D::isSetFill ( ) const

Returns true if the fill attribute is set or false otherwise.

Definition at line 86 of file CLGraphicalPrimitive2D.cpp.

References mFill.

Referenced by addLineEndingToItem(), CCopasiXMLParser::GroupElement::end(), CLLayoutRenderer::extract_2d_attributes(), getBrush(), CCopasiXML::save2DAttributes(), and CLLayoutRenderer::update_textures_and_colors().

87 {
88  return !this->mFill.empty();
89 }
bool CLGraphicalPrimitive2D::isSetFillRule ( ) const
void CLGraphicalPrimitive2D::setFillColor ( const std::string &  color)
void CLGraphicalPrimitive2D::setFillRule ( CLGraphicalPrimitive2D::FILL_RULE  rule)

Member Data Documentation

std::string CLGraphicalPrimitive2D::mFill
protected

Definition at line 37 of file CLGraphicalPrimitive2D.h.

Referenced by addSBMLAttributes(), getFillColor(), isSetFill(), and setFillColor().

FILL_RULE CLGraphicalPrimitive2D::mFillRule
protected

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