Exemplo n.º 1
0
KinectPlayerFactory::KinectPlayerFactory(Vrui::VisletManager& visletManager)
	:Vrui::VisletFactory("KinectPlayer",visletManager)
	{
	#if 0
	/* Insert class into class hierarchy: */
	Vrui::VisletFactory* visletFactory=visletManager.loadClass("Vislet");
	visletFactory->addChildClass(this);
	addParentClass(visletFactory);
	#endif
	
	/* Load class settings: */
	Misc::ConfigurationFileSection cfs=visletManager.getVisletClassSection(getClassName());
	std::string defaultSaveFileNamePrefix=cfs.retrieveString("./saveFileNamePrefix",".");
	
	std::vector<std::string> kinectDevices=cfs.retrieveValue<std::vector<std::string> >("./kinectDevices",std::vector<std::string>());
	for(std::vector<std::string>::iterator kdIt=kinectDevices.begin();kdIt!=kinectDevices.end();++kdIt)
		{
		/* Go to the Kinect device's configuration file section: */
		Misc::ConfigurationFileSection kds=cfs.getSection(kdIt->c_str());
		
		KinectConfig config;
		
		/* Read the recorded camera's serial number: */
		config.deviceSerialNumber=kds.retrieveString("./serialNumber");
		
		/* Read the save file name prefix: */
		config.saveFileNamePrefix=kds.retrieveString("./saveFileNamePrefix",defaultSaveFileNamePrefix);
		
		/* Store the configuration structure: */
		kinectConfigs.push_back(config);
		}
	
	std::vector<std::string> soundDevices=cfs.retrieveValue<std::vector<std::string> >("./soundDevices",std::vector<std::string>());
	for(std::vector<std::string>::iterator sdIt=soundDevices.begin();sdIt!=soundDevices.end();++sdIt)
		{
		/* Go to the sound device's configuration file section: */
		Misc::ConfigurationFileSection sds=cfs.getSection(sdIt->c_str());
		
		SoundConfig config;
		
		/* Read node index: */
		config.nodeIndex=sds.retrieveValue<int>("./nodeIndex",0);
		
		/* Read the sound file name: */
		config.soundFileName=sds.retrieveString("./soundFileName");
		
		/* Store the configuration structure: */
		soundConfigs.push_back(config);
		}
	
	/* Set tool class' factory pointer: */
	KinectPlayer::factory=this;
	}
Exemplo n.º 2
0
KinectViewerFactory::KinectViewerFactory(Vrui::VisletManager& visletManager)
	:Vrui::VisletFactory("KinectViewer",visletManager)
	{
	#if 0
	/* Insert class into class hierarchy: */
	Vrui::VisletFactory* visletFactory=visletManager.loadClass("Vislet");
	visletFactory->addChildClass(this);
	addParentClass(visletFactory);
	#endif
	
	/* Set tool class' factory pointer: */
	KinectViewer::factory=this;
	}