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
4eab0532
Commit
4eab0532
authored
Apr 12, 2018
by
Christian Mattes
Browse files
Added free functions for non-C++11 Vectors
parent
f12ca3fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/OpenMesh/Core/Geometry/VectorT.hh
View file @
4eab0532
...
...
@@ -264,7 +264,6 @@ dot(const VectorT<Scalar,N>& _v1, const VectorT<Scalar,N>& _v2) {
return
(
_v1
|
_v2
);
}
/// \relates OpenMesh::VectorT
/// symmetric version of the cross product
template
<
typename
Scalar
,
int
N
>
...
...
@@ -273,8 +272,46 @@ cross(const VectorT<Scalar,N>& _v1, const VectorT<Scalar,N>& _v2) {
return
(
_v1
%
_v2
);
}
/// \relates OpenMesh::VectorT
/// non-member norm
template
<
typename
Scalar
,
int
DIM
>
Scalar
norm
(
const
VectorT
<
Scalar
,
DIM
>&
_v
)
{
return
_v
.
norm
();
}
/// \relates OpenMesh::VectorT
/// non-member sqrnorm
template
<
typename
Scalar
,
int
DIM
>
Scalar
sqrnorm
(
const
VectorT
<
Scalar
,
DIM
>&
_v
)
{
return
_v
.
sqrnorm
();
}
/// \relates OpenMesh::VectorT
/// non-member vectorize
template
<
typename
Scalar
,
int
DIM
,
typename
OtherScalar
>
VectorT
<
Scalar
,
DIM
>&
vectorize
(
VectorT
<
Scalar
,
DIM
>&
_v
,
OtherScalar
const
&
_val
)
{
return
_v
.
vectorize
(
_val
);
}
/// \relates OpenMesh::VectorT
/// non-member normalize
template
<
typename
Scalar
,
int
DIM
>
VectorT
<
Scalar
,
DIM
>&
normalize
(
VectorT
<
Scalar
,
DIM
>&
_v
)
{
return
_v
.
normalize
();
}
/// \relates OpenMesh::VectorT
/// non-member maximize
template
<
typename
Scalar
,
int
DIM
>
VectorT
<
Scalar
,
DIM
>&
maximize
(
VectorT
<
Scalar
,
DIM
>&
_v1
,
VectorT
<
Scalar
,
DIM
>&
_v2
)
{
return
_v1
.
maximize
(
_v2
);
}
/// \relates OpenMesh::VectorT
/// non-member minimize
template
<
typename
Scalar
,
int
DIM
>
VectorT
<
Scalar
,
DIM
>&
minimize
(
VectorT
<
Scalar
,
DIM
>&
_v1
,
VectorT
<
Scalar
,
DIM
>&
_v2
)
{
return
_v1
.
minimize
(
_v2
);
}
//== TYPEDEFS =================================================================
...
...
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