Ignore:
Timestamp:
Dec 18, 2014, 8:45:38 PM (5 years ago)
Author:
ldelgass
Message:

Add command line options to set I/O file descriptors, merge some refactoring to
prep for merging threading support.

Location:
nanovis/branches/1.1
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • nanovis/branches/1.1

  • nanovis/branches/1.1/nanovis.h

    r4820 r4874  
    1414 * ======================================================================
    1515 */
    16 #ifndef NANOVIS_H
    17 #define NANOVIS_H
    18 
    19 #include <tcl.h>
    20 #include <md5.h>
    21 #include <GL/glew.h>
    22 #include <sys/types.h> // For pid_t
    23 #include <sys/time.h>  // For struct timeval
     16#ifndef NV_NANOVIS_H
     17#define NV_NANOVIS_H
    2418
    2519#include <math.h>
    2620#include <stddef.h> // For size_t
    2721#include <stdio.h>
     22#include <sys/time.h>  // For struct timeval
     23#include <sys/types.h> // For pid_t
     24
     25#include <tcl.h>
     26
     27#include <GL/glew.h>
    2828
    2929#include <vector>
     
    3434
    3535#include "config.h"
    36 
    37 #define NANOVIS_VERSION         "1.1.3"
    3836
    3937//defines for the image based flow visualization
     
    5048}
    5149
    52 class VolumeRenderer;
    53 class PointSetRenderer;
     50class NvCamera;
     51class Flow;
     52class Grid;
     53class HeightMap;
     54class NvLIC;
    5455class NvParticleRenderer;
    5556class PlaneRenderer;
     57class Texture2D;
     58class TransferFunction;
    5659class VelocityArrowsSlice;
    57 class NvLIC;
    58 class PointSet;
    59 class Texture2D;
    60 class HeightMap;
    61 class Grid;
    62 class NvCamera;
    63 class TransferFunction;
    6460class Volume;
    65 class Flow;
     61class VolumeRenderer;
    6662
    6763class NanoVis
     
    8278    };
    8379
    84     typedef struct {
    85         pid_t pid;
    86         size_t nFrames;            /**< # of frames sent to client. */
    87         size_t nBytes;             /**< # of bytes for all frames. */
    88         size_t nCommands;          /**< # of commands executed */
    89         double cmdTime;            /**< Elasped time spend executing
    90                                     * commands. */
    91         struct timeval start;      /**< Start of elapsed time. */
    92     } Stats;
    93 
    9480    typedef std::string TransferFunctionId;
    9581    typedef std::string VolumeId;
     
    10187    typedef std::tr1::unordered_map<HeightMapId, HeightMap *> HeightMapHashmap;
    10288
    103     static void processCommands();
    104     static void init(const char *path);
    105     static void initGL();
    106     static void initOffscreenBuffer();
    107     static void resizeOffscreenBuffer(int w, int h);
     89    static bool init(const char *path);
     90    static bool initGL();
     91    static bool initOffscreenBuffer();
     92    static bool resizeOffscreenBuffer(int w, int h);
    10893    static void setBgColor(float color[3]);
    10994    static void render();
    11095    static void draw3dAxis();
    111     static void idle();
    11296    static void update();
    11397    static void removeAllData();
     
    123107    static void eventuallyRedraw(unsigned int flag = 0);
    124108
    125     static void setVolumeRanges();
    126     static void setHeightmapRanges();
    127 
    128 #ifdef KEEPSTATS
    129     static int getStatsFile(Tcl_Obj *objPtr);
    130     static int writeToStatsFile(int f, const char *s, size_t length);
    131 #endif
    132109    static void ppmWrite(const char *prefix);
    133     static void sendDataToClient(const char *command, const char *data,
    134                                  size_t dlen);
    135110    static void bmpWrite(const char *prefix);
    136111    static void bmpWriteToFile(int frame_number, const char* directory_name);
     
    151126    static void readScreen()
    152127    {
     128        //glPixelStorei(GL_PACK_ALIGNMENT, 1);
    153129        glReadPixels(0, 0, winWidth, winHeight, GL_RGB, GL_UNSIGNED_BYTE,
    154130                     screenBuffer);
     
    159135    }
    160136
     137    static void setVolumeRanges();
     138    static void setHeightmapRanges();
     139
    161140    static Flow *getFlow(const char *name);
    162141    static Flow *createFlow(Tcl_Interp *interp, const char *name);
     142    static void deleteFlows(Tcl_Interp *interp);
    163143    static void deleteFlow(const char *name);
    164     static void deleteFlows(Tcl_Interp *interp);
    165144    static bool mapFlows();
    166145    static void getFlowBounds(vrmath::Vector3f& min,
     
    172151    static void advectFlows();
    173152
    174     static FILE *stdin, *logfile, *recfile;
    175     static Stats stats;
    176     static int statsFile;
     153    static Tcl_Interp *interp;
     154
    177155    static unsigned int flags;
    178156    static bool debugFlag;
     
    181159    static int winWidth;        ///< Width of the render window
    182160    static int winHeight;       ///< Height of the render window
    183     static int renderWindow;    //< GLUT handle for the render window
     161    static int renderWindow;    ///< GLUT handle for the render window
    184162    static unsigned char *screenBuffer;
    185163    static Texture2D *legendTexture;
    186     static Grid *grid;
    187164    static nv::util::Fonts *fonts;
    188165    static int updir;
     
    203180    static NvLIC *licRenderer;
    204181    static PlaneRenderer *planeRenderer;
    205 
    206     static Tcl_Interp *interp;
     182    static Grid *grid;
    207183
    208184private:
Note: See TracChangeset for help on using the changeset viewer.