HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GEO_SplitPoints.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2021
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  * Declarations of functions for splitting points based on vertices or primitives
27  */
28 
29 #pragma once
30 
31 #ifndef __HDK_GEO_SplitPoints__
32 #define __HDK_GEO_SplitPoints__
33 
34 #include <GA/GA_Types.h>
35 #include <SYS/SYS_Types.h>
36 
37 class GEO_Detail;
38 class GA_Range;
39 class GA_Attribute;
40 class GA_ElementGroup;
41 
42 namespace HDK_Sample {
43 
44 /// group can be a point, vertex, or primitive group to split out
45 /// new points for all vertices associated with elements in the group,
46 /// if the points are shared.
47 /// This splits all points if group is nullptr.
48 /// Returns the number of points added.
49 /// This bumps data IDs as necessary if any points are split.
51  GEO_Detail *detail,
52  const GA_ElementGroup *group=nullptr);
53 
54 /// group can be a point, vertex, or primitive group to split out
55 /// new points for all clusters of vertices in the group where their values are
56 /// unequal to at least one vertex (whether in the group or not) on the shared point.
57 /// This splits all points by the attribute if group is nullptr.
58 /// Returns the number of points added.
59 /// This bumps data IDs as necessary if any points are split.
61  GEO_Detail *detail,
62  const GA_ElementGroup *group,
63  const GA_Attribute *attrib,
64  fpreal tolerance = 0);
65 
66 /// Returns the number of points added.
67 /// NOTE: You can use GU_Promote to promote primitive attributes to point attributes.
68 /// This bumps data IDs as necessary if any points are split.
70  GEO_Detail *detail,
71  const GA_Range &points,
72  const GA_Attribute *attrib,
73  fpreal tolerance = 0);
74 
75 } // End of HDK_Sample namespace
76 
77 #endif
Definition of a geometry attribute.
Definition: GA_Attribute.h:196
GA_Size GEOsplitPointsByAttrib(GEO_Detail *detail, const GA_ElementGroup *group, const GA_Attribute *attrib, fpreal tolerance)
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:233
A range of elements in an index-map.
Definition: GA_Range.h:42
fpreal64 fpreal
Definition: SYS_Types.h:277
GLuint GLdouble GLdouble GLint GLint const GLdouble * points
Definition: glew.h:3446
GA_Size GEOsplitPoints(GEO_Detail *detail, const GA_ElementGroup *group)
GLboolean GLuint group
Definition: glew.h:2745