25 #ifndef WONSCREENSELECTION_H
26 #define WONSCREENSELECTION_H
30 #include <boost/function.hpp>
33 #include <osg/Geometry>
34 #include <osg/LineWidth>
35 #include <osg/Projection>
37 #include "core/graphicsEngine/postprocessing/WGEPostprocessingNode.h"
38 #include "core/graphicsEngine/shaders/WGEShader.h"
39 #include "core/kernel/WKernel.h"
40 #include "WOnscreenSelectionHandler.h"
82 void start(
float x,
float y );
90 void end(
float x,
float y );
98 void move(
float x,
float y );
127 std::vector< WPosition >
isSelected( std::vector< WPosition> positions );
Handles the GUIEvents in context of the WOnscreenSelection.
Manages different types of selection.
std::vector< WPosition > m_line
The points that are used for the selection.
bool lineloopCheck(float x, float y)
Check for the lineloop selection.
osg::ref_ptr< osg::Projection > m_projection
The Projection to draw on.
void setSelectionType(enum WSelectionType selectionType)
Sets the current selection type.
void clear()
Clears the current selection.
void start(float x, float y)
Starts the selection.
CallbackType m_onend
The Callback for the end function.
bool brushCheck(float x, float y)
Check for the brush selection.
osg::ref_ptr< WGEShader > m_shader
The shader for the selection.
int crossingNumberProduct(float x, float y, WPosition b, WPosition c)
Calculates the crossing number product.
void setOnmove(CallbackType onmove)
Sets the callback for the onmove function.
void setOnend(CallbackType onend)
Sets the callback for the onend function.
float m_thickness
The thickness of the brush.
CallbackType m_onmove
The Callback for the move function.
bool getClickType()
Gets the click type.
CallbackType m_onstart
The Callback for the start function.
void setClickType(bool clickType)
Sets the click type.
~WOnscreenSelection()
Cleans up all the now unneeded drawing context stuff.
bool m_clickType
Whether this is a left click or not.
bool isSelected(float x, float y, float z)
Whether a point is selected or not.
void move(float x, float y)
Handles mouse move while selecting.
bool m_moved
Whether the mouse has been moved.
WOnscreenSelection()
Not only creates the Object but also sets up the drawing context.
bool m_isSelecting
Whether a selection has been started or not.
enum WSelectionType getSelectionType()
Gets the current selection type.
void setOnstart(CallbackType onstart)
Sets the callback for the onstart function.
bool boxCheck(float x, float y)
Check for the box selection.
void updateDisplay()
Updates the current rendered data.
WSelectionType
The different types of selection.
bool isSelecting()
Returns whether this manager is currently creating a selection.
void end(float x, float y)
Ends the selection.
osg::ref_ptr< WOnscreenSelectionHandler > m_selectionHandler
The SelectionHandler for this object.
boost::function< void(enum WSelectionType, float, float) > CallbackType
A typedef for the type of the callbacks.
enum WSelectionType m_selectionType
The current selection type.
This only is a 3d double vector.