gEDA-dev: New diagram (attempt at UML)

Peter Clifton pcjc2 at cam.ac.uk
Thu Mar 22 09:31:59 EDT 2007


On Thu, 2007-03-22 at 06:02 -0800, Steve Meier wrote:
> Yes you could probably do it this way to.
> 
> struct st_object {
>   char obj_type;  // defined in o_types.h
> 
>   int reference_count;
> 
>   BOOL selected;            // object selected flag
>   BOOL visible;
>   BOOL locked;
>  
>   BOOL hierarchy_is_disabled;
> 
>   // attributes from symbol files
>   GList *sym_attribs;
> 
>   // attributes from schematic files
>   GList *sch_attribs;
> };
> 
> 
> struct st_pin {
>   OBJECT *base_obj;
> 
>   LINE       *line;
> 
>   POINT      *contact_location;
> 
>   PIN_TYPE   type;
> 
>   GString    *hierachy_path;
> 
>   VOID     *parent;
> };


That's kind of what I was thinking. I hadn't decided whether inheritance
or aggregation was best for the relationship between pins and lines.

This way, each pin owns a line, which it will manage the life of
internally, and use to draw its self.

Another question is.. do you make line know how to draw things like
pin-ends, or do you over-ride / extend the drawing implementation.

I like having a separate contact_location. That is what the outside
world wants to know when you embed this graphic. On the other hand, I'm
a little uneasy about replicating the data already held in the line.

Peter




More information about the geda-dev mailing list