Blender  V3.3
Projections.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #ifndef __PROJECTIONS_H__
4 #define __PROJECTIONS_H__
5 
6 #include <stdio.h>
7 #include <stdlib.h>
8 
9 #define CONTAINS_INDEX
10 #define GRID_DIMENSION 20
11 
12 #if defined(_WIN32) && !(_MSC_VER >= 1900)
13 # define isnan(n) _isnan(n)
14 # define LONG __int64
15 # define int64_t __int64
16 #else
17 # include <stdint.h>
18 #endif
19 
27 extern const int vertmap[8][3];
28 extern const int centmap[3][3][3][2];
29 extern const int edgemap[12][2];
30 extern const int facemap[6][4];
31 
32 /* Axes:
33  * 0, 1, 2: cube face normals
34  *
35  * 3: triangle normal
36  *
37  * 4, 5, 6,
38  * 7, 8, 9,
39  * 10, 11, 12: cross of each triangle edge vector with each cube
40  * face normal
41  */
42 #define NUM_AXES 13
43 
50 
52  double norm[3];
53 
55  int index;
56 };
57 
58 /* This is a projection for the cube against a single projection
59  axis, see CubeTriangleIsect.cubeProj */
64 };
65 
70  public:
73 
76 
77  public:
79  {
80  }
81 
85  CubeTriangleIsect(int64_t cube[2][3], int64_t trig[3][3], int64_t error, int triind);
86 
92 
93  unsigned char getBoxMask();
94 
98  void shift(int off[3]);
99 
103  int isIntersecting() const;
104 
105  int isIntersectingPrimary(int edgeInd) const;
106 
107  float getIntersectionPrimary(int edgeInd) const;
108 
109 #ifdef WITH_CXX_GUARDEDALLOC
110  MEM_CXX_CLASS_ALLOC_FUNCS("DUALCON:CubeTriangleIsect")
111 #endif
112 };
113 
114 #endif /* __PROJECTIONS_H__ */
const int edgemap[12][2]
Definition: Projections.cpp:28
#define NUM_AXES
Definition: Projections.h:42
const int centmap[3][3][3][2]
Definition: Projections.cpp:21
const int vertmap[8][3]
Definition: Projections.cpp:10
const int facemap[6][4]
Definition: Projections.cpp:43
void shift(int off[3])
int isIntersecting() const
int isIntersectingPrimary(int edgeInd) const
CubeProjection cubeProj[NUM_AXES]
Projections of the cube vertices.
Definition: Projections.h:75
unsigned char getBoxMask()
TriangleProjection * inherit
Inheritable portion.
Definition: Projections.h:72
float getIntersectionPrimary(int edgeInd) const
static void error(const char *str)
Definition: meshlaplacian.c:51
__int64 int64_t
Definition: stdint.h:89
int64_t origin
Definition: Projections.h:61
int64_t edges[3]
Definition: Projections.h:62
int64_t tri_proj[NUM_AXES][2]
Projections of triangle (min and max)
Definition: Projections.h:49
double norm[3]
Normal of the triangle.
Definition: Projections.h:52
int index
Index of polygon.
Definition: Projections.h:55