[Insight-users] Get the coordinate of source and destination of a QuadEdge

Alexandre GOUAILLARD agouaillard at gmail.com
Wed Sep 16 05:22:18 EDT 2009


Hi david,
Thanks for your interest in Meshes implementations in ITK. SOrry to take so
long to answer, I will be more responsive now.

You can find a little bit more information on QE here:
http://www.itk.org/Wiki/Proposals:New_Mesh_Class

You also have TONS of inspiration in the tests. Here is a short list to
begin with that implements the kind of basic operation you're struggling
with now (bad documentation, my bad), other tests are more advanced:
/Insight/Testing/Code/Review/
itkGeometricalQuadEdgeTest1.cxx
itkQuadEdgeMeshAddFaceTest1.cxx
itkQuadEdgeMeshAddFaceTest2.cxx
itkQuadEdgeMeshBasicLayerTest.cxx
itkQuadEdgeMeshCellInterfaceTest.cxx
itkQuadEdgeMeshCountingCellsTest.cxx
itkQuadEdgeMeshDeleteEdgeTest.cxx
itkQuadEdgeMeshDeletePointAndReorderIDsTest.cxx
itkQuadEdgeMeshFrontIteratorTest.cxx
itkQuadEdgeMeshIteratorTest.cxx
itkQuadEdgeMeshPointTest1.cxx
itkQuadEdgeMeshPolygonCellTest.cxx
itkQuadEdgeMeshTest1.cxx
itkQuadEdgeMeshTest2.cxx
itkQuadEdgeMeshTest3.cxx
itkQuadEdgeTest1.cxx

when you do a Mesh->GetEdge()  without arguments, you get the first edge in
the cell container (well, the first edge in the edge container, as QEMesh
has two cells containers). Some algorithms on surface just need one edge,
any edge and that s why we provide this argument-less flavor of GetEdge().

Send me your code, I ll troubleshot it.

alex.


On Tue, Sep 15, 2009 at 8:09 PM, David Doria
<daviddoria+itk at gmail.com<daviddoria%2Bitk at gmail.com>
> wrote:

> Consider a mesh like this:
> MeshType::PointType p0,....
>     p0[0]= -1.0; p0[1]= -1.0; p0[2]= 0.0; // first  point ( -1, -1, 0 )
> ....
>     mesh->SetPoint( 0, p0 );
> .....
>
> Then I add lines connecting these points. Then I get an edge:
>
>     MeshType::QEPrimal* edge = mesh->GetEdge(); //not sure which edge this
> is getting?
>
> And the indices of the points that make up this edge:
>     MeshType::CoordRepType origin = edge->GetOrigin();
>     MeshType::CoordRepType destination = edge->GetDestination();
>     std::cout << "origin: " << origin << std::endl;
>     std::cout << "Destination: " << destination << std::endl;
>
> 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):
>     MeshType::PointType* p;
>     mesh->GetPoint(origin, p );
>     std::cout << "p: " << p[0] << " " << p[1] << " " << p[2] << std::endl;
>
> The bottom line is: how do I get the coordinate of a point (and potentially
> other attached information) by it's mesh index?
>
> Thanks,
>
> David
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090916/6bcc99d6/attachment.htm>


More information about the Insight-users mailing list