本文整理汇总了C++中QTransform::determinant方法的典型用法代码示例。如果您正苦于以下问题:C++ QTransform::determinant方法的具体用法?C++ QTransform::determinant怎么用?C++ QTransform::determinant使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTransform
的用法示例。
在下文中一共展示了QTransform::determinant方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: transform
void Selection::transform(QTransform transform, int pageNum)
{
m_selectionPolygon = transform.map(m_selectionPolygon);
qreal sx = transform.m11();
qreal sy = transform.m22();
qreal s = (sx + sy) / 2.0;
for (int i = 0; i < m_strokes.size(); ++i)
{
m_strokes[i].points = transform.map(m_strokes[i].points);
/*
'if (!transform.isRotating())' doesn't work, since rotation of 180 and 360 degrees is treated as a scaling transformation. Same goes for
'if (transform.isScaling())'
*/
if (transform.determinant() != 1)
{
m_strokes[i].penWidth = m_strokes[i].penWidth * s;
}
}
if (transform.determinant() != 1)
{
m_x_padding *= sx;
m_y_padding *= sy;
}
if (transform.isRotating())
{
m_x_padding = m_padding;
m_y_padding = m_padding;
}
m_angle = 0.0;
setPageNum(pageNum);
}
示例2: threePointsAreCollinear
bool CallbackAxisPointsAbstract::threePointsAreCollinear (double m [3] [3], int numberColumns)
{
if (numberColumns == 3) {
// Compute determinant to determine if the three points are collinear
QTransform t (
m [0] [0], m [0] [1], m [0] [2],
m [1] [0], m [1] [1], m [1] [2],
m [2] [0], m [2] [1], m [2] [2]);
return (t.determinant() == 0);
}
return false;
}
示例3: approxTransformScale
qreal KoUnit::approxTransformScale(const QTransform &t)
{
return std::sqrt(t.determinant());
}
示例4: threePointsAreCollinear
bool CallbackAxisPointsAbstract::threePointsAreCollinear (const QTransform &transform)
{
return (transform.determinant() == 0);
}