HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SIM_GeoVisitor.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013
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 __SIM_GeoVisitor_h__
27 #define __SIM_GeoVisitor_h__
28 
29 #include "SIMZ_API.h"
30 
31 #include <UT/UT_VectorTypes.h>
32 
33 class GA_PointGroup;
34 class GEO_Quadric;
35 class GU_Detail;
36 
38 {
39 public:
40  virtual ~SIM_GeoVisitor();
41 
42  /// Called for each sphere or tube primitive in the geometry.
43  virtual void onPrimQuadric(const GEO_Quadric *quadric) = 0;
44 
45  /// Called for each convex hull shape in the geometry.
46  virtual void onConvexHull(const GU_Detail &gdp,
47  const GA_PointGroup *points) = 0;
48 
49  /// Called for each box shape that is found in the geometry.
50  virtual void onBox(const UT_Vector3 &center, const UT_Vector3 &size,
51  const UT_Matrix3 &rot,
52  const GU_Detail &gdp,
53  const GA_PointGroup *points) = 0;
54 
55  /// Get the refiner user to refine to polygons to computer the
56  /// the convex hulls.
57  virtual void refine(const GU_Detail *src, GU_Detail &dest,
58  const UT_Matrix4D &xform) = 0;
59 };
60 
61 /// If group_by_connectivity is false, a single shape will be created for the
62 /// entire geometry. Otherwise, a separate shape will be created for each
63 /// connected component in the geometry.
64 void SIMZ_API SIMvisitGeometry(const GU_Detail &gdp, SIM_GeoVisitor &visitor,
65  bool group_by_connectivity);
66 
67 #endif
void SIMZ_API SIMvisitGeometry(const GU_Detail &gdp, SIM_GeoVisitor &visitor, bool group_by_connectivity)
#define SIMZ_API
Definition: SIMZ_API.h:10
GA_API const UT_StringHolder rot
GLsizeiptr size
Definition: glcorearb.h:663
GLenum src
Definition: glcorearb.h:1792