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
c3e12e05
Commit
c3e12e05
authored
Aug 11, 2010
by
Alexander Wiebel
Browse files
Options
Browse Files
Download
Plain Diff
[MERGE]
parents
8e0581fe
d989572a
Changes
13
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
777 additions
and
2 deletions
+777
-2
src/graphicsEngine/WGEZoomTrackballManipulator.cpp
src/graphicsEngine/WGEZoomTrackballManipulator.cpp
+5
-0
src/graphicsEngine/WGEZoomTrackballManipulator.h
src/graphicsEngine/WGEZoomTrackballManipulator.h
+7
-0
src/modules/coordinateHUD/CMakeLists.txt
src/modules/coordinateHUD/CMakeLists.txt
+42
-0
src/modules/coordinateHUD/WMCoordinateHUD.cpp
src/modules/coordinateHUD/WMCoordinateHUD.cpp
+377
-0
src/modules/coordinateHUD/WMCoordinateHUD.h
src/modules/coordinateHUD/WMCoordinateHUD.h
+172
-0
src/modules/coordinateHUD/coordinateHUD.xpm
src/modules/coordinateHUD/coordinateHUD.xpm
+24
-0
src/modules/coordinateHUD/option_1.xpm
src/modules/coordinateHUD/option_1.xpm
+23
-0
src/modules/coordinateHUD/option_2.xpm
src/modules/coordinateHUD/option_2.xpm
+23
-0
src/modules/coordinateHUD/option_3.xpm
src/modules/coordinateHUD/option_3.xpm
+23
-0
src/modules/coordinateHUD/shaders/WMCoordinateHUD-fragment.glsl
...dules/coordinateHUD/shaders/WMCoordinateHUD-fragment.glsl
+35
-0
src/modules/coordinateHUD/shaders/WMCoordinateHUD-vertex.glsl
...modules/coordinateHUD/shaders/WMCoordinateHUD-vertex.glsl
+43
-0
src/modules/modules-base.toolbox
src/modules/modules-base.toolbox
+1
-0
src/modules/modules-others.toolbox
src/modules/modules-others.toolbox
+2
-2
No files found.
src/graphicsEngine/WGEZoomTrackballManipulator.cpp
View file @
c3e12e05
...
...
@@ -49,6 +49,11 @@ osg::Matrixd WGEZoomTrackballManipulator::getMatrix() const
return
osg
::
Matrixd
::
scale
(
1.0
/
m_zoom
,
1.0
/
m_zoom
,
1.0
/
m_zoom
)
*
TrackballManipulator
::
getMatrix
();
}
osg
::
Matrixd
WGEZoomTrackballManipulator
::
getMatrixWithoutZoom
()
const
{
return
TrackballManipulator
::
getMatrix
();
}
osg
::
Matrixd
WGEZoomTrackballManipulator
::
getInverseMatrix
()
const
{
return
TrackballManipulator
::
getInverseMatrix
()
*
osg
::
Matrixd
::
scale
(
m_zoom
,
m_zoom
,
m_zoom
);
...
...
src/graphicsEngine/WGEZoomTrackballManipulator.h
View file @
c3e12e05
...
...
@@ -50,6 +50,13 @@ public:
*/
virtual
osg
::
Matrixd
getMatrix
()
const
;
/**
* Get the manipulator only containing rotation and translation.
*
* \return the matrix with translation and rotation.
*/
virtual
osg
::
Matrixd
getMatrixWithoutZoom
()
const
;
/**
* Get the position of the manipulator as a inverse matrix of the
* manipulator, typically used as a model view matrix.
...
...
src/modules/coordinateHUD/CMakeLists.txt
0 → 100644
View file @
c3e12e05
FILE
(
GLOB_RECURSE MODULES_SRC
"*.cpp"
"*.h"
)
# Grab module name and setup target directories
GET_FILENAME_COMPONENT
(
MODULE_NAME
${
CMAKE_CURRENT_SOURCE_DIR
}
NAME
)
SET
(
MODULE_TARGET_DIR
${
CMAKE_LIBRARY_OUTPUT_DIRECTORY
}
/modules/
${
MODULE_NAME
}
)
SET
(
CMAKE_LIBRARY_OUTPUT_DIRECTORY
${
MODULE_TARGET_DIR
}
)
SET
(
CMAKE_RUNTIME_OUTPUT_DIRECTORY
${
MODULE_TARGET_DIR
}
)
SET
(
MODULE_DIRNAME
${
MODULE_NAME
}
)
SET
(
MODULE_NAME
"OWmodule_
${
MODULE_NAME
}
"
)
# prefix all module names with "OWmodule_" to separate them from other libs
# Build module lib
ADD_LIBRARY
(
${
MODULE_NAME
}
SHARED
${
MODULES_SRC
}
)
TARGET_LINK_LIBRARIES
(
${
MODULE_NAME
}
OWkernel
)
# Copy local shaders to module target directory
IF
(
OW_COPY_SHADERS AND EXISTS
${
CMAKE_CURRENT_SOURCE_DIR
}
/shaders
)
# copy shaders only if the user wants it
ADD_CUSTOM_TARGET
(
${
MODULE_NAME
}
_CopyShaders
COMMAND
${
CMAKE_COMMAND
}
-E copy_directory
${
CMAKE_CURRENT_SOURCE_DIR
}
/shaders
${
MODULE_TARGET_DIR
}
/shaders/
COMMENT
"Copy shaders of
${
MODULE_NAME
}
"
)
ADD_DEPENDENCIES
(
${
MODULE_NAME
}
${
MODULE_NAME
}
_CopyShaders
)
ENDIF
()
# Build unit tests
IF
(
OW_COMPILE_TESTS
)
# This ensures that the test is copied to the module directory
SET
(
CMAKE_RUNTIME_OUTPUT_DIRECTORY
${
MODULE_TARGET_DIR
}
)
CXXTEST_ADD_TESTS_FROM_LIST
(
"
${
MODULES_SRC
}
"
"OWkernel;
${
MODULE_NAME
}
"
)
# Copy fixtures if they exist
IF
(
EXISTS
${
CMAKE_CURRENT_SOURCE_DIR
}
/test/fixtures
)
ADD_CUSTOM_TARGET
(
${
MODULE_NAME
}
_CopyFixtures
# as the "test" target runs in CMakes temporary build dir, the fixtures need to be placed there too.
COMMAND
${
CMAKE_COMMAND
}
-E copy_directory
${
CMAKE_CURRENT_SOURCE_DIR
}
/test/fixtures
${
CMAKE_BINARY_DIR
}
/modules/
${
MODULE_DIRNAME
}
/fixtures/
COMMENT
"Copy fixtures of
${
MODULE_NAME
}
"
)
ADD_DEPENDENCIES
(
${
MODULE_NAME
}
${
MODULE_NAME
}
_CopyFixtures
)
ENDIF
(
EXISTS
${
CMAKE_CURRENT_SOURCE_DIR
}
/test/fixtures
)
ENDIF
(
OW_COMPILE_TESTS
)
src/modules/coordinateHUD/WMCoordinateHUD.cpp
0 → 100644
View file @
c3e12e05
This diff is collapsed.
Click to expand it.
src/modules/coordinateHUD/WMCoordinateHUD.h
0 → 100644
View file @
c3e12e05
//---------------------------------------------------------------------------
//
// 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 WMCOORDINATEHUD_H
#define WMCOORDINATEHUD_H
#include <string>
#include <osg/Geode>
#include "../../common/WItemSelection.h"
#include "../../common/WItemSelector.h"
#include "../../graphicsEngine/WGEManagedGroupNode.h"
#include "../../graphicsEngine/WGEZoomTrackballManipulator.h"
#include "../../graphicsEngine/WShader.h"
#include "../../kernel/WModule.h"
#include "../../kernel/WModuleInputData.h"
#include "../../kernel/WModuleOutputData.h"
/**
* This module shows a coordinatesystem as HUD.
* The attenuation can be customized to users needs.
*/
class
WMCoordinateHUD
:
public
WModule
,
public
osg
::
Referenced
{
public:
/**
* Default constructor.
*/
WMCoordinateHUD
();
/**
* Destructor.
*/
virtual
~
WMCoordinateHUD
();
/**
* Gives back the name of this module.
* \return the module's name.
*/
virtual
const
std
::
string
getName
()
const
;
/**
* Gives back a description of this module.
* \return description to module.
*/
virtual
const
std
::
string
getDescription
()
const
;
/**
* Due to the prototype design pattern used to build modules, this method returns a new instance of this method. NOTE: it
* should never be initialized or modified in some other way. A simple new instance is required.
*
* \return the prototype used to create every module in OpenWalnut.
*/
virtual
boost
::
shared_ptr
<
WModule
>
factory
()
const
;
/**
* Get the icon for this module in XPM format.
*/
virtual
const
char
**
getXPMIcon
()
const
;
protected:
/**
* Entry point after loading the module. Runs in separate thread.
*/
virtual
void
moduleMain
();
/**
* Initialize the connectors this module is using.
*/
virtual
void
connectors
();
/**
* Initialize the properties for this module.
*/
virtual
void
properties
();
/**
* Build the geode for colorfull coordinate axis
*/
virtual
void
buildColorAxis
();
/**
* build the geode for black & white coordinate axis
*/
virtual
void
buildBWAxis
();
/**
* build the geode for black & white coordinate cube
*/
virtual
void
buildColorCube
();
/**
* build the geometry of the cube
*/
virtual
osg
::
Vec3Array
*
buildCubeVertices
();
/**
* build the geometry of the axis
*/
virtual
osg
::
Vec3Array
*
buildAxisVertices
();
/**
* create caption for medical plane
*/
virtual
void
buildCaption
();
/**
* The root node used for this modules graphics.
*/
osg
::
ref_ptr
<
WGEManagedGroupNode
>
m_rootNode
;
/**
* The geometry rendered by this module.
*/
osg
::
ref_ptr
<
osg
::
Geode
>
m_geode
;
/**
* The caption rendered by this module.
*/
osg
::
ref_ptr
<
osg
::
Geode
>
m_txtGeode
;
private:
/**
* the shader
*/
osg
::
ref_ptr
<
WShader
>
m_shader
;
/**
* A condition used to notify about changes in several properties.
*/
boost
::
shared_ptr
<
WCondition
>
m_propCondition
;
/**
* A property allowing the user to select ONE item of some list
*/
WPropSelection
m_aSingleSelection
;
/**
* A list of items that can be selected using m_aSingleSelection or m_aMultiSelection.
*/
boost
::
shared_ptr
<
WItemSelection
>
m_possibleSelections
;
};
#endif // WMCOORDINATEHUD_H
src/modules/coordinateHUD/coordinateHUD.xpm
0 → 100644
View file @
c3e12e05
/* XPM */
static const char * coordinateHUD_xpm[] = {
"16 16 5 1",
" c None",
". c #FF0000",
"+ c #0072FF",
"@ c #000000",
"# c #12FF00",
".. ++",
".. ++",
".. ++ ",
".. ++ ",
".. ++ ",
".. ++ ",
".. ++ ",
".. ++ ",
".. ++ ",
".. ++ ",
".@@ @+@@ @ @@@@ ",
".@@ @+@@ @ @@ @@",
".@@@@ @@ @ @@ @",
".@@+@ @@ @ @@ @@",
".@@#@#@@@@#@@@@#",
"..##############"};
src/modules/coordinateHUD/option_1.xpm
0 → 100644
View file @
c3e12e05
/* XPM */
static const char * option_1_xpm[] = {
"16 16 4 1",
" c None",
". c #FF0000",
"+ c #0072FF",
"@ c #12FF00",
".. ++",
".. ++",
".. ++ ",
".. ++ ",
".. ++ ",
".. ++ ",
".. ++ ",
".. ++ ",
".. ++ ",
".. ++ ",
".. ++ ",
".. ++ ",
"..++ ",
"..++ ",
"..@@@@@@@@@@@@@@",
"..@@@@@@@@@@@@@@"};
src/modules/coordinateHUD/option_2.xpm
0 → 100644
View file @
c3e12e05
/* XPM */
static const char * option_2_xpm[] = {
"16 16 4 1",
" c None",
". c #363636",
"+ c #646464",
"@ c #BABABA",
".. ++",
".. ++",
".. ++ ",
".. ++ ",
".. ++ ",
".. ++ ",
".. ++ ",
".. ++ ",
".. ++ ",
".. ++ ",
".. ++ ",
".. ++ ",
"..++ ",
"..++ ",
"..@@@@@@@@@@@@@@",
"..@@@@@@@@@@@@@@"};
src/modules/coordinateHUD/option_3.xpm
0 → 100644
View file @
c3e12e05
/* XPM */
static const char * option_3_xpm[] = {
"16 16 4 1",
" c None",
". c #0072FF",
"+ c #12FF00",
"@ c #FF0000",
" ",
" ",
" ",
" ........... ",
" ...........+ ",
" ...........++ ",
"...........+++ ",
"@@@@@@@@@@++++ ",
"@@@@@@@@@@++++ ",
"@@@@@@@@@@++++ ",
"@@@@@@@@@@++++ ",
"@@@@@@@@@@++++ ",
"@@@@@@@@@@++++ ",
"@@@@@@@@@@+++ ",
"@@@@@@@@@@++ ",
"@@@@@@@@@@+ "};
src/modules/coordinateHUD/shaders/WMCoordinateHUD-fragment.glsl
0 → 100644
View file @
c3e12e05
//---------------------------------------------------------------------------
//
// 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/>.
//
//---------------------------------------------------------------------------
#version 120
void
main
()
{
// simply set the color. All the magic happens in vertex shader.
gl_FragColor
=
gl_Color
;
// this line ensures that the coordinate system is always on top.
gl_FragDepth
=
0
.
001
*
gl_FragCoord
.
z
;
}
src/modules/coordinateHUD/shaders/WMCoordinateHUD-vertex.glsl
0 → 100644
View file @
c3e12e05
//---------------------------------------------------------------------------
//
// 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/>.
//
//--------------------------------------------------------------------------
#version 120
void
main
()
{
// keep color
gl_FrontColor
=
gl_Color
;
// get the scaling applied during transformation from model space to camera space
vec4
vertexScale
=
gl_ModelViewMatrix
*
vec4
(
1
.
0
,
0
.
0
,
0
.
0
,
0
.
0
);
// <- needs to be of length 1
float
s
=
1
.
0
/
length
(
vertexScale
);
float
size
=
25
.
0
;
// project
vec4
vertexInScreenSpace
=
gl_ModelViewProjectionMatrix
*
vec4
(
s
*
size
*
gl_Vertex
.
xyz
,
0
.
0
);
vertexInScreenSpace
.
w
=
1
.
0
;
gl_Position
=
vec4
(
-
0
.
75
,
-
0
.
75
,
0
.
0
,
0
.
0
)
+
vertexInScreenSpace
;
}
src/modules/modules-base.toolbox
View file @
c3e12e05
...
...
@@ -2,6 +2,7 @@
ADD_SUBDIRECTORY( arbitraryRois )
ADD_SUBDIRECTORY( boundingBox )
ADD_SUBDIRECTORY( coordinateHUD )
ADD_SUBDIRECTORY( coordinateSystem )
ADD_SUBDIRECTORY( distanceMap )
ADD_SUBDIRECTORY( distanceMapIsosurface )
...
...
src/modules/modules-others.toolbox
View file @
c3e12e05
ADD_SUBDIRECTORY( applyMask )
ADD_SUBDIRECTORY( arbitraryPlane )
ADD_SUBDIRECTORY( atlasSurfaces )
ADD_SUBDIRECTORY( clusterParamDisplay )
ADD_SUBDIRECTORY( clusterSlicer )
...
...
@@ -14,8 +16,6 @@ ADD_SUBDIRECTORY( probTractDisplay )
ADD_SUBDIRECTORY( scalarSegmentation )
ADD_SUBDIRECTORY( splineSurface )
ADD_SUBDIRECTORY( surfaceParameterAnimator )
ADD_SUBDIRECTORY( applyMask )
ADD_SUBDIRECTORY( arbitraryPlane )
IF( Teem_FOUND )
ADD_SUBDIRECTORY( homeGlyphs )
...
...
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