COVISE Core
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
15namespace covise
16{
17
19{
20public:
21 enum
22 {
23 TESSELATION = 17
24 };
25
26private:
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
57public:
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
#define ALGEXPORT
Definition: coExport.h:337
#define M_PI
Definition: coVector.cpp:30
GLenum GLenum GLenum GLenum GLenum scale
Definition: khronos-glext.h:9991
GLfloat angle
Definition: khronos-glext.h:12122
list of all chemical elements
Definition: coConfig.h:27
std::vector< TRIANGLE > TESSELATION
Definition: IsoSurfaceGPMUtil.h:75
Definition: coObjID.h:231
Definition: coDistributedObject.h:296
Definition: coSphere.h:19
float gcos(float angle)
Definition: coSphere.h:51
float gsin45_
Definition: coSphere.h:31
float gsin(float angle)
Definition: coSphere.h:47