Model Type GraphRep
It is possible to define a GraphRep which is used for drawing the background of the drawing area in the modelling tookit. This graphical representation can be realized on model type level, model attributes can be displayed on the drawing area.
To define a GraphRep for a model type, two configuration steps have to be performed:
- Add a class attribute of type STRING or LONGSTRING to the class "__ModelTypeMetaData__" of the dynamic library. This attribute will be used as GraphRep definition for the treated model type. You may choose any attribute name, e.g. "ModelType X GraphRep" for a model type "X".
- Add a graphrep specification to the model type defnition. The model type definition is contained in the library attribute "Modi". There you have to specify the name of the attribute which contains the GraphRep definition e.g.
graphrep:"ModelType X GraphRep"
The model types's GraphRep is painted as the first object in its layer. The layer index is specified at the GRAPHREP element in the model type's GraphRep. If a high layer index is specified at the model type's GraphRep, it is more a foreground than a background graphics. To draw a graphics which lies behind all objects, you have to specify the lowest index used at a modeling object's GraphRep.
In the model type's GraphRep, model attributes can be accessed via ATTR and AVAL. This applies also for custom model attributes.
If, for any reasons, the abstract class __ModelTypeMetaData__ is missing from your application library, simply redefine it as a subclass of class __D-construct__ .
At a model type's GraphRep, the following variables are preset:
- w -- the current drawing area width
- h -- the current drawing area height
So the GraphRep may depened on the current drawing area size. That makes it possible to draw lanes across the whole width or height, or to place a text at the bottom of the drawing area etc.