HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GT_RefineCollect.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: GT_RefineCollect.h ( GT Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GT_RefineCollect__
12 #define __GT_RefineCollect__
13 
14 #include "GT_API.h"
15 #include "GT_Refine.h"
16 #include "GT_Handles.h"
17 #include "GT_PrimCollect.h"
18 #include <UT/UT_Array.h>
19 
20 /// A simple refiner which just collects the refined primitives in a list
22 {
23 public:
24  /// Default constructor
26  /// The primitive handle @b must be a handle to a primitive collection
27  /// If the primitive is not a collection, the refiner will allocate its own
28  /// collection (as the default behaviour)
29  GT_RefineCollect(const GT_PrimitiveHandle &collection);
30  /// D-tor
31  virtual ~GT_RefineCollect();
32 
33  /// Clear the collection
34  void clear();
35 
36  /// @{
37  /// Accessor
38  const GT_PrimitiveHandle &getPrim() const
39  { return myList; }
41  { return getList(); }
42  exint entries() const
43  {
44  const GT_PrimCollect *cprim = getList();
45  return cprim ? cprim->entries() : 0;
46  }
48  { return getList()->getPrim(i); }
49  /// @}
50 
51  /// @{
52  /// Implemented from GT_Refine
53  virtual bool allowThreading() const { return true; }
54  virtual void addPrimitive(const GT_PrimitiveHandle &prim);
55  /// @}
56 
57 private:
58  const GT_PrimCollect *getList() const
59  {
60  return UTverify_cast<const GT_PrimCollect *>(myList.get());
61  }
62 
63  GT_PrimitiveHandle myList;
64 };
65 
66 #endif
const GT_PrimitiveHandle & getPrim() const
#define GT_API
Definition: GT_API.h:11
virtual void addPrimitive(const GT_PrimitiveHandle &prim)=0
SYS_FORCE_INLINE TO_T UTverify_cast(FROM_T from)
Definition: UT_Assert.h:199
const GT_PrimCollect * getPrimCollect() const
png_uint_32 i
Definition: png.h:2877
A simple refiner which just collects the refined primitives in a list.
GT_PrimitiveHandle getPrim(int i) const
int64 exint
Definition: SYS_Types.h:116
Processes primitives generated by refinement process.
Definition: GT_Refine.h:20
virtual bool allowThreading() const
exint entries() const
Return the number of primitives in the collection.
exint entries() const