1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
17 #pragma once
18 
19 /** \file
20  * \ingroup freestyle
21  * \brief Different natures for both vertices and edges
22  */
23 
24 namespace Freestyle {
25 
26 /*! Namespace gathering the different possible natures of 0D and 1D elements of the ViewMap */
27 namespace Nature {
28 
29 /* XXX Why not using enums??? */
30 /* In order to optimize for space (enum is int) - T.K. */
31 
32 typedef unsigned short VertexNature;
33 /*! true for any 0D element */
34 static const VertexNature POINT = 0;  // 0
35 /*! true for SVertex */
36 static const VertexNature S_VERTEX = (1 << 0);  // 1
37 /*! true for ViewVertex */
38 static const VertexNature VIEW_VERTEX = (1 << 1);  // 2
39 /*! true for NonTVertex */
40 static const VertexNature NON_T_VERTEX = (1 << 2);  // 4
41 /*! true for TVertex */
42 static const VertexNature T_VERTEX = (1 << 3);  // 8
43 /*! true for CUSP */
44 static const VertexNature CUSP = (1 << 4);  // 16
45 
46 typedef unsigned short EdgeNature;
47 /*! true for non feature edges (always false for 1D elements of the ViewMap) */
48 static const EdgeNature NO_FEATURE = 0;  // 0
49 /*! true for silhouettes */
50 static const EdgeNature SILHOUETTE = (1 << 0);  // 1
51 /*! true for borders */
52 static const EdgeNature BORDER = (1 << 1);  // 2
53 /*! true for creases */
54 static const EdgeNature CREASE = (1 << 2);  // 4
55 /*! true for ridges */
56 static const EdgeNature RIDGE = (1 << 3);  // 8
57 /*! true for valleys */
58 static const EdgeNature VALLEY = (1 << 4);  // 16
59 /*! true for suggestive contours */
60 static const EdgeNature SUGGESTIVE_CONTOUR = (1 << 5);  // 32
61 /*! true for material boundaries */
62 static const EdgeNature MATERIAL_BOUNDARY = (1 << 6);  // 64
63 /*! true for user-defined edge marks */
64 static const EdgeNature EDGE_MARK = (1 << 7);  // 128
65 
66 }  // end of namespace Nature
67 
68 } /* namespace Freestyle */
69