← Back to team overview

kicad-developers team mailing list archive

Re: understanding EDA_ITEM

 

Le 09/04/2015 23:39, Mário Luzeiro a écrit :
> Hello all,
> 
> I was trying to understand the propose of the EDA_ITEM (and its use on 3d-viewer).
> I was trying to understand what could be the historical decisions to use it in some classes of the module.
> 
> As an example, in 3d_material.h
> 
> class S3D_MATERIAL : public EDA_ITEM
> ...
>     S3D_MATERIAL* Next() const { return (S3D_MATERIAL*) Pnext; }
>     S3D_MATERIAL* Back() const { return (S3D_MATERIAL*) Pback; }
> ...
>     virtual wxString GetClass() const
>     {
>         return wxT( "S3D_MATERIAL" );
>     }
> ...
> etc
> 
> I am not sure why it was used and if it have any benefit from using it. In some of this simple cases I think it make the implementation a bit more confused and hard to follow.
> 
> So I was trying to understand benefit / propose of use EDA_ITEM and when it should used / should not be used/ can be avoided..
> Special, I have in mind to implement some things in the future using vectors and not (never) any type of linked lists (for memory access operations and speed up..)
> 

When the 3D viewer was started, the class EDA_ITEM was mainly a simple
base class to handle a linked list of schematic or board items, with
basic members to help edition of these items (edition = edit, add,
remove, undo/redo, identify the item type, store a time stamp, keep
trace of a change...)

Now it is no more a simple class, and does not have a lot of interest to
handle the 3D graphic item data, which is not edited.

So, data like S3D_MATERIAL could be handle by some other containers.

-- 
Jean-Pierre CHARRAS


References