std::string SwapFieldElementCommand::getPresentationName(void) const
{
	return getCommandDescription();
}
	virtual std::string getPresentationName(void) const
	{
		return getCommandDescription();
	}
std::string AttachColGeomGraphOpCommand::getPresentationName(void) const
{
	return getCommandDescription();
}
std::string SetFieldValueCommand::getPresentationName(void) const
{
	return getCommandDescription();
}
std::string RemoveSceneCommand::getPresentationName(void) const
{
	return getCommandDescription();
}
Exemple #6
0
//==============================================================================
ObjectHandle CommandInstance::getCommandDescription() const
{
	auto command = this->getCommand();

	auto description = command->getCommandDescription(getArguments());
	if (description != nullptr)
	{
        return setCommandDescription(std::move(description));
	}

	if (undoRedoData_.empty())
	{
		return nullptr;
	}

	// Single command
	// OR
	// Batch command with one child
	// OR
	// Macro command
	// - getCommandDescription() returns the same as a single command

	const auto commandCount = undoRedoData_.size();
	auto batchCommand = dynamic_cast<const BatchCommand*>(command);
	if ((commandCount == 1) || (commandCount == 2))
	{
        return setCommandDescription(undoRedoData_.begin()->get()->getCommandDescription());
	}

	// Batch command with multiple children
	// This is expected to have a "Children" collection attached
	auto itr = undoRedoData_.begin();

	// First item is the batch itself
	auto batchHandle = itr->get()->getCommandDescription();
    auto pBatchDescription = batchHandle.getHandleT();
	TF_ASSERT(pBatchDescription != nullptr);

	// Get copy of children
    typedef std::vector<ManagedObjectPtr> ContainerType;
	Collection childrenCollection;
	const bool success = pBatchDescription->get("Children", childrenCollection);
    auto container = childrenCollection.container<ContainerType>();
    if (!success || !container)
    {
        TF_ASSERT(!"Children must be in container of Managed Objects");
        return nullptr;
    }

	// Latter items are children of the batch
    ++itr;
    for (; itr != undoRedoData_.end(); ++itr)
    {
        auto childObject = itr->get()->getCommandDescription();
        container->push_back(std::make_unique<ManagedObject<GenericObject>>(std::move(childObject)));
    }

	// Copy back to batch
	const auto setCollection = pBatchDescription->set("Children", childrenCollection);
	TF_ASSERT(setCollection);

    return setCommandDescription(std::move(batchHandle));
}
std::string DeleteSelectedCommand::getPresentationName(void) const
{
    return getCommandDescription();
}
std::string LoadProjectCommand::getPresentationName(void) const
{
	return getCommandDescription();
}
std::string TravMaskCommand::getPresentationName(void) const
{
	return getCommandDescription();
}
std::string PruneGraphOpCommand::getPresentationName(void) const
{
    return getCommandDescription();
}
void CloseProjectCommand::execute(void)
{
	std::cout << getCommandDescription() << std::endl;
}
std::string AddLightToSceneCommand::getPresentationName(void) const
{
	return getCommandDescription();
}