edge.h

Go to the documentation of this file.
00001 // Author: Justin Kinney
00002 // Date: Sep 2008
00003 
00004 #ifndef EDGE_H
00005 #define EDGE_H 1
00006 
00007 #include "meshmorph.h"
00008 
00009 #include "vertex.h"
00010 
00011 class Edge
00012 {
00013 private:
00014   Face   *f1,*f2; // pointers to adjacent faces
00015   float        l; // original edge length
00016   Vertex *v1,*v2; // Vertices at each end of edge
00017   Vertex *o1,*o2; // vertices of adjacent faces not part of this edge
00018 public:
00019   Edge                          (Face * const ,
00020                                  Vertex * const ,
00021                                  Vertex * const ,
00022                                  Vertex * const);
00023   void    print                 (std::ostream &) const;
00024   void    update                (Face * const,Vertex * const);
00025   double  getAngle              (void) const;
00026   double  getCurvatureLength    (Vertex const * const o,
00027                                  Vertex const * const v1,
00028                                  Vertex const * const v2,
00029                                  double const & edge_length) const;
00030   double  getAngleForceEnergy   (int const &,vector3 &,bool) const;  
00031   void    getAngleReForceEnergy (vector3 &,bool) const;  
00032   double  getStretchForceEnergy (Vertex const * const,
00033                                  vector3 &,
00034                                  double const &,
00035                                  bool) const;
00036   Face *  getFace1              (void) const;
00037   Face *  getFace2              (void) const;
00038 
00043   Vertex * const getV1 (void)
00044   {
00045     return v1;
00046   }
00047 
00052   Vertex * const getV2 (void)
00053   {
00054     return v2;
00055   }
00056 
00061   Vertex * const getO1 (void)
00062   {
00063     return o1;
00064   }
00065 
00070   Vertex * const getO2 (void)
00071   {
00072     return o2;
00073   }
00074 
00079   double getOriginalLength (void) const
00080   {
00081     return l;
00082   }
00083 
00088   double getSqLength (void) const
00089   {
00090     vector3 a(*v1->getPos()-*v2->getPos());
00091     return a.dot(a); 
00092   }
00093 
00094 };
00095 
00096 #endif

Generated on Fri Feb 13 13:58:10 2009 for meshmorph by  doxygen 1.5.1