ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkFEMElement2DC0LinearLine.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 __itkFEMElement2DC0LinearLine_h
00020 #define __itkFEMElement2DC0LinearLine_h
00021 
00022 #include "itkFEMElementStd.h"
00023 
00024 namespace itk
00025 {
00026 namespace fem
00027 {
00034 class Element2DC0LinearLine : public ElementStd<2, 2>
00035 {
00036 public:
00037 
00039   typedef Element2DC0LinearLine    Self;
00040   typedef ElementStd<2, 2>         TemplatedParentClass;
00041   typedef TemplatedParentClass     Superclass;
00042   typedef SmartPointer<Self>       Pointer;
00043   typedef SmartPointer<const Self> ConstPointer;
00044 
00046   itkTypeMacro(Element2DC0LinearLine, TemplatedParentClass);
00047 
00048   // ////////////////////////////////////////////////////////////////////////
00053   enum { DefaultIntegrationOrder = 1 };
00054 
00056   virtual void GetIntegrationPointAndWeight(unsigned int i,
00057                                             VectorType & pt,
00058                                             Float & w,
00059                                             unsigned int order) const;
00060 
00062   virtual unsigned int GetNumberOfIntegrationPoints(unsigned int order) const;
00063 
00064   // ////////////////////////////////////////////////////////////////////////
00070   virtual VectorType ShapeFunctions(const VectorType & pt) const;
00071 
00073   virtual void ShapeFunctionDerivatives(const VectorType & pt, MatrixType & shapeD) const;
00074 
00080   virtual bool GetLocalFromGlobalCoordinates(const VectorType & globalPt,
00081                                              VectorType & localPt) const;
00082 
00092   virtual void Jacobian(const VectorType & pt, MatrixType & J, const MatrixType *pshapeD = 0) const;
00093 
00097   Float DistanceToLine(const VectorType & x, const VectorType & p1, const VectorType & p2, Float & t,
00098                        VectorType & closestPoint) const;
00099 
00100 protected:
00101   virtual void PrintSelf(std::ostream& os, Indent indent) const;
00102 
00103   virtual void PopulateEdgeIds(void); // HACK:  Should PopulateEdgeIds
00104                                       // be const or not in this
00105                                       // heirarchy. Sometimes it is,
00106                                       // sometimes it is not.
00107 
00108 };
00109 }
00110 }  // end namespace itk::fem
00111 
00112 #endif  // #ifndef __itkFEMElement2DC0LinearLine_h
00113