Overview | Modules | Class Hierarchy | Classes | Members

# tlp::ImportCSVDataWidget Class Reference

`#include <ImportCSVDataWidget.h>`

Inherits tlp::CSVContentHandler.

Inheritance diagram for tlp::ImportCSVDataWidget:

[legend]
Collaboration diagram for tlp::ImportCSVDataWidget:

[legend]
List of all members.

## Signals

- void validStateChange (bool valid)

## Public Member Functions

- ImportCSVDataWidget (QWidget *parent=NULL)
- virtual ~ImportCSVDataWidget ()
- QWidget * buildWidget (QWidget *parent)
- bool loadDataIntoGraph ()
- void setGraph (tlp::Graph *graph)
- tlp::Graph * getGraph () const
- void begin ()
- void token (unsigned int row, unsigned int column, const std::string &token)
- void end (unsigned int rowNumber, unsigned int columnNumber)

## Protected Slots

- virtual void CSVFileChanged (QString file)
- virtual void separatorChanged (QString newSeparator)
- virtual void useFirstRowAsPropertyNameChanged (bool useFirstRow)
- virtual void propertyOrientationChanged (ImportCSVDataConfigurationWidget::PropertyOrientation oritentation)

## Protected Member Functions

- virtual bool checkIfDataAreValid ()
- void updateWidgetState ()
- void graphChanged (tlp::Graph *newGraph)
- virtual ImportCSVDataConfigurationWidget * buildConfigurationWidget (QWidget *parent)
- virtual CSVParser * buildCSVParser ()
- virtual void updatePreviews ()
- virtual void loadCSVData ()
- ImportCSVDataConfigurationWidget::PropertyType guessVectorDataType (const std::vector< std::string > &dataRow)
- ImportCSVDataConfigurationWidget::PropertyType guessDataType (const std::string &data, const std::string &decimalSeparator)
- bool existingPropertyIsCompatibleWithType (tlp::Graph *graph, const std::string &propertyName, ImportCSVDataConfigurationWidget::PropertyType propertyType) const
- tlp::PropertyInterface * getProperty (tlp::Graph *graph, const std::string &propertyName, ImportCSVDataConfigurationWidget::PropertyType propertyType)
- tlp::node getNextNode ()
- void stopDataLoading ()
- tlp::PropertyInterface * getPropertyInterface (unsigned int row, unsigned int column, const std::string &token)
- tlp::node getNode (unsigned int row, unsigned int column)

## Protected Attributes

- tlp::Graph * graph
- QWidget * rootWidget
- ImportCSVDataConfigurationWidget * propertiesWidget
- CSVParser * parser
- std::map< unsigned int, tlp::node > nodesBuffer
- tlp::Iterator< tlp::node > * nodesIterator
- QMessageBox::StandardButton overwritePropertiesButton
- std::map< unsigned int,tlp::PropertyInterface * > propertiesBuffer
- tlp::node currentNode
- tlp::PluginProgress * pluginProgress

## Constructor & Destructor Documentation

tlp::ImportCSVDataWidget::ImportCSVDataWidget | ( | QWidget * | parent = `NULL` | ) |

virtual tlp::ImportCSVDataWidget::~ImportCSVDataWidget | ( |  | ) | `[virtual]`

## Member Function Documentation

void tlp::ImportCSVDataWidget::begin | ( |  | ) | `[virtual]`

| Function called at the beginning of the file parsing. Implements tlp::CSVContentHandler.

virtual ImportCSVDataConfigurationWidget* tlp::ImportCSVDataWidget::buildConfigurationWidget | ( | QWidget * | parent | ) | `[protected, virtual]`

virtual CSVParser* tlp::ImportCSVDataWidget::buildCSVParser | ( |  | ) | `[protected, virtual]`

| Create and return the CSV parser object.

QWidget* tlp::ImportCSVDataWidget::buildWidget | ( | QWidget * | parent | ) |

virtual bool tlp::ImportCSVDataWidget::checkIfDataAreValid | ( |  | ) | `[protected, virtual]`

| Function used to check if all the selected options are valid.

virtual void tlp::ImportCSVDataWidget::CSVFileChanged | ( | QString | file | ) | `[protected, virtual, slot]`

void tlp::ImportCSVDataWidget::end | ( | unsigned int | rowNumber,
|  | unsigned int | columnNumber
| ) | `[virtual]`

Function called at the end of the parsing.

Parameters:

  | rowNumber | the number of row read in the file.
  | columnNumber | The column number for the line with the greatest column number.

Implements tlp::CSVContentHandler.

bool tlp::ImportCSVDataWidget::existingPropertyIsCompatibleWithType | ( | tlp::Graph * | graph,
|  | const std::string & | propertyName,
|  | ImportCSVDataConfigurationWidget::PropertyType | propertyType
| ) | const`[protected]`

| Test if a property is compatible with the given type.

tlp::Graph* tlp::ImportCSVDataWidget::getGraph | ( |  | ) | const`[inline]`

tlp::node tlp::ImportCSVDataWidget::getNextNode | ( |  | ) | `[protected]`

| Get the next node in the graph if it exists or an invalid node.

tlp::node tlp::ImportCSVDataWidget::getNode | ( | unsigned int | row,
|  | unsigned int | column
| ) | `[protected]`

| Compute the node number in function of the given row and column.

tlp::PropertyInterface* tlp::ImportCSVDataWidget::getProperty | ( | tlp::Graph * | graph,
|  | const std::string & | propertyName,
|  | ImportCSVDataConfigurationWidget::PropertyType | propertyType
| ) | `[protected]`

| Find or create a property in the graph.

tlp::PropertyInterface* tlp::ImportCSVDataWidget::getPropertyInterface | ( | unsigned int | row,
|  | unsigned int | column,
|  | const std::string & | token
| ) | `[protected]`

| Get the property interface for the given row or column or create it if needed.

void tlp::ImportCSVDataWidget::graphChanged | ( | tlp::Graph * | newGraph | ) | `[protected]`

| Function called to set the graph.

ImportCSVDataConfigurationWidget::PropertyType tlp::ImportCSVDataWidget::guessDataType | ( | const std::string & | data,
|  | const std::string & | decimalSeparator
| ) | `[protected]`

| Try to find the type from a string.

ImportCSVDataConfigurationWidget::PropertyType tlp::ImportCSVDataWidget::guessVectorDataType | ( | const std::vector< std::string > & | dataRow | ) | `[protected]`

| Try to find the type of a vector of string.

virtual void tlp::ImportCSVDataWidget::loadCSVData | ( |  | ) | `[protected, virtual]`

| Parse and load data in the graph.

bool tlp::ImportCSVDataWidget::loadDataIntoGraph | ( |  | ) |

virtual void tlp::ImportCSVDataWidget::propertyOrientationChanged | ( | ImportCSVDataConfigurationWidget::PropertyOrientation | oritentation | ) | `[protected, virtual, slot]`

virtual void tlp::ImportCSVDataWidget::separatorChanged | ( | QString | newSeparator | ) | `[protected, virtual, slot]`

void tlp::ImportCSVDataWidget::setGraph | ( | tlp::Graph * | graph | ) |

void tlp::ImportCSVDataWidget::stopDataLoading | ( |  | ) | `[protected]`

| Stop the current data loading.

void tlp::ImportCSVDataWidget::token | ( | unsigned int | row,
|  | unsigned int | column,
|  | const std::string & | token
| ) | `[virtual]`

Function called for each tokens found in the file.

Parameters:

  | row | The row position of the token.
  | column | The column position of the token.
  | token | The token.

Implements tlp::CSVContentHandler.

virtual void tlp::ImportCSVDataWidget::updatePreviews | ( |  | ) | `[protected, virtual]`

void tlp::ImportCSVDataWidget::updateWidgetState | ( |  | ) | `[protected]`

virtual void tlp::ImportCSVDataWidget::useFirstRowAsPropertyNameChanged | ( | bool | useFirstRow | ) | `[protected, virtual, slot]`

void tlp::ImportCSVDataWidget::validStateChange | ( | bool | valid | ) | `[signal]`

## Member Data Documentation

tlp::node tlp::ImportCSVDataWidget::currentNode `[protected]`

tlp::Graph* tlp::ImportCSVDataWidget::graph `[protected]`

std::map<unsigned int,tlp::node> tlp::ImportCSVDataWidget::nodesBuffer `[protected]`

tlp::Iterator<tlp::node>* tlp::ImportCSVDataWidget::nodesIterator `[protected]`

QMessageBox::StandardButton tlp::ImportCSVDataWidget::overwritePropertiesButton `[protected]`

CSVParser* tlp::ImportCSVDataWidget::parser `[protected]`

tlp::PluginProgress* tlp::ImportCSVDataWidget::pluginProgress `[protected]`

std::map<unsigned int ,tlp::PropertyInterface*> tlp::ImportCSVDataWidget::propertiesBuffer `[protected]`

ImportCSVDataConfigurationWidget* tlp::ImportCSVDataWidget::propertiesWidget `[protected]`

QWidget* tlp::ImportCSVDataWidget::rootWidget `[protected]`

Tulip Software by LaBRI Visualization Team 2001 - 2010