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
c4a515de
Commit
c4a515de
authored
Mar 13, 2014
by
Sebastian Eichelbaum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX
#298
] now WOSG is removed, every BIND_PER_PRIMITIVE is removed.
parent
6bf871bf
Changes
33
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
179 additions
and
398 deletions
+179
-398
src/core/graphicsEngine/WGETextureHud.cpp
src/core/graphicsEngine/WGETextureHud.cpp
+3
-6
src/core/graphicsEngine/WOSG.h
src/core/graphicsEngine/WOSG.h
+0
-39
src/core/graphicsEngine/WROI.cpp
src/core/graphicsEngine/WROI.cpp
+1
-1
src/core/graphicsEngine/WROIArbitrary.cpp
src/core/graphicsEngine/WROIArbitrary.cpp
+4
-9
src/core/graphicsEngine/WROIBox.cpp
src/core/graphicsEngine/WROIBox.cpp
+50
-145
src/core/graphicsEngine/WROIBox.h
src/core/graphicsEngine/WROIBox.h
+8
-4
src/core/graphicsEngine/geodes/WDendrogramGeode.cpp
src/core/graphicsEngine/geodes/WDendrogramGeode.cpp
+2
-5
src/core/graphicsEngine/geodes/WGEGridNode.cpp
src/core/graphicsEngine/geodes/WGEGridNode.cpp
+2
-5
src/core/graphicsEngine/widgets/labeling/WGEBorderLayout.cpp
src/core/graphicsEngine/widgets/labeling/WGEBorderLayout.cpp
+2
-5
src/modules/arbitraryPlane/WMArbitraryPlane.cpp
src/modules/arbitraryPlane/WMArbitraryPlane.cpp
+1
-4
src/modules/arbitraryROIs/WMArbitraryROIs.cpp
src/modules/arbitraryROIs/WMArbitraryROIs.cpp
+3
-6
src/modules/clusterDisplayVoxels/WMClusterDisplayVoxels.cpp
src/modules/clusterDisplayVoxels/WMClusterDisplayVoxels.cpp
+8
-11
src/modules/colormapper/WMColormapper.cpp
src/modules/colormapper/WMColormapper.cpp
+2
-5
src/modules/coordinateSystem/WMCoordinateSystem.cpp
src/modules/coordinateSystem/WMCoordinateSystem.cpp
+3
-6
src/modules/coordinateSystem/WRulerOrtho.cpp
src/modules/coordinateSystem/WRulerOrtho.cpp
+13
-16
src/modules/coordinateSystem/WRulerOrtho.h
src/modules/coordinateSystem/WRulerOrtho.h
+6
-9
src/modules/datasetProfile/WMDatasetProfile.cpp
src/modules/datasetProfile/WMDatasetProfile.cpp
+6
-9
src/modules/eegView/WEEGEvent.cpp
src/modules/eegView/WEEGEvent.cpp
+2
-5
src/modules/eegView/WHeadSurfaceCallback.cpp
src/modules/eegView/WHeadSurfaceCallback.cpp
+2
-5
src/modules/eegView/WLineStripCallback.cpp
src/modules/eegView/WLineStripCallback.cpp
+1
-4
src/modules/fiberDisplay/WMFiberDisplay.cpp
src/modules/fiberDisplay/WMFiberDisplay.cpp
+18
-21
src/modules/histogramView/WMHistogramView.cpp
src/modules/histogramView/WMHistogramView.cpp
+14
-17
src/modules/imageSpaceLIC/WMImageSpaceLIC.cpp
src/modules/imageSpaceLIC/WMImageSpaceLIC.cpp
+2
-5
src/modules/isosurface/WMIsosurface.cpp
src/modules/isosurface/WMIsosurface.cpp
+3
-6
src/modules/pointRenderer/WMPointRenderer.cpp
src/modules/pointRenderer/WMPointRenderer.cpp
+2
-5
src/modules/splineSurface/WMSplineSurface.cpp
src/modules/splineSurface/WMSplineSurface.cpp
+3
-6
src/modules/superquadricGlyphs/WMSuperquadricGlyphs.cpp
src/modules/superquadricGlyphs/WMSuperquadricGlyphs.cpp
+4
-7
src/modules/superquadricGlyphs/WMSuperquadricGlyphs.h
src/modules/superquadricGlyphs/WMSuperquadricGlyphs.h
+2
-5
src/modules/teemGlyphs/WMTeemGlyphs.cpp
src/modules/teemGlyphs/WMTeemGlyphs.cpp
+3
-6
src/modules/transferFunctionColorBar/WMTransferFunctionColorBar.cpp
...s/transferFunctionColorBar/WMTransferFunctionColorBar.cpp
+2
-5
src/modules/vectorPlot/WMVectorPlot.cpp
src/modules/vectorPlot/WMVectorPlot.cpp
+1
-4
src/modules/vectorPlot/WMVectorPlot.h
src/modules/vectorPlot/WMVectorPlot.h
+5
-8
src/modules/voxelizer/WMVoxelizer.cpp
src/modules/voxelizer/WMVoxelizer.cpp
+1
-4
No files found.
src/core/graphicsEngine/WGETextureHud.cpp
View file @
c4a515de
...
...
@@ -35,9 +35,6 @@
#include <osg/Node>
#include <osg/TexEnv>
// Compatibility between OSG 3.2 and earlier versions
#include "core/graphicsEngine/WOSG.h"
#include "../common/WPathHelper.h"
#include "WGETextureHud.h"
...
...
@@ -190,7 +187,7 @@ WGETextureHud::WGETextureHudEntry::WGETextureHudEntry( osg::ref_ptr< osg::Textur
osg
::
Geode
*
geode
=
new
osg
::
Geode
();
// Set up geometry for the HUD and add it to the HUD
osg
::
ref_ptr
<
wosg
::
Geometry
>
HUDBackgroundGeometry
=
new
w
osg
::
Geometry
();
osg
::
ref_ptr
<
osg
::
Geometry
>
HUDBackgroundGeometry
=
new
osg
::
Geometry
();
osg
::
ref_ptr
<
osg
::
Vec3Array
>
HUDBackgroundVertices
=
new
osg
::
Vec3Array
;
HUDBackgroundVertices
->
push_back
(
osg
::
Vec3
(
0
,
0
,
-
1
)
);
...
...
@@ -216,11 +213,11 @@ WGETextureHud::WGETextureHudEntry::WGETextureHudEntry( osg::ref_ptr< osg::Textur
osg
::
ref_ptr
<
osg
::
Vec3Array
>
HUDnormals
=
new
osg
::
Vec3Array
;
HUDnormals
->
push_back
(
osg
::
Vec3
(
0.0
f
,
0.0
f
,
1.0
f
)
);
HUDBackgroundGeometry
->
setNormalArray
(
HUDnormals
);
HUDBackgroundGeometry
->
setNormalBinding
(
w
osg
::
Geometry
::
BIND_OVERALL
);
HUDBackgroundGeometry
->
setNormalBinding
(
osg
::
Geometry
::
BIND_OVERALL
);
HUDBackgroundGeometry
->
addPrimitiveSet
(
HUDBackgroundIndices
);
HUDBackgroundGeometry
->
setVertexArray
(
HUDBackgroundVertices
);
HUDBackgroundGeometry
->
setColorArray
(
HUDcolors
);
HUDBackgroundGeometry
->
setColorBinding
(
w
osg
::
Geometry
::
BIND_OVERALL
);
HUDBackgroundGeometry
->
setColorBinding
(
osg
::
Geometry
::
BIND_OVERALL
);
HUDBackgroundGeometry
->
setTexCoordArray
(
0
,
HUDBackgroundTex
);
geode
->
addDrawable
(
HUDBackgroundGeometry
);
...
...
src/core/graphicsEngine/WOSG.h
deleted
100644 → 0
View file @
6bf871bf
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
// For more information see http://www.openwalnut.org/copying
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------
#ifndef WOSG_H
#define WOSG_H
#include "osg/Version"
// Since OSG 3.2, OpenSceneGraph has changed several things in their Geometry class. For compilation compatibility, they provide
// deprecated_osg::Geometry. It was introduced somewhere in between 3.0 and 3.2. As I do not know where exactly, we only differentiate between
// 3.2 and earlier.
#if OSG_VERSION_GREATER_OR_EQUAL( 3, 2, 0 )
#define wosg deprecated_osg
#else
#define wosg osg
#endif
#endif // WOSG_H
src/core/graphicsEngine/WROI.cpp
View file @
c4a515de
...
...
@@ -28,7 +28,7 @@
#include "WROI.h"
#include "WPickHandler.h"
WROI
::
WROI
()
:
WROI
::
WROI
()
:
osg
::
Geode
()
{
properties
();
...
...
src/core/graphicsEngine/WROIArbitrary.cpp
View file @
c4a515de
...
...
@@ -36,9 +36,6 @@
#include "callbacks/WGEFunctorCallback.h"
#include "WGraphicsEngine.h"
// Compatibility between OSG 3.2 and earlier versions
#include "core/graphicsEngine/WOSG.h"
#include "WROIArbitrary.h"
WROIArbitrary
::
WROIArbitrary
(
size_t
nbCoordsX
,
size_t
nbCoordsY
,
size_t
nbCoordsZ
,
...
...
@@ -158,24 +155,22 @@ void WROIArbitrary::updateGFX()
&
m_vals
,
m_threshold
->
get
()
);
wosg
::
Geometry
*
surfaceGeometry
=
new
w
osg
::
Geometry
();
osg
::
Geometry
*
surfaceGeometry
=
new
osg
::
Geometry
();
setName
(
"roi"
);
surfaceGeometry
->
setVertexArray
(
m_triMesh
->
getVertexArray
()
);
// ------------------------------------------------
// normals
// FIXME: OSG 3.2 no longer supports binding per primitive. I did not find any evidence that the marching lego Algorithm calculated any
// normals. So the code is disabled.
// surfaceGeometry->setNormalArray( m_triMesh->getTriangleNormalArray() );
// surfaceGeometry->setNormalBinding( wosg::Geometry::BIND_PER_PRIMITIVE );
surfaceGeometry
->
setNormalArray
(
m_triMesh
->
getVertexNormalArray
()
);
surfaceGeometry
->
setNormalBinding
(
osg
::
Geometry
::
BIND_PER_VERTEX
);
// ------------------------------------------------
// colors
osg
::
Vec4Array
*
colors
=
new
osg
::
Vec4Array
;
colors
->
push_back
(
m_color
);
surfaceGeometry
->
setColorArray
(
colors
);
surfaceGeometry
->
setColorBinding
(
w
osg
::
Geometry
::
BIND_OVERALL
);
surfaceGeometry
->
setColorBinding
(
osg
::
Geometry
::
BIND_OVERALL
);
osg
::
DrawElementsUInt
*
surfaceElement
=
new
osg
::
DrawElementsUInt
(
osg
::
PrimitiveSet
::
TRIANGLES
,
0
);
...
...
src/core/graphicsEngine/WROIBox.cpp
View file @
c4a515de
This diff is collapsed.
Click to expand it.
src/core/graphicsEngine/WROIBox.h
View file @
c4a515de
...
...
@@ -32,9 +32,6 @@
#include <osg/Geometry>
// Compatibility between OSG 3.2 and earlier versions
#include "core/graphicsEngine/WOSG.h"
#include "WPickHandler.h"
#include "shaders/WGEShader.h"
...
...
@@ -124,7 +121,7 @@ private:
WVector2d
m_oldPixelPosition
;
//!< Caches the old picked position to a allow for cmoparison
int16_t
m_oldScrollWheel
;
//!< caches scroll wheel value
boost
::
shared_mutex
m_updateLock
;
//!< Lock to prevent concurrent threads trying to update the osg node
osg
::
ref_ptr
<
w
osg
::
Geometry
>
m_surfaceGeometry
;
//!< store this pointer for use in updates
osg
::
ref_ptr
<
osg
::
Geometry
>
m_surfaceGeometry
;
//!< store this pointer for use in updates
WPickInfo
m_pickInfo
;
//!< Stores the pick information for potential redraw
...
...
@@ -174,6 +171,13 @@ private:
* \param property the property
*/
void
boxPropertiesChanged
(
boost
::
shared_ptr
<
WPropertyBase
>
property
);
/**
* Set new color of the box in the geometry
*
* \param color the new color
*/
void
updateColor
(
osg
::
Vec4
color
);
};
#endif // WROIBOX_H
src/core/graphicsEngine/geodes/WDendrogramGeode.cpp
View file @
c4a515de
...
...
@@ -26,9 +26,6 @@
#include "../../graphicsEngine/WGEUtils.h"
// Compatibility between OSG 3.2 and earlier versions
#include "core/graphicsEngine/WOSG.h"
#include "WDendrogramGeode.h"
/**
...
...
@@ -84,14 +81,14 @@ void WDendrogramGeode::create()
(
*
m_vertexArray
)[
i
].
y
()
=
(
*
m_vertexArray
)[
i
].
y
()
*
m_yMult
+
m_yOff
;
}
osg
::
ref_ptr
<
wosg
::
Geometry
>
geometry
=
osg
::
ref_ptr
<
wosg
::
Geometry
>
(
new
w
osg
::
Geometry
()
);
osg
::
ref_ptr
<
osg
::
Geometry
>
geometry
=
osg
::
ref_ptr
<
osg
::
Geometry
>
(
new
osg
::
Geometry
()
);
geometry
->
setVertexArray
(
m_vertexArray
);
geometry
->
addPrimitiveSet
(
m_lineArray
);
geometry
->
setColorArray
(
m_colors
);
geometry
->
setColorBinding
(
w
osg
::
Geometry
::
BIND_PER_VERTEX
);
geometry
->
setColorBinding
(
osg
::
Geometry
::
BIND_PER_VERTEX
);
osg
::
StateSet
*
state
=
geometry
->
getOrCreateStateSet
();
state
->
setMode
(
GL_LIGHTING
,
osg
::
StateAttribute
::
OFF
|
osg
::
StateAttribute
::
PROTECTED
);
...
...
src/core/graphicsEngine/geodes/WGEGridNode.cpp
View file @
c4a515de
...
...
@@ -31,9 +31,6 @@
#include "../WGEGeodeUtils.h"
#include "WGEGridNode.h"
// Compatibility between OSG 3.2 and earlier versions
#include "core/graphicsEngine/WOSG.h"
WGEGridNode
::
WGEGridNode
(
WGridRegular3D
::
ConstSPtr
grid
)
:
m_boundaryGeode
(
new
osg
::
Geode
()
),
m_innerGridGeode
(
new
osg
::
Geode
()
),
...
...
@@ -254,7 +251,7 @@ void WGEGridNode::callback( osg::Node* /*node*/ )
// grab the grid
WGridRegular3D
::
ConstSPtr
grid
=
m_grid
.
getReadTicket
()
->
get
();
wosg
::
Geometry
*
gridGeometry
=
new
w
osg
::
Geometry
();
osg
::
Geometry
*
gridGeometry
=
new
osg
::
Geometry
();
osg
::
ref_ptr
<
osg
::
Vec3Array
>
vertArray
=
new
osg
::
Vec3Array
(
grid
->
size
()
);
osg
::
DrawElementsUInt
*
gridElement
=
new
osg
::
DrawElementsUInt
(
osg
::
PrimitiveSet
::
LINES
,
0
);
...
...
@@ -304,7 +301,7 @@ void WGEGridNode::callback( osg::Node* /*node*/ )
// finally, the colors
colors
->
push_back
(
m_gridColor
);
gridGeometry
->
setColorArray
(
colors
);
gridGeometry
->
setColorBinding
(
w
osg
::
Geometry
::
BIND_OVERALL
);
gridGeometry
->
setColorBinding
(
osg
::
Geometry
::
BIND_OVERALL
);
if
(
m_innerGridGeode
->
getNumDrawables
()
)
{
...
...
src/core/graphicsEngine/widgets/labeling/WGEBorderLayout.cpp
View file @
c4a515de
...
...
@@ -29,9 +29,6 @@
#include "../../WGraphicsEngine.h"
#include "../../WGECamera.h"
// Compatibility between OSG 3.2 and earlier versions
#include "core/graphicsEngine/WOSG.h"
#include "WGEBorderLayout.h"
WGEBorderLayout
::
WGEBorderLayout
()
:
...
...
@@ -124,14 +121,14 @@ void WGEBorderLayout::SafeUpdateCallback::operator()( osg::Node* node, osg::Node
}
// create geometry for the lines calculated above
osg
::
ref_ptr
<
wosg
::
Geometry
>
g
=
new
w
osg
::
Geometry
;
osg
::
ref_ptr
<
osg
::
Geometry
>
g
=
new
osg
::
Geometry
;
g
->
setDataVariance
(
osg
::
Object
::
DYNAMIC
);
osg
::
ref_ptr
<
osg
::
DrawArrays
>
da
=
new
osg
::
DrawArrays
(
osg
::
PrimitiveSet
::
LINES
,
0
,
v
->
size
()
);
g
->
setVertexArray
(
v
);
osg
::
ref_ptr
<
osg
::
Vec4Array
>
colors
=
new
osg
::
Vec4Array
;
colors
->
push_back
(
osg
::
Vec4
(
0.0
f
,
0.0
f
,
0.0
f
,
1.0
f
)
);
g
->
setColorArray
(
colors
);
g
->
setColorBinding
(
w
osg
::
Geometry
::
BIND_OVERALL
);
g
->
setColorBinding
(
osg
::
Geometry
::
BIND_OVERALL
);
g
->
addPrimitiveSet
(
da
);
osg
::
LineWidth
*
linewidth
=
new
osg
::
LineWidth
();
...
...
src/modules/arbitraryPlane/WMArbitraryPlane.cpp
View file @
c4a515de
...
...
@@ -41,9 +41,6 @@
#include "core/kernel/WKernel.h"
#include "core/kernel/WSelectionManager.h"
// Compatibility between OSG 3.2 and earlier versions
#include "core/graphicsEngine/WOSG.h"
#include "WMArbitraryPlane.h"
#include "WMArbitraryPlane.xpm"
...
...
@@ -285,7 +282,7 @@ void WMArbitraryPlane::updatePlane()
WPosition
v2
(
p0
[
0
]
+
p0
[
0
]
-
p1
[
0
]
,
p0
[
1
]
+
p0
[
1
]
-
p2
[
1
]
,
p0
[
2
]
+
(
p0
[
2
]
-
p1
[
2
]
)
+
(
p0
[
2
]
-
p2
[
2
]
)
);
WPosition
v3
(
p0
[
0
]
+
p0
[
0
]
-
p1
[
0
]
,
p2
[
1
]
,
p0
[
2
]
+
(
p0
[
2
]
-
p1
[
2
]
)
-
(
p0
[
2
]
-
p2
[
2
]
)
);
osg
::
ref_ptr
<
wosg
::
Geometry
>
planeGeometry
=
osg
::
ref_ptr
<
wosg
::
Geometry
>
(
new
w
osg
::
Geometry
()
);
osg
::
ref_ptr
<
osg
::
Geometry
>
planeGeometry
=
osg
::
ref_ptr
<
osg
::
Geometry
>
(
new
osg
::
Geometry
()
);
osg
::
Vec3Array
*
planeVertices
=
new
osg
::
Vec3Array
;
planeVertices
->
push_back
(
v0
);
...
...
src/modules/arbitraryROIs/WMArbitraryROIs.cpp
View file @
c4a515de
...
...
@@ -42,9 +42,6 @@
#include "core/kernel/WROIManager.h"
#include "core/kernel/WSelectionManager.h"
// Compatibility between OSG 3.2 and earlier versions
#include "core/graphicsEngine/WOSG.h"
#include "WMArbitraryROIs.h"
#include "WMArbitraryROIs.xpm"
...
...
@@ -313,7 +310,7 @@ void WMArbitraryROIs::renderMesh()
if
(
m_showSelector
)
{
wosg
::
Geometry
*
surfaceGeometry
=
new
w
osg
::
Geometry
();
osg
::
Geometry
*
surfaceGeometry
=
new
osg
::
Geometry
();
m_outputGeode
=
osg
::
ref_ptr
<
osg
::
Geode
>
(
new
osg
::
Geode
);
m_outputGeode
->
setName
(
"ROI"
);
...
...
@@ -323,14 +320,14 @@ void WMArbitraryROIs::renderMesh()
// ------------------------------------------------
// normals
surfaceGeometry
->
setNormalArray
(
m_triMesh
->
getVertexNormalArray
()
);
surfaceGeometry
->
setNormalBinding
(
w
osg
::
Geometry
::
BIND_PER_VERTEX
);
surfaceGeometry
->
setNormalBinding
(
osg
::
Geometry
::
BIND_PER_VERTEX
);
// ------------------------------------------------
// colors
osg
::
Vec4Array
*
colors
=
new
osg
::
Vec4Array
;
colors
->
push_back
(
osg
::
Vec4
(
0.2
f
,
1.0
f
,
0.2
f
,
1.0
f
)
);
surfaceGeometry
->
setColorArray
(
colors
);
surfaceGeometry
->
setColorBinding
(
w
osg
::
Geometry
::
BIND_OVERALL
);
surfaceGeometry
->
setColorBinding
(
osg
::
Geometry
::
BIND_OVERALL
);
osg
::
DrawElementsUInt
*
surfaceElement
=
new
osg
::
DrawElementsUInt
(
osg
::
PrimitiveSet
::
TRIANGLES
,
0
);
...
...
src/modules/clusterDisplayVoxels/WMClusterDisplayVoxels.cpp
View file @
c4a515de
...
...
@@ -43,9 +43,6 @@
#include "core/kernel/WKernel.h"
#include "core/kernel/WSelectionManager.h"
// Compatibility between OSG 3.2 and earlier versions
#include "core/graphicsEngine/WOSG.h"
#include "WFileParser.h"
#include "WMClusterDisplayVoxels.h"
#include "WMClusterDisplayVoxels.xpm"
...
...
@@ -767,7 +764,7 @@ void WMClusterDisplayVoxels::renderMesh()
{
for
(
size_t
i
=
0
;
i
<
m_triMeshes
.
size
();
++
i
)
{
wosg
::
Geometry
*
surfaceGeometry
=
new
w
osg
::
Geometry
();
osg
::
Geometry
*
surfaceGeometry
=
new
osg
::
Geometry
();
osg
::
ref_ptr
<
osg
::
Geode
>
outputGeode
=
osg
::
ref_ptr
<
osg
::
Geode
>
(
new
osg
::
Geode
);
outputGeode
->
setName
(
(
std
::
string
(
"cluster"
)
+
string_utils
::
toString
(
m_activatedClusters
[
i
]
)
).
c_str
()
);
...
...
@@ -776,15 +773,15 @@ void WMClusterDisplayVoxels::renderMesh()
// ------------------------------------------------
// normals
surfaceGeometry
->
setNormalArray
(
m_triMeshes
[
i
]
->
get
Triangle
NormalArray
()
);
surfaceGeometry
->
setNormalBinding
(
wosg
::
Geometry
::
BIND_PER_PRIMITIVE
);
surfaceGeometry
->
setNormalArray
(
m_triMeshes
[
i
]
->
get
Vertex
NormalArray
()
);
surfaceGeometry
->
setNormalBinding
(
osg
::
Geometry
::
BIND_PER_VERTEX
);
// ------------------------------------------------
// colors
osg
::
Vec4Array
*
colors
=
new
osg
::
Vec4Array
;
colors
->
push_back
(
m_clusterColors
[
m_activatedClusters
[
i
]]
);
surfaceGeometry
->
setColorArray
(
colors
);
surfaceGeometry
->
setColorBinding
(
w
osg
::
Geometry
::
BIND_OVERALL
);
surfaceGeometry
->
setColorBinding
(
osg
::
Geometry
::
BIND_OVERALL
);
osg
::
DrawElementsUInt
*
surfaceElement
=
new
osg
::
DrawElementsUInt
(
osg
::
PrimitiveSet
::
TRIANGLES
,
0
);
...
...
@@ -810,7 +807,7 @@ void WMClusterDisplayVoxels::renderMesh()
}
if
(
m_propShowVoxelTriangulation
->
get
(
true
)
&&
m_showNotInClusters
->
get
()
)
{
wosg
::
Geometry
*
surfaceGeometry
=
new
w
osg
::
Geometry
();
osg
::
Geometry
*
surfaceGeometry
=
new
osg
::
Geometry
();
osg
::
ref_ptr
<
osg
::
Geode
>
outputGeode
=
osg
::
ref_ptr
<
osg
::
Geode
>
(
new
osg
::
Geode
);
outputGeode
->
setName
(
(
std
::
string
(
"non active"
)
).
c_str
()
);
...
...
@@ -819,8 +816,8 @@ void WMClusterDisplayVoxels::renderMesh()
// ------------------------------------------------
// normals
surfaceGeometry
->
setNormalArray
(
m_nonActiveMesh
->
get
Triangle
NormalArray
()
);
surfaceGeometry
->
setNormalBinding
(
wosg
::
Geometry
::
BIND_PER_PRIMITIVE
);
surfaceGeometry
->
setNormalArray
(
m_nonActiveMesh
->
get
Vertex
NormalArray
()
);
surfaceGeometry
->
setNormalBinding
(
osg
::
Geometry
::
BIND_PER_VERTEX
);
// ------------------------------------------------
// colors
...
...
@@ -828,7 +825,7 @@ void WMClusterDisplayVoxels::renderMesh()
colors
->
push_back
(
osg
::
Vec4
(
0.3
,
0.3
,
0.3
,
1.0
f
)
);
surfaceGeometry
->
setColorArray
(
colors
);
surfaceGeometry
->
setColorBinding
(
w
osg
::
Geometry
::
BIND_OVERALL
);
surfaceGeometry
->
setColorBinding
(
osg
::
Geometry
::
BIND_OVERALL
);
osg
::
DrawElementsUInt
*
surfaceElement
=
new
osg
::
DrawElementsUInt
(
osg
::
PrimitiveSet
::
TRIANGLES
,
0
);
...
...
src/modules/colormapper/WMColormapper.cpp
View file @
c4a515de
...
...
@@ -37,9 +37,6 @@
#include "core/graphicsEngine/widgets/labeling/WGELabel.h"
#include "core/kernel/WKernel.h"
// Compatibility between OSG 3.2 and earlier versions
#include "core/graphicsEngine/WOSG.h"
#include "WMColormapper.xpm"
#include "WMColormapper.h"
...
...
@@ -478,12 +475,12 @@ void WMColormapper::updateColorbarScale( osg::Node* scaleLabels )
}
// create the line drawable
wosg
::
Geometry
*
lines
=
new
w
osg
::
Geometry
();
osg
::
Geometry
*
lines
=
new
osg
::
Geometry
();
lines
->
setVertexArray
(
lineVerts
);
osg
::
Vec4Array
*
color
=
new
osg
::
Vec4Array
();
color
->
push_back
(
m_colorBarLabelsBarColor
->
get
()
);
lines
->
setColorArray
(
color
);
lines
->
setColorBinding
(
w
osg
::
Geometry
::
BIND_OVERALL
);
lines
->
setColorBinding
(
osg
::
Geometry
::
BIND_OVERALL
);
lines
->
addPrimitiveSet
(
new
osg
::
DrawArrays
(
GL_LINES
,
0
,
lineVerts
->
size
()
)
);
g
->
addDrawable
(
lines
);
}
...
...
src/modules/coordinateSystem/WMCoordinateSystem.cpp
View file @
c4a515de
...
...
@@ -40,9 +40,6 @@
#include "core/kernel/WKernel.h"
#include "core/kernel/WSelectionManager.h"
// Compatibility between OSG 3.2 and earlier versions
#include "core/graphicsEngine/WOSG.h"
#include "WMCoordinateSystem.h"
#include "WMCoordinateSystem.xpm"
#include "WTalairachConverter.h"
...
...
@@ -576,7 +573,7 @@ void WMCoordinateSystem::addSagittalGrid( float position )
}
osg
::
ref_ptr
<
osg
::
Geode
>
gridGeode
=
osg
::
ref_ptr
<
osg
::
Geode
>
(
new
osg
::
Geode
()
);
osg
::
ref_ptr
<
wosg
::
Geometry
>
geometry
=
osg
::
ref_ptr
<
wosg
::
Geometry
>
(
new
w
osg
::
Geometry
()
);
osg
::
ref_ptr
<
osg
::
Geometry
>
geometry
=
osg
::
ref_ptr
<
osg
::
Geometry
>
(
new
osg
::
Geometry
()
);
osg
::
Vec3Array
*
vertices
=
new
osg
::
Vec3Array
;
WBoundingBox
boundingBox
=
m_coordConverter
->
getBoundingBox
();
...
...
@@ -657,7 +654,7 @@ void WMCoordinateSystem::addCoronalGrid( float position )
}
osg
::
ref_ptr
<
osg
::
Geode
>
gridGeode
=
osg
::
ref_ptr
<
osg
::
Geode
>
(
new
osg
::
Geode
()
);
osg
::
ref_ptr
<
wosg
::
Geometry
>
geometry
=
osg
::
ref_ptr
<
wosg
::
Geometry
>
(
new
w
osg
::
Geometry
()
);
osg
::
ref_ptr
<
osg
::
Geometry
>
geometry
=
osg
::
ref_ptr
<
osg
::
Geometry
>
(
new
osg
::
Geometry
()
);
osg
::
Vec3Array
*
vertices
=
new
osg
::
Vec3Array
;
WBoundingBox
boundingBox
=
m_coordConverter
->
getBoundingBox
();
...
...
@@ -738,7 +735,7 @@ void WMCoordinateSystem::addAxialGrid( float position )
}
osg
::
ref_ptr
<
osg
::
Geode
>
gridGeode
=
osg
::
ref_ptr
<
osg
::
Geode
>
(
new
osg
::
Geode
()
);
osg
::
ref_ptr
<
wosg
::
Geometry
>
geometry
=
osg
::
ref_ptr
<
wosg
::
Geometry
>
(
new
w
osg
::
Geometry
()
);
osg
::
ref_ptr
<
osg
::
Geometry
>
geometry
=
osg
::
ref_ptr
<
osg
::
Geometry
>
(
new
osg
::
Geometry
()
);
osg
::
Vec3Array
*
vertices
=
new
osg
::
Vec3Array
;
WBoundingBox
boundingBox
=
m_coordConverter
->
getBoundingBox
();
...
...
src/modules/coordinateSystem/WRulerOrtho.cpp
View file @
c4a515de
...
...
@@ -34,9 +34,6 @@
#include "core/common/WStringUtils.h"
#include "core/common/WPathHelper.h"
// Compatibility between OSG 3.2 and earlier versions
#include "core/graphicsEngine/WOSG.h"
#include "WRulerOrtho.h"
WRulerOrtho
::
WRulerOrtho
(
boost
::
shared_ptr
<
WCoordConverter
>
coordConverter
,
osg
::
Vec3
origin
,
scaleMode
mode
,
bool
showNumbers
)
:
...
...
@@ -59,7 +56,7 @@ WRulerOrtho::~WRulerOrtho()
void
WRulerOrtho
::
create
()
{
osg
::
ref_ptr
<
osg
::
Geode
>
rulerGeode
=
osg
::
ref_ptr
<
osg
::
Geode
>
(
new
osg
::
Geode
()
);
osg
::
ref_ptr
<
w
osg
::
Geometry
>
geometry
;
osg
::
ref_ptr
<
osg
::
Geometry
>
geometry
;
switch
(
m_scaleMode
)
{
...
...
@@ -127,9 +124,9 @@ void WRulerOrtho::addLabel( osg::Vec3 position, std::string text )
labelXform
->
addChild
(
labelGeode
);
}
osg
::
ref_ptr
<
w
osg
::
Geometry
>
WRulerOrtho
::
createXY
()
osg
::
ref_ptr
<
osg
::
Geometry
>
WRulerOrtho
::
createXY
()
{
osg
::
ref_ptr
<
wosg
::
Geometry
>
geometry
=
osg
::
ref_ptr
<
wosg
::
Geometry
>
(
new
w
osg
::
Geometry
()
);
osg
::
ref_ptr
<
osg
::
Geometry
>
geometry
=
osg
::
ref_ptr
<
osg
::
Geometry
>
(
new
osg
::
Geometry
()
);
osg
::
Vec3Array
*
vertices
=
new
osg
::
Vec3Array
;
int
startX
=
static_cast
<
int
>
(
m_lb
[
0
]
+
0.5
);
...
...
@@ -201,9 +198,9 @@ osg::ref_ptr< wosg::Geometry > WRulerOrtho::createXY()
return
geometry
;
}
osg
::
ref_ptr
<
w
osg
::
Geometry
>
WRulerOrtho
::
createXZ
()
osg
::
ref_ptr
<
osg
::
Geometry
>
WRulerOrtho
::
createXZ
()
{
osg
::
ref_ptr
<
wosg
::
Geometry
>
geometry
=
osg
::
ref_ptr
<
wosg
::
Geometry
>
(
new
w
osg
::
Geometry
()
);
osg
::
ref_ptr
<
osg
::
Geometry
>
geometry
=
osg
::
ref_ptr
<
osg
::
Geometry
>
(
new
osg
::
Geometry
()
);
osg
::
Vec3Array
*
vertices
=
new
osg
::
Vec3Array
;
int
startX
=
static_cast
<
int
>
(
m_lb
[
0
]
+
0.5
);
...
...
@@ -274,9 +271,9 @@ osg::ref_ptr< wosg::Geometry > WRulerOrtho::createXZ()
return
geometry
;
}
osg
::
ref_ptr
<
w
osg
::
Geometry
>
WRulerOrtho
::
createYX
()
osg
::
ref_ptr
<
osg
::
Geometry
>
WRulerOrtho
::
createYX
()
{
osg
::
ref_ptr
<
wosg
::
Geometry
>
geometry
=
osg
::
ref_ptr
<
wosg
::
Geometry
>
(
new
w
osg
::
Geometry
()
);
osg
::
ref_ptr
<
osg
::
Geometry
>
geometry
=
osg
::
ref_ptr
<
osg
::
Geometry
>
(
new
osg
::
Geometry
()
);
osg
::
Vec3Array
*
vertices
=
new
osg
::
Vec3Array
;
int
startY
=
static_cast
<
int
>
(
m_lb
[
1
]
+
0.5
);
...
...
@@ -349,9 +346,9 @@ osg::ref_ptr< wosg::Geometry > WRulerOrtho::createYX()
return
geometry
;
}
osg
::
ref_ptr
<
w
osg
::
Geometry
>
WRulerOrtho
::
createYZ
()
osg
::
ref_ptr
<
osg
::
Geometry
>
WRulerOrtho
::
createYZ
()
{
osg
::
ref_ptr
<
wosg
::
Geometry
>
geometry
=
osg
::
ref_ptr
<
wosg
::
Geometry
>
(
new
w
osg
::
Geometry
()
);
osg
::
ref_ptr
<
osg
::
Geometry
>
geometry
=
osg
::
ref_ptr
<
osg
::
Geometry
>
(
new
osg
::
Geometry
()
);
osg
::
Vec3Array
*
vertices
=
new
osg
::
Vec3Array
;
int
startY
=
static_cast
<
int
>
(
m_lb
[
1
]
+
0.5
);
...
...
@@ -424,9 +421,9 @@ osg::ref_ptr< wosg::Geometry > WRulerOrtho::createYZ()
return
geometry
;
}
osg
::
ref_ptr
<
w
osg
::
Geometry
>
WRulerOrtho
::
createZX
()
osg
::
ref_ptr
<
osg
::
Geometry
>
WRulerOrtho
::
createZX
()
{
osg
::
ref_ptr
<
wosg
::
Geometry
>
geometry
=
osg
::
ref_ptr
<
wosg
::
Geometry
>
(
new
w
osg
::
Geometry
()
);
osg
::
ref_ptr
<
osg
::
Geometry
>
geometry
=
osg
::
ref_ptr
<
osg
::
Geometry
>
(
new
osg
::
Geometry
()
);
osg
::
Vec3Array
*
vertices
=
new
osg
::
Vec3Array
;
int
startZ
=
static_cast
<
int
>
(
m_lb
[
2
]
+
0.5
);
...
...
@@ -499,9 +496,9 @@ osg::ref_ptr< wosg::Geometry > WRulerOrtho::createZX()
return
geometry
;
}
osg
::
ref_ptr
<
w
osg
::
Geometry
>
WRulerOrtho
::
createZY
()
osg
::
ref_ptr
<
osg
::
Geometry
>
WRulerOrtho
::
createZY
()
{
osg
::
ref_ptr
<
wosg
::
Geometry
>
geometry
=
osg
::
ref_ptr
<
wosg
::
Geometry
>
(
new
w
osg
::
Geometry
()
);
osg
::
ref_ptr
<
osg
::
Geometry
>
geometry
=
osg
::
ref_ptr
<
osg
::
Geometry
>
(
new
osg
::
Geometry
()
);
osg
::
Vec3Array
*
vertices
=
new
osg
::
Vec3Array
;
int
startZ
=
static_cast
<
int
>
(
m_lb
[
2
]
+
0.5
);
...
...
src/modules/coordinateSystem/WRulerOrtho.h
View file @
c4a515de
...
...
@@ -31,9 +31,6 @@
#include "core/common/math/linearAlgebra/WVectorFixed.h"
// Compatibility between OSG 3.2 and earlier versions
#include "core/graphicsEngine/WOSG.h"
#include "WCoordConverter.h"
#include "WRuler.h"
...
...
@@ -107,42 +104,42 @@ private:
*
* \return A part of the geometry of the ruler
*/
osg
::
ref_ptr
<
w
osg
::
Geometry
>
createXY
();
osg
::
ref_ptr
<
osg
::
Geometry
>
createXY
();
/**
* Helper function to create the ruler along the x axis
*
* \return A part of the geometry of the ruler
*/
osg
::
ref_ptr
<
w
osg
::
Geometry
>
createXZ
();
osg
::
ref_ptr
<
osg
::
Geometry
>
createXZ
();
/**
* Helper function to create the ruler along the y axis
*
* \return A part of the geometry of the ruler
*/
osg
::
ref_ptr
<
w
osg
::
Geometry
>
createYX
();
osg
::
ref_ptr
<
osg
::
Geometry
>
createYX
();
/**
* Helper function to create the ruler along the y axis
*
* \return A part of the geometry of the ruler
*/
osg
::
ref_ptr
<
w
osg
::
Geometry
>
createYZ
();
osg
::
ref_ptr
<
osg
::
Geometry
>
createYZ
();
/**
* Helper function to create the ruler along the z axis
*
* \return A part of the geometry of the ruler
*/
osg
::
ref_ptr
<
w
osg
::
Geometry
>
createZX
();
osg
::
ref_ptr
<
osg
::
Geometry
>
createZX
();
/**
* Helper function to create the ruler along the z axis
*
* \return A part of the geometry of the ruler
*/
osg
::
ref_ptr
<
w
osg
::
Geometry
>
createZY
();
osg
::
ref_ptr
<
osg
::
Geometry
>
createZY
();
/**
* converts a number into a string according to the currently selected coordinate system
...
...
src/modules/datasetProfile/WMDatasetProfile.cpp
View file @
c4a515de
...
...
@@ -36,9 +36,6 @@
#include "core/kernel/WKernel.h"
#include "core/kernel/WSelectionManager.h"
// Compatibility between OSG 3.2 and earlier versions
#include "core/graphicsEngine/WOSG.h"
#include "WMDatasetProfile.h"
#include "WMDatasetProfile.xpm" // Please put a real icon here.
...
...
@@ -339,7 +336,7 @@ void WMDatasetProfile::update()
{
osg
::
ref_ptr
<
osg
::
Vec3Array
>
vertices
=
osg
::
ref_ptr
<
osg
::
Vec3Array
>
(
new
osg
::
Vec3Array
);
osg
::
ref_ptr
<
osg
::
Vec4Array
>
colors
=
osg
::
ref_ptr
<
osg
::
Vec4Array
>
(
new
osg
::
Vec4Array
);
osg
::
ref_ptr
<
wosg
::
Geometry
>
geometry
=
osg
::
ref_ptr
<
wosg
::
Geometry
>
(
new
w
osg
::
Geometry
);
osg
::
ref_ptr
<
osg
::
Geometry
>
geometry
=
osg
::
ref_ptr
<
osg
::
Geometry
>
(
new
osg
::
Geometry
);
for
(
size_t
i
=
0
;
i
<
knobs
.
size
();
++
i
)
{
...
...
@@ -351,7 +348,7 @@ void WMDatasetProfile::update()
colors
->
push_back
(
m_graphColor
->
get
()
);
geometry
->
setColorArray
(
colors
);
geometry
->
setColorBinding
(
w
osg
::
Geometry
::
BIND_OVERALL
);
geometry
->
setColorBinding
(
osg
::
Geometry
::
BIND_OVERALL
);
// disable light for this geode as lines can't be lit properly
osg
::
StateSet
*
state
=
m_lineGeode
->
getOrCreateStateSet
();
...
...
@@ -402,7 +399,7 @@ osg::ref_ptr< osg::Geode > WMDatasetProfile::createGraphGridGeode()
osg
::
ref_ptr
<
osg
::
Vec3Array
>
vertices
=
osg
::
ref_ptr
<
osg
::
Vec3Array
>
(
new
osg
::
Vec3Array
);
osg
::
ref_ptr
<
osg
::
Vec4Array
>
colors
=
osg
::
ref_ptr
<
osg
::
Vec4Array
>
(
new
osg
::
Vec4Array
);
osg
::
ref_ptr
<
wosg
::
Geometry
>
geometry
=
osg
::
ref_ptr
<
wosg
::
Geometry
>
(
new
w
osg
::
Geometry
);
osg
::
ref_ptr
<
osg
::
Geometry
>
geometry
=
osg
::
ref_ptr
<
osg
::
Geometry
>
(
new
osg
::
Geometry
);
int
step
=
(
m_oldViewWidth
-
20
)
/
10
;