Candidate_v1.7.0
        stable
      
      
        
          | 
            Last change
 on this file since 91c409 was             9eb71b3, checked in by Frederik Heber <frederik.heber@…>, 9 years ago           | 
        
        
          | 
             
Commented out MemDebug include and Memory::ignore. 
 
- MemDebug clashes with various allocation operators that use a specific
placement in memory. It is so far not possible to wrap new/delete fully.
Hence, we stop this effort which so far has forced us to put ever more
includes (with clashes) into MemDebug and thereby bloat compilation time.
 - MemDebug does not add that much usefulness which is not also provided by
valgrind.
  
           | 
        
        
          
            
              - 
Property                 mode
 set to                 
100644
               
             
           | 
        
        
          | 
            File size:
            1.5 KB
           | 
        
      
      
| Rev | Line |   | 
|---|
| [35302b] | 1 | /*
 | 
|---|
 | 2 |  * QSeisPlotCurve.cpp
 | 
|---|
 | 3 |  *
 | 
|---|
 | 4 |  *  Created on: Jan 30, 2011
 | 
|---|
 | 5 |  *      Author: landvogt
 | 
|---|
 | 6 |  */
 | 
|---|
 | 7 | 
 | 
|---|
 | 8 | // include config.h
 | 
|---|
 | 9 | #ifdef HAVE_CONFIG_H
 | 
|---|
 | 10 | #include <config.h>
 | 
|---|
 | 11 | #endif
 | 
|---|
 | 12 | 
 | 
|---|
 | 13 | #include "UIElements/Views/Qt4/Plotting/QSeisPlotCurve.hpp"
 | 
|---|
 | 14 | #include "UIElements/Views/Qt4/Plotting/QSeisPlot.hpp"
 | 
|---|
 | 15 | 
 | 
|---|
 | 16 | // have this after(!) all Qt includes
 | 
|---|
| [9eb71b3] | 17 | //#include "CodePatterns/MemDebug.hpp"
 | 
|---|
| [35302b] | 18 | 
 | 
|---|
 | 19 | #include "CodePatterns/Assert.hpp"
 | 
|---|
 | 20 | 
 | 
|---|
 | 21 | 
 | 
|---|
 | 22 | QSeisPlotCurve::QSeisPlotCurve(QString name, QString dataType, bool preparsed) :
 | 
|---|
 | 23 |         type(dataType), intName(name), onlyPreparsed(preparsed), upToDate(true)
 | 
|---|
 | 24 | {}
 | 
|---|
 | 25 | 
 | 
|---|
 | 26 | QSeisPlotCurve::~QSeisPlotCurve()
 | 
|---|
 | 27 | {
 | 
|---|
 | 28 |     detach();
 | 
|---|
 | 29 | }
 | 
|---|
 | 30 | 
 | 
|---|
 | 31 | std::string QSeisPlotCurve::getName()
 | 
|---|
 | 32 | {
 | 
|---|
 | 33 |     return intName.toStdString();
 | 
|---|
 | 34 | }
 | 
|---|
 | 35 | 
 | 
|---|
 | 36 | void QSeisPlotCurve::updateCurve(QwtData *newData)
 | 
|---|
 | 37 | {
 | 
|---|
 | 38 |     setTitle(intName.right(intName.length() - intName.lastIndexOf('/') - 1));
 | 
|---|
 | 39 |     setData(*newData);
 | 
|---|
 | 40 |     upToDate = true;
 | 
|---|
 | 41 |     if (plot() != NULL)
 | 
|---|
 | 42 |         plot()->replot();
 | 
|---|
 | 43 | }
 | 
|---|
 | 44 | 
 | 
|---|
 | 45 | void QSeisPlotCurve::attach(QSeisPlot *plot)
 | 
|---|
 | 46 | {
 | 
|---|
 | 47 |     //check if already all data is present or if we have to request it
 | 
|---|
 | 48 |     if (onlyPreparsed || !upToDate)
 | 
|---|
 | 49 |     {
 | 
|---|
 | 50 |         onlyPreparsed = false;
 | 
|---|
 | 51 |         emit dataRequested();
 | 
|---|
 | 52 |     }
 | 
|---|
 | 53 |     setPen(QPen(plot->getCurveColor(color)));
 | 
|---|
 | 54 |     QwtPlotCurve::attach((QwtPlot *)plot);
 | 
|---|
 | 55 | }
 | 
|---|
 | 56 | 
 | 
|---|
 | 57 | void QSeisPlotCurve::detach()
 | 
|---|
 | 58 | {
 | 
|---|
 | 59 |     if (plot() == NULL)
 | 
|---|
 | 60 |         return;
 | 
|---|
 | 61 | 
 | 
|---|
 | 62 |     ((QSeisPlot *)plot())->freeCurveColor(pen().color());
 | 
|---|
 | 63 |     QwtPlotCurve::detach();
 | 
|---|
 | 64 | }
 | 
|---|
 | 65 | 
 | 
|---|
 | 66 | void QSeisPlotCurve::markAsOutOfDate()
 | 
|---|
 | 67 | {
 | 
|---|
 | 68 |     upToDate = false;
 | 
|---|
 | 69 |     if (plot() != NULL)
 | 
|---|
 | 70 |         emit dataRequested();
 | 
|---|
 | 71 | }
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.