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

Last change on this file since 1028 was 1028, checked in by gah, 13 years ago

various cleanups

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#include <RpOutcome.h>
22
23namespace Rappture {
24
25class DX {
26public:
27    DX();
28    DX(const char* filename, RpOutcome *resultPtr);
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
40    virtual const float* origin() const;
41    virtual const float* delta() const;
42    virtual const float* max() const;
43
44    virtual const float* data() const;
45    virtual float dataMin() const;
46    virtual float dataMax() const;
47    virtual float nzero_min() const;
48
49    virtual DX& interpolate(int* newAxisLen);
50    virtual int n() const;
51    virtual int rank() const;
52    virtual int shape() const;
53    virtual const float* positions() const;
54    virtual const int* axisLen() const;
55
56protected:
57
58private:
59    float _dataMin;
60    float _dataMax;
61    float _nzero_min;
62    int _numAxis;       // same as _shape if _rank == 1
63    int* _axisLen;      // number of points on each axis
64    float* _data;
65
66    int _n;             // number of points in the position array
67    int _rank;          // number of dimensions in each item
68    int _shape;         // array of the extents of each dimension
69    float* _positions;  // array holding the x,y,z coord of each point
70    float* _delta;      // array holding deltas of the uniform mesh
71    float* _max;        // array hodling coord of most distant pt from origin
72    float* _origin;     // array holding coord of origin
73
74    Object _dxobj;
75
76    void __findPosMax();
77    void __collectDataStats();
78    void __getInterpPos();
79    void __getInterpData();
80
81
82};
83
84} // namespace Rappture
85
86#endif
Note: See TracBrowser for help on using the repository browser.