void WireBoxCornerShrinkGrow::createWireBoxCorner(const quint8 rotate, const quint8 flip) { quint8 xyz = 0; for (quint16 j = 0; j < m_iterations; j++) { for (quint8 i = 0; i < CUBE_SIZE * 2; i++) { xyz = CUBE_SIZE - 1 - i; if (i > CUBE_SIZE - 1) xyz = i - CUBE_SIZE; fillCubeArray(0x00); boxWireframe(0, 0, 0, xyz, xyz, xyz); if (flip > 0) mirrorZ(); if (rotate == 1 || rotate == 3) mirrorY(); if (rotate == 2 || rotate == 3) mirrorX(); if(m_abort) return; waitMs(speed()); } } }
AViz::AViz() : QMainWindow() { // Make menus in menubar QMenu *file = menuBar()->addMenu("&File"); QMenu *elements = menuBar()->addMenu( "&Elements"); QMenu *view = menuBar()->addMenu( "&View"); QMenu *settings = menuBar()->addMenu( "&Settings"); QMenu *data = menuBar()->addMenu("&Data"); menuBar()->addSeparator(); QMenu *help = menuBar()->addMenu("&Help"); // Make a cascade menu to read files QMenu *openfile = file->addMenu("&Open"); openfile->addAction("Open XYZ File...", this, SLOT(openXYZ())); openfile->addAction("Open File List...", this, SLOT(openList())); openfile->addAction("Open ViewParam File...", this, SLOT(openViewParam())); file->addAction( "Save ViewParam File...", this, SLOT(saveViewParam()) ); file->addSeparator(); file->addAction( "File List...", this, SLOT(launchFileList()) ); file->addAction( "Animation...", this, SLOT(launchAnimation()) ); file->addSeparator(); m_inOutWatchModelAction = file->addAction( "Watch XYZ File", this, SLOT(watchFile()) ); file->addSeparator(); file->addAction( "Snap PNG File...", this, SLOT(savePNGFile()) ); file->addSeparator(); file->addAction( "Set Default View Param", this, SLOT(setDefaultView())); file->addSeparator(); file->addAction( "E&xit", qApp, SLOT(quit()), Qt::CTRL+Qt::Key_Q ); // Make a general view menu QMenu *viewpoint = view->addMenu("Set &Viewpoint"); view->addAction( "Clipping...", this, SLOT(launchClip()) ); view->addAction( "Slicing...", this, SLOT(launchSlice()) ); // Make a cascade menu to set standard view points viewpoint->addAction( "Explicit...", this, SLOT(launchExplicit()) ); viewpoint->addSeparator(); viewpoint->addAction( "Default View", this, SLOT(setDefaults()) ); viewpoint->addSeparator(); viewpoint->addAction( "View XY +", this, SLOT(viewXYPlus()) ); viewpoint->addAction( "View XY -", this, SLOT(viewXYMinus()) ); viewpoint->addSeparator(); viewpoint->addAction( "View XZ +", this, SLOT(viewXZPlus()) ); viewpoint->addAction( "View XZ -", this, SLOT(viewXZMinus()) ); viewpoint->addSeparator(); viewpoint->addAction( "View YZ +", this, SLOT(viewYZPlus()) ); viewpoint->addAction( "View YZ -", this, SLOT(viewYZMinus()) ); // Fill a general elements menu m_atomsMenu = elements->addMenu("Atoms..."); // Make a submenu for atom specifications m_atomsMenu->addAction( "Atoms/Molecules...", this, SLOT(launchAtoms()) ); m_atomsMenu->addAction( "Bonds...", this, SLOT(launchBonds()) ); m_spinsAction = elements->addAction( "Spins...", this, SLOT(launchSpins()) ); m_liquidCrystalsAction = elements->addAction( "Liquid Crystals...", this, SLOT(launchLiquidCrystals()) ); m_polymersMenu = elements->addMenu( "Polymers..."); m_poresAction = elements->addAction( "Pores ...", this, SLOT(launchPores()) ); elements->addAction( "Lights...", this, SLOT(launchLights()) ); elements->addAction( "Annotation...", this, SLOT(launchAnnotation()) ); // fill submenu for polymer specifications m_polymersMenu->addAction( "Polymers...", this, SLOT(launchPolymers()) ); m_polymersMenu->addAction( "Bonds...", this, SLOT(launchBonds()) ); // fill a general settings menu m_showHideAxesAction = settings->addAction( "Hide Axes", this, SLOT(showHideAxesCB()) ); m_showHideContourAction = settings->addAction( "Hide Contour", this, SLOT(showHideContourCB()) ); m_onlyContourAction = settings->addAction( "Only Contour", this, SLOT(onlyContourCB()) ); // fill a general data menu data->addAction( "&Translate...", this, SLOT(launchTranslation()) ); data->addSeparator(); data->addAction( "Swap XY", this, SLOT(swapXY()) ); data->addAction( "Swap XZ", this, SLOT(swapXZ()) ); data->addAction( "Swap YZ", this, SLOT(swapYZ()) ); data->addSeparator(); data->addAction( "Mirror X", this, SLOT(mirrorX()) ); data->addAction( "Mirror Y", this, SLOT(mirrorY()) ); data->addAction( "Mirror Z", this, SLOT(mirrorZ()) ); data->addSeparator(); data->addAction( "Stretch XYZ...", this, SLOT(launchStretch()) ); // fill a general help menu help->addAction( "&About", this, SLOT(about()), Qt::CTRL+Qt::Key_H ); help->addAction( "License", this, SLOT(license()) ); help->addAction( "Distribution", this, SLOT(distribute()) ); // Now construct the main form // (Note having aviz as paramter for MainForm ctor // is "This is an ugly hack, intended to propagate the // address of the calling class") m_mainForm = new MainForm(this/*parent*/, this /*aviz*/); setCentralWidget(m_mainForm); // Construct a timer m_watchTimer = new QTimer(this); // Set initial settings setAtomMenus(); }