Beispiel #1
0
	//----------
	shared_ptr<Panels::Base> Builder::addBlank(string caption) {
		auto newPanel = this->makeBlank();
		newPanel->setCaption(caption);
		auto panel = PanelPtr(newPanel);
		this->controller.add(panel);
		return newPanel;
	}
Beispiel #2
0
		//---------
		PanelPtr const SharedViewClient::findScreen(const ofVec2f & xy, ofRectangle & currentPanelBounds) {
			if (this->view) {
				return this->view->findScreen(xy, currentPanelBounds);
			} else {
				return PanelPtr();
			}
		}
Beispiel #3
0
	//----------
	void Controller::init(shared_ptr<Panels::Groups::Base> rootGroup) {
		ofBackground(30);

		ofAddListener(ofEvents().update, this, &Controller::update);
		ofAddListener(ofEvents().draw, this, &Controller::draw);
		ofAddListener(ofEvents().mouseMoved, this, &Controller::mouseMoved);
		ofAddListener(ofEvents().mousePressed, this, &Controller::mousePressed);
		ofAddListener(ofEvents().mouseReleased, this, &Controller::mouseReleased);
		ofAddListener(ofEvents().mouseDragged, this, &Controller::mouseDragged);
		ofAddListener(ofEvents().keyPressed, this, &Controller::keyPressed);	
		ofAddListener(ofEvents().fileDragEvent, this, &Controller::filesDragged);
		ofAddListener(ofEvents().windowResized, this, &Controller::windowResized);

		ofxAssets::Register::X().addAddon("ofxCvGui");
		
		rootGroup->setBounds(ofGetCurrentViewport());
		this->rootGroup = rootGroup;
		this->currentPanel = PanelPtr();
		this->currentPanelBounds = ofGetCurrentViewport();

		//cache fonts
		ofxAssets::font("ofxCvGui::swisop3", 12);
		ofxAssets::font("ofxCvGui::swisop3", 14);
		ofxAssets::font("ofxCvGui::swisop3", 18);
		ofxAssets::font("ofxCvGui::swisop3", 24);

		this->initialised = true;
	}
//-----------
void CameraHead::setProjectorID(int projector) {
	if (!this->initialised)
		return;

	if (this->projector != projector)
		this->save();

	this->decoder.reset();
	this->decoder.init(*payload);
	this->projector = projector;

	if ( this->panelPinC != PanelPtr() )
		panelPinC->setCaption( "P " + ofToString(this->projector) + " in C " + ofToString( this->getCameraID() ) );
	if ( this->panelCinP != PanelPtr() )
		panelCinP->setCaption( "C " + ofToString(this->getCameraID()) + " in P " + ofToString( this->projector ) );
}
Beispiel #5
0
		//---------
		PanelPtr const SharedViewServer::findScreen(const ofVec2f & xy, ofRectangle & currentPanelBounds) {
			auto client = this->focus.lock();
			if (client) {
				return client->getHostedView()->findScreen(xy, currentPanelBounds);
			}
			else {
				return PanelPtr();
			}
		}
Beispiel #6
0
	//----------
	void Controller::filesDragged(ofDragInfo & args) {
		if (!initialised)
			return;
		auto rootBounds = this->rootGroup->getBounds();
		auto panel = this->findPanelUnderCursor(rootBounds);
		if (panel != PanelPtr()) {
			auto panelBounds = panel->getBounds();
			ofVec2f panelTopLeft = panelBounds.getTopLeft();
			auto newArgs = FilesDraggedArguments((ofVec2f) args.position - panelTopLeft, (ofVec2f) args.position, args.files);
			panel->onFilesDragged(newArgs);
		}
	}
Beispiel #7
0
void GfxGLWindowGLUI::Imp::addPanel( GLUI_Panel* panel, PanelID id ) {
    DGFX_ASSERT( panel != 0 && id != GfxGLWindowGLUI::PANEL_NONE );
    DGFX_ASSERT( _panelMap.find( id ) == _panelMap.end() );
    _panelMap[ id ] = PanelPtr( panel );
}
Beispiel #8
0
	//----------
	shared_ptr<Panels::Groups::Grid> Builder::addGrid() {
		auto newPanel = this->makeGrid();
		auto panel = PanelPtr(newPanel);
		this->controller.add(panel);
		return newPanel;
	}
Beispiel #9
0
	//----------
	shared_ptr<Panels::Inspector> Builder::addInspector() {
		auto newPanel = this->makeInspector();
		auto panel = PanelPtr(newPanel);
		this->controller.add(panel);
		return newPanel;
	}
Beispiel #10
0
	//----------
	shared_ptr<Panels::Scroll> Builder::addScroll(string caption) {
		auto newPanel = this->makeScroll(caption);
		auto panel = PanelPtr(newPanel);
		this->controller.add(panel);
		return newPanel;
	}
Beispiel #11
0
	//----------
	shared_ptr<Panels::World> Builder::addWorld(string caption) {
		auto newPanel = this->makeWorld(caption);
		auto panel = PanelPtr(newPanel);
		this->controller.add(panel);
		return newPanel;
	}