Prev: object-hierarchy.html Up Next: box.html
GRaphical OBjects (grobs)

The name 'grob' originates from LilyPond, a music typesetter, and it stands for GRaphical OBject. Grob is the base class for all objects which you place in your plot (except graph). Grob defines a few common properties:

  • The 'container *parent()' member function returns the parent of this object (the container in which it is placed, or NULL if it is not placed into any container)
  • The print_hierarchy() member function prints the object-hierarchy onto your standard error output beginning with this object. For example if you want to check what objects are stored in your current pad, say: pad::current()->print_hierarchy();
  • etc, etc, etc.

    Objects may need to be prepared for drawing. For example they can hold only some preliminary info about themselves, and they calculate their final layout only before being printed. Or, as it was explained before, lengths need to be specialized before they can be used in any printing process. The coordinates of grobs have to be registered in order that they will be specialized (I would wonder if this were clear... let me have a chance later to explain it better :-). The member function prepare_for_draw()(which is pure virtual) usually does this, and this member function is overridden in derived classes. The user never has to call this function.

    Source files:
       grob.h
       grob.cc
    

    Prev: object-hierarchy.html Up Next: box.html