| 1 |
#ifndef SOLUTION_H |
| 2 |
#define SOLUTION_H |
| 3 |
|
| 4 |
#include <queue> |
| 5 |
|
| 6 |
#include <Inventor/nodes/SoSeparator.h> |
| 7 |
|
| 8 |
class Solution { |
| 9 |
public: |
| 10 |
Solution() {npar_ = 0;} |
| 11 |
~Solution() {} |
| 12 |
void copyDataToWorkArray(int varIndices[], int cur, int mx, int to); |
| 13 |
SoSeparator *createSceneWithWidgets(); |
| 14 |
SoSeparator *createInertialFrameScene(float dis); |
| 15 |
bool parse(const char* sFileName); |
| 16 |
bool read(const char* sFileName, int varIndices[]); |
| 17 |
void normalizeData(); |
| 18 |
void alloc(); |
| 19 |
void dealloc(); |
| 20 |
void searchForMaxMin(int component, int varIndices[]); |
| 21 |
void denormalizePosition(float position[]); |
| 22 |
void set_parID(std::queue<int> &parIDs); |
| 23 |
|
| 24 |
int nar() const {return nar_;} |
| 25 |
int npar() const {return npar_;} |
| 26 |
int parID(int i) const {return parID_[i];} |
| 27 |
long int branchID(int i) const {return branchID_[i];} |
| 28 |
long int numOrbits() const {return numOrbits_;} |
| 29 |
long int labels(int i) const {return orbits_[i].label;} |
| 30 |
int totalLabels() const {return totalLabels_;} |
| 31 |
long totalNumPoints() const {return totalNumPoints_;} |
| 32 |
int32_t numVerticesEachPeriod(int i) const {return orbits_[i].numVerticesEachPeriod;} |
| 33 |
float **data() const {return data_;} |
| 34 |
float masses(int i) const {return orbits_[i].mass;} |
| 35 |
|
| 36 |
private: |
| 37 |
SoSeparator *render(); |
| 38 |
SoGroup *renderPoints(int style); |
| 39 |
SoGroup *renderLines(); |
| 40 |
SoGroup *renderNurbsCurve(); |
| 41 |
SoGroup *renderTubes(); |
| 42 |
SoGroup *renderSurface(); |
| 43 |
SoSeparator *drawUsingTubes(); |
| 44 |
SoSeparator *drawABranchUsingSurface(long obStart, long obEnd, |
| 45 |
long numVert); |
| 46 |
SoSeparator *animateUsingPoints(int style, bool aniColoring); |
| 47 |
SoSeparator *animateUsingLines(bool aniColoring); |
| 48 |
SoSeparator *animateUsingTubes(bool aniColoring); |
| 49 |
SoSeparator *drawAnOrbitUsingPoints(int style, int iBranch, long int l, |
| 50 |
long int si, float scaler, int stability, int type, |
| 51 |
bool aniColoring); |
| 52 |
SoSeparator *drawAnOrbitUsingLines(int iBranch, long int l, long int si, |
| 53 |
float scaler, int stability, int type, bool aniColoring); |
| 54 |
SoSeparator *drawAnOrbitUsingTubes(int iBranch, long int l, long int si, |
| 55 |
float scaler, int stability, int type); |
| 56 |
SoSeparator *drawAnOrbitUsingNurbsCurve(int iBranch, long int l, |
| 57 |
long int si, float scaler, |
| 58 |
int stability, int type); |
| 59 |
SoSeparator *animateOrbitWithTail(int iBranch, long int j, long int si); |
| 60 |
SoSeparator *drawAPoint(float x, float y, float z, float size, float scale); |
| 61 |
SoSeparator *drawAStrip(float stripSet[][3], int size); |
| 62 |
|
| 63 |
SoSeparator *animateOrbitInertialSysUsingLine(int iBranch, int iOrbit, |
| 64 |
float (*vertices)[3], float (*largePrimPos)[3], float (*smallPrimPos)[3], |
| 65 |
float * myColorBase, float period, int size, |
| 66 |
float scaler, int stability, int type); |
| 67 |
SoSeparator *drawAnOrbitInertialSysUsingLines(int iBranch, int iOrbit, |
| 68 |
float (*myVertices)[3], float *myColorBase, |
| 69 |
long int arrSize, float scaler, int stability, int type); |
| 70 |
void convertDataToInertialSystem(float (*myVertices)[3], |
| 71 |
float *timeEqualDiv, float *myColorBase, |
| 72 |
long int arrSize, long int orbitSize, long int kth, long int sumX); |
| 73 |
SoSeparator *drawAnOrbitInertialSysUsingTubes(int iBranch, int iOrbit, |
| 74 |
float (*myVertices)[3], float *myColorBase, const long int arrSize, |
| 75 |
const float tubeRadiusScaler, const int stability, const int type); |
| 76 |
SoSeparator *drawAnOrbitInertialSysUsingNurbsCurve(int iBranch, |
| 77 |
int iOrbit, float (*myVertices)[3], const long int arrSize, |
| 78 |
const float scaler, const int stability, const int type); |
| 79 |
#if 0 |
| 80 |
SoSeparator * animateIner2(long int j, long int si); |
| 81 |
SoSeparator * animateOrbitMovement(long int n, long int si); |
| 82 |
SoSeparator * animateOrbitCalSteps(long int n,long int si); |
| 83 |
SoSeparator * animateOrbitWithNurbsCurveTail(long int j,long int si); |
| 84 |
SoSeparator *drawEarthMovement(int k); |
| 85 |
void calPrimPos(float t, float pos[]); |
| 86 |
void calSatPos(int center, float mu, float t, float primPos[], float satPos[]); |
| 87 |
SoSeparator *drawASphereWithColor(float color[], float position[], float size); |
| 88 |
#endif |
| 89 |
|
| 90 |
std::queue<long> positions_; |
| 91 |
double *time_; |
| 92 |
float (*xyzCoords_)[3]; |
| 93 |
int32_t *numVerticesEachBranch_; |
| 94 |
int32_t *numOrbitsInEachBranch_; |
| 95 |
int nar_; |
| 96 |
int npar_; |
| 97 |
|
| 98 |
long int totalNumPoints_; |
| 99 |
long int numBranches_; |
| 100 |
long int *branchID_; |
| 101 |
long int numOrbits_; |
| 102 |
struct orbit { |
| 103 |
long int label; |
| 104 |
long int ntst; |
| 105 |
long int ncol; |
| 106 |
double *par; |
| 107 |
float mass; |
| 108 |
float period; |
| 109 |
int32_t numVerticesEachPeriod; |
| 110 |
} *orbits_; |
| 111 |
int numAxis_; |
| 112 |
int totalLabels_; |
| 113 |
double (**parMax_); |
| 114 |
double (**parMin_); |
| 115 |
double (**parMid_); |
| 116 |
int *parID_; |
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
float max_[3], min_[3]; |
| 121 |
|
| 122 |
float **data_; |
| 123 |
}; |
| 124 |
|
| 125 |
extern Solution *mySolNode; |
| 126 |
|
| 127 |
#endif |