![]() |
OpenWalnut
1.5.0dev
|
Handles the fibers of the WMPointsConnector. More...
#include <WFiberHandler.h>
Collaboration diagram for WFiberHandler:Public Types | |
| typedef std::shared_ptr< WFiberHandler > | SPtr |
| A shared_ptr to this class. More... | |
| typedef WItemSelectionItemTyped< std::string > | ItemType |
| Type of selectable items. More... | |
| typedef std::vector< osg::Vec3 > | PCFiber |
| Vector of 3D vectors, representing points. More... | |
| typedef std::vector< PCFiber > | PCFiberList |
| Vector, that could contain multiple fibers. More... | |
| typedef std::shared_ptr< PCFiberList > | PCFiberListSPtr |
| Shared pointer to fibers-vector. More... | |
Public Member Functions | |
| WFiberHandler (WMPointConnector *pointConnector) | |
| Creates the list of fibers. More... | |
| void | createProperties (WPropertyGroup::SPtr properties) |
| Creates the properties for this handler. More... | |
| void | addVertexToFiber (osg::Vec3 vertex, size_t fiberIdx, bool silent=false) |
| Adds a vertex to the currently selected fiber. More... | |
| void | addVerticesToFiber (std::vector< osg::Vec3 > vertices, size_t fiberIdx, bool silent=false) |
| Adds multiple vertices to the currently selected fiber. More... | |
| void | addVertexToFiberAt (osg::Vec3 vertex, size_t fiberIdx, size_t position, bool silent=false) |
| Adds a vertex to the currently selected fiber. More... | |
| void | removeVertexFromFiber (osg::Vec3 vertex, size_t fiberIdx, bool silent=false) |
| Removes a vertex from the currently selected fiber. More... | |
| void | removeVerticesFromFiber (std::vector< osg::Vec3 > vertices, size_t fiberIdx, bool silent=false) |
| Removes multiple vertices from the currently selected fiber. More... | |
| void | addFiber (std::string name, bool silent=false, bool updateSelector=true) |
| Adds a new fiber. More... | |
| void | addFiberAt (std::string name, size_t position, bool hidden, bool silent=false, PCFiber fiber=PCFiber()) |
| Adds a new or an old fiber at a specific position. More... | |
| void | removeFiber (size_t idx, bool silent=false, bool updateSelector=true) |
| Removes a fiber at an index in the fibers vector. More... | |
| void | toggleFiber (size_t idx, bool silent=false) |
| Toggles the visibility of a fiber. More... | |
| void | createNewFiber () |
| Creates a new fiber. More... | |
| void | selectorUpdate (size_t idx) |
| Updates the UI selector. More... | |
| void | clear () |
| Clears the data in this handler. More... | |
| void | selectFiber (size_t idx) |
| Selects a fiber by its index in the fibers vector. More... | |
| void | selectLastPoint () |
| Selects the last point of the currently selected fiber. More... | |
| void | sortVertices () |
| Sorts the vertices by their z value. More... | |
| bool | isHidden (size_t idx) |
| Checks if a fiber is hidden. More... | |
| bool | getFiberOfPoint (osg::Vec3 vertex, size_t *idx=NULL) |
| Gets the index of the fiber of a point. More... | |
| bool | isPointHidden (osg::Vec3 vertex) |
| Checks whether a point is in a hidden fiber. More... | |
| PCFiberListSPtr | getFibers () |
| WMPointConnector * | getPointConnector () |
| size_t | getSelectedFiber () |
| WActionHandler::SPtr | getActionHandler () |
| void | setFiberCount (size_t fiberCount) |
| Sets the fiber count. More... | |
Private Member Functions | |
| void | updateProperty (WPropertyBase::SPtr property) |
| Update handler for the properties. More... | |
Private Attributes | |
| WMPointConnector * | m_pointConnector |
| A reference to the WMPointConnector this belongs to. More... | |
| WActionHandler::SPtr | m_actionHandler |
| Handles the undo and redo action. More... | |
| int | m_fiberCount = 0 |
| Stores the amount of new created fibers. More... | |
| size_t | m_selectedFiber = 0 |
| Represents the index of the current active fiber. More... | |
| std::shared_ptr< WItemSelection > | m_possibleFiberSelections |
| The list of possible fibers, which can be selected. More... | |
| WPropSelection | m_fiberSelection |
| Represents the current active fiber selection property. More... | |
| WPropSelection | m_selectionType |
| The type of the selection. More... | |
| WPropTrigger | m_addFiber |
| Property (button) to add a new fiber. More... | |
| WPropTrigger | m_removeFiber |
| Property (button) to remove a fiber. More... | |
| WPropTrigger | m_toggleFiber |
| Property (button) to toggle the visibility of a fiber. More... | |
| WPropTrigger | m_undoTrigger |
| Property (button) to undo the last action. More... | |
| WPropTrigger | m_redoTrigger |
| Property (button) to redo the last action. More... | |
| PCFiberListSPtr | m_fibers |
| A pointer to the list of fibers. More... | |
| std::shared_ptr< std::vector< char > > | m_hidden |
| Vector for the visibility of the fibers. More... | |
Handles the fibers of the WMPointsConnector.
Definition at line 47 of file WFiberHandler.h.
| typedef WItemSelectionItemTyped< std::string > WFiberHandler::ItemType |
Type of selectable items.
Definition at line 58 of file WFiberHandler.h.
| typedef std::vector< osg::Vec3 > WFiberHandler::PCFiber |
Vector of 3D vectors, representing points.
Definition at line 63 of file WFiberHandler.h.
| typedef std::vector< PCFiber > WFiberHandler::PCFiberList |
Vector, that could contain multiple fibers.
Definition at line 68 of file WFiberHandler.h.
| typedef std::shared_ptr< PCFiberList > WFiberHandler::PCFiberListSPtr |
Shared pointer to fibers-vector.
Definition at line 73 of file WFiberHandler.h.
| typedef std::shared_ptr< WFiberHandler > WFiberHandler::SPtr |
A shared_ptr to this class.
Definition at line 53 of file WFiberHandler.h.
|
explicit |
Creates the list of fibers.
| pointConnector | The WMPointConnector this belongs to. |
Definition at line 42 of file WFiberHandler.cpp.
References m_actionHandler, m_fiberCount, m_fibers, m_hidden, m_pointConnector, and m_selectedFiber.
| void WFiberHandler::addFiber | ( | std::string | name, |
| bool | silent = false, |
||
| bool | updateSelector = true |
||
| ) |
Adds a new fiber.
| name | The name of the fiber. |
| silent | Whether or not this should add to the undo stack. |
| updateSelector | Whether the UI selector should be updated |
Definition at line 238 of file WFiberHandler.cpp.
References WItemSelectionItemTyped< T >::create(), m_actionHandler, m_fibers, m_hidden, m_possibleFiberSelections, and selectorUpdate().
Referenced by clear(), createNewFiber(), and createProperties().
Here is the call graph for this function:
Here is the caller graph for this function:| void WFiberHandler::addFiberAt | ( | std::string | name, |
| size_t | position, | ||
| bool | hidden, | ||
| bool | silent = false, |
||
| PCFiber | fiber = PCFiber() |
||
| ) |
Adds a new or an old fiber at a specific position.
| name | The name of the fiber. |
| position | The position of the fiber. |
| hidden | Whether the fiber is hidden or not. |
| silent | Whether or not this should add to the undo stack. |
| fiber | The fiber to add. |
Definition at line 261 of file WFiberHandler.cpp.
References WItemSelectionItemTyped< T >::create(), m_actionHandler, m_fibers, m_fiberSelection, m_hidden, m_pointConnector, m_possibleFiberSelections, and WMPointConnector::updateOutput().
Referenced by WFiberActionAddFiber::redo(), and WFiberActionRemoveFiber::undo().
Here is the call graph for this function:
Here is the caller graph for this function:| void WFiberHandler::addVertexToFiber | ( | osg::Vec3 | vertex, |
| size_t | fiberIdx, | ||
| bool | silent = false |
||
| ) |
Adds a vertex to the currently selected fiber.
| vertex | The vertex to add. |
| fiberIdx | The index of the fiber to add the vertex to. |
| silent | Whether or not this should add to the undo stack. |
Definition at line 84 of file WFiberHandler.cpp.
References m_actionHandler, m_fibers, and sortVertices().
Referenced by WFiberActionAddVertex::redo().
Here is the call graph for this function:
Here is the caller graph for this function:| void WFiberHandler::addVertexToFiberAt | ( | osg::Vec3 | vertex, |
| size_t | fiberIdx, | ||
| size_t | position, | ||
| bool | silent = false |
||
| ) |
Adds a vertex to the currently selected fiber.
| vertex | The vertex to add. |
| fiberIdx | The index of the fiber to add the vertex to. |
| position | The position where to add the vertex. |
| silent | Whether or not this should add to the undo stack. |
Definition at line 149 of file WFiberHandler.cpp.
References m_actionHandler, and m_fibers.
Referenced by WFiberActionRemoveVertex::undo().
Here is the caller graph for this function:| void WFiberHandler::addVerticesToFiber | ( | std::vector< osg::Vec3 > | vertices, |
| size_t | fiberIdx, | ||
| bool | silent = false |
||
| ) |
Adds multiple vertices to the currently selected fiber.
| vertices | The vertices to add. |
| fiberIdx | The index of the fiber to add the vertex to. |
| silent | Whether or not this should add to the undo stack. |
Definition at line 101 of file WFiberHandler.cpp.
References m_actionHandler, m_fibers, and sortVertices().
Referenced by WFiberActionMultiselect::redo(), and WFiberActionMultideselect::undo().
Here is the call graph for this function:
Here is the caller graph for this function:| void WFiberHandler::clear | ( | ) |
Clears the data in this handler.
Definition at line 181 of file WFiberHandler.cpp.
References addFiber(), m_fiberCount, m_fibers, m_hidden, m_possibleFiberSelections, and m_selectedFiber.
Here is the call graph for this function:| void WFiberHandler::createNewFiber | ( | ) |
Creates a new fiber.
Definition at line 439 of file WFiberHandler.cpp.
References addFiber(), and m_fiberCount.
Referenced by updateProperty().
Here is the call graph for this function:
Here is the caller graph for this function:| void WFiberHandler::createProperties | ( | WPropertyGroup::SPtr | properties | ) |
Creates the properties for this handler.
| properties | The PropertyGroup to add the properties to. |
Definition at line 201 of file WFiberHandler.cpp.
References addFiber(), WPropertyHelper::PC_SELECTONLYONE::addTo(), WPropertyHelper::PC_NOTEMPTY::addTo(), WItemSelectionItemTyped< T >::create(), m_addFiber, m_fiberSelection, m_possibleFiberSelections, m_redoTrigger, m_removeFiber, m_selectionType, m_toggleFiber, m_undoTrigger, WPVBaseTypes::PV_TRIGGER_READY, and updateProperty().
Here is the call graph for this function:| WActionHandler::SPtr WFiberHandler::getActionHandler | ( | ) |
Definition at line 429 of file WFiberHandler.cpp.
References m_actionHandler.
| bool WFiberHandler::getFiberOfPoint | ( | osg::Vec3 | vertex, |
| size_t * | idx = NULL |
||
| ) |
Gets the index of the fiber of a point.
| vertex | The point to check. |
| idx | The index of the fiber of the point. This is a pointer and the secondary output. If this is NULL it is ignored. |
Definition at line 352 of file WFiberHandler.cpp.
References m_fibers.
Referenced by isPointHidden().
Here is the caller graph for this function:| WFiberHandler::PCFiberListSPtr WFiberHandler::getFibers | ( | ) |
Definition at line 413 of file WFiberHandler.cpp.
References m_fibers.
| WMPointConnector * WFiberHandler::getPointConnector | ( | ) |
Definition at line 419 of file WFiberHandler.cpp.
References m_pointConnector.
Referenced by WFiberActionAddVertex::redo(), WFiberActionMultideselect::redo(), WFiberActionMultiselect::redo(), WFiberActionRemoveVertex::redo(), WFiberActionAddVertex::undo(), WFiberActionMultideselect::undo(), WFiberActionMultiselect::undo(), and WFiberActionRemoveVertex::undo().
Here is the caller graph for this function:| size_t WFiberHandler::getSelectedFiber | ( | ) |
Definition at line 424 of file WFiberHandler.cpp.
References m_selectedFiber.
| bool WFiberHandler::isHidden | ( | size_t | idx | ) |
Checks if a fiber is hidden.
| idx | The index of the fiber to check. |
Definition at line 337 of file WFiberHandler.cpp.
References m_hidden.
Referenced by isPointHidden(), and toggleFiber().
Here is the caller graph for this function:| bool WFiberHandler::isPointHidden | ( | osg::Vec3 | vertex | ) |
Checks whether a point is in a hidden fiber.
| vertex | The point to check. |
Definition at line 369 of file WFiberHandler.cpp.
References getFiberOfPoint(), and isHidden().
Here is the call graph for this function:| void WFiberHandler::removeFiber | ( | size_t | idx, |
| bool | silent = false, |
||
| bool | updateSelector = true |
||
| ) |
Removes a fiber at an index in the fibers vector.
| idx | The index of the fiber. |
| silent | Whether or not this should add to the undo stack. |
| updateSelector | Whether the UI selector should be updated |
Definition at line 282 of file WFiberHandler.cpp.
References m_actionHandler, m_fibers, m_hidden, m_pointConnector, m_possibleFiberSelections, selectorUpdate(), and WMPointConnector::updateOutput().
Referenced by WFiberActionRemoveFiber::redo(), WFiberActionAddFiber::undo(), and updateProperty().
Here is the call graph for this function:
Here is the caller graph for this function:| void WFiberHandler::removeVertexFromFiber | ( | osg::Vec3 | vertex, |
| size_t | fiberIdx, | ||
| bool | silent = false |
||
| ) |
Removes a vertex from the currently selected fiber.
| vertex | The vertex to remove. |
| fiberIdx | The index of the fiber to remove the vertex from. |
| silent | Whether or not this should add to the undo stack. |
Definition at line 160 of file WFiberHandler.cpp.
References m_actionHandler, and m_fibers.
Referenced by WFiberActionRemoveVertex::redo(), and WFiberActionAddVertex::undo().
Here is the caller graph for this function:| void WFiberHandler::removeVerticesFromFiber | ( | std::vector< osg::Vec3 > | vertices, |
| size_t | fiberIdx, | ||
| bool | silent = false |
||
| ) |
Removes multiple vertices from the currently selected fiber.
| vertices | The vertices to remove. |
| fiberIdx | The index of the fiber to remove the vertex from. |
| silent | Whether or not this should add to the undo stack. |
Definition at line 130 of file WFiberHandler.cpp.
References m_actionHandler, and m_fibers.
Referenced by WFiberActionMultideselect::redo(), and WFiberActionMultiselect::undo().
Here is the caller graph for this function:| void WFiberHandler::selectFiber | ( | size_t | idx | ) |
Selects a fiber by its index in the fibers vector.
| idx | The index of the fiber. |
Definition at line 342 of file WFiberHandler.cpp.
References WMPointConnector::getConnectorData(), m_pointConnector, m_selectedFiber, selectLastPoint(), and WMPointConnector::updateAll().
Referenced by updateProperty().
Here is the call graph for this function:
Here is the caller graph for this function:| void WFiberHandler::selectLastPoint | ( | ) |
Selects the last point of the currently selected fiber.
Definition at line 192 of file WFiberHandler.cpp.
References WMPointConnector::getConnectorData(), m_fibers, m_pointConnector, and m_selectedFiber.
Referenced by WFiberActionAddVertex::redo(), WFiberActionMultideselect::redo(), WFiberActionMultiselect::redo(), WFiberActionRemoveVertex::redo(), selectFiber(), WFiberActionAddVertex::undo(), WFiberActionMultideselect::undo(), WFiberActionMultiselect::undo(), and WFiberActionRemoveVertex::undo().
Here is the call graph for this function:
Here is the caller graph for this function:| void WFiberHandler::selectorUpdate | ( | size_t | idx | ) |
Updates the UI selector.
| idx | index of the selected fiber. |
Definition at line 256 of file WFiberHandler.cpp.
References m_fiberSelection, and m_possibleFiberSelections.
Referenced by addFiber(), and removeFiber().
Here is the caller graph for this function:| void WFiberHandler::setFiberCount | ( | size_t | fiberCount | ) |
Sets the fiber count.
| fiberCount | The new fiber count. |
Definition at line 434 of file WFiberHandler.cpp.
References m_fiberCount.
| void WFiberHandler::sortVertices | ( | ) |
Sorts the vertices by their z value.
Definition at line 53 of file WFiberHandler.cpp.
References m_fibers.
Referenced by addVertexToFiber(), and addVerticesToFiber().
Here is the caller graph for this function:| void WFiberHandler::toggleFiber | ( | size_t | idx, |
| bool | silent = false |
||
| ) |
Toggles the visibility of a fiber.
| idx | The index of the fiber. |
| silent | Whether or not this should add to the undo stack. |
Definition at line 312 of file WFiberHandler.cpp.
References WItemSelectionItemTyped< T >::create(), isHidden(), m_actionHandler, m_fiberSelection, m_hidden, m_pointConnector, m_possibleFiberSelections, and WMPointConnector::updateAll().
Referenced by WFiberActionToggle::redo(), WFiberActionToggle::undo(), and updateProperty().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Update handler for the properties.
| property | updated property |
Definition at line 375 of file WFiberHandler.cpp.
References createNewFiber(), WMPointConnector::getOnscreenSelection(), m_actionHandler, m_addFiber, m_fiberSelection, m_pointConnector, m_redoTrigger, m_removeFiber, m_selectionType, m_toggleFiber, m_undoTrigger, WPVBaseTypes::PV_TRIGGER_READY, WPVBaseTypes::PV_TRIGGER_TRIGGERED, removeFiber(), selectFiber(), and toggleFiber().
Referenced by createProperties().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Handles the undo and redo action.
Definition at line 260 of file WFiberHandler.h.
Referenced by addFiber(), addFiberAt(), addVertexToFiber(), addVertexToFiberAt(), addVerticesToFiber(), getActionHandler(), removeFiber(), removeVertexFromFiber(), removeVerticesFromFiber(), toggleFiber(), updateProperty(), and WFiberHandler().
|
private |
Property (button) to add a new fiber.
Definition at line 290 of file WFiberHandler.h.
Referenced by createProperties(), and updateProperty().
|
private |
Stores the amount of new created fibers.
Definition at line 265 of file WFiberHandler.h.
Referenced by clear(), createNewFiber(), setFiberCount(), and WFiberHandler().
|
private |
A pointer to the list of fibers.
Definition at line 315 of file WFiberHandler.h.
Referenced by addFiber(), addFiberAt(), addVertexToFiber(), addVertexToFiberAt(), addVerticesToFiber(), clear(), getFiberOfPoint(), getFibers(), removeFiber(), removeVertexFromFiber(), removeVerticesFromFiber(), selectLastPoint(), sortVertices(), and WFiberHandler().
|
private |
Represents the current active fiber selection property.
Definition at line 280 of file WFiberHandler.h.
Referenced by addFiberAt(), createProperties(), selectorUpdate(), toggleFiber(), and updateProperty().
|
private |
Vector for the visibility of the fibers.
Definition at line 320 of file WFiberHandler.h.
Referenced by addFiber(), addFiberAt(), clear(), isHidden(), removeFiber(), toggleFiber(), and WFiberHandler().
|
private |
A reference to the WMPointConnector this belongs to.
Definition at line 255 of file WFiberHandler.h.
Referenced by addFiberAt(), getPointConnector(), removeFiber(), selectFiber(), selectLastPoint(), toggleFiber(), updateProperty(), and WFiberHandler().
|
private |
The list of possible fibers, which can be selected.
Definition at line 275 of file WFiberHandler.h.
Referenced by addFiber(), addFiberAt(), clear(), createProperties(), removeFiber(), selectorUpdate(), and toggleFiber().
|
private |
Property (button) to redo the last action.
Definition at line 310 of file WFiberHandler.h.
Referenced by createProperties(), and updateProperty().
|
private |
Property (button) to remove a fiber.
Definition at line 295 of file WFiberHandler.h.
Referenced by createProperties(), and updateProperty().
|
private |
Represents the index of the current active fiber.
Definition at line 270 of file WFiberHandler.h.
Referenced by clear(), getSelectedFiber(), selectFiber(), selectLastPoint(), and WFiberHandler().
|
private |
The type of the selection.
Definition at line 285 of file WFiberHandler.h.
Referenced by createProperties(), and updateProperty().
|
private |
Property (button) to toggle the visibility of a fiber.
Definition at line 300 of file WFiberHandler.h.
Referenced by createProperties(), and updateProperty().
|
private |
Property (button) to undo the last action.
Definition at line 305 of file WFiberHandler.h.
Referenced by createProperties(), and updateProperty().