Skip to content
GitLab
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
a7e96577
Commit
a7e96577
authored
Jan 17, 2019
by
Jan Möbius
Browse files
Use vectorize for initializing vector in dummy implementations
closes
#59
parent
a5e04d48
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/OpenMesh/Core/Geometry/EigenVectorT.hh
View file @
a7e96577
...
@@ -89,9 +89,7 @@ namespace Eigen {
...
@@ -89,9 +89,7 @@ namespace Eigen {
template
<
typename
Derived
>
template
<
typename
Derived
>
MatrixBase
<
Derived
>
normalize
(
MatrixBase
<
Derived
>
&
x
)
{
MatrixBase
<
Derived
>
normalize
(
MatrixBase
<
Derived
>
&
x
)
{
std
::
cerr
<<
"Norm : "
<<
x
.
norm
()
<<
std
::
endl
;
x
/=
x
.
norm
();
x
/=
x
.
norm
();
std
::
cerr
<<
"Norm : "
<<
x
<<
std
::
endl
;
return
x
;
return
x
;
}
}
...
@@ -99,6 +97,7 @@ namespace Eigen {
...
@@ -99,6 +97,7 @@ namespace Eigen {
MatrixBase
<
Derived
>
&
vectorize
(
MatrixBase
<
Derived
>
&
x
,
MatrixBase
<
Derived
>
&
vectorize
(
MatrixBase
<
Derived
>
&
x
,
typename
Derived
::
Scalar
const
&
val
)
{
typename
Derived
::
Scalar
const
&
val
)
{
x
.
fill
(
val
);
x
.
fill
(
val
);
std
::
cerr
<<
"Vec"
<<
std
::
endl
;
return
x
;
return
x
;
}
}
...
...
src/OpenMesh/Core/Mesh/PolyMeshT.cc
View file @
a7e96577
...
@@ -154,7 +154,15 @@ typename PolyMeshT<Kernel>::Normal
...
@@ -154,7 +154,15 @@ typename PolyMeshT<Kernel>::Normal
PolyMeshT
<
Kernel
>::
calc_face_normal_impl
(
FaceHandle
,
PointIsNot3DTag
)
const
PolyMeshT
<
Kernel
>::
calc_face_normal_impl
(
FaceHandle
,
PointIsNot3DTag
)
const
{
{
// Dummy fallback implementation
// Dummy fallback implementation
return
Normal
(
typename
Normal
::
value_type
(
0
));
// Returns just an initialized all 0 normal
// This function is only used if we don't hate a matching implementation
// for normal computation with the current vector type defined in the mesh traits
assert
(
false
);
Normal
normal
;
vectorize
(
normal
,
0
);
return
normal
;
}
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
...
@@ -212,7 +220,17 @@ template <class Kernel>
...
@@ -212,7 +220,17 @@ template <class Kernel>
typename
PolyMeshT
<
Kernel
>::
Normal
typename
PolyMeshT
<
Kernel
>::
Normal
PolyMeshT
<
Kernel
>::
calc_face_normal_impl
(
const
Point
&
,
const
Point
&
,
const
Point
&
,
PointIsNot3DTag
)
const
PolyMeshT
<
Kernel
>::
calc_face_normal_impl
(
const
Point
&
,
const
Point
&
,
const
Point
&
,
PointIsNot3DTag
)
const
{
{
return
Normal
(
typename
Normal
::
value_type
(
0
));
// Dummy fallback implementation
// Returns just an initialized all 0 normal
// This function is only used if we don't hate a matching implementation
// for normal computation with the current vector type defined in the mesh traits
assert
(
false
);
Normal
normal
;
vectorize
(
normal
,
0
);
return
normal
;
}
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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