Input: 5.6 Input Hierarchies: Extending the Hierarchies

Up: GEOS SDK TechDocs | Up | Prev: 5.5 Using Model

You may also extend or modify the hierarchies to add other objects that are not active nodes by default. If custom objects wish to use the hierarchies, you will need to add instance data and message handlers for their classes. The following steps must be taken to add a new node in a hierarchy:

  1. Add a hierarchical instance field of type HierarchicalGrab .
  2. Add a handler for MSG_META_MUP_ALTER_FTVMC_EXCL . This method alters the custom instance field for the grab and release messages for all hierarchies. You must call the superclass in your handler.
  3. Add methods to handle the GAINED and LOST messages pertaining to the particular hierarchy you are extending. These methods should call FlowUpdateHierarchicalGrab() . You can also add behavior exhibited when the object gains or loses the exclusive. Depending on what you are subclassing, your default behavior may already take care of this. For instance subclasses of VisClass automatically handle losing and gaining the target exclusive.
  4. Add a method to handle the GET message for the particular hierarchy you are extending. This method returns the optr of the object set in the new instance field. The method should return true to signal that it is capable of gaining the exclusive.
  5. Add the capability to handle the MSG_META_SEND_CLASSED_EVENT with the TravelOption of the particular hierarchy you are extending. The way you handle this message depends on the hierarchy affected, as discussed below.

TO_FOCUS and TO_TARGET requests should only travel down hierarchies of the same name. If no further travel is possible, the method should pass the event on to the superclass for handling. TO_MODEL requests should only travel down the Model hierarchy if it exists and the next optr is non-null.


Up: GEOS SDK TechDocs | Up | Prev: 5.5 Using Model