本文整理汇总了C++中MeshDocument::rm方法的典型用法代码示例。如果您正苦于以下问题:C++ MeshDocument::rm方法的具体用法?C++ MeshDocument::rm怎么用?C++ MeshDocument::rm使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MeshDocument
的用法示例。
在下文中一共展示了MeshDocument::rm方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MeshDocumentFromNvm
bool MeshDocumentFromNvm(MeshDocument &md, QString filename_nvm, QString model_filename)
{
md.addNewMesh(model_filename,QString("model"));
std::vector<vcg::Shotf> shots;
const QString path = QFileInfo(filename_nvm).absolutePath();
//const QString path_im = QFileInfo(image_list_filename).absolutePath()+QString("/");
std::vector<std::string> image_filenames;
vcg::tri::io::ImporterNVM<CMeshO>::Open(md.mm()->cm,shots,image_filenames,qPrintable(filename_nvm));
md.mm()->updateDataMask(MeshModel::MM_VERTCOLOR);
QString curr_path = QDir::currentPath();
//QFileInfo imi(image_list_filename);
//QDir::setCurrent(imi.absoluteDir().absolutePath());
QStringList image_filenames_q;
for(unsigned int i = 0; i < image_filenames.size(); ++i)
image_filenames_q.push_back(QString::fromStdString(image_filenames[i]));
for(size_t i=0 ; i<shots.size() ; i++){
md.addNewRaster();
const QString fullpath_image_filename = image_filenames_q[i];
md.rm()->addPlane(new Plane(fullpath_image_filename,Plane::RGBA));
md.rm()->setLabel(image_filenames_q[i].section('/',1,2));
md.rm()->shot = shots[i];
/*md.rm()->shot.Intrinsics.ViewportPx[0]=md.rm()->currentPlane->image.width();
md.rm()->shot.Intrinsics.ViewportPx[1]=md.rm()->currentPlane->image.height();
md.rm()->shot.Intrinsics.CenterPx[0]=(int)((double)md.rm()->shot.Intrinsics.ViewportPx[0]/2.0f);
md.rm()->shot.Intrinsics.CenterPx[1]=(int)((double)md.rm()->shot.Intrinsics.ViewportPx[1]/2.0f);*/
}
QDir::setCurrent(curr_path);
return true;
}
示例2: MeshDocumentFromBundler
bool MeshDocumentFromBundler(MeshDocument &md, QString filename_out,QString image_list_filename, QString model_filename)
{
md.addNewMesh(model_filename,QString("model"));
std::vector<Shotm> shots;
const QString path = QFileInfo(filename_out).absolutePath();
const QString path_im = QFileInfo(image_list_filename).absolutePath()+QString("/");
std::vector<std::string> image_filenames;
vcg::tri::io::ImporterOUT<CMeshO>::Open(md.mm()->cm,shots,image_filenames, qUtf8Printable(filename_out), qUtf8Printable(image_list_filename));
md.mm()->updateDataMask(MeshModel::MM_VERTCOLOR);
QString curr_path = QDir::currentPath();
QFileInfo imi(image_list_filename);
//
QStringList image_filenames_q;
for(unsigned int i = 0; i < image_filenames.size(); ++i)
{
QImageReader sizeImg(QString::fromStdString(image_filenames[i]));
if(sizeImg.size()==QSize(-1,-1))
image_filenames_q.push_back(path_im+QString::fromStdString(image_filenames[i]));
else
image_filenames_q.push_back(QString::fromStdString(image_filenames[i]));
}
QDir::setCurrent(imi.absoluteDir().absolutePath());
for(size_t i=0 ; i<shots.size() ; i++)
{
md.addNewRaster();
const QString fullpath_image_filename = image_filenames_q[int(i)];
md.rm()->addPlane(new Plane(fullpath_image_filename,Plane::RGBA));
int count=fullpath_image_filename.count('\\');
if (count==0)
{
count=fullpath_image_filename.count('/');
md.rm()->setLabel(fullpath_image_filename.section('/',count,1));
}
else
md.rm()->setLabel(fullpath_image_filename.section('\\',count,1));
md.rm()->shot = shots[i];
}
QDir::setCurrent(curr_path);
return true;
}