//------------------------------------------------------------------------------
// entityStateManager() --  (Output support)
//    -- Update the entity object for this NIB(Player)
//------------------------------------------------------------------------------
bool Nib::entityStateManager(const double curExecTime)
{
   bool ok = true;
   if (getPlayer()->isMode(simulation::Player::ACTIVE) && isPlayerStateUpdateRequired(curExecTime)) {

      // Need to update this entity object ...

      NetIO* netIO = static_cast<NetIO*>(getNetIO());
      RTI::RTIambassador* rtiAmb = netIO->getRTIambassador();

      // ---
      // First, make sure this entity has been registered
      // ---
      if (!isRegistered()) {
         try {
            RTI::ObjectClassHandle theClassHandle = netIO->getObjectClassHandle( getClassIndex() );
            makeObjectName();
            setObjectHandle( rtiAmb->registerObjectInstance( theClassHandle, getObjectName() ) );
            netIO->addNibToObjectTables(this, simulation::NetIO::OUTPUT_NIB);
            std::cout << "rprfom::Nib::updateEntity(): Register entity: " << getObjectName() << " handle = " << getObjectHandle() << std::endl;
         }
         catch (RTI::Exception& e) {
            std::cerr << &e << std::endl;
            ok = false;
         }
      }

      // ---
      // Next, update the entity's attribute values ...
      // ---
      if ( ok && isRegistered()) {
         try {
            // Create the attribute-value pair set
            RTI::AttributeHandleValuePairSet* attrs = nullptr;
            attrs = RTI::AttributeSetFactory::create( NetIO::NUM_OBJECT_ATTRIBUTES );

            // Load the set with updated attribute values
            updateBasicEntity(attrs,curExecTime);
            updatePhysicalEntity(attrs,curExecTime);
            updatePlatform(attrs,curExecTime);

            // Send attributes to the RTI
            //std::cout << "RprFom::Nib::updateEntity(): Update entity: " << getObjectName() << " handle = " << getObjectHandle() << std::endl;
            ok = netIO->updateAttributeValues(getObjectHandle(), attrs);

            delete attrs;
         }

         catch (RTI::Exception& e) {
            std::cerr << &e << std::endl;
            ok = false;
         }
      }
   } // end -- if active player needs an update

   return ok;
}
Example #2
0
C_INT32 CMetabOld::load(CReadConfig &configbuffer)
{
  C_INT32 Fail = 0;
  std::string tmp;
  Fail = configbuffer.getVariable("Metabolite", "string",
                                  (void *) & tmp,
                                  CReadConfig::SEARCH);

  if (Fail)
    return Fail;

  setObjectName(tmp);

  Fail = configbuffer.getVariable("Concentration", "C_FLOAT64",
                                  (void *) & mIConc);

  if (Fail)
    return Fail;

  Fail = configbuffer.getVariable("Compartment", "C_INT32",
                                  (void *) & mCompartment);

  if (Fail)
    return Fail;

  C_INT32 Status;

  Fail = configbuffer.getVariable("Type", "C_INT32",
                                  (void *) & Status);

  if (Status == 0)
    mStatus = CModelEntity::FIXED;
  else
    mStatus = CModelEntity::REACTIONS;

  // sanity check
  if ((mStatus < 0) || (mStatus > 7))
    {
      CCopasiMessage(CCopasiMessage::WARNING,
                     "The file specifies a non-existing type "
                     "for '%s'.\nReset to internal species.",
                     getObjectName().c_str());
      mStatus = CModelEntity::REACTIONS;
    }

  // sanity check
  if ((mStatus != METAB_MOIETY) && (mIConc < 0.0))
    {
      CCopasiMessage(CCopasiMessage::WARNING,
                     "The file specifies a negative concentration "
                     "for '%s'.\nReset to default.",
                     getObjectName().c_str());
      mIConc = 1.0;
    }

  return Fail;
}
const NAString QualifiedName::getQualifiedNameAsAnsiNTFilenameString() const
{
  // Preallocate a result buffer that'll be big enough most of the time
  // (so += won't reallocate+copy most of the time).
  NAString result((NASize_T)40, CmpCommon::statementHeap());

  NAString catName(CmpCommon::statementHeap());
  NAString schName(CmpCommon::statementHeap());
  NAString objName(CmpCommon::statementHeap());

  formatAsAnsiIdentifier = TRUE;	// put quotes on delimited identifiers

  if ( NOT getCatalogName().isNull() ) {
    catName = FORMAT(getCatalogName());
    makeSafeFilenamePart(catName, "SQLMX_DEFAULT_CATALOG_");
  }
  if ( NOT getSchemaName().isNull() ) {
    schName = FORMAT(getSchemaName());
    makeSafeFilenamePart(schName, "SQLMX_DEFAULT_SCHEMA_");
  }
  if ( NOT getObjectName().isNull() ) {
    objName = FORMAT(getObjectName());
  }
  makeSafeFilenamePart(objName, "SQLMX_DEFAULT_FILE_");

  formatAsAnsiIdentifier = FALSE;	// reset to initial value

  size_t totlen = catName.length() + schName.length() + objName.length() + 2;

  if ( totlen > 255 ) {					// need to truncate
    // +1 so round off doesn't give us less than what we need to chop
    size_t chopLen = totlen - 255 + 1;  
             
    if ( catName.length() - chopLen/2 <= 0 )		// cat too short
      schName.remove( schName.length() - chopLen );
    else if ( schName.length() - chopLen/2 <= 0 )	// sch too short
      catName.remove( catName.length() - chopLen );
    else {						// chop from both
      // remember position starts at 0 and length is 1 more
      chopLen /= 2;
      catName.remove( catName.length() - chopLen - 1 );
      schName.remove( schName.length() - chopLen - 1 );
    }
  }

  if (NOT catName.isNull()) {
    result = catName;
    result += ".";
  }
  if (NOT schName.isNull()) {
    result += schName;
    result += ".";
  }
  result += objName;

  return result;
}
Example #4
0
C_INT32 CMetab::load(CReadConfig &configbuffer)
{
  C_INT32 Fail = 0;

  std::string tmp;
  Fail = configbuffer.getVariable("Metabolite", "string",
                                  (void *) & tmp,
                                  CReadConfig::SEARCH);

  if (Fail)
    return Fail;

  setObjectName(tmp);

  Fail = configbuffer.getVariable("InitialConcentration", "C_FLOAT64",
                                  (void *) & mIConc);

  setInitialConcentration(mIConc);
  setConcentration(mIConc);

  Status GepasiStatus;
  Fail = configbuffer.getVariable("Type", "C_INT16",
                                  (void *) & GepasiStatus);

  if (Fail)
    return Fail;

  setStatus(GepasiStatus);

  // sanity check
  if ((GepasiStatus < 0) || (GepasiStatus > 7))
    {
      CCopasiMessage(CCopasiMessage::WARNING,
                     "The file specifies a non-existing type "
                     "for '%s'.\nReset to internal species.",
                     getObjectName().c_str());
      setStatus(REACTIONS);
    }

  // sanity check
  if ((GepasiStatus != METAB_MOIETY) && (mIConc < 0.0))
    {
      CCopasiMessage(CCopasiMessage::WARNING,
                     "The file specifies a negative concentration "
                     "for '%s'.\nReset to default.",
                     getObjectName().c_str());
      mIConc = 1.0;
    }

  return Fail;
}
Example #5
0
void findConnectedNodeTypes(uint nodeId, MObject thisObject, MObjectArray& connectedElements, MPlugArray& completeList, bool upstream)
{

	MGlobal::displayInfo(MString("thisNode: ") + getObjectName(thisObject));

	MString name = getObjectName(thisObject);

	MFnDependencyNode depFn(thisObject);
	if(depFn.typeId().id() == nodeId)
	{
		connectedElements.append(thisObject);
		MGlobal::displayInfo(MString("found object with correct id: ") + depFn.name());
		return;
	}

	bool downstream = !upstream;

	MPlugArray plugArray;
	depFn.getConnections(plugArray);

	int numc = plugArray.length();

	for( uint plugId = 0; plugId < plugArray.length(); plugId++)
	{
		MPlug plug = plugArray[plugId];
		if( isPlugInList(plug, completeList))
			continue;

		completeList.append(plug);

		MString pn = plug.name();
		if( upstream && plug.isDestination())
			continue;
		if( downstream && plug.isSource())
			continue;
		
		MPlugArray otherSidePlugs;
		bool asDest = plug.isDestination();
		bool asSrc = plug.isSource();
		MGlobal::displayInfo(MString("findConnectedNodeTypes: checking plug ") + plug.name());
		plug.connectedTo(otherSidePlugs, asDest, asSrc);
		for( uint cplugId = 0; cplugId < otherSidePlugs.length(); cplugId++)
		{
			findConnectedNodeTypes(nodeId, otherSidePlugs[cplugId].node(), connectedElements, completeList, upstream);
		}		
	}

}
bool CExperimentObjectMap::elevateChildren()
{
  bool success = true;

  std::vector<CCopasiParameter *>::iterator itColumn = mValue.pGROUP->begin();
  std::vector<CCopasiParameter *>::iterator endColumn = mValue.pGROUP->end();

  if (itColumn != endColumn &&
      dynamic_cast< CCopasiParameterGroup * >(*itColumn) == NULL) // We have an old data format.
    {
      CCopasiParameterGroup New(getObjectName());

      for (; itColumn != endColumn; ++itColumn)
        {
          CCopasiParameterGroup * pGroup = New.assertGroup((*itColumn)->getObjectName());
          pGroup->assertParameter("Object CN", CCopasiParameter::CN, *(*itColumn)->getValue().pCN);
        }

      clear();
      *this = New;
    }

  for (itColumn = mValue.pGROUP->begin(); itColumn != endColumn; ++itColumn)
    if (((*itColumn) = elevate<CDataColumn, CCopasiParameterGroup>(*itColumn)) == NULL)
      success = false;

  return success;
}
	static void _write(liqRibLocatorData* pData, const structJob &currentJob__)
	{
		CM_TRACE_FUNC("er_writeLocatorData.cpp::write("<<pData->getFullPathName().asChar()<<","<<currentJob__.name.asChar()<<",...)");
		OutputMgr &o = Renderer::getOutputMgr();

		o.ln();
		o.ln();
		o.ln();
		o.a(boost::str(boost::format("locator %s")%pData->getFullPathName().asChar()));

#ifdef TRANSFORM_SHAPE_PAIR
		const std::string objectName(pData->getFullPathName().asChar());//shape
#else// SHAPE SHAPE_object PAIR
		const std::string objectName(getObjectName(pData->getFullPathName().asChar()));//shape+"_object"
#endif

		std::vector<MVector> POSITION;
		std::vector<MVector> POSITION_mb;//motion blur position
		std::vector<std::size_t> INDEX;//global vertex index
		std::vector<MVector> NORMAL;
		std::vector<MVector> UV;

		o.liq_object(objectName.c_str(),
			POSITION, POSITION_mb, INDEX, NORMAL, UV
			);
	}
Example #8
0
/*!
  Creates a declaration for the object given in \a e.

  Children are not traversed recursively.

  \sa createObjectImpl()
 */
void Uic::createObjectDecl( const QDomElement& e )
{
    if ( e.tagName() == "vbox" ) {
	out << "    QVBoxLayout* " << registerObject(getLayoutName(e) ) << ";" << endl;
    } else if ( e.tagName() == "hbox" ) {
	out << "    QHBoxLayout* " << registerObject(getLayoutName(e) ) << ";" << endl;
    } else if ( e.tagName() == "grid" ) {
	out << "    QGridLayout* " << registerObject(getLayoutName(e) ) << ";" << endl;
    } else {
	QString objClass = getClassName( e );
	if ( objClass.isEmpty() )
	    return;
	QString objName = getObjectName( e );
	if ( objName.isEmpty() )
	    return;
	// ignore QLayoutWidgets
	if ( objClass == "QLayoutWidget" )
	    return;
	// register the object and unify its name
	objName = registerObject( objName );
	if ( objClass == "Line" )
	    objClass = "QFrame";
	else if (objClass == "Spacer")
	    objClass = "QSpacerItem";
	out << "    " << objClass << "* " << objName << ";" << endl;
    }
}
Example #9
0
void CFunction::writeMathML(std::ostream & out,
                            const std::vector<std::vector<std::string> > & env,
                            bool expand, bool fullExpand,
                            unsigned C_INT32 l) const
{
  if (expand && mpRoot)
    {
      bool flag = false; //TODO include check if parantheses are necessary

      if (flag) out << SPC(l) << "<mfenced>" << std::endl;

      mpRoot->writeMathML(out, env, fullExpand, l + 1);

      if (flag) out << SPC(l) << "</mfenced>" << std::endl;
    }
  else //no expand
    {
      out << SPC(l) << "<mrow>" << std::endl;
      out << SPC(l + 1) << CMathMl::fixName(getObjectName()) << std::endl;
      out << SPC(l + 1) << "<mfenced>" << std::endl;

      unsigned C_INT32 i, imax = getVariables().size();

      for (i = 0; i < imax; ++i)
        {
          out << SPC(l + 2) << env[i][0] << std::endl;
        }

      out << SPC(l + 1) << "</mfenced>" << std::endl;
      out << SPC(l) << "</mrow>" << std::endl;
    }
}
Example #10
0
bool CExperimentObjectMap::elevateChildren()
{
  bool success = true;

  elements::iterator itColumn = beginIndex();
  elements::iterator endColumn = endIndex();

  if (itColumn != endColumn &&
      dynamic_cast< CCopasiParameterGroup * >(*itColumn) == NULL) // We have an old data format.
    {
      CCopasiParameterGroup New(getObjectName());

      for (; itColumn != endColumn; ++itColumn)
        {
          CCopasiParameterGroup * pGroup = New.assertGroup((*itColumn)->getObjectName());
          pGroup->assertParameter("Object CN", CCopasiParameter::CN, (*itColumn)->getValue< CRegisteredObjectName >());
        }

      clear();
      operator=(New);
    }

  for (itColumn = beginIndex(); itColumn != endColumn; ++itColumn)
    if (((*itColumn) = elevate<CDataColumn, CCopasiParameterGroup>(*itColumn)) == NULL)
      success = false;

  return success;
}
Example #11
0
void Uic::createMenuBarImpl( const QDomElement &n, const QString &parentClass, const QString &parent )
{
    QString objName = getObjectName( n );
    out << indent << objName << " = new QMenuBar( this, \"" << objName << "\" );" << endl;
    createObjectImpl( n, parentClass, parent );
    int i = 0;
    QDomElement c = n.firstChild().toElement();
    while ( !c.isNull() ) {
	if ( c.tagName() == "item" ) {
	    QString itemName = c.attribute( "name" );
	    out << endl;
	    out << indent << itemName << " = new QPopupMenu( this );" << endl;
	    createPopupMenuImpl( c, parentClass, itemName );
	    out << indent << objName << "->insertItem( QString(\"\"), " << itemName << ", " << i << " );" << endl;
	    QString findItem(objName + "->findItem(%1)");
	    findItem = findItem.arg(i);
	    trout << indent << "if (" << findItem << ")" << endl;
	    trout << indent << indent << findItem << "->setText( " << trcall( c.attribute( "text" ) ) << " );" << endl;
	} else if ( c.tagName() == "separator" ) {
	    out << endl;
	    out << indent << objName << "->insertSeparator( " << i << " );" << endl;
	}
	c = c.nextSibling().toElement();
	i++;
    }
}
Example #12
0
QString Uic::createSpacerImpl( const QDomElement &e, const QString& /*parentClass*/, const QString& /*parent*/, const QString& /*layout*/)
{
    QDomElement n;
    QString objClass, objName;
    objClass = e.tagName();
    objName = registerObject( getObjectName( e ) );

    QSize size = DomTool::readProperty( e, "sizeHint", QSize( 0, 0 ) ).toSize();
    QString sizeType = DomTool::readProperty( e, "sizeType", "Expanding" ).toString();
    bool isVspacer = DomTool::readProperty( e, "orientation", "Horizontal" ) == "Vertical";

    if ( sizeType != "Expanding" && sizeType != "MinimumExpanding" &&
	 DomTool::hasProperty( e, "geometry" ) ) { // compatibility Qt 2.2
	QRect geom = DomTool::readProperty( e, "geometry", QRect(0,0,0,0) ).toRect();
	size = geom.size();
    }

    if ( isVspacer )
	out << "    " << objName << " = new QSpacerItem( "
	    << size.width() << ", " << size.height()
	    << ", QSizePolicy::Minimum, QSizePolicy::" << sizeType << " );" << endl;
    else
	out << "    " << objName << " = new QSpacerItem( "
	    << size.width() << ", " << size.height()
	    << ", QSizePolicy::" << sizeType << ", QSizePolicy::Minimum );" << endl;

    return objName;
}
Example #13
0
void Ui3Reader::generate(const QString &fn, const QString &outputFn,
                         QDomDocument doc, bool decl, bool subcl, const QString &trm,
                         const QString& subClass, const QString &convertedUiFile)
{
    init();

    fileName = fn;
    outputFileName = outputFn;
    trmacro = trm;

    QDomElement e = parse(doc);

    if (nameOfClass.isEmpty())
        nameOfClass = getObjectName(e);
    namespaces = nameOfClass.split(QLatin1String("::"));
    bareNameOfClass = namespaces.last();
    namespaces.removeLast();

    if (!convertedUiFile.isEmpty()) {
        createWrapperDecl(e, convertedUiFile);
    } else if (subcl) {
        if (decl)
            createSubDecl(e, subClass);
        else
            createSubImpl(e, subClass);
    } else {
        if (decl)
            createFormDecl(e);
        else
            createFormImpl(e);
    }

}
Example #14
0
void Uic::createToolbarImpl( const QDomElement &n, const QString &parentClass, const QString &parent )
{
    QDomNodeList nl = n.elementsByTagName( "toolbar" );
    for ( int i = 0; i < (int) nl.length(); i++ ) {
	QDomElement ae = nl.item( i ).toElement();
	QString dock = get_dock( ae.attribute( "dock" ) );
	QString objName = getObjectName( ae );
 	out << indent << objName << " = new QToolBar( QString(\"\"), this, " << dock << " ); " << endl;
	createObjectImpl( ae, parentClass, parent );
	for ( QDomElement n2 = ae.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) {
	    if ( n2.tagName() == "action" ) {
		out << indent << n2.attribute( "name" ) << "->addTo( " << objName << " );" << endl;
	    } else if ( n2.tagName() == "separator" ) {
		out << indent << objName << "->addSeparator();" << endl;
	    } else if ( n2.tagName() == "widget" ) {
		if ( n2.attribute( "class" ) != "Spacer" ) {
		    createObjectImpl( n2, "QToolBar", objName );
		} else {
		    QString child = createSpacerImpl( n2, parentClass, parent, objName );
		    out << indent << "QApplication::sendPostedEvents( " << objName
			<< ", QEvent::ChildInserted );" << endl;
		    out << indent << objName << "->boxLayout()->addItem( " << child << " );" << endl;
		}
	    }
	}
    }
}
Example #15
0
void Uic::createSpacerDecl( const QDomElement &e )
{
    for ( QDomElement n = e.firstChild().toElement();
	  !n.isNull(); n = n.nextSibling().toElement() )
	if ( n.tagName() == "spacer" )
	    out << "    QSpacerItem* " << registerObject(getObjectName(n)) << ";" << endl;
}
Example #16
0
const McEnvironment* McObject::getEnvironment() const {
    /* Check if the environment is set into the object */
    if(!environment)
        throw(GeneralError("Object " + getObjectName() + " from module " + getModuleName() +
                           " attempted to access the environment but there isn't a reference to it "));
    return environment;
}
Example #17
0
/*!
  Creates a set-call for property \a exclusiveProp of the object
  given in \a e.

  If the object does not have this property, the function does nothing.

  Exclusive properties are used to generate the implementation of
  application font or palette change handlers in createFormImpl().

 */
void Uic::createExclusiveProperty( const QDomElement & e, const QString& exclusiveProp )
{
    QDomElement n;
    QString objClass = getClassName( e );
    if ( objClass.isEmpty() )
	return;
    QString objName = getObjectName( e );
#if 0 // it's not clear whether this check should be here or not
    if ( objName.isEmpty() )
	return;
#endif
    for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) {
	if ( n.tagName() == "property" ) {
	    bool stdset = stdsetdef;
	    if ( n.hasAttribute( "stdset" ) )
		stdset = toBool( n.attribute( "stdset" ) );
	    QString prop = n.attribute( "name" );
	    if ( prop != exclusiveProp )
		continue;
	    QString value = setObjectProperty( objClass, objName, prop, n.firstChild().toElement(), stdset );
	    if ( value.isEmpty() )
		continue;
	    // we assume the property isn't of type 'string'
	    out << '\t' << objName << "->setProperty( \"" << prop << "\", " << value << " );" << endl;
	}
    }
}
/*****************************************************
**
**   GenericTableWriter   ---   writeObjectNameAndLongitude
**
******************************************************/
void GenericTableWriter::writeObjectNameAndLongitude( const uint &colid, const TcColumnSet &set )
{
	assert( table->getNbCols() >= colid + 2 );
	assert( table->getNbRows() > obs.size());
	SheetFormatter fmt;

	ObjectPosition pos;
	wxString s;

	switch( set.listcontext )
	{
		case TAB_LC_PLANETS:
			s = _( "Planet" );
		break;
		case TAB_LC_HOUSE_CUSPS:
			s = _( "House Cusp" );
		break;
		case TAB_LC_URANIAN:
			s = _( "Uranian" );
		break;
		default:
			s = wxT( "ERROR" );
		break;
	}
	table->setHeader( colid,  s );

	for ( uint p = 0; p < obs.size(); p++ )
	{
		table->setEntry( colid, p + 1, getObjectName( obs[p], set ));
		pos = getObjectPosition( obs[p], set );
		table->setEntry( colid + 1, p + 1, fmt.getPosFormatted( pos.longitude, pos.direction, DEG_PRECISION_SECOND ));
		if ( h->getTropicalLongitude( obs[p] ) == 0 ) table->errorcount++;
	}
}
Example #19
0
void KSPopupMenu::createDeepSkyObjectMenu( DeepSkyObject *obj ) {
    QString name     = getObjectName(obj);
    QString typeName = obj->typeName();
    // FIXME: information about angular sizes should be added.
    QString info = magToStr( obj->mag() );
    initPopupMenu( obj, name, typeName, info );
    addLinksToMenu( obj );
}
NAString QualifiedName::getQualifiedNameAsString(NABoolean formatForDisplay,
						 NABoolean externalDisplay) const
{
  // Preallocate a result buffer that'll be big enough most of the time
  // (so += won't reallocate+copy most of the time).
  NAString result((NASize_T)40, CmpCommon::statementHeap());

  // The object name can be empty if it's an ambiguous column reference
  // (in a join), e.g.  In that case, do NOT prepend "cat.sch." to colrefname
  // which would yield the incorrect string "cat.sch..col".
  //
  if (NOT getObjectName().isNull()) 
  {
    // If volatile, only output the object part of the external name.
    // cat/sch names are internal.
    if ((formatForDisplay) &&
	(isVolatile()))
      {
	result += FORMAT(getObjectName());
      }
    else
      {
	if (NOT getCatalogName().isNull() && NOT externalDisplay) 
	  {
	    if ((SqlParser_NADefaults_Glob != NULL) AND
		(SqlParser_NADefaults_Glob->NAMETYPE_ == DF_SHORTANSI) AND
		(*getCatalogName().data() == '\\'))
	      {
		formatAsAnsiIdentifier = FALSE;
	      }
	    result = FORMAT(getCatalogName());
	    result += ".";
	    CMPASSERT(NOT getSchemaName().isNull());
	  }
	
	if (NOT getSchemaName().isNull())
	  {
	    result += FORMAT(getSchemaName());
	    result += ".";
	  }
	result += FORMAT(getObjectName());
      }
  }
  
  return result;
}
Example #21
0
void ShadingNode::setMObject(MObject mobj)
{
	this->mobject = mobj;
	if( this->mobject != MObject::kNullObj)
	{
		this->typeName = getDepNodeTypeName(this->mobject);
		this->fullName = getObjectName(this->mobject);	
	}
}
Example #22
0
void ShadingNode::setMObject(const MObject& mobj)
{
    mobject = mobj;
    if (mobject != MObject::kNullObj)
    {
        typeName = getDepNodeTypeName(mobject);
        fullName = getObjectName(mobject);
    }
}
Example #23
0
std::string CArrayAnnotation::getObjectDisplayName() const
{
  std::string part;

  if (getObjectParent() && getObjectParent()->getObjectType() != "Model")
    part = getObjectParent()->getObjectDisplayName() + ".";

  return part + getObjectName() + "[[]]";
}
Example #24
0
std::string CEvent::getObjectDisplayName() const
{
  CModel* tmp = dynamic_cast<CModel*>(this->getObjectAncestor("Model"));

  if (tmp)
    return "((" + getObjectName() + "))";

  return CCopasiObject::getObjectDisplayName();
}
Example #25
0
char *AGOSEngine_PN::getMessage(char *msg, uint16 num) {
	char *origPtr, *strPtr1 = msg;
	uint8 count;

	getObjectName(strPtr1, num);
	if (!(num & 0x8000)) {
		return msg;
	}

	if (strPtr1[0] == 0x41 || strPtr1[0] == 0x61) {
		if (strPtr1[1] != 0x20)
			strPtr1 += 2;
	} else if (strPtr1[0] == 0x54 || strPtr1[0] == 0x74) {
		if (strPtr1[1] == 0x68 &&
		    strPtr1[2] == 0x65 &&
		    strPtr1[3] == 0x20)
			strPtr1 += 4;
	}

	origPtr = strPtr1;
	while (*strPtr1 != 13)
		strPtr1++;

	strPtr1[0] = 32;
	strPtr1[1] = 13;
	strPtr1[2] = 0;

	if (_videoLockOut & 0x10) {
		strPtr1 = origPtr;
		count = 6;
		while (*strPtr1) {
			if (*strPtr1 == 32) {
				count = 6;
			} else {
				count--;
				if (count == 0) {
					char *tmpPtr = strPtr1;
					char *strPtr2 = strPtr1;

					while (*strPtr2 != 0 && *strPtr2 != 32)
						strPtr2++;

					while (*strPtr2) {
						*strPtr1++ = *strPtr2++;
					}
					*strPtr1++ = *strPtr2++;

					strPtr1 = tmpPtr;
					count = 6;
				}
			}
			strPtr1++;
		}
	}

	return origPtr;
}
Example #26
0
 void IMesh::initDebug(std::string ref)
 {
     imesh_mark_.scale.x = 0.005;
     imesh_mark_.color.a = imesh_mark_.color.r = 1;
     imesh_mark_.type = visualization_msgs::Marker::LINE_LIST;
     imesh_mark_.header.frame_id = ref;
     imesh_mark_.ns = getObjectName();
     imesh_mark_pub_ = server_->advertise<visualization_msgs::Marker>(ns_ +"/InteractionMesh", 1, true);
     HIGHLIGHT("InteractionMesh connectivity is published on ROS topic "<<imesh_mark_pub_.getTopic()<<", in reference frame "<<ref);
 }
Example #27
0
bool CMathExpression::convertToInitialExpression()
{
  if (getObjectName().substr(0, 7) != "Initial")
    {
      setObjectName("Initial" + getObjectName());
    }

  if (mpNodeList == NULL)
    {
      return false;
    }

  std::vector< CEvaluationNode * >::iterator it = mpNodeList->begin();
  std::vector< CEvaluationNode * >::iterator end = mpNodeList->end();
  bool changed = false;

  for (; it != end; ++it)
    {
      if ((*it)->mainType() == CEvaluationNode::T_OBJECT &&
          (*it)->subType() == CEvaluationNode::S_POINTER)
        {
          CEvaluationNodeObject * pNode = static_cast< CEvaluationNodeObject *>(*it);
          const C_FLOAT64 * pValue = pNode->getObjectValuePtr();
          C_FLOAT64 * pInitialValue = pMathContainer->getInitialValuePointer(pValue);

          if (pValue != pInitialValue)
            {
              changed = true;
              pNode->setObjectValuePtr(pInitialValue);

              mPrerequisites.erase(pMathContainer->getMathObject(pValue));
              mPrerequisites.insert(pMathContainer->getMathObject(pInitialValue));
            }
        }
    }

  if (changed)
    {
      mInfix = mpRootNode->buildInfix();
    }

  return true;
}
Example #28
0
std::string CObjectClassesHandler::getObjectName(si32 type, si32 subtype) const
{
	if (knownSubObjects(type).count(subtype))
	{
		auto name = getHandlerFor(type, subtype)->getCustomName();
		if (name)
			return name.get();
	}
	return getObjectName(type);
}
Example #29
0
void ShadingNode::init(void)
{
	this->mobject = MObject::kNullObj;
	this->nodeState = INVALID;
	if( this->mobject != MObject::kNullObj)
	{
		this->typeName = getDepNodeTypeName(this->mobject);
		this->fullName = getObjectName(this->mobject);	
	}
}
void QualifiedName::print(FILE* ofd, const char* indent, const char* title) const
{
#ifndef NDEBUG
  fprintf(ofd,"c=%s s=%s o=%s%s",
	  getCatalogName().data(),
	  getSchemaName().data(),
	  getObjectName().data(),
	  indent);	// just to prevent warnings
  if (strcmp(title,"")) fprintf(ofd,"\n");
#endif
}