HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GU_PrimCircle.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: GU_PrimCircle.h (C++)
7  *
8  * COMMENTS:
9  * Header file for GU_PrimCircle.h class...
10  *
11  */
12 
13 #ifndef __GU_PrimCircle_h__
14 #define __GU_PrimCircle_h__
15 
16 #include "GU_API.h"
17 #include <GEO/GEO_PrimCircle.h>
18 #include "GU_Detail.h"
19 
21 class GEO_ConvertParms;
22 class GEO_Face;
23 class GU_PrimPoly;
24 class GU_PrimNURBCurve;
25 class GU_PrimRBezCurve;
26 class UT_MemoryCounter;
27 
28 /////////////////////////////////////////////////////////////
29 // //
30 // Class: GU_PrimCircle //
31 // Descr: This class is responsible for operations //
32 // done on circle primitives. As we need to access //
33 // the GU_Detail, the pointer is passed in the //
34 // constructor. The second constructor creates a //
35 // circle with the given parameters. //
36 // //
37 /////////////////////////////////////////////////////////////
38 
40 {
41 public:
43 
45  GA_Offset ptoff; // use this point instead of your own
47  int divisions;
48  float beginAngle; // Radians
49  float endAngle; // Radians
50  GU_CircleType type; // Type of circle
51  int order;
52  int imperfect; // nonrational
53 };
54 
56 {
57 protected:
58  /// NOTE: Primitives should not be deleted directly. They are managed
59  /// by the GA_PrimitiveList and the stash.
60  virtual ~GU_PrimCircle() {}
61 
62 public:
63  /// NOTE: This constructor should only be called via GU_PrimitiveFactory.
65  : GEO_PrimCircle(gdp, offset)
66  {}
67 
68  /// Report approximate memory usage.
69  virtual int64 getMemoryUsage() const;
70 
71  /// Count memory usage using a UT_MemoryCounter in order to count
72  /// shared memory correctly.
73  /// NOTE: This should always include sizeof(*this).
74  virtual void countMemory(UT_MemoryCounter &counter) const;
75 
76  virtual const GA_PrimitiveDefinition &getTypeDef() const
77  {
78  UT_ASSERT(theDefinition);
79  return *theDefinition;
80  }
81 
82  // Conversion Methods: to polygon, nurb curve, and bezier curve
83  virtual GEO_Primitive *convert(GEO_ConvertParms &parms,
84  GA_PointGroup *usedpts = 0);
85  virtual GEO_Primitive *convertNew(GEO_ConvertParms &parms);
86 
87  virtual void normal(NormalComp &output) const;
88  virtual int intersectRay(const UT_Vector3 &o, const UT_Vector3 &d,
89  float tmax = 1E17F, float tol = 1E-12F,
90  float *distance = 0, UT_Vector3 *pos = 0,
91  UT_Vector3 *nml = 0, int accurate = 0,
92  float *u = 0, float *v = 0,
93  int ignoretrim = 1) const;
94 
95  static GEO_Primitive *build(const GU_PrimCircleParms &parms,
97 
98 protected:
99 private:
100  void passAttributesTo(GEO_Primitive &dest,
101  GA_ElementWranglerCache &wranglers,
102  int preserve_groups) const;
103 
104  static GA_PrimitiveDefinition *theDefinition;
105  friend class GU_PrimitiveFactory;
107 };
109 
110 #endif
#define SYS_DEPRECATED_PUSH_DISABLE()
const GLdouble * v
Definition: glcorearb.h:836
#define SYS_DEPRECATED_POP_DISABLE()
GU_PrimCircle(GU_Detail *gdp, GA_Offset offset=GA_INVALID_OFFSET)
NOTE: This constructor should only be called via GU_PrimitiveFactory.
Definition: GU_PrimCircle.h:64
3D Vector class.
virtual int64 getMemoryUsage() const
Definition: GA_Primitive.h:204
#define GA_INVALID_OFFSET
Definition: GA_Types.h:654
virtual void normal(NormalComp &output) const =0
GA_Size GA_Offset
Definition: GA_Types.h:617
long long int64
Definition: SYS_Types.h:106
virtual const GA_PrimitiveDefinition & getTypeDef() const
Definition: GU_PrimCircle.h:76
virtual ~GU_PrimCircle()
Definition: GU_PrimCircle.h:60
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:102
T distance(const UT_Vector4T< T > &v1, const UT_Vector4T< T > &v2)
Definition: UT_Vector4.h:634
virtual void countMemory(UT_MemoryCounter &counter) const
GLintptr offset
Definition: glcorearb.h:664
GU_CircleType
Definition: GU_Types.h:15
#define GU_API
Definition: GU_API.h:11
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
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
virtual GEO_Primitive * convert(GEO_ConvertParms &parms, GA_PointGroup *usedpts=0)=0
Definition of a geometric primitive.
static GEO_Quadric * build(GA_Detail &detail, GA_PrimitiveTypeId type, GA_Offset existing_ptoff=GA_INVALID_OFFSET)
GU_CircleType type
Definition: GU_PrimCircle.h:50
virtual GEO_Primitive * convertNew(GEO_ConvertParms &parms)=0