Exemplo n.º 1
0
/**
 * Copy constructor.
 */
Curve::Curve(const Curve& source):SBase(source)
{
    // copy the line segments
    this->mCurveSegments=*source.getListOfCurveSegments();

    connectToChild();
}
Exemplo n.º 2
0
/*
 * Constructor which sets the id, the coordinates and the dimensions to the
 * given 3D values.
 */ 
BoundingBox::BoundingBox (LayoutPkgNamespaces* layoutns, const std::string id,
                          const Point*      p,
                          const Dimensions* d)
  : SBase     (layoutns)
  , mId (id)
  , mPosition(layoutns)
  , mDimensions(layoutns)
  ,mPositionExplicitlySet (true)
  ,mDimensionsExplicitlySet (true)
{
  //
  // set the element namespace of this object
  //
  setElementNamespace(layoutns->getURI());

  if(p)
  {
      this->mPosition=*p;   
  }

  mPosition.setElementName("position");


  if(d)
  {
      this->mDimensions=*d;   
  }

  connectToChild();
  //
  // load package extensions bound with this object (if any) 
  //
  loadPlugins(layoutns);
}
Exemplo n.º 3
0
LIBSBML_CPP_NAMESPACE_BEGIN

/** @cond doxygenLibsbmlInternal */
/*
 * Creates a new RenderPoint object with the given SBML level
 * and SBML version.
 *
 * @param level SBML level of the new object
 * @param level SBML version of the new object
 */
RenderPoint::RenderPoint (unsigned int level, unsigned int version, unsigned int pkgVersion) : 
    SBase(level,version)
    ,mXOffset(RelAbsVector(0.0,0.0))
    ,mYOffset(RelAbsVector(0.0,0.0))
    ,mZOffset(RelAbsVector(0.0,0.0))
    ,mElementName("element")
{
    if (!hasValidLevelVersionNamespaceCombination())
        throw SBMLConstructorException();

  RenderPkgNamespaces* renderns = new RenderPkgNamespaces(level, version, pkgVersion);
  setSBMLNamespacesAndOwn(renderns);  

  connectToChild();

  loadPlugins(renderns);
}
Exemplo n.º 4
0
/*
 * Creates a GeneralGlyph with the given @p id and set the id of the
 * associated reaction to the second argument.
 */
GeneralGlyph::GeneralGlyph (LayoutPkgNamespaces* layoutns, const std::string& id,
                              const std::string& referenceId) 
  : GraphicalObject( layoutns, id  )
   ,mReference      ( referenceId  )
   ,mReferenceGlyphs(layoutns)
   ,mSubGlyphs(layoutns)
   ,mCurve(layoutns)
   , mCurveExplicitlySet (false)
{
  mSubGlyphs.setElementName("listOfSubGlyphs");

  //
  // (NOTE) Developers don't have to invoke setElementNamespace function as follows (commentted line)
  //        in this constuctor because the function is properly invoked in the constructor of the
  //        base class (LineSegment).
  //

  // setElementNamespace(layoutns->getURI());

  connectToChild();

  //
  // load package extensions bound with this object (if any) 
  //
  loadPlugins(layoutns);
}
Exemplo n.º 5
0
/*
 * Creates a new RenderPoint object from the given XMLNode object.
 * The XMLNode object has to contain a valid XML representation of a 
 * RenderPoint object as defined in the render extension specification.
 * This method is normally called when render information is read from a file and 
 * should normally not have to be called explicitely.
 *
 * @param node the XMLNode object reference that describes the RenderPoint
 * object to be instantiated.
 */
RenderPoint::RenderPoint(const XMLNode& node, unsigned int l2version) : SBase(2, l2version)
{
    const XMLAttributes& attributes=node.getAttributes();
    const XMLNode* child;
     ExpectedAttributes ea;
    addExpectedAttributes(ea);
    this->readAttributes(attributes, ea);
    unsigned int n=0,nMax = node.getNumChildren();
    while(n<nMax)
    {
        child=&node.getChild(n);
        const std::string& childName=child->getName();
        if(childName=="annotation")
        {
            this->mAnnotation=new XMLNode(node);
        }
        else if(childName=="notes")
        {
            this->mNotes=new XMLNode(node);
        }
        else
        {
            //throw;
        }
        ++n;
    }    

    
  setSBMLNamespacesAndOwn(new RenderPkgNamespaces(2,l2version));  

  connectToChild();
}
Exemplo n.º 6
0
/*
 * Creates a CubicBezier and returns the pointer.
 */
CubicBezier::CubicBezier(LayoutPkgNamespaces* layoutns)
 : LineSegment(layoutns)
  ,mBasePoint1(layoutns)
  ,mBasePoint2(layoutns)
  , mBasePt1ExplicitlySet (false)
  , mBasePt2ExplicitlySet (false)
{
  this->mStartPoint.setElementName("start");
  this->mEndPoint.setElementName("end");
  this->mBasePoint1.setElementName("basePoint1");
  this->mBasePoint2.setElementName("basePoint2");

  connectToChild();

  //
  // (NOTE) Developers don't have to invoke setElementNamespace function as follows (commentted line)
  //        in this constuctor because the function is properly invoked in the constructor of the
  //        base class (LineSegment).
  //

  // setElementNamespace(layoutns->getURI());

  //
  // load package extensions bound with this object (if any) 
  //
  loadPlugins(layoutns);
}
/**
 * Copy constructor.
 */
ReactionGlyph::ReactionGlyph(const ReactionGlyph& source):GraphicalObject(source)
{
    this->mReaction=source.getReactionId();
    this->mCurve=*source.getCurve();
    this->mSpeciesReferenceGlyphs=*source.getListOfSpeciesReferenceGlyphs();

    connectToChild();
}
Exemplo n.º 8
0
/*
 * Copy constructor.
 */
CubicBezier::CubicBezier(const CubicBezier& orig):LineSegment(orig)
{
  this->mBasePoint1=orig.mBasePoint1;
  this->mBasePoint2=orig.mBasePoint2;
  this->mBasePt1ExplicitlySet=orig.mBasePt1ExplicitlySet;
  this->mBasePt2ExplicitlySet=orig.mBasePt2ExplicitlySet;

  connectToChild();
}
Exemplo n.º 9
0
LIBSBML_CPP_NAMESPACE_BEGIN

CompSBasePlugin::CompSBasePlugin (const std::string &uri, const std::string &prefix, CompPkgNamespaces *compns)
  : SBasePlugin(uri,prefix, compns)
  , mListOfReplacedElements(NULL)
  , mReplacedBy(NULL)
{
  connectToChild();
}
Exemplo n.º 10
0
/*
 * Copy constructor.
 */
BoundingBox::BoundingBox(const BoundingBox& orig):SBase(orig)
{
  this->mId = orig.mId;
  this->mPosition=orig.mPosition;
  this->mDimensions=orig.mDimensions;
  this->mPositionExplicitlySet = orig.mPositionExplicitlySet;
  this->mDimensionsExplicitlySet = orig.mDimensionsExplicitlySet;

  connectToChild();
}
/**
 * Copy constructor.
 */
SpeciesReferenceGlyph::SpeciesReferenceGlyph(const SpeciesReferenceGlyph& source) :
    GraphicalObject(source)
{
    this->mSpeciesReference=source.getSpeciesReferenceId();
    this->mSpeciesGlyph=source.getSpeciesGlyphId();
    this->mRole=source.getRole();
    this->mCurve=*source.getCurve();

    connectToChild();
}
Exemplo n.º 12
0
/*
 * Copy constructor.
 */
GeneralGlyph::GeneralGlyph(const GeneralGlyph& source):GraphicalObject(source)
{
    this->mReference=source.getReferenceId();
    this->mCurve=*source.getCurve();
    this->mReferenceGlyphs=*source.getListOfReferenceGlyphs();
    this->mSubGlyphs=*source.getListOfSubGlyphs();
    this->mCurveExplicitlySet = source.mCurveExplicitlySet;

    connectToChild();
}
Exemplo n.º 13
0
/*
 * Creates a new CubicBezier from the given XMLNode
 */
CubicBezier::CubicBezier(const XMLNode& node, unsigned int l2version)
 : LineSegment(2, l2version)
  ,mBasePoint1(2, l2version)
  ,mBasePoint2(2, l2version)
  , mBasePt1ExplicitlySet (false)
  , mBasePt2ExplicitlySet (false)
{
    const XMLAttributes& attributes=node.getAttributes();
    const XMLNode* child;
    //ExpectedAttributes ea(getElementName());
    ExpectedAttributes ea;
    addExpectedAttributes(ea);
    this->readAttributes(attributes,ea);
    unsigned int n=0,nMax = node.getNumChildren();
    while(n<nMax)
    {
        child=&node.getChild(n);
        const std::string& childName=child->getName();
        if(childName=="start")
        {
            this->mStartPoint=Point(*child);
            this->mStartExplicitlySet = true;
        }
        else if(childName=="end")
        {
            this->mEndPoint=Point(*child);
            this->mEndExplicitlySet = true;
        }
        else if(childName=="basePoint1")
        {
            this->mBasePoint1=Point(*child);
            this->mBasePt1ExplicitlySet = true;
        }
        else if(childName=="basePoint2")
        {
            this->mBasePoint2=Point(*child);
            this->mBasePt2ExplicitlySet = true;
        }
        else if(childName=="annotation")
        {
            this->mAnnotation=new XMLNode(*child);
        }
        else if(childName=="notes")
        {
            this->mNotes=new XMLNode(*child);
        }
        else
        {
            //throw;
        }
        ++n;
    }    

  connectToChild();
}
Exemplo n.º 14
0
/*
 * Copy constructor.
 */
ReferenceGlyph::ReferenceGlyph(const ReferenceGlyph& source) :
    GraphicalObject(source)
{
    this->mReference=source.mReference;
    this->mGlyph=source.mGlyph;
    this->mRole=source.mRole;
    this->mCurve=*source.getCurve();
    this->mCurveExplicitlySet = source.mCurveExplicitlySet;

    connectToChild();
}
Exemplo n.º 15
0
/*
 * Default Constructor set position and dimensions to (0.0,0.0,0.0) and the
 * id to an empty string.
 */ 
BoundingBox::BoundingBox(unsigned int level, unsigned int version, unsigned int pkgVersion) 
 : SBase(level,version)
  ,mPosition(level,version,pkgVersion)
  ,mDimensions(level,version,pkgVersion)
  ,mPositionExplicitlySet (false)
  ,mDimensionsExplicitlySet (false)
{
  mPosition.setElementName("position");
  setSBMLNamespacesAndOwn(new LayoutPkgNamespaces(level,version,pkgVersion));  
  connectToChild();
}
Exemplo n.º 16
0
/**
 * Assignment operator.
 */
LineSegment& LineSegment::operator=(const LineSegment& orig)
{
  if(&orig!=this)
  {
    this->SBase::operator=(orig);
    this->mStartPoint=orig.mStartPoint;
    this->mEndPoint=orig.mEndPoint;
    connectToChild();
  }
  
  return *this;
}
Exemplo n.º 17
0
/*
 * Creates a new Transformation2D object with the given SBMLNamespaces.
 *
 * @param sbmlns The SBML namespace for the object.
 */
Transformation2D::Transformation2D (RenderPkgNamespaces* renderns):
    Transformation(renderns)
{
    this->updateMatrix2D();
        // set the element namespace of this object
  setElementNamespace(renderns->getURI());

  // connect child elements to this element.
  connectToChild();

  // load package extensions bound with this object (if any) 
  loadPlugins(renderns);
}
Exemplo n.º 18
0
/*
 * Creates a new Transformation2D object from the given XMLNode object.
 * The XMLNode object has to contain a valid XML representation of a 
 * Transformation2D object as defined in the render extension specification.
 * This method is normally called when render information is read from a file and 
 * should normally not have to be called explicitely.
 *
 * @param node the XMLNode object reference that describes the Transformation2D
 * object to be instantiated.
 */
Transformation2D::Transformation2D(const XMLNode& node, unsigned int l2version)
  :Transformation(node, l2version)
{
      ExpectedAttributes ea;
    addExpectedAttributes(ea);

    this->readAttributes(node.getAttributes(), ea);

    
  setSBMLNamespacesAndOwn(new RenderPkgNamespaces(2,l2version));  

  connectToChild();
}
Exemplo n.º 19
0
LIBSBML_CPP_NAMESPACE_BEGIN

/**
 * Creates a curve with the given SBML level, version and package version and 
 * an empty list of segments.
 */ 
Curve::Curve (unsigned int level, unsigned int version, unsigned int pkgVersion) 
 : SBase (level,version)
  ,mCurveSegments(level,version,pkgVersion)
{
  setSBMLNamespacesAndOwn(new LayoutPkgNamespaces(level,version,pkgVersion));  
  connectToChild();
}
Exemplo n.º 20
0
/**
 * Assignment operator.
 */
ReactionGlyph& ReactionGlyph::operator=(const ReactionGlyph& source)
{
  if(&source!=this)
  {
    GraphicalObject::operator=(source);
    this->mReaction=source.getReactionId();
    this->mCurve=*source.getCurve();
    this->mSpeciesReferenceGlyphs=*source.getListOfSpeciesReferenceGlyphs();
    connectToChild();
  }
  
  return *this;
}
Exemplo n.º 21
0
/*
 * Assignment operator.
 */
Curve& Curve::operator=(const Curve& source)
{
  if(&source!=this)
  {
    this->SBase::operator=(source);
    // copy the line segments
    this->mCurveSegments=*source.getListOfCurveSegments();

    connectToChild();  
  }
  
  return *this;
}
Exemplo n.º 22
0
/*
 * Assignment operator.
 */
CubicBezier& CubicBezier::operator=(const CubicBezier& orig)
{
  if(&orig!=this)
  {
    LineSegment::operator=(orig);
    this->mBasePoint1=orig.mBasePoint1;
    this->mBasePoint2=orig.mBasePoint2;
    this->mBasePt1ExplicitlySet=orig.mBasePt1ExplicitlySet;
    this->mBasePt2ExplicitlySet=orig.mBasePt2ExplicitlySet;
    connectToChild();
  }

  return *this;
}
/*
 * Creates a new GlobalRenderInformation object with the given SBMLNamespaces.
 *
 * @param sbmlns The SBML namespace for the object.
 */
GlobalRenderInformation::GlobalRenderInformation (RenderPkgNamespaces* renderns):
    RenderInformationBase(renderns), mListOfStyles(renderns)
{
    if (!hasValidLevelVersionNamespaceCombination())
        throw SBMLConstructorException();
        // set the element namespace of this object
  setElementNamespace(renderns->getURI());

  // connect child elements to this element.
  connectToChild();

  // load package extensions bound with this object (if any) 
  loadPlugins(renderns);
}
Exemplo n.º 24
0
/*
 * Creates a new RenderCubicBezier object with the given SBMLNamespaces.
 *
 * @param sbmlns The SBML namespace for the object.
 */
RenderCubicBezier::RenderCubicBezier (RenderPkgNamespaces* renderns):
    RenderPoint(renderns)
{
    if (!hasValidLevelVersionNamespaceCombination())
        throw SBMLConstructorException();
    // set the element namespace of this object
    setElementNamespace(renderns->getURI());

    // connect child elements to this element.
    connectToChild();

    // load package extensions bound with this object (if any)
    loadPlugins(renderns);
}
Exemplo n.º 25
0
/*
 * Creates a new Style object with the given SBMLNamespaces.
 *
 * @param sbmlns The SBML namespace for the object.
 */
Style::Style (RenderPkgNamespaces* renderns):
    SBase(renderns)
    ,mId("")
    ,mGroup(renderns) 
{
      // set the element namespace of this object
  setElementNamespace(renderns->getURI());

  // connect child elements to this element.
  connectToChild();

  // load package extensions bound with this object (if any) 
  loadPlugins(renderns);
}
Exemplo n.º 26
0
/*
 * Constructor which creates a GlobalStyle with the given @p id
 * and all lists empty.
 *
 * @param id the new id for the GlobalStyle.
 *
 * This constructor is deprecated. The new libsbml API only has
 * constructors which take the SBML level and version or one that takes
 * an SBMLNamespaces object.
 */
GlobalStyle::GlobalStyle(RenderPkgNamespaces* renderns, const std::string& id):Style(renderns,id)
{
#ifdef DEPRECATION_WARNINGS
    std::cerr << "Warning. GlobalStyle::GlobalStyle(const std::string& id) is deprecated." << std::endl;
#endif // DEPRECATION_WARNINGS
        // set the element namespace of this object
  setElementNamespace(renderns->getURI());

  // connect child elements to this element.
  connectToChild();

  // load package extensions bound with this object (if any) 
  loadPlugins(renderns);
}
Exemplo n.º 27
0
/*
 * Creates a new BoundingBox from the given XMLNode
 */
BoundingBox::BoundingBox(const XMLNode& node, unsigned int l2version)
 :  SBase(2,l2version)
  , mId("")
  , mPosition(2,l2version)
  , mDimensions(2,l2version)
  ,mPositionExplicitlySet (false)
  ,mDimensionsExplicitlySet (false)
{
    mPosition.setElementName("position");

    const XMLAttributes& attributes=node.getAttributes();
    const XMLNode* child;

    //ExpectedAttributes ea(getElementName());
    ExpectedAttributes ea;
    addExpectedAttributes(ea);
    this->readAttributes(attributes,ea);
    unsigned int n=0,nMax = node.getNumChildren();
    while(n<nMax)
    {
        child=&node.getChild(n);
        const std::string& childName=child->getName();
        if(childName=="position")
        {
            this->mPosition=Point(*child);
            this->mPositionExplicitlySet = true;
        }
        else if(childName=="dimensions")
        {
            this->mDimensions=Dimensions(*child);
            this->mDimensionsExplicitlySet = true;
        }
        else if(childName=="annotation")
        {
            this->mAnnotation=new XMLNode(*child);
        }
        else if(childName=="notes")
        {
            this->mNotes=new XMLNode(*child);
        }
        else
        {
            //throw;
        }
        ++n;
    }    
  setSBMLNamespacesAndOwn(new LayoutPkgNamespaces(2,l2version));
  connectToChild();
}
Exemplo n.º 28
0
/*
 * Creates a new ReactionGlyph.  The list of species reference glyph is
 * empty and the id of the associated reaction is set to the empty string.
 */
ReactionGlyph::ReactionGlyph(unsigned int level, unsigned int version, unsigned int pkgVersion) 
 : GraphicalObject (level,version,pkgVersion)
  ,mReaction("")
  ,mSpeciesReferenceGlyphs(level,version,pkgVersion)
  ,mCurve(level,version,pkgVersion)
  ,mCurveExplicitlySet (false)
{
  connectToChild();
  //
  // (NOTE) Developers don't have to invoke setSBMLNamespacesAndOwn function as follows (commentted line)
  //        in this constuctor because the function is properly invoked in the constructor of the
  //        base class (GraphicalObject).
  //
  //setSBMLNamespacesAndOwn(new LayoutPkgNamespaces(level,version,pkgVersion));  
}
Exemplo n.º 29
0
/*
 * Assignment operator.
 */
GeneralGlyph& GeneralGlyph::operator=(const GeneralGlyph& source)
{
  if(&source!=this)
  {
    GraphicalObject::operator=(source);
    this->mReference=source.mReference;
    this->mCurve=*source.getCurve();
    this->mReferenceGlyphs=*source.getListOfReferenceGlyphs();
    this->mSubGlyphs=*source.getListOfSubGlyphs();
    this->mCurveExplicitlySet = source.mCurveExplicitlySet;
    connectToChild();
  }
  
  return *this;
}
Exemplo n.º 30
0
/*
 * Constructor with id and values for the matrix.
 */
Transformation2D::Transformation2D(RenderPkgNamespaces* renderns, const double matrix[6]):Transformation(renderns)
{
#ifdef DEPRECATION_WARNINGS
    std::cerr << "Warning. Transformation2D::Transformation2D(const double matrix[6]) is deprecated." << std::endl;
#endif // DEPRECATION_WARNINGS
    this->setMatrix2D(matrix);
        // set the element namespace of this object
  setElementNamespace(renderns->getURI());

  // connect child elements to this element.
  connectToChild();

  // load package extensions bound with this object (if any) 
  loadPlugins(renderns);
}