MVE - Multi-View Environment
mve-devel
Loading...
Searching...
No Matches
libs
fssr
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
18
FSSR_NAMESPACE_BEGIN
19
37
struct
VoxelIndex
38
{
39
public
:
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
49
public
:
50
uint64_t
index
;
51
};
52
53
/* --------------------------------------------------------------------- */
54
60
struct
VoxelData
61
{
62
public
:
63
VoxelData
(
void
);
64
65
public
:
66
float
value
;
67
float
conf
;
68
float
scale
;
69
math::Vec3f
color
;
70
#if FSSR_USE_DERIVATIVES
71
math::Vec3f
deriv
;
72
#endif
// FSSR_USE_DERIVATIVES
73
};
74
75
/* --------------------------------------------------------------------- */
76
82
VoxelData
83
interpolate_voxel
(
VoxelData
const
& d1,
float
w1,
84
VoxelData
const
& d2,
float
w2);
85
86
FSSR_NAMESPACE_END
87
88
/* ------------------------- Implementation ---------------------------- */
89
90
FSSR_NAMESPACE_BEGIN
91
92
inline
bool
93
VoxelIndex::operator< (
VoxelIndex
const
& other)
const
94
{
95
return
this->index < other.
index
;
96
}
97
98
inline
99
VoxelData::VoxelData (
void
)
100
: value(0.0f)
101
, conf(0.0f)
102
, scale(0.0f)
103
, color(0.0f)
104
{
105
}
106
107
FSSR_NAMESPACE_END
108
109
#endif
/* FSSR_VOXEL_HEADER */
math::Vector< double, 3 >
defines.h
FSSR_NAMESPACE_END
#define FSSR_NAMESPACE_END
Definition
defines.h:14
FSSR_NAMESPACE_BEGIN
#define FSSR_NAMESPACE_BEGIN
Definition
defines.h:13
fssr::interpolate_voxel
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
octree.h
fssr::VoxelData
Stores per voxel data.
Definition
voxel.h:61
fssr::VoxelData::conf
float conf
Definition
voxel.h:67
fssr::VoxelData::color
math::Vec3f color
Definition
voxel.h:69
fssr::VoxelData::value
float value
Definition
voxel.h:66
fssr::VoxelData::deriv
math::Vec3f deriv
Definition
voxel.h:71
fssr::VoxelData::scale
float scale
Definition
voxel.h:68
fssr::VoxelIndex
The voxel index is a unique 64 bit ID for each voxel in the octree.
Definition
voxel.h:38
fssr::VoxelIndex::index
uint64_t index
Definition
voxel.h:50
Generated on Thu Dec 21 2023 01:53:38 for MVE - Multi-View Environment by
1.9.8