Commit d08c4eaf authored by artificiel's avatar artificiel
Browse files

CloudServerApp: refactor des callbacks will()/did()

parent d0e6199c
......@@ -42,18 +42,19 @@ class ofCloudServerApp : public ofBaseApp
cloudserver_parameters_.add(draw_clusters_.set("<s> draw segmentation", false));
cloudserver_parameters_.add(euclidian_extractor_.parameters);
setup_after_merger();
// setup_after_merger();
gui_.add(cloudserver_parameters_);
load_gui_params_from_file(0);
cloudserver_did_setup();
}
void update()
{
cloudserver_will_update();
// merge elements are channel threaded
if (merger_.update()) {
// std::cout << "new stuff in merger" << std::endl;
voxel_filter_.perform(mesh_converter_.perform(merger_.get_mesh()), voxel_resolution_);
euclidian_extractor_.send(voxel_filter_.get());
}
......@@ -61,7 +62,8 @@ class ofCloudServerApp : public ofBaseApp
if (euclidian_extractor_.receive()) {
cluster_tracker_.track(euclidian_extractor_.get_clouds());
}
update_after_merger();
cloudserver_did_update();
}
void draw()
......@@ -80,7 +82,6 @@ class ofCloudServerApp : public ofBaseApp
glPointSize(1);
ofPushMatrix();
merger_.draw_models();
ofPopMatrix();
......@@ -89,15 +90,10 @@ class ofCloudServerApp : public ofBaseApp
ofPushMatrix();
ofScale(100, 100, 100); // somehow seems reasonable
merger_.draw();
if (draw_clusters_) {
euclidian_extractor_.draw();
}
if (draw_clusters_) euclidian_extractor_.draw();
ofPopMatrix();
draw_in_camera_after_cloud();
ofDisableDepthTest();
}
cam_.end();
......@@ -106,7 +102,7 @@ class ofCloudServerApp : public ofBaseApp
}
ofPopStyle();
final_fbo_.draw(0, 0, 1920, 1080);
draw_after_fbo();
ofSetColor(255, 255, 255, 255);
......@@ -178,10 +174,15 @@ class ofCloudServerApp : public ofBaseApp
ofxCloudLib::ClusterTracker cluster_tracker_;
ofxCloudLib::MeshToCloudConverter mesh_converter_;
virtual void cloudserver_will_draw(){};
virtual void cloudserver_will_setup(){};
virtual void setup_after_merger(){};
virtual void cloudserver_did_setup(){};
virtual void cloudserver_will_update(){};
virtual void cloudserver_did_update(){};
virtual void cloudserver_will_draw(){};
virtual void update_after_merger(){};
virtual void draw_in_camera_before_cloud(){};
virtual void draw_in_camera_after_cloud(){};
virtual void draw_after_fbo(){};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment