HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_PrimTriStrip.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_PrimTriStrip.h ( GU Library, C++)
7  *
8  * COMMENTS: TriStrip utilitiy functions.
9  */
10 
11 #ifndef __GU_PrimTriStrip__
12 #define __GU_PrimTriStrip__
13 
14 #include "GU_API.h"
15 #include <GEO/GEO_PrimTriStrip.h>
16 #include "GU_Detail.h"
17 
18 class UT_MemoryCounter;
19 class GEO_ConvertParms;
20 
22 {
23 protected:
24  /// NOTE: Primitives should not be deleted directly. They are managed
25  /// by the GA_PrimitiveList and the stash.
26  ~GU_PrimTriStrip() override {}
27 
28 public:
29  /// NOTE: This constructor should only be called via GU_PrimitiveFactory.
31  : GEO_PrimTriStrip(gdp, offset)
32  {}
33 
34  /// Report approximate memory usage.
35  int64 getMemoryUsage() const override;
36 
37  /// Count memory usage using a UT_MemoryCounter in order to count
38  /// shared memory correctly.
39  /// NOTE: This should always include sizeof(*this).
40  void countMemory(UT_MemoryCounter &counter) const override;
41 
42  const GA_PrimitiveDefinition &getTypeDef() const override
43  {
44  UT_ASSERT(theDefinition);
45  return *theDefinition;
46  }
47 
48  // Conversion Methods
50  GA_PointGroup *usedpts = 0) override;
51  GEO_Primitive *convertNew(GEO_ConvertParms &parms) override;
52 
53  // NOTE: For static member functions please call in the following
54  // manner. <ptrvalue> = GU_PrimTriStrip::<functname>
55  // i.e. partptr = GU_PrimTriStrip::build(params...);
56 
57  // Optional Build Method
58 
59  static GU_PrimTriStrip *build(GU_Detail *gdp, GA_Size numpts,
60  bool appendpts = true);
61 
62  void normal(NormalComp &output) const override;
63  void normal(NormalCompD &output) const override;
64 
65 protected:
66  template <typename T, typename NORMALCOMP>
67  void internalComputeNormal(NORMALCOMP &output) const;
68 
69 private:
70  static GA_PrimitiveDefinition *theDefinition;
71  friend class GU_PrimitiveFactory;
73 };
75 
76 #endif
77 
#define SYS_DEPRECATED_PUSH_DISABLE()
#define SYS_DEPRECATED_POP_DISABLE()
GU_PrimTriStrip(GU_Detail *gdp, GA_Offset offset=GA_INVALID_OFFSET)
NOTE: This constructor should only be called via GU_PrimitiveFactory.
UT_Vector3T< T > internalComputeNormal() const
virtual int64 getMemoryUsage() const
Definition: GA_Primitive.h:209
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:235
#define GA_INVALID_OFFSET
Definition: GA_Types.h:678
virtual void normal(NormalComp &output) const =0
GA_Size GA_Offset
Definition: GA_Types.h:641
const GA_PrimitiveDefinition & getTypeDef() const override
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
~GU_PrimTriStrip() override
A strip of triangles. The Nth triangle shares an edge with the previous.
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.
virtual GEO_Primitive * convertNew(GEO_ConvertParms &parms)=0