1 #ifndef AIMS_SHORTESTPATH_H 2 #define AIMS_SHORTESTPATH_H 43 template<
typename Val>
48 uint ns=initmesh.vertex().size();
62 for (
uint l=0; l<ns; l++)
64 if (tex[0].item(l)==value)
65 initMap.
item(l)=(short) 0;
66 else initMap.
item(l)=(short) -1;
68 initMap.
item(dep)=(short) 100;
71 std::map<uint,float> res;
73 for (
uint l=0; l<ns; l++)
75 res[l]=(float) distanceMap[0].item(l);
82 uint j, inext, iprevious=i;
84 result[0].
item(i)=(Val) value;
93 std::set<uint> vois=neigh[i];
94 std::set<uint>::iterator itVois=vois.begin();
96 for (; itVois != vois.end(); ++itVois)
99 if ((tex[0].item(j)==value) && (j != iprevious))
103 inext=j; distmin=res[j];
107 debugTex[0].
item(inext)=value*2;
110 std::cerr <<
"ShortestPath->GraphPath<Val>::process : problem. There is no path between start and end included in the provided set" << std::endl;
112 debugTex[0].
item(dep)=value*3;
113 debugTex[0].
item(arr)=value*3;
114 debugW.
write(debugTex);
118 longueur+=(initmesh.vertex()[i] - initmesh.vertex()[inext]).
norm();
119 iprevious=i; i=inext;
120 result[0].
item(i)=(Val) value;
133 template<
typename Val>
137 process(tex, initmesh, value, dep, arr);
TimeTexture< Val > process(TimeTexture< Val > &tex, AimsSurfaceTriangle &initmesh, Val value, int dep, int arr)
AIMSDATA_API AimsTimeSurface< 3, Void > AimsSurfaceTriangle
const T & item(int n) const
Texture< float > MeshDistance(const AimsSurface< 3, Void > &mesh, const Texture< T > &inittex, bool allowUnreached)
float getLongueur(TimeTexture< Val > &tex, AimsSurfaceTriangle &initmesh, Val value, int dep, int arr)
static std::vector< std::set< uint > > surfaceNeighbours(const AimsSurface< D, T > &surf)
const T & item(int n) const
virtual bool write(const T &obj, bool ascii=false, const std::string *format=0)
AIMSDATA_API float norm(const Tensor &thing)