HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GT_PrimTubeMesh.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_PrimTubeMesh.h ( GT Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GT_PrimTubeMesh__
12 #define __GT_PrimTubeMesh__
13 
14 #include "GT_API.h"
15 #include "GT_PrimQuadricMesh.h"
16 
17 class GT_PrimTube;
18 
20 {
21 public:
22  GT_PrimTubeMesh(fpreal taper=1, bool caps=false)
23  : myTaper(taper)
24  , myCaps(caps)
26  {
27  }
29  : GT_PrimQuadricMesh(src)
30  , myTaper(src.myTaper)
31  , myCaps(src.myCaps)
32  {
33  }
34 
35  GT_PrimTubeMesh(fpreal taper, bool caps,
36  const GT_AttributeListHandle &vertex,
37  const GT_AttributeListHandle &detail,
38  const GT_TransformArrayHandle &xforms)
39  : myTaper(taper)
40  , myCaps(caps)
41  , GT_PrimQuadricMesh(vertex, detail, xforms)
42  {
43  }
44  GT_PrimTubeMesh(const GT_PrimTube *tube);
45 
46  virtual ~GT_PrimTubeMesh();
47 
48  /// @{
49  /// Methods defined on GT_PrimQuadricMesh
50  virtual const char *className() const { return "GT_PrimTubeMesh"; }
51  virtual bool save(UT_JSONWriter &w) const;
52  virtual int getPrimitiveType() const
53  { return GT_PRIM_TUBE_MESH; }
55  { return new GT_PrimTubeMesh(*this); }
56  virtual GT_PrimitiveHandle doHarden() const;
57  /// @}
58 
59  /// Initialize the mesh
60  bool init(fpreal taper, bool caps,
61  const GT_AttributeListHandle &vertex,
62  const GT_AttributeListHandle &detail,
63  const GT_TransformArrayHandle &xforms);
64 
65  /// @{
66  /// Accessors
67  /// See GT_PrimQuadricMesh for additional queries.
68  bool getCaps() const { return myCaps; }
69  fpreal getTaper() const { return myTaper; }
71  { return getQuadricCount(); }
72  /// @}
73 
74  virtual bool getBaseTransform(UT_Matrix4D &mat) const;
75 
76 private:
77  /// Compute the bounding box for a single (untransformed) tube
78  virtual void getQBounds(UT_BoundingBox &box) const;
81  const GT_TransformHandle &x,
82  const GT_RefineParms *parms) const;
83 
84  fpreal myTaper;
85  bool myCaps;
86 };
87 
88 #endif
virtual GT_PrimitiveHandle doSoftCopy() const
virtual GT_PrimitiveHandle makeQuadric(GT_Size index, const GT_AttributeListHandle &h, const GT_TransformHandle &x, const GT_RefineParms *parms) const =0
Sub-class method to make an individual primitive.
A tapered tube primitive (mapping to GEO_PrimTube)
Definition: GT_PrimTube.h:24
#define GT_API
Definition: GT_API.h:11
bool getCaps() const
GT_PrimTubeMesh(const GT_PrimTubeMesh &src)
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:32
bool init(const GT_AttributeListHandle &vertex, const GT_AttributeListHandle &detail, const GT_TransformArrayHandle &xforms)
Initialize the quadric mesh.
GT_Size getTubeCount() const
GT_Size getQuadricCount() const
virtual int getPrimitiveType() const
virtual void getQBounds(UT_BoundingBox &box) const =0
A virtual container used by sphere, circle and tube meshes.
virtual bool getBaseTransform(UT_Matrix4D &) const
virtual GT_PrimitiveHandle doHarden() const
GT_PrimTubeMesh(fpreal taper, bool caps, const GT_AttributeListHandle &vertex, const GT_AttributeListHandle &detail, const GT_TransformArrayHandle &xforms)
fpreal getTaper() const
GLfloat GLfloat GLfloat GLfloat h
Definition: glcorearb.h:2001
double fpreal
Definition: SYS_Types.h:269
GLuint index
Definition: glcorearb.h:785
GLint GLenum GLint x
Definition: glcorearb.h:408
virtual bool save(UT_JSONWriter &w) const
GT_PrimTubeMesh(fpreal taper=1, bool caps=false)
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:856
int64 GT_Size
Definition: GT_Types.h:109
virtual const char * className() const
GLenum src
Definition: glcorearb.h:1792