HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GT_PrimTetra.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2024
3  * Side Effects Software Inc. All rights reserved.
4  *
5  * Redistribution and use of Houdini Development Kit samples in source and
6  * binary forms, with or without modification, are permitted provided that the
7  * following conditions are met:
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  * 2. The name of Side Effects Software may not be used to endorse or
11  * promote products derived from this software without specific prior
12  * written permission.
13  *
14  * THIS SOFTWARE IS PROVIDED BY SIDE EFFECTS SOFTWARE `AS IS' AND ANY EXPRESS
15  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
17  * NO EVENT SHALL SIDE EFFECTS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
18  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
19  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
20  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
22  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
23  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  */
25 
26 #ifndef __GT_PrimTetra__
27 #define __GT_PrimTetra__
28 
29 #include <GT/GT_GEOPrimCollect.h>
30 
31 namespace HDK_Sample {
32 
33 /// Hook to handle tesselation of tetra primitives
34 ///
35 /// When rendering tet primitives, collect all the tet primitives together,
36 /// then a single polygonal mesh is generated as a result.
38 {
39 public:
40  /// Register the GT collector
41  static void registerPrimitive(const GA_PrimitiveTypeId &id);
42 
43  /// Constructor. The @c id is used to bind the collector to the proper
44  /// primitive type.
46 
47  /// Destructor
48  ~GT_PrimTetraCollect() override;
49 
50  /// Return a structure to capture all the tet primitives
53  const GT_RefineParms *parms) const override;
54 
55  /// When refining a single tet primitive, we add it to the container
57  collect(const GT_GEODetailListHandle &geometry,
58  const GEO_Primitive *const* prim_list,
59  int nsegments,
60  GT_GEOPrimCollectData *data) const override;
61  /// At the end of collecting, the single outside skin is generated
63  endCollecting(const GT_GEODetailListHandle &geometry,
64  GT_GEOPrimCollectData *data) const override;
65 private:
66  GA_PrimitiveTypeId myId;
67 };
68 
69 } // End HDK_Sample namespace
70 
71 #endif
GT_GEOPrimCollectData * beginCollecting(const GT_GEODetailListHandle &geometry, const GT_RefineParms *parms) const override
Return a structure to capture all the tet primitives.
Definition: GT_PrimTetra.C:58
Collection data container.
GT_PrimTetraCollect(const GA_PrimitiveTypeId &id)
Definition: GT_PrimTetra.C:44
static void registerPrimitive(const GA_PrimitiveTypeId &id)
Register the GT collector.
Definition: GT_PrimTetra.C:38
~GT_PrimTetraCollect() override
Destructor.
Definition: GT_PrimTetra.C:53
GT_PrimitiveHandle collect(const GT_GEODetailListHandle &geometry, const GEO_Primitive *const *prim_list, int nsegments, GT_GEOPrimCollectData *data) const override
When refining a single tet primitive, we add it to the container.
Definition: GT_PrimTetra.C:66
GT_PrimitiveHandle endCollecting(const GT_GEODetailListHandle &geometry, GT_GEOPrimCollectData *data) const override
At the end of collecting, the single outside skin is generated.
Definition: GT_PrimTetra.C:78
UT_SharedPtr< GT_GEODetailList > GT_GEODetailListHandle
Definition: format.h:895