HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_PrimCamera.h
Go to the documentation of this file.
1 
2 /*
3  * PROPRIETARY INFORMATION. This software is proprietary to
4  * Side Effects Software Inc., and is not to be reproduced,
5  * transmitted, or disclosed in any way without written permission.
6  *
7  * NAME: GU_PrimCamera.h (C++)
8  *
9  * COMMENTS:
10  * Utilities for Camera Primitives
11  */
12 
13 #ifndef __GU_PrimCamera__
14 #define __GU_PrimCamera__
15 
16 #include "GU_API.h"
17 #include <GEO/GEO_PrimCamera.h>
18 #include "GU_Detail.h"
19 
20 class UT_MemoryCounter;
21 
23 {
24 protected:
25  /// NOTE: Primitives should not be deleted directly. They are managed
26  /// by the GA_PrimitiveList and the stash.
27  ~GU_PrimCamera() override {}
28 
29 public:
30  /// NOTE: This constructor should only be called via GU_PrimitiveFactory.
32 
33  /// Report approximate memory usage.
34  int64 getMemoryUsage() const override;
35 
36  /// Count memory usage using a UT_MemoryCounter in order to count
37  /// shared memory correctly.
38  /// NOTE: This should always include sizeof(*this).
39  void countMemory(UT_MemoryCounter &counter) const override;
40 
41  const GA_PrimitiveDefinition &getTypeDef() const override
42  {
43  UT_ASSERT(theDefinition);
44  return *theDefinition;
45  }
46 
48  {
49  UT_ASSERT(theDefinition);
50  return theDefinition->getId();
51  }
52 
53  // Conversion Methods: to polygon, nurb curve, and bezier curve
55  GA_PointGroup *usedpts = nullptr) override;
57 
58  void normal(NormalComp &output) const override;
59  void normal(NormalCompD &output) const override;
60 
61  int intersectRay(const UT_Vector3 &o, const UT_Vector3 &d,
62  float tmax = 1E17F, float tol = 1E-12F,
63  float *distance = nullptr,
64  UT_Vector3 *pos = nullptr,
65  UT_Vector3 *nml = nullptr, int accurate = 0,
66  float *u = nullptr, float *v = nullptr,
67  int ignoretrim = 1) const override;
68 
69  static GEO_Primitive *build(GU_Detail *gdp, const UT_CameraParms &parms,
70  const UT_Matrix4D &xform);
71 
72 protected:
73 private:
74  static GA_PrimitiveDefinition *theDefinition;
75 
76  friend class GU_PrimitiveFactory;
78 };
80 
81 #endif
const GLdouble * v
Definition: glcorearb.h:837
#define SYS_DEPRECATED_PUSH_DISABLE()
#define SYS_DEPRECATED_POP_DISABLE()
virtual int64 getMemoryUsage() const
Definition: GA_Primitive.h:209
static GA_PrimitiveTypeId typeId()
Definition: GU_PrimCamera.h:47
#define GA_INVALID_OFFSET
Definition: GA_Types.h:694
virtual void normal(NormalComp &output) const =0
GA_Size GA_Offset
Definition: GA_Types.h:653
GLintptr offset
Definition: glcorearb.h:665
virtual void countMemory(UT_MemoryCounter &counter) const
long long int64
Definition: SYS_Types.h:116
#define GU_API
Definition: GU_API.h:14
GA_API const UT_StringHolder parms
virtual int intersectRay(const UT_Vector3 &o, const UT_Vector3 &d, float tmax=1E17F, float tol=1E-12F, float *distance=0, UT_Vector3 *pos=0, UT_Vector3 *nml=0, int accurate=0, float *u=0, float *v=0, int ignoretrim=1) const
static GEO_PrimCamera * build(GA_Detail *gdp, GA_Offset exisiting_ptoff=GA_INVALID_OFFSET)
builds a new camera. Reuses offset if valid
GU_API void xform(CE_Context &context, bool recompile, int npts, const cl::Buffer &outPos, const cl::Buffer &inPos, const cl::Buffer &surfacexform, const cl::Buffer *grp=nullptr)
virtual GEO_Primitive * convert(GEO_ConvertParms &parms, GA_PointGroup *usedpts=0)=0
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:165
Definition of a geometric primitive.
SIM_API const UT_StringHolder distance
~GU_PrimCamera() override
Definition: GU_PrimCamera.h:27
const GA_PrimitiveDefinition & getTypeDef() const override
Definition: GU_PrimCamera.h:41
virtual GEO_Primitive * convertNew(GEO_ConvertParms &parms)=0