Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenMesh
OpenMesh
Commits
0d619f33
Commit
0d619f33
authored
Nov 10, 2015
by
Hans-Christian Ebke
Browse files
C++11: Create version of homogenized() for C++11 branch (without macros).
parent
dfcc98c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/OpenMesh/Core/Geometry/VectorT_inc.hh
View file @
0d619f33
...
...
@@ -107,6 +107,17 @@ public:
typename
=
typename
std
::
enable_if
<
are_convertible_to
<
float
,
T
...
>::
value
>::
type
>
constexpr
VectorT
(
T
...
vs
)
:
Base
{
static_cast
<
Scalar
>
(
vs
)...}
{
}
template
<
int
D
=
DIM
,
typename
=
typename
std
::
enable_if
<
D
==
DIM
>
::
type
>
typename
std
::
enable_if
<
D
==
4
,
VectorT
>::
type
homogenized
()
const
{
return
VectorT
(
Base
::
values_
[
0
]
/
Base
::
values_
[
3
],
Base
::
values_
[
1
]
/
Base
::
values_
[
3
],
Base
::
values_
[
2
]
/
Base
::
values_
[
3
],
1
);
}
#else
/// special constructor for 1D vectors
explicit
inline
VectorT
(
const
Scalar
&
v
)
{
...
...
@@ -136,7 +147,7 @@ public:
Base
::
values_
[
0
]
=
v0
;
Base
::
values_
[
1
]
=
v1
;
Base
::
values_
[
2
]
=
v2
;
Base
::
values_
[
3
]
=
v3
;
}
VectorT
homogenized
()
{
return
VectorT
(
Base
::
values_
[
0
]
/
Base
::
values_
[
3
],
Base
::
values_
[
1
]
/
Base
::
values_
[
3
],
Base
::
values_
[
2
]
/
Base
::
values_
[
3
],
1
);
}
VectorT
homogenized
()
const
{
return
VectorT
(
Base
::
values_
[
0
]
/
Base
::
values_
[
3
],
Base
::
values_
[
1
]
/
Base
::
values_
[
3
],
Base
::
values_
[
2
]
/
Base
::
values_
[
3
],
1
);
}
#endif
#if DIM == 5
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment