00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef FILE_UPDATER_BASECLASS_HXX
00021
00022
00023 #include "../errors.cxx"
00024 #include <stdio.h>
00025
00026
00027 namespace Multivac
00028 {
00029
00030
00032
00034
00035 template <class T>
00036 class CFastMarchingNode;
00037
00038
00040
00042
00045
00051 template <class T>
00052 class CUpdater
00053 {
00054
00055
00056
00057
00058
00059
00060 public:
00061
00062 typedef CFastMarchingNode<T> heap_node_value_type;
00063 typedef CFastMarchingNode<T>& heap_node_reference;
00064 typedef const CFastMarchingNode<T>& heap_node_const_reference;
00065 typedef CFastMarchingNode<T>* heap_node_pointer;
00066 typedef const CFastMarchingNode<T>* heap_node_const_pointer;
00067
00068
00069
00070
00071
00072
00073 protected:
00074
00075
00076
00079 Matrix<T> Temp;
00080
00082 int offset;
00083
00086 bool NeedSpeedUpdateFlag;
00087
00090 bool NeedInitializationFlag;
00091
00092
00093
00094
00095
00096
00099 Vector<List<Vector<int> >, Vect_Full, NewAlloc<List<Vector<int> > > > Tube;
00101 int TubeSemiWidth;
00102
00106 Matrix<int> Barrier;
00108 int BarrierWidth;
00109
00113 Matrix<int> OutSpace;
00115 int OutSpaceWidth;
00116
00121 ArrayHeap<CFastMarchingNode<T> > TrialPoints;
00124 Matrix<int> PointersToNodes;
00126 T TMax;
00127
00128
00129
00130
00131
00132
00133 public:
00134
00135 CUpdater() throw();
00136
00137 virtual ~CUpdater() throw();
00138
00139
00140
00141
00142
00143
00144 public:
00145
00146
00147
00148 virtual bool IsNarrowBand() const = 0;
00149 virtual bool IsFastMarching() const = 0;
00150
00151 virtual void Init(CMesh<T>& Mesh, CLevelSet<T>& Phi) = 0;
00152 virtual void UpdateLevelSet(T Delta_t, CMesh<T>& Mesh,
00153 CSpeedFunction<T>& F,
00154 CLevelSet<T>& Phi,
00155 T CurrentTime) = 0;
00156
00157 virtual bool NeedSpeedUpdate() const;
00158 virtual bool NeedInitialization() const;
00159
00160 virtual Matrix<T>& GetTemp();
00161
00162 int GetOffset();
00163
00164
00165
00166
00167
00168
00169 Vector<List<Vector<int> >, Vect_Full, NewAlloc<List<Vector<int> > > >& GetTube();
00170 int GetTubeSemiWidth() const;
00171
00172 Matrix<int>& GetBarrier();
00173 int GetBarrierWidth() const;
00174 Matrix<int>& GetOutSpace();
00175 int GetOutSpaceWidth() const;
00176
00177
00178
00179 virtual bool KeepOnWorking() const;
00180
00181 ArrayHeap<CFastMarchingNode<T> >& GetTrialPoints();
00182 Matrix<int>& GetPointersToNodes();
00183
00184 T GetTMax();
00185
00186 };
00187
00188
00189 }
00190
00191
00192 #define FILE_UPDATER_BASECLASS_HXX
00193 #endif