11 #ifndef __BRAY_Procedural__
12 #define __BRAY_Procedural__
28 template <
typename PREC>
87 T &
castTo() {
return *
reinterpret_cast<T *
>(
this); }
89 const T &
castTo()
const {
return *
reinterpret_cast<T *
>(
this); }
95 void inc_ref() { ++ref_count; }
151 Hit *
get()
const noexcept {
return myHit; }
192 return myFactory->paramList();
210 template <
typename T>
213 doSetParameter(key, &val, 1);
216 template <
typename T>
219 doSetParameter(key, values, n);
250 return checkIsValid();
269 virtual HitPtr
intersect(
const Ray32 &ray)
const = 0;
270 virtual HitPtr
intersect(
const Ray64 &ray)
const = 0;
350 HitPtr getHit()
const;
357 virtual HitPtr newHit()
const;
361 virtual void errorMessage(
const char *fmt, ...)
366 virtual
void doBeginUpdate() = 0;
367 virtual
void doEndUpdate() = 0;
370 virtual
bool checkIsValid() const = 0;
377 const
int64* values,
int n = 1) = 0;
379 const
fpreal32* values,
int n = 1) = 0;
BRAY_EventType
Types of events that can be sent as updates to the renderer.
GLenum GLuint GLenum GLsizei const GLchar * buf
virtual const BRAY_AttribList * paramList() const
HitPtr(const HitPtr &src) noexcept
float BRAYtime
Consistent representation of time type within BRAY.
GT_API const UT_StringHolder time
void setParameter(const UT_StringRef &key, const T &val)
const BRAY_ProceduralFactory * factory() const
Return the factory definition.
UT_Vector3T< float > UT_Vector3
bool isValid() const
Check whether the procedural is valid.
void swap(T &lhs, T &rhs)
Hit * operator->() const noexcept
const UT_StringHolder & className() const
Return a name for this procedural. This defaults to factory()->name();.
void setParameter(const UT_StringRef &key, const T *values, int n)
Class which writes ASCII or binary JSON streams.
virtual UT_Vector3 displayColor() const
Return a display color for low-quality rendering.
void reset(Hit *hit) noexcept
#define SYS_PRINTF_CHECK_ATTRIBUTE(string_index, first_to_check)
const UT_Vector3T< PREC > & org
HitPtr & operator=(const HitPtr &src)
HitPtr(Hit *ptr) noexcept
const UT_Vector3T< PREC > & dir
HitPtr(HitPtr &&src) noexcept
Each BRAY_Object can define a list of attributes that it can evaluate.
GLenum GLsizei GLsizei GLint * values
IMATH_CONSTEXPR14 bool intersect(const Line3< T > &line, const Vec3< T > &v0, const Vec3< T > &v1, const Vec3< T > &v2, Vec3< T > &pt, Vec3< T > &barycentric, bool &front) IMATH_NOEXCEPT
HitPtr & operator=(HitPtr &&src)
GLubyte GLubyte GLubyte GLubyte w
void swap(HitPtr &s) noexcept
SIM_API const UT_StringHolder distance
Hit & operator*() const noexcept
Hit(fpreal d=SYS_FPREAL_MAX)