vtkwrap_test04.cpp

00001 /***********************************************************************************
00002  * VTKwrap - Simple VTK wrappers                                                   *
00003  * Copyright (C) 2005 Dorival de Moraes Pedroso <dorival.pedroso at gmail.com>     *
00004  *                                                                                 *
00005  * This file is part of VTKwrap.                                                   *
00006  *                                                                                 *
00007  * VTKwrap is free software; you can redistribute it and/or modify it under        *
00008  * the  terms of the GNU General Public License as published by the Free Software  *
00009  * Foundation; either version 2 of the License, or (at your option) any later      *
00010  * version.                                                                        *
00011  *                                                                                 *
00012  * VTKwrap is distributed in the hope that it will be useful, but WITHOUT ANY      *
00013  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A *
00014  * PARTICULAR PURPOSE. See the GNU General Public License for more details.        *
00015  *                                                                                 *
00016  * You should have received a copy of the GNU General Public License along with    *
00017  * VTKwrap; if not, write to the Free Software Foundation, Inc., 51 Franklin       *
00018  * Street, Fifth Floor, Boston, MA 02110-1301, USA                                 *
00019  ***********************************************************************************/
00020 
00021 #include <iostream>
00022 #include <cmath>
00023 
00024 #include "vtkwrap/vtkwin.h"
00025 #include "vtkwrap/arrow.h"
00026 #include "vtkwrap/axes.h"
00027 
00028 using std::cout;
00029 using std::endl;
00030 
00031 int main(int argc, char **argv)
00032 {
00033     Axes ax(2,2,2,"X","Y","Z","yellow");
00034 
00035     Arrow::Geometry geom(/*BodyRadius*/0.025, /*TipRadius*/0.06, /*TipMultiplier*/8.0, /*Resolution*/25);
00036 
00037     Arrow a1(1.0,0.0,0.0, "red"    , 0.0,0.0,0.0, &geom);
00038     Arrow a2(1.0,0.0,0.0, "green"  , 1.0,1.0,1.0, &geom);
00039     Arrow a3(0.0,1.0,0.0, "blue"   , 0.0,0.0,0.0, &geom);
00040     Arrow a4(0.0,0.0,1.0, "cyan"   , 0.0,0.0,0.0, &geom);
00041     Arrow a5(1.0,1.0,1.0, "magenta", 0.0,0.0,0.0, &geom);
00042     Arrow a6(2.0,2.0,2.0, "black"  , 0.0,0.0,0.0, &geom);
00043     Arrow a7(0.5,0.5,0.5, "peacock", 0.5,0.5,0.5, &geom);
00044 
00045     VTKWin win;
00046     ax.AddActorsTo(win);
00047     win.AddActor(a1.GetActor());
00048     win.AddActor(a2.GetActor());
00049     win.AddActor(a3.GetActor());
00050     win.AddActor(a4.GetActor());
00051     win.AddActor(a5.GetActor());
00052     win.AddActor(a6.GetActor());
00053     win.AddActor(a7.GetActor());
00054     win.Show();
00055 
00056     return 0;
00057 }

Generated on Wed Jan 24 15:56:28 2007 for MechSys by  doxygen 1.4.7