HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_PointGroup.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: GU Library (C++)
7  *
8  * COMMENTS:
9  *
10  */
11 
12 #ifndef __GU_PointGroup_h__
13 #define __GU_PointGroup_h__
14 
15 #include "GU_API.h"
16 #include "GU_ElementGroup.h"
17 #include "GU_Detail.h"
18 #include <UT/UT_BitArray.h>
19 
20 ////////////////////////////////////////////////////////////////////////////
21 //
22 // GU_PointGroup - Creates a point group and selects specific points to
23 // be created given a set of parameters
24 //
25 ////////////////////////////////////////////////////////////////////////////
26 
28 {
29 public:
30  /// Constructor and Destructor allocate and free a ptRefArray
31  /// if mask isn't GEOPRIMALL
32  /// NOTE: The constructor without a name allocates a detached group
33  /// that is destroyed by the destructor.
34  GU_PointGroup(const GU_Detail *gdp, const GA_PrimitiveTypeId &id);
35  GU_PointGroup(const char *n, GU_Detail *gdp, const GA_PrimitiveTypeId &id);
36  GU_PointGroup(GU_Detail *gdp, GA_PointGroup *ptgroup);
37  ~GU_PointGroup() override;
38 
39  GA_ElementGroup *newGroup(const char *name) override;
40  GA_ElementGroup *find(const char *name) const override;
41  void destroy() override;
42 
43  GA_PointGroup *pointGroup() const;
44 
45  // actual method that allows you to generate a group given the
46  // set of parameters
47  void generateGroup(const GU_GroupParms &parms) override;
48 
49  // methods that allow you to select points to be in the group
50  void range(int, int, int, int, int, int) const override;
51  void pattern(const char *pattern, int nelements,
52  int order) const override;
53  void patternGroup(const char *pattern,
54  bool order) const override;
55  int boundingBox(float tx, float ty, float tz,
56  float halfx, float halfy, float halfz,
57  float rx, float ry, float rz,
58  bool includeNotWhollyContained) override;
59  void boundingSphere(float tx, float ty, float tz,
60  float radx, float rady, float radz,
61  bool includeNotWhollyContained
62  ) const override;
63  void boundingObject(const GU_RayIntersect *rayTree) const;
64  void boundingVolume(const GU_Detail *vgdp, fpreal iso, bool invert) const;
65  void boundingConvexHull(const GU_Detail *vgdp, fpreal iso, bool invert, bool includeNotWhollyContained) const;
66 
67  void normal(UT_Vector3 &nml, float angle,
68  bool include_opposite=false) const override;
69  void backface(const UT_Vector3 &eye) const;
70  void degenerate(bool degenerate, bool zaf, bool doOpen,
71  float tol) const override;
72 
73  void edgeDist(const GA_PointGroup *ptgroup, int depth) const;
74 
75  void randomChance(float seed, float frac, bool use_attrib,
76  const char * attrib_name) const override;
77 
78 private:
79  UT_BitArray *myPtArray; // Point array for prim masks
80  const char *myName; // name of the group
81  GA_PrimitiveTypeId myId;
82  bool myAllPoints;
83 };
84 
85 #endif
virtual void normal(UT_Vector3 &nml, float angle, bool include_opposite) const =0
virtual int boundingBox(float, float, float, float, float, float, float, float, float, bool)
virtual void randomChance(float seed, float frac, bool use_attrib, const char *attrib_name) const =0
SIM_API const UT_StringHolder angle
GLboolean invert
Definition: glcorearb.h:549
virtual void generateGroup(const GU_GroupParms &parms)=0
virtual void patternGroup(const char *pattern, bool order) const =0
virtual void range(int, int, int, int, int, int) const =0
virtual GA_Group * find(const char *) const =0
GLdouble n
Definition: glcorearb.h:2008
virtual void destroy()=0
virtual void pattern(const char *pattern, int nelements, int order) const =0
GLdouble GLdouble GLint GLint order
Definition: glad.h:2676
#define GU_API
Definition: GU_API.h:14
GLuint const GLchar * name
Definition: glcorearb.h:786
GLushort pattern
Definition: glad.h:2583
virtual void boundingSphere(float, float, float, float, float, float, bool) const =0
GLint GLint GLsizei GLsizei GLsizei depth
Definition: glcorearb.h:476
fpreal64 fpreal
Definition: SYS_Types.h:277
virtual void degenerate(bool degenerate, bool zaf, bool doOpen, float tol) const =0
virtual GA_Group * newGroup(const char *)=0