1. 26 Sep, 2018 1 commit
  2. 13 Feb, 2018 1 commit
  3. 23 Jan, 2018 1 commit
    • T.J. Corona's avatar
      Refactor operators. · dc574a3e
      T.J. Corona authored
      This commit contains many changes made by Haocheng, David and myself.
      It performs the following:
      
      a) move operators out of model and have them operate indpendently from
         model sessions
      b) operators now each have their own attribute collection, rather than being
         represented as single attributes from an attribute collection
      c) Separate XML descriptions from the base operator, loosening the requirement
         on operators to simply have a descriptive attribute (XML descriptions are
         now supported as a subclass of the base operator). This facilitates the
         construction of python operators without requiring an XML string describing
         their inputs
      c) introduce an operation manager that tracks the availability of operators.
         It has the following properties:
         i.   Registration of operators via a unique name (usually the c++ name of
              the operator)
         ii.  Provide a connection to a resource manager so that operations that
              construct resources will automatically register the new resources to
              the manager
         iii. Provide a list of available operators given an input selection (i.e.
              show which operators accept a given input)
      d) allow read/write locks on operations' input resources and add tests for
         asynchronous operations
      e) break static registration of operations and resources into a set of
         libraries that accompany the libraries in which they are defined. A library
         that provides static registration of a resource and associated operations
         for library smtkFoo is called smtkFooEnvironment, and the registration
         occurs in the foo::environment namespace
      f) deprecate the exodus session
      g) convert smtk::model and polygon, mesh and discrete sessions to use
         nlohmann::json instead of cJSON. With this change, we can hopefully remove
         cJSON from smtk
      h) provide operations for creating, loading and saving smtk resources
      i) update tests to use the new operation framework
      
      This merge is a work in progress, but has become too large to avoid merging
      into the msater branch. The outstanding issues are
      
      a) remove smtk::model::Operation from smtk (it is still required for the qt
         bindings)
      b) rename smtk::operation::NewOp smtk::operation::Operator
      c) fix Qt bindings to use the new operation infrastructure
      d) fix the infrastructure for meshing interop with remus to avoid using json
         fragments
      e) remove cJSON from smtk
      f) switch resources' read/write/create methods from bare functors to smtk
         operators. This is more in keeping with the pattern of using operators to
         affect resources
      g) enable CGM session
      h) enable matplotlib extension
      dc574a3e
  4. 04 Aug, 2017 1 commit
  5. 03 Jul, 2017 1 commit
  6. 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