GemaCoreLib
The GeMA Core library
Loading...
Searching...
No Matches
gmFileExtraNodes.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_FILE_EXTRA_NODES_H_
25#define _GEMA_FILE_EXTRA_NODES_H_
26
27#include <QVector>
28#include <assert.h>
29
30#include <gmCell.h>
31
32class GmCellMesh;
34class GmFileFormat;
35
36
46{
47public:
48 GmFileExtraNodes(const GmFileFormat* fileFormat, const GmCellMesh* mesh, bool activeOnly,
49 const GmCellGroupSet* group, int numMeshNodes, bool useModelOrder);
50
52 int numNodes() const { return _extraNodes.size(); }
53
55 const QPair<int, int>& edgeNodes(int i) const { return _extraNodes[i]; }
56
59
63 int nextNodeIndex() { return _currentIndex++; }
64
66 int lastNodeIndex() const { return _firstIndex + _extraNodes.size() - 1; }
67
69 static bool transformationExists(GmCellType cellType)
70 {
71 return _acceptedTypes.contains(cellType);
72 }
73
74private:
76
80};
81
82#endif
83
Interface for helping managing mesh cell groups and returning the elements in their union.
Definition gmCellGroupSet.h:35
Base interface class for CellMesh type plugins.
Definition gmCellMesh.h:40
An auxiliary class for emiting extra mesh nodes needed by standard GeMA element transformations that ...
Definition gmFileExtraNodes.h:46
int numNodes() const
Returns the number of extra nodes.
Definition gmFileExtraNodes.h:52
int _firstIndex
The exported index for the first extra node.
Definition gmFileExtraNodes.h:78
const QPair< int, int > & edgeNodes(int i) const
Returns the mesh node indices for the endpoints of the edge where the i'th extra node was created.
Definition gmFileExtraNodes.h:55
int lastNodeIndex() const
Returns the index of the last valid extra node index.
Definition gmFileExtraNodes.h:66
static QVector< GmCellType > _acceptedTypes
The set of types that we can handle.
Definition gmFileExtraNodes.h:33
void resetNext()
Resets the value that will be returned by nextNodeIndex() to the first extra node index.
Definition gmFileExtraNodes.h:58
GmFileExtraNodes(const GmFileFormat *fileFormat, const GmCellMesh *mesh, bool activeOnly, const GmCellGroupSet *group, int numMeshNodes, bool useModelOrder)
Constructor. Gets as parameter the file format object used to define which element types need transfo...
Definition gmFileExtraNodes.cpp:52
int nextNodeIndex()
Each call returns the next extra node index. The series starts with the exported index for the first ...
Definition gmFileExtraNodes.h:63
QVector< QPair< int, int > > _extraNodes
Set of extra nodes created for element transformations.
Definition gmFileExtraNodes.h:77
int _currentIndex
The "current" extra node index returned by nextNodeIndex()
Definition gmFileExtraNodes.h:79
static bool transformationExists(GmCellType cellType)
Returns true if this class implements a standard transformation for the given type.
Definition gmFileExtraNodes.h:69
Basic interface for describing high level file format capabilities.
Definition gmFileFormat.h:35
Declaration of the GmCell class.
GmCellType
Mesh Cell types. Don't change type orders or add types without reading comments below.
Definition gmCellType.h:31
bool contains(const T &value) const const
int size() const const