HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GU_PrimPart.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_PrimParticle.h (C++)
7  *
8  * COMMENTS:
9  * Header file for GU_PrimParticle.h class...
10  *
11  */
12 
13 #ifndef __GU_PrimParticle_h__
14 #define __GU_PrimParticle_h__
15 
16 #include "GU_API.h"
17 #include <GEO/GEO_PrimPart.h>
18 #include "GU_Detail.h"
19 
20 class UT_MemoryCounter;
21 class GEO_ConvertParms;
22 
23 /////////////////////////////////////////////////////////////
24 // //
25 // Class: GU_PrimParticle //
26 // Descr: This class is responsible for operations //
27 // done on particle primitives. As we need to //
28 // access the GU_Detail, the pointer is passed in //
29 // the constructor. //
30 // //
31 /////////////////////////////////////////////////////////////
32 
34 {
35 protected:
36  /// NOTE: Primitives should not be deleted directly. They are managed
37  /// by the GA_PrimitiveList and the stash.
38  virtual ~GU_PrimParticle() {}
39 
40 public:
41  /// NOTE: This constructor should only be called via GU_PrimitiveFactory.
43  : GEO_PrimParticle(gdp, offset)
44  {}
45 
46  /// Report approximate memory usage.
47  virtual int64 getMemoryUsage() const;
48 
49  /// Count memory usage using a UT_MemoryCounter in order to count
50  /// shared memory correctly.
51  /// NOTE: This should always include sizeof(*this).
52  virtual void countMemory(UT_MemoryCounter &counter) const;
53 
54  virtual const GA_PrimitiveDefinition &getTypeDef() const
55  {
56  UT_ASSERT(theDefinition);
57  return *theDefinition;
58  }
59 
60  // Conversion Method
61  virtual GEO_Primitive *convert(GEO_ConvertParms &parms,
62  GA_PointGroup *usedpts = 0);
63  virtual GEO_Primitive *convertNew(GEO_ConvertParms &parms);
64 
65  virtual void normal(NormalComp &output) const;
66 
67  void restrictedNormal(NormalComp &output,
68  const UT_BitArray &skip_pts) const;
69 
70  // NOTE: For static member functions please call in the following
71  // manner. <ptrvalue> = GU_PrimParticle::<functname>
72  // i.e. partptr = GU_PrimParticle::build(params...);
73 
74  // Optional Build Method
75 
76  static GU_PrimParticle *build(GU_Detail *gdp, GA_Size numparts,
77  bool appendPts = true);
78 
79  virtual void clip(UT_Vector3 nml, float d = 0,
80  GA_PrimitiveGroup *delgroup = 0);
81 
82 private:
83  void create(GA_Size numparts);
84 
85  static GA_PrimitiveDefinition *theDefinition;
86  friend class GU_PrimitiveFactory;
88 };
90 
91 #endif
#define SYS_DEPRECATED_PUSH_DISABLE()
#define SYS_DEPRECATED_POP_DISABLE()
3D Vector class.
virtual int64 getMemoryUsage() const
Definition: GA_Primitive.h:204
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211
#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 void clip(UT_Vector3 normal, float distance=0, GA_PrimitiveGroup *clipgrp=NULL)
GU_PrimParticle(GU_Detail *gdp, GA_Offset offset=GA_INVALID_OFFSET)
NOTE: This constructor should only be called via GU_PrimitiveFactory.
Definition: GU_PrimPart.h:42
virtual const GA_PrimitiveDefinition & getTypeDef() const
Definition: GU_PrimPart.h:54
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:102
virtual void countMemory(UT_MemoryCounter &counter) const
GLintptr offset
Definition: glcorearb.h:664
#define GU_API
Definition: GU_API.h:11
virtual GEO_Primitive * convert(GEO_ConvertParms &parms, GA_PointGroup *usedpts=0)=0
Definition of a geometric primitive.
virtual ~GU_PrimParticle()
Definition: GU_PrimPart.h:38
virtual GEO_Primitive * convertNew(GEO_ConvertParms &parms)=0