[Smtk-developers] New Feature for Attribute Definitions - inheritable association rules

Bob Obara bob.obara at kitware.com
Wed Oct 25 10:26:24 EDT 2017


Hi All,

I’ve added the ability for an attribute definition to inherit the association rule from its base definition.  This should streamline the creation of templates.

For example you can create a definition called “Surface Boundary Condition” and assign an association rule to indicate that it can be associated with faces.  By default and definition based on “Surface Boundary Condition” will inherit this association rule and therefore be associated with model faces.
You can still override the inherited rule (note that in this implementation it will replace the entire rule).

To support this functionality there were some changes made to the attribute::Definition API:

associationRule() - returns the association rule that the definition uses - note that this can be a rule inherited from its Base Definition.  As a result this method now returns a shared pointer to a const model entity item definition
localAssociationRule() - returns the local association rule overriding the rule the definition would inherit from its base definition (Note that this can be nullptr)
createLocalAssociationRule() - creates a local association rule for the definition (by default its associated with nothing)
clearLocalAssociationRule() - removes the local association rule- the definition will now use the one inherited by its base definition 
setAssociationRule(...) -> setLocalAssociationRule(…) - sets the definition’s local association rule that overrides the one inherited by its base definition
associationMask() -> returns the association mask that the definition uses - note that this can be the mask inherited from its Base Definition. 
setAssociationMask->setLocalAssociationMask - sets the mask of the local association rule (and creates one if necessary)

What needs to be done in the future is to determine what constraints (if any) are imposed on the local association rule by the association rule inherited by the base definition?  Does the rule need to be a subset or a superset of the inherited rule. 

For Example assume a base definition foo can be applied to edges and faces
A definition bar is derived from foo and is going to have a local association rule

Which of the following are allowed?

1. bar can be associated with just faces (its rule is a subset of foo’s rule)
2. bar can be associated with edges, faces, and volumes (its rule is a superset)
3. bar can be associated with volumes (its rule is independent)

The question boils down to if bar can be treated as a foo then should it be associated to at least all  things foo? - then the we do superset
or is it a specialization of foo - in that case its a subset

I think case 3 (independent) is probably not allowed?

Note that the functionality is currently being tested and should be committed soon.


Comments?

Bob


Robert M. O'Bara, MEng.
Assistant Director of Scientific Computing

Kitware Inc.
28 Corporate Drive
Suite 101
Clifton Park, NY 12065

Phone: (518) 881- 4931




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/smtk-developers/attachments/20171025/9a1e4899/attachment.html>


More information about the Smtk-developers mailing list