Commit eb2f7548 authored by Robin Eschbach's avatar Robin Eschbach
Browse files

[ADD #70] fiber display to module container and property groups

parent efdf8741
......@@ -101,20 +101,23 @@ void WFiberHandler::createProperties( WPropertyGroup::SPtr properties )
{
WPropertyBase::PropertyChangeNotifierType notifier = boost::bind( &WFiberHandler::updateProperty, this, boost::placeholders::_1 );
WPropertyGroup::SPtr fiberGroup = properties->addPropertyGroup( "Fibers", "Property group for fiber selection, adding and deleting." );
WPropertyGroup::SPtr undoGroup = properties->addPropertyGroup( "Undo | Redo", "Property group for undo and redo." );
m_possibleFiberSelections = WItemSelection::SPtr( new WItemSelection() );
m_possibleFiberSelections->addItem( ItemType::create( "Fiber 1", "Fiber 1", "", NULL ) );
m_fiberSelection = properties->addProperty(
m_fiberSelection = fiberGroup->addProperty(
"Selected Line", "The line to which the points are added", m_possibleFiberSelections->getSelectorFirst(), notifier );
WPropertyHelper::PC_SELECTONLYONE::addTo( m_fiberSelection );
WPropertyHelper::PC_NOTEMPTY::addTo( m_fiberSelection );
m_addFiber = properties->addProperty( "Add Fiber", "Add Fiber", WPVBaseTypes::PV_TRIGGER_READY, notifier );
m_removeFiber = properties->addProperty( "Remove Fiber", "Remove Fiber", WPVBaseTypes::PV_TRIGGER_READY, notifier );
m_addFiber = fiberGroup->addProperty( "Add Fiber", "Add Fiber", WPVBaseTypes::PV_TRIGGER_READY, notifier );
m_removeFiber = fiberGroup->addProperty( "Remove Fiber", "Remove Fiber", WPVBaseTypes::PV_TRIGGER_READY, notifier );
m_undoTrigger = properties->addProperty( "Undo", "Undo", WPVBaseTypes::PV_TRIGGER_READY, notifier );
m_redoTrigger = properties->addProperty( "Redo", "Redo", WPVBaseTypes::PV_TRIGGER_READY, notifier );
m_undoTrigger = undoGroup->addProperty( "Undo", "Undo", WPVBaseTypes::PV_TRIGGER_READY, notifier );
m_redoTrigger = undoGroup->addProperty( "Redo", "Redo", WPVBaseTypes::PV_TRIGGER_READY, notifier );
}
static bool sortComparator( boost::shared_ptr< WItemSelectionItem > a, boost::shared_ptr< WItemSelectionItem > b )
......
......@@ -35,6 +35,7 @@
#include "core/common/WItemSelectionItem.h"
#include "core/common/WItemSelectionItemTyped.h"
#include "core/common/WItemSelector.h"
#include "core/common/WPropertyGroup.h"
#include "core/kernel/WModule.h"
#include "WMPointConnector.h"
......
......@@ -88,6 +88,7 @@ void WMPointConnector::moduleMain()
m_moduleState.add( m_pointInput->getDataChangedCondition() );
createPointRenderer();
createFiberDisplay();
createHandler();
ready();
......@@ -116,6 +117,13 @@ void WMPointConnector::createPointRenderer()
m_properties->addProperty( m_pointRenderer->getProperties()->getProperty( "Point Size" ) );
}
void WMPointConnector::createFiberDisplay()
{
m_fiberDisplay = createAndAdd( "Fiber Display" );
m_fiberDisplay->isReady().wait();
m_fiberOutput->connect( m_fiberDisplay->getInputConnector( "fibers" ) );
}
void WMPointConnector::createHandler()
{
osg::ref_ptr< osgViewer::View > viewer = WKernel::getRunningKernel()->getGraphicsEngine()->getViewer()->getView();
......
......@@ -39,6 +39,7 @@
#include "core/kernel/WModuleOutputData.h"
#include "../pointRenderer/WMPointRenderer.h"
#include "../fiberDisplay/WMFiberDisplay.h"
class WClickHandler;
class WConnectorData;
......@@ -160,6 +161,11 @@ private:
*/
void createPointRenderer();
/**
* Creates the WMFiberDisplay and runs it.
*/
void createFiberDisplay();
/**
* Creates the WClickHandler and the WKeyboardHandler and registers them.
*/
......@@ -186,6 +192,11 @@ private:
*/
WModule::SPtr m_pointRenderer;
/**
* The WMFiberDisplay associated with this module.
*/
WModule::SPtr m_fiberDisplay;
/**
* The data of this module.
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment