[vtkusers] vtkusers Digest, Vol 60, Issue 12

Thiago Franco Moraes tfmoraes at cti.gov.br
Sun Apr 12 11:06:32 EDT 2009


fd

On Sat, Apr 11, 2009 at 1:00 PM,  <vtkusers-request at vtk.org> wrote:
> Send vtkusers mailing list submissions to
>        vtkusers at vtk.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>        http://www.vtk.org/mailman/listinfo/vtkusers
> or, via email, send a message with subject or body 'help' to
>        vtkusers-request at vtk.org
>
> You can reach the person managing the list at
>        vtkusers-owner at vtk.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of vtkusers digest..."
>
>
> Today's Topics:
>
>   1. How to use vtk Widgets in C# (kigihanko)
>   2. How to use vtk Widgets in C# (kigihanko)
>   3. Re: ??:Re:  How to use vtk Widgets in C# (Elvis Dowson)
>   4. Re: How to use vtk Widgets in C# (Elvis Dowson)
>   5. Adding cell to polydata with existing cells - error in    cell
>      association of points (maybe a problem of python wrapper  or
>      generall) (Charles Monty Burns)
>   6. Re: _How_to_use_vtk_Widgets_in_C# (Elvis Dowson)
>   7. Specifying VTK Path in CMakeLists.txt (David Doria)
>   8. Re: Specifying VTK Path in CMakeLists.txt (David Doria)
>   9. Re: Specifying VTK Path in CMakeLists.txt (John Drescher)
>  10. Re: Specifying VTK Path in CMakeLists.txt (David Doria)
>  11. Re: Specifying VTK Path in CMakeLists.txt (John Drescher)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sat, 11 Apr 2009 15:36:23 +0800
> From: "kigihanko" <kigihanko at sina.com>
> Subject: [vtkusers] How to use vtk Widgets in C#
> To: vtkusers<vtkusers at vtk.org>
> Message-ID: <20090411073623.AE54A153416 at mail3-79.sinamail.sina.com.cn>
> Content-Type: text/plain; charset="gbk"
>
> Hi folks,
> I've developed a software using C# 3.5 and vtk 5.1. By now I 've succeeded to display the 3D model,however,I still have some works to do,which include:
>
> 1.the measure of the length and angle :for examplt,pick two points in the model,and calculate the distance between them
> 2.draw the split plane,and divide the model by the plane
> 3.label
> 4.calculation of area and volume
>
> I've read some codes about this,most of vtk users use vtkImagePlaneWidget to make split plane I 've mentioned above.However,the codes
> have used callback functions,which couldn't be found in C#.
> Dear guys,do you have any suggestions about the 4 problems I've encountered?If you know ,could you pls show your kindly idea?Thx very much!
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090411/dfd14fe7/attachment-0001.htm>
>
> ------------------------------
>
> Message: 2
> Date: Sat, 11 Apr 2009 15:35:27 +0800
> From: "kigihanko" <kigihanko at sina.com>
> Subject: [vtkusers] How to use vtk Widgets in C#
> To: vtkusers at vtk.org
> Message-ID: <20090411073528.05757153418 at mail3-79.sinamail.sina.com.cn>
> Content-Type: text/plain; charset="gbk"
>
> &nbsp;Hi folks,
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I've developed a software using C# 3.5 and vtk 5.1. By now I 've succeeded to display the 3D model,however,I still have some works to do,which&nbsp;include:
> &nbsp;
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1.the measure of the length and angle :for examplt,pick two points in the model,and calculate the distance between them
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2.draw the split plane,and divide the model by the plane
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3.label
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4.calculation of area and volume
> &nbsp;
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I've read some codes about this,most of vtk users use vtkImagePlaneWidget to&nbsp;make split plane&nbsp;I 've mentioned above.However,the codes
> have used callback functions,which couldn't be found in C#.
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dear guys,do you have any suggestions about the 4 problems I've encountered?If you know ,could you pls show your kindly idea?Thx very much!
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090411/7e34fd80/attachment-0001.htm>
>
> ------------------------------
>
> Message: 3
> Date: Sat, 11 Apr 2009 12:35:35 +0400
> From: Elvis Dowson <elvis.dowson at mac.com>
> Subject: Re: [vtkusers] ??:Re:  How to use vtk Widgets in C#
> To: kigihanko <kigihanko at sina.com>
> Cc: VTK Users <vtkusers at vtk.org>
> Message-ID: <F3A18914-1E05-4B4E-94A4-FA7088D538EC at mac.com>
> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
>
> You should be able to translate the tcl example I gave you into C#.
>
> I myself use tcl just for quick prototyping, but then implement the
> actual application using C++. Haven't used C# much because of the
> managed code part, and the difficulties involved with getting the CLR
> to connect to C++ code. (Tried this 5 years ago, but don't know if
> things have become simpler since then to integrate C# and C++ code).
>
>
>
> On Apr 11, 2009, at 12:04 PM, kigihanko wrote:
>
>> Thx,Elvis.I found that widgets examples developed by C# are quite
>> difficult to find
>
>
>
> ------------------------------
>
> Message: 4
> Date: Sat, 11 Apr 2009 11:54:58 +0400
> From: Elvis Dowson <elvis.dowson at mac.com>
> Subject: Re: [vtkusers] How to use vtk Widgets in C#
> To: kigihanko <kigihanko at sina.com>
> Cc: vtkusers <vtkusers at vtk.org>
> Message-ID: <A4982518-DFA5-4A1D-8B24-C2B87F58C332 at mac.com>
> Content-Type: text/plain; charset="us-ascii"; Format="flowed"
>
> Hi,
>        Try to use the vtkDistanceMeasurement2D and AngleMeasurement widgets.
>
> Here is an example tcl code that you can reuse to measure the length.
>
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: TriangleWithDistanceMeasurement.tcl
> Type: application/octet-stream
> Size: 4025 bytes
> Desc: not available
> URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090411/b689e21a/attachment-0001.obj>
> -------------- next part --------------
>
>
>
> Use the mouse to click on one point and then move it to another point
> and click once again, to display the length.
>
> Best regards,
>
> Elvis
>
> On Apr 11, 2009, at 11:36 AM, kigihanko wrote:
>
>> 1.the measure of the length and angle :for examplt,pick two points
>> in the model,and calculate the distance between them
>
> ------------------------------
>
> Message: 5
> Date: Sat, 11 Apr 2009 14:26:31 +0200
> From: Charles Monty Burns <ch.monty.burns at googlemail.com>
> Subject: [vtkusers] Adding cell to polydata with existing cells -
>        error in        cell association of points (maybe a problem of python wrapper
>        or generall)
> To: vtkusers at vtk.org
> Message-ID:
>        <b43d2fa50904110526k2254dcafu1399d0b4ef0f9a0e at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hello,
>
> I have a problem of insert new cells in a polydata-mesh that have allready
> cells
> in it. Look at my example an the comments between the lines:
>
> # loading 41059 triangle cells's
> reader = vtk.vtkXMLPolyDataReader()
> reader.SetFileName("opt_mesh.vtp")
> reader.Update()
> mesh = reader.GetOutput()
> mesh.BuildLinks(0)
>
> # removing some cells
> mesh.RemoveCellReference(24285)
> mesh.DeleteCell(24285)
>
> mesh.RemoveCellReference(3526)
> mesh.DeleteCell(3526)
>
> # points used for a new cell
> points = [3205L, 2950L, 3070L]
>
> # adding them to vtkIdList
> pt_list = vtk.vtkIdList()
> map(pt_list.InsertNextId, points)
>
> # adding cell to polydata
> new_cell_index = mesh.InsertNextCell(vtk.VTK_TRIANGLE, pt_list)
>
> # resize point-links-size
> cell_list = vtk.vtkIdList()
>
> for pt in points:
>    mesh.GetPointCells(pt, cell_list)
>    mesh.ResizeCellList(pt, cell_list.GetNumberOfIds() + 1)
>
> # add point to cell links by ones
> mesh.AddCellReference(new_cell_nbr)
>
> # test whether I can get the right point-ids of the new cell
> pt_list = vtk.vtkIdList()
> mesh.GetCellPoints(new_cell_index, pt_list)
> cell_points = map(pt_list.GetId, xrange(pt_list.GetNumberOfIds()))
>
> print points == cell_points # !!!!!!!!!!!!!! this will evalute as false
>
> print cell_points # !!!!!!!!!!!!!!! >>> [0L, 1L, 2L]
>
> The last line shows, that vtk don't associate the right point ids with the
> cell-nbr, but new_cell_index has the value 41060! When I use Allocate(1, 1)
> before
> I insert the cell vtk gets the right cell-points, but get the points of
> other cells
> in the mesh will cause a Segmentation fault. This will happen also if I
> allocate via
> Allocate(mesh.GetNumberOfCells() + 1, 1) (don't really know what the
> arguments
> are for ... !?)
>
> What is the solution of that issue?
>
> I'm using VTK 5.2.
>
> Greetings and a nice eastern.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090411/d1f59dae/attachment-0001.htm>
>
> ------------------------------
>
> Message: 6
> Date: Sat, 11 Apr 2009 17:10:15 +0400
> From: Elvis Dowson <elvis.dowson at mac.com>
> Subject: Re: [vtkusers] _How_to_use_vtk_Widgets_in_C#
> To: kigihanko <kigihanko at sina.com>, VTK Users <vtkusers at vtk.org>
> Message-ID: <093156FC-F184-4865-8005-E6129406F5E4 at mac.com>
> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
>
> Hi,
>            VTK uses a process to automatically generate the wrapping
> for other libraries, internally it is all C++ code, but then it
> generates the wrappers for all the other languages automatically.
> Perhaps if you can dig through the sources and find in which file the
> list of vtk classes that are to be included for wrapping, you might be
> able to get away with doing a reconfigure and rebuilding the vtk
> libraries.
>
> Perhaps if someone could help by telling us which files to modify, to
> include the vtkAngleWidget and vtkDistanceWidget classes in the .net
> wrapper?
>
> Best regards,
>
> Elvis
>
>
> On Apr 11, 2009, at 4:28 PM, kigihanko wrote:
>
>> Thank you for your advice,Elvis.
>>
>> About the 4 problems I have asked ,I 've got answers to some of them.
>>
>> As I see it,
>>
>> vtkImplicitPlaneWidget,vtkAngleWidget,vtkDistanceWidget could solve
>> my problem.
>>
>> However,vtkAngleWidget and vtkDistanceWidget haven't been included
>> in vtk .net wrapper.
>>
>> That's to say ,I can't use them unless I switch to C++ or tcl.What'
>> worse,althought I could use vtkImplicitPlaneWidget,the control of
>> the left Mouse button is seized ,that makes it impossible to rotate
>> the 3D model.  :(
>>
>>
>
>
> ------------------------------
>
> Message: 7
> Date: Sat, 11 Apr 2009 09:53:19 -0400
> From: David Doria <daviddoria at gmail.com>
> Subject: [vtkusers] Specifying VTK Path in CMakeLists.txt
> To: vtk <vtkusers at vtk.org>
> Message-ID:
>        <c19fcadc0904110653r58a9d40ax376e3ad42698f3c4 at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> If I use this:
> ---------------------------
> FIND_PACKAGE(VTK REQUIRED)
> INCLUDE(${VTK_USE_FILE})
> ---------------------------
>
> CMake prompts me to enter the path to VTK and then everything works
> properly. I thought I could specify the path in the CMakeLists.txt file like
> this:
>
> ---------------------------
> SET( VTK_DIR /home/doriad/bin/ParaView3/VTK )
> INCLUDE(${VTK_DIR}/UseVTK.cmake)
> ---------------------------
>
> But I get the error:
>
> ---------------------------
>  CMake Error at /home/doriad/bin/ParaView3/VTK/UseVTK.cmake:30 (INCLUDE):
>   include could not find load file:
>
>     /vtkMakeInstantiator.cmake
>  Call Stack (most recent call first):
>   CMakeLists.txt:24 (INCLUDE)
> ---------------------------
>
> /home/doriad/bin/ParaView3/VTK is the same path I tell cmake in the first
> version.
>
> Can anyone see what I've done wrong?
>
> Thanks,
>
> David
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090411/569ce809/attachment-0001.htm>
>
> ------------------------------
>
> Message: 8
> Date: Sat, 11 Apr 2009 10:12:20 -0400
> From: David Doria <daviddoria at gmail.com>
> Subject: Re: [vtkusers] Specifying VTK Path in CMakeLists.txt
> Cc: VTK <vtkusers at vtk.org>
> Message-ID:
>        <c19fcadc0904110712v6dd9a27cra515aeeba0ab3e98 at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Ok, I set VTK_DIR in my environment:
>
> [doriad at davedesktop LandmarkTransform]$ echo $VTK_DIR
> /home/doriad/bin/ParaView3/VTK
>
> and then just used this in CMakeLists.txt
> INCLUDE(${VTK_DIR}/UseVTK.cmake)
>
> and it still gives me the same
>
> ------------
>  CMake Error at CMakeLists.txt:43 (INCLUDE):
>   include could not find load file:
>
>     /UseVTK.cmake
> ------------
>
> Thanks,
>
> David
>
>
> On Sat, Apr 11, 2009 at 10:07 AM, John Drescher <drescherjm at gmail.com>wrote:
>
>> On Sat, Apr 11, 2009 at 9:53 AM, David Doria <daviddoria at gmail.com> wrote:
>> > If I use this:
>> > ---------------------------
>> > FIND_PACKAGE(VTK REQUIRED)
>> > INCLUDE(${VTK_USE_FILE})
>> > ---------------------------
>> >
>> > CMake prompts me to enter the path to VTK and then everything works
>> > properly. I thought I could specify the path in the CMakeLists.txt file
>> like
>> > this:
>> >
>>
>> One way to get around the prompt is by setting VTK_DIR in your environment.
>>
>> John
>>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090411/fa792819/attachment-0001.htm>
>
> ------------------------------
>
> Message: 9
> Date: Sat, 11 Apr 2009 10:16:02 -0400
> From: John Drescher <drescherjm at gmail.com>
> Subject: Re: [vtkusers] Specifying VTK Path in CMakeLists.txt
> To: David Doria <daviddoria at gmail.com>
> Cc: VTK <vtkusers at vtk.org>
> Message-ID:
>        <387ee2020904110716p2d31d045qc79fd8d45a199036 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
>> Ok, I set VTK_DIR in my environment:
>>
>> [doriad at davedesktop LandmarkTransform]$ echo $VTK_DIR
>> /home/doriad/bin/ParaView3/VTK
>>
>> and then just used this in CMakeLists.txt
>> INCLUDE(${VTK_DIR}/UseVTK.cmake)
>>
>> and it still gives me the same
>>
>> ------------
>> ?CMake Error at CMakeLists.txt:43 (INCLUDE):
>> ?? include could not find load file:
>>
>> ???? /UseVTK.cmake
>> ------------
>>
>
> You want to get rid of the INCLUDE(${VTK_DIR}/UseVTK.cmake) and put it
> back to the original.
>
> FIND_PACKAGE(VTK REQUIRED)
> INCLUDE(${VTK_USE_FILE})
>
> The finder for VTK will look for VTK_DIR in the environment and use
> that if found.
>
> John
>
>
> ------------------------------
>
> Message: 10
> Date: Sat, 11 Apr 2009 10:19:07 -0400
> From: David Doria <daviddoria at gmail.com>
> Subject: Re: [vtkusers] Specifying VTK Path in CMakeLists.txt
> Cc: VTK <vtkusers at vtk.org>
> Message-ID:
>        <c19fcadc0904110719k474ace88hc6c3df26c92e3f at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Ah, got it. Thanks.
>
> David
>
>
> On Sat, Apr 11, 2009 at 10:16 AM, John Drescher <drescherjm at gmail.com>wrote:
>
>> > Ok, I set VTK_DIR in my environment:
>> >
>> > [doriad at davedesktop LandmarkTransform]$ echo $VTK_DIR
>> > /home/doriad/bin/ParaView3/VTK
>> >
>> > and then just used this in CMakeLists.txt
>> > INCLUDE(${VTK_DIR}/UseVTK.cmake)
>> >
>> > and it still gives me the same
>> >
>> > ------------
>> >  CMake Error at CMakeLists.txt:43 (INCLUDE):
>> >    include could not find load file:
>> >
>> >      /UseVTK.cmake
>> > ------------
>> >
>>
>> You want to get rid of the INCLUDE(${VTK_DIR}/UseVTK.cmake) and put it
>> back to the original.
>>
>> FIND_PACKAGE(VTK REQUIRED)
>> INCLUDE(${VTK_USE_FILE})
>>
>> The finder for VTK will look for VTK_DIR in the environment and use
>> that if found.
>>
>> John
>>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090411/e1f4945b/attachment-0001.htm>
>
> ------------------------------
>
> Message: 11
> Date: Sat, 11 Apr 2009 10:07:36 -0400
> From: John Drescher <drescherjm at gmail.com>
> Subject: Re: [vtkusers] Specifying VTK Path in CMakeLists.txt
> To: David Doria <daviddoria at gmail.com>, VTK <vtkusers at vtk.org>
> Message-ID:
>        <387ee2020904110707j13e24b33te1656305f055bca2 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On Sat, Apr 11, 2009 at 9:53 AM, David Doria <daviddoria at gmail.com> wrote:
>> If I use this:
>> ---------------------------
>> FIND_PACKAGE(VTK REQUIRED)
>> INCLUDE(${VTK_USE_FILE})
>> ---------------------------
>>
>> CMake prompts me to enter the path to VTK and then everything works
>> properly. I thought I could specify the path in the CMakeLists.txt file like
>> this:
>>
>
> One way to get around the prompt is by setting VTK_DIR in your environment.
>
> John
>
>
> ------------------------------
>
> _______________________________________________
> vtkusers mailing list
> vtkusers at vtk.org
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
> End of vtkusers Digest, Vol 60, Issue 12
> ****************************************
>
>



More information about the vtkusers mailing list