Example #1
0
int maoni_main(int argc, char* argv[], RenderAlgorithm* algorithm_stack)
{
	boost::mpi::environment env(argc, argv);
	QApplication app(argc, argv);
	Q_INIT_RESOURCE( Resources);

	QPixmap pixmap(":/Maoni/Splashscreen.jpg");
	QSplashScreen splash(pixmap, Qt::WindowStaysOnTopHint);

	FrameDataIceT framedata(algorithm_stack);

	RenderWidgetIceT* icet_widget = new RenderWidgetIceT(framedata);

	QWidget* main_window;
	if (framedata.master())
	{
		MainWindow* mw = new MainWindow(framedata, icet_widget);

		TilesWidget* tiles_widget = new TilesWidget(framedata);
		mw->connect(mw, SIGNAL(data_updated()), tiles_widget, SLOT(
				update_browser()));

		mw->add_dock("Tile Config", Qt::LeftDockWidgetArea, //
				tiles_widget);
		main_window = mw;
		splash.show();
	}
	else
	{
		main_window = icet_widget;
	}

	QString window_title("Maoni using IceT Parallel Rendering; Rank %1");
	main_window->setWindowTitle(window_title.arg(framedata.myrank()));

	QTimer::singleShot(1000, main_window, SLOT(show()));
	QTimer::singleShot(1337, &splash, SLOT(close()));

	env.abort(app.exec());
	return 0;
}
Example #2
0
         //Timer call to animate the graph bars.
         void MonthView::on_growth_animation_timer_update()
          {

             if (prev_source_name != SOURCE_OTHER )
             {
             if((opacity <= 255) && (opacity >= 20 ))
             {
                opacity -= 25;
             }else
             {
                if (opacity <= 20 )
                 {
                    opacity =20;

                }
                if (opacity >= 255)
                {
                    opacity = 255;
                }
                }
            }
             bool isAnimationinProgress = false;
            all_week_data = 0;

            int data;
             int sourceData;
             int weekly_total = 0;

             for(int row = 0; row < 6; row++)
             {
                  weekly_total = 0;
                     for(int col = 0; col < 7; col++)
                        {
                                 if ( m_vector_vector_view_selected_day_usage_values.size() != 42)
                                {
                                     break;
                                 }
                                 QTableWidgetItem *item = ui->tblDates->item(row,col);

                                 QVariant v =  item->data(0);
                                 StarRating r = v.value<StarRating>();
//                                  int data;
//                                  int sourceData;

                                  if (ResetAnimation)
                                  {
                                      data = 0;
                                      sourceData =0;
                                  }
                                 else
                                 {
                                     data =  r.data_total;
                                     sourceData = r.data_from_source;
                                }


                                 if (opacity> 20 && prev_source_name != SOURCE_OTHER )
                                 {
                                     isAnimationinProgress = true;
                                   sourceData = ((int)((qreal)(50 * ( m_vector_vector_view_selected_day_usage_values[(row * 7) + col ][prev_source_name] )))/MaxUnit );
                                   if (opacity < 50)
                                   {
                                       sourceData =0;
                                   }
                                 }
                                 else if(data <  ((int)((qreal)(50 * ( m_vector_vector_view_selected_day_usage_values[(row * 7) + col ][0] +  m_vector_vector_view_selected_day_usage_values[(row * 7) + col ][1] +  m_vector_vector_view_selected_day_usage_values[(row * 7) + col ][2] +  m_vector_vector_view_selected_day_usage_values[(row * 7) + col ][3] +  m_vector_vector_view_selected_day_usage_values[(row * 7) + col ][4]  )))/MaxUnit ) )
                                 {
                                         data++;
                                         isAnimationinProgress = true;
                                 }
                                 else if(sourceData <  ((int)((qreal)(50 * ( m_vector_vector_view_selected_day_usage_values[(row * 7) + col ][currentSource] )))/MaxUnit ))
                                 {
                                         sourceData++;

                                         isAnimationinProgress= true;
                                 }

                                  QDate dt = QDate::fromString(item->whatsThis());
                                  bool isfuturedate = false;
                                  if(dt.operator <= (QDate::currentDate()))
                                   {
                                       isfuturedate = true;
                                   }


                                   item->setData(0, qVariantFromValue(StarRating(r.date, data, sourceData, currentSource,r.max_data_total,r.max_source_data, opacity, prev_source_name, (qreal)((qreal)(50 * ( m_vector_vector_view_selected_day_usage_values[(row * 7) + col ][prev_source_name] )))/MaxUnit ,  isfuturedate)));

                                    if (opacity  <= 20)
                                    {
                                        opacity= 255;
                                        prev_source_name = SOURCE_OTHER;

                                    }
                                    if(sourceData >0 && isfuturedate)
                                    {
                                        weekly_total +=  m_vector_vector_view_selected_day_usage_values[(row * 7) + col ][currentSource] ;
                                    }
                          }

                    // if(weekly_total > 0)
                     {
                         all_week_data += weekly_total;
                         QTableWidgetItem *item_total = ui->tblDates->item(row, 7);
                         item_total->setData(0,
                                    qVariantFromValue(StarRating(100,weekly_total,0, source_name,data,sourceData)));
                      }

                 }
                     ResetAnimation= false;
                     if (isAnimationinProgress == false  )
                     {
                             prev_source_name =currentSource;
                             m_ptr_growth_animation_timer->stop();
                     }

                     emit(data_updated(all_week_data));
          }