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


C++ BasicShape类代码示例

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


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

示例1: Create

void RevoluteJoint::Create(b2World &world,
                           const BasicShape &joinedBody1,
                           const BasicShape &joinedBody2,
                           const b2Vec2 &anchor1,
                           const b2Vec2 &anchor2,
                           const bool collideConnected,
                           const float lowerAngle,
                           const float upperAngle,
                           const bool enableLimit,
                           const float maxMotorTorque,
                           const float motorSpeed,
                           const bool enableMotor,
                           const float referenceAngle)
{
    b_ptrJoinedBody1 = const_cast<b2Body*>(joinedBody1.GetBody());
    b_ptrJoinedBody2 = const_cast<b2Body*>(joinedBody2.GetBody());

    //b2RevoluteJointDef revoluteJointDefinition;
    _revoluteJointDefinition.bodyA = b_ptrJoinedBody1;
    _revoluteJointDefinition.bodyB = b_ptrJoinedBody2;
    _revoluteJointDefinition.localAnchorA = anchor1;
    _revoluteJointDefinition.localAnchorB = anchor2;
    _revoluteJointDefinition.collideConnected = collideConnected;
    _revoluteJointDefinition.lowerAngle = lowerAngle;
    _revoluteJointDefinition.upperAngle = upperAngle;
    _revoluteJointDefinition.enableLimit = enableLimit;
    _revoluteJointDefinition.maxMotorTorque = maxMotorTorque;
    _revoluteJointDefinition.motorSpeed = motorSpeed;
    _revoluteJointDefinition.enableMotor = enableMotor;
    _revoluteJointDefinition.referenceAngle = referenceAngle;

    b_ptrJoint = world.CreateJoint(&_revoluteJointDefinition);
}
开发者ID:ruwhan,项目名称:LearnBox2DSFML,代码行数:33,代码来源:RevoluteJoint.cpp

示例2: isExclusionShapeInsideInfoEnabledForRenderBlock

bool ExclusionShapeInsideInfo::isExclusionShapeInsideInfoEnabledForRenderBlock(const RenderBlock* block)
{
    // FIXME: Bug 89707: Enable shape inside for non-rectangular shapes
    ExclusionShapeValue* shapeValue = block->style()->shapeInside();
    BasicShape* shape = (shapeValue && shapeValue->type() == ExclusionShapeValue::SHAPE) ? shapeValue->shape() : 0;
    return shape && (shape->type() == BasicShape::BASIC_SHAPE_RECTANGLE || shape->type() == BasicShape::BASIC_SHAPE_POLYGON);
}
开发者ID:jiezh,项目名称:h5vcc,代码行数:7,代码来源:ExclusionShapeInsideInfo.cpp

示例3: radius

bool BasicShapeCircle::canBlend(const BasicShape& other) const
{
    if (type() != other.type())
        return false;

    return radius().canBlend(downcast<BasicShapeCircle>(other).radius());
}
开发者ID:JohnDn,项目名称:webkit,代码行数:7,代码来源:BasicShapes.cpp

示例4:

bool BasicShapePath::operator==(const BasicShape& other) const
{
    if (type() != other.type())
        return false;

    auto& otherPath = downcast<BasicShapePath>(other);
    return m_windRule == otherPath.m_windRule && *m_byteStream == *otherPath.m_byteStream;
}
开发者ID:JohnDn,项目名称:webkit,代码行数:8,代码来源:BasicShapes.cpp

示例5: canBlend

bool BasicShapePath::canBlend(const BasicShape& other) const
{
    if (type() != other.type())
        return false;

    auto& otherPath = downcast<BasicShapePath>(other);
    return windRule() == otherPath.windRule() && canBlendSVGPathByteStreams(*m_byteStream, *otherPath.pathData());
}
开发者ID:JohnDn,项目名称:webkit,代码行数:8,代码来源:BasicShapes.cpp

示例6: getCorrectStrokeStyle

 VGImage::StyleType VGImage::getCorrectStrokeStyle(StrokeStyle *s, const BasicShape& shape)
 {
   if(shape.hasOwnStrokeStyle())
   {
     *s = shape.getStrokeStyle();
     if(!s->getColor().isClear())
       return SHAPE;
     else
       return CLEAR;
   }
   else if(defaults->useSS)
   {
     *s = defaults->strokeStyle;
     if(!s->getColor().isClear())
       return DEFAULT;
     else
       return CLEAR;
   }
   return NONE;
 }
开发者ID:etschneider,项目名称:GPSTk,代码行数:20,代码来源:VGImage.cpp

示例7: ASSERT

Ref<BasicShape> BasicShapeCircle::blend(const BasicShape& other, double progress) const
{
    ASSERT(type() == other.type());
    auto& otherCircle = downcast<BasicShapeCircle>(other);
    auto result =  BasicShapeCircle::create();

    result->setCenterX(m_centerX.blend(otherCircle.centerX(), progress));
    result->setCenterY(m_centerY.blend(otherCircle.centerY(), progress));
    result->setRadius(m_radius.blend(otherCircle.radius(), progress));
    return WTFMove(result);
}
开发者ID:JohnDn,项目名称:webkit,代码行数:11,代码来源:BasicShapes.cpp


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