SPModel: plugins/flowHierarchyViewer/visualization.c File Reference
VPAC - Computational Software Development
Main | SPModel | StGermain FrameWork |
Main Page | Alphabetical List | Class List | Directories | File List | Class Members | File Members

visualization.c File Reference

#include <mpi.h>
#include <StGermain/StGermain.h>
#include "SPModel/SPModel.h"
#include "visualization.h"
#include "../faultModel/FaultModel.h"
#include <math.h>
#include <sys/time.h>
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <string.h>
#include <assert.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <SDL/SDL.h>

Include dependency graph for visualization.c:

Go to the source code of this file.

Defines

#define WIDTH   1100
#define HEIGHT   800
#define BPP   16
#define POINT_SIZE   3
#define MY_CIRCLE_LIST   1

Functions

void selection (void *context, int x, int y)
void displayCatchments (SPModel_Context *context)
void initializeNodes (SPModel_Context *SPM_Context)
void dumpNodes (void *context)
void mouseClick (int button, int state, int x, int y)
void mouseMotion (int x, int y)
void windowEvents (void *context)
void initializeGL (void)
void buildCircle (double radius)
void createGLWindow (SPModel_Context *context)
void clearDepthColor (void)

Variables

ExtensionInfo_Index simulationExtensionHandle
ExtensionInfo_Index faultModelExtensionHandle
SPModelSimulationContextExtensionsimulationExt = NULL
SPModelFaultModelContextExtensionfaultModel = NULL
static int displayOn = 0
double heightFactor = 2.0f
double maxX = 0
double maxY = 0
double maxH = 0
double minX = LONG_MAX
double minY = LONG_MAX
double minH = LONG_MAX
GLuint selectionBuffer [1024]
float maxIsostaticRebound = 0
float minIsostaticRebound = 0
int currentProcessor = 0
int scaled
float ratio
int oldMouseX
int oldMouseY
GLdouble xRot = 37.2
GLdouble yRot = -36.3
int motionOn = 0
int zoomOn = 0
int oldZoomY = 0
double zoomFactor = 9.0f
int showReceivers = 0
int showFaultBlocks = 0
int showFaultModel = 0
int selectCatchments = 0
int flexureMap = 0
int showCatchment = 0
int showRegularMesh = 0
int drawingModeIndex = 0
int drawingModes [] = {GL_TRIANGLES, GL_LINE_LOOP, GL_POINTS}
int doSelection = 0
float maxErosion = 0
float minErosion = 0
int erosionMap = 0
float maxSediment = 0
float minSediment = 0
int sedimentMap = 0
double ** normalArray = NULL
int selectedNode = 1
GLfloat mat_specular [] = { 1.0, 1.0, 1.0, 1.0 }
GLfloat light_position [] = { 1000.0, 1000.0, 10000.0, 0.0 }
GLfloat diffuseMaterial [4] = { 0.5, 0.5, 0.5, 1.0 }


Define Documentation

#define BPP   16
 

Definition at line 68 of file visualization.c.

Referenced by createGLWindow().

#define HEIGHT   800
 

Definition at line 67 of file visualization.c.

Referenced by createGLWindow(), initializeGL(), and selection().

#define MY_CIRCLE_LIST   1
 

Definition at line 70 of file visualization.c.

Referenced by buildCircle(), and dumpNodes().

#define POINT_SIZE   3
 

Definition at line 69 of file visualization.c.

Referenced by initializeGL().

#define WIDTH   1100
 

Definition at line 66 of file visualization.c.

Referenced by createGLWindow(), initializeGL(), and selection().


Function Documentation

void buildCircle double  radius  ) 
 

Definition at line 809 of file visualization.c.

References MY_CIRCLE_LIST, and PI.

Referenced by createGLWindow().

void clearDepthColor void   ) 
 

Definition at line 902 of file visualization.c.

Referenced by dumpNodes().

void createGLWindow SPModel_Context context  ) 
 

Definition at line 826 of file visualization.c.

Referenced by _SPModelFlowHierarchyViewer_Init(), and main().

void displayCatchments SPModel_Context context  ) 
 

Definition at line 173 of file visualization.c.

References SurfaceMesh::h, heightFactor, SurfaceMesh::id, SPModel_Context::localMesh, SurfaceMesh::numNodes, SurfaceMesh::receiver, SurfaceMesh::x, and SurfaceMesh::y.

Referenced by dumpNodes().

void dumpNodes void *  context  ) 
 

Definition at line 259 of file visualization.c.

Referenced by main(), selection(), and windowEvents().

void initializeGL void   ) 
 

Definition at line 773 of file visualization.c.

References diffuseMaterial, HEIGHT, light_position, mat_specular, POINT_SIZE, and WIDTH.

Referenced by createGLWindow().

void initializeNodes SPModel_Context SPM_Context  ) 
 

Definition at line 190 of file visualization.c.

References SurfaceMesh::elementGlobalCount, SPModelSimulationContextExtension_t::globalErosion, SPModel_Context::globalMesh, SPModelSimulationContextExtension_t::globalSedimentHistory, SurfaceMesh::h, SPModelSimulationContextExtension_t::hisotot, maxErosion, maxIsostaticRebound, maxSediment, minErosion, minIsostaticRebound, minSediment, normalArray, SurfaceMesh::numNodes, SurfaceMesh::vertices, SurfaceMesh::x, and SurfaceMesh::y.

Referenced by dumpNodes().

void mouseClick int  button,
int  state,
int  x,
int  y
 

Definition at line 572 of file visualization.c.

References motionOn, oldMouseX, oldMouseY, oldZoomY, and zoomOn.

Referenced by windowEvents().

void mouseMotion int  x,
int  y
 

Definition at line 594 of file visualization.c.

References motionOn, oldMouseX, oldMouseY, oldZoomY, xRot, yRot, zoomFactor, and zoomOn.

Referenced by windowEvents().

void selection void *  context,
int  x,
int  y
 

Definition at line 108 of file visualization.c.

References dumpNodes(), HEIGHT, selectedNode, selectionBuffer, and WIDTH.

Referenced by windowEvents().

void windowEvents void *  context  ) 
 

Definition at line 615 of file visualization.c.

Referenced by main(), and SPModelFlowHierarchyViewer_UpdateView().


Variable Documentation

int currentProcessor = 0
 

Definition at line 64 of file visualization.c.

Referenced by dumpNodes(), and windowEvents().

GLfloat diffuseMaterial[4] = { 0.5, 0.5, 0.5, 1.0 }
 

Definition at line 106 of file visualization.c.

Referenced by initializeGL().

int displayOn = 0 [static]
 

Definition at line 56 of file visualization.c.

Referenced by createGLWindow().

int doSelection = 0
 

Definition at line 91 of file visualization.c.

Referenced by dumpNodes(), and windowEvents().

int drawingModeIndex = 0
 

Definition at line 89 of file visualization.c.

Referenced by dumpNodes(), and windowEvents().

int drawingModes[] = {GL_TRIANGLES, GL_LINE_LOOP, GL_POINTS}
 

Definition at line 90 of file visualization.c.

Referenced by dumpNodes().

int erosionMap = 0
 

Definition at line 94 of file visualization.c.

Referenced by dumpNodes(), and windowEvents().

SPModelFaultModelContextExtension* faultModel = NULL
 

Definition at line 54 of file visualization.c.

Referenced by _SPModelFaultModel_Init(), SPModelFaultModel_RefreshNodeIndices(), and SPModelFaultModel_Solve().

ExtensionInfo_Index faultModelExtensionHandle
 

Definition at line 51 of file visualization.c.

Referenced by createGLWindow().

int flexureMap = 0
 

Definition at line 86 of file visualization.c.

Referenced by dumpNodes(), and windowEvents().

double heightFactor = 2.0f
 

Definition at line 57 of file visualization.c.

Referenced by displayCatchments(), dumpNodes(), and windowEvents().

GLfloat light_position[] = { 1000.0, 1000.0, 10000.0, 0.0 }
 

Definition at line 105 of file visualization.c.

Referenced by initializeGL().

GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 }
 

Definition at line 104 of file visualization.c.

Referenced by initializeGL().

float maxErosion = 0
 

Definition at line 92 of file visualization.c.

Referenced by dumpNodes(), and initializeNodes().

double maxH = 0
 

Definition at line 59 of file visualization.c.

Referenced by dumpNodes(), SurfaceMeshIrregularDecomp_AllocateNodes(), and windowEvents().

float maxIsostaticRebound = 0
 

Definition at line 62 of file visualization.c.

Referenced by dumpNodes(), and initializeNodes().

float maxSediment = 0
 

Definition at line 95 of file visualization.c.

Referenced by dumpNodes(), and initializeNodes().

double maxX = 0
 

Definition at line 59 of file visualization.c.

Referenced by _Interpolator_Build(), dumpNodes(), SurfaceMeshIrregularDecomp_AllocateNodes(), SurfaceMeshRegularDecomp_AllocateNodes(), and windowEvents().

double maxY = 0
 

Definition at line 59 of file visualization.c.

Referenced by _Interpolator_Build(), dumpNodes(), SurfaceMeshIrregularDecomp_AllocateNodes(), and windowEvents().

float minErosion = 0
 

Definition at line 93 of file visualization.c.

Referenced by dumpNodes(), and initializeNodes().

double minH = LONG_MAX
 

Definition at line 60 of file visualization.c.

Referenced by dumpNodes(), SurfaceMeshIrregularDecomp_AllocateNodes(), and windowEvents().

float minIsostaticRebound = 0
 

Definition at line 63 of file visualization.c.

Referenced by dumpNodes(), and initializeNodes().

float minSediment = 0
 

Definition at line 96 of file visualization.c.

Referenced by dumpNodes(), fluvial(), initializeNodes(), and SPModelDiffusionErosion_Solve().

double minX = LONG_MAX
 

Definition at line 60 of file visualization.c.

Referenced by _Interpolator_Build(), SurfaceMeshIrregularDecomp_AllocateNodes(), SurfaceMeshRegularDecomp_AllocateNodes(), and windowEvents().

double minY = LONG_MAX
 

Definition at line 60 of file visualization.c.

Referenced by _Interpolator_Build(), SurfaceMeshIrregularDecomp_AllocateNodes(), and windowEvents().

int motionOn = 0
 

Definition at line 78 of file visualization.c.

Referenced by mouseClick(), and mouseMotion().

double** normalArray = NULL
 

Definition at line 99 of file visualization.c.

Referenced by createGLWindow(), dumpNodes(), and initializeNodes().

int oldMouseX
 

Definition at line 74 of file visualization.c.

Referenced by mouseClick(), and mouseMotion().

int oldMouseY
 

Definition at line 75 of file visualization.c.

Referenced by mouseClick(), and mouseMotion().

int oldZoomY = 0
 

Definition at line 80 of file visualization.c.

Referenced by mouseClick(), and mouseMotion().

float ratio
 

Definition at line 73 of file visualization.c.

int scaled
 

Definition at line 72 of file visualization.c.

Referenced by dumpNodes(), and windowEvents().

int sedimentMap = 0
 

Definition at line 97 of file visualization.c.

Referenced by dumpNodes(), and windowEvents().

int selectCatchments = 0
 

Definition at line 85 of file visualization.c.

Referenced by dumpNodes(), and windowEvents().

int selectedNode = 1
 

Definition at line 100 of file visualization.c.

Referenced by dumpNodes(), selection(), and windowEvents().

GLuint selectionBuffer[1024]
 

Definition at line 61 of file visualization.c.

Referenced by selection().

int showCatchment = 0
 

Definition at line 87 of file visualization.c.

Referenced by dumpNodes(), and windowEvents().

int showFaultBlocks = 0
 

Definition at line 83 of file visualization.c.

Referenced by dumpNodes(), and windowEvents().

int showFaultModel = 0
 

Definition at line 84 of file visualization.c.

Referenced by dumpNodes(), and windowEvents().

int showReceivers = 0
 

Definition at line 82 of file visualization.c.

Referenced by dumpNodes(), and windowEvents().

int showRegularMesh = 0
 

Definition at line 88 of file visualization.c.

Referenced by dumpNodes(), and windowEvents().

SPModelSimulationContextExtension* simulationExt = NULL
 

Definition at line 53 of file visualization.c.

Referenced by _SPModel_SimulationContextExtension_AllocateMemory(), _SPModel_SimulationContextExtension_ReleaseMemory(), interpolateFunction(), SPModelDiffusionErosion_Solve(), SPModelFaultModel_Solve(), SPModelFileOutput_Dump(), SPModelFluvialErosion_BoundaryConditions(), SPModelFluvialErosion_Solve(), SPModelIsostaticFlexure_Solve(), SPModelOrography_Solve(), SPModelSimulationContextExtension_Gather(), and SPModelSimulationContextExtension_Scatter().

ExtensionInfo_Index simulationExtensionHandle
 

Definition at line 50 of file visualization.c.

Referenced by createGLWindow().

GLdouble xRot = 37.2
 

Definition at line 76 of file visualization.c.

Referenced by dumpNodes(), mouseMotion(), and windowEvents().

GLdouble yRot = -36.3
 

Definition at line 77 of file visualization.c.

Referenced by dumpNodes(), mouseMotion(), and windowEvents().

double zoomFactor = 9.0f
 

Definition at line 81 of file visualization.c.

Referenced by dumpNodes(), and mouseMotion().

int zoomOn = 0
 

Definition at line 79 of file visualization.c.

Referenced by mouseClick(), and mouseMotion().