]> Creatis software - bbtk.git/blob - packages/vtk/src/bbvtkMarchingCubes.h
#3008 BBTK Feature New Normal - Active option in box vtk::IsoSurfaceExtractor
[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_INPUT(Active,bool);
77     BBTK_DECLARE_VTK_INPUT(In,vtkImageData *);
78         BBTK_DECLARE_INPUT(Value,double);
79         BBTK_DECLARE_INPUT(ComputeNormalsOn,bool);
80         BBTK_DECLARE_INPUT(ComputeScalarsOn,bool);
81     BBTK_DECLARE_VTK_OUTPUT(Out,vtkPolyData *);
82
83     // For the 'Value' parameter, the standard bbtk macro does not work 
84     // as vtk Get/Set accessors have a parameter...
85     //  BBTK_DECLARE_VTK_PARAM(vtkMarchingCubes,Value,double);
86     // Hence have to wrap the accessors "by hand" :
87           
88          /* 
89     double bbGetInputValue ()
90        { return vtkMarchingCubes::GetValue(0); }
91     void bbSetInputValue (double d)     
92        { // vtkMarchingCubes::SetValue(0,d);
93                    
94                    mVtkObject->SetValue(0,1000.0);
95
96                    std::cout <<  "EED MarchingCubes::bbSetInputValue " << d << std::endl;
97            
98            }
99 */
100           
101           
102   // BBTK_VTK_PROCESS();
103           BBTK_PROCESS(Process);
104           void Process();
105
106   };
107   //=======================================================================
108   
109   //=======================================================================
110   BBTK_BEGIN_DESCRIBE_BLACK_BOX(MarchingCubes,bbtk::AtomicBlackBox);
111   BBTK_NAME("MarchingCubes");
112   BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");
113   BBTK_DESCRIPTION("Extracts an iso-surface of an image using the marching cubes algorithm (bbfication of vtkMarchingCubes)");
114   BBTK_CATEGORY("image;mesh");
115
116   BBTK_INPUT(MarchingCubes,Active,"Active true/false (default true)",bool,"");
117   BBTK_INPUT(MarchingCubes,In,"Image",vtkImageData*,"");
118   BBTK_INPUT(MarchingCubes,Value,"Value of the iso-surface",double,"");
119   BBTK_INPUT(MarchingCubes,ComputeNormalsOn,"Set the computation of normals",bool,"");
120   BBTK_INPUT(MarchingCubes,ComputeScalarsOn,"Set the computation of scalars",bool,"");
121   BBTK_OUTPUT(MarchingCubes,Out,"Output iso-surface",vtkPolyData*,"");
122   
123   BBTK_END_DESCRIBE_BLACK_BOX(MarchingCubes);
124   //=======================================================================
125
126 }// EO namespace bbvtk
127
128
129 #endif  //__bbvtkMarchingCubes_h_INCLUDED__
130
131 #endif //_USE_VTK_
132