InstanceObject::InstanceObject(GameWorld* engine, const glm::vec3& pos, const glm::quat& rot, const ModelRef& model, const glm::vec3& scale, std::shared_ptr<ObjectData> obj, InstanceObject* lod, std::shared_ptr<DynamicObjectData> dyn) : GameObject(engine, pos, rot, model) , health(100.f) , scale(scale) , body(nullptr) , object(obj) , LODinstance(lod) , dynamics(dyn) , _enablePhysics(false) { if( obj ) { changeModel(obj); for( auto& path : obj->paths ) { engine->aigraph.createPathNodes(position, rot, path); } } }
OutputWidget::OutputWidget(QWidget* parent, ToolViewData* tvdata) : QWidget( parent ), tabwidget(0), data(tvdata) { setWindowTitle(i18n("Output View")); setWindowIcon(tvdata->icon); QVBoxLayout* layout = new QVBoxLayout(this); layout->setMargin(0); if( data->type & KDevelop::IOutputView::MultipleView ) { tabwidget = new KTabWidget(this); layout->addWidget( tabwidget ); m_closeButton = new QToolButton( this ); connect( m_closeButton, SIGNAL( clicked() ), this, SLOT( closeActiveView() ) ); m_closeButton->setIcon( KIcon("tab-close") ); m_closeButton->adjustSize(); m_closeButton->setToolTip( i18n( "Close the currently active output view") ); tabwidget->setCornerWidget( m_closeButton, Qt::TopRightCorner ); } else if ( data->type == KDevelop::IOutputView::HistoryView ) { stackwidget = new QStackedWidget( this ); layout->addWidget( stackwidget ); previousAction = new KAction( KIcon( "go-previous" ), i18n("Previous"), this ); connect(previousAction, SIGNAL(triggered()), this, SLOT(previousOutput())); addAction(previousAction); nextAction = new KAction( KIcon( "go-next" ), i18n("Next"), this ); connect(nextAction, SIGNAL(triggered()), this, SLOT(nextOutput())); addAction(nextAction); } activateOnSelect = new KToggleAction( KIcon(), i18n("Select activated Item"), this ); addAction(activateOnSelect); activateOnSelect->setChecked( true ); focusOnSelect = new KToggleAction( KIcon(), i18n("Focus when selecting Item"), this ); addAction(focusOnSelect); focusOnSelect->setChecked( false ); connect( data, SIGNAL( outputAdded( int ) ), this, SLOT( addOutput( int ) ) ); connect( this, SIGNAL( outputRemoved( int, int ) ), data->plugin, SIGNAL( outputRemoved( int, int ) ) ); connect( data->plugin, SIGNAL(selectNextItem()), this, SLOT(selectNextItem()) ); connect( data->plugin, SIGNAL(selectPrevItem()), this, SLOT(selectPrevItem()) ); foreach( int id, data->outputdata.keys() ) { changeModel( id ); changeDelegate( id ); } enableActions(); }
void CFixLocalReactionParameters::fixModel(CModel * pModel) { if (pModel == NULL) return; mpModel = pModel; checkModel(); if (mChanges.size() == 0) return; changeModel(); }
void SessionServer::rloop() { if(!validHeader()) return; char cmd[_CMD_SIZE + 1]; cmd[_CMD_SIZE] = '\0'; if(!readSBuf(cmd, _CMD_SIZE)) return; if(strcmp(cmd, "cdr") == 0) createFolder(); else if(strcmp(cmd, "cfl") == 0) createFile(); else if(strcmp(cmd, "rdr") == 0) readFolder(); else if(strcmp(cmd, "cmd") == 0) changeModel(); else if(strcmp(cmd, "ofl") == 0) openFile(); else if(strcmp(cmd, "rfl") == 0) readFile(); else if(strcmp(cmd, "wfl") == 0) writeFile(); else if(strcmp(cmd, "skf") == 0) seekFile(); else if(strcmp(cmd, "tlf") == 0) tellFile(); else if(strcmp(cmd, "csf") == 0) closeFile(); else if(strcmp(cmd, "del") == 0) deleteItem(); else if(strcmp(cmd, "gsf") == 0) getItemSafeInfo(); // else if(strcmp(cmd, "fdk") == 0) // formatDisk(); else if(strcmp(cmd, "lgt") == 0) logout(); else if(strcmp(cmd, "aur") == 0) addUsr(); else if(strcmp(cmd, "cpd") == 0) changePsd(); else cmdError(); }
void StandardPLPanel::showView( int i_view ) { switch( i_view ) { case ICON_VIEW: { if( iconView == NULL ) createIconView(); currentView = iconView; break; } case LIST_VIEW: { if( listView == NULL ) createListView(); currentView = listView; break; } case PICTUREFLOW_VIEW: { if( picFlowView == NULL ) createCoverView(); currentView = picFlowView; break; } default: case TREE_VIEW: { if( treeView == NULL ) createTreeView(); currentView = treeView; break; } } changeModel( false ); viewStack->setCurrentWidget( currentView ); browseInto(); gotoPlayingItem(); }
//! [0] MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), completer(0), lineEdit(0) { createMenu(); QWidget *centralWidget = new QWidget; QLabel *modelLabel = new QLabel; modelLabel->setText(tr("Model")); modelCombo = new QComboBox; modelCombo->addItem(tr("QFileSytemModel")); modelCombo->addItem(tr("QFileSytemModel that shows full path")); modelCombo->addItem(tr("Country list")); modelCombo->addItem(tr("Word list")); modelCombo->setCurrentIndex(0); QLabel *modeLabel = new QLabel; modeLabel->setText(tr("Completion Mode")); modeCombo = new QComboBox; modeCombo->addItem(tr("Inline")); modeCombo->addItem(tr("Filtered Popup")); modeCombo->addItem(tr("Unfiltered Popup")); modeCombo->setCurrentIndex(1); QLabel *caseLabel = new QLabel; caseLabel->setText(tr("Case Sensitivity")); caseCombo = new QComboBox; caseCombo->addItem(tr("Case Insensitive")); caseCombo->addItem(tr("Case Sensitive")); caseCombo->setCurrentIndex(0); //! [0] //! [1] QLabel *maxVisibleLabel = new QLabel; maxVisibleLabel->setText(tr("Max Visible Items")); maxVisibleSpinBox = new QSpinBox; maxVisibleSpinBox->setRange(3,25); maxVisibleSpinBox->setValue(10); wrapCheckBox = new QCheckBox; wrapCheckBox->setText(tr("Wrap around completions")); wrapCheckBox->setChecked(true); //! [1] //! [2] contentsLabel = new QLabel; contentsLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); connect(modelCombo, SIGNAL(activated(int)), this, SLOT(changeModel())); connect(modeCombo, SIGNAL(activated(int)), this, SLOT(changeMode(int))); connect(caseCombo, SIGNAL(activated(int)), this, SLOT(changeCase(int))); connect(maxVisibleSpinBox, SIGNAL(valueChanged(int)), this, SLOT(changeMaxVisible(int))); //! [2] //! [3] lineEdit = new QLineEdit; QGridLayout *layout = new QGridLayout; layout->addWidget(modelLabel, 0, 0); layout->addWidget(modelCombo, 0, 1); layout->addWidget(modeLabel, 1, 0); layout->addWidget(modeCombo, 1, 1); layout->addWidget(caseLabel, 2, 0); layout->addWidget(caseCombo, 2, 1); layout->addWidget(maxVisibleLabel, 3, 0); layout->addWidget(maxVisibleSpinBox, 3, 1); layout->addWidget(wrapCheckBox, 4, 0); layout->addWidget(contentsLabel, 5, 0, 1, 2); layout->addWidget(lineEdit, 6, 0, 1, 2); centralWidget->setLayout(layout); setCentralWidget(centralWidget); changeModel(); setWindowTitle(tr("Completer")); lineEdit->setFocus(); }
OutputWidget::OutputWidget(QWidget* parent, const ToolViewData* tvdata) : QWidget( parent ) , tabwidget(0) , stackwidget(0) , data(tvdata) , m_closeButton(0) , m_closeOthersAction(0) , nextAction(0) , previousAction(0) , activateOnSelect(0) , focusOnSelect(0) , filterInput(0) , filterAction(0) { setWindowTitle(i18n("Output View")); setWindowIcon(tvdata->icon); QVBoxLayout* layout = new QVBoxLayout(this); layout->setMargin(0); if( data->type & KDevelop::IOutputView::MultipleView ) { tabwidget = new QTabWidget(this); layout->addWidget( tabwidget ); m_closeButton = new QToolButton( this ); connect( m_closeButton, &QToolButton::clicked, this, &OutputWidget::closeActiveView ); m_closeButton->setIcon( QIcon::fromTheme( QStringLiteral( "tab-close") ) ); m_closeButton->setToolTip( i18n( "Close the currently active output view") ); m_closeOthersAction = new QAction( this ); connect(m_closeOthersAction, &QAction::triggered, this, &OutputWidget::closeOtherViews); m_closeOthersAction->setIcon(QIcon::fromTheme(QStringLiteral("tab-close-other"))); m_closeOthersAction->setToolTip( i18n( "Close all other output views" ) ); m_closeOthersAction->setText( m_closeOthersAction->toolTip() ); addAction(m_closeOthersAction); tabwidget->setCornerWidget(m_closeButton, Qt::TopRightCorner); } else if ( data->type == KDevelop::IOutputView::HistoryView ) { stackwidget = new QStackedWidget( this ); layout->addWidget( stackwidget ); previousAction = new QAction( QIcon::fromTheme( QStringLiteral( "arrow-left" ) ), i18n("Previous Output"), this ); connect(previousAction, &QAction::triggered, this, &OutputWidget::previousOutput); addAction(previousAction); nextAction = new QAction( QIcon::fromTheme( QStringLiteral( "arrow-right" ) ), i18n("Next Output"), this ); connect(nextAction, &QAction::triggered, this, &OutputWidget::nextOutput); addAction(nextAction); } addAction(dynamic_cast<QAction*>(data->plugin->actionCollection()->action(QStringLiteral("prev_error")))); addAction(dynamic_cast<QAction*>(data->plugin->actionCollection()->action(QStringLiteral("next_error")))); activateOnSelect = new KToggleAction( QIcon(), i18n("Select activated Item"), this ); activateOnSelect->setChecked( true ); focusOnSelect = new KToggleAction( QIcon(), i18n("Focus when selecting Item"), this ); focusOnSelect->setChecked( false ); if( data->option & KDevelop::IOutputView::ShowItemsButton ) { addAction(activateOnSelect); addAction(focusOnSelect); } QAction *separator = new QAction(this); separator->setSeparator(true); addAction(separator); QAction* action; action = new QAction(QIcon::fromTheme(QStringLiteral("go-first")), i18n("First Item"), this); connect(action, &QAction::triggered, this, &OutputWidget::selectFirstItem); addAction(action); action = new QAction(QIcon::fromTheme(QStringLiteral("go-previous")), i18n("Previous Item"), this); connect(action, &QAction::triggered, this, &OutputWidget::selectPreviousItem); addAction(action); action = new QAction(QIcon::fromTheme(QStringLiteral("go-next")), i18n("Next Item"), this); connect(action, &QAction::triggered, this, &OutputWidget::selectNextItem); addAction(action); action = new QAction(QIcon::fromTheme(QStringLiteral("go-last")), i18n("Last Item"), this); connect(action, &QAction::triggered, this, &OutputWidget::selectLastItem); addAction(action); QAction* selectAllAction = KStandardAction::selectAll(this, SLOT(selectAll()), this); selectAllAction->setShortcut(QKeySequence()); //FIXME: why does CTRL-A conflict with Katepart (while CTRL-Cbelow doesn't) ? selectAllAction->setShortcutContext(Qt::WidgetWithChildrenShortcut); addAction(selectAllAction); QAction* copyAction = KStandardAction::copy(this, SLOT(copySelection()), this); copyAction->setShortcutContext(Qt::WidgetWithChildrenShortcut); addAction(copyAction); if( data->option & KDevelop::IOutputView::AddFilterAction ) { QAction *separator = new QAction(this); separator->setSeparator(true); addAction(separator); filterInput = new QLineEdit(); filterInput->setMaximumWidth(150); filterInput->setMinimumWidth(100); filterInput->setPlaceholderText(i18n("Search...")); filterInput->setClearButtonEnabled(true); filterInput->setToolTip(i18n("Enter a wild card string to filter the output view")); filterAction = new QWidgetAction(this); filterAction->setDefaultWidget(filterInput); addAction(filterAction); connect(filterInput, &QLineEdit::textEdited, this, &OutputWidget::outputFilter ); if( data->type & KDevelop::IOutputView::MultipleView ) { connect(tabwidget, &QTabWidget::currentChanged, this, &OutputWidget::updateFilter); } else if ( data->type == KDevelop::IOutputView::HistoryView ) { connect(stackwidget, &QStackedWidget::currentChanged, this, &OutputWidget::updateFilter); } } addActions(data->actionList); connect( data, &ToolViewData::outputAdded, this, &OutputWidget::addOutput ); connect( this, &OutputWidget::outputRemoved, data->plugin, &StandardOutputView::outputRemoved ); foreach( int id, data->outputdata.keys() ) { changeModel( id ); changeDelegate( id ); } enableActions(); }
QTreeView* OutputWidget::createListView(int id) { auto createHelper = [&]() -> QTreeView* { KDevelop::FocusedTreeView* listview = new KDevelop::FocusedTreeView(this); listview->setEditTriggers( QAbstractItemView::NoEditTriggers ); listview->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn); //Always enable the scrollbar, so it doesn't flash around listview->setHeaderHidden(true); listview->setUniformRowHeights(true); listview->setRootIsDecorated(false); listview->setSelectionMode( QAbstractItemView::ContiguousSelection ); if (data->outputdata.value(id)->behaviour & KDevelop::IOutputView::AutoScroll) { listview->setAutoScrollAtEnd(true); } connect(listview, &QTreeView::activated, this, &OutputWidget::activate); connect(listview, &QTreeView::clicked, this, &OutputWidget::activate); return listview; }; QTreeView* listview = 0; if( !views.contains(id) ) { bool newView = true; if( data->type & KDevelop::IOutputView::MultipleView || data->type & KDevelop::IOutputView::HistoryView ) { qCDebug(PLUGIN_STANDARDOUTPUTVIEW) << "creating listview"; listview = createHelper(); if( data->type & KDevelop::IOutputView::MultipleView ) { tabwidget->addTab( listview, data->outputdata.value(id)->title ); } else { stackwidget->addWidget( listview ); stackwidget->setCurrentWidget( listview ); } } else { if( views.isEmpty() ) { listview = createHelper(); layout()->addWidget( listview ); } else { listview = views.begin().value(); newView = false; } } views[id] = listview; changeModel( id ); changeDelegate( id ); if (newView) listview->scrollToBottom(); } else { listview = views.value(id); } enableActions(); return listview; }
Muneco (Models name,float s,Vector3f pos) { scalated = s; changeModel(name); posFinal = Vector3f(pos.x,pos.y+tamano.y/2,pos.z); }
void StandardPLPanel::showView( int i_view ) { bool b_treeViewCreated = false; switch( i_view ) { case ICON_VIEW: { if( iconView == NULL ) createIconView(); currentView = iconView; break; } case LIST_VIEW: { if( listView == NULL ) createListView(); currentView = listView; break; } case PICTUREFLOW_VIEW: { if( picFlowView == NULL ) createCoverView(); currentView = picFlowView; break; } default: case TREE_VIEW: { if( treeView == NULL ) { createTreeView(); b_treeViewCreated = true; } currentView = treeView; break; } } changeModel( false ); /* Restoring the header Columns must come after changeModel */ if( b_treeViewCreated ) { assert( treeView ); if( getSettings()->contains( "Playlist/headerStateV2" ) ) { treeView->header()->restoreState(getSettings() ->value( "Playlist/headerStateV2" ).toByteArray() ); /* if there is allready stuff in playlist, we don't sort it and we reset sorting */ if( model->rowCount() ) { treeView->header()->setSortIndicator( -1 , Qt::AscendingOrder ); } } else { for( int m = 1, c = 0; m != COLUMN_END; m <<= 1, c++ ) { treeView->setColumnHidden( c, !( m & COLUMN_DEFAULT ) ); if( m == COLUMN_TITLE ) treeView->header()->resizeSection( c, 200 ); else if( m == COLUMN_DURATION ) treeView->header()->resizeSection( c, 80 ); } } } viewStack->setCurrentWidget( currentView ); browseInto(); gotoPlayingItem(); }
Object::Object(Model* _model, Vector3D _pos, Vector3D _rot, Vector3D _scale) : expired(false), visible(true), rendering_model(NULL), pos(_pos), rot(_rot), scale(_scale) { changeModel(_model); }
Object::Object(ModelSpecification& _model_spec, Vector3D _pos, Vector3D _rot, Vector3D _scale) : expired(false), visible(true), rendering_model(NULL), pos(_pos), rot(_rot), scale(_scale) { changeModel(_model_spec); }