[Insight-users] Get the coordinate of source and destination of a QuadEdge
Bill Lorensen
bill.lorensen at gmail.com
Wed Sep 16 10:36:05 EDT 2009
Tests do not typically make good examples. Their intent is to
validate, regression test and cover code. However, tests are a source
of good information. As you pointed out, tests are not as well
commented as examples.
Bill
On Wed, Sep 16, 2009 at 9:07 AM, David Doria <daviddoria+itk at gmail.com> wrote:
>
> On Wed, Sep 16, 2009 at 5:22 AM, Alexandre GOUAILLARD
> <agouaillard at gmail.com> wrote:
>>
>> 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.
>
> Alex,
>
> Ah, I always forget to look in testing. Typically the lack of comments in
> testing makes it quite daunting to look through. We should certainly add
> some comments to some of those tests and throw them in the Examples
> directory (where I'd imagine many people look).
>
> From the itkSoftwareGuide, I thought I should be adding edges like this:
> typedef MeshType::CellType::CellAutoPointer CellAutoPointer;
> typedef itk::LineCell< MeshType::CellType > LineType;
>
> CellAutoPointer colline;
> colline.TakeOwnership( new LineType );
>
> //create an edge between points 2 and 3
> unsigned int pointId0 = 2;
> unsigned int pointId1 = 3;
> colline->SetPointId(0, pointId0); // line between points 0 and 1
> colline->SetPointId(1, pointId1);
>
> mesh->SetCell( 0, colline );
>
>
> but turns out all you need to do is this:
> unsigned int pointId0 = 2;
> unsigned int pointId1 = 3;
> mesh->AddEdge(pointId0, pointId1);
>
> Also, my problem with getting the origin coordinate was a silly thing.
>
> I was never creating an instance of a Point to store the result in:
> MeshType::PointType* p;
> mesh->GetPoint(origin, p);
>
> I changed it to
> MeshType::PointType p;
> mesh->GetPoint(origin, &p);
>
> and it worked fine. I suppose what I was attempting to do was:
>
> MeshType::PointType::Pointer p = MeshType::PointType::New() ;
>
> but I get "Pointer is not a member of QuadEdgeMeshPoint.
>
> I also tried this
> MeshType::PointType* p = MeshType::PointType::New() ;
>
> but get "New() is not a member of QuadEdgeMeshPoint.
>
> Is it by design that you can't use these two things?
>
> 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
>
>
More information about the Insight-users
mailing list