MVE - Multi-View Environment mve-devel
Loading...
Searching...
No Matches
voxel.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2015, Simon Fuhrmann
3 * TU Darmstadt - Graphics, Capture and Massively Parallel Computing
4 * All rights reserved.
5 *
6 * This software may be modified and distributed under the terms
7 * of the BSD 3-Clause license. See the LICENSE.txt file for details.
8 */
9
10#ifndef FSSR_VOXEL_HEADER
11#define FSSR_VOXEL_HEADER
12
13#include <cstdint>
14
15#include "fssr/defines.h"
16#include "fssr/octree.h"
17
19
38{
39public:
41 void from_path_and_corner (uint8_t level, uint64_t path, int corner);
43 math::Vec3d compute_position (math::Vec3d const& center, double size) const;
44 int32_t get_offset_x (void) const;
45 int32_t get_offset_y (void) const;
46 int32_t get_offset_z (void) const;
47 bool operator< (VoxelIndex const& other) const;
48
49public:
50 uint64_t index;
51};
52
53/* --------------------------------------------------------------------- */
54
61{
62public:
63 VoxelData (void);
64
65public:
66 float value;
67 float conf;
68 float scale;
70#if FSSR_USE_DERIVATIVES
72#endif // FSSR_USE_DERIVATIVES
73};
74
75/* --------------------------------------------------------------------- */
76
83interpolate_voxel (VoxelData const& d1, float w1,
84 VoxelData const& d2, float w2);
85
87
88/* ------------------------- Implementation ---------------------------- */
89
91
92inline bool
93VoxelIndex::operator< (VoxelIndex const& other) const
94{
95 return this->index < other.index;
96}
97
98inline
99VoxelData::VoxelData (void)
100 : value(0.0f)
101 , conf(0.0f)
102 , scale(0.0f)
103 , color(0.0f)
104{
105}
106
108
109#endif /* FSSR_VOXEL_HEADER */
#define FSSR_NAMESPACE_END
Definition defines.h:14
#define FSSR_NAMESPACE_BEGIN
Definition defines.h:13
VoxelData interpolate_voxel(VoxelData const &d1, float w1, VoxelData const &d2, float w2)
Interpolates between two VoxelData objects for Marching Cubes.
Definition voxel.cc:74
Stores per voxel data.
Definition voxel.h:61
float conf
Definition voxel.h:67
math::Vec3f color
Definition voxel.h:69
float value
Definition voxel.h:66
math::Vec3f deriv
Definition voxel.h:71
float scale
Definition voxel.h:68
The voxel index is a unique 64 bit ID for each voxel in the octree.
Definition voxel.h:38
uint64_t index
Definition voxel.h:50