View on GitHub

Vistle

Distributed Data-parallel Scientific Visualization in VR

structuredgrid.h
Go to the documentation of this file.
1//-------------------------------------------------------------------------
2// STRUCTURED GRID CLASS H
3// *
4// * Structured Grid Container Object
5//-------------------------------------------------------------------------
6#ifndef STRUCTURED_GRID_H
7#define STRUCTURED_GRID_H
8
9#include "scalar.h"
10#include "shm.h"
11#include "structuredgridbase.h"
12#include "coords.h"
13#include "celltree.h"
14#include "normals.h"
15#include "export.h"
16
17namespace vistle {
18
19//-------------------------------------------------------------------------
20// DECLARATION OF STRUCTUREDGRID
21//-------------------------------------------------------------------------
23 virtual public StructuredGridBase,
24 virtual public CelltreeInterface<3> {
26
27public:
28 typedef Coords Base;
30
31 // constructor
32 StructuredGrid(const Index numVert_x, const Index numVert_y, const Index numVert_z, const Meta &meta = Meta());
33
34 // get functions for metadata
35 Index getNumDivisions(int c) override { return d()->numDivisions[c]; }
36 Index getNumDivisions(int c) const override { return m_numDivisions[c]; }
37 Index getNumGhostLayers(unsigned dim, GhostLayerPosition pos) override;
38 Index getNumGhostLayers(unsigned dim, GhostLayerPosition pos) const override;
39 Index getGlobalIndexOffset(int c) const override { return d()->indexOffset[c]; }
40 void setGlobalIndexOffset(int c, Index offset) override;
41
42 // virtual set functions
43 void setNumGhostLayers(unsigned dim, GhostLayerPosition pos, unsigned value) override;
44
45 // GridInterface
46 Index getNumVertices() const override;
47 std::pair<Vector, Vector> getBounds() const override;
48 Normals::const_ptr normals() const override;
49 void setNormals(Normals::const_ptr normals);
50 std::pair<Vector, Vector> cellBounds(Index elem) const override;
51 Index findCell(const Vector &point, Index hint = InvalidIndex, int flags = NoFlags) const override;
52 bool inside(Index elem, const Vector &point) const override;
53 Interpolator getInterpolator(Index elem, const Vector &point, DataBase::Mapping mapping = DataBase::Vertex,
54 InterpolationMode mode = Linear) const override;
55
56 bool hasCelltree() const override;
57 Celltree::const_ptr getCelltree() const override;
58 bool validateCelltree() const override;
59 Scalar exitDistance(Index elem, const Vector &point, const Vector &dir) const override;
60
61 void copyAttributes(Object::const_ptr src, bool replace = true) override;
62
63private:
64 // mutable pointers to ShmVectors
65 mutable Index m_numDivisions[3];
66 mutable Index m_ghostLayers[3][2];
67 mutable Celltree::const_ptr m_celltree;
68
69 void createCelltree(Index dims[]) const;
70
71 // data object
73
75 Index indexOffset[3]; //< global index offset
76 Index numDivisions[3]; //< number of divisions on each axis (1 more than number of cells)
77 Index ghostLayers[3][2]; //< number of ghost cell layers in each of x, y, z directions
78
79 Data(const Index numVert_x, const Index numVert_y, const Index numVert_z, const std::string &name,
80 const Meta &meta = Meta());
81 ~Data();
82 static Data *create(const Index numVert_x = 0, const Index numVert_y = 0, const Index numVert_z = 0,
83 const Meta &meta = Meta());
84
86};
87
88
90
91} // namespace vistle
92#endif /* STRUCTURED_GRID_H */
#define ARCHIVE_ASSUME_ABSTRACT(obj)
Definition: archives_config.h:466
Definition: celltree.h:172
Definition: coords.h:15
return at least those elements sharing faces with elem, but might also contain those just sharing ver...
Definition: grid.h:33
Definition: objectmeta.h:16
std::shared_ptr< const Object > const_ptr
Definition: object.h:68
Definition: structuredgridbase.h:20
Definition: structuredgrid.h:24
Index getGlobalIndexOffset(int c) const override
Definition: structuredgrid.h:39
Index getNumDivisions(int c) override
Definition: structuredgrid.h:35
Normals::const_ptr normals() const override
CelltreeInterface< 3 >::Celltree Celltree
Definition: structuredgrid.h:29
Coords Base
Definition: structuredgrid.h:28
Index getNumDivisions(int c) const override
Definition: structuredgrid.h:36
Scalar Scalar
Definition: vec.h:23
Definition: shm_obj_ref.h:15
#define V_COREEXPORT
Definition: export.h:9
Definition: allobjects.cpp:30
Vector3 Vector
Definition: vector.h:36
const Index InvalidIndex
Definition: index.h:17
uint32_t Index
Definition: index.h:13
#define V_DATA_BEGIN(ObjType)
Definition: object.h:474
#define V_DATA_END(ObjType)
Definition: object.h:481
#define V_OBJECT(ObjType)
declare a new Object type
Definition: object.h:381
Definition: object.h:233