SpriterData2D.cpp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761
  1. //
  2. // Copyright (c) 2008-2017 the Urho3D project.
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to deal
  6. // in the Software without restriction, including without limitation the rights
  7. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. // copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20. // THE SOFTWARE.
  21. //
  22. #include "../Precompiled.h"
  23. #include "../Math/MathDefs.h"
  24. #include "../Atomic2D/SpriterData2D.h"
  25. // ATOMIC BEGIN
  26. #include <PugiXml/src/pugixml.hpp>
  27. // ATOMIC END
  28. #include <cstring>
  29. using namespace pugi;
  30. namespace Atomic
  31. {
  32. namespace Spriter
  33. {
  34. SpriterData::SpriterData()
  35. {
  36. }
  37. SpriterData::~SpriterData()
  38. {
  39. Reset();
  40. }
  41. void SpriterData::Reset()
  42. {
  43. if (!folders_.Empty())
  44. {
  45. for (unsigned i = 0; i < folders_.Size(); ++i)
  46. delete folders_[i];
  47. folders_.Clear();
  48. }
  49. if (!entities_.Empty())
  50. {
  51. for (unsigned i = 0; i < entities_.Size(); ++i)
  52. delete entities_[i];
  53. entities_.Clear();
  54. }
  55. }
  56. bool SpriterData::Load(const pugi::xml_node& node)
  57. {
  58. Reset();
  59. if (strcmp(node.name(), "spriter_data"))
  60. return false;
  61. scmlVersion_ = node.attribute("scml_version").as_int();
  62. generator_ = node.attribute("generator").as_string();
  63. generatorVersion_ = node.attribute("scml_version").as_string();
  64. for (xml_node folderNode = node.child("folder"); !folderNode.empty(); folderNode = folderNode.next_sibling("folder"))
  65. {
  66. folders_.Push(new Folder());
  67. if (!folders_.Back()->Load(folderNode))
  68. return false;
  69. }
  70. for (xml_node entityNode = node.child("entity"); !entityNode.empty(); entityNode = entityNode.next_sibling("entity"))
  71. {
  72. entities_.Push(new Entity());
  73. if (!entities_.Back()->Load(entityNode))
  74. return false;
  75. }
  76. return true;
  77. }
  78. bool SpriterData::Load(const void* data, size_t size)
  79. {
  80. xml_document document;
  81. if (!document.load_buffer(data, size))
  82. return false;
  83. return Load(document.child("spriter_data"));
  84. }
  85. Folder::Folder()
  86. {
  87. }
  88. Folder::~Folder()
  89. {
  90. Reset();
  91. }
  92. void Folder::Reset()
  93. {
  94. for (unsigned i = 0; i < files_.Size(); ++i)
  95. delete files_[i];
  96. files_.Clear();
  97. }
  98. bool Folder::Load(const pugi::xml_node& node)
  99. {
  100. Reset();
  101. if (strcmp(node.name(), "folder"))
  102. return false;
  103. id_ = node.attribute("id").as_int();
  104. name_ = node.attribute("name").as_string();
  105. for (xml_node fileNode = node.child("file"); !fileNode.empty(); fileNode = fileNode.next_sibling("file"))
  106. {
  107. files_.Push(new File(this));
  108. if (!files_.Back()->Load(fileNode))
  109. return false;
  110. }
  111. return true;
  112. }
  113. File::File(Folder* folder) :
  114. folder_(folder)
  115. {
  116. }
  117. File::~File()
  118. {
  119. }
  120. bool File::Load(const pugi::xml_node& node)
  121. {
  122. if (strcmp(node.name(), "file"))
  123. return false;
  124. id_ = node.attribute("id").as_int();
  125. name_ = node.attribute("name").as_string();
  126. width_ = node.attribute("width").as_float();
  127. height_ = node.attribute("height").as_float();
  128. pivotX_ = node.attribute("pivot_x").as_float(0.0f);
  129. pivotY_ = node.attribute("pivot_y").as_float(1.0f);
  130. return true;
  131. }
  132. Entity::Entity()
  133. {
  134. }
  135. Entity::~Entity()
  136. {
  137. Reset();
  138. }
  139. void Entity::Reset()
  140. {
  141. for (unsigned i = 0; i < characterMaps_.Size(); ++i)
  142. delete characterMaps_[i];
  143. characterMaps_.Clear();
  144. for (unsigned i = 0; i < animations_.Size(); ++i)
  145. delete animations_[i];
  146. animations_.Clear();
  147. }
  148. bool Entity::Load(const pugi::xml_node& node)
  149. {
  150. Reset();
  151. if (strcmp(node.name(), "entity"))
  152. return false;
  153. id_ = node.attribute("id").as_int();
  154. name_ = node.attribute("name").as_string();
  155. for (xml_node characterMapNode = node.child("character_map"); !characterMapNode.empty(); characterMapNode = characterMapNode.next_sibling("character_map"))
  156. {
  157. characterMaps_.Push(new CharacterMap());
  158. if (!characterMaps_.Back()->Load(characterMapNode))
  159. return false;
  160. }
  161. for (xml_node animationNode = node.child("animation"); !animationNode.empty(); animationNode = animationNode.next_sibling("animation"))
  162. {
  163. animations_.Push(new Animation());
  164. if (!animations_.Back()->Load(animationNode))
  165. return false;
  166. }
  167. return true;
  168. }
  169. CharacterMap::CharacterMap()
  170. {
  171. }
  172. CharacterMap::~CharacterMap()
  173. {
  174. }
  175. void CharacterMap::Reset()
  176. {
  177. for (unsigned i = 0; i < maps_.Size(); ++i)
  178. delete maps_[i];
  179. maps_.Clear();
  180. }
  181. bool CharacterMap::Load(const pugi::xml_node& node)
  182. {
  183. Reset();
  184. if (strcmp(node.name(), "character_map"))
  185. return false;
  186. id_ = node.attribute("id").as_int();
  187. name_ = node.attribute("name").as_string();
  188. for (xml_node mapNode = node.child("map"); !mapNode.empty(); mapNode = mapNode.next_sibling("map"))
  189. {
  190. maps_.Push(new MapInstruction());
  191. if (!maps_.Back()->Load(mapNode))
  192. return false;
  193. }
  194. return false;
  195. }
  196. MapInstruction::MapInstruction()
  197. {
  198. }
  199. MapInstruction::~MapInstruction()
  200. {
  201. }
  202. bool MapInstruction::Load(const pugi::xml_node& node)
  203. {
  204. if (strcmp(node.name(), "map"))
  205. return false;
  206. folder_ = node.attribute("folder").as_int();
  207. file_ = node.attribute("file").as_int();
  208. targetFolder_ = node.attribute("target_folder").as_int(-1);
  209. targetFile_ = node.attribute("target_file").as_int(-1);
  210. return true;
  211. }
  212. Animation::Animation()
  213. {
  214. }
  215. Animation::~Animation()
  216. {
  217. Reset();
  218. }
  219. void Animation::Reset()
  220. {
  221. if (!mainlineKeys_.Empty())
  222. {
  223. for (unsigned i = 0; i < mainlineKeys_.Size(); ++i)
  224. delete mainlineKeys_[i];
  225. mainlineKeys_.Clear();
  226. }
  227. for (unsigned i = 0; i < timelines_.Size(); ++i)
  228. delete timelines_[i];
  229. timelines_.Clear();
  230. }
  231. bool Animation::Load(const pugi::xml_node& node)
  232. {
  233. Reset();
  234. if (strcmp(node.name(), "animation"))
  235. return false;
  236. id_ = node.attribute("id").as_int();
  237. name_ = node.attribute("name").as_string();
  238. length_ = node.attribute("length").as_float() * 0.001f;
  239. looping_ = node.attribute("looping").as_bool(true);
  240. xml_node mainlineNode = node.child("mainline");
  241. for (xml_node keyNode = mainlineNode.child("key"); !keyNode.empty(); keyNode = keyNode.next_sibling("key"))
  242. {
  243. mainlineKeys_.Push(new MainlineKey());
  244. if (!mainlineKeys_.Back()->Load(keyNode))
  245. return false;
  246. }
  247. for (xml_node timelineNode = node.child("timeline"); !timelineNode.empty(); timelineNode = timelineNode.next_sibling("timeline"))
  248. {
  249. timelines_.Push(new Timeline());
  250. if (!timelines_.Back()->Load(timelineNode))
  251. return false;
  252. }
  253. return true;
  254. }
  255. MainlineKey::MainlineKey()
  256. {
  257. }
  258. MainlineKey::~MainlineKey()
  259. {
  260. Reset();
  261. }
  262. void MainlineKey::Reset()
  263. {
  264. for (unsigned i = 0; i < boneRefs_.Size(); ++i)
  265. delete boneRefs_[i];
  266. boneRefs_.Clear();
  267. for (unsigned i = 0; i < objectRefs_.Size(); ++i)
  268. delete objectRefs_[i];
  269. objectRefs_.Clear();
  270. }
  271. bool MainlineKey::Load(const pugi::xml_node& node)
  272. {
  273. id_ = node.attribute("id").as_int();
  274. time_ = node.attribute("time").as_float() * 0.001f;
  275. for (xml_node boneRefNode = node.child("bone_ref"); !boneRefNode.empty(); boneRefNode = boneRefNode.next_sibling("bone_ref"))
  276. {
  277. boneRefs_.Push(new Ref());
  278. if (!boneRefs_.Back()->Load(boneRefNode))
  279. return false;
  280. }
  281. for (xml_node objectRefNode = node.child("object_ref"); !objectRefNode.empty(); objectRefNode = objectRefNode.next_sibling("object_ref"))
  282. {
  283. objectRefs_.Push(new Ref());
  284. if (!objectRefs_.Back()->Load(objectRefNode))
  285. return false;
  286. }
  287. return true;
  288. }
  289. Ref::Ref()
  290. {
  291. }
  292. Ref::~Ref()
  293. {
  294. }
  295. bool Ref::Load(const pugi::xml_node& node)
  296. {
  297. if (strcmp(node.name(), "bone_ref") && strcmp(node.name(), "object_ref"))
  298. return false;
  299. id_ = node.attribute("id").as_int();
  300. parent_ = node.attribute("parent").as_int(-1);
  301. timeline_ = node.attribute("timeline").as_int();
  302. key_ = node.attribute("key").as_int();
  303. zIndex_ = node.attribute("z_index").as_int();
  304. return true;
  305. }
  306. Timeline::Timeline()
  307. {
  308. }
  309. Timeline::~Timeline()
  310. {
  311. Reset();
  312. }
  313. void Timeline::Reset()
  314. {
  315. for (unsigned i = 0; i < keys_.Size(); ++i)
  316. delete keys_[i];
  317. keys_.Clear();
  318. }
  319. bool Timeline::Load(const pugi::xml_node& node)
  320. {
  321. Reset();
  322. if (strcmp(node.name(), "timeline"))
  323. return false;
  324. id_ = node.attribute("id").as_int();
  325. name_ = node.attribute("name").as_string();
  326. String typeString;
  327. xml_attribute typeAttr = node.attribute("type");
  328. if (typeAttr.empty())
  329. typeString = node.attribute("object_type").as_string("sprite");
  330. else
  331. typeString = typeAttr.as_string("sprite");
  332. if (typeString == "bone")
  333. {
  334. objectType_ = BONE;
  335. for (xml_node keyNode = node.child("key"); !keyNode.empty(); keyNode = keyNode.next_sibling("key"))
  336. {
  337. keys_.Push(new BoneTimelineKey(this));
  338. if (!keys_.Back()->Load(keyNode))
  339. return false;
  340. }
  341. }
  342. else if (typeString == "sprite")
  343. {
  344. objectType_ = SPRITE;
  345. for (xml_node keyNode = node.child("key"); !keyNode.empty(); keyNode = keyNode.next_sibling("key"))
  346. {
  347. keys_.Push(new SpriteTimelineKey(this));
  348. if (!keys_.Back()->Load(keyNode))
  349. return false;
  350. }
  351. }
  352. else
  353. {
  354. // Unsupported object type now.
  355. return false;
  356. }
  357. return true;
  358. }
  359. TimelineKey::TimelineKey(Timeline* timeline)
  360. {
  361. this->timeline_ = timeline;
  362. }
  363. TimelineKey::~TimelineKey()
  364. {
  365. }
  366. bool TimelineKey::Load(const pugi::xml_node& node)
  367. {
  368. if (strcmp(node.name(), "key"))
  369. return false;
  370. id_ = node.attribute("id").as_int();
  371. time_ = node.attribute("time").as_float() * 0.001f;
  372. String curveType = node.attribute("curve_type").as_string("linear");
  373. if (curveType == "instant")
  374. curveType_ = INSTANT;
  375. else if (curveType == "linear")
  376. curveType_ = LINEAR;
  377. else if (curveType == "quadratic")
  378. curveType_ = QUADRATIC;
  379. else if (curveType == "cubic")
  380. curveType_ = CUBIC;
  381. else
  382. curveType_ = LINEAR;
  383. c1_ = node.attribute("c1").as_float();
  384. c2_ = node.attribute("c2").as_float();
  385. return true;
  386. }
  387. TimelineKey& TimelineKey::operator=(const TimelineKey& rhs)
  388. {
  389. id_ = rhs.id_;
  390. time_ = rhs.time_;
  391. curveType_ = rhs.curveType_;
  392. c1_ = rhs.c1_;
  393. c2_ = rhs.c2_;
  394. return *this;
  395. }
  396. // From http://www.brashmonkey.com/ScmlDocs/ScmlReference.html
  397. inline float Linear(float a, float b, float t)
  398. {
  399. return a + (b - a) * t;
  400. }
  401. inline float Quadratic(float a, float b, float c, float t)
  402. {
  403. return Linear(Linear(a, b, t), Linear(b, c, t), t);
  404. }
  405. inline float Cubic(float a, float b, float c, float d, float t)
  406. {
  407. return Linear(Quadratic(a, b, c, t), Quadratic(b, c, d, t), t);
  408. }
  409. float TimelineKey::GetTByCurveType(float currentTime, float nextTimelineTime) const
  410. {
  411. if (curveType_ == INSTANT)
  412. return 0.0f;
  413. float t = (currentTime - time_) / (nextTimelineTime - time_);
  414. switch (curveType_)
  415. {
  416. case LINEAR:
  417. return t;
  418. case QUADRATIC:
  419. return Quadratic(0.0f, c1_, 1.0f, t);
  420. case CUBIC:
  421. return Cubic(0.0f, c1_, c2_, 1.0f, t);
  422. default:
  423. return 0.0f;
  424. }
  425. }
  426. SpatialInfo::SpatialInfo(float x, float y, float angle, float scale_x, float scale_y, float a, int spin)
  427. {
  428. this->x_ = x;
  429. this->y_ = y;
  430. this->angle_ = angle;
  431. this->scaleX_ = scale_x;
  432. this->scaleY_ = scale_y;
  433. this->alpha_ = a;
  434. this->spin = spin;
  435. }
  436. SpatialInfo SpatialInfo::UnmapFromParent(const SpatialInfo& parentInfo) const
  437. {
  438. float unmappedX;
  439. float unmappedY;
  440. float unmappedAngle = angle_ + parentInfo.angle_;
  441. float unmappedScaleX = scaleX_ * parentInfo.scaleX_;
  442. float unmappedScaleY = scaleY_ * parentInfo.scaleY_;
  443. float unmappedAlpha = alpha_ * parentInfo.alpha_;
  444. if (x_ != 0.0f || y_ != 0.0f)
  445. {
  446. float preMultX = x_ * parentInfo.scaleX_;
  447. float preMultY = y_ * parentInfo.scaleY_;
  448. float s = Sin(parentInfo.angle_);
  449. float c = Cos(parentInfo.angle_);
  450. unmappedX = (preMultX * c) - (preMultY * s) + parentInfo.x_;
  451. unmappedY = (preMultX * s) + (preMultY * c) + parentInfo.y_;
  452. }
  453. else
  454. {
  455. unmappedX = parentInfo.x_;
  456. unmappedY = parentInfo.y_;
  457. }
  458. return SpatialInfo(unmappedX, unmappedY, unmappedAngle, unmappedScaleX, unmappedScaleY, unmappedAlpha, spin);
  459. }
  460. void SpatialInfo::Interpolate(const SpatialInfo& other, float t)
  461. {
  462. x_ = Linear(x_, other.x_, t);
  463. y_ = Linear(y_, other.y_, t);
  464. if (spin > 0.0f && (other.angle_ - angle_ < 0.0f))
  465. {
  466. angle_ = Linear(angle_, other.angle_ + 360.0f, t);
  467. }
  468. else if (spin < 0.0f && (other.angle_ - angle_ > 0.0f))
  469. {
  470. angle_ = Linear(angle_, other.angle_ - 360.0f, t);
  471. }
  472. else
  473. {
  474. angle_ = Linear(angle_, other.angle_, t);
  475. }
  476. scaleX_ = Linear(scaleX_, other.scaleX_, t);
  477. scaleY_ = Linear(scaleY_, other.scaleY_, t);
  478. alpha_ = Linear(alpha_, other.alpha_, t);
  479. }
  480. SpatialTimelineKey::SpatialTimelineKey(Timeline* timeline) :
  481. TimelineKey(timeline)
  482. {
  483. }
  484. SpatialTimelineKey::~SpatialTimelineKey()
  485. {
  486. }
  487. bool SpatialTimelineKey::Load(const xml_node& node)
  488. {
  489. if (!TimelineKey::Load(node))
  490. return false;
  491. xml_node childNode = node.child("bone");
  492. if (childNode.empty())
  493. childNode = node.child("object");
  494. info_.x_ = childNode.attribute("x").as_float();
  495. info_.y_ = childNode.attribute("y").as_float();
  496. info_.angle_ = childNode.attribute("angle").as_float();
  497. info_.scaleX_ = childNode.attribute("scale_x").as_float(1.0f);
  498. info_.scaleY_ = childNode.attribute("scale_y").as_float(1.0f);
  499. info_.alpha_ = childNode.attribute("a").as_float(1.0f);
  500. info_.spin = node.attribute("spin").as_int(1);
  501. return true;
  502. }
  503. SpatialTimelineKey& SpatialTimelineKey::operator=(const SpatialTimelineKey& rhs)
  504. {
  505. TimelineKey::operator=(rhs);
  506. info_ = rhs.info_;
  507. return *this;
  508. }
  509. void SpatialTimelineKey::Interpolate(const TimelineKey& other, float t)
  510. {
  511. const SpatialTimelineKey& o = (const SpatialTimelineKey&)other;
  512. info_.Interpolate(o.info_, t);
  513. }
  514. BoneTimelineKey::BoneTimelineKey(Timeline* timeline) :
  515. SpatialTimelineKey(timeline)
  516. {
  517. }
  518. BoneTimelineKey::~BoneTimelineKey()
  519. {
  520. }
  521. TimelineKey* BoneTimelineKey::Clone() const
  522. {
  523. BoneTimelineKey* result = new BoneTimelineKey(timeline_);
  524. *result = *this;
  525. return result;
  526. }
  527. bool BoneTimelineKey::Load(const xml_node& node)
  528. {
  529. if (!SpatialTimelineKey::Load(node))
  530. return false;
  531. xml_node boneNode = node.child("bone");
  532. length_ = boneNode.attribute("length").as_float(200.0f);
  533. width_ = boneNode.attribute("width").as_float(10.0f);
  534. return true;
  535. }
  536. BoneTimelineKey& BoneTimelineKey::operator=(const BoneTimelineKey& rhs)
  537. {
  538. SpatialTimelineKey::operator=(rhs);
  539. length_ = rhs.length_;
  540. width_ = rhs.width_;
  541. return *this;
  542. }
  543. void BoneTimelineKey::Interpolate(const TimelineKey& other, float t)
  544. {
  545. SpatialTimelineKey::Interpolate(other, t);
  546. const BoneTimelineKey& o = (const BoneTimelineKey&)other;
  547. length_ = Linear(length_, o.length_, t);
  548. width_ = Linear(width_, o.width_, t);
  549. }
  550. TimelineKey* SpriteTimelineKey::Clone() const
  551. {
  552. SpriteTimelineKey* result = new SpriteTimelineKey(timeline_);
  553. *result = *this;
  554. return result;
  555. }
  556. SpriteTimelineKey::SpriteTimelineKey(Timeline* timeline) :
  557. SpatialTimelineKey(timeline)
  558. {
  559. }
  560. SpriteTimelineKey::~SpriteTimelineKey()
  561. {
  562. }
  563. bool SpriteTimelineKey::Load(const pugi::xml_node& node)
  564. {
  565. if (!SpatialTimelineKey::Load(node))
  566. return false;
  567. xml_node objectNode = node.child("object");
  568. folderId_ = objectNode.attribute("folder").as_int(-1);
  569. fileId_ = objectNode.attribute("file").as_int(-1);
  570. xml_attribute pivotXAttr = objectNode.attribute("pivot_x");
  571. xml_attribute pivotYAttr = objectNode.attribute("pivot_y");
  572. if (pivotXAttr.empty() && pivotYAttr.empty())
  573. useDefaultPivot_ = true;
  574. else
  575. {
  576. useDefaultPivot_ = false;
  577. pivotX_ = pivotXAttr.as_float(0.0f);
  578. pivotY_ = pivotYAttr.as_float(1.0f);
  579. }
  580. return true;
  581. }
  582. void SpriteTimelineKey::Interpolate(const TimelineKey& other, float t)
  583. {
  584. SpatialTimelineKey::Interpolate(other, t);
  585. const SpriteTimelineKey& o = (const SpriteTimelineKey&)other;
  586. pivotX_ = Linear(pivotX_, o.pivotX_, t);
  587. pivotY_ = Linear(pivotY_, o.pivotY_, t);
  588. }
  589. SpriteTimelineKey& SpriteTimelineKey::operator=(const SpriteTimelineKey& rhs)
  590. {
  591. SpatialTimelineKey::operator=(rhs);
  592. folderId_ = rhs.folderId_;
  593. fileId_ = rhs.fileId_;
  594. useDefaultPivot_ = rhs.useDefaultPivot_;
  595. pivotX_ = rhs.pivotX_;
  596. pivotY_ = rhs.pivotY_;
  597. return *this;
  598. }
  599. }
  600. }