COVISE Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
coSphere.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_SPHERE_H
9 #define CO_SPHERE_H
10 
11 #include <util/coExport.h>
12 #include <sysdep/math.h>
13 #include <do/coDoSpheres.h>
14 
15 namespace covise
16 {
17 
19 {
20 public:
21  enum
22  {
24  };
25 
26 private:
27  float gcos_72_[5];
28  float gcos_72_36_[5];
29  float gsin_72_[5];
30  float gsin_72_36_[5];
31  float gsin45_;
32 
33  // a unit sphere
34  float xSphere_[TESSELATION];
35  float ySphere_[TESSELATION];
36  float zSphere_[TESSELATION];
37  float normalsOutX_[TESSELATION];
38  float normalsOutY_[TESSELATION];
39  float normalsOutZ_[TESSELATION];
40  int tsl_[6];
41  int vl_[42];
42 
43  float xScaleSphere_[TESSELATION];
44  float yScaleSphere_[TESSELATION];
45  float zScaleSphere_[TESSELATION];
46 
47  float gsin(float angle)
48  {
49  return ((float)(sin((angle * M_PI) / 180.0)));
50  };
51  float gcos(float angle)
52  {
53  return ((float)(cos((angle * M_PI) / 180.0)));
54  };
55  void buildOneUnitSphere();
56 
57 public:
58  coSphere();
59  void deformSpheres(int numPoints, float *dataIn[3], float *xPoints, float *yPoints, float *zPoints, float *xSpheres, float *ySpheres, float *zSpheres, float *normalsOut[3], float scale);
60 
61  void scaleSphere(float radius);
62 
63  void useScaledSphere(const float *sourceX, const float *sourceY, const float *sourceZ, const float *data_in, float radscal, float *xSpheres, float *ySpheres, float *zSpheres, float *xPoints, float *yPoints, float *zPoints, float *normalsOut[3], int *tsl, int *vl, int numPoints, float *dataOut, float *colorIn, int hasColor);
64 
65  void computeSpheres(float scale, float radius, float *data_in[3], float *xSpheres, float *ySpheres, float *zSpheres, float *xPoints, float *yPoints, float *zPoints, float *normalsOut[3], int *tsl, int *vl, int numPoints, float *dataOut, float *colorIn, int hasColor, int hasData);
66  coDistributedObject *amplifyData(const coDistributedObject *, const coObjInfo &newObj, int);
67 };
68 }
69 #endif
float gcos(float angle)
Definition: coSphere.h:51
Definition: coSphere.h:18
Definition: coObjID.h:230
#define ALGEXPORT
Definition: coExport.h:313
GLenum GLenum GLenum GLenum GLenum scale
Definition: khronos-glext.h:9991
GLfloat angle
Definition: khronos-glext.h:12122
#define M_PI
Definition: coVector.cpp:30
std::vector< TRIANGLE > TESSELATION
Definition: IsoSurfaceGPMUtil.h:75
Definition: coDistributedObject.h:295
float gsin(float angle)
Definition: coSphere.h:47
float gsin45_
Definition: coSphere.h:31