KWStyle - itkDefaultDynamicMeshTraits.h
 
Matrix View
Description

1 /*=========================================================================
2
3   Program:   Insight Segmentation & Registration Toolkit
4   Module:    $RCSfile: itkDefaultDynamicMeshTraits.h.html,v $
5   Language:  C++
6   Date:      $Date: 2006/01/17 19:15:34 $
7   Version:   $Revision: 1.4 $
8
9   Copyright (c) Insight Software Consortium. All rights reserved.
10   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11
12      This software is distributed WITHOUT ANY WARRANTY; without even 
13      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
14      PURPOSE.  See the above copyright notices for more information.
15
16 =========================================================================*/
17 #ifndef __itkDefaultDynamicMeshTraits_h
18 #define __itkDefaultDynamicMeshTraits_h
19
20 #include "itkCellInterface.h"
21 #include "itkMapContainer.h"
22 #include "itkPoint.h"
23 #include <set>
24
25 namespace itk
26 {
27
28 /** \class DefaultDynamicMeshTraits
29  * DefaultDynamicMeshTraits is a simple structure that holds type information
30  * for a mesh and its cells.  It is used to avoid the passing of many
31  * template parameters while still enjoying the benefits of generic
32  * programming.
33  *
34  * Unlike DefaultStaticMeshTraits, this version of the MeshTraits structure
35  * is designed to create Mesh instances that will have many insert and delete
36  * operations done on them.
37  *
38  * Template parameters for DefaultDynamicMeshTraits:
39  *
40  * TPixelType =
41  *    The type stored as data for an entity (cell, point, or boundary).
42  *
43  * VPointDimension =
44  *    Geometric dimension of space.
45  *
46  * VMaxTopologicalDimension =
47  *    Max topological dimension of a cell that can be inserted into this mesh.
48  *
49  * TCoordRep =
50  *    Numerical type to store each coordinate value.
51  *
52  * TInterpolationWeight =
53  *    Numerical type to store interpolation weights.
54  * 
55  * \ingroup MeshObjects 
56  */
57 template <
58   typename TPixelType,
59   unsigned int VPointDimension = 3,
60   unsigned int VMaxTopologicalDimension = VPointDimension,
61   typename TCoordRep = float,
62   typename TInterpolationWeight = float,
63   typename TCellPixelType = TPixelType
64 IND **>
65 class DefaultDynamicMeshTraits
66 {
67 public:
68   /** Standard class typedefs. */
69   typedef DefaultDynamicMeshTraits  Self;
70   
71   /** Just save all the template parameters. */
72   typedef TPixelType      PixelType;
73   typedef TCellPixelType  CellPixelType;
74 TDA   typedef TCoordRep  CoordRepType;
75 TDA   typedef TInterpolationWeight  InterpolationWeightType;
76     
77   /** Just save all the template parameters. */
78   itkStaticConstMacro(PointDimension, unsigned int, VPointDimension);
79   itkStaticConstMacro(MaxTopologicalDimension, unsigned int,
80                       VMaxTopologicalDimension);  
81   
82   /** The type to be used to identify a point.  This should be the index type
83    * to the PointsContainer. */
84   typedef unsigned long  PointIdentifier;
85
86   /** The type to be used to identify a cell.  This should be the index type
87    * to the CellsContainer. */
88   typedef unsigned long  CellIdentifier;
89
90   /** A type that can be used to identifiy individual boundary features on
91    * the cells.  Since this will probably be an index into a static array,
92    * this will probably never change from an integer setting. */
93   typedef unsigned long  CellFeatureIdentifier;
94   
95   /** The type of point used by the mesh.  This should never change from
96    * this setting, regardless of the mesh type. */
97   typedef Point< CoordRepType, VPointDimension >  PointType;
98
99   /** The container type for use in storing points.  It must conform to
100    * the IndexedContainerInterface. */
101   typedef MapContainer< PointIdentifier , PointType >  PointsContainer;
102
103   /** The container type that will be used to store boundary links
104    * back to cells.  This must conform to the STL "set" interface. */
105   typedef std::set< CellIdentifier >            UsingCellsContainer;
106   
107   /** The information needed for a cell type is now defined, so we can
108    * define the cell type. */
109   typedef itkMakeCellTraitsMacro                           CellTraits;
110   
111   /** The interface to cells to be used by the mesh.
112    * This should not be changed. */
113   typedef CellInterface< CellPixelType , CellTraits >  CellType;
114   typedef typename CellType::CellAutoPointer           CellAutoPointer;
115   
116   /** The container type for use in storing cells.  It must conform to
117    * the IndexedContainerInterface. */
118   typedef MapContainer< CellIdentifier , CellType * >
119 IND ********CellsContainer;
120   
121   /** The CellLinks container should be a container of PointCellLinksContainer,
122    * which should be a container conforming to the STL "set" interface. */
123   typedef std::set< CellIdentifier >
124 IND ********PointCellLinksContainer;
125
126   /** The container type for use in storing point links back to cells.]
127    * It must conform to the IndexedContainerInterface. */
128   typedef MapContainer< PointIdentifier , PointCellLinksContainer >
129 IND ********CellLinksContainer;
130
131   /** The container type for use in storing point data.  It must conform to
132    * the IndexedContainerInterface. */
133   typedef MapContainer< PointIdentifier , PixelType >
134 IND ********PointDataContainer;
135
136   /** The container type for use in storing cell data.  It must conform to
137    * the IndexedContainerInterface. */
138   typedef MapContainer< CellIdentifier , CellPixelType >
139 IND ********CellDataContainer;
140
141 };
142
143 // end namespace itk
144
145 #endif
146

Generated by KWStyle 1.0b on Tuesday January,17 at 02:14:05PM
© Kitware Inc.