gVirtualXRay  2.0.10
VirtualX-RayImagingLibraryonGPU
AnatomicalMesh.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 __AnatomicalMesh_h
36 #define __AnatomicalMesh_h
37 
38 
56 //******************************************************************************
57 // Include
58 //******************************************************************************
59 #include <string>
60 
61 #ifndef __PolygonMesh_h
63 #endif
64 
65 #ifndef __Matrix4x4_h
66 #include "gVirtualXRay/Matrix4x4.h"
67 #endif
68 
69 
70 //******************************************************************************
71 // Namespace
72 //******************************************************************************
73 namespace gVirtualXRay {
74 
75 
76 //==============================================================================
81 //==============================================================================
83 //------------------------------------------------------------------------------
84 {
85 //******************************************************************************
86 public:
87  //--------------------------------------------------------------------------
89  //--------------------------------------------------------------------------
91 
92 
93  //--------------------------------------------------------------------------
95  //--------------------------------------------------------------------------
96  virtual ~AnatomicalMesh();
97 
98 
99  //--------------------------------------------------------------------------
101  //--------------------------------------------------------------------------
102  virtual bool isTransparent() const = 0;
103 
104 
105  //--------------------------------------------------------------------------
107  //--------------------------------------------------------------------------
108  virtual bool isSoftTissue() const = 0;
109 
110 
111  //--------------------------------------------------------------------------
113  /*
114  * @param shader_id: The GLSL shader used to display the anatomical mesh
115  */
116  //-------------------------------------------------------------------------
117  virtual void defineDisplayShaderInput(int shader_id);
118 
119 
120  //--------------------------------------------------------------------------
122  //--------------------------------------------------------------------------
123  virtual void initialize() = 0;
124 
125 
126  virtual void copyFrom(const AnatomicalMesh& aPolygonMesh);
127 
128 
129  virtual AnatomicalMesh& operator=(const PolygonMesh& aPolygonMesh);
130 
131 
132  virtual AnatomicalMesh& operator=(const AnatomicalMesh& aPolygonMesh);
133 
134 
135  //--------------------------------------------------------------------------
137  /*
138  * @return the label
139  */
140  //-------------------------------------------------------------------------
141  virtual const std::string& getLabel() const;
142 
143 
144 //******************************************************************************
145 protected:
148 
151 
153  std::string m_label;
154 };
155 
156 
157 } //namespace gVirtualXRay
158 
159 
160 #endif // __AnatomicalMesh_h
virtual const std::string & getLabel() const
Accessor on the label that determines the type of the mesh.
int m_use_texture
1 if the mesh use texturing; default value is 0
virtual void copyFrom(const AnatomicalMesh &aPolygonMesh)
virtual bool isTransparent() const =0
return true if the mesh has to be displayed with transparency
Template class to handle a 4x4 matrixs.
PolygonMesh is a class to handle polygon (triangles) meshes.
Definition: PolygonMesh.h:114
AnatomicalMesh is a class to handle a polygon mesh for tissue.
virtual void defineDisplayShaderInput(int shader_id)
Link the attributes to their id in the shader.
virtual AnatomicalMesh & operator=(const PolygonMesh &aPolygonMesh)
Copy operator.
std::string m_label
A label to determine the type of the mesh.
AnatomicalMesh()
Default Constructor.
virtual void initialize()=0
initialize the needful depending on the organ
virtual ~AnatomicalMesh()
Destructor.
virtual bool isSoftTissue() const =0
return true if the mesh represent a soft tissue
int m_use_bump_map
1 if the mesh use bump mapping; default value is 0
Class to handle polygon (triangles) meshes.