Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

edge_frame.H

Go to the documentation of this file.
00001 /*****************************************************************
00002  * edge_frame.H
00003  *
00004  *                         n                                   
00005  *                         |                                   
00006  *                         |                                   
00007  *                         |                                   
00008  *                         o - - - b                          
00009  *                        /                                    
00010  *                       /                                     
00011  *                      t                                      
00012  *                                                             
00013  *      EdgeFrame: a coordinate frame associated with a Bedge.
00014  *      Origin is on the edge. Direction t is along the edge.
00015  *      Direction n is computed to be orthogonal to t (both are
00016  *      unit length). Direction b is determined by them:
00017  *              b = n x t.
00018  *
00019  *****************************************************************/
00020 #ifndef EDGE_FRAME_H_IS_INCLUDED
00021 #define EDGE_FRAME_H_IS_INCLUDED
00022 
00023 #include "simplex_frame.H"
00024 
00025 /*****************************************************************
00026  * EdgeFrame:
00027  *
00028  *      see diagram above.
00029  *****************************************************************/
00030 class EdgeFrame : public SimplexFrame {
00031  public:
00032 
00033    //******** MANAGERS ********
00034 
00035    EdgeFrame(uint key, Bedge* e, CWvec& n, double s=0.5, bool flip=false) :
00036       SimplexFrame(key, e, (flip?(-e->vec()):(e->vec())), n),
00037       _orig_n(n),
00038       _flip(flip),
00039       _s(s) {}
00040 
00041    //******** RUN-TIME TYPE ID ********
00042 
00043    DEFINE_RTTI_METHODS3("EdgeFrame", EdgeFrame*, SimplexFrame, CSimplexData*);
00044 
00045    //******** ACCESSORS ********
00046 
00047    Wvec         orig_n()        const   { return _orig_n; }
00048    double       s()             const   { return _s; }
00049    Bedge*       edge()          const   { return (Bedge*) _simplex; }
00050 
00051    //******** CoordFrame VIRTUAL METHODS ******** 
00052 
00053    virtual Wpt o() { return edge()->interp(_s); }
00054 
00055    //******** SimplexData NOTIFICATION METHODS ********
00056 
00057    virtual void notify_simplex_changed() {
00058       // a verttex of the edge changed position
00059       _dirty = 1;       // mark dirty to be recomputed later
00060       changed();        // notify observers
00061    }
00062 
00063  //*******************************************************
00064  // PROTECTED
00065  //*******************************************************
00066  protected:
00067    Wvec         _orig_n;        // original "normal"
00068    bool         _flip;          // whether _t is flipped
00069    double       _s;             // position along edge where "origin" is
00070 
00071    //******** SimplexFrame VIRTUAL METHODS ********
00072    virtual void recompute() {
00073       // align t with the edge vector
00074       set_((_flip?(-(edge()->vec())):(edge()->vec())), _orig_n);
00075       SimplexFrame::recompute();
00076    }
00077 };
00078 typedef const EdgeFrame CEdgeFrame;
00079 
00080 #endif // EDGE_FRAME_H_IS_INCLUDED
00081 
00082 // end of file edge_frame.H

Generated on Mon Sep 18 11:39:29 2006 for jot by  doxygen 1.4.4