HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GT_GEOPrimList.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: GT_GEOPrimList.h (GT Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GT_GEOPrimList__
12 #define __GT_GEOPrimList__
13 
14 #include "GT_API.h"
15 #include "GT_Primitive.h"
16 #include "GT_GEOSupport.h"
17 #include <GEO/GEO_Primitive.h>
18 
19 class UT_StringRef;
20 
21 
22 /// Class to contain a range of GEO primitives
24 {
25 public:
27  const GT_GEOOffsetList &prims);
29  ~GT_GEOPrimList() override;
30 
31  /// @{
32  /// GT_Primitive interface
33  const char *className() const override;
34  int getPrimitiveType() const override
35  { return GT_GEO_PRIMLIST; }
36  void enlargeBounds(UT_BoundingBox boxes[],
37  int nseg) const override;
39  int nseg) const override;
40  void getVelocityRange(
41  UT_Vector3 &vmin, UT_Vector3 &vmax,
42  const UT_StringRef &attribute_name
43  ) const override;
44  int getMotionSegments() const override;
45  int64 getMemoryUsage() const override;
46  bool save(UT_JSONWriter &w) const override;
47  GT_PrimitiveHandle doSoftCopy() const override
48  { return new GT_GEOPrimList(*this); }
49  GT_PrimitiveHandle doHarden() const override
50  { return GT_PrimitiveHandle(); }
51  /// @}
52 
53  /// Refining fails for this primitive.
54  bool refine(GT_Refine &refiner,
55  const GT_RefineParms *parms=NULL) const override;
56 
57  /// Add a primitive
58  void append(const GEO_Primitive &prim);
59 
60  /// Access to the GU_Detail
61  const GU_ConstDetailHandle &detail() const { return myGdp; }
62 
63  /// Access the list of primitives
64  GA_Range getPrimitiveRange() const;
65 
66  /// Query primitive type
67  /// If the list contains a heterogeneous mix of primitive types, the type
68  /// will be invalid.
69  const GA_PrimitiveTypeId &getTypeId() const { return myType; }
70 
71 private:
73  GT_GEOOffsetList myPrimitives;
74  GA_PrimitiveTypeId myType;
75 };
76 
77 #endif
virtual int getMotionSegments() const =0
virtual bool refine(GT_Refine &refiner, const GT_RefineParms *parms=NULL) const
#define GT_API
Definition: GT_API.h:13
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:37
GT_PrimitiveHandle doSoftCopy() const override
const GU_ConstDetailHandle & detail() const
Access to the GU_Detail.
A range of elements in an index-map.
Definition: GA_Range.h:42
int getPrimitiveType() const override
const GA_PrimitiveTypeId & getTypeId() const
virtual void getVelocityRange(UT_Vector3 &min, UT_Vector3 &max, const UT_StringRef &attribute_name=GA_Names::v) const
virtual void enlargeRenderBounds(UT_BoundingBox boxes[], int nsegments) const
long long int64
Definition: SYS_Types.h:116
The base class for all GT primitive types.
Definition: GT_Primitive.h:43
virtual int64 getMemoryUsage() const =0
Processes primitives generated by refinement process.
Definition: GT_Refine.h:20
virtual bool save(UT_JSONWriter &w) const
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:857
UT_IntrusivePtr< GT_Primitive > GT_PrimitiveHandle
Definition: GT_Handles.h:34
virtual void enlargeBounds(UT_BoundingBox boxes[], int nsegments) const =0
Class to contain a range of GEO primitives.
virtual const char * className() const =0
GT_PrimitiveHandle doHarden() const override
GLenum src
Definition: glcorearb.h:1793