source: trunk/src2/core/RpFieldRect3D.h @ 372

Last change on this file since 372 was 372, checked in by mmc, 18 years ago

Added field scaling and made points outside of volume invisible.

File size: 1.9 KB
Line 
1/*
2 * ----------------------------------------------------------------------
3 *  Rappture::FieldRect3D
4 *    This is a continuous, linear function defined by a series of
5 *    points on a 3D structured mesh.  It's a scalar field defined
6 *    in 3D space.
7 *
8 * ======================================================================
9 *  AUTHOR:  Michael McLennan, Purdue University
10 *  Copyright (c) 2004-2006  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_FIELDRECT3D_H
17#define RAPPTURE_FIELDRECT3D_H
18
19#include <math.h>
20#include <vector>
21#include "RpPtr.h"
22#include "RpMeshRect3D.h"
23
24namespace Rappture {
25
26class FieldRect3D {
27public:
28    FieldRect3D();
29    FieldRect3D(const Mesh1D& xg, const Mesh1D& yg, const Mesh1D& zg);
30    FieldRect3D(const FieldRect3D& field);
31    FieldRect3D& operator=(const FieldRect3D& field);
32    virtual ~FieldRect3D();
33
34    virtual int size(Axis which) const;
35    virtual Node1D& atNode(Axis which, int pos);
36    virtual double rangeMin(Axis which) const;
37    virtual double rangeMax(Axis which) const;
38
39    virtual FieldRect3D& define(int nodeId, double f);
40    virtual double value(double x, double y, double z,
41        double outside=NAN) const;
42    virtual double valueMin() const;
43    virtual double valueMax() const;
44
45protected:
46    virtual double _interpolate(double x0, double y0, double x1, double y1,
47        double x) const;
48
49private:
50    std::vector<double> _valuelist; // list of all values, in nodeId order
51    double _vmin;                   // minimum value in _valuelist
52    double _vmax;                   // maximum value in _valuelist
53    Ptr<MeshRect3D> _meshPtr;       // mesh for all (x,y,z) points
54    int _counter;                   // counter for generating node IDs
55};
56
57} // namespace Rappture
58
59#endif
Note: See TracBrowser for help on using the repository browser.