source: branches/1.3/src/core2/RpMeshRect3D.h @ 5348

Last change on this file since 5348 was 3177, checked in by mmc, 12 years ago

Updated all of the copyright notices to reference the transfer to
the new HUBzero Foundation, LLC.

File size: 2.0 KB
Line 
1/*
2 * ----------------------------------------------------------------------
3 *  Rappture::MeshRect3D
4 *    This is a non-uniform, structured 3D mesh.  Each of the x, y,
5 *    and z-axes can be configured independently.  Their product
6 *    forms a rectangular mesh in 3D space.
7 *
8 * ======================================================================
9 *  AUTHOR:  Michael McLennan, Purdue University
10 *  Copyright (c) 2004-2012  HUBzero Foundation, LLC
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_MESHRECT3D_H
17#define RAPPTURE_MESHRECT3D_H
18
19#include "RpMesh1D.h"
20
21namespace Rappture {
22
23class CellRect3D {
24public:
25    CellRect3D();
26    CellRect3D(const CellRect3D& cell);
27    CellRect3D& operator=(const CellRect3D& cell);
28    int& nodeId(int n);
29    double& x(int n);
30    double& y(int n);
31    double& z(int n);
32
33    int isOutside() const;
34
35private:
36    int _nodeIds[8];
37    double _x[8];
38    double _y[8];
39    double _z[8];
40};
41
42class MeshRect3D {
43public:
44    MeshRect3D();
45    MeshRect3D(const Mesh1D& xm, const Mesh1D& ym, const Mesh1D& zm);
46    MeshRect3D(const MeshRect3D& mesh);
47    MeshRect3D& operator=(const MeshRect3D& mesh);
48    virtual ~MeshRect3D();
49
50    virtual Node1D& add(Axis which, const Node1D& node);
51    virtual MeshRect3D& remove(Axis which, int nodeId);
52    virtual MeshRect3D& remove(Axis which, const Node1D& node);
53    virtual MeshRect3D& clear();
54
55    virtual int size(Axis which) const;
56    virtual Node1D& at(Axis which, int pos);
57    virtual double rangeMin(Axis which) const;
58    virtual double rangeMax(Axis which) const;
59
60    virtual CellRect3D locate(const Node3D& node) const;
61
62    // required for base class Serializable:
63    const char* serializerType() const { return "MeshRect3D"; }
64    char serializerVersion() const { return 'A'; }
65
66private:
67    Mesh1D _axis[3];  // mesh along x-, y-, and z-axes
68};
69
70} // namespace Rappture
71
72#endif
Note: See TracBrowser for help on using the repository browser.