~ubuntu-branches/ubuntu/vivid/travis/vivid-proposed

« back to all changes in this revision

Viewing changes to src/sdfmap.h

  • Committer: Package Import Robot
  • Author(s): Daniel Leidert, Daniel Leidert, Michael Banck
  • Date: 2014-09-22 10:00:17 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20140922100017-voentkpft033vxa6
Tags: 140902-1
* New upstream release.

[ Daniel Leidert ]
* debian/copyright: Updated.
* debian/upstream: Renamed to debian/upstream/metadata.

[ Michael Banck ]
* debian/travis.1: Add LAMMPS and DLPOLY to trajectory filetypes and
  document -stream option.
* debian/control (Description): List supported fileteypes and
  available analysis features.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*****************************************************************************
 
2
    TRAVIS - Trajectory Analyzer and Visualizer
 
3
    http://www.travis-analyzer.de/
 
4
 
 
5
    Copyright (c) 2009-2014 Martin Brehm
 
6
                  2012-2014 Martin Thomas
 
7
 
 
8
    This file written by Martin Brehm.
 
9
 
 
10
    This program is free software: you can redistribute it and/or modify
 
11
    it under the terms of the GNU General Public License as published by
 
12
    the Free Software Foundation, either version 3 of the License, or
 
13
    (at your option) any later version.
 
14
 
 
15
    This program is distributed in the hope that it will be useful,
 
16
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
18
    GNU General Public License for more details.
 
19
 
 
20
    You should have received a copy of the GNU General Public License
 
21
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
22
*****************************************************************************/
 
23
 
 
24
#ifndef SDFMAP_H
 
25
#define SDFMAP_H
 
26
 
 
27
 
 
28
#include "xobject.h"
 
29
#include "xobarray.h"
 
30
#include "3df.h"
 
31
#include "timestep.h"
 
32
 
 
33
 
 
34
class CSDFMap : public CxObject
 
35
{
 
36
public:
 
37
        CSDFMap();
 
38
        ~CSDFMap();
 
39
 
 
40
        void Parse();
 
41
        void Create();
 
42
        void Process(int rm, CTimeStep *ts);
 
43
        void BuildName();
 
44
        void Finish();
 
45
 
 
46
        int m_iQuantity;
 
47
        bool m_bModeMin;
 
48
        bool m_bModeMax;
 
49
        bool m_bModeAvg;
 
50
 
 
51
        CxObArray m_oaAtomGroups;
 
52
 
 
53
        int m_iResolution;
 
54
        float m_fRadius;
 
55
        bool m_bSphere;
 
56
        int m_iSphereRadius;
 
57
 
 
58
        C3DF *m_pValueMin;
 
59
        C3DF *m_pValueMax;
 
60
        C3DF *m_pValueAvg;
 
61
        C3DF *m_pCount;
 
62
        char *m_sName;
 
63
        char *m_sSubName;
 
64
 
 
65
 
 
66
        inline void AddValue(double x, double y, double z, double v)
 
67
        {
 
68
                if (m_bModeAvg)
 
69
                        m_pValueAvg->AddToBin_Single(x,y,z,v);
 
70
 
 
71
                if (m_bModeMax)
 
72
                        if (v > m_pValueMax->GetBinValue_Single(x,y,z))
 
73
                                m_pValueMax->SetBinValue_Single(x,y,z,v);
 
74
 
 
75
                if (m_bModeMin)
 
76
                {
 
77
                        if ((m_pCount->GetBinValue_Single(x,y,z) == 0) || (v < m_pValueMin->GetBinValue_Single(x,y,z)))
 
78
                                m_pValueMin->SetBinValue_Single(x,y,z,v);
 
79
                }
 
80
 
 
81
                m_pCount->AddToBin_Single(x,y,z,1.0);
 
82
        }
 
83
 
 
84
};
 
85
 
 
86
 
 
87
#endif
 
88
 
 
89