Exemplo n.º 1
0
void vtkFrame::OpenCSVFile(wxCommandEvent& event)
{

	wxFileDialog dialog(this, _T("Choose a CSV file to open"),
							  _T(""),_T(""),_T("*.*"),
							  wxFD_OPEN | wxFD_FILE_MUST_EXIST);

	if (dialog.ShowModal() == wxID_OK)
 	{  	
		
		fileInfoDialog infoDialog(this);
		if ( infoDialog.ShowModal() == wxID_OK )
        {
        	showProgressDialog("Processing CSV File");
        									
        	*ds = new Dataset( (const char*)dialog.GetPath().mb_str(wxConvUTF8), 
        					infoDialog.dims, infoDialog.steps, this );   				
        	
        	clearProgressDialog();
        	
        	UpdateSliderLimits();
        	vtkRenderWindow->SetDataset(*ds);  
        	UpdateMenuItems();
        }
			
	}
	
}
Exemplo n.º 2
0
void vtkFrame::Filter( wxCommandEvent& event )
{
	filterDialog dialog(this);
	if ( dialog.ShowModal() == wxID_OK ) {
		
        showProgressDialog("Filtering Dataset");        									
       	(*ds)->filter_grains(dialog.threshold);
       	(*ds)->calculate_grain_info();
       	clearProgressDialog();
       	vtkRenderWindow->RefreshData();
        	
	}
}
Exemplo n.º 3
0
bool KviPackageWriter::pack(const QString & szFileName, kvi_u32_t uPackFlags)
{
	m_p->iCurrentProgress = 0;
	if(!(uPackFlags & NoProgressDialog))
	{
		showProgressDialog(__tr2qs("Creating package..."), 100);
		updateProgress(m_p->iCurrentProgress, __tr2qs("Writing package header"));
	}

	bool bRet = packInternal(szFileName, uPackFlags);

	hideProgressDialog();
	return bRet;
}
Exemplo n.º 4
0
bool KviPackageReader::unpackInternal(const QString & szLocalFileName, const QString & szUnpackPath, kvi_u32_t uUnpackFlags)
{

	KviFile f(szLocalFileName);
	if(!f.open(QFile::ReadOnly))
	{
		setLastError(__tr2qs("Can't open file for reading"));
		return false;
	}

	kvi_file_offset_t size = f.size();

	if(!(uUnpackFlags & NoProgressDialog))
	{
		showProgressDialog(__tr2qs("Reading package..."), size);
		updateProgress(0, __tr2qs("Reading package header"));
	}

	if(!readHeaderInternal(&f, szLocalFileName))
		return false;

	if(!updateProgress(f.pos(), __tr2qs("Reading package data")))
		return false; // aborted

	while(!f.atEnd())
	{
		// DataFieldType
		kvi_u32_t uDataFieldType;
		if(!f.load(uDataFieldType))
			return readError();
		// DataFieldLen
		kvi_u32_t uDataFieldLen;
		if(!f.load(uDataFieldLen))
			return readError();

		switch(uDataFieldType)
		{
			case KVI_PACKAGE_DATAFIELD_TYPE_FILE:
				if(!unpackFile(&f, szUnpackPath))
					return false;
				break;
			default:
				setLastError(__tr2qs("Invalid data field: the package is probably corrupt"));
				return false;
				break;
		}
	}

	return true;
}
Exemplo n.º 5
0
void vtkFrame::Dilate( wxCommandEvent& event )
{
	dilateDialog dialog(this);
	if ( dialog.ShowModal() == wxID_OK ) {
		
        showProgressDialog("Dilating Dataset");        									
       	(*ds)->dilate_grains();
       	(*ds)->calculate_grain_info();
       	(*ds)->merge_grains(dialog.threshold);
       	(*ds)->calculate_grain_info();   				
       	clearProgressDialog();
       	vtkRenderWindow->RefreshData();
        	
	}
}
Exemplo n.º 6
0
ProgressDialog::ProgressDialog( QWidget* alignWidget, QWidget* parent, const char* name )
    : OverlayWidget( alignWidget, parent, name ), mWasLastShown( false )
{
    setFrameStyle( QFrame::Panel | QFrame::Sunken ); // QFrame
    setSpacing( 0 ); // QHBox
    setMargin( 1 );

    mScrollView = new TransactionItemView( this, "ProgressScrollView" );

    // No more close button for now, since there is no more autoshow
    /*
    QVBox* rightBox = new QVBox( this );
    QToolButton* pbClose = new QToolButton( rightBox );
    pbClose->setAutoRaise(true);
    pbClose->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
    pbClose->setFixedSize( 16, 16 );
    pbClose->setIconSet( KGlobal::iconLoader()->loadIconSet( "fileclose", KIcon::Small, 14 ) );
    QToolTip::add( pbClose, i18n( "Hide detailed progress window" ) );
    connect(pbClose, SIGNAL(clicked()), this, SLOT(slotClose()));
    QWidget* spacer = new QWidget( rightBox ); // don't let the close button take up all the height
    rightBox->setStretchFactor( spacer, 100 );
    */

    /*
     * Get the singleton ProgressManager item which will inform us of
     * appearing and vanishing items.
     */
    ProgressManager *pm = ProgressManager::instance();
    connect ( pm, SIGNAL( progressItemAdded( KPIM::ProgressItem* ) ),
              this, SLOT( slotTransactionAdded( KPIM::ProgressItem* ) ) );
    connect ( pm, SIGNAL( progressItemCompleted( KPIM::ProgressItem* ) ),
              this, SLOT( slotTransactionCompleted( KPIM::ProgressItem* ) ) );
    connect ( pm, SIGNAL( progressItemProgress( KPIM::ProgressItem*, unsigned int ) ),
              this, SLOT( slotTransactionProgress( KPIM::ProgressItem*, unsigned int ) ) );
    connect ( pm, SIGNAL( progressItemStatus( KPIM::ProgressItem*, const QString& ) ),
              this, SLOT( slotTransactionStatus( KPIM::ProgressItem*, const QString& ) ) );
    connect ( pm, SIGNAL( progressItemLabel( KPIM::ProgressItem*, const QString& ) ),
              this, SLOT( slotTransactionLabel( KPIM::ProgressItem*, const QString& ) ) );
    connect ( pm, SIGNAL( progressItemUsesCrypto(KPIM::ProgressItem*, bool) ),
              this, SLOT( slotTransactionUsesCrypto( KPIM::ProgressItem*, bool ) ) );
    connect ( pm, SIGNAL( showProgressDialog() ),
              this, SLOT( slotShow() ) );
}
Exemplo n.º 7
0
void vtkFrame::CalculateExtraStats(  wxCommandEvent& event )
{
	showProgressDialog("Filtering Dataset");        									
    (*ds)->calculate_extra_stats();
    clearProgressDialog();	
}