|
From: <sar...@us...> - 2013-07-31 12:23:45
|
Revision: 18277
http://sourceforge.net/p/sbml/code/18277
Author: sarahkeating
Date: 2013-07-31 12:23:39 +0000 (Wed, 31 Jul 2013)
Log Message:
-----------
adding validation to layout
Modified Paths:
--------------
trunk/libsbml/src/sbml/packages/layout/common/LayoutExtensionTypes.h
trunk/libsbml/src/sbml/packages/layout/extension/LayoutSBMLDocumentPlugin.cpp
trunk/libsbml/src/sbml/packages/layout/extension/LayoutSBMLDocumentPlugin.h
trunk/libsbml/src/sbml/packages/layout/sbml/BoundingBox.cpp
trunk/libsbml/src/sbml/packages/layout/sbml/CubicBezier.cpp
trunk/libsbml/src/sbml/packages/layout/sbml/CubicBezier.h
trunk/libsbml/src/sbml/packages/layout/sbml/Curve.cpp
trunk/libsbml/src/sbml/packages/layout/sbml/Dimensions.cpp
trunk/libsbml/src/sbml/packages/layout/sbml/GeneralGlyph.cpp
trunk/libsbml/src/sbml/packages/layout/sbml/GeneralGlyph.h
trunk/libsbml/src/sbml/packages/layout/sbml/GraphicalObject.cpp
trunk/libsbml/src/sbml/packages/layout/sbml/GraphicalObject.h
trunk/libsbml/src/sbml/packages/layout/sbml/Layout.cpp
trunk/libsbml/src/sbml/packages/layout/sbml/Layout.h
trunk/libsbml/src/sbml/packages/layout/sbml/LineSegment.cpp
trunk/libsbml/src/sbml/packages/layout/sbml/Point.cpp
trunk/libsbml/src/sbml/packages/layout/sbml/ReactionGlyph.cpp
trunk/libsbml/src/sbml/packages/layout/sbml/ReactionGlyph.h
trunk/libsbml/src/sbml/packages/layout/sbml/ReferenceGlyph.cpp
trunk/libsbml/src/sbml/packages/layout/sbml/ReferenceGlyph.h
trunk/libsbml/src/sbml/packages/layout/sbml/SpeciesReferenceGlyph.cpp
trunk/libsbml/src/sbml/packages/layout/sbml/SpeciesReferenceGlyph.h
trunk/libsbml/src/sbml/packages/layout/validator/LayoutValidator.cpp
trunk/libsbml/src/sbml/packages/layout/validator/constraints/LayoutConsistencyConstraints.cpp
Added Paths:
-----------
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020204-fail-01-02.xml
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020315-fail-01-01.xml
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020315-fail-01-02.xml
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020402-fail-01-01.xml
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020402-pass-00-01.xml
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020404-fail-01-01.xml
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020404-fail-01-02.xml
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020404-pass-00-01.xml
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020405-fail-01-01-6020406.xml
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020406-fail-01-01.xml
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020406-fail-01-02.xml
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020407-fail-01-01.xml
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020407-fail-01-02.xml
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020505-fail-01-01-6020506.xml
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020506-fail-01-01.xml
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020605-fail-01-01-6020606.xml
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020606-fail-01-01.xml
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020705-fail-01-01-6020706.xml
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020706-fail-01-01.xml
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020805-fail-01-01-6020806.xml
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020806-fail-01-01.xml
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020905-fail-01-01-6020906.xml
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020906-fail-01-01.xml
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020907-fail-01-01.xml
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6021005-fail-01-01-6021006.xml
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6021006-fail-01-01.xml
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6021105-fail-01-01-6021106.xml
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6021106-fail-01-01.xml
Removed Paths:
-------------
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020505-fail-01-01.xml
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020605-fail-01-01.xml
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020705-fail-01-01.xml
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020805-fail-01-01.xml
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020905-fail-01-01.xml
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6021005-fail-01-01.xml
trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6021105-fail-01-01.xml
Modified: trunk/libsbml/src/sbml/packages/layout/common/LayoutExtensionTypes.h
===================================================================
--- trunk/libsbml/src/sbml/packages/layout/common/LayoutExtensionTypes.h 2013-07-30 11:52:05 UTC (rev 18276)
+++ trunk/libsbml/src/sbml/packages/layout/common/LayoutExtensionTypes.h 2013-07-31 12:23:39 UTC (rev 18277)
@@ -32,6 +32,7 @@
#include <sbml/packages/layout/extension/LayoutExtension.h>
#include <sbml/packages/layout/extension/LayoutModelPlugin.h>
+#include <sbml/packages/layout/extension/LayoutSBMLDocumentPlugin.h>
#include <sbml/packages/layout/sbml/BoundingBox.h>
#include <sbml/packages/layout/sbml/CompartmentGlyph.h>
Modified: trunk/libsbml/src/sbml/packages/layout/extension/LayoutSBMLDocumentPlugin.cpp
===================================================================
--- trunk/libsbml/src/sbml/packages/layout/extension/LayoutSBMLDocumentPlugin.cpp 2013-07-30 11:52:05 UTC (rev 18276)
+++ trunk/libsbml/src/sbml/packages/layout/extension/LayoutSBMLDocumentPlugin.cpp 2013-07-31 12:23:39 UTC (rev 18277)
@@ -30,7 +30,9 @@
#include <sbml/packages/layout/validator/LayoutIdentifierConsistencyValidator.h>
#include <sbml/packages/layout/validator/LayoutSBMLError.h>
+#include <sbml/util/MetaIdFilter.h>
+
#ifdef __cplusplus
/** @cond doxygen-libsbml-internal */
@@ -44,12 +46,14 @@
LayoutSBMLDocumentPlugin::LayoutSBMLDocumentPlugin (const string &uri,
const string &prefix, LayoutPkgNamespaces *layoutns)
: SBMLDocumentPlugin(uri,prefix, layoutns)
+ , mMetaIdListPopulated ( false )
{
}
LayoutSBMLDocumentPlugin::LayoutSBMLDocumentPlugin(const LayoutSBMLDocumentPlugin& orig)
: SBMLDocumentPlugin(orig)
+ , mMetaIdListPopulated ( false )
{
}
@@ -60,6 +64,7 @@
if(&orig!=this)
{
SBMLDocumentPlugin::operator =(orig);
+ mMetaIdListPopulated = orig.mMetaIdListPopulated;
}
return *this;
}
@@ -132,12 +137,19 @@
unsigned int
-LayoutSBMLDocumentPlugin::checkConsistency()
+LayoutSBMLDocumentPlugin::checkConsistency(bool overrideFlattening)
{
unsigned int nerrors = 0;
unsigned int total_errors = 0;
SBMLDocument* doc = static_cast<SBMLDocument *>(this->getParentSBMLObject());
+
+ /* populate the listofMetaids in the model*/
+ if (hasMetaidListBeenPopulated() == false)
+ {
+ populateMetaidList();
+ }
+
SBMLErrorLog *log = doc->getErrorLog();
unsigned char applicableValidators = doc->getApplicableValidators();
@@ -189,6 +201,39 @@
return total_errors;
}
+IdList
+LayoutSBMLDocumentPlugin::getMetaidList() const
+{
+ //if (hasMetaidListBeenPopulated() == false)
+ //{
+ // this->populateMetaidList();
+ //}
+ return mMetaIdList;
+}
+
+bool
+LayoutSBMLDocumentPlugin::hasMetaidListBeenPopulated() const
+{
+ return mMetaIdListPopulated;
+}
+
+void
+LayoutSBMLDocumentPlugin::populateMetaidList()
+{
+ SBMLDocument* doc = static_cast<SBMLDocument *>(this->getParentSBMLObject());
+
+ MetaIdFilter filter;
+
+ List* allElements = doc->getModel()->getAllElements(&filter);
+
+ for (unsigned int i = 0; i < allElements->getSize(); i++)
+ {
+ mMetaIdList.append(static_cast<SBase*>(allElements->get(i))->getMetaId());
+ }
+
+ mMetaIdListPopulated = true;
+}
+
LIBSBML_CPP_NAMESPACE_END
#endif /* __cplusplus */
Modified: trunk/libsbml/src/sbml/packages/layout/extension/LayoutSBMLDocumentPlugin.h
===================================================================
--- trunk/libsbml/src/sbml/packages/layout/extension/LayoutSBMLDocumentPlugin.h 2013-07-30 11:52:05 UTC (rev 18276)
+++ trunk/libsbml/src/sbml/packages/layout/extension/LayoutSBMLDocumentPlugin.h 2013-07-31 12:23:39 UTC (rev 18277)
@@ -39,6 +39,7 @@
#include <sbml/extension/SBMLDocumentPlugin.h>
#include <sbml/packages/layout/extension/LayoutExtension.h>
+#include <sbml/util/IdList.h>
LIBSBML_CPP_NAMESPACE_BEGIN
@@ -121,7 +122,7 @@
/**
* Check consistency function.
*/
- virtual unsigned int checkConsistency();
+ virtual unsigned int checkConsistency(bool overrideFlattening);
/** @endcond doxygen-libsbml-internal */
@@ -133,15 +134,24 @@
* Accepts the SBMLVisitor.
*/
+ IdList getMetaidList() const;
- /** @endcond doxygen-libsbml-internal */
+ bool hasMetaidListBeenPopulated() const;
+ void populateMetaidList();
+ /** @endcond doxygen-libsbml-internal */
+
+
protected:
/** @cond doxygen-libsbml-internal */
- /** @endcond doxygen-libsbml-internal */
+ IdList mMetaIdList;
+ bool mMetaIdListPopulated;
+
+
+ /** @endcond doxygen-libsbml-internal */
};
Modified: trunk/libsbml/src/sbml/packages/layout/sbml/BoundingBox.cpp
===================================================================
--- trunk/libsbml/src/sbml/packages/layout/sbml/BoundingBox.cpp 2013-07-30 11:52:05 UTC (rev 18276)
+++ trunk/libsbml/src/sbml/packages/layout/sbml/BoundingBox.cpp 2013-07-31 12:23:39 UTC (rev 18277)
@@ -720,12 +720,14 @@
bool
BoundingBox::accept (SBMLVisitor& v) const
{
- /*
- bool result=v.visit(*this);
+ v.visit(*this);
+
mPosition.accept(v);
mDimensions.accept(v);
- v.leave(*this);*/
- return false;
+
+ v.leave(*this);
+
+ return true;
}
/*
Modified: trunk/libsbml/src/sbml/packages/layout/sbml/CubicBezier.cpp
===================================================================
--- trunk/libsbml/src/sbml/packages/layout/sbml/CubicBezier.cpp 2013-07-30 11:52:05 UTC (rev 18276)
+++ trunk/libsbml/src/sbml/packages/layout/sbml/CubicBezier.cpp 2013-07-31 12:23:39 UTC (rev 18277)
@@ -577,21 +577,24 @@
/*
* Accepts the given SBMLVisitor.
-
+ */
bool
CubicBezier::accept (SBMLVisitor& v) const
{
- bool result=v.visit(*this);
+ v.visit(*this);
+
this->mStartPoint.accept(v);
this->mBasePoint1.accept(v);
this->mBasePoint2.accept(v);
this->mEndPoint.accept(v);
+
v.leave(*this);
- return result;
+
+ return true;
}
-*/
+
/*
* Sets the parent SBMLDocument of this SBML object.
*/
Modified: trunk/libsbml/src/sbml/packages/layout/sbml/CubicBezier.h
===================================================================
--- trunk/libsbml/src/sbml/packages/layout/sbml/CubicBezier.h 2013-07-30 11:52:05 UTC (rev 18276)
+++ trunk/libsbml/src/sbml/packages/layout/sbml/CubicBezier.h 2013-07-31 12:23:39 UTC (rev 18277)
@@ -299,9 +299,9 @@
* @return the result of calling <code>v.visit()</code>, which indicates
* whether or not the Visitor would like to visit the SBML object's next
* sibling object (if available).
+ */
+ virtual bool accept (SBMLVisitor& v) const;
- virtual bool accept (SBMLVisitor& v) const;
- */
/**
* Creates an XMLNode object from this.
Modified: trunk/libsbml/src/sbml/packages/layout/sbml/Curve.cpp
===================================================================
--- trunk/libsbml/src/sbml/packages/layout/sbml/Curve.cpp 2013-07-30 11:52:05 UTC (rev 18276)
+++ trunk/libsbml/src/sbml/packages/layout/sbml/Curve.cpp 2013-07-31 12:23:39 UTC (rev 18277)
@@ -673,11 +673,13 @@
bool
Curve::accept (SBMLVisitor& v) const
{
-
- /*bool result=v.visit(*this);
+ v.visit(*this);
+
mCurveSegments.accept(v);
- v.leave(*this);*/
- return false;
+
+ v.leave(*this);
+
+ return true;
}
Modified: trunk/libsbml/src/sbml/packages/layout/sbml/Dimensions.cpp
===================================================================
--- trunk/libsbml/src/sbml/packages/layout/sbml/Dimensions.cpp 2013-07-30 11:52:05 UTC (rev 18276)
+++ trunk/libsbml/src/sbml/packages/layout/sbml/Dimensions.cpp 2013-07-31 12:23:39 UTC (rev 18277)
@@ -628,8 +628,7 @@
*/
bool Dimensions::accept (SBMLVisitor& v) const
{
- //return v.visit(*this);
- return false;
+ return v.visit(*this);
}
/*
Modified: trunk/libsbml/src/sbml/packages/layout/sbml/GeneralGlyph.cpp
===================================================================
--- trunk/libsbml/src/sbml/packages/layout/sbml/GeneralGlyph.cpp 2013-07-30 11:52:05 UTC (rev 18276)
+++ trunk/libsbml/src/sbml/packages/layout/sbml/GeneralGlyph.cpp 2013-07-31 12:23:39 UTC (rev 18277)
@@ -1123,26 +1123,31 @@
/*
* Accepts the given SBMLVisitor.
-
+ */
bool
GeneralGlyph::accept (SBMLVisitor& v) const
{
- bool result=v.visit(*this);
+ v.visit(*this);
+
if(this->mCurve.getNumCurveSegments()>0)
{
this->mCurve.accept(v);
}
- else
+
+ if (getBoundingBoxExplicitlySet() == true)
{
this->mBoundingBox.accept(v);
}
- this->mReferenceGlyphs.accept(this);
+
+ this->mReferenceGlyphs.accept(v);
+
v.leave(*this);
- return result;
+
+ return true;
}
-*/
+
/*
* Sets the parent SBMLDocument of this SBML object.
*/
Modified: trunk/libsbml/src/sbml/packages/layout/sbml/GeneralGlyph.h
===================================================================
--- trunk/libsbml/src/sbml/packages/layout/sbml/GeneralGlyph.h 2013-07-30 11:52:05 UTC (rev 18276)
+++ trunk/libsbml/src/sbml/packages/layout/sbml/GeneralGlyph.h 2013-07-31 12:23:39 UTC (rev 18277)
@@ -574,10 +574,10 @@
* @return the result of calling <code>v.visit()</code>, which indicates
* whether or not the Visitor would like to visit the SBML object's next
* sibling object (if available).
-
+ */
virtual bool accept (SBMLVisitor& v) const;
- */
+
/**
* Creates an XMLNode object from this.
*/
Modified: trunk/libsbml/src/sbml/packages/layout/sbml/GraphicalObject.cpp
===================================================================
--- trunk/libsbml/src/sbml/packages/layout/sbml/GraphicalObject.cpp 2013-07-30 11:52:05 UTC (rev 18276)
+++ trunk/libsbml/src/sbml/packages/layout/sbml/GraphicalObject.cpp 2013-07-31 12:23:39 UTC (rev 18277)
@@ -105,6 +105,7 @@
, mId("")
, mMetaIdRef ("")
, mBoundingBox(level,version,pkgVersion)
+ , mBoundingBoxExplicitlySet (false)
{
setSBMLNamespacesAndOwn(new LayoutPkgNamespaces(level,version,pkgVersion));
}
@@ -118,6 +119,7 @@
, mId ("")
, mMetaIdRef ("")
, mBoundingBox(layoutns)
+ , mBoundingBoxExplicitlySet (false)
{
//
// set the element namespace of this object
@@ -141,6 +143,7 @@
, mId (id)
, mMetaIdRef ("")
, mBoundingBox(layoutns)
+ , mBoundingBoxExplicitlySet (false )
{
//
// set the element namespace of this object
@@ -166,6 +169,7 @@
, mId (id)
, mMetaIdRef ("")
, mBoundingBox( BoundingBox(layoutns, "", x, y, 0.0, w, h, 0.0))
+ , mBoundingBoxExplicitlySet (true)
{
//
// set the element namespace of this object
@@ -192,6 +196,7 @@
, mId (id)
, mMetaIdRef ("")
, mBoundingBox( BoundingBox(layoutns, "", x, y, z, w, h, d))
+ , mBoundingBoxExplicitlySet (true)
{
//
// set the element namespace of this object
@@ -218,6 +223,7 @@
, mId (id)
, mMetaIdRef ("")
, mBoundingBox( BoundingBox(layoutns, "", p, d) )
+ , mBoundingBoxExplicitlySet (true)
{
//
// set the element namespace of this object
@@ -242,6 +248,7 @@
, mId (id)
, mMetaIdRef ("")
, mBoundingBox(layoutns)
+ , mBoundingBoxExplicitlySet ( false)
{
//
// set the element namespace of this object
@@ -251,6 +258,7 @@
if(bb)
{
this->mBoundingBox=*bb;
+ mBoundingBoxExplicitlySet = true;
}
connectToChild();
@@ -289,6 +297,7 @@
if(childName=="boundingBox")
{
this->mBoundingBox=BoundingBox(*child);
+ mBoundingBoxExplicitlySet = true;
}
else if(childName=="annotation")
{
@@ -330,6 +339,7 @@
this->mId = source.mId;
this->mMetaIdRef = source.mMetaIdRef;
this->mBoundingBox=*source.getBoundingBox();
+ this->mBoundingBoxExplicitlySet = source.mBoundingBoxExplicitlySet;
connectToChild();
}
@@ -345,6 +355,7 @@
this->mId = source.mId;
this->mMetaIdRef = source.mMetaIdRef;
this->mBoundingBox=*source.getBoundingBox();
+ this->mBoundingBoxExplicitlySet = source.mBoundingBoxExplicitlySet;
connectToChild();
}
@@ -461,6 +472,7 @@
if(bb==NULL) return;
this->mBoundingBox = *bb;
this->mBoundingBox.connectToParent(this);
+ this->mBoundingBoxExplicitlySet = true;
}
@@ -484,6 +496,12 @@
}
+bool
+GraphicalObject::getBoundingBoxExplicitlySet() const
+{
+ return mBoundingBoxExplicitlySet;
+}
+
/*
* Does nothing. No defaults are defined for GraphicalObject.
*/
@@ -522,7 +540,14 @@
if (name == "boundingBox")
{
+ if (getBoundingBoxExplicitlySet() == true)
+ {
+ getErrorLog()->logPackageError("layout", LayoutGOMustContainBoundingBox,
+ getPackageVersion(), getLevel(), getVersion());
+ }
+
object = &mBoundingBox;
+ mBoundingBoxExplicitlySet = true;
}
return object;
@@ -549,6 +574,110 @@
const unsigned int sbmlLevel = getLevel ();
const unsigned int sbmlVersion = getVersion();
+ // look to see whether an unknown attribute error was logged
+ if (getErrorLog() != NULL)
+ {
+ unsigned int numErrs = getErrorLog()->getNumErrors();
+ for (int n = numErrs-1; n >= 0; n--)
+ {
+ if (getErrorLog()->getError(n)->getErrorId() == UnknownPackageAttribute)
+ {
+ const std::string details =
+ getErrorLog()->getError(n)->getMessage();
+ getErrorLog()->remove(UnknownPackageAttribute);
+
+ int tc = this->getTypeCode();
+
+ switch (tc)
+ {
+ case SBML_LAYOUT_COMPARTMENTGLYPH:
+ getErrorLog()->logPackageError("layout", LayoutCGAllowedAttributes,
+ getPackageVersion(), sbmlLevel, sbmlVersion);
+ break;
+ case SBML_LAYOUT_REACTIONGLYPH:
+ getErrorLog()->logPackageError("layout", LayoutRGAllowedAttributes,
+ getPackageVersion(), sbmlLevel, sbmlVersion);
+ break;
+ case SBML_LAYOUT_SPECIESGLYPH:
+ getErrorLog()->logPackageError("layout", LayoutSGAllowedAttributes,
+ getPackageVersion(), sbmlLevel, sbmlVersion);
+ break;
+ case SBML_LAYOUT_SPECIESREFERENCEGLYPH:
+ getErrorLog()->logPackageError("layout", LayoutSRGAllowedAttributes,
+ getPackageVersion(), sbmlLevel, sbmlVersion);
+ break;
+ case SBML_LAYOUT_TEXTGLYPH:
+ getErrorLog()->logPackageError("layout", LayoutTGAllowedAttributes,
+ getPackageVersion(), sbmlLevel, sbmlVersion);
+ break;
+ case SBML_LAYOUT_REFERENCEGLYPH:
+ getErrorLog()->logPackageError("layout", LayoutREFGAllowedAttributes,
+ getPackageVersion(), sbmlLevel, sbmlVersion);
+ break;
+ case SBML_LAYOUT_GENERALGLYPH:
+ getErrorLog()->logPackageError("layout", LayoutGGAllowedAttributes,
+ getPackageVersion(), sbmlLevel, sbmlVersion);
+ break;
+ default:
+ getErrorLog()->logPackageError("layout", LayoutGOAllowedAttributes,
+ getPackageVersion(), sbmlLevel, sbmlVersion);
+ break;
+ }
+ }
+ else if (getErrorLog()->getError(n)->getErrorId() == UnknownCoreAttribute)
+ {
+ const std::string details =
+ getErrorLog()->getError(n)->getMessage();
+ getErrorLog()->remove(UnknownCoreAttribute);
+ int tc = this->getTypeCode();
+
+ switch (tc)
+ {
+ case SBML_LAYOUT_COMPARTMENTGLYPH:
+ getErrorLog()->logPackageError("layout",
+ LayoutCGAllowedCoreAttributes,
+ getPackageVersion(), sbmlLevel, sbmlVersion);
+ break;
+ case SBML_LAYOUT_REACTIONGLYPH:
+ getErrorLog()->logPackageError("layout",
+ LayoutRGAllowedCoreAttributes,
+ getPackageVersion(), sbmlLevel, sbmlVersion);
+ break;
+ case SBML_LAYOUT_SPECIESGLYPH:
+ getErrorLog()->logPackageError("layout",
+ LayoutSGAllowedCoreAttributes,
+ getPackageVersion(), sbmlLevel, sbmlVersion);
+ break;
+ case SBML_LAYOUT_SPECIESREFERENCEGLYPH:
+ getErrorLog()->logPackageError("layout",
+ LayoutSRGAllowedCoreAttributes,
+ getPackageVersion(), sbmlLevel, sbmlVersion);
+ break;
+ case SBML_LAYOUT_TEXTGLYPH:
+ getErrorLog()->logPackageError("layout",
+ LayoutTGAllowedCoreAttributes,
+ getPackageVersion(), sbmlLevel, sbmlVersion);
+ break;
+ case SBML_LAYOUT_REFERENCEGLYPH:
+ getErrorLog()->logPackageError("layout",
+ LayoutREFGAllowedCoreAttributes,
+ getPackageVersion(), sbmlLevel, sbmlVersion);
+ break;
+ case SBML_LAYOUT_GENERALGLYPH:
+ getErrorLog()->logPackageError("layout",
+ LayoutGGAllowedCoreAttributes,
+ getPackageVersion(), sbmlLevel, sbmlVersion);
+ break;
+ default:
+ getErrorLog()->logPackageError("layout",
+ LayoutGOAllowedCoreAttributes,
+ getPackageVersion(), sbmlLevel, sbmlVersion);
+ break;
+ }
+ }
+ }
+ }
+
// id reqd
bool assigned = attributes.readInto("id", mId);
@@ -727,13 +856,14 @@
*/
bool
GraphicalObject::accept (SBMLVisitor& v) const
-{
- /*
- bool result=v.visit(*this);
+{
+ v.visit(*this);
+
this->mBoundingBox.accept(v);
+
v.leave(*this);
- */
- return false;
+
+ return true;
}
/*
Modified: trunk/libsbml/src/sbml/packages/layout/sbml/GraphicalObject.h
===================================================================
--- trunk/libsbml/src/sbml/packages/layout/sbml/GraphicalObject.h 2013-07-30 11:52:05 UTC (rev 18276)
+++ trunk/libsbml/src/sbml/packages/layout/sbml/GraphicalObject.h 2013-07-31 12:23:39 UTC (rev 18277)
@@ -79,6 +79,7 @@
std::string mId;
std::string mMetaIdRef;
BoundingBox mBoundingBox;
+ bool mBoundingBoxExplicitlySet;
/** @endcond */
@@ -271,6 +272,8 @@
const BoundingBox* getBoundingBox() const;
+
+ bool getBoundingBoxExplicitlySet() const;
/** @cond doxygen-libsbml-internal */
/**
* Subclasses should override this method to write out their contained
Modified: trunk/libsbml/src/sbml/packages/layout/sbml/Layout.cpp
===================================================================
--- trunk/libsbml/src/sbml/packages/layout/sbml/Layout.cpp 2013-07-30 11:52:05 UTC (rev 18276)
+++ trunk/libsbml/src/sbml/packages/layout/sbml/Layout.cpp 2013-07-31 12:23:39 UTC (rev 18277)
@@ -87,6 +87,7 @@
,mReactionGlyphs(level,version,pkgVersion)
,mTextGlyphs(level,version,pkgVersion)
,mAdditionalGraphicalObjects(level,version,pkgVersion)
+ ,mDimensionsExplicitlySet( false )
{
// set an SBMLNamespaces derived object (LayoutPkgNamespaces) of this package.
setSBMLNamespacesAndOwn(new LayoutPkgNamespaces(level,version,pkgVersion));
@@ -109,6 +110,7 @@
,mReactionGlyphs(layoutns)
,mTextGlyphs(layoutns)
,mAdditionalGraphicalObjects(layoutns)
+ ,mDimensionsExplicitlySet (false)
{
//
// set the element namespace of this object
@@ -118,6 +120,7 @@
if(dimensions)
{
this->mDimensions=*dimensions;
+ mDimensionsExplicitlySet = true;
}
// connect child elements to this element.
@@ -143,6 +146,7 @@
,mReactionGlyphs(layoutns)
,mTextGlyphs(layoutns)
,mAdditionalGraphicalObjects(layoutns)
+ ,mDimensionsExplicitlySet (false )
{
//
// set the element namespace of this object
@@ -173,6 +177,7 @@
,mReactionGlyphs(2,l2version)
,mTextGlyphs(2,l2version)
,mAdditionalGraphicalObjects(2,l2version)
+ ,mDimensionsExplicitlySet (false)
{
LayoutPkgNamespaces *layoutNS = new LayoutPkgNamespaces(2,l2version);
@@ -197,6 +202,7 @@
if(childName=="dimensions")
{
this->mDimensions=Dimensions(*child);
+ mDimensionsExplicitlySet = true;
}
else if(childName=="annotation")
{
@@ -377,6 +383,7 @@
this->mReactionGlyphs=*source.getListOfReactionGlyphs();
this->mTextGlyphs=*source.getListOfTextGlyphs();
this->mAdditionalGraphicalObjects=*source.getListOfAdditionalGraphicalObjects();
+ this->mDimensionsExplicitlySet=source.getDimensionsExplicitlySet();
// connect child elements to this element.
connectToChild();
@@ -398,6 +405,7 @@
this->mReactionGlyphs=*source.getListOfReactionGlyphs();
this->mTextGlyphs=*source.getListOfTextGlyphs();
this->mAdditionalGraphicalObjects=*source.getListOfAdditionalGraphicalObjects();
+ this->mDimensionsExplicitlySet=source.mDimensionsExplicitlySet;
// connect child elements to this element.
connectToChild();
@@ -533,10 +541,18 @@
{
if(dimensions==NULL) return;
this->mDimensions = *dimensions;
+ this->mDimensionsExplicitlySet = true;
this->mDimensions.connectToParent(this);
}
+bool
+Layout::getDimensionsExplicitlySet() const
+{
+ return mDimensionsExplicitlySet;
+}
+
+
/*
* Returns the ListOf object that holds all compartment glyphs.
*/
@@ -1496,13 +1512,14 @@
}
else if ( name == "dimensions" )
{
- //if (&(mDimensions) != NULL)
- //{
- // getErrorLog()->logPackageError("layout", LayoutLayoutMustHaveDimensions,
- // getPackageVersion(), getLevel(), getVersion());
- //}
+ if (getDimensionsExplicitlySet() == true)
+ {
+ getErrorLog()->logPackageError("layout", LayoutLayoutMustHaveDimensions,
+ getPackageVersion(), getLevel(), getVersion());
+ }
object = &mDimensions;
+ mDimensionsExplicitlySet = true;
}
return object;
@@ -1546,7 +1563,8 @@
const std::string details =
getErrorLog()->getError(n)->getMessage();
getErrorLog()->remove(UnknownPackageAttribute);
- getErrorLog()->logPackageError("layout", LayoutUnknownError,
+ getErrorLog()->logPackageError("layout",
+ LayoutLOLayoutsAllowedAttributes,
getPackageVersion(), sbmlLevel, sbmlVersion, details);
}
else if (getErrorLog()->getError(n)->getErrorId() == UnknownCoreAttribute)
@@ -1554,7 +1572,8 @@
const std::string details =
getErrorLog()->getError(n)->getMessage();
getErrorLog()->remove(UnknownCoreAttribute);
- getErrorLog()->logPackageError("layout", LayoutLOLayoutsAllowedAttributes,
+ getErrorLog()->logPackageError("layout",
+ LayoutLOLayoutsAllowedAttributes,
getPackageVersion(), sbmlLevel, sbmlVersion, details);
}
}
@@ -1691,16 +1710,19 @@
bool
Layout::accept (SBMLVisitor& v) const
{
- /*
- bool result=v.visit(*this);
+
+ v.visit(*this);
+
this->mDimensions.accept(v);
this->mCompartmentGlyphs.accept(v);
this->mSpeciesGlyphs.accept(v);
this->mReactionGlyphs.accept(v);
this->mTextGlyphs.accept(v);
this->mAdditionalGraphicalObjects.accept(v);
- v.leave(*this);*/
- return false;
+
+ v.leave(*this);
+
+ return true;
}
Modified: trunk/libsbml/src/sbml/packages/layout/sbml/Layout.h
===================================================================
--- trunk/libsbml/src/sbml/packages/layout/sbml/Layout.h 2013-07-30 11:52:05 UTC (rev 18276)
+++ trunk/libsbml/src/sbml/packages/layout/sbml/Layout.h 2013-07-31 12:23:39 UTC (rev 18277)
@@ -645,6 +645,7 @@
ListOfReactionGlyphs mReactionGlyphs;
ListOfTextGlyphs mTextGlyphs;
ListOfGraphicalObjects mAdditionalGraphicalObjects;
+ bool mDimensionsExplicitlySet;
/** @endcond */
protected:
@@ -791,6 +792,10 @@
void setDimensions (const Dimensions* dimensions);
+ /**
+ * Predicate returning true if the dimensions has been set
+ */
+ bool getDimensionsExplicitlySet() const;
/**
* Returns the ListOf object that holds all compartment glyphs.
Modified: trunk/libsbml/src/sbml/packages/layout/sbml/LineSegment.cpp
===================================================================
--- trunk/libsbml/src/sbml/packages/layout/sbml/LineSegment.cpp 2013-07-30 11:52:05 UTC (rev 18276)
+++ trunk/libsbml/src/sbml/packages/layout/sbml/LineSegment.cpp 2013-07-31 12:23:39 UTC (rev 18277)
@@ -591,12 +591,14 @@
bool
LineSegment::accept (SBMLVisitor& v) const
{
- /*
- bool result=v.visit(*this);
+ v.visit(*this);
+
this->mStartPoint.accept(v);
this->mEndPoint.accept(v);
- v.leave(*this);*/
- return false;
+
+ v.leave(*this);
+
+ return true;
}
Modified: trunk/libsbml/src/sbml/packages/layout/sbml/Point.cpp
===================================================================
--- trunk/libsbml/src/sbml/packages/layout/sbml/Point.cpp 2013-07-30 11:52:05 UTC (rev 18276)
+++ trunk/libsbml/src/sbml/packages/layout/sbml/Point.cpp 2013-07-31 12:23:39 UTC (rev 18277)
@@ -693,8 +693,7 @@
*/
bool Point::accept (SBMLVisitor& v) const
{
- //v.visit(*this);
- return false;
+ return v.visit(*this);
}
Modified: trunk/libsbml/src/sbml/packages/layout/sbml/ReactionGlyph.cpp
===================================================================
--- trunk/libsbml/src/sbml/packages/layout/sbml/ReactionGlyph.cpp 2013-07-30 11:52:05 UTC (rev 18276)
+++ trunk/libsbml/src/sbml/packages/layout/sbml/ReactionGlyph.cpp 2013-07-31 12:23:39 UTC (rev 18277)
@@ -937,26 +937,31 @@
/*
* Accepts the given SBMLVisitor.
-
+ */
bool
ReactionGlyph::accept (SBMLVisitor& v) const
{
- bool result=v.visit(*this);
+ v.visit(*this);
+
if(this->mCurve.getNumCurveSegments()>0)
{
this->mCurve.accept(v);
}
- else
+
+ if (getBoundingBoxExplicitlySet() == true)
{
this->mBoundingBox.accept(v);
}
- this->mSpeciesReferenceGlyphs.accept(this);
+
+ this->mSpeciesReferenceGlyphs.accept(v);
+
v.leave(*this);
- return result;
+
+ return true;
}
-*/
+
/*
* Sets the parent SBMLDocument of this SBML object.
*/
Modified: trunk/libsbml/src/sbml/packages/layout/sbml/ReactionGlyph.h
===================================================================
--- trunk/libsbml/src/sbml/packages/layout/sbml/ReactionGlyph.h 2013-07-30 11:52:05 UTC (rev 18276)
+++ trunk/libsbml/src/sbml/packages/layout/sbml/ReactionGlyph.h 2013-07-31 12:23:39 UTC (rev 18277)
@@ -507,10 +507,10 @@
* @return the result of calling <code>v.visit()</code>, which indicates
* whether or not the Visitor would like to visit the SBML object's next
* sibling object (if available).
-
+ */
virtual bool accept (SBMLVisitor& v) const;
- */
+
/**
* Creates an XMLNode object from this.
*/
Modified: trunk/libsbml/src/sbml/packages/layout/sbml/ReferenceGlyph.cpp
===================================================================
--- trunk/libsbml/src/sbml/packages/layout/sbml/ReferenceGlyph.cpp 2013-07-30 11:52:05 UTC (rev 18276)
+++ trunk/libsbml/src/sbml/packages/layout/sbml/ReferenceGlyph.cpp 2013-07-31 12:23:39 UTC (rev 18277)
@@ -54,6 +54,7 @@
#include <sbml/packages/layout/sbml/ReferenceGlyph.h>
#include <sbml/packages/layout/sbml/GeneralGlyph.h>
+#include <sbml/packages/layout/sbml/GraphicalObject.h>
#include <sbml/packages/layout/util/LayoutUtilities.h>
#include <sbml/packages/layout/extension/LayoutExtension.h>
@@ -689,25 +690,29 @@
/*
* Accepts the given SBMLVisitor.
-
+ */
bool
ReferenceGlyph::accept (SBMLVisitor& v) const
{
- bool result=v.visit(*this);
+ v.visit(*this);
+
if(this->mCurve.getNumCurveSegments()>0)
{
this->mCurve.accept(v);
}
- else
+
+ if (getBoundingBoxExplicitlySet() == true)
{
this->mBoundingBox.accept(v);
}
+
v.leave(*this);
- return result;
+
+ return true;
}
-*/
+
/*
* Sets the parent SBMLDocument of this SBML object.
*/
Modified: trunk/libsbml/src/sbml/packages/layout/sbml/ReferenceGlyph.h
===================================================================
--- trunk/libsbml/src/sbml/packages/layout/sbml/ReferenceGlyph.h 2013-07-30 11:52:05 UTC (rev 18276)
+++ trunk/libsbml/src/sbml/packages/layout/sbml/ReferenceGlyph.h 2013-07-31 12:23:39 UTC (rev 18277)
@@ -319,9 +319,9 @@
* @return the result of calling <code>v.visit()</code>, which indicates
* whether or not the Visitor would like to visit the SBML object's next
* sibling object (if available).
+ */
+ virtual bool accept (SBMLVisitor& v) const;
- virtual bool accept (SBMLVisitor& v) const;
- */
/**
* Creates an XMLNode object from this.
Modified: trunk/libsbml/src/sbml/packages/layout/sbml/SpeciesReferenceGlyph.cpp
===================================================================
--- trunk/libsbml/src/sbml/packages/layout/sbml/SpeciesReferenceGlyph.cpp 2013-07-30 11:52:05 UTC (rev 18276)
+++ trunk/libsbml/src/sbml/packages/layout/sbml/SpeciesReferenceGlyph.cpp 2013-07-31 12:23:39 UTC (rev 18277)
@@ -750,25 +750,29 @@
/*
* Accepts the given SBMLVisitor.
-
+ */
bool
SpeciesReferenceGlyph::accept (SBMLVisitor& v) const
{
- bool result=v.visit(*this);
+ v.visit(*this);
+
if(this->mCurve.getNumCurveSegments()>0)
{
this->mCurve.accept(v);
}
- else
+
+ if (getBoundingBoxExplicitlySet() == true)
{
this->mBoundingBox.accept(v);
}
+
v.leave(*this);
- return result;
+
+ return true;
}
-*/
+
/*
* Sets the parent SBMLDocument of this SBML object.
*/
Modified: trunk/libsbml/src/sbml/packages/layout/sbml/SpeciesReferenceGlyph.h
===================================================================
--- trunk/libsbml/src/sbml/packages/layout/sbml/SpeciesReferenceGlyph.h 2013-07-30 11:52:05 UTC (rev 18276)
+++ trunk/libsbml/src/sbml/packages/layout/sbml/SpeciesReferenceGlyph.h 2013-07-31 12:23:39 UTC (rev 18277)
@@ -349,9 +349,9 @@
* @return the result of calling <code>v.visit()</code>, which indicates
* whether or not the Visitor would like to visit the SBML object's next
* sibling object (if available).
+ */
+ virtual bool accept (SBMLVisitor& v) const;
- virtual bool accept (SBMLVisitor& v) const;
- */
/**
* Creates an XMLNode object from this.
Modified: trunk/libsbml/src/sbml/packages/layout/validator/LayoutValidator.cpp
===================================================================
--- trunk/libsbml/src/sbml/packages/layout/validator/LayoutValidator.cpp 2013-07-30 11:52:05 UTC (rev 18276)
+++ trunk/libsbml/src/sbml/packages/layout/validator/LayoutValidator.cpp 2013-07-31 12:23:39 UTC (rev 18277)
@@ -540,6 +540,15 @@
if (m != NULL)
{
+ const LayoutSBMLDocumentPlugin* docPlug =
+ static_cast <const LayoutSBMLDocumentPlugin *> (d.getPlugin("layout"));
+
+ if (docPlug->hasMetaidListBeenPopulated() == false)
+ {
+ const_cast<LayoutSBMLDocumentPlugin *>(docPlug)->populateMetaidList();
+ }
+
+
LayoutValidatingVisitor vv(*this, *m);
const LayoutModelPlugin* plugin =
Modified: trunk/libsbml/src/sbml/packages/layout/validator/constraints/LayoutConsistencyConstraints.cpp
===================================================================
--- trunk/libsbml/src/sbml/packages/layout/validator/constraints/LayoutConsistencyConstraints.cpp 2013-07-30 11:52:05 UTC (rev 18276)
+++ trunk/libsbml/src/sbml/packages/layout/validator/constraints/LayoutConsistencyConstraints.cpp 2013-07-31 12:23:39 UTC (rev 18277)
@@ -33,6 +33,8 @@
#include <sbml/validator/VConstraint.h>
#include <sbml/packages/layout/validator/LayoutSBMLError.h>
+#include <sbml/packages/layout/common/LayoutExtensionTypes.h>
+#include <sbml/packages/layout/extension/LayoutSBMLDocumentPlugin.h>
#endif /* AddingConstrainstToValidator */
@@ -44,8 +46,199 @@
/** @endcond */
-/** PUT CONSTRAINTS HERE */
+//20315
+START_CONSTRAINT (LayoutLayoutMustHaveDimensions, Layout, l)
+{
+ bool fail = false;
+ if (l.getDimensionsExplicitlySet() == false)
+ {
+ fail = true;
+ }
+
+ inv(fail == false);
+}
+END_CONSTRAINT
+
+//20406
+START_CONSTRAINT (LayoutGOMetaIdRefMustReferenceObject, GraphicalObject, go)
+{
+ pre(go.isSetMetaIdRef() == true);
+
+ bool fail = false;
+
+ const LayoutSBMLDocumentPlugin * plug =
+ static_cast<const LayoutSBMLDocumentPlugin*>
+ (go.getSBMLDocument()->getPlugin("layout"));
+
+ if (plug->getMetaidList().contains(go.getMetaIdRef()) == false)
+ {
+ fail = true;
+ }
+
+ inv(fail == false);
+}
+END_CONSTRAINT
+
+
+//20407
+START_CONSTRAINT (LayoutGOMustContainBoundingBox, GraphicalObject, go)
+{
+ bool fail = false;
+
+ if (go.getBoundingBoxExplicitlySet() == false)
+ {
+ fail = true;
+ }
+
+ inv(fail == false);
+}
+END_CONSTRAINT
+
+//20506
+START_CONSTRAINT (LayoutCGMetaIdRefMustReferenceObject, CompartmentGlyph, glyph)
+{
+ pre(glyph.isSetMetaIdRef() == true);
+
+ bool fail = false;
+
+ const LayoutSBMLDocumentPlugin * plug =
+ static_cast<const LayoutSBMLDocumentPlugin*>
+ (glyph.getSBMLDocument()->getPlugin("layout"));
+
+ if (plug->getMetaidList().contains(glyph.getMetaIdRef()) == false)
+ {
+ fail = true;
+ }
+
+ inv(fail == false);
+}
+END_CONSTRAINT
+
+//20606
+START_CONSTRAINT (LayoutSGMetaIdRefMustReferenceObject, SpeciesGlyph, glyph)
+{
+ pre(glyph.isSetMetaIdRef() == true);
+
+ bool fail = false;
+
+ const LayoutSBMLDocumentPlugin * plug =
+ static_cast<const LayoutSBMLDocumentPlugin*>
+ (glyph.getSBMLDocument()->getPlugin("layout"));
+
+ if (plug->getMetaidList().contains(glyph.getMetaIdRef()) == false)
+ {
+ fail = true;
+ }
+
+ inv(fail == false);
+}
+END_CONSTRAINT
+
+//20706
+START_CONSTRAINT (LayoutRGMetaIdRefMustReferenceObject, ReactionGlyph, glyph)
+{
+ pre(glyph.isSetMetaIdRef() == true);
+
+ bool fail = false;
+
+ const LayoutSBMLDocumentPlugin * plug =
+ static_cast<const LayoutSBMLDocumentPlugin*>
+ (glyph.getSBMLDocument()->getPlugin("layout"));
+
+ if (plug->getMetaidList().contains(glyph.getMetaIdRef()) == false)
+ {
+ fail = true;
+ }
+
+ inv(fail == false);
+}
+END_CONSTRAINT
+
+//20806
+START_CONSTRAINT (LayoutGGMetaIdRefMustReferenceObject, GeneralGlyph, glyph)
+{
+ pre(glyph.isSetMetaIdRef() == true);
+
+ bool fail = false;
+
+ const LayoutSBMLDocumentPlugin * plug =
+ static_cast<const LayoutSBMLDocumentPlugin*>
+ (glyph.getSBMLDocument()->getPlugin("layout"));
+
+ if (plug->getMetaidList().contains(glyph.getMetaIdRef()) == false)
+ {
+ fail = true;
+ }
+
+ inv(fail == false);
+}
+END_CONSTRAINT
+
+//20906
+START_CONSTRAINT (LayoutTGMetaIdRefMustReferenceObject, TextGlyph, glyph)
+{
+ pre(glyph.isSetMetaIdRef() == true);
+
+ bool fail = false;
+
+ const LayoutSBMLDocumentPlugin * plug =
+ static_cast<const LayoutSBMLDocumentPlugin*>
+ (glyph.getSBMLDocument()->getPlugin("layout"));
+
+ if (plug->getMetaidList().contains(glyph.getMetaIdRef()) == false)
+ {
+ fail = true;
+ }
+
+ inv(fail == false);
+}
+END_CONSTRAINT
+
+//20106
+START_CONSTRAINT (LayoutSRGMetaIdRefMustReferenceObject,
+ SpeciesReferenceGlyph, glyph)
+{
+ pre(glyph.isSetMetaIdRef() == true);
+
+ bool fail = false;
+
+ const LayoutSBMLDocumentPlugin * plug =
+ static_cast<const LayoutSBMLDocumentPlugin*>
+ (glyph.getSBMLDocument()->getPlugin("layout"));
+
+ if (plug->getMetaidList().contains(glyph.getMetaIdRef()) == false)
+ {
+ fail = true;
+ }
+
+ inv(fail == false);
+}
+END_CONSTRAINT
+
+
+//20116
+START_CONSTRAINT (LayoutREFGMetaIdRefMustReferenceObject, ReferenceGlyph, glyph)
+{
+ pre(glyph.isSetMetaIdRef() == true);
+
+ bool fail = false;
+
+ const LayoutSBMLDocumentPlugin * plug =
+ static_cast<const LayoutSBMLDocumentPlugin*>
+ (glyph.getSBMLDocument()->getPlugin("layout"));
+
+ if (plug->getMetaidList().contains(glyph.getMetaIdRef()) == false)
+ {
+ fail = true;
+ }
+
+ inv(fail == false);
+}
+END_CONSTRAINT
+
+
+
/** @endcond doxygen-libsbml-internal */
Added: trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020204-fail-01-02.xml
===================================================================
--- trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020204-fail-01-02.xml (rev 0)
+++ trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020204-fail-01-02.xml 2013-07-31 12:23:39 UTC (rev 18277)
@@ -0,0 +1,246 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core"
+ xmlns:layout="http://www.sbml.org/sbml/level3/version1/layout/version1"
+ level="3" version="1" layout:required="false" >
+ <model id="TestModel_with_modifiers" timeUnits="time">
+
+ <listOfCompartments>
+ <compartment id="Yeast" spatialDimensions="3" units="volume" constant="true"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="Glucose" compartment="Yeast" substanceUnits="substance"
+ hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"/>
+ <species id="G6P" name="Glucose-6-phosphate" compartment="Yeast"
+ substanceUnits="substance" hasOnlySubstanceUnits="false"
+ boundaryCondition="false" constant="false"/>
+ <species id="ATP" compartment="Yeast" substanceUnits="substance"
+ hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"/>
+ <species id="ADP" compartment="Yeast" substanceUnits="substance"
+ hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"/>
+ <species id="Pi" compartment="Yeast" substanceUnits="substance"
+ hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"/>
+ </listOfSpecies>
+ <listOfReactions>
+ <reaction id="Hexokinase" reversible="false" fast="false">
+ <listOfReactants>
+ <speciesReference id="SpeciesReference_Glucose" species="Glucose"
+ stoichiometry="1" constant="true"/>
+ <speciesReference id="SpeciesReference_ATP" species="ATP"
+ stoichiometry="1" constant="true"/>
+ </listOfReactants>
+ <listOfProducts>
+ <speciesReference id="SpeciesReference_G6P" species="G6P"
+ stoichiometry="1" constant="true"/>
+ <speciesReference id="SpeciesReference_ADP" species="ADP"
+ stoichiometry="1" constant="true"/>
+ </listOfProducts>
+ <listOfModifiers>
+ <modifierSpeciesReference id="ModifierSpeciesReference_G6P" species="G6P"/>
+ <modifierSpeciesReference id="ModifierSpeciesReference_Pi" species="Pi"/>
+ </listOfModifiers>
+ </reaction>
+ </listOfReactions>
+ <layout:listOfLayouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:layout="http://www.sbml.org/sbml/level3/version1/layout/version1" layout:id="smk" metaid="__smk" sboTerm="SBO:0000001">
+ <layout:layout layout:id="Layout_1">
+ <layout:dimensions layout:width="400" layout:height="230"/>
+ <layout:listOfCompartmentGlyphs>
+ <layout:compartmentGlyph layout:id="CompartmentGlyph_1" layout:compartment="Yeast">
+ <layout:boundingBox layout:id="bb1">
+ <layout:position layout:x="5" layout:y="5"/>
+ <layout:dimensions layout:width="390" layout:height="220"/>
+ </layout:boundingBox>
+ </layout:compartmentGlyph>
+ </layout:listOfCompartmentGlyphs>
+ <layout:listOfSpeciesGlyphs>
+ <layout:speciesGlyph layout:id="SpeciesGlyph_Glucose" layout:species="Glucose">
+ <layout:boundingBox layout:id="bb2">
+ <layout:position layout:x="105" layout:y="20"/>
+ <layout:dimensions layout:width="130" layout:height="20"/>
+ </layout:boundingBox>
+ </layout:speciesGlyph>
+ <layout:speciesGlyph layout:id="SpeciesGlyph_G6P" layout:species="G6P">
+ <layout:boundingBox layout:id="bb5">
+ <layout:position layout:x="50" layout:y="190"/>
+ <layout:dimensions layout:width="270" layout:height="20"/>
+ </layout:boundingBox>
+ </layout:speciesGlyph>
+ <layout:speciesGlyph layout:id="SpeciesGlyph_ATP" layout:species="ATP">
+ <layout:boundingBox layout:id="bb3">
+ <layout:position layout:x="270" layout:y="70"/>
+ <layout:dimensions layout:width="80" layout:height="20"/>
+ </layout:boundingBox>
+ </layout:speciesGlyph>
+ <layout:speciesGlyph layout:id="glyph_ADP" layout:species="ADP">
+ <layout:boundingBox layout:id="bb4">
+ <layout:position layout:x="270" layout:y="140"/>
+ <layout:dimensions layout:width="80" layout:height="20"/>
+ </layout:boundingBox>
+ </layout:speciesGlyph>
+ <layout:speciesGlyph layout:id="SpeciesGlyph_Pi" layout:species="Pi">
+ <layout:boundingBox layout:id="bb6">
+ <layout:position layout:x="50" layout:y="100"/>
+ <layout:dimensions layout:width="60" layout:height="20"/>
+ </layout:boundingBox>
+ </layout:speciesGlyph>
+ </layout:listOfSpeciesGlyphs>
+ <layout:listOfReactionGlyphs>
+ <layout:reactionGlyph layout:id="glyph_Hexokinase" layout:reaction="Hexokinase">
+ <layout:curve>
+ <layout:listOfCurveSegments>
+ <layout:curveSegment
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:type="LineSegment">
+ <layout:start layout:x="170" layout:y="100"/>
+ <layout:end layout:x="170" layout:y="130"/>
+ </layout:curveSegment>
+ </layout:listOfCurveSegments>
+ </layout:curve>
+ <layout:listOfSpeciesReferenceGlyphs>
+ <layout:speciesReferenceGlyph layout:id="SpeciesReferenceGlyph_Glucose"
+ layout:speciesReference="SpeciesReference_Glucose"
+ layout:speciesGlyph="SpeciesGlyph_Glucose"
+ layout:role="substrate">
+ <layout:curve>
+ <layout:listOfCurveSegments>
+ <layout:curveSegment
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:type="LineSegment">
+ <layout:start layout:x="170" layout:y="100"/>
+ <layout:end layout:x="170" layout:y="50"/>
+ </layout:curveSegment>
+ </layout:listOfCurveSegments>
+ </layout:curve>
+ </layout:speciesReferenceGlyph>
+ <layout:speciesReferenceGlyph layout:id="SpeciesReferenceGlyph_ATP"
+ layout:speciesReference="SpeciesReference_ATP"
+ layout:speciesGlyph="SpeciesGlyph_ATP"
+ layout:role="sidesubstrate">
+ <layout:curve>
+ <layout:listOfCurveSegments>
+ <layout:curveSegment
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:type="CubicBezier">
+ <layout:start layout:x="170" layout:y="100"/>
+ <layout:end layout:x="260" layout:y="80"/>
+ <layout:basePoint1 layout:x="170" layout:y="80"/>
+ <layout:basePoint2 layout:x="170" layout:y="80"/>
+ </layout:curveSegment>
+ </layout:listOfCurveSegments>
+ </layout:curve>
+ </layout:speciesReferenceGlyph>
+ <layout:speciesReferenceGlyph layout:id="SpeciesReferenceGlyph_G6P_1"
+ layout:speciesReference="SpeciesReference_G6P"
+ layout:speciesGlyph="SpeciesGlyph_G6P"
+ layout:role="product">
+ <layout:curve>
+ <layout:listOfCurveSegments>
+ <layout:curveSegment
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:type="LineSegment">
+ <layout:start layout:x="170" layout:y="130"/>
+ <layout:end layout:x="170" layout:y="180"/>
+ </layout:curveSegment>
+ </layout:listOfCurveSegments>
+ </layout:curve>
+ </layout:speciesReferenceGlyph>
+ <layout:speciesReferenceGlyph layout:id="SpeciesReferenceGlyph_ADP"
+ layout:speciesReference="SpeciesReference_ADP"
+ layout:speciesGlyph="glyph_ADP"
+ layout:role="sideproduct">
+ <layout:curve>
+ <layout:listOfCurveSegments>
+ <layout:curveSegment
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:type="CubicBezier">
+ <layout:start layout:x="170" layout:y="130"/>
+ <layout:end layout:x="260" layout:y="150"/>
+ <layout:basePoint1 layout:x="170" layout:y="150"/>
+ <layout:basePoint2 layout:x="170" layout:y="150"/>
+ </layout:curveSegment>
+ </layout:listOfCurveSegments>
+ </layout:curve>
+ </layout:speciesReferenceGlyph>
+ <layout:speciesReferenceGlyph layout:id="SpeciesReferenceGlyph_G6P_2"
+ layout:speciesReference="ModifierSpeciesReference_G6P"
+ layout:speciesGlyph="SpeciesGlyph_G6P"
+ layout:role="inhibitor">
+ <layout:curve>
+ <layout:listOfCurveSegments>
+ <layout:curveSegment
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:type="CubicBezier">
+ <layout:start layout:x="45" layout:y="200"/>
+ <layout:end layout:x="165" layout:y="120"/>
+ <layout:basePoint1 layout:x="0" layout:y="200"/>
+ <layout:basePoint2 layout:x="0" layout:y="120"/>
+ </layout:curveSegment>
+ </layout:listOfCurveSegments>
+ </layout:curve>
+ </layout:speciesReferenceGlyph>
+ <layout:speciesReferenceGlyph layout:id="SpeciesReferenceGlyph_PI"
+ layout:speciesReference="ModifierSpeciesReference_Pi"
+ layout:speciesGlyph="SpeciesGlyph_Pi"
+ layout:role="activator">
+ <layout:curve>
+ <layout:listOfCurveSegments>
+ <layout:curveSegment
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:type="CubicBezier">
+ <layout:start layout:x="115" layout:y="110"/>
+ <layout:end layout:x="165" layout:y="110"/>
+ <layout:basePoint1 layout:x="140" layout:y="110"/>
+ <layout:basePoint2 layout:x="140" layout:y="110"/>
+ </layout:curveSegment>
+ </layout:listOfCurveSegments>
+ </layout:curve>
+ </layout:speciesReferenceGlyph>
+ </layout:listOfSpeciesReferenceGlyphs>
+ </layout:reactionGlyph>
+ </layout:listOfReactionGlyphs>
+ <layout:listOfTextGlyphs>
+ <layout:textGlyph layout:id="TextGlyph_Glucose"
+ layout:originOfText="Glucose"
+ layout:graphicalObject="SpeciesGlyph_Glucose">
+ <layout:boundingBox layout:id="bbA">
+ <layout:position layout:x="115" layout:y="20"/>
+ <layout:dimensions layout:width="110" layout:height="20"/>
+ </layout:boundingBox>
+ </layout:textGlyph>
+ <layout:textGlyph layout:id="TextGlyph_G6P"
+ layout:originOfText="G6P"
+ layout:graphicalObject="SpeciesGlyph_G6P">
+ <layout:boundingBox layout:id="bbD">
+ <layout:position layout:x="60" layout:y="190"/>
+ <layout:dimensions layout:width="250" layout:height="20"/>
+ </layout:boundingBox>
+ </layout:textGlyph>
+ <layout:textGlyph layout:id="TextGlyph_ATP"
+ layout:originOfText="ATP"
+ layout:graphicalObject="SpeciesGlyph_ATP">
+ <layout:boundingBox layout:id="bbB">
+ <layout:position layout:x="280" layout:y="70"/>
+ <layout:dimensions layout:width="60" layout:height="20"/>
+ </layout:boundingBox>
+ </layout:textGlyph>
+ <layout:textGlyph layout:id="TextGlyph_ADP"
+ layout:originOfText="ADP"
+ layout:graphicalObject="glyph_ADP">
+ <layout:boundingBox layout:id="bbC">
+ <layout:position layout:x="280" layout:y="140"/>
+ <layout:dimensions layout:width="60" layout:height="20"/>
+ </layout:boundingBox>
+ </layout:textGlyph>
+ <layout:textGlyph layout:id="TextGlyph_PI"
+ layout:originOfText="Pi"
+ layout:graphicalObject="SpeciesGlyph_Pi">
+ <layout:boundingBox layout:id="bbE">
+ <layout:position layout:x="60" layout:y="100"/>
+ <layout:dimensions layout:width="40" layout:height="20"/>
+ </layout:boundingBox>
+ </layout:textGlyph>
+ </layout:listOfTextGlyphs>
+ </layout:layout>
+ </layout:listOfLayouts>
+ </model>
+</sbml>
Added: trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020315-fail-01-01.xml
===================================================================
--- trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020315-fail-01-01.xml (rev 0)
+++ trunk/libsbml/src/sbml/packages/layout/validator/test/test-data/general-constraints/6020315-fail-01-01.xml 2013-07-31 12:23:39 UTC (rev 18277)
@@ -0,0 +1,246 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core"
+ xmlns:layout="http://www.sbml.org/sbml/level3/version1/layout/version1"
+ level="3" version="1" layout:required="false" >
+ <model id="TestModel_with_modifiers" timeUnits="time">
+
+ <listOfCompartments>
+ <compartment id="Yeast" spatialDimensions="3" units="volume" constant="true"/>
+ </listOfCompartments>
+ <listOfSpecies>
+ <species id="Glucose" compartment="Yeast" substanceUnits="substance"
+ hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"/>
+ <species id="G6P" name="Glucose-6-phosphate" compartment="Yeast"
+ substanceUnits="substance" hasOnlySubstanceUnits="false"
+ boundaryCondition="false" constant="false"/>
+ <species id="ATP" compartment="Yeast" substanceUnits="substance"
+ hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"/>
+ <species id="ADP" compartment="Yeast" substanceUnits="substance"
+ hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"/>
+ <species id="Pi" compartment="Yeast" substanceUnits="substance"
+ hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"/>
+ </listOfSpecies>
+ <listOfReactions>
+ <reaction id="Hexokinase" reversible="false" fast="false">
+ <listOfReactants>
+ <speciesReference id="SpeciesReference_Glucose" species="Glucose"
+ stoichiometry="1" constant="true"/>
+ <speciesReference id="SpeciesReference_ATP" species="ATP"
+ stoichiometry="1" constant="true"/>
+ </listOfReactants>
+ <listOfProducts>
+ <speciesReference id="SpeciesReference_G6P" species="G6P"
+ stoichiometry="1" constant="true"/>
+ <speciesReference id="SpeciesReference_ADP" species="ADP"
+ stoichiometry="1" constant="true"/>
+ </listOfProducts>
+ <listOfModifiers>
+ <modifierSpeciesReference id="ModifierSpeciesReference_G6P" species="G6P"/>
+ <modifierSpeciesReference id="ModifierSpeciesReference_Pi" species="Pi"/>
+ </listOfModifiers>
+ </reaction>
+ </listOfReactions>
+ <layout:listOfLayouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:layout="http://www.sbml.org/sbml/level3/version1/layout/version1">
+ <layout:layout layout:id="Layout_1">
+
+ <layout:listOfCompartmentGlyphs>
+ <layout:compartmentGlyph layout:id="CompartmentGlyph_1" layout:compartment="Yeast">
+ <layout:boundingBox layout:id="bb1">
+ <layout:position layout:x="5" layout:y="5"/>
+ <layout:dimensions layout:width="390" layout:height="220"/>
+ </layout:boundingBox>
+ </layout:compartmentGlyph>
+ </layout:listOfCompartmentGlyphs>
+ <layout:listOfSpeciesGlyphs>
+ <layout:speciesGlyph layout:id="SpeciesGlyph_Glucose" layout:species="Glucose">
+ <layout:boundingBox layout:id="bb2">
+ <layout:position layout:x="105" layout:y="20"/>
+ <layout:dimensions layout:width="130" layout:height="20"/>
+ </layout:boundingBox>
+ </layout:speciesGlyph>
+ <layout:speciesGlyph layout:id="SpeciesGlyph_G6P" layout:species="G6P">
+ <layout:boundingBox layout:id="bb5">
+ <layout:position layout:x="50" layout:y="190"/>
+ <layout:dimensions layout:width="270" layout:height="20"/>
+ </layout:boundingBox>
+ </layout:speciesGlyph>
+ <layout:speciesGlyph layout:id="SpeciesGlyph_ATP" layout:species="ATP">
+ <layout:boundingBox layout:id="bb3">
+ <layout:position layout:x="270" layout:y="70"/>
+ <layout:dimensions layout:width="80" layout:height="20"/>
+ </layout:boundingBox>
+ </layout:speciesGlyph>
+ <layout:speciesGlyph layout:id="glyph_ADP" layout:species="ADP">
+ <layout:boundingBox layout:id="bb4">
+ <layout:position layout:x="270" layout:y="140"/>
+ <layout:dimensions layout:width="80" layout:height="20"/>
+ </layout:boundingBox>
+ </layout:speciesGlyph>
+ <layout:speciesGlyph layout:id="SpeciesGlyph_Pi" layout:species="Pi">
+ <layout:boundingBox layout:id="bb6">
+ <layout:position layout:x="50" layout:y="100"/>
+ <layout:dimensions layout:width="60" layout:height="20"/>
+ </layout:boundingBox>
+ </layout:speciesGlyph>
+ </layout:listOfSpeciesGlyphs>
+ <layout:listOfReactionGlyphs>
+ <layout:reactionGlyph layout:id="glyph_Hexokinase" layout:reaction="Hexokinase">
+ <layout:curve>
+ <layout:listOfCurveSegments>
+ <layout:curveSegment
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:type="LineSegment">
+ <layout:start layout:x="170" layout:y="100"/>
+ <layout:end layout:x="170" layout:y="130"/>
+ </layout:curveSegment>
+ </layout:listOfCurveSegments>
+ </layout:curve>
+ <layout:listOfSpeciesReferenceGlyphs>
+ <layout:speciesReferenceGlyph layout:id="SpeciesRefer...
[truncated message content] |