Ejemplo n.º 1
0
/** @cond doxygenLibsbmlInternal */
void 
LayoutModelPlugin::writeAttributes (XMLOutputStream& ) const
{
  //
  // This function is used only for SBML Level 2.
  //
  if ( getURI() != LayoutExtension::getXmlnsL2() ) return;

  SBase *parent = const_cast<SBase*>(getParentSBMLObject());
  if (parent == NULL) 
    return;

  // when called this will serialize the annotation
  parent->getAnnotation();
  
}
/** @cond doxygenLibsbmlInternal */
void 
RenderListOfLayoutsPlugin::writeAttributes (XMLOutputStream& stream) const
{
  //
  // This function is used only for SBML Level 2.
  //
  if ( getURI() != RenderExtension::getXmlnsL2() ) return;

  SBase *parent = const_cast<SBase*>(getParentSBMLObject());
  if (!parent) return;

  // getting the annotation actually updates all annotations
  // so the call is needed
  /*XMLNode *annotation =*/ parent->getAnnotation();
  //RenderListOfLayoutsPlugin* self = const_cast<RenderListOfLayoutsPlugin*>(this);
  //self->syncAnnotation(parent, parent->getAnnotation());
}
Ejemplo n.º 3
0
bool UniPAX::SBase::merge(SBase& object)
{
	if (metaId.empty())
	{
		metaId = object.getMetaId();
	}
	else
	{
		if (metaId.compare(object.getMetaId()) != 0)
		{
			std::cerr << "Error during merging: UniPAX::SBase::metaId not equal ..."
					<< metaId << " != " << object.getMetaId() << std::endl;
			return false;
		}
	}
	if (sboTerm.empty())
	{
		sboTerm = object.getSboTerm();
	}
	else
	{
		if (sboTerm.compare(object.getSboTerm()) != 0)
		{
			std::cerr << "Error during merging: UniPAX::SBase::sboTerm not equal ..."
					<< sboTerm << " != " << object.getSboTerm() << std::endl;
			return false;
		}
	}
	if (notes.empty())
	{
		notes = object.getNotes();
	}
	else
	{
		if (notes.compare(object.getNotes()) != 0)
		{
			std::cerr << "Error during merging: UniPAX::SBase::notes not equal ..."
					<< notes << " != " << object.getNotes() << std::endl;
			return false;
		}
	}
	if (annotation.empty())
	{
		annotation = object.getAnnotation();
	}
	else
	{
		if (annotation.compare(object.getAnnotation()) != 0)
		{
			std::cerr << "Error during merging: UniPAX::SBase::annotation not equal ..."
					<< annotation << " != " << object.getAnnotation() << std::endl;
			return false;
		}
	}

//	if (unipaxSource != 0)
//	{
//		if (object.getUnipaxSource() != 0)
//		{
//
//			if (unipaxSource->getUnipaxId() != object.getUnipaxSource()->getUnipaxId())
//			{
//				std::cerr << "Error during merging: UniPAX::SBase::unipaxSource not equal ..."
//						<< unipaxSource->getUnipaxId() << " != " << object.getUnipaxSource()->getUnipaxId() << std::endl;
//				return false;
//			}
//		}
//	}
//	else
//	{
//		unipaxSource = object.getUnipaxSource();
//	}

	return UniPAX::UIBase::merge(object);
}