Exemple #1
0
//---------------------------------------------------------------
IsoLine::IsoLine(double val, const GribRecord *rec_)
{
    value = val;

    rec = rec_;
    W = rec->getNi();
    H = rec->getNj();

    //---------------------------------------------------------
    // Génère la liste des segments.
    extractIsoLine(rec);

    if(trace.size() == 0)
          return;

    //      Join the isoline segments into a nice list
    //      Which is end-to-end continuous and unidirectional

    //      Create a master wxList of the trace list
    std::list<Segment *>::iterator it;
    for (it=trace.begin(); it!=trace.end(); it++)
    {
          Segment *seg = *it;
          seg->bUsed = false;
          m_seglist.Append(*it);
    }

    //      Isoline may be discontinuous....
    //      So build a list of continuous segments
    bool bdone = false;
    while(!bdone)
    {
          MySegList *ps = BuildContinuousSegment();

          m_SegListList.Append(ps);

          MySegList::Node *node;
          Segment *seg;

          // recreate the master list, removing used segs

          node = m_seglist.GetFirst();
          while(node)
          {
                seg = node->GetData();
                if(seg->bUsed)
                {
                      m_seglist.Erase(node);
                      node = m_seglist.GetFirst();
                }
                else
                      node = node->GetNext();
          }

          if(0 == m_seglist.GetCount())
                bdone = true;
    }

///printf("create Isobar : press=%4.0f long=%d\n", pressure/100, trace.size());
}
Exemple #2
0
//---------------------------------------------------------------
IsoLine::IsoLine (DataCode dtc, double val, GriddedRecord *rec, int deltaI, int deltaJ)
{
    this->rec    = rec;
    this->value  = val;
	this->dtc    = dtc;
	
    W = rec->getNi();
    H = rec->getNj();
    int gr = 80;
    isoLineColor = QColor(gr,gr,gr);
    //---------------------------------------------------------
    // Génère la liste des segments.
    extractIsoLine (rec, deltaI, deltaJ);
}
Exemple #3
0
//---------------------------------------------------------------
IsoLine::IsoLine(double val, double coeff, double offset, const GribRecord *rec_)
{
    if(wxGetDisplaySize().x > 0){
        m_pixelMM = PlugInGetDisplaySizeMM() / wxGetDisplaySize().x;
        m_pixelMM = wxMax(.02, m_pixelMM);          // protect against bad data
    }
    else
        m_pixelMM = 0.27;               // semi-standard number...

    value = val/coeff-offset;

    rec = rec_;
    W = rec_->getNi();
    H = rec_->getNj();

    //---------------------------------------------------------
    // Génère la liste des segments.
    extractIsoLine(rec_);

    value = val;

    if(trace.size() == 0)
          return;

    //      Join the isoline segments into a nice list
    //      Which is end-to-end continuous and unidirectional

    //      Create a master wxList of the trace list
    std::list<Segment *>::iterator it;
    for (it=trace.begin(); it!=trace.end(); it++)
    {
          Segment *seg = *it;
          seg->bUsed = false;
          m_seglist.Append(*it);
    }

    //      Isoline may be discontinuous....
    //      So build a list of continuous segments
    bool bdone = false;
    while(!bdone)
    {
          MySegList *ps = BuildContinuousSegment();

          m_SegListList.Append(ps);

          MySegList::Node *node;
          Segment *seg;

          // recreate the master list, removing used segs

          node = m_seglist.GetFirst();
          while(node)
          {
                seg = node->GetData();
                if(seg->bUsed)
                {
                      m_seglist.Erase(node);
                      node = m_seglist.GetFirst();
                }
                else
                      node = node->GetNext();
          }

          if(0 == m_seglist.GetCount())
                bdone = true;
    }

///printf("create Isobar : press=%4.0f long=%d\n", pressure/100, trace.size());
}