20 #ifndef __UT_GeometryPredicate_h__
21 #define __UT_GeometryPredicate_h__
33 template<
typename REAL,
bool USEFILTER = true,
bool EXACT = true>
45 void exactinit(
const REAL bbox_size[3]);
57 const REAL pc[2])
const;
71 const REAL pd[3])
const;
85 const REAL pd[2])
const;
101 const REAL pe[3])
const;
111 REAL ah, REAL bh, REAL ch, REAL dh, REAL eh)
const
119 REAL ah, REAL bh, REAL ch, REAL dh, REAL eh)
const;
142 namespace UT_GeometryPredicate
147 template<
typename REAL>
150 #define SPECIALIZE_GET_DEFAULT(REAL) \
153 const UT_GeometryPredicates<REAL,false,true>& \
154 getDefault<REAL>() { return ut_global_predicates_##REAL; }
160 template<typename REAL>
166 {
return getDefault<REAL>().
orient2d(pa,pb,pc); }
167 template<
typename REAL>
173 {
return getDefault<REAL>().
orient2d(pa,pb,pc); }
177 template<
typename REAL>
184 {
return getDefault<REAL>().
orient3d(pa,pb,pc,pd); }
185 template<
typename REAL>
192 {
return getDefault<REAL>().
orient3d(pa,pb,pc,pd); }
196 template<
typename REAL>
203 {
return getDefault<REAL>().
incircle(pa,pb,pc,pd); }
204 template<
typename REAL>
211 {
return getDefault<REAL>().
incircle(pa,pb,pc,pd); }
215 template<
typename REAL>
223 {
return getDefault<REAL>().
insphere(pa,pb,pc,pd,pe); }
224 template<
typename REAL>
232 {
return getDefault<REAL>().
insphere(pa,pb,pc,pd,pe); }
236 template<
typename REAL>
244 REAL ah, REAL bh, REAL ch, REAL dh, REAL eh)
245 {
return getDefault<REAL>().
orient4d(pa,pb,pc,pd,pe,ah,bh,ch,dh,eh); }
246 template<
typename REAL>
254 REAL ah, REAL bh, REAL ch, REAL dh, REAL eh)
255 {
return getDefault<REAL>().
orient4d(pa,pb,pc,pd,pe,ah,bh,ch,dh,eh); }
259 template<
typename REAL,
bool USEFILTER>
270 Vec2(v2.
y(), v2.
z()),
273 Vec2(v2.
z(), v2.
x()),
276 Vec2(v2.
x(), v2.
y()),
280 template<
typename REAL>
286 return UTcrossExact<REAL,false>(
v1,
v2, UT_GeometryPredicate::getDefault<REAL>());
296 double pa[2] = {a[0], a[1]};
297 double pb[2] = {b[0], b[1]};
298 double pc[2] = {c[0], c[1]};
299 return UT_GeometryPredicate::orient2d<fpreal64>(pa, pb, pc);
307 return UT_GeometryPredicate::orient2d<fpreal64>(pa.data(), pb.data(), pc.data());
315 return UT_GeometryPredicate::orient2d<fpreal64>(pa, pb, pc);
326 double pa[3] = {a[0], a[1], a[2]};
327 double pb[3] = {b[0], b[1], b[2]};
328 double pc[3] = {c[0], c[1], c[2]};
329 double pd[3] = {d[0], d[1], d[2]};
330 return UT_GeometryPredicate::orient3d<fpreal64>(pa, pb, pc, pd);
339 return UT_GeometryPredicate::orient3d<fpreal64>(pa.data(), pb.data(), pc.data(), pd.data());
348 return UT_GeometryPredicate::orient3d<fpreal64>(pa, pb, pc, pd);
360 double pa[2] = {a[0], a[1]};
361 double pb[2] = {b[0], b[1]};
362 double pc[2] = {c[0], c[1]};
363 double pd[2] = {d[0], d[1]};
364 return UT_GeometryPredicate::incircle<fpreal64>(pa, pb, pc, pd);
373 return UT_GeometryPredicate::incircle<fpreal64>(pa.data(), pb.data(),
374 pc.data(), pd.data());
383 return UT_GeometryPredicate::incircle<fpreal64>(pa, pb, pc, pd);
396 double pa[3] = {a[0], a[1], a[2]};
397 double pb[3] = {b[0], b[1], b[2]};
398 double pc[3] = {c[0], c[1], c[2]};
399 double pd[3] = {d[0], d[1], d[2]};
400 double pe[3] = {e[0], e[1], e[2]};
401 return UT_GeometryPredicate::insphere<fpreal64>(pa, pb, pc, pd, pe);
411 return UT_GeometryPredicate::insphere<fpreal64>(pa.data(), pb.data(), pc.data(),
412 pd.data(), pe.data());
422 return UT_GeometryPredicate::insphere<fpreal64>(pa, pb, pc, pd, pe);
425 #endif // __UT_GeometryPredicate_h__
GLboolean GLboolean GLboolean b
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)
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)
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
GLfloat GLfloat GLfloat v2
SYS_FORCE_INLINE REAL orient3d(const REAL pa[3], const REAL pb[3], const REAL pc[3], const REAL pd[3])
GLboolean GLboolean GLboolean GLboolean a
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)
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