.. _release-notes-21.09:

=========================
SMTK 21.10 Release Notes
=========================

See also :ref:`release-notes-21.09` for previous changes.


SMTK Common Changes
===================================

Observers and debugging
-----------------------

Now :smtk:`smtk::common::Observers` takes a second template parameter:
a boolean indicating whether to print debug messages or not.
This does away with the previous macro (which printed messages for *all*
observers – resource, operation, etc.) in favor of messages that can
be enabled for a single specialization. See the :ref:`smtk-tips` section
of the user's manual for more information.


Attribute Resource Changes
==========================

Expanding Attribute Resource's Query Grammar
--------------------------------------------

Attribute Resource's queryOperation now uses a Pegtl-based approach which now provides the following benefits:

* In addition to querying on Attribute Type, you can now also query based on Property and Property Value
* Type Query can now include Regular Expressions.

See the `attribute filter documentation`_ for more details and examples.

.. attribute filter documentation: https://smtk.readthedocs.io/en/latest/userguide/attribute/filtering-and-searching.html


Qt UI Changes
=============

New qtComponentAttributeView Replacing qtModelEntityAttributeView
-----------------------------------------------------------------
This new class expands the capabilities of the old class by now supporting Components of any Resources not just Model Resources.

Also there is no longer a need to specifier the filter type.  The View will look at the association rule associated with the Attribute Definition specified in the view configuration.  If more than one Definition is specified, then the first one is chosen.

As a result the new constraints to using this View are:
* The Attribute Definition(s) in the configuration must contain the association rule to be used to determine which Resource Components need to be attributed
* If more than one Attribute Definition is listed, then the first one's association rule will be used.

In addition the following improvements have been made:

* Selection of the Type of Attribute via the ComboBox no longer requires any button press after the selection has been made

* Also addressed a bug related to the View being updated when selecting a different attribute to be assigned to the SMTK component.  The symptom was that instead of accepting the requested type, the View would instead display "Please Select" indicating that the component had no attribute associated with it. The reason was due to the fact that the View was being updated via the call to removeAttribute prior to the new attribute being created.  The fix was to postpone calling that method until after the new attribute was in place.


How to refer to qtComponentAttributeViews in a ViewConfiguration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Setting the "Type" to ComponentAttributeView will cause the creation of a qtComponentAttributeView.
**Note** The "ModelEntity" Type will still be supported and will result in the creation of a qtComponentAttributeView.

.. code-block:: xml

  <Views>
    <View Type="ComponentAttribute" Title="Surface Properties">
      <AttributeTypes>
        <Att Type="SurfaceProperty" />
      </AttributeTypes>
    </View>
  </Views>


Improving qtAssociation2ColumnWidget's Operation Handler
--------------------------------------------------------

The original code would cause a large number of refreshes due to the fact it merely would see if the were any resource changes.  The new logic is a bit more intelligent and will only cause a refresh if any of the following conditions happen:

* A modified component is either the widget's attribute or can be associated with the widget's attribute
* A deleted component could have been associated with the widget's attribute
* A created component could be associated with the widget's attribute

The result should be a more responsive UI.

SMTK's New String Token Support
===============================

String token classes
--------------------

SMTK now provides a ``smtk::string::Token`` class for working with tokenized strings.
See the `user's guide section on string tokens` for more information.

.. _user's guide section on string tokens: https://smtk.readthedocs.io/en/latest/userguide/string/concepts.html


SMTK Software Process Changes
=============================

Dynamic initialization in plugins
---------------------------------

The CMake macro SMTK provides to create plugins
now uses a new feature in ParaView to ensure that
plugins are initialized properly in both Qt-based
GUI applications and python interpreters.

This should not require any changes to your code;
it simply changes the code generated by the `smtk_add_plugin()` macro.
Instead of generating a ParaView plugin with an
automatically-generated `pqAutoStartInterface` class,
it generates a ParaView plugin with
a `vtkPVDynamicInitializerPluginInterface` class which
calls a free function to initialize the plugin's registrars.
