Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
eb2f7548
Commit
eb2f7548
authored
Mar 08, 2021
by
Robin Eschbach
Browse files
[ADD
#70
] fiber display to module container and property groups
parent
efdf8741
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
5 deletions
+28
-5
src/modules/pointConnector/WFiberHandler.cpp
src/modules/pointConnector/WFiberHandler.cpp
+8
-5
src/modules/pointConnector/WFiberHandler.h
src/modules/pointConnector/WFiberHandler.h
+1
-0
src/modules/pointConnector/WMPointConnector.cpp
src/modules/pointConnector/WMPointConnector.cpp
+8
-0
src/modules/pointConnector/WMPointConnector.h
src/modules/pointConnector/WMPointConnector.h
+11
-0
No files found.
src/modules/pointConnector/WFiberHandler.cpp
View file @
eb2f7548
...
...
@@ -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
)
...
...
src/modules/pointConnector/WFiberHandler.h
View file @
eb2f7548
...
...
@@ -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"
...
...
src/modules/pointConnector/WMPointConnector.cpp
View file @
eb2f7548
...
...
@@ -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
();
...
...
src/modules/pointConnector/WMPointConnector.h
View file @
eb2f7548
...
...
@@ -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.
*/
...
...
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