20 #ifndef __UT_GeometryPredicate_h__
21 #define __UT_GeometryPredicate_h__
33 template<
typename REAL,
bool USEFILTER = true,
bool EXACT = true>
44 void exactinit(
const REAL bbox_size[3]);
56 const REAL pc[2])
const;
70 const REAL pd[3])
const;
84 const REAL pd[2])
const;
100 const REAL pe[3])
const;
110 REAL ah, REAL bh, REAL ch, REAL dh, REAL eh)
const
118 REAL ah, REAL bh, REAL ch, REAL dh, REAL eh)
const;
141 namespace UT_GeometryPredicate
146 template<
typename REAL>
149 #define SPECIALIZE_GET_DEFAULT(REAL) \
152 const UT_GeometryPredicates<REAL,false,true>& \
153 getDefault<REAL>() { return ut_global_predicates_##REAL; }
159 template<typename REAL>
165 {
return getDefault<REAL>().
orient2d(pa,pb,pc); }
166 template<
typename REAL>
172 {
return getDefault<REAL>().
orient2d(pa,pb,pc); }
176 template<
typename REAL>
183 {
return getDefault<REAL>().
orient3d(pa,pb,pc,pd); }
184 template<
typename REAL>
191 {
return getDefault<REAL>().
orient3d(pa,pb,pc,pd); }
195 template<
typename REAL>
202 {
return getDefault<REAL>().
incircle(pa,pb,pc,pd); }
203 template<
typename REAL>
210 {
return getDefault<REAL>().
incircle(pa,pb,pc,pd); }
214 template<
typename REAL>
222 {
return getDefault<REAL>().
insphere(pa,pb,pc,pd,pe); }
223 template<
typename REAL>
231 {
return getDefault<REAL>().
insphere(pa,pb,pc,pd,pe); }
235 template<
typename REAL>
243 REAL ah, REAL bh, REAL ch, REAL dh, REAL eh)
244 {
return getDefault<REAL>().
orient4d(pa,pb,pc,pd,pe,ah,bh,ch,dh,eh); }
245 template<
typename REAL>
253 REAL ah, REAL bh, REAL ch, REAL dh, REAL eh)
254 {
return getDefault<REAL>().
orient4d(pa,pb,pc,pd,pe,ah,bh,ch,dh,eh); }
258 template<
typename REAL,
bool USEFILTER>
269 Vec2(v2.
y(), v2.
z()),
272 Vec2(v2.
z(), v2.
x()),
275 Vec2(v2.
x(), v2.
y()),
279 template<
typename REAL>
285 return UTcrossExact<REAL,false>(
v1,
v2, UT_GeometryPredicate::getDefault<REAL>());
295 double pa[2] = {a[0], a[1]};
296 double pb[2] = {b[0], b[1]};
297 double pc[2] = {c[0], c[1]};
298 return UT_GeometryPredicate::orient2d<fpreal64>(pa, pb, pc);
306 return UT_GeometryPredicate::orient2d<fpreal64>(pa.data(), pb.data(), pc.data());
314 return UT_GeometryPredicate::orient2d<fpreal64>(pa, pb, pc);
325 double pa[3] = {a[0], a[1], a[2]};
326 double pb[3] = {b[0], b[1], b[2]};
327 double pc[3] = {c[0], c[1], c[2]};
328 double pd[3] = {d[0], d[1], d[2]};
329 return UT_GeometryPredicate::orient3d<fpreal64>(pa, pb, pc, pd);
338 return UT_GeometryPredicate::orient3d<fpreal64>(pa.data(), pb.data(), pc.data(), pd.data());
347 return UT_GeometryPredicate::orient3d<fpreal64>(pa, pb, pc, pd);
359 double pa[2] = {a[0], a[1]};
360 double pb[2] = {b[0], b[1]};
361 double pc[2] = {c[0], c[1]};
362 double pd[2] = {d[0], d[1]};
363 return UT_GeometryPredicate::incircle<fpreal64>(pa, pb, pc, pd);
372 return UT_GeometryPredicate::incircle<fpreal64>(pa.data(), pb.data(),
373 pc.data(), pd.data());
382 return UT_GeometryPredicate::incircle<fpreal64>(pa, pb, pc, pd);
395 double pa[3] = {a[0], a[1], a[2]};
396 double pb[3] = {b[0], b[1], b[2]};
397 double pc[3] = {c[0], c[1], c[2]};
398 double pd[3] = {d[0], d[1], d[2]};
399 double pe[3] = {e[0], e[1], e[2]};
400 return UT_GeometryPredicate::insphere<fpreal64>(pa, pb, pc, pd, pe);
410 return UT_GeometryPredicate::insphere<fpreal64>(pa.data(), pb.data(), pc.data(),
411 pd.data(), pe.data());
421 return UT_GeometryPredicate::insphere<fpreal64>(pa, pb, pc, pd, pe);
424 #endif // __UT_GeometryPredicate_h__
SYS_FORCE_INLINE REAL orient3d(const UT_Vector3T< REAL > &pa, const UT_Vector3T< REAL > &pb, const UT_Vector3T< REAL > &pc, const UT_Vector3T< REAL > &pd)
REAL incircle(const UT_Vector2T< REAL > &pa, const UT_Vector2T< REAL > &pb, const UT_Vector2T< REAL > &pc, const UT_Vector2T< REAL > &pd) const
REAL orient3d(const UT_Vector3T< REAL > &pa, const UT_Vector3T< REAL > &pb, const UT_Vector3T< REAL > &pc, const UT_Vector3T< REAL > &pd) const
#define SYS_DEPRECATED_HDK_REPLACE(__V__, __R__)
constexpr SYS_FORCE_INLINE T & z() noexcept
#define SPECIALIZE_GET_DEFAULT(REAL)
GLboolean GLboolean GLboolean GLboolean a
SYS_FORCE_INLINE double UTgeometryPredicateIncircle(const UT_Vector2 &a, const UT_Vector2 &b, const UT_Vector2 &c, const UT_Vector2 &d)
SYS_FORCE_INLINE REAL insphere(const UT_Vector3T< REAL > &pa, const UT_Vector3T< REAL > &pb, const UT_Vector3T< REAL > &pc, const UT_Vector3T< REAL > &pd, const UT_Vector3T< REAL > &pe)
GLfloat GLfloat GLfloat v2
SYS_FORCE_INLINE REAL orient4d(const REAL pa[3], const REAL pb[3], const REAL pc[3], const REAL pd[3], const REAL pe[3], REAL ah, REAL bh, REAL ch, REAL dh, REAL eh)
SYS_FORCE_INLINE REAL incircle(const UT_Vector2T< REAL > &pa, const UT_Vector2T< REAL > &pb, const UT_Vector2T< REAL > &pc, const UT_Vector2T< REAL > &pd)
constexpr SYS_FORCE_INLINE const T * data() const noexcept
SYS_FORCE_INLINE REAL orient3d(const REAL pa[3], const REAL pb[3], const REAL pc[3], const REAL pd[3])
REAL orient2d(const UT_Vector2T< REAL > &pa, const UT_Vector2T< REAL > &pb, const UT_Vector2T< REAL > &pc) const
constexpr SYS_FORCE_INLINE const T * data() const noexcept
SYS_FORCE_INLINE double UTgeometryPredicateOrient2d(const UT_Vector2 &a, const UT_Vector2 &b, const UT_Vector2 &c)
GLboolean GLboolean GLboolean b
UT_API const UT_GeometryPredicates< fpreal64, false, true > ut_global_predicates_fpreal64
REAL orient4d(const UT_Vector3T< REAL > &pa, const UT_Vector3T< REAL > &pb, const UT_Vector3T< REAL > &pc, const UT_Vector3T< REAL > &pd, const UT_Vector3T< REAL > &pe, REAL ah, REAL bh, REAL ch, REAL dh, REAL eh) const
SYS_FORCE_INLINE UT_Vector3T< REAL > UTcrossExact(const UT_Vector3T< REAL > &v1, const UT_Vector3T< REAL > &v2, const UT_GeometryPredicates< REAL, USEFILTER, true > &pred)
SYS_FORCE_INLINE REAL incircle(const REAL pa[2], const REAL pb[2], const REAL pc[2], const REAL pd[2])
SYS_FORCE_INLINE REAL insphere(const REAL pa[3], const REAL pb[3], const REAL pc[3], const REAL pd[3], const REAL pe[3])
REAL insphere(const UT_Vector3T< REAL > &pa, const UT_Vector3T< REAL > &pb, const UT_Vector3T< REAL > &pc, const UT_Vector3T< REAL > &pd, const UT_Vector3T< REAL > &pe) const
SYS_FORCE_INLINE REAL orient4d(const UT_Vector3T< REAL > &pa, const UT_Vector3T< REAL > &pb, const UT_Vector3T< REAL > &pc, const UT_Vector3T< REAL > &pd, const UT_Vector3T< REAL > &pe, REAL ah, REAL bh, REAL ch, REAL dh, REAL eh)
UT_API const UT_GeometryPredicates< fpreal32, false, true > ut_global_predicates_fpreal32
SYS_FORCE_INLINE double UTgeometryPredicateOrient3d(const UT_Vector3 &a, const UT_Vector3 &b, const UT_Vector3 &c, const UT_Vector3 &d)
SYS_FORCE_INLINE REAL orient2d(const UT_Vector2T< REAL > &pa, const UT_Vector2T< REAL > &pb, const UT_Vector2T< REAL > &pc)
const UT_GeometryPredicates< REAL, false, true > & getDefault()
constexpr SYS_FORCE_INLINE T & y() noexcept
SYS_FORCE_INLINE REAL orient2d(const REAL pa[2], const REAL pb[2], const REAL pc[2])
SYS_FORCE_INLINE double UTgeometryPredicateInsphere(const UT_Vector3 &a, const UT_Vector3 &b, const UT_Vector3 &c, const UT_Vector3 &d, const UT_Vector3 &e)
constexpr SYS_FORCE_INLINE T & x() noexcept