CheckId.java 4.16 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
/*-
 *  Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
 * 
 *  This file is part of CityDoctor2.
 *
 *  CityDoctor2 is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  CityDoctor2 is distributed in the hope that it will be useful,
Matthias Betz's avatar
Matthias Betz committed
12
 *  but WITHOUT ANY WARRANTY); without even the implied warranty of
13
14
15
16
17
18
19
20
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public License
 *  along with CityDoctor2.  If not, see <https://www.gnu.org/licenses/>.
 */
package de.hft.stuttgart.citydoctor2.check;

Matthias Betz's avatar
Matthias Betz committed
21
import java.io.Serializable;
22

Matthias Betz's avatar
Matthias Betz committed
23
public class CheckId implements Serializable {
24

Matthias Betz's avatar
Matthias Betz committed
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
	private static final long serialVersionUID = -6267337828874296004L;
	
	public static final CheckId C_GE_R_TOO_FEW_POINTS = new CheckId("C_GE_R_TOO_FEW_POINTS");
	public static final CheckId C_GE_R_NOT_CLOSED = new CheckId("C_GE_R_NOT_CLOSED");
	public static final CheckId C_GE_S_MULTIPLE_CONNECTED_COMPONENTS = new CheckId(
			"C_GE_S_MULTIPLE_CONNECTED_COMPONENTS");
	public static final CheckId C_GE_R_DUPLICATE_POINT = new CheckId("C_GE_R_DUPLICATE_POINT");
	public static final CheckId C_GE_R_SELF_INTERSECTION = new CheckId("C_GE_R_SELF_INTERSECTION");
	public static final CheckId C_GE_P_INTERIOR_DISCONNECTED = new CheckId("C_GE_P_INTERIOR_DISCONNECTED");
	public static final CheckId C_GE_P_INTERSECTING_RINGS = new CheckId("C_GE_P_INTERSECTING_RINGS");
	public static final CheckId C_GE_P_NON_PLANAR = new CheckId("C_GE_P_NON_PLANAR");
	public static final CheckId C_GE_S_TOO_FEW_POLYGONS = new CheckId("C_GE_S_TOO_FEW_POLYGONS");
	public static final CheckId C_GE_R_NULL_AREA = new CheckId("C_GE_R_NULL_AREA");
	public static final CheckId C_GE_S_NON_MANIFOLD_EDGE = new CheckId("C_GE_S_NON_MANIFOLD_EDGE");
	public static final CheckId C_GE_S_POLYGON_WRONG_ORIENTATION = new CheckId("C_GE_S_POLYGON_WRONG_ORIENTATION");
	public static final CheckId C_GE_S_ALL_POLYGONS_WRONG_ORIENTATION = new CheckId(
			"C_GE_S_ALL_POLYGONS_WRONG_ORIENTATION");
	public static final CheckId C_GE_S_NON_MANIFOLD_VERTEX = new CheckId("C_GE_S_NON_MANIFOLD_VERTEX");
	public static final CheckId C_GE_S_SELF_INTERSECTION = new CheckId("C_GE_S_SELF_INTERSECTION");
	public static final CheckId C_GE_P_HOLE_OUTSIDE = new CheckId("C_GE_P_HOLE_OUTSIDE");
	public static final CheckId IS_CEILING = new CheckId("IS_CEILING");
	public static final CheckId C_GE_P_INNER_RINGS_NESTED = new CheckId("C_GE_P_INNER_RINGS_NESTED");
47
48
49
50
51
52
53
	public static final CheckId C_SE_BS_IS_CEILING = new CheckId("C_SE_BS_IS_CEILING");
	public static final CheckId C_SE_BS_IS_FLOOR = new CheckId("C_SE_BS_IS_FLOOR");
	public static final CheckId C_SE_BS_IS_GROUND = new CheckId("C_SE_BS_IS_GROUND");
	public static final CheckId C_SE_BS_GROUND_NOT_FRAGMENTED = new CheckId("C_SE_BS_GROUND_NOT_FRAGMENTED");
	public static final CheckId C_SE_BS_IS_WALL = new CheckId("C_SE_BS_IS_WALL");
	public static final CheckId C_SE_SCHEMATRON = new CheckId("C_SE_SCHEMATRON");
	public static final CheckId C_SE_BS_ROOF_UNFRAGMENTED = new CheckId("C_SE_BS_ROOF_UNFRAGMENTED");
Matthias Betz's avatar
Matthias Betz committed
54
55
56
57
	public static final CheckId C_GE_S_NOT_CLOSED = new CheckId("C_GE_S_NOT_CLOSED");
	public static final CheckId C_GE_P_ORIENTATION_RINGS_SAME = new CheckId("C_GE_P_ORIENTATION_RINGS_SAME");
	
	private String name;
58

Matthias Betz's avatar
Matthias Betz committed
59
60
61
62
63
64
65
66
67
68
69
70
71
72
	public CheckId(String name) {
		this.name = name;
	}
	
	public String getName() {
		return name;
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		return result;
73
74
	}

Matthias Betz's avatar
Matthias Betz committed
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		CheckId other = (CheckId) obj;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		return true;
90
91
92
93
	}

	@Override
	public String toString() {
Matthias Betz's avatar
Matthias Betz committed
94
		return name;
95
96
97
	}

}