本文整理汇总了C++中SVGEllipseElement::transform_attr方法的典型用法代码示例。如果您正苦于以下问题:C++ SVGEllipseElement::transform_attr方法的具体用法?C++ SVGEllipseElement::transform_attr怎么用?C++ SVGEllipseElement::transform_attr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SVGEllipseElement
的用法示例。
在下文中一共展示了SVGEllipseElement::transform_attr方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CalculateBounds
//virtual
void PSVGEllipseElement::CalculateBounds()
{
SVGEllipseElement* psvgElement = static_cast<SVGEllipseElement*>(m_pNode);
gm::Matrix3d* matrix = psvgElement->transform_attr()->m_animVal->consolidateToMatrix();
PSVGElement* pViewportElement = GetViewportElement();
ASSERT(pViewportElement);
gm::RectD viewBox = pViewportElement->GetViewBox();
/*
SVGLength* cxLength = psvgElement->m_cx->m_animated->m_animVal->m_value;
SVGLength* cyLength = psvgElement->m_cy->m_animated->m_animVal->m_value;
SVGLength* rxLength = psvgElement->m_rx->m_animated->m_animVal->m_value;
SVGLength* ryLength = psvgElement->m_ry->m_animated->m_animVal->m_value;
*/
ISVGLength* cxLength = psvgElement->get_cx()->get_animVal();
ISVGLength* cyLength = psvgElement->get_cy()->get_animVal();
ISVGLength* rxLength = psvgElement->get_rx()->get_animVal();
ISVGLength* ryLength = psvgElement->get_ry()->get_animVal();
m_computedCx = LengthToUserUnits(cxLength, viewBox.Width);
m_computedCy = LengthToUserUnits(cyLength, viewBox.Height);
m_computedRx = LengthToUserUnits(rxLength, viewBox.Width);
m_computedRy = LengthToUserUnits(ryLength, viewBox.Height);
/*
if (cxLength->m_unitType == SVG_LENGTHTYPE_PERCENTAGE)
{
m_computedCx = (cxLength->m_valueInSpecifiedUnits * viewBox.Width)/100;
}
else
{
m_computedCx = cxLength->m_value;
}
if (cyLength->m_unitType == SVG_LENGTHTYPE_PERCENTAGE)
{
m_computedCy = (cyLength->m_valueInSpecifiedUnits * viewBox.Height)/100;
}
else
{
m_computedCy = cyLength->m_value;
}
if (rxLength->m_unitType == SVG_LENGTHTYPE_PERCENTAGE)
{
m_computedRx = (rxLength->m_valueInSpecifiedUnits * viewBox.Width)/100;
}
else
{
m_computedRx = rxLength->m_value;
}
if (ryLength->m_unitType == SVG_LENGTHTYPE_PERCENTAGE)
{
m_computedRy = (ryLength->m_valueInSpecifiedUnits * viewBox.Height)/100;
}
else
{
m_computedRy = ryLength->m_value;
}
*/
m_bounds.X = m_computedCx - m_computedRx;
m_bounds.Y = m_computedCy - m_computedRy;
m_bounds.Width = m_computedRx * 2;
m_bounds.Height = m_computedRy * 2;
m_xbounds = gm::CalcEllipseBBox(m_bounds.X, m_bounds.Y, m_bounds.Width, m_bounds.Height, matrix);
// LDraw::GraphicsPathF GraphicsPathF;
// GraphicsPathF.AddEllipse(float(m_bounds.X), float(m_bounds.Y), float(m_bounds.Width), float(m_bounds.Height));
// LDraw::Pen pen(LDraw::Color(0,0,0), (float)m_computedStrokeWidth);
/*
LDraw::RectF bounds;
GraphicsPathF.GetBounds(&bounds, NULL, &pen);
*/
m_expandedBBox.X = m_bounds.X - m_computedStrokeWidth/2;
m_expandedBBox.Y = m_bounds.Y - m_computedStrokeWidth/2;
m_expandedBBox.Width = m_bounds.Width + m_computedStrokeWidth;
m_expandedBBox.Height = m_bounds.Height + m_computedStrokeWidth;
}