HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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  ~GU_PrimCircle() override {}
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  int64 getMemoryUsage() const override;
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  void countMemory(UT_MemoryCounter &counter) const override;
75 
76  const GA_PrimitiveDefinition &getTypeDef() const override
77  {
78  UT_ASSERT(theDefinition);
79  return *theDefinition;
80  }
81 
82  // Conversion Methods: to polygon, nurb curve, and bezier curve
84  GA_PointGroup *usedpts = 0) override;
85  GEO_Primitive *convertNew(GEO_ConvertParms &parms) override;
86 
87  void normal(NormalComp &output) const override;
88  void normal(NormalCompD &output) const override;
89 
90  int intersectRay(const UT_Vector3 &o, const UT_Vector3 &d,
91  float tmax = 1E17F, float tol = 1E-12F,
92  float *distance = 0, UT_Vector3 *pos = 0,
93  UT_Vector3 *nml = 0, int accurate = 0,
94  float *u = 0, float *v = 0,
95  int ignoretrim = 1) const override;
96 
97  static GEO_Primitive *build(const GU_PrimCircleParms &parms,
99 
100 protected:
101 private:
102  void passAttributesTo(GEO_Primitive &dest,
103  GA_ElementWranglerCache &wranglers,
104  int preserve_groups) const;
105 
106  static GA_PrimitiveDefinition *theDefinition;
107  friend class GU_PrimitiveFactory;
109 };
111 
112 #endif
const GLdouble * v
Definition: glcorearb.h:837
#define SYS_DEPRECATED_PUSH_DISABLE()
#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
virtual int64 getMemoryUsage() const
Definition: GA_Primitive.h:209
~GU_PrimCircle() override
Definition: GU_PrimCircle.h:60
const GA_PrimitiveDefinition & getTypeDef() const override
Definition: GU_PrimCircle.h:76
#define GA_INVALID_OFFSET
Definition: GA_Types.h:687
virtual void normal(NormalComp &output) const =0
GA_Size GA_Offset
Definition: GA_Types.h:646
GLintptr offset
Definition: glcorearb.h:665
virtual void countMemory(UT_MemoryCounter &counter) const
GU_CircleType
Definition: GU_Types.h:15
long long int64
Definition: SYS_Types.h:116
#define GU_API
Definition: GU_API.h:14
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
virtual GEO_Primitive * convert(GEO_ConvertParms &parms, GA_PointGroup *usedpts=0)=0
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
Definition of a geometric primitive.
SIM_API const UT_StringHolder distance
type
Definition: core.h:1059
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