HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GT_GEODetail.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_GEODetail.h ( GEO Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GT_GEODetail__
12 #define __GT_GEODetail__
13 
14 #include "GT_API.h"
15 #include "GT_Primitive.h"
16 #include "GT_GEODetailList.h"
17 #include <GA/GA_Names.h>
18 #include <GA/GA_Range.h>
19 
21 class GU_Detail;
22 class UT_StringRef;
23 
24 /// @brief Primitive representing entire detail. Refine this primitive.
25 ///
26 /// Refining this primitive will iterate over the primitives in the detail.
28 {
29 public:
31  const GA_Range *prim_range);
33  const GA_Range *prim_range);
35  virtual ~GT_GEODetail();
36 
37  virtual const char *className() const { return "GT_GEODetail"; }
38 
39  /// Compute the bounding box
40  virtual void enlargeBounds(UT_BoundingBox boxes[],
41  int nsegments) const;
42  virtual void getVelocityRange(
44  const UT_StringRef &attribute_name = GA_Names::v
45  ) const;
46 
47  /// Return the primitive type
48  virtual int getPrimitiveType() const;
49 
50  /// Harden the detail.
51  virtual GT_PrimitiveHandle doHarden() const;
52 
53  /// Do a soft-copy
55  { return new GT_GEODetail(*this); }
56 
57  /// Parameters
58  /// - bool renderpoints (false) @n Generate GT_PrimPointsMesh primitive
59  /// - string rendergroup ("") @n Name of primitive group to refine
60  /// - bool polygonmesh (true) @n Generate GT_PrimPolygonMesh primitive
61  virtual bool refine(GT_Refine &refine,
62  const GT_RefineParms *parms) const;
63 
64  virtual int64 getMemoryUsage() const
65  { return sizeof(*this); }
66 
67  /// Query number of motion segments
68  int getMotionSegments() const
69  { return myList->getMotionSegments(); }
70  /// Get geometry for a given segment
71  const GU_ConstDetailHandle &getGeometry(int segment=0) const
72  { return myList->getGeometry(segment); }
74  { return myRange; }
75 
76  /// @{
77  /// Make a primitive for an entire detail
78  static GT_PrimitiveHandle makeDetail(const GU_ConstDetailHandle &gdh,
79  const GA_Range *prim_range = NULL);
80 
81  static GT_PrimitiveHandle makeDetail(
82  const GT_GEODetailListHandle &geo,
83  const GA_Range *prim_range
84  );
85  /// @}
86 
87  /// @{
88  /// Make a polygon mesh primitive for all the polygons in the detail
89  static GT_PrimitiveHandle makePolygonMesh(
90  const GU_ConstDetailHandle &gdp,
91  const GA_Range *prim_range = NULL,
92  const GT_RefineParms *rparms = NULL
93  );
94  static GT_PrimitiveHandle makePolygonMesh(
95  const GT_GEODetailListHandle &geo,
96  const GA_Range &prim_range,
97  const GT_RefineParms *rparms = NULL
98  );
99  /// @}
100 
101  /// @{
102  /// Make a point mesh containing just the points from a detail. Note that
103  /// the attributes can be picked up from detail attributes as well.
104  /// Vertex & primitive attributes are ignored.
105  static GT_PrimitiveHandle makePointMesh(
106  const GU_ConstDetailHandle &gdp,
107  const GA_Range *point_range = NULL
108  );
109  static GT_PrimitiveHandle makePointMesh(
110  const GT_GEODetailListHandle &geo,
111  const GA_Range *point_range = NULL
112  );
113  /// @}
114  virtual bool save(UT_JSONWriter &w) const;
115 
116 private:
117  GT_GEODetailListHandle myList;
119 };
120 
121 #endif
virtual int64 getMemoryUsage() const
Definition: GT_GEODetail.h:64
virtual const char * className() const
Definition: GT_GEODetail.h:37
virtual bool refine(GT_Refine &refiner, const GT_RefineParms *parms=NULL) const
virtual int getPrimitiveType() const
const GU_ConstDetailHandle & getGeometry(int segment=0) const
Get geometry for a given segment.
Definition: GT_GEODetail.h:71
#define GT_API
Definition: GT_API.h:11
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:32
3D Vector class.
GA_API const UT_StringHolder v
A range of elements in an index-map.
Definition: GA_Range.h:42
int getMotionSegments() const
Query number of motion segments.
Definition: GT_GEODetail.h:68
long long int64
Definition: SYS_Types.h:107
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:28
const std::enable_if<!VecTraits< T >::IsVec, T >::type & max(const T &a, const T &b)
Definition: Composite.h:133
virtual void getVelocityRange(UT_Vector3 &min, UT_Vector3 &max, const UT_StringRef &attribute_name=GA_Names::v) const
The base class for all GT primitive types.
Definition: GT_Primitive.h:43
virtual GT_PrimitiveHandle doHarden() const
Processes primitives generated by refinement process.
Definition: GT_Refine.h:20
virtual bool save(UT_JSONWriter &w) const
virtual GT_PrimitiveHandle doSoftCopy() const
Do a soft-copy.
Definition: GT_GEODetail.h:54
const UT_SharedPtr< const GA_Range > & getRange() const
Definition: GT_GEODetail.h:73
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:856
Primitive representing entire detail. Refine this primitive.
Definition: GT_GEODetail.h:27
UT_SharedPtr< GT_GEODetailList > GT_GEODetailListHandle
virtual void enlargeBounds(UT_BoundingBox boxes[], int nsegments) const =0
const std::enable_if<!VecTraits< T >::IsVec, T >::type & min(const T &a, const T &b)
Definition: Composite.h:129
GLenum src
Definition: glcorearb.h:1792