From 8e6a101c81d7e6ff86b20ebbcc6c510997f40851 Mon Sep 17 00:00:00 2001 From: Alexander Wiebel Date: Thu, 20 Jul 2017 11:35:47 +0200 Subject: [PATCH] [CLEAN][STYLE] --- .../pointsCutOutliers/WMPointsCutOutliers.cpp | 34 ++++++------------- .../pointsCutOutliers/WMPointsCutOutliers.h | 30 +--------------- .../tempRandomPoints/WMTempRandomPoints.cpp | 16 --------- .../src/tempRandomPoints/WMTempRandomPoints.h | 23 +++---------- 4 files changed, 16 insertions(+), 87 deletions(-) diff --git a/LiDARToolbox/src/pointsCutOutliers/WMPointsCutOutliers.cpp b/LiDARToolbox/src/pointsCutOutliers/WMPointsCutOutliers.cpp index 4660bc5..8fbba55 100644 --- a/LiDARToolbox/src/pointsCutOutliers/WMPointsCutOutliers.cpp +++ b/LiDARToolbox/src/pointsCutOutliers/WMPointsCutOutliers.cpp @@ -2,7 +2,7 @@ // // Project: OpenWalnut ( http://www.openwalnut.org ) // -// Copyright 2013-2014 Andreas Schwarzkopf, OpenWalnut Community +// Copyright 2013-2014 Andreas Schwarzkopf, 2017 OpenWalnut Community // For more information see http://www.openwalnut.org/copying // // This file is part of OpenWalnut. @@ -23,25 +23,17 @@ //--------------------------------------------------------------------------- #include - -#include #include -#include -#include "core/kernel/WModule.h" - #include "core/dataHandler/WDataSetScalar.h" -#include "core/graphicsEngine/callbacks/WGELinearTranslationCallback.h" -#include "core/graphicsEngine/shaders/WGEPropertyUniform.h" -#include "core/graphicsEngine/shaders/WGEShader.h" -#include "core/graphicsEngine/WGEGeodeUtils.h" -#include "core/graphicsEngine/WGEManagedGroupNode.h" #include "core/kernel/WKernel.h" +#include "core/kernel/WModule.h" #include "core/kernel/WModuleInputData.h" -#include "WMPointsCutOutliers.xpm" + +#include "WCutOutliersDeamon.h" #include "WMPointsCutOutliers.h" +#include "WMPointsCutOutliers.xpm" #include "../common/datastructures/octree/WOctree.h" -#include "WCutOutliersDeamon.h" WMPointsCutOutliers::WMPointsCutOutliers(): WModule(), @@ -70,16 +62,16 @@ const std::string WMPointsCutOutliers::getName() const const std::string WMPointsCutOutliers::getDescription() const { - return "Should draw values above some threshold."; + return "No description yet."; } void WMPointsCutOutliers::connectors() { - m_input = WModuleInputData< WDataSetPoints >::createAndAdd( shared_from_this(), "input", "" ); + m_input = WModuleInputData< WDataSetPoints >::createAndAdd( shared_from_this(), "input points", "" ); m_output = boost::shared_ptr< WModuleOutputData< WDataSetPoints > >( new WModuleOutputData< WDataSetPoints >( - shared_from_this(), "points", "" ) ); + shared_from_this(), "output points", "" ) ); addConnector( m_output ); WModule::connectors(); @@ -87,11 +79,11 @@ void WMPointsCutOutliers::connectors() void WMPointsCutOutliers::properties() { - m_detailDepth = m_properties->addProperty( "Detail Depth 2^n m: ", "Resulting 2^n meters detail " + m_detailDepth = m_properties->addProperty( "Detail Depth 2^n m", "Resulting 2^n meters detail " "depth for the octree search tree.", 0, m_propCondition ); m_detailDepth->setMin( -3 ); m_detailDepth->setMax( 4 ); - m_detailDepthLabel = m_properties->addProperty( "Voxel width meters: ", "Resulting detail depth " + m_detailDepthLabel = m_properties->addProperty( "Voxel width meters", "Resulting detail depth " "in meters for the octree search tree.", pow( 2.0, m_detailDepth->get() ) * 2.0 ); m_detailDepthLabel->setPurpose( PV_PURPOSE_INFORMATION ); @@ -110,10 +102,6 @@ void WMPointsCutOutliers::moduleMain() ready(); - // graphics setup - m_rootNode = osg::ref_ptr< WGEManagedGroupNode >( new WGEManagedGroupNode( m_active ) ); - WKernel::getRunningKernel()->getGraphicsEngine()->getScene()->insert( m_rootNode ); - // main loop while( !m_shutdownFlag() ) { @@ -146,8 +134,6 @@ void WMPointsCutOutliers::moduleMain() continue; } } - - WKernel::getRunningKernel()->getGraphicsEngine()->getScene()->remove( m_rootNode ); } void WMPointsCutOutliers::setProgressSettings( size_t steps ) diff --git a/LiDARToolbox/src/pointsCutOutliers/WMPointsCutOutliers.h b/LiDARToolbox/src/pointsCutOutliers/WMPointsCutOutliers.h index 97176fa..ccdd50d 100644 --- a/LiDARToolbox/src/pointsCutOutliers/WMPointsCutOutliers.h +++ b/LiDARToolbox/src/pointsCutOutliers/WMPointsCutOutliers.h @@ -2,7 +2,7 @@ // // Project: OpenWalnut ( http://www.openwalnut.org ) // -// Copyright 2013-2014 Andreas Schwarzkopf, OpenWalnut Community +// Copyright 2013-2014 Andreas Schwarzkopf, 2017 OpenWalnut Community // For more information see http://www.openwalnut.org/copying // // This file is part of OpenWalnut. @@ -30,48 +30,25 @@ #include #include -#include // std::ifstream -#include // std::cout - #include "core/kernel/WModule.h" - -#include "core/graphicsEngine/WGEManagedGroupNode.h" -#include "core/graphicsEngine/shaders/WGEShader.h" -#include "core/graphicsEngine/WTriangleMesh.h" - -#include -#include #include "core/dataHandler/WDataSetPoints.h" #include "../common/datastructures/octree/WOctree.h" - - - - //!.Unnecessary imports #include "core/common/WItemSelection.h" #include "core/common/WItemSelector.h" #include "core/kernel/WModuleOutputData.h" -#include -#include -#include #include "core/kernel/WKernel.h" -#include "core/common/exceptions/WFileNotFound.h" -#include "core/common/WColor.h" #include "core/common/WPathHelper.h" #include "core/common/WPropertyHelper.h" #include "core/common/WItemSelectionItem.h" #include "core/common/WItemSelectionItemTyped.h" -#include "core/graphicsEngine/WGEUtils.h" -#include "core/graphicsEngine/WGERequirement.h" // forward declarations to reduce compile dependencies template< class T > class WModuleInputData; -class WDataSetScalar; -class WGEManagedGroupNode; /** * Cuts data set points outliers. It works by put points in rasterized cube set. Neighbor cubes will @@ -154,11 +131,6 @@ private: */ boost::shared_ptr< WModuleOutputData< WDataSetPoints > > m_output; - /** - * The OSG root node for this module. All other geodes or OSG nodes will be attached on this single node. - */ - osg::ref_ptr< WGEManagedGroupNode > m_rootNode; - /** * Needed for recreating the geometry, incase when resolution changes. */ diff --git a/LiDARToolbox/src/tempRandomPoints/WMTempRandomPoints.cpp b/LiDARToolbox/src/tempRandomPoints/WMTempRandomPoints.cpp index 94d81ef..ba19135 100644 --- a/LiDARToolbox/src/tempRandomPoints/WMTempRandomPoints.cpp +++ b/LiDARToolbox/src/tempRandomPoints/WMTempRandomPoints.cpp @@ -27,17 +27,9 @@ #include // std::ifstream #include -#include #include "core/kernel/WModule.h" -#include "core/dataHandler/WDataSetScalar.h" -#include "core/graphicsEngine/callbacks/WGELinearTranslationCallback.h" -#include "core/graphicsEngine/shaders/WGEPropertyUniform.h" -#include "core/graphicsEngine/shaders/WGEShader.h" -#include "core/graphicsEngine/WGEGeodeUtils.h" -#include "core/graphicsEngine/WGEManagedGroupNode.h" #include "core/kernel/WKernel.h" -#include "core/kernel/WModuleInputData.h" #include "WMTempRandomPoints.xpm" #include "WMTempRandomPoints.h" #include "../common/datastructures/octree/WOctree.h" @@ -111,11 +103,6 @@ void WMTempRandomPoints::moduleMain() ready(); - // graphics setup - m_rootNode = osg::ref_ptr< WGEManagedGroupNode >( new WGEManagedGroupNode( m_active ) ); - WKernel::getRunningKernel()->getGraphicsEngine()->getScene()->insert( m_rootNode ); - - while( !m_shutdownFlag() ) { m_moduleState.wait(); @@ -129,8 +116,6 @@ void WMTempRandomPoints::moduleMain() break; } } - - WKernel::getRunningKernel()->getGraphicsEngine()->getScene()->remove( m_rootNode ); } void WMTempRandomPoints::setProgressSettings( size_t steps ) @@ -150,7 +135,6 @@ boost::shared_ptr< WDataSetPoints > WMTempRandomPoints::getRandomPoints() WDataSetPoints::ColorArray outColors( new WDataSetPoints::ColorArray::element_type() ); - infoLog() << std::endl << "Applying point set:" << std::endl; m_currentRandomNumber = m_initRandomNumber->get(); double colorIntensity = 0.8; size_t count = m_pointCount->get(); diff --git a/LiDARToolbox/src/tempRandomPoints/WMTempRandomPoints.h b/LiDARToolbox/src/tempRandomPoints/WMTempRandomPoints.h index 8f995d3..852bfb2 100644 --- a/LiDARToolbox/src/tempRandomPoints/WMTempRandomPoints.h +++ b/LiDARToolbox/src/tempRandomPoints/WMTempRandomPoints.h @@ -31,13 +31,11 @@ #include #include // std::ifstream -#include // std::cout - -#include "core/kernel/WModule.h" #include "core/graphicsEngine/WGEManagedGroupNode.h" -#include "core/graphicsEngine/shaders/WGEShader.h" #include "core/graphicsEngine/WTriangleMesh.h" +#include "core/graphicsEngine/shaders/WGEShader.h" +#include "core/kernel/WModule.h" #include #include @@ -71,12 +69,6 @@ #include "../common/math/leastSquares/WLeastSquares.h" - -// forward declarations to reduce compile dependencies -template< class T > class WModuleInputData; -class WDataSetScalar; -class WGEManagedGroupNode; - /** * Creates a cubical or spherical random set of points. * Use a transformation plugin to get a customized point set. @@ -149,17 +141,12 @@ private: void setProgressSettings( size_t steps ); /** - * Returns a pseudo random number. It depends on a counter. The aim is to get + * Returns a pseudo random number. It depends on a counter. The aim is to get * reproducable results. * \return Pseudo random number between 0 and 1. */ double getNextRandomNumber(); - /** - * The OSG root node for this module. All other geodes or OSG nodes will be attached on this single node. - */ - osg::ref_ptr< WGEManagedGroupNode > m_rootNode; - /** * Returns a cropped data set corresponding to the selection. The selection is * set by m__. m_cutInsteadOfCrop determines whether to crop to @@ -169,7 +156,7 @@ private: boost::shared_ptr< WDataSetPoints > getRandomPoints(); /** - * Processed point data with cut off outliers. + * Generated random points. */ boost::shared_ptr< WModuleOutputData< WDataSetPoints > > m_output; @@ -194,7 +181,7 @@ private: WDataSetPoints::ColorArray m_colors; /** - * The last random number It's stored to calculate a next number deterministically. + * The last random number It's stored to calculate a next number deterministically. * Reproducable results are produced that way */ double m_currentRandomNumber; -- GitLab