[vtkusers] setting polyline every part to different colors.Who can help me?

ye.yuanzhi yeyuzh at 163.com
Mon Jun 4 23:34:25 EDT 2007


hello everyone:
     I want to draw a well of oil. so i want use the polyline to  render it. I want to the every part of the polyline to set different colors
by the data of property. Who can set the different colors.Please help me.Thanks a lot!!
	

======= 2007-06-04 12:00:00 您在来信中写道:=======

>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. vtkPolyData to vtkStructuredGrid (Shriram N)
>   2. Re: vtkusers Digest, Vol 38, Issue 3 (L.J. van Ruijven)
>   3. How to extract all pixel values from a vtkImageData into	a
>      Tcl binary string? (Erin McKay)
>   4. Re: vtk 64bit windows (David Cole)
>   5. internal for repeating primitive cell (Evan Bollig)
>   6. DCMTK question (Luca Pamparana)
>   7. Re: DCMTK question (Luca Pamparana)
>   8. Comparing points (samo)
>
>
>----------------------------------------------------------------------
>
>Message: 1
>Date: Sun, 3 Jun 2007 15:29:00 -0500
>From: "Shriram N" <shriram.uc at gmail.com>
>Subject: [vtkusers] vtkPolyData to vtkStructuredGrid
>To: vtkusers at vtk.org
>Message-ID:
>	<91783a1b0706031329s53e01e2av808174f32f48981b at mail.gmail.com>
>Content-Type: text/plain; charset="iso-8859-1"
>
>Hi all,
>
>I have a bunch of random points in 3D with associated scalar and vector
>values. I have managed to create a vtk polydata
>file from the data. Here's a link to a sample file in case any of you would
>like to have a look.
>http://acm.cs.uic.edu/~shriram/259200.vtk
>
>I am able to draw glyphs and hedgehogs using this dataset. In order to be
>able to draw iso-surfaces and streamlines, I
>understand that we need a structured grid. Is there something in vtk to
>convert polydata to a structured grid? I have looked
>at vtkShepardMethod and vtkInterpolatedVelocityField. Shepard method returns
>vtkImageData (which I can use to draw
>iso surfaces but not streamlines since the vector values are missing) and I
>can't seem to get vtkInterpolatedVelocityField
>to work correctly.
>
>Any help would be greatly appreciated.
>
>Thanks,
>Shriram
>-------------- next part --------------
>An HTML attachment was scrubbed...
>URL: http://public.kitware.com/pipermail/vtkusers/attachments/20070603/8c70b16e/attachment-0001.htm
>
>------------------------------
>
>Message: 2
>Date: Mon, 04 Jun 2007 08:35:09 +0200
>From: "L.J. van Ruijven" <L.J.vanRuijven at amc.uva.nl>
>Subject: [vtkusers] Re: vtkusers Digest, Vol 38, Issue 3
>To: vtkusers at vtk.org
>Cc: dov.mayzlish at philips.com
>Message-ID: <a4f088a5176a.a5176aa4f088 at amc.uva.nl>
>Content-Type: text/plain; charset="us-ascii"
>
>Hi Dov,
>
>I advise you check carefully if there are no conversions from 32 bit 
>values/pointers to 64 bit values/pointers. Almost all problems in the 
>past were related to these conversions.
>For example, in your code the pointer void* hwnd is a 32bit pointer 
>when compiling for 32bit platform, and it is a 64bit pointer when 
>compiling for the 64bit platform. I don't know the function this-
>>Handle.ToPointer)), not what it returns. But if it returns a 32bit 
>value on the 64bit platform, this values is automatically converted to 
>a 64bit value before it is assigned to hwnd. These conversions almost 
>always deliver invalid pointers.
>
>success, Leo
>
>
>> Hi,
>> 
>> I'm a vtk beginner, trying to embed vtk image in my viewport.
>> 
>> My code is something like this:
>> 
>> 
>>        this->renWin = vtkRenderWindow::New();
>>        this->iren = vtkRenderWindowInteractor::New();
>>        this->ren = vtkRenderer::New();
>> ...
>> 
>> 
>>        this->renWin->AddRenderer(this->ren);
>> 
>>        // setup the parent window
>>        void* hwnd = (this->Handle.ToPointer());   // (the class 
>> is a .NET 
>> UserControl)
>>        this->renWin->SetParentId(hwnd);
>>        this->iren->SetRenderWindow(this->renWin); 
>> 
>> 
>>        // initialize
>>        this->iren->Initialize();
>>        this->ren->ResetCamera();
>> 
>> 
>> When working 32bit, this works perfect.
>> 
>> When working 64bit, an empty black window is created, named 
>> "Form1" 
>> (instead of the name I gave it).
>> 
>> When I comment out the lines (64bit)
>>        //void* hwnd = (this->Handle.ToPointer());
>>        //this->renWin->SetParentId(hwnd);
>> a new window with the correct name appears with the correct actor, 
>> but the 
>> "Form1" window appears as well.
>> Since I plan to embed the viewport in a large application, I need 
>> the 
>> image to be in my existing viewport.
>> 
>> Does anyone have a suggestion what could make only the 64bit build 
>> to fail 
>> to embed the image in my viewport?
>> 
>> Thanks,
>> Dov
>
>-------------- next part --------------
>A non-text attachment was scrubbed...
>Name: ljvanruijven.vcf
>Type: text/x-vcard
>Size: 262 bytes
>Desc: Card for "L.J. van Ruijven" <L.J.vanRuijven at amc.uva.nl>
>Url : http://public.kitware.com/pipermail/vtkusers/attachments/20070604/7e1a6883/ljvanruijven-0001.vcf
>
>------------------------------
>
>Message: 3
>Date: Mon, 4 Jun 2007 22:12:36 +1000
>From: Erin McKay <intrigue at ozemail.com.au>
>Subject: [vtkusers] How to extract all pixel values from a
>	vtkImageData into	a Tcl binary string?
>To: vtkusers at vtk.org
>Message-ID: <6ec56d562e52b23faf3a9c576dce51c3 at ozemail.com.au>
>Content-Type: text/plain; charset=US-ASCII; format=flowed
>
>Answering my own question, for future reference...
>
>One way is to add code like the following to the Tcl wrapper code 
>generated during the build process. Each of the concrete vtkDataArray 
>subclasses may be extended in this way. The SetValuesBinary command 
>takes a Tcl binary string and inserts it into an existing, allocated 
>array at a nominated offset. Parameters are offset and count (in the 
>array's native units) and the string. The GetValuesBinary command 
>returns a binary string containing a nominated number of values, from a 
>nominated offset in the array. Parameters are offset and count.
>
>   if ((!strcmp("SetValuesBinary",argv[1]))&&(argc == 5))
>     {
>     char *temp0;
>     long temp1;
>     long temp2;
>     error = 0;
>
>     if (Tcl_GetInt(interp,argv[2],&tempi) != TCL_OK) error = 1;
>     temp1 = tempi;
>     if (Tcl_GetInt(interp,argv[3],&tempi) != TCL_OK) error = 1;
>     temp2 = tempi;
>     temp0 = argv[4];
>     if (!error)
>       {
>       double *pix = op->WritePointer(temp1,temp2);
>       long len = sizeof(double) * temp2;
>       memcpy((char*)pix,temp0,len);
>       Tcl_ResetResult(interp);
>       }
>       return TCL_OK;
>     }
>
>   if ((!strcmp("GetValuesBinary",argv[1]))&&(argc == 4))
>     {
>     error = 0;
>
>     long temp1;
>     long temp2;
>     error = 0;
>
>     if (Tcl_GetInt(interp,argv[2],&tempi) != TCL_OK) error = 1;
>     temp1 = tempi;
>     if (Tcl_GetInt(interp,argv[3],&tempi) != TCL_OK) error = 1;
>     temp2 = tempi;
>     if (!error)
>       {
>       double *pix = op->WritePointer(temp1,temp2);
>       long len = sizeof(double) * temp2;
>       Tcl_Obj *obj = Tcl_NewStringObj((char*)pix,len);
>       Tcl_SetObjResult(interp, obj);
>       }
>     else
>       {
>       Tcl_ResetResult(interp);
>       }
>     return TCL_OK;
>     }
>
>
>
>Erin McKay
>Lead Programmer & Tea Boy
>Computerhead
>
>
>------------------------------
>
>Message: 4
>Date: Mon, 4 Jun 2007 09:38:41 -0400
>From: "David Cole" <david.cole at kitware.com>
>Subject: Re: [vtkusers] vtk 64bit windows
>To: "Dov Mayzlish" <dov.mayzlish at philips.com>
>Cc: vtkusers at vtk.org
>Message-ID:
>	<f435c2c50706040638y15710dc8k11f69f26314a5fdd at mail.gmail.com>
>Content-Type: text/plain; charset="iso-8859-1"
>
>What version of VTK are you using?
>
>You have built both 32 and 64-bit builds of VTK?
>
>For 64-bit usage on Windows, definitely use VTK from CVS. There were several
>important fixes committed to CVS VTK that make 64-bit builds usable on
>Windows.
>
>HTH,
>David
>
>On 6/3/07, Dov Mayzlish <dov.mayzlish at philips.com> wrote:
>>
>>
>> Hi,
>>
>> I'm a vtk beginner, trying to embed vtk image in my viewport.
>>
>> My code is something like this:
>>
>>
>>         this->renWin = vtkRenderWindow::New();
>>         this->iren = vtkRenderWindowInteractor::New();
>>         this->ren = vtkRenderer::New();
>> ...
>>
>>
>>         this->renWin->AddRenderer(this->ren);
>>
>>         // setup the parent window
>>         void* hwnd = (this->Handle.ToPointer());   // (the class is a .NET
>> UserControl)
>>         this->renWin->SetParentId(hwnd);
>>         this->iren->SetRenderWindow(this->renWin);
>>
>>
>>         // initialize
>>         this->iren->Initialize();
>>         this->ren->ResetCamera();
>>
>>
>> When working 32bit, this works perfect.
>>
>> When working 64bit, an empty black window is created, named "Form1"
>> (instead of the name I gave it).
>>
>> When I comment out the lines (64bit)
>>         //void* hwnd = (this->Handle.ToPointer());
>>         //this->renWin->SetParentId(hwnd);
>> a new window with the correct name appears with the correct actor, but the
>> "Form1" window appears as well.
>> Since I plan to embed the viewport in a large application, I need the
>> image to be in my existing viewport.
>>
>> Does anyone have a suggestion what could make only the 64bit build to fail
>> to embed the image in my viewport?
>>
>> Thanks,
>> Dov
>>
>> _______________________________________________
>> This is the private VTK discussion list.
>> Please keep messages on-topic. Check the FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>>
>-------------- next part --------------
>An HTML attachment was scrubbed...
>URL: http://public.kitware.com/pipermail/vtkusers/attachments/20070604/cb4827d6/attachment-0001.htm
>
>------------------------------
>
>Message: 5
>Date: Mon, 4 Jun 2007 11:05:07 -0400
>From: "Evan Bollig" <bollig at scs.fsu.edu>
>Subject: [vtkusers] internal for repeating primitive cell
>To: vtkusers at vtk.org
>Message-ID:
>	<1e93c9c0706040805y666d00aai7cb1f07813ec1d4 at mail.gmail.com>
>Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
>Hey all, I have gaussian cube data which describes primitive vectors
>and coordinates for atomic crystals. I have everything setup to
>visualize the primitive cell which in this case contains two atoms,
>but I would like to repeat it along the primitive vectors to see the
>cell as part of a larger structure (i.e. a diamond crystal). Does
>anyone know how I would  do this in VTK 5.0? Are there any filters
>capable of repeating the data along vectors?s
>
>thanks for your help,
>
>-Evan
>-- 
>bollig at scs.fsu.edu
>
>
>------------------------------
>
>Message: 6
>Date: Mon, 4 Jun 2007 16:38:01 +0100
>From: "Luca Pamparana" <luca.pamparana at gmail.com>
>Subject: [vtkusers] DCMTK question
>To: vtkusers <vtkusers at vtk.org>
>Message-ID:
>	<94ca0b990706040838h1d47e6bbna74b2b59e08aae17 at mail.gmail.com>
>Content-Type: text/plain; charset="iso-8859-1"
>
>Hello,
>
>I know this is not the best forum for this and I apologize for positing
>here. However, since many people here have experience with DCMTK, I was
>wondering if someone could help me.
>
>I am trying to read the DCM_ImageOrientationPatient tag (0020, 0037).
>
>I have the following code which should get the pointer to the value arrays:
>
>
>const Float32 * data = 0;
>retval = m_dcmFileFormat->getDataset()->findAndGetFloat32Array(
>                DCM_ImageOrientationPatient, data).good();
>
>m_dcmFileFormat = DcmFileFormat object pointer.
>
>I have tried it with float and double array types but the method always
>returns false.
>
>If someone can help me find what I am doing wrong, I will be much grateful.
>
>Thank you,
>
>Luca
>-------------- next part --------------
>An HTML attachment was scrubbed...
>URL: http://public.kitware.com/pipermail/vtkusers/attachments/20070604/c708bc49/attachment-0001.html
>
>------------------------------
>
>Message: 7
>Date: Mon, 4 Jun 2007 16:56:42 +0100
>From: "Luca Pamparana" <luca.pamparana at gmail.com>
>Subject: [vtkusers] Re: DCMTK question
>To: vtkusers <vtkusers at vtk.org>
>Message-ID:
>	<94ca0b990706040856w66bfb80bx38b8a1c1b5df7e5 at mail.gmail.com>
>Content-Type: text/plain; charset="iso-8859-1"
>
>Hi everyone,
>
>This tag cannot be read as an array. I did not know that each value had to
>be read in seperately. It is sorted now.
>
>Float64 rowxCos = 0.0;
>m_dcmFileFormat->getDataset()->findAndGetFloat64(
>
>>                 DCM_ImageOrientationPatient, rowxCos);
>
>
>Float64 rowyCos = 0.0;
>m_dcmFileFormat->getDataset()->findAndGetFloat64(
>
>>                 DCM_ImageOrientationPatient, rowyCos);
>
>
>and so on...
>
>Thanks,
>Luca
>
>
>
>
>So, I had to do..
>
>On 6/4/07, Luca Pamparana <luca.pamparana at gmail.com> wrote:
>>
>> Hello,
>>
>> I know this is not the best forum for this and I apologize for positing
>> here. However, since many people here have experience with DCMTK, I was
>> wondering if someone could help me.
>>
>> I am trying to read the DCM_ImageOrientationPatient tag (0020, 0037).
>>
>> I have the following code which should get the pointer to the value
>> arrays:
>>
>>
>> const Float32 * data = 0;
>> retval = m_dcmFileFormat->getDataset()->findAndGetFloat32Array(
>>                 DCM_ImageOrientationPatient, data).good();
>>
>> m_dcmFileFormat = DcmFileFormat object pointer.
>>
>> I have tried it with float and double array types but the method always
>> returns false.
>>
>> If someone can help me find what I am doing wrong, I will be much
>> grateful.
>>
>> Thank you,
>>
>> Luca
>>
>-------------- next part --------------
>An HTML attachment was scrubbed...
>URL: http://public.kitware.com/pipermail/vtkusers/attachments/20070604/4b23811d/attachment-0001.htm
>
>------------------------------
>
>Message: 8
>Date: Mon, 4 Jun 2007 08:58:52 -0700 (PDT)
>From: samo <sandra.moritz at gmx.de>
>Subject: [vtkusers] Comparing points
>To: vtkusers at vtk.org
>Message-ID: <10952422.post at talk.nabble.com>
>Content-Type: text/plain; charset=us-ascii
>
>
>
>Hi people
>
>I would like to know whether there is a method or something already
>implemented in vtk to easily compare two vtkPoints arrays and only get the
>nearest neighbor for each point out from the other point array. 
>
>Thank you for your help!
>
>-- 
>View this message in context: http://www.nabble.com/Comparing-points-tf3866059.html#a10952422
>Sent from the VTK - Users mailing list archive at Nabble.com.
>
>
>
>------------------------------
>
>_______________________________________________
>vtkusers mailing list
>vtkusers at vtk.org
>http://www.vtk.org/mailman/listinfo/vtkusers
>
>
>End of vtkusers Digest, Vol 38, Issue 4
>***************************************
>

= = = = = = = = = = = = = = = = = = = =
			

        致
礼!
 
				 
        ye.yuanzhi
        yeyuzh at 163.com
          2007-06-05



More information about the vtkusers mailing list