ITK  4.0.0
Insight Segmentation and Registration Toolkit
itkFEMLoadElementBase.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 
00019 #ifndef __itkFEMLoadElementBase_h
00020 #define __itkFEMLoadElementBase_h
00021 
00022 #include "itkFEMLoadBase.h"
00023 
00024 namespace itk
00025 {
00026 namespace fem
00027 {
00044 class LoadElement : public Load
00045 {
00046 public:
00047 
00049   typedef LoadElement              Self;
00050   typedef Load                     Superclass;
00051   typedef SmartPointer<Self>       Pointer;
00052   typedef SmartPointer<const Self> ConstPointer;
00053 
00055   itkSimpleNewMacro(Self);
00056 
00058   itkTypeMacro(LoadElement, Load);
00059 
00062   virtual::itk::LightObject::Pointer CreateAnother(void) const;
00063 
00067   typedef Element::Float Float;
00068 
00072   typedef std::vector<const Element *> ElementPointersVectorType;
00073 
00074   // FIXME: should clear vector, not zero it
00075   LoadElement() : m_Element(0)
00076   {
00077   }
00078   void AddNextElement(Element::ConstPointer e)
00079     {
00080       this->AddNextElementInternal(e.GetPointer());
00081     }
00082   void AddNextElement(Element::Pointer e)
00083     {
00084       this->AddNextElementInternal(e.GetPointer());
00085     }
00086 
00087   Element::ConstPointer GetElement(int i);
00088 
00089   unsigned int GetNumberOfElements(void);
00090 
00091   ElementPointersVectorType & GetElementArray()
00092     {
00093       return this->m_Element;
00094     }
00095 
00096   const ElementPointersVectorType & GetElementArray() const
00097     {
00098       return this->m_Element;
00099     }
00100 
00102   virtual void ApplyLoad(Element::ConstPointer , Element::VectorType & ) { /* HACK:  This should probably through an execption if it is not intended to be used. */ }
00103 
00104 protected:
00105   virtual void PrintSelf(std::ostream& os, Indent indent) const;
00106   void AddNextElementInternal(const Element *e);
00109 };
00110 
00111 }
00112 }  // end namespace itk::fem
00113 
00114 #endif // #ifndef __itkFEMLoadElementBase_h
00115