53 static constexpr size_t invalidIndex = std::numeric_limits<size_t>::max();
61 std::shared_ptr<const std::unordered_map<Geometry::IComponent const *, size_t>>
m_compIDToIndex;
64 std::shared_ptr<std::vector<std::shared_ptr<const Geometry::IObject>>>
m_shapes;
73 std::shared_ptr<Parameter> findParameter(
size_t componentIndex, std::string
const &
name,
bool recursive)
const;
75 template <
class T> std::vector<T> getParameter(
size_t componentIndex,
const std::string &
name,
bool recursive)
const;
79 void addTypedParameter(
const size_t componentIndex,
const std::string &type,
const std::string &
name,
const T &
value,
80 const std::string *
const pDescription,
const std::string &pVisible);
87 const bool excludeMonitors =
false)
const;
94 const bool excludeMonitors =
false)
const;
106 ComponentInfo(std::unique_ptr<Beamline::ComponentInfo> componentInfo,
107 std::shared_ptr<
const std::vector<Mantid::Geometry::IComponent *>> componentIds,
108 std::shared_ptr<
const std::unordered_map<Geometry::IComponent const *, size_t>> componentIdToIndexMap,
109 std::shared_ptr<std::vector<std::shared_ptr<const Geometry::IObject>>> shapes,
110 std::shared_ptr<ParameterInfo> parameterInfo =
nullptr,
111 std::shared_ptr<const ReferenceFrame> referenceFrame =
nullptr);
115 std::unique_ptr<ComponentInfo> cloneWithoutDetectorInfo()
const;
116 std::vector<size_t> detectorsInSubtree(
size_t componentIndex)
const;
117 std::vector<size_t> componentsInSubtree(
size_t componentIndex)
const;
118 const std::vector<size_t> &children(
size_t componentIndex)
const;
120 size_t getMemorySize()
const;
127 size_t indexOfAny(
const std::string &
name)
const;
128 bool uniqueName(
const std::string &
name)
const;
129 bool isDetector(
const size_t componentIndex)
const;
134 Kernel::V3D relativePosition(
const size_t componentIndex)
const;
135 Kernel::Quat relativeRotation(
const size_t componentIndex)
const;
140 void scaleComponent(
const size_t componentIndex,
const Kernel::V3D &newScaling);
141 void scaleComponent(
const std::pair<size_t, size_t> &
index,
const Kernel::V3D &newScaling);
142 size_t parent(
const size_t componentIndex)
const;
143 bool hasParent(
const size_t componentIndex)
const;
144 bool hasDetectorInfo()
const;
147 bool hasSource()
const;
149 bool hasSample()
const;
151 bool hasDetectors(
const size_t componentIndex)
const;
152 size_t source()
const;
153 size_t sample()
const;
155 Kernel::V3D scaleFactor(
const size_t componentIndex)
const;
156 const std::string &
name(
const size_t componentIndex)
const;
157 void setScaleFactor(
const size_t componentIndex,
const Kernel::V3D &scaleFactor);
158 Kernel::V2D sideBySideViewPosition(
const size_t componentIndex)
const;
159 Beamline::PixelGridComponent pixelGridComponent(
const size_t componentIndex)
const;
160 size_t detectorIndexAtXYZ(
const size_t componentIndex,
const int x,
const int y,
const int z)
const;
161 std::tuple<int, int, int> xyzForDetectorID(
const size_t componentIndex,
const detid_t detectorID)
const;
162 bool isGridDetector(
size_t const componentIndex)
const;
164 const Beamline::StructuredGridComponent &structuredGridComponent(
const size_t componentIndex)
const;
165 bool isStructuredDetector(
size_t const componentIndex)
const;
169 std::shared_ptr<const ReferenceFrame> referenceFrame()
const;
172 bool hasValidShape(
const size_t componentIndex)
const;
175 std::unordered_map<std::shared_ptr<const Geometry::IObject>, std::vector<size_t>> shapeToComponentIndices()
const;
179 const bool excludeMonitors =
false)
const;
180 Beamline::ComponentType componentType(
const size_t componentIndex)
const;
181 void setScanInterval(
const std::pair<Types::Core::DateAndTime, Types::Core::DateAndTime> &interval);
182 size_t scanCount()
const;
190 size_t findBankParent(
size_t index,
const std::string &bankPart)
const;
193 std::string fullName(
const size_t componentIndex)
const;
196 size_t indexOfFullName(
const std::string &fullName)
const;
199 bool hasParameter(
const size_t componentIndex,
const std::string &
name,
bool recursive =
true)
const;
200 std::set<std::string> getParameterNames(
const size_t componentIndex,
bool recursive =
true)
const;
204 std::shared_ptr<const Parameter> parameter(
const size_t componentIndex,
const std::string &
name,
205 const std::string &type =
"",
bool recursive =
true)
const;
207 std::shared_ptr<const Parameter> parameterByType(
const size_t componentIndex,
const std::string &type,
208 bool recursive =
true)
const;
209 std::vector<double> getNumberParameter(
const size_t componentIndex,
const std::string &
name,
210 bool recursive =
true)
const;
211 std::vector<int> getIntParameter(
const size_t componentIndex,
const std::string &
name,
bool recursive =
true)
const;
212 std::vector<bool> getBoolParameter(
const size_t componentIndex,
const std::string &
name,
bool recursive =
true)
const;
213 std::vector<std::string> getStringParameter(
const size_t componentIndex,
const std::string &
name,
214 bool recursive =
true)
const;
215 std::vector<Kernel::V3D> getPositionParameter(
const size_t componentIndex,
const std::string &
name,
216 bool recursive =
true)
const;
217 std::vector<Kernel::Quat> getRotationParameter(
const size_t componentIndex,
const std::string &
name,
218 bool recursive =
true)
const;
220 bool getParameterVisible(
const size_t componentIndex,
const std::string &
name,
bool recursive =
true)
const;
222 std::string getParameterType(
const size_t componentIndex,
const std::string &
name,
bool recursive =
true)
const;
224 std::string getParameterAsString(
size_t const componentIndex, std::string
const &
name,
225 bool const recursive =
true)
const;
226 double getFittingParameter(
const size_t componentIndex,
const std::string &
name,
double xvalue)
const;
228 std::string getParamDescription(
const size_t componentIndex,
const std::string &
name,
bool recursive =
true)
const;
230 std::string getParamShortDescription(
const size_t componentIndex,
const std::string &
name,
231 bool recursive =
true)
const;
233 std::string getDescription(
const size_t componentIndex)
const;
235 std::string getShortDescription(
const size_t componentIndex)
const;
238 void addParameter(
const size_t componentIndex,
const std::string &type,
const std::string &
name,
239 const std::string &
value,
const std::string *
const pDescription =
nullptr,
240 const std::string &pVisible =
"true");
242 void addDouble(
const size_t componentIndex,
const std::string &
name,
double value,
243 const std::string *
const pDescription =
nullptr,
const std::string &pVisible =
"true");
245 void addInt(
const size_t componentIndex,
const std::string &
name,
int value,
246 const std::string *
const pDescription =
nullptr,
const std::string &pVisible =
"true");
248 void addBool(
const size_t componentIndex,
const std::string &
name,
bool value,
249 const std::string *
const pDescription =
nullptr,
const std::string &pVisible =
"true");
251 void addString(
const size_t componentIndex,
const std::string &
name,
const std::string &
value,
252 const std::string *
const pDescription =
nullptr,
const std::string &pVisible =
"true");
255 const std::string *
const pDescription =
nullptr);
258 const std::string *
const pDescription =
nullptr);
260 void addFittingParameter(
const size_t componentIndex,
const std::string &
name,
const std::string &fittingFunction,
261 const std::string &
value,
const std::string *
const pDescription =
nullptr,
262 const std::string &pVisible =
"true");
265 void setDescription(
const size_t componentIndex,
const std::string &description);
268 void clearParameter(
const size_t componentIndex,
const std::string &
name);
270 void clearParameters();
276 void addLogfileParameter(
size_t const componentIndex, std::string
const &cacheKey,
277 std::shared_ptr<const XMLInstrumentParameter>
const ¶meter);