<commit_before>/* Begin CVS Header
   $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/plot/CPlotItem.h,v $
   $Revision: 1.3 $
   $Name:  $
   $Author: ssahle $ 
   $Date: 2004/08/13 09:25:07 $
   End CVS Header */

/**
 *  
 */

#ifndef COPASI_PLOT_ITEM
#define COPASI_PLOT_ITEM

#include <string>
#include <vector>
#include "copasi.h"

#include "utilities/CCopasiParameterGroup.h"
#include "report/CCopasiObjectName.h" 
//#include "utilities/CCopasiVector.h"

class CPlotDataChannelSpec : public CCopasiObjectName
  {
  public:
    /**
     *  Minimum value of the data in this channel
     */
    C_FLOAT64 min;

    /**
     *  Maximum value of the data in this channel
     */
    C_FLOAT64 max;

    /**
     * Should autoscaling be attempted?
     */
    bool minAutoscale;
    bool maxAutoscale;

    CPlotDataChannelSpec()
        : CCopasiObjectName(),
        min(0.0),
        max(0.0),
        minAutoscale(true),
        maxAutoscale(true)
    {}

    CPlotDataChannelSpec(const CCopasiObjectName & obj)
        : CCopasiObjectName(obj),
        min(0.0),
        max(0.0),
        minAutoscale(true),
        maxAutoscale(true)
    {}

    CPlotDataChannelSpec(const CCopasiObjectName & obj, C_FLOAT64 minimum, C_FLOAT64 maximum)
        : CCopasiObjectName(obj),
        min(minimum),
        max(maximum),
        minAutoscale(false),
        maxAutoscale(false)
    {}};

//****************************************************************************************

class CPlotItem : public CCopasiParameterGroup
  {
  public:
    /**
     * Enumeration of the sub types of methods known to COPASI.
     */
    enum Type
    {
      unset = 0, curve2d,    //for plot items
      plot2d, simWiz   //for plot specifications
    };

    /**
     * String literals for the GUI to display sub type names of methods known
     * to COPASI.
     */
    static const std::string TypeName[];

    /**
     * XML sub type names of methods known to COPASI.
     */
    static const std::string XMLType[];

    // Attributes
  private:

    /**
     *  Key 
     */ 
    //    std::string mKey;

    /**
     * The type of the method
     */
    Type mType;

    std::vector<CPlotDataChannelSpec> channels;

    /**
     * Initialize the contained CCopasiObjects
     */
    void initObjects();

  public:
    CPlotItem(const std::string & name = "NoName",
              const CCopasiContainer * pParent = NULL,
              const CPlotItem::Type & type = curve2d);

    CPlotItem(const CPlotItem & src,
              const CCopasiContainer * pParent = NULL);

    /**
     * Destructor
     */
    virtual ~CPlotItem();

    void cleanup();

    /**
     * Convert a TypeName to the matching enum value.
     * Returns CPlotItem::unset if no match is found.
     * @param (const std::string & subTypeName)
     * @return CPlotItem::Type type
     */
    static
    CPlotItem::Type TypeNameToEnum(const std::string & typeName);

    /**
     * Convert a XMLType to the matching enum value
     * Returns CCopasiMethod::unset if no match is found.
     * @param (const char * xmlTypeName)
     * @return CCopasiMethod::SubType type
     */ 
    //static
    //CPlotItem::Type XMLNameToEnum(const char * xmlTypeName);
    static<commit_msg>Fixed to compile under Visual C++.<commit_after>/* Begin CVS Header
   $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/plot/CPlotItem.h,v $
   $Revision: 1.4 $
   $Name:  $
   $Author: shoops $ 
   $Date: 2004/08/13 21:12:37 $
   End CVS Header */

/**
 *  
 */

#ifndef COPASI_PLOT_ITEM
#define COPASI_PLOT_ITEM

#include <string>
#include <vector>
#include "copasi.h"

#include "utilities/CCopasiParameterGroup.h"
#include "report/CCopasiObjectName.h" 
//#include "utilities/CCopasiVector.h"

class CPlotDataChannelSpec : public CCopasiObjectName
  {
  public:
    /**
     *  Minimum value of the data in this channel
     */
    C_FLOAT64 min;

    /**
     *  Maximum value of the data in this channel
     */
    C_FLOAT64 max;

    /**
     * Should autoscaling be attempted?
     */
    bool minAutoscale;
    bool maxAutoscale;

    CPlotDataChannelSpec()
        : CCopasiObjectName(),
        min(0.0),
        max(0.0),
        minAutoscale(true),
        maxAutoscale(true)
    {}

    CPlotDataChannelSpec(const CCopasiObjectName & obj)
        : CCopasiObjectName(obj),
        min(0.0),
        max(0.0),
        minAutoscale(true),
        maxAutoscale(true)
    {}

    CPlotDataChannelSpec(const CCopasiObjectName & obj, C_FLOAT64 minimum, C_FLOAT64 maximum)
        : CCopasiObjectName(obj),
        min(minimum),
        max(maximum),
        minAutoscale(false),
        maxAutoscale(false)
    {}};

//****************************************************************************************

class CPlotItem : public CCopasiParameterGroup
  {
  public:
    /**
     * Enumeration of the sub types of methods known to COPASI.
     */
    enum Type
    {
      unset = 0, curve2d,     //for plot items
      plot2d, simWiz   //for plot specifications
    };

    /**
     * String literals for the GUI to display sub type names of methods known
     * to COPASI.
     */
    static const std::string TypeName[];

    /**
     * XML sub type names of methods known to COPASI.
     */
    static const std::string XMLType[];

    // Attributes
  private:

    /**
     *  Key 
     */ 
    //    std::string mKey;

    /**
     * The type of the method
     */
    Type mType;

    std::vector<CPlotDataChannelSpec> channels;

    /**
     * Initialize the contained CCopasiObjects
     */
    void initObjects();

  public:
    CPlotItem(const std::string & name = "NoName",
              const CCopasiContainer * pParent = NULL,
              const Type & type = curve2d);

    CPlotItem(const CPlotItem & src,
              const CCopasiContainer * pParent = NULL);

    /**
     * Destructor
     */
    virtual ~CPlotItem();

    void cleanup();

    /**
     * Convert a TypeName to the matching enum value.
     * Returns CPlotItem::unset if no match is found.
     * @param (const std::string & subTypeName)
     * @return CPlotItem::Type type
     */
    static
    CPlotItem::Type TypeNameToEnum(const std::string & typeName);

    /**
     * Convert a XMLType to the matching enum value
     * Returns CCopasiMethod::unset if no match is found.
     * @param (const char * xmlTypeName)
     * @return CCopasiMethod::SubType type
     */ 
    //static
    //CPlotItem::Type XMLNameToEnum(const char * xmlTypeName);
    static
{'fraction_non_alphanumeric': 0.1333435629891054, 'fraction_numerical': 0.01104802823384993, 'mean_word_length': 2.3221202854230376, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '3674829', 'n_tokens_mistral': 2166, 'n_tokens_neox': 2037, 'n_words': 508}