qCC_io version 2.13.alpha (Qt) - 31 May 2022
CloudCompare standard I/O filters (file readers & writers)
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
AsciiOpenDlg Class Reference

Dialog for configuration of ASCII files opening sequence. More...

#include <AsciiOpenDlg.h>

Inheritance diagram for AsciiOpenDlg:
Inheritance graph
[legend]
Collaboration diagram for AsciiOpenDlg:
Collaboration graph
[legend]

Classes

struct  SequenceItem
 ASCII open sequence item. More...
 

Public Types

using Sequence = std::vector< SequenceItem >
 ASCII open sequence.
 

Public Member Functions

 AsciiOpenDlg (QWidget *parent=nullptr)
 Default constructor. More...
 
 ~AsciiOpenDlg () override
 Default destructor.
 
void setInput (const QString &filename, QTextStream *stream=nullptr)
 Sets the input filename or text stream. More...
 
bool restorePreviousContext ()
 Restores the previous context ('Apply all' button) More...
 
Sequence getOpenSequence () const
 Returns the whole "opening" sequence as set by the user.
 
unsigned getSkippedLinesCount () const
 Returns number of lines to skip.
 
unsigned char getSeparator () const
 Returns user selected separator.
 
bool useCommaAsDecimal () const
 Returns whether comma should be used as decimal point.
 
double getAverageLineSize () const
 Returns roughly estimated average line size (in bytes)
 
unsigned getColumnsCount () const
 Returns columns count per line.
 
unsigned getMaxCloudSize () const
 Returns the max number of points per cloud.
 
bool showLabelsIn2D () const
 Whether labels should be visible in 2D.
 
bool safeSequence () const
 Returns whether the current sequence is 'safe'. More...
 
void onSeparatorChange (const QString &separator)
 Slot called when separator changes.
 
void updateTable ()
 Forces the table to update itself.
 
void setSkippedLines (int linesCount)
 Sets the number of lines to skip.
 
void commaDecimalCheckBoxToggled (bool)
 Slot called when the 'comma as decimal' checkbox is toggled.
 

Static Public Member Functions

static bool CheckOpenSequence (const Sequence &sequence, QString &errorMessage)
 Checks the "opening" sequence as set by the user. More...
 
static void ResetApplyAll ()
 Resets the "apply all" flag (if set)
 

Protected Types

enum  ColumnType { TEXT = 0 , UNKNOWN = 1 , IGNORED = 2 , VALID = 3 }
 

Protected Member Functions

bool apply ()
 
void applyAll ()
 
void columnsTypeHasChanged (int index)
 
void shortcutButtonPressed ()
 
void checkSelectedColumnsValidity ()
 
void autoFindBestSeparator ()
 Tries to guess the best separator automagically.
 
void setSeparator (QChar)
 Sets the current separator.
 

Protected Attributes

Ui_AsciiOpenDialog * m_ui
 
unsigned m_skippedLines
 
QChar m_separator
 
double m_averageLineSize
 
QString m_filename
 
QTextStream * m_stream
 
QString m_headerLine
 
std::vector< ColumnType > m_columnType
 Identifies columns with numbers only [mandatory].
 
unsigned m_columnsCount
 

Detailed Description

Dialog for configuration of ASCII files opening sequence.

Constructor & Destructor Documentation

◆ AsciiOpenDlg()

AsciiOpenDlg::AsciiOpenDlg ( QWidget *  parent = nullptr)
explicit

Default constructor.

Parameters
parentparent widget

Member Function Documentation

◆ CheckOpenSequence()

bool AsciiOpenDlg::CheckOpenSequence ( const Sequence sequence,
QString &  errorMessage 
)
static

Checks the "opening" sequence as set by the user.

Returns
validity (+ error message if not)

◆ restorePreviousContext()

bool AsciiOpenDlg::restorePreviousContext ( )

Restores the previous context ('Apply all' button)

Returns
whether a context was saved or not

◆ safeSequence()

bool AsciiOpenDlg::safeSequence ( ) const

Returns whether the current sequence is 'safe'.

A safe sequence is safe if it matches the header (if any) or if the file has less than 6 columns.

◆ setInput()

void AsciiOpenDlg::setInput ( const QString &  filename,
QTextStream *  stream = nullptr 
)

Sets the input filename or text stream.

Parameters
filenamefilename
streamtext stream

The documentation for this class was generated from the following files: