|
Mantid
|
Class originally intended to be used with the DataHandling 'LoadInstrument' algorithm. More...
#include <ShapeFactory.h>
Public Member Functions | |
| std::string | addAppliedGoniometerTag (const Kernel::Matrix< double > &bakedRotation, std::string xml) |
| Replace or insert the <applied-goniometer> tag, recording how much of <goniometer> is a bake into the lab frame rather than a rotation of the shape within its own frame. | |
| std::string | addGoniometerTag (const Kernel::Matrix< double > &rotateMatrix, std::string xml) |
| Replace or insert the <goniometer> tag, the TOTAL rotation applied to the shape's surfaces. | |
| std::shared_ptr< CSGObject > | createShape (Poco::XML::Element *pElem) |
| Creates a geometric object from a DOM-element-node pointing to an element whose child nodes contain the shape information. | |
| std::shared_ptr< CSGObject > | createShape (std::string shapeXML, bool addTypeTag=true) |
| Creates a geometric object directly from a XML shape string. | |
| std::string | rebakeGoniometer (const Kernel::Matrix< double > &newBake, std::string xml, const Kernel::Matrix< double > ¤tBake) |
| Rebase the shape so the baked part becomes exactly newBake, preserving the definition-frame rotation. | |
Static Public Member Functions | |
| static Kernel::Matrix< double > | appliedGoniometerFromXML (const std::string &xml) |
| The baked part of a shape XML string's rotation - what a shape built from this XML reports through getAppliedRotation. | |
| static std::shared_ptr< CSGObject > | createHexahedralShape (double xlb, double xlf, double xrf, double xrb, double ylb, double ylf, double yrf, double yrb) |
| Create a hexahedral shape object. | |
| static std::shared_ptr< CSGObject > | createSphere (const Kernel::V3D ¢re, double radius) |
| Create a Sphere. | |
| static Kernel::Matrix< double > | generateMatrix (double xRotation, double yRotation, double zRotation) |
| Generates a rotate Matrix applying the x rotate then y rotate, then z rotate. | |
| static Kernel::Matrix< double > | generateXRotation (double xRotation) |
| Generates the x component of the rotate matrix. | |
| static Kernel::Matrix< double > | generateYRotation (double yRotation) |
| Generates the y component of the rotate matrix. | |
| static Kernel::Matrix< double > | generateZRotation (double zRotation) |
| Generates the z component of the rotate matrix. | |
| static Kernel::Matrix< double > | goniometerFromXML (const std::string &xml) |
| The total rotation held in a shape XML string's <goniometer> tag, identity if there is none. | |
Private Member Functions | |
| void | createGeometryHandler (Poco::XML::Element *, const std::shared_ptr< CSGObject > &) |
| create a special geometry handler for the known finite primitives | |
| Poco::XML::Element * | getOptionalShapeElement (Poco::XML::Element *pElem, const std::string &name) |
| Return a subelement of an XML element. | |
| Poco::XML::Element * | getShapeElement (Poco::XML::Element *pElem, const std::string &name) |
| Return a subelement of an XML element, but also checks that there exist exactly one entry of this subelement. | |
| std::string | parseCone (Poco::XML::Element *pElem, std::map< int, std::shared_ptr< Surface > > &prim, int &l_id) |
| Parse XML 'cone' element. | |
| CuboidCorners | parseCuboid (Poco::XML::Element *pElem) |
| Get the four corners of a cuboid from an XML element. | |
| std::string | parseCuboid (Poco::XML::Element *pElem, std::map< int, std::shared_ptr< Surface > > &prim, int &l_id) |
| Parse XML 'cuboid' element. | |
| std::string | parseCylinder (Poco::XML::Element *pElem, std::map< int, std::shared_ptr< Surface > > &prim, int &l_id) |
| Parse XML 'cylinder' element. | |
| Hexahedron | parseHexahedron (Poco::XML::Element *pElem) |
| Get all corners of a hexahedron from an XML element. | |
| std::string | parseHexahedron (Poco::XML::Element *pElem, std::map< int, std::shared_ptr< Surface > > &prim, int &l_id) |
| Parse XML 'hexahedron' element. | |
| std::string | parseHollowCylinder (Poco::XML::Element *pElem, std::map< int, std::shared_ptr< Surface > > &prim, int &l_id) |
| Parse XML 'hollow-cylinder' element. | |
| std::string | parseInfiniteCone (Poco::XML::Element *pElem, std::map< int, std::shared_ptr< Surface > > &prim, int &l_id) |
| Parse XML 'infinite-cone' element. | |
| std::string | parseInfiniteCylinder (Poco::XML::Element *pElem, std::map< int, std::shared_ptr< Surface > > &prim, int &l_id) |
| Parse XML 'infinite-cylinder' element. | |
| std::string | parseInfinitePlane (Poco::XML::Element *pElem, std::map< int, std::shared_ptr< Surface > > &prim, int &l_id) |
| Parse XML 'infinite-plane' element. | |
| Kernel::V3D | parsePosition (Poco::XML::Element *pElem) |
| Get position coordinates from XML element. | |
| std::string | parseSliceOfCylinderRing (Poco::XML::Element *pElem, std::map< int, std::shared_ptr< Surface > > &prim, int &l_id) |
| Parse XML 'slice-of-cylinder-ring' element. | |
| std::string | parseSphere (Poco::XML::Element *pElem, std::map< int, std::shared_ptr< Surface > > &prim, int &l_id) |
| Parse XML 'sphere' element. | |
| std::string | parseTaperedGuide (Poco::XML::Element *pElem, std::map< int, std::shared_ptr< Surface > > &prim, int &l_id) |
| Parse XML 'tapered-guide' element, which is a special case of the XML 'hexahedron' element. | |
| std::string | parseTorus (Poco::XML::Element *pElem, std::map< int, std::shared_ptr< Surface > > &prim, int &l_id) |
| Parse XML 'torus' element. | |
Static Private Member Functions | |
| static double | getDoubleAttribute (Poco::XML::Element *pElem, const std::string &name) |
| Return value of attribute to XML element. | |
| static std::string | insertMatrixTag (const std::string &tagName, const Kernel::Matrix< double > &matrix, std::string xml) |
| Replace, or insert, a tag holding a 3x3 matrix as a11..a33 attributes. | |
| static std::optional< Kernel::Matrix< double > > | matrixFromXMLTag (const std::string &xml, const std::string &tagName) |
| The matrix held in the named tag of a shape XML string, read as createShape reads it, or nullopt when there is no such tag or the XML does not parse. | |
| static std::string | parseHexahedronFromStruct (const Hexahedron &hex, std::map< int, std::shared_ptr< Surface > > &prim, int &l_id) |
| The "tapered-guide" shape is actually a special case of hexahedron; once we have the 8 points that make up either shape, the process of parsing them can be exactly the same in both cases. | |
| static Kernel::Matrix< double > | parseMatrixElement (Poco::XML::Element *pElem) |
| Read a 3x3 matrix held as a11..a33 attributes on an XML element. | |
| static std::string | sphereAlgebra (const int surfaceID) |
| Create the algebra string for a Sphere. | |
Private Attributes | |
| Kernel::Matrix< double > | m_gonioRotateMatrix = Kernel::Matrix<double>(3, 3, 1) |
| Kernel::Matrix< double > | m_rotateAllMatrix = Kernel::Matrix<double>(3, 3, 1) |
Class originally intended to be used with the DataHandling 'LoadInstrument' algorithm.
In that algorithm it is used for creating shared pointers to the geometric shapes described in the XML instrument definition file.
This class is now also use elsewhere, and in addition to create geometric shapes from an DOM-element-node pointing to a <type> element with shape information, shapes can also be created directly from a XML shape string.
Definition at line 90 of file ShapeFactory.h.
| std::string Mantid::Geometry::ShapeFactory::addAppliedGoniometerTag | ( | const Kernel::Matrix< double > & | bakedRotation, |
| std::string | xml | ||
| ) |
Replace or insert the <applied-goniometer> tag, recording how much of <goniometer> is a bake into the lab frame rather than a rotation of the shape within its own frame.
Definition at line 1712 of file ShapeFactory.cpp.
References insertMatrixTag().
Referenced by rebakeGoniometer().
| std::string Mantid::Geometry::ShapeFactory::addGoniometerTag | ( | const Kernel::Matrix< double > & | rotateMatrix, |
| std::string | xml | ||
| ) |
Replace or insert the <goniometer> tag, the TOTAL rotation applied to the shape's surfaces.
Leaves any <applied-goniometer> tag untouched.
Definition at line 1708 of file ShapeFactory.cpp.
References insertMatrixTag().
Referenced by Mantid::Algorithms::CopySample::copyParameters(), Mantid::DataHandling::RotateSampleShape::exec(), rebakeGoniometer(), and Mantid::DataHandling::SetSample::setSampleShape().
|
static |
The baked part of a shape XML string's rotation - what a shape built from this XML reports through getAppliedRotation.
Suitable as rebakeGoniometer's currentBake.
Definition at line 1738 of file ShapeFactory.cpp.
References goniometerFromXML(), and matrixFromXMLTag().
|
private |
create a special geometry handler for the known finite primitives
Definition at line 1551 of file ShapeFactory.cpp.
References centre, getOptionalShapeElement(), getShapeElement(), height, Mantid::Kernel::V3D::normalize(), Mantid::Kernel::normalize(), parseCuboid(), parseHexahedron(), parsePosition(), Mantid::Geometry::detail::ShapeInfo::setCone(), Mantid::Geometry::detail::ShapeInfo::setCuboid(), Mantid::Geometry::detail::ShapeInfo::setCylinder(), Mantid::Geometry::detail::ShapeInfo::setHexahedron(), Mantid::Geometry::detail::ShapeInfo::setHollowCylinder(), and Mantid::Geometry::detail::ShapeInfo::setSphere().
Referenced by createShape().
|
static |
Create a hexahedral shape object.
| xlb | :: Left-back x point or hexahedron |
| xlf | :: Left-front x point of hexahedron |
| xrf | :: Right-front x point of hexahedron |
| xrb | :: Right-back x point of hexahedron |
| ylb | :: Left-back y point or hexahedron |
| ylf | :: Left-front y point of hexahedron |
| yrf | :: Right-front y point of hexahedron |
| yrb | :: Right-back y point of hexahedron |
Definition at line 1516 of file ShapeFactory.cpp.
References Mantid::Geometry::Hexahedron::lbb, Mantid::Geometry::Hexahedron::lbt, Mantid::Geometry::Hexahedron::lfb, Mantid::Geometry::Hexahedron::lft, parseHexahedronFromStruct(), Mantid::Geometry::Hexahedron::rbb, Mantid::Geometry::Hexahedron::rbt, Mantid::Geometry::Hexahedron::rfb, Mantid::Geometry::Hexahedron::rft, and Mantid::Geometry::detail::ShapeInfo::setHexahedron().
Referenced by Mantid::Geometry::StructuredDetector::addDetector().
| std::shared_ptr< CSGObject > Mantid::Geometry::ShapeFactory::createShape | ( | Poco::XML::Element * | pElem | ) |
Creates a geometric object from a DOM-element-node pointing to an element whose child nodes contain the shape information.
If no shape information an empty Object is returned.
| pElem | A pointer to an Element node whose children fully define the object. The name of this element is unimportant. |
Definition at line 108 of file ShapeFactory.cpp.
References createGeometryHandler(), Mantid::Geometry::g_log, generateMatrix(), getShapeElement(), Mantid::Kernel::Matrix< T >::identityMatrix(), m_gonioRotateMatrix, m_rotateAllMatrix, parseCone(), parseCuboid(), parseCylinder(), parseHexahedron(), parseHollowCylinder(), parseInfiniteCone(), parseInfiniteCylinder(), parseInfinitePlane(), parseMatrixElement(), parsePosition(), parseSliceOfCylinderRing(), parseSphere(), parseTaperedGuide(), parseTorus(), and Mantid::Kernel::Logger::warning().
Referenced by Mantid::Geometry::InstrumentDefinitionParser::adjustTypesContainingCombineComponentsElement(), Mantid::Algorithms::AnyShapeAbsorption::constructGaugeVolume(), Mantid::Algorithms::PaalmanPingsAbsorptionCorrection::constructGaugeVolume(), Mantid::Algorithms::AbsorptionCorrection::constructSample(), Mantid::Algorithms::CopySample::copyParameters(), Mantid::Algorithms::CreateSampleWorkspace::createCappedCylinder(), ComponentCreationHelper::createCappedCylinder(), Mantid::Algorithms::DiscusMultipleScatteringCorrection::createCollimatorHexahedronShape(), ComponentCreationHelper::createCuboid(), ComponentCreationHelper::createCuboid(), ComponentCreationHelper::createHollowCylinder(), ComponentCreationHelper::createHollowShell(), Mantid::Geometry::ObjCompAssembly::createOutline(), Mantid::Geometry::Container::createSampleShape(), createShape(), Mantid::Geometry::InstrumentDefinitionParser::createShapeIfTypeIsNotAnAssembly(), Mantid::Algorithms::CreateSampleWorkspace::createSphere(), ComponentCreationHelper::createSphere(), Mantid::Geometry::ComponentHelper::createSphere(), Mantid::Algorithms::MonteCarloAbsorption::doSimulation(), Mantid::DataHandling::DefineGaugeVolume::exec(), Mantid::DataHandling::FindDetectorsInShape::exec(), Mantid::DataHandling::LoadQKK::exec(), Mantid::Algorithms::IBeamProfile::getIntersectionWithSample(), Mantid::Geometry::getLabFrameShape(), Mantid::Algorithms::SparseWorkspace::makeCubeShape(), WorkspaceCreationHelper::maskSpectra(), Mantid::DataHandling::SampleEnvironmentSpecParser::parseComponent(), Mantid::Algorithms::EstimateScatteringVolumeCentreOfMass::rasterizeLabGaugeAndCalculateMeanElementPosition(), Mantid::DataHandling::SetSample::setSampleEnvironmentFromXML(), Mantid::DataHandling::CreateSampleShape::setSampleShape(), Mantid::API::Sample::setShape(), Mantid::Geometry::GridDetector::shape(), Mantid::Geometry::StructuredDetector::shape(), and Mantid::DataHandling::SetSample::validateGeometry().
| std::shared_ptr< CSGObject > Mantid::Geometry::ShapeFactory::createShape | ( | std::string | shapeXML, |
| bool | addTypeTag = true |
||
| ) |
Creates a geometric object directly from a XML shape string.
| shapeXML | :: XML shape string |
| addTypeTag | :: true to wrap a <type> tag around the XML supplied (default) |
Definition at line 78 of file ShapeFactory.cpp.
References createShape(), Mantid::Geometry::g_log, and Mantid::Kernel::Logger::warning().
|
static |
Create a Sphere.
| centre | The center of the sphere |
| radius | The radius in metres |
Definition at line 1486 of file ShapeFactory.cpp.
References centre, Mantid::Geometry::detail::ShapeInfo::setSphere(), and sphereAlgebra().
Referenced by Mantid::Crystal::SaveHKL::exec(), and Mantid::DataHandling::LoadNXSPE::exec().
|
static |
Generates a rotate Matrix applying the x rotate then y rotate, then z rotate.
| xrotate | The x rotate required in radians |
| yrotate | The y rotate required in radians |
| zrotate | The z rotate required in radians |
Definition at line 1613 of file ShapeFactory.cpp.
References generateXRotation(), generateYRotation(), and generateZRotation().
Referenced by createShape(), parseCuboid(), parseCylinder(), parseHexahedron(), parseHollowCylinder(), parseInfiniteCylinder(), parseInfinitePlane(), parseSliceOfCylinderRing(), parseTaperedGuide(), and Mantid::DataHandling::MeshFileIO::rotate().
|
static |
Generates the x component of the rotate matrix.
| xrotate | The x rotate required in radians |
Definition at line 1626 of file ShapeFactory.cpp.
Referenced by generateMatrix().
|
static |
Generates the y component of the rotate matrix.
| yrotate | The y rotate required in radians |
Definition at line 1638 of file ShapeFactory.cpp.
Referenced by generateMatrix().
|
static |
Generates the z component of the rotate matrix.
| zrotate | The z rotate required in radians |
Definition at line 1650 of file ShapeFactory.cpp.
Referenced by generateMatrix().
|
staticprivate |
Return value of attribute to XML element.
It is an extension of poco's getAttribute method, which in addition check that this attribute exists and if not throws an error.
| pElem | :: XML from instrument def. file |
| name | :: Name of subelement |
| std::invalid_argument | Thrown if issues with XML string |
Definition at line 1422 of file ShapeFactory.cpp.
References name.
Referenced by parseCone(), parseCuboid(), parseCylinder(), parseHollowCylinder(), parseInfiniteCone(), parseInfiniteCylinder(), parseMatrixElement(), parseSliceOfCylinderRing(), parseSphere(), parseTaperedGuide(), and parseTorus().
|
private |
Return a subelement of an XML element.
The subelement is optional so it may not exist, but we also check that there is never more than one.
| pElem | :: XML from instrument definition file. |
| name | :: Name of the subelement. |
| std::invalid_argument | if XML string is invalid. |
Definition at line 1399 of file ShapeFactory.cpp.
References name.
Referenced by createGeometryHandler(), parseCuboid(), parseCylinder(), parseHexahedron(), parseHollowCylinder(), parseInfiniteCylinder(), parseInfinitePlane(), parseSliceOfCylinderRing(), parseSphere(), and parseTaperedGuide().
|
private |
Return a subelement of an XML element, but also checks that there exist exactly one entry of this subelement.
| pElem | :: XML from instrument def. file |
| name | :: Name of subelement |
| std::invalid_argument | Thrown if issues with XML string |
Definition at line 1376 of file ShapeFactory.cpp.
References name.
Referenced by createGeometryHandler(), createShape(), parseCone(), parseCylinder(), parseHexahedron(), parseHollowCylinder(), parseInfiniteCone(), parseInfiniteCylinder(), parseInfinitePlane(), parseSliceOfCylinderRing(), parseSphere(), parseTaperedGuide(), and parseTorus().
|
static |
The total rotation held in a shape XML string's <goniometer> tag, identity if there is none.
Definition at line 1734 of file ShapeFactory.cpp.
References matrixFromXMLTag().
Referenced by appliedGoniometerFromXML(), and rebakeGoniometer().
|
staticprivate |
Replace, or insert, a tag holding a 3x3 matrix as a11..a33 attributes.
tagName carries no angle brackets.
Definition at line 1670 of file ShapeFactory.cpp.
References Mantid::Kernel::Matrix< T >::numCols(), Mantid::Kernel::Matrix< T >::numRows(), and Mantid::Kernel::Matrix< T >::size().
Referenced by addAppliedGoniometerTag(), and addGoniometerTag().
|
staticprivate |
The matrix held in the named tag of a shape XML string, read as createShape reads it, or nullopt when there is no such tag or the XML does not parse.
Definition at line 1718 of file ShapeFactory.cpp.
References parseMatrixElement().
Referenced by appliedGoniometerFromXML(), and goniometerFromXML().
|
private |
Parse XML 'cone' element.
| pElem | :: XML 'cone' element from instrument def. file |
| prim | :: To add shapes to |
| l_id | :: When shapes added to the map prim l_id is the continuous incremented index |
| InstrumentDefinitionError | Thrown if issues with the content of XML instrument file |
Definition at line 909 of file ShapeFactory.cpp.
References getDoubleAttribute(), getShapeElement(), height, Mantid::Kernel::normalize(), and parsePosition().
Referenced by createShape().
|
private |
Get the four corners of a cuboid from an XML element.
The XML may consist of one of the two available syntaxes. We disallow a mixture of syntaxes.
| pElem | :: XML 'cuboid' element from instrument definition file. |
| std::invalid_argument | if XML string is invalid. |
Definition at line 667 of file ShapeFactory.cpp.
References centre, generateMatrix(), getDoubleAttribute(), getOptionalShapeElement(), Mantid::Geometry::CuboidCorners::lbb, Mantid::Geometry::CuboidCorners::lfb, Mantid::Geometry::CuboidCorners::lft, m_gonioRotateMatrix, m_rotateAllMatrix, Mantid::Kernel::normalize(), parsePosition(), Mantid::Geometry::CuboidCorners::rfb, Mantid::Kernel::Quat::rotate(), and Mantid::Geometry::CuboidCorners::rotatePoints().
Referenced by createGeometryHandler(), createShape(), and parseCuboid().
|
private |
Parse XML 'cuboid' element.
| pElem | :: XML 'cuboid' element from instrument def. file |
| prim | :: To add shapes to |
| l_id | :: When shapes added to the map prim l_id is the continuous incremented index |
| InstrumentDefinitionError | Thrown if issues with the content of XML instrument file |
Definition at line 774 of file ShapeFactory.cpp.
References Mantid::Kernel::normalize(), and parseCuboid().
|
private |
Parse XML 'cylinder' element.
| pElem | :: XML 'cylinder' element from instrument def. file |
| prim | :: To add shapes to |
| l_id | :: When shapes added to the map prim l_id is the continuous incremented index |
| InstrumentDefinitionError | Thrown if issues with the content of XML instrument file |
Definition at line 492 of file ShapeFactory.cpp.
References centre, generateMatrix(), getDoubleAttribute(), getOptionalShapeElement(), getShapeElement(), height, m_gonioRotateMatrix, m_rotateAllMatrix, Mantid::Kernel::normalize(), parsePosition(), and Mantid::Kernel::V3D::rotate().
Referenced by createShape().
|
private |
Get all corners of a hexahedron from an XML element.
| pElem | :: XML 'hexahedron' element from instrument definition file. |
| std::invalid_argument | if XML string is invalid. |
Definition at line 1034 of file ShapeFactory.cpp.
References generateMatrix(), getOptionalShapeElement(), getShapeElement(), Mantid::Geometry::Hexahedron::lbb, Mantid::Geometry::Hexahedron::lbt, Mantid::Geometry::Hexahedron::lfb, Mantid::Geometry::Hexahedron::lft, m_gonioRotateMatrix, m_rotateAllMatrix, parsePosition(), Mantid::Geometry::Hexahedron::rbb, Mantid::Geometry::Hexahedron::rbt, Mantid::Geometry::Hexahedron::rfb, Mantid::Geometry::Hexahedron::rft, and Mantid::Geometry::Hexahedron::rotatePoints().
Referenced by createGeometryHandler(), createShape(), and parseHexahedron().
|
private |
Parse XML 'hexahedron' element.
| pElem | :: XML 'hexahedron' element from instrument def. file |
| prim | :: To add shapes to |
| l_id | :: When shapes added to the map prim l_id is the continuous incremented index |
| InstrumentDefinitionError | Thrown if issues with the content of XML instrument file |
Definition at line 1113 of file ShapeFactory.cpp.
References parseHexahedron(), and parseHexahedronFromStruct().
|
staticprivate |
The "tapered-guide" shape is actually a special case of hexahedron; once we have the 8 points that make up either shape, the process of parsing them can be exactly the same in both cases.
Definition at line 958 of file ShapeFactory.cpp.
References Mantid::Geometry::Hexahedron::lbb, Mantid::Geometry::Hexahedron::lbt, Mantid::Geometry::Hexahedron::lfb, Mantid::Geometry::Hexahedron::lft, Mantid::Geometry::Hexahedron::rbb, Mantid::Geometry::Hexahedron::rfb, and Mantid::Geometry::Hexahedron::rft.
Referenced by createHexahedralShape(), parseHexahedron(), and parseTaperedGuide().
|
private |
Parse XML 'hollow-cylinder' element.
| pElem | :: XML 'hollow-cylinder' element from instrument def. file |
| prim | :: To add shapes to |
| l_id | :: When shapes added to the map prim l_id is the continuous incremented index |
| InstrumentDefinitionError | Thrown if issues with the content of XML instrument file |
Definition at line 571 of file ShapeFactory.cpp.
References centre, generateMatrix(), getDoubleAttribute(), getOptionalShapeElement(), getShapeElement(), height, m_gonioRotateMatrix, m_rotateAllMatrix, Mantid::Kernel::normalize(), parsePosition(), and Mantid::Kernel::V3D::rotate().
Referenced by createShape().
|
private |
Parse XML 'infinite-cone' element.
| pElem | :: XML 'infinite-cone' element from instrument def. file |
| prim | :: To add shapes to |
| l_id | :: When shapes added to the map prim l_id is the continuous incremented index |
| InstrumentDefinitionError | Thrown if issues with the content of XML instrument file |
Definition at line 866 of file ShapeFactory.cpp.
References getDoubleAttribute(), getShapeElement(), Mantid::Kernel::normalize(), and parsePosition().
Referenced by createShape().
|
private |
Parse XML 'infinite-cylinder' element.
| pElem | :: XML 'infinite-cylinder' element from instrument def. file |
| prim | :: To add shapes to |
| l_id | :: When shapes added to the map prim l_id is the continuous incremented index |
| InstrumentDefinitionError | Thrown if issues with the content of XML instrument file |
Definition at line 436 of file ShapeFactory.cpp.
References centre, generateMatrix(), getDoubleAttribute(), getOptionalShapeElement(), getShapeElement(), m_gonioRotateMatrix, m_rotateAllMatrix, Mantid::Kernel::normalize(), parsePosition(), and Mantid::Kernel::V3D::rotate().
Referenced by createShape().
|
private |
Parse XML 'infinite-plane' element.
| pElem | :: XML 'infinite-plane' element from instrument def. file |
| prim | :: To add shapes to |
| l_id | :: When shapes added to the map prim l_id is the continuous incremented index |
| InstrumentDefinitionError | Thrown if issues with the content of XML instrument file |
Definition at line 386 of file ShapeFactory.cpp.
References centre, generateMatrix(), getOptionalShapeElement(), getShapeElement(), m_gonioRotateMatrix, m_rotateAllMatrix, Mantid::Kernel::normalize(), parsePosition(), and Mantid::Kernel::V3D::rotate().
Referenced by createShape().
|
staticprivate |
Read a 3x3 matrix held as a11..a33 attributes on an XML element.
Definition at line 1658 of file ShapeFactory.cpp.
References getDoubleAttribute(), and std::to_string().
Referenced by createShape(), and matrixFromXMLTag().
|
private |
Get position coordinates from XML element.
| pElem | :: XML element whose attributes contain position coordinates |
Definition at line 1435 of file ShapeFactory.cpp.
References Mantid::Kernel::V3D::spherical(), Mantid::Geometry::x, Mantid::Geometry::y, and Mantid::Geometry::z.
Referenced by createGeometryHandler(), createShape(), parseCone(), parseCuboid(), parseCylinder(), parseHexahedron(), parseHollowCylinder(), parseInfiniteCone(), parseInfiniteCylinder(), parseInfinitePlane(), parseSliceOfCylinderRing(), parseSphere(), parseTaperedGuide(), and parseTorus().
|
private |
Parse XML 'slice-of-cylinder-ring' element.
| pElem | :: XML 'slice-of-cylinder-ring' element from instrument def. file |
| prim | :: To add shapes to |
| l_id | :: When shapes added to the map prim l_id is the continuous incremented index |
| InstrumentDefinitionError | Thrown if issues with the content of XML instrument file |
Definition at line 1264 of file ShapeFactory.cpp.
References Mantid::Geometry::g_log, generateMatrix(), getDoubleAttribute(), getOptionalShapeElement(), getShapeElement(), m_gonioRotateMatrix, m_rotateAllMatrix, parsePosition(), Mantid::Kernel::V3D::rotate(), and Mantid::Kernel::Logger::warning().
Referenced by createShape().
|
private |
Parse XML 'sphere' element.
| pElem | :: XML 'sphere' element from instrument def. file |
| prim | :: To add shapes to |
| l_id | :: When shapes added to the map prim l_id is the continuous incremented index |
| InstrumentDefinitionError | Thrown if issues with the content of XML instrument file |
Definition at line 344 of file ShapeFactory.cpp.
References centre, getDoubleAttribute(), getOptionalShapeElement(), getShapeElement(), m_gonioRotateMatrix, m_rotateAllMatrix, parsePosition(), and sphereAlgebra().
Referenced by createShape().
|
private |
Parse XML 'tapered-guide' element, which is a special case of the XML 'hexahedron' element.
| pElem | :: XML 'hexahedron' element from instrument def. file |
| prim | :: To add shapes to |
| l_id | :: When shapes added to the map prim l_id is the continuous incremented index |
| InstrumentDefinitionError | Thrown if issues with the content of XML instrument file |
Definition at line 1132 of file ShapeFactory.cpp.
References centre, generateMatrix(), getDoubleAttribute(), getOptionalShapeElement(), getShapeElement(), Mantid::Geometry::Hexahedron::lbb, Mantid::Geometry::Hexahedron::lbt, Mantid::Geometry::Hexahedron::lfb, Mantid::Geometry::Hexahedron::lft, m_gonioRotateMatrix, m_rotateAllMatrix, Mantid::Kernel::normalize(), parseHexahedronFromStruct(), parsePosition(), Mantid::Geometry::Hexahedron::rbb, Mantid::Geometry::Hexahedron::rbt, Mantid::Geometry::Hexahedron::rfb, Mantid::Geometry::Hexahedron::rft, Mantid::Kernel::Quat::rotate(), and Mantid::Geometry::Hexahedron::rotatePoints().
Referenced by createShape().
|
private |
Parse XML 'torus' element.
| pElem | :: XML 'torus' element from instrument def. file |
| prim | :: To add shapes to |
| l_id | :: When shapes added to the map prim l_id is the continuous incremented index |
| InstrumentDefinitionError | Thrown if issues with the content of XML instrument file |
Definition at line 1224 of file ShapeFactory.cpp.
References getDoubleAttribute(), getShapeElement(), Mantid::Kernel::normalize(), and parsePosition().
Referenced by createShape().
| std::string Mantid::Geometry::ShapeFactory::rebakeGoniometer | ( | const Kernel::Matrix< double > & | newBake, |
| std::string | xml, | ||
| const Kernel::Matrix< double > & | currentBake | ||
| ) |
Rebase the shape so the baked part becomes exactly newBake, preserving the definition-frame rotation.
currentBake is what the shape reports through getAppliedRotation today.
Definition at line 1749 of file ShapeFactory.cpp.
References addAppliedGoniometerTag(), addGoniometerTag(), goniometerFromXML(), and Mantid::Kernel::Matrix< T >::Tprime().
Referenced by Mantid::Geometry::getLabFrameShape().
|
staticprivate |
Create the algebra string for a Sphere.
| surfaceID | ID of surface in map lookup |
Definition at line 373 of file ShapeFactory.cpp.
References std::to_string().
Referenced by createSphere(), and parseSphere().
|
private |
Definition at line 150 of file ShapeFactory.h.
Referenced by createShape(), parseCuboid(), parseCylinder(), parseHexahedron(), parseHollowCylinder(), parseInfiniteCylinder(), parseInfinitePlane(), parseSliceOfCylinderRing(), parseSphere(), and parseTaperedGuide().
|
private |
Definition at line 151 of file ShapeFactory.h.
Referenced by createShape(), parseCuboid(), parseCylinder(), parseHexahedron(), parseHollowCylinder(), parseInfiniteCylinder(), parseInfinitePlane(), parseSliceOfCylinderRing(), parseSphere(), and parseTaperedGuide().