@TransformRegion.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /******************************************************************************/
  2. /******************************************************************************/
  3. class TransformRegion : Region
  4. {
  5. enum ANCHOR
  6. {
  7. SEL_CENTER,
  8. SEL_LEFT,
  9. SEL_RIGHT,
  10. SEL_DOWN,
  11. SEL_UP,
  12. SEL_BACK,
  13. SEL_FRONT,
  14. WORLD_CENTER,
  15. CAM_TARGET,
  16. };
  17. static cchar8 *AnchorName[]
  18. ;
  19. bool full;
  20. Property *move_p[3];
  21. Memx<Property> props;
  22. TextWhite ts;
  23. Button rescale_height, rescale_depth, move_bottom, move_back, move_center, move_center_xz, rest_bottom, rot_y_min_box, ok, reset, cancel, close, original,
  24. rot[3][2]; // [xyz][dec/inc]
  25. TextLine rescale_height_value, rescale_depth_value;
  26. Pose trans;
  27. flt trans_normal;
  28. Vec trans_scale, anchor_pos;
  29. Vec2 move_uv, scale_uv;
  30. Matrix matrix;
  31. ANCHOR anchor;
  32. static void RescaleHeight(TransformRegion &tr);
  33. static void RescaleDepth(TransformRegion &tr);
  34. static void MoveBottom (TransformRegion &tr);
  35. static void MoveBack (TransformRegion &tr);
  36. static void MoveCenter (TransformRegion &tr);
  37. static void MoveCenterXZ(TransformRegion &tr);
  38. static void RestBottom (TransformRegion &tr);
  39. static void RotYMinBox (TransformRegion &tr);
  40. static void OK (TransformRegion &tr);
  41. static void Reset (TransformRegion &tr);
  42. static void Cancel (TransformRegion &tr);
  43. static void Original (TransformRegion &tr);
  44. static void RotX( TransformRegion &tr, C Str &text);
  45. static void RotY( TransformRegion &tr, C Str &text);
  46. static void RotZ( TransformRegion &tr, C Str &text);
  47. static Str RotX(C TransformRegion &tr );
  48. static Str RotY(C TransformRegion &tr );
  49. static Str RotZ(C TransformRegion &tr );
  50. static void Dec90(Property &prop);
  51. static void Inc90(Property &prop);
  52. void moveBottom ();
  53. void moveBack ();
  54. void moveCenter ();
  55. void moveCenterXZ();
  56. void restBottom ();
  57. void rotYMinBox();
  58. void toGui();
  59. static void Changed (C Property &prop);
  60. void setMatrix();
  61. Matrix drawMatrix()C;
  62. void setAnchorPos();
  63. Vec anchorPos()C;
  64. void resetDo();
  65. void hideDo();
  66. void cancelDo();
  67. void apply();
  68. virtual void update(C GuiPC &gpc)override;
  69. TransformRegion& create(bool full);
  70. public:
  71. TransformRegion();
  72. };
  73. /******************************************************************************/
  74. /******************************************************************************/
  75. /******************************************************************************/