Blue Brain BioExplorer
Curve.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2018, EPFL/Blue Brain Project
3
* All rights reserved. Do not distribute without permission.
4
* Responsible Author: Jonas Karlsson <jonas.karlsson@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
24
#include <
platform/core/common/Types.h
>
25
26
namespace
core
27
{
28
enum class
CurveType
29
{
30
flat
= 0,
31
round
= 1,
32
ribbon
= 2
33
};
34
35
enum class
BaseType
36
{
37
linear
= 0,
38
bezier
= 1,
39
bspline
= 2,
40
hermite
= 3
41
};
42
43
inline
std::string
baseTypeAsString
(
const
BaseType
baseType)
44
{
45
const
strings
values = {
"linear"
,
"bezier"
,
"bspline"
,
"hermite"
};
46
return
values[
static_cast<
size_t
>
(baseType)];
47
};
48
49
inline
std::string
curveTypeAsString
(
const
CurveType
curveType)
50
{
51
const
strings
values = {
"flat"
,
"round"
,
"ribbon"
};
52
return
values[
static_cast<
size_t
>
(curveType)];
53
};
54
55
struct
Curve
56
{
57
Curve
(
const
CurveType
curveType_in,
const
BaseType
baseType_in,
const
Vector4fs
& vertices_in,
58
const
uint64_ts
& indices_in,
const
Vector3fs
& normals_in,
const
Vector3fs
& tangents_in)
59
:
curveType
(curveType_in)
60
,
baseType
(baseType_in)
61
,
vertices
(vertices_in)
62
,
indices
(indices_in)
63
,
normals
(normals_in)
64
,
tangents
(tangents_in)
65
{
66
}
67
68
// Curve type: falt, round, ribbon
69
CurveType
curveType
;
70
71
// Base type: linear, bezier, bspline, hermite
72
BaseType
baseType
;
73
74
// Vertices
75
Vector4fs
vertices
;
76
77
// Indices
78
uint64_ts
indices
;
79
80
// Normals (for ribbon curves)
81
Vector3fs
normals
;
82
83
// Tangents (for hermite curves)
84
Vector3fs
tangents
;
85
};
86
}
// namespace core
core
Definition:
BaseWindow.cpp:53
core::Vector4fs
std::vector< Vector4f > Vector4fs
Definition:
MathTypes.h:140
core::BaseType
BaseType
Definition:
Curve.h:36
core::BaseType::bspline
@ bspline
core::BaseType::hermite
@ hermite
core::BaseType::linear
@ linear
core::BaseType::bezier
@ bezier
core::CurveType
CurveType
Definition:
Curve.h:29
core::CurveType::flat
@ flat
core::CurveType::round
@ round
core::CurveType::ribbon
@ ribbon
core::baseTypeAsString
std::string baseTypeAsString(const BaseType baseType)
Definition:
Curve.h:43
core::curveTypeAsString
std::string curveTypeAsString(const CurveType curveType)
Definition:
Curve.h:49
core::Vector3fs
std::vector< Vector3f > Vector3fs
Definition:
MathTypes.h:139
Types.h
strings
std::vector< std::string > strings
Definition:
Types.h:44
uint64_ts
std::vector< uint64_t > uint64_ts
Definition:
Types.h:55
core::Curve
Definition:
Curve.h:56
core::Curve::indices
uint64_ts indices
Definition:
Curve.h:78
core::Curve::baseType
BaseType baseType
Definition:
Curve.h:72
core::Curve::tangents
Vector3fs tangents
Definition:
Curve.h:84
core::Curve::Curve
Curve(const CurveType curveType_in, const BaseType baseType_in, const Vector4fs &vertices_in, const uint64_ts &indices_in, const Vector3fs &normals_in, const Vector3fs &tangents_in)
Definition:
Curve.h:57
core::Curve::normals
Vector3fs normals
Definition:
Curve.h:81
core::Curve::vertices
Vector4fs vertices
Definition:
Curve.h:75
core::Curve::curveType
CurveType curveType
Definition:
Curve.h:69
platform
core
common
geometry
Curve.h
Generated by
1.9.1