本文整理汇总了C++中Viewer3D::createNewLineList方法的典型用法代码示例。如果您正苦于以下问题:C++ Viewer3D::createNewLineList方法的具体用法?C++ Viewer3D::createNewLineList怎么用?C++ Viewer3D::createNewLineList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Viewer3D
的用法示例。
在下文中一共展示了Viewer3D::createNewLineList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
}
if(vm.count("customColorSDP")) {
std::vector<unsigned int > vectCol = vm["customColorSDP"].as<std::vector<unsigned int> >();
if(vectCol.size()!=4) {
trace.error() << "colors specification should contain R,G,B and Alpha values"<< std::endl;
}
sdpColorR = vectCol[0];
sdpColorG = vectCol[1];
sdpColorB = vectCol[2];
sdpColorA = vectCol[3];
}
QApplication application(argc,argv);
Viewer3D<> viewer;
std::stringstream title;
title << "Simple Mesh Viewer: " << inputFilenameVect[0];
viewer.setWindowTitle(title.str().c_str());
viewer.show();
viewer.myGLLineMinWidth = lineWidth;
viewer.setGLScale(sx, sy, sz);
bool invertNormal= vm.count("invertNormal");
double ballRadius = vm["SDPradius"].as<double>();
trace.info() << "Importing mesh... ";
std::vector<Mesh<DGtal::Z3i::RealPoint> > vectMesh;
for(unsigned int i = 0; i< inputFilenameVect.size(); i++) {
Mesh<DGtal::Z3i::RealPoint> aMesh(!vm.count("customColorMesh"));
aMesh << inputFilenameVect[i];
vectMesh.push_back(aMesh);
}
bool import = vectMesh.size()==inputFilenameVect.size();
if(!import) {
trace.info() << "File import failed. " << std::endl;
return 0;
}
trace.info() << "[done]. "<< std::endl;
if(vm.count("displaySDP")) {
std::string filenameSDP = vm["displaySDP"].as<std::string>();
vector<Z3i::RealPoint> vectPoints;
vectPoints = PointListReader<Z3i::RealPoint>::getPointsFromFile(filenameSDP);
viewer << CustomColors3D(Color(sdpColorR, sdpColorG, sdpColorB, sdpColorA),
Color(sdpColorR, sdpColorG, sdpColorB, sdpColorA));
for(unsigned int i=0; i< vectPoints.size(); i++) {
viewer.addBall(vectPoints.at(i), ballRadius);
}
}
if(invertNormal) {
for(unsigned int i=0; i<vectMesh.size(); i++) {
vectMesh[i].invertVertexFaceOrder();
}
}
viewer << CustomColors3D(Color(meshColorRLine, meshColorGLine, meshColorBLine, meshColorALine),
Color(meshColorR, meshColorG, meshColorB, meshColorA));
for(unsigned int i=0; i<vectMesh.size(); i++) {
viewer << vectMesh[i];
}
if(vm.count("drawVertex")) {
for(unsigned int i=0; i<vectMesh.size(); i++) {
for( Mesh<DGtal::Z3i::RealPoint>::VertexStorage::const_iterator it = vectMesh[i].vertexBegin();
it!=vectMesh[i].vertexEnd(); ++it) {
DGtal::Z3i::Point pt;
pt[0]=(*it)[0];
pt[1]=(*it)[1];
pt[2]=(*it)[2];
viewer << pt;
}
}
}
if (displayVectorField) {
std::vector<unsigned int > vectFieldIndices1 = {vectFieldIndices[0],vectFieldIndices[1], vectFieldIndices[2]};
std::vector<unsigned int > vectFieldIndices2 = {vectFieldIndices[3],vectFieldIndices[4], vectFieldIndices[5]};
std::vector<DGtal::Z3i::RealPoint> vectPt1 = PointListReader<DGtal::Z3i::RealPoint>::getPointsFromFile(vm["displayVectorField"].as<std::string>(), vectFieldIndices1);
std::vector<DGtal::Z3i::RealPoint> vectPt2 = PointListReader<DGtal::Z3i::RealPoint>::getPointsFromFile(vm["displayVectorField"].as<std::string>(), vectFieldIndices2);
viewer.createNewLineList();
for (unsigned int i = 0; i < vectPt1.size(); i++) {
viewer.setLineColor(vFieldLineColor);
viewer.addLine(vectPt1[i], vectPt2[i]);
}
}
viewer << Viewer3D<>::updateDisplay;
return application.exec();
}