本文整理汇总了C++中ofPtr::getUid方法的典型用法代码示例。如果您正苦于以下问题:C++ ofPtr::getUid方法的具体用法?C++ ofPtr::getUid怎么用?C++ ofPtr::getUid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofPtr
的用法示例。
在下文中一共展示了ofPtr::getUid方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: saveScene
void bankManager::saveScene(ofxXmlSettings & XML, ofPtr<scene> sn){
XML.addValue("NAME", sn->getName());
XML.addValue("UID", sn->getUid());
XML.addValue("FADE_IN", sn->getFadeIn());
XML.addValue("FADE_OUT", sn->getFadeOut());
vector <ofPtr<triggerZone> > t_tzs = sn->getTriggerZones();
vector <ofPtr<triggerZone> > ::iterator it;
int count = 0;
for(it = t_tzs.begin(); it != t_tzs.end(); it++){
XML.addTag("ZONE");
ofPtr<triggerZone> z = (*it);
if(XML.pushTag("ZONE", count)){
saveZone(XML, z);
count++;
//zone tag
XML.popTag();
}
}
}
示例2: loadScene
void bankManager::loadScene(ofxXmlSettings & XML, ofPtr<scene> nScene){
nScene->setName(XML.getValue("NAME", ""));
nScene->setUid(XML.getValue("UID", nScene->getUid()));
nScene->setFadeIn(XML.getValue("FADE_IN", 0.01));
nScene->setFadeOut(XML.getValue("FADE_OUT", 0.01));
int numZones = XML.getNumTags("ZONE");
for(int tz = 0; tz < numZones; tz++){
ofSleepMillis(1000/60); //FIX ME : a hack to prevent UDP flooding
//but really OSC Manager should handle this and throttle the number of messages per frame
if(XML.pushTag("ZONE", tz)){
ofPtr<triggerZone> z = nScene->addTriggerZone(currentZone, true); //isLoading flag to prevent OSC flood
loadZone(XML, z);
//zone tag
XML.popTag();
}
}
allScenes.push_back(nScene);
}
示例3: checkUniqueId
void bankManager::checkUniqueId(ofPtr<scene> sn){
bool isUnique = false;
while (!isUnique) {
bool isFound = false;
vector<ofPtr<scene> >::iterator it = allScenes.begin();
for(it = allScenes.begin(); it != allScenes.end(); it++){
if(sn->getUid() == (*it)->getUid())isFound = true;
}
if(isFound){
sn->newIndex();
}else{
isUnique = true;
}
}
}