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>
20 
21 ////////////////////////////////////////////////////////////////////////////
22 //
23 // GU_PointGroup - Creates a point group and selects specific points to
24 // be created given a set of parameters
25 //
26 ////////////////////////////////////////////////////////////////////////////
27 
29 {
30 public:
31  /// Constructor and Destructor allocate and free a ptRefArray
32  /// if mask isn't GEOPRIMALL
33  /// NOTE: The constructor without a name allocates a detached group
34  /// that is destroyed by the destructor.
35  GU_PointGroup(const GU_Detail *gdp, const GA_PrimitiveTypeId &id);
36  GU_PointGroup(const char *n, GU_Detail *gdp, const GA_PrimitiveTypeId &id);
37  GU_PointGroup(GU_Detail *gdp, GA_PointGroup *ptgroup);
38  virtual ~GU_PointGroup();
39 
40  virtual GA_ElementGroup *newGroup(const char *name);
41  virtual GA_ElementGroup *find(const char *name) const;
42  virtual void destroy(void);
43 
44  // actual method that allows you to generate a group given the
45  // set of parameters
46  void generateGroup(const GU_GroupParms &parms);
47 
48  // methods that allow you to select points to be in the group
49  void range(int, int, int, int, int, int) const;
50  void pattern(const char *pattern, int nelements,
51  int order) const;
52  void patternGroup(const char *pattern, bool order) const;
53  int boundingBox(float tx, float ty, float tz,
54  float halfx, float halfy, float halfz,
55  float rx, float ry, float rz,
56  bool includeNotWhollyContained);
57  void boundingSphere(float tx, float ty, float tz,
58  float radx, float rady, float radz,
59  bool includeNotWhollyContained)
60  const;
61  void boundingObject(const GU_RayIntersect *rayTree) const;
62  void boundingVolume(const GU_Detail *vgdp, fpreal iso, bool invert) const;
63 
64  void normal(UT_Vector3 &nml, float angle) const;
65  void backface(const UT_Vector3 &eye) const;
66  void degenerate(bool degenerate, bool zaf, bool doOpen,
67  float tol) const;
68 
69  void edgeDist(const GA_PointGroup *ptgroup, int depth) const;
70 
71 protected:
72  THREADED_METHOD_CONST(GU_PointGroup, gdp()->getNumPoints() > 5000,
73  unorderedBoundingBox
74  )
75  void unorderedBoundingBoxPartial(
76  const UT_JobInfo &info) const;
77 
78  THREADED_METHOD6_CONST(GU_PointGroup, gdp()->getNumPoints() > 5000,
79  unorderedBoundingSphere,
80  float, a,
81  float, b,
82  float, c,
83  float, tx,
84  float, ty,
85  float, tz)
86  void unorderedBoundingSpherePartial(
87  float a,
88  float b,
89  float c,
90  float tx,
91  float ty,
92  float tz,
93  const UT_JobInfo &info) const;
94 
95  THREADED_METHOD1_CONST(GU_PointGroup, gdp()->getNumPoints() > 5000,
96  unorderedBoundingObject,
97  const GU_RayIntersect *, rayTree)
98  void unorderedBoundingObjectPartial(
99  const GU_RayIntersect *rayTree,
101 
102  THREADED_METHOD3_CONST(GU_PointGroup, gdp()->getNumPoints() > 5000,
103  unorderedBoundVolume,
104  const UT_ValArray<const GEO_Primitive *> &, vlist,
105  float, iso,
106  bool, invert)
107  void unorderedBoundVolumePartial(
108  const UT_ValArray<const GEO_Primitive *> &vlist,
109  float iso,
110  bool invert,
111  const UT_JobInfo &info) const;
112 
113 private:
114  UT_BitArray *myPtArray; // Point array for prim masks
115  const char *myName; // name of the group
116  GA_PrimitiveTypeId myId;
117  bool myAllPoints;
118 };
119 
120 #endif
virtual int boundingBox(float, float, float, float, float, float, float, float, float, bool)
#define THREADED_METHOD6_CONST(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2, PARMTYPE3, PARMNAME3, PARMTYPE4, PARMNAME4, PARMTYPE5, PARMNAME5, PARMTYPE6, PARMNAME6)
#define THREADED_METHOD_CONST(CLASSNAME, DOMULTI, METHOD)
GLboolean invert
Definition: glcorearb.h:548
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1221
virtual void generateGroup(const GU_GroupParms &parms)=0
virtual void patternGroup(const char *pattern, bool order) const =0
virtual void normal(UT_Vector3 &nml, float angle) 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:2007
GLint GLint GLsizei GLsizei GLsizei depth
Definition: glcorearb.h:475
virtual void pattern(const char *pattern, int nelements, int order) const =0
T angle(const Vec2< T > &v1, const Vec2< T > &v2)
Definition: Vec2.h:472
#define GU_API
Definition: GU_API.h:12
GLuint const GLchar * name
Definition: glcorearb.h:785
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1221
virtual void boundingSphere(float, float, float, float, float, float, bool) const =0
#define THREADED_METHOD1_CONST(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1)
virtual void destroy(void)=0
double fpreal
Definition: SYS_Types.h:270
virtual void degenerate(bool degenerate, bool zaf, bool doOpen, float tol) const =0
GU_Detail * gdp() const
Definition: GU_Group.h:206
#define const
Definition: zconf.h:214
virtual GA_Group * newGroup(const char *)=0
#define THREADED_METHOD3_CONST(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2, PARMTYPE3, PARMNAME3)