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


C++ Matrix4D::multVec方法代码示例

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


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

示例1: transformGeometry

void PointKernel::transformGeometry(const Base::Matrix4D &rclMat)
{
    std::vector<value_type>& kernel = getBasicPoints();
    QtConcurrent::blockingMap(kernel, [rclMat](value_type& value) {
        rclMat.multVec(value, value);
    });
}
开发者ID:pgilfernandez,项目名称:FreeCAD,代码行数:7,代码来源:Points.cpp

示例2: transformGeometry

void PropertyNormalList::transformGeometry(const Base::Matrix4D &mat)
{
    // A normal vector is only a direction with unit length, so we only need to rotate it
    // (no translations or scaling)

    // Extract scale factors (assumes an orthogonal rotation matrix)
    // Use the fact that the length of the row vectors of R are all equal to 1
    // And that scaling is applied after rotating
    double s[3];
    s[0] = sqrt(mat[0][0] * mat[0][0] + mat[0][1] * mat[0][1] + mat[0][2] * mat[0][2]);
    s[1] = sqrt(mat[1][0] * mat[1][0] + mat[1][1] * mat[1][1] + mat[1][2] * mat[1][2]);
    s[2] = sqrt(mat[2][0] * mat[2][0] + mat[2][1] * mat[2][1] + mat[2][2] * mat[2][2]);

    // Set up the rotation matrix: zero the translations and make the scale factors = 1
    Base::Matrix4D rot;
    rot.setToUnity();
    for (unsigned short i = 0; i < 3; i++) {
        for (unsigned short j = 0; j < 3; j++) {
            rot[i][j] = mat[i][j] / s[i];
        }
    }

    aboutToSetValue();

    // Rotate the normal vectors
#ifdef _WIN32
    Concurrency::parallel_for_each(_lValueList.begin(), _lValueList.end(), [rot](Base::Vector3f& value) {
        value = rot * value;
    });
#else
    QtConcurrent::blockingMap(_lValueList, [rot](Base::Vector3f& value) {
        rot.multVec(value, value);
    });
#endif

    hasSetValue();
}
开发者ID:DevJohan,项目名称:FreeCAD_sf_master,代码行数:37,代码来源:Properties.cpp


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