Changeset 934 for trunk


Ignore:
Timestamp:
Mar 10, 2008, 5:24:42 PM (17 years ago)
Author:
gah
Message:

Makefile cleanup: add library for transfer-function, no longer compile Socket.o, etc.

Location:
trunk/vizservers/nanovis
Files:
15 edited

Legend:

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

    r933 r934  
    3131 */
    3232
    33 class Chain;
    3433
    3534class ChainLink {
     
    4645    ChainLink(void *clientData) {
    4746        _clientData = clientData;
    48         _next = _prev = NULL;
     47        _next = _prev = NULL;
    4948    }
    5049    void *GetValue(void) {
  • trunk/vizservers/nanovis/CmdProc.h

    r913 r934  
    4949        CmdSpec *specs, int operPos, int objc, Tcl_Obj *const *objv, int flags);
    5050
    51 #define NumCmdSpecs(s) (sizeof(s) / sizeof(Rappture::CmdSpec));
     51#define NumCmdSpecs(s) (sizeof(s) / sizeof(Rappture::CmdSpec))
    5252
    53 };
     53}
    5454
    5555
  • trunk/vizservers/nanovis/Command.cpp

    r932 r934  
    8585// EXTERN DECLARATIONS
    8686// in Nv.cpp
    87 
    88 extern Grid* NanoVis::grid;
    8987
    9088// in nanovis.cpp
  • trunk/vizservers/nanovis/Grid.h

    r932 r934  
    3434        return _visible;
    3535    }
     36    void setVisible(bool visible) {
     37        _visible = visible;
     38    }
     39    void setAxisColor(float r, float g, float b, float a) {
     40        _axisColor.SetColor(r, g, b, a);
     41    }
     42    void setLineColor(float r, float g, float b, float a) {
     43        _majorColor.SetColor(r, g, b, a);
     44        _minorColor = _majorColor;
     45    }
    3646    void render();
    37    
    3847    void setFont(R2Fonts* font);
    39     void setVisible(bool visible);
    40     void setAxisColor(float r, float g, float b, float a);
    41     void setLineColor(float r, float g, float b, float a);
    4248};
    4349
    44 inline void Grid::setVisible(bool visible)
    45 {
    46     _visible = visible;
    47 }
    48 
    49 inline void Grid::setAxisColor(float r, float g, float b, float a)
    50 {
    51     _axisColor.SetColor(r, g, b, a);
    52 }
    53 
    54 inline void Grid::setLineColor(float r, float g, float b, float a)
    55 {
    56     _majorColor.SetColor(r, g, b, a);
    57     _minorColor = _majorColor;
    58 }
    5950
    6051#endif
  • trunk/vizservers/nanovis/HeightMap.h

    r932 r934  
    1212
    1313namespace graphics {
    14 class RenderContext;
    15 };
     14    class RenderContext;
     15}
    1616
    1717/**
  • trunk/vizservers/nanovis/Makefile.in

    r933 r934  
    11
    2 #
    3 # FIXME: I can see at least 3 possible candidates for separate libraries.
    4 #         R2, mat, and Image.  (First 2 are done.)
    5 #
    62SHELL = /bin/sh
    73
     
    2016
    2117INSTALL         = @INSTALL@
     18#Why are these files installed owner writable?
    2219INSTALL_PROGRAM = ${INSTALL} -m 755
    2320INSTALL_DATA    = ${INSTALL} -m 644
    2421INSTALL_SCRIPT  = ${INSTALL} -m 644
    2522
    26 CC = @CC@
    27 
    28 AUXSRC = config.h define.h global.h
     23AUXSRC          = config.h define.h global.h
    2924
    3025DX_DIR          = /usr/lib/dx
     
    4439R2_INC_SPEC     = -I$(srcdir)/$(R2_DIR)/include
    4540R2_LIB          = $(R2_DIR)/src/libR2.a
    46 R2_LIB_SPEC     = $(R2_LIB)
     41R2_LIB_SPEC     = $(R2_LIB)
     42
    4743RP_DIR          =  @RP_DIR@
    4844RP_INC_SPEC     = -I$(RP_DIR)/include -I$(RP_DIR)/include/rappture2
    4945RP_LIB_SPEC     = -L$(RP_DIR)/lib -lrappture2 -lb64 -lz
    5046
    51 LIBS = \
    52         $(RP_LIB_SPEC) \
    53         -ltcl8.4 \
    54         $(GL_LIB_SPEC) \
    55         $(DX_LIB_SPEC) \
    56         $(IMG_LIB_SPEC) \
    57         $(R2_LIB_SPEC) \
    58         $(MAT_LIB_SPEC)
    59 
    60 INCLUDES = \
    61         -I. \
    62         $(RP_INC_SPEC) \
    63         $(GL_INC_SPEC) \
    64         $(R2_INC_SPEC) \
    65         $(IMG_INC_SPEC) \
    66         $(MAT_INC_SPEC)
    67 
    68 CFLAGS = @CFLAGS@
    69 EXTRA_CFLAGS = -Wall
    70 DEFINES = @DEFINES@
    71 CC_SWITCHES = $(CFLAGS) $(EXTRA_CFLAGS) $(INCLUDES)
    72 
    73 OBJS  = \
    74         BucketSort.o \
    75         NvCamera.o \
    76         CmdProc.o \
    77         Axis.o \
    78         Chain.o \
    79         Color.o \
    80         ColorGradient.o \
    81         ColorGradientGLUTWindow.o \
    82         ColorPaletteWindow.o\
    83         Command.o \
    84         ContourLineFilter.o \
    85         ControlPoint.o \
    86         ConvexPolygon.o \
    87         Event.o \
    88         GradientFilter.o \
    89         Grid.o \
    90         HeightMap.o \
    91         MainWindow.o \
    92         Mat4x4.o \
    93         Nv.o \
    94         NvColorTableRenderer.o \
    95         NvColorTableShader.o \
    96         NvDefaultTFData.o \
    97         NvEventLog.o \
    98         NvLIC.o \
    99         NvLoadFile.o \
    100         NvParticleAdvectionShader.o \
    101         NvParticleRenderer.o \
    102         NvRegularVolumeShader.o \
    103         NvShader.o \
    104         NvStdVertexShader.o \
    105         NvVolumeShader.o \
    106         NvZincBlendeReconstructor.o \
    107         NvZincBlendeVolumeShader.o \
    108         PCASplit.o \
    109         PerfQuery.o \
    110         Plane.o \
    111         PlaneRenderer.o \
    112         PointSet.o \
    113         PointSetRenderer.o \
    114         PointShader.o \
    115         RenderContext.o \
    116         RenderVertexArray.o \
    117         Renderable.o \
    118         RpDX.o \
    119         ScreenSnapper.o \
    120         Socket.o \
    121         Sphere.o \
    122         Texture1D.o \
    123         Texture2D.o \
    124         Texture3D.o \
    125         Trace.o \
    126         TransferFunction.o \
    127         TransferFunctionGLUTWindow.o \
    128         Util.o \
    129         Vector3.o \
    130         Vector4.o \
    131         Volume.o \
    132         VolumeInterpolator.o \
    133         VolumeRenderer.o \
    134         ZincBlendeVolume.o \
    135         dxReader.o \
    136         dxReader2.o \
    137         dxReaderCommon.o \
    138         nanovis.o
    139 
     47TF_DIR          = ./transfer-function
     48TF_INC_SPEC     = -I$(TF_DIR)
     49TF_LIB          = $(TF_DIR)/libTransferFunction.a
     50TF_LIB_SPEC     = $(TF_LIB)
     51
     52LIBS            = \
     53                $(RP_LIB_SPEC) \
     54                $(DX_LIB_SPEC) \
     55                $(IMG_LIB_SPEC) \
     56                $(R2_LIB_SPEC) \
     57                $(TF_LIB_SPEC) \
     58                $(MAT_LIB_SPEC) \
     59                -ltcl8.4 \
     60                $(GL_LIB_SPEC)
     61
     62INCLUDES        = \
     63                -I. \
     64                $(RP_INC_SPEC) \
     65                $(GL_INC_SPEC) \
     66                $(R2_INC_SPEC) \
     67                $(IMG_INC_SPEC) \
     68                $(MAT_INC_SPEC)
     69
     70CC              = @CC@
     71CFLAGS          = @CFLAGS@
     72EXTRA_CFLAGS    = -Wall
     73DEFINES         = @DEFINES@
     74CC_SWITCHES     = $(CFLAGS) $(EXTRA_CFLAGS) $(INCLUDES)
     75
     76OBJS            = \
     77                Axis.o \
     78                BucketSort.o \
     79                Chain.o \
     80                CmdProc.o \
     81                Color.o \
     82                Command.o \
     83                ContourLineFilter.o \
     84                ConvexPolygon.o \
     85                Event.o \
     86                GradientFilter.o \
     87                Grid.o \
     88                HeightMap.o \
     89                Mat4x4.o \
     90                Nv.o \
     91                NvCamera.o \
     92                NvColorTableRenderer.o \
     93                NvColorTableShader.o \
     94                NvDefaultTFData.o \
     95                NvEventLog.o \
     96                NvLIC.o \
     97                NvLoadFile.o \
     98                NvParticleAdvectionShader.o \
     99                NvParticleRenderer.o \
     100                NvRegularVolumeShader.o \
     101                NvShader.o \
     102                NvStdVertexShader.o \
     103                NvVolumeShader.o \
     104                NvZincBlendeReconstructor.o \
     105                NvZincBlendeVolumeShader.o \
     106                PCASplit.o \
     107                PerfQuery.o \
     108                Plane.o \
     109                PlaneRenderer.o \
     110                PointSet.o \
     111                PointSetRenderer.o \
     112                PointShader.o \
     113                RenderContext.o \
     114                RenderVertexArray.o \
     115                Renderable.o \
     116                RpDX.o \
     117                ScreenSnapper.o \
     118                Sphere.o \
     119                Texture1D.o \
     120                Texture2D.o \
     121                Texture3D.o \
     122                Trace.o \
     123                TransferFunction.o \
     124                Util.o \
     125                Vector3.o \
     126                Vector4.o \
     127                Volume.o \
     128                VolumeInterpolator.o \
     129                VolumeRenderer.o \
     130                ZincBlendeVolume.o \
     131                dxReader.o \
     132                dxReader2.o \
     133                dxReaderCommon.o \
     134                nanovis.o
     135
     136resources       = \
     137                $(srcdir)/resources/Font.bmp \
     138                $(srcdir)/resources/particle2.bmp \
     139                $(srcdir)/resources/verdana.fnt \
     140                $(srcdir)/resources/verdana_bold.fnt
     141
     142shaders         = \
     143                $(srcdir)/shaders/common.cg \
     144                $(srcdir)/shaders/copy_texcoord.cg \
     145                $(srcdir)/shaders/heightcolor.cg \
     146                $(srcdir)/shaders/one_plane.cg \
     147                $(srcdir)/shaders/one_volume.cg \
     148                $(srcdir)/shaders/passthru.cg \
     149                $(srcdir)/shaders/pointsvp.cg \
     150                $(srcdir)/shaders/render_vel.cg \
     151                $(srcdir)/shaders/update_pos.cg \
     152                $(srcdir)/shaders/update_pos_vel.cg \
     153                $(srcdir)/shaders/update_vel.cg \
     154                $(srcdir)/shaders/vertex_std.cg \
     155                $(srcdir)/shaders/volqd_volume.cg \
     156                $(srcdir)/shaders/zincblende_volume.cg
    140157
    141158all: nanovis
    142159
    143 install: nanovis
    144         $(INSTALL_PROGRAM) nanovis $(bindir)/nanovis
    145         $(INSTALL_PROGRAM) @RP_DIR@/bin/voronoi $(bindir)/voronoi
    146         $(INSTALL_PROGRAM) -d $(libdir)/resources $(libdir)/shaders
    147         $(INSTALL_DATA) resources/* $(libdir)/resources
    148         $(INSTALL_DATA) shaders/* $(libdir)/shaders
    149         $(INSTALL_DATA) @RP_DIR@/lib/librappture2.so $(libdir)/librappture2.so
    150         $(INSTALL_DATA) @RP_DIR@/lib/libz.so $(libdir)/libz.so
    151         $(INSTALL_DATA) @RP_DIR@/lib/libb64.so $(libdir)/libb64.so
     160install: install-nanovis install-resources install-shaders
     161
     162$(MAT_LIB):
     163        make -C $(MAT_DIR) all
     164
     165$(R2_LIB):
     166        make -C $(R2_DIR)/src all
     167
     168$(IMG_LIB):
     169        make -C $(IMG_DIR) all
     170
     171$(TF_LIB):
     172        make -C $(TF_DIR) all
     173
     174nanovis: $(MAT_LIB) $(R2_LIB) $(IMG_LIB) $(TF_LIB) $(OBJS)
     175        $(CC) $(CC_SWITCHES) -o $@ $^ $(LIBS)
     176
     177.cpp.o:
     178        $(CC) $(CC_SWITCHES) -o $@ -c $<
     179
     180dxReader2.o: $(srcdir)/dxReader2.cpp
     181        $(CC) -c $(CC_SWITCHES) $(DX_INC_SPEC) $?
     182RpDX.o: $(srcdir)/RpDX.cpp
     183        $(CC) -c $(CC_SWITCHES) $(DX_INC_SPEC) $?
     184
     185client: Socket.o ClientSocket.o RenderClient.o Event.o
     186        $(CC) $(CC_SWITCHES) -o $@ $^ $(LIBS)
     187
     188Socket.o: socket/Socket.cpp socket/Socket.h
     189        $(CC) $(CC_SWITCHES) -o $@ -c $<
     190ClientSocket.o: socket/ClientSocket.cpp socket/ClientSocket.h
     191        $(CC) $(CC_SWITCHES) -o $@ -c $<
     192RenderClient.o: socket/RenderClient.cpp socket/RenderClient.h
     193        $(CC) $(CC_SWITCHES) -o $@ -c $<
     194
     195install-resources:
     196        mkdir -p $(libdir)/resources
     197        @for i in $(resources) ; do \
     198            echo "installing $$i..." ; \
     199            $(INSTALL_DATA) -m 0444 $$i $(libdir)/resources ; \
     200        done
     201
     202install-shaders:
     203        mkdir -p $(libdir)/shaders
     204        @for i in $(shaders) ; do \
     205            echo "installing $$i..." ; \
     206            $(INSTALL_DATA) -m 0444 $$i $(libdir)/shaders ; \
     207        done
     208
     209install-nanovis: nanovis
     210        $(INSTALL) -m 0555 nanovis $(bindir)/nanovis
     211
     212# Only do what's necessary: These items assume an already installed version
     213# of rappture. We won't install them.
     214#       $(INSTALL_PROGRAM) $(RP_DIR)/bin/voronoi $(bindir)/voronoi
     215#       $(INSTALL_DATA) $(RP_DIR)/lib/librappture2.so $(libdir)/librappture2.so
     216#       $(INSTALL_DATA) $(RP_DIR)/lib/libz.so $(libdir)/libz.so
     217#       $(INSTALL_DATA) $(RP_DIR)/lib/libb64.so $(libdir)/libb64.so
     218
    152219
    153220clean:
     
    155222        make -C $(R2_DIR)/src clean
    156223        make -C $(IMG_DIR) clean
     224        make -C $(TF_DIR) clean
    157225        rm -f nanovis client $(OBJS)
    158226
    159227distclean: clean
    160228        rm -f Makefile *~
    161 
    162 $(MAT_LIB):
    163         make -C $(MAT_DIR) all
    164 
    165 $(R2_LIB):
    166         make -C $(R2_DIR)/src all
    167 
    168 $(IMG_LIB):
    169         make -C $(IMG_DIR) all
    170 
    171 nanovis: $(MAT_LIB) $(R2_LIB) $(IMG_LIB) $(OBJS)
    172         $(CC) $(CC_SWITCHES) -o $@ $^ $(LIBS)
    173 
    174 client: Socket.o ClientSocket.o RenderClient.o Event.o
    175         $(CC) $(CC_SWITCHES) -o $@ $^ $(LIBS)
    176 
    177 .cpp.o:
    178         $(CC) $(CC_SWITCHES) -o $@ -c $<
    179 
    180 Nv.o: Nv.cpp NvShader.cpp
    181         $(CC) $(CC_SWITCHES) -c $^
    182 
    183 dxReader2.o: $(srcdir)/dxReader2.cpp
    184         $(CC) -c $(CC_SWITCHES) $(DX_INC_SPEC) $?
    185 RpDX.o: $(srcdir)/RpDX.cpp
    186         $(CC) -c $(CC_SWITCHES) $(DX_INC_SPEC) $?
    187 
    188 ColorGradient.o: transfer-function/ColorGradient.cpp
    189         $(CC) $(CC_SWITCHES) -o $@ -c $<
    190 ColorPaletteWindow.o: transfer-function/ColorPaletteWindow.cpp
    191         $(CC) $(CC_SWITCHES) -o $@ -c $<
    192 ColorGradientGLUTWindow.o: transfer-function/ColorGradientGLUTWindow.cpp
    193         $(CC) $(CC_SWITCHES) -o $@ -c $<
    194 ControlPoint.o: transfer-function/ControlPoint.cpp
    195         $(CC) $(CC_SWITCHES) -o $@ -c $<
    196 TransferFunctionGLUTWindow.o: transfer-function/TransferFunctionGLUTWindow.cpp
    197         $(CC) $(CC_SWITCHES) -o $@ -c $<
    198 MainWindow.o: transfer-function/MainWindow.cpp
    199         $(CC) $(CC_SWITCHES) -o $@ -c $<
    200 Socket.o: socket/Socket.cpp socket/Socket.h
    201         $(CC) $(CC_SWITCHES) -o $@ -c $<
    202 ClientSocket.o: socket/ClientSocket.cpp socket/ClientSocket.h
    203         $(CC) $(CC_SWITCHES) -o $@ -c $<
    204 RenderClient.o: socket/RenderClient.cpp socket/RenderClient.h
    205         $(CC) $(CC_SWITCHES) -o $@ -c $<
    206229
    207230NvStdVertexShader.o: NvStdVertexShader.cpp NvStdVertexShader.h
  • trunk/vizservers/nanovis/PCASplit.h

    r846 r934  
    154154}
    155155
    156 };
     156}
    157157
    158158#endif
  • trunk/vizservers/nanovis/R2/include/R2/R2.h

    r580 r934  
    4242enum R2TEXFILTER {
    4343    R2_NEAREST = GL_NEAREST,        /*< GL_NEAREST */
    44     R2_LINEAR = GL_LINEAR,          /*< GL_LINEAR */
     44    R2_LINEAR = GL_LINEAR           /*< GL_LINEAR */
    4545};
    4646
     
    4949    R2_TEXTURE_2D = GL_TEXTURE_2D,  /*< GL_TEXTURE_2D */
    5050    R2_TEXTURE_RECTANGLE = GL_TEXTURE_RECTANGLE_NV, /*< GL_TEXTURE_RECTANGLE_NV */
    51     R2_TEXTURE_3D = GL_TEXTURE_3D,  /*< GL_TEXTURE_3D */
     51    R2_TEXTURE_3D = GL_TEXTURE_3D  /*< GL_TEXTURE_3D */
    5252
    5353};
     
    5555    R2_CLAMP = GL_CLAMP,                    /*< GL_CLAMP */
    5656    R2_CLAMP_TO_EDGE = GL_CLAMP_TO_EDGE,    /*< GL_CLAMP_TO_EDGE */
    57     R2_REPEAT = GL_REPEAT,                  /*< GL_REPEAT */
     57    R2_REPEAT = GL_REPEAT                   /*< GL_REPEAT */
    5858};
    5959
  • trunk/vizservers/nanovis/R2/include/R2/graphics/R2Geometry.h

    r929 r934  
    1414        TRIANGLES = GL_TRIANGLES,
    1515        TRIANGLE_STRIP = GL_TRIANGLE_STRIP,
    16         QUADS = GL_QUADS,
     16        QUADS = GL_QUADS
    1717    };
    1818
  • trunk/vizservers/nanovis/RenderContext.h

    r838 r934  
    99public :
    1010    enum ShadingModel {
    11         FLAT = GL_FLAT ,   //!< Flat Shading
    12         SMOOTH = GL_SMOOTH, //!< Smooth shading (Goraud shading model)
     11        FLAT = GL_FLAT ,        //!< Flat Shading
     12        SMOOTH = GL_SMOOTH      //!< Smooth shading (Goraud shading model)
    1313    };
    1414
    1515    enum PolygonMode {
    1616        LINE = GL_LINE,
    17         FILL = GL_FILL,
     17        FILL = GL_FILL
    1818    };
    1919
    2020    enum CullMode {
    21         NO_CULL,    //!< No culling
    22         BACK= GL_BACK,  //!< Back face culling
    23         FRONT= GL_FRONT, //!< Front face culling
     21        NO_CULL,                //!< No culling
     22        BACK= GL_BACK,          //!< Back face culling
     23        FRONT= GL_FRONT         //!< Front face culling
    2424    };
    2525
     
    8585}
    8686
    87 };
     87}
    8888
    8989#endif //
  • trunk/vizservers/nanovis/Texture1D.cpp

    r259 r934  
     1
    12/*
    23 * ----------------------------------------------------------------------
     
    2122
    2223Texture1D::Texture1D(){
    23         id = -1;
    24         gl_resource_allocated = false;
     24    id = -1;                   
     25    gl_resource_allocated = false;
    2526}
    2627
    2728Texture1D::Texture1D(int width, int type)
    2829{
    29         assert(type == GL_UNSIGNED_BYTE || type == GL_FLOAT|| type ==GL_UNSIGNED_INT);
    30        
    31         this->width = width;
    32         this->type = type;
     30    assert(type == GL_UNSIGNED_BYTE || type == GL_FLOAT ||
     31           type == GL_UNSIGNED_INT);
     32       
     33    this->width = width;
     34    this->type = type;
    3335
    34         id = -1;
    35         gl_resource_allocated = false;
     36    id = -1;
     37    gl_resource_allocated = false;
    3638}
    3739
    3840GLuint Texture1D::initialize_float_rgba(float *data)
    3941{
    40         glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
     42    glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
    4143
    42         glGenTextures(1, &id);
    43         glBindTexture(GL_TEXTURE_1D, id);
    44         assert(id!=-1);
     44    glGenTextures(1, &id);
     45    glBindTexture(GL_TEXTURE_1D, id);
     46    assert(id != -1);
    4547
    46         glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
     48    glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
    4749
    48         glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    49         glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
     50    glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
     51    glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    5052
    51         glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA, width, 0, GL_RGBA, GL_FLOAT, data);
    52         assert(glGetError()==0);
    53        
    54         gl_resource_allocated = true;
    55         return id;
     53    glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA, width, 0, GL_RGBA, GL_FLOAT, data);
     54    assert(glGetError()==0);
     55       
     56    gl_resource_allocated = true;
     57    return id;
    5658}
    5759
    5860void Texture1D::update_float_rgba(float* data){
    59         glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
    60         glBindTexture(GL_TEXTURE_1D, id);
    61        
    62         glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
     61    glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
     62    glBindTexture(GL_TEXTURE_1D, id);
     63       
     64    glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
    6365
    64         glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    65         glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
     66    glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
     67    glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    6668
    67         glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA, width, 0, GL_RGBA, GL_FLOAT, data);
    68         assert(glGetError()==0);       
     69    glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA, width, 0, GL_RGBA, GL_FLOAT, data);
     70    assert(glGetError()==0);   
    6971}
    7072
    7173void Texture1D::activate()
    7274{
    73         glBindTexture(GL_TEXTURE_1D, id);
    74         glEnable(GL_TEXTURE_1D);
     75    glBindTexture(GL_TEXTURE_1D, id);
     76    glEnable(GL_TEXTURE_1D);
    7577}
    7678
    7779void Texture1D::deactivate()
    7880{
    79         glDisable(GL_TEXTURE_1D);               
     81    glDisable(GL_TEXTURE_1D);           
    8082}
    8183
    8284Texture1D::~Texture1D()
    8385{
    84         glDeleteTextures(1, &id);
     86    glDeleteTextures(1, &id);
    8587}
    8688
    8789void Texture1D::check_max_size(){
    88         GLint max = 0;
    89         glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max);
    90        
    91         //printf("%d", glGetError());
    92         fprintf(stderr, "max texture size: %d\n", max);
     90    GLint max = 0;
     91    glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max);
     92       
     93    //printf("%d", glGetError());
     94    fprintf(stderr, "max texture size: %d\n", max);
    9395}
    9496
    9597void Texture1D::check_max_unit(){
    96         int max;
    97         glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &max);
     98    int max;
     99    glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &max);
    98100
    99         fprintf(stderr, "max texture units: %d.\n", max);
     101    fprintf(stderr, "max texture units: %d.\n", max);
    100102}
  • trunk/vizservers/nanovis/Texture1D.h

    r273 r934  
    1818#include <GL/glew.h>
    1919
    20 class Texture1D{
    21        
     20class Texture1D {
    2221public:
    23         int width;
    24         bool gl_resource_allocated;
    25        
    26         GLuint type;
    27         GLuint id;
    28         GLuint tex_unit;
     22    int width;
     23    bool gl_resource_allocated;
     24   
     25    GLuint type;
     26    GLuint id;
     27    GLuint tex_unit;
    2928
    30         Texture1D();
    31         Texture1D(int length, int type = GL_UNSIGNED_BYTE);
    32         ~Texture1D();
    33        
    34         void activate();
    35         void deactivate();
    36         GLuint initialize_float_rgba(float* data);
    37         void update_float_rgba(float* data);
    38         static void check_max_size();
    39         static void check_max_unit();
     29    Texture1D();
     30    Texture1D(int length, int type = GL_UNSIGNED_BYTE);
     31    ~Texture1D();
     32       
     33    void activate();
     34    void deactivate();
     35    GLuint initialize_float_rgba(float* data);
     36    void update_float_rgba(float* data);
     37    static void check_max_size();
     38    static void check_max_unit();
    4039};
    4140
  • trunk/vizservers/nanovis/dxReader2.cpp

    r932 r934  
    6363
    6464// This is legacy code that can be removed during code cleanup
    65 int getInterpData(  int rank, float* numPts, float* max, float* dxpos, Object* dxobj,
    66                     double* dataMin, double* dataMax, float** result)
     65int
     66getInterpData(int rank, float* numPts, float* max, float* dxpos, Object* dxobj,
     67              double* dataMin, double* dataMax, float** result)
    6768{
    6869    int pts = int(numPts[0]*numPts[1]*numPts[2]);
    6970    int interppts = pts;
     71    Interpolator interpolator;
     72
     73#ifdef test
    7074    int arrSize = interppts*rank;
    7175    float interppos[arrSize];
    72     Interpolator interpolator;
    73 
    7476//     commented this out to see what happens when we use the dxpos array
    7577//     which holds the positions dx generated for interpolation.
    7678//
    77     // generate the positions we want to interpolate on
     79//    generate the positions we want to interpolate on
    7880//    getInterpPos(numPts,dxpos,max,rank,interppos);
    7981//    fprintf(stdout, "after getInterpPos\n");
    8082//    fflush(stdout);
    81 
     83#endif
    8284    // build the interpolator and interpolate
    8385    interpolator = DXNewInterpolator(*dxobj,INTERP_INIT_IMMEDIATE,-1.0);
     
    9395        fprintf(stdout,
    9496            "(%f,%f,%f)|->% 8e\n(%f,%f,%f)|->% 8e\n(%f,%f,%f)|->% 8e\n",
     97#ifdef test
    9598//            interppos[pt],interppos[pt+1],interppos[pt+2], (*result)[lcv],
    9699//            interppos[pt+3],interppos[pt+4],interppos[pt+5],(*result)[lcv+1],
    97100//            interppos[pt+6],interppos[pt+7],interppos[pt+8],(*result)[lcv+2]);
     101#endif
    98102            dxpos[pt],dxpos[pt+1],dxpos[pt+2], (*result)[lcv],
    99103            dxpos[pt+3],dxpos[pt+4],dxpos[pt+5],(*result)[lcv+1],
  • trunk/vizservers/nanovis/imgLoaders/Image.h

    r823 r934  
    66    enum DataType {
    77        IMG_UNSIGNED_BYTE,
    8         IMG_FLOAT,
     8        IMG_FLOAT
    99    };
    1010
    1111    enum ImageFormat {
    1212        IMG_RGB = 3,
    13         IMG_RGBA = 4,
     13        IMG_RGBA = 4
    1414    };
    1515
  • trunk/vizservers/nanovis/nanovis.cpp

    r932 r934  
    7878
    7979// STATIC MEMBER DATA
     80Grid *NanoVis::grid = NULL;
    8081int NanoVis::updir = Y_POS;
    8182NvCamera* NanoVis::cam = NULL;
     
    101102bool NanoVis::vector_on = false;
    102103bool NanoVis::config_pending = false;
     104
    103105
    104106// pointers to volumes, currently handle up to 10 volumes
Note: See TracChangeset for help on using the changeset viewer.