GemaCoreLib
The GeMA Core library
Public Member Functions | List of all members
GmSpatialIndex Class Referenceabstract

Base interface class for Spatial Index type plugins. More...

#include <gmSpatialIndex.h>

Inheritance diagram for GmSpatialIndex:
Inheritance graph
[legend]
Collaboration diagram for GmSpatialIndex:
Collaboration graph
[legend]

Public Member Functions

 GmSpatialIndex (GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger)
 Constructor. More...
 
virtual ~GmSpatialIndex ()
 Virtual destructor.
 
virtual const char * pluginCategory () const
 Returns the plugin category.
 
virtual bool hasCapability (QString capabilityName) const =0
 This function should return true or false to indicate whether the spatial index supports the requested capability or not. Capabilities are refered by string names in order to enable derived interfaces to extend the available capabilities that can be queried. More...
 
virtual GmMeshmesh () const =0
 Returns the mesh that this index is tied to.
 
virtual const GmValueAccessorcoordAccessor () const =0
 Returns the coordinate accessor stored by the spatial index. Using this accessor ensures that queries are done in the SAME unit as the one used by the spatial index.
 
virtual bool activeOnly () const =0
 For the nearestGauss and containingCell capabilities, does this index considers only active cells or all cells?
 
virtual int ruleSet () const =0
 For the nearestGauss capability, returns the rule set of the indexed Gauss points. Returns 0 otherwise.
 
virtual bool isOutsideOfDomain (const GmVector &crd) const =0
 Returns true if the given point is outside of the spatial index domain.
 
virtual int numReferences () const =0
 Returns the number of nodes, cells or gauss points stored at the index.
 
virtual int getClosestNode (const GmVector &crd, double &sqrDist) const =0
 Returns the id of the closest node to the given coordinate, also filling sqrDist with the square of the Euclidian distance between them. MUST be implemented if the 'nearestNode' capability is supported.
 
virtual void getClosestNodes (const GmVector &crd, int n, QList< int > &nodeList, QList< double > &sdList) const =0
 Returns the ids of the n closest nodes, together with their squared distances, in distance order.
 
virtual void getClosestNodes (const GmVector &crd, double r, QList< int > &nodeList, QList< double > &sdList) const =0
 Returns the ids of the nodes whose distances to crd are less than radius, together with their squared distances, in distance order.
 
virtual GmCellgetContainingCell (const GmVector &crd) const =0
 Returns a pointer to the cell in which the given point falls in. MUST be implemented if the 'containingCell' capability is supported.
 
virtual QPair< int, int > getClosestGaussPoint (const GmVector &crd, double &sqrDist) const =0
 Returns the ids of the closest gauss point, together with its squared distance. MUST be implemented if the 'nearestGauss' capability is supported.
 
virtual void getClosestGaussPoints (const GmVector &crd, int n, QList< QPair< int, int > > &gpList, QList< double > &sdList) const =0
 Returns the ids of the n closest gauss points, together with their squared distances, in distance order.
 
virtual void getClosestGaussPoints (const GmVector &crd, double r, QList< QPair< int, int > > &gpList, QList< double > &sdList) const =0
 Returns the ids of the gauss points whose distance to crd are less than radius, together with their squared distances, in distance order.
 
virtual void printParameters (const GmLogCategory &logger)
 Asks the spatial index to print all of its parameters using the provided logger. More...
 
- Public Member Functions inherited from GmPluginObject
 GmPluginObject (GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger)
 Constructor. More...
 
virtual ~GmPluginObject ()
 Destructor.
 
QString id () const
 Returns the object id.
 
QString description () const
 Returns the object description.
 
QString pluginTypeName () const
 Returns the hierarchical type name for the plugin object type. See also pluginName() and pluginType().
 
virtual const char * pluginName () const =0
 Returns a string identifying the plugin which implements this object. Should return the SAME string as the one read from the plugin information file in the pluginName field.
 
virtual const char * pluginType () const =0
 Returns the string identifying the plugin object type. Should return the SAME string as the one read from the plugin information file in the objectTypes table. More...
 
virtual bool loadPrivateData (LuaTable &table)=0
 Function called by the model loader to give the object acess to it's private parameters. Should return false only if the received parameter set makes the use of this object impossible.
 

Additional Inherited Members

- Protected Member Functions inherited from GmPluginObject
virtual const GmLogCategorylogger () const
 Returns the internal logger used by the plugin to emmit messages.
 
GmSimulationDatasimulationData () const
 Returns a reference to the simulation data object keeping global simulation information.
 

Detailed Description

Base interface class for Spatial Index type plugins.

Constructor & Destructor Documentation

◆ GmSpatialIndex()

GmSpatialIndex::GmSpatialIndex ( GmSimulationData simulation,
QString  id,
QString  description,
const GmLogCategory logger 
)

Constructor.

Parameters
simulationReference to the simulation object.
idSpatial index id.
descriptionSpatial index description.
loggerPlugin logger object used to emmit messages

Member Function Documentation

◆ hasCapability()

virtual bool GmSpatialIndex::hasCapability ( QString  capabilityName) const
pure virtual

This function should return true or false to indicate whether the spatial index supports the requested capability or not. Capabilities are refered by string names in order to enable derived interfaces to extend the available capabilities that can be queried.

Standard capability names: nearestNode - Does the index supports querying the nearest nodes from a given coordinate? nearestGauss - Does the index supports querying the nearest Gauss points from a given coordinate? containingCell - Does the index supports querying the cell that contains a given coordinate?

◆ printParameters()

void GmSpatialIndex::printParameters ( const GmLogCategory logger)
virtual

Asks the spatial index to print all of its parameters using the provided logger.

The default implementation logs the data, as seen through the access interface;

Implements GmPluginObject.


The documentation for this class was generated from the following files: