Changeset 4889 for nanovis/branches/1.1


Ignore:
Timestamp:
Dec 19, 2014, 10:00:34 PM (10 years ago)
Author:
ldelgass
Message:

Merge r3611:3618 from trunk

Location:
nanovis/branches/1.1
Files:
22 deleted
83 edited
22 copied

Legend:

Unmodified
Added
Removed
  • nanovis/branches/1.1

  • nanovis/branches/1.1/Axis.cpp

    r3502 r4889  
    1212
    1313#include "Axis.h"
     14
     15using namespace nv;
    1416
    1517inline bool DEFINED(double x) {
  • nanovis/branches/1.1/Axis.h

    r3502 r4889  
    55 * Authors: George A. Howlett <gah@purdue.edu>
    66 */
    7 #ifndef AXIS_H
    8 #define AXIS_H
     7#ifndef NV_AXIS_H
     8#define NV_AXIS_H
    99
    1010#include <stdlib.h>
     
    1919#define NAN (std::numeric_limits<double>::quiet_NaN())
    2020#endif
     21
     22namespace nv {
    2123
    2224class Axis;
     
    409411};
    410412
     413}
     414
    411415#endif
  • nanovis/branches/1.1/AxisRange.h

    r3502 r4889  
    55 * Authors: George A. Howlett <gah@purdue.edu>
    66 */
    7 #ifndef AXIS_RANGE_H
    8 #define AXIS_RANGE_H
     7#ifndef NV_AXIS_RANGE_H
     8#define NV_AXIS_RANGE_H
    99
    1010#include <string.h>
     11
     12namespace nv {
    1113
    1214class AxisRange
     
    8183};
    8284
     85}
     86
    8387#endif
  • nanovis/branches/1.1/BucketSort.cpp

    r3502 r4889  
    55 */
    66
     7#include <vrmath/Vector3f.h>
     8#include <vrmath/Matrix4x4d.h>
     9
    710#include "BucketSort.h"
    811
    912using namespace PCA;
    10 
    11 #include <vrmath/Vector3f.h>
    12 #include <vrmath/Matrix4x4d.h>
     13using namespace vrmath;
    1314
    1415void
     
    2324{
    2425    if (clusterAccel == 0) {
    25         return;
     26        return;
    2627    }
    2728    Cluster* cluster = clusterAccel->startPointerCluster[level - 1];
     
    2930    Cluster* end = &(cluster[clusterAccel->numOfClusters[level - 1] - 1]);
    3031
    31     Vector3f pos;
    3232    for (; c <= end; c = (Cluster*) ((char *)c + sizeof(Cluster))) {
    33         pos = cameraMat.transform(c->centroid);
    34         addBucket(c, pos.length()*_invMaxLength);
     33        Vector4f pt = cameraMat.transform(Vector4f(c->centroid, 1));
     34        Vector3f pos(pt.x, pt.y, pt.z);
     35        addBucket(c, pos.length()*_invMaxLength);
    3536    }
    3637}       
  • nanovis/branches/1.1/BucketSort.h

    r3502 r4889  
    44 *
    55 */
    6 #ifndef BUCKETSORT_H
    7 #define BUCKETSORT_H
     6#ifndef PCA_BUCKETSORT_H
     7#define PCA_BUCKETSORT_H
    88
    99#include <vector>
  • nanovis/branches/1.1/Chain.cpp

    r2923 r4889  
    2727
    2828#include "Chain.h"
     29
     30using namespace nv;
    2931
    3032typedef int (QSortCompareProc) (const void *, const void *);
  • nanovis/branches/1.1/Chain.h

    r2923 r4889  
    2222 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    2323 */
    24 #ifndef CHAIN_H
    25 #define CHAIN_H
     24#ifndef NV_CHAIN_H
     25#define NV_CHAIN_H
     26
     27namespace nv {
    2628
    2729/**
     
    143145};
    144146
     147}
     148
    145149#endif
  • nanovis/branches/1.1/CircularQueue.h

    r2877 r4889  
    1414* @author Kjell Hedström, hedstrom@kjellkod.cc */
    1515
    16 #ifndef CIRCULARFIFO_H_
    17 #define CIRCULARFIFO_H_
     16#ifndef CIRCULARFIFO_H
     17#define CIRCULARFIFO_H
    1818
    1919/** Circular Fifo (a.k.a. Circular Buffer)
     
    181181}
    182182
    183 #endif /* CIRCULARFIFO_H_ */
     183#endif
  • nanovis/branches/1.1/CmdProc.h

    r3502 r4889  
    44 *
    55 */
    6 /*
    7  *-------------------------------------------------------------------------------
    8  *
    9  * CmdSpec.h --
    10  *
    11  *      Generic function prototype of CmdOptions.
    12  *
    13  *-------------------------------------------------------------------------------
    14  */
    15 
    16 #ifndef CMDSPEC_H
    17 #define CMDSPEC_H
     6#ifndef RAPPTURE_CMDPROC_H
     7#define RAPPTURE_CMDPROC_H
    188
    199namespace Rappture {
    2010
    21 /*
    22  *-------------------------------------------------------------------------------
    23  *
    24  * CmdSpec --
    25  *
    26  *      Structure to specify a set of operations for a Tcl command.
    27  *      This is passed to the Blt_GetOp procedure to look
    28  *      for a function pointer associated with the operation name.
    29  *
    30  *-------------------------------------------------------------------------------
     11/**
     12 * Structure to specify a set of operations for a Tcl command.
     13 * This is passed to the Blt_GetOp procedure to look
     14 * for a function pointer associated with the operation name.
    3115 */
    3216typedef struct {
    33     const char *name;           /* Name of operation */
    34     int minChars;               /* Minimum # characters to disambiguate */
     17    const char *name;           /**< Name of operation */
     18    int minChars;               /**< Minimum # characters to disambiguate */
    3519    Tcl_ObjCmdProc *proc;
    36     int minArgs;                /* Minimum # args required */
    37     int maxArgs;                /* Maximum # args required */
    38     const char *usage;          /* Usage message */
     20    int minArgs;                /**< Minimum # args required */
     21    int maxArgs;                /**< Maximum # args required */
     22    const char *usage;          /**< Usage message */
    3923} CmdSpec;
    4024
    4125typedef enum {
    42     CMDSPEC_ARG0,               /* Op is the first argument. */
    43     CMDSPEC_ARG1,               /* Op is the second argument. */
    44     CMDSPEC_ARG2,               /* Op is the third argument. */
    45     CMDSPEC_ARG3,               /* Op is the fourth argument. */
    46     CMDSPEC_ARG4                /* Op is the fifth argument. */
     26    CMDSPEC_ARG0,               /**< Op is the first argument. */
     27    CMDSPEC_ARG1,               /**< Op is the second argument. */
     28    CMDSPEC_ARG2,               /**< Op is the third argument. */
     29    CMDSPEC_ARG3,               /**< Op is the fourth argument. */
     30    CMDSPEC_ARG4                /**< Op is the fifth argument. */
    4731} CmdSpecIndex;
    4832
     
    5842}
    5943
    60 #endif /* CMDSPEC_H */
     44#endif
  • nanovis/branches/1.1/Command.cpp

    r4881 r4889  
    5555#include "Grid.h"
    5656#include "HeightMap.h"
    57 #include "NvCamera.h"
    58 #include "NvZincBlendeReconstructor.h"
     57#include "Camera.h"
     58#include "ZincBlendeVolume.h"
     59#include "ZincBlendeReconstructor.h"
    5960#include "Unirect.h"
    6061#include "Volume.h"
     
    12821283    if ((nBytes > 5) && (strncmp(bytes, "<HDR>", 5) == 0)) {
    12831284        TRACE("ZincBlende Stream loading...");
    1284         volume = NvZincBlendeReconstructor::getInstance()->loadFromMemory(buf.bytes());
     1285        volume = ZincBlendeReconstructor::getInstance()->loadFromMemory(buf.bytes());
    12851286        if (volume == NULL) {
    12861287            Tcl_AppendResult(interp, "can't get volume instance", (char *)NULL);
  • nanovis/branches/1.1/Command.h

    r4874 r4889  
    99 *   Leif Delgass <ldelgass@purdue.edu>
    1010 */
    11 #ifndef COMMAND_H
    12 #define COMMAND_H
     11#ifndef NV_COMMAND_H
     12#define NV_COMMAND_H
    1313
    1414#include <unistd.h>
     
    1919class Buffer;
    2020}
    21 class Volume;
    2221
    2322namespace nv {
    2423
    2524class ReadBuffer;
     25class Volume;
    2626
    2727extern ssize_t SocketWrite(const void *bytes, size_t len);
  • nanovis/branches/1.1/ContourLineFilter.cpp

    r3492 r4889  
    1414#include "ContourLineFilter.h"
    1515
     16using namespace nv;
    1617using namespace nv::graphics;
    1718using namespace vrmath;
  • nanovis/branches/1.1/ContourLineFilter.h

    r3492 r4889  
    11/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
    2 #ifndef CONTOURLINEFILTER_H
    3 #define CONTOURLINEFILTER_H
     2#ifndef NV_CONTOURLINEFILTER_H
     3#define NV_CONTOURLINEFILTER_H
    44
    55#include <list>
     
    99#include <vrmath/Vector3f.h>
    1010#include <vrmath/Vector4f.h>
     11
     12namespace nv {
    1113
    1214class ContourLineFilter
     
    6062};
    6163
     64}
     65
    6266#endif
  • nanovis/branches/1.1/ConvexPolygon.cpp

    r3502 r4889  
    2121#include "Trace.h"
    2222
     23using namespace nv;
    2324using namespace vrmath;
    2425
  • nanovis/branches/1.1/ConvexPolygon.h

    r3502 r4889  
    11/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
    22/*
    3  * ----------------------------------------------------------------------
    4  * ConvexPolygon.h: convex polygon class
     3 * Copyright (c) 2004-2013  HUBzero Foundation, LLC
    54 *
    6  * ======================================================================
    7  *  AUTHOR:  Wei Qiao <qiaow@purdue.edu>
    8  *           Purdue Rendering and Perceptualization Lab (PURPL)
    9  *
    10  *  Copyright (c) 2004-2013  HUBzero Foundation, LLC
    11  *
    12  *  See the file "license.terms" for information on usage and
    13  *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
    14  * ======================================================================
     5 * Authors:
     6 *   Wei Qiao <qiaow@purdue.edu>
    157 */
    16 #ifndef _CONVEX_POLYGON_H_
    17 #define _CONVEX_POLYGON_H_
     8#ifndef NV_CONVEX_POLYGON_H
     9#define NV_CONVEX_POLYGON_H
    1810
    1911#include <assert.h>
     
    2517
    2618#include "Plane.h"
     19
     20namespace nv {
    2721
    2822typedef std::vector<vrmath::Vector4f> VertexVector;
     
    7165};
    7266
     67}
     68
    7369#endif
  • nanovis/branches/1.1/Flow.cpp

    r4874 r4889  
    2020#include "FlowParticles.h"
    2121#include "FlowBox.h"
    22 #include "NvLIC.h"
     22#include "LIC.h"
    2323#include "VelocityArrowsSlice.h"
    24 #include "NvParticleRenderer.h"
    2524#include "Switch.h"
    2625#include "Unirect.h"
  • nanovis/branches/1.1/Flow.h

    r4612 r4889  
    99 *   Leif Delgass <ldelgass@purdue.edu>
    1010 */
    11 
    12 #ifndef FLOW_H
    13 #define FLOW_H
     11#ifndef NV_FLOW_H
     12#define NV_FLOW_H
    1413
    1514#include <tr1/unordered_map>
     
    2524#include "FlowParticles.h"
    2625#include "FlowBox.h"
    27 #include "NvLIC.h"
    28 #include "NvParticleRenderer.h"
     26#include "LIC.h"
    2927#include "Unirect.h"
    3028#include "Volume.h"
    3129#include "TransferFunction.h"
     30
     31namespace nv {
    3232
    3333struct FlowValues {
     
    253253};
    254254
     255}
     256
    255257#endif
  • nanovis/branches/1.1/FlowBox.cpp

    r3567 r4889  
    2121#include "Trace.h"
    2222
     23using namespace nv;
    2324using namespace vrmath;
    2425
  • nanovis/branches/1.1/FlowBox.h

    r3568 r4889  
    99 *   Leif Delgass <ldelgass@purdue.edu>
    1010 */
    11 #ifndef FLOWBOX_H
    12 #define FLOWBOX_H
     11#ifndef NV_FLOWBOX_H
     12#define NV_FLOWBOX_H
    1313
    1414#include <string>
     
    2121#include "Switch.h"
    2222#include "Volume.h"
     23
     24namespace nv {
    2325
    2426struct FlowBoxValues {
     
    7173};
    7274
     75}
     76
    7377#endif
  • nanovis/branches/1.1/FlowCmd.cpp

    r4884 r4889  
    3737#include "Switch.h"
    3838#include "TransferFunction.h"
    39 #include "NvLIC.h"
     39#include "LIC.h"
    4040#include "Unirect.h"
    4141#include "VelocityArrowsSlice.h"
  • nanovis/branches/1.1/FlowCmd.h

    r4874 r4889  
    11/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
    22/*
    3  * ----------------------------------------------------------------------
    4  * FlowCmd.h
     3 * Copyright (c) 2004-2013  HUBzero Foundation, LLC
    54 *
    6  *      This modules creates the Tcl interface to the nanovis server.  The
    7  *      communication protocol of the server is the Tcl language.  Commands
    8  *      given to the server by clients are executed in a safe interpreter and
    9  *      the resulting image rendered offscreen is returned as BMP-formatted
    10  *      image data.
    11  *
    12  * ======================================================================
    13  *  AUTHOR:  Wei Qiao <qiaow@purdue.edu>
    14  *           Insoo Woo <iwoo@purdue.edu>
    15  *           Michael McLennan <mmclennan@purdue.edu>
    16  *           Purdue Rendering and Perceptualization Lab (PURPL)
    17  *
    18  *  Copyright (c) 2004-2013  HUBzero Foundation, LLC
    19  *
    20  *  See the file "license.terms" for information on usage and
    21  *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
    22  * ======================================================================
     5 * Authors:
     6 *   Wei Qiao <qiaow@purdue.edu>
     7 *   Insoo Woo <iwoo@purdue.edu>
     8 *   Michael McLennan <mmclennan@purdue.edu>
    239 */
    24 #ifndef FLOWCMD_H
    25 #define FLOWCMD_H
     10#ifndef NV_FLOWCMD_H
     11#define NV_FLOWCMD_H
    2612
    2713#include <tcl.h>
  • nanovis/branches/1.1/FlowParticles.cpp

    r4612 r4889  
    1919#include "Trace.h"
    2020
     21using namespace nv;
    2122using namespace vrmath;
    2223
    2324FlowParticles::FlowParticles(const char *name) :
    2425    _name(name),
    25     _renderer(new NvParticleRenderer(NMESH, NMESH))
     26    _renderer(new ParticleRenderer(NMESH, NMESH))
    2627{
    2728    _sv.position.value = 0.0f;
  • nanovis/branches/1.1/FlowParticles.h

    r4612 r4889  
    99 *   Leif Delgass <ldelgass@purdue.edu>
    1010 */
    11 #ifndef FLOWPARTICLES_H
    12 #define FLOWPARTICLES_H
     11#ifndef NV_FLOWPARTICLES_H
     12#define NV_FLOWPARTICLES_H
    1313
    1414#include <cassert>
     
    2121#include "FlowTypes.h"
    2222#include "Switch.h"
    23 #include "NvParticleRenderer.h"
     23#include "ParticleRenderer.h"
    2424#include "Volume.h"
     25
     26namespace nv {
    2527
    2628struct FlowParticlesValues {
     
    9698     */
    9799    std::string _name;
    98     NvParticleRenderer *_renderer;        ///< Particle renderer
     100    nv::ParticleRenderer *_renderer;        ///< Particle renderer
    99101    FlowParticlesValues _sv;
    100102
     
    102104};
    103105
     106}
     107
    104108#endif
  • nanovis/branches/1.1/FlowTypes.h

    r3567 r4889  
    99 *   Leif Delgass <ldelgass@purdue.edu>
    1010 */
    11 #ifndef FLOWTYPES_H
    12 #define FLOWTYPES_H
     11#ifndef NV_FLOWTYPES_H
     12#define NV_FLOWTYPES_H
     13
     14namespace nv {
    1315
    1416struct FlowColor {
     
    3032#define ABSPOS 1
    3133
     34}
     35
    3236#endif
  • nanovis/branches/1.1/GradientFilter.cpp

    r3559 r4889  
    1414#include "GradientFilter.h"
    1515
     16using namespace nv;
     17
    1618#ifndef SQR
    1719#define SQR(a) ((a) * (a))
     
    9597#endif
    9698
    97 int
    98 getNextPowerOfTwo(int n)
    99 {
    100     int i;
    101 
    102     i = 1;
    103     while (i < n) {
    104         i *= 2;
    105     }
    106 
    107     return i;
    108 }
    109 
    110 static unsigned char getVoxel8(int x, int y, int z)
     99static unsigned char
     100getVoxel8(int x, int y, int z)
    111101{
    112102    return ((unsigned char*)g_volData)[z * g_numOfSlices[0] * g_numOfSlices[1] +
     
    115105}
    116106
    117 static unsigned short getVoxel16(int x, int y, int z)
     107static unsigned short
     108getVoxel16(int x, int y, int z)
    118109{
    119110    return ((unsigned short*)g_volData)[z * g_numOfSlices[0] * g_numOfSlices[1] +
     
    122113}
    123114
    124 static float getVoxelFloat(int x, int y, int z)
     115static float
     116getVoxelFloat(int x, int y, int z)
    125117{
    126118    return ((float*)g_volData)[z * g_numOfSlices[0] * g_numOfSlices[1] +
     
    129121}
    130122
    131 static float getVoxel(int x, int y, int z, DataType dataType)
     123static float
     124getVoxel(int x, int y, int z, nv::DataType dataType)
    132125{
    133126    switch (dataType) {
    134         case DATRAW_UCHAR:
    135             return (float)getVoxel8(x, y, z);
    136             break;
    137         case DATRAW_USHORT:
    138             return (float)getVoxel16(x, y, z);
    139             break;
    140         case DATRAW_FLOAT :
    141             return (float)getVoxelFloat(x, y, z);
    142             break;
    143         default:
    144             ERROR("Unsupported data type");
    145             exit(1);
    146             break;
     127    case nv::DATRAW_UCHAR:
     128        return (float)getVoxel8(x, y, z);
     129        break;
     130    case nv::DATRAW_USHORT:
     131        return (float)getVoxel16(x, y, z);
     132        break;
     133    case nv::DATRAW_FLOAT:
     134        return (float)getVoxelFloat(x, y, z);
     135        break;
     136    default:
     137        ERROR("Unsupported data type");
     138        exit(1);
    147139    }
    148140    return 0.0;
    149141}
    150142
    151 void computeGradients(float *gradients, void *volData, int *sizes,
    152                       float *spacing, DataType dataType)
    153 {
    154     ::g_volData = volData;
     143void
     144nv::computeGradients(float *gradients, void *volData, int *sizes,
     145                     float *spacing, DataType dataType)
     146{
     147    g_volData = volData;
    155148    g_numOfSlices[0] = sizes[0];
    156149    g_numOfSlices[1] = sizes[1];
     
    309302}
    310303
    311 void filterGradients(float *gradients, int *sizes)
     304void
     305nv::filterGradients(float *gradients, int *sizes)
    312306{
    313307    int i, j, k, idz, idy, idx, gi, ogi, filterWidth, n, borderDist[3];
     
    444438}
    445439
    446 void quantize8(float *grad, unsigned char *data)
     440static void
     441quantize8(float *grad, unsigned char *data)
    447442{
    448443    float len;
     
    464459}
    465460
    466 void quantize16(float *grad, unsigned short *data)
     461static void
     462quantize16(float *grad, unsigned short *data)
    467463{
    468464    float len;
     
    484480}
    485481
    486 void quantizeFloat(float *grad, float *data)
     482static void
     483quantizeFloat(float *grad, float *data)
    487484{
    488485    float len;
     
    504501}
    505502
    506 void quantizeGradients(float *gradientsIn, void *gradientsOut,
    507                        int *sizes, DataType dataType)
     503void
     504nv::quantizeGradients(float *gradientsIn, void *gradientsOut,
     505                      int *sizes, DataType dataType)
    508506{
    509507    int idx, idy, idz, di;
  • nanovis/branches/1.1/GradientFilter.h

    r3502 r4889  
    44 *
    55 */
    6 #ifndef GRADIENT_FILTER_H
    7 #define GRADIENT_FILTER_H
     6#ifndef NV_GRADIENT_FILTER_H
     7#define NV_GRADIENT_FILTER_H
     8
     9namespace nv {
    810
    911typedef enum {
     
    2123                              int *sizes, DataType dataType);
    2224
     25}
     26
    2327#endif
  • nanovis/branches/1.1/Grid.cpp

    r4874 r4889  
    1313#include "Trace.h"
    1414
     15using namespace nv;
    1516using namespace nv::util;
    1617
  • nanovis/branches/1.1/Grid.h

    r3502 r4889  
    44 *
    55 */
    6 #ifndef GRID_H
    7 #define GRID_H
     6#ifndef NV_GRID_H
     7#define NV_GRID_H
    88
    99#include <util/Fonts.h>
     
    1111#include "Axis.h"
    1212#include "AxisRange.h"
     13
     14namespace nv {
    1315
    1416class RGBA
     
    7476};
    7577
     78}
    7679
    7780#endif
  • nanovis/branches/1.1/HeightMap.cpp

    r4874 r4889  
    1515#include "Texture1D.h"
    1616
     17using namespace nv;
     18using namespace nv::graphics;
     19using namespace vrmath;
     20
    1721bool HeightMap::updatePending = false;
    1822double HeightMap::valueMin = 0.0;
    1923double HeightMap::valueMax = 1.0;
    20 
    21 using namespace nv::graphics;
    22 using namespace vrmath;
    2324
    2425HeightMap::HeightMap() :
     
    3839    _heights(NULL)
    3940{
    40     _shader = new NvShader();
     41    _shader = new Shader();
    4142    _shader->loadFragmentProgram("heightcolor.cg", "main");
    4243}
  • nanovis/branches/1.1/HeightMap.h

    r4612 r4889  
    44 *
    55 */
    6 #ifndef HEIGHTMAP_H
    7 #define HEIGHTMAP_H
     6#ifndef NV_HEIGHTMAP_H
     7#define NV_HEIGHTMAP_H
    88
    99#include <graphics/Geometry.h>
     
    1212
    1313#include "TransferFunction.h"
    14 #include "NvShader.h"
     14#include "Shader.h"
    1515#include "AxisRange.h"
     16
     17namespace nv {
    1618
    1719class Grid;
     
    130132    TransferFunction *_transferFunc;
    131133    float _opacity;
    132     NvShader *_shader;
     134    Shader *_shader;
    133135    int *_indexBuffer;
    134136    int _indexCount;
     
    145147};
    146148
     149}
     150
    147151#endif
  • nanovis/branches/1.1/LIC.cpp

    r3611 r4889  
    11/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
    22/*
    3  * ----------------------------------------------------------------------
    4  * NvLIC.h: line integral convolution class
    5  *
    6  * ======================================================================
    7  *  AUTHOR:  Insoo Woo <iwoo@purdue.edu, Wei Qiao <qiaow@purdue.edu>
    8  *           Purdue Rendering and Perceptualization Lab (PURPL)
    9  *
    103 *  Copyright (c) 2004-2013  HUBzero Foundation, LLC
    114 *
    12  *  See the file "license.terms" for information on usage and
    13  *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
    14  * ======================================================================
     5 *  Authors:
     6 *    Insoo Woo <iwoo@purdue.edu>
     7 *    Wei Qiao <qiaow@purdue.edu>
    158 */
    169#include <stdlib.h>
     
    2215
    2316#include "LIC.h"
    24 #include "NvShader.h"
     17#include "Shader.h"
    2518#include "Trace.h"
    2619
     
    111104    glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fboOrig);
    112105
    113     _renderVelShader = new NvShader();
     106    _renderVelShader = new Shader();
    114107    _renderVelShader->loadFragmentProgram("render_vel.cg", "main");
    115108
  • nanovis/branches/1.1/LIC.h

    r3611 r4889  
    11/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
    22/*
    3  * ----------------------------------------------------------------------
    4  * NvLIC.h: line integral convolution class
    5  *
    6  * ======================================================================
    7  *  AUTHOR:  Wei Qiao <qiaow@purdue.edu>
    8  *           Purdue Rendering and Perceptualization Lab (PURPL)
    9  *
    103 *  Copyright (c) 2004-2013  HUBzero Foundation, LLC
    114 *
    12  *  See the file "license.terms" for information on usage and
    13  *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
    14  * ======================================================================
     5 *  Authors:
     6 *    Wei Qiao <qiaow@purdue.edu>
    157 */
    168#ifndef NV_LIC_H
     
    2214
    2315#include "Volume.h"
    24 #include "NvShader.h"
     16#include "Shader.h"
    2517
    2618namespace nv {
     
    8476private:
    8577    /**
    86      * @brief the normal vector of the NvLIC plane,
     78     * @brief the normal vector of the LIC plane,
    8779     * the inherited Vector3 location is its center
    8880     */
     
    111103    GLuint _disListID;
    112104
    113     NvShader *_renderVelShader;
     105    Shader *_renderVelShader;
    114106
    115107    GLuint _colorTex, _patternTex, _magTex;
  • nanovis/branches/1.1/Makefile.in

    r4874 r4889  
    104104OBJS            = \
    105105                Axis.o \
     106                Camera.o \
    106107                Chain.o \
    107108                CmdProc.o \
     109                ColorTableShader.o \
    108110                Command.o \
    109111                ContourLineFilter.o \
     
    116118                Grid.o \
    117119                HeightMap.o \
    118                 NvCamera.o \
    119                 NvColorTableShader.o \
    120                 NvLIC.o \
    121                 NvParticleAdvectionShader.o \
    122                 NvParticleRenderer.o \
    123                 NvRegularVolumeShader.o \
    124                 NvShader.o \
    125                 NvStdVertexShader.o \
    126                 NvVolumeShader.o \
    127                 NvZincBlendeReconstructor.o \
    128                 NvZincBlendeVolumeShader.o \
     120                LIC.o \
     121                ParticleAdvectionShader.o \
     122                ParticleRenderer.o \
    129123                PerfQuery.o \
    130124                Plane.o \
     
    132126                ReadBuffer.o \
    133127                ReaderCommon.o \
     128                RegularVolumeShader.o \
    134129                RenderVertexArray.o \
     130                Shader.o \
     131                StdVertexShader.o \
    135132                Switch.o \
    136133                Texture1D.o \
     
    144141                VolumeInterpolator.o \
    145142                VolumeRenderer.o \
     143                VolumeShader.o \
    146144                VtkReader.o \
     145                ZincBlendeReconstructor.o \
    147146                ZincBlendeVolume.o \
     147                ZincBlendeVolumeShader.o \
    148148                dxReader.o \
    149149                md5.o \
     
    271271Axis.o: Axis.cpp Axis.h Chain.h
    272272BucketSort.o: BucketSort.cpp BucketSort.h $(VRMATH_DIR)/include/vrmath/Vector3f.h $(VRMATH_DIR)/include/vrmath/Vector4f.h $(VRMATH_DIR)/include/vrmath/Matrix4x4d.h PCASplit.h
     273Camera.o: Camera.cpp Camera.h config.h $(VRMATH_DIR)/include/vrmath/Matrix4x4d.h
    273274Chain.o: Chain.cpp Chain.h
    274275CmdProc.o: CmdProc.cpp CmdProc.h
    275 Command.o: Command.cpp nanovis.h nanovisServer.h ReadBuffer.h config.h define.h FlowCmd.h CmdProc.h Trace.h PlaneRenderer.h dxReader.h Grid.h HeightMap.h NvCamera.h NvZincBlendeReconstructor.h Unirect.h Volume.h VolumeRenderer.h
     276ColorTableShader.o: ColorTableShader.cpp ColorTableShader.h Shader.h
     277Command.o: Command.cpp nanovis.h nanovisServer.h ReadBuffer.h config.h define.h FlowCmd.h CmdProc.h Trace.h PlaneRenderer.h dxReader.h Grid.h HeightMap.h Camera.h ZincBlendeReconstructor.h Unirect.h Volume.h VolumeRenderer.h
    276278ContourLineFilter.o: ContourLineFilter.cpp ContourLineFilter.h
    277279ConvexPolygon.o: ConvexPolygon.cpp ConvexPolygon.h $(VRMATH_DIR)/include/vrmath/Vector4f.h $(VRMATH_DIR)/include/vrmath/Matrix4x4d.h Plane.h
    278 Flow.o: Flow.cpp Flow.h FlowCmd.h FlowTypes.h FlowBox.h FlowParticles.h NvLIC.h VelocityArrowsSlice.h Switch.h Unirect.h Volume.h TransferFunction.h Trace.h
     280Flow.o: Flow.cpp Flow.h FlowCmd.h FlowTypes.h FlowBox.h FlowParticles.h LIC.h VelocityArrowsSlice.h Switch.h Unirect.h Volume.h TransferFunction.h Trace.h
    279281FlowBox.o: FlowBox.cpp FlowBox.h FlowTypes.h Switch.h Trace.h Volume.h $(VRMATH_DIR)/include/vrmath/Vector3f.h $(VRMATH_DIR)/include/vrmath/Vector4f.h $(VRMATH_DIR)/include/vrmath/Matrix4x4d.h
    280 FlowCmd.o: FlowCmd.cpp FlowCmd.h FlowParticles.h FlowBox.h FlowTypes.h Command.h Switch.h Trace.h TransferFunction.h nanovis.h nanovisServer.h CmdProc.h NvLIC.h Unirect.h Volume.h VelocityArrowsSlice.h $(VRMATH_DIR)/include/vrmath/Vector3f.h
    281 FlowParticles.o: FlowParticles.cpp FlowParticles.h FlowTypes.h FlowCmd.h Switch.h Trace.h NvParticleRenderer.h Volume.h $(VRMATH_DIR)/include/vrmath/Vector3f.h $(VRMATH_DIR)/include/vrmath/Vector4f.h
     282<FlowCmd.o: FlowCmd.cpp FlowCmd.h FlowParticles.h FlowBox.h FlowTypes.h Command.h Switch.h Trace.h TransferFunction.h nanovis.h nanovisServer.h CmdProc.h LIC.h Unirect.h Volume.h VelocityArrowsSlice.h $(VRMATH_DIR)/include/vrmath/Vector3f.h
     283FlowParticles.o: FlowParticles.cpp FlowParticles.h FlowTypes.h FlowCmd.h Switch.h Trace.h ParticleRenderer.h Volume.h $(VRMATH_DIR)/include/vrmath/Vector3f.h $(VRMATH_DIR)/include/vrmath/Vector4f.h
    282284GradientFilter.o: GradientFilter.cpp GradientFilter.h
    283285Grid.o: Grid.cpp Grid.h Axis.h Chain.h
    284286HeightMap.o: HeightMap.cpp HeightMap.h
    285 NvCamera.o: NvCamera.cpp NvCamera.h config.h $(VRMATH_DIR)/include/vrmath/Matrix4x4d.h
    286 NvColorTableShader.o: NvColorTableShader.cpp NvColorTableShader.h NvShader.h
    287 NvLIC.o: NvLIC.cpp NvLIC.h define.h
    288 NvParticleAdvectionShader.o: NvParticleAdvectionShader.cpp NvParticleAdvectionShader.h NvShader.h
    289 NvParticleRenderer.o: NvParticleRenderer.cpp NvParticleRenderer.h define.h
    290 NvRegularVolumeShader.o: NvRegularVolumeShader.cpp NvRegularVolumeShader.h NvVolumeShader.h NvShader.h
    291 NvShader.o: NvShader.cpp NvShader.h
    292 NvStdVertexShader.o: NvStdVertexShader.cpp NvStdVertexShader.h NvShader.h
    293 NvVolumeShader.o: NvVolumeShader.cpp NvVolumeShader.h NvShader.h
    294 NvZincBlendeReconstructor.o: NvZincBlendeReconstructor.cpp NvZincBlendeReconstructor.h ZincBlendeVolume.h Volume.h $(VRMATH_DIR)/include/vrmath/Vector3f.h
    295 NvZincBlendeVolumeShader.o: NvZincBlendeVolumeShader.cpp NvZincBlendeVolumeShader.h NvVolumeShader.h NvShader.h
     287LIC.o: LIC.cpp LIC.h define.h
     288ParticleAdvectionShader.o: ParticleAdvectionShader.cpp ParticleAdvectionShader.h Shader.h
    296289ParticleEmitter.o: ParticleEmitter.cpp ParticleEmitter.h
    297 ParticleSystem.o: ParticleSystem.cpp ParticleSystem.h DataLoader.h
     290ParticleRenderer.o: ParticleRenderer.cpp ParticleRenderer.h define.h
     291ParticleSystem.o: ParticleSystem.cpp ParticleSystem.h
    298292ParticleSystemFactory.o: ParticleSystemFactory.cpp ParticleSystemFactory.h
    299293PCASplit.o: PCASplit.cpp PCASplit.h
     
    306300ReadBuffer.o: ReadBuffer.cpp ReadBuffer.h Trace.h
    307301ReaderCommon.o: ReaderCommon.cpp ReaderCommon.h GradientFilter.h $(VRMATH_DIR)/include/vrmath/Vector3f.h
     302RegularVolumeShader.o: RegularVolumeShader.cpp RegularVolumeShader.h VolumeShader.h Shader.h
    308303RenderVertexArray.o: RenderVertexArray.cpp RenderVertexArray.h
     304Shader.o: Shader.cpp Shader.h
     305StdVertexShader.o: StdVertexShader.cpp StdVertexShader.h Shader.h
    309306Switch.o: Switch.cpp Switch.h
    310307Texture1D.o: Texture1D.cpp Texture1D.h
     
    317314Volume.o: Volume.cpp Volume.h config.h define.h
    318315VolumeInterpolator.o: VolumeInterpolator.cpp VolumeInterpolator.h Volume.h
    319 VolumeRenderer.o: VolumeRenderer.cpp VolumeRenderer.h
     316VolumeRenderer.o: VolumeRenderer.cpp VolumeRenderer.h ConvexPolygon.h Volume.h nanovis.h Trace.h Plane.h StdVertexShader.h Shader.h
     317VolumeShader.o: VolumeShader.cpp VolumeShader.h Shader.h
    320318VtkReader.o: VtkReader.h Trace.h Volume.h $(VRMATH_DIR)/include/vrmath/Vector3f.h ReaderCommon.h nanovis.h
     319ZincBlendeReconstructor.o: ZincBlendeReconstructor.cpp ZincBlendeReconstructor.h ZincBlendeVolume.h Volume.h $(VRMATH_DIR)/include/vrmath/Vector3f.h
    321320ZincBlendeVolume.o: ZincBlendeVolume.cpp ZincBlendeVolume.h config.h define.h
    322 dxReader.o: dxReader.cpp ReaderCommon.h config.h nanovis.h Unirect.h ZincBlendeVolume.h NvZincBlendeReconstructor.h
     321ZincBlendeVolumeShader.o: ZincBlendeVolumeShader.cpp ZincBlendeVolumeShader.h VolumeShader.h Shader.h
     322dxReader.o: dxReader.cpp ReaderCommon.h config.h nanovis.h Unirect.h ZincBlendeVolume.h ZincBlendeReconstructor.h
    323323md5.o: md5.h
    324 nanovis.o: nanovis.cpp nanovis.h nanovisServer.h config.h define.h Command.h Flow.h Grid.h HeightMap.h NvCamera.h NvLIC.h NvZincBlendeReconstructor.h PerfQuery.h PlaneRenderer.h PointSetRenderer.h PointSet.h Switch.h Trace.h Unirect.h VelocityArrowsSlice.h VolumeInterpolator.h VolumeRenderer.h ZincBlendeVolume.h Axis.h Chain.h
    325 nanovisServer.o: nanovisServer.cpp nanovisServer.h config.h nanovis.h define.h Command.h NvShader.h Trace.h
     324nanovis.o: nanovis.cpp nanovis.h nanovisServer.h config.h define.h Command.h Flow.h Grid.h HeightMap.h Camera.h LIC.h ZincBlendeReconstructor.h PerfQuery.h PlaneRenderer.h PointSetRenderer.h PointSet.h Switch.h Trace.h Unirect.h VelocityArrowsSlice.h VolumeInterpolator.h VolumeRenderer.h ZincBlendeVolume.h Axis.h Chain.h
     325nanovisServer.o: nanovisServer.cpp nanovisServer.h config.h nanovis.h define.h Command.h ReadBuffer.h Shader.h Trace.h
  • nanovis/branches/1.1/PCASplit.cpp

    r3502 r4889  
    1212#include <newmatio.h>                // need matrix output routines
    1313#include <newmatrc.h>
    14 
    15 #include "PCASplit.h"
    16 
    17 using namespace vrmath;
    18 
    1914#ifdef use_namespace
    2015using namespace NEWMAT;              // access NEWMAT namespace
    2116#endif
    2217
     18#include "PCASplit.h"
     19#include "Trace.h"
     20
     21using namespace vrmath;
    2322using namespace PCA;
    2423
  • nanovis/branches/1.1/PCASplit.h

    r3502 r4889  
    44 *
    55 */
    6 #ifndef PCA_SPLIT_H
    7 #define PCA_SPLIT_H
     6#ifndef PCA_PCASPLIT_H
     7#define PCA_PCASPLIT_H
    88
    99#include <memory.h>
  • nanovis/branches/1.1/ParticleEmitter.cpp

    r3502 r4889  
    55 */
    66#include "ParticleEmitter.h"
     7
     8using namespace nv;
    79
    810ParticleEmitter::ParticleEmitter() :
  • nanovis/branches/1.1/ParticleEmitter.h

    r3502 r4889  
    44 *
    55 */
    6 #ifndef PARTICLEEMITTER_H
    7 #define PARTICLEEMITTER_H
     6#ifndef NV_PARTICLEEMITTER_H
     7#define NV_PARTICLEEMITTER_H
    88
    99#include <string>
     
    1111#include <vrmath/Vector3f.h>
    1212
     13namespace nv {
     14
    1315class ParticleEmitter
    1416{
    1517public:
    16    ParticleEmitter();
     18    ParticleEmitter();
    1719
    1820    void setName(const std::string& name);
     
    8486}
    8587
     88}
     89
    8690#endif
  • nanovis/branches/1.1/ParticleRenderer.cpp

    r3611 r4889  
    1919using namespace nv;
    2020
    21 NvParticleAdvectionShader *ParticleRenderer::_advectionShader = NULL;
     21ParticleAdvectionShader *ParticleRenderer::_advectionShader = NULL;
    2222ParticleAdvectionShaderInstance shaderInstance;
    2323
     
    103103
    104104    if (_advectionShader == NULL) {
    105         _advectionShader = new NvParticleAdvectionShader();
     105        _advectionShader = new ParticleAdvectionShader();
    106106    }
    107107}
  • nanovis/branches/1.1/ParticleRenderer.h

    r3611 r4889  
    1414#include <vrmath/Vector4f.h>
    1515
    16 #include "NvParticleAdvectionShader.h"
     16#include "ParticleAdvectionShader.h"
    1717#include "RenderVertexArray.h"
    1818
     
    8484    }
    8585
    86    static NvParticleAdvectionShader *_advectionShader;
     86   static ParticleAdvectionShader *_advectionShader;
    8787
    8888private:
  • nanovis/branches/1.1/ParticleSystem.cpp

    r3502 r4889  
    2727#include "ParticleSystem.h"
    2828#include "ParticleEmitter.h"
    29 #include "DataLoader.h"
    3029#include "Texture2D.h"
    3130#include "Texture3D.h"
    32 #include "NvShader.h"
     31#include "Shader.h"
    3332#include "Trace.h"
    3433
     34using namespace nv;
    3535using namespace nv::util;
    3636
     
    423423{
    424424    // TBD...
    425     _context = NvShader::getCgContext();
     425    _context = Shader::getCgContext();
    426426
    427427    std::string path = FilePath::getInstance()->getPath("distance.cg");
     
    987987
    988988        glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, _atlas_fbo);
    989         _streamVertices->Read(_atlasWidth, _atlasHeight);
     989        _streamVertices->read(_atlasWidth, _atlasHeight);
    990990        glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
    991991        _currentStreamlineIndex++;
     
    10961096
    10971097            glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, psys_fbo[_destPosIndex]);
    1098             _vertices->Read(_width, _height);
     1098            _vertices->read(_width, _height);
    10991099            glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
    11001100        } else {
    11011101            glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, psys_fbo[_currentPosIndex]);
    1102             _vertices->Read(_width, _height);
     1102            _vertices->read(_width, _height);
    11031103            glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
    11041104        }
     
    11101110            for (unsigned int k = 0; k < numOfNewParticles; ++k) {
    11111111                vrmath::Vector3f position = _emitters[i]->_position;
    1112                 position += _emitters[i]->_maxPositionOffset *
    1113                     vrmath::Vector3f(randomRange(-1.0f, 1.0f), randomRange(-1.0f, 1.0f), randomRange(-1.0f, 1.0f));
    1114 
     1112                position +=
     1113                    _emitters[i]->_maxPositionOffset.scale(vrmath::Vector3f(randomRange(-1.0f, 1.0f),
     1114                                                                            randomRange(-1.0f, 1.0f),
     1115                                                                            randomRange(-1.0f, 1.0f)));
    11151116                float lifetime = randomRange(_emitters[i]->_minLifeTime, _emitters[i]->_maxLifeTime);
    11161117
     
    15811582        //glEnableClientState(GL_COLOR_ARRAY);
    15821583
    1583         _streamVertices->SetPointer(0);
     1584        _streamVertices->setPointer(0);
    15841585        //glColorPointer(4, GL_FLOAT, 0, 0);
    15851586
     
    16531654            glEnableClientState(GL_VERTEX_ARRAY);
    16541655            //glEnableClientState(GL_COLOR_ARRAY);
    1655             _vertices->SetPointer(0);
     1656            _vertices->setPointer(0);
    16561657            //glBindBufferARB(GL_ARRAY_BUFFER, _colorBufferID);
    16571658            //glColorPointer(4, GL_FLOAT, 0, 0);
     
    16911692            glEnableClientState(GL_VERTEX_ARRAY);
    16921693            //glEnableClientState(GL_COLOR_ARRAY);
    1693             _vertices->SetPointer(0);
     1694            _vertices->setPointer(0);
    16941695            //glBindBufferARB(GL_ARRAY_BUFFER, _colorBufferID);
    16951696            //glColorPointer(4, GL_FLOAT, 0, 0);
     
    17181719            //glEnableClientState(GL_COLOR_ARRAY);
    17191720            glPointSize(10);
    1720             _vertices->SetPointer(0);
     1721            _vertices->setPointer(0);
    17211722            //glBindBufferARB(GL_ARRAY_BUFFER, _colorBufferID);
    17221723            //glColorPointer(4, GL_FLOAT, 0, 0);
     
    17251726
    17261727            glPointSize(1);
    1727             _vertices->SetPointer(0);
     1728            _vertices->setPointer(0);
    17281729            //glBindBufferARB(GL_ARRAY_BUFFER, _colorBufferID);
    17291730            //glColorPointer(4, GL_FLOAT, 0, 0);
  • nanovis/branches/1.1/ParticleSystem.h

    r3502 r4889  
    44 *
    55 */
    6 #ifndef PARTICLESYSTEM_H
    7 #define PARTICLESYSTEM_H
     6#ifndef NV_PARTICLESYSTEM_H
     7#define NV_PARTICLESYSTEM_H
    88
    99#include <vector>
     
    2323
    2424#include "CircularQueue.h"
     25
     26namespace nv {
    2527
    2628struct NewParticle {
     
    4749};
    4850
    49 namespace std
    50 {
    51     template <>
    52     struct greater<ActiveParticle> {
    53         bool operator() (const ActiveParticle& left, const ActiveParticle& right)
    54         {
    55             return left.timeOfDeath > right.timeOfDeath;
    56         }
    57     };
    58 }
     51struct particle_greater {
     52    bool operator() (const ActiveParticle& left, const ActiveParticle& right)
     53    {
     54        return (left.timeOfDeath > right.timeOfDeath);
     55    }
     56};
    5957
    6058struct color4 {
     
    171169
    172170    priority_queue_vector<int, std::greater<int> > _availableIndices;
    173     priority_queue_vector<ActiveParticle, std::greater<ActiveParticle> > _activeParticles;
     171    priority_queue_vector<ActiveParticle, particle_greater > _activeParticles;
    174172    std::vector<NewParticle> _newParticles;
    175173
     
    409407}
    410408
     409}
     410
    411411#endif
  • nanovis/branches/1.1/ParticleSystemFactory.cpp

    r3502 r4889  
    1515#include "Trace.h"
    1616
     17using namespace nv;
    1718using namespace nv::util;
    1819
  • nanovis/branches/1.1/ParticleSystemFactory.h

    r3502 r4889  
    44 *
    55 */
    6 #ifndef PARTICLESYSTEMFACTORY_H
    7 #define PARTICLESYSTEMFACTORY_H
     6#ifndef NV_PARTICLESYSTEMFACTORY_H
     7#define NV_PARTICLESYSTEMFACTORY_H
    88
    99#include <string>
    1010
    1111#include <expat.h>
     12
     13namespace nv {
    1214
    1315class ParticleSystem;
     
    3234};
    3335
     36}
     37
    3438#endif
  • nanovis/branches/1.1/PerfQuery.cpp

    r3502 r4889  
    1717
    1818#include "PerfQuery.h"
     19
     20using namespace nv;
    1921
    2022PerfQuery::PerfQuery()
  • nanovis/branches/1.1/PerfQuery.h

    r3502 r4889  
    1616 * ======================================================================
    1717 */
    18 #ifndef PERFQUERY_H
    19 #define PERFQUERY_H
     18#ifndef NV_PERFQUERY_H
     19#define NV_PERFQUERY_H
    2020
    2121#include <stdio.h>
     
    2424
    2525#include "Trace.h"
     26
     27namespace nv {
    2628
    2729class PerfQuery
     
    6870    }
    6971}
     72
     73}
     74
    7075#endif
    7176
  • nanovis/branches/1.1/Plane.h

    r3502 r4889  
    1414 * ======================================================================
    1515 */
    16 #ifndef PLANE_H
    17 #define PLANE_H
     16#ifndef NV_PLANE_H
     17#define NV_PLANE_H
    1818
    1919#include <vrmath/Vector3f.h>
  • nanovis/branches/1.1/PlaneRenderer.cpp

    r4612 r4889  
    11/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
    22/*
    3  * ----------------------------------------------------------------------
    4  * PlaneRenderer.cpp : PlaneRenderer class for volume visualization
    5  *
    6  * ======================================================================
    7  *  AUTHOR:  Wei Qiao <qiaow@purdue.edu>
    8  *           Purdue Rendering and Perceptualization Lab (PURPL)
    9  *
    103 *  Copyright (c) 2004-2013  HUBzero Foundation, LLC
    114 *
    12  *  See the file "license.terms" for information on usage and
    13  *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
    14  * ======================================================================
     5 *  Authors:
     6 *    Wei Qiao <qiaow@purdue.edu>
    157 */
    168
     
    2012#include "Trace.h"
    2113
     14using namespace nv;
     15
    2216PlaneRenderer::PlaneRenderer(int width, int height) :
    2317    _activePlane(-1),
     
    2519    _renderWidth(width),
    2620    _renderHeight(height),
    27     _shader(new NvColorTableShader())
     21    _shader(new ColorTableShader())
    2822{
    2923    _plane.clear();
  • nanovis/branches/1.1/PlaneRenderer.h

    r3502 r4889  
    11/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
    22/*
    3  * ----------------------------------------------------------------------
    4  * PlaneRenderer.h : PlaneRenderer class for 2D visualization
    5  *
    6  * ======================================================================
    7  *  AUTHOR:  Wei Qiao <qiaow@purdue.edu>
    8  *           Purdue Rendering and Perceptualization Lab (PURPL)
    9  *
    103 *  Copyright (c) 2004-2013  HUBzero Foundation, LLC
    114 *
    12  *  See the file "license.terms" for information on usage and
    13  *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
    14  * ======================================================================
     5 *  Authors:
     6 *    Wei Qiao <qiaow@purdue.edu>
    157 */
    16 #ifndef PLANE_RENDERER_H
    17 #define PLANE_RENDERER_H
     8#ifndef NV_PLANE_RENDERER_H
     9#define NV_PLANE_RENDERER_H
    1810
    1911#include <vector>
    2012
    21 #include "NvColorTableShader.h"
     13#include "ColorTableShader.h"
    2214#include "TransferFunction.h"
    2315#include "Texture2D.h"
     16
     17namespace nv {
    2418
    2519class PlaneRenderer
     
    5246    int _renderHeight; 
    5347
    54     NvColorTableShader *_shader;
     48    ColorTableShader *_shader;
    5549};
    5650
     51}
     52
    5753#endif
  • nanovis/branches/1.1/PointSet.cpp

    r3502 r4889  
    1212#include "PointSet.h"
    1313#include "PCASplit.h"
     14
     15using namespace nv;
    1416
    1517void
  • nanovis/branches/1.1/PointSet.h

    r3502 r4889  
    44 *
    55 */
    6 #ifndef POINT_SET_H
    7 #define POINT_SET_H
     6#ifndef NV_POINT_SET_H
     7#define NV_POINT_SET_H
    88
    99#include <vrmath/Vector3f.h>
     
    1111
    1212#include "PCASplit.h"
     13
     14namespace nv {
    1315
    1416class PointSet
     
    8789};
    8890
     91}
     92
    8993#endif
  • nanovis/branches/1.1/PointSetRenderer.cpp

    r3502 r4889  
    1414#include "PCASplit.h"
    1515
     16using namespace nv;
    1617using namespace nv::util;
     18using namespace vrmath;
     19using namespace PCA;
    1720
    1821#define USE_TEXTURE
     
    5053    delete loader;
    5154    delete image;
    52     _bucketSort = new PCA::BucketSort(1024);
     55    _bucketSort = new BucketSort(1024);
    5356}
    5457
     
    5760}
    5861
    59 void PointSetRenderer::renderPoints(PCA::Point *points, int length)
     62void PointSetRenderer::renderPoints(Point *points, int length)
    6063{
    61     PCA::Point *p = points;
     64    Point *p = points;
    6265    for (int i = 0; i < length; ++i, ++p) {
    6366        glColor4f(p->color.x, p->color.y, p->color.z, p->color.w);
     
    6669}
    6770
    68 void PointSetRenderer::renderCluster(PCA::ClusterList** bucket, int size, int level)
     71void PointSetRenderer::renderCluster(ClusterList** bucket, int size, int level)
    6972{
    7073    float quadratic[] = { 1.0f, 0.0f, 0.01f };
     
    8285    glBegin(GL_POINTS);
    8386
    84     PCA::ClusterList *p;
     87    ClusterList *p;
    8588    for (int i = size - 1; i >= 0; --i) {
    8689        p = bucket[i];
     
    107110}
    108111
    109 void PointSetRenderer::render(PCA::ClusterAccel *cluster, const Matrix4x4d& mat,
     112void PointSetRenderer::render(ClusterAccel *cluster, const Matrix4x4d& mat,
    110113                              int sortLevel, const Vector3f& scale, const Vector3f& origin)
    111114{
     
    130133    glPushMatrix();
    131134    float s = 1.0f / scale.x;
    132     Vector3 shift(origin.x + scale.x * 0.5, origin.x + scale.x * 0.5, origin.x + scale.x * 0.5);
     135    Vector3f shift(origin.x + scale.x * 0.5, origin.x + scale.x * 0.5, origin.x + scale.x * 0.5);
    133136    glScalef(s, scale.y / scale.x * s, scale.z / scale.x * s);
    134137
  • nanovis/branches/1.1/PointSetRenderer.h

    r3502 r4889  
    44 *
    55 */
    6 #ifndef POINT_SET_RENDERER_H
    7 #define POINT_SET_RENDERER_H
     6#ifndef NV_POINT_SET_RENDERER_H
     7#define NV_POINT_SET_RENDERER_H
    88
    99#include <vrmath/Vector3f.h>
     
    1414#include "PointShader.h"
    1515#include "Texture2D.h"
     16
     17namespace nv {
    1618
    1719class PointSetRenderer
     
    3436};
    3537
     38}
     39
    3640#endif
  • nanovis/branches/1.1/PointShader.cpp

    r3502 r4889  
    66#include "PointShader.h"
    77
     8using namespace nv;
     9
    810PointShader::PointShader() :
    9     NvShader(),
     11    Shader(),
    1012    _scale(1.0f),
    1113    _normal(NULL)
     
    2931    //setVPTextureParameter("normal", _normal->getGraphicsObjectID());
    3032
    31     NvShader::bind();
     33    Shader::bind();
    3234}
    3335
     
    3638    //disableVPTextureParameter("normal");
    3739
    38     NvShader::unbind();
     40    Shader::unbind();
    3941}
  • nanovis/branches/1.1/PointShader.h

    r3502 r4889  
    44 *
    55 */
    6 #ifndef POINTSHADER_H
    7 #define POINTSHADER_H
     6#ifndef NV_POINTSHADER_H
     7#define NV_POINTSHADER_H
    88
    9 #include "NvShader.h"
     9#include "Shader.h"
    1010#include "Texture3D.h"
    1111
    12 class PointShader : public NvShader
     12namespace nv {
     13
     14class PointShader : public Shader
    1315{
    1416public:
     
    3335private:
    3436    float _scale;
    35     float _scale;
    3637    Texture3D *_normal;
    3738};
    3839
     40}
     41
    3942#endif
  • nanovis/branches/1.1/ReaderCommon.cpp

    r3580 r4889  
    44 *
    55 */
     6
     7#include <cstdlib>
     8
     9#include <vrmath/Vector3f.h>
     10
    611#include "ReaderCommon.h"
    712#include "GradientFilter.h"
    813
    9 #include <vrmath/Vector3f.h>
    10 
    11 #include "stdlib.h"
    12 
     14using namespace nv;
    1315using namespace vrmath;
    1416
    1517float *
    16 merge(float *scalar, float *gradient, int size)
     18nv::merge(float *scalar, float *gradient, int size)
    1719{
    1820    float *data = (float *)malloc(sizeof(float) * 4 * size);
     
    4345 */
    4446void
    45 normalizeScalar(float *data, int count, int stride, double vmin, double vmax)
     47nv::normalizeScalar(float *data, int count, int stride, double vmin, double vmax)
    4648{
    4749    double dv = vmax - vmin;
     
    8284 */
    8385float *
    84 computeGradient(float *data,
    85                 int nx, int ny, int nz,
    86                 float dx, float dy, float dz,
    87                 float min, float max)
     86nv::computeGradient(float *data,
     87                    int nx, int ny, int nz,
     88                    float dx, float dy, float dz,
     89                    float min, float max)
    8890{
    8991    int npts = nx * ny * nz;
     
    123125 */
    124126void
    125 computeSimpleGradient(float *data,
    126                       int nx, int ny, int nz,
    127                       float dx, float dy, float dz)
     127nv::computeSimpleGradient(float *data,
     128                          int nx, int ny, int nz,
     129                          float dx, float dy, float dz)
    128130{
    129131    bool clampToEdge = true;
  • nanovis/branches/1.1/ReaderCommon.h

    r3574 r4889  
    44 *
    55 */
    6 #ifndef DX_READER_COMMON_H
    7 #define DX_READER_COMMON_H
     6#ifndef NV_READER_COMMON_H
     7#define NV_READER_COMMON_H
     8
     9namespace nv {
    810
    911extern float *
     
    2426                      float dx = 1.0f, float dy = 1.0f, float dz = 1.0f);
    2527
     28}
     29
    2630#endif
  • nanovis/branches/1.1/RenderVertexArray.cpp

    r3502 r4889  
    4242#include "RenderVertexArray.h"
    4343#include "Trace.h"
     44
     45using namespace nv;
    4446
    4547RenderVertexArray::RenderVertexArray(int nverts, GLint size, GLenum type) :
  • nanovis/branches/1.1/RenderVertexArray.h

    r3502 r4889  
    11/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
    22/*
    3  * ----------------------------------------------------------------------
    4  * Render to vertex array class
     3 * Copyright (c) 2004-2013  HUBzero Foundation, LLC
    54 *
    6  * ======================================================================
    7  *  AUTHOR:  Wei Qiao <qiaow@purdue.edu>
    8  *           Purdue Rendering and Perceptualization Lab (PURPL)
    9  *
    10  *  Copyright (c) 2004-2013  HUBzero Foundation, LLC
    11  *
    12  *  See the file "license.terms" for information on usage and
    13  *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
    14  * ======================================================================
     5 * Author:
     6 *   Wei Qiao <qiaow@purdue.edu>
    157 */
    16 #ifndef RENDERVERTEXARRAY_H
    17 #define RENDERVERTEXARRAY_H
     8#ifndef NV_RENDERVERTEXARRAY_H
     9#define NV_RENDERVERTEXARRAY_H
    1810
    1911#include <GL/glew.h>
    2012#include <GL/gl.h>
     13
     14namespace nv {
    2115
    2216class RenderVertexArray
     
    4438};
    4539
     40}
     41
    4642#endif
  • nanovis/branches/1.1/Switch.h

    r2877 r4889  
    2828 */
    2929
    30 #ifndef SWITCH_H
    31 #define SWITCH_H
     30#ifndef RAPPTURE_SWITCH_H
     31#define RAPPTURE_SWITCH_H
    3232
    3333#ifdef HAVE_STDDEF_H
     
    133133}
    134134
    135 #endif /* BLT_SWITCH_H */
     135#endif
  • nanovis/branches/1.1/Texture1D.cpp

    r3561 r4889  
    2121#include "Texture1D.h"
    2222#include "Trace.h"
     23
     24using namespace nv;
    2325
    2426Texture1D::Texture1D() :
  • nanovis/branches/1.1/Texture1D.h

    r3502 r4889  
    1414 * ======================================================================
    1515 */
    16 #ifndef TEXTURE1D_H
    17 #define TEXTURE1D_H
     16#ifndef NV_TEXTURE1D_H
     17#define NV_TEXTURE1D_H
    1818
    1919#include <GL/glew.h>
     20
     21namespace nv {
    2022
    2123class Texture1D
     
    6870};
    6971
     72}
     73
    7074#endif
  • nanovis/branches/1.1/Texture2D.cpp

    r3561 r4889  
    2222#include "Texture2D.h"
    2323#include "Trace.h"
     24
     25using namespace nv;
    2426
    2527Texture2D::Texture2D() :
  • nanovis/branches/1.1/Texture2D.h

    r3502 r4889  
    1414 * ======================================================================
    1515 */
    16 #ifndef TEXTURE2D_H
    17 #define TEXTURE2D_H
     16#ifndef NV_TEXTURE2D_H
     17#define NV_TEXTURE2D_H
    1818
    1919#include <GL/glew.h>
     20
     21namespace nv {
    2022
    2123class Texture2D
     
    7779};
    7880
     81}
     82
    7983#endif
  • nanovis/branches/1.1/Texture3D.cpp

    r3561 r4889  
    2222#include "Texture3D.h"
    2323#include "Trace.h"
     24
     25using namespace nv;
    2426
    2527Texture3D::Texture3D() :
  • nanovis/branches/1.1/Texture3D.h

    r3502 r4889  
    1414 * ======================================================================
    1515 */
    16 #ifndef TEXTURE3D_H
    17 #define TEXTURE3D_H
     16#ifndef NV_TEXTURE3D_H
     17#define NV_TEXTURE3D_H
    1818
    1919#include <GL/glew.h>
     20
     21namespace nv {
    2022
    2123class Texture3D
     
    8688};
    8789
     90}
     91
    8892#endif
  • nanovis/branches/1.1/TransferFunction.cpp

    r4819 r4889  
    2222#include "TransferFunction.h"
    2323
     24using namespace nv;
    2425using namespace vrmath;
    2526
  • nanovis/branches/1.1/TransferFunction.h

    r4819 r4889  
    1414 * ======================================================================
    1515 */
    16 #ifndef TRANSFER_FUNCTION_H
    17 #define TRANSFER_FUNCTION_H
     16#ifndef NV_TRANSFER_FUNCTION_H
     17#define NV_TRANSFER_FUNCTION_H
    1818
    1919#include <string>
     
    2222
    2323#include "Texture1D.h"
     24
     25namespace nv {
    2426
    2527class TransferFunction
     
    7880};
    7981
     82}
     83
    8084#endif
  • nanovis/branches/1.1/Unirect.h

    r4877 r4889  
    55 * Author: George A. Howlett <gah@purdue.edu>
    66 */
    7 #ifndef UNIRECT_H
    8 #define UNIRECT_H
     7#ifndef RAPPTURE_UNIRECT_H
     8#define RAPPTURE_UNIRECT_H
    99
    1010#include <float.h>
  • nanovis/branches/1.1/VelocityArrowsSlice.cpp

    r3502 r4889  
    1919#include "nanovis.h"
    2020#include "VelocityArrowsSlice.h"
    21 #include "NvShader.h"
    22 #include "NvCamera.h"
    23 
     21#include "Shader.h"
     22#include "Camera.h"
     23
     24using namespace nv;
    2425using namespace nv::util;
    2526using namespace vrmath;
     
    423424                                         tan(NanoVis::getCamera()->fov() * 0.5) * NanoVis::winHeight * 0.5);
    424425        _particleShader.setGLStateMatrixVPParameter("modelview",
    425                                                     NvShader::MODELVIEW_MATRIX,
    426                                                     NvShader::MATRIX_IDENTITY);
     426                                                    Shader::MODELVIEW_MATRIX,
     427                                                    Shader::MATRIX_IDENTITY);
    427428        _particleShader.setGLStateMatrixVPParameter("mvp",
    428                                                     NvShader::MODELVIEW_PROJECTION_MATRIX,
    429                                                     NvShader::MATRIX_IDENTITY);
     429                                                    Shader::MODELVIEW_PROJECTION_MATRIX,
     430                                                    Shader::MATRIX_IDENTITY);
    430431
    431432        glEnableClientState(GL_VERTEX_ARRAY);
  • nanovis/branches/1.1/VelocityArrowsSlice.h

    r3502 r4889  
    44 *
    55 */
    6 #ifndef VELOCITY_ARROW_SLICE_H
    7 #define VELOCITY_ARROW_SLICE_H
     6#ifndef NV_VELOCITY_ARROW_SLICE_H
     7#define NV_VELOCITY_ARROW_SLICE_H
    88
    99#include <vector>
     
    1212
    1313#include "Texture2D.h"
    14 #include "NvShader.h"
     14#include "Shader.h"
     15
     16namespace nv {
    1517
    1618class VelocityArrowsSlice
     
    103105    float _maxPointSize;
    104106
    105     NvShader _queryVelocityFP;
    106 
    107     NvShader _particleShader;
     107    Shader _queryVelocityFP;
     108    Shader _particleShader;
    108109
    109110    int _renderTargetWidth;
     
    135136};
    136137
     138}
     139
    137140#endif
  • nanovis/branches/1.1/Volume.cpp

    r4818 r4889  
    2424#include "Trace.h"
    2525
     26using namespace nv;
    2627using namespace vrmath;
    2728
  • nanovis/branches/1.1/Volume.h

    r4818 r4889  
    11/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
    22/*
    3  * ----------------------------------------------------------------------
    4  * Volume.h: 3d volume class
     3 * Copyright (c) 2004-2013  HUBzero Foundation, LLC
    54 *
    6  * ======================================================================
    7  *  AUTHOR:  Wei Qiao <qiaow@purdue.edu>
    8  *           Purdue Rendering and Perceptualization Lab (PURPL)
    9  *
    10  *  Copyright (c) 2004-2013  HUBzero Foundation, LLC
    11  *
    12  *  See the file "license.terms" for information on usage and
    13  *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
    14  * ======================================================================
     5 * Author:
     6 *   Wei Qiao <qiaow@purdue.edu>
    157 */
    16 #ifndef VOLUME_H
    17 #define VOLUME_H
     8#ifndef NV_VOLUME_H
     9#define NV_VOLUME_H
    1810
    1911#include <cstring>
     
    2618#include "AxisRange.h"
    2719#include "TransferFunction.h"
     20
     21namespace nv {
    2822
    2923struct CutPlane {
     
    479473}
    480474
     475}
     476
    481477#endif
  • nanovis/branches/1.1/VolumeInterpolator.cpp

    r4874 r4889  
    1616#include "Trace.h"
    1717
     18using namespace nv;
    1819using namespace vrmath;
    1920
  • nanovis/branches/1.1/VolumeInterpolator.h

    r3502 r4889  
    44 *
    55 */
    6 #ifndef VOLUME_INTERPOLATOR_H
    7 #define VOLUME_INTERPOLATOR_H
     6#ifndef NV_VOLUME_INTERPOLATOR_H
     7#define NV_VOLUME_INTERPOLATOR_H
    88
    99#include <vector>
    1010
    1111#include "Volume.h"
     12
     13namespace nv {
    1214
    1315class VolumeInterpolator
     
    6466}
    6567
     68}
     69
    6670#endif
    6771
  • nanovis/branches/1.1/VolumeRenderer.cpp

    r4818 r4889  
    2828#include "Plane.h"
    2929#include "ConvexPolygon.h"
    30 #include "NvStdVertexShader.h"
     30#include "StdVertexShader.h"
    3131#include "Trace.h"
    3232
     33using namespace nv;
    3334using namespace vrmath;
    3435
     
    5253void VolumeRenderer::initShaders()
    5354{
    54     _cutplaneShader = new NvShader();
     55    _cutplaneShader = new Shader();
    5556    _cutplaneShader->loadVertexProgram("cutplane_vp.cg", "main");
    5657    _cutplaneShader->loadFragmentProgram("cutplane_fp.cg", "main");
    5758
    5859    //standard vertex program
    59     _stdVertexShader = new NvStdVertexShader();
     60    _stdVertexShader = new StdVertexShader();
    6061
    6162    //volume rendering shader: one cubic volume
    62     _regularVolumeShader = new NvRegularVolumeShader();
     63    _regularVolumeShader = new RegularVolumeShader();
    6364
    6465    //volume rendering shader: one zincblende orbital volume.
     
    7071    //The engine is already capable of rendering multiple volumes and combine them. Thus, we just invoke this shader on
    7172    //S, P, D and SS orbitals with different transfor functions. The result is a multi-orbital rendering.
    72     _zincBlendeShader = new NvZincBlendeVolumeShader();
     73    _zincBlendeShader = new ZincBlendeVolumeShader();
    7374}
    7475
     
    286287            glScalef(volScaling.x, volScaling.y, volScaling.z);
    287288            _cutplaneShader->setGLStateMatrixVPParameter("modelViewProjMatrix",
    288                                                          NvShader::MODELVIEW_PROJECTION_MATRIX);
     289                                                         Shader::MODELVIEW_PROJECTION_MATRIX);
    289290            glPopMatrix();
    290291
  • nanovis/branches/1.1/VolumeRenderer.h

    r3502 r4889  
    11/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
    22/*
    3  * ----------------------------------------------------------------------
    4  * VolumeRenderer.h : VolumeRenderer class for volume visualization
     3 * Copyright (c) 2004-2013  HUBzero Foundation, LLC
    54 *
    6  * ======================================================================
    7  *  AUTHOR:  Wei Qiao <qiaow@purdue.edu>
    8  *           Purdue Rendering and Perceptualization Lab (PURPL)
    9  *
    10  *  Copyright (c) 2004-2013  HUBzero Foundation, LLC
    11  *
    12  *  See the file "license.terms" for information on usage and
    13  *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
    14  * ======================================================================
     5 * Authors:
     6 *   Wei Qiao <qiaow@purdue.edu>
    157 */
    16 #ifndef _VOLUME_RENDERER_H_
    17 #define _VOLUME_RENDERER_H_
     8#ifndef NV_VOLUME_RENDERER_H
     9#define NV_VOLUME_RENDERER_H
    1810
    1911#include <vrmath/Matrix4x4d.h>
     
    2113#include "Volume.h"
    2214#include "VolumeInterpolator.h"
    23 #include "NvRegularVolumeShader.h"
    24 #include "NvZincBlendeVolumeShader.h"
    25 #include "NvStdVertexShader.h"
     15#include "RegularVolumeShader.h"
     16#include "ZincBlendeVolumeShader.h"
     17#include "StdVertexShader.h"
     18
     19namespace nv {
    2620
    2721class VolumeRenderer
     
    8579     * Shader for single slice cutplane render
    8680     */
    87     NvShader *_cutplaneShader;
     81    Shader *_cutplaneShader;
    8882
    8983    /**
    9084     * Shader for rendering a single cubic volume
    9185     */
    92     NvRegularVolumeShader *_regularVolumeShader;
     86    RegularVolumeShader *_regularVolumeShader;
    9387
    9488    /**
     
    106100     * same space.
    107101     */
    108     NvZincBlendeVolumeShader *_zincBlendeShader;
     102    ZincBlendeVolumeShader *_zincBlendeShader;
    109103
    110104    /**
    111105     * standard vertex shader
    112106     */
    113     NvStdVertexShader *_stdVertexShader;
     107    StdVertexShader *_stdVertexShader;
    114108};
    115109
     110}
     111
    116112#endif
  • nanovis/branches/1.1/VtkReader.cpp

    r4612 r4889  
    2020#include "Volume.h"
    2121#include "Trace.h"
     22
     23using namespace nv;
    2224
    2325enum FieldType {
     
    181183
    182184Volume *
    183 load_vtk_volume_stream(Rappture::Outcome& result, const char *tag, std::iostream& fin)
     185nv::load_vtk_volume_stream(Rappture::Outcome& result, const char *tag, std::iostream& fin)
    184186{
    185187    TRACE("Enter tag:%s", tag);
  • nanovis/branches/1.1/VtkReader.h

    r3503 r4889  
    44 *
    55 */
    6 #ifndef VTKREADER_H
    7 #define VTKREADER_H
     6#ifndef NV_VTKREADER_H
     7#define NV_VTKREADER_H
    88
    99#include <iostream>
    1010
    1111namespace Rappture {
    12     class Outcome;
     12class Outcome;
    1313}
     14
     15namespace nv {
     16
    1417class Volume;
    1518
     
    1720load_vtk_volume_stream(Rappture::Outcome& status, const char *tag, std::iostream& fin);
    1821
     22}
     23
    1924#endif
  • nanovis/branches/1.1/ZincBlendeReconstructor.cpp

    r3611 r4889  
    66 *   Insoo Woo <iwoo@purdue.edu>
    77 */
    8 #include <stdio.h>
    9 #include <string.h>
    10 #include <stdlib.h>
     8#include <cstdio>
     9#include <cstring>
     10#include <cstdlib>
     11#include <fstream>
    1112
    1213#include <vrmath/Vector3f.h>
     
    372373
    373374ZincBlendeVolume *
    374 ZincBlendeReconstructor::loadFromMemory(void *dataBlock)
     375ZincBlendeReconstructor::loadFromMemory(const void *dataBlock)
    375376{
    376377    ZincBlendeVolume *volume = NULL;
     
    380381    int version = 1;
    381382
    382     unsigned char *stream = (unsigned char *)dataBlock;
     383    const unsigned char *stream = (const unsigned char *)dataBlock;
    383384    char str[5][20];
    384385    do {
     
    472473}
    473474
    474 void ZincBlendeReconstructor::getLine(unsigned char*& stream)
     475void ZincBlendeReconstructor::getLine(const unsigned char*& stream)
    475476{
    476477    char ch;
  • nanovis/branches/1.1/ZincBlendeReconstructor.h

    r3611 r4889  
    99#define NV_ZINC_BLENDE_RECONSTRUCTOR_H
    1010
    11 #include <stdio.h>
    12 #include <ostream>
    13 #include <sstream>
    14 #include <fstream>
     11#include <istream>
    1512
    1613#include <vrmath/Vector3f.h>
     
    3532    ZincBlendeVolume *loadFromStream(std::istream& stream);
    3633
    37     ZincBlendeVolume *loadFromMemory(void *dataBlock);
     34    ZincBlendeVolume *loadFromMemory(const void *dataBlock);
    3835
    3936    /**
     
    6764     */
    6865    void getLine(std::istream& stream);
    69     void getLine(unsigned char*& stream);
     66    void getLine(const unsigned char*& stream);
    7067
    7168    char buff[255];
  • nanovis/branches/1.1/ZincBlendeVolume.cpp

    r3502 r4889  
    2121#include "ZincBlendeVolume.h"
    2222
     23using namespace nv;
    2324using namespace vrmath;
    2425
  • nanovis/branches/1.1/ZincBlendeVolume.h

    r3502 r4889  
    11/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
    22/*
    3  * ----------------------------------------------------------------------
    4  * ZincBlendeVolume.h: 3d zincblende volume class, a subclass of Volume.
    5  *                      It contains two cubic volumes.
     3 * Copyright (c) 2004-2013  HUBzero Foundation, LLC
    64 *
    7  * ======================================================================
    8  *  AUTHOR:  Wei Qiao <qiaow@purdue.edu>
    9  *           Purdue Rendering and Perceptualization Lab (PURPL)
    10  *
    11  *  Copyright (c) 2004-2013  HUBzero Foundation, LLC
    12  *
    13  *  See the file "license.terms" for information on usage and
    14  *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
    15  * ======================================================================
     5 * Authors:
     6 *   Wei Qiao <qiaow@purdue.edu>
    167 */
    17 #ifndef _ZINCBLENDE_VOLUME_H_
    18 #define _ZINCBLENDE_VOLUME_H_
     8#ifndef NV_ZINCBLENDE_VOLUME_H
     9#define NV_ZINCBLENDE_VOLUME_H
    1910
    2011#include <vrmath/Vector3f.h>
     
    2213#include "Volume.h"
    2314
     15namespace nv {
     16
     17/**
     18 * \brief 3D ZincBlende volume, contains two cubic volumes
     19 */
    2420class ZincBlendeVolume : public Volume
    2521{
     
    3632};
    3733
     34}
     35
    3836#endif
  • nanovis/branches/1.1/dxReader.cpp

    r4821 r4889  
    3939#include "config.h"
    4040#include "nanovis.h"
     41#include "dxReader.h"
    4142#include "Unirect.h"
    4243#include "Volume.h"
    43 #include "ZincBlendeVolume.h"
    44 #include "NvZincBlendeReconstructor.h"
     44
     45using namespace nv;
    4546
    4647/**
     
    5758 */
    5859Volume *
    59 load_dx_volume_stream(Rappture::Outcome& result, const char *tag,
    60                       std::iostream& fin)
     60nv::load_dx_volume_stream(Rappture::Outcome& result, const char *tag,
     61                          std::iostream& fin)
    6162{
    6263    TRACE("Enter tag:%s", tag);
  • nanovis/branches/1.1/dxReader.h

    r3502 r4889  
    1010
    1111namespace Rappture {
    12     class Outcome;
     12class Outcome;
    1313}
     14
     15namespace nv {
     16
    1417class Volume;
    1518
     
    1821                      std::iostream& fin);
    1922
     23}
     24
    2025#endif
  • nanovis/branches/1.1/nanovis.cpp

    r4879 r4889  
    4949#include "Grid.h"
    5050#include "HeightMap.h"
    51 #include "NvCamera.h"
    52 #include "NvLIC.h"
    53 #include "NvShader.h"
     51#include "Camera.h"
     52#include "LIC.h"
     53#include "Shader.h"
    5454#include "PlaneRenderer.h"
    5555#include "Texture2D.h"
     
    8484Fonts *NanoVis::fonts;
    8585int NanoVis::updir = Y_POS;
    86 NvCamera *NanoVis::cam = NULL;
     86Camera *NanoVis::cam = NULL;
    8787RenderContext *NanoVis::renderContext = NULL;
    8888
     
    106106VolumeRenderer *NanoVis::volRenderer = NULL;
    107107VelocityArrowsSlice *NanoVis::velocityArrowsSlice = NULL;
    108 NvLIC *NanoVis::licRenderer = NULL;
     108LIC *NanoVis::licRenderer = NULL;
    109109PlaneRenderer *NanoVis::planeRenderer = NULL;
    110110Grid *NanoVis::grid = NULL;
     
    466466void cgErrorCallback(void)
    467467{
    468     if (!NvShader::printErrorInfo()) {
     468    if (!Shader::printErrorInfo()) {
    469469        TRACE("Cg error, exiting...");
    470470        exit(1);
     
    541541    ImageLoaderFactory::getInstance()->addLoaderImpl("bmp", new BMPImageLoaderImpl());
    542542
    543     NvShader::initCg();
    544     NvShader::setErrorCallback(cgErrorCallback);
     543    Shader::initCg();
     544    Shader::setErrorCallback(cgErrorCallback);
    545545
    546546    fonts = new Fonts();
     
    549549
    550550    velocityArrowsSlice = new VelocityArrowsSlice;
    551     licRenderer = new NvLIC(NMESH, NPIX, NPIX, _licAxis, _licSlice);
     551    licRenderer = new LIC(NMESH, NPIX, NPIX, _licAxis, _licSlice);
    552552
    553553    grid = new Grid();
     
    570570
    571571    //create the camera with default setting
    572     cam = new NvCamera(0, 0, winWidth, winHeight,
    573                        def_eye_x, def_eye_y, def_eye_z);
     572    cam = new Camera(0, 0, winWidth, winHeight,
     573                     def_eye_x, def_eye_y, def_eye_z);
    574574
    575575    glEnable(GL_TEXTURE_2D);
  • nanovis/branches/1.1/nanovis.h

    r4886 r4889  
    4040    class Fonts;
    4141}
    42 }
    4342
    44 class NvCamera;
     43class Camera;
    4544class Flow;
    4645class Grid;
    4746class HeightMap;
    48 class NvLIC;
    49 class NvParticleRenderer;
     47class LIC;
    5048class PlaneRenderer;
    5149class Texture2D;
     
    9189    static void removeAllData();
    9290
    93     static const NvCamera *getCamera()
     91    static const Camera *getCamera()
    9492    {
    9593        return cam;
     
    156154    static unsigned char *screenBuffer;
    157155    static Texture2D *legendTexture;
    158     static nv::util::Fonts *fonts;
     156    static util::Fonts *fonts;
    159157    static int updir;
    160     static NvCamera *cam;
    161     static nv::graphics::RenderContext *renderContext;
     158    static Camera *cam;
     159    static graphics::RenderContext *renderContext;
    162160
    163161    static TransferFunctionHashmap tfTable; ///< maps transfunc name to TransferFunction object
     
    172170    static VolumeRenderer *volRenderer;
    173171    static VelocityArrowsSlice *velocityArrowsSlice;
    174     static NvLIC *licRenderer;
     172    static LIC *licRenderer;
    175173    static PlaneRenderer *planeRenderer;
    176174    static Grid *grid;
     
    186184};
    187185
     186}
     187
    188188#endif
  • nanovis/branches/1.1/nanovisServer.cpp

    r4883 r4889  
    3636#include "Command.h"
    3737#include "ReadBuffer.h"
    38 #include "NvShader.h"
     38#include "Shader.h"
    3939#include "Trace.h"
    4040
     
    334334    NanoVis::removeAllData();
    335335
    336     NvShader::exitCg();
     336    Shader::exitCg();
    337337
    338338    //close log file
     
    493493void shaderErrorCallback(void)
    494494{
    495     if (!NvShader::printErrorInfo()) {
     495    if (!Shader::printErrorInfo()) {
    496496        TRACE("Shader error, exiting...");
    497497        exitService(1);
     
    574574    TRACE("File descriptors: in %d out %d log %d", g_fdIn, g_fdOut, fileno(g_fLog));
    575575
     576    /* This synchronizes the client with the server, so that the client
     577     * doesn't start writing commands before the server is ready. It could
     578     * also be used to supply information about the server (version, memory
     579     * size, etc). */
    576580    fprintf(g_fOut, "NanoVis %s (build %s)\n", NANOVIS_VERSION_STRING, SVN_VERSION);
    577581    fflush(g_fOut);
     
    634638
    635639    // Override callback with one that cleans up server on exit
    636     NvShader::setErrorCallback(shaderErrorCallback);
     640    Shader::setErrorCallback(shaderErrorCallback);
    637641
    638642    if (!NanoVis::initGL()) {
  • nanovis/branches/1.1/vrmath/include/vrmath/Vector3f.h

    r3567 r4889  
    4848    Vector3f normalize() const;
    4949
    50     Vector3f scale(Vector3f& sc) const;
     50    Vector3f scale(const Vector3f& sc) const;
    5151
    5252    Vector3f scale(float scale) const;
     
    236236}
    237237
    238 inline Vector3f Vector3f::scale(Vector3f& sc) const
     238inline Vector3f Vector3f::scale(const Vector3f& sc) const
    239239{
    240240    return Vector3f(x * sc.x, y * sc.y, z * sc.z);
Note: See TracChangeset for help on using the changeset viewer.