Ejemplo n.º 1
0
bool MapImporter::addPrimitiveToEntity(const scene::INodePtr& primitive, const scene::INodePtr& entity)
{
	_nodes.insert(NodeMap::value_type(
		NodeIndexPair(_entityCount, _primitiveCount), primitive));

	_primitiveCount++;

	if (_dialog && _dialogEventLimiter.readyForEvent())
    {
		_dialog->setTextAndFraction(
            _dlgEntityText + "Primitive " + string::to_string(_primitiveCount),
			getProgressFraction()
        );
    }

	if (Node_getEntity(entity)->isContainer())
	{
		entity->addChildNode(primitive);
		return true;
	}
	else
	{
		return false;
	}
}
Ejemplo n.º 2
0
bool MapImporter::addEntity(const scene::INodePtr& entityNode)
{
	// Keep track of this entity
	_nodes.insert(NodeMap::value_type(
		NodeIndexPair(_entityCount, InfoFile::EMPTY_PRIMITVE_NUM), entityNode));

	_entityCount++;

	if (_dialog)
	{
		// Update the dialog text
		_dlgEntityText = (boost::format(_("Loading entity %d\n")) % _entityCount).str();

		// Update the dialog text. This will throw an exception if the cancel
		// button is clicked, which we must catch and handle.
		if (_dialogEventLimiter.readyForEvent())
		{
			// Let the OperationAbortedException fall through, it will be caught in the MapResource class
			_dialog->setTextAndFraction(_dlgEntityText, getProgressFraction());
		}
	}

	_root->addChildNode(entityNode);

	return true;
}
Ejemplo n.º 3
0
bool MapImporter::addEntity(const scene::INodePtr& entityNode)
{
	_entityCount++;

	if (_dialog)
	{
		// Update the dialog text
		_dlgEntityText = (boost::format(_("Loading entity %d")) % _entityCount).str();

		// Update the dialog text. This will throw an exception if the cancel
		// button is clicked, which we must catch and handle.
		if (_dialogEventLimiter.readyForEvent())
		{
			// Let the OperationAbortedException fall through, it will be caught in the MapResource class
			_dialog->setTextAndFraction(_dlgEntityText, getProgressFraction());
		}
	}

	_root->addChildNode(entityNode);

	return true;
}