1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
#ifndef CVS_INPUTDATAITEM_H
#define CVS_INPUTDATAITEM_H
#include <inputDataItem.h>
#include <BALL/QSAR/QSARData.h>
#include <QtGui/QGraphicsSceneMouseEvent>
namespace BALL
{
namespace VIEW
{
class CSVInputDataItem : public InputDataItem
{
public:
/** @name Constructors and Destructors
*/
//CSVInputDataItem(QString file, int no_y, bool xlabels, bool ylabels, const char* sep);
CSVInputDataItem(QString filename, DataItemView* view);
~CSVInputDataItem();
CSVInputDataItem(CSVInputDataItem& item);
CSVInputDataItem(BALL::QSAR::QSARData* data, DataItemView* view);
/** read the input data */
bool execute();
/** @name Accessors
*/
enum { Type = UserType + 124 };
/** Returns the type of the item as an int. This type information is used by qgraphicsitem_cast() to distinguish between types. */
int type() const { return Type; }
void setXLabelFlag(bool x);
void setYLabelFlag(bool y);
void setNumOfActivities(int num);
void setSeperator(string sep);
bool checkForDiscreteY();
string getSeperator() {return sep_;}
bool getDescriptorLabels() {return x_labels_;}
bool getCompoundLabels() {return y_labels_;}
int getNoResponseVariables() {return no_y_;}
void addToPipeline();
void removeFromPipeline();
/** Replace the given InputDataItem.\n
Thus all edges are transferred from the old item to this item, the latter one is inserted into the correct pipeline at the same position than the old item, which is then deleted.*/
void replaceItem(InputDataItem* old_item);
private:
void readData();
void appendData();
/** @name Attributes
*/
int no_y_;
bool x_labels_;
bool y_labels_;
string sep_;
protected:
void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
};
}
}
#endif
|