[Smtk-developers] Model association changes
David Thompson
david.thompson at kitware.com
Mon Nov 24 18:47:16 EST 2014
Hi all,
I've pushed a first batch of changes to treat associations as special ModelEntity{ItemDefinition,Item} instances. This was done so that attributes can specify the number of associated entities as well as their type. For example, it is possible for attributes representing SMTK model operators to indicate that only a single model may serve as the workpiece (say, for a subtraction operator).
The effects of this are that now
1. Instead of smtk::attribute::Definition owning a BitFlags integer that serves as the association mask, it owns a ModelEntityItemDefinition instance.
2. Instead of the *XML attribute* named Associations, the <AttDef> element may have a child tag named <AssociationsDef>. It is processed as if it were a <ModelEntity> tag inside <ItemDefinitions> (but it resides directly inside the <AttDef> tag, not as a child to <ItemDefinitions>). An example is:
<AttDef Type="Material">
<Associations NumberOfRequiredValues="0" Extensible="true">
<MembershipMask>group|domain|volume</MembershipMask>
</Associations>
<ItemDefinitions>
...
</AttDef>
Note the MembershipMask value may be specified numerically as a decimal number encoding flags or as a string like the example above. See smtk/model/Entity.cxx for details on string processing.
3. Checks on entity associations are now implemented where previously they were not. Be aware that you may have issues to address. Several tests (and the test data repo) were updated to verify the checks on whether an association is valid or not.
The work will not be complete until Attribute instances use a ModelEntityItem to hold the set of associated model entities. At that point, the membership testing code that is part of ModelEntityItem will also be used for associations.
If you have any issues, please let me know.
David
More information about the Smtk-developers
mailing list