00001
00002
00008 #if !defined(__geom_mesh_iss_distance_h__)
00009 #define __geom_mesh_iss_distance_h__
00010
00011 #include "geometry.h"
00012
00013 #include "../simplex/simplex_distance.h"
00014
00015 #include "../../../ads/algorithm/min_max.h"
00016
00017 BEGIN_NAMESPACE_GEOM
00018
00019
00022
00023
00024
00025
00026
00028
00046 template<bool _A, typename _T, typename _V, typename _IS>
00047 typename IndSimpSetIncAdj<2,1,_A,_T,_V,_IS>::Number
00048 computeSignedDistance
00049 (const IndSimpSetIncAdj<2,1,_A,_T,_V,_IS>& mesh,
00050 const ads::Array<1, typename IndSimpSetIncAdj<2,1,_A,_T,_V,_IS>::Number>&
00051 squaredHalfLengths,
00052 const typename IndSimpSetIncAdj<2,1,_A,_T,_V,_IS>::Vertex& point,
00053 typename IndSimpSetIncAdj<2,1,_A,_T,_V,_IS>::Vertex* closestPoint);
00054
00056
00060 template<bool _A, typename _T, typename _V, typename _IS>
00061 typename IndSimpSetIncAdj<2,1,_A,_T,_V,_IS>::Number
00062 computeSignedDistance
00063 (const IndSimpSetIncAdj<2,1,_A,_T,_V,_IS>& mesh,
00064 const typename IndSimpSetIncAdj<2,1,_A,_T,_V,_IS>::Vertex& point,
00065 typename IndSimpSetIncAdj<2,1,_A,_T,_V,_IS>::Vertex* closestPoint);
00066
00068
00072 template<bool _A, typename _T, typename _V, typename _IS>
00073 inline
00074 typename IndSimpSetIncAdj<2,1,_A,_T,_V,_IS>::Number
00075 computeSignedDistance
00076 (const IndSimpSetIncAdj<2,1,_A,_T,_V,_IS>& mesh,
00077 const typename IndSimpSetIncAdj<2,1,_A,_T,_V,_IS>::Vertex& point) {
00078 typename IndSimpSetIncAdj<2,1,_A,_T,_V,_IS>::Vertex closestPoint;
00079 return computeSignedDistance(mesh, point, &closestPoint);
00080 }
00081
00082
00083
00084
00085
00087 template<bool _A, typename _T, typename _V, typename _IS,
00088 typename InputIterator, typename NumberOutputIterator,
00089 typename PointOutputIterator>
00090 void
00091 computeSignedDistance
00092 (const IndSimpSetIncAdj<2,1,_A,_T,_V,_IS>& mesh,
00093 InputIterator pointsBeginning, InputIterator pointsEnd,
00094 NumberOutputIterator distances, PointOutputIterator closestPoints);
00095
00097 template<bool _A, typename _T, typename _V, typename _IS,
00098 typename InputIterator, typename NumberOutputIterator>
00099 inline
00100 void
00101 computeSignedDistance
00102 (const IndSimpSetIncAdj<2,1,_A,_T,_V,_IS>& mesh,
00103 InputIterator pointsBeginning, InputIterator pointsEnd,
00104 NumberOutputIterator distances) {
00105 computeSignedDistance(mesh, pointsBeginning, pointsEnd, distances,
00106 ads::constructTrivialOutputIterator());
00107 }
00108
00109
00110
00111
00112
00114
00132 template<bool _A, typename _T, typename _V, typename _IS>
00133 typename IndSimpSetIncAdj<3,2,_A,_T,_V,_IS>::Number
00134 computeSignedDistance
00135 (const IndSimpSetIncAdj<3,2,_A,_T,_V,_IS>& mesh,
00136 const ads::Array<1, typename IndSimpSetIncAdj<3,2,_A,_T,_V,_IS>::Number>&
00137 squaredLongestEdgeLengths,
00138 const typename IndSimpSetIncAdj<3,2,_A,_T,_V,_IS>::Vertex& point,
00139 typename IndSimpSetIncAdj<3,2,_A,_T,_V,_IS>::Vertex* closestPoint);
00140
00142
00146 template<bool _A, typename _T, typename _V, typename _IS>
00147 typename IndSimpSetIncAdj<3,2,_A,_T,_V,_IS>::Number
00148 computeSignedDistance
00149 (const IndSimpSetIncAdj<3,2,_A,_T,_V,_IS>& mesh,
00150 const typename IndSimpSetIncAdj<3,2,_A,_T,_V,_IS>::Vertex& point,
00151 typename IndSimpSetIncAdj<3,2,_A,_T,_V,_IS>::Vertex* closestPoint);
00152
00154
00158 template<bool _A, typename _T, typename _V, typename _IS>
00159 inline
00160 typename IndSimpSetIncAdj<3,2,_A,_T,_V,_IS>::Number
00161 computeSignedDistance
00162 (const IndSimpSetIncAdj<3,2,_A,_T,_V,_IS>& mesh,
00163 const typename IndSimpSetIncAdj<3,2,_A,_T,_V,_IS>::Vertex& point) {
00164 typename IndSimpSetIncAdj<3,2,_A,_T,_V,_IS>::Vertex closestPoint;
00165 return computeSignedDistance(mesh, point, &closestPoint);
00166 }
00167
00168
00169
00170
00171
00173 template<bool _A, typename _T, typename _V, typename _IS,
00174 typename InputIterator, typename NumberOutputIterator,
00175 typename PointOutputIterator>
00176 void
00177 computeSignedDistance
00178 (const IndSimpSetIncAdj<3,2,_A,_T,_V,_IS>& mesh,
00179 InputIterator pointsBeginning, InputIterator pointsEnd,
00180 NumberOutputIterator distances, PointOutputIterator closestPoints);
00181
00183 template<bool _A, typename _T, typename _V, typename _IS,
00184 typename InputIterator, typename NumberOutputIterator>
00185 inline
00186 void
00187 computeSignedDistance
00188 (const IndSimpSetIncAdj<3,2,_A,_T,_V,_IS>& mesh,
00189 InputIterator pointsBeginning, InputIterator pointsEnd,
00190 NumberOutputIterator distances) {
00191 computeSignedDistance(mesh, pointsBeginning, pointsEnd, distances,
00192 ads::constructTrivialOutputIterator());
00193 }
00194
00196
00197 END_NAMESPACE_GEOM
00198
00199 #define __geom_mesh_iss_distance_ipp__
00200 #include "distance.ipp"
00201 #undef __geom_mesh_iss_distance_ipp__
00202
00203 #endif