GemaMesh
The GeMA Mesh Plugin
gmpGemaCellBoundary.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 #include <assert.h>
32 
33 #include <QString>
34 
36 class GMP_GEMAMESH_API_EXPORT GmpGemaCellBoundary: public GmCellBoundary
37 {
38 public:
39  GmpGemaCellBoundary(QString id, GmCellBoundaryType type, GmCellMesh* mesh, int numCells, int* cells, int* borders);
40 
41  virtual ~GmpGemaCellBoundary();
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(GmpGemaCellBoundary) + _numCells * 2 * sizeof(int); }
65 
66 private:
67  template <template <class> class Vector> friend struct GmpCellMeshData; // Needed for the state dumping code to have access to the address of the _cells/_borders/_numCells attributes
68 
71  int _numCells;
72  int* _cells;
73  int* _borders;
75 };
76 
77 
78 #endif
79 
int _numCells
The number of cells stored in this group.
Definition: gmpGemaCellBoundary.h:71
virtual bool setBoundaryData(int numCells, int *cellList, int *borderList)
virtual size_t usedMemory() const=0
virtual QString id() const=0
GmCellMesh * _mesh
The mesh that we belong to.
Definition: gmpGemaCellBoundary.h:74
virtual GmCellBoundaryType type() const=0
virtual int numCells() const=0
virtual GmCell * cell(int i) const=0
int * _cells
The cell vector.
Definition: gmpGemaCellBoundary.h:72
virtual GmCellMesh * mesh() const=0
GmCellBoundaryType _type
The type of border.
Definition: gmpGemaCellBoundary.h:70
QString _id
The group name.
Definition: gmpGemaCellBoundary.h:69
virtual int cellBorder(int i) const=0
Declaration of usefull configuration definitions for the plugin library.
Auxiliar structure used to share data between GmpXxxCellMeshBase and GmpMeshLoader.
Definition: gmpCellMeshData.h:123
int * _borders
The border (edge or face) vector.
Definition: gmpGemaCellBoundary.h:73
A simple concrete implementation of the GmCellBoundary interface.
Definition: gmpGemaCellBoundary.h:36
GmCellBoundaryType