OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 double x() const { return m_x; } | 44 double x() const { return m_x; } |
45 double y() const { return m_y; } | 45 double y() const { return m_y; } |
46 double z() const { return m_z; } | 46 double z() const { return m_z; } |
47 double angle() const { return m_angle; } | 47 double angle() const { return m_angle; } |
48 | 48 |
49 FloatPoint3D axis() const; | 49 FloatPoint3D axis() const; |
50 static bool shareSameAxis(const RotateTransformOperation* fromRotation, cons
t RotateTransformOperation* toRotation, FloatPoint3D* axis, double* fromAngle, d
ouble* toAngle); | 50 static bool shareSameAxis(const RotateTransformOperation* fromRotation, cons
t RotateTransformOperation* toRotation, FloatPoint3D* axis, double* fromAngle, d
ouble* toAngle); |
51 | 51 |
52 virtual bool canBlendWith(const TransformOperation& other) const; | 52 virtual bool canBlendWith(const TransformOperation& other) const; |
53 virtual OperationType type() const override { return m_type; } | 53 OperationType type() const override { return m_type; } |
54 | 54 |
55 virtual void apply(TransformationMatrix& transform, const FloatSize& /*borde
rBoxSize*/) const override | 55 void apply(TransformationMatrix& transform, const FloatSize& /*borderBoxSize
*/) const override |
56 { | 56 { |
57 transform.rotate3d(m_x, m_y, m_z, m_angle); | 57 transform.rotate3d(m_x, m_y, m_z, m_angle); |
58 } | 58 } |
59 | 59 |
60 static bool isMatchingOperationType(OperationType type) { return type == Rot
ate || type == RotateX || type == RotateY || type == RotateZ || type == Rotate3D
; } | 60 static bool isMatchingOperationType(OperationType type) { return type == Rot
ate || type == RotateX || type == RotateY || type == RotateZ || type == Rotate3D
; } |
61 | 61 |
62 private: | 62 private: |
63 virtual bool operator==(const TransformOperation& o) const override | 63 bool operator==(const TransformOperation& o) const override |
64 { | 64 { |
65 if (!isSameType(o)) | 65 if (!isSameType(o)) |
66 return false; | 66 return false; |
67 const RotateTransformOperation* r = static_cast<const RotateTransformOpe
ration*>(&o); | 67 const RotateTransformOperation* r = static_cast<const RotateTransformOpe
ration*>(&o); |
68 return m_x == r->m_x && m_y == r->m_y && m_z == r->m_z && m_angle == r->
m_angle; | 68 return m_x == r->m_x && m_y == r->m_y && m_z == r->m_z && m_angle == r->
m_angle; |
69 } | 69 } |
70 | 70 |
71 virtual PassRefPtr<TransformOperation> blend(const TransformOperation* from,
double progress, bool blendToIdentity = false) override; | 71 PassRefPtr<TransformOperation> blend(const TransformOperation* from, double
progress, bool blendToIdentity = false) override; |
72 | 72 |
73 RotateTransformOperation(double x, double y, double z, double angle, Operati
onType type) | 73 RotateTransformOperation(double x, double y, double z, double angle, Operati
onType type) |
74 : m_x(x) | 74 : m_x(x) |
75 , m_y(y) | 75 , m_y(y) |
76 , m_z(z) | 76 , m_z(z) |
77 , m_angle(angle) | 77 , m_angle(angle) |
78 , m_type(type) | 78 , m_type(type) |
79 { | 79 { |
80 ASSERT(isMatchingOperationType(type)); | 80 ASSERT(isMatchingOperationType(type)); |
81 } | 81 } |
82 | 82 |
83 double m_x; | 83 double m_x; |
84 double m_y; | 84 double m_y; |
85 double m_z; | 85 double m_z; |
86 double m_angle; | 86 double m_angle; |
87 OperationType m_type; | 87 OperationType m_type; |
88 }; | 88 }; |
89 | 89 |
90 DEFINE_TRANSFORM_TYPE_CASTS(RotateTransformOperation); | 90 DEFINE_TRANSFORM_TYPE_CASTS(RotateTransformOperation); |
91 | 91 |
92 } // namespace blink | 92 } // namespace blink |
93 | 93 |
94 #endif // RotateTransformOperation_h | 94 #endif // RotateTransformOperation_h |
OLD | NEW |