ITK
4.1.0
Insight Segmentation and Registration Toolkit
|
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 __itkFEMLoadGrav_h 00020 #define __itkFEMLoadGrav_h 00021 00022 #include "itkFEMLoadElementBase.h" 00023 #include "vnl/vnl_vector.h" 00024 00025 namespace itk 00026 { 00027 namespace fem 00028 { 00039 class LoadGrav : public LoadElement 00040 { 00041 public: 00042 00044 typedef LoadGrav Self; 00045 typedef LoadElement Superclass; 00046 typedef SmartPointer<Self> Pointer; 00047 typedef SmartPointer<const Self> ConstPointer; 00048 00050 itkTypeMacro(LoadGrav, LoadElement); 00051 00052 virtual vnl_vector<Float> GetGravitationalForceAtPoint(vnl_vector<Float> ) = 0; 00053 00054 protected: 00055 virtual void PrintSelf(std::ostream& os, Indent indent) const 00056 { 00057 Superclass::PrintSelf(os, indent); 00058 } 00059 00060 }; 00061 00070 class LoadGravConst : public LoadGrav 00071 { 00072 public: 00073 00075 typedef LoadGravConst Self; 00076 typedef LoadGrav Superclass; 00077 typedef SmartPointer<Self> Pointer; 00078 typedef SmartPointer<const Self> ConstPointer; 00079 00081 itkSimpleNewMacro(Self); 00082 00084 itkTypeMacro(LoadGravConst, LoadGrav); 00085 00088 virtual::itk::LightObject::Pointer CreateAnother(void) const; 00089 00090 virtual vnl_vector<Float> GetGravitationalForceAtPoint(vnl_vector<Float> ) 00091 { 00092 return m_GravityForce; 00093 } 00094 00098 void SetForce(const vnl_vector<itk::fem::Element::Float> force); 00099 00103 vnl_vector<itk::fem::Element::Float> & GetForce(); 00104 const vnl_vector<itk::fem::Element::Float> & GetForce() const; 00106 00108 virtual void ApplyLoad(Element::ConstPointer element, Element::VectorType & Fe); 00109 00110 protected: 00111 virtual void PrintSelf(std::ostream& os, Indent indent) const; 00112 00113 vnl_vector<Float> m_GravityForce; 00114 }; 00115 00116 } 00117 } // end namespace itk::fem 00118 00119 #endif // #ifndef __itkFEMLoadGrav_h 00120