Esempio n. 1
0
void Frame::Construct(int spiceId, const std::string& name)
{
	if(!ValidateId(spiceId))
		CSpiceUtil::SignalError("No such CSpice frame is defined");

	this->spiceId = spiceId;

	if(name != "")
		this->name = name;
	else
		this->name = GetSpiceName();

	this->centerObject = new SpaceObject(GetFrameInfo().centerId, this->name + "_center");
}
Esempio n. 2
0
YK_BOOL CForGantt::GetWork(YK_ID& workId)
{
	if (m_vecNodes.empty()) return false;
	if (!m_loopWorkFlg)
	{
		m_iterNodes = m_vecNodes.begin();
		m_loopWorkFlg = true;
	}
	else
	{
		++m_iterNodes;
	}
	YK_ID id(0);
	while(m_iterNodes != m_vecNodes.end())
	{
		YKNode* pNode = *m_iterNodes;
		assert(pNode != YK_NULL);
		if (pNode->ut == (YK_SHORT)(WP_PRESET|WP_BEG))
		{
			workId = pNode->id;
			return true;
		}
		else if (pNode->ut == (YK_SHORT)(WP_PRODUCE|WP_BEG))
		{
			id = pNode->id;
			if (m_pPreCapPt != YK_NULL)
			{
				if ((!m_pPreCapPt->Have(id))&&ValidateId(id, TYPE_PRODUCETM))
				{
					workId = id;
					return true;
				}
				else
				{
					++m_iterNodes;
					continue;
				}
			}
			if (ValidateId(id, TYPE_PRODUCETM))
			{
				workId = id;
				return true;
			}
			else
			{
				++m_iterNodes;
				continue;
			}
		}
		else if (pNode->ut == (YK_SHORT)(WP_LOCK|WP_BEG))
		{
			id = pNode->id;
			if (m_pPreCapPt != YK_NULL )
			{
				if ((!m_pPreCapPt->Have(id))&&ValidateId(id,TYPE_LOCKTM))
				{
					workId = id;
					return true;
				}
				else
				{
					++m_iterNodes;
					continue;
				}
			}
			if (ValidateId(id,TYPE_LOCKTM))
			{
				workId = id;
				return true;
			}
			else
			{
				++m_iterNodes;
				continue;
			}
		}
		else if (pNode->ut == (YK_SHORT)(WP_POSTSET|WP_BEG))
		{
			id = pNode->id;
			if (m_pPreCapPt != YK_NULL)
			{
				if ((!m_pPreCapPt->Have(id))&&ValidateId(id,TYPE_POSTSET))
				{
					workId = id;
					return true;
				}
				else
				{
					++m_iterNodes;
					continue;
				}
			}
			if (ValidateId(id,TYPE_POSTSET))
			{
				workId = id;
				return true;
			}
			else
			{
				++m_iterNodes;
				continue;
			}
		}
		++m_iterNodes;
	}
	return false;
}