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 
57  int rayIndex;
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 weight;
77 
78 private:
79  /// Pointer to the (unique) GEO_Primitive containing this TS_MetaPrimitive
80  const GEO_Primitive *myGeoPrimPtr;
81 };
82 
83 #endif
#define TS_API
Definition: TS_API.h:10
virtual int64 getMemoryUsage(bool inclusive) const
Compute memory usage (includes all shared memory)
GLuint GLenum GLenum transform
Definition: glew.h:14742
virtual void getAllPrimitives(UT_Array< TS_MetaPrimitive * > &prims)
const UT_BoundingBox & getBBox() const
Definition: TS_Primitive.h:34
const UT_BoundingBox & getBBox() const
GLboolean reset
Definition: glew.h:4959
virtual void raySweepInit(const TS_Ray &ray, float clip, float &t0, float &t1)=0
TS_MetaKernel kernel
Definition: TS_Primitive.h:76
UT_BoundingBox myBBox
Definition: TS_Ray.h:21
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
const GEO_Primitive * getGeoPrimPtr() const
Definition: TS_Primitive.h:51
virtual const TS_MetaPrimitive * isPrimitive() const
GLfloat GLfloat p
Definition: glew.h:16321
IMATH_INTERNAL_NAMESPACE_HEADER_ENTER T clip(const T &p, const Box< T > &box)
Definition: ImathBoxAlgo.h:89
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t1
Definition: glew.h:12681
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t0
Definition: glew.h:12681
GLboolean GLboolean g
Definition: glew.h:9477
void setGeoPrimPtr(const GEO_Primitive *g)
Definition: TS_Primitive.h:49