当前位置: 首页>>代码示例>>C++>>正文


C++ MDWSDescription::isQ3DMode方法代码示例

本文整理汇总了C++中MDWSDescription::isQ3DMode方法的典型用法代码示例。如果您正苦于以下问题:C++ MDWSDescription::isQ3DMode方法的具体用法?C++ MDWSDescription::isQ3DMode怎么用?C++ MDWSDescription::isQ3DMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MDWSDescription的用法示例。


在下文中一共展示了MDWSDescription::isQ3DMode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Q

/** method to build the Q-coordinates transformation.
 *
 * @param TargWSDescription -- the class which describes target MD workspace. In
 Q3D case this description is modified by the method
                               with default Q-axis labels and Q-axis units
 * @param FrameRequested    -- the string which describes the target
 transformation frame in Q3D case. If the string value is '''Auto'''
 *   the frame is selected depending on the presence of UB matrix and goniometer
 settings, namely it can be:
 * a) the laboratory -- (no UB matrix, goniometer angles set to 0)
   b) Q (sample frame)''': the goniometer rotation of the sample is taken out,
 to give Q in the frame of the sample. See [[SetGoniometer]] to specify the
 goniometer used in the experiment.
   c) Crystal or crystal Cartesian (C)- Busing, Levi 1967 coordinate system --
 depending on Q-scale requested
 *  one of the target frames above can be requested explicitly. In this case the
 method throws invalid argument if necessary parameters (UB matrix) is not
 attached to the workspace

 * @param QScaleRequested   -- Q-transformation needed
 *
 * @return the linear representation for the transformation matrix, which
 translate momentums from laboratory to the requested
 *   coordinate system.
*/
std::vector<double>
MDWSTransform::getTransfMatrix(MDWSDescription &TargWSDescription,
                               const std::string &FrameRequested,
                               const std::string &QScaleRequested) const {
  CoordScaling ScaleID = getQScaling(QScaleRequested);
  TargetFrame FrameID = getTargetFrame(FrameRequested);
  std::vector<double> transf =
      getTransfMatrix(TargWSDescription, FrameID, ScaleID);

  if (TargWSDescription.isQ3DMode()) {
    this->setQ3DDimensionsNames(TargWSDescription, FrameID, ScaleID);
  }

  return transf;
}
开发者ID:spaceyatom,项目名称:mantid,代码行数:40,代码来源:MDWSTransform.cpp

示例2: createEmptyEventWS

void MDEventWSWrapper::createEmptyEventWS(const MDWSDescription &description) {

    boost::shared_ptr<DataObjects::MDEventWorkspace<DataObjects::MDEvent<nd>, nd>>
            ws = boost::shared_ptr<
                 DataObjects::MDEventWorkspace<DataObjects::MDEvent<nd>, nd>>(
                     new DataObjects::MDEventWorkspace<DataObjects::MDEvent<nd>, nd>());

    auto numBins = description.getNBins();
    size_t nBins(10); // HACK. this means we have 10 bins artificially. This can't
    // be right.
    // Give all the dimensions
    for (size_t d = 0; d < nd; d++) {
        if (!numBins.empty())
            nBins = numBins[d];

        Geometry::MDHistoDimension *dim = NULL;
        if (d < 3 && description.isQ3DMode()) {
            // We should have frame and scale information that we can use correctly
            // for our Q dimensions.
            auto mdFrame = description.getFrame(d);

            dim = new Geometry::MDHistoDimension(
                description.getDimNames()[d], description.getDimIDs()[d], *mdFrame,
                Mantid::coord_t(description.getDimMin()[d]),
                Mantid::coord_t(description.getDimMax()[d]), nBins);

        } else {
            Mantid::Geometry::GeneralFrame frame(description.getDimNames()[d],
                                                 description.getDimUnits()[d]);
            dim = new Geometry::MDHistoDimension(
                description.getDimNames()[d], description.getDimIDs()[d], frame,
                Mantid::coord_t(description.getDimMin()[d]),
                Mantid::coord_t(description.getDimMax()[d]), nBins);
        }

        ws->addDimension(Geometry::MDHistoDimension_sptr(dim));
    }
    ws->initialize();

    m_Workspace = ws;
}
开发者ID:spaceyatom,项目名称:mantid,代码行数:41,代码来源:MDEventWSWrapper.cpp


注:本文中的MDWSDescription::isQ3DMode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。