Walls And Holes  1
M2MPropertyInstance Class Reference

The M2MPropertyInstance class represents an instance of a property class in Tima's map2mesh code. More...

#include <m2mpropertyinstance.h>

Collaboration diagram for M2MPropertyInstance:

Public Types

using ParamTriplet = Triplet< M2MPropertyClass *, QString, float >
 

Public Member Functions

double getParameter (M2MPropertyClass *owningClass, QString param) const
 Gets the value of the parameter. More...
 
M2MPropertyClassgetClass () const
 Get the class of the instance. More...
 
bool operator== (const M2MPropertyInstance &other) const
 
bool operator!= (const M2MPropertyInstance &other) const
 

Static Public Member Functions

static M2MPropertyInstance createInstance (M2MPropertyClass *ofClass)
 Creates an instance of the class with default parameter values. More...
 
static M2MPropertyInstance createInstance (M2MPropertyClass *ofClass, QVector< ParamTriplet > params)
 Creates an instance of the class with the given parameter values. More...
 

Protected Member Functions

 M2MPropertyInstance ()
 

Protected Attributes

M2MPropertyClassmClassPtr
 A pointer to the class that this is directly an instance of. More...
 
QMap< M2MPropertyClass *, QMap< QString, double > > mParameters
 The parameters for this object. All parameters are double values. More...
 

Detailed Description

The M2MPropertyInstance class represents an instance of a property class in Tima's map2mesh code.

Member Typedef Documentation

◆ ParamTriplet

Constructor & Destructor Documentation

◆ M2MPropertyInstance()

M2MPropertyInstance::M2MPropertyInstance ( )
protected

Member Function Documentation

◆ createInstance() [1/2]

M2MPropertyInstance M2MPropertyInstance::createInstance ( M2MPropertyClass ofClass)
static

Creates an instance of the class with default parameter values.

The reason this method is in M2MPropertyInstance instead of M2MPropertyClass is so that nonpublic attributes can be set.

Parameters
ofClassThe parent class of the instance.
Returns
An instance of the given class.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createInstance() [2/2]

M2MPropertyInstance M2MPropertyInstance::createInstance ( M2MPropertyClass ofClass,
QVector< ParamTriplet params 
)
static

Creates an instance of the class with the given parameter values.

Parameters
ofClassThe parent class of the instance.
paramsThe parameters to supply. Format for each entry is {{class, param name}, param value}. Unspecified parameters remain at their default values.
Returns
An instance of the given class.
Here is the call graph for this function:

◆ getClass()

M2MPropertyClass * M2MPropertyInstance::getClass ( ) const

Get the class of the instance.

Returns
The class.
Here is the caller graph for this function:

◆ getParameter()

double M2MPropertyInstance::getParameter ( M2MPropertyClass owningClass,
QString  param 
) const

Gets the value of the parameter.

Parameters
owningClassThe class that defines the parameter.
paramThe name of the parameter.
Returns
The value of the parameter for this instance.

◆ operator!=()

bool M2MPropertyInstance::operator!= ( const M2MPropertyInstance other) const

◆ operator==()

bool M2MPropertyInstance::operator== ( const M2MPropertyInstance other) const

Member Data Documentation

◆ mClassPtr

M2MPropertyClass* M2MPropertyInstance::mClassPtr
protected

A pointer to the class that this is directly an instance of.

◆ mParameters

QMap<M2MPropertyClass *, QMap<QString, double> > M2MPropertyInstance::mParameters
protected

The parameters for this object. All parameters are double values.

mParameters maps classes to parameter dictionaries. Every superclass of this instance must be accounted for.


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