Slot.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /******************************************************************************
  2. * Spine Runtimes License Agreement
  3. * Last updated January 1, 2020. Replaces all prior versions.
  4. *
  5. * Copyright (c) 2013-2020, Esoteric Software LLC
  6. *
  7. * Integration of the Spine Runtimes into software or otherwise creating
  8. * derivative works of the Spine Runtimes is permitted under the terms and
  9. * conditions of Section 2 of the Spine Editor License Agreement:
  10. * http://esotericsoftware.com/spine-editor-license
  11. *
  12. * Otherwise, it is permitted to integrate the Spine Runtimes into software
  13. * or otherwise create derivative works of the Spine Runtimes (collectively,
  14. * "Products"), provided that each user of the Products must obtain their own
  15. * Spine Editor license and redistribution of the Products in any form must
  16. * include this license and copyright notice.
  17. *
  18. * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
  19. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  20. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  21. * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
  22. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  23. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
  24. * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
  25. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  26. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  27. * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  28. *****************************************************************************/
  29. #ifndef Spine_Slot_h
  30. #define Spine_Slot_h
  31. #include <spine/Vector.h>
  32. #include <spine/SpineObject.h>
  33. #include <spine/Color.h>
  34. namespace spine {
  35. class SlotData;
  36. class Bone;
  37. class Skeleton;
  38. class Attachment;
  39. class SP_API Slot : public SpineObject {
  40. friend class VertexAttachment;
  41. friend class Skeleton;
  42. friend class SkeletonBounds;
  43. friend class SkeletonClipping;
  44. friend class AttachmentTimeline;
  45. friend class ColorTimeline;
  46. friend class DeformTimeline;
  47. friend class DrawOrderTimeline;
  48. friend class EventTimeline;
  49. friend class IkConstraintTimeline;
  50. friend class PathConstraintMixTimeline;
  51. friend class PathConstraintPositionTimeline;
  52. friend class PathConstraintSpacingTimeline;
  53. friend class ScaleTimeline;
  54. friend class ShearTimeline;
  55. friend class TransformConstraintTimeline;
  56. friend class TranslateTimeline;
  57. friend class TwoColorTimeline;
  58. public:
  59. Slot(SlotData &data, Bone &bone);
  60. void setToSetupPose();
  61. SlotData &getData();
  62. Bone &getBone();
  63. Skeleton &getSkeleton();
  64. Color &getColor();
  65. Color &getDarkColor();
  66. bool hasDarkColor();
  67. /// May be NULL.
  68. Attachment *getAttachment();
  69. void setAttachment(Attachment *inValue);
  70. float getAttachmentTime();
  71. void setAttachmentTime(float inValue);
  72. Vector<float> &getDeform();
  73. private:
  74. SlotData &_data;
  75. Bone &_bone;
  76. Skeleton &_skeleton;
  77. Color _color;
  78. Color _darkColor;
  79. bool _hasDarkColor;
  80. Attachment *_attachment;
  81. float _attachmentTime;
  82. Vector<float> _deform;
  83. };
  84. }
  85. #endif /* Spine_Slot_h */