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 | |
---|
21 | namespace Rappture { |
---|
22 | |
---|
23 | class CellRect3D { |
---|
24 | public: |
---|
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 | |
---|
35 | private: |
---|
36 | int _nodeIds[8]; |
---|
37 | double _x[8]; |
---|
38 | double _y[8]; |
---|
39 | double _z[8]; |
---|
40 | }; |
---|
41 | |
---|
42 | class MeshRect3D { |
---|
43 | public: |
---|
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 | |
---|
66 | private: |
---|
67 | Mesh1D _axis[3]; // mesh along x-, y-, and z-axes |
---|
68 | }; |
---|
69 | |
---|
70 | } // namespace Rappture |
---|
71 | |
---|
72 | #endif |
---|