//-------------------------------------------------------------- void ofApp::setup() { ofSetEscapeQuitsApp(false); play.addListener(this, &ofApp::playPressed); learnPlay.addListener(this, &ofApp::playPressed); conductModeButton.addListener(this, &ofApp::conductModeSelected); learnModeButton.addListener(this, &ofApp::learnModeSelected); back.addListener(this, &ofApp::backPressed); learnBack.addListener(this, &ofApp::backPressed); // Main screen gui guiModeSelection.setup("", "settings.xml", screenWidth/2, screenHeight/2); //guiModeSelection.add(conductModeButton.setup("conduct", 50.0F, 50.0F)); //guiModeSelection.add(learnModeButton.setup("learn", 50.0F, 50.0F)); conductModeButton.setup("Conduct", 30.0F, 30.0F); conductModeButton.setPosition(ofPoint(screenWidth/2-15, screenHeight/2-15)); learnModeButton.setup("Learn", 30.0F, 30.0F); learnModeButton.setPosition(ofPoint(screenWidth / 2 - 15, screenHeight / 2 + 15)); // Conduct mode gui //gui.setup(); gui.setup("", "settings.xml", 50.0F, 50.0F); gui.add(play.setup("play")); gui.add(volume.setup("volume", 1.0, 0.0, 1.0)); gui.add(speed.setup("tempo", 1.0, 0.5, 2.0)); gui.add(background.setup("background", 0, 0, 8)); gui.add(instruments.setup("instruments", -1, -1, 11)); gui.add(back.setup("back")); // Learn mode gui learnGui.setup("", "settings.xml", 50.0F, 500.0F); learnGui.add(learnPlay.setup("play")); learnGui.add(learnVolume.setup("volume", 1.0, 0.0, 1.0)); learnGui.add(learnSpeed.setup("tempo", 1.0, 0.5, 2.0)); learnGui.add(learnBackground.setup("background", 0, 0, 8)); learnGui.add(learnPattern.setup("pattern", 1, 1, 3)); learnGui.add(learnBack.setup("back")); finalVideo = new unsigned char[1440 * 1080 * 3]; finalTexture.allocate(1440, 1080, GL_RGB); readInputFiles(); for (int i = 0; i < 12; i++) { showInstrumentsVect.push_back(1); } }
int main(int argc, char** argv) { if (argc == 1) { cerr << "Usage: <program> <SDF-file-list>" << endl; return 1; } std::vector<Linker> linkers; std::vector<Rigid> rigids; readInputFiles(argc, argv, linkers, rigids); cerr << "1" << endl; Instantiator instantiator(cout); cerr << "2" << endl; HyperGraph<Molecule, EdgeAnnotationT> graph = instantiator.Instantiate(linkers, rigids); cerr << "3" << endl; PebblerHyperGraph<Molecule, EdgeAnnotationT> pebblerGraph = graph.GetPebblerHyperGraph(); cerr << "4" << endl; if (DEBUG) cout << graph; cerr << "5" << endl; Cleanup(linkers, rigids); cerr << "6" << endl; return 0; }
int main(int argc, char** argv) { if (argc < 2) { std::cerr << "Usage: <program> [SDF-file-list] -o <output-file> -v <validation-file>" << " -pool <#obgen-threads>" << std::endl; return 1; } // // Remove log files from a previous run. // std::string rmString = "rm synth_log*"; system(rmString.c_str()); // // Global options object. // Options options(argc, argv); if (!options.parseCommandLine()) { std::cerr << "Command-line parsing failed; exiting." << std::endl; return 1; } // // Output command-line option information // if (!Options::THREADED) { std::cout << "\'-threaded\' not specified, but will be used." << std::endl; } // Printing the specified Tanimoto value to the user. std::cerr << "Tanimoto Coefficient Threshold Specified: " << Options::TANIMOTO << std::endl; std::cerr << "OBGEN output thread pool size: " << Options::OBGEN_THREAD_POOL_SIZE << std::endl; if (!readInputFiles(options)) return 1; // // Bypass synthesis for acquiring information about the input fragments. // if (g_calculate_lipinski_descriptors_for_input_fragments_only) { std::cout << "Calculated Lipinski Descriptors for input fragments, now exiting early." << " (Flag set in Constants.h)" << std:: endl; return 0; } // Output object for the nodes of the hypergraph. OBWriter* writer = new OBWriter(Options::OBGEN_THREAD_POOL_SIZE); writer->InitializeFile(options.outFile); // The main object that performs synthesis. Instantiator instantiator(writer, cout); // Instantiation build the hypergraph; this is the main data structure for the // resultant molecules. // Also creates the hypergraph using threaded or non-threaded techniques. HyperGraph<Molecule, EdgeAnnotationT>* graph = instantiator.ThreadedInstantiate(linkers, rigids); std::cout << "Hypergraph contains (" << graph->size() << ") nodes" << std::endl; std::cout << OBWriter::compliantMols.size() << " are Lipinski compliant molecules" << std::endl; // // Validate the molecules specified in the validation file (command-line -v) // Validator validator(OBWriter::compliantMols); validator.Validate(options.validationFile); // Deleting the writer will kill the thread pool. delete writer; // For later: pebbling //PebblerHyperGraph<Molecule, EdgeAnnotationT> pebblerGraph = graph->GetPebblerHyperGraph(); Cleanup(linkers, rigids); std::cerr << "Exiting the main thread." << std::endl; return 0; }