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 Modules
Commits
4fc2c24d
Commit
4fc2c24d
authored
Aug 13, 2014
by
Alexander Wiebel
Browse files
[STYLE #42] cleanup
parent
f131681b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
63 deletions
+20
-63
LiDARToolbox/src/pointsCutOutliers/WMPointsCutOutliers.cpp
LiDARToolbox/src/pointsCutOutliers/WMPointsCutOutliers.cpp
+4
-10
LiDARToolbox/src/readLAS/WLasReader.cpp
LiDARToolbox/src/readLAS/WLasReader.cpp
+1
-30
LiDARToolbox/src/readLAS/WMReadLAS.cpp
LiDARToolbox/src/readLAS/WMReadLAS.cpp
+13
-21
LiDARToolbox/src/readLAS/WMReadLAS.h
LiDARToolbox/src/readLAS/WMReadLAS.h
+2
-2
No files found.
LiDARToolbox/src/pointsCutOutliers/WMPointsCutOutliers.cpp
View file @
4fc2c24d
...
...
@@ -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
=
"
Load
ing data"
;
std
::
string
headerText
=
"
Process
ing data"
;
m_progressStatus
=
boost
::
shared_ptr
<
WProgress
>
(
new
WProgress
(
headerText
,
steps
)
);
m_progress
->
addSubProgress
(
m_progressStatus
);
}
LiDARToolbox/src/readLAS/WLasReader.cpp
View file @
4fc2c24d
...
...
@@ -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
*/
LiDARToolbox/src/readLAS/WMReadLAS.cpp
View file @
4fc2c24d
...
...
@@ -100,11 +100,11 @@ void WMReadLAS::properties()
200
,
m_propCondition
);
m_outputDataWidth
->
setMin
(
0
);
m_s
crollBa
rX
=
m_properties
->
addProperty
(
"Scope selection X: "
,
m_s
lide
rX
=
m_properties
->
addProperty
(
"Scope selection X: "
,
"X range will be drawn between input and input+'Data set "
"width'."
,
0
,
m_propCondition
);
m_s
crollBa
rY
=
m_properties
->
addProperty
(
"Scope selection Y: "
,
m_s
lide
rY
=
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_s
crollBa
rX
->
setMin
(
dividend
*
dataWidth
);
m_s
lide
rX
->
setMin
(
dividend
*
dataWidth
);
dividend
=
reader
.
getXMax
()
/
dataWidth
;
m_s
crollBa
rX
->
setMax
(
dividend
*
dataWidth
);
m_s
lide
rX
->
setMax
(
dividend
*
dataWidth
);
dividend
=
reader
.
getYMin
()
/
dataWidth
;
m_s
crollBa
rY
->
setMin
(
dividend
*
dataWidth
);
m_s
lide
rY
->
setMin
(
dividend
*
dataWidth
);
dividend
=
reader
.
getYMax
()
/
dataWidth
;
m_s
crollBa
rY
->
setMax
(
dividend
*
dataWidth
);
m_s
lide
rY
->
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
);
}
LiDARToolbox/src/readLAS/WMReadLAS.h
View file @
4fc2c24d
...
...
@@ -169,11 +169,11 @@ private:
/**
* Scrollbar that changes the minimal output X value
*/
WPropInt
m_s
crollBa
rX
;
WPropInt
m_s
lide
rX
;
/**
* Scrollbar that changes the minimal output Y value
*/
WPropInt
m_s
crollBa
rY
;
WPropInt
m_s
lide
rY
;
/**
* Enables to put the output data to the coordinate system center
*/
...
...
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