@ImportTerrainClass.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /******************************************************************************/
  2. /******************************************************************************/
  3. class ImportTerrainClass : ClosableWindow
  4. {
  5. class GuiImage2 : ImageSkin
  6. {
  7. bool mono;
  8. int channel;
  9. Image image_sw, image_hw;
  10. WindowIO wio;
  11. static void Load(C Str &name, GuiImage2 &img);
  12. void load(C Str &name);
  13. GuiImage2& create(C Rect &rect, bool mono=false);
  14. virtual void update(C GuiPC &gpc)override;
  15. virtual void draw(C GuiPC &gpc)override;
  16. public:
  17. GuiImage2();
  18. };
  19. class MaterialChannel : GuiImage
  20. {
  21. Button remove;
  22. MaterialPtr mtrl;
  23. UID mtrl_id;
  24. static void Clear(MaterialChannel &mc);
  25. void clear();
  26. void set(Elm &elm);
  27. MaterialChannel& create(C Rect &rect, Color rect_color, C Str &desc);
  28. virtual void update(C GuiPC &gpc)override;
  29. public:
  30. MaterialChannel();
  31. };
  32. Tabs pos_mode, height, mtrl, color, mtrl_channel, height_mode, mtrl_mode, color_mode;
  33. bool color_img_alpha;
  34. flt mtrl_blend, color_blend;
  35. VecI2 area, radius, size, target;
  36. Vec2 height_range;
  37. GuiImage2 height_image, mtrl_image, color_image;
  38. Memx<Property> area_p, radius_p, size_p, target_p, height_prop, mtrl_prop, color_prop;
  39. Button import_b;
  40. TextBlack ts, ts_l, ts_r;
  41. Text mtrl_channels_t, select_t, world_area_coords_t;
  42. MaterialChannel mtrl_channels[4];
  43. static void HeightModeChanged(ImportTerrainClass &it);
  44. static void ChannelChanged(ImportTerrainClass &it);
  45. static void Import(ImportTerrainClass &it);
  46. void import();
  47. // get
  48. Vec2 heightRange();
  49. bool areaRectValid()C;
  50. RectI areaRect()C;
  51. // manage
  52. void create();
  53. // operations
  54. void clearProj();
  55. void erasing(C UID &elm_id);
  56. void drag(Memc<UID> &elms, GuiObj *obj, C Vec2 &screen_pos);
  57. void drop(Memc<Str> &names, GuiObj *obj, C Vec2 &screen_pos);
  58. virtual void update(C GuiPC &gpc)override;
  59. public:
  60. ImportTerrainClass();
  61. };
  62. /******************************************************************************/
  63. /******************************************************************************/
  64. extern ImportTerrainClass ImportTerrain;
  65. /******************************************************************************/