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

VolSlicer.h

Go to the documentation of this file.
00001 //------------------------------------------------------------------------
00002 //
00003 //   Joe Kniss
00004 //     6-17-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 //VolSlicer.h
00019 
00020 /// A base class for slicing a volume.  More generaly, generating
00021 ///  volume samples.  A strategy for "VolRenBase". 
00022 /// Also implements the standard volume slicer.
00023 
00024 #ifndef __VOLUME_SLICER_DOT_H
00025 #define __VOLUME_SLICER_DOT_H
00026 
00027 #include <mathGutz.h>
00028 #include <arrayGutz.h>
00029 #include <volume/Volytope.h>
00030 #include <volume/VolSamples.h>
00031 
00032 class VolSlicer : public gutz::Counted {
00033 public:
00034    VolSlicer():_sampleSpace(.01f){}
00035    virtual ~VolSlicer(){}
00036 
00037    void setSampleSpace(float sp) {_sampleSpace = sp;}
00038    float getSampleSpace()        {return _sampleSpace;}
00039 
00040    virtual void slice( gutz::mat4f  mv,    // Model View Matrix
00041       VolytopeSP   vtp,   // A class containing a convex polytope with edge info
00042       VolSamplesSP vs,    // A class containing the verts, tcoords, idx, and prims for slices
00043       gutz::vec3f  axis);       // axis to slice along eye-space coords
00044 
00045 protected:
00046    /////////////////////////////////////////////////////////////
00047    /// interect
00048    inline int intersect(
00049       const gutz::vec3f &m0, const gutz::vec3f &m1, //object-space line end points
00050       const gutz::vec3f &t0, const gutz::vec3f &t1, //texture-space line end points
00051       const gutz::vec3f &e0, const gutz::vec3f &e1, //eye-space line end points
00052       const gutz::vec3f &sp, const gutz::vec3f &sn, //plane point & norm
00053       gutz::vec3f &mnew,                            //object-space line/plane intersection
00054       gutz::vec4f &tnew,                            //texture-space line/plane intersection
00055       gutz::vec3f &enew);                           //eye-space line/plane intersection 
00056 
00057    float _sampleSpace;
00058 
00059 };
00060 
00061 typedef gutz::SmartPtr<VolSlicer> VolSlicerSP;
00062 
00063 #endif
00064 

Send questions, comments, and bug reports to:
jmk