本文整理汇总了C++中Marker::getType方法的典型用法代码示例。如果您正苦于以下问题:C++ Marker::getType方法的具体用法?C++ Marker::getType怎么用?C++ Marker::getType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Marker
的用法示例。
在下文中一共展示了Marker::getType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sl_onTypeChanged
void EditMarkerGroupDialog::sl_onTypeChanged(int newTypeIndex) {
if (newTypeIndex == currentTypeIndex) {
return;
}
MarkerDataType oldType = MarkerTypes::getDataTypeById(marker->getType());
MarkerDataType newType = MarkerTypes::getDataTypeById(typeIds.at(newTypeIndex));
bool changeMarker = false;
if (1 == marker->getValues().size()) { // contains only "rest"
changeMarker = true;
} else {
if (oldType == newType) {
changeMarker = true;
} else {
changeMarker = (QMessageBox::Ok == QMessageBox::question(this, tr("Warning"), tr("Are you really want to change marker's type? Some data can be lost!"), QMessageBox::Ok | QMessageBox::Cancel));
}
}
if (changeMarker) {
Marker *oldMarker = marker;
marker = MarkerFactory::createInstanse(typeIds.at(newTypeIndex), addParamEdit->text());
{
marker->setName(oldMarker->getName());
MarkerDataType oldType = MarkerTypes::getDataTypeById(oldMarker->getType());
MarkerDataType newType = MarkerTypes::getDataTypeById(marker->getType());
if (oldType == newType) {
foreach (const QString &key, oldMarker->getValues().keys()) {
marker->addValue(key, oldMarker->getValues().value(key));
}
} else {
marker->addValue(MarkerUtils::REST_OPERATION, oldMarker->getValues().value(MarkerUtils::REST_OPERATION));
}
}
示例2: sl_onMarkerAdded
void MarkerEditor::sl_onMarkerAdded(const QString &markerName) {
Marker *marker = markerModel->getMarker(markerName);
SAFE_POINT(NULL != marker, "NULL marker", );
{ // TODO: make common way to get marked object output port
assert(1 == cfg->getOutputPorts().size());
Port *outPort = cfg->getOutputPorts().at(0);
assert(outPort->getOutputType()->isMap());
QMap<Descriptor, DataTypePtr> outTypeMap = outPort->getOutputType()->getDatatypesMap();
Descriptor newSlot = MarkerSlots::getSlotByMarkerType(marker->getType(), marker->getName());
outTypeMap[newSlot] = BaseTypes::STRING_TYPE();
DataTypePtr newType(new MapDataType(dynamic_cast<Descriptor&>(*(outPort->getType())), outTypeMap));
outPort->setNewType(newType);
}
}
示例3: onCollide
bool Player::onCollide(Entity* other, const EntityCollision& c) {
if(m_state == &Root().editor_state) return false;
if(other->getTypeName() == "Pair") {
Pair* p = (Pair*)other;
p->activate();
return true;
} else if(other->getTypeName() == "Marker") {
Marker* m = (Marker*)other;
if(m->getType() == Marker::GOAL) {
auto p = getPairsLeft();
if(p == 0) {
Root().game_state.nextLevel();
} else {
Root().game_state.message(std::to_string(p / 2) + " pair" + (p == 2 ? "" : "s") + " missing");
}
}
}
return false;
}