gVirtualXRay  2.0.10
VirtualX-RayImagingLibraryonGPU
CoordinateSystemMesh.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (c) 2023, 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 __CoordinateSystemMesh_h
36 #define __CoordinateSystemMesh_h
37 
38 
66 //******************************************************************************
67 // Include
68 //******************************************************************************
69 #ifndef __gVirtualXRayConfig_h
71 #endif
72 
73 // #include <memory>
74 // #include <vector> // To store the energy response
75 // #include <utility> // To create STL pairs
76 
77 // #ifndef TYPES_H
78 // #include "gVirtualXRay/Types.h"
79 // #endif
80 
81 // #ifndef GVXR_MATRIX4X4_H
82 // #include "gVirtualXRay/Matrix4x4.h"
83 // #endif
84 
85 // #ifndef GVXR_VBO_H
86 // #include "gVirtualXRay/VBO.h"
87 // #endif
88 
89 #ifndef __LineMesh_h
90 #include "gVirtualXRay/LineMesh.h"
91 #endif
92 
93 // #ifndef GVXR_UBE_MESH_H
94 // #include "gVirtualXRay/CubeMesh.h"
95 // #endif
96 
97 
98 //******************************************************************************
99 // namespace
100 //******************************************************************************
101 namespace gVirtualXRay {
102 
103 
104 //==============================================================================
110 //==============================================================================
112 //------------------------------------------------------------------------------
113 {
114 //******************************************************************************
115 public:
116  //--------------------------------------------------------------------------
118  //--------------------------------------------------------------------------
119  CoordinateSystemMesh(RATIONAL_NUMBER aLength = 1.0 * cm);
120 
121 
122  //--------------------------------------------------------------------------
124  //--------------------------------------------------------------------------
126 
127 
128  //--------------------------------------------------------------------------
130  //--------------------------------------------------------------------------
131  void release();
132 
133 
134  //--------------------------------------------------------------------------
136  //--------------------------------------------------------------------------
137  void display(GLuint aShaderID);
138 
139 
140  //--------------------------------------------------------------------------
142 
145  //--------------------------------------------------------------------------
146  void setLength(const RATIONAL_NUMBER& aLength);
147 
148 
149  //--------------------------------------------------------------------------
151 
154  //--------------------------------------------------------------------------
155  const RATIONAL_NUMBER& getLength() const;
156 
157 
158 //******************************************************************************
159 protected:
161 
162 
163  //--------------------------------------------------------------------------
165  //--------------------------------------------------------------------------
166  void updateVBOs();
167 
168 
171 
172 
175 
176 
179 };
180 
181 
182 } // namespace gVirtualXRay
183 
184 
185 //******************************************************************************
186 #include "CoordinateSystemMesh.inl"
187 
188 
189 #endif // __CoordinateSystemMesh_h
LineMesh< float > m_y_axis_geometry
The triangle mesh corresponding to the Y-axis.
void display(GLuint aShaderID)
Display the coordinate system axes using OpenGL.
CoordinateSystemMesh is a class to handle the display of coordinate system axes in the visualisation...
Class to handle 3D meshes of line segments.
float RATIONAL_NUMBER
Type of data used to store real numbers.
Definition: Types.h:107
const RATIONAL_NUMBER & getLength() const
Accessor on the length of axes (in units of length)
const double cm
centimeter
Definition: Units.h:106
LineMesh< float > m_x_axis_geometry
The triangle mesh corresponding to the X-axis.
CoordinateSystemMesh(RATIONAL_NUMBER aLength=1.0 *cm)
Default constructor.
void updateVBOs()
Update the VBOs.
Class to handle coordinate system meshes.
void setLength(const RATIONAL_NUMBER &aLength)
Set the length of axes (in units of length)
LineMesh< float > m_z_axis_geometry
The triangle mesh corresponding to the Z-axis.