| 1 |
|
| 2 |
#ifndef PLAUT04_H |
| 3 |
#define PLAUT04_H |
| 4 |
|
| 5 |
#include <algorithm> |
| 6 |
#include <string> |
| 7 |
#include <vector> |
| 8 |
|
| 9 |
#include <ctype.h> |
| 10 |
#include <time.h> |
| 11 |
#include <math.h> |
| 12 |
#include <stdlib.h> |
| 13 |
#include <stdio.h> |
| 14 |
#include <stddef.h> |
| 15 |
#include <string.h> |
| 16 |
#include <unistd.h> |
| 17 |
|
| 18 |
#include <Inventor/So.h> |
| 19 |
#include <Inventor/SoOffscreenRenderer.h> |
| 20 |
#include <Inventor/SbViewportRegion.h> |
| 21 |
#include <Inventor/SbLinear.h> |
| 22 |
#include <Inventor/SoPickedPoint.h> |
| 23 |
#include <Inventor/actions/SoRayPickAction.h> |
| 24 |
#include <Inventor/actions/SoWriteAction.h> |
| 25 |
#include <Inventor/actions/SoBoxHighlightRenderAction.h> |
| 26 |
#include <Inventor/actions/SoLineHighlightRenderAction.h> |
| 27 |
|
| 28 |
#include <Inventor/engines/SoTimeCounter.h> |
| 29 |
#include <Inventor/engines/SoSelectOne.h> |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
#include <Inventor/engines/SoCalculator.h> |
| 34 |
|
| 35 |
|
| 36 |
#include <Inventor/events/SoMouseButtonEvent.h> |
| 37 |
#include <Inventor/fields/SoField.h> |
| 38 |
|
| 39 |
#include <Inventor/nodes/SoEventCallback.h> |
| 40 |
#include <Inventor/nodes/SoSelection.h> |
| 41 |
|
| 42 |
#include <Inventor/nodes/SoFont.h> |
| 43 |
#include <Inventor/nodes/SoText2.h> |
| 44 |
|
| 45 |
#define SCREEN(w) XScreenNumberOfScreen(XtScreen(w)) |
| 46 |
|
| 47 |
#define NDEBUG |
| 48 |
|
| 49 |
|
| 50 |
#define LIST_UNDER_MENUBAR |
| 51 |
#define USE_EXAM_VIEWER |
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
#define TOGGLE_ON(BUTTON) \ |
| 57 |
XmToggleButtonSetState((Widget) BUTTON, TRUE, FALSE) |
| 58 |
#define TOGGLE_OFF(BUTTON) \ |
| 59 |
XmToggleButtonSetState((Widget) BUTTON, FALSE, FALSE) |
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
#define OPEN_ITEM 0 |
| 65 |
#define SAVE_ITEM 1 |
| 66 |
#define PRINT_ITEM 2 |
| 67 |
#define QUIT_ITEM 3 |
| 68 |
|
| 69 |
#define ITEM_ONE 0 |
| 70 |
#define ITEM_TWO 1 |
| 71 |
#define ITEM_THREE 2 |
| 72 |
#define ITEM_FOUR 3 |
| 73 |
|
| 74 |
#define WIN_WIDTH 1000 |
| 75 |
#define WIN_HEIGHT 1000 |
| 76 |
|
| 77 |
#ifndef M_PI |
| 78 |
#define M_PI 3.1415926 |
| 79 |
#endif |
| 80 |
|
| 81 |
#ifndef M_PI_2 |
| 82 |
#define M_PI_2 1.5707963 |
| 83 |
#endif |
| 84 |
|
| 85 |
#define MY_NONE -1 |
| 86 |
#define MY_SPEC -2 |
| 87 |
#define MY_HALF -3 |
| 88 |
#define MY_ALL -4 |
| 89 |
|
| 90 |
#define SOLUTION 0 |
| 91 |
#define BIFURCATION 1 |
| 92 |
|
| 93 |
|
| 94 |
#define CL_BRANCH_NUMBER -7 |
| 95 |
#define CL_STABILITY -6 |
| 96 |
#define CL_POINT_NUMBER -5 |
| 97 |
#define CL_CURVE_NUMBER -4 |
| 98 |
#define CL_ORBIT_TYPE -3 |
| 99 |
#define CL_LABELS -2 |
| 100 |
#define CL_COMPONENT -1 |
| 101 |
|
| 102 |
#define LINE 0 |
| 103 |
#define TUBE 1 |
| 104 |
#define SURFACE 2 |
| 105 |
#define MESH_POINTS 3 |
| 106 |
#define ALL_POINTS 4 |
| 107 |
#define NURBS 5 |
| 108 |
|
| 109 |
#define ROTATING_F 0 //CR3BP 0 |
| 110 |
#define INERTIAL_B 1 |
| 111 |
#define INERTIAL_S 2 // big primary centered, sun |
| 112 |
#define INERTIAL_E 3 // small primary centered, earth. |
| 113 |
|
| 114 |
#include "r3bplaut04.h" |
| 115 |
|
| 116 |
#define NO_COORD 0 |
| 117 |
#define COORDORIGIN 1 |
| 118 |
#define LEFTBACK 2 |
| 119 |
#define LEFTAHEAD 3 |
| 120 |
#define COORD_AT_ORIGIN 4 |
| 121 |
#define DRAW_TICKER 5 |
| 122 |
#define GEOCENTER 6 |
| 123 |
|
| 124 |
#define TYPE_BP_ALG 1 |
| 125 |
#define TYPE_LP_ALG 2 |
| 126 |
#define TYPE_HB_ALG 3 |
| 127 |
#define TYPE_RG 4 |
| 128 |
#define TYPE_UZ -4 |
| 129 |
#define TYPE_LP_ODE 5 |
| 130 |
#define TYPE_BP_ODE 6 |
| 131 |
#define TYPE_PD_ODE 7 |
| 132 |
#define TYPE_TR_ODE 8 |
| 133 |
#define TYPE_EP_ODE 9 |
| 134 |
#define TYPE_MX -9 |
| 135 |
|
| 136 |
#define TIME_IS_OFF 0 |
| 137 |
#define TIME_ON_X 1 |
| 138 |
#define TIME_ON_Y 2 |
| 139 |
#define TIME_ON_Z 3 |
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
struct UserData{ |
| 144 |
float (*multipliers)[2]; |
| 145 |
int maxndim; |
| 146 |
int *numFM; |
| 147 |
long int (*labelIndex)[4]; |
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
float *solMax, *solMin; |
| 152 |
}; |
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
struct coord3{ |
| 158 |
float x ; |
| 159 |
float y ; |
| 160 |
float z ; |
| 161 |
}; |
| 162 |
|
| 163 |
struct TubeNode{ |
| 164 |
coord3 translation; |
| 165 |
coord3 axis; |
| 166 |
float angle; |
| 167 |
float height; |
| 168 |
float radius; |
| 169 |
}; |
| 170 |
|
| 171 |
|
| 172 |
SoGroup * setLineAttributesByStability(int stability, float scaler); |
| 173 |
SoGroup * setLineAttributesByParameterValue(double parValue, double parMax, double parMid, double parMin, int stability, float scaler); |
| 174 |
SoGroup * setLineAttributesByBranch(int iBranch, int stability, float scaler); |
| 175 |
SoGroup * setLineAttributesByType(int stability, int type, float scaler); |
| 176 |
SoGroup * setLineColorBlending(float * vertices, long int size, int stability, float scaler); |
| 177 |
SoGroup * setLineColorBlendingByStability(float * vertices, long int size, int stab, float scaler); |
| 178 |
SoSeparator * drawASphere(float ptb[], float size); |
| 179 |
void updateScene(); |
| 180 |
void postDeals(); |
| 181 |
void showHelpDialog(); |
| 182 |
int writePreferValuesToFile(); |
| 183 |
void writeToFile(const char * fileName); |
| 184 |
void deleteScene(); |
| 185 |
SbBool readFile(const char *filename); |
| 186 |
void myMousePressCB(void *userData, SoEventCallback *eventCB); |
| 187 |
double fortranatof(char* word); |
| 188 |
|
| 189 |
|
| 190 |
void popupFloquetMultiplierDialog(float data[], int size, int numFM); |
| 191 |
void soxtmain(int argc, char *argv[]); |
| 192 |
void setListValue(); |
| 193 |
|
| 194 |
struct DefaultAxisItems |
| 195 |
{ |
| 196 |
std::vector<int> bifX, bifY, bifZ, solX, solY, solZ; |
| 197 |
}; |
| 198 |
|
| 199 |
#define CL_SP_ITEMS 7 |
| 200 |
#define LBL_OFFSET 4 |
| 201 |
#define SP_LBL_ITEMS 4 |
| 202 |
#define NUM_SP_POINTS 13 |
| 203 |
|
| 204 |
extern float orbitSpeed, satSpeed, numPeriodAnimated, lineWidthScaler; |
| 205 |
extern float fmData[12]; |
| 206 |
extern std::vector<int> xCoordIndices, yCoordIndices, zCoordIndices; |
| 207 |
extern int coloringMethod, specialColorItems, coloringMethodType[2]; |
| 208 |
extern std::vector<int> lblIndices, lblChoice; |
| 209 |
extern bool options[]; |
| 210 |
extern long int numLabels; |
| 211 |
extern bool setShow3D, setShow3DSol, setShow3DBif; |
| 212 |
extern int whichType, whichTypeOld, whichTypeTemp; |
| 213 |
extern int whichStyle, whichStyleOld, whichStyleTemp; |
| 214 |
extern int whichCoord, whichCoordOld, whichCoordTemp; |
| 215 |
extern int winWidth, winHeight; |
| 216 |
extern unsigned long linePattern[], linePatternTemp[], linePatternOld[]; |
| 217 |
extern SbColor lineColor[], lineColorTemp[], lineColorOld[]; |
| 218 |
extern SbColor envColors[]; |
| 219 |
extern unsigned long graphWidgetToggleSet, graphWidgetToggleSetTemp, |
| 220 |
graphWidgetToggleSetOld; |
| 221 |
extern UserData clientData; |
| 222 |
extern int MIN_ORBIT_SPEED, MAX_ORBIT_SPEED; |
| 223 |
extern int MIN_SAT_SPEED, MAX_SAT_SPEED; |
| 224 |
extern bool blDrawTicker; |
| 225 |
extern struct DefaultAxisItems dai; |
| 226 |
extern std::vector<std::string> coloringMethodList; |
| 227 |
extern int *myLabels; |
| 228 |
extern std::vector<std::string> xAxis, yAxis, zAxis; |
| 229 |
extern bool optBif[11], optSol[11]; |
| 230 |
extern float satRadius, aniLineScaler; |
| 231 |
extern std::vector<std::string> labels; |
| 232 |
extern long int animationLabel; |
| 233 |
extern const char *autoDir; |
| 234 |
extern int whichCoordSystem, whichCoordSystemOld, whichCoordSystemTemp; |
| 235 |
extern SoSeparator *root; |
| 236 |
extern const char * graphWidgetItems[GRAPH_WIDGET_ITEMS]; |
| 237 |
extern float diskPosition[3]; |
| 238 |
extern float diskRadius; |
| 239 |
extern float labelRadius; |
| 240 |
extern bool useR3B; |
| 241 |
|
| 242 |
#endif |