本文整理汇总了C++中TStroke::getControlPointAtParameter方法的典型用法代码示例。如果您正苦于以下问题:C++ TStroke::getControlPointAtParameter方法的具体用法?C++ TStroke::getControlPointAtParameter怎么用?C++ TStroke::getControlPointAtParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TStroke
的用法示例。
在下文中一共展示了TStroke::getControlPointAtParameter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getDisplacement
TThickPoint TStrokeBenderDeformation::getDisplacement(const TStroke &s,
double w) const {
// potenziale exp^(-x^2) limitato tra
// [-c_maxLenghtOfGaussian,c_maxLenghtOfGaussian]
double strokeLengthAtParameter = s.getLength(w);
double diff = strokeLengthAtParameter - m_startLength;
if (m_vect) {
double outVal = 0.0;
if (fabs(diff) <= m_lengthOfDeformation)
if (m_versus == INNER) {
diff *= (1.0 / m_lengthOfDeformation) * c_maxLenghtOfGaussian;
outVal = gaussianPotential(diff);
} else if (m_versus == OUTER) {
double valForGaussian = -c_maxLenghtOfGaussian +
2 * c_maxLenghtOfGaussian /
m_lengthOfDeformation *
strokeLengthAtParameter;
outVal = 1.0 - gaussianPotential(valForGaussian);
}
TPointD cp = convert(s.getControlPointAtParameter(w));
TPointD p = cp;
TRotation rot(*m_vect, outVal * rad2degree(m_angle));
p = rot * p;
return TThickPoint(p - cp, 0.0);
}
return TThickPoint();
}
示例2: getDelta
double TStrokePointDeformation::getDelta(const TStroke &stroke,
double w) const {
// reference to a thickpoint
TThickPoint thickPnt = m_imp->m_vect ? stroke.getControlPointAtParameter(w)
: stroke.getThickPoint(w);
assert(thickPnt != TConsts::natp);
TPointD pntOfStroke = convert(thickPnt);
double d = tdistance(pntOfStroke, m_imp->m_circleCenter);
return m_imp->m_potential->gradient(d);
}