HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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,
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  ~GT_PrimTubeMesh() override;
47 
48  /// @{
49  /// Methods defined on GT_PrimQuadricMesh
50  const char *className() const override
51  { return "GT_PrimTubeMesh"; }
52  bool save(UT_JSONWriter &w) const override;
53  int getPrimitiveType() const override
54  { return GT_PRIM_TUBE_MESH; }
55  GT_PrimitiveHandle doSoftCopy() const override
56  { return new GT_PrimTubeMesh(*this); }
57  GT_PrimitiveHandle doHarden() const override;
58  /// @}
59 
60  /// Initialize the mesh
61  bool init(fpreal taper, bool caps,
63  const GT_AttributeListHandle &detail,
64  const GT_TransformArrayHandle &xforms);
65 
66  /// @{
67  /// Accessors
68  /// See GT_PrimQuadricMesh for additional queries.
69  bool getCaps() const { return myCaps; }
70  fpreal getTaper() const { return myTaper; }
72  { return getQuadricCount(); }
73  /// @}
74 
75  bool getBaseTransform(UT_Matrix4D &mat) const override;
76 
77 private:
78  /// Compute the bounding box for a single (untransformed) tube
79  void getQBounds(UT_BoundingBox &box) const override;
82  const GT_TransformHandle &x,
83  const GT_RefineParms *parms) const override;
84 
85  fpreal myTaper;
86  bool myCaps;
87 };
88 
89 #endif
SIM_API const UT_StringHolder vertex
int getPrimitiveType() const override
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:13
bool getCaps() const
GT_PrimTubeMesh(const GT_PrimTubeMesh &src)
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:37
bool init(const GT_AttributeListHandle &vertex, const GT_AttributeListHandle &detail, const GT_TransformArrayHandle &xforms)
Initialize the quadric mesh.
GT_Size getTubeCount() const
const char * className() const override
GT_Size getQuadricCount() const
virtual void getQBounds(UT_BoundingBox &box) const =0
A virtual container used by sphere, circle and tube meshes.
GLint GLenum GLint x
Definition: glcorearb.h:409
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)
int64 GT_Size
Definition: GT_Types.h:128
fpreal getTaper() const
GLfloat GLfloat GLfloat GLfloat h
Definition: glcorearb.h:2002
fpreal64 fpreal
Definition: SYS_Types.h:277
GLuint index
Definition: glcorearb.h:786
virtual bool save(UT_JSONWriter &w) const
GT_PrimTubeMesh(fpreal taper=1, bool caps=false)
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:857
GT_PrimitiveHandle doSoftCopy() const override
GLenum src
Definition: glcorearb.h:1793