]> Creatis software - bbtk.git/blob - packages/vtk/src/bbvtkMarchingCubes.h
bd4f55256af1a04bcf53ef0e3ca14cb2e9eaf0cd
[bbtk.git] / packages / vtk / src / bbvtkMarchingCubes.h
1 /*=========================================================================
2                                                                                 
3   Program:   bbtk
4   Module:    $RCSfile: bbvtkMarchingCubes.h,v $
5   Language:  C++
6   Date:      $Date: 2008/05/07 06:31:37 $
7   Version:   $Revision: 1.5 $
8                                                                                 
9   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10   l'Image). All rights reserved. See Doc/License.txt or
11   http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details.
12                                                                                 
13      This software is distributed WITHOUT ANY WARRANTY; without even
14      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15      PURPOSE.  See the above copyright notices for more information.
16                                                                                 
17 =========================================================================*//**
18  * \brief Short description in one line
19  * 
20  * Long description which 
21  * can span multiple lines
22  */
23 /**
24  * \file 
25  * \brief Pattern for the definition of a new type of Node (header)
26  */
27 /**
28  * \class bbtk::NodePatern 
29  * \brief Pattern for the definition of a new type of Node 
30  */
31
32
33 #ifdef _USE_VTK_
34
35 #ifndef __bbvtkMarchingCubes_h_INCLUDED__
36 #define __bbvtkMarchingCubes_h_INCLUDED__
37
38
39 #include "bbtkAtomicBlackBox.h"
40 #include "bbtkVtkBlackBoxMacros.h"
41 #include "vtkMarchingCubes.h"
42 #include "vtkImageData.h"
43
44 namespace bbvtk
45 {
46
47    //=======================================================================
48   class /*BBTK_EXPORT*/ MarchingCubes
49     : 
50     public bbtk::AtomicBlackBox,
51     public vtkMarchingCubes
52   {
53     BBTK_BLACK_BOX_INTERFACE(MarchingCubes,bbtk::AtomicBlackBox);
54     
55     BBTK_DECLARE_VTK_INPUT(vtkMarchingCubes,In,vtkImageData *);
56     BBTK_DECLARE_VTK_OUTPUT(vtkMarchingCubes,Out,vtkPolyData *);
57
58     // For the 'Value' parameter, the standard bbtk macro does not work 
59     // as vtk Get/Set accessors have a parameter...
60     //  BBTK_DECLARE_VTK_PARAM(vtkMarchingCubes,Value,double);
61     // Hence have to wrap the accessors "by hand" :
62     double bbGetInputValue ()
63        { return vtkMarchingCubes::GetValue(0); }
64     void bbSetInputValue (double d)     
65        { vtkMarchingCubes::SetValue(0,d); }
66
67     
68     BBTK_PROCESS(DoProcess);
69     void DoProcess() { vtkMarchingCubes::Update(); }
70
71     // Overload bbDelete to handle vtk reference counting
72     BBTK_VTK_DELETE(vtkMarchingCubes);
73     //void bbDelete() { Delete(); }
74   };
75   //=======================================================================
76   
77   //=======================================================================
78   BBTK_BEGIN_DESCRIBE_BLACK_BOX(MarchingCubes,bbtk::AtomicBlackBox);
79   BBTK_NAME("MarchingCubes");
80   BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");
81   BBTK_DESCRIPTION("Extracts an iso-surface of an image using the marching cubes algorithm (bbfication of vtkMarchingCubes)");
82   BBTK_CATEGORY("image;mesh");
83
84   BBTK_INPUT(MarchingCubes,In,"Image",vtkImageData*,"");
85   BBTK_INPUT(MarchingCubes,Value,"Value of the iso-surface",double,"");
86   BBTK_OUTPUT(MarchingCubes,Out,"Output iso-surface",vtkPolyData*,"");
87   
88   BBTK_END_DESCRIBE_BLACK_BOX(MarchingCubes);
89   //=======================================================================
90
91 }// EO namespace bbvtk
92
93
94 #endif  //__bbvtkMarchingCubes_h_INCLUDED__
95
96 #endif //_USE_VTK_
97