Path Tracer
StandardShapes.h
1 /*
2 Open Asset Import Library (assimp)
3 ----------------------------------------------------------------------
4 
5 Copyright (c) 2006-2020, assimp team
6 
7 
8 All rights reserved.
9 
10 Redistribution and use of this software in source and binary forms,
11 with or without modification, are permitted provided that the
12 following conditions are met:
13 
14 * Redistributions of source code must retain the above
15  copyright notice, this list of conditions and the
16  following disclaimer.
17 
18 * Redistributions in binary form must reproduce the above
19  copyright notice, this list of conditions and the
20  following disclaimer in the documentation and/or other
21  materials provided with the distribution.
22 
23 * Neither the name of the assimp team, nor the names of its
24  contributors may be used to endorse or promote products
25  derived from this software without specific prior
26  written permission of the assimp team.
27 
28 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 
40 ----------------------------------------------------------------------
41 */
42 
46 #pragma once
47 #ifndef AI_STANDARD_SHAPES_H_INC
48 #define AI_STANDARD_SHAPES_H_INC
49 
50 #ifdef __GNUC__
51 # pragma GCC system_header
52 #endif
53 
54 #include <assimp/vector3.h>
55 #include <stddef.h>
56 #include <vector>
57 
58 struct aiMesh;
59 
60 namespace Assimp {
61 
62 // ---------------------------------------------------------------------------
66 class ASSIMP_API StandardShapes
67 {
68  // class cannot be instanced
69  StandardShapes() {}
70 
71 public:
72 
73 
74  // ----------------------------------------------------------------
81  static aiMesh* MakeMesh(const std::vector<aiVector3D>& positions,
82  unsigned int numIndices);
83 
84 
85  static aiMesh* MakeMesh ( unsigned int (*GenerateFunc)
86  (std::vector<aiVector3D>&));
87 
88  static aiMesh* MakeMesh ( unsigned int (*GenerateFunc)
89  (std::vector<aiVector3D>&, bool));
90 
91  static aiMesh* MakeMesh ( unsigned int n, void (*GenerateFunc)
92  (unsigned int,std::vector<aiVector3D>&));
93 
94  // ----------------------------------------------------------------
102  static unsigned int MakeHexahedron(
103  std::vector<aiVector3D>& positions,
104  bool polygons = false);
105 
106  // ----------------------------------------------------------------
112  static unsigned int MakeIcosahedron(
113  std::vector<aiVector3D>& positions);
114 
115 
116  // ----------------------------------------------------------------
123  static unsigned int MakeDodecahedron(
124  std::vector<aiVector3D>& positions,
125  bool polygons = false);
126 
127 
128  // ----------------------------------------------------------------
134  static unsigned int MakeOctahedron(
135  std::vector<aiVector3D>& positions);
136 
137 
138  // ----------------------------------------------------------------
144  static unsigned int MakeTetrahedron(
145  std::vector<aiVector3D>& positions);
146 
147 
148 
149  // ----------------------------------------------------------------
155  static void MakeSphere(unsigned int tess,
156  std::vector<aiVector3D>& positions);
157 
158 
159  // ----------------------------------------------------------------
185  static void MakeCone(ai_real height,ai_real radius1,
186  ai_real radius2,unsigned int tess,
187  std::vector<aiVector3D>& positions,bool bOpen= false);
188 
189 
190  // ----------------------------------------------------------------
200  static void MakeCircle(ai_real radius, unsigned int tess,
201  std::vector<aiVector3D>& positions);
202 
203 };
204 } // ! Assimp
205 
206 #endif // !! AI_STANDARD_SHAPES_H_INC
Assimp::StandardShapes::MakeHexahedron
static unsigned int MakeHexahedron(std::vector< aiVector3D > &positions, bool polygons=false)
Generates a hexahedron (cube)
Assimp::StandardShapes::MakeOctahedron
static unsigned int MakeOctahedron(std::vector< aiVector3D > &positions)
Generates an octahedron.
Assimp::StandardShapes::MakeSphere
static void MakeSphere(unsigned int tess, std::vector< aiVector3D > &positions)
Generates a sphere.
Assimp::StandardShapes::MakeCircle
static void MakeCircle(ai_real radius, unsigned int tess, std::vector< aiVector3D > &positions)
Generates a flat circle.
Assimp::StandardShapes
Helper class to generate vertex buffers for standard geometric shapes, such as cylinders,...
Definition: StandardShapes.h:67
vector3.h
3D vector structure, including operators when compiling in C++
Assimp::StandardShapes::MakeDodecahedron
static unsigned int MakeDodecahedron(std::vector< aiVector3D > &positions, bool polygons=false)
Generates a dodecahedron.
Assimp::StandardShapes::MakeMesh
static aiMesh * MakeMesh(const std::vector< aiVector3D > &positions, unsigned int numIndices)
Assimp::StandardShapes::MakeTetrahedron
static unsigned int MakeTetrahedron(std::vector< aiVector3D > &positions)
Generates a tetrahedron.
Assimp::StandardShapes::MakeCone
static void MakeCone(ai_real height, ai_real radius1, ai_real radius2, unsigned int tess, std::vector< aiVector3D > &positions, bool bOpen=false)
Generates a cone or a cylinder, either open or closed.
Assimp::StandardShapes::MakeIcosahedron
static unsigned int MakeIcosahedron(std::vector< aiVector3D > &positions)
Generates an icosahedron.
Assimp
Definition: ai_assert.h:50
aiMesh
enum aiMorphingMethod
Definition: mesh.h:575