graph_node.cpp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691
  1. /*************************************************************************/
  2. /* graph_node.cpp */
  3. /*************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* http://www.godotengine.org */
  7. /*************************************************************************/
  8. /* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
  9. /* */
  10. /* Permission is hereby granted, free of charge, to any person obtaining */
  11. /* a copy of this software and associated documentation files (the */
  12. /* "Software"), to deal in the Software without restriction, including */
  13. /* without limitation the rights to use, copy, modify, merge, publish, */
  14. /* distribute, sublicense, and/or sell copies of the Software, and to */
  15. /* permit persons to whom the Software is furnished to do so, subject to */
  16. /* the following conditions: */
  17. /* */
  18. /* The above copyright notice and this permission notice shall be */
  19. /* included in all copies or substantial portions of the Software. */
  20. /* */
  21. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  22. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  23. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
  24. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  25. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  26. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  27. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  28. /*************************************************************************/
  29. #include "graph_node.h"
  30. #include "method_bind_ext.inc"
  31. bool GraphNode::_set(const StringName& p_name, const Variant& p_value) {
  32. if (!p_name.operator String().begins_with("slot/"))
  33. return false;
  34. int idx=p_name.operator String().get_slice("/",1).to_int();
  35. String what = p_name.operator String().get_slice("/",2);
  36. Slot si;
  37. if (slot_info.has(idx))
  38. si=slot_info[idx];
  39. if (what=="left_enabled")
  40. si.enable_left=p_value;
  41. else if (what=="left_type")
  42. si.type_left=p_value;
  43. else if (what=="left_color")
  44. si.color_left=p_value;
  45. else if (what=="right_enabled")
  46. si.enable_right=p_value;
  47. else if (what=="right_type")
  48. si.type_right=p_value;
  49. else if (what=="right_color")
  50. si.color_right=p_value;
  51. else
  52. return false;
  53. set_slot(idx,si.enable_left,si.type_left,si.color_left,si.enable_right,si.type_right,si.color_right);
  54. update();
  55. return true;
  56. }
  57. bool GraphNode::_get(const StringName& p_name,Variant &r_ret) const{
  58. if (!p_name.operator String().begins_with("slot/")) {
  59. return false;
  60. }
  61. int idx=p_name.operator String().get_slice("/",1).to_int();
  62. String what = p_name.operator String().get_slice("/",2);
  63. Slot si;
  64. if (slot_info.has(idx))
  65. si=slot_info[idx];
  66. if (what=="left_enabled")
  67. r_ret=si.enable_left;
  68. else if (what=="left_type")
  69. r_ret=si.type_left;
  70. else if (what=="left_color")
  71. r_ret=si.color_left;
  72. else if (what=="right_enabled")
  73. r_ret=si.enable_right;
  74. else if (what=="right_type")
  75. r_ret=si.type_right;
  76. else if (what=="right_color")
  77. r_ret=si.color_right;
  78. else
  79. return false;
  80. return true;
  81. }
  82. void GraphNode::_get_property_list( List<PropertyInfo> *p_list) const{
  83. int idx=0;
  84. for(int i=0;i<get_child_count();i++) {
  85. Control *c=get_child(i)->cast_to<Control>();
  86. if (!c || c->is_set_as_toplevel() )
  87. continue;
  88. String base="slot/"+itos(idx)+"/";
  89. p_list->push_back(PropertyInfo(Variant::BOOL,base+"left_enabled"));
  90. p_list->push_back(PropertyInfo(Variant::INT,base+"left_type"));
  91. p_list->push_back(PropertyInfo(Variant::COLOR,base+"left_color"));
  92. p_list->push_back(PropertyInfo(Variant::BOOL,base+"right_enabled"));
  93. p_list->push_back(PropertyInfo(Variant::INT,base+"right_type"));
  94. p_list->push_back(PropertyInfo(Variant::COLOR,base+"right_color"));
  95. idx++;
  96. }
  97. }
  98. void GraphNode::_resort() {
  99. int sep=get_constant("separation");
  100. Ref<StyleBox> sb=get_stylebox("frame");
  101. bool first=true;
  102. Size2 minsize;
  103. for(int i=0;i<get_child_count();i++) {
  104. Control *c=get_child(i)->cast_to<Control>();
  105. if (!c)
  106. continue;
  107. if (c->is_set_as_toplevel())
  108. continue;
  109. Size2i size=c->get_combined_minimum_size();
  110. minsize.y+=size.y;
  111. minsize.x=MAX(minsize.x,size.x);
  112. if (first)
  113. first=false;
  114. else
  115. minsize.y+=sep;
  116. }
  117. int vofs=0;
  118. int w = get_size().x - sb->get_minimum_size().x;
  119. cache_y.clear();
  120. for(int i=0;i<get_child_count();i++) {
  121. Control *c=get_child(i)->cast_to<Control>();
  122. if (!c)
  123. continue;
  124. if (c->is_set_as_toplevel())
  125. continue;
  126. Size2i size=c->get_combined_minimum_size();
  127. Rect2 r(sb->get_margin(MARGIN_LEFT),sb->get_margin(MARGIN_TOP)+vofs,w,size.y);
  128. fit_child_in_rect(c,r);
  129. cache_y.push_back(vofs+size.y*0.5);
  130. if (vofs>0)
  131. vofs+=sep;
  132. vofs+=size.y;
  133. }
  134. _change_notify();
  135. update();
  136. connpos_dirty=true;
  137. }
  138. void GraphNode::_notification(int p_what) {
  139. if (p_what==NOTIFICATION_DRAW) {
  140. Ref<StyleBox> sb=get_stylebox(selected ? "selectedframe" : "frame");
  141. sb=sb->duplicate();
  142. sb->call("set_modulate",modulate);
  143. Ref<Texture> port =get_icon("port");
  144. Ref<Texture> close =get_icon("close");
  145. int close_offset = get_constant("close_offset");
  146. Ref<Font> title_font = get_font("title_font");
  147. int title_offset = get_constant("title_offset");
  148. Color title_color = get_color("title_color");
  149. Point2i icofs = -port->get_size()*0.5;
  150. int edgeofs=get_constant("port_offset");
  151. icofs.y+=sb->get_margin(MARGIN_TOP);
  152. draw_style_box(sb,Rect2(Point2(),get_size()));
  153. switch(overlay) {
  154. case OVERLAY_DISABLED: {
  155. } break;
  156. case OVERLAY_BREAKPOINT: {
  157. draw_style_box(get_stylebox("breakpoint"),Rect2(Point2(),get_size()));
  158. } break;
  159. case OVERLAY_POSITION: {
  160. draw_style_box(get_stylebox("position"),Rect2(Point2(),get_size()));
  161. } break;
  162. }
  163. int w = get_size().width-sb->get_minimum_size().x;
  164. if (show_close)
  165. w-=close->get_width();
  166. draw_string(title_font,Point2(sb->get_margin(MARGIN_LEFT),-title_font->get_height()+title_font->get_ascent()+title_offset),title,title_color,w);
  167. if (show_close) {
  168. Vector2 cpos = Point2(w+sb->get_margin(MARGIN_LEFT),-close->get_height()+close_offset);
  169. draw_texture(close,cpos);
  170. close_rect.pos=cpos;
  171. close_rect.size=close->get_size();
  172. } else {
  173. close_rect=Rect2();
  174. }
  175. for (Map<int,Slot>::Element *E=slot_info.front();E;E=E->next()) {
  176. if (E->key() < 0 || E->key()>=cache_y.size())
  177. continue;
  178. if (!slot_info.has(E->key()))
  179. continue;
  180. const Slot &s=slot_info[E->key()];
  181. //left
  182. if (s.enable_left) {
  183. Ref<Texture> p = port;
  184. if (s.custom_slot_left.is_valid()) {
  185. p=s.custom_slot_left;
  186. }
  187. p->draw(get_canvas_item(),icofs+Point2(edgeofs,cache_y[E->key()]),s.color_left);
  188. }
  189. if (s.enable_right) {
  190. Ref<Texture> p = port;
  191. if (s.custom_slot_right.is_valid()) {
  192. p=s.custom_slot_right;
  193. }
  194. p->draw(get_canvas_item(),icofs+Point2(get_size().x-edgeofs,cache_y[E->key()]),s.color_right);
  195. }
  196. }
  197. }
  198. if (p_what==NOTIFICATION_SORT_CHILDREN) {
  199. _resort();
  200. }
  201. }
  202. void GraphNode::set_slot(int p_idx,bool p_enable_left,int p_type_left,const Color& p_color_left, bool p_enable_right,int p_type_right,const Color& p_color_right,const Ref<Texture>& p_custom_left,const Ref<Texture>& p_custom_right) {
  203. ERR_FAIL_COND(p_idx<0);
  204. if (!p_enable_left && p_type_left==0 && p_color_left==Color(1,1,1,1) && !p_enable_right && p_type_right==0 && p_color_right==Color(1,1,1,1)) {
  205. slot_info.erase(p_idx);
  206. return;
  207. }
  208. Slot s;
  209. s.enable_left=p_enable_left;
  210. s.type_left=p_type_left;
  211. s.color_left=p_color_left;
  212. s.enable_right=p_enable_right;
  213. s.type_right=p_type_right;
  214. s.color_right=p_color_right;
  215. s.custom_slot_left=p_custom_left;
  216. s.custom_slot_right=p_custom_right;
  217. slot_info[p_idx]=s;
  218. update();
  219. connpos_dirty=true;
  220. }
  221. void GraphNode::clear_slot(int p_idx){
  222. slot_info.erase(p_idx);
  223. update();
  224. connpos_dirty=true;
  225. }
  226. void GraphNode::clear_all_slots(){
  227. slot_info.clear();
  228. update();
  229. connpos_dirty=true;
  230. }
  231. bool GraphNode::is_slot_enabled_left(int p_idx) const{
  232. if (!slot_info.has(p_idx))
  233. return false;
  234. return slot_info[p_idx].enable_left;
  235. }
  236. int GraphNode::get_slot_type_left(int p_idx) const{
  237. if (!slot_info.has(p_idx))
  238. return 0;
  239. return slot_info[p_idx].type_left;
  240. }
  241. Color GraphNode::get_slot_color_left(int p_idx) const{
  242. if (!slot_info.has(p_idx))
  243. return Color(1,1,1,1);
  244. return slot_info[p_idx].color_left;
  245. }
  246. bool GraphNode::is_slot_enabled_right(int p_idx) const{
  247. if (!slot_info.has(p_idx))
  248. return false;
  249. return slot_info[p_idx].enable_right;
  250. }
  251. int GraphNode::get_slot_type_right(int p_idx) const{
  252. if (!slot_info.has(p_idx))
  253. return 0;
  254. return slot_info[p_idx].type_right;
  255. }
  256. Color GraphNode::get_slot_color_right(int p_idx) const{
  257. if (!slot_info.has(p_idx))
  258. return Color(1,1,1,1);
  259. return slot_info[p_idx].color_right;
  260. }
  261. Size2 GraphNode::get_minimum_size() const {
  262. Ref<Font> title_font = get_font("title_font");
  263. int sep=get_constant("separation");
  264. Ref<StyleBox> sb=get_stylebox("frame");
  265. bool first=true;
  266. Size2 minsize;
  267. minsize.x=title_font->get_string_size(title).x;
  268. if (show_close) {
  269. Ref<Texture> close =get_icon("close");
  270. minsize.x+=sep+close->get_width();
  271. }
  272. for(int i=0;i<get_child_count();i++) {
  273. Control *c=get_child(i)->cast_to<Control>();
  274. if (!c)
  275. continue;
  276. if (c->is_set_as_toplevel())
  277. continue;
  278. Size2i size=c->get_combined_minimum_size();
  279. minsize.y+=size.y;
  280. minsize.x=MAX(minsize.x,size.x);
  281. if (first)
  282. first=false;
  283. else
  284. minsize.y+=sep;
  285. }
  286. return minsize+sb->get_minimum_size();
  287. }
  288. void GraphNode::set_title(const String& p_title) {
  289. title=p_title;
  290. minimum_size_changed();
  291. update();
  292. }
  293. String GraphNode::get_title() const{
  294. return title;
  295. }
  296. void GraphNode::set_offset(const Vector2& p_offset) {
  297. offset=p_offset;
  298. emit_signal("offset_changed");
  299. update();
  300. }
  301. Vector2 GraphNode::get_offset() const {
  302. return offset;
  303. }
  304. void GraphNode::set_selected(bool p_selected)
  305. {
  306. selected = p_selected;
  307. update();
  308. }
  309. bool GraphNode::is_selected()
  310. {
  311. return selected;
  312. }
  313. void GraphNode::set_drag(bool p_drag)
  314. {
  315. if (p_drag)
  316. drag_from=get_offset();
  317. else
  318. emit_signal("dragged",drag_from,get_offset()); //useful for undo/redo
  319. }
  320. Vector2 GraphNode::get_drag_from()
  321. {
  322. return drag_from;
  323. }
  324. void GraphNode::set_show_close_button(bool p_enable){
  325. show_close=p_enable;
  326. update();
  327. }
  328. bool GraphNode::is_close_button_visible() const{
  329. return show_close;
  330. }
  331. void GraphNode::_connpos_update() {
  332. int edgeofs=get_constant("port_offset");
  333. int sep=get_constant("separation");
  334. Ref<StyleBox> sb=get_stylebox("frame");
  335. conn_input_cache.clear();
  336. conn_output_cache.clear();
  337. int vofs=0;
  338. int idx=0;
  339. for(int i=0;i<get_child_count();i++) {
  340. Control *c=get_child(i)->cast_to<Control>();
  341. if (!c)
  342. continue;
  343. if (c->is_set_as_toplevel())
  344. continue;
  345. Size2i size=c->get_combined_minimum_size();
  346. int y = sb->get_margin(MARGIN_TOP)+vofs;
  347. int h = size.y;
  348. if (slot_info.has(idx)) {
  349. if (slot_info[idx].enable_left) {
  350. ConnCache cc;
  351. cc.pos=Point2i(edgeofs,y+h/2);
  352. cc.type=slot_info[idx].type_left;
  353. cc.color=slot_info[idx].color_left;
  354. conn_input_cache.push_back(cc);
  355. }
  356. if (slot_info[idx].enable_right) {
  357. ConnCache cc;
  358. cc.pos=Point2i(get_size().width-edgeofs,y+h/2);
  359. cc.type=slot_info[idx].type_right;
  360. cc.color=slot_info[idx].color_right;
  361. conn_output_cache.push_back(cc);
  362. }
  363. }
  364. if (vofs>0)
  365. vofs+=sep;
  366. vofs+=size.y;
  367. idx++;
  368. }
  369. connpos_dirty=false;
  370. }
  371. int GraphNode::get_connection_input_count() {
  372. if (connpos_dirty)
  373. _connpos_update();
  374. return conn_input_cache.size();
  375. }
  376. int GraphNode::get_connection_output_count() {
  377. if (connpos_dirty)
  378. _connpos_update();
  379. return conn_output_cache.size();
  380. }
  381. Vector2 GraphNode::get_connection_input_pos(int p_idx) {
  382. if (connpos_dirty)
  383. _connpos_update();
  384. ERR_FAIL_INDEX_V(p_idx,conn_input_cache.size(),Vector2());
  385. Vector2 pos = conn_input_cache[p_idx].pos;
  386. pos.x *= get_scale().x;
  387. pos.y *= get_scale().y;
  388. return pos;
  389. }
  390. int GraphNode::get_connection_input_type(int p_idx) {
  391. if (connpos_dirty)
  392. _connpos_update();
  393. ERR_FAIL_INDEX_V(p_idx,conn_input_cache.size(),0);
  394. return conn_input_cache[p_idx].type;
  395. }
  396. Color GraphNode::get_connection_input_color(int p_idx) {
  397. if (connpos_dirty)
  398. _connpos_update();
  399. ERR_FAIL_INDEX_V(p_idx,conn_input_cache.size(),Color());
  400. return conn_input_cache[p_idx].color;
  401. }
  402. Vector2 GraphNode::get_connection_output_pos(int p_idx){
  403. if (connpos_dirty)
  404. _connpos_update();
  405. ERR_FAIL_INDEX_V(p_idx,conn_output_cache.size(),Vector2());
  406. Vector2 pos = conn_output_cache[p_idx].pos;
  407. pos.x *= get_scale().x;
  408. pos.y *= get_scale().y;
  409. return pos;
  410. }
  411. int GraphNode::get_connection_output_type(int p_idx) {
  412. if (connpos_dirty)
  413. _connpos_update();
  414. ERR_FAIL_INDEX_V(p_idx,conn_output_cache.size(),0);
  415. return conn_output_cache[p_idx].type;
  416. }
  417. Color GraphNode::get_connection_output_color(int p_idx) {
  418. if (connpos_dirty)
  419. _connpos_update();
  420. ERR_FAIL_INDEX_V(p_idx,conn_output_cache.size(),Color());
  421. return conn_output_cache[p_idx].color;
  422. }
  423. void GraphNode::_input_event(const InputEvent& p_ev) {
  424. if (p_ev.type==InputEvent::MOUSE_BUTTON) {
  425. ERR_EXPLAIN("GraphNode must be the child of a GraphEdit node.");
  426. ERR_FAIL_COND(get_parent_control() == NULL);
  427. get_parent_control()->grab_focus();
  428. if(p_ev.mouse_button.pressed && p_ev.mouse_button.button_index==BUTTON_LEFT) {
  429. Vector2 mpos = Vector2(p_ev.mouse_button.x,p_ev.mouse_button.y);
  430. if (close_rect.size!=Size2() && close_rect.has_point(mpos)) {
  431. emit_signal("close_request");
  432. return;
  433. }
  434. emit_signal("raise_request");
  435. }
  436. }
  437. }
  438. void GraphNode::set_modulate(const Color &p_color) {
  439. modulate=p_color;
  440. update();
  441. }
  442. Color GraphNode::get_modulate() const{
  443. return modulate;
  444. }
  445. void GraphNode::set_overlay(Overlay p_overlay) {
  446. overlay=p_overlay;
  447. update();
  448. }
  449. GraphNode::Overlay GraphNode::get_overlay() const{
  450. return overlay;
  451. }
  452. void GraphNode::_bind_methods() {
  453. ObjectTypeDB::bind_method(_MD("set_title","title"),&GraphNode::set_title);
  454. ObjectTypeDB::bind_method(_MD("get_title"),&GraphNode::get_title);
  455. ObjectTypeDB::bind_method(_MD("_input_event"),&GraphNode::_input_event);
  456. ObjectTypeDB::bind_method(_MD("set_slot","idx","enable_left","type_left","color_left","enable_right","type_right","color_right","custom_left","custom_right"),&GraphNode::set_slot,DEFVAL(Ref<Texture>()),DEFVAL(Ref<Texture>()));
  457. ObjectTypeDB::bind_method(_MD("clear_slot","idx"),&GraphNode::clear_slot);
  458. ObjectTypeDB::bind_method(_MD("clear_all_slots","idx"),&GraphNode::clear_all_slots);
  459. ObjectTypeDB::bind_method(_MD("is_slot_enabled_left","idx"),&GraphNode::is_slot_enabled_left);
  460. ObjectTypeDB::bind_method(_MD("get_slot_type_left","idx"),&GraphNode::get_slot_type_left);
  461. ObjectTypeDB::bind_method(_MD("get_slot_color_left","idx"),&GraphNode::get_slot_color_left);
  462. ObjectTypeDB::bind_method(_MD("is_slot_enabled_right","idx"),&GraphNode::is_slot_enabled_right);
  463. ObjectTypeDB::bind_method(_MD("get_slot_type_right","idx"),&GraphNode::get_slot_type_right);
  464. ObjectTypeDB::bind_method(_MD("get_slot_color_right","idx"),&GraphNode::get_slot_color_right);
  465. ObjectTypeDB::bind_method(_MD("set_offset","offset"),&GraphNode::set_offset);
  466. ObjectTypeDB::bind_method(_MD("get_offset"),&GraphNode::get_offset);
  467. ObjectTypeDB::bind_method(_MD("get_connection_output_count"),&GraphNode::get_connection_output_count);
  468. ObjectTypeDB::bind_method(_MD("get_connection_input_count"),&GraphNode::get_connection_input_count);
  469. ObjectTypeDB::bind_method(_MD("get_connection_output_pos","idx"),&GraphNode::get_connection_output_pos);
  470. ObjectTypeDB::bind_method(_MD("get_connection_output_type","idx"),&GraphNode::get_connection_output_type);
  471. ObjectTypeDB::bind_method(_MD("get_connection_output_color","idx"),&GraphNode::get_connection_output_color);
  472. ObjectTypeDB::bind_method(_MD("get_connection_input_pos","idx"),&GraphNode::get_connection_input_pos);
  473. ObjectTypeDB::bind_method(_MD("get_connection_input_type","idx"),&GraphNode::get_connection_input_type);
  474. ObjectTypeDB::bind_method(_MD("get_connection_input_color","idx"),&GraphNode::get_connection_input_color);
  475. ObjectTypeDB::bind_method(_MD("set_modulate","color"),&GraphNode::set_modulate);
  476. ObjectTypeDB::bind_method(_MD("get_modulate"),&GraphNode::get_modulate);
  477. ObjectTypeDB::bind_method(_MD("set_show_close_button","show"),&GraphNode::set_show_close_button);
  478. ObjectTypeDB::bind_method(_MD("is_close_button_visible"),&GraphNode::is_close_button_visible);
  479. ObjectTypeDB::bind_method(_MD("set_overlay","overlay"),&GraphNode::set_overlay);
  480. ObjectTypeDB::bind_method(_MD("get_overlay"),&GraphNode::get_overlay);
  481. ADD_PROPERTY( PropertyInfo(Variant::STRING,"title"),_SCS("set_title"),_SCS("get_title"));
  482. ADD_PROPERTY( PropertyInfo(Variant::BOOL,"show_close"),_SCS("set_show_close_button"),_SCS("is_close_button_visible"));
  483. ADD_SIGNAL(MethodInfo("offset_changed"));
  484. ADD_SIGNAL(MethodInfo("dragged",PropertyInfo(Variant::VECTOR2,"from"),PropertyInfo(Variant::VECTOR2,"to")));
  485. ADD_SIGNAL(MethodInfo("raise_request"));
  486. ADD_SIGNAL(MethodInfo("close_request"));
  487. BIND_CONSTANT( OVERLAY_DISABLED );
  488. BIND_CONSTANT( OVERLAY_BREAKPOINT );
  489. BIND_CONSTANT( OVERLAY_POSITION );
  490. }
  491. GraphNode::GraphNode() {
  492. overlay=OVERLAY_DISABLED;
  493. show_close=false;
  494. connpos_dirty=true;
  495. set_stop_mouse(false);
  496. modulate=Color(1,1,1,1);
  497. }