Changeset 3463


Ignore:
Timestamp:
Mar 6, 2013, 11:39:42 AM (7 years ago)
Author:
ldelgass
Message:

Begin process of renaming R2 library

Location:
trunk/packages/vizservers/nanovis
Files:
1 deleted
33 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/nanovis/Command.cpp

    r3452 r3463  
    6868#include "Volume.h"
    6969#include "VolumeRenderer.h"
     70
     71using namespace nv::graphics;
    7072
    7173// default transfer function
     
    137139static int
    138140GetCullMode(Tcl_Interp *interp, Tcl_Obj *objPtr,
    139             graphics::RenderContext::CullMode *modePtr)
     141            RenderContext::CullMode *modePtr)
    140142{
    141143    const char *string = Tcl_GetString(objPtr);
    142144    if (strcmp(string, "none") == 0) {
    143         *modePtr = graphics::RenderContext::NO_CULL;
     145        *modePtr = RenderContext::NO_CULL;
    144146    } else if (strcmp(string, "front") == 0) {
    145         *modePtr = graphics::RenderContext::FRONT;
     147        *modePtr = RenderContext::FRONT;
    146148    } else if (strcmp(string, "back") == 0) {
    147         *modePtr = graphics::RenderContext::BACK;
     149        *modePtr = RenderContext::BACK;
    148150    } else {
    149151        Tcl_AppendResult(interp, "invalid cull mode \"", string,
     
    156158static int
    157159GetShadingModel(Tcl_Interp *interp, Tcl_Obj *objPtr,
    158                 graphics::RenderContext::ShadingModel *modelPtr)
     160                RenderContext::ShadingModel *modelPtr)
    159161{
    160162    const char *string = Tcl_GetString(objPtr);
    161163
    162164    if (strcmp(string,"flat") == 0) {
    163         *modelPtr = graphics::RenderContext::FLAT;
     165        *modelPtr = RenderContext::FLAT;
    164166    } else if (strcmp(string,"smooth") == 0) {
    165         *modelPtr = graphics::RenderContext::SMOOTH;
     167        *modelPtr = RenderContext::SMOOTH;
    166168    } else {
    167169        Tcl_AppendResult(interp, "bad shading model \"", string,
     
    174176static int
    175177GetPolygonMode(Tcl_Interp *interp, Tcl_Obj *objPtr,
    176                graphics::RenderContext::PolygonMode *modePtr)
     178               RenderContext::PolygonMode *modePtr)
    177179{
    178180    const char *string = Tcl_GetString(objPtr);
    179181
    180182    if (strcmp(string,"wireframe") == 0) {
    181         *modePtr = graphics::RenderContext::LINE;
     183        *modePtr = RenderContext::LINE;
    182184    } else if (strcmp(string,"fill") == 0) {
    183         *modePtr = graphics::RenderContext::FILL;
     185        *modePtr = RenderContext::FILL;
    184186    } else {
    185187        Tcl_AppendResult(interp, "invalid polygon mode \"", string,
     
    18491851                Tcl_Obj *const *objv)
    18501852{
    1851     graphics::RenderContext::CullMode mode;
     1853    RenderContext::CullMode mode;
    18521854    if (GetCullMode(interp, objv[2], &mode) != TCL_OK) {
    18531855        return TCL_ERROR;
     
    19191921                   Tcl_Obj *const *objv)
    19201922{
    1921     graphics::RenderContext::PolygonMode mode;
     1923    RenderContext::PolygonMode mode;
    19221924    if (GetPolygonMode(interp, objv[2], &mode) != TCL_OK) {
    19231925        return TCL_ERROR;
     
    19321934                 Tcl_Obj *const *objv)
    19331935{
    1934     graphics::RenderContext::ShadingModel model;
     1936    RenderContext::ShadingModel model;
    19351937    if (GetShadingModel(interp, objv[2], &model) != TCL_OK) {
    19361938        return TCL_ERROR;
  • trunk/packages/vizservers/nanovis/ContourLineFilter.cpp

    r2827 r3463  
    1414#include "ContourLineFilter.h"
    1515
     16using namespace nv::graphics;
     17
    1618ContourLineFilter::ContourLineFilter()
    1719    : _colorMap(0), _top(false)
     
    3032}
    3133
    32 R2Geometry*
     34Geometry *
    3335ContourLineFilter::create(float min, float max, int linecount,
    3436                          Vector3* vertices, int width, int height)
     
    7072        }
    7173    }
    72     R2VertexBuffer* vertexBuffer;
    73     vertexBuffer = new R2VertexBuffer(R2VertexBuffer::POSITION3, totalPoints,
    74         totalPoints * sizeof(Vector3), vertexSet, false);
    75     R2VertexBuffer* colorBuffer = NULL;
     74    VertexBuffer *vertexBuffer =
     75        new VertexBuffer(VertexBuffer::POSITION3, totalPoints,
     76                         totalPoints * sizeof(Vector3), vertexSet, false);
     77    VertexBuffer *colorBuffer = NULL;
    7678    if (_colorMap) {
    77         colorBuffer  = new R2VertexBuffer(R2VertexBuffer::COLOR4, totalPoints,
    78                 totalPoints * sizeof(Vector3), colorSet, false);
    79     }
    80     R2Geometry* geometry;
    81     geometry = new R2Geometry(R2Geometry::LINES, vertexBuffer, colorBuffer, 0);
     79        colorBuffer =
     80            new VertexBuffer(VertexBuffer::COLOR4, totalPoints,
     81                             totalPoints * sizeof(Vector3), colorSet, false);
     82    }
     83    Geometry *geometry = new Geometry(Geometry::LINES, vertexBuffer, colorBuffer, 0);
    8284    clear();
    8385    return geometry;
    8486}
    8587
    86 R2Geometry*
     88Geometry *
    8789ContourLineFilter::create(float min, float max, int linecount,
    8890                          Vector4* vertices, int width, int height)
     
    124126        }
    125127    }
    126     R2VertexBuffer* vertexBuffer;
    127     vertexBuffer = new R2VertexBuffer(R2VertexBuffer::POSITION3, totalPoints,
    128         totalPoints * sizeof(Vector3), vertexSet, false);
    129     R2VertexBuffer* colorBuffer;
    130     colorBuffer = new R2VertexBuffer(R2VertexBuffer::COLOR4, totalPoints,
    131         totalPoints * sizeof(Vector3), colorSet, false);
    132     R2Geometry* geometry;
    133     geometry = new R2Geometry(R2Geometry::LINES, vertexBuffer, colorBuffer, 0);
     128    VertexBuffer *vertexBuffer =
     129        new VertexBuffer(VertexBuffer::POSITION3, totalPoints,
     130                         totalPoints * sizeof(Vector3), vertexSet, false);
     131    VertexBuffer *colorBuffer =
     132        new VertexBuffer(VertexBuffer::COLOR4, totalPoints,
     133                         totalPoints * sizeof(Vector3), colorSet, false);
     134    Geometry *geometry =
     135        new Geometry(Geometry::LINES, vertexBuffer, colorBuffer, 0);
    134136    clear();
    135137    return geometry;
  • trunk/packages/vizservers/nanovis/ContourLineFilter.h

    r2877 r3463  
    4141    ContourLineFilter();
    4242
    43     R2Geometry *create(float min, float max, int linecount, Vector3 *vertices, int width, int height);
    44     R2Geometry *create(float min, float max, int linecount, Vector4 *vertices, int width, int height);
     43    nv::graphics::Geometry *create(float min, float max, int linecount, Vector3 *vertices, int width, int height);
     44    nv::graphics::Geometry *create(float min, float max, int linecount, Vector4 *vertices, int width, int height);
    4545
    4646    void setColorMap(Vector3Array *colorMap);
  • trunk/packages/vizservers/nanovis/Grid.cpp

    r3452 r3463  
    88#include "Grid.h"
    99#include "Trace.h"
     10
     11using namespace nv::util;
    1012
    1113#define NUMDIGITS       6
     
    246248}
    247249
    248 void Grid::setFont(R2Fonts *font)
     250void Grid::setFont(Fonts *font)
    249251{
    250252//    if (font == _font) return;
  • trunk/packages/vizservers/nanovis/Grid.h

    r2953 r3463  
    5858    void render();
    5959
    60     void setFont(R2Fonts *font);
     60    void setFont(nv::util::Fonts *font);
    6161
    6262    Axis xAxis;
     
    6666private:
    6767    RGBA _axisColor, _majorColor, _minorColor;
    68     R2Fonts *_font;
     68    nv::util::Fonts *_font;
    6969    bool _visible;
    7070};
  • trunk/packages/vizservers/nanovis/HeightMap.cpp

    r3452 r3463  
    1111double HeightMap::valueMin = 0.0;
    1212double HeightMap::valueMax = 1.0;
     13
     14using namespace nv::graphics;
    1315
    1416HeightMap::HeightMap() :
     
    4547
    4648void
    47 HeightMap::render(graphics::RenderContext *renderContext)
     49HeightMap::render(RenderContext *renderContext)
    4850{
    4951    glPushAttrib(GL_ENABLE_BIT | GL_POLYGON_BIT | GL_LIGHTING_BIT);
    5052
    51     if (renderContext->getCullMode() == graphics::RenderContext::NO_CULL) {
     53    if (renderContext->getCullMode() == RenderContext::NO_CULL) {
    5254        glDisable(GL_CULL_FACE);
    5355    } else {
  • trunk/packages/vizservers/nanovis/HeightMap.h

    r3362 r3463  
    1010#include "RenderContext.h"
    1111#include "AxisRange.h"
    12 
    13 namespace graphics {
    14     class RenderContext;
    15 }
    1612
    1713class Grid;
     
    2723    ~HeightMap();
    2824
    29     void render(graphics::RenderContext *renderContext);
     25    void render(nv::graphics::RenderContext *renderContext);
    3026
    3127    /**
     
    125121    unsigned int _texcoordBufferObjectID;
    126122    int _vertexCount;
    127     R2Geometry *_contour;
     123    nv::graphics::Geometry *_contour;
    128124    TransferFunction *_tfPtr;
    129125    float _opacity;
  • trunk/packages/vizservers/nanovis/NvColorTableRenderer.cpp

    r2958 r3463  
    77
    88#include "NvColorTableRenderer.h"
     9
     10using namespace nv::util;
    911
    1012NvColorTableRenderer::NvColorTableRenderer() :
  • trunk/packages/vizservers/nanovis/NvColorTableRenderer.h

    r2863 r3463  
    1717    void render(int width, int height,
    1818                Texture2D *texture, TransferFunction *tf,
    19                 double rangeMin, double rageMax);
     19                double rangeMin, double rangeMax);
    2020
    21     void setFonts(R2Fonts *fonts)
     21    void setFonts(nv::util::Fonts *fonts)
    2222    {
    2323        _fonts = fonts;
     
    2525
    2626private:
    27     R2Fonts *_fonts;
     27    nv::util::Fonts *_fonts;
    2828    NvColorTableShader *_shader;
    2929};
  • trunk/packages/vizservers/nanovis/NvShader.cpp

    r3452 r3463  
    1010#include "NvShader.h"
    1111#include "Trace.h"
     12
     13using namespace nv::util;
    1214
    1315CGprofile NvShader::_defaultVertexProfile = CG_PROFILE_VP40;
     
    5254                              CGprofile profile, const char *entryPoint)
    5355{
    54     std::string path = R2FilePath::getInstance()->getPath(fileName);
     56    std::string path = FilePath::getInstance()->getPath(fileName);
    5557    if (path.empty()) {
    5658        ERROR("can't find program \"%s\"", fileName);
  • trunk/packages/vizservers/nanovis/ParticleSystem.cpp

    r3453 r3463  
    2929#include "Trace.h"
    3030
     31using namespace nv::util;
     32
    3133#define USE_RGBA_ARROW
    3234
     
    8486            if (tail != -1) {
    8587                sprintf(buff, fileNameFormat, curIndex);
    86                 //std::string path = R2FilePath::getInstance()->getPath(buff);
     88                //std::string path = FilePath::getInstance()->getPath(buff);
    8789#ifdef WANT_TRACE
    8890                float t = clock() /(float) CLOCKS_PER_SEC;
     
    285287    }
    286288
    287     std::string path = R2FilePath::getInstance()->getPath("arrows.bmp");
     289    std::string path = FilePath::getInstance()->getPath("arrows.bmp");
    288290
    289291    if (!path.empty()) {
     
    419421    _context = NvShader::getCgContext();
    420422
    421     std::string path = R2FilePath::getInstance()->getPath("distance.cg");
     423    std::string path = FilePath::getInstance()->getPath("distance.cg");
    422424    _distanceInitFP = 
    423425        cgCreateProgramFromFile(_context, CG_SOURCE, path.c_str(),
     
    436438    cgGLLoadProgram(_distanceSortLookupFP);
    437439
    438     path = R2FilePath::getInstance()->getPath("mergesort.cg");
     440    path = FilePath::getInstance()->getPath("mergesort.cg");
    439441    _sortRecursionFP =
    440442        cgCreateProgramFromFile(_context, CG_SOURCE, path.c_str(),
     
    454456    _seStepParam = cgGetNamedParameter(_sortEndFP, "step");
    455457
    456     path = R2FilePath::getInstance()->getPath("passthrough.cg");
     458    path = FilePath::getInstance()->getPath("passthrough.cg");
    457459    _passthroughFP =
    458460        cgCreateProgramFromFile(_context, CG_SOURCE, path.c_str(),
     
    463465    _biasParam = cgGetNamedParameter(_passthroughFP, "bias");
    464466
    465     path = R2FilePath::getInstance()->getPath("moveparticles.cg");
     467    path = FilePath::getInstance()->getPath("moveparticles.cg");
    466468    _moveParticlesFP =
    467469        cgCreateProgramFromFile(_context, CG_SOURCE, path.c_str(),
     
    475477    _mpScale= cgGetNamedParameter(_moveParticlesFP, "scale");
    476478
    477     path = R2FilePath::getInstance()->getPath("particlevp.cg");
     479    path = FilePath::getInstance()->getPath("particlevp.cg");
    478480    _particleVP =
    479481        cgCreateProgramFromFile(_context, CG_SOURCE, path.c_str(),
     
    485487    _mvCurrentTimeParam =  cgGetNamedParameter(_particleVP, "currentTime");
    486488
    487     path = R2FilePath::getInstance()->getPath("particlefp.cg");
     489    path = FilePath::getInstance()->getPath("particlefp.cg");
    488490    _particleFP =
    489491        cgCreateProgramFromFile(_context, CG_SOURCE, path.c_str(),
     
    492494    _vectorParticleParam = cgGetNamedParameter(_particleVP, "vfield");
    493495
    494     path = R2FilePath::getInstance()->getPath("moveparticles.cg");
     496    path = FilePath::getInstance()->getPath("moveparticles.cg");
    495497    _initParticlePosFP =
    496498        cgCreateProgramFromFile(_context, CG_SOURCE, path.c_str(),
  • trunk/packages/vizservers/nanovis/ParticleSystemFactory.cpp

    r3452 r3463  
    1010#include "ParticleSystem.h"
    1111#include "Trace.h"
     12
     13using namespace nv::util;
    1214
    1315#define BUFSIZE 4096
     
    144146        char buff[256];
    145147        sprintf(buff, fileName.c_str(), startIndex);
    146         std::string path = R2FilePath::getInstance()->getPath(buff);
     148        std::string path = FilePath::getInstance()->getPath(buff);
    147149        if (path.size()) {
    148150            std::string dir;
     
    169171        }
    170172    } else {
    171         std::string path = R2FilePath::getInstance()->getPath(fileName.c_str());
     173        std::string path = FilePath::getInstance()->getPath(fileName.c_str());
    172174        _newParticleSystem =
    173175            new ParticleSystem(width, height, path.c_str(),
  • trunk/packages/vizservers/nanovis/PointSetRenderer.cpp

    r3452 r3463  
    1010#include "PCASplit.h"
    1111
     12using namespace nv::util;
     13
    1214#define USE_TEXTURE
    1315//#define USE_SHADER
     
    1719{
    1820    _shader = new PointShader();
    19     std::string path = R2FilePath::getInstance()->getPath("particle2.bmp");
     21    std::string path = FilePath::getInstance()->getPath("particle2.bmp");
    2022    if (path.empty()) {
    2123        ERROR("Particle image not found");
  • trunk/packages/vizservers/nanovis/R2/include/R2/R2FilePath.h

    r2972 r3463  
    11/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
    2 #ifndef R2_FILE_PATH_H
    3 #define R2_FILE_PATH_H
     2#ifndef NV_UTIL_FILE_PATH_H
     3#define NV_UTIL_FILE_PATH_H
    44
    55#include <list>
    66#include <string>
    77
    8 class R2FilePath
     8namespace nv {
     9namespace util {
     10
     11class FilePath
    912{
    1013public:
    11     R2FilePath();
     14    FilePath();
    1215
    1316    /**
     
    2629    void setWorkingDirectory(int argc, const char **argv);
    2730
    28     /// get R2FilePath instance
    29     static R2FilePath *getInstance();
     31    /// get FilePath instance
     32    static FilePath *getInstance();
    3033
    3134private:
     
    3639    static std::string _curDirectory;
    3740
    38     /// R2FilePath instance
    39     static R2FilePath _instance;
     41    /// FilePath instance
     42    static FilePath _instance;
    4043
    4144    /// all default file paths
     
    4346};
    4447
     48}
     49}
     50
    4551#endif
    4652
  • trunk/packages/vizservers/nanovis/R2/include/R2/R2Fonts.h

    r2972 r3463  
    11/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
    2 #ifndef R2_FONTS_H
    3 #define R2_FONTS_H
     2#ifndef NV_UTIL_FONTS_H
     3#define NV_UTIL_FONTS_H
    44
    55#include <vector>
    66#include <string>
    77
    8 #include <R2/R2.h>
    98#include <R2/R2Object.h>
    109
    11 class R2Fonts : public R2Object
     10namespace nv {
     11namespace util {
     12
     13class Fonts : public Object
    1214{
    13     struct R2FontAttributes {
     15    struct FontAttributes {
    1416        std::string _fontName;
    1517        int _textureWidth;
     
    1921        unsigned int _displayLists;
    2022
    21         struct R2CharInfo {
     23        struct CharInfo {
    2224            float _left;
    2325            float _right;
     
    2729            float _width;
    2830        };
    29         R2CharInfo _chars[256];
     31        CharInfo _chars[256];
    3032    };
    3133
    32     typedef std::vector<R2FontAttributes>  R2FontVector;
     34    typedef std::vector<FontAttributes>  FontVector;
    3335
    3436public:
    35     R2Fonts();
     37    Fonts();
    3638
    3739    /// set projection to orthographic
     
    4143    void end();
    4244
    43     /// initialize R2FontAttributes
    44     void initializeFont(R2FontAttributes& attr);
     45    /// initialize FontAttributes
     46    void initializeFont(FontAttributes& attr);
    4547
    4648    /**
    4749     * @brief load font data
    4850     */
    49     bool loadFont(const char *fontName, const char *fontFileName, R2FontAttributes& sFont);
     51    bool loadFont(const char *fontName, const char *fontFileName, FontAttributes& sFont);
    5052
    5153    void addFont(const char *fontName, const char *fontFileName);
     
    6163
    6264private:
    63     ~R2Fonts();
     65    ~Fonts();
    6466
    65     R2FontVector _fonts;
     67    FontVector _fonts;
    6668    /// current font index
    6769    int _fontIndex;
     
    7274};
    7375
    74 inline int R2Fonts::getFontHeight() const
     76inline int Fonts::getFontHeight() const
    7577{
    7678    return _fonts[_fontIndex]._fontHeight;
    7779}
    7880
     81}
     82}
     83
    7984#endif
    8085
  • trunk/packages/vizservers/nanovis/R2/include/R2/R2Object.h

    r2841 r3463  
    11/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
    2 #ifndef R2_OBJECT_H
    3 #define R2_OBJECT_H
     2#ifndef NV_UTIL_OBJECT_H
     3#define NV_UTIL_OBJECT_H
    44
    5 #include <R2/R2.h>
     5namespace nv {
     6namespace util {
    67
    7 class R2Object
     8class Object
    89{
    910public:
    10     R2Object();
     11    Object();
    1112
    1213    int getRef();
     
    1516
    1617protected:
    17     virtual ~R2Object();
     18    virtual ~Object();
    1819
    1920private:
     
    2223};
    2324
    24 inline int R2Object::getRef()
     25inline int Object::getRef()
    2526{
    2627    return _refCount;
    2728}
    2829
    29 inline int R2Object::ref()
     30inline int Object::ref()
    3031{
    3132    return ++_refCount;
    3233}
    3334
    34 inline void R2Object::unref()
     35inline void Object::unref()
    3536{
    3637    _refCount--;
     
    4041}
    4142
     43}
     44}
     45
    4246#endif
    4347
  • trunk/packages/vizservers/nanovis/R2/include/R2/graphics/R2Geometry.h

    r2870 r3463  
    11 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
    2 #ifndef R2_GEOMETRY_H
    3 #define R2_GEOMETRY_H
     2#ifndef NV_GRAPHICS_GEOMETRY_H
     3#define NV_GRAPHICS_GEOMETRY_H
    44
    55#include <GL/glew.h>
     
    77#include <R2/graphics/R2IndexBuffer.h>
    88
    9 class R2Geometry
     9namespace nv {
     10namespace graphics {
     11
     12class Geometry
    1013{
    11 public :
     14public:
    1215    enum {
    1316        LINES = GL_LINES,
     
    1821    };
    1922
    20 public :
    21     R2Geometry(int primitive, R2VertexBuffer *vertexBuffer,
    22                R2IndexBuffer *indexBuffer);
    23     R2Geometry(int primitive, R2VertexBuffer *pointBuffer,
    24                R2VertexBuffer *colorBuffer, R2IndexBuffer *indexBuffer);
    25     ~R2Geometry();
     23    Geometry(int primitive, VertexBuffer *vertexBuffer,
     24             IndexBuffer *indexBuffer);
     25    Geometry(int primitive, VertexBuffer *pointBuffer,
     26             VertexBuffer *colorBuffer, IndexBuffer *indexBuffer);
     27    ~Geometry();
    2628
    2729    void render();
    2830
    29 private :
    30     R2VertexBuffer *_vertexBuffer;
    31     R2VertexBuffer *_colorBuffer;
    32     R2IndexBuffer *_indexBuffer;
     31private:
     32    VertexBuffer *_vertexBuffer;
     33    VertexBuffer *_colorBuffer;
     34    IndexBuffer *_indexBuffer;
    3335    int _primitiveType;
    3436};
    3537
    36 #endif /*_R2_GEOMETRY_H_*/
     38}
     39}
     40
     41#endif
  • trunk/packages/vizservers/nanovis/R2/include/R2/graphics/R2IndexBuffer.h

    r2870 r3463  
    11/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
    2 #ifndef R2_INDEX_BUFFER_H
    3 #define R2_INDEX_BUFFER_H
     2#ifndef NV_GRAPHICS_INDEX_BUFFER_H
     3#define NV_GRAPHICS_INDEX_BUFFER_H
    44
    5 class R2IndexBuffer
     5namespace nv {
     6namespace graphics {
     7
     8class IndexBuffer
    69{
    710public:
    8     R2IndexBuffer(int indexCount, int *data, bool copy = true);
    9     ~R2IndexBuffer();
     11    IndexBuffer(int indexCount, int *data, bool copy = true);
     12    ~IndexBuffer();
    1013
    1114    int getIndexCount() const;
     
    1720};
    1821
    19 inline int R2IndexBuffer::getIndexCount() const
     22inline int IndexBuffer::getIndexCount() const
    2023{
    2124    return _indexCount;
    2225}
    2326
    24 inline const int* R2IndexBuffer::getData() const
     27inline const int *IndexBuffer::getData() const
    2528{
    2629    return _data;
    2730}
    2831
     32}
     33}
     34
    2935#endif
  • trunk/packages/vizservers/nanovis/R2/include/R2/graphics/R2VertexBuffer.h

    r2841 r3463  
    11/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
    2 #ifndef R2_VERTEXBUFFER_H
    3 #define R2_VERTEXBUFFER_H
     2#ifndef NV_GRAPHICS_VERTEXBUFFER_H
     3#define NV_GRAPHICS_VERTEXBUFFER_H
    44
    5 class R2VertexBuffer
     5namespace nv {
     6namespace graphics {
     7
     8class VertexBuffer
    69{
    710public:
     
    1316    };
    1417
    15     R2VertexBuffer(int type, int vertexCount,
    16                    int byteSize, void *data, bool copy = true);
     18    VertexBuffer(int type, int vertexCount,
     19                 int byteSize, void *data, bool copy = true);
    1720
    18     ~R2VertexBuffer();
     21    ~VertexBuffer();
    1922
    2023    unsigned int getGraphicObjectID() const;
     
    3235};
    3336
    34 inline int R2VertexBuffer::getVertexCount() const
     37inline int VertexBuffer::getVertexCount() const
    3538{
    3639    return _vertexCount;
    3740}
    3841
    39 inline unsigned int R2VertexBuffer::getGraphicObjectID() const
     42inline unsigned int VertexBuffer::getGraphicObjectID() const
    4043{
    4144    return _graphicObjectID;
    4245}
    4346
     47}
     48}
     49
    4450#endif
  • trunk/packages/vizservers/nanovis/R2/src/R2FilePath.cpp

    r2972 r3463  
    1313#include "Trace.h"
    1414
    15 std::string R2FilePath::_curDirectory;
    16 R2FilePath R2FilePath::_instance;
     15using namespace nv::util;
     16
     17std::string FilePath::_curDirectory;
     18FilePath FilePath::_instance;
    1719
    1820static char seps[] = ":";
    1921
    20 R2FilePath::R2FilePath()
     22FilePath::FilePath()
    2123{
    2224    char buff[BUFSIZ+2];
     
    3537
    3638bool
    37 R2FilePath::setPath(const char *filePath)
     39FilePath::setPath(const char *filePath)
    3840{
    3941    char buff[256];
     
    7072}
    7173
    72 R2FilePath *
    73 R2FilePath::getInstance()
     74FilePath *
     75FilePath::getInstance()
    7476{
    7577    return &_instance;
     
    7779
    7880std::string
    79 R2FilePath::getPath(const char* fileName)
     81FilePath::getPath(const char* fileName)
    8082{
    8183    std::string path;
     
    9597
    9698void
    97 R2FilePath::setWorkingDirectory(int argc, const char **argv)
     99FilePath::setWorkingDirectory(int argc, const char **argv)
    98100{
    99101    char buff[256];
  • trunk/packages/vizservers/nanovis/R2/src/R2Fonts.cpp

    r2972 r3463  
    1010#include <R2/R2FilePath.h>
    1111
     12using namespace nv::util;
     13
    1214// constants
    1315const int c_nFileMagicHeader = 6666;
    1416
    15 R2Fonts::R2Fonts() :
     17Fonts::Fonts() :
    1618    _fontIndex(-1),
    1719    _screenWidth(512),
     
    2022}
    2123
    22 R2Fonts::~R2Fonts()
     24Fonts::~Fonts()
    2325{
    2426    for (unsigned index = 0; index < _fonts.size(); ++index) {
     
    2931
    3032void
    31 R2Fonts::setFont(const char *fontName)
     33Fonts::setFont(const char *fontName)
    3234{
    3335    if (fontName != NULL) {
     
    4345
    4446void
    45 R2Fonts::addFont(const char *fontName, const char *fontFileName)
    46 {
    47     R2FontAttributes sFont;
     47Fonts::addFont(const char *fontName, const char *fontFileName)
     48{
     49    FontAttributes sFont;
    4850   
    4951    loadFont(fontName, fontFileName, sFont);
     
    5355
    5456void
    55 R2Fonts::draw(const char *pString, ...) const
     57Fonts::draw(const char *pString, ...) const
    5658{
    5759    va_list vlArgs;
     
    7173
    7274void
    73 R2Fonts::begin()
     75Fonts::begin()
    7476{
    7577    glPushAttrib(GL_TRANSFORM_BIT | GL_ENABLE_BIT);
     
    9294
    9395void
    94 R2Fonts::end()
     96Fonts::end()
    9597{
    9698    glBindTexture(GL_TEXTURE_2D, 0);
     
    106108
    107109void
    108 R2Fonts::initializeFont(R2FontAttributes& attr)
     110Fonts::initializeFont(FontAttributes& attr)
    109111{
    110112    attr._displayLists = glGenLists(256);
     
    112114    int index;
    113115    for (index = 0; index < 256; ++index) {
    114         R2FontAttributes::R2CharInfo& charInfo = attr._chars[index];
     116        FontAttributes::CharInfo& charInfo = attr._chars[index];
    115117        glNewList(attr._displayLists + index, GL_COMPILE);
    116118        if (charInfo._valid) {
     
    137139
    138140bool
    139 R2Fonts::loadFont(const char *fontName, const char *fontFileName,
    140                   R2FontAttributes& sFont)
     141Fonts::loadFont(const char *fontName, const char *fontFileName,
     142                FontAttributes& sFont)
    141143{
    142144    bool bSuccess = false;
    143145
    144     std::string path = R2FilePath::getInstance()->getPath(fontFileName);
     146    std::string path = FilePath::getInstance()->getPath(fontFileName);
    145147    if (path.empty()) {
    146148        return false;
     
    233235
    234236void
    235 R2Fonts::resize(int width, int height)
     237Fonts::resize(int width, int height)
    236238{
    237239    _screenWidth = width;
  • trunk/packages/vizservers/nanovis/R2/src/R2Geometry.cpp

    r2841 r3463  
    55#include <R2/graphics/R2Geometry.h>
    66
    7 R2Geometry::R2Geometry(int primitive, R2VertexBuffer *vertexBuffer,
    8                        R2IndexBuffer *indexBuffer) :
     7using namespace nv::graphics;
     8
     9Geometry::Geometry(int primitive,
     10                   VertexBuffer *vertexBuffer,
     11                   IndexBuffer *indexBuffer) :
    912    _vertexBuffer(vertexBuffer),
    1013    _colorBuffer(0),
     
    1417}
    1518
    16 R2Geometry::R2Geometry(int primitive, R2VertexBuffer *vertexBuffer,
    17                        R2VertexBuffer *colorBuffer, R2IndexBuffer *indexBuffer) :
     19Geometry::Geometry(int primitive,
     20                   VertexBuffer *vertexBuffer,
     21                   VertexBuffer *colorBuffer,
     22                   IndexBuffer *indexBuffer) :
    1823    _vertexBuffer(vertexBuffer),
    1924    _colorBuffer(colorBuffer),
     
    2328}
    2429
    25 R2Geometry::~R2Geometry()
     30Geometry::~Geometry()
    2631{
    2732}
    2833
    2934void
    30 R2Geometry::render()
     35Geometry::render()
    3136{
    3237    //glDisableClientState(GL_NORMAL_ARRAY);
  • trunk/packages/vizservers/nanovis/R2/src/R2IndexBuffer.cpp

    r2841 r3463  
    55#include <R2/graphics/R2IndexBuffer.h>
    66
    7 R2IndexBuffer::R2IndexBuffer(int indexCount, int* data, bool copy) :
     7using namespace nv::graphics;
     8
     9IndexBuffer::IndexBuffer(int indexCount, int* data, bool copy) :
    810    _indexCount(indexCount)
    911{
     
    1618}
    1719
    18 R2IndexBuffer::~R2IndexBuffer()
     20IndexBuffer::~IndexBuffer()
    1921{
    2022    if (_data) {
  • trunk/packages/vizservers/nanovis/R2/src/R2Object.cpp

    r2798 r3463  
    22#include <R2/R2Object.h>
    33
    4 R2Object::R2Object() :
     4using namespace nv::util;
     5
     6Object::Object() :
    57    _refCount(0)
    68{
    79}
    810
    9 R2Object::~R2Object()
     11Object::~Object()
    1012{
    1113}
  • trunk/packages/vizservers/nanovis/R2/src/R2VertexBuffer.cpp

    r2841 r3463  
    88#include <R2/graphics/R2VertexBuffer.h>
    99
    10 R2VertexBuffer::R2VertexBuffer(int type, int vertexCount,
    11                                int byteSize, void *data, bool copy) :
    12     _graphicObjectID(0), _byteSize(byteSize), _vertexCount(vertexCount)
     10using namespace nv::graphics;
     11
     12VertexBuffer::VertexBuffer(int type, int vertexCount,
     13                           int byteSize, void *data, bool copy) :
     14    _graphicObjectID(0),
     15    _byteSize(byteSize),
     16    _vertexCount(vertexCount)
    1317{
    1418    if (copy) {
     
    2731}
    2832
    29 R2VertexBuffer::~R2VertexBuffer()
     33VertexBuffer::~VertexBuffer()
    3034{
    3135    if (_graphicObjectID != 0) {
  • trunk/packages/vizservers/nanovis/RenderContext.cpp

    r2831 r3463  
    22#include "RenderContext.h"
    33
    4 namespace graphics {
     4using namespace nv::graphics;
    55
    66RenderContext::RenderContext() :
     
    1515}
    1616
    17 }
  • trunk/packages/vizservers/nanovis/RenderContext.h

    r2831 r3463  
    55#include <GL/gl.h>
    66
     7namespace nv {
    78namespace graphics {
    89
     
    7071
    7172}
     73}
    7274
    7375#endif
  • trunk/packages/vizservers/nanovis/TransferFunction.h

    r3177 r3463  
    2222#include "Vector3.h"
    2323
    24 class TransferFunction : public R2Object
     24class TransferFunction
    2525{
    2626public:
  • trunk/packages/vizservers/nanovis/VelocityArrowsSlice.cpp

    r3452 r3463  
    1616#include "NvShader.h"
    1717#include "NvCamera.h"
     18
     19using namespace nv::util;
    1820
    1921static inline float deg2rad(float deg)
     
    6365    createRenderTarget();
    6466
    65     std::string path = R2FilePath::getInstance()->getPath("arrows.bmp");
     67    std::string path = FilePath::getInstance()->getPath("arrows.bmp");
    6668    if (!path.empty()) {
    6769        ImageLoader *loader = ImageLoaderFactory::getInstance()->createLoader("bmp");
  • trunk/packages/vizservers/nanovis/Volume.h

    r3362 r3463  
    1919#include <string>
    2020#include <vector>
    21 
    22 #include <R2/R2Object.h>
    2321
    2422#include "Color.h"
  • trunk/packages/vizservers/nanovis/config.h

    r3453 r3463  
    5050 * Controls if debug trace logging is enabled
    5151 */
    52 //#define WANT_TRACE
     52#define WANT_TRACE
    5353
    5454/*
  • trunk/packages/vizservers/nanovis/nanovis.cpp

    r3459 r3463  
    8080#include "ZincBlendeVolume.h"
    8181
     82using namespace nv::graphics;
     83using namespace nv::util;
     84
    8285#define SIZEOF_BMP_HEADER   54
    8386
     
    135138VelocityArrowsSlice *NanoVis::velocityArrowsSlice = NULL;
    136139
    137 graphics::RenderContext *NanoVis::renderContext = NULL;
     140RenderContext *NanoVis::renderContext = NULL;
    138141NvLIC *NanoVis::licRenderer = NULL;
    139 R2Fonts *NanoVis::fonts;
     142Fonts *NanoVis::fonts;
    140143
    141144FILE *NanoVis::stdin = NULL;
     
    895898    }
    896899
    897     if (!R2FilePath::getInstance()->setPath(path)) {
     900    if (!FilePath::getInstance()->setPath(path)) {
    898901        ERROR("can't set file path to %s", path);
    899902        exitService(1);
     
    905908    NvShader::setErrorCallback(cgErrorCallback);
    906909
    907     fonts = new R2Fonts();
     910    fonts = new Fonts();
    908911    fonts->addFont("verdana", "verdana.fnt");
    909912    fonts->setFont("verdana");
     
    976979
    977980    // create
    978     renderContext = new graphics::RenderContext();
     981    renderContext = new RenderContext();
    979982
    980983    //create a 2D plane renderer
     
    19091912    }
    19101913
    1911     R2FilePath::getInstance()->setWorkingDirectory(argc, (const char**) argv);
     1914    FilePath::getInstance()->setWorkingDirectory(argc, (const char**) argv);
    19121915
    19131916#ifdef notdef
  • trunk/packages/vizservers/nanovis/nanovis.h

    r3452 r3463  
    3838#define NPIX  512       //display size
    3939
     40namespace nv {
    4041namespace graphics {
    4142    class RenderContext;
     43}
     44namespace util {
     45    class Fonts;
     46}
    4247}
    4348
     
    5560class NvVectorField;
    5661class Grid;
    57 class R2Fonts;
    5862class NvCamera;
    5963class TransferFunction;
     
    152156    static Texture2D *legendTexture;
    153157    static Grid *grid;
    154     static R2Fonts *fonts;
     158    static nv::util::Fonts *fonts;
    155159    static int updir;
    156160    static NvCamera *cam;
    157     static graphics::RenderContext *renderContext;
     161    static nv::graphics::RenderContext *renderContext;
    158162
    159163    static Tcl_HashTable tfTable;
Note: See TracChangeset for help on using the changeset viewer.