Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
OpenWalnut Core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
44
Issues
44
List
Boards
Labels
Service Desk
Milestones
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
421664a0
Commit
421664a0
authored
Dec 09, 2010
by
Alexander Wiebel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX #453] now the index stuff is right (module works fine)
parent
ff3b0db5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
17 deletions
+11
-17
src/modules/marchingCubes/WMMarchingCubes.cpp
src/modules/marchingCubes/WMMarchingCubes.cpp
+1
-0
src/modules/teemGlyphs/WMTeemGlyphs.cpp
src/modules/teemGlyphs/WMTeemGlyphs.cpp
+10
-17
No files found.
src/modules/marchingCubes/WMMarchingCubes.cpp
View file @
421664a0
...
...
@@ -637,6 +637,7 @@ void WMMarchingCubes::updateGraphicsCallback()
{
if
(
localTextureChangedFlag
)
{
std
::
cout
<<
m_surfaceGeode
->
getNumDrawables
()
<<
std
::
endl
;
osg
::
ref_ptr
<
osg
::
Geometry
>
surfaceGeometry
=
m_surfaceGeode
->
getDrawable
(
0
)
->
asGeometry
();
osg
::
Vec3Array
*
texCoords
=
new
osg
::
Vec3Array
;
boost
::
shared_ptr
<
WGridRegular3D
>
grid
=
(
*
iter
)
->
getGrid
();
...
...
src/modules/teemGlyphs/WMTeemGlyphs.cpp
View file @
421664a0
...
...
@@ -229,7 +229,6 @@ void WMTeemGlyphs::moduleMain()
m_moduleState
.
wait
();
continue
;
}
// std::cout << "FA: " << m_GFAThresholdProp->get( true ) << std::endl;
if
(
m_input
->
getData
().
get
()
)
{
bool
dataChanged
=
false
;
...
...
@@ -448,7 +447,7 @@ WMTeemGlyphs::GlyphGeneration::GlyphGeneration( boost::shared_ptr< WDataSetSpher
m_nB
=
m_nY
;
break
;
}
size_t
nbGlyphs
=
(
m_nA
*
m_nB
)
/
(
m_modulo
*
m_modulo
);
size_t
nbGlyphs
=
(
(
m_nA
+
(
m_modulo
-
1
)
)
/
m_modulo
)
*
(
(
m_nB
+
(
m_modulo
-
1
)
)
/
m_modulo
);
const
unsigned
int
level
=
m_subdivisionLevel
;
// subdivision level of sphere
unsigned
int
infoBitFlag
=
(
1
<<
limnPolyDataInfoNorm
)
|
(
1
<<
limnPolyDataInfoRGBA
);
...
...
@@ -512,33 +511,29 @@ void WMTeemGlyphs::GlyphGeneration::operator()( size_t id, size_t numThreads, WB
float
*
esh
=
new
float
[
type
->
num
];
//******************************************
// Please take care when changing something between here and the following mark.
// Sizes and upper bound are carefully adjusted to avoid segfault with modulo
// and to avoid unwanted gaps if computing with many threads.
size_t
chunkSize
=
m_nA
/
numThreads
;
size_t
chunkSize
=
m_nA
/
(
numThreads
-
1
);
size_t
first
=
id
*
chunkSize
;
size_t
last
=
(
id
+
1
)
*
chunkSize
-
1
;
size_t
lastPlusOne
=
(
id
+
1
)
*
chunkSize
;
if
(
id
==
numThreads
-
1
)
{
last
=
m_nA
-
2
;
last
PlusOne
=
m_nA
;
}
std
::
stringstream
ss
;
ss
<<
id
<<
"/"
<<
numThreads
<<
" ("
<<
first
<<
" ... "
<<
last
<<
")["
<<
chunkSize
<<
"/"
<<
m_nA
<<
"]"
<<
std
::
endl
;
ss
<<
id
<<
"/"
<<
numThreads
<<
" ("
<<
first
<<
" ... "
<<
last
PlusOne
-
1
<<
")["
<<
chunkSize
<<
"/"
<<
m_nA
<<
"]"
<<
std
::
endl
;
WLogger
::
getLogger
()
->
addLogMessage
(
ss
.
str
(),
"______"
,
LL_DEBUG
);
for
(
size_t
aId
=
first
;
aId
<
=
last
;
++
aId
)
for
(
size_t
aId
=
first
;
aId
<
lastPlusOne
;
++
aId
)
{
for
(
size_t
bId
=
0
;
bId
<
m_nB
;
++
bId
)
{
// Please take care when changing something between here and the above mark.
//******************************************
if
(
!
(
(
aId
%
m_modulo
==
0
)
&&
(
bId
%
m_modulo
==
0
)
)
)
if
(
(
aId
%
m_modulo
!=
0
)
||
(
bId
%
m_modulo
!=
0
)
)
{
continue
;
}
size_t
glyphId
=
(
aId
/
m_modulo
)
*
(
m_nB
/
m_modulo
)
+
(
bId
/
m_modulo
);
size_t
glyphId
=
(
aId
/
m_modulo
)
*
(
(
m_nB
+
(
m_modulo
-
1
)
)
/
m_modulo
)
+
(
bId
/
m_modulo
);
size_t
vertsUpToCurrentIteration
=
glyphId
*
nbVerts
;
size_t
idsUpToCurrentIteration
=
glyphId
*
m_sphere
->
indxNum
;
...
...
@@ -632,12 +627,10 @@ void WMTeemGlyphs::GlyphGeneration::operator()( size_t id, size_t numThreads, WB
}
else
{
// std::cout<< radius << " " << m_scale << std::endl;
if
(
radius
!=
0
)
{
scale
=
m_scale
/
radius
;
}
// std::cout<< m_scale << std::endl<< std::endl;
}
estimateNormalsAntipodal
(
glyph
,
normalize
);
...
...
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