Commit 4fc2c24d authored by Alexander Wiebel's avatar Alexander Wiebel

[STYLE #42] cleanup

parent f131681b
......@@ -25,7 +25,6 @@
#include <string>
#include <fstream> // std::ifstream
#include <iostream> // std::cout
#include <vector>
#include <osg/Geometry>
......@@ -80,11 +79,11 @@ const std::string WMPointsCutOutliers::getDescription() const
void WMPointsCutOutliers::connectors()
{
m_input = WModuleInputData< WDataSetPoints >::createAndAdd( shared_from_this(), "input", "The mesh to display" );
m_input = WModuleInputData< WDataSetPoints >::createAndAdd( shared_from_this(), "input", "" );
m_output = boost::shared_ptr< WModuleOutputData< WDataSetPoints > >(
new WModuleOutputData< WDataSetPoints >(
shared_from_this(), "points", "The loaded points." ) );
shared_from_this(), "points", "" ) );
addConnector( m_output );
// addConnector( m_buildings );
......@@ -93,7 +92,6 @@ void WMPointsCutOutliers::connectors()
void WMPointsCutOutliers::properties()
{
// ---> Put the code for your properties here. See "src/modules/template/" for an extensively documented example.
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 );
......@@ -111,8 +109,6 @@ void WMPointsCutOutliers::requirements()
void WMPointsCutOutliers::moduleMain()
{
infoLog() << "Thrsholding example main routine started";
// get notified about data changes
m_moduleState.setResetable( true, true );
m_moduleState.add( m_input->getDataChangedCondition() );
......@@ -127,11 +123,9 @@ void WMPointsCutOutliers::moduleMain()
// main loop
while( !m_shutdownFlag() )
{
//infoLog() << "Waiting ...";
m_moduleState.wait();
boost::shared_ptr< WDataSetPoints > points = m_input->getData();
// std::cout << "Execute cycle\r\n";
m_detailDepthLabel->set( pow( 2.0, m_detailDepth->get() ) * 2.0 );
if ( points )
{
......@@ -145,7 +139,6 @@ void WMPointsCutOutliers::moduleMain()
m_progressStatus->finish();
}
// std::cout << "this is WOTree " << std::endl;
// woke up since the module is requested to finish?
if ( m_shutdownFlag() )
......@@ -164,10 +157,11 @@ void WMPointsCutOutliers::moduleMain()
WKernel::getRunningKernel()->getGraphicsEngine()->getScene()->remove( m_rootNode );
}
void WMPointsCutOutliers::setProgressSettings( size_t steps )
{
m_progress->removeSubProgress( m_progressStatus );
std::string headerText = "Loading data";
std::string headerText = "Processing data";
m_progressStatus = boost::shared_ptr< WProgress >( new WProgress( headerText, steps ) );
m_progress->addSubProgress( m_progressStatus );
}
......@@ -24,7 +24,6 @@
#include <liblas/liblas.hpp>
#include <fstream> // std::ifstream
#include <iostream> // std::cout
#include <string>
#include <vector>
......@@ -93,11 +92,6 @@ namespace laslibb
float yOffset = m_fromY + m_dataSetWidth / 2;
float zOffset = ( m_zMax - m_zMin ) / 2;
// double oldTime = 0.0; //TODO(schwarzkopf): remove that commented lines in final version
// size_t oldI = 0;
// size_t timeIdx = 0;
// size_t crashCount = 0;
for ( size_t i = 0; i < count; i++ )
{
double x, y, z;
......@@ -109,25 +103,6 @@ namespace laslibb
y = point.GetY();
z = point.GetZ();
v = point.GetIntensity(); //TODO(schwarzkopf): Still had no colored data set to check some liblas functions.
// { //TODO(schwarzkopf): remove that commented lines in final version
// double thisTime = point.GetTime();
// if(oldTime != thisTime)
// {
// if(oldTime>thisTime)
// {
// crashCount++;
// std::cout << "crash!! " << oldTime << "\t" << thisTime-oldTime << std::endl;
// }
// double diff = thisTime-oldTime;
// std::cout << diff << "\t" << ( i - oldI ) << std::endl;
// oldTime = thisTime;
// oldI = i;
// timeIdx++;
// }
// //std::cout << "Point stuff: " << point.GetFlightLineEdge() << "\t" <<
// // point.GetPointSourceID() << "\t" << point.GetRawX() << "\t" <<
// // timeIdx << std::endl;
// }
if ( i == 0 )
{
m_xMin = m_xMax = x;
......@@ -160,13 +135,9 @@ namespace laslibb
colors->push_back( v * m_contrast );
addedPoints++;
}
// std::cout << i << ": " << x << " " << " " << y << " " << z << " " << v << "\r\n";
m_progressStatus->increment( 1 );
}
// std::cout << "Time/point count: " << timeIdx << " / " << count <<
// "\tInvalid order occurances: " << crashCount<< std::endl;
m_progressStatus->finish();
// std::cout << "Added points: " << addedPoints << std::endl;
if ( addedPoints == 0 )
{
......@@ -229,4 +200,4 @@ namespace laslibb
{
return m_intensityMax;
}
} /* namespace std */
} /* namespace laslibb */
......@@ -100,11 +100,11 @@ void WMReadLAS::properties()
200, m_propCondition );
m_outputDataWidth->setMin( 0 );
m_scrollBarX = m_properties->addProperty( "Scope selection X: ",
m_sliderX = m_properties->addProperty( "Scope selection X: ",
"X range will be drawn between input and input+'Data set "
"width'.", 0, m_propCondition );
m_scrollBarY = m_properties->addProperty( "Scope selection Y: ",
m_sliderY = m_properties->addProperty( "Scope selection Y: ",
"YY range will be drawn between input and input+'Data set "
"width'.", 0, m_propCondition );
......@@ -154,16 +154,14 @@ void WMReadLAS::moduleMain()
// main loop
while( !m_shutdownFlag() )
{
//infoLog() << "Waiting ...";
m_moduleState.wait();
std::cout << "cycle" << std::endl;
reader.setInputFilePath( m_lasFile->get().c_str() );
try
{
reader.setDataSetRegion( m_scrollBarX->get( true ), m_scrollBarY->get( true ),
m_outputDataWidth->get( true ) );
reader.setDataSetRegion( m_sliderX->get( true ),
m_sliderY->get( true ),
m_outputDataWidth->get( true ) );
reader.setTranslateToCenter( m_translateDataToCenter->get( true ) );
boost::shared_ptr< WDataSetPoints > tmpPointSet = reader.getPoints();
WDataSetPoints::VertexArray points = tmpPointSet->getVertices();
......@@ -187,13 +185,11 @@ void WMReadLAS::moduleMain()
m_reloadData->set( WPVBaseTypes::PV_TRIGGER_READY, true );
m_reloadData->get( true );
// woke up since the module is requested to finish?
if ( m_shutdownFlag() )
// woke up since the module is requested to finish?
if( m_shutdownFlag() )
{
break;
}
// ---> Insert code doing the real stuff here
}
WKernel::getRunningKernel()->getGraphicsEngine()->getScene()->remove( m_rootNode );
......@@ -202,23 +198,19 @@ void WMReadLAS::refreshScrollBars()
{
size_t dataWidth = ( m_outputDataWidth->get() + 1 ) / 2;
m_outputDataWidth->set( dataWidth = dataWidth * 2 );
// double x = m_scrollBarX->get();
// double y = m_scrollBarY->get();
if ( m_outputDataWidth == 0 ) return;
size_t dividend = reader.getXMin() / dataWidth;
m_scrollBarX->setMin( dividend * dataWidth );
m_sliderX->setMin( dividend * dataWidth );
dividend = reader.getXMax() / dataWidth;
m_scrollBarX->setMax( dividend * dataWidth );
m_sliderX->setMax( dividend * dataWidth );
dividend = reader.getYMin() / dataWidth;
m_scrollBarY->setMin( dividend * dataWidth );
m_sliderY->setMin( dividend * dataWidth );
dividend = reader.getYMax() / dataWidth;
m_scrollBarY->setMax( dividend * dataWidth );
m_sliderY->setMax( dividend * dataWidth );
// m_scrollBarX->set( x );
// m_scrollBarY->set( y );
m_scrollBarX->get( true );
m_scrollBarY->get( true );
m_sliderX->get( true );
m_sliderY->get( true );
}
......@@ -169,11 +169,11 @@ private:
/**
* Scrollbar that changes the minimal output X value
*/
WPropInt m_scrollBarX;
WPropInt m_sliderX;
/**
* Scrollbar that changes the minimal output Y value
*/
WPropInt m_scrollBarY;
WPropInt m_sliderY;
/**
* Enables to put the output data to the coordinate system center
*/
......
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