Associative arrays are implemented through the following mechanisms:
When an associative array is implemented through two BTRs, the first (source) BTR stores the source entities. Array items are represented with block references pointing to the source BTR. Those references are stored in the second (destination) anonymous BTR.
Associative array BTRs in the database hierarchy |
In the picture above, the source entity is stored in the U2 block, and array items are stored in the U3 block.
In model space, an associative array is implemented with a block reference to the destination BTR.
Associative array with block reference to destination BTR |
In model space, the AcDbDictionary object stores a block reference pointing to the U3 block. This block contains the destination BTR (as described in Two anonymous BTRs).
The base class that provides the associative behavior is the OdDbAssocAction class. This class stores the value parameters of the array (rows, columns and levels count, spacing between array entities, etc.) and provides the evaluate() method for handling all changes.
Note that the OdDbAssocAction class has no virtual methods that can be overridden, therefore it can't be used for deriving and alternating association implementations.
OdDbAssocAction is the base class for such classes as:
The OdDbAssocParamBasedActionBody class is derived from OdDbAssocActionBody and represents the associated parameter based on the action body. It is the parent class for OdDbAssocArrayActionBody.
The OdDbAssocArrayActionBody class implements an array of associated actions which can be evaluated for locating and managing the items of an associative array. It contains common functionality for all types of associative arrays:
Any association can have parameters that determine its type and reaction for changing items. The base abstract class which implements the interface for an array of associated parameters is OdDbAssocArrayParameters. Common associated parameters are in the OdDbAssocArrayCommonParameters class.
The following classes are inherited from OdDbAssocArrayCommonParameters:
These classes are designed to control the parameters of associative arrays according to their types: rectangle, polar, or path.
The OdDbAssocDependency class is the base class that represents the dependency.
The dependency stores a list of action objects. An action object either depends on an entity of the database or modifies it. In other words, dependency determines how associativity is represented in the drawing database. Dependencies are attached to the entities as persistent reactors and are owned by the action object. When the entity that is depended on is changed, it notifies the dependency through the persistent reactor mechanism.
The OdDbAssocDependency object stores several softPointRef objects:
The OdDbAssocDependency object acts as a reactor for all objects listed above. The evaluate() method checks whether any changes were made in the source entities and updates those entities.
Dependency as a reactor for associative array items |
Classes derived from OdDbAssocDependency:
Working with Associative Arrays
Editing Associative Array Parameters
Copyright © 2002 – 2020. Open Design Alliance. All rights reserved.
|