Esempio n. 1
0
			//----------
			void KinectV2::populateInspector(ofxCvGui::ElementGroupPtr inspector) {
				auto selectPlayState = make_shared<ofxCvGui::Widgets::MultipleChoice>("Play state");
				selectPlayState->addOption("Play");
				selectPlayState->addOption("Pause");
				selectPlayState->entangle(this->playState);
				inspector->add(selectPlayState);

				auto selectViewType = make_shared<ofxCvGui::Widgets::MultipleChoice>("3D View");
				selectViewType->addOption("Frustums");
				selectViewType->addOption("Bodies");
				selectViewType->addOption("All");
				selectViewType->entangle(this->viewType);
				inspector->add(selectViewType);
			}
Esempio n. 2
0
			//----------
			void Model::populateInspector(ofxCvGui::ElementGroupPtr inspector) {
				auto loadButton = make_shared<ofxCvGui::Widgets::Button>("Load model...", [this]() {
					auto result = ofSystemLoadDialog("Load model using Assimp");
					if (result.bSuccess) {
						this->modelLoader->loadModel(result.filePath);
						this->filename.set(result.filePath);
					}
				});
				inspector->add(loadButton);

				inspector->add(make_shared<LiveValue<string>>("Filename", [this]() {
					return this->filename.get();
				}));
				auto clearModelButton = make_shared <ofxCvGui::Widgets::Button>("Clear model", [this]() {
					this->modelLoader->clear();
					this->filename.set("");
				});
				//we put the listener on the loadButton since we'll be disabling clearModelButton
				//also it stops there being a circular reference where loadButton owns a listener stack which owns a lambda which owns loadButton
				loadButton->onUpdate += [this, clearModelButton](ofxCvGui::UpdateArguments &) {
					clearModelButton->setEnabled(!this->filename.get().empty());
				};
				inspector->add(clearModelButton);

				inspector->add(make_shared<Title>("Draw options", Title::Level::H3));
				inspector->add(make_shared<Toggle>(this->drawVertices));
				inspector->add(make_shared<Toggle>(this->drawWireframe));
				inspector->add(make_shared<Toggle>(this->drawFaces));

				inspector->add(make_shared<Title>("Model transform", Title::Level::H3));
				inspector->add(make_shared<Toggle>(this->flipX));
				inspector->add(make_shared<Toggle>(this->flipY));
				inspector->add(make_shared<Toggle>(this->flipZ));
				inspector->add(make_shared<Slider>(this->inputUnitScale));
			}