Evita  0.16
evVectorField.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 __evVectorField_h
25 #define __evVectorField_h
26 
27 
28 #include "evScalarField.h"
29 #include "evVector.h"
30 
31 
32 class evVectorField : public evField<evVector>
33 {
34 public:
35  evVectorField(void);
36  evVectorField(const evAddress &size, const unsigned int vector_dimension);
37  virtual ~evVectorField(void)
38  { }
39 
40  int SetSize(const evAddress &size,
41  const unsigned int vector_dimension = 0,
42  const bool allocate = 1);
43  int Resize(const evAddress &size,
44  const unsigned int vector_dimension = 0,
45  const bool linear = 0);
46  int Copy(const evVectorField &field);
47 
48  unsigned int GetVectorDimension(void) const;
49 
51  int GetField(evScalarField &field, const unsigned int component) const;
52 
54  int PutField(const evScalarField &field, const unsigned int component);
55 
56  double GetFieldMax(void) const;
57  double GetFieldMin(void) const;
58  double GetFieldMaxNorm(void) const;
59  double GetFieldMinNorm(void) const;
60  evVector GetFieldMean(void) const;
61  int GetFieldHighestBitplane(void) const;
62 
63  void Scale(const double scale);
64 
65 protected:
66 
67 private:
68  evVectorField(const evVectorField &vector_field);
69 };
70 
71 
73 {
74 }
75 
76 
78  const unsigned int vector_dimension)
79 {
80  this->SetSize(size, vector_dimension);
81 }
82 
83 
84 inline unsigned int evVectorField::GetVectorDimension(void) const
85 {
86  if (this->Field.empty())
87  return(0);
88 
89  return(this->Field[0].Dimension());
90 }
91 
92 
93 inline void evVectorField::Scale(const double scale)
94 {
95  for (unsigned int index = 0; index < this->Field.size(); index++)
96  this->Field[index] *= scale;
97 }
98 
99 
100 #endif
int SetSize(const evAddress &size, const unsigned int vector_dimension=0, const bool allocate=1)
evVectorField(void)
Definition: evVectorField.h:72
int PutField(const evScalarField &field, const unsigned int component)
unsigned int GetVectorDimension(void) const
Definition: evVectorField.h:84
double GetFieldMin(void) const
Definition: evVector.h:36
void Scale(const double scale)
Definition: evVectorField.h:93
Definition: evAddress.h:37
double GetFieldMaxNorm(void) const
double GetFieldMax(void) const
evVector GetFieldMean(void) const
std::vector< evVector > Field
Definition: evField.h:125
Definition: evVectorField.h:32
Definition: evField.h:34
int Copy(const evVectorField &field)
virtual ~evVectorField(void)
Definition: evVectorField.h:37
int Resize(const evAddress &size, const unsigned int vector_dimension=0, const bool linear=0)
int GetField(evScalarField &field, const unsigned int component) const
double GetFieldMinNorm(void) const
Definition: evScalarField.h:31
int GetFieldHighestBitplane(void) const