
Public Member Functions | |
| WalzFileConverterWX (std::string inputFileName, std::string outputFileName) | |
| Constructor. | |
| virtual void | OnBlockIsRead () |
| Called when a block has been read. | |
| virtual void | OnBlockIsCompressed () |
| Called when a block has been compressed. | |
Two handlers are overloaded: OnBlockIsRead and OnBlockIsCompressed. The overloads are in this case used only for debugging.
| sgis::image::WalzFileConverterWX::WalzFileConverterWX | ( | std::string | inputFileName, | |
| std::string | outputFileName | |||
| ) |
Constructor.
| inputFileName | Input file to be converted | |
| outputFileName | Output file to write to |
| virtual void sgis::image::WalzFileConverterWX::OnBlockIsRead | ( | ) | [virtual] |
Called when a block has been read.
The coordinates are available in the readers io::GetX(), io::GetY(), io::GetZ(). This overload could be used to make e.g. a "distance transform" before compression:
void WalzFileConverterWX::OnBlockIsRead() { io *pReader = GetReader(); Vec_DP &X = pReader->GetX(); Vec_DP &Y = pReader->GetY(); Vec_DP &Z = pReader->GetZ(); int nSize = X.size(), i; Vec_DP vTmp( nSize ); vTmp[0] = X[0]; for ( i=1; i<nSize; ++i ) { vTmp[i] = X[i]; vTmp[i] -= X[i-1]; } X = vTmp; vTmp[0] = Y[0]; for ( i=1; i<nSize; ++i ) { vTmp[i] = Y[i]; vTmp[i] -= Y[i-1]; } Y = vTmp; }
Reimplemented from laserlib::FileConverter.
| virtual void sgis::image::WalzFileConverterWX::OnBlockIsCompressed | ( | ) | [virtual] |
Called when a block has been compressed.
It has not really been compressed, just e.g. wavelet transformed etc. The writer now contains wavelet coefficients if lidarlib::walz is the writer.
This handler could be used to debug trace the first 25 points of each wavelet level:
void WalzFileConverterWX::OnBlockIsCompressed()
{
io *pWriter = GetWriter();
// No wavelets used if packbits - just return
if ( pWriter->GetParameters().cWaveletType == laserlib::EWT_PACKBITS )
return;
wxMessageOutputDebug err;
Vec_DP &X = pWriter->GetX();
Vec_DP &Y = pWriter->GetY();
Vec_DP &Z = pWriter->GetZ();
int level=1, nStart=1000, nEnd;
int i,j;
for (i=1; nStart >= 4; ++i)
{
pWriter->GetInterval( i, nStart, nEnd );
err.Printf("LEVEL %d\n=========\n", i );
for ( j=nStart; j<nEnd && j<nStart+25; ++j )
{
err.Printf("%d %.2lf %.2lf %.2lf\n", j-nStart, X[j], Y[j], Z[j] );
}
}
}
Reimplemented from laserlib::FileConverter.
1.5.6