inline bool BasicColorMatrixFilterOperation::operator==(const FilterOperation& operation) const
{
    if (!isSameType(operation))
        return false;
    const BasicColorMatrixFilterOperation& other = downcast<BasicColorMatrixFilterOperation>(operation);
    return m_amount == other.m_amount;
}
bool BoxReflectFilterOperation::operator==(const FilterOperation& o) const
{
    if (!isSameType(o))
        return false;
    const auto& other = static_cast<const BoxReflectFilterOperation&>(o);
    return m_direction == other.m_direction && m_offset == other.m_offset;
}
bool DefaultFilterOperation::operator==(const FilterOperation& operation) const
{
    if (!isSameType(operation))
        return false;
    
    return representedType() == downcast<DefaultFilterOperation>(operation).representedType();
}
bool ReferenceFilterOperation::operator==(const FilterOperation& operation) const
{
    if (!isSameType(operation))
        return false;
    
    return m_url == downcast<ReferenceFilterOperation>(operation).m_url;
}
bool BlurFilterOperation::operator==(const FilterOperation& operation) const
{
    if (!isSameType(operation))
        return false;
    
    return m_stdDeviation == downcast<BlurFilterOperation>(operation).stdDeviation();
}
bool RotateTransformOperation::operator==(const TransformOperation& other) const
{
    if (!isSameType(other))
        return false;
    const RotateTransformOperation& r = downcast<RotateTransformOperation>(other);
    return m_x == r.m_x && m_y == r.m_y && m_z == r.m_z && m_angle == r.m_angle;
}
bool MatrixTransformOperation::operator==(const TransformOperation& o) const
{
    if (!isSameType(o))
        return false;
    const MatrixTransformOperation& m = toMatrixTransformOperation(o);
    return m_a == m.m_a && m_b == m.m_b && m_c == m.m_c && m_d == m.m_d && m_e == m.m_e && m_f == m.m_f;
}
bool RotateTransformOperation::operator==(const TransformOperation& other) const
{
    if (!isSameType(other))
        return false;
    const Rotation& otherRotation = toRotateTransformOperation(other).m_rotation;
    return m_rotation.axis == otherRotation.axis && m_rotation.angle == otherRotation.angle;
}
Example #9
0
bool ReferenceFilterOperation::operator==(const FilterOperation& o) const
{
    if (!isSameType(o))
        return false;
    
    return m_url == toReferenceFilterOperation(o).m_url;
}
bool ScaleTransformOperation::operator==(const TransformOperation& o) const
{
    if (!isSameType(o))
        return false;
    const ScaleTransformOperation& s = toScaleTransformOperation(o);
    return m_x == s.m_x && m_y == s.m_y && m_z == s.m_z;
}
Example #11
0
inline bool BasicColorMatrixFilterOperation::operator==(const FilterOperation& o) const
{
    if (!isSameType(o))
        return false;
    const BasicColorMatrixFilterOperation& other = toBasicColorMatrixFilterOperation(o);
    return m_amount == other.m_amount;
}
bool BasicShape::canBlend(const BasicShape* other) const
{
    // FIXME: Support animations between different shapes in the future.
    if (!other || !isSameType(*other))
        return false;

    // Just polygons with same number of vertices can be animated.
    if (type() == BasicShape::BasicShapePolygonType
        && (toBasicShapePolygon(this)->values().size() != toBasicShapePolygon(other)->values().size()
        || toBasicShapePolygon(this)->windRule() != toBasicShapePolygon(other)->windRule()))
        return false;

    // Circles with keywords for radii or center coordinates cannot be animated.
    if (type() == BasicShape::BasicShapeCircleType) {
        if (!toBasicShapeCircle(this)->radius().canBlend(toBasicShapeCircle(other)->radius()))
            return false;
    }

    // Ellipses with keywords for radii or center coordinates cannot be animated.
    if (type() != BasicShape::BasicShapeEllipseType)
        return true;

    return (toBasicShapeEllipse(this)->radiusX().canBlend(toBasicShapeEllipse(other)->radiusX())
        && toBasicShapeEllipse(this)->radiusY().canBlend(toBasicShapeEllipse(other)->radiusY()));
}
bool BasicShapeCircle::operator==(const BasicShape& o) const
{
    if (!isSameType(o))
        return false;
    const BasicShapeCircle& other = toBasicShapeCircle(o);
    return m_centerX == other.m_centerX && m_centerY == other.m_centerY && m_radius == other.m_radius;
}
Example #14
0
bool DropShadowFilterOperation::operator==(const FilterOperation& o) const
{
    if (!isSameType(o))
        return false;
    const DropShadowFilterOperation& other = toDropShadowFilterOperation(o);
    return m_location == other.m_location && m_stdDeviation == other.m_stdDeviation && m_color == other.m_color;
}
Example #15
0
bool BlurFilterOperation::operator==(const FilterOperation& o) const
{
    if (!isSameType(o))
        return false;
    
    return m_stdDeviation == toBlurFilterOperation(o).stdDeviation();
}
bool SkewTransformOperation::operator==(const TransformOperation& other) const
{
    if (!isSameType(other))
        return false;
    const SkewTransformOperation& s = downcast<SkewTransformOperation>(other);
    return m_angleX == s.m_angleX && m_angleY == s.m_angleY;
}
bool BasicShapePolygon::operator==(const BasicShape& o) const
{
    if (!isSameType(o))
        return false;
    const BasicShapePolygon& other = toBasicShapePolygon(o);
    return m_windRule == other.m_windRule && m_values == other.m_values;
}
bool BasicShapeEllipse::operator==(const BasicShape& o) const
{
    if (!isSameType(o))
        return false;
    const BasicShapeEllipse& other = toBasicShapeEllipse(o);
    return m_centerX == other.m_centerX && m_centerY == other.m_centerY && m_radiusX == other.m_radiusX && m_radiusY == other.m_radiusY;
}
bool TranslateTransformOperation::operator==(const TransformOperation& other) const
{
    if (!isSameType(other))
        return false;
    const TranslateTransformOperation& t = downcast<TranslateTransformOperation>(other);
    return m_x == t.m_x && m_y == t.m_y && m_z == t.m_z;
}
Example #20
0
bool DefaultFilterOperation::operator==(const FilterOperation& o) const
{
    if (!isSameType(o))
        return false;
    
    return representedType() == toDefaultFilterOperation(o).representedType();
}
bool InterpolatedTransformOperation::operator==(const TransformOperation& o) const
{
    if (!isSameType(o))
        return false;
    const InterpolatedTransformOperation* t = static_cast<const InterpolatedTransformOperation*>(&o);
    return progress == t->progress && from == t->from && to == t->to;
}
Example #22
0
Point Board::isNeighbourTheSameType(Point current, Point neighbour)
{
	if(existsIndex(neighbour))
	{
		Gem* currentGem = mTiles[XYCoordinatesToIndex(current)];
		Gem* upperGem = mTiles[XYCoordinatesToIndex(neighbour)];
		if(isSameType(currentGem,upperGem))
			return neighbour;
	}
	return NULL_POINT;// Point(-1,-1);
}
Example #23
0
int OSM_Crusher::setFeed( OSM_Stream& modelFeed )
{
    int setOk = 0;                // Default fail

    if( isSameType(modelFeed) )   // Check StreamTypes
    {
        feedStream = &modelFeed;  // Save pointer to modelFeed
        setOk = 1;                // Succeed
    }
    return setOk;
}
bool BasicShapeInset::operator==(const BasicShape& o) const
{
    if (!isSameType(o))
        return false;
    const BasicShapeInset& other = toBasicShapeInset(o);
    return m_right == other.m_right
        && m_top == other.m_top
        && m_bottom == other.m_bottom
        && m_left == other.m_left
        && m_topLeftRadius == other.m_topLeftRadius
        && m_topRightRadius == other.m_topRightRadius
        && m_bottomRightRadius == other.m_bottomRightRadius
        && m_bottomLeftRadius == other.m_bottomLeftRadius;
}
PassRefPtr<BasicShape> BasicShapeInset::blend(const BasicShape* other, double progress) const
{
    ASSERT(other && isSameType(*other));

    const BasicShapeInset& otherInset = toBasicShapeInset(*other);
    RefPtr<BasicShapeInset> result = BasicShapeInset::create();
    result->setTop(m_top.blend(otherInset.top(), progress, ValueRangeAll));
    result->setRight(m_right.blend(otherInset.right(), progress, ValueRangeAll));
    result->setBottom(m_bottom.blend(otherInset.bottom(), progress, ValueRangeAll));
    result->setLeft(m_left.blend(otherInset.left(), progress, ValueRangeAll));

    result->setTopLeftRadius(blendLengthSize(m_topLeftRadius, otherInset.topLeftRadius(), progress));
    result->setTopRightRadius(blendLengthSize(m_topRightRadius, otherInset.topRightRadius(), progress));
    result->setBottomRightRadius(blendLengthSize(m_bottomRightRadius, otherInset.bottomRightRadius(), progress));
    result->setBottomLeftRadius(blendLengthSize(m_bottomLeftRadius, otherInset.bottomLeftRadius(), progress));

    return result.release();
}
PassRefPtr<BasicShape> BasicShapePolygon::blend(const BasicShape* other, double progress) const
{
    ASSERT(other && isSameType(*other));

    const BasicShapePolygon* o = toBasicShapePolygon(other);
    ASSERT(m_values.size() == o->values().size());
    ASSERT(!(m_values.size() % 2));

    size_t length = m_values.size();
    RefPtr<BasicShapePolygon> result = BasicShapePolygon::create();
    if (!length)
        return result.release();

    result->setWindRule(o->windRule());

    for (size_t i = 0; i < length; i = i + 2) {
        result->appendPoint(m_values.at(i).blend(o->values().at(i), progress, ValueRangeAll),
            m_values.at(i + 1).blend(o->values().at(i + 1), progress, ValueRangeAll));
    }

    return result.release();
}
UnicodeString FieldsSet::diffFrom(const FieldsSet& other, UErrorCode& status) const {
    UnicodeString str;
    if(!isSameType(other)) {
        status = U_ILLEGAL_ARGUMENT_ERROR;
        return UnicodeString("U_ILLEGAL_ARGUMENT_ERROR: FieldsSet of a different type!");
    }
    for (int i=0; i<fieldCount(); i++) {
        if (isSet((UCalendarDateFields)i)) {
            int32_t myVal = get(i);
            int32_t theirVal = other.get(i);

            if(fEnum != -1) {
                const UnicodeString& fieldName = udbg_enumString(
                                                     fEnum, i);

                str = str + fieldName + UnicodeString("=")+myVal+UnicodeString(" not ")+theirVal+UnicodeString(", ");
            } else {
                str = str + UnicodeString("some field") + "=" + myVal+" not " + theirVal+", ";
            }
        }
    }
    return str;
}
Example #28
0
bool ReferenceClipPathOperation::operator==(const ClipPathOperation& o) const {
  if (!isSameType(o))
    return false;
  const ReferenceClipPathOperation& other = toReferenceClipPathOperation(o);
  return m_elementProxy == other.m_elementProxy && m_url == other.m_url;
}
Example #29
0
 bool ExponentOp::canCombineWith(const OpRcPtr & op) const
 {
     return isSameType(op);
 }
Example #30
0
bool PerspectiveTransformOperation::operator==(const TransformOperation& other) const
{
    if (!isSameType(other))
        return false;
    return m_p == downcast<PerspectiveTransformOperation>(other).m_p;
}