Re: Differentiating between Connectors and Objects

On Wed, 9 Jul 2008 20:59:10 +0200, Fred Morcos wrote
Diagram Auto-Layouting [1], basically the "connections" act like
springs and the "objects" act like repulsive charges. A simulation is
ran and as the system approaches an equilibrium state, the diagram
starts "looking good" and well "layouted".


PS: Using the algorithms used by "dot" (graphviz) is not really an
option for me, it is my bachelor thesis so the tasks are pretty

Very interesting; I don't know if they admit connections not being segments ...
 In my use of Dia I have to bo be very aware of connected objects; there are
"general lines" having "connection handles" and "general elements" having
"connection points" (is spite of that, just as Lars said, there are objects
having connection handles and connection points; the simplest case is the
Standard Line with 2 handles and 1 or more connection points).
 But Dia's files only have information about efectively connected "connection
something as 
      <dia:connection handle="1" to="O7" connection="5"/>
indicates that the line number ..... connects, by its handle number 1, with
object number 7  at its connection point 5

I imagine you will have to detect, as inconvenient objects for yor task, lines
with less than two efectively connected connection handles and elements not
connected to any line

Perhaps you shoud not be worried about future lines and only be prepared to
detect unknown ones.


On Wed, Jul 9, 2008 at 8:54 PM, Lars Clausen <lars raeder dk> wrote:

On Jul 9, 2008, at 8:47 PM, Fred Morcos wrote:

So basically I am stuck with string comparison of all shapes that were
ever created, currently existing and ever to come?

On Wed, Jul 9, 2008 at 8:34 PM, Lars Clausen <lars raeder dk> wrote:

On Jul 9, 2008, at 7:50 PM, Fred Morcos wrote:

Is it possible to get the type of an object without using a returned
string (object_get_type)? I want to loop over all the selected objects
and count the number of "connection objects" and the number of "other
normal objects" without having to go through this:

(pseudo code)
if (objtype == "Standard - Line" || "UML - Generalization" || "UML -
Dependency" || etc...)

Many of the "connection objects" and "normal objects" inherit from a few
classes - Line, Arc, Polyline resp. Element.
However, not all do, and some few objects have aspects of both types
(Lifeline, for instance).

Maybe. What are you trying to  accomplish?

Dia-list mailing list
Dia-list gnome org
FAQ at
Main page at

Fred Morcos
Dia-list mailing list
Dia-list gnome org
FAQ at
Main page at

loli unsa edu ar

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]