1. 24 Jan, 2016 1 commit
    • David Thompson's avatar
      Fix methods on Model to omit invalid entries. · 1415340a
      David Thompson authored
      Methods like `smtk::model::Model::cellsAs<T>()` and
      `smtk::model::Model::groupsAs<T>()` would append cursors
      that were invalid rather than omitting values not matching
      the container type. For example, calling `model->cellsAs<Edges>()`
      should only return cells owned by the model that are edges
      (as opposed to vertices, faces, or volumes).
      Without this patch, invalid `Edge` cursors were being inserted
      for each vertex, face, or volume in the model's set of cells.
      1415340a
  2. 30 Oct, 2015 1 commit
    • David Thompson's avatar
      Progress on a polygonal modeler. · f909bb60
      David Thompson authored
      New Modeling Kernel
      -------------------
      
      This commit adds a new modeling kernel based on
      [Boost.polygon](http://www.boost.org/doc/libs/1_58_0/libs/polygon/doc/index.htm).
      It currently supports a very limited set of operations:
      
      + Creation a model.
      + Creation of model vertices.
      + Creation of model edges.
      
      Internally, an edge split operation is provided but not yet exposed.
      
      Miscellany
      ----------
      
      + Fix a bug in attribute association.
        Because model entity items in attributes may have a membership mask,
        calling `setValue()` does not guarantee that the association will
        occur. Return the proper boolean or infinite recursion will occur
        inside `Attribute::associateEntity()`.
      + Add a Python-callable variant of ImportJSON::ofLog.
      + Have `smtk.simple` hang on to operator results so that scripts can access them if they need to.
      + Fix error log printout in `smtk.simple` API.
      + Have python test `addToScene()` method return pipeline objects.
      f909bb60
  3. 26 Oct, 2015 1 commit
    • David Thompson's avatar
      Generalize the Exodus session; add a SLAC reader. · bd395985
      David Thompson authored
      This changes the way datasets are referenced in the Exodus session
      so that the structure of the reader's output does not have to
      match the Exodus reader's convention. Instead of using handles
      that refer to specific blocks in an Exodus reader's output,
      reference the VTK datasets themselves.
      
      This also adds support for reading SLAC NetCDF files via VTK's reader.
      
      Finally, this fixes several SMTK issues and provides a new operator:
      + Provide a global operator to export model JSON ("export model json").
      + Fix `model::Manager::modelOwningEntity`.
      + Fix problems with the SetProperty operator.
      + Fix the Exodus reader test to prevent the image test from failing.
      bd395985
  4. 17 Jun, 2015 1 commit
    • Yumin Yuan's avatar
      Refactor APIs for association between Entity and Attribute. · 9670c8d3
      Yumin Yuan authored
      Before this change, model manager had one and only one reference to an attribute system, so when we do entity assoication with attribute from different attribute system, such as model operators or simulation templates, we have to switch back and forth the attribute system of the model manager.
      This added extra burden for application to manage the logic for switching the system, also could cause hard-to-find bugs if the application logic is not properly handled. So we removed the reference to attribute system from model manager, and changed the association api to include the attributesystem. The manager stills contains the map of entity and its associations for easy access from smtk, but now the association api eliminate the ambiguilty of which attribute system to use.
      9670c8d3
  5. 13 May, 2015 1 commit
    • David Thompson's avatar
      Add geometry style (parametric/discrete) to models. · 45c19684
      David Thompson authored
      This commit adds a new enum named `ModelGeometryStyle` used to
      indicate whether a model is discrete or parametric (or some other
      type in the future — maybe point clouds, implicit models like RBFs
      or other non-solid-models). The various sessions mark their models
      with the appropriate type. It is stored as an integer property.
      
      This also adds some new image tests to the various sessions.
      
      Finally, it adds SetEntityProperty to the simple Python API
      and uses that in the image tests to set colors on groups.
      45c19684
  6. 05 Feb, 2015 1 commit
    • David Thompson's avatar
      Add "assign names" property to model Operator. · 32790424
      David Thompson authored
      When set (it is optional and its default value is OFF),
      entity names will be assigned after each operation is
      performed.
      
      Names will only be assigned to models listed explicitly
      by UUID in the operator result's "entities" item.
      
      This is an efficient way for user interfaces to control
      "prettification" of names.
      32790424
  7. 03 Feb, 2015 1 commit
    • David Thompson's avatar
      Clean up session relationships. · f8e6bbdd
      David Thompson authored
      Make the documentation match reality as far as model ownership
      goes (it did not show Model→Group relations and incorrectly had
      submodels related by `INCLUDES/EMBEDDED_IN` instead of
      `SUPERSET_OF/SUBSET_OF`).
      
      Add methods to EntityRef for managing superset/subset arrangements
      and use those (instead of raw relations) for parent-child of Model
      and Session.
      
      Rename ModelEntities and GroupEntities typedefs to Models and Groups.
      
      Clean up Read operator in all bridges to use new session storage
      style (where `Entity::relations()` holds session children) instead
      of having Session instance track top-level models.
      
      Get rid of `smtk::model::Manager::m_modelSessions`; this information
      is now stored in the sessions's `Entity::relations()`.
      f8e6bbdd
  8. 30 Jan, 2015 1 commit
  9. 20 Nov, 2014 1 commit
    • David Thompson's avatar
      Fixes, better attention to detail for member masks. · c9704651
      David Thompson authored
      Some fixes and enhancements for the code processing
      membership mask specifications.
      
      This also improves the Exodus bridge to include the
      true embedding dimension of the model (obtained from the
      reader), both directly and in the dimension bits of
      boundary and domain groups. This in turn causes
      more precise descriptions of the groups and gets
      the CMBv4 hydra template working so that only groups
      of the proper dimensionality appear as available.
      
      Finally, it improves the method by which the
      qtAssociationWidget obtains its list of available
      entities. Iterating over subphrases is not an efficient
      (nor guaranteed accurate) method for obtaining all of
      the entities available.
      c9704651
  10. 26 Sep, 2014 1 commit
  11. 08 Jul, 2014 1 commit
    • David Thompson's avatar
      Use the attribute system to specify operators. · da25ac93
      David Thompson authored
      Remove the `smtk/model/{Parameter,OperatorResult}` classes.
      They are replaced by adding a `specification()` method to
      the `Operator` class that returns an `AttributePtr` (typedef'd
      to `OperatorSpecification`). The `OperatorResult` class is
      also replaced by an `AttributePtr`.
      
      The attributes and their definitions are held by an
      attribute `Manager` owned by the `Bridge` whose model
      entities the operators can have as operands.
      
      Since the attribute system will be used for operators,
      it will be possible to determine operator names and
      parameters without instantiating an operator. (Instead,
      the attribute manager for the bridge can be asked for
      definitions.) Because of this, `Operator`s now use the
      same auto-init utilities as the `Bridge` classes.
      Upon an operator's static initialization, it registers
      itself with the proper subclass of `smtk::model::Bridge`,
      providing its name, a constructor function, and an XML
      definition of its parameters and another definition of
      its result values.
      When an instance of a Bridge subclass is constructed,
      each registered operator's XML definition is loaded into
      the bridge's attribute manager.
      Thus, bridges no longer keep a list of Operator instances;
      instead their attribute manager tracks available definitions.
      
      Operators now have a "specification" that is an AttributePtr
      specifying parameter values.
      The specification is null by default but can be set to an
      attribute with the proper definition (matching the one in the bridge's
      attribute manager).
      
      ImportJSON and ExportJSON provide methods for transporting attribute
      definitions.
      Since the XML reader does not provide a list of
      the toplevel attributes it reads, the JSON
      we export/import must store a copy of attribute
      name alongside the XML.
      
      This commit also adds smtkTypeMacro() to a large number
      of smtk::attribute classes so that templated methods operating
      on subclasses of Item and ItemDefinition can refer to
      shared pointers more easily.
      
      This commit makes the Bridge class's `operatorManager()`
      attribute manager held by pointer rather than by value.
      Because subclasses of DefaultBridge (like the TestForwardingBridge
      in the unitDefaultBridge test) are constructed by calling all
      subclass constructors, they would being initialized with the
      wrong static list of operator constructors if the manager
      was held by value. Now, when each Bridge
      subclass calls `initializeOperatorManager()` in its constructor,
      any previous subclass initialization is blown away by deleting
      the old `operatorManager()` and constructing a new one before
      populating it. It would be nice to have a `reset()` method on
      attribute::Manager. Sigh.
      
      Finally, this adds some helper methods to bridges and operators
      for obtaining the class name of an instance. The tests use this
      to aid in debugging.
      
      Silence silly shiboken signals: ignore warnings generated by
      shiboken-generated-code... at least for GNU and clang C++ compilers.
      
      A CMake function named smtk_operator_xml() is installed so that
      external projects (namely CMB) can use it. This function encodes
      an XML file as a C++ string for use in associating an `Operator`'s
      C++ implementation with its XML definition.
      da25ac93
  12. 21 Mar, 2014 1 commit
  13. 16 Mar, 2014 1 commit
  14. 14 Mar, 2014 1 commit
  15. 05 Mar, 2014 1 commit
  16. 06 Jan, 2014 1 commit
    • David Thompson's avatar
      Progress on cursor subclass implementation. · ca6c7e75
      David Thompson authored
      This patch includes many changes to the cursor subclasses
      to improve their utility in constructing and traversing models.
      
      + More methods allowing model traversal are implemented (or fixed)
        and tested as part of the `unitCursor` test.
      
      + The methods of `Storage` that return cursor subclasses are now
        properly wrapped in Python. However, many cursor methods that
        return arrays of cursors (e.g., Vertex::edges()) still cause
        segfaults as shiboken does not properly handle value/pointer
        conversion.
      
      + Add a VolumeUse cursor class.
        This is for the convenience of automating adaptors to other modelers.
      
      + The `createTet` test helper now properly models
        vertex-uses, edge-uses, face-uses, volume-uses,
        chains, loops, and shells and is
        used to test cursor-subclass methods.
      
      + It also adds a compile-time option to make the Storage
        class configurable between map and sparse_hash_map.
        The new (advanced) CMake option is named `SMTK_HASH_STORAGE`.
        When true, the `sparse_hash_map` is used for the maps between
      
        + UUID and Entity records; and
        + UUID and Arrangement records
      
        in addition to property names and values.
      
        This makes debugging issues with invalidated iterators simpler
        since `std::map` does not invalidate iterators upon insertion
        while `google::sparse_hash_map` does.
      
      + The browseModel demo now allows more in-depth inspection
        of the model but has some issues. (No exploration below face-uses.)
      ca6c7e75
  17. 23 Dec, 2013 1 commit