Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
OpenWalnut Modules
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenWalnut
OpenWalnut Modules
Commits
372dc1d9
Commit
372dc1d9
authored
Jun 26, 2015
by
Alexander Wiebel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX #82] made it compile again
parent
394bd781
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
Unmaintained/src/sliceContext/WTransparentLinesDrawable.cpp
Unmaintained/src/sliceContext/WTransparentLinesDrawable.cpp
+9
-9
No files found.
Unmaintained/src/sliceContext/WTransparentLinesDrawable.cpp
View file @
372dc1d9
...
...
@@ -58,10 +58,10 @@ void WTransparentLinesDrawable::drawImplementation( osg::RenderInfo &renderInfo
WPosition
startPos
=
WPosition
(
wge
::
unprojectFromScreen
(
osg
::
Vec3
(),
viewer
->
getCamera
()
)
);
WPosition
viewDir
=
normalize
(
endPos
-
startPos
);
std
::
vector
<
std
::
pair
<
double
,
size_t
>
>
depthVals
(
_vertex
Data
.
a
rray
->
getNumElements
()
);
for
(
size_t
i
=
0
;
i
<
_vertex
Data
.
a
rray
->
getNumElements
();
i
+=
2
)
std
::
vector
<
std
::
pair
<
double
,
size_t
>
>
depthVals
(
_vertex
A
rray
->
getNumElements
()
);
for
(
size_t
i
=
0
;
i
<
_vertex
A
rray
->
getNumElements
();
i
+=
2
)
{
double
myDepth
=
-
1
*
depth
(
(
*
(
dynamic_cast
<
osg
::
Vec3Array
*
>
(
_vertex
Data
.
a
rray
.
get
()
)
)
)[
i
],
viewDir
);
double
myDepth
=
-
1
*
depth
(
(
*
(
dynamic_cast
<
osg
::
Vec3Array
*
>
(
_vertex
A
rray
.
get
()
)
)
)[
i
],
viewDir
);
// TODO(wiebel): improve this unidication of values
depthVals
[
i
]
=
std
::
make_pair
(
myDepth
,
i
);
depthVals
[
i
+
1
]
=
std
::
make_pair
(
myDepth
,
i
+
1
);
...
...
@@ -70,16 +70,16 @@ void WTransparentLinesDrawable::drawImplementation( osg::RenderInfo &renderInfo
std
::
stable_sort
(
depthVals
.
begin
(),
depthVals
.
end
(),
MySorting
()
);
// osg::ref_ptr< osg::Vec3Array > tmp( new osg::Vec3Array( _vertex
Data.a
rray->getNumElements() ) );
// osg::ref_ptr< osg::Vec3Array > tmp( new osg::Vec3Array( _vertex
A
rray->getNumElements() ) );
osg
::
ref_ptr
<
osg
::
Vec3Array
>
oldVec
=
new
osg
::
Vec3Array
(
*
dynamic_cast
<
osg
::
Vec3Array
*>
(
_vertex
Data
.
a
rray
.
get
()
),
osg
::
CopyOp
::
DEEP_COPY_ALL
);
new
osg
::
Vec3Array
(
*
dynamic_cast
<
osg
::
Vec3Array
*>
(
_vertex
A
rray
.
get
()
),
osg
::
CopyOp
::
DEEP_COPY_ALL
);
osg
::
Vec3Array
*
oldVec2
=
oldVec
.
get
();
osg
::
Vec3Array
*
tmpVec
=
const_cast
<
osg
::
Vec3Array
*
>
(
(
dynamic_cast
<
const
osg
::
Vec3Array
*>
(
_vertex
Data
.
a
rray
.
get
()
)
)
);
osg
::
Vec3Array
*
tmpVec
=
const_cast
<
osg
::
Vec3Array
*
>
(
(
dynamic_cast
<
const
osg
::
Vec3Array
*>
(
_vertex
A
rray
.
get
()
)
)
);
osg
::
ref_ptr
<
osg
::
Vec3Array
>
oldTexCoords
=
new
osg
::
Vec3Array
(
*
dynamic_cast
<
osg
::
Vec3Array
*>
(
getTexCoordData
(
0
).
array
.
get
()
),
osg
::
CopyOp
::
DEEP_COPY_ALL
);
new
osg
::
Vec3Array
(
*
dynamic_cast
<
osg
::
Vec3Array
*>
(
_texCoordList
[
0
]
.
get
()
),
osg
::
CopyOp
::
DEEP_COPY_ALL
);
osg
::
Vec3Array
*
oldTexCoords2
=
oldTexCoords
.
get
();
osg
::
Vec3Array
*
tmpTexCoords
=
const_cast
<
osg
::
Vec3Array
*
>
(
(
dynamic_cast
<
const
osg
::
Vec3Array
*>
(
getTexCoordData
(
0
).
array
.
get
()
)
)
);
for
(
size_t
i
=
0
;
i
<
_vertex
Data
.
a
rray
->
getNumElements
();
++
i
)
osg
::
Vec3Array
*
tmpTexCoords
=
const_cast
<
osg
::
Vec3Array
*
>
(
(
dynamic_cast
<
const
osg
::
Vec3Array
*>
(
_texCoordList
[
0
]
.
get
()
)
)
);
for
(
size_t
i
=
0
;
i
<
_vertex
A
rray
->
getNumElements
();
++
i
)
{
(
*
tmpTexCoords
)[
i
]
=
(
*
oldTexCoords2
)[
depthVals
[
i
].
second
];
(
*
tmpVec
)[
i
]
=
(
*
oldVec2
)[
depthVals
[
i
].
second
];
...
...
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