本文整理汇总了C++中Interaction::getSelectionActionModel方法的典型用法代码示例。如果您正苦于以下问题:C++ Interaction::getSelectionActionModel方法的具体用法?C++ Interaction::getSelectionActionModel怎么用?C++ Interaction::getSelectionActionModel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Interaction
的用法示例。
在下文中一共展示了Interaction::getSelectionActionModel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute
void InteractionHighlightSelectionActionEvent::execute() {
int i;
Entity* entity;
ModelInterface* highlightModel;
HighlightSelectionActionModel* selectionModel = NULL;
// std::string modelPath = Configuration::getPath("Highlighters");
SceneGraphInterface* sgIF = OutputInterface::getSceneGraphInterface();
if (!sgIF) {
printd(ERROR,
"InteractionHighlightSelectionActionEvent::execute(): no SceneGraphInterface found!\n");
return;
} // if
// modelPath = modelPath + modelUrl;
std::string modelPath = getConcatenatedPath(modelUrl, "Highlighters");
highlightModel = sgIF->loadModel(modelType, modelPath);
if (!highlightModel) {
printd(
ERROR,
"InteractionHighlightSelectionActionEvent::execute(): failed to load highlightmodel %s\n",
modelPath.c_str());
return;
} // if
if (userId == UserDatabase::getLocalUserId()) {
Interaction* interactionModule = (Interaction*)SystemCore::getModuleByName("Interaction");
assert(interactionModule);
selectionModel
= dynamic_cast<HighlightSelectionActionModel*> (interactionModule->getSelectionActionModel());
} // if
for (i = 0; i < (int)highlightEntityIds.size(); i++) {
entity = WorldDatabase::getEntityWithTypeInstanceId(highlightEntityIds[i]);
if (entity)
highlightEntity(entity, sgIF, highlightModel, selectionModel);
else
printd(WARNING,
"InteractionHighlightSelectionActionEvent::execute(): Could not find Entity for highlighting!\n");
// highlightEntity(highlightEntityIds[i], sgIF, highlightModel, selectionModel)
} // for
for (i = 0; i < (int)unhighlightEntityIds.size(); i++) {
entity = WorldDatabase::getEntityWithTypeInstanceId(unhighlightEntityIds[i]);
if (entity)
unhighlightEntity(entity, sgIF, selectionModel);
else
printd(WARNING,
"InteractionHighlightSelectionActionEvent::execute(): Could not find Entity for unhighlighting!\n");
// unhighlightEntity(unhighlightEntityIds[i], sgIF, highlightModel, selectionModel)
} // for
} // execute