1. 17 Dec, 2018 1 commit
    • David Thompson's avatar
      Make qtResourceBrowser more useful as a standalone widget. · 51d82b42
      David Thompson authored
      + Allow a subclassed qtDescriptivePhraseModel instance to be passed to
        its constructor.
      + Make the ParaView-specific visibility decorator available for other
        ParaView plugins to use.
      + Expose the qtResourceBrowser's QTreeView.
      + Move most of pqSMTKResourcePanel into qtResourceBrowser (Qt parts) and
        pqSMTKResourceBrowser (ParaView parts).
        This will allow easier customization, and particularly
        allows people to use the widget without it being central to
        a dock widget, making it simpler to configure components in
        the widget that are needed at construction time.
      + Also, make pqSMTKResourcePanel::Internal::m_phraseModel point to
        the base class (PhraseModel) rather than the particular subclass
        we use (ResourcePhraseModel).
      + Better nullptr testing to prevent crashes when invalid QModelIndex values
        are used.
      + Test whether the model passed to qtDescriptivePhraseDelegate::editorEvent
        is a QAbstractItemModel such as QSortFilterProxyModel; if it is, then map
        the index.
      + Store descriptive phrase pointers in QVariants and provide a way to
        obtain phrase pointers from a QModelIndex without access to the
        underlying QAbstractItemModel.
        This allows clean separation between our QAbstractItemModel subclass
        and classes that consume its QModelIndex instances.
        The separation makes it possible to pass a QAbstractProxyModel to
        use instead of a qtDescriptivePhraseModel so that searching can
        be exposed in the GUI.
      51d82b42
  2. 05 Dec, 2018 1 commit
    • David Thompson's avatar
      Refactor pqSMTKResourcePanel into qtResourceBrowser. · 944a1c97
      David Thompson authored
      + Refactor all but the ParaView-specific pieces from
        the SMTK resource panel widget into a new class named
        qtResourceBrowser.
      + Remove the unimplemented search text entry from the
        resource panel.
      + Add methods to qtSMTKUtilities to accept an override for
        the QTreeView widget.
      + Moves synchronization of the SMTK selection (when resources
        rather than components are selected) with ParaView's
        pipeline inspector into a new behavior named
        pqSMTKPipelineSelectionBehavior.
      + Fix the `Selection::visitSelection()` method; it
        was not possible to call the more general visitor
        because shared pointers can be implicitly converted.
      + Add a `relatedObject()` method to descriptive phrases
        and phrase content. Arguably, this should replace
        `relatedComponent()` and `relatedResource()` as the
        only method they provide.
      944a1c97
  3. 10 Oct, 2018 1 commit
    • David Thompson's avatar
      Make editing model-entity names work. · ff5e1934
      David Thompson authored
      This does not affect attribute (or meshset names), although those
      should now be un-editable (i.e., double-clicking on the name will
      have no effect rather than popping up an editor that is ignored).
      
      This also does some work to make colors editable, but does not
      complete it; the render window is not updated properly.
      ff5e1934
  4. 02 Oct, 2018 1 commit
    • David Thompson's avatar
      Make highlight-on-hover a user preference. · c0781fdd
      David Thompson authored
      This also
      + makes highlighting more robust against unreported
        (i.e., buggy Qt) "leave" events (by also resetting the hover
        selection when the mouse leaves the resource panel dock widget).
      + draws a background on Qt items as the mouse hovers over them
        (when highlight-on-hover is set) so that users get feedback on
        when Qt has skipped events.
      + fixes transforms applied to the representation; previously,
        transforms were not applied to selected/highlighted components.
      + fixes the build against latest ParaView master.
        The old `WRAP_EXCLUDE` and `WRAP_EXCLUDE_PYTHON` CMake source
        properties are no longer used; classes must pay attention to
        the `__VTK_WRAP__` macro to exclude themselves if needed.
      + adds user preferences for selection/hover colors and a default
        model-face color (for model edges, we should use ParaView's
        existing edge color).
        Thanks to Utkarsh for explaining the `<Extension ...>`
        element in PV's SM XML.
      + fixes the "can't deselect" bug (the SMTK model-representation's
        actors/mappers were not being updated when no entities were selected).
      c0781fdd
  5. 14 Mar, 2018 1 commit
    • David Thompson's avatar
      Add a qtItem subclass for resource components & more. · 679154d0
      David Thompson authored
      + Add the qtReferenceItem subclass of qtItem. Then add
        qtComponentItem which inherits qtReferenceItem. Eventually,
        qtResourceItem will also exist (or qtReference item will
        encompass functionality for both resources and their components).
          + This item now properly presents and allows editing
            of entries related to a ComponentItem. However, it does
            not update the entries of the ComponentItem upon editing yet.
          + The Qt item displays a synopsis of the selected components
            and indicates whether the selection meets the requirements
            called out by the attribute (specifically, the number of
            entries must be allowed and the selection must come from a
            list of acceptable components).
      + Add callbacks to SMTK resource panel to signal when a row is hovered
        and change the "hovered" selection value.
      + Add support to the model representation to illustrate the "hover"
        selection value in preference to the "selected" value.
      + Fix a memory leak in the model representation.
      + Fix the SMTK attribute panel exposed as a PV plugin:
          + Always clear the widget out when switching between
            attribute resources.
          + Note that this has not been tested with switching between
            views within the same attribute resource, and will probably
            need changes to handle that case.
          + Also note that you must click on a _resource_ entry in the
            resource tree-view panel to switch what is displayed in the
            attribute panel; clicking on an attribute is not enough.
      679154d0
  6. 10 Feb, 2018 1 commit
    • David Thompson's avatar
      Add per-view, per-component visibility edits. · 7aae9671
      David Thompson authored
      + Visibility editing in the SMTK resource tree, in all its glory.
        Consistent, per-view component visibility editing, including:
        1. Toggling of pqPipelineSource visibility when a resource's visibility is edited.
        2. Immediate updates of all eyeball icons in the entire tree when one
           component's visibility is presented multiple times.
        3. Immediate updates of all eyeball icons when the active view changes.
        4. No eyeballs displayed when the active view is null.
        5. Proper decoration of resource phrases so their visibility may be edited.
        6. Sorting of phrases by default.
      + Other GUI components (besides the SMTK resource tree) may call
        `pqSMTKModelRepresentation::setComponentVisibility()` and the resource panel
        should stay up to date. This is in anticipation of RGG, which wants to change
        ping/duct/assembly/core visibility in response to what's being edited.
      + Adjust the color and opacity used to render selected entities.
        By default, the selection should be rendered as a translucent overlay.
        This removes problems with z-fighting and allows users to see when
        visibility has changed on selected entities.
      + Do not add color arrays to model-entity polydata (in the vtkModelMultiBlockSource).
        This wastes space; instead, entity color is now stored as field-data in an array
        named "entity color".  However, this field data is currently ignored by the model
        representation in SMTK's ParaView plugins; instead, the model resource itself is
        asked for color property information.  The "entity color" array is stored so that
        ParaView and VTK filters ignorant of SMTK can make use of it.
      + Change "mixed-dimension cell(s)" to "cell(s)" in model-entity summaries.
        This is less confusing to users. And more concise.
      + Fix a crash when the resource loader fails.
        This can happen when the plugin for the type of session
        contained in a resource's file is absent.
      7aae9671
  7. 02 Feb, 2018 1 commit
    • David Thompson's avatar
      Adapt to the new operator/resource classes. · ff5d9498
      David Thompson authored
      + Use the new resource/operator framework to load model files.
      + Check more pointers to avoid crashes.
      + Eliminate warning from vtkModelMultiBlockSource about model being unset
         because now each **resource** should have its own representation,
        so we should always render everything the resource has to offer
        rather than trying to traverse just one model.
      + Set up SMTK model representation properly: set both the resource and the
        vtkSMTKWrapper instance so that selections are properly synchronized.
      ff5d9498
  8. 12 Jan, 2018 1 commit
    • David Thompson's avatar
      Model representation and resource tree for ParaView. · ebe09392
      David Thompson authored
      This commit contains many changes from Alvaro Sanchez and me to address:
      + Color-by-entity and -by-volume mode for the model representation.
        In cases where the begin() entity is invalid, volumeOfEntity() would
        return an entity not flagged as being a volume.
      
        In order to get access to an EntityRef's color property, pqRepresentation
        provides a smtk::model::ManagerPtr to the vtkSMTKModelRepresentation object.
      
        The appropriate EntityRef is queried from model::ManagerPtr (Resource)
        depending on the active coloring mode; color-by-entity uses direclty its
        entity color and color-by-volume uses the color of the 0th volume bounded
        by the entity.
      + Use pqSMTKResource's model::Manager instead of a global instance.
      + Representation subtypes (points, wireframe, surface, surface with edges)
        for the model representation.
      + Line color for the model representation.
      + Representation class location.
        Move the server-side classes to the PV server extension and add
        pqProxy subclasses to the appcomponents extension.
        This is necessary to avoid cyclic dependencies between the representation
        and the resource panel (which will soon display/modify the representation's
        visibility information).
      + Move DescriptivePhrase subclasses (that describe content) into
        a PhraseContent class, instances of which are owned by DescriptivePhrase.
        This separates the hierarchy of subjects from the content of the subject
        so that attributes of the subject can be overridden via the decorator pattern.
        This leaves phrase lists with improper descriptions at the moment
        since the common/union flag values are not set properly (among other things).
      + Displaying "eyeball" visibility icon selectively -- only
        when the PhraseContent advertises it as available is it rendered and active.
      + Use the new visitor method of vtkCompositeDataDisplayAttributes to
        fetch per-view block visibility information from mappers and add
        methods to set the per-block visibility, although this is not complete yet.
        This requires us to bump VTK and PV forward, which in turn requires us to
        Fix build issues due to changes in wrapping.
          + Fixes errors: No rule to make target '*Hierarchy'.
          + Manually excludes classes that do not need wrapping.
      + Try to keep `ENTITYID` out of SMTK except for the `vtkModelMultiBlockSource`.
      + Attach UUID to both the multiblock metadata and the actual `vtkDataObject`
        instance. The latter is preferrable in almost every instance since it is
        then possible for methods passed only a data object to get its UUID.
        This is necessary for the PV representation's visibility modification
        queries to work properly since, when iterating over visibility entries in
        vtkCompositeDataDisplayAttribute, only the block is available, not its metadata.
      + Add missing parts to representation xml: property to enable/disable
        multi-block inspector coloring.
      + Create and make representations visible by default in new views.
        pqApplyBehavior makes the model visible on the initial view. Additional
        views need to create and make their representations visible, this is done
        through pqSMTKBehavior.
      + Fix some crashes by holding a weak ref to the selection.
      Co-authored-by: Alvaro Sanchez's avatarAlvaro Sanchez <alvaro.sanchez@kitware.com>
      ebe09392
  9. 08 Dec, 2017 1 commit
    • David Thompson's avatar
      Work on the UI for ComponentItem / deprecation of ModelEntityItem. · 3ece72e1
      David Thompson authored
      + Move smtk::resource::SelectionManager to smtk::view::Selection.
        It really isn't a manager; it's a selection. Each instance holds a
        map enumerating the "degree" to which each component is selected.
        You can have multiple selections in an application.
      
      + Make the ParaView SMTK resource panel respond to selections
        and emit its own. Note that selecting a summary phrase does not
        result in entities in its child phrases being selected. This
        is a departure from the previous phrase view; we may add
        this functionality into the new resource panel at some point
        as it satisfies the priniciple of minimum astonishment.
        The problem is that it requires computation of child phrases,
        which destroys the lazy nature of the algorithm.
      
      + Fix resource handling when deleting sources.
      
      + Add a VTK-based attribute "reader" (that produces a pretty empty multiblock
        but has the side effect of adding a resource to the resource manager when
        an observer is attached).
      
      + Port more code over from old, model-only EntityListPhrase to PhraseList:
        generate more descriptive titles for lists with many, potentially disparate children.
        For now, this only deals with model, not mesh or attribute, components.
      
      + Adds a currently-uncompiled "unit test" for a component item UI.
      
      + When inheriting QStyledItemDelegate, do not call the inherited
        `paint()` method inside your own as it will draw each item's
        `Qt::DisplayRole` text overlapping your own.
      3ece72e1
  10. 30 Nov, 2017 1 commit
    • David Thompson's avatar
      Many changes to support resource and operation reorg. · d31e963f
      David Thompson authored
      + Add an abstract PhraseModel class and a concrete ResourcePhraseModel class.
        A PhraseModel owns a DescriptivePhrase hierarchy and the SubphraseGenerator
        instances attached to it. The PhraseModel class maintains the hierarchy as
        operations and selections are performed by users.
        A PhraseModel may be configured by an SMTK views.
        PhraseModel provides some methods for its children to override that
        make managing the hierarchy much simpler.
      + Add a JSON deserialization for smtk::view::View and test that it matches
        the equivalent XML description.
      + Add an observe() method to resource manager.
        Now it is possible to get notified when a resource is added/removed.
        Note that the notification comes *after* the operation that reads the
        resource has completed.
      + Track both resources and resource managers with pqProxy subclasses.
      + Add a ParaView plugin panel that presents resources in a model-tree view.
      + Provide minimal registration of the model manager to the resource manager.
      + Add DescriptivePhrase::visitChildren() method for traversing a phrase
        hierarchy in order to update it.
      + Fix issues with operator result creation.
        Model operators still need to use their Session's attribute collection to
        create the result while the new-style operators should use the operator
        manager. This will change again when the new operation manager is
        modified to use an attribute collection per operator rather than a single
        instance for the manager.
      + Implement more of ComponentItemDefinition and partially implement XML
        I/O of attributes with ComponentItems. The associated components of an
        attribute are still not synchronized/serialized/deserialized.
      + Provide some model-operator-specific code to copy result
        summary items from ModelEntityItems to ComponentItems with
        similar names (now also defined in Session.cxx).
        In the long term, ModelEntityItem should disappear.
      + Make Resource store a weak pointer to its manager,
        not a raw pointer. Since the manager may not hold the
        only shared pointer to a resource, the resource may outlive
        its manager and should still behave.
      d31e963f
  11. 18 Nov, 2017 1 commit
    • David Thompson's avatar
      Checkpoint on PV, resource, selection, and operation refactor. · 4e330ba2
      David Thompson authored
      + Implement some stubbed methods in smtk::operation classes
        and test them.
      + Add C++11 callbacks for listening to operator events (all
        of them, not just individual operators like the model-
        operator callbacks did).
      + Add behaviors to the ParaView extensions that do client-
        server communication of selections.
      + Add pqSMTKResourceManager proxy that gets created by
        pqSMTKResourceManagerBehavior upon plugin startup.
        All the selection management stuff in the behavior should
        eventually be moved into the proxy class.
      + Add pqSMTKResource proxy that registers itself with
        the VTK/PV-wrapping of SMTK's resource manager.
      + Fix documentation and add stubs for documenting the
        `smtk/extension` directory.
      + Add Qt extension classes that expose the new
        descriptive phrase classes in `smtk/view`.
      + Use the new qtDescriptivePhraseModel in a panel
        to show resources in ParaView as a behavior.
      + Eliminate client-server duality.
        For now, we work only with PV's built-in server,
        not separate client+server processes.
        This means that there is no need for operator
        forwarding, separate resources on the client and server,
        problems synchronizing the client-only attribute panels
        with models that are modified only on the server, etc.
      4e330ba2
  12. 26 Apr, 2017 1 commit
  13. 24 May, 2016 1 commit