gVirtualXRay  2.0.10
VirtualX-RayImagingLibraryonGPU
CylinderMesh.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 __CylinderMesh_h
36 #define __CylinderMesh_h
37 
38 
66 //******************************************************************************
67 // Include
68 //******************************************************************************
69 #ifndef __gVirtualXRayConfig_h
71 #endif
72 
73 #include <string>
74 #include <vector>
75 
76 #ifndef __PolygonMesh_h
78 #endif
79 
80 #ifndef __Types_h
81 #include "gVirtualXRay/Types.h"
82 #endif
83 
84 
85 //******************************************************************************
86 // namespace
87 //******************************************************************************
88 namespace gVirtualXRay {
89 
90 
91 //==============================================================================
96 //==============================================================================
97 template<typename T> class CylinderMesh: public PolygonMesh
98 //------------------------------------------------------------------------------
99 {
100 //******************************************************************************
101 public:
102  //--------------------------------------------------------------------------
104 
112  //--------------------------------------------------------------------------
113  CylinderMesh(unsigned int aNumberOfSectors = 10,
114  double aHeight = 1.0 * cm,
115  double aRadius = 0.5 * cm,
116  int anIndexDataType = 0);
117 
118 
119  //--------------------------------------------------------------------------
121 
129  //--------------------------------------------------------------------------
130  void create(unsigned int aNumberOfSectors = 10,
131  double aHeight = 1.0 * cm,
132  double aRadius = 0.5 * cm,
133  int anIndexDataType = 0);
134 
135 
136 private:
137  void subdivision();
138  double m_height;
139  double m_radius;
140 };
141 
142 
143 } // namespace gVirtualXRay
144 
145 
146 //******************************************************************************
147 #include "CylinderMesh.inl"
148 
149 
150 #endif // __CylinderMesh_h
CylinderMesh is a class to handle 3D meshes of cylinders.
Definition: CylinderMesh.h:97
Type declarations.
CylinderMesh(unsigned int aNumberOfSectors=10, double aHeight=1.0 *cm, double aRadius=0.5 *cm, int anIndexDataType=0)
Default constructor.
Class to handle 3D meshes of cylinders.
void create(unsigned int aNumberOfSectors=10, double aHeight=1.0 *cm, double aRadius=0.5 *cm, int anIndexDataType=0)
Create a new sphere.
PolygonMesh is a class to handle polygon (triangles) meshes.
Definition: PolygonMesh.h:114
const double cm
centimeter
Definition: Units.h:106
Class to handle polygon (triangles) meshes.