HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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  virtual ~TS_MetaPrimitive();
29 
30  const TS_MetaPrimitive *isPrimitive() const;
32  virtual void setWeight(float);
33  virtual float getWeight() const;
34  const UT_BoundingBox &getBBox() const { return myBBox; }
36  virtual void setKernel(const TS_MetaKernel &);
37  virtual void transform(const UT_Matrix4 &) = 0;
38  virtual void raySweepInit(const TS_Ray &ray,
39  float clip, float &t0, float &t1);
40  virtual void init() = 0;
41  virtual void reset();
43 
45  { myGeoPrimPtr = g; }
46  const GEO_Primitive *getGeoPrimPtr() const { return myGeoPrimPtr; }
47 
48  virtual float listDensity(const UT_Vector3 &p,
50 
51  int rayIndex;
53 
54  // A serial for metaball rendering
56 
58 
59  /// Compute memory usage (including all shared memory)
60  /// There's nothing to add at this level, and all subclasses need it, so
61  /// it might as well be pure virtual.
62  /// NOTE: Subclasses must add in TS_MetaExpression::getMemoryUsage(false).
63  virtual int64 getMemoryUsage(bool inclusive) const = 0;
64 
65 protected:
66  float weight;
68 
69 private:
70  /// Pointer to the (unique) GEO_Primitive containing this TS_MetaPrimitive
71  const GEO_Primitive *myGeoPrimPtr;
72 };
73 
74 #endif
#define TS_API
Definition: TS_API.h:10
virtual int64 getMemoryUsage(bool inclusive) const
Compute memory usage (includes all shared memory)
virtual void getAllPrimitives(UT_Array< TS_MetaPrimitive * > &prims)
const UT_BoundingBox & getBBox() const
Definition: TS_Primitive.h:34
GLboolean GLboolean g
Definition: glcorearb.h:1221
const UT_BoundingBox & getBBox() const
3D Vector class.
virtual void raySweepInit(const TS_Ray &ray, float clip, float &t0, float &t1)=0
TS_MetaKernel kernel
Definition: TS_Primitive.h:67
UT_BoundingBox myBBox
long long int64
Definition: SYS_Types.h:100
Definition: TS_Ray.h:21
virtual float listDensity(const UT_Vector3 &p, UT_ValArray< TS_MetaPrimitive * > &)=0
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:46
virtual const TS_MetaPrimitive * isPrimitive() const
IMATH_INTERNAL_NAMESPACE_HEADER_ENTER T clip(const T &p, const Box< T > &box)
Definition: ImathBoxAlgo.h:89
void setGeoPrimPtr(const GEO_Primitive *g)
Definition: TS_Primitive.h:44