Consider a mesh like this:<br>MeshType::PointType p0,....<br> p0[0]= -1.0; p0[1]= -1.0; p0[2]= 0.0; // first point ( -1, -1, 0 )<br>....<br> mesh->SetPoint( 0, p0 );<br>.....<br><br>Then I add lines connecting these points. Then I get an edge:<br>
<br> MeshType::QEPrimal* edge = mesh->GetEdge(); //not sure which edge this is getting?<br> <br>And the indices of the points that make up this edge:<br> MeshType::CoordRepType origin = edge->GetOrigin();<br>
MeshType::CoordRepType destination = edge->GetDestination();<br> std::cout << "origin: " << origin << std::endl;<br> std::cout << "Destination: " << destination << std::endl;<br>
<br>Now I want to get back my original coordinate (-1, -1, 0). This compiles, but segfaults (the output of origin and destination was 3, 2, respectively, so these are valid point indices on the mesh):<br> MeshType::PointType* p;<br>
mesh->GetPoint(origin, p );<br> std::cout << "p: " << p[0] << " " << p[1] << " " << p[2] << std::endl;<br><br>The bottom line is: how do I get the coordinate of a point (and potentially other attached information) by it's mesh index?<br>
<br clear="all">Thanks,<br><br>David<br>