本文整理汇总了C++中Topology::addPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ Topology::addPoint方法的具体用法?C++ Topology::addPoint怎么用?C++ Topology::addPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Topology
的用法示例。
在下文中一共展示了Topology::addPoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: openProject
void ProjectManager::openProject(const std::string &path, Topology& topology)
{
ifstream inputFile;
inputFile.open(path);
//TODO: ellenorizni
if(inputFile.fail()){
//ERROR
return;
}
InputState state = PATH_;
string line;
std::istringstream iss;
char c;
int n, i;
unsigned int id, current_id, pointId1, pointId2, pointId3, pointId4, edgeId1, edgeId2, edgeId3, edgeId4;
float posX, posY, posZ, normX, normY, normZ;
//Read model path
getline(inputFile, line);
string modelPath = line;
//Read points
getline(inputFile, line);
iss = istringstream(line);
iss >> c >> n >> current_id;
printf("read points: %d \n", n);
TopologyPoint::current_id = current_id;
for(i = 0; i < n; i++){
getline(inputFile, line);
iss = istringstream(line);
iss >> id >> posX >> posY >> posZ >> normX >> normY >> normZ;
TopologyPoint point(id);
point.setPosition(posX, posY, posZ);
point.setNormal(normX, normY, normZ);
topology.addPoint(point);
}
//Read edges
getline(inputFile, line);
iss = istringstream(line);
iss >> c >> n >> current_id;
printf("read edges: %d \n", n);
TopologyEdge::current_id = current_id;
for(i = 0; i < n; i++){
getline(inputFile, line);
iss = istringstream(line);
iss >> id >> pointId1 >> pointId2;
TopologyEdge edge(id, pointId1, pointId2);
topology.addEdge(edge);
}
//Read triangles
getline(inputFile, line);
iss = istringstream(line);
iss >> c >> n >> current_id;
printf("read triangles: %d \n", n);
TopologyHelperTriangle::current_id = current_id;
for(i = 0; i < n; i++){
getline(inputFile, line);
iss = istringstream(line);
iss >> id >> pointId1 >> pointId2 >> pointId3 >> edgeId1 >> edgeId2 >> edgeId3;
TopologyHelperTriangle triangle(id, pointId1, pointId2, pointId3, edgeId1, edgeId2, edgeId3);
topology.addTriangle(triangle);
}
//Read quads
getline(inputFile, line);
iss = istringstream(line);
iss >> c >> n >> current_id;
printf("read quads: %d \n", n);
TopologyHelperQuad::current_id = current_id;
for(i = 0; i < n; i++){
getline(inputFile, line);
iss = istringstream(line);
iss >> id >> pointId1 >> pointId2 >> pointId3 >> pointId4 >> edgeId1 >> edgeId2 >> edgeId3 >> edgeId4;
TopologyHelperQuad quad(id, pointId1, pointId2, pointId3, pointId4, edgeId1, edgeId2, edgeId3, edgeId4);
topology.addQuad(quad);
}
}