source: trunk/vizservers/nanovis/RpDX.h @ 956

Last change on this file since 956 was 956, checked in by dkearney, 16 years ago

updated the process of querying data from dx files but using native dx library calls instead of calculating grid positions and data points myself.
the Rappture::DX::interpolate() function does not quite work as intended, but if you do not change the axis lengths you can get the original data values back.
created a new function !computeSimpleGradient, located in dxReaderCommon.cpp, as part of the effort to simplify !dxReader.cpp.
removed old code from !dxReader2.cpp

File size: 2.3 KB
Line 
1/*
2 * ----------------------------------------------------------------------
3 *  Rappture::DX
4 *
5 *  Rappture DX object for file reading and interacting
6 *  with libDX and friends.
7 *
8 * ======================================================================
9 *  AUTHOR:  Derrick S. Kearney, Purdue University
10 *  Copyright (c) 2005-2008  Purdue Research Foundation
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 * ======================================================================
15 */
16#ifndef RAPPTURE_DX_H
17#define RAPPTURE_DX_H
18
19// #include "rappture2.h"
20#include <dx/dx.h>
21
22namespace Rappture {
23
24class DX {
25public:
26    DX();
27    DX(const char* filename);
28    DX(const DX& rpdx);
29    DX& operator=(const DX& rpdx);
30    virtual ~DX();
31
32    /*
33    virtual double value(double x, double y, double z,
34        double outside=NAN) const;
35    virtual double valueMin() const;
36    virtual double valueMax() const;
37    */
38
39    virtual const float* origin() const;
40    virtual const float* delta() const;
41    virtual const float* max() const;
42
43    virtual const float* data() const;
44    virtual float dataMin() const;
45    virtual float dataMax() const;
46    virtual float nzero_min() const;
47
48    virtual DX& interpolate(int* newAxisLen);
49    virtual int n() const;
50    virtual int rank() const;
51    virtual int shape() const;
52    virtual const float* positions() const;
53    virtual const int* axisLen() const;
54
55protected:
56
57private:
58    float _dataMin;
59    float _dataMax;
60    float _nzero_min;
61    int _numAxis;       // same as _shape if _rank == 1
62    int* _axisLen;      // number of points on each axis
63    float* _data;
64
65    int _n;             // number of points in the position array
66    int _rank;          // number of dimensions in each item
67    int _shape;         // array of the extents of each dimension
68    float* _positions;  // array holding the x,y,z coord of each point
69    float* _delta;      // array holding deltas of the uniform mesh
70    float* _max;        // array hodling coord of most distant pt from origin
71    float* _origin;     // array holding coord of origin
72
73    Object _dxobj;
74
75    void __findPosMax();
76    void __collectDataStats();
77    void __getInterpPos();
78    void __getInterpData();
79
80
81};
82
83} // namespace Rappture
84
85#endif
Note: See TracBrowser for help on using the repository browser.