Mantid
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
Mantid::Geometry::ParameterMap Class Reference

ParameterMap class. More...

#include <ParameterMap.h>

Public Types

using pmap = tbb::concurrent_unordered_multimap< ComponentID, std::shared_ptr< Parameter > >
 Parameter map typedef. More...
 
using pmap_cit = tbb::concurrent_unordered_multimap< ComponentID, std::shared_ptr< Parameter > >::const_iterator
 Parameter map iterator typedef. More...
 
using pmap_it = tbb::concurrent_unordered_multimap< ComponentID, std::shared_ptr< Parameter > >::iterator
 Parameter map iterator typedef. More...
 

Public Member Functions

void add (const IComponent *comp, const std::shared_ptr< Parameter > &par, const std::string *const pDescription=nullptr)
 Method for adding a parameter providing shared pointer to it. More...
 
void add (const std::string &type, const IComponent *comp, const std::string &name, const std::string &value, const std::string *const pDescription=nullptr, const std::string &visible="true")
 Method for adding a parameter providing its value as a string. More...
 
template<class T >
void add (const std::string &type, const IComponent *comp, const std::string &name, const T &value, const std::string *const pDescription=nullptr, const std::string &pVisible="true")
 Method for adding a parameter providing its value of a particular type. More...
 
void clear ()
 Clears the map. More...
 
void clearParametersByName (const std::string &name)
 Clear any parameters with the given name. More...
 
void clearParametersByName (const std::string &name, const IComponent *comp)
 Clear any parameters with the given name for a specified component. More...
 
const std::string diff (const ParameterMap &rhs, const bool &firstDiffOnly=false, const bool relative=false, const double doubleTolerance=Kernel::Tolerance) const
 Output information that helps understanding the mismatch between two parameter maps. More...
 
bool empty () const
 Returns true if the map is empty, false otherwise. More...
 
bool operator!= (const ParameterMap &rhs) const
 Inquality comparison operator. More...
 
bool operator== (const ParameterMap &rhs) const
 Equality comparison operator. More...
 
 ParameterMap ()
 Default constructor. More...
 
 ParameterMap (const ParameterMap &other)
 Const constructor. More...
 
int size () const
 Return the size of the map. More...
 
void swap (ParameterMap &other)
 method swaps two parameter maps contents each other. More...
 
 ~ParameterMap ()
 

Static Public Member Functions

static const std::string & pBool ()
 
static const std::string & pDouble ()
 
static const std::string & pInt ()
 
static const std::string & pos ()
 Return string to be used in the map. More...
 
static const std::string & posx ()
 
static const std::string & posy ()
 
static const std::string & posz ()
 
static const std::string & pQuat ()
 
static const std::string & pString ()
 
static const std::string & pV3D ()
 
static const std::string & rot ()
 
static const std::string & rotx ()
 
static const std::string & roty ()
 
static const std::string & rotz ()
 
static const std::string & scale ()
 

Helper methods for adding and updating parameter types <br>

std::vector< std::string > m_parameterFileNames
 internal list of parameter files loaded More...
 
pmap m_map
 internal parameter map instance More...
 
std::unique_ptr< Kernel::Cache< const ComponentID, Kernel::V3D > > m_cacheLocMap
 internal cache map instance for cached position values More...
 
std::unique_ptr< Kernel::Cache< const ComponentID, Kernel::Quat > > m_cacheRotMap
 internal cache map instance for cached rotation values More...
 
std::unique_ptr< Geometry::DetectorInfom_detectorInfo
 Pointer to the DetectorInfo wrapper. More...
 
std::unique_ptr< Geometry::ComponentInfom_componentInfo
 Pointer to the ComponentInfo wrapper. More...
 
const Instrumentm_instrument {nullptr}
 Pointer to the owning instrument for translating detector IDs into detector indices when accessing the DetectorInfo object. More...
 
void addPositionCoordinate (const IComponent *comp, const std::string &name, const double value, const std::string *const pDescription=nullptr)
 Create or adjust "pos" parameter for a component. More...
 
void addRotationParam (const IComponent *comp, const std::string &name, const double deg, const std::string *const pDescription=nullptr)
 Create or adjust "rot" parameter for a component. More...
 
void addDouble (const IComponent *comp, const std::string &name, const std::string &value, const std::string *const pDescription=nullptr, const std::string &pVisible="true")
 Adds a double value to the parameter map. More...
 
void addDouble (const IComponent *comp, const std::string &name, double value, const std::string *const pDescription=nullptr, const std::string &pVisible="true")
 Adds a double value to the parameter map. More...
 
void addInt (const IComponent *comp, const std::string &name, const std::string &value, const std::string *const pDescription=nullptr, const std::string &pVisible="true")
 Adds an int value to the parameter map. More...
 
void addInt (const IComponent *comp, const std::string &name, int value, const std::string *const pDescription=nullptr, const std::string &pVisible="true")
 Adds an int value to the parameter map. More...
 
void addBool (const IComponent *comp, const std::string &name, const std::string &value, const std::string *const pDescription=nullptr, const std::string &pVisible="true")
 Adds a bool value to the parameter map. More...
 
void addBool (const IComponent *comp, const std::string &name, bool value, const std::string *const pDescription=nullptr, const std::string &pVisible="true")
 Adds a bool value to the parameter map. More...
 
void addString (const IComponent *comp, const std::string &name, const std::string &value, const std::string *const pDescription=nullptr, const std::string &pVisible="true")
 Adds a std::string value to the parameter map. More...
 
void addV3D (const IComponent *comp, const std::string &name, const std::string &value, const std::string *const pDescription=nullptr)
 Adds a Kernel::V3D value to the parameter map. More...
 
void addV3D (const IComponent *comp, const std::string &name, const Kernel::V3D &value, const std::string *const pDescription=nullptr)
 Adds a V3D value to the parameter map. More...
 
void addQuat (const IComponent *comp, const std::string &name, const Kernel::Quat &value, const std::string *const pDescription=nullptr)
 Adds a Kernel::Quat value to the parameter map. More...
 
void forceUnsafeSetMasked (const IComponent *comp, bool value)
 Force adding masking information. More...
 
bool contains (const IComponent *comp, const std::string &name, const std::string &type="") const
 Does the named parameter exist for the given component and type (std::string version) More...
 
bool contains (const IComponent *comp, const char *name, const char *type="") const
 Does the named parameter exist for the given component (c-string version) More...
 
bool contains (const IComponent *comp, const Parameter &parameter) const
 Does the given parameter & component combination exist. More...
 
std::shared_ptr< Parameterget (const IComponent *comp, const std::string &name, const std::string &type="") const
 Get a parameter with a given name and type (std::string version) More...
 
std::shared_ptr< Parameterget (const IComponent *comp, const char *name, const char *type="") const
 Get a parameter with a given name and type (c-string version) More...
 
std::shared_ptr< ParametergetByType (const IComponent *comp, const std::string &type) const
 Finds the parameter in the map via the parameter type. More...
 
std::shared_ptr< ParametergetRecursive (const IComponent *comp, const std::string &name, const std::string &type="") const
 Use get() recursively to see if can find param in all parents of comp and given type (std::string version) More...
 
std::shared_ptr< ParametergetRecursive (const IComponent *comp, const char *name, const char *type="") const
 Use get() recursively to see if can find param in all parents of comp and given type (const char type) More...
 
std::shared_ptr< ParametergetRecursiveByType (const IComponent *comp, const std::string &type) const
 Looks recursively upwards in the component tree for the first instance of a parameter with a specified type. More...
 
template<class T >
std::vector< T > getType (const std::string &compName, const std::string &name) const
 Get the values of a given parameter of all the components that have the name: compName. More...
 
const std::string getDescription (const std::string &compName, const std::string &name) const
 Get the component description by name. More...
 
const std::string getShortDescription (const std::string &compName, const std::string &name) const
 Get the component tooltip by name. More...
 
std::string getString (const IComponent *comp, const std::string &name, bool recursive=false) const
 Return the value of a parameter as a string. More...
 
std::vector< std::string > getString (const std::string &compName, const std::string &name) const
 Returns a string parameter as vector's first element if exists and an empty vector if it doesn't. More...
 
std::vector< double > getDouble (const std::string &compName, const std::string &name) const
 Returns a double parameter as vector's first element if exists and an empty vector if it doesn't. More...
 
std::vector< Kernel::V3DgetV3D (const std::string &compName, const std::string &name) const
 Returns a Kernel::V3D parameter as vector's first element if exists and an empty vector if it doesn't. More...
 
std::set< std::string > names (const IComponent *comp) const
 Returns a set with all parameter names for component. More...
 
std::string asString () const
 Returns a string with all component names, parameter names and values. More...
 
void clearPositionSensitiveCaches ()
 Clears the location, rotation & bounding box caches. More...
 
void setCachedLocation (const IComponent *comp, const Kernel::V3D &location) const
 Sets a cached location on the location cache. More...
 
bool getCachedLocation (const IComponent *comp, Kernel::V3D &location) const
 Attempts to retrieve a location from the location cache. More...
 
void setCachedRotation (const IComponent *comp, const Kernel::Quat &rotation) const
 Sets a cached rotation on the rotation cache. More...
 
bool getCachedRotation (const IComponent *comp, Kernel::Quat &rotation) const
 Attempts to retrieve a rotation from the rotation cache. More...
 
void saveNexus (::NeXus::File *file, const std::string &group) const
 Persist a representation of the Parameter map to the open Nexus file. More...
 
void copyFromParameterMap (const IComponent *oldComp, const IComponent *newComp, const ParameterMap *oldPMap)
 Copy pairs (oldComp->id,Parameter) to the m_map assigning the new newComp->id. More...
 
const std::vector< std::string > & getParameterFilenames () const
 Returns a list of all the parameter files loaded. More...
 
void addParameterFilename (const std::string &filename)
 adds a parameter filename that has been loaded More...
 
pmap_it begin ()
 access iterators. begin; More...
 
pmap_cit begin () const
 
pmap_it end ()
 access iterators. end; More...
 
pmap_cit end () const
 
bool hasDetectorInfo (const Instrument *instrument) const
 Only for use by ExperimentInfo. More...
 
bool hasComponentInfo (const Instrument *instrument) const
 Only for use by ExperimentInfo. More...
 
const Geometry::DetectorInfodetectorInfo () const
 Only for use by ExperimentInfo. Returns a reference to the DetectorInfo. More...
 
Geometry::DetectorInfomutableDetectorInfo ()
 Only for use by ExperimentInfo. Returns a reference to the DetectorInfo. More...
 
const Geometry::ComponentInfocomponentInfo () const
 Only for use by ExperimentInfo. Returns a reference to the ComponentInfo. More...
 
Geometry::ComponentInfomutableComponentInfo ()
 Only for use by ExperimentInfo. Returns a reference to the ComponentInfo. More...
 
size_t detectorIndex (const detid_t detID) const
 Only for use by Detector. Returns a detector index for a detector ID. More...
 
size_t componentIndex (const Geometry::ComponentID componentId) const
 
const std::vector< Geometry::ComponentID > & componentIds () const
 
void setInstrument (const Instrument *instrument)
 Only for use by Instrument. Sets the pointer to the owning instrument. More...
 
std::shared_ptr< Parametercreate (const std::string &className, const std::string &name, const std::string &visible="true") const
 Wrapper for ParameterFactory::create to avoid include in header. More...
 
ParameterMapoperator= (ParameterMap *rhs)
 Assignment operator. More...
 
component_map_it positionOf (const IComponent *comp, const char *name, const char *type)
 internal function to get position of the parameter in the parameter map More...
 
component_map_cit positionOf (const IComponent *comp, const char *name, const char *type) const
 const version of the internal function to get position of the parameter in the parameter map More...
 
bool relErr (double x1, double x2, double errorVal) const
 calculate relative error for use in diff More...
 

Detailed Description

ParameterMap class.

Holds the parameters of modified (parametrized) instrument components. ParameterMap has a number of 'add' methods for adding parameters of different types.

Author
Roman Tolchenov, Tessella Support Services plc
Date
2/12/2008

Definition at line 43 of file ParameterMap.h.

Member Typedef Documentation

◆ pmap

using Mantid::Geometry::ParameterMap::pmap = tbb::concurrent_unordered_multimap<ComponentID, std::shared_ptr<Parameter> >

Parameter map typedef.

Definition at line 46 of file ParameterMap.h.

◆ pmap_cit

using Mantid::Geometry::ParameterMap::pmap_cit = tbb::concurrent_unordered_multimap<ComponentID, std::shared_ptr<Parameter> >::const_iterator

Parameter map iterator typedef.

Definition at line 50 of file ParameterMap.h.

◆ pmap_it

using Mantid::Geometry::ParameterMap::pmap_it = tbb::concurrent_unordered_multimap<ComponentID, std::shared_ptr<Parameter> >::iterator

Parameter map iterator typedef.

Definition at line 48 of file ParameterMap.h.

Constructor & Destructor Documentation

◆ ParameterMap() [1/2]

Mantid::Geometry::ParameterMap::ParameterMap ( )

Default constructor.

Definition at line 63 of file ParameterMap.cpp.

◆ ParameterMap() [2/2]

Mantid::Geometry::ParameterMap::ParameterMap ( const ParameterMap other)

Const constructor.

Definition at line 67 of file ParameterMap.cpp.

References m_componentInfo, m_detectorInfo, m_instrument, and Mantid::Geometry::Instrument::makeBeamline().

◆ ~ParameterMap()

Mantid::Geometry::ParameterMap::~ParameterMap ( )
default

Member Function Documentation

◆ add() [1/3]

void Mantid::Geometry::ParameterMap::add ( const IComponent comp,
const std::shared_ptr< Parameter > &  par,
const std::string *const  pDescription = nullptr 
)

Method for adding a parameter providing shared pointer to it.

Method for adding/replacing a parameter providing shared pointer to it.

The class stores share pointer and increment ref count to it

Parameters
comp:: A pointer to the component that this parameter is attached to
par:: a shared pointer to existing parameter. The ParameterMap stores share pointer and increment ref count to it
pDescription:: a pointer (may be NULL) to a string, containing parameter's description. If provided, the contents of the string is copied to the parameters memory

Definition at line 359 of file ParameterMap.cpp.

References Mantid::Geometry::IComponent::getComponentID(), m_map, and positionOf().

◆ add() [2/3]

void Mantid::Geometry::ParameterMap::add ( const std::string &  type,
const IComponent comp,
const std::string &  name,
const std::string &  value,
const std::string *const  pDescription = nullptr,
const std::string &  pVisible = "true" 
)

Method for adding a parameter providing its value as a string.

Add a value into the map.

Parameters
type:: A string denoting the type, e.g. double, string, fitting
comp:: A pointer to the component that this parameter is attached to
name:: The name of the parameter
value:: The parameter's value
pDescription:: a pointer (may be NULL) to a string, containing parameter's description. If provided, the contents of the string is copied to the parameters memory
pVisible:: Whether the parameter should be visible in InstrumentViewer

Definition at line 345 of file ParameterMap.cpp.

References add(), Mantid::Geometry::ParameterFactory::create(), and value.

Referenced by add(), addBool(), addDouble(), addInt(), addQuat(), addV3D(), Mantid::Algorithms::CopyInstrumentParameters::exec(), and Mantid::API::ExperimentInfo::populateWithParameter().

◆ add() [3/3]

template<class T >
void Mantid::Geometry::ParameterMap::add ( const std::string &  type,
const IComponent comp,
const std::string &  name,
const T &  value,
const std::string *const  pDescription = nullptr,
const std::string &  pVisible = "true" 
)
inline

Method for adding a parameter providing its value of a particular type.

If a parameter already exists then it is replaced with a new one of the given type and value

Template Parameters
TThe concrete type
Parameters
type:: A string denoting the type, e.g. double, string, fitting
comp:: A pointer to the component that this parameter is attached to
name:: The name of the parameter
value:: The parameter's value
pDescription:: if present, the constant pointer to a constant string, containing parameter's description.
pVisible:: if present, defines whether the parameter should be visible in InstrumentViewer

Definition at line 121 of file ParameterMap.h.

References Mantid::DataObjects::create(), and value.

◆ addBool() [1/2]

void Mantid::Geometry::ParameterMap::addBool ( const IComponent comp,
const std::string &  name,
bool  value,
const std::string *const  pDescription = nullptr,
const std::string &  pVisible = "true" 
)

Adds a bool value to the parameter map.

Parameters
comp:: Component to which the new parameter is related
name:: Name for the new parameter
value:: Parameter value as a bool
pDescription:: a pointer (may be NULL) to a string, containing parameter's description. If provided, the contents of the string is copied to the parameter's memory
pVisible:: Whether the parameter should be visible in InstrumentViewer

Definition at line 569 of file ParameterMap.cpp.

References add(), pBool(), and value.

◆ addBool() [2/2]

void Mantid::Geometry::ParameterMap::addBool ( const IComponent comp,
const std::string &  name,
const std::string &  value,
const std::string *const  pDescription = nullptr,
const std::string &  pVisible = "true" 
)

Adds a bool value to the parameter map.

Parameters
comp:: Component to which the new parameter is related
name:: Name for the new parameter
value:: Parameter value as a string
pDescription:: a pointer (may be NULL) to a string, containing parameter's description. If provided, the contents of the string is copied to the parameters memory
pVisible:: Whether the parameter should be visible in InstrumentViewer

Definition at line 556 of file ParameterMap.cpp.

References add(), pBool(), and value.

Referenced by Mantid::API::ExperimentInfo::populateWithParameter().

◆ addDouble() [1/2]

void Mantid::Geometry::ParameterMap::addDouble ( const IComponent comp,
const std::string &  name,
const std::string &  value,
const std::string *const  pDescription = nullptr,
const std::string &  pVisible = "true" 
)

Adds a double value to the parameter map.

Parameters
comp:: Component to which the new parameter is related
name:: Name for the new parameter
value:: Parameter value as a string
pDescription:: a pointer (may be NULL) to a string, containing parameter's description. If provided, the contents of the string is copied to the parameter's memory
pVisible:: Whether the parameter should be visible in InstrumentViewer

Definition at line 500 of file ParameterMap.cpp.

References add(), pDouble(), and value.

Referenced by addRotationParam(), and Mantid::API::ExperimentInfo::populateWithParameter().

◆ addDouble() [2/2]

void Mantid::Geometry::ParameterMap::addDouble ( const IComponent comp,
const std::string &  name,
double  value,
const std::string *const  pDescription = nullptr,
const std::string &  pVisible = "true" 
)

Adds a double value to the parameter map.

Parameters
comp:: Component to which the new parameter is related
name:: Name for the new parameter
value:: Parameter value as a double
pDescription:: a pointer (may be NULL) to a string, containing parameter's description. If provided, the contents of the string is copied to the parameter's memory
pVisible:: Whether the parameter should be visible in InstrumentViewer

Definition at line 514 of file ParameterMap.cpp.

References add(), pDouble(), and value.

◆ addInt() [1/2]

void Mantid::Geometry::ParameterMap::addInt ( const IComponent comp,
const std::string &  name,
const std::string &  value,
const std::string *const  pDescription = nullptr,
const std::string &  pVisible = "true" 
)

Adds an int value to the parameter map.

Parameters
comp:: Component to which the new parameter is related
name:: Name for the new parameter
value:: Parameter value as a string
pDescription:: a pointer (may be NULL) to a string, containing parameter's description. If provided, the contents of the string is copied to the parameters memory
pVisible:: Whether the parameter should be visible in InstrumentViewer

Definition at line 528 of file ParameterMap.cpp.

References add(), pInt(), and value.

Referenced by Mantid::API::ExperimentInfo::populateWithParameter().

◆ addInt() [2/2]

void Mantid::Geometry::ParameterMap::addInt ( const IComponent comp,
const std::string &  name,
int  value,
const std::string *const  pDescription = nullptr,
const std::string &  pVisible = "true" 
)

Adds an int value to the parameter map.

Parameters
comp:: Component to which the new parameter is related
name:: Name for the new parameter
value:: Parameter value as an int
pDescription:: a pointer (may be NULL) to a string, containing parameter's description. If provided, the contents of the string is copied to the parameters memory
pVisible:: Whether the parameter should be visible in InstrumentViewer

Definition at line 542 of file ParameterMap.cpp.

References add(), pInt(), and value.

◆ addParameterFilename()

void Mantid::Geometry::ParameterMap::addParameterFilename ( const std::string &  filename)

adds a parameter filename that has been loaded

Parameters
filenamethe filename to add

Definition at line 1040 of file ParameterMap.cpp.

References m_parameterFileNames.

◆ addPositionCoordinate()

void Mantid::Geometry::ParameterMap::addPositionCoordinate ( const IComponent comp,
const std::string &  name,
const double  value,
const std::string *const  pDescription = nullptr 
)

Create or adjust "pos" parameter for a component.

Create or adjust "pos" parameter for a component Assumed that name either equals "x", "y" or "z" otherwise this method will not add or modify "pos" parameter.

Parameters
comp:: Component
name:: name of the parameter
value:: value
pDescription:: a pointer (may be NULL) to a string, containing parameter's description. If provided, the contents of the string is copied to the parameters memory

Definition at line 400 of file ParameterMap.cpp.

References addV3D(), clearPositionSensitiveCaches(), Mantid::Geometry::g_log, get(), Mantid::Geometry::IComponent::getPos(), pos(), position, posx(), posy(), posz(), value, and Mantid::Kernel::Logger::warning().

Referenced by Mantid::API::ExperimentInfo::populateWithParameter().

◆ addQuat()

void Mantid::Geometry::ParameterMap::addQuat ( const IComponent comp,
const std::string &  name,
const Kernel::Quat value,
const std::string *const  pDescription = nullptr 
)

Adds a Kernel::Quat value to the parameter map.

Adds a Quat value to the parameter map.

Parameters
comp:: Component to which the new parameter is related
name:: Name for the new parameter
value:: Parameter value as a Quat
pDescription:: a pointer (may be NULL) to a string, containing parameter's description. If provided, the contents of the string is copied to the parameter's memory

Definition at line 651 of file ParameterMap.cpp.

References add(), clearPositionSensitiveCaches(), pQuat(), and value.

Referenced by addRotationParam().

◆ addRotationParam()

void Mantid::Geometry::ParameterMap::addRotationParam ( const IComponent comp,
const std::string &  name,
const double  deg,
const std::string *const  pDescription = nullptr 
)

Create or adjust "rot" parameter for a component.

Create or adjust "rot" parameter for a component Assumed that name either equals "rotx", "roty" or "rotz" otherwise this method will not add/modify "rot" parameter.

Parameters
comp:: Component
name:: Parameter name
deg:: Parameter value in degrees
pDescription:: a pointer (may be NULL) to a string, containing parameter's description. If provided, the contents of the string is copied to the parameter's memory

Definition at line 446 of file ParameterMap.cpp.

References addDouble(), addQuat(), clearPositionSensitiveCaches(), Mantid::Geometry::g_log, get(), rot(), rotx(), roty(), rotz(), and Mantid::Kernel::Logger::warning().

Referenced by Mantid::API::ExperimentInfo::populateWithParameter().

◆ addString()

void Mantid::Geometry::ParameterMap::addString ( const IComponent comp,
const std::string &  name,
const std::string &  value,
const std::string *const  pDescription = nullptr,
const std::string &  pVisible = "true" 
)

Adds a std::string value to the parameter map.

Parameters
comp:: Component to which the new parameter is related
name:: Name for the new parameter
value:: Parameter value
pDescription:: a pointer (may be NULL) to a string, containing parameter's description. If provided, the contents of the string is copied to the parameter's memory
pVisible:: Whether the parameter should be visible in InstrumentViewer

Definition at line 610 of file ParameterMap.cpp.

References pString(), and value.

Referenced by Mantid::API::ExperimentInfo::populateWithParameter().

◆ addV3D() [1/2]

void Mantid::Geometry::ParameterMap::addV3D ( const IComponent comp,
const std::string &  name,
const Kernel::V3D value,
const std::string *const  pDescription = nullptr 
)

Adds a V3D value to the parameter map.

Parameters
value:: Parameter value as a Kernel::V3D
comp:: Component to which the new parameter is related
name:: Name for the new parameter
value:: Parameter value as a V3D
pDescription:: a pointer (may be NULL) to a string, containing parameter's description. If provided, the contents of the string is copied to the parameter's memory

Definition at line 637 of file ParameterMap.cpp.

References add(), clearPositionSensitiveCaches(), pV3D(), and value.

◆ addV3D() [2/2]

void Mantid::Geometry::ParameterMap::addV3D ( const IComponent comp,
const std::string &  name,
const std::string &  value,
const std::string *const  pDescription = nullptr 
)

Adds a Kernel::V3D value to the parameter map.

Adds a V3D value to the parameter map.

Parameters
comp:: Component to which the new parameter is related
name:: Name for the new parameter
value:: Parameter value as a string
pDescription:: a pointer (may be NULL) to a string, containing parameter's description. If provided, the contents of the string is copied to the parameter's memory

Definition at line 623 of file ParameterMap.cpp.

References add(), clearPositionSensitiveCaches(), pV3D(), and value.

Referenced by addPositionCoordinate(), and Mantid::API::ExperimentInfo::populateInstrumentParameters().

◆ asString()

std::string Mantid::Geometry::ParameterMap::asString ( ) const

Returns a string with all component names, parameter names and values.

Return a string representation of the parameter map.

The format is either: |detID:id-value;param-type;param-name;param-value| for a detector or |comp-name;param-type;param-name;param-value| for other components.

Returns
A string containing the contents of the parameter map.

Definition at line 930 of file ParameterMap.cpp.

References Mantid::Geometry::IDetector::getID(), and m_map.

Referenced by diff(), Mantid::Algorithms::CopyInstrumentParameters::exec(), and saveNexus().

◆ begin() [1/2]

pmap_it Mantid::Geometry::ParameterMap::begin ( )
inline

access iterators. begin;

Definition at line 278 of file ParameterMap.h.

◆ begin() [2/2]

pmap_cit Mantid::Geometry::ParameterMap::begin ( ) const
inline

Definition at line 279 of file ParameterMap.h.

◆ clear()

void Mantid::Geometry::ParameterMap::clear ( )
inline

Clears the map.

Definition at line 86 of file ParameterMap.h.

◆ clearParametersByName() [1/2]

void Mantid::Geometry::ParameterMap::clearParametersByName ( const std::string &  name)

Clear any parameters with the given name.

Parameters
name:: The name of the parameter

Definition at line 296 of file ParameterMap.cpp.

References clearPositionSensitiveCaches(), m_map, PARALLEL_CRITICAL, pos(), and rot().

◆ clearParametersByName() [2/2]

void Mantid::Geometry::ParameterMap::clearParametersByName ( const std::string &  name,
const IComponent comp 
)

Clear any parameters with the given name for a specified component.

Parameters
name:: The name of the parameter
comp:: The component to clear parameters from

Definition at line 316 of file ParameterMap.cpp.

References clearPositionSensitiveCaches(), Mantid::Geometry::IComponent::getComponentID(), m_map, PARALLEL_CRITICAL, pos(), and rot().

◆ clearPositionSensitiveCaches()

void Mantid::Geometry::ParameterMap::clearPositionSensitiveCaches ( )

Clears the location, rotation & bounding box caches.

Definition at line 953 of file ParameterMap.cpp.

References m_cacheLocMap, and m_cacheRotMap.

Referenced by addPositionCoordinate(), addQuat(), addRotationParam(), addV3D(), and clearParametersByName().

◆ componentIds()

const std::vector< Geometry::ComponentID > & Mantid::Geometry::ParameterMap::componentIds ( ) const

◆ componentIndex()

size_t Mantid::Geometry::ParameterMap::componentIndex ( const Geometry::ComponentID  componentId) const

Definition at line 1102 of file ParameterMap.cpp.

References m_componentInfo.

Referenced by Mantid::Geometry::Component::index().

◆ componentInfo()

const Geometry::ComponentInfo & Mantid::Geometry::ParameterMap::componentInfo ( ) const

◆ contains() [1/3]

bool Mantid::Geometry::ParameterMap::contains ( const IComponent comp,
const char *  name,
const char *  type = "" 
) const

Does the named parameter exist for the given component (c-string version)

Avoids having to instantiate temporary std::string in method below when called with a string directly.

Parameters
comp:: The component to be searched as a c-string
name:: The name of the parameter
type:: The type of the component
Returns
A boolean indicating if the map contains the named parameter.

Definition at line 676 of file ParameterMap.cpp.

References Mantid::Geometry::IComponent::getComponentID(), and m_map.

◆ contains() [2/3]

bool Mantid::Geometry::ParameterMap::contains ( const IComponent comp,
const Parameter parameter 
) const

Does the given parameter & component combination exist.

Parameters
compA pointer to a component
parameterA Parameter object
Returns
true if the combination exists in the map, false otherwise

Definition at line 697 of file ParameterMap.cpp.

References Mantid::Geometry::IComponent::getComponentID(), m_map, and Mantid::Geometry::Parameter::name().

◆ contains() [3/3]

bool Mantid::Geometry::ParameterMap::contains ( const IComponent comp,
const std::string &  name,
const std::string &  type = "" 
) const

Does the named parameter exist for the given component and type (std::string version)

Does the named parameter exist for the given component and given type.

Parameters
comp:: The component to be searched
name:: The name of the parameter
type:: The type of the component as a string
Returns
A boolean indicating if the map contains the named parameter. If the type is given then this must also match

Definition at line 664 of file ParameterMap.cpp.

References contains().

Referenced by contains(), Mantid::API::ExperimentInfo::getEMode(), Mantid::Geometry::Component::getRelativePos(), Mantid::Geometry::GridDetector::getRelativePosAtXYZ(), Mantid::Geometry::Component::getRelativeRot(), Mantid::Geometry::Component::hasParameter(), Mantid::Geometry::GridDetector::xsize(), Mantid::Geometry::GridDetector::xstart(), Mantid::Geometry::GridDetector::xstep(), Mantid::Geometry::GridDetector::ysize(), Mantid::Geometry::GridDetector::ystart(), Mantid::Geometry::GridDetector::ystep(), Mantid::Geometry::GridDetector::zsize(), Mantid::Geometry::GridDetector::zstart(), and Mantid::Geometry::GridDetector::zstep().

◆ copyFromParameterMap()

void Mantid::Geometry::ParameterMap::copyFromParameterMap ( const IComponent oldComp,
const IComponent newComp,
const ParameterMap oldPMap 
)

Copy pairs (oldComp->id,Parameter) to the m_map assigning the new newComp->id.

Parameters
oldComp:: Old component
newComp:: New component
oldPMap:: Old map corresponding to the Old component

Definition at line 995 of file ParameterMap.cpp.

References get(), Mantid::Geometry::IComponent::getComponentID(), m_map, and names().

◆ create()

std::shared_ptr< Parameter > Mantid::Geometry::ParameterMap::create ( const std::string &  className,
const std::string &  name,
const std::string &  visible = "true" 
) const
private

Wrapper for ParameterFactory::create to avoid include in header.

Definition at line 1043 of file ParameterMap.cpp.

References Mantid::Geometry::ParameterFactory::create().

Referenced by forceUnsafeSetMasked().

◆ detectorIndex()

size_t Mantid::Geometry::ParameterMap::detectorIndex ( const detid_t  detID) const

Only for use by Detector. Returns a detector index for a detector ID.

Definition at line 1100 of file ParameterMap.cpp.

References Mantid::Geometry::Instrument::detectorIndex(), and m_instrument.

Referenced by Mantid::Geometry::Detector::index().

◆ detectorInfo()

const Geometry::DetectorInfo & Mantid::Geometry::ParameterMap::detectorInfo ( ) const

Only for use by ExperimentInfo. Returns a reference to the DetectorInfo.

Definition at line 1070 of file ParameterMap.cpp.

References hasDetectorInfo(), m_detectorInfo, and m_instrument.

Referenced by Mantid::Geometry::Instrument::makeBeamline().

◆ diff()

const std::string Mantid::Geometry::ParameterMap::diff ( const ParameterMap rhs,
const bool &  firstDiffOnly = false,
const bool  relative = false,
const double  doubleTolerance = Kernel::Tolerance 
) const

Output information that helps understanding the mismatch between two parameter maps.

To loop through the difference between two very large parameter map can take time, in which you can a hit to what causes the difference faster setting firstDiffOnly to true

Parameters
rhsA reference to a ParameterMap object to compare it to
firstDiffOnlyIf true return only first difference found
relativeIndicates whether to treat the error as relative or absolute
doubleToleranceThe tolerance to use when comparing parameter values of type double
Returns
diff as a string

Definition at line 215 of file ParameterMap.cpp.

References asString(), m_map, relErr(), rhs, size(), and std::to_string().

Referenced by Mantid::Algorithms::CompareWorkspaces::checkInstrument(), and operator==().

◆ empty()

bool Mantid::Geometry::ParameterMap::empty ( ) const
inline

Returns true if the map is empty, false otherwise.

Definition at line 57 of file ParameterMap.h.

Referenced by Mantid::Geometry::InstrumentVisitor::walkInstrument().

◆ end() [1/2]

pmap_it Mantid::Geometry::ParameterMap::end ( )
inline

access iterators. end;

Definition at line 281 of file ParameterMap.h.

◆ end() [2/2]

pmap_cit Mantid::Geometry::ParameterMap::end ( ) const
inline

Definition at line 282 of file ParameterMap.h.

◆ forceUnsafeSetMasked()

void Mantid::Geometry::ParameterMap::forceUnsafeSetMasked ( const IComponent comp,
bool  value 
)

Force adding masking information.

ONLY FOR INTERNAL USE by class Instrument.

ParameterMap usually rejects "legacy style" masking information since it is now stored in DetectorInfo. However, for the purpose of writing files class Instrument needs to insert masking information. This method is only for internal use by class Instrument. ParameterMaps modified by this method are only for use as a temporary.

Definition at line 581 of file ParameterMap.cpp.

References create(), Mantid::Geometry::IComponent::getComponentID(), m_map, pBool(), and value.

◆ get() [1/2]

std::shared_ptr< Parameter > Mantid::Geometry::ParameterMap::get ( const IComponent comp,
const char *  name,
const char *  type = "" 
) const

Get a parameter with a given name and type (c-string version)

Return a named parameter of a given type.

Avoids allocating std::string temporaries

Parameters
comp:: Component to which parameter is related
name:: Parameter name
type:: An optional type string
Returns
The named parameter of the given type if it exists or a NULL shared pointer if not

Definition at line 733 of file ParameterMap.cpp.

References m_map, and positionOf().

◆ get() [2/2]

Parameter_sptr Mantid::Geometry::ParameterMap::get ( const IComponent comp,
const std::string &  name,
const std::string &  type = "" 
) const

◆ getByType()

Parameter_sptr Mantid::Geometry::ParameterMap::getByType ( const IComponent comp,
const std::string &  type 
) const

Finds the parameter in the map via the parameter type.

Look for a parameter in the given component by the type of the parameter.

Parameters
comp:: Component to which parameter is related
type:: Parameter type
Returns
The typed parameter if it exists or a NULL shared pointer if not

m_map.empty()

Definition at line 808 of file ParameterMap.cpp.

References Mantid::Geometry::IComponent::getComponentID(), and m_map.

Referenced by getRecursiveByType().

◆ getCachedLocation()

bool Mantid::Geometry::ParameterMap::getCachedLocation ( const IComponent comp,
Kernel::V3D location 
) const

Attempts to retrieve a location from the location cache.

Parameters
comp:: The Component to find the location of
location:: If the location is found it's value will be set here
Returns
true if the location is in the map, otherwise false

Definition at line 969 of file ParameterMap.cpp.

References Mantid::Geometry::IComponent::getComponentID(), and m_cacheLocMap.

Referenced by Mantid::Geometry::CompAssembly::getPos(), Mantid::Geometry::Component::getPos(), and Mantid::Geometry::ObjCompAssembly::getPos().

◆ getCachedRotation()

bool Mantid::Geometry::ParameterMap::getCachedRotation ( const IComponent comp,
Kernel::Quat rotation 
) const

Attempts to retrieve a rotation from the rotation cache.

Parameters
comp:: The Component to find the rotation of
rotation:: If the rotation is found it's value will be set here
Returns
true if the rotation is in the map, otherwise false

Definition at line 984 of file ParameterMap.cpp.

References Mantid::Geometry::IComponent::getComponentID(), m_cacheRotMap, and rotation.

Referenced by Mantid::Geometry::Component::getPos(), Mantid::Geometry::CompAssembly::getRotation(), Mantid::Geometry::Component::getRotation(), and Mantid::Geometry::ObjCompAssembly::getRotation().

◆ getDescription()

const std::string Mantid::Geometry::ParameterMap::getDescription ( const std::string &  compName,
const std::string &  name 
) const

Get the component description by name.

Parameters
compName:: The name of the component
name:: The name of the parameter
Returns
:: the description for the first parameter found and having non-empty description, or empty string if no description found.

Definition at line 139 of file ParameterMap.cpp.

References get(), and m_map.

◆ getDouble()

std::vector< double > Mantid::Geometry::ParameterMap::getDouble ( const std::string &  compName,
const std::string &  name 
) const
inline

Returns a double parameter as vector's first element if exists and an empty vector if it doesn't.

Parameters
compName:: Component name
name:: Parameter name
Returns
a double parameter from component with the requested name

Definition at line 237 of file ParameterMap.h.

Referenced by Mantid::WorkflowAlgorithms::SofTwoThetaTOF::clarifyAngleStep().

◆ getParameterFilenames()

const std::vector< std::string > & Mantid::Geometry::ParameterMap::getParameterFilenames ( ) const

Returns a list of all the parameter files loaded.

Returns
a vector of the filenames

Definition at line 1035 of file ParameterMap.cpp.

References m_parameterFileNames.

Referenced by Mantid::API::ExperimentInfo::toString().

◆ getRecursive() [1/2]

Parameter_sptr Mantid::Geometry::ParameterMap::getRecursive ( const IComponent comp,
const char *  name,
const char *  type = "" 
) const

Use get() recursively to see if can find param in all parents of comp and given type (const char type)

Find a parameter by name, recursively going up the component tree to higher parents.

Parameters
comp:: The component to start the search with
name:: Parameter name
type:: An optional type string
Returns
the first matching parameter.

Definition at line 867 of file ParameterMap.cpp.

References get(), Mantid::Geometry::IComponent::getComponentID(), and Mantid::Geometry::IComponent::getParent().

◆ getRecursive() [2/2]

Parameter_sptr Mantid::Geometry::ParameterMap::getRecursive ( const IComponent comp,
const std::string &  name,
const std::string &  type = "" 
) const

Use get() recursively to see if can find param in all parents of comp and given type (std::string version)

Find a parameter by name, recursively going up the component tree to higher parents.

Parameters
comp:: The component to start the search with
name:: Parameter name
type:: An optional type string
Returns
the first matching parameter.

Definition at line 854 of file ParameterMap.cpp.

References getRecursive().

Referenced by Mantid::Algorithms::DetectorEfficiencyCor::correctForEfficiency(), Mantid::API::ExperimentInfo::getEFixedForIndirect(), Mantid::Geometry::Component::getParamDescription(), Mantid::Geometry::Component::getParameter(), Mantid::Geometry::Component::getParamShortDescription(), getRecursive(), getString(), and Mantid::Geometry::Component::setDescription().

◆ getRecursiveByType()

Parameter_sptr Mantid::Geometry::ParameterMap::getRecursiveByType ( const IComponent comp,
const std::string &  type 
) const

Looks recursively upwards in the component tree for the first instance of a parameter with a specified type.

Looks recursively upwards in the component tree for the first instance of a component with a matching type.

Parameters
comp:: The component to start the search with
type:: Parameter type
Returns
the first matching parameter.

Definition at line 833 of file ParameterMap.cpp.

References getByType().

◆ getShortDescription()

const std::string Mantid::Geometry::ParameterMap::getShortDescription ( const std::string &  compName,
const std::string &  name 
) const

Get the component tooltip by name.

Get the component short description by name.

Parameters
compName:: The name of the component
name:: The name of the parameter
Returns
:: the short description for the first parameter found and having non-empty description, or empty string if no description found.

Definition at line 161 of file ParameterMap.cpp.

References get(), and m_map.

◆ getString() [1/2]

std::string Mantid::Geometry::ParameterMap::getString ( const IComponent comp,
const std::string &  name,
bool  recursive = false 
) const

Return the value of a parameter as a string.

Parameters
comp:: Component to which parameter is related
name:: Parameter name
recursive:: Whether to travel up the instrument tree if not found at this level
Returns
string representation of the parameter

Definition at line 891 of file ParameterMap.cpp.

References get(), and getRecursive().

Referenced by Mantid::API::ExperimentInfo::getLog(), and Mantid::API::ExperimentInfo::getLogAsSingleValue().

◆ getString() [2/2]

std::vector< std::string > Mantid::Geometry::ParameterMap::getString ( const std::string &  compName,
const std::string &  name 
) const
inline

Returns a string parameter as vector's first element if exists and an empty vector if it doesn't.

Definition at line 227 of file ParameterMap.h.

◆ getType()

template<class T >
std::vector< T > Mantid::Geometry::ParameterMap::getType ( const std::string &  compName,
const std::string &  name 
) const
inline

Get the values of a given parameter of all the components that have the name: compName.

Template Parameters
Theparameter type
Parameters
compName:: The name of the component
name:: The name of the parameter
Returns
all component values from the given component name

Definition at line 205 of file ParameterMap.h.

◆ getV3D()

std::vector< Kernel::V3D > Mantid::Geometry::ParameterMap::getV3D ( const std::string &  compName,
const std::string &  name 
) const
inline

Returns a Kernel::V3D parameter as vector's first element if exists and an empty vector if it doesn't.

Parameters
compName:: Component name
name:: Parameter name
Returns
a Kernel::V3D parameter from component with the requested name

Definition at line 247 of file ParameterMap.h.

◆ hasComponentInfo()

bool Mantid::Geometry::ParameterMap::hasComponentInfo ( const Instrument instrument) const

Only for use by ExperimentInfo.

Returns returns true if this instrument contains a ComponentInfo.

Definition at line 1063 of file ParameterMap.cpp.

References m_componentInfo, and m_instrument.

Referenced by componentInfo(), Mantid::Geometry::Instrument::getBoundingBox(), Mantid::Geometry::Component::hasComponentInfo(), Mantid::Geometry::Instrument::makeBeamline(), and mutableComponentInfo().

◆ hasDetectorInfo()

bool Mantid::Geometry::ParameterMap::hasDetectorInfo ( const Instrument instrument) const

Only for use by ExperimentInfo.

Returns returns true if this instrument contains a DetectorInfo.

The instrument argument is needed for the special case of having a neutronic and* a physical instrument. Instrument uses the same parameter map for both, but the DetectorInfo is only for the neutronic instrument.

Definition at line 1054 of file ParameterMap.cpp.

References m_detectorInfo, and m_instrument.

Referenced by detectorInfo(), Mantid::Geometry::Detector::hasDetectorInfo(), and mutableDetectorInfo().

◆ mutableComponentInfo()

Geometry::ComponentInfo & Mantid::Geometry::ParameterMap::mutableComponentInfo ( )

Only for use by ExperimentInfo. Returns a reference to the ComponentInfo.

Definition at line 1092 of file ParameterMap.cpp.

References hasComponentInfo(), m_componentInfo, and m_instrument.

◆ mutableDetectorInfo()

Geometry::DetectorInfo & Mantid::Geometry::ParameterMap::mutableDetectorInfo ( )

Only for use by ExperimentInfo. Returns a reference to the DetectorInfo.

Definition at line 1077 of file ParameterMap.cpp.

References hasDetectorInfo(), m_detectorInfo, and m_instrument.

◆ names()

std::set< std::string > Mantid::Geometry::ParameterMap::names ( const IComponent comp) const

Returns a set with all parameter names for component.

Returns a set with all the parameter names for the given component.

Parameters
comp:: A pointer to the component of interest
Returns
A set of names of parameters for the given component

Definition at line 908 of file ParameterMap.cpp.

References Mantid::Geometry::IComponent::getComponentID(), and m_map.

Referenced by copyFromParameterMap(), Mantid::Geometry::Component::getParameterNames(), and Mantid::Geometry::Component::getParameterNamesByComponent().

◆ operator!=()

bool Mantid::Geometry::ParameterMap::operator!= ( const ParameterMap rhs) const

Inquality comparison operator.

Compares the values in this object with that given for inequality The order of the values in the map is not important.

Parameters
rhsA reference to a ParameterMap object to compare it to
Returns
true if the objects are considered not equal, false otherwise

Definition at line 122 of file ParameterMap.cpp.

References operator==().

◆ operator=()

ParameterMap & Mantid::Geometry::ParameterMap::operator= ( ParameterMap rhs)
private

Assignment operator.

◆ operator==()

bool Mantid::Geometry::ParameterMap::operator== ( const ParameterMap rhs) const

Equality comparison operator.

Compares the values in this object with that given for equality The order of the values in the map is not important.

Parameters
rhsA reference to a ParameterMap object to compare it to
Returns
true if the objects are considered equal, false otherwise

Definition at line 130 of file ParameterMap.cpp.

References diff(), and rhs.

Referenced by operator!=().

◆ pBool()

const std::string & Mantid::Geometry::ParameterMap::pBool ( )
static

Definition at line 105 of file ParameterMap.cpp.

Referenced by addBool(), and forceUnsafeSetMasked().

◆ pDouble()

const std::string & Mantid::Geometry::ParameterMap::pDouble ( )
static

Definition at line 101 of file ParameterMap.cpp.

Referenced by addDouble().

◆ pInt()

const std::string & Mantid::Geometry::ParameterMap::pInt ( )
static

Definition at line 103 of file ParameterMap.cpp.

Referenced by addInt().

◆ pos()

const std::string & Mantid::Geometry::ParameterMap::pos ( )
static

Return string to be used in the map.

Return string to be inserted into the parameter map.

Definition at line 83 of file ParameterMap.cpp.

Referenced by addPositionCoordinate(), clearParametersByName(), Mantid::Geometry::Instrument::makeLegacyParameterMap(), and Mantid::API::ExperimentInfo::populateInstrumentParameters().

◆ positionOf() [1/2]

component_map_it Mantid::Geometry::ParameterMap::positionOf ( const IComponent comp,
const char *  name,
const char *  type 
)
private

internal function to get position of the parameter in the parameter map

Return an iterator pointing to a named parameter of a given type.

Parameters
comp:: Component to which parameter is related
name:: Parameter name
type:: An optional type string. If empty, any type is returned
Returns
The iterator parameter of the given type if it exists or a NULL shared pointer if not

Definition at line 752 of file ParameterMap.cpp.

References Mantid::Geometry::IComponent::getComponentID(), and m_map.

Referenced by add(), and get().

◆ positionOf() [2/2]

component_map_cit Mantid::Geometry::ParameterMap::positionOf ( const IComponent comp,
const char *  name,
const char *  type 
) const
private

const version of the internal function to get position of the parameter in the parameter map

Return a const iterator pointing to a named parameter of a given type.

Parameters
comp:: Component to which parameter is related
name:: Parameter name
type:: An optional type string. If empty, any type is returned
Returns
The iterator parameter of the given type if it exists or a NULL shared pointer if not

Definition at line 781 of file ParameterMap.cpp.

References Mantid::Geometry::IComponent::getComponentID(), and m_map.

◆ posx()

const std::string & Mantid::Geometry::ParameterMap::posx ( )
static

Definition at line 85 of file ParameterMap.cpp.

Referenced by addPositionCoordinate().

◆ posy()

const std::string & Mantid::Geometry::ParameterMap::posy ( )
static

Definition at line 87 of file ParameterMap.cpp.

Referenced by addPositionCoordinate().

◆ posz()

const std::string & Mantid::Geometry::ParameterMap::posz ( )
static

Definition at line 89 of file ParameterMap.cpp.

Referenced by addPositionCoordinate().

◆ pQuat()

const std::string & Mantid::Geometry::ParameterMap::pQuat ( )
static

Definition at line 111 of file ParameterMap.cpp.

Referenced by addQuat().

◆ pString()

const std::string & Mantid::Geometry::ParameterMap::pString ( )
static

Definition at line 107 of file ParameterMap.cpp.

Referenced by addString().

◆ pV3D()

const std::string & Mantid::Geometry::ParameterMap::pV3D ( )
static

Definition at line 109 of file ParameterMap.cpp.

Referenced by addV3D().

◆ relErr()

bool Mantid::Geometry::ParameterMap::relErr ( double  x1,
double  x2,
double  errorVal 
) const
private

calculate relative error for use in diff

Function which calculates relative error between two values and analyses if this error is within the limits requested.

When the absolute value of the difference is smaller then the value of the error requested, absolute error is used instead of relative error.

Parameters
x1– first value to check difference
x2– second value to check difference
errorVal– the value of the error, to check against. Should be large then 0
Returns
true if error or false if the value is within the limits requested

Definition at line 191 of file ParameterMap.cpp.

Referenced by diff().

◆ rot()

const std::string & Mantid::Geometry::ParameterMap::rot ( )
static

◆ rotx()

const std::string & Mantid::Geometry::ParameterMap::rotx ( )
static

Definition at line 94 of file ParameterMap.cpp.

Referenced by addRotationParam().

◆ roty()

const std::string & Mantid::Geometry::ParameterMap::roty ( )
static

Definition at line 96 of file ParameterMap.cpp.

Referenced by addRotationParam().

◆ rotz()

const std::string & Mantid::Geometry::ParameterMap::rotz ( )
static

Definition at line 98 of file ParameterMap.cpp.

Referenced by addRotationParam().

◆ saveNexus()

void Mantid::Geometry::ParameterMap::saveNexus ( ::NeXus::File *  file,
const std::string &  group 
) const

Persist a representation of the Parameter map to the open Nexus file.

Save the object to an open NeXus file.

Parameters
file:: open NeXus file
group:: name of the group to create

Definition at line 1015 of file ParameterMap.cpp.

References asString().

◆ scale()

const std::string & Mantid::Geometry::ParameterMap::scale ( )
static

◆ setCachedLocation()

void Mantid::Geometry::ParameterMap::setCachedLocation ( const IComponent comp,
const Kernel::V3D location 
) const

Sets a cached location on the location cache.

Parameters
comp:: The Component to set the location of
location:: The location

Definition at line 961 of file ParameterMap.cpp.

References Mantid::Geometry::IComponent::getComponentID(), and m_cacheLocMap.

Referenced by Mantid::Geometry::CompAssembly::getPos(), and Mantid::Geometry::ObjCompAssembly::getPos().

◆ setCachedRotation()

void Mantid::Geometry::ParameterMap::setCachedRotation ( const IComponent comp,
const Kernel::Quat rotation 
) const

Sets a cached rotation on the rotation cache.

Parameters
comp:: The Component to set the rotation of
rotation:: The rotation as a quaternion

Definition at line 976 of file ParameterMap.cpp.

References Mantid::Geometry::IComponent::getComponentID(), m_cacheRotMap, and rotation.

Referenced by Mantid::Geometry::CompAssembly::getRotation(), and Mantid::Geometry::ObjCompAssembly::getRotation().

◆ setInstrument()

void Mantid::Geometry::ParameterMap::setInstrument ( const Instrument instrument)

Only for use by Instrument. Sets the pointer to the owning instrument.

Definition at line 1107 of file ParameterMap.cpp.

References Mantid::Geometry::Component::isParametrized(), m_componentInfo, m_detectorInfo, m_instrument, and Mantid::Geometry::Instrument::makeBeamline().

◆ size()

int Mantid::Geometry::ParameterMap::size ( ) const
inline

Return the size of the map.

Definition at line 59 of file ParameterMap.h.

Referenced by diff().

◆ swap()

void Mantid::Geometry::ParameterMap::swap ( ParameterMap other)
inline

method swaps two parameter maps contents each other.

All caches contents is nullified (TO DO: it can be efficiently swapped too)

Definition at line 92 of file ParameterMap.h.

Member Data Documentation

◆ m_cacheLocMap

std::unique_ptr<Kernel::Cache<const ComponentID, Kernel::V3D> > Mantid::Geometry::ParameterMap::m_cacheLocMap
private

internal cache map instance for cached position values

Definition at line 315 of file ParameterMap.h.

Referenced by clearPositionSensitiveCaches(), getCachedLocation(), and setCachedLocation().

◆ m_cacheRotMap

std::unique_ptr<Kernel::Cache<const ComponentID, Kernel::Quat> > Mantid::Geometry::ParameterMap::m_cacheRotMap
private

internal cache map instance for cached rotation values

Definition at line 317 of file ParameterMap.h.

Referenced by clearPositionSensitiveCaches(), getCachedRotation(), and setCachedRotation().

◆ m_componentInfo

std::unique_ptr<Geometry::ComponentInfo> Mantid::Geometry::ParameterMap::m_componentInfo
private

Pointer to the ComponentInfo wrapper.

NULL unless the instrument is associated with an ExperimentInfo object.

Definition at line 325 of file ParameterMap.h.

Referenced by componentIndex(), componentInfo(), hasComponentInfo(), mutableComponentInfo(), ParameterMap(), and setInstrument().

◆ m_detectorInfo

std::unique_ptr<Geometry::DetectorInfo> Mantid::Geometry::ParameterMap::m_detectorInfo
private

Pointer to the DetectorInfo wrapper.

NULL unless the instrument is associated with an ExperimentInfo object.

Definition at line 321 of file ParameterMap.h.

Referenced by detectorInfo(), hasDetectorInfo(), mutableDetectorInfo(), ParameterMap(), and setInstrument().

◆ m_instrument

const Instrument* Mantid::Geometry::ParameterMap::m_instrument {nullptr}
private

Pointer to the owning instrument for translating detector IDs into detector indices when accessing the DetectorInfo object.

If the workspace distinguishes between a neutronic instrument and a physical instrument the owning instrument is the neutronic one.

Definition at line 331 of file ParameterMap.h.

Referenced by componentInfo(), detectorIndex(), detectorInfo(), hasComponentInfo(), hasDetectorInfo(), mutableComponentInfo(), mutableDetectorInfo(), ParameterMap(), and setInstrument().

◆ m_map

pmap Mantid::Geometry::ParameterMap::m_map
private

◆ m_parameterFileNames

std::vector<std::string> Mantid::Geometry::ParameterMap::m_parameterFileNames
private

internal list of parameter files loaded

Definition at line 310 of file ParameterMap.h.

Referenced by addParameterFilename(), and getParameterFilenames().


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