GUI_3DScene.xsp 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682
  1. %module{Slic3r::XS};
  2. #include <xsinit.h>
  3. #include "slic3r/GUI/GLShader.hpp"
  4. #include "slic3r/GUI/3DScene.hpp"
  5. %name{Slic3r::GUI::_3DScene::GLShader} class GLShader {
  6. GLShader();
  7. ~GLShader();
  8. bool load_from_text(const char *fragment_shader, const char *vertex_shader);
  9. bool load_from_file(const char *fragment_shader, const char *vertex_shader);
  10. void release();
  11. int get_attrib_location(const char *name) const;
  12. int get_uniform_location(const char *name) const;
  13. bool set_uniform(const char *name, float value) const;
  14. void enable() const;
  15. void disable() const;
  16. int shader_program_id() const
  17. %code%{ RETVAL = THIS->shader_program_id; %};
  18. std::string last_error() const
  19. %code%{ RETVAL = THIS->last_error; %};
  20. };
  21. %name{Slic3r::GUI::_3DScene::GLVolume} class GLVolume {
  22. GLVolume();
  23. ~GLVolume();
  24. std::vector<double> color()
  25. %code%{ RETVAL.reserve(4); RETVAL.push_back(THIS->color[0]); RETVAL.push_back(THIS->color[1]); RETVAL.push_back(THIS->color[2]); RETVAL.push_back(THIS->color[3]); %};
  26. int select_group_id()
  27. %code%{ RETVAL = THIS->select_group_id; %};
  28. int drag_group_id()
  29. %code%{ RETVAL = THIS->drag_group_id; %};
  30. int selected()
  31. %code%{ RETVAL = THIS->selected; %};
  32. void set_selected(int i)
  33. %code%{ THIS->selected = i; %};
  34. int hover()
  35. %code%{ RETVAL = THIS->hover; %};
  36. void set_hover(int i)
  37. %code%{ THIS->hover = i; %};
  38. int zoom_to_volumes()
  39. %code%{ RETVAL = THIS->zoom_to_volumes; %};
  40. void set_layer_height_texture_data(unsigned int texture_id, unsigned int shader_id, PrintObject* print_object, float z_cursor_relative, float edit_band_width);
  41. void reset_layer_height_texture_data();
  42. int object_idx() const;
  43. int volume_idx() const;
  44. int instance_idx() const;
  45. Clone<Pointf3> origin() const
  46. %code%{ RETVAL = THIS->get_origin(); %};
  47. void translate(double x, double y, double z)
  48. %code%{
  49. Pointf3 o = THIS->get_origin();
  50. o.translate(x, y, z);
  51. THIS->set_origin(o);
  52. %};
  53. Clone<BoundingBoxf3> bounding_box() const
  54. %code%{ RETVAL = THIS->bounding_box; %};
  55. Clone<BoundingBoxf3> transformed_bounding_box() const;
  56. bool empty() const;
  57. bool indexed() const;
  58. void render() const;
  59. bool has_layer_height_texture();
  60. int layer_height_texture_width();
  61. int layer_height_texture_height();
  62. int layer_height_texture_cells();
  63. void* layer_height_texture_data_ptr_level0();
  64. void* layer_height_texture_data_ptr_level1();
  65. double layer_height_texture_z_to_row_id() const;
  66. void generate_layer_height_texture(PrintObject *print_object, bool force);
  67. };
  68. %name{Slic3r::GUI::_3DScene::GLVolume::Collection} class GLVolumeCollection {
  69. GLVolumeCollection();
  70. ~GLVolumeCollection();
  71. std::vector<int> load_object(ModelObject *object, int obj_idx, std::vector<int> instance_idxs, std::string color_by, std::string select_by, std::string drag_by, bool use_VBOs);
  72. int load_wipe_tower_preview(int obj_idx, float pos_x, float pos_y, float width, float depth, float height, float rotation_angle, bool use_VBOs);
  73. void erase()
  74. %code{% THIS->clear(); %};
  75. int count()
  76. %code{% RETVAL = THIS->volumes.size(); %};
  77. void set_range(double low, double high);
  78. void render_VBOs() const;
  79. void render_legacy() const;
  80. void finalize_geometry(bool use_VBOs);
  81. void release_geometry();
  82. void set_print_box(float min_x, float min_y, float min_z, float max_x, float max_y, float max_z);
  83. void reset_outside_state();
  84. void update_colors_by_extruder(DynamicPrintConfig* config);
  85. bool move_volume_up(int idx)
  86. %code%{
  87. if (idx > 0 && idx < int(THIS->volumes.size())) {
  88. std::swap(THIS->volumes[idx-1], THIS->volumes[idx]);
  89. std::swap(THIS->volumes[idx-1]->composite_id, THIS->volumes[idx]->composite_id);
  90. std::swap(THIS->volumes[idx-1]->select_group_id, THIS->volumes[idx]->select_group_id);
  91. std::swap(THIS->volumes[idx-1]->drag_group_id, THIS->volumes[idx]->drag_group_id);
  92. RETVAL = true;
  93. } else
  94. RETVAL = false;
  95. %};
  96. bool move_volume_down(int idx)
  97. %code%{
  98. if (idx >= 0 && idx + 1 < int(THIS->volumes.size())) {
  99. std::swap(THIS->volumes[idx+1], THIS->volumes[idx]);
  100. std::swap(THIS->volumes[idx+1]->composite_id, THIS->volumes[idx]->composite_id);
  101. std::swap(THIS->volumes[idx+1]->select_group_id, THIS->volumes[idx]->select_group_id);
  102. std::swap(THIS->volumes[idx+1]->drag_group_id, THIS->volumes[idx]->drag_group_id);
  103. RETVAL = true;
  104. } else
  105. RETVAL = false;
  106. %};
  107. %{
  108. SV*
  109. GLVolumeCollection::arrayref()
  110. CODE:
  111. AV* av = newAV();
  112. av_fill(av, THIS->volumes.size()-1);
  113. int i = 0;
  114. for (GLVolume *v : THIS->volumes) {
  115. av_store(av, i++, perl_to_SV_ref(*v));
  116. }
  117. RETVAL = newRV_noinc((SV*)av);
  118. OUTPUT:
  119. RETVAL
  120. %}
  121. };
  122. %package{Slic3r::GUI::_3DScene};
  123. %{
  124. std::string
  125. get_gl_info(format_as_html, extensions)
  126. bool format_as_html;
  127. bool extensions;
  128. CODE:
  129. RETVAL = _3DScene::get_gl_info(format_as_html, extensions);
  130. OUTPUT:
  131. RETVAL
  132. bool
  133. use_VBOs()
  134. CODE:
  135. RETVAL = _3DScene::use_VBOs();
  136. OUTPUT:
  137. RETVAL
  138. bool
  139. add_canvas(canvas)
  140. SV *canvas;
  141. CODE:
  142. RETVAL = _3DScene::add_canvas((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
  143. OUTPUT:
  144. RETVAL
  145. bool
  146. remove_canvas(canvas)
  147. SV *canvas;
  148. CODE:
  149. RETVAL = _3DScene::remove_canvas((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
  150. OUTPUT:
  151. RETVAL
  152. void
  153. remove_all_canvases()
  154. CODE:
  155. _3DScene::remove_all_canvases();
  156. void
  157. set_as_dirty(canvas)
  158. SV *canvas;
  159. CODE:
  160. _3DScene::set_as_dirty((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
  161. unsigned int
  162. get_volumes_count(canvas)
  163. SV *canvas;
  164. CODE:
  165. RETVAL = _3DScene::get_volumes_count((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
  166. OUTPUT:
  167. RETVAL
  168. void
  169. reset_volumes(canvas)
  170. SV *canvas;
  171. CODE:
  172. _3DScene::reset_volumes((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
  173. void
  174. deselect_volumes(canvas)
  175. SV *canvas;
  176. CODE:
  177. _3DScene::deselect_volumes((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
  178. void
  179. select_volume(canvas, id)
  180. SV *canvas;
  181. unsigned int id;
  182. CODE:
  183. _3DScene::select_volume((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), id);
  184. void
  185. update_volumes_selection(canvas, selections)
  186. SV *canvas;
  187. std::vector<int> selections;
  188. CODE:
  189. _3DScene::update_volumes_selection((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), selections);
  190. int
  191. check_volumes_outside_state(canvas, config)
  192. SV *canvas;
  193. DynamicPrintConfig *config;
  194. CODE:
  195. RETVAL = _3DScene::check_volumes_outside_state((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), config);
  196. OUTPUT:
  197. RETVAL
  198. bool
  199. move_volume_up(canvas, id)
  200. SV *canvas;
  201. unsigned int id;
  202. CODE:
  203. RETVAL = _3DScene::move_volume_up((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), id);
  204. OUTPUT:
  205. RETVAL
  206. bool
  207. move_volume_down(canvas, id)
  208. SV *canvas;
  209. unsigned int id;
  210. CODE:
  211. RETVAL = _3DScene::move_volume_down((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), id);
  212. OUTPUT:
  213. RETVAL
  214. void
  215. set_objects_selections(canvas, selections)
  216. SV *canvas;
  217. std::vector<int> selections;
  218. CODE:
  219. _3DScene::set_objects_selections((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), selections);
  220. void
  221. set_config(canvas, config)
  222. SV *canvas;
  223. DynamicPrintConfig *config;
  224. CODE:
  225. _3DScene::set_config((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), config);
  226. void
  227. set_print(canvas, print)
  228. SV *canvas;
  229. Print *print;
  230. CODE:
  231. _3DScene::set_print((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), print);
  232. void
  233. set_model(canvas, model)
  234. SV *canvas;
  235. Model *model;
  236. CODE:
  237. _3DScene::set_model((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), model);
  238. void
  239. set_bed_shape(canvas, shape)
  240. SV *canvas;
  241. Pointfs shape;
  242. CODE:
  243. _3DScene::set_bed_shape((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), shape);
  244. void
  245. set_auto_bed_shape(canvas)
  246. SV *canvas;
  247. CODE:
  248. _3DScene::set_auto_bed_shape((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
  249. Clone<BoundingBoxf3>
  250. get_volumes_bounding_box(canvas)
  251. SV *canvas;
  252. CODE:
  253. RETVAL = _3DScene::get_volumes_bounding_box((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
  254. OUTPUT:
  255. RETVAL
  256. void
  257. set_axes_length(canvas, length)
  258. SV *canvas;
  259. float length;
  260. CODE:
  261. _3DScene::set_axes_length((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), length);
  262. void
  263. set_cutting_plane(canvas, z, polygons)
  264. SV *canvas;
  265. float z;
  266. ExPolygons polygons;
  267. CODE:
  268. _3DScene::set_cutting_plane((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), z, polygons);
  269. void
  270. set_color_by(canvas, value)
  271. SV *canvas;
  272. std::string value;
  273. CODE:
  274. _3DScene::set_color_by((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), value);
  275. void
  276. set_select_by(canvas, value)
  277. SV *canvas;
  278. std::string value;
  279. CODE:
  280. _3DScene::set_select_by((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), value);
  281. void
  282. set_drag_by(canvas, value)
  283. SV *canvas;
  284. std::string value;
  285. CODE:
  286. _3DScene::set_drag_by((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), value);
  287. bool
  288. is_layers_editing_enabled(canvas)
  289. SV *canvas;
  290. CODE:
  291. RETVAL = _3DScene::is_layers_editing_enabled((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
  292. OUTPUT:
  293. RETVAL
  294. bool
  295. is_layers_editing_allowed(canvas)
  296. SV *canvas;
  297. CODE:
  298. RETVAL = _3DScene::is_layers_editing_allowed((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
  299. OUTPUT:
  300. RETVAL
  301. bool
  302. is_shader_enabled(canvas)
  303. SV *canvas;
  304. CODE:
  305. RETVAL = _3DScene::is_shader_enabled((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
  306. OUTPUT:
  307. RETVAL
  308. bool
  309. is_reload_delayed(canvas)
  310. SV *canvas;
  311. CODE:
  312. RETVAL = _3DScene::is_reload_delayed((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
  313. OUTPUT:
  314. RETVAL
  315. void
  316. enable_layers_editing(canvas, enable)
  317. SV *canvas;
  318. bool enable;
  319. CODE:
  320. _3DScene::enable_layers_editing((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), enable);
  321. void
  322. enable_warning_texture(canvas, enable)
  323. SV *canvas;
  324. bool enable;
  325. CODE:
  326. _3DScene::enable_warning_texture((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), enable);
  327. void
  328. enable_legend_texture(canvas, enable)
  329. SV *canvas;
  330. bool enable;
  331. CODE:
  332. _3DScene::enable_legend_texture((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), enable);
  333. void
  334. enable_picking(canvas, enable)
  335. SV *canvas;
  336. bool enable;
  337. CODE:
  338. _3DScene::enable_picking((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), enable);
  339. void
  340. enable_moving(canvas, enable)
  341. SV *canvas;
  342. bool enable;
  343. CODE:
  344. _3DScene::enable_moving((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), enable);
  345. void
  346. enable_gizmos(canvas, enable)
  347. SV *canvas;
  348. bool enable;
  349. CODE:
  350. _3DScene::enable_gizmos((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), enable);
  351. void
  352. enable_shader(canvas, enable)
  353. SV *canvas;
  354. bool enable;
  355. CODE:
  356. _3DScene::enable_shader((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), enable);
  357. void
  358. enable_force_zoom_to_bed(canvas, enable)
  359. SV *canvas;
  360. bool enable;
  361. CODE:
  362. _3DScene::enable_force_zoom_to_bed((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), enable);
  363. void
  364. enable_dynamic_background(canvas, enable)
  365. SV *canvas;
  366. bool enable;
  367. CODE:
  368. _3DScene::enable_dynamic_background((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), enable);
  369. void
  370. allow_multisample(canvas, allow)
  371. SV *canvas;
  372. bool allow;
  373. CODE:
  374. _3DScene::allow_multisample((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), allow);
  375. void
  376. zoom_to_bed(canvas)
  377. SV *canvas;
  378. CODE:
  379. _3DScene::zoom_to_bed((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
  380. void
  381. zoom_to_volumes(canvas)
  382. SV *canvas;
  383. CODE:
  384. _3DScene::zoom_to_volumes((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
  385. void
  386. select_view(canvas, direction)
  387. SV *canvas;
  388. std::string direction;
  389. CODE:
  390. _3DScene::select_view((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), direction);
  391. void
  392. set_viewport_from_scene(canvas, other)
  393. SV *canvas;
  394. SV *other;
  395. CODE:
  396. _3DScene::set_viewport_from_scene((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (wxGLCanvas*)wxPli_sv_2_object(aTHX_ other, "Wx::GLCanvas"));
  397. void
  398. update_volumes_colors_by_extruder(canvas)
  399. SV *canvas;
  400. CODE:
  401. _3DScene::update_volumes_colors_by_extruder((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
  402. void
  403. update_gizmos_data(canvas)
  404. SV *canvas;
  405. CODE:
  406. _3DScene::update_gizmos_data((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
  407. void
  408. render(canvas)
  409. SV *canvas;
  410. CODE:
  411. _3DScene::render((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"));
  412. std::vector<double>
  413. get_current_print_zs(canvas, active_only)
  414. SV *canvas;
  415. bool active_only;
  416. CODE:
  417. RETVAL = _3DScene::get_current_print_zs((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), active_only);
  418. OUTPUT:
  419. RETVAL
  420. void
  421. set_toolpaths_range(canvas, low, high)
  422. SV *canvas;
  423. double low;
  424. double high;
  425. CODE:
  426. _3DScene::set_toolpaths_range((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), low, high);
  427. void
  428. register_on_viewport_changed_callback(canvas, callback)
  429. SV *canvas;
  430. SV *callback;
  431. CODE:
  432. _3DScene::register_on_viewport_changed_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
  433. void
  434. register_on_double_click_callback(canvas, callback)
  435. SV *canvas;
  436. SV *callback;
  437. CODE:
  438. _3DScene::register_on_double_click_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
  439. void
  440. register_on_right_click_callback(canvas, callback)
  441. SV *canvas;
  442. SV *callback;
  443. CODE:
  444. _3DScene::register_on_right_click_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
  445. void
  446. register_on_select_object_callback(canvas, callback)
  447. SV *canvas;
  448. SV *callback;
  449. CODE:
  450. _3DScene::register_on_select_object_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
  451. void
  452. register_on_model_update_callback(canvas, callback)
  453. SV *canvas;
  454. SV *callback;
  455. CODE:
  456. _3DScene::register_on_model_update_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
  457. void
  458. register_on_remove_object_callback(canvas, callback)
  459. SV *canvas;
  460. SV *callback;
  461. CODE:
  462. _3DScene::register_on_remove_object_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
  463. void
  464. register_on_arrange_callback(canvas, callback)
  465. SV *canvas;
  466. SV *callback;
  467. CODE:
  468. _3DScene::register_on_arrange_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
  469. void
  470. register_on_rotate_object_left_callback(canvas, callback)
  471. SV *canvas;
  472. SV *callback;
  473. CODE:
  474. _3DScene::register_on_rotate_object_left_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
  475. void
  476. register_on_rotate_object_right_callback(canvas, callback)
  477. SV *canvas;
  478. SV *callback;
  479. CODE:
  480. _3DScene::register_on_rotate_object_right_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
  481. void
  482. register_on_scale_object_uniformly_callback(canvas, callback)
  483. SV *canvas;
  484. SV *callback;
  485. CODE:
  486. _3DScene::register_on_scale_object_uniformly_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
  487. void
  488. register_on_increase_objects_callback(canvas, callback)
  489. SV *canvas;
  490. SV *callback;
  491. CODE:
  492. _3DScene::register_on_increase_objects_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
  493. void
  494. register_on_decrease_objects_callback(canvas, callback)
  495. SV *canvas;
  496. SV *callback;
  497. CODE:
  498. _3DScene::register_on_decrease_objects_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
  499. void
  500. register_on_instance_moved_callback(canvas, callback)
  501. SV *canvas;
  502. SV *callback;
  503. CODE:
  504. _3DScene::register_on_instance_moved_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
  505. void
  506. register_on_wipe_tower_moved_callback(canvas, callback)
  507. SV *canvas;
  508. SV *callback;
  509. CODE:
  510. _3DScene::register_on_wipe_tower_moved_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
  511. void
  512. register_on_enable_action_buttons_callback(canvas, callback)
  513. SV *canvas;
  514. SV *callback;
  515. CODE:
  516. _3DScene::register_on_enable_action_buttons_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
  517. void
  518. register_on_gizmo_scale_uniformly_callback(canvas, callback)
  519. SV *canvas;
  520. SV *callback;
  521. CODE:
  522. _3DScene::register_on_gizmo_scale_uniformly_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
  523. void
  524. register_on_gizmo_rotate_callback(canvas, callback)
  525. SV *canvas;
  526. SV *callback;
  527. CODE:
  528. _3DScene::register_on_gizmo_rotate_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
  529. void
  530. register_on_update_geometry_info_callback(canvas, callback)
  531. SV *canvas;
  532. SV *callback;
  533. CODE:
  534. _3DScene::register_on_update_geometry_info_callback((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), (void*)callback);
  535. void
  536. reset_legend_texture()
  537. CODE:
  538. _3DScene::reset_legend_texture();
  539. std::vector<int>
  540. load_model_object(canvas, model_object, obj_idx, instance_idxs)
  541. SV *canvas;
  542. ModelObject *model_object;
  543. int obj_idx;
  544. std::vector<int> instance_idxs;
  545. CODE:
  546. RETVAL = _3DScene::load_object((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), model_object, obj_idx, instance_idxs);
  547. OUTPUT:
  548. RETVAL
  549. std::vector<int>
  550. load_model(canvas, model, obj_idx)
  551. SV *canvas;
  552. Model *model;
  553. int obj_idx;
  554. CODE:
  555. RETVAL = _3DScene::load_object((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), model, obj_idx);
  556. OUTPUT:
  557. RETVAL
  558. void
  559. reload_scene(canvas, force)
  560. SV *canvas;
  561. bool force;
  562. CODE:
  563. _3DScene::reload_scene((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), force);
  564. void
  565. load_gcode_preview(canvas, preview_data, str_tool_colors)
  566. SV *canvas;
  567. GCodePreviewData *preview_data;
  568. std::vector<std::string> str_tool_colors;
  569. CODE:
  570. _3DScene::load_gcode_preview((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), preview_data, str_tool_colors);
  571. void
  572. load_preview(canvas, str_tool_colors)
  573. SV *canvas;
  574. std::vector<std::string> str_tool_colors;
  575. CODE:
  576. _3DScene::load_preview((wxGLCanvas*)wxPli_sv_2_object(aTHX_ canvas, "Wx::GLCanvas"), str_tool_colors);
  577. %}