Main Page | Class Hierarchy | Class List | File List | Class Members

isosurface.h

00001 /* ************************************************************************* 00002 isosurface.h - description 00003 ------------------- 00004 begin : Wed Oct 16 2002 00005 copyright : (C) 2002 by Micha Riser 00006 email : mriser@gmx.net 00007 00008 $Id: isosurface_8h-source.html,v 1.1 2005/02/04 21:02:27 micha Exp $ 00009 00010 ************************************************************************* */ 00011 00012 /* ************************************************************************* 00013 * * 00014 * This program is free software; you can redistribute it and/or modify * 00015 * it under the terms of the GNU General Public License as published by * 00016 * the Free Software Foundation; either version 2 of the License, or * 00017 * (at your option) any later version. * 00018 * * 00019 ************************************************************************* */ 00020 00021 #ifndef ISOSURFACE_H 00022 #define ISOSURFACE_H 00023 00024 #include "object3d.h" 00025 #include "intersection.h" 00026 #include "function.h" 00027 00033 class Isosurface: public Object3D { 00034 00035 public: // Type definitions 00036 typedef Function<const Vector3,DBL> IsosurfaceFunction; 00037 00038 public: // Constructor and destructor 00039 00047 Isosurface(IsosurfaceFunction* func, Object3D* cont, DBL maxd, bool doeval); 00048 00049 ~Isosurface(); 00050 00051 private: // Private constructor 00054 Isosurface(const Isosurface&); 00055 Isosurface& operator=(const Isosurface&); 00056 00057 public: // Public methods 00058 00059 // Inherited from Object3D 00060 Object3D* duplicate() const; 00061 bool isInsideAt(const Vector3& locallocation) const; 00062 Intersection* intersectLocalLimitedTime(const Ray& r, DBL maxtime) const; 00063 00064 private: // Constants 00065 static const DBL NORMAL_E; 00066 static const int MAX_STEP_INCREASE = 1024; 00067 #ifdef WRONG_INNER_CLASSES_ACCESS 00068 public: 00069 #endif 00070 static const DBL K_INCREASE_FACT; 00071 00072 private: // Static members 00075 static HitStatistics stat; 00076 static int isosurfacecount; 00077 00078 private: // Private attributes 00079 #ifdef WRONG_INNER_CLASSES_ACCESS 00080 public: 00081 #endif 00082 00086 Object3D* container; 00087 00091 IsosurfaceFunction* f; 00092 00093 mutable DBL K; 00094 mutable DBL missstepsize; 00095 bool eval; 00096 00097 // max derivative statistics 00098 mutable MaxStatistics<DBL> maxdstat; 00099 00100 private: // Private inner classes 00101 00104 class StackElement { 00105 public: // Public attributes 00106 DBL time; 00107 DBL value; 00108 public: // Constructors and destructor 00109 StackElement() {} 00110 StackElement(DBL t, DBL v): time(t), value(v) {} 00111 }; 00112 00116 class IsosurfaceIntersection: public Intersection { 00117 00118 public: // Public attributes 00119 bool nointersection; 00120 00121 public: // Constructor and destructor 00122 IsosurfaceIntersection(const Isosurface* object, const Ray& r, DBL tmax); 00123 ~IsosurfaceIntersection(); 00124 00125 public: // Public methods 00126 void next(); 00127 DBL currentTime(); 00128 Vector3 normal(); 00129 00130 private: // Private attributes 00131 const Isosurface* iso; 00132 StackElement prelast, last; 00133 DBL root; 00134 DBL klocal; 00135 DBL maxtime; 00136 DBL t_container_max; 00137 bool containerhit; 00138 Intersection* i_container; 00139 00140 private: // Private methods 00141 void findExactRoot(); 00142 void findRoot(); 00143 DBL calcPolyRoot(); 00144 00145 }; 00146 00147 }; 00148 00149 #endif

Generated on Thu Jan 27 12:16:05 2005 for raytracer.kdevelop by doxygen 1.3.8