gml_GRItem_DisplayList.h

00001 // gml_GRItem_DisplayList.h --
00002 //    Define the "gml_TGRDisplayList". An ordered list of GRItems from back to front item.
00003 //
00004 //  Copyright (c) 2004 CLIPS-IMAG.
00005 //
00006 //  See the file "gml_LicenseTerms.txt" for information on usage and redistribution
00007 //  of this file, and for a DISCLAIMER OF ALL WARRANTIES.
00008 //
00009 //  June 3, 2004 (FB).
00010 //    Renamed files from "gml_GRDisplayList.*" to "gml_GRItem_DisplayList.*"
00011 //    Minor code corrections.
00012 //
00013 //  Created on May 2004 (Sylvie Rouillard).
00014 
00015 #ifndef __GML_GRITEM_DISPLAYLIST__
00016 #define __GML_GRITEM_DISPLAYLIST__
00017 
00018 
00019 #include "gml/base/gml_List.h"
00020 
00021 
00022 // gml_TGRItem_DisplayList --
00023 
00024 class gml_TGRItem;
00025 class gml_TGRItem_DisplayList
00026 {
00027 public:
00028 
00029   // Init --
00030 
00031   gml_TError            Init ();
00032   
00033   // Dispose --
00034 
00035   void                  Dispose ();
00036 
00037   // AppendItem --
00038   //
00039   //  Places the item <item> in the list after the topmost item that is
00040   //  in the same layer of item.
00041   
00042   gml_TError            AppendItem (gml_TGRItem* item);
00043 
00044   // Delete --
00045   
00046   void                  Delete (gml_TGRItem* item);
00047 
00048 
00049 
00050   // RelinkItems --
00051   //
00052   //  Moves the item <item> just after <prevItem> in the display list.
00053   //  If <prevItem> is NULL, moves <item> at the head of the display list.
00054   //  If <withHierarchy> is true, <item> and all its children are moved, otherwise
00055   //    only <item> is moved.
00056 
00057   gml_TError RelinkItems (gml_TGRItem* item, gml_TGRItem* prevItem, int withHierarchy);
00058 
00059   // SetupAndRelinkItems --
00060   //
00061   //  Finds where <item> must be inserted (depending on its layer level, etc)
00062   //  if <refItem> is not null change <item> layer level if necessary
00063   //  if <prevItem> is not null, it will receive the adress of the item just after which <item> must be inserted
00064   //    NULL if <item> must be inserted at the beginning
00065   //  call RelinkItems 
00066   
00067   gml_TError            SetupAndRelinkItems  (gml_TGRItem*      item,
00068                                               gml_TGRItem*      refItem,
00069                                               int               withHierarchy,
00070                                               int               isRaised,
00071                                               gml_TGRItem**     prevItem);
00072   
00073 
00074   // Draw --
00075 
00076   void                  Draw ();
00077 
00078   // List --
00079   //
00080   //  Returns a pointer to the internal list of GRItems.
00081 
00082   gml_TList*            List ()
00083                           { return fList; }
00084 
00085 
00086 protected:
00087 
00088   gml_TList*          fList;          /* list of displayed items */
00089 
00090 };
00091 
00092 #endif // __GML_GRITEM_DISPLAYLIST__
Generated on Tue Jun 12 14:03:27 2007 for gml by Doxygen 1.5.2.