ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkFEMElementStd.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 
19 #ifndef itkFEMElementStd_h
20 #define itkFEMElementStd_h
21 
22 #include "itkFEMElementBase.h"
23 
24 namespace itk
25 {
26 namespace fem
27 {
55 template< unsigned int VNumberOfNodes, unsigned int VNumberOfSpatialDimensions, typename TBaseClass = Element >
56 class ITK_TEMPLATE_EXPORT ElementStd : public TBaseClass
57 {
58 public:
59 
61  typedef ElementStd Self;
62  typedef TBaseClass Superclass;
65 
67  itkTypeMacro(ElementStd, TBaseClass);
68 
69 // FIXME: Add concept cheking for TBaseClass, and TPointClass
70 
71  // Repeat typedefs and enums from parent class
72 
73  typedef typename Superclass::Float Float;
74  typedef typename Superclass::MatrixType MatrixType;
76  typedef typename Superclass::LoadType LoadType;
77  typedef typename Superclass::LoadPointer LoadPointer;
78  typedef typename Superclass::NodeIDType NodeIDType;
79  typedef typename Superclass::DegreeOfFreedomIDType DegreeOfFreedomIDType;
80  typedef typename Superclass::Node Node;
81  enum { InvalidDegreeOfFreedomID = Superclass::InvalidDegreeOfFreedomID };
82 
84  enum { NumberOfNodes = VNumberOfNodes };
85 
87  enum { NumberOfSpatialDimensions = VNumberOfSpatialDimensions };
88 
90  ElementStd();
91 
93  virtual unsigned int GetNumberOfNodes(void) const ITK_OVERRIDE
94  {
95  return NumberOfNodes;
96  }
97 
99  virtual NodeIDType GetNode(unsigned int n) const ITK_OVERRIDE
100  {
101  if( n >= NumberOfNodes )
102  {
103  return ITK_NULLPTR;
104  }
105  return this->m_node[n];
106  }
108 
109  virtual void SetNode(unsigned int n, NodeIDType node) ITK_OVERRIDE
110  {
111  this->SetNodeInternal(n,node);
112  }
113  virtual void SetNode(unsigned int n, typename Superclass::Node::Pointer node) ITK_OVERRIDE
114  {
115  this->SetNodeInternal(n,node);
116  }
117 
119  virtual const VectorType & GetNodeCoordinates(unsigned int n) const ITK_OVERRIDE
120  {
121  return m_node[n]->GetCoordinates();
122  }
123 
125  virtual unsigned int GetNumberOfSpatialDimensions() const ITK_OVERRIDE
126  {
127  return NumberOfSpatialDimensions;
128  }
129 
130 
131 protected:
132 
133  virtual void PrintSelf(std::ostream& os, Indent indent) const ITK_OVERRIDE;
134 
135  virtual void SetNodeInternal(unsigned int n, const Node *node)
136  {
137  if( n >= NumberOfNodes )
138  {
139  return;
140  }
141  this->m_node[n] = node;
142  }
143 
144  // Array of pointers to point objects that define the element
145  const Node *m_node[NumberOfNodes];
146 };
147 
148 } // end namespace fem
149 } // end namespace itk
150 
151 #ifndef ITK_MANUAL_INSTANTIATION
152 #include "itkFEMElementStd.hxx"
153 #endif
154 
155 #endif // #ifndef itkFEMElementStd_h
virtual void SetNodeInternal(unsigned int n, const Node *node)
Superclass::DegreeOfFreedomIDType DegreeOfFreedomIDType
virtual unsigned int GetNumberOfNodes(void) const override
Superclass::Node Node
Superclass::LoadPointer LoadPointer
virtual const VectorType & GetNodeCoordinates(unsigned int n) const override
Implements standard node management in the element classes.
SmartPointer< const Self > ConstPointer
virtual NodeIDType GetNode(unsigned int n) const override
vnl_vector< Float > VectorType
virtual unsigned int GetNumberOfSpatialDimensions() const override
virtual void SetNode(unsigned int n, typename Superclass::Node::Pointer node) override
Superclass::Float Float
SmartPointer< Self > Pointer
Superclass::VectorType VectorType
Superclass::NodeIDType NodeIDType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
virtual void SetNode(unsigned int n, NodeIDType node) override
Superclass::LoadType LoadType
Superclass::MatrixType MatrixType