Ignore:
Timestamp:
Apr 2, 2013 1:31:30 PM (11 years ago)
Author:
ldelgass
Message:

Add writer thread to nanovis (set USE_THREADS in Makefile), more refactoring.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/nanovis/nanovis.h

    r3597 r3605  
    1717#define NANOVIS_H
    1818
    19 #include <tcl.h>
    20 #include <md5.h>
    21 #include <GL/glew.h>
    22 
    2319#include <math.h>
    2420#include <stddef.h> // For size_t
    2521#include <stdio.h>
     22#include <sys/time.h>
     23#include <sys/types.h> // For pid_t
     24
     25#include <tcl.h>
     26
     27#include <GL/glew.h>
    2628
    2729#include <vector>
     
    3234
    3335#include "config.h"
     36#include "md5.h"
    3437
    35 #define NANOVIS_VERSION         "1.1"
     38#define NANOVIS_VERSION         "1.2"
    3639
    3740//defines for the image based flow visualization
     
    4649    class Fonts;
    4750}
     51class OrientationIndicator;
    4852}
    4953
    5054class VolumeRenderer;
    51 class PointSetRenderer;
    5255class NvParticleRenderer;
    53 class PlaneRenderer;
    5456class VelocityArrowsSlice;
    5557class NvLIC;
    56 class PointSet;
     58class PlaneRenderer;
    5759class Texture2D;
    5860class HeightMap;
     
    8991    typedef std::tr1::unordered_map<HeightMapId, HeightMap *> HeightMapHashmap;
    9092
    91     static void processCommands();
    92     static void init(const char *path);
    93     static void initGL();
    94     static void initOffscreenBuffer();
    95     static void resizeOffscreenBuffer(int w, int h);
     93    static bool init(const char *path);
     94    static bool initGL();
     95    static bool initOffscreenBuffer();
     96    static bool resizeOffscreenBuffer(int w, int h);
    9697    static void setBgColor(float color[3]);
    9798    static void render();
    9899    static void draw3dAxis();
    99     static void idle();
    100100    static void update();
    101101    static void removeAllData();
     
    113113    static void setVolumeRanges();
    114114    static void setHeightmapRanges();
    115 
    116 #ifdef KEEPSTATS
    117     static int getStatsFile(Tcl_Obj *objPtr);
    118     static int writeToStatsFile(int f, const char *s, size_t length);
    119 #endif
    120     static void ppmWrite(const char *prefix);
    121     static void sendDataToClient(const char *command, const char *data,
    122                                  size_t dlen);
    123     static void bmpWrite(const char *prefix);
    124     static void bmpWriteToFile(int frame_number, const char* directory_name);
    125115 
    126116    static TransferFunction *getTransferFunction(const TransferFunctionId& id);
     
    139129    static void readScreen()
    140130    {
     131        glPixelStorei(GL_PACK_ALIGNMENT, 1);
    141132        glReadPixels(0, 0, winWidth, winHeight, GL_RGB, GL_UNSIGNED_BYTE,
    142133                     screenBuffer);
     
    149140    static Flow *getFlow(const char *name);
    150141    static Flow *createFlow(Tcl_Interp *interp, const char *name);
     142    static void deleteFlows(Tcl_Interp *interp);
    151143    static void deleteFlow(const char *name);
    152     static void deleteFlows(Tcl_Interp *interp);
    153144    static bool mapFlows();
    154145    static void getFlowBounds(vrmath::Vector3f& min,
     
    160151    static void advectFlows();
    161152
    162     static FILE *stdin, *logfile, *recfile;
    163     static int statsFile;
     153    static Tcl_Interp *interp;
     154
    164155    static unsigned int flags;
    165156    static bool debugFlag;
    166     static bool axisOn;
    167     static struct timeval startTime;       ///< Start of elapsed time.
    168157
    169158    static int winWidth;        ///< Width of the render window
     
    172161    static unsigned char *screenBuffer;
    173162    static Texture2D *legendTexture;
    174     static Grid *grid;
    175163    static nv::util::Fonts *fonts;
    176164    static int updir;
     
    191179    static NvLIC *licRenderer;
    192180    static PlaneRenderer *planeRenderer;
    193 
    194 #ifdef USE_POINTSET_RENDERER
    195     static PointSetRenderer *pointSetRenderer;
    196     static std::vector<PointSet *> pointSet;
    197 #endif
    198 
    199     static Tcl_Interp *interp;
     181    static nv::OrientationIndicator *orientationIndicator;
     182    static Grid *grid;
    200183
    201184private:
Note: See TracChangeset for help on using the changeset viewer.