arbeit
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

nrroProbe.h

Go to the documentation of this file.
00001 //------------------------------------------------------------------------
00002 //
00003 //   Joe Kniss
00004 //     4-1-03
00005 //                   ________    ____   ___ 
00006 //                  |        \  /    | /  /
00007 //                  +---+     \/     |/  /
00008 //                  +--+|  |\    /|     < 
00009 //                  |  ||  | \  / |  |\  \ 
00010 //                  |      |  \/  |  | \  \ 
00011 //                   \_____|      |__|  \__\
00012 //                       Copyright  2003 
00013 //                      Joe Michael Kniss
00014 //                   <<< jmk@cs.utah.edu >>>
00015 //               "All Your Base are Belong to Us"
00016 //-------------------------------------------------------------------------
00017 
00018 //nrroProbe.h
00019 
00020 #ifndef __NRRO_PROBE_DOT_H
00021 #define __NRRO_PROBE_DOT_H
00022 
00023 #include <gage.h>
00024 #include <nrro/nrro.h>
00025 
00026 ///////////////////////////////////////////////////////////////////////////
00027 ///////////////////////////////////////////////////////////////////////////
00028 ///////////////////////////////////////////////////////////////////////////
00029 ///////////////////////////////////////////////////////////////////////////
00030 ///                      Probe
00031 ///////////////////////////////////////////////////////////////////////////
00032 ///////////////////////////////////////////////////////////////////////////
00033 ///////////////////////////////////////////////////////////////////////////
00034 ///////////////////////////////////////////////////////////////////////////
00035 
00036 ///////////////////////////////////////////////////////////////////////////
00037 /// Designed to nicely handle multi-channel volumes
00038 ///////////////////////////////////////////////////////////////////////////
00039 class NrroProbe
00040 {
00041 public:
00042    //////////////////////////////////////////////////////////
00043    /// need to know if you are probing a multi-channel volume
00044    ///  or a vector field
00045    NrroProbe(bool multiChannel=true, 
00046       const NrroKernel &nk=CatmulRomKernel);
00047    virtual ~NrroProbe();
00048 
00049    //////////////////////////////////////////
00050    /// type of values measured, (float)
00051    typedef gage_t     TYPE;
00052    /// type for kind of probe scalor/vector/etc...
00053    typedef gageKind*  PKIND;
00054 
00055 
00056    //////////////////////////////////////////////////////////////
00057    /// measures, some of these are not appropriate
00058    ///   for vector/scalor data types, some are 
00059    ///   valid for both, this is noted to the right
00060    enum{
00061       VALUE       = 1 << 0,   ///scl/vec 
00062       GRAD        = 1 << 1,   ///scl/vec (vec: multigradient (MG))
00063       GRADMAG     = 1 << 2,   ///scl/vec (vec: L2 of MG)
00064       GRAD_EVAL   = 1 << 3,   ///scl/vec (scl: grad mag)
00065       GRAD_EVEC   = 1 << 4,   ///scl/vec (scl: normal)
00066       NORMAL      = 1 << 5,   ///scl/vec (vec: evec of lagest eval)
00067       HESS        = 1 << 6,   ///scl
00068       HESS_EVAL   = 1 << 7,   ///scl
00069       HESS_EVEC   = 1 << 8,   ///scl
00070       LAPLAC      = 1 << 9,   ///scl
00071       DD2         = 1 << 10,  ///scl
00072       GEOM_TENS   = 1 << 11,  ///scl
00073       K1          = 1 << 12,  ///scl
00074       K2          = 1 << 13,  ///scl
00075       CURVE       = 1 << 14,  ///scl
00076       /// Gage has more measure types, but....          
00077    };
00078    unsigned int  getProbeType(int vol=0) const;
00079    void setProbeType(unsigned int ptype, int vol=0);
00080 
00081    ///////////////////////////////////////////////////
00082    /// get/set data to be/being probed
00083    void addNrro(const Nrro *n, int probeType = VALUE);
00084    NrroSP getNrro(unsigned int vol=0);
00085    void getNumChannels();
00086 
00087    NrroKernel getKernel() const               {return _nk;}
00088    void       setKernel(const NrroKernel &nk) {_nk=nk; setKernel();}
00089 
00090    /////////////////////////////
00091    // probe and get value
00092    TYPE *operator() (float x=0, float y=0, float z=0);
00093 
00094    gutz::vec3f getProbePos() const {return _lastProbe;}
00095 
00096    int valLen(int v) const;
00097    TYPE *getVal(int v);
00098 
00099    int gradLen(int v) const;
00100    TYPE *getGrad(int v);
00101 
00102    TYPE *getGradMag(int v);
00103 
00104    int gradEvalLen(int v) const;
00105    TYPE *getGradEval(int v);
00106 
00107    int gradEvecLen(int v) const;
00108    TYPE *getGradEvec(int v);
00109 
00110    TYPE *getNormal(int v);
00111 
00112    /// ...
00113 
00114 
00115    TYPE *grad()  {return 0;}
00116 
00117 protected:
00118 
00119 
00120    void update();
00121    void setKernel();
00122    PKIND getProbeKind(const Nrro &n);
00123    unsigned int nrro2GageType(const Nrro &n, int probeType, PKIND kind) const;
00124    unsigned int gage2NrroType(unsigned int t, PKIND kind) const ;
00125 
00126    gageContext   *_ctx;
00127    NrroSPVec      _nvec;
00128 
00129    gutz::vec3f    _lastProbe;
00130 
00131    NrroKernel     _nk;
00132 
00133    bool           _multi;
00134 };
00135 
00136 
00137 #endif
00138 
00139 

Send questions, comments, and bug reports to:
jmk