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,
00100 NewAlloc<List<Vector<int> > > > Tube;
00102 int TubeSemiWidth;
00103
00107 Matrix<int> Barrier;
00109 int BarrierWidth;
00110
00115 Matrix<int> OutSpace;
00117 int OutSpaceWidth;
00118
00123 ArrayHeap<CFastMarchingNode<T> > TrialPoints;
00126 Matrix<int> PointersToNodes;
00128 T TMax;
00129
00130
00131
00132
00133
00134
00135 public:
00136
00137 CUpdater() throw();
00138
00139 virtual ~CUpdater() throw();
00140
00141
00142
00143
00144
00145
00146 public:
00147
00148
00149
00150 virtual bool IsNarrowBand() const = 0;
00151 virtual bool IsFastMarching() const = 0;
00152
00153 virtual void Init(CMesh<T>& Mesh, CLevelSet<T>& Phi) = 0;
00154 virtual void UpdateLevelSet(T Delta_t, CMesh<T>& Mesh,
00155 CSpeedFunction<T>& F,
00156 CLevelSet<T>& Phi,
00157 T CurrentTime) = 0;
00158
00159 virtual bool NeedSpeedUpdate() const;
00160 virtual bool NeedInitialization() const;
00161
00162 virtual Matrix<T>& GetTemp();
00163
00164 int GetOffset();
00165
00166
00167
00168
00169
00170
00171 Vector<List<Vector<int> >, Vect_Full,
00172 NewAlloc<List<Vector<int> > > >& GetTube();
00173 int GetTubeSemiWidth() const;
00174
00175 Matrix<int>& GetBarrier();
00176 int GetBarrierWidth() const;
00177 Matrix<int>& GetOutSpace();
00178 int GetOutSpaceWidth() const;
00179
00180
00181
00182 virtual bool KeepOnWorking() const;
00183
00184 ArrayHeap<CFastMarchingNode<T> >& GetTrialPoints();
00185 Matrix<int>& GetPointersToNodes();
00186
00187 T GetTMax();
00188
00189 };
00190
00191
00192 }
00193
00194
00195 #define FILE_UPDATER_BASECLASS_HXX
00196 #endif