25 #ifndef WMPOINTCONNECTOR_H
26 #define WMPOINTCONNECTOR_H
35 #include "core/dataHandler/WDataSetFibers.h"
36 #include "core/dataHandler/WDataSetPoints.h"
37 #include "core/graphicsEngine/onscreenSelection/WOnscreenSelection.h"
38 #include "core/kernel/WKernel.h"
39 #include "core/kernel/WModule.h"
40 #include "core/kernel/WModuleContainer.h"
41 #include "core/kernel/WModuleInputData.h"
42 #include "core/kernel/WModuleOutputData.h"
44 #include "../fiberDisplay/WMFiberDisplay.h"
45 #include "../pointRenderer/WMPointRenderer.h"
78 typedef std::shared_ptr< WMPointConnector >
SPtr;
94 virtual const std::string
getName()
const;
108 virtual std::shared_ptr< WModule >
factory()
const;
123 void handleClick( osg::Vec3 cameraPosition, osg::Vec3 direction,
bool isLeftClick );
204 float hitVertex( osg::Vec3 rayStart, osg::Vec3 rayDir, osg::Vec3 vertex,
float radius );
235 bool findClickedPoint( osg::Vec3 cameraPosition, osg::Vec3 direction,
size_t* hitIdx );
std::shared_ptr< WCondition > SPtr
Shared pointer type for WCondition.
Holds the data of the WMPointConnector.
Handles the fibers of the WMPointsConnector.
The keyboard handler for the keyboard events of WMPointConnector.
Test functionality of WMPointConnector class.
This module connects the points in a point dataset.
WModule::SPtr m_fiberDisplay
The WMFiberDisplay associated with this module.
std::shared_ptr< std::vector< size_t > > SPSizeVector
represents a std::shared_ptr to a vector containing a vector of size_t.
virtual void activate()
Deactivates or activates the inner modules when active changes.
WPropDouble m_adaptiveVisibilityAngle
Property to set the angle for the adaptive visibility.
bool isAdaptivelyHidden(osg::Vec3 vertex, osg::Vec3 *from=NULL)
Checks whether a vertex is adaptively hidden.
virtual void properties()
Initialize the properties for this module.
std::shared_ptr< WConnectorData > m_connectorData
The data of this module.
void updateAll()
Updates all.
WPropDouble m_hiddenOpacity
Property to set the opacity of the hidden points.
WPropPosition m_scaling
Property for the scaling as Vector.
WMPointConnector()
Constructor.
std::vector< std::function< void() > > m_eventQueue
A vector for the events.
virtual ~WMPointConnector()
Destructor.
std::shared_ptr< WOnscreenSelection > getOnscreenSelection()
float hitVertex(osg::Vec3 rayStart, osg::Vec3 rayDir, osg::Vec3 vertex, float radius)
Checks if a vertex with a certain radius is hit by a ray.
WPropBool m_enableAdaptiveVisibility
Property to enable adaptive visibility.
WPropPosition getScaling()
void handleInput()
Handles the input of this module.
bool findClickedPoint(osg::Vec3 cameraPosition, osg::Vec3 direction, size_t *hitIdx)
Finds the point that was clicked and writes it into hitIdx, while return whether a point was hit.
void pushEventQueue(std::function< void() > func)
Pushes a function to the selection queue.
void createHandler()
Creates the WKeyboardHandler and registers them.
std::shared_ptr< WModuleOutputData< WDataSetFibers > > m_fiberOutput
An output connector used to provide fibers to other modules.
void handleRightSelection(std::vector< WPosition > positions)
Handles the selection of a right click.
std::mutex m_eventMutex
A mutex for the vector to make it thread-safe.
std::shared_ptr< WMPointConnector > SPtr
A shared_ptr to this class.
virtual void connectors()
Initialize the connectors this module is using.
std::shared_ptr< WFiberHandler > getFiberHandler()
WModule::SPtr m_pointRenderer
The WMPointRenderer associated with this module.
void acceptPrediction()
Accepts the current prediction.
std::shared_ptr< WConnectorData > getConnectorData()
WPropBool m_enableSizes
Property to enable the sizes.
virtual void moduleMain()
Entry point after loading the module.
osg::ref_ptr< WKeyboardHandler > m_keyboardHandler
The keyboard handler for this point connector.
virtual const std::string getDescription() const
Gives back a description of this module.
std::shared_ptr< std::vector< float > > SPFloatVector
represents a std::shared_ptr to a vector containing a vector of floats.
std::vector< WPosition > m_prediction
The current prediction.
std::shared_ptr< WModuleInputData< WDataSetPoints > > m_pointInput
An input connector used to get points from other modules.
void createPrediction()
Creates a track continuation prediction.
void toggleActivationOfModule(WModule::SPtr mod)
Toggles the activation of a module.
void handleClickSelection(bool clickType, double x, double y)
Handles a selection with only one click.
virtual std::shared_ptr< WModule > factory() const
Due to the prototype design pattern used to build modules, this method returns a new instance of this...
void selectionEnd(WOnscreenSelection::WSelectionType type, float x, float y)
The end callback of m_onscreenSelection.
virtual const char ** getXPMIcon() const
Get the icon for this module in XPM format.
void createFiberDisplay()
Creates the WMFiberDisplay and runs it.
void updateOutput()
Updates the fiber output.
std::shared_ptr< WModuleOutputData< WDataSetPoints > > m_pointOutput
The internal pointOutput to pass data to the WMPointRenderer.
std::shared_ptr< WFiberHandler > m_fiberHandler
The WFiberHandler of this module.
WCondition::SPtr m_eventCondition
A condition notifying when something was added to the event queue.
void updatePoints()
Redraws the current vertices with their colors.
WPropBool m_enableSAPT
Property to enable the adjusted dijkstra.
void handleLeftSelection(std::vector< WPosition > positions)
Handles the selection of a left click.
virtual const std::string getName() const
Gives back the name of this module.
void handleClick(osg::Vec3 cameraPosition, osg::Vec3 direction, bool isLeftClick)
Handles a click on the drawing area.
void createPointRenderer()
Creates the WMPointRenderer and runs it.
std::shared_ptr< WOnscreenSelection > m_onscreenSelection
Enables possibility for multiselection of points.
WPropBool m_enablePrediction
Enables the prediction.
Class able to contain other modules.
std::shared_ptr< WModule > SPtr
Shared pointer to a WModule.
WSelectionType
The different types of selection.