Blue Brain BioExplorer
Field.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2023, EPFL/Blue Brain Project
3  * All rights reserved. Do not distribute without permission.
4  * Responsible Author: Daniel Nachbaur <daniel.nachbaur@epfl.ch>
5  *
6  * This file is part of Blue Brain BioExplorer <https://github.com/BlueBrain/BioExplorer>
7  *
8  * This library is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU Lesser General Public License version 3.0 as published
10  * by the Free Software Foundation.
11  *
12  * This library is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
15  * details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this library; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21 
22 #pragma once
23 
27 
29 
30 namespace core
31 {
36 class Field : public PropertyObject
37 {
38 public:
48  PLATFORM_API Field(const FieldParameters& parameters, const Vector3ui& dimensions, const Vector3f& spacing,
49  const Vector3f& offset, const uint32_ts& indices, const floats& values,
50  const OctreeDataType dataType)
51  : _parameters(parameters)
52  , _dimensions(dimensions)
53  , _spacing(spacing)
54  , _offset(offset)
55  , _octreeIndices(indices)
56  , _octreeValues(values)
57  , _octreeDataType(dataType)
58  {
59  }
60 
66 
73 
80 
86  PLATFORM_API Vector3f getOffset() const { return _offset; }
87 
94 
101 
108 
109 protected:
110  // Octree
118 
119 private:
120  SERIALIZATION_FRIEND(Field);
121 };
122 } // namespace core
#define PLATFORM_API
Definition: Api.h:37
#define SERIALIZATION_ACCESS(type)
Definition: Macros.h:25
A field is volume in which voxels are computed in real-time using a pre-loaded Octree structure of ev...
Definition: Field.h:37
PLATFORM_API Field(const FieldParameters &parameters, const Vector3ui &dimensions, const Vector3f &spacing, const Vector3f &offset, const uint32_ts &indices, const floats &values, const OctreeDataType dataType)
Constructs a new Field object.
Definition: Field.h:48
Vector3i _dimensions
Definition: Field.h:111
OctreeDataType _octreeDataType
Definition: Field.h:116
PLATFORM_API Vector3f getElementSpacing() const
Get the Element Spacing object.
Definition: Field.h:79
PLATFORM_API const uint32_ts & getOctreeIndices() const
Get the Octree Indices object.
Definition: Field.h:93
PLATFORM_API OctreeDataType getOctreeDataType() const
Get the Octree Data Type object.
Definition: Field.h:107
Vector3f _offset
Definition: Field.h:113
PLATFORM_API const floats & getOctreeValues() const
Get the Octree Values object.
Definition: Field.h:100
const FieldParameters & _parameters
Definition: Field.h:117
floats _octreeValues
Definition: Field.h:115
PLATFORM_API Vector3i getDimensions() const
Get the Dimensions object.
Definition: Field.h:72
PLATFORM_API Boxd getBounds() const
Gets the bounding box of the field.
Definition: Field.h:65
PLATFORM_API Vector3f getOffset() const
Get the Offset object.
Definition: Field.h:86
Vector3f _spacing
Definition: Field.h:112
uint32_ts _octreeIndices
Definition: Field.h:114
glm::vec3 Vector3f
Definition: MathTypes.h:137
glm::vec< 3, uint32_t > Vector3ui
Definition: MathTypes.h:134
glm::vec< 3, int32_t > Vector3i
Definition: MathTypes.h:131
OctreeDataType
Definition: CommonTypes.h:66
std::vector< uint32_t > uint32_ts
Definition: Types.h:53
std::vector< float > floats
Definition: Types.h:45