]> Creatis software - bbtk.git/blob - packages/vtk/src/bbvtkMarchingCubes.h
6198ee99860b78b363f20af51fc3af8d1e9b1e2c
[bbtk.git] / packages / vtk / src / bbvtkMarchingCubes.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 /*=========================================================================
29   Program:   bbtk
30   Module:    $RCSfile: bbvtkMarchingCubes.h,v $
31   Language:  C++
32   Date:      $Date: 2012/11/16 08:51:58 $
33   Version:   $Revision: 1.10 $
34 =========================================================================*/
35
36 /**
37  * \brief Short description in one line
38  * 
39  * Long description which 
40  * can span multiple lines
41  */
42 /**
43  * \file 
44  * \brief Pattern for the definition of a new type of Node (header)
45  */
46 /**
47  * \class bbtk::NodePatern 
48  * \brief Pattern for the definition of a new type of Node 
49  */
50
51
52 #ifdef _USE_VTK_
53
54 #ifndef __bbvtkMarchingCubes_h_INCLUDED__
55 #define __bbvtkMarchingCubes_h_INCLUDED__
56
57
58 #include "bbtkAtomicBlackBox.h"
59 #include "bbtkVtkBlackBoxMacros.h"
60 #include "vtkMarchingCubes.h"
61 #include "vtkImageData.h"
62
63 namespace bbvtk
64 {
65
66    //=======================================================================
67   class /*BBTK_EXPORT*/ MarchingCubes
68     : 
69     public bbtk::AtomicBlackBox 
70 //    ,public vtkMarchingCubes
71   {
72     BBTK_VTK_BLACK_BOX_INTERFACE(MarchingCubes,
73                                  bbtk::AtomicBlackBox,
74                                  vtkMarchingCubes);
75
76     BBTK_DECLARE_VTK_INPUT(In,vtkImageData *);
77         BBTK_DECLARE_INPUT(Value,double);
78         BBTK_DECLARE_INPUT(ComputeNormalsOn,bool);
79         BBTK_DECLARE_INPUT(ComputeScalarsOn,bool);
80     BBTK_DECLARE_VTK_OUTPUT(Out,vtkPolyData *);
81
82     // For the 'Value' parameter, the standard bbtk macro does not work 
83     // as vtk Get/Set accessors have a parameter...
84     //  BBTK_DECLARE_VTK_PARAM(vtkMarchingCubes,Value,double);
85     // Hence have to wrap the accessors "by hand" :
86           
87          /* 
88     double bbGetInputValue ()
89        { return vtkMarchingCubes::GetValue(0); }
90     void bbSetInputValue (double d)     
91        { // vtkMarchingCubes::SetValue(0,d);
92                    
93                    mVtkObject->SetValue(0,1000.0);
94
95                    std::cout <<  "EED MarchingCubes::bbSetInputValue " << d << std::endl;
96            
97            }
98 */
99           
100           
101   // BBTK_VTK_PROCESS();
102           BBTK_PROCESS(Process);
103           void Process();
104
105   };
106   //=======================================================================
107   
108   //=======================================================================
109   BBTK_BEGIN_DESCRIBE_BLACK_BOX(MarchingCubes,bbtk::AtomicBlackBox);
110   BBTK_NAME("MarchingCubes");
111   BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");
112   BBTK_DESCRIPTION("Extracts an iso-surface of an image using the marching cubes algorithm (bbfication of vtkMarchingCubes)");
113   BBTK_CATEGORY("image;mesh");
114
115   BBTK_INPUT(MarchingCubes,In,"Image",vtkImageData*,"");
116   BBTK_INPUT(MarchingCubes,Value,"Value of the iso-surface",double,"");
117   BBTK_INPUT(MarchingCubes,ComputeNormalsOn,"Set the computation of normals",bool,"");
118   BBTK_INPUT(MarchingCubes,ComputeScalarsOn,"Set the computation of scalars",bool,"");
119   BBTK_OUTPUT(MarchingCubes,Out,"Output iso-surface",vtkPolyData*,"");
120   
121   BBTK_END_DESCRIBE_BLACK_BOX(MarchingCubes);
122   //=======================================================================
123
124 }// EO namespace bbvtk
125
126
127 #endif  //__bbvtkMarchingCubes_h_INCLUDED__
128
129 #endif //_USE_VTK_
130