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


C++ Vector3::x方法代码示例

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


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

示例1:

 template <typename T> inline Math::Vector3<T> operator* (SymMatrix3<T> m, Math::Vector3<T> v) {
   return Math::Vector3<T> (
                            m.aa()*v.x() + m.ab()*v.y() + m.ac()*v.z(),
                            m.ab()*v.x() + m.bb()*v.y() + m.bc()*v.z(),
                            m.ac()*v.x() + m.bc()*v.y() + m.cc()*v.z()
                            );
 }
开发者ID:steffen-kiess,项目名称:dda,代码行数:7,代码来源:SymMatrix3.hpp

示例2: ASSERT

  DipoleGeometry::DipoleGeometry (ldouble gridUnit,
                                  Math::Vector3<ldouble> periodicity1,
                                  Math::Vector3<ldouble> periodicity2)
    : box_ (0, 0, 0), matCount_ (0), validNvCount_ (0), origin_ (0, 0, 0),
      orientation_ (EMSim::Rotation<ldouble>::none ()),
      orientationInverse_ (EMSim::Rotation<ldouble>::none ()),
      gridUnit_ (gridUnit),
      periodicity1_ (periodicity1),
      periodicity2_ (periodicity2)
  {
    ASSERT (gridUnit >= 0);

    bool periodicity1IsZero = periodicity1.x () == 0 && periodicity1.y () == 0 && periodicity1.z () == 0;
    bool periodicity2IsZero = periodicity2.x () == 0 && periodicity2.y () == 0 && periodicity2.z () == 0;
    if (periodicity1IsZero) {
      ASSERT (periodicity2IsZero);
      periodicityDimension_ = 0;
    } else {
      if (periodicity2IsZero) {
        periodicityDimension_ = 1;
      } else {
        periodicityDimension_ = 2;
      }
    }

    gridUnitVol_ = gridUnit * gridUnit * gridUnit;
  }
开发者ID:steffen-kiess,项目名称:dda,代码行数:27,代码来源:DipoleGeometry.cpp

示例3: parse

 void parse (StringParser& p, Math::Vector3<T>& out) {
   size_t start = p.pos ();
   p.expect (typeid (Math::Vector3<T>), start, '(');
   parse (p, out.x ());
   p.expect (typeid (Math::Vector3<T>), start, ',');
   parse (p, out.y ());
   p.expect (typeid (Math::Vector3<T>), start, ',');
   parse (p, out.z ());
   p.expect (typeid (Math::Vector3<T>), start, ')');
 }
开发者ID:steffen-kiess,项目名称:dda,代码行数:10,代码来源:Parse.hpp

示例4: createDipoleGeometry

 void Box::createDipoleGeometry (DipoleGeometry& dipoleGeometry) const {
   Math::Vector3<ldouble> size = this->size () / dipoleGeometry.gridUnit ();
   size_t mat = dipoleGeometry.materials ().size ();
   dipoleGeometry.materials ().push_back (material ());
   for (uint32_t z = 0; z < size.z (); z++) {
     for (uint32_t y = 0; y < size.y (); y++) {
       for (uint32_t x = 0; x < size.x (); x++) {
         ASSERT (mat <= 255);
         dipoleGeometry.addDipole (x, y, z, static_cast<uint8_t> (mat));
       }
     }
   }
   dipoleGeometry.moveToCenter ();
 }
开发者ID:steffen-kiess,项目名称:dda,代码行数:14,代码来源:Shapes.cpp

示例5: normalize

  void DipoleGeometry::normalize () {
    if (nvCount () == 0)
      return;

    Math::Vector3<uint32_t> min = Math::Vector3<uint32_t> (std::numeric_limits<uint32_t>::max (), std::numeric_limits<uint32_t>::max (), std::numeric_limits<uint32_t>::max ());

    for (uint32_t i = 0; i < nvCount (); i++) {
      Math::Vector3<uint32_t> coords = getGridCoordinates (i);
      if (coords.x () < min.x ())
        min.x () = coords.x ();
      if (coords.y () < min.y ())
        min.y () = coords.y ();
      if (coords.z () < min.z ())
        min.z () = coords.z ();
    }

    if (min != Math::Vector3<uint32_t> (0, 0, 0)) {
      for (uint32_t i = 0; i < nvCount (); i++) {
        positions_[i] -= min;
      }
      box_ -= min;
      origin () += min * gridUnit ();
    }
  }
开发者ID:steffen-kiess,项目名称:dda,代码行数:24,代码来源:DipoleGeometry.cpp

示例6: set

 void set (std::vector<U>& vector, size_t index, const Math::Vector3<U>& value) const {
     vector[index] = value.x ();
     vector[index + vecStride ()] = value.y ();
     vector[index + 2 * vecStride ()] = value.z ();
 }
开发者ID:steffen-kiess,项目名称:dda,代码行数:5,代码来源:DDAParams.hpp


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