ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
AsciiOpenDlg Class Reference

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

#include <AsciiOpenDlg.h>

Inheritance diagram for AsciiOpenDlg:
Collaboration diagram for AsciiOpenDlg:

Classes

struct  SequenceItem
 ASCII open sequence item. More...
 

Public Types

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

Public Member Functions

 AsciiOpenDlg (QWidget *parent=nullptr)
 Default constructor. More...
 
 ~AsciiOpenDlg () override
 Default destructor. More...
 
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. More...
 
unsigned getSkippedLinesCount () const
 Returns number of lines to skip. More...
 
unsigned char getSeparator () const
 Returns user selected separator. More...
 
bool useCommaAsDecimal () const
 Returns whether comma should be used as decimal point. More...
 
double getAverageLineSize () const
 Returns roughly estimated average line size (in bytes) More...
 
unsigned getColumnsCount () const
 Returns columns count per line. More...
 
unsigned getMaxCloudSize () const
 Returns the max number of points per cloud. More...
 
bool showLabelsIn2D () const
 Whether labels should be visible in 2D. More...
 
bool safeSequence () const
 Returns whether the current sequence is 'safe'. More...
 
void onSeparatorChange (const QString &separator)
 Slot called when separator changes. More...
 
void updateTable ()
 Forces the table to update itself. More...
 
void setSkippedLines (int linesCount)
 Sets the number of lines to skip. More...
 
void commaDecimalCheckBoxToggled (bool)
 Slot called when the 'comma as decimal' checkbox is toggled. More...
 

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) More...
 

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. More...
 
void setSeparator (QChar)
 Sets the current separator. More...
 

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< ColumnTypem_columnType
 Identifies columns with numbers only [mandatory]. More...
 
unsigned m_columnsCount
 

Detailed Description

Dialog for configuration of ASCII files opening sequence.

Definition at line 100 of file AsciiOpenDlg.h.

Member Typedef Documentation

◆ Sequence

using AsciiOpenDlg::Sequence = std::vector<SequenceItem>

ASCII open sequence.

Definition at line 137 of file AsciiOpenDlg.h.

Member Enumeration Documentation

◆ ColumnType

enum AsciiOpenDlg::ColumnType
protected
Enumerator
TEXT 
UNKNOWN 
IGNORED 
VALID 

Definition at line 212 of file AsciiOpenDlg.h.

Constructor & Destructor Documentation

◆ AsciiOpenDlg()

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

Default constructor.

Parameters
parentparent widget

◆ ~AsciiOpenDlg()

AsciiOpenDlg::~AsciiOpenDlg ( )
override

Default destructor.

Member Function Documentation

◆ apply()

bool AsciiOpenDlg::apply ( )
protected

◆ applyAll()

void AsciiOpenDlg::applyAll ( )
protected

◆ autoFindBestSeparator()

void AsciiOpenDlg::autoFindBestSeparator ( )
protected

Tries to guess the best separator automagically.

◆ CheckOpenSequence()

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

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

Returns
validity (+ error message if not)

◆ checkSelectedColumnsValidity()

void AsciiOpenDlg::checkSelectedColumnsValidity ( )
protected

◆ columnsTypeHasChanged()

void AsciiOpenDlg::columnsTypeHasChanged ( int  index)
protected

◆ commaDecimalCheckBoxToggled()

void AsciiOpenDlg::commaDecimalCheckBoxToggled ( bool  )

Slot called when the 'comma as decimal' checkbox is toggled.

◆ getAverageLineSize()

double AsciiOpenDlg::getAverageLineSize ( ) const
inline

Returns roughly estimated average line size (in bytes)

Definition at line 152 of file AsciiOpenDlg.h.

◆ getColumnsCount()

unsigned AsciiOpenDlg::getColumnsCount ( ) const
inline

Returns columns count per line.

Definition at line 155 of file AsciiOpenDlg.h.

◆ getMaxCloudSize()

unsigned AsciiOpenDlg::getMaxCloudSize ( ) const

Returns the max number of points per cloud.

◆ getOpenSequence()

Sequence AsciiOpenDlg::getOpenSequence ( ) const

Returns the whole "opening" sequence as set by the user.

◆ getSeparator()

unsigned char AsciiOpenDlg::getSeparator ( ) const
inline

Returns user selected separator.

Definition at line 146 of file AsciiOpenDlg.h.

◆ getSkippedLinesCount()

unsigned AsciiOpenDlg::getSkippedLinesCount ( ) const
inline

Returns number of lines to skip.

Definition at line 143 of file AsciiOpenDlg.h.

◆ onSeparatorChange()

void AsciiOpenDlg::onSeparatorChange ( const QString &  separator)

Slot called when separator changes.

◆ ResetApplyAll()

static void AsciiOpenDlg::ResetApplyAll ( )
static

Resets the "apply all" flag (if set)

◆ 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

◆ setSeparator()

void AsciiOpenDlg::setSeparator ( QChar  )
protected

Sets the current separator.

◆ setSkippedLines()

void AsciiOpenDlg::setSkippedLines ( int  linesCount)

Sets the number of lines to skip.

◆ shortcutButtonPressed()

void AsciiOpenDlg::shortcutButtonPressed ( )
protected

◆ showLabelsIn2D()

bool AsciiOpenDlg::showLabelsIn2D ( ) const

Whether labels should be visible in 2D.

◆ updateTable()

void AsciiOpenDlg::updateTable ( )

Forces the table to update itself.

◆ useCommaAsDecimal()

bool AsciiOpenDlg::useCommaAsDecimal ( ) const

Returns whether comma should be used as decimal point.

Member Data Documentation

◆ m_averageLineSize

double AsciiOpenDlg::m_averageLineSize
protected

Definition at line 207 of file AsciiOpenDlg.h.

◆ m_columnsCount

unsigned AsciiOpenDlg::m_columnsCount
protected

Definition at line 217 of file AsciiOpenDlg.h.

◆ m_columnType

std::vector<ColumnType> AsciiOpenDlg::m_columnType
protected

Identifies columns with numbers only [mandatory].

Definition at line 215 of file AsciiOpenDlg.h.

◆ m_filename

QString AsciiOpenDlg::m_filename
protected

Definition at line 208 of file AsciiOpenDlg.h.

◆ m_headerLine

QString AsciiOpenDlg::m_headerLine
protected

Definition at line 210 of file AsciiOpenDlg.h.

◆ m_separator

QChar AsciiOpenDlg::m_separator
protected

Definition at line 206 of file AsciiOpenDlg.h.

◆ m_skippedLines

unsigned AsciiOpenDlg::m_skippedLines
protected

Definition at line 205 of file AsciiOpenDlg.h.

◆ m_stream

QTextStream* AsciiOpenDlg::m_stream
protected

Definition at line 209 of file AsciiOpenDlg.h.

◆ m_ui

Ui_AsciiOpenDialog* AsciiOpenDlg::m_ui
protected

Definition at line 203 of file AsciiOpenDlg.h.


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