本文整理汇总了C++中Patch::getId方法的典型用法代码示例。如果您正苦于以下问题:C++ Patch::getId方法的具体用法?C++ Patch::getId怎么用?C++ Patch::getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Patch
的用法示例。
在下文中一共展示了Patch::getId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadMVS
void FileLoader::loadMVS(const char *fileName, MVS &mvs) {
vector<Camera> &cameras = mvs.cameras;
map<int, Patch> &patches = mvs.patches;
// reset container
cameras.clear();
patches.clear();
// open mvs file
ifstream file(fileName, ifstream::in | ifstream::binary);
if ( !file.is_open() ) {
printf("Can't open MVS file: %s\n", fileName);
return;
}
char *strip = NULL;
char strbuf[STRING_BUFFER_LENGTH];
int num;
bool loadCamera = false;
bool loadPatch = false;
while ( !file.eof() ) {
file.getline(strbuf, STRING_BUFFER_LENGTH);
strip = strtok(strbuf, DELIMITER);
if (strip == NULL) continue; // skip blank line
// start load camera
if (strcmp(strip, "MVS_V2") == 0) {
loadCamera = true;
continue;
}
// set config and start load camera
if (strcmp(strip, "MVS_V3") == 0) {
MvsConfig config = loadMvsConfig(file);
mvs.setConfig(config);
loadCamera = true;
continue;
}
if (loadCamera) {
strip = strtok(NULL, DELIMITER);
num = atoi(strip);
for (int i = 0; i < num; ++i) {
printf("\rloading cameras: %d / %d", i+1, num);
cameras.push_back( loadMvsCamera(file) );
}
printf("\n");
loadCamera = false;
loadPatch = true;
continue;
}
if (loadPatch) {
strip = strtok(NULL, DELIMITER);
num = atoi(strip);
for (int i = 0; i < num; ++i) {
printf("\rloading patches: %d / %d", i+1, num);
Patch pth = loadMvsPatch(file);
patches.insert( pair<int, Patch>(pth.getId(), pth) );
}
printf("\n");
loadPatch = false;
}
}
file.close();
}
示例2: file
void FileLoader::loadNVM2(const char *fileName, MVS &mvs) {
vector<Camera> &cameras = mvs.cameras;
map<int, Patch> &patches = mvs.patches;
// reset container
cameras.clear();
patches.clear();
// open nvm file
ifstream file(fileName, ifstream::in);
if ( !file.is_open() ) {
printf("Can't open NVM2 file: %s\n", fileName);
return;
}
// get file path
char filePath [MAX_FILE_NAME_LENGTH];
getDir(fileName, filePath);
char *strip = NULL;
char strbuf[STRING_BUFFER_LENGTH];
int num;
bool loadCamera = false;
bool loadPatch = false;
while ( !file.eof() ) {
file.getline(strbuf, STRING_BUFFER_LENGTH);
strip = strtok(strbuf, DELIMITER);
if (strip == NULL) continue; // skip blank line
// start load camera
if (strcmp(strip, "NVM_V3") == 0) {
loadCamera = true;
continue;
}
if (loadCamera) {
// get number of cameras
strip = strtok(strbuf, DELIMITER);
num = atoi(strip);
cameras.reserve(num);
for (int i = 0; i < num; i++) {
printf("\rloading cameras: %d / %d", i+1, num);
cameras.push_back( loadNvm2Camera(file, filePath) );
}
printf("\n");
loadCamera = false;
loadPatch = true;
continue;
}
if (loadPatch) {
// get number of points
strip = strtok(strbuf, DELIMITER);
num = atoi(strip);
for (int i = 0; i < num; i++) {
printf("\rloading patches: %d / %d", i+1, num);
Patch p = loadNvmPatch(file, mvs);
patches.insert( pair<int, Patch>(p.getId(), p) );
}
printf("\n");
loadPatch = false;
break;
}
}
file.close();
}