HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TS_Primitive.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: TS_Primitive (C++)
7  *
8  * COMMENTS:
9  *
10  */
11 
12 #ifndef _TS_Primitive_h_
13 #define _TS_Primitive_h_
14 
15 #include "TS_API.h"
16 #include "TS_Expression.h"
17 #include "TS_Ray.h"
18 
19 class TS_MetaKernel;
20 class GEO_Primitive;
21 
23 {
24 protected:
27 public:
28  ~TS_MetaPrimitive() override;
29 
30  const TS_MetaPrimitive *isPrimitive() const override;
31  TS_MetaPrimitive *isPrimitive() override;
32  virtual void setWeight(float);
33  virtual float getWeight() const;
34  const UT_BoundingBox &getBBox() const { return myBBox; }
35  UT_Interval getBBox(UT_BoundingBox &) const override;
36  virtual void setKernel(const TS_MetaKernel &);
37  virtual void transform(const UT_Matrix4 &) = 0;
38  void raySweepInit(
39  const TS_Ray &ray,
40  float clip,
41  float &t0,
42  float &t1) override;
43  virtual void init() = 0;
44  virtual void reset();
46  const UT_BoundingBox &,
47  UT_Interval &) override;
48 
50  { myGeoPrimPtr = g; }
51  const GEO_Primitive *getGeoPrimPtr() const { return myGeoPrimPtr; }
52 
53  float listDensity(
54  const UT_Vector3 &p,
56 
59 
60  // A serial for metaball rendering
62 
63  void getAllPrimitives(
65  ) override;
66 
67  /// Compute memory usage (including all shared memory)
68  /// There's nothing to add at this level, and all subclasses need it, so
69  /// it might as well be pure virtual.
70  /// NOTE: Subclasses must add in TS_MetaExpression::getMemoryUsage(false).
72  bool inclusive) const override = 0;
73 
74 protected:
75  float myWeight;
77 
78 private:
79  /// Pointer to the (unique) GEO_Primitive containing this TS_MetaPrimitive
80  const GEO_Primitive *myGeoPrimPtr;
81 };
82 
83 #endif
virtual int64 getMemoryUsage(bool inclusive) const
Compute memory usage (includes all shared memory)
TS_MetaKernel myKernel
Definition: TS_Primitive.h:76
virtual void getAllPrimitives(UT_Array< TS_MetaPrimitive * > &prims)
const UT_BoundingBox & getBBox() const
Definition: TS_Primitive.h:34
GLboolean GLboolean g
Definition: glcorearb.h:1222
const UT_BoundingBox & getBBox() const
virtual void raySweepInit(const TS_Ray &ray, float clip, float &t0, float &t1)=0
UT_BoundingBox myBBox
Definition: TS_Ray.h:21
GLboolean reset
Definition: glad.h:5138
virtual float listDensity(const UT_Vector3 &p, UT_ValArray< TS_MetaPrimitive * > &)=0
long long int64
Definition: SYS_Types.h:116
virtual TS_MetaExpression * prune(const UT_BoundingBox &, UT_Interval &range)=0
GA_API const UT_StringHolder transform
const GEO_Primitive * getGeoPrimPtr() const
Definition: TS_Primitive.h:51
#define TS_API
Definition: api.h:41
virtual const TS_MetaPrimitive * isPrimitive() const
IMATH_INTERNAL_NAMESPACE_HEADER_ENTER IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T clip(const T &p, const Box< T > &box) IMATH_NOEXCEPT
Definition: ImathBoxAlgo.h:29
void setGeoPrimPtr(const GEO_Primitive *g)
Definition: TS_Primitive.h:49