Пример #1
0
EditorFrame::EditorFrame(QWidget * parent)
  : QMainWindow(parent),
    mModelExplorer(nullptr),
    mTableModel(nullptr),
    mTreeModel(nullptr),
    mStatusBar(nullptr),
    mSearchViews(nullptr),
    mCompleter(nullptr),
    mAboutAction(nullptr),
    mAddAction(nullptr),
    mCopyAction(nullptr),
    mExitAction(nullptr),
    mExportIdfAction(nullptr),
    mImportIdfAction(nullptr),
    mNewIdkAction(nullptr),
    mOpenIdkAction(nullptr),
    mPasteAction(nullptr),
    mRemoveAction(nullptr),
    mSaveIdkAction(nullptr),
    mSaveIdkAsAction(nullptr),
    mExpandAllNodesAction(nullptr),
    mToggleGUIDsAction(nullptr),
    mSearchViewsAction(nullptr),
    mToggleCommentsAction(nullptr),
    mTogglePrecisionAction(nullptr),
    mToggleUnitsAction(nullptr),
    mFileMenu(nullptr),
    mHelpMenu(nullptr),
    mContextMenu(nullptr),
    mFileToolBar(nullptr),
    mEditToolBar(nullptr),
    mPrefToolBar(nullptr),
    mSearchToolBar(nullptr),
    mActionDescriptionPrefix(QString("Add ")),
    mLastPathOpened(QApplication::applicationDirPath()),
    mShowGUIDs(true),
    mShowComments(true),
    mShowPrecision(true)
{
  createWidgets();
  createActions();
  createMenus();
  createToolBars();
  createStatusBar();
  createLayout();
  connectSignalsAndSlots();
  readSettings();
  setCurrentFile("");

  ///! TODO HACK
  openstudio::model::Model model = mModelExplorer->getModel();
  openstudio::WorkspaceObjectVector objects = model.objects();
  QStringList strings;
  for (const openstudio::WorkspaceObject& object : objects){
    strings << object.iddObject().name().c_str();
  }
  mCompleter = new QCompleter(strings,this);
  mCompleter->setCaseSensitivity(Qt::CaseInsensitive);
  if(mSearchViews) mSearchViews->setCompleter(mCompleter);
}
Пример #2
0
 ModelExplorer::ModelExplorer(QWidget * parent)
   : QWidget(parent),
     mClassViewWidget(NULL),
     mTreeViewWidget(NULL),
     mObjectExplorer(NULL),
     mClassViewUnderMouse(false),
     mTreeViewUnderMouse(false),
     mProgressBarLbl(NULL),
     mSplitter(NULL),
     mDlg(NULL),
     mProgressBar(NULL),
     mQProgressBar(NULL),
     mClassAction(NULL),
     mTreeAction(NULL),
     mStackedWidget(NULL),
     mToolBar(NULL),
     mModel(openstudio::model::Model()),
     mIddFile(mModel.iddFile())
 {
   mModel.order().setDirectOrder(HandleVector());
   createProgressDlg();
   createWidgets();
   createActions();
   createToolBars();
   createLayout();
   connectSignalsAndSlots();
   restoreState();
   setIddFile(mModel);
   expandAllNodes();
 }
Пример #3
0
MainWindow::MainWindow(QWidget *parent) :
	QMainWindow(parent), ui(new Ui::OknoProgramu) {
	isPlay = false;

	setApplicationSettings();

    splash = new QSplashScreen(this, QPixmap(":/splashHeader.jpg"));
    splash->show();
    splash->showMessage(tr("Tworzenie okna"), Qt::AlignCenter | Qt::AlignBottom);


    QStringList capabiliteisList = Phonon::BackendCapabilities::availableMimeTypes();
    capabiliteisList.sort();
    qDebug("########Cap Start###########");
    for(int i = 0;i < capabiliteisList.size();i++){
        qDebug() << QString(capabiliteisList[i]);
    }
    qDebug("########Cap End###########");


    //proxy
    proxyDial = new proxyDialog(this);
    //options
    optionsDial = new Options(this);

    setWindowObjects();

    splash->showMessage(tr("Uruchamianie phonon"), Qt::AlignCenter | Qt::AlignBottom);

    startPhonon();

    createMainWindowObjectVariables();

    //file parser
    //this class add stations to window
    splash->showMessage(tr("Ładowanie listy stacji"), Qt::AlignCenter | Qt::AlignBottom);

    //download and parse playlist
    p = new Parser();
    //add parsed data from QMapIterator<QString,QString> to window
    connect(p, SIGNAL(send(QMap<QString,QString>*,QMap<QString,QString>*)),
			this, SLOT(recive(QMap<QString,QString>*,QMap<QString,QString>*)));
    connect(p, SIGNAL(fail()), this, SLOT(stationsFailed()));
    p->start();

    connectSignalsAndSlots();

    //timer
    timer = new QTimer(this);
    //timer run update function
    connect(timer, SIGNAL(timeout()), this, SLOT(checkPlayList()));
    //run this function every 5 second
    timer->start(5000);
    //center
    move((QApplication::desktop()->width() / 2 - width() / 2), (QApplication::desktop()->height() / 2 - height() / 2));
    audioOutput->setVolume((qreal)(1));

	tray.setIcon(QIcon(":/images/icon.ico"));
	tray.show();
}
Пример #4
0
MapView::MapView(QWidget *parent) : QGraphicsView(parent)
{
    outlinePen.setBrush(Qt::white);
    setInteractable(true);

    //NYI: limit maximum number of current downloads to 2 as specified in the CycleMap tileserver terms,
    // this would severely degrade download performance, though. Maybe keep limit at ~5?
    requestLimit = 5;
    maxReqStackSize = 30;
    networkManager = new QNetworkAccessManager(this);

    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

    setScene(new QGraphicsScene(this)); //no delete necessary, parent set
    setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate);

    lastTileUpdate = QTime(0,0);
    currentTime = new QTime(QTime::currentTime());

    //tile size: 256px x 256px, in coordinates: 2*PI x 2*PI
    scale(128/PI,128/PI); //default zoom == 0
    setSceneRect(-PI, -PI, 2*PI, 2*PI);

    mapSources.insert(OCM,{OCM,"OpenCycleMap", "http://tile.opencyclemap.org/cycle/", 0, 17});
    mapSources.insert(Mapnik,{Mapnik,"OpenStreetMap Mapnik", "http://tile.openstreetmap.org/", 0,18});
    mapSources.insert(None,{None,"None","",0,20});

    MapSource = {None, "None", "", 0 , 20};
    currentZoom = 0; zoomTo(MapSource.minzoom);

    connectSignalsAndSlots();
}
CalibrationWidget::CalibrationWidget(QWidget* parent)
    : QWidget(parent)
    , calibrationWidget(new Ui::CalibrationWidget)
    , imgModel(new ImageModel)
    , currentImage(0)
    , calibrationRunning(false)
{
    setupUi();
    connectSignalsAndSlots();
}
Пример #6
0
ObjectExplorer::ObjectExplorer(openstudio::IddFile& iddFile, QWidget * parent)
  : QWidget(parent),
  mGroupEdit(nullptr),
  mObjectEdit(nullptr),
  mGroupList(nullptr),
  mObjectList(nullptr),
  mIddFile(iddFile)
{
  createWidgets();
  connectSignalsAndSlots();
  createLayout();
}
Пример #7
0
void FetchDialog::accept()
// ----------------------------------------------------------------------------
//    Fetch from the previously chosen remote
// ----------------------------------------------------------------------------
{
    QApplication::setOverrideCursor(Qt::BusyCursor);

    proc = repo->asyncFetch(repo->lastFetchUrl = Url());
    if (!proc)
        return;
    connectSignalsAndSlots();
    (void)repo->dispatch(proc);
}
LVRRemoveOutliersDialog::LVRRemoveOutliersDialog(LVRPointCloudItem* pc, LVRModelItem* parent, QTreeWidget* treeWidget, vtkRenderWindow* window) :
   m_pc(pc), m_parent(parent), m_treeWidget(treeWidget), m_renderWindow(window)
{
    // Setup DialogUI and events
    QDialog* dialog = new QDialog(m_treeWidget);
    m_dialog = new RemoveOutliersDialog;
    m_dialog->setupUi(dialog);

    connectSignalsAndSlots();

    dialog->show();
    dialog->raise();
    dialog->activateWindow();
}
Пример #9
0
LogWindow::LogWindow(QWidget *parent) : QMainWindow(parent) {
	filenameLabel = new QLabel("Unsaved file", this);
	resultLabel = new QLabel("0", this);
	
	calculator = new CalculatorDialog(this);
	filename = "";
	
	setWindowTitle("Log of calculation");

	createActions();
	createMenu();
	createStatusBar();
	createCentralWidget();
	connectSignalsAndSlots();
}
Пример #10
0
/**
 * @brief NewFileDialog::NewFileDialog Creates a new File Dialog object
 * @param parent Pointer to parent object
 */
NewFileDialog::NewFileDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::NewFileDialog)
{
    ui->setupUi(this);

    // Initialize UI Elements
    ui->bgColor_colorLineEdit->setPreviewColor(true);
    ui->bgColor_colorLineEdit->hide();
    ui->bgColor_label->hide();

    bgColorExists = false;

    connectSignalsAndSlots();
}
Пример #11
0
ViewWidget::ViewWidget(QWidget *parent)
  : QWidget(parent),
  mSplitter(NULL),
  mIG(NULL),
  mIGPrecisionDlg(NULL),
  mModelExplorer(NULL),
  mModelDirty(false)
{
  mModelExplorer = qobject_cast<ModelExplorer *>(this->parent());
  OS_ASSERT(mModelExplorer);

  createWidgets();
  createLayout();
  connectSignalsAndSlots();
}
Пример #12
0
ViewWidget::ViewWidget(openstudio::model::Model model, QWidget *parent)
  : QWidget(parent),
  mSplitter(nullptr),
  mIG(nullptr),
  mIGPrecisionDlg(nullptr),
  mModelExplorer(nullptr),
  mModel(model),
  mModelDirty(false)
{
  mModelExplorer = qobject_cast<ModelExplorer *>(this->parent());
  OS_ASSERT(mModelExplorer);

  createWidgets();
  createLayout();
  connectSignalsAndSlots();
}
Пример #13
0
void
pcl::cloud_composer::CloudView::setModel (ProjectModel* new_model)
{
  //Create the QVTKWidget
  qvtk_ = new QVTKWidget ();
  qvtk_->SetRenderWindow (vis_->getRenderWindow ());
  vis_->setupInteractor (qvtk_->GetInteractor (), qvtk_->GetRenderWindow ());
 
  QGridLayout *mainLayout = new QGridLayout (this);
  mainLayout-> addWidget (qvtk_,0,0);
  
  model_ = new_model;
  //Make Connections!
  connectSignalsAndSlots();
  //Refresh the view
  qvtk_->show();
  qvtk_->update ();
}
Пример #14
0
/**
*the constructor of EasyTable
*/
EasyTable::EasyTable(QWidget *parent) :
    QTableWidget(parent)
{
    autoRecalc = true;
    defaultAlignment = true;
    autoResize = true;
    autoTip = false;
    tipDirty = false;
    RowCount = 32;      //set the number of rows
    ColumnCount = 18;   //set the number of columns
    setItemPrototype(new Cell);
    setSelectionMode(ExtendedSelection);
    clear();
    storeCellSize(0,0);//store the size of a normal cell;
    //Connections should be done later than clear(),
    //otherwise the size of Cell will be changed unexpectedly
    connectSignalsAndSlots();
}
Пример #15
0
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent), scaleFactor(1)
{
    setupUi(this);
	connectSignalsAndSlots();    
    addTreeView();    

	previewBefore = new PreViewWidget();
	previewAfter = new PreViewWidget();
	comparison = new PreViewWidget();
	tabWidget->addTab(previewBefore,"&Before");
	tabWidget->addTab(previewAfter,"&After");
	tabWidget->addTab(comparison,"&Comparion");
    
    foreach (QByteArray byteArray, QImageReader::supportedImageFormats())
    {
        QString extra = QString("*.") + QString(byteArray);
        supportedFormat << extra;
    }
Пример #16
0
void Simonoid::checkConnection() {
  if ( !m_isconnected ) {
    if ( !connectSignalsAndSlots() ) {
      kDebug() << "waiting for Simon to start...";
    } else {
      kDebug() << "connected successful!";
      m_status = i18n ( "Waiting" );
      m_peak = 0;
      update();
    }
  } else {
    if ( !m_dbusinterface->isValid() ) {
      kDebug() << "connection lost!";
      disconnectSignalsAndSlots();
      update();
    } else {
      kDebug() << "connection still valid";
    }
  }
}
LVRReconstructViaMarchingCubesDialog::LVRReconstructViaMarchingCubesDialog(string decomposition, LVRPointCloudItem* pc, LVRModelItem* parent, QTreeWidget* treeWidget, vtkRenderWindow* window) :
   m_decomposition(decomposition), 
   m_pc(pc), m_parent(parent), 
   m_treeWidget(treeWidget),
   m_renderWindow(window)
{
	m_master = this;

    // Setup DialogUI and events
    QDialog* dialog = new QDialog(m_treeWidget);
    m_dialog = new ReconstructViaMarchingCubesDialog;
    m_dialog->setupUi(dialog);

    if(decomposition == "PMC")
    {
    	dialog->setWindowTitle("Planar Marching Cubes");
    }

    connectSignalsAndSlots();

    m_progressDialog = new QProgressDialog;
    m_progressDialog->setMinimum(0);
    m_progressDialog->setMaximum(100);
    m_progressDialog->setMinimumDuration(100);
    m_progressDialog->setWindowTitle("Processing...");

    // Register LVR progress callbacks
    lvr::ProgressBar::setProgressCallback(&updateProgressbar);
    lvr::ProgressBar::setProgressTitleCallback(&updateProgressbarTitle);

    connect(this, SIGNAL(progressValueChanged(int)), m_progressDialog, SLOT(setValue(int)));
    connect(this, SIGNAL(progressTitleChanged(const QString&)), m_progressDialog, SLOT(setLabelText(const QString&)));

    dialog->show();
    dialog->raise();
    dialog->activateWindow();


}
LVRMainWindow::LVRMainWindow()
{
    setupUi(this);
    setupQVTK();

    // Init members
    m_correspondanceDialog = new LVRCorrespondanceDialog(treeWidget);
    m_incompatibilityBox = new QMessageBox();
    m_aboutDialog = new QDialog();
    Ui::AboutDialog aboutDialog;
    aboutDialog.setupUi(m_aboutDialog);

    // Setup specific properties
    QHeaderView* v = this->treeWidget->header();
    v->resizeSection(0, 175);

    treeWidget->setSelectionMode(QAbstractItemView::SingleSelection);
    treeWidget->setContextMenuPolicy(Qt::CustomContextMenu);

    m_treeWidgetHelper = new LVRTreeWidgetHelper(treeWidget);

    m_treeParentItemContextMenu = new QMenu;
    m_treeChildItemContextMenu = new QMenu;
    m_actionRenameModelItem = new QAction("Rename item", this);
    m_actionDeleteModelItem = new QAction("Delete item", this);
    m_actionExportModelTransformed = new QAction("Export item with transformation", this);
    m_actionShowColorDialog = new QAction("Select base color...", this);

    m_treeParentItemContextMenu->addAction(m_actionRenameModelItem);
    m_treeParentItemContextMenu->addAction(m_actionDeleteModelItem);
    m_treeChildItemContextMenu->addAction(m_actionExportModelTransformed);
    m_treeChildItemContextMenu->addAction(m_actionShowColorDialog);
    m_treeChildItemContextMenu->addAction(m_actionDeleteModelItem);

    // Toolbar item "File"
    m_actionOpen = this->actionOpen;
    m_actionExport = this->actionExport;
    m_actionQuit = this->actionQuit;
    // Toolbar item "Views"
    m_actionReset_Camera = this->actionReset_Camera;
    m_actionStore_Current_View = this->actionStore_Current_View;
    m_actionRecall_Stored_View = this->actionRecall_Stored_View;
    m_actionCameraPathTool = this->actionCameraPathTool;
    // Toolbar item "Reconstruction"
    m_actionEstimate_Normals = this->actionEstimate_Normals; // TODO: fix normal estimation
    m_actionMarching_Cubes = this->actionMarching_Cubes;
    m_actionPlanar_Marching_Cubes = this->actionPlanar_Marching_Cubes;
    m_actionExtended_Marching_Cubes = this->actionExtended_Marching_Cubes;
    m_actionCompute_Textures = this->actionCompute_Textures; // TODO: Compute textures
    m_actionMatch_Textures_from_Package = this->actionMatch_Textures_from_Package; // TODO: Match textures from package
    m_actionExtract_and_Rematch_Patterns = this->actionExtract_and_Rematch_Patterns; // TODO: Extract and rematch patterns
    // Toolbar item "Mesh Optimization"
    m_actionPlanar_Optimization = this->actionPlanar_Optimization;
    m_actionRemove_Artifacts = this->actionRemove_Artifacts;
    // Toolbar item "Filtering"
    m_actionRemove_Outliers = this->actionRemove_Outliers;
    m_actionMLS_Projection = this->actionMLS_Projection;
    // Toolbar item "Registration"
    m_actionICP_Using_Manual_Correspondance = this->actionICP_Using_Manual_Correspondance;
    m_actionICP_Using_Pose_Estimations = this->actionICP_Using_Pose_Estimations; // TODO: implement ICP registration
    m_actionGlobal_Relaxation = this->actionGlobal_Relaxation; // TODO: implement global relaxation
    // Toolbar item "Classification"
    m_actionSimple_Plane_Classification = this->actionSimple_Plane_Classification;
    m_actionFurniture_Recognition = this->actionFurniture_Recognition;
    // Toolbar item "About"
    // TODO: Replace "About"-QMenu with "About"-QAction
    m_menuAbout = this->menuAbout;
    // QToolbar below toolbar
    m_actionShow_Points = this->actionShow_Points;
    m_actionShow_Normals = this->actionShow_Normals;
    m_actionShow_Mesh = this->actionShow_Mesh;
    m_actionShow_Wireframe = this->actionShow_Wireframe;
    m_actionShowBackgroundSettings = this->actionShowBackgroundSettings;

    // Slider below tree widget
    m_horizontalSliderPointSize = this->horizontalSliderPointSize;
    m_horizontalSliderTransparency = this->horizontalSliderTransparency;
    // Combo boxes
    m_comboBoxGradient = this->comboBoxGradient; // TODO: implement gradients
    m_comboBoxShading = this->comboBoxShading; // TODO: fix shading
    // Buttons below combo boxes
    m_buttonCameraPathTool = this->buttonCameraPathTool;
    m_buttonCreateMesh = this->buttonCreateMesh;
    m_buttonExportData = this->buttonExportData;
    m_buttonTransformModel = this->buttonTransformModel;

    m_pickingInteractor = new LVRPickingInteractor(m_renderer);
    qvtkWidget->GetRenderWindow()->GetInteractor()->SetInteractorStyle( m_pickingInteractor );
    vtkSmartPointer<vtkPointPicker> pointPicker = vtkSmartPointer<vtkPointPicker>::New();
    qvtkWidget->GetRenderWindow()->GetInteractor()->SetPicker(pointPicker);


   // Widget to display the coordinate system
     m_axes = vtkSmartPointer<vtkAxesActor>::New();

     m_axesWidget = vtkSmartPointer<vtkOrientationMarkerWidget>::New();
     m_axesWidget->SetOutlineColor( 0.9300, 0.5700, 0.1300 );
     m_axesWidget->SetOrientationMarker( m_axes );
     m_axesWidget->SetInteractor( m_renderer->GetRenderWindow()->GetInteractor() );
     m_axesWidget->SetDefaultRenderer(m_renderer);
     m_axesWidget->SetViewport( 0.0, 0.0, 0.3, 0.3 );
     m_axesWidget->SetEnabled( 1 );
     m_axesWidget->InteractiveOff();

    connectSignalsAndSlots();
}
Пример #19
0
/*! \~russian
 * \brief Конструктор инициализирует объект, но для установки соединения необходимо
 *        воспользоваться методом TcpClient::connectToServer
 * \param parent - родитель для инициализации QObject
 */
TcpClient::TcpClient(QObject *parent)
    :QObject(parent)
{
    connectSignalsAndSlots();
}
Пример #20
0
/*! \~russian
 * \brief Конструктор инициализирует объект и открывает соединение
 * \param host - адрес удаленного сервера
 * \param port - порт на удаленном сервере
 * \param parent - родитель для инициализации QObject
 */
TcpClient::TcpClient(const QString &host, int port, QObject *parent)
    :QObject(parent)
{
    connectSignalsAndSlots();
    connectToServer(host, port);
}