COVISE Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
coVectField.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 #include <util/coExport.h>
9 #include <string>
10 #include <do/coDoData.h>
11 #include <do/coDoLines.h>
12 
13 #ifndef YAC
14 #include "coColors.h"
15 #endif
16 
17 #define S_U 1
18 #define S_V 2
19 #define S_DATA 3
20 #define STR_GRD 1
21 #define RCT_GRD 2
22 #define UNI_GRD 3
23 #define on_the_bottom 1
24 #define on_the_middle 2
25 
26 namespace covise
27 {
28 
29 class coDistributedObject;
30 class coDoLines;
31 class coDoColormap;
32 class ScalarContainer;
33 
35 {
36 private:
37  float *s_out;
41 
42  //data for arrows
43  float angle_;
44  float cos_a_;
45  float sin_a_;
46  float *cosenos_;
47  float *senos_;
52 
53  int numc;
54  int length_param, fasten_param;
55  float scale, scale_min, scale_max;
56  int i_dim, j_dim, k_dim;
57  float min_max[6];
58  int grdtype;
59  float *x_in, *x_c;
60  float *y_in, *y_c;
61  float *z_in, *z_c;
62  float *s_in;
63  float *u_in, *v_in, *w_in;
64  int *l_l, *v_l;
65  float *n_x, *n_y, *n_z;
66 
67  void create_strgrid_lines();
68  void create_rectgrid_lines();
69  void create_unigrid_lines();
70  void create_lines();
71  void vector_displacement();
72 
73  void create_stings();
74  void fillTheStingPoints(const int);
75  void orthoBase(float *, float *, const float *);
76 
77  void project_lines(int keepLength);
78 
79 public:
81  coVectField(int num_points,
82  float *_x_in, float *_y_in, float *_z_in,
83  float *_u_in, float *_v_in, float *_w_in);
84 
86  coVectField(int grd_type,
87  float *_x_in, float *_y_in, float *_z_in,
88  float *_u_in, float *_v_in, float *_w_in,
89  int _i_dim, int _j_dim, int _k_dim);
90 
92  coVectField(float *_x_in, float *_y_in, float *_z_in,
93  float *_u_in, float *_v_in, float *_w_in,
94  int _i_dim, int _j_dim, int _k_dim,
95  float min_max[6]);
96 
98  void setScalarInField(float *scField)
99  {
100  s_in = scField;
101  }
102 
104  void setProjectionNormals(float *_n_x, float *_n_y, float *_n_z)
105  {
106  n_x = _n_x;
107  n_y = _n_y;
108  n_z = _n_z;
109  }
110 
111  virtual ~coVectField()
112  {
113  if (s_out)
114  delete[] s_out;
115  }
116  enum ValFlag
117  {
119  PER_LINE
120  };
121  void compute_vectorfields(float scale, int length_param, int fasten_param, int num_sectors,
122  const coObjInfo *outlines, const coObjInfo *outfloat, ValFlag flag = PER_VERTEX);
123  void compute_vectorfields(float scale_, int length, int fasten_param, int num_sectors,
124  float arrow_factor, float angle, const coObjInfo *objInfoLines, const coObjInfo *objInfoFloat, ValFlag = PER_VERTEX);
125 
127  {
128  return s_out;
129  }
131  {
132  return num_scalar;
133  }
135  {
136  return lines_out;
137  }
139  {
140  return u_scalar_data;
141  }
142 };
143 
144 #ifndef YAC
146 {
147 public:
149  const coDoColormap *colorMap, float scale, int lineChoice, int numsectors, int projectlines);
151  const coDoColormap *colorMap, float scale, int lineChoice, int numsectors, float arrow_factor,
152  float angle, int projectlines);
153 
154  bool Execute(coDistributedObject **lines,
155  coDistributedObject **colorSurf, coDistributedObject **colorLines,
156  std::string, std::string, bool, const ScalarContainer *, int vectOpt);
157 
158 private:
159  bool CreateLinesAndScalar(coDistributedObject **lines, std::string linesName,
160  const coDistributedObject *geo, const coDistributedObject *vect,
161  ScalarContainer &scalar);
162  bool CreateColors(coDistributedObject **color, std::string colorName,
163  const ScalarContainer &scalar,
164  bool CMAPAttr, const ScalarContainer *SCont, int repeat);
168 
169  // parameters for coVectField
170  float _scale;
175  float _angle;
177 };
178 #endif
179 }
int numc_line_2_
Definition: coVectField.h:50
float * z_in
Definition: coVectField.h:61
float * get_scalar_data()
Definition: coVectField.h:126
ValFlag
Definition: coVectField.h:116
float * x_in
Definition: coVectField.h:59
int grdtype
Definition: coVectField.h:58
int get_scalar_count()
Definition: coVectField.h:130
int num_sectors_
Definition: coVectField.h:49
int num_scalar
Definition: coVectField.h:38
coDoFloat * u_scalar_data
Definition: coVectField.h:40
float angle_
Definition: coVectField.h:43
const coDistributedObject * _vect
Definition: coVectField.h:166
float * cosenos_
Definition: coVectField.h:46
Definition: coVectField.h:118
GLsizei const GLchar *const * string
Definition: khronos-glext.h:6750
const coDistributedObject * _geo
Definition: coVectField.h:165
float _angle
Definition: coVectField.h:175
float * senos_
Definition: coVectField.h:47
const int PER_VERTEX
Definition: covise_shm.h:144
Definition: coObjID.h:230
int numc_line_3_
Definition: coVectField.h:51
float _scale
Definition: coVectField.h:170
#define ALGEXPORT
Definition: coExport.h:313
float * s_out
Definition: coVectField.h:37
coDoFloat * get_obj_scalar()
Definition: coVectField.h:138
const coDoColormap * _colorMap
Definition: coVectField.h:167
virtual ~coVectField()
Definition: coVectField.h:111
int length_param
Definition: coVectField.h:54
int * v_l
Definition: coVectField.h:64
void setScalarInField(float *scField)
set the scalar field
Definition: coVectField.h:98
coDoLines * lines_out
Definition: coVectField.h:39
float * y_in
Definition: coVectField.h:60
float cos_a_
Definition: coVectField.h:44
Definition: coVectField.h:145
int numc
Definition: coVectField.h:53
Definition: coDoLines.h:47
int k_dim
Definition: coVectField.h:56
float * w_in
Definition: coVectField.h:63
float arrow_factor_
Definition: coVectField.h:48
GLenum GLenum GLenum GLenum GLenum scale
Definition: khronos-glext.h:9991
float sin_a_
Definition: coVectField.h:45
GLfloat angle
Definition: khronos-glext.h:12122
Definition: coDoData.h:84
int _fasten_param
Definition: coVectField.h:172
Definition: coDoColormap.h:38
int _length_param
Definition: coVectField.h:171
Definition: coDistributedObject.h:295
float * n_z
Definition: coVectField.h:65
Definition: coVectField.h:34
float scale_min
Definition: coVectField.h:55
Definition: coColors.h:69
int _num_sectors
Definition: coVectField.h:173
GLuint color
Definition: khronos-glext.h:6934
float _arrow_factor
Definition: coVectField.h:174
GLenum GLuint GLenum GLsizei length
Definition: khronos-glext.h:6279
void setProjectionNormals(float *_n_x, float *_n_y, float *_n_z)
set normal list (to project lines)
Definition: coVectField.h:104
coDoLines * get_obj_lines()
Definition: coVectField.h:134
float * s_in
Definition: coVectField.h:62
int _project_lines
Definition: coVectField.h:176