void VoxCad::SetupBCWindow(void) { BCDockWidget = new QDockWidget(this); BCDockWidget->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); BCsDlg = new Dlg_BCs(&MainEnv, BCDockWidget); BCDockWidget->setWidget(BCsDlg); BCDockWidget->setWindowTitle("BCs"); BCDockWidget->setVisible(false); connect(BCDockWidget->toggleViewAction(), SIGNAL(triggered(bool)), this, SLOT(BCsMode(bool))); connect(BCsDlg, SIGNAL(RequestUpdateGL()), this, SLOT(ReqGLUpdateAll())); connect(BCsDlg, SIGNAL(RequestGLSelect(int)), this, SLOT(SetGLSelected(int))); connect(BCsDlg, SIGNAL(DoneEditing()), this, SLOT(ViewMode(void))); connect(&MainEnv, SIGNAL(BCsChanged()), BCsDlg, SLOT(UpdateBCLists(void))); //when we load BC's update the dlg! connect(&MainSim, SIGNAL(BCsChanged()), BCsDlg, SLOT(UpdateBCLists(void))); //when we load BC's update the dlg! addDockWidget(Qt::RightDockWidgetArea, BCDockWidget); }
Dlg_BCs::Dlg_BCs(QVX_Environment* pEnvIn, QWidget *parent) : QWidget(parent) { CurRegion = NULL; CurBcIndex = -1; pEnv = pEnvIn; ui.setupUi(this); SetupPrimTab(); ui.BCPresetsCombo->addItem("None"); //should be in same order as BCPresetType enum ui.BCPresetsCombo->addItem("X Cantilever"); //should be in same order as BCPresetType enum ui.BCPresetsCombo->addItem("Y Cantilever"); ui.BCPresetsCombo->addItem("X Axial"); ui.BCPresetsCombo->addItem("Y Axial"); ui.BCPresetsCombo->addItem("Z Axial"); ui.BCPresetsCombo->addItem("X Symmetry"); ui.BCPresetsCombo->addItem("Y Symmetry"); ui.BCPresetsCombo->addItem("Z Symmetry"); const QValidator* DEval = new QDoubleValidator(this); ui.XForceEdit->setValidator(DEval); ui.YForceEdit->setValidator(DEval); ui.ZForceEdit->setValidator(DEval); ui.XDispEdit->setValidator(DEval); ui.YDispEdit->setValidator(DEval); ui.ZDispEdit->setValidator(DEval); ui.TXTorqueEdit->setValidator(DEval); ui.TYTorqueEdit->setValidator(DEval); ui.TZTorqueEdit->setValidator(DEval); ui.TXDispEdit->setValidator(DEval); ui.TYDispEdit->setValidator(DEval); ui.TZDispEdit->setValidator(DEval); ApplyPreset(BC_XCANT); connect(ui.BCPresetsCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(ApplyPreset(int))); //connect(ui.BCList, SIGNAL(currentRowChanged (int)), this, SLOT(BCrowChanged(int))); //itemClicked ? connect(ui.BCList, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(BCRowClicked())); //itemClicked ? //add or delete boundary conditions connect(ui.AddBCButton, SIGNAL(clicked(bool)), this, SLOT(AddBC())); connect(ui.DelBCButton, SIGNAL(clicked(bool)), this, SLOT(DelCurBC())); //Load or Save Boundary Conditions connect(ui.LoadBCButton, SIGNAL(clicked()), this, SLOT(LoadBCs())); connect(ui.SaveBCButton, SIGNAL(clicked()), this, SLOT(SaveBCs())); connect(ui.FixAllButton, SIGNAL(clicked()), this, SLOT(ClickedFixAll())); connect(ui.FixNoneButton, SIGNAL(clicked()), this, SLOT(ClickedFixNone())); //Translation connect(ui.XFixed, SIGNAL(clicked(bool)), this, SLOT(ChangedXFixed(bool))); connect(ui.YFixed, SIGNAL(clicked(bool)), this, SLOT(ChangedYFixed(bool))); connect(ui.ZFixed, SIGNAL(clicked(bool)), this, SLOT(ChangedZFixed(bool))); connect(ui.XForceEdit, SIGNAL(editingFinished()), this, SLOT(EditedXForce())); connect(ui.YForceEdit, SIGNAL(editingFinished()), this, SLOT(EditedYForce())); connect(ui.ZForceEdit, SIGNAL(editingFinished()), this, SLOT(EditedZForce())); connect(ui.XDispEdit, SIGNAL(editingFinished()), this, SLOT(EditedXDisp())); connect(ui.YDispEdit, SIGNAL(editingFinished()), this, SLOT(EditedYDisp())); connect(ui.ZDispEdit, SIGNAL(editingFinished()), this, SLOT(EditedZDisp())); //Rotation connect(ui.TXFixed, SIGNAL(clicked(bool)), this, SLOT(ChangedTXFixed(bool))); connect(ui.TYFixed, SIGNAL(clicked(bool)), this, SLOT(ChangedTYFixed(bool))); connect(ui.TZFixed, SIGNAL(clicked(bool)), this, SLOT(ChangedTZFixed(bool))); connect(ui.TXTorqueEdit, SIGNAL(editingFinished()), this, SLOT(EditedTXTorque())); connect(ui.TYTorqueEdit, SIGNAL(editingFinished()), this, SLOT(EditedTYTorque())); connect(ui.TZTorqueEdit, SIGNAL(editingFinished()), this, SLOT(EditedTZTorque())); connect(ui.TXDispEdit, SIGNAL(editingFinished()), this, SLOT(EditedTXDisp())); connect(ui.TXDispEdit, SIGNAL(textChanged(QString)), this, SLOT(ChangedTDisp(QString))); connect(ui.TYDispEdit, SIGNAL(editingFinished()), this, SLOT(EditedTYDisp())); connect(ui.TYDispEdit, SIGNAL(textChanged(QString)), this, SLOT(ChangedTDisp(QString))); connect(ui.TZDispEdit, SIGNAL(editingFinished()), this, SLOT(EditedTZDisp())); connect(ui.TZDispEdit, SIGNAL(textChanged(QString)), this, SLOT(ChangedTDisp(QString))); connect(ui.BCDonePushButton, SIGNAL(clicked()), this, SIGNAL(DoneEditing())); }
Dlg_Palette::Dlg_Palette(QVX_Object* pObjIn, QWidget *parent) : QWidget(parent) { pObj = pObjIn; ui.setupUi(this); Palette_Model = new CPalModel(pObj, this); // Palette_Model.pObj = pObj; //connect our model to our object ui.MaterialList->setModel(Palette_Model); selectionModel = ui.MaterialList->selectionModel(); SetCurMat(0); const QValidator* DEval = new QDoubleValidator(this); ui.StiffEdit->setValidator(DEval); ui.PoissoEdit->setValidator(DEval); ui.DensityEdit->setValidator(DEval); //Change selection connect(selectionModel, SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)), this, SLOT(UpdateFields())); //add/delete materials connect(ui.AddMatButton, SIGNAL(clicked(bool)), this, SLOT(AddMaterial())); connect(ui.DelMatButton, SIGNAL(clicked(bool)), this, SLOT(DeleteCurMaterial())); //Load or Save Palettes connect(ui.LoadPalButton, SIGNAL(clicked()), this, SLOT(LoadPalette())); connect(ui.SavePalButton, SIGNAL(clicked()), this, SLOT(SavePalette())); //Visible connect(ui.VisibleCheck, SIGNAL(clicked(bool)), this, SLOT(ChangedVisible(bool))); //Material mode Radios connect(ui.MTBasicRadio, SIGNAL(toggled(bool)), this, SLOT(ChangedBasic(bool))); connect(ui.MTDitherRadio, SIGNAL(toggled(bool)), this, SLOT(ChangedDither(bool))); connect(ui.MTStructureRadio, SIGNAL(toggled(bool)), this, SLOT(ChangedStructure(bool))); //color sliders connect(ui.RedSlider, SIGNAL(valueChanged(int)), this, SLOT(ChangedR(int))); connect(ui.GreenSlider, SIGNAL(valueChanged(int)), this, SLOT(ChangedG(int))); connect(ui.BlueSlider, SIGNAL(valueChanged(int)), this, SLOT(ChangedB(int))); connect(ui.AlphaSlider, SIGNAL(valueChanged(int)), this, SLOT(ChangedA(int))); //physical properties connect(ui.StiffEdit, SIGNAL(textChanged(QString)), this, SLOT(ChangedStiffness(QString))); connect(ui.PoissoEdit, SIGNAL(textChanged(QString)), this, SLOT(ChangedPoisson(QString))); connect(ui.DensityEdit, SIGNAL(textChanged(QString)), this, SLOT(ChangedDens(QString))); connect(ui.CTEEdit, SIGNAL(textChanged(QString)), this, SLOT(ChangedCTE(QString))); connect(ui.UsEdit, SIGNAL(textChanged(QString)), this, SLOT(ChangeduStatic(QString))); connect(ui.UdEdit, SIGNAL(textChanged(QString)), this, SLOT(ChangeduDynamic(QString))); //Dither connect(ui.Mat1SelCombo, SIGNAL(activated(int)), this, SLOT(Mat1IndexChanged(int))); connect(ui.Mat2SelCombo, SIGNAL(activated(int)), this, SLOT(Mat2IndexChanged(int))); connect(ui.MatPercSlider, SIGNAL(valueChanged(int)), this, SLOT(ChangedPercRand(int))); //Structure connect(ui.ImportButton, SIGNAL(clicked()), this, SLOT(ClickedImport())); connect(ui.ExportButton, SIGNAL(clicked()), this, SLOT(ClickedExport())); connect(ui.XDimSpin, SIGNAL(valueChanged(int)), this, SLOT(ChangedXDim(int))); connect(ui.YDimSpin, SIGNAL(valueChanged(int)), this, SLOT(ChangedYDim(int))); connect(ui.ZDimSpin, SIGNAL(valueChanged(int)), this, SLOT(ChangedZDim(int))); connect(ui.XOffSpin, SIGNAL(valueChanged(int)), this, SLOT(ChangedXOff(int))); connect(ui.YOffSpin, SIGNAL(valueChanged(int)), this, SLOT(ChangedYOff(int))); connect(ui.ZOffSpin, SIGNAL(valueChanged(int)), this, SLOT(ChangedZOff(int))); connect(ui.EditStructureButton, SIGNAL(clicked()), this, SLOT(ClickedEditStructure())); //set up editor window!! TmpEditDlg = new Dlg_StructureEditor(&TmpEdit, NULL); //shouldn't ever casue me leaks... TmpEditDlg->setWindowTitle("Structure Editor"); TmpEditDlg->setWindowModality(Qt::ApplicationModal); connect(TmpEditDlg, SIGNAL(DoneEditing()), this, SLOT(DoneEditStructure())); // UpdateMaterialWindow(QItemSelection()); }