• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

作図ソフト dia の改良版


Commit MetaInfo

Révisionf86ac53cf333bf94500c773ee8a166857d331657 (tree)
l'heure2001-06-09 06:37:07
AuteurCyrille Chepelov <cyrille@src....>
CommiterCyrille Chepelov

Message de Log

patch from Marc <mrw@siemens.ch> (fixes #55863) : some clean-ups in the

* objects/UML/lifeline.c: patch from Marc <mrw@siemens.ch>
(fixes #55863) : some clean-ups in the handling of connection
points. Now the total number of connection points is just a
#define (the proper solution is to retrofit the GRAFCET Vergent's
dynamic behaviour wrt connection points).

Change Summary

Modification

--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,12 @@
22
33 * plug-ins/xfig/xfig-import.c: corrected a typo (fixes #55910)
44
5+ * objects/UML/lifeline.c: patch from Marc <mrw@siemens.ch>
6+ (fixes #55863) : some clean-ups in the handling of connection
7+ points. Now the total number of connection points is just a
8+ #define (the proper solution is to retrofit the GRAFCET Vergent's
9+ dynamic behaviour wrt connection points).
10+
511 2001-06-07 Cyrille Chepelov <chepelov@calixo.net>
612
713 * app/app_procs.c (app_init): added a call to unicode_init() (only
--- a/objects/UML/lifeline.c
+++ b/objects/UML/lifeline.c
@@ -45,10 +45,12 @@ struct _LifelineState {
4545 int draw_cross;
4646 };
4747
48+#define CONNECTIONS 6 /* must be even */
49+
4850 struct _Lifeline {
4951 Connection connection;
5052
51- ConnectionPoint connections[6];
53+ ConnectionPoint connections[CONNECTIONS];
5254
5355 Handle boxbot_handle;
5456 Handle boxtop_handle;
@@ -341,7 +343,7 @@ lifeline_create(Point *startpoint,
341343 obj->type = &lifeline_type;
342344 obj->ops = &lifeline_ops;
343345
344- connection_init(conn, 4, 6);
346+ connection_init(conn, 4, CONNECTIONS);
345347
346348 lifeline->rtop = LIFELINE_HEIGHT/3;
347349 lifeline->rbot = lifeline->rtop+0.7;
@@ -364,7 +366,7 @@ lifeline_create(Point *startpoint,
364366 obj->handles[1]->connect_type = HANDLE_NONCONNECTABLE;
365367
366368 /* Connection points */
367- for (i=0;i<6;i++) {
369+ for (i=0;i<CONNECTIONS;i++) {
368370 obj->connections[i] = &lifeline->connections[i];
369371 lifeline->connections[i].object = obj;
370372 lifeline->connections[i].connected = NULL;
@@ -401,7 +403,7 @@ lifeline_copy(Lifeline *lifeline)
401403
402404 connection_copy(conn, newconn);
403405
404- for (i = 0; i < 6; i++) {
406+ for (i = 0; i < CONNECTIONS; i++) {
405407 newobj->connections[i] = &newlifeline->connections[i];
406408 newlifeline->connections[i].object = newobj;
407409 newlifeline->connections[i].connected = NULL;
@@ -488,21 +490,17 @@ lifeline_update_data(Lifeline *lifeline)
488490 p1.x -= LIFELINE_WIDTH/2.0;
489491 p2.x += LIFELINE_WIDTH/2.0;
490492 /* Update connections: */
491- lifeline->connections[0].pos = p1;
492- lifeline->connections[1].pos.x = p2.x;
493- lifeline->connections[1].pos.y = p1.y;
494- lifeline->connections[2].pos.x = p2.x;
495- lifeline->connections[2].pos.y = (p1.y + p2.y)/2.0;
496- lifeline->connections[3].pos.x = p2.x;
497- lifeline->connections[3].pos.y = p2.y;
498- lifeline->connections[4].pos.x = p1.x;
499- lifeline->connections[4].pos.y = (p1.y + p2.y)/2.0;
500- lifeline->connections[5].pos.x = p1.x;
501- lifeline->connections[5].pos.y = p2.y;
493+ r = (p2.y - p1.y)/(float)(CONNECTIONS/2-1);
494+ for (i = 0; i < CONNECTIONS/2; ++i) {
495+ lifeline->connections[i*2].pos.x = p1.x;
496+ lifeline->connections[i*2+1].pos.x = p2.x;
497+ lifeline->connections[i*2+1].pos.y =
498+ lifeline->connections[i*2].pos.y = p1.y + i*r;
499+ }
502500 } else {
503501 /* without focus of control, the points are over the line */
504- r = (p2.y - p1.y)/5.0;
505- for (i = 0; i < 6; i++) {
502+ r = (p2.y - p1.y)/(float)(CONNECTIONS-1);
503+ for (i = 0; i < CONNECTIONS; i++) {
506504 lifeline->connections[i].pos.x = p1.x;
507505 lifeline->connections[i].pos.y = p1.y + i*r;
508506 }
@@ -545,7 +543,7 @@ lifeline_load(ObjectNode obj_node, int version, const char *filename)
545543
546544 connection_load(conn, obj_node);
547545
548- connection_init(conn, 4, 6);
546+ connection_init(conn, 4, CONNECTIONS);
549547
550548 attr = object_find_attribute(obj_node, "rtop");
551549 if (attr != NULL)
@@ -572,7 +570,7 @@ lifeline_load(ObjectNode obj_node, int version, const char *filename)
572570 lifeline->draw_cross = 0;
573571
574572 /* Connection points */
575- for (i=0;i<6;i++) {
573+ for (i=0;i<CONNECTIONS;i++) {
576574 obj->connections[i] = &lifeline->connections[i];
577575 lifeline->connections[i].object = obj;
578576 lifeline->connections[i].connected = NULL;