HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_Skin.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_Skin.C (C++)
7  *
8  * COMMENTS:
9  * This is the filter used to create skinned patches.
10  */
11 
12 #ifndef __GU_Skin_h__
13 #define __GU_Skin_h__
14 
15 #include "GU_API.h"
16 #include <GEO/GEO_Primitive.h>
17 #include <GEO/GEO_SurfaceType.h>
18 
19 class GA_PrimitiveGroup;
20 class GU_Detail;
21 
23 {
27 };
28 
29 /// This class can be used to queue up all primitives that are
30 /// to be deleted, with actual deletion being done once the operation
31 /// is complete.
32 ///
33 /// This is particularly useful when an operation is performed on
34 /// multiple groups within one detail, since each deletion opeartion
35 /// itself is O(n) where n is the number of primitives in the detail.
36 /// Thus, accumulating primitives that are to be deleted and deleting them
37 /// once instead of every time for every group can lead to signficantly
38 /// faster code.
40 {
41 public:
42  GU_SkinCache(GEO_Detail& parent_detail);
43  virtual ~GU_SkinCache();
44 
45  /// Queues up an array of primitives to delete. If delete_points is true,
46  /// will delete primitives' points as well. All queued primitives are
47  /// deleted either by calling cleanup() or in the destructor.
48  void addCleanupPrimitives(UT_Array<GEO_Primitive*>* prims_array, bool delete_points);
49 
50  /// Queues up a single primitive to delete. If delete_points is true,
51  /// will delete primitives' points as well. All queued primitives are
52  /// deleted either by calling cleanup() or in the destructor.
53  void addCleanupPrimitive(GEO_Primitive* prim, bool delete_points);
54 
55  /// Deletes all queued up primitives.
56  virtual void cleanup();
57 
58 private:
59  /// Disable the assignment operator. We don't need to copy the arrays
60  /// entirely (slow) and at the same time we don't want pointers being
61  /// shared between multiple objects.
62  GU_SkinCache& operator=(const GU_SkinCache &source) { return *this; }
63 
64 private:
65 
66  /// Holds pointers to primitives whose points also have to be deleted
67  UT_Array<GEO_Primitive*> *myCleanupPrimsDeletePoints;
68 
69  /// Holds pointers to primitives whose points are to be left alone
70  UT_Array<GEO_Primitive*> *myCleanupPrimsLeavePoints;
71 
72  /// Parent detail of the above primitives. For now we only support deleting
73  /// primitives from one detail, but this can easily be extended to support
74  /// multiple ones without changing external functions.
75  GEO_Detail* myParentDetail;
76 };
77 
79 {
80 public:
81  GU_SkinParms();
82  virtual ~GU_SkinParms();
83 
84  void ConvertGroupToPrimsArray(GEO_Detail* parent_detail, const GA_PrimitiveGroup& group, UT_Array<GEO_Primitive*>& prims_array);
85  virtual void InitializePrimArrays(GEO_Detail* parent_detail);
86 
88  int vOrder;
90  int keepShape; // ruled or truly skinned
92 
94 };
95 
96 #endif
GU_SkinClosureType vWrap
Definition: GU_Skin.h:89
GEO_SurfaceType surfType
Definition: GU_Skin.h:87
UT_Array< GEO_Primitive * > * myUPrimsToProcess
Definition: GU_Skin.h:93
int vOrder
Definition: GU_Skin.h:88
GU_SkinClosureType
Definition: GU_Skin.h:22
GLsizei GLsizei GLchar * source
Definition: glcorearb.h:803
#define GU_API
Definition: GU_API.h:14
const GA_PrimitiveGroup * uFaces
Definition: GU_Skin.h:91
LeafData & operator=(const LeafData &)=delete
GEO_SurfaceType
int keepShape
Definition: GU_Skin.h:90