Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
1d5ffab8
Commit
1d5ffab8
authored
May 04, 2011
by
Sebastian Eichelbaum
Browse files
[CHANGE] - removed in-place normalize() calls in modules and common
parent
2c1363c6
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
14 additions
and
14 deletions
+14
-14
src/common/math/WPlane.cpp
src/common/math/WPlane.cpp
+2
-2
src/common/math/WPlane.h
src/common/math/WPlane.h
+2
-2
src/common/math/WUnitSphereCoordinates.cpp
src/common/math/WUnitSphereCoordinates.cpp
+1
-1
src/modules/coordinateSystem/WTalairachConverter.cpp
src/modules/coordinateSystem/WTalairachConverter.cpp
+2
-2
src/modules/deterministicFTMori/WMDeterministicFTMori.cpp
src/modules/deterministicFTMori/WMDeterministicFTMori.cpp
+1
-1
src/modules/fiberDisplaySimple/WMFiberDisplaySimple.cpp
src/modules/fiberDisplaySimple/WMFiberDisplaySimple.cpp
+1
-1
src/modules/splineSurface/WSurface.cpp
src/modules/splineSurface/WSurface.cpp
+3
-3
src/modules/teemGlyphs/WMTeemGlyphs.cpp
src/modules/teemGlyphs/WMTeemGlyphs.cpp
+1
-1
src/modules/voxelizer/WBresenham.cpp
src/modules/voxelizer/WBresenham.cpp
+1
-1
No files found.
src/common/math/WPlane.cpp
View file @
1d5ffab8
...
...
@@ -46,8 +46,8 @@ WPlane::WPlane( const WVector3d_2& normal, const WPosition_2& pos, const WVector
m_pos
(
pos
)
{
setPlaneVectors
(
first
,
second
);
m_first
.
normalize
();
m_second
.
normalize
();
m_first
=
normalize
(
m_first
);
m_second
=
normalize
(
m_second
);
}
WPlane
::~
WPlane
()
...
...
src/common/math/WPlane.h
View file @
1d5ffab8
...
...
@@ -142,9 +142,9 @@ public:
gen
=
WVector3d_2
(
0
,
1
,
0
);
}
m_first
=
cross
(
normal
,
gen
);
m_first
.
normalize
();
m_first
=
normalize
(
m_first
);
m_second
=
cross
(
normal
,
m_first
);
m_second
.
normalize
();
m_second
=
normalize
(
m_second
);
}
// \cond
...
...
src/common/math/WUnitSphereCoordinates.cpp
View file @
1d5ffab8
...
...
@@ -40,7 +40,7 @@ WUnitSphereCoordinates::WUnitSphereCoordinates( double theta, double phi )
WUnitSphereCoordinates
::
WUnitSphereCoordinates
(
WVector3d_2
vector
)
{
vector
.
normalize
();
vector
=
normalize
(
vector
);
// calculate angles
m_theta
=
std
::
acos
(
vector
[
2
]
);
m_phi
=
std
::
atan2
(
vector
[
1
],
vector
[
0
]
);
...
...
src/modules/coordinateSystem/WTalairachConverter.cpp
View file @
1d5ffab8
...
...
@@ -228,9 +228,9 @@ void WTalairachConverter::defineRotationMatrix()
m_ihp_proj
=
ihp_proj
;
WVector3d_2
ex
(
m_ac
-
m_pc
);
ex
.
normalize
();
ex
=
normalize
(
ex
);
WVector3d_2
ez
(
ihp_proj
-
m_ac
);
ez
.
normalize
();
ez
=
normalize
(
ez
);
WVector3d_2
ey
=
cross
(
ez
,
ex
);
m_rotMat
(
0
,
0
)
=
ex
[
0
];
...
...
src/modules/deterministicFTMori/WMDeterministicFTMori.cpp
View file @
1d5ffab8
...
...
@@ -332,7 +332,7 @@ WVector3d_2 WMDeterministicFTMori::getEigenDirection( boost::shared_ptr< WDataSe
v
[
0
]
=
vs
->
rawData
()[
4
*
i
+
0
];
v
[
1
]
=
vs
->
rawData
()[
4
*
i
+
1
];
v
[
2
]
=
vs
->
rawData
()[
4
*
i
+
2
];
v
.
normalize
();
v
=
normalize
(
v
);
if
(
length
(
j
.
second
)
==
0
)
{
return
v
;
...
...
src/modules/fiberDisplaySimple/WMFiberDisplaySimple.cpp
View file @
1d5ffab8
...
...
@@ -430,7 +430,7 @@ osg::ref_ptr< osg::Node > WMFiberDisplaySimple::createFiberGeode( boost::shared_
osg
::
Vec3
tangent
=
osg
::
Vec3
(
fibTangents
->
at
(
(
3
*
k
)
+
sidx
),
fibTangents
->
at
(
(
3
*
k
)
+
sidx
+
1
),
fibTangents
->
at
(
(
3
*
k
)
+
sidx
+
2
)
);
tangent
.
normalize
();
tangent
=
normalize
(
tangent
);
vertices
->
push_back
(
vert
);
colors
->
push_back
(
color
);
...
...
src/modules/splineSurface/WSurface.cpp
View file @
1d5ffab8
...
...
@@ -181,9 +181,9 @@ void WSurface::execute()
jacobiEigenvector3D
(
myTensor
,
&
eigenSys
);
eigenSys
[
0
].
second
.
normalize
();
eigenSys
[
1
].
second
.
normalize
();
eigenSys
[
2
].
second
.
normalize
();
eigenSys
[
0
].
second
=
normalize
(
eigenSys
[
0
].
second
);
eigenSys
[
1
].
second
=
normalize
(
eigenSys
[
1
].
second
);
eigenSys
[
2
].
second
=
normalize
(
eigenSys
[
2
].
second
);
// This sorts the entries automatically :-)
std
::
map
<
double
,
WVector3d_2
>
sortedEigenSystem
;
...
...
src/modules/teemGlyphs/WMTeemGlyphs.cpp
View file @
1d5ffab8
...
...
@@ -743,7 +743,7 @@ void WMTeemGlyphs::GlyphGeneration::operator()( size_t id, size_t numThreads, WB
(
*
m_normals
)[
globalVertexId
][
0
]
=
glyph
->
norm
[
3
*
vertId
];
(
*
m_normals
)[
globalVertexId
][
1
]
=
glyph
->
norm
[
3
*
vertId
+
1
];
(
*
m_normals
)[
globalVertexId
][
2
]
=
glyph
->
norm
[
3
*
vertId
+
2
];
(
*
m_normals
)[
globalVertexId
]
.
normalize
();
(
*
m_normals
)[
globalVertexId
]
=
normalize
(
(
*
m_normals
)[
globalVertexId
]
);
// ------------------------------------------------
// colors
...
...
src/modules/voxelizer/WBresenham.cpp
View file @
1d5ffab8
...
...
@@ -161,7 +161,7 @@ std::vector< double > WBresenham::computeDistances( const size_t voxelNum,
const
WPosition_2
&
end
)
const
{
WPosition_2
u
=
end
-
start
;
u
.
normalize
();
u
=
normalize
(
u
);
std
::
vector
<
WPosition_2
>
x
;
x
.
reserve
(
7
);
...
...
Write
Preview
Markdown
is supported
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