]> Creatis software - bbtk.git/blob - packages/vtk/src/bbvtkSphereList.h
#3107 BBTK Bug New Normal - branch vtk7itk4 compilation with vtk7
[bbtk.git] / packages / vtk / src / bbvtkSphereList.h
1 /*
2  # ---------------------------------------------------------------------
3  #
4  # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
5  #                        pour la SantÈ)
6  # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7  # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8  # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
9  #
10  #  This software is governed by the CeCILL-B license under French law and
11  #  abiding by the rules of distribution of free software. You can  use,
12  #  modify and/ or redistribute the software under the terms of the CeCILL-B
13  #  license as circulated by CEA, CNRS and INRIA at the following URL
14  #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
15  #  or in the file LICENSE.txt.
16  #
17  #  As a counterpart to the access to the source code and  rights to copy,
18  #  modify and redistribute granted by the license, users are provided only
19  #  with a limited warranty  and the software's author,  the holder of the
20  #  economic rights,  and the successive licensors  have only  limited
21  #  liability.
22  #
23  #  The fact that you are presently reading this means that you have had
24  #  knowledge of the CeCILL-B license and that you accept its terms.
25  # ------------------------------------------------------------------------ */
26
27
28 #ifndef __bbvtkSphereList_h_INCLUDED__
29 #define __bbvtkSphereList_h_INCLUDED__
30 #include "bbvtk_EXPORT.h"
31 #include "bbtkAtomicBlackBox.h"
32 #include "iostream"
33
34 #include <vtkPolyDataMapper.h>
35 #include <vtkRenderer.h>
36 #include <vtkSphereSource.h>
37 #include <vtkLinearTransform.h>
38
39
40 namespace bbvtk
41 {
42
43 class bbvtk_EXPORT SphereList
44  : 
45    public bbtk::AtomicBlackBox
46 {
47   BBTK_BLACK_BOX_INTERFACE(SphereList,bbtk::AtomicBlackBox);
48
49         BBTK_DECLARE_INPUT(Renderer ,vtkRenderer*);
50         BBTK_DECLARE_INPUT(lstPointX,std::vector<double>);
51         BBTK_DECLARE_INPUT(lstPointY,std::vector<double>);
52         BBTK_DECLARE_INPUT(lstPointZ,std::vector<double>);
53         BBTK_DECLARE_INPUT(lstRadio ,std::vector<double>);
54         BBTK_DECLARE_INPUT(Colour   ,std::vector<double>);
55         BBTK_DECLARE_INPUT(Opacity  ,double);
56         BBTK_DECLARE_INPUT(Spacing   ,std::vector<double>);
57         BBTK_DECLARE_INPUT(Transform   ,vtkLinearTransform*);
58
59   BBTK_DECLARE_OUTPUT(ActorList,std::vector<vtkActor*>);
60
61   BBTK_PROCESS(Process);
62   void Process();
63
64   std::vector<vtkActor *> sphereActor;
65   std::vector<vtkSphereSource *> vtkspheresourceLst;
66
67 private:
68    double GetRadio(int);
69    void GetPoint(int i, double &px,double &py,double &pz);   
70    void GetColor(int i, double &cr,double &cg,double &cb);
71 };
72
73 BBTK_BEGIN_DESCRIBE_BLACK_BOX(SphereList,bbtk::AtomicBlackBox);
74         BBTK_NAME("SphereList");
75         BBTK_AUTHOR("InfoTeam  CREATIS");
76         BBTK_DESCRIPTION("Builds a sphere list actor given four vectors (X, Y, Z, radius).");
77         BBTK_CATEGORY("");
78         BBTK_INPUT(SphereList,Renderer,"Renderer",vtkRenderer*,"");
79         BBTK_INPUT(SphereList,lstPointX,"List of X coordinates. Requirement: same size as vector Y and vector Z.",std::vector<double>,"");
80         BBTK_INPUT(SphereList,lstPointY,"List of Y coordinates. Requirement: same size as vector X and vector Z.",std::vector<double>,"");
81         BBTK_INPUT(SphereList,lstPointZ,"List of Z coordinates. Requirement: same size as vector X and vector Y.",std::vector<double>,"");
82         BBTK_INPUT(SphereList,lstRadio,"List of Radio values",std::vector<double>,"");
83         BBTK_INPUT(SphereList,Colour,"Colour RGB values for the spheres (default [1 0 0])  (3 first values of the vector for the first sphere, following values for the second sphere, etc.)",std::vector<double>,"");
84         BBTK_INPUT(SphereList,Opacity,"Opacity of the spheres (default 1)",double,"");
85         BBTK_INPUT(SphereList,Spacing,"(default [1 1 1]) Spacing vector [sx sy sz]",std::vector<double>,"");
86 BBTK_INPUT(SphereList,Transform,"vtkTransform",vtkLinearTransform*,"");
87
88  BBTK_OUTPUT(SphereList,ActorList,"List of the sphere actors",std::vector<vtkActor*>,"");
89
90 BBTK_END_DESCRIBE_BLACK_BOX(SphereList);
91 }
92 // EO namespace bbvtk
93
94 #endif // __bbvtkSphereList_h_INCLUDED__
95