Commit 8e6a101c authored by Alexander Wiebel's avatar Alexander Wiebel

[CLEAN][STYLE]

parent 7a09f5fe
......@@ -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 <string>
#include <fstream>
#include <vector>
#include <osg/Geometry>
#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 )
......
......@@ -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 <string>
#include <vector>
#include <fstream> // std::ifstream
#include <iostream> // std::cout
#include "core/kernel/WModule.h"
#include "core/graphicsEngine/WGEManagedGroupNode.h"
#include "core/graphicsEngine/shaders/WGEShader.h"
#include "core/graphicsEngine/WTriangleMesh.h"
#include <osg/ShapeDrawable>
#include <osg/Geode>
#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 <osg/Group>
#include <osg/Material>
#include <osg/StateAttribute>
#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.
*/
......
......@@ -27,17 +27,9 @@
#include <fstream> // std::ifstream
#include <vector>
#include <osg/Geometry>
#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();
......
......@@ -31,13 +31,11 @@
#include <vector>
#include <fstream> // std::ifstream
#include <iostream> // 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 <osg/ShapeDrawable>
#include <osg/Geode>
......@@ -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_<from/to>_<X/Y/Z>. 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;
......
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