[vtkusers] Re: vtkusers digest, Vol 1 #1843 - 9 msgs

Amit Tikekar amitt at tataelxsi.co.in
Tue May 27 13:23:35 EDT 2003


Hi Carol,

You can startup with the \\vtk\\Examples  directory. There you can find some
samples on how to make use of  VTK classes from MFC.

http://public.kitware.com/VTK/example-code.php
Class Reference & Documentation :
http://www.vtk.org/doc/release/4.0/html/index.html

http://www.barre.nom.fr/vtk/links-examples.html#courses


In addition, the NET is always there..!!
HTH
Amit


----- Original Message ----- 
From: <vtkusers-request at public.kitware.com>
To: <vtkusers at public.kitware.com>
Sent: Tuesday, May 27, 2003 10:32 PM
Subject: vtkusers digest, Vol 1 #1843 - 9 msgs


> Send vtkusers mailing list submissions to
> vtkusers at public.kitware.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://public.kitware.com/mailman/listinfo/vtkusers
> or, via email, send a message with subject or body 'help' to
> vtkusers-request at public.kitware.com
>
> You can reach the person managing the list at
> vtkusers-admin at public.kitware.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of vtkusers digest..."
>
>
> Today's Topics:
>
>    1. Re: GUI for vtk (Sebastien Auclair)
>    2. vtkContourFilter & vtkLocator  question (Subha)
>    3. Beginner (=?gb2312?q?yan=20zhang?=)
>    4. RE: Link errors on Win2000 (Todd Schneider)
>    5. vtkProgrammableSource example written in C++ or Java
(da5y at k2.dion.ne.jp)
>    6. visualizing slice contours via vtkAppendPolyData
(dean.inglis at on.aibn.com)
>    7. Bug or Leak in vtkFeatureEdges ! (Sebastien Auclair)
>    8. Re: Beginner (Jeremy Winston)
>    9. Re: vtkProgrammableSource example written in C++ or Java (Jarek
Sacha)
>
> --__--__--
>
> Message: 1
> From: "Sebastien Auclair" <sxa at fluent.com>
> To: <senet at v2t.de>, <vtkusers at public.kitware.com>
> Subject: Re: [vtkusers] GUI for vtk
> Date: Tue, 27 May 2003 08:45:01 -0400
>
> Christian,
> I can't speak for the other points but about QT i'd say it is a terrific
GUI
> ToolKit.
>
> We develop our CAD application on QT and vtk ( vtkQgl) and everyone is
quite
> pleased with the results.
>
>
>
> ----- Original Message -----
> From: "Christian M. Senet (V2T)" <senet at v2t.de>
> To: <vtkusers at public.kitware.com>
> Sent: Monday, May 26, 2003 1:14 PM
> Subject: [vtkusers] GUI for vtk
>
>
> > I have followed the controversal GUI discussion at the mailing list.
> >
> > There are still the open questions to me:
> > - are there some new/usable developments for wxWindows - vtk?
> > - is there someone using java for GUIing vtk-applications?
> > - can somebody can report his/her experiences with Qt (is it worth to
> spend
> > the money?)?
> >
> > --> summarising all my questions:
> > - whats the most adequate solution for GUIing vtk?
> >
> > Best regards,
> > Chris
> >
> >
> >
> >
> > _______________________________________________
> > This is the private VTK discussion list.
> > Please keep messages on-topic. Check the FAQ at:
> <http://public.kitware.com/cgi-bin/vtkfaq>
> > Follow this link to subscribe/unsubscribe:
> > http://public.kitware.com/mailman/listinfo/vtkusers
>
>
> --__--__--
>
> Message: 2
> From: "Subha" <smahaade at essence.utsi.edu>
> To: vtkusers at public.kitware.com
> Date: Tue, 27 May 2003 08:13:31 -0600
> Subject: [vtkusers] vtkContourFilter & vtkLocator  question
>
> Hi,
> I have a quick question about the vtkContourFilter and vtkLocator classes.
>
> When rendering a Structured points dataset, if the cells in the grid are
not
> contoured in order beginning from the 0th cell to the last cell in the
grid,
> there seems to be a two fold increase in the time taken to contour all the
> cells ( the code in the vtkContourFilter::Execute() has been modified to
> shuffle the order in which the cells are contoured ).
> The parts where the index for getting the correct marching cubes case and
> interpolation seem straight forward. That leaves the part where the
locator
> comes in and later the inserting the polygons created in the vtkPolyData
> object. but here too, the code did not seem to suggest anyhting that might
> depend on the order the cells are processed.
>
> Does anyone have any insights into anything that might be happening
inside/
> outside of the above mentioned classes ?
>
> Thanks in advance for any help.
>
> Regards,
> S.
>
> --__--__--
>
> Message: 3
> Date: Tue, 27 May 2003 22:41:39 +0800 (CST)
> From: =?gb2312?q?yan=20zhang?= <liaozhy99 at yahoo.com.cn>
> To: vtkusers at public.kitware.com
> Subject: [vtkusers] Beginner
>
> --0-1576920176-1054046499=:63456
> Content-Type: text/plain; charset=gb2312
> Content-Transfer-Encoding: 8bit
>
> hello, Everyone
>
> I'm new to VTK. I am plan to use VTK with VC++ 6.0 on Windows 2000
platform.
> Could you recommend some literature, websites or methods to me?
> I try to find some from this mailing list, but there are too many mails, I
don't know how to get the suitable parts. :(
>
> Thank you very much!
> Carol
>
>
>
>
>
> ---------------------------------
> Do You Yahoo!?
>
"Ïà¼û²»ÈçÁÄÌì!²»³öÃÅÒ»ÑùÃæ¶ÔÃ棡ÍøÂçÉãÏñÍ·¶Ô¶ÔÅÉËÍÖÐ~¸Ï¿ìÓÃÄãµÄÑÅ»¢µçÓÊÕʺŲ
ÎÓë°É¡­¡­
> --0-1576920176-1054046499=:63456
> Content-Type: text/html; charset=gb2312
> Content-Transfer-Encoding: 8bit
>
> <DIV>hello, Everyone</DIV>
> <DIV>&nbsp;</DIV>
> <DIV>I'm new to VTK. I&nbsp;am plan&nbsp;to use VTK with VC++ 6.0 on
Windows 2000 platform. </DIV>
> <DIV>Could you recommend some literature, websites or methods to me?</DIV>
> <DIV>I try to find some from this mailing list, but there are too many
mails, I don't know how to get the suitable parts. :(</DIV>
> <DIV>&nbsp;</DIV>
> <DIV>Thank you very much!</DIV>
> <DIV>Carol</DIV>
> <DIV>&nbsp;</DIV>
> <DIV>&nbsp;</DIV><p><br><hr size=1><b>Do You Yahoo!?</b><br>
> <a
href="http://cn.rd.yahoo.com/mail_cn/tag/?http://cn.messenger.yahoo.com/">"Ï
à¼û²»ÈçÁÄÌì!²»³öÃÅÒ»ÑùÃæ¶ÔÃ棡ÍøÂçÉãÏñÍ·¶Ô¶ÔÅÉËÍÖÐ~¸Ï¿ìÓÃÄãµÄÑÅ»¢µçÓÊÕʺŲÎÓ
ë°É¡­¡­</a>
> --0-1576920176-1054046499=:63456--
>
> --__--__--
>
> Message: 4
> From: "Todd Schneider" <tschnei1 at nd.edu>
> To: "'Jon Johansson'" <jon.johansson at ualberta.ca>,
> <vtkusers at public.kitware.com>
> Subject: RE: [vtkusers] Link errors on Win2000
> Date: Tue, 27 May 2003 10:06:43 -0500
>
> Hey everyone, I have this exact same problem, running both VC++ 6.0 and
> VC++ 7- any help would be greatly appreciated.
>
> Todd Schneider
>
> -----Original Message-----
> From: vtkusers-admin at public.kitware.com
> [mailto:vtkusers-admin at public.kitware.com] On Behalf Of Jon Johansson
> Sent: Monday, May 26, 2003 5:55 PM
> To: vtkusers at public.kitware.com
> Subject: [vtkusers] Link errors on Win2000
>
> Hi,
>
> I have the latest prebuilt release of VTK, VTK4.2 dated Apr. 8, 2003
> which I downloaded from http://www.vtk.org/get-software.php#release
> today.
>
> I'm trying to compile the Cone.cxx example from
>    C:\Program Files\vtk42\Examples\Tutorial\Step1\Cxx
> and it seems to compile just fine, but linking fails with
> the errors below.
>
> I have include and library files in
>
>    C:\Program Files\vtk42\include\vtk
>    C:\Program Files\vtk42\lib\vtk
>
> and these are included in my Visual Studio 6 project settings in
> (I think) the correct spots. There doesn't seen to be any other
> libraries for me to point at in the VTK directory structure that
> I have.
>
> If anyone sees my mistake could you let me know?
>
> Thank you,
> Jon.
>
> --------------------Configuration: Cone - Win32
> Debug--------------------
> Compiling...
> Cone.cxx
> Linking...
> Cone.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport)
> public: void __thiscall vtkCamera::Azimuth(double)"
> (__imp_?Azimuth at vtkCamera@@QAEXN at Z)
> Cone.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport)
> public: class vtkCamera * __thiscall vtkRenderer::GetActiveCamera(void)"
> (__imp_?GetActiveCamera at vtkRenderer@@QAEPAVvtkCamera@@XZ)
> Cone.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport)
> public: static class vtkRenderWindow * __cdecl
> vtkRenderWindow::New(void)"
> (__imp_?New at vtkRenderWindow@@SAPAV1 at XZ)
> Cone.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport)
> public: void __thiscall vtkRenderer::AddActor(class vtkProp *)"
> (__imp_?AddActor at vtkRenderer@@QAEXPAVvtkProp@@@Z)
> Cone.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport)
> public: static class vtkRenderer * __cdecl vtkRenderer::New(void)"
> (__imp_?New at vtkRenderer@@SAPAV1 at XZ)
> Cone.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport)
> public: static class vtkActor * __cdecl vtkActor::New(void)"
> (__imp_?New at vtkActor@@SAPAV1 at XZ)
> Cone.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport)
> public: void __thiscall vtkPolyDataMapper::SetInput(class vtkPolyData
> *)"
> (__imp_?SetInput at vtkPolyDataMapper@@QAEXPAVvtkPolyData@@@Z)
> Cone.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport)
> public: class vtkPolyData * __thiscall
> vtkPolyDataSource::GetOutput(void)"
> (__imp_?GetOutput at vtkPolyDataSource@@QAEPAVvtkPolyData@@XZ)
> Cone.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport)
> public: static class vtkPolyDataMapper * __cdecl
> vtkPolyDataMapper::New(void)" (__imp_?New at vtkPolyDataMapper@@SAPAV1 at XZ)
> Cone.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport)
> public: static class vtkConeSource * __cdecl vtkConeSource::New(void)"
> (__imp_?New at vtkConeSource@@SAPAV1 at XZ)
> Debug/Cone.exe : fatal error LNK1120: 10 unresolved externals
> Error executing link.exe.
>
> Cone.exe - 11 error(s), 0 warning(s)
>
>
>
> -- 
> Jon I Johansson             *  Research Computing Support
> jon.johansson at ualberta.ca   *  Computing and Network Services
> Tel.: (780) 492-9304        *  University of Alberta
> Fax.: (780) 492-1729        *  Edmonton, Alberta, CANADA
>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
>
> --__--__--
>
> Message: 5
> Date: Wed, 28 May 2003 00:11:37 +0900
> From: da5y at k2.dion.ne.jp
> To: vtkusers at public.kitware.com
> Subject: [vtkusers] vtkProgrammableSource example written in C++ or Java
>
> Hi all
>
> I've been learning the usage of vtkProgrammableSource.
> But I'm very confused the usage.
>
> Especially, I can't understand the how to set the outputdata.
>
> Dose anybody have an example written in C++ or Java?
>
> Thanks in advance
> -- 
> Yoshihiko
>
>
> --__--__--
>
> Message: 6
> From: <dean.inglis at on.aibn.com>
> To: <vtkusers at public.kitware.com>
> Date: Tue, 27 May 2003 11:43:48 -0400
> Subject: [vtkusers] visualizing slice contours via vtkAppendPolyData
>
> I am attempting to use a vtkAppendPolyData filter be used to stack
contours
> generated by a tracing widget.  For example, in my gui app, the user
traces out a
> contour on an vtkImageActor, then clicks a button to add the contour to
> the vtkAPD filter.  Each contour is stored by slice index as an element of
> an array of allocated vtkPolyData objects:
>
> void __fastcall TMainForm::StoreBtnClick(TObject *Sender)
> {
>   vtkImagePlaneWidget* wptr;
>   switch ( m_currentAxis)
>     {
>     case 0:  wptr = m_planeWidgetX; break;
>     case 1:  wptr = m_planeWidgetY; break;
>     case 2:  wptr = m_planeWidgetZ; break;
>     default: wptr = NULL; break;
>     }
>   if(wptr == NULL) { return; }
>
>   float pos = wptr->GetSlicePosition();
>   int index = wptr->GetSliceIndex();
>
>   vtkPolyData* poly = m_contourPolys[index];
>   m_tracer->GetPolyData(poly);
>   vtkPoints* points = poly->GetPoints();
>
>   if(points != NULL)
>     {
>     float pt[3];
>     for (int i=0;i<points->GetNumberOfPoints();++i)
>       {
>       points->GetPoint(i,pt);
>       pt[m_currentAxis] = pos;
>       points->SetPoint(i,pt);
>       }
>     }
>
>   m_contoursAppend->SetInputByNumber(index,m_contourPolys[i]);
>   m_contoursAppend->Update();
>
>   if(m_contoursActor->GetVisibility() == 0)
>     {
>     m_contoursActor->VisibilityOn();
>     }
>   RenderWindow3D->GetRenderer()->Render();
> }
>
> At startup, the app initializes the vtk objects:
>
> <snip>
>   vtkPoints* points = vtkPoints::New(VTK_FLOAT);
>   points->SetNumberOfPoints(2);
>   int i;
>   for (i = 0; i < 2; i++)
>     {
>     points->SetPoint(i,i,i,i);
>     }
>
>   vtkCellArray *cells = vtkCellArray::New();
>   cells->Allocate(cells->EstimateSize(1,2));
>   vtkIdType pts[2];
>   pts[0] = 0; pts[1] = 1;
>   cells->InsertNextCell(2,pts);
>
>   m_contoursAppend->UserManagedInputsOn();
>   m_contoursAppend->SetNumberOfInputs(100);
>   for (i=0;i<100;i++)
>     {
>     m_contourPolys[i]->SetPoints(points);
>     m_contourPolys[i]->SetLines(cells);
>     m_contoursAppend->SetInputByNumber(i,m_contourPolys[i]);
>     }
>
>   cells->Delete();
>   points->Delete();
>
>   m_contoursMapper->SetInput(m_contoursAppend->GetOutput());
>   m_contoursMapper->SetResolveCoincidentTopologyToPolygonOffset();
>   m_contoursActor->SetMapper(m_contoursMapper);
>   m_contoursActor->VisibilityOff();
> <snip>
>
> The pb is that I cannot visualize more than one contour at a time!!!
> How do I visualize the contours without having to have an actor for each
> polydata contour? Do I have to add all polydata contours AFTER they
> have been created?
>
> Dean
>
>
> --__--__--
>
> Message: 7
> From: "Sebastien Auclair" <sxa at fluent.com>
> To: <vtkusers at public.kitware.com>
> Date: Tue, 27 May 2003 12:15:01 -0400
> Subject: [vtkusers] Bug or Leak in vtkFeatureEdges !
>
> This is a multi-part message in MIME format.
>
> ------=_NextPart_000_0009_01C32449.98F017F0
> Content-Type: text/plain;
> charset="iso-8859-1"
> Content-Transfer-Encoding: 7bit
>
> On vtk 4.0
>
> I modified the win32Cone sample provided with vtk to show this problem we
> have. (See attachment.)
> I simply added a second mapper\actor to display the cone's edges.
> I also added a vtkPolyDataNormal and vtkFeatureEdges filters.
>
> Each time i use an instance of vtkFeatureEdges, 500 K of dynamic memory
are
> consumed !
> If i create 100 actors, even if they are simple, our software's memory
usage
> will increase by 50 MB.
> ...which of course is unacceptable !
>
> So we're using vtk 4.0 (binaries from vtk setup) on Win2K.
>
> Thanks for any help !
>
> ________________________________________________
> Seb
>
> ------=_NextPart_000_0009_01C32449.98F017F0
> Content-Type: application/octet-stream;
> name="Win32Cone.cxx"
> Content-Transfer-Encoding: quoted-printable
> Content-Disposition: attachment;
> filename="Win32Cone.cxx"
>
> //
> // This example is a windows application (instead of a console =
> application)
> // version of Examples/Tutorial/Step1/Cxx/Cone.cxx. It is organized in a =
> more
> // object oriented manner and shows a fairly minimal windows VTK =
> application.
> //
>
>
> // first include the required header files for the vtk classes we are =
> using
> #include "vtkConeSource.h"
> #include "vtkPolyDataMapper.h"
> #include "vtkRenderWindow.h"
> #include "vtkRenderWindowInteractor.h"
> #include <vtkPolyDataNormals.h>
> #include <vtkFeatureEdges.h>
>
> static HANDLE hinst;=20
> long FAR PASCAL WndProc(HWND, UINT, UINT, LONG);
> // define the vtk part as a simple c++ class=20
> class myVTKApp  =20
> {
> public:=20
>   myVTKApp(HWND parent);    =20
>   ~myVTKApp();
> private:
>   vtkRenderWindow *renWin;
>   vtkRenderer *renderer;
>   vtkRenderWindowInteractor *iren;
>   vtkConeSource *cone;
>   vtkPolyDataMapper *coneMapper;
>   vtkActor *coneActor;
>
>
>   vtkPolyDataNormals* normal;
>   vtkFeatureEdges* edges;
>   vtkPolyDataMapper *coneMapper2;
>   vtkActor *coneActor2;
> };
>
>
> int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
>     LPSTR lpszCmdParam, int nCmdShow)=20
> {
>   static char szAppName[] =3D "Win32Cone";
>   HWND        hwnd ;
>   MSG         msg ;
>   WNDCLASS    wndclass ;
>
>   if (!hPrevInstance)
>     {
>     wndclass.style         =3D CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
>     wndclass.lpfnWndProc   =3D WndProc ;
>     wndclass.cbClsExtra    =3D 0 ;
>     wndclass.cbWndExtra    =3D 0 ;
>     wndclass.hInstance     =3D hInstance;
>     wndclass.hIcon         =3D LoadIcon(NULL,IDI_APPLICATION);
>     wndclass.hCursor       =3D LoadCursor (NULL, IDC_ARROW);        =20
>     wndclass.lpszMenuName  =3D NULL;
>     wndclass.hbrBackground =3D (HBRUSH)GetStockObject(BLACK_BRUSH);
>     wndclass.lpszClassName =3D szAppName;
>     RegisterClass (&wndclass);
>     }
>  =20
>   hinst =3D hInstance;
>   hwnd =3D CreateWindow ( szAppName,
>                         "Draw Window",
>                         WS_OVERLAPPEDWINDOW,
>                         CW_USEDEFAULT,
>                         CW_USEDEFAULT,
>                         400,
>                         480,
>                         NULL,
>                         NULL,
>                         hInstance,
>                         NULL);
>   ShowWindow (hwnd, nCmdShow);
>   UpdateWindow (hwnd);
>   while (GetMessage (&msg, NULL, 0, 0))
>     {    =20
>     TranslateMessage (&msg);
>     DispatchMessage (&msg);
>     }
>   return msg.wParam;
> }
>
> long FAR PASCAL WndProc (HWND hwnd, UINT message,                        =
>  =20
>                          UINT wParam, LONG lParam)
> {
>   static HWND ewin;
>   static myVTKApp *theVTKApp;
>
>   switch (message)
>     {
>     case WM_CREATE:
>       {
>       ewin =3D CreateWindow("button","Exit",
>                           WS_CHILD | WS_VISIBLE | SS_CENTER,             =
>      =20
>                           0,400,400,60,=20
>                           hwnd,(HMENU)2,=20
>                           (HINSTANCE)GetWindowLong(hwnd,GWL_HINSTANCE),
>                           NULL);
>       theVTKApp =3D new myVTKApp(hwnd);
>       return 0;
>       }
>      =20
>     case WM_COMMAND:
>       switch (wParam)
>         {
>         case 2:
>           PostQuitMessage (0);
>           if (theVTKApp)
>             {
>             delete theVTKApp;
>             theVTKApp =3D NULL;
>             }
>           break;
>         }
>       return 0;
>      =20
>     case WM_DESTROY:
>       PostQuitMessage (0);
>       if (theVTKApp)
>         {
>         delete theVTKApp;
>         theVTKApp =3D NULL;
>         }
>       return 0;=20
>     }
>   return DefWindowProc (hwnd, message, wParam, lParam);
> }
>
> myVTKApp::myVTKApp(HWND hwnd)=20
> {
> // Similar to Examples/Tutorial/Step1/Cxx/Cone.cxx=20
> // We create the basic parts of a pipeline and connect them
> this->renderer =3D vtkRenderer::New();
> this->renWin =3D vtkRenderWindow::New();
> this->renWin->AddRenderer(this->renderer);
>
> // setup the parent window
> this->renWin->SetParentId(hwnd);
> this->iren =3D vtkRenderWindowInteractor::New();
> this->iren->SetRenderWindow(this->renWin);
>
> this->cone =3D vtkConeSource::New();
> this->cone->SetHeight( 3.0 );
> this->cone->SetRadius( 1.0 );
> this->cone->SetResolution( 10 );
>
>
>
>  =20
>
> normal =3D vtkPolyDataNormals::New();
> normal->SetInput(cone->GetOutput());
> normal->Update();
>
> this->coneMapper =3D vtkPolyDataMapper::New();
> this->coneMapper->SetInput(normal->GetOutput());
> this->coneActor =3D vtkActor::New();
> this->coneActor->SetMapper(this->coneMapper);
>
> this->renderer->AddActor(this->coneActor);
>
>
> edges =3D vtkFeatureEdges::New();
> edges->SetInput(normal->GetOutput());
> edges->SetFeatureAngle (80);
> edges->FeatureEdgesOff  ();
> edges->BoundaryEdgesOn (); =20
> edges->ManifoldEdgesOff ();=20
> edges->NonManifoldEdgesOff (); =20
> edges->ColoringOff ();=20
> edges->Update();
>
>
> this->coneMapper2 =3D vtkPolyDataMapper::New();
> this->coneMapper2->SetInput(edges->GetOutput());
> this->coneActor2 =3D vtkActor::New();
> this->coneActor2->SetMapper(this->coneMapper2);
>
> this->renderer->AddActor(this->coneActor2);
>
>
>
>
>   this->renderer->SetBackground(0.2,0.4,0.3);
>   this->renWin->SetSize(400,400);
>
>   // Finally we start the interactor so that event will be handled
>   this->renWin->Render();
> }
>
> myVTKApp::~myVTKApp()
> {
>     renWin->Delete();
>     renderer->Delete();
>     iren->Delete();
>     cone->Delete();
>     coneMapper->Delete();
>     coneActor->Delete();
> }
>
> ------=_NextPart_000_0009_01C32449.98F017F0--
>
>
> --__--__--
>
> Message: 8
> Date: Tue, 27 May 2003 12:36:52 -0400
> From: Jeremy Winston <winston at cat.rpi.edu>
> Organization: CAT @ RPI
> To: yan zhang <liaozhy99 at yahoo.com.cn>
> Cc: vtkusers at public.kitware.com
> Subject: Re: [vtkusers] Beginner
>
> yan zhang wrote:
> >
> > hello, Everyone
> >
> > I'm new to VTK. I am plan to use VTK with VC++ 6.0 on W2K platform.
> > Could you recommend some literature, websites or methods to me?
> > I try to find some from this mailing list, but there are too many
> > mails, I don't know how to get the suitable parts. :(
>
> Yan,
>     The mailing list archive was the right place to look.
> If you don't know about visualization, then the best place
> to start if you plan to use vtk would be with the textbook:
> http://www.kitware.com/products/vtktextbook.html
>     Otherwise, the Users' Guide is a good place to start
> to learn how to install and use vtk:
> http://www.kitware.com/products/vtkguide.html
>
>     Once you've got it installed and running, the best way
> to learn it is to wade through the many examples in the
> Examples directory.
>
>     For getting specific questions answered, the mailing list
> archive is the first place to look (use the 2nd form at):
> http://www.kitware.com/search.html
>
>     If that fails, then posting to the mailing list is the
> next thing to try.
>
> -Jeremy
>
> --__--__--
>
> Message: 9
> Date: Tue, 27 May 2003 10:01:17 -0700 (PDT)
> From: Jarek Sacha <galicjan at yahoo.com>
> Subject: Re: [vtkusers] vtkProgrammableSource example written in C++ or
Java
> To: da5y at k2.dion.ne.jp, vtkusers at public.kitware.com
>
> --0-437213590-1054054877=:47229
> Content-Type: text/plain; charset=us-ascii
> Content-Id:
> Content-Disposition: inline
>
> Yoshihiko:
>
> Here is an example in Java. vtkProgrammableSource is used to generate
> points on a cylinder. The pipeline is created in setupPipeline() method,
> the first four lines maybe of most interest to you, output is extracted
> from the source, in this case, with GetPolyDataOutput(). Here is the
> definition of the source from the example (see attached file for the
> rest):
>
>     static class MyDataSource extends vtkProgrammableSource {
>         void run() {
>             // Get reference to output data
>             vtkPolyData output = GetPolyDataOutput();
>             // Create data points on a cylinder
>             vtkPoints points = new vtkPoints();
>             for (double z = 10D; z < (double) 100; z += 10) {
>                 for (double t = 0.0D;
>                      t < 6.2831853071795862D;
>                      t += 0.062831853071795868D) {
>                     double x = (double) 25 * Math.sin(t);
>                     double y = (double) 30 * Math.cos(t);
>                     points.InsertNextPoint(x, y, z);
>                 }
>             }
>             // Set output data
>             output.SetPoints(points);
>         }
>     }
>
> Jarek
>
> --- da5y at k2.dion.ne.jp wrote:
> > Hi all
> >
> > I've been learning the usage of vtkProgrammableSource.
> > But I'm very confused the usage.
> >
> > Especially, I can't understand the how to set the outputdata.
> >
> > Dose anybody have an example written in C++ or Java?
> >
> > Thanks in advance
> > -- 
> > Yoshihiko
>
> --0-437213590-1054054877=:47229
> Content-Type: X-unknown/X-unknown; name="ProgrammableSourceTest.java"
> Content-Transfer-Encoding: base64
> Content-Description: ProgrammableSourceTest.java
> Content-Disposition: attachment; filename="ProgrammableSourceTest.java"
>
> CmltcG9ydCB2dGsuKjsKCmltcG9ydCBqYXZheC5zd2luZy4qOwppbXBvcnQg
> amF2YS5hd3QuKjsKaW1wb3J0IGphdmEuYXd0LmV2ZW50LkFjdGlvbkV2ZW50
> OwppbXBvcnQgamF2YS5hd3QuZXZlbnQuQWN0aW9uTGlzdGVuZXI7CmltcG9y
> dCBqYXZhLmF3dC5ldmVudC5XaW5kb3dBZGFwdGVyOwppbXBvcnQgamF2YS5h
> d3QuZXZlbnQuV2luZG93RXZlbnQ7CgoKcHVibGljIGNsYXNzIFByb2dyYW1t
> YWJsZVNvdXJjZVRlc3QgZXh0ZW5kcyBKUGFuZWwgaW1wbGVtZW50cyBBY3Rp
> b25MaXN0ZW5lciB7CgogICAgLyoqCiAgICAgKiB2dGtQcm9ncmFtbWFibGVT
> b3VyY2UgdGhhdCBjcmVhdGVzIHNldCBvZiBwb2ludHMgb24gYSBjeWxpbmRl
> cgogICAgICovCiAgICBzdGF0aWMgY2xhc3MgTXlEYXRhU291cmNlIGV4dGVu
> ZHMgdnRrUHJvZ3JhbW1hYmxlU291cmNlIHsKICAgICAgICB2b2lkIHJ1bigp
> IHsKICAgICAgICAgICAgdnRrUG9seURhdGEgb3V0cHV0ID0gR2V0UG9seURh
> dGFPdXRwdXQoKTsKICAgICAgICAgICAgdnRrUG9pbnRzIHBvaW50cyA9IG5l
> dyB2dGtQb2ludHMoKTsKCiAgICAgICAgICAgIC8vIENyZWF0ZSBkYXRhIHBv
> aW50cyBvbiBhIGN5bGluZGVyCiAgICAgICAgICAgIGZvciAoZG91YmxlIHog
> PSAxMEQ7IHogPCAoZG91YmxlKSAxMDA7IHogKz0gMTApIHsKICAgICAgICAg
> ICAgICAgIGZvciAoZG91YmxlIHQgPSAwLjBEOwogICAgICAgICAgICAgICAg
> ICAgICB0IDwgNi4yODMxODUzMDcxNzk1ODYyRDsKICAgICAgICAgICAgICAg
> ICAgICAgdCArPSAwLjA2MjgzMTg1MzA3MTc5NTg2OEQpIHsKICAgICAgICAg
> ICAgICAgICAgICBkb3VibGUgeCA9IChkb3VibGUpIDI1ICogTWF0aC5zaW4o
> dCk7CiAgICAgICAgICAgICAgICAgICAgZG91YmxlIHkgPSAoZG91YmxlKSAz
> MCAqIE1hdGguY29zKHQpOwogICAgICAgICAgICAgICAgICAgIHBvaW50cy5J
> bnNlcnROZXh0UG9pbnQoeCwgeSwgeik7CiAgICAgICAgICAgICAgICB9CiAg
> ICAgICAgICAgIH0KCiAgICAgICAgICAgIG91dHB1dC5TZXRQb2ludHMocG9p
> bnRzKTsKICAgICAgICB9CiAgICB9CgogICAgc3RhdGljIEpGcmFtZSBmcmFt
> ZSA9IG51bGw7CgogICAgSkJ1dHRvbiBleGl0QnV0dG9uID0gbmV3IEpCdXR0
> b24oIkV4aXQiKTsKICAgIHZ0a1BhbmVsIHJlbldpbiA9IG5ldyB2dGtQYW5l
> bCgpOwoKICAgIHB1YmxpYyBQcm9ncmFtbWFibGVTb3VyY2VUZXN0KCkgewoK
> ICAgICAgICBzZXR1cFBpcGVsaW5lKCk7CgogICAgICAgIGV4aXRCdXR0b24u
> YWRkQWN0aW9uTGlzdGVuZXIodGhpcyk7CgogICAgICAgIHNldExheW91dChu
> ZXcgQm9yZGVyTGF5b3V0KCkpOwogICAgICAgIGFkZChyZW5XaW4sICJDZW50
> ZXIiKTsKICAgICAgICBhZGQoZXhpdEJ1dHRvbiwgIkVhc3QiKTsKICAgIH0K
> CiAgICBwdWJsaWMgdm9pZCBhY3Rpb25QZXJmb3JtZWQoQWN0aW9uRXZlbnQg
> ZSkgewogICAgICAgIGlmIChlLmdldFNvdXJjZSgpLmVxdWFscyhleGl0QnV0
> dG9uKSkgewogICAgICAgICAgICBTeXN0ZW0uZXhpdCgwKTsKICAgICAgICB9
> CiAgICB9CgogICAgcHVibGljIHZvaWQgc2V0dXBQaXBlbGluZSgpIHsKICAg
> ICAgICB2dGtQcm9ncmFtbWFibGVTb3VyY2Ugc291cmNlID0gbmV3IE15RGF0
> YVNvdXJjZSgpOwogICAgICAgIHNvdXJjZS5TZXRFeGVjdXRlTWV0aG9kKHNv
> dXJjZSwgInJ1biIpOwoKICAgICAgICB2dGtTdXJmYWNlUmVjb25zdHJ1Y3Rp
> b25GaWx0ZXIgc3VyZiA9IG5ldyB2dGtTdXJmYWNlUmVjb25zdHJ1Y3Rpb25G
> aWx0ZXIoKTsKICAgICAgICBzdXJmLlNldElucHV0KHNvdXJjZS5HZXRQb2x5
> RGF0YU91dHB1dCgpKTsKCiAgICAgICAgdnRrQ29udG91ckZpbHRlciBjZiA9
> IG5ldyB2dGtDb250b3VyRmlsdGVyKCk7CiAgICAgICAgY2YuU2V0SW5wdXQo
> c3VyZi5HZXRPdXRwdXQoKSk7CiAgICAgICAgY2YuU2V0VmFsdWUoMCwgMC4w
> RCk7CgogICAgICAgIHZ0a1JldmVyc2VTZW5zZSByZXZlcnNlID0gbmV3IHZ0
> a1JldmVyc2VTZW5zZSgpOwogICAgICAgIHJldmVyc2UuU2V0SW5wdXQoY2Yu
> R2V0T3V0cHV0KCkpOwogICAgICAgIHJldmVyc2UuUmV2ZXJzZUNlbGxzT24o
> KTsKICAgICAgICByZXZlcnNlLlJldmVyc2VOb3JtYWxzT24oKTsKCiAgICAg
> ICAgdnRrUG9seURhdGFNYXBwZXIgbWFwID0gbmV3IHZ0a1BvbHlEYXRhTWFw
> cGVyKCk7CiAgICAgICAgbWFwLlNldElucHV0KHJldmVyc2UuR2V0T3V0cHV0
> KCkpOwogICAgICAgIG1hcC5TY2FsYXJWaXNpYmlsaXR5T2ZmKCk7CgogICAg
> ICAgIHZ0a0FjdG9yIHN1cmZhY2VBY3RvciA9IG5ldyB2dGtBY3RvcigpOwog
> ICAgICAgIHN1cmZhY2VBY3Rvci5TZXRNYXBwZXIobWFwKTsKICAgICAgICBy
> ZW5XaW4uR2V0UmVuZGVyZXIoKS5BZGRBY3RvcihzdXJmYWNlQWN0b3IpOwog
> ICAgfQoKICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKFN0cmluZ1tdIGFy
> Z3MpIHsKICAgICAgICBQcm9ncmFtbWFibGVTb3VyY2VUZXN0IGFUZXN0ID0g
> bmV3IFByb2dyYW1tYWJsZVNvdXJjZVRlc3QoKTsKICAgICAgICBmcmFtZSA9
> IG5ldyBKRnJhbWUoIlByb2dyYW1tYWJsZVNvdXJjZVRlc3QiKTsKICAgICAg
> ICBmcmFtZS5hZGRXaW5kb3dMaXN0ZW5lcihuZXcgV2luZG93QWRhcHRlcigp
> IHsKICAgICAgICAgICAgcHVibGljIHZvaWQgd2luZG93Q2xvc2luZyhXaW5k
> b3dFdmVudCBlKSB7CiAgICAgICAgICAgICAgICBTeXN0ZW0uZXhpdCgwKTsK
> ICAgICAgICAgICAgfQogICAgICAgIH0pOwogICAgICAgIGZyYW1lLmdldENv
> bnRlbnRQYW5lKCkuYWRkKCJDZW50ZXIiLCBhVGVzdCk7CiAgICAgICAgZnJh
> bWUucGFjaygpOwogICAgICAgIGZyYW1lLnNldFZpc2libGUodHJ1ZSk7CiAg
> ICB9Cgp9Cg==
>
> --0-437213590-1054054877=:47229--
>
>
> --__--__--
>
> _______________________________________________
> vtkusers mailing list
> vtkusers at public.kitware.com
> http://public.kitware.com/mailman/listinfo/vtkusers
>
>
> End of vtkusers Digest




More information about the vtkusers mailing list