COVISE Core
coCellToVert.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 CO_CELLTOVERT_H
9#define CO_CELLTOVERT_H
10
11// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
12// ++ (C)2005 Visenso ++
13// ++ Description: Interpolation from Cell Data to Vertex Data ++
14// ++ ( CellToVert module functionality ) ++
15// ++ ++
16// ++ Author: Sven Kufer( sk@visenso.de) ++
17// ++ ++
18// ++**********************************************************************/
19
20#include <covise/covise.h>
21
22namespace covise
23{
24
25class coDistributedObject;
26
28{
29private:
31 //
32 // Original algorithm by Andreas Werner: + Assume data value related to center of elements.
33 // + Calculate the average values weighted by the distance to the
34 // surrounding center of elements.
35 //
36 // - only implemented for unstructured grids
37 //
39
40 bool weightedAlgo(int num_elem, int num_conn, int num_point,
41 const int *elem_list, const int *conn_list, const int *type_list,
42 const int *neighbour_cells, const int *neighbour_idx,
43 const float *xcoord, const float *ycoord, const float *zcoord,
44 int numComp, int dataSize, const float *in_data_0, const float *in_data_1, const float *in_data_2,
45 float *out_data_0, float *out_data_1, float *out_data_2);
46
48 //
49 // Take the average value of all elements which the point includes
50 //
51 // implemtented for POLYGN, LINES, UNSGRD
52 //
54
55 bool simpleAlgo(int num_elem, int num_conn, int num_point,
56 const int *elem_list, const int *conn_list,
57 int numComp, int dataSize, const float *in_data_0, const float *in_data_1, const float *in_data_2,
58 float *out_data_0, float *out_data_1, float *out_data_2);
59
60public:
61 typedef enum
62 {
63 SQR_WEIGHT = 1,
64 SIMPLE = 2
65 } Algorithm;
66
67 //
68 // geoType/dataType: type string, .e.g. "UNSGRD"
69 // objName: name of the coDistributedObject to create
70 //
71 // returns NULL in case of an error
72 //
73 coDistributedObject *interpolate(bool unstructured, int num_elem, int num_conn, int num_point,
74 const int *elem_list, const int *conn_list, const int *type_list, const int *neighbour_cells, const int *neighbour_idx,
75 const float *xcoord, const float *ycoord, const float *zcoord,
76 int numComp, int &dataSize, const float *in_data_0, const float *in_data_1, const float *in_data_2,
77 const char *objName, Algorithm algo_option = SIMPLE);
78
79 coDistributedObject *interpolate(const coDistributedObject *geo_in,
80 int numComp, int &dataSize, const float *in_data_0, const float *in_data_1, const float *in_data_2,
81 const char *objName, Algorithm algo_option = SIMPLE);
82
83 // note: no attributes copied
84 coDistributedObject *interpolate(const coDistributedObject *geo_in, const coDistributedObject *data_in, const char *objName,
85 Algorithm algo_option = SIMPLE);
86
87 //
88 // returns false in case of an error
89 //
90 bool interpolate(bool unstructured, int num_elem, int num_conn, int num_point,
91 const int *elem_list, const int *conn_list, const int *type_list, const int *neighbour_cells, const int *neighbour_idx,
92 const float *xcoord, const float *ycoord, const float *zcoord,
93 int numComp, int &dataSize, const float *in_data_0, const float *in_data_1, const float *in_data_2,
94 float *out_data_0, float *out_data_1, float *out_data_2, Algorithm algo_option = SIMPLE);
95};
96}
97
98#endif
#define ALGEXPORT
Definition: coExport.h:337
GLenum GLsizei dataSize
Definition: khronos-glext.h:12392
list of all chemical elements
Definition: coConfig.h:27
Definition: coDistributedObject.h:296
Definition: coCellToVert.h:28