bool Journal::PlayNext()
{
   if (_State == PlayState) {
      _start();
      Id id;

      mFile->read(&id);

      Functor* jrn = _create(id);
      AssertFatal(jrn,"Journal: Undefined function found in journal");
      jrn->read(mFile);
      _finish();

      _Dispatching = true;
      jrn->dispatch();
      _Dispatching = false;

      delete jrn;
      if (_Count)
         return true;
      Stop();

      //debugBreak();
   }
   return false;
}
Esempio n. 2
0
/* this is registered in _envsetup */
int
_notehandler(void *u, char *msg)
{
	int i;
	void(*f)(int, char*, Ureg*);
	extern void _doatexits(void);	/* in stdio/exit.c */

	if(_finishing)
		_finish(0, 0);
	for(i = 0; i<NSIGTAB; i++){
		if(strncmp(msg, sigtab[i].msg, strlen(sigtab[i].msg)) == 0){
			f = _sighdlr[sigtab[i].num];
			if(f == SIG_DFL || f == SIG_ERR)
				break;
			if(f != SIG_IGN) {
				_notetramp(sigtab[i].num, f, u);
				/* notetramp is machine-dependent; doesn't return to here */
			}
			noted(0); /* NCONT */
			return 0;
		}
	}
	//_doatexits();
	noted(1); /* NDFLT */
	return 0;
}
const CByteArray &IISCPacketCreator::kick()
{
	_start(ISCC_KICK);

	_finish();

	return ms_packet;
}
const CByteArray &IISCPacketCreator::logout(ID _sid)
{
	_start(ISCC_LOGOUT);

	ms_packet.addInt(_sid);

	_finish();

	return ms_packet;
}
const CByteArray &IISCPacketCreator::authAnswer(ID _sid, E_AUTH_ANSWER _answer)
{
	_start(ISCC_AUTH_ANSWER);

	ms_packet.addInt(_sid);
	ms_packet.addInt(_answer);

	_finish();

	return ms_packet;
}
const CByteArray &IISCPacketCreator::channelInfos(s32 _currplayers, s32 _maxplayers)
{
	_start(ISCC_CHANNEL_INFOS);

	ms_packet.addInt(_currplayers);
	ms_packet.addInt(_maxplayers);

	_finish();

	return ms_packet;
}
const CByteArray &IISCPacketCreator::auth(E_ISC_CLIENT_TYPE _type, const char *_password,
										  const char *_name, const char *_thisip, ID _extid, s32 _additional)
{
	_start(ISCC_AUTH);

	ms_packet.addInt(_type);
	ms_packet.addString(_password);
	ms_packet.addString(_name);
	ms_packet.addString(_thisip);
	ms_packet.addInt(_extid);
	ms_packet.addInt(_additional);

	_finish();

	return ms_packet;
}
Esempio n. 8
0
 void finish() { _finish(); }
Esempio n. 9
0
void
_exit(int status)
{
	_finish(status, 0);
}
void DicomSurfaceSegmentationLoad::_addMeshToOutput(const int meshNumber)
{
	if(meshNumber >= _dicomMeshesVector.size())
  {
		return;
  }

  int meshesIDStartValue = (int)_meshesIDStartValueFld->getIntValue();

	const Element3D meshElement     = _dicomMeshesVector[meshNumber];

	const std::string segmentLabel  = meshElement.getSegmentLabel();	 
  const Coordinates3D meshSurface = meshElement.getReferencedSurface();

  const std::vector<Vector3> wemPositions              = meshSurface.getCoordinates();
	const std::vector<unsigned long> meshPositionIndices = meshSurface.getCoordinateIndices();
	const std::vector<Vector3> meshNormals               = meshSurface.getNormals();

	WEMTrianglePatch* newPatch = NULL;
	ML_CHECK_NEW(newPatch, WEMTrianglePatch());

  // Add WEM nodes
	for (unsigned long p = 0; p < wemPositions.size(); p++) 
  {
		WEMNode* newNode = newPatch->addNode();

		newNode->setPosition(wemPositions[p]);

		if(!meshNormals.empty())
    {
			newNode->setNormal(meshNormals[p]);
    }
		else
    {
			newNode->computeNormal();
    }
	}

  // Add WEM faces
	for (size_t f = 0; f < meshPositionIndices.size(); f += 3) 
  {
		WEMTriangle* newFace = newPatch->addTriangle();

		for (unsigned int i = 0; i < 3; i++) 
    {
			WEMNode* node = newPatch->getNodeAt(meshPositionIndices[f+i]);
			newFace->setNode(i, node);
			node->addFace(newFace);
		}

		newFace->computeNormal();
	}
	
	newPatch->setLabel(segmentLabel);
	//newPatch->setId(_outWEM->getCurrentWEMPatchId());
	newPatch->setId(meshesIDStartValue + meshNumber);
	newPatch->setType(_type);

	ML_NAMESPACE::WEMPrimitiveValueList* primitiveValueList = newPatch->createOrGetPrimitiveValueList("LUT");
	primitiveValueList->setValue(0, static_cast<double>(meshNumber));

	newPatch->buildEdgeConnectivity();
	_outWEM->addWEMPatch(newPatch);
	_finish(newPatch);
}
Esempio n. 11
0
void gz_fclose(GZ_FILE* stream)
{
    _finish(stream);
    fclose(stream->file);
    free(stream);
}