Evita  0.16
evFeatureCompositor.h
Go to the documentation of this file.
1 /*
2  *
3  * EVITA: Efficient Visualization of Terascale Datasets
4  * Copyright (C) 2000-2016 Team Evita
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
19  * MA 02139, USA.
20  *
21  */
22 
23 
24 #ifndef __evFeatureCompositor_h
25 #define __evFeatureCompositor_h
26 
27 
28 #include "evProcessObject.h"
29 #include "evScalarField.h"
30 
31 #include <list>
32 
33 
35 {
36 public:
38  {
39  this->Initialize();
40  }
41  virtual ~evFeatureCompositor(void)
42  { }
43 
44  virtual const evString GetClassName(void) const
45  {
46  return(evString("evFeatureCompositor"));
47  }
48 
49  virtual int AddFeature(const evScalarField &significance_map);
50 
51  virtual int Composite(evScalarField &significance_map) const = 0;
52 
53 protected:
54 
55  typedef const evScalarField *evFeatureField;
56 
57  unsigned int GetNumberOfFields(void) const;
58  evFeatureField operator [] (const int index) const
59  {
60  return(this->CompositeList[index]);
61  }
62 
63 private:
64 
65  std::vector<evFeatureField> CompositeList;
66 
67  void Initialize(void);
68 
69 };
70 
71 
73 {
74 }
75 
76 
77 inline unsigned int evFeatureCompositor::GetNumberOfFields(void) const
78 {
79  return(this->CompositeList.size());
80 }
81 
82 
84  &significance_map)
85 {
86  if (this->CompositeList.size() > 1)
87  if (significance_map.GetSize() !=
88  ((const evScalarField *)(this->CompositeList.back()))->GetSize())
89  {
90  ErrorHandler.ErrorMessage("evFeatureCompositor::AddFeature(): Significance map must be same size as others in the composite list");
91  return(1);
92  }
93 
94  this->CompositeList.push_back(&significance_map);
95 
96  return(0);
97 }
98 
99 
100 #endif
virtual ~evFeatureCompositor(void)
Definition: evFeatureCompositor.h:41
void Initialize(void)
Definition: evFeatureCompositor.h:72
unsigned int GetNumberOfFields(void) const
Definition: evFeatureCompositor.h:77
virtual int AddFeature(const evScalarField &significance_map)
Definition: evFeatureCompositor.h:83
virtual int Composite(evScalarField &significance_map) const =0
std::vector< evFeatureField > CompositeList
Definition: evFeatureCompositor.h:65
evFeatureField operator[](const int index) const
Definition: evFeatureCompositor.h:58
evFeatureCompositor(void)
Definition: evFeatureCompositor.h:37
Definition: evFeatureCompositor.h:34
evErrorHandler ErrorHandler
unsigned int GetSize(const unsigned int index) const
Definition: evField.h:285
void ErrorMessage(const char *format,...)
virtual const evString GetClassName(void) const
Definition: evFeatureCompositor.h:44
Definition: evScalarField.h:31
Definition: evProcessObject.h:31
const evScalarField * evFeatureField
Definition: evFeatureCompositor.h:55
Definition: evString.h:30