<commit_before>// This is free and unencumbered software released into the public domain.
// For more information, please refer to <http://unlicense.org/>

#ifndef SPANANALYZER_SPAN_ANALYZER_DOC_H_
#define SPANANALYZER_SPAN_ANALYZER_DOC_H_

#include <list>
#include <string>
#include <vector>

#include "models/base/units.h"
#include "models/transmissionline/hardware.h"
#include "models/transmissionline/line_structure.h"
#include "wx/docview.h"

#include "spananalyzer/analysis_controller.h"
#include "spananalyzer/span.h"

/// \par OVERVIEW
///
/// This class is a used when updating the view associated with the document.
class UpdateHint : public wxObject {
 public:
  /// This enum class contains types of update hints.
  enum class Type {
    kAnalysisFilterGroupEdit,
    kAnalysisFilterGroupSelect,
    kAnalysisFilterSelect,
    kCablesEdit,
    kPreferencesEdit,
    kSpansEdit,
    kViewSelect,
    kWeathercasesEdit
  };

  /// \brief Default Constructor.
  UpdateHint() {}

  /// \brief Alternate constructor.
  UpdateHint(Type hint) {type_ = hint;}

  /// \brief Sets the hint type.
  /// \param[in] type
  ///   The hint type.
  void set_type(const Type& type) {type_ = type;}

  /// \brief Gets the hint type.
  /// \return The hint type.
  const Type& type() const {return type_;}

 private:
  /// \var type_
  ///   The hint type.
  Type type_;
};

/// \par OVERVIEW
///
/// This is a SpanAnalyzer application document, which holds all of the
/// information for a SpanAnalyzer project file. It also holds all of the
/// sag-tension results that are calculated for the selected span.
///
/// \par SPANS
///
/// The document holds all of the spans that can be analyzed and allows them to
/// be edited. Once a span is activated, an analysis will be performed on it.
///
/// The span is connected to dummy structures. This is only for validation error
/// suppression.
///
/// \par SAG-TENSION ANALYSIS CONTROLLER
///
/// The document uses an analysis controller to handle the sag-tension
/// calculations and store the generated results for the selected span. The
/// results can be accessed via public functions.
///
/// \par APPLICATION DATA
///
/// There is application data that this document does not own. This data can be
/// modified outside of the document, so the document needs to be notified of
/// any data changes in order to update the analysis results.
///
/// \par UPDATES
///
/// The document and view(s) need to be updated when:
///  - The application data is changed
///  - The selected analysis span is changed
///
/// Most updates are done with the UpdateAllViews() method. There are also hints
/// that are passed along to help the view update. The document will handle most
/// of the updates for the selected span, but updates will need to be called
/// outside the document when the application data changes. See the function
/// declarations/definitions to see for sure.
///
/// \par wxWIDGETS LIBRARY BUILD NOTE
///
/// This class requires that the wxWidgets library deviate from the standard<commit_msg>SpanAnalyzerDoc documentation updated.<commit_after>// This is free and unencumbered software released into the public domain.
// For more information, please refer to <http://unlicense.org/>

#ifndef SPANANALYZER_SPAN_ANALYZER_DOC_H_
#define SPANANALYZER_SPAN_ANALYZER_DOC_H_

#include <list>
#include <string>
#include <vector>

#include "models/base/units.h"
#include "models/transmissionline/hardware.h"
#include "models/transmissionline/line_structure.h"
#include "wx/docview.h"

#include "spananalyzer/analysis_controller.h"
#include "spananalyzer/span.h"

/// \par OVERVIEW
///
/// This class is a used when updating the view associated with the document.
class UpdateHint : public wxObject {
 public:
  /// This enum class contains types of update hints.
  enum class Type {
    kAnalysisFilterGroupEdit,
    kAnalysisFilterGroupSelect,
    kAnalysisFilterSelect,
    kCablesEdit,
    kPreferencesEdit,
    kSpansEdit,
    kViewSelect,
    kWeathercasesEdit
  };

  /// \brief Default Constructor.
  UpdateHint() {}

  /// \brief Alternate constructor.
  UpdateHint(Type hint) {type_ = hint;}

  /// \brief Sets the hint type.
  /// \param[in] type
  ///   The hint type.
  void set_type(const Type& type) {type_ = type;}

  /// \brief Gets the hint type.
  /// \return The hint type.
  const Type& type() const {return type_;}

 private:
  /// \var type_
  ///   The hint type.
  Type type_;
};

/// \par OVERVIEW
///
/// This is a SpanAnalyzer application document, which holds all of the
/// information for a SpanAnalyzer project file. It also holds all of the
/// sag-tension results that are calculated for the selected span.
///
/// \par SPANS
///
/// The document holds all of the spans that can be analyzed and allows them to
/// be edited. Once a span is activated, an analysis will be performed on it.
///
/// The span is connected to dummy structures. This is only for validation error
/// suppression.
///
/// \par SAG-TENSION ANALYSIS CONTROLLER
///
/// The document uses an analysis controller to handle the sag-tension
/// calculations and store the generated results for the selected span. The
/// results can be accessed via public functions.
///
/// \par APPLICATION DATA
///
/// There is application data that this document does not own. This data can be
/// modified outside of the document, so the document needs to be notified of
/// any data changes in order to update the analysis results.
///
/// \par UPDATES
///
/// The document will automatically update itself for all span related changes.
/// However, the document will need to be manually updated when the application
/// data is changed. Document updates are done with the RunAnalysis() method.
///
/// All view updates must be manually posted. This makes it so that several
/// document changes can be made before the view is refreshed. View updates are
/// posted with the UpdateAllViews() method. Hints should be passed along to
/// help the view update properly.
///
/// \par wxWIDGETS LIBRARY BUILD NOTE
///
/// This class requires that the wxWidgets library deviate from the standard
{'fraction_non_alphanumeric': 0.10262685593082069, 'fraction_numerical': 0.0, 'mean_word_length': 3.081225033288948, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '659785', 'n_tokens_mistral': 1733, 'n_tokens_neox': 1695, 'n_words': 751}