HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_Fur.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_Fur.h (GU Library, C++)
7  *
8  * COMMENTS: Generates fur geometry
9  */
10 
11 #ifndef __GU_Fur__
12 #define __GU_Fur__
13 
14 #include "GU_API.h"
15 
16 #include "GU_Detail.h"
17 #include <UT/UT_OpCaller.h>
19 
21 {
24 };
25 
26 class guFurSkinWrapper;
27 class guFurGuidesWrapper;
28 class guFurClumpsWrapper;
29 class guFurPartingLinesWrapper;
30 struct guFurGenerateParms;
31 
33 {
34 public:
35  GU_Fur(const GU_Detail *skin,
36  const GU_Detail *guides,
37  const GU_Detail *clumps,
38  const GU_Detail *partinglines,
39  int seed,
40  fpreal density,
41  fpreal length,
42  fpreal guideradius,
43  fpreal clumpradius,
44  fpreal partingradius,
45  const UT_String &skin_shader,
46  const UT_String &guide_shader,
47  const UT_String &skin_attribs,
48  const UT_String &guide_attribs,
49  bool set_id);
50  virtual ~GU_Fur();
51 
52  // This must be called and return true before attempting to generate
53  // curves with the generate() method.
54  // This method can fail (return false) if the number primitives in the
55  // guides geometry does not match the number of points in the skin
56  // geometry or the number of vertices in guide and clump geometries
57  // are inconsistent.
58  bool initialize(int nvertices);
59 
60  // creates curves in 'gdp' grown from the primitives specified by
61  // 'skinprims' from the skin geometry used in the constructor
62  void generate(UT_OpCaller *caller,
63  GU_Detail *gdp,
64  const UT_IntArray &skinprims,
65  fpreal display,
66  bool limit_to_bounds,
67  const UT_BoundingBox &bounds,
68  bool use_closest_clump,
69  bool remove_unclumped,
70  bool remove_unguided,
72  GA_AttributeOwner skinowner,
73  GA_AttributeOwner guideowner,
74  bool interruptable);
75 
76  // Fetches a bounding box for fur grown from skin primitive 'pr'.
77  // 'preblur' and 'postblur' are shutter times (in seconds from the frame
78  // being rendered) for motion blur.
79  void getBoundingBox(UT_BoundingBox &box, int pr,
80  fpreal preblur, fpreal postblur) const;
81 
82  // subclasses implement these methods to record any errors and warnings
83  virtual void addError(const UT_String &str) = 0;
84  virtual void addWarning(const UT_String &str) = 0;
85 
86 private:
87  // threaded method to generate fur over a section
88  THREADED_METHOD2(GU_Fur, skinprims->entries() > 1, generatePrivate, const UT_IntArray *, skinprims, guFurGenerateParms *, parms)
89  void generatePrivatePartial(const UT_IntArray *skinprims, guFurGenerateParms *parms, const UT_JobInfo &info);
90 
91  guFurSkinWrapper *mySkin;
92  guFurGuidesWrapper *myGuides;
93  guFurClumpsWrapper *myClumps;
94  guFurPartingLinesWrapper *myPartingLines;
95 
96  int mySeed;
97  fpreal myDensity;
98  fpreal myLength;
99  const UT_String mySkinShader;
100  const UT_String myGuideShader;
101  const UT_String mySkinAttribs;
102  const UT_String myGuideAttribs;
103  bool mySetId;
104  int myNumVertices;
105 };
106 
107 #endif
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:795
#define THREADED_METHOD2(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2)
Definition: GU_Fur.h:32
#define GU_API
Definition: GU_API.h:14
OPENVDB_API void initialize()
Global registration of native Grid, Transform, Metadata and Point attribute types. Also initializes blosc (if enabled).
Definition: logging.h:294
exint entries() const
Alias of size(). size() is preferred.
Definition: UT_Array.h:648
GA_AttributeOwner
Definition: GA_Types.h:35
fpreal64 fpreal
Definition: SYS_Types.h:277
GU_FurCurveType
Definition: GU_Fur.h:20
type
Definition: core.h:1059