Open ASCII bug. Kubuntu

If you are allergic to bug trackers, you can post here any remarks, issues and potential bugs you encounter
Post Reply
psullie
Posts: 4
Joined: Tue Jun 18, 2013 4:28 pm

Open ASCII bug. Kubuntu

Post by psullie »

Hi all

First off thank you for this excellent software.

I've compiled a copy on Kubuntu 12.10 with CMake, and noticed a small issue with the open file option.

When I attempt to open an .pts file with the ASCII option via file -> open CC uses the open BIN command instead resulting in a garbled import. Fortunately the drag to viewer option works like a charm and the pts file opens as expected. (I only discovered this route when I was checking the ccViewer build)

Let me know if you need any more info, glad to help if I can.

Cheers

Paul
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Open ASCII bug. Kubuntu

Post by daniel »

I've looked at the code, and the only reason for this would be that the 'CC_FILE_TYPES_ENUMS' and 'CC_FILE_TYPE_FILTERS' arrays are not consistent (which would be quite strange) ... or that the filter returned by QFileDialog::getOpenFileNames is wrong ('selectedFilter').

Can you check the output of the QFileDialog::getOpenFileNames method by adding a log output in 'MainWindow::loadFile' such as:

Code: Select all

ccLog::Print(selectedFilter);
And also check the value of all the enums:

Code: Select all

ccLog::Print("ASCII ENUM=%i\n",ASCII);
ccLog::Print("BIN ENUM=%i\n",BIN);
ccLog::Print("ASCII FILTER=%s\n",CC_FILE_TYPE_FILTERS[ASCII]);
ccLog::Print("BIN FILTER=%s\n",CC_FILE_TYPE_FILTERS[BIN]);
ccLog::Print("ASCII TYPE=%i\n",CC_FILE_TYPES_ENUMS[ASCII]);
ccLog::Print("BIN TYPE=%i\n",CC_FILE_TYPES_ENUMS[BIN]);
Daniel, CloudCompare admin
psullie
Posts: 4
Joined: Tue Jun 18, 2013 4:28 pm

Re: Open ASCII bug. Kubuntu

Post by psullie »

Hi Daniel

I've tried adding this to the mainwindow.cpp file and recompiling but I don't see any output.
I'm not much of a C++ coder it's very likely that I'm missing something.

Cheers

Paul
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Open ASCII bug. Kubuntu

Post by daniel »

You should add these lines just at the very beginning of the loadFile method. And you can replace 'ccLog' by 'ccConsole' to be sure.

By the way, Is there anything displayed in the console at all?
Daniel, CloudCompare admin
psullie
Posts: 4
Joined: Tue Jun 18, 2013 4:28 pm

Re: Open ASCII bug. Kubuntu

Post by psullie »

Hi Daniel

Here's the console output (just the end bit after loading plug-ins etc.):

[09:43:58] CloudCompare started!
[09:44:29] BIN CloudCompare binaries (*bin)
[09:44:29] ASCII ENUM=2

[09:44:29] BIN ENUM=3

[09:44:29] ASCII FILTER=ASCII FILES (*txt *.asc *.neu *.xyz *.pts *.csv)

[09:44:29] BIN FILTER=BIN CloudCompare binaries (*.bin)

[09:44:29] ASCII TYPE=2

[09:44:29] BIN TYPE=3

[09:44:29] [BIN] Opening file '/home/paul/Desktop/files/sample.pts'…
[09:44:29] [BIN] Version 1.0

CC then prompts with the 'Oups' dialogue: Hum, do you really want to load 858929203 point clouds? (a cancel button would be useful here)
The sample file is 1 cloud with 3.8 million points, CC then tries to import and will hang.

Also, the File -> Open dialogue will not display any files with the All (*.*) option or display OBJ files with the Wavefront (*.obj) options.
However all files tested so far will open by dragging into the main window.

Paul
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Open ASCII bug. Kubuntu

Post by daniel »

It seems that the QFileDialog returns the wrong selected filter. Moreover you don't even see the Yes/No buttons on the 'Oups' dialog?! There's definitely something wrong with Qt here.

Just to confirm something, can you add another trace:

Code: Select all

ccLog::Print(QString("Selected filter = ")+selectedFilter);
You can put this just after

Code: Select all

    if (selectedFiles.isEmpty())
        return;
It seems also that KDE has some limitations on their native file dialog (if I believe the Qt bugtracker). Can you un-comment the last argument of the call to QFileDialog::getOpenFileNames (remove the /* and */ around QFileDialog::DontUseNativeDialog and see if it changes anything?

And last but not least, for the records can you type the command below in a console and then report report us the Qt version?

Code: Select all

qmake --version
Thanks for the help.
Daniel, CloudCompare admin
psullie
Posts: 4
Joined: Tue Jun 18, 2013 4:28 pm

Re: Open ASCII bug. Kubuntu

Post by psullie »

Hi Daniel

I think the issue was a bug with Qt, I applied a minor upgrade yesterday (0.190.6, 0.190.7) and when I re-compiled CC it opened the files correctly, except that when All(*.*) is selected it will not display any files in the dialogue window. Removing the comments from the QFileDialog corrected this.

qmake --version QMake version 2.01a Using Qt version 4.8.3 in /usr/lib/x86_64-linux-gnu

ASCII files (*.txt *.asc *.neu *.xyz *.pts *.csv)
Selected filter = ASCII files(*.txt *.asc *.neu *.xyz *.pts *.csv)
ASCII ENUM=2
BIN ENUM=3
ASCII FILTER=ASCII files(*.txt *.asc *.neu *.xyz *.pts *.csv)
BIN FILTER=BIN CloudCompare binaries (*.bin)
ASCII TYPE=2
BIN TYPE=3

Cheers

Paul
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Open ASCII bug. Kubuntu

Post by daniel »

Thanks for the feedback.

I don't believe that we can patch the code specifically for Kubuntu though... I'll add a comment in the code so others might find the solution to this issue more easily.
Daniel, CloudCompare admin
Post Reply