GemaMesh
The GeMA Mesh Plugin
Loading...
Searching...
No Matches
gmpCellBoundary.h
Go to the documentation of this file.
1/************************************************************************
2**
3** Copyright (C) 2014 by Carlos Augusto Teixera Mendes
4** All rights reserved.
5**
6** This file is part of the "GeMA" software. It's use should respect
7** the terms in the license agreement that can be found together
8** with this source code.
9** It is provided AS IS, with NO WARRANTY OF ANY KIND,
10** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR
11** A PARTICULAR PURPOSE.
12**
13************************************************************************/
14
24#ifndef _GEMA_PLUGIN_GEMA_CELL_BOUNDARY_H_
25#define _GEMA_PLUGIN_GEMA_CELL_BOUNDARY_H_
26
27#include "gmpGemaMeshConfig.h"
28
29#include <gmCellBoundary.h>
30#include <gmCellMesh.h>
31
32#include <assert.h>
33
34
36class GMP_GEMAMESH_API_EXPORT GmpCellBoundary: public GmCellBoundary
37{
38public:
39 GmpCellBoundary(QString id, GmCellBoundaryType type, GmCellMesh* mesh, int numCells, int* cells, int* borders);
40
41 virtual ~GmpCellBoundary();
42
43 // Comments on the base class
44 virtual QString id() const { return _id; }
45
46 // Comments on the base class
47 virtual GmCellBoundaryType type() const { return _type; }
48
49 // Comments on the base class
50 virtual GmCellMesh* mesh() const { return _mesh; }
51
52 // Comments on the base class
53 virtual int numCells() const { return _numCells; }
54
55 // Comments on the base class
56 virtual GmCell* cell(int i) const { assert(i >= 0 && i < _numCells); return _mesh->cell(_cells[i]); }
57
58 // Comments on the base class
59 virtual int cellBorder(int i) const { assert(i >= 0 && i < _numCells); return _borders[i]; }
60
61 virtual bool setBoundaryData(int numCells, int* cellList, int* borderList);
62
63 // Comments on the base class
64 virtual size_t usedMemory() const { return sizeof(GmpCellBoundary) + _numCells * 2 * sizeof(int); }
65
66private:
67 template <template <class> class Vector> friend class GmpCellDataDump; // Needed for the state dumping code to have access to the address of the _cells/_borders/_numCells attributes
68
72 int* _cells;
73 int* _borders;
75};
76
77
78#endif
79
virtual int cellBorder(int i) const=0
virtual GmCellBoundaryType type() const=0
virtual QString id() const=0
virtual size_t usedMemory() const=0
virtual GmCell * cell(int i) const=0
virtual int numCells() const=0
virtual GmCellMesh * mesh() const=0
virtual bool setBoundaryData(int numCells, int *cellList, int *borderList)
A simple concrete implementation of the GmCellBoundary interface.
Definition gmpCellBoundary.h:37
int _numCells
The number of cells stored in this group.
Definition gmpCellBoundary.h:71
GmCellBoundaryType _type
The type of border.
Definition gmpCellBoundary.h:70
GmCellMesh * _mesh
The mesh that we belong to.
Definition gmpCellBoundary.h:74
QString _id
The group name.
Definition gmpCellBoundary.h:69
int * _cells
The cell vector.
Definition gmpCellBoundary.h:72
int * _borders
The border (edge or face) vector.
Definition gmpCellBoundary.h:73
A helper class to implement state dump operations for a GmpCellMeshData<Vector> object.
Definition gmpCellDataDump.h:43
GmCellBoundaryType
Declaration of useful configuration definitions for the plugin library.