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


C++ Path::GetLineWeightScalable方法代码示例

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


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

示例1: ProcessLineUsage

SE_LineStyle* SE_StyleVisitor::ProcessLineUsage(LineUsage& lineUsage)
{
    SE_LineStyle* style = new SE_LineStyle();
    ParseStringExpression(lineUsage.GetAngleControl(), style->angleControl, LineUsage::sAngleControlDefault, LineUsage::sAngleControlValues);
    ParseStringExpression(lineUsage.GetUnitsControl(), style->unitsControl, LineUsage::sUnitsControlDefault, LineUsage::sUnitsControlValues);
    ParseStringExpression(lineUsage.GetVertexControl(), style->vertexControl, LineUsage::sVertexControlDefault, LineUsage::sVertexControlValues);
    ParseDoubleExpression(lineUsage.GetAngle(), style->angleDeg, 0.0);
    ParseDoubleExpression(lineUsage.GetStartOffset(), style->startOffset, -1.0);
    ParseDoubleExpression(lineUsage.GetEndOffset(), style->endOffset, -1.0);
    ParseDoubleExpression(lineUsage.GetRepeat(), style->repeat, 0.0);
    ParseDoubleExpression(lineUsage.GetVertexAngleLimit(), style->vertexAngleLimit, 0.0);
    ParseStringExpression(lineUsage.GetVertexJoin(), style->vertexJoin, LineUsage::sVertexJoinDefault, LineUsage::sVertexJoinValues);
    ParseDoubleExpression(lineUsage.GetVertexMiterLimit(), style->vertexMiterLimit, 5.0);

    Path* defaultPath = lineUsage.GetDefaultPath();
    if (defaultPath != NULL)
    {
        ParseDoubleExpression(defaultPath->GetLineWeight(), style->dpWeight, 0.0);
        ParseColorExpression(defaultPath->GetLineColor(), style->dpColor, 0);
        ParseBooleanExpression(defaultPath->GetLineWeightScalable(), style->dpWeightScalable, true);
        ParseStringExpression(defaultPath->GetLineCap(), style->dpCap, Path::sLineCapDefault, Path::sLineCapValues);
        ParseStringExpression(defaultPath->GetLineJoin(), style->dpJoin, Path::sLineJoinDefault, Path::sLineJoinValues);
        ParseDoubleExpression(defaultPath->GetLineMiterLimit(), style->dpMiterLimit, 5.0);

        // if the color is transparent there's no point in drawing this
        // path, so change it to black
        if (style->dpColor.value.argb == 0)
            style->dpColor.value.comps.a = 255;
    }

    // set flag if all properties are constant
    style->cacheable = !(style->angleDeg.expression
                      || style->angleControl.expression
                      || style->unitsControl.expression
                      || style->vertexControl.expression
                      || style->startOffset.expression
                      || style->endOffset.expression
                      || style->repeat.expression
                      || style->vertexAngleLimit.expression
                      || style->vertexJoin.expression
                      || style->vertexMiterLimit.expression
                      || style->dpWeight.expression
                      || style->dpColor.expression
                      || style->dpWeightScalable.expression
                      || style->dpCap.expression
                      || style->dpJoin.expression
                      || style->dpMiterLimit.expression);

    return style;
}
开发者ID:asir6,项目名称:Colt,代码行数:50,代码来源:SE_StyleVisitor.cpp

示例2: VisitPath

void SE_StyleVisitor::VisitPath(Path& path)
{
    delete m_primitive;
    m_primitive = NULL;

    SE_Color fillColor;
    ParseColorExpression(path.GetFillColor(), fillColor, 0);

    if (fillColor.empty())
    {
        SE_Polyline* primitive = new SE_Polyline();
        m_primitive = primitive;
        primitive->geometry = SE_BufferPool::NewSELineBuffer(m_bp, 4);
        ParseGeometry(path.GetGeometry(), *primitive->geometry);
        ParseDoubleExpression(path.GetLineWeight(), primitive->weight, 0.0);
        ParseColorExpression(path.GetLineColor(), primitive->color, 0);
        ParseBooleanExpression(path.GetLineWeightScalable(), primitive->weightScalable, true);
        ParseStringExpression(path.GetLineCap(), primitive->cap, Path::sLineCapDefault, Path::sLineCapValues);
        ParseStringExpression(path.GetLineJoin(), primitive->join, Path::sLineJoinDefault, Path::sLineJoinValues);
        ParseDoubleExpression(path.GetLineMiterLimit(), primitive->miterLimit, 5.0);
        ParseDoubleExpression(path.GetScaleX(), primitive->scaleX, 1.0);
        ParseDoubleExpression(path.GetScaleY(), primitive->scaleY, 1.0);
        ParseStringExpression(path.GetResizeControl(), primitive->resizeControl, GraphicElement::sResizeControlDefault, GraphicElement::sResizeControlValues);

        // if the color is transparent there's no point in drawing this
        // path, so change it to black
        if (primitive->color.value.argb == 0)
            primitive->color.value.comps.a = 255;

        primitive->cacheable = !(primitive->weight.expression
                              || primitive->color.expression
                              || primitive->weightScalable.expression
                              || primitive->cap.expression
                              || primitive->join.expression
                              || primitive->miterLimit.expression
                              || primitive->resizeControl.expression
                              || primitive->scaleX.expression
                              || primitive->scaleY.expression);
    }
    else
    {
        SE_Polygon* primitive = new SE_Polygon();
        m_primitive = primitive;
        primitive->fill = fillColor;
        primitive->geometry = SE_BufferPool::NewSELineBuffer(m_bp, 4);
        ParseGeometry(path.GetGeometry(), *primitive->geometry);
        ParseDoubleExpression(path.GetLineWeight(), primitive->weight, 0.0);
        ParseColorExpression(path.GetLineColor(), primitive->color, 0);
        ParseBooleanExpression(path.GetLineWeightScalable(), primitive->weightScalable, true);
        ParseStringExpression(path.GetLineCap(), primitive->cap, Path::sLineCapDefault, Path::sLineCapValues);
        ParseStringExpression(path.GetLineJoin(), primitive->join, Path::sLineJoinDefault, Path::sLineJoinValues);
        ParseDoubleExpression(path.GetLineMiterLimit(), primitive->miterLimit, 5.0);
        ParseDoubleExpression(path.GetScaleX(), primitive->scaleX, 1.0);
        ParseDoubleExpression(path.GetScaleY(), primitive->scaleY, 1.0);
        ParseStringExpression(path.GetResizeControl(), primitive->resizeControl, GraphicElement::sResizeControlDefault, GraphicElement::sResizeControlValues);

        primitive->cacheable = !(primitive->weight.expression
                              || primitive->color.expression
                              || primitive->fill.expression
                              || primitive->weightScalable.expression
                              || primitive->cap.expression
                              || primitive->join.expression
                              || primitive->miterLimit.expression
                              || primitive->resizeControl.expression
                              || primitive->scaleX.expression
                              || primitive->scaleY.expression);
    }
}
开发者ID:asir6,项目名称:Colt,代码行数:68,代码来源:SE_StyleVisitor.cpp


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