GemaCoreLib
The GeMA Core library
gmSpatialIndex.h
Go to the documentation of this file.
1 /************************************************************************
2 **
3 ** Copyright (C) 2015 by Erwan Yann Renaut
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_SPATIAL_INDEX_H_
25 #define _GEMA_SPATIAL_INDEX_H_
26 
27 #include "gmPluginObject.h"
28 #include "gmPluginCategory.h"
29 
30 #include "gmVector.h"
31 
32 class GmMesh;
33 class GmCell;
34 class GmValueAccessor;
35 
38 {
39 public:
40  GmSpatialIndex(GmSimulationData* simulation, QString id, QString description, const GmLogCategory& logger);
41  virtual ~GmSpatialIndex();
42 
43  // Comments on the base class
44  virtual const char* pluginCategory() const { return GM_PLUGIN_SPATIALINDEX; }
45 
56  virtual bool hasCapability(QString capabilityName) const = 0;
57 
59  virtual GmMesh* mesh() const = 0;
60 
65  virtual const GmValueAccessor* coordAccessor() const = 0;
66 
68  virtual bool activeOnly() const = 0;
69 
71  virtual int ruleSet() const = 0;
72 
74  virtual bool isOutsideOfDomain(const GmVector& crd) const = 0;
75 
77  virtual int numReferences() const = 0;
78 
83  virtual int getClosestNode(const GmVector& crd, double& sqrDist) const = 0;
84 
86  virtual void getClosestNodes(const GmVector& crd, int n, QList<int>& nodeList, QList<double>& sdList) const = 0;
87 
89  virtual void getClosestNodes(const GmVector& crd, double r, QList<int>& nodeList, QList<double>& sdList) const = 0;
90 
94  virtual GmCell* getContainingCell(const GmVector& crd) const = 0;
95 
99  virtual QPair<int, int> getClosestGaussPoint(const GmVector& crd, double& sqrDist) const = 0;
100 
102  virtual void getClosestGaussPoints(const GmVector& crd, int n, QList< QPair<int, int> >& gpList, QList<double>& sdList) const = 0;
103 
105  virtual void getClosestGaussPoints(const GmVector& crd, double r, QList< QPair<int, int> >& gpList, QList<double>& sdList) const = 0;
106 
107  virtual void printParameters(const GmLogCategory& logger);
108 };
109 
110 
111 #endif // _GEMA_SPATIAL_INDEX_H_
Declaration of the GmPluginObject base class.
Base interface for mesh cells.
Definition: gmCell.h:81
virtual const char * pluginCategory() const
Returns the plugin category.
Definition: gmSpatialIndex.h:44
Interface class for accessing and setting values from an "indexable" collection of values.
Definition: gmValueAccessor.h:59
Auxiliar class used to store the complete set of simulation data.
Definition: gmSimulationData.h:51
virtual void printParameters(const GmLogCategory &logger)=0
Asks the object to print all of its parameters using the provided logger.
Definition: gmPluginObject.cpp:62
Base interface class for Spatial Index type plugins.
Definition: gmSpatialIndex.h:37
#define GM_PLUGIN_SPATIALINDEX
Plugin implements spatial indices.
Definition: gmPluginCategory.h:32
Declaration of macros for standard plugin categories.
Base interface class for all object plugins.
Definition: gmPluginObject.h:36
Declaration of the GmVector class.
#define GMC_API_EXPORT
Macro for controling if the class is being exported (GEMA_CORE_LIB defined) or imported (GEMA_CORE_LI...
Definition: gmCoreConfig.h:35
Class representing a category with multiple logging levels.
Definition: gmLog.h:58
arma::vec GmVector
The basic type for a GeMA vector object. Currently based on an Armadillo vector.
Definition: gmVector.h:34
Base interface class for Mesh type plugins.
Definition: gmMesh.h:44