Visual Computing Library
Loading...
Searching...
No Matches
mesh.h
1/*****************************************************************************
2 * VCLib *
3 * Visual Computing Library *
4 * *
5 * Copyright(C) 2021-2025 *
6 * Visual Computing Lab *
7 * ISTI - Italian National Research Council *
8 * *
9 * All rights reserved. *
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the Mozilla Public License Version 2.0 as published *
13 * by the Mozilla Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 * This program is distributed in the hope that it will be useful, *
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
19 * Mozilla Public License Version 2.0 *
20 * (https://www.mozilla.org/en-US/MPL/2.0/) for more details. *
21 ****************************************************************************/
22
23#ifndef VCL_EXCEPTIONS_MESH_H
24#define VCL_EXCEPTIONS_MESH_H
25
26#include <stdexcept>
27#include <string>
28
29namespace vcl {
30
36class InconsistentMeshException : public std::runtime_error
37{
38public:
39 InconsistentMeshException(const std::string& err) : std::runtime_error(err)
40 {
41 }
42
43 virtual const char* what() const throw()
44 {
45 static std::string error;
46 error =
47 std::string("Inconsistent Mesh - ") + std::runtime_error::what();
48 return error.c_str();
49 }
50};
51
58class MissingPreconditionException : public std::runtime_error
59{
60public:
61 MissingPreconditionException(const std::string& err) :
62 std::runtime_error(err)
63 {
64 }
65
66 virtual const char* what() const throw()
67 {
68 static std::string error;
69 error = std::string("Missing Mesh Precondition - ") +
70 std::runtime_error::what();
71 return error.c_str();
72 }
73};
74
80class MissingCompactnessException : public std::runtime_error
81{
82public:
83 MissingCompactnessException(const std::string& err) :
84 std::runtime_error(err)
85 {
86 }
87
88 virtual const char* what() const throw()
89 {
90 static std::string error;
91 error =
92 std::string("Lack of Compactness - ") + std::runtime_error::what();
93 return error.c_str();
94 }
95};
96
103class MissingComponentException : public std::runtime_error
104{
105public:
106 MissingComponentException(const std::string& err) : std::runtime_error(err)
107 {
108 }
109
110 virtual const char* what() const throw()
111 {
112 static std::string error;
113 error =
114 std::string("Missing Component - ") + std::runtime_error::what();
115 return error.c_str();
116 }
117};
118
125class MissingTriangularRequirementException : public std::runtime_error
126{
127public:
128 MissingTriangularRequirementException(const std::string& err) :
129 std::runtime_error(err)
130 {
131 }
132
133 virtual const char* what() const throw()
134 {
135 static std::string error;
136 error = std::string("Missing Triangular Mesh Requirement - ") +
137 std::runtime_error::what();
138 return error.c_str();
139 }
140};
141
147class MissingQuadRequirementException : public std::runtime_error
148{
149public:
150 MissingQuadRequirementException(const std::string& err) :
151 std::runtime_error(err)
152 {
153 }
154
155 virtual const char* what() const throw()
156 {
157 static std::string error;
158 error = std::string("Missing Quad Mesh Requirement - ") +
159 std::runtime_error::what();
160 return error.c_str();
161 }
162};
163
169class BadVertexIndexException : public std::runtime_error
170{
171public:
172 BadVertexIndexException(const std::string& err) : std::runtime_error(err) {}
173
174 virtual const char* what() const throw()
175 {
176 static std::string error;
177 error = std::string("Bad Vertex Index - ") + std::runtime_error::what();
178 return error.c_str();
179 }
180};
181
188class BadCustomComponentTypeException : public std::runtime_error
189{
190public:
191 BadCustomComponentTypeException(const std::string& err) :
192 std::runtime_error(err)
193 {
194 }
195
196 virtual const char* what() const throw()
197 {
198 static std::string error;
199 error = std::string("Bad Custom Component Type - ") +
200 std::runtime_error::what();
201 return error.c_str();
202 }
203};
204
205} // namespace vcl
206
207#endif // VCL_EXCEPTIONS_MESH_H
Exception thrown when the type of a custom component is not the one expected.
Definition mesh.h:189
Exception thrown when an index is out of bounds in a vertex container.
Definition mesh.h:170
Exception thrown when the mesh is inconsistent.
Definition mesh.h:37
Exception thrown when the mesh is not compact.
Definition mesh.h:81
Exception thrown when a mesh/element component is missing (not enabled).
Definition mesh.h:104
Exception thrown when a precondition on an input/output mesh is missing.
Definition mesh.h:59
Exception thrown when an input/output mesh is not composed of quads.
Definition mesh.h:148
Exception thrown when an input/output mesh is not composed of triangles.
Definition mesh.h:126
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:43