#pragma once
#include "SummaryResultTypeN.h"

namespace DNVGL { namespace Sestra {namespace API {
    /**
    * Part of the SESTRA Public API (managed c++)
    * Copyright DNV GL - Software
    *
    * An interface which allows Sestra to
    * communicate basic results back to the caller
    *
    * It is left to the caller to 
    * provide an implementation of this interface.
    */

    public interface class ISestraSummaryResultListenerN {
    public:
        /* Sestra calls Start() prior to any other call */
        void Start() = 0;

        /**
        * Available results:
        * type = MASS_CENTRE:                   id is not used. results has size 3 (x,y,z coordinates)
        * type = MASS_MATRIX:                   id is not used. results has size 36 (6x6 symmetric matrix)
        * type = NODAL_MASS_CENTRE:             id is not used. results has size 3 (x,y,z coordinates)
        * type = NODAL_MASS_MATRIX:             id is not used. results has size 36 (6x6 symmetric matrix)
        * type = LOAD_SUM:                      id identifies result case. results has size 6 (tx, ty, tz, rx, ry, rz)
        * type = LOAD_SUM_COMPLEX:              id identifies result case. results has size 12 (Rtx, Itx, Rty, Ity, Rtz, Itz, Rrx, Irx, Rry, Iry, Rrz, Irz)
        * type = REACTION_FORCE_SUM:            id identifies result case. results has size 6 (tx, ty, tz, rx, ry, rz)
        * type = REACTION_FORCE_SUM_COMPLEX:    id identifies result case. results has size 12 (Rtx, Itx, Rty, Ity, Rtz, Itz, Rrx, Irx, Rry, Iry, Rrz, Irz)
        * type = MATRIX_ELEMENT_R.F._SUM:       id identifies result case. results has size 6 (tx, ty, tz, rx, ry, rz)
        * type = MATRIX_ELEMENT_R.F._SUM_CMPL.: id identifies result case. results has size 12 (Rtx, Itx, Rty, Ity, Rtz, Itz, Rrx, Irx, Rry, Iry, Rrz, Irz)
        * type = EIGENVALUES:                   id is not used. results contains eigenvalues computed by sestra.
        * type = HYDM_WET_SURFACE_AREA:         id identifies added mass load case key. results has size 1 (area)
        * type = HYDM_VOLUME_BELOW_WATER_LEVEL: id identifies added mass load case key. results has size 2 (volume calculated by Lx and by Ly)
        * type = HYDM_GLOBAL_ADDED_MASS:        id itentifies added mass load case key. results has size 3 (mass components in x, y, z)
        */
        void StoreResult(SummaryResultTypeN type, int id, array<double>^ results) = 0;

        /**
        * internal_result_case_number: assigned by Sestra
        * load_case_number:            user-defined via the Input Interface File (or other model input)
        * external_result_case_number: typically used to group various result cases, for example cases beloning to the same time history
        * load_case_name:            : user-defined via the Input Interface File (or other model input), or created by Sestra if not defined
        */
        virtual void StoreResultCaseData(int internal_result_case_number, int load_case_number, int external_result_case_number, System::String^ load_case_name) = 0;

        virtual void SetProgramVersion(System::String^ version) = 0;

        virtual void SetInputInterfaceFiles(System::String^ T_file, System::String^ L_file) = 0;
        /**
        * type = 0: info message
        * type = 1: warning message
        * type = 2: error message
        */
        virtual void StoreMessage(int type, System::String^ message) = 0;

        /**
        * type = 0: info message
        * type = 1: warning message
        * type = 2: error message
        *
        * Any call in the ISchurComplement interface other than Retrack will invoke FlushMessage(2) after any other call
        *
        */
        virtual void FlushMessage(int type) = 0;

        /* Any call in the ISestra interface and ISchurComplement::Retrack() interface will invoke Stop() after any other call. */
        void Stop() = 0;
    };
}}}