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