HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GU_PrimGroup.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_PrimGroup_h__
13 #define __GU_PrimGroup_h__
14 
15 #include "GU_API.h"
16 #include <GEO/GEO_Primitive.h>
17 #include "GU_ElementGroup.h"
18 #include "GU_Detail.h"
19 
20 ////////////////////////////////////////////////////////////////////////////
21 //
22 // GU_PrimGroup - Creates a primitive group and selects specific
23 // primitives to be members given a set of parameters
24 //
25 ////////////////////////////////////////////////////////////////////////////
26 
27 
29 {
30 public:
31  /// Create a detached group that we own.
32  GU_PrimGroup(const GU_Detail *gdp, const GA_PrimitiveTypeId &id)
34  , myId(id)
35  { newGroup(NULL); }
36  GU_PrimGroup(const char *n, GU_Detail *gdp, const GA_PrimitiveTypeId &id)
37  : GU_ElementGroup(gdp)
38  , myId(id)
39  { newGroup(n); }
41  : GU_ElementGroup(gdp)
42  {
43  myName = primGroup->getName();
44  setGroup(primGroup);
45  }
46  virtual ~GU_PrimGroup();
47 
48  GA_PrimitiveGroup *primGroup() const;
49 
50  virtual GA_ElementGroup *newGroup(const char *name);
51  virtual GA_ElementGroup *find(const char *name) const;
52  virtual void destroy(void);
53 
54  // Goes through the methods below with the given parameters and creates
55  // a group.
56  void generateGroup(const GU_GroupParms &parms);
57 
58  // methods that allow you to select objects to be in the group
59  void range(int num, int, int, int, int, int) const;
60  void pattern(const char *pattern, int nelements, int) const;
61  void patternGroup(const char *pattern, bool order) const;
62  int boundingBox(float, float, float, float, float, float,
63  float, float, float, bool);
64  void boundingSphere(float tx, float ty, float tz,
65  float radx, float rady, float radz,
66  bool includeNotWhollyContained)
67  const;
68  void normal(UT_Vector3 &nml, float angle) const;
69  void backface(const UT_Vector3 &eye) const;
70  void degenerate(bool degenerate, bool zaf, bool doOpen,
71  float tol) const;
72 
73  void nonplanar(float tol) const;
74 
75 private:
76  /// The name of the group, or NULL if a detached group
77  const char *myName;
78  GA_PrimitiveTypeId myId;
79 
80  int primInsideSphere(GEO_Primitive *prim, float, float,
81  float, float, float, float, bool) const;
82 
83  bool primPartiallyInBBox(GEO_Primitive * prim) const;
84 
85  bool matchTypeId(const GEO_Primitive *prim) const;
86 };
87 
88 #endif
virtual int boundingBox(float, float, float, float, float, float, float, float, float, bool)
SYS_FORCE_INLINE T * SYSconst_cast(const T *foo)
Definition: SYS_Types.h:120
virtual void generateGroup(const GU_GroupParms &parms)=0
virtual void patternGroup(const char *pattern, bool order) const =0
3D Vector class.
const UT_StringHolder & getName() const
Definition: GA_Attribute.h:250
virtual void normal(UT_Vector3 &nml, float angle) const =0
virtual void range(int, int, int, int, int, int) const =0
void setGroup(GA_Group *grp)
Definition: GU_Group.h:210
virtual GA_Group * find(const char *) const =0
GLdouble n
Definition: glcorearb.h:2007
virtual void pattern(const char *pattern, int nelements, int order) const =0
GU_PrimGroup(GU_Detail *gdp, GA_PrimitiveGroup *primGroup)
Definition: GU_PrimGroup.h:40
T angle(const Vec2< T > &v1, const Vec2< T > &v2)
Definition: Vec2.h:480
#define GU_API
Definition: GU_API.h:11
GLuint const GLchar * name
Definition: glcorearb.h:785
virtual void boundingSphere(float, float, float, float, float, float, bool) const =0
virtual void destroy(void)=0
virtual void degenerate(bool degenerate, bool zaf, bool doOpen, float tol) const =0
GU_PrimGroup(const char *n, GU_Detail *gdp, const GA_PrimitiveTypeId &id)
Definition: GU_PrimGroup.h:36
png_infop png_uint_32 int num
Definition: png.h:2158
virtual GA_Group * newGroup(const char *)=0
GU_PrimGroup(const GU_Detail *gdp, const GA_PrimitiveTypeId &id)
Create a detached group that we own.
Definition: GU_PrimGroup.h:32