Ignore:
Timestamp:
Apr 4, 2013 10:17:26 PM (11 years ago)
Author:
ldelgass
Message:

Use vrmath::Color4f for color where appropriate

Location:
trunk/packages/vizservers/nanovis
Files:
12 edited

Legend:

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

    r3611 r3627  
    1212#include <assert.h>
    1313
    14 #include <vrmath/Vector4f.h>
     14#include <vrmath/Color4f.h>
    1515
    1616#include "nanovis.h"        // For NMESH
     
    6161{
    6262    _renderer->setPos(Flow::getRelativePosition(&_sv.position));
    63     _renderer->setColor(Vector4f(_sv.color.r,
    64                                  _sv.color.g,
    65                                  _sv.color.b,
    66                                  _sv.color.a));
     63    _renderer->setColor(Color4f(_sv.color.r,
     64                                _sv.color.g,
     65                                _sv.color.b,
     66                                _sv.color.a));
    6767    _renderer->particleSize(_sv.particleSize);
    6868    _renderer->setAxis(_sv.position.axis);
  • trunk/packages/vizservers/nanovis/Grid.cpp

    r3611 r3627  
    99#include <GL/glew.h>
    1010#include <GL/gl.h>
     11
     12#include <util/Fonts.h>
     13#include <vrmath/Color4f.h>
    1114
    1215#include "Grid.h"
     
    8689
    8790    glLineWidth(2.0f);
    88     glColor4f(_axisColor.red, _axisColor.green, _axisColor.blue,
    89               _axisColor.alpha);
     91    glColor4f(_axisColor.r, _axisColor.g, _axisColor.b,
     92              _axisColor.a);
    9093
    9194    glBegin(GL_LINES);
     
    101104
    102105    glLineWidth(1.0f);
    103     glColor4f(_majorColor.red, _majorColor.green, _majorColor.blue,
    104               _majorColor.alpha);
     106    glColor4f(_majorColor.r, _majorColor.g, _majorColor.b,
     107              _majorColor.a);
    105108
    106109    glBegin(GL_LINES);
     
    137140
    138141    // Set minor line color
    139     glColor4f(_minorColor.red, _minorColor.green, _minorColor.blue,
    140               _minorColor.alpha);
     142    glColor4f(_minorColor.r, _minorColor.g, _minorColor.b,
     143              _minorColor.a);
    141144
    142145    glBegin(GL_LINES);
  • trunk/packages/vizservers/nanovis/Grid.h

    r3613 r3627  
    77#define NV_GRID_H
    88
    9 #include <util/Fonts.h>
     9#include <vrmath/Color4f.h>
    1010
    1111#include "Axis.h"
     
    1414namespace nv {
    1515
    16 class RGBA
    17 {
    18 public:
    19     RGBA(float r, float g, float b, float a) :
    20         red(r),
    21         green(g),
    22         blue(b),
    23         alpha(a)
    24     {}
    25 
    26     void set(float r, float g, float b, float a)
    27     {
    28         red   = r;
    29         green = g;
    30         blue  = b;
    31         alpha = a;
    32     }
    33 
    34     float red, green, blue, alpha;
    35 };
     16namespace util {
     17class Fonts;
     18}
    3619
    3720class Grid
     
    7154
    7255private:
    73     RGBA _axisColor, _majorColor, _minorColor;
     56    vrmath::Color4f _axisColor, _majorColor, _minorColor;
    7457    nv::util::Fonts *_font;
    7558    bool _visible;
  • trunk/packages/vizservers/nanovis/Makefile.in

    r3618 r3627  
    292292FlowParticles.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
    293293GradientFilter.o: GradientFilter.cpp GradientFilter.h
    294 Grid.o: Grid.cpp Grid.h Axis.h Chain.h
     294Grid.o: Grid.cpp Grid.h Axis.h Chain.h $(UTIL_DIR)/Fonts.h $(VRMATH_DIR)/include/vrmath/Color4f.h $(VRMATH_DIR)/include/vrmath/Vector4f.h
    295295HeightMap.o: HeightMap.cpp HeightMap.h
    296296LIC.o: LIC.cpp LIC.h
     
    332332dxReader.o: dxReader.cpp ReaderCommon.h config.h nanovis.h Unirect.h ZincBlendeVolume.h ZincBlendeReconstructor.h
    333333md5.o: md5.h
    334 nanovis.o: nanovis.cpp nanovis.h config.h define.h Command.h Flow.h Grid.h HeightMap.h Camera.h LIC.h ZincBlendeReconstructor.h OrientationIndicator.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
     334nanovis.o: nanovis.cpp nanovis.h config.h define.h Command.h Flow.h Grid.h HeightMap.h Camera.h LIC.h ZincBlendeReconstructor.h OrientationIndicator.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 $(UTIL_DIR)/Fonts.h
    335335nanovisServer.o: nanovisServer.cpp nanovisServer.h config.h nanovis.h define.h Command.h PPMWriter.h ReadBuffer.h Shader.h ResponseQueue.h Trace.h
  • trunk/packages/vizservers/nanovis/PCASplit.h

    r3613 r3627  
    1010
    1111#include <vrmath/Vector3f.h>
    12 #include <vrmath/Vector4f.h>
     12#include <vrmath/Color4f.h>
    1313
    1414namespace PCA {
     
    2323
    2424    vrmath::Vector3f position;
    25     vrmath::Vector4f color;
     25    vrmath::Color4f color;
    2626    float size;
    2727    float value;
     
    5757
    5858    vrmath::Vector3f centroid;
    59     vrmath::Vector4f color;
     59    vrmath::Color4f color;
    6060    float scale;
    6161
  • trunk/packages/vizservers/nanovis/ParticleRenderer.cpp

    r3612 r3627  
    1212
    1313#include <GL/glew.h>
     14
     15#include <vrmath/Color4f.h>
    1416
    1517#include "ParticleRenderer.h"
  • trunk/packages/vizservers/nanovis/ParticleRenderer.h

    r3612 r3627  
    1212
    1313#include <vrmath/Vector3f.h>
    14 #include <vrmath/Vector4f.h>
     14#include <vrmath/Color4f.h>
    1515
    1616#include "ParticleAdvectionShader.h"
     
    6363    }
    6464
    65     void setColor(const vrmath::Vector4f& color)
     65    void setColor(const vrmath::Color4f& color)
    6666    {
    6767        _color = color;
     
    122122    int _sliceAxis;
    123123
    124     vrmath::Vector4f _color;
     124    vrmath::Color4f _color;
    125125
    126126    //the storage of particles is implemented as a 2D array.
  • trunk/packages/vizservers/nanovis/PointSet.cpp

    r3612 r3627  
    99#include <vrmath/Vector3f.h>
    1010#include <vrmath/Vector4f.h>
     11#include <vrmath/Color4f.h>
    1112
    1213#include "PointSet.h"
     
    5859
    5960    PCA::Point *points;
    60     vrmath::Vector4f *colors = (vrmath::Vector4f *)color;
     61    vrmath::Color4f *colors = (vrmath::Color4f *)color;
    6162    int numOfPoints;
    6263    int index;
  • trunk/packages/vizservers/nanovis/PointSetRenderer.cpp

    r3617 r3627  
    6464    Point *p = points;
    6565    for (int i = 0; i < length; ++i, ++p) {
    66         glColor4f(p->color.x, p->color.y, p->color.z, p->color.w);
     66        glColor4f(p->color.r, p->color.g, p->color.b, p->color.a);
    6767        glVertex3f(p->position.x, p->position.y, p->position.z);
    6868    }
  • trunk/packages/vizservers/nanovis/vrmath/include/vrmath/Vector2f.h

    r3492 r3627  
    2727        x(x1), y(y1)
    2828    {}
     29
     30    Vector2f& operator=(const Vector2f& other)
     31    {
     32        set(other.x, other.y);
     33        return *this;
     34    }
    2935
    3036    void set(float x1, float y1);
  • trunk/packages/vizservers/nanovis/vrmath/include/vrmath/Vector3f.h

    r3618 r3627  
    2727        x(x1), y(y1), z(z1)
    2828    {}
     29   
     30    Vector3f& operator=(const Vector3f& other)
     31    {
     32        set(other.x, other.y, other.z);
     33        return *this;
     34    }
    2935
    3036    void set(float x1, float y1, float z1);
  • trunk/packages/vizservers/nanovis/vrmath/include/vrmath/Vector4f.h

    r3567 r3627  
    3737
    3838    void set(const Vector4f& v4);
     39
     40    Vector4f& operator=(const Vector4f& other)
     41    {
     42        set(other.x, other.y, other.z, other.w);
     43        return *this;
     44    }
    3945
    4046    bool operator==(const Vector4f& op2) const
Note: See TracChangeset for help on using the changeset viewer.