source: trunk/packages/vizservers/nanovis/RpDX.h @ 1522

Last change on this file since 1522 was 1325, checked in by gah, 15 years ago

Clean up of warnings, outcomes

File size: 2.6 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#include <RpOutcome.h>
22
23namespace Rappture {
24
25class DX {
26public:
27    DX();
28    DX(Rappture::Outcome &result, const char* filename);
29    DX(const DX& rpdx);
30    DX& operator=(const DX& rpdx);
31    virtual ~DX();
32
33    /*
34    virtual double value(double x, double y, double z,
35        double outside=NAN) const;
36    virtual double valueMin() const;
37    virtual double valueMax() const;
38    */
39    virtual DX& interpolate(int* newAxisLen);
40
41    int n(void) const {
42        return _n;
43    }
44    int rank(void) const {
45        return _rank;
46    }
47    int shape(void) const {
48        return _shape;
49    }
50    const float* delta(void) const {
51        // FIXME: Delta is always three numbers.
52        return _delta;
53    }
54    const float *max(void) const {
55        return _max;
56    }
57    const float *origin(void) const {
58        return _origin;
59    }
60    const float * positions(void) const {
61        return _positions;
62    }
63    const int *axisLen(void) const {
64        return _axisLen;
65    }
66    const float *data(void) const {
67        return _data;
68    }
69    float dataMin(void) const {
70        return _dataMin;
71    }
72    float dataMax(void) const {
73        return _dataMax;
74    }
75    float nzero_min(void) const {
76        return _nzero_min;
77    }
78
79protected:
80
81private:
82    float _dataMin;
83    float _dataMax;
84    float _nzero_min;
85    int _numAxis;       // same as _shape if _rank == 1
86    int *_axisLen;      // number of points on each axis
87    float* _data;
88
89    int _n;             // number of points in the position array
90    int _rank;          // number of dimensions in each item
91    int _shape;         // array of the extents of each dimension
92    float* _positions;  // array holding the x,y,z coord of each point
93    float* _delta;      // array holding deltas of the uniform mesh
94    float* _max;        // array hodling coord of most distant pt from origin
95    float* _origin;     // array holding coord of origin
96
97    Object _dxobj;
98
99    void __findPosMax();
100    void __collectDataStats();
101    void __getInterpPos();
102    void __getInterpData();
103
104
105};
106
107} // namespace Rappture
108
109#endif
Note: See TracBrowser for help on using the repository browser.