gVirtualXRay  2.0.10
VirtualX-RayImagingLibraryonGPU
SphereMesh.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (c) 2017, Dr Franck P. Vidal (franck.p.vidal@fpvidal.net),
4 http://www.fpvidal.net/
5 All rights reserved.
6 
7 Redistribution and use in source and binary forms, with or without modification,
8 are permitted provided that the following conditions are met:
9 
10 1. Redistributions of source code must retain the above copyright notice,
11 this list of conditions and the following disclaimer.
12 
13 2. Redistributions in binary form must reproduce the above copyright notice,
14 this list of conditions and the following disclaimer in the documentation and/or
15 other materials provided with the distribution.
16 
17 3. Neither the name of the Bangor University nor the names of its contributors
18 may be used to endorse or promote products derived from this software without
19 specific prior written permission.
20 
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 
32 */
33 
34 
35 #ifndef __SphereMesh_h
36 #define __SphereMesh_h
37 
38 
68 //******************************************************************************
69 // Include
70 //******************************************************************************
71 #ifndef __gVirtualXRayConfig_h
73 #endif
74 
75 #include <string>
76 #include <vector>
77 
78 #ifndef __PolygonMesh_h
80 #endif
81 
82 #ifndef __Types_h
83 #include "gVirtualXRay/Types.h"
84 #endif
85 
86 
87 //******************************************************************************
88 // namespace
89 //******************************************************************************
90 namespace gVirtualXRay {
91 
92 
93 //==============================================================================
98 //==============================================================================
99 class SphereMesh: public PolygonMesh
100 //------------------------------------------------------------------------------
101 {
102 //******************************************************************************
103 public:
104  //--------------------------------------------------------------------------
106 
115  //--------------------------------------------------------------------------
116  SphereMesh(unsigned int aNumberOfRings,
117  unsigned int aNumberOfSectors,
118  float aRadius,
119  int anIndexDataType = 0);
120 
121 
122  SphereMesh(unsigned int aNumberOfSubdivision = 0,
123  float aRadius = 0.5 * cm,
124  int anIndexDataType = 0);
125 
126 
127  //--------------------------------------------------------------------------
129 
138  //--------------------------------------------------------------------------
139  void create(unsigned int aNumberOfRings,
140  unsigned int aNumberOfSectors,
141  float aRadius,
142  int anIndexDataType = 0);
143 
144 
145  void create(unsigned int aNumberOfSubdivision = 0,
146  float aRadius = 0.5 * cm,
147  int anIndexDataType = 0);
148 
149 
150 
151 
152 private:
153  void subdivision();
154  float m_radius;
155 };
156 
157 
158 } // namespace gVirtualXRay
159 
160 
161 //******************************************************************************
162 #include "SphereMesh.inl"
163 
164 
165 #endif // __SphereMesh_h
Type declarations.
SphereMesh(unsigned int aNumberOfRings, unsigned int aNumberOfSectors, float aRadius, int anIndexDataType=0)
Default constructor.
Definition: SphereMesh.inl:71
void create(unsigned int aNumberOfRings, unsigned int aNumberOfSectors, float aRadius, int anIndexDataType=0)
Create a new sphere.
SphereMesh is a class to handle 3D meshes of spheres.
Definition: SphereMesh.h:99
PolygonMesh is a class to handle polygon (triangles) meshes.
Definition: PolygonMesh.h:114
const double cm
centimeter
Definition: Units.h:106
Class to handle 3D meshes of spheres.
Class to handle polygon (triangles) meshes.