本文整理汇总了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);
}
示例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);
}
示例3: radius
bool BasicShapeCircle::canBlend(const BasicShape& other) const
{
if (type() != other.type())
return false;
return radius().canBlend(downcast<BasicShapeCircle>(other).radius());
}
示例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;
}
示例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());
}
示例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;
}
示例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);
}