COVISE Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
coIsoSurface.h
Go to the documentation of this file.
1 /* This file is part of COVISE.
2 
3  You can use it under the terms of the GNU Lesser General Public License
4  version 2.1 or later, see lgpl-2.1.txt.
5 
6  * License: LGPL 2+ */
7 
8 #ifndef _PLANE_KRAMM_H
9 #define _PLANE_KRAMM_H
10 
11 #include <util/coTypes.h>
12 #include <cstdlib>
13 #include <alg/IsoSurfaceGPMUtil.h>
14 
15 namespace covise
16 {
17 
18 class coOutputPort;
19 
20 typedef struct NodeInfo_s
21 {
22  float dist;
23  int side;
24  int targets[12];
25  int vertice_list[12];
26 } NodeInfo;
27 
28 typedef struct cutting_info_s
29 {
30  int node_pairs[12];
31  int nvert;
32 } cutting_info;
33 
35 {
36  friend class STR_IsoPlane;
37  friend class UNI_IsoPlane;
38  friend class RECT_IsoPlane;
39  friend class POLYHEDRON_IsoPlane;
40 
41 protected:
42  const int *el, *cl, *tl;
43  const float *x_in;
44  const float *y_in;
45  const float *z_in;
46  const float *s_in; // mapped scalar data
47  const float *i_in; // isodata
48  const float *u_in; // mapped vector data
49  const float *v_in; // mapped vector data
50  const float *w_in; // mapped vector data
51 
52 private:
53  int num_nodes;
54  int num_elem;
59  int *vertex;
64  int *neighbors;
65  float *coords_x;
66  float *coords_y;
67  float *coords_z;
68  float *coord_x;
69  float *coord_y;
70  float *coord_z;
71  float *V_Data_U;
72  float *V_Data_V;
73  float *V_Data_W;
74  float *S_Data;
75  float *V_Data_U_p;
76  float *V_Data_V_p;
77  float *V_Data_W_p;
78  float *S_Data_p;
79  float *Normals_U;
80  float *Normals_V;
81  float *Normals_W;
83  int Datatype;
84  float _isovalue;
86  char *iblank;
87 
88  // Maximal number of triangles attached to one Vertex.
89  // configure at IsoSurface.MAX_TRI_PER_VERT
90  // starting value for
91  static int maxTriPerVertex;
92 
93  // This variable represents the current state. Set when
94  // a neighbour list is built. Might be increased if the
95  // list was not built successfully with the given default
97 
98 protected:
99  bool add_vertex(int n1, int n2);
100  void add_vertex(int n1, int n2, int x, int y, int z, int u, int v, int w);
101 
102 public:
104 
105  IsoPlane();
106  IsoPlane(int n_elem, int n_nodes, int Type, float cutVertexRatio,
107  const int *el, const int *cl, const int *tl,
108  const float *x_in, const float *y_in, const float *z_in,
109  const float *s_in, const float *i_in,
110  const float *u_in, const float *v_in, const float *w_in, float isovalue,
111  bool isConnected, char *ib);
112  IsoPlane(int n_elem, int n_nodes, int Type, /*float cutVertexRatio,*/
113  const int *el, const int *cl, const int *tl,
114  const float *x_in, const float *y_in, const float *z_in,
115  const float *s_in, const float *i_in,
116  const float *u_in, const float *v_in, const float *w_in, float isovalue,
117  bool isConnected, char *ib);
118  virtual ~IsoPlane();
119  void createNormals(int genstrips);
120  void createStrips(int gennormals);
121  void createcoDistributedObjects(coOutputPort *, coOutputPort *, coOutputPort *,
122  int gennormals, int genstrips,
123  const char *colorn);
124  bool createIsoPlane();
125  void createNeighbourList();
126 
127  // access to output fields
129  {
130  return num_coords;
131  };
133  {
134  return (int)(vertex - vertice_list);
135  };
137  {
138  return num_triangles;
139  }
140  float *getXout()
141  {
142  return coords_x;
143  };
144  float *getYout()
145  {
146  return coords_y;
147  };
148  float *getZout()
149  {
150  return coords_z;
151  };
153  {
154  return vertice_list;
155  };
156 };
157 
159 {
160 
161 public:
162  STR_IsoPlane(int n_elem, int n_nodes, int Type,
163  int xsiz, int ysiz, int zsiz,
164  const float *x_in, const float *y_in, const float *z_in,
165  const float *s_in, const float *i_in,
166  const float *u_in, const float *v_in, const float *w_in, float isovalue,
167  bool isConnected, char *ib)
168  : IsoPlane(n_elem, n_nodes, Type, -1, NULL, NULL, NULL, x_in, y_in, z_in,
169  s_in, i_in, u_in, v_in, w_in, isovalue, isConnected, ib)
170  , x_size(xsiz)
171  , y_size(ysiz)
172  , z_size(zsiz)
173  {
174  }
175  bool createIsoPlane();
176 
177 private:
178  int x_size;
179  int y_size;
180  int z_size;
181 };
182 
184 {
185 
186 public:
187  UNI_IsoPlane(int n_elem, int n_nodes, int Type,
188  float x_min, float x_max, float y_min,
189  float y_max, float z_min, float z_max,
190  int xsiz, int ysiz, int zsiz,
191  const float *sin, const float *iin,
192  const float *uin, const float *vin, const float *win, float isovalue,
193  bool isConnected, char *ib);
194  virtual ~UNI_IsoPlane();
195  void createIsoPlane();
196 
197 private:
198  int x_size;
199  int y_size;
200  int z_size;
201 };
202 
204 {
205 
206 public:
207  RECT_IsoPlane(int n_elem, int n_nodes, int Type,
208  int xsiz, int ysiz, int zsiz,
209  const float *xin, const float *yin, const float *zin,
210  const float *sin, const float *iin,
211  const float *uin, const float *vin, const float *win, float isovalue,
212  bool isConnected, char *ib);
213  void createIsoPlane();
214 
215 private:
216  int x_size;
217  int y_size;
218  int z_size;
219 };
220 
222 {
223 private:
224  int num_conn;
225 
226  /***************/
227  /* Output Data */
228  /***************/
229 
233 
234  int *elem_out;
235  int *conn_out;
236 
237  float *x_coord_out;
238  float *y_coord_out;
239  float *z_coord_out;
240  float *sdata_out;
241  float *udata_out;
242  float *vdata_out;
243  float *wdata_out;
244 
245 public:
246  POLYHEDRON_IsoPlane(int n_elem, int n_conn, int n_nodes, int Type,
247  const int *el, const int *cl, const int *tl,
248  const float *x_in, const float *y_in, const float *z_in,
249  const float *s_in, const float *i_in,
250  const float *u_in, const float *v_in, const float *w_in, float isovalue,
251  bool isConnected, char *ib);
252 
254 
255  void create_isocontour(int num_elem_in, int *elem_in, int num_conn_in, int *conn_in,
256  int num_coord_in, float *x_coord_in, float *y_coord_in, float *z_coord_in,
257  int *polygon_list, int *index_list, float *isodata_in, float *sdata_in, float *udata_in, float *vdata_in, float *wdata_in,
258  float isovalue, ISOSURFACE_EDGE_INTERSECTION_VECTOR &intsec_vector, CONTOUR &contour, TESSELATION &triangulation);
259 
260  bool createIsoPlane();
261 
262  void createcoDistributedObjects(coOutputPort *p_GridOut, coOutputPort *p_DataOut);
263 };
264 }
265 #endif
int * ts_line_list
Definition: coIsoSurface.h:63
const int * tl
Definition: coIsoSurface.h:42
float * vdata_out
Definition: coIsoSurface.h:242
Definition: coIsoSurface.h:158
Definition: coOutputPort.h:26
const float * s_in
Definition: coIsoSurface.h:46
Definition: coIsoSurface.h:34
char * iblank
Definition: coIsoSurface.h:86
float * getYout()
Definition: coIsoSurface.h:144
int x_size
Definition: coIsoSurface.h:198
int num_coords
Definition: coIsoSurface.h:60
float * coords_y
Definition: coIsoSurface.h:66
float * getXout()
Definition: coIsoSurface.h:140
STR_IsoPlane(int n_elem, int n_nodes, int Type, int xsiz, int ysiz, int zsiz, const float *x_in, const float *y_in, const float *z_in, const float *s_in, const float *i_in, const float *u_in, const float *v_in, const float *w_in, float isovalue, bool isConnected, char *ib)
Definition: coIsoSurface.h:162
Definition: CuttingSurfaceGPMUtil.h:37
float * coords_x
Definition: coIsoSurface.h:65
int num_vertices
Definition: coIsoSurface.h:56
float * coords_z
Definition: coIsoSurface.h:67
GLint GLint GLint GLint GLint GLint y
Definition: khronos-glext.h:6346
float * V_Data_U
Definition: coIsoSurface.h:71
struct covise::NodeInfo_s NodeInfo
float * udata_out
Definition: coIsoSurface.h:241
NodeInfo * node_table
Definition: coIsoSurface.h:82
int * neighbors
Definition: coIsoSurface.h:64
int num_coord_out
Definition: coIsoSurface.h:232
float * V_Data_V
Definition: coIsoSurface.h:72
float * V_Data_V_p
Definition: coIsoSurface.h:76
#define NULL
Definition: covise_list.h:22
float * coord_x
Definition: coIsoSurface.h:68
int y_size
Definition: coIsoSurface.h:179
static int maxTriPerVertex
Definition: coIsoSurface.h:91
const float * y_in
Definition: coIsoSurface.h:44
int z_size
Definition: coIsoSurface.h:180
GLdouble GLdouble z
Definition: khronos-glext.h:6565
float * V_Data_U_p
Definition: coIsoSurface.h:75
int z_size
Definition: coIsoSurface.h:218
float * getZout()
Definition: coIsoSurface.h:148
Definition: coIsoSurface.h:221
float _isovalue
Definition: coIsoSurface.h:84
#define ALGEXPORT
Definition: coExport.h:313
bool _isConnected
Definition: coIsoSurface.h:85
const float * w_in
Definition: coIsoSurface.h:50
GLint GLint GLint GLint GLint x
Definition: khronos-glext.h:6346
int x_size
Definition: coIsoSurface.h:216
int targets[12]
Definition: coCuttingSurface.h:41
int node_pairs[12]
Definition: coCuttingSurface.h:47
const float * u_in
Definition: coIsoSurface.h:48
const float * i_in
Definition: coIsoSurface.h:47
Definition: coIsoSurface.h:203
const GLdouble * v
Definition: khronos-glext.h:6442
int * vertex
Definition: coIsoSurface.h:59
int max_coords
Definition: coIsoSurface.h:61
float * Normals_W
Definition: coIsoSurface.h:81
float * Normals_U
Definition: coIsoSurface.h:79
int side
Definition: coCuttingSurface.h:40
GLubyte GLubyte GLubyte GLubyte w
Definition: khronos-glext.h:6793
int num_elem
Definition: coIsoSurface.h:54
int getNumCoords()
Definition: coIsoSurface.h:128
float * coord_z
Definition: coIsoSurface.h:70
float * y_coord_out
Definition: coIsoSurface.h:238
int * vertice_list
Definition: coIsoSurface.h:58
int num_elem_out
Definition: coIsoSurface.h:230
float * sdata_out
Definition: coIsoSurface.h:240
int getNumTriangles()
Definition: coIsoSurface.h:136
const float * v_in
Definition: coIsoSurface.h:49
int num_conn_out
Definition: coIsoSurface.h:231
int nvert
Definition: coCuttingSurface.h:48
float dist
Definition: coCuttingSurface.h:39
int num_triangles
Definition: coIsoSurface.h:55
int * ts_vertice_list
Definition: coIsoSurface.h:62
float * S_Data
Definition: coIsoSurface.h:74
int * conn_out
Definition: coIsoSurface.h:235
int num_conn
Definition: coIsoSurface.h:224
float * Normals_V
Definition: coIsoSurface.h:80
int * getVerticeList()
Definition: coIsoSurface.h:152
Definition: coCuttingSurface.h:37
float * V_Data_W_p
Definition: coIsoSurface.h:77
float * S_Data_p
Definition: coIsoSurface.h:78
int * elem_out
Definition: coIsoSurface.h:234
int z_size
Definition: coIsoSurface.h:200
float * wdata_out
Definition: coIsoSurface.h:243
std::vector< TRIANGLE > TESSELATION
Definition: IsoSurfaceGPMUtil.h:75
int num_strips
Definition: coIsoSurface.h:57
int num_nodes
Definition: coIsoSurface.h:53
float * coord_y
Definition: coIsoSurface.h:69
int y_size
Definition: coIsoSurface.h:217
int triPerVertex
Definition: coIsoSurface.h:96
Definition: coIsoSurface.h:183
int Datatype
Definition: coIsoSurface.h:83
int x_size
Definition: coIsoSurface.h:178
float * x_coord_out
Definition: coIsoSurface.h:237
float * z_coord_out
Definition: coIsoSurface.h:239
int vertice_list[12]
Definition: coCuttingSurface.h:42
struct covise::cutting_info_s cutting_info
float * V_Data_W
Definition: coIsoSurface.h:73
const float * x_in
Definition: coIsoSurface.h:43
bool polyhedral_cells_found
Definition: coIsoSurface.h:103
int y_size
Definition: coIsoSurface.h:199
int getNumVertices()
Definition: coIsoSurface.h:132
const float * z_in
Definition: coIsoSurface.h:45
std::vector< ISOSURFACE_EDGE_INTERSECTION > ISOSURFACE_EDGE_INTERSECTION_VECTOR
Definition: IsoSurfaceGPMUtil.h:73