Orfeo Toolbox  3.16
itkFEMElementStd.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkFEMElementStd.h,v $
5  Language: C++
6  Date: $Date: 2009-01-29 21:28:16 $
7  Version: $Revision: 1.17 $
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 
18 #ifndef __itkFEMElementStd_h
19 #define __itkFEMElementStd_h
20 
21 #include "itkFEMElementBase.h"
22 
23 namespace itk {
24 namespace fem {
25 
52 template<unsigned int VNumberOfNodes, unsigned int VNumberOfSpatialDimensions, class TBaseClass=Element>
53 class ElementStd : public TBaseClass
54 {
56 public:
57 
58 // FIXME: Add concept cheking for TBaseClass, and TPointClass
59 
60  // Repeat typedefs and enums from parent class
61  typedef typename Superclass::Float Float;
62  typedef typename Superclass::MatrixType MatrixType;
63  typedef typename Superclass::VectorType VectorType;
64  typedef typename Superclass::LoadType LoadType;
65  typedef typename Superclass::LoadPointer LoadPointer;
66  typedef typename Superclass::NodeIDType NodeIDType;
68  typedef typename Superclass::Node Node;
69  enum{ InvalidDegreeOfFreedomID = Superclass::InvalidDegreeOfFreedomID };
70 
74  enum { NumberOfNodes=VNumberOfNodes };
75 
79  enum { NumberOfSpatialDimensions=VNumberOfSpatialDimensions };
80 
84  ElementStd();
85 
87 
90  virtual unsigned int GetNumberOfNodes( void ) const
91  { return NumberOfNodes; }
92 
93  virtual NodeIDType GetNode(unsigned int n) const
94  {
95  if(n>=NumberOfNodes)
96  {
97  return 0;
98  }
99  return this->m_node[n];
100  }
101 
102  virtual void SetNode(unsigned int n, NodeIDType node)
103  {
104  if(n>=NumberOfNodes)
105  {
106  return;
107  }
108  this->m_node[n]=node;
109  }
110 
111  virtual const VectorType& GetNodeCoordinates( unsigned int n ) const
112  {
113  return m_node[n]->GetCoordinates();
114  }
115 
116  virtual unsigned int GetNumberOfSpatialDimensions() const
117  {
119  }
120 
122 
129  virtual void Read( std::istream&, void* info );
130 
134  virtual void Write( std::ostream& f ) const;
135 
136 protected:
137 
142 
143 };
144 
145 #ifdef _MSC_VER
146 // Declare a static dummy function to prevent a MSVC 6.0 SP5 from crashing.
147 // I have no idea why things don't work when this is not declared, but it
148 // looks like this declaration makes compiler forget about some of the
149 // troubles it has with templates.
150 static void Dummy( void );
151 #endif // #ifdef _MSC_VER
152 
153 }} // end namespace itk::fem
154 
155 #ifndef ITK_MANUAL_INSTANTIATION
156 #include "itkFEMElementStd.txx"
157 #endif
158 
159 #endif // #ifndef __itkFEMElementStd_h

Generated at Sat Feb 2 2013 23:36:43 for Orfeo Toolbox with doxygen 1.8.1.1