View on GitHub

Vistle

Distributed Data-parallel Scientific Visualization in VR

ngons.h
Go to the documentation of this file.
1#ifndef VISTLE_NGONS_H
2#define VISTLE_NGONS_H
3
4#include "shm.h"
5#include "coords.h"
6#include "geometry.h"
7#include "celltree.h"
8
9namespace vistle {
10
11template<int N>
12class V_COREEXPORT Ngons: public Coords, virtual public CelltreeInterface<3> {
14
15public:
16 static constexpr int num_corners = N;
17 typedef Coords Base;
19
20 Ngons(const Index numCorners, const Index numCoords, const Meta &meta = Meta());
21
22 Index getNumElements() override;
23 Index getNumElements() const override;
24 Index getNumCorners();
25 Index getNumCorners() const;
26
27 shm<Index>::array &cl() { return *d()->cl; }
28 const Index *cl() const { return m_cl; }
29
30 bool hasCelltree() const override;
31 Celltree::const_ptr getCelltree() const override;
32 bool validateCelltree() const override;
33
34 virtual std::pair<Vector, Vector> elementBounds(Index elem) const;
35
36 Index cellNumFaces(Index elem) const override { return 1; }
37 std::vector<Index> cellVertices(Index elem) const override;
38
39private:
40 void createCelltree(Index nelem, const Index *cl) const;
41
42 mutable const Index *m_cl;
43 mutable Index m_numCorners = 0;
44 mutable Celltree::const_ptr m_celltree;
45
48
49 Data(const Index numCorners = 0, const Index numCoords = 0, const std::string &name = "",
50 const Meta &meta = Meta());
51 static Data *create(const Index numCorners = 0, const Index numCoords = 0, const Meta &meta = Meta());
53
54 static_assert(N == 3 || N == 4, "only usable for triangles and quads");
55};
56
57} // namespace vistle
58#endif
Definition: celltree.h:172
Definition: celltree.h:31
Definition: coords.h:15
Definition: objectmeta.h:16
Definition: ngons.h:12
vistle::CelltreeInterface< 3 >::Celltree Celltree
Definition: ngons.h:18
Coords Base
Definition: ngons.h:17
const Index * cl() const
Definition: ngons.h:28
Index cellNumFaces(Index elem) const override
Definition: ngons.h:36
shm< Index >::array & cl()
Definition: ngons.h:27
std::shared_ptr< const Object > const_ptr
Definition: object.h:68
Definition: shm_reference.h:15
Definition: shm_array.h:19
#define V_COREEXPORT
Definition: export.h:9
Definition: allobjects.cpp:30
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