int main(int argc, char** argv) { QApplication application(argc,argv); // Instantiate the two viewers. StandardCamera* sc = new StandardCamera(); Viewer viewer(sc); CameraViewer cviewer(sc); // Make sure every v camera movement updates the camera viewer QObject::connect(viewer.camera()->frame(), SIGNAL(manipulated()), &cviewer, SLOT(updateGL())); QObject::connect(viewer.camera()->frame(), SIGNAL(spun()), &cviewer, SLOT(updateGL())); // Also update on camera change (type or mode) QObject::connect(&viewer, SIGNAL(cameraChanged()), &cviewer, SLOT(updateGL())); #if QT_VERSION < 0x040000 application.setMainWidget(&viewer); #else viewer.setWindowTitle("standardCamera"); cviewer.setWindowTitle("Camera viewer"); #endif cviewer.show(); viewer.show(); return application.exec(); }
BoundingBox::BoundingBox() { boxColor = Vec(0.9f, 0.9f, 0.9f); defaultColor = Vec(0.9f, 0.9f, 0.7f); selectColor = Vec(1.0f, 0.3f, 0.1f); setBounds(Vec(0,0,0), Vec(1,1,1)); for(int i=0; i<6; i++) { m_bounds[i].setThreshold(20); // set grabsMouse radius to 20 m_bounds[i].setOnlyTranslate(true); // only translations allowed } connect(&m_bounds[0], SIGNAL(manipulated()), this, SLOT(update())); connect(&m_bounds[1], SIGNAL(manipulated()), this, SLOT(update())); connect(&m_bounds[2], SIGNAL(manipulated()), this, SLOT(update())); connect(&m_bounds[3], SIGNAL(manipulated()), this, SLOT(update())); connect(&m_bounds[4], SIGNAL(manipulated()), this, SLOT(update())); connect(&m_bounds[5], SIGNAL(manipulated()), this, SLOT(update())); }