Commit 40752d65 authored by artificiel's avatar artificiel
Browse files

ClientsManager: format et ajout d'un compteur de rejets

parent 672dbeb9
......@@ -21,10 +21,10 @@ ClientsManager::ClientsManager()
sticky_mesh_parameters_.add(sticky_mesh_dither_amnt_.set("Dither amnt", 0, 0, .1));
sticky_mesh_parameters_.add(sticky_mesh_color_.set("Color", ofColor::yellow, ofColor::black, ofColor::white));
parameters_.add(sticky_mesh_parameters_);
parameters_.add(crop_left_.set("crop_left", 0,-10,10));
parameters_.add(crop_right_.set("crop_right", 0,-10,10));
parameters_.add(crop_top_.set("crop_top", 0,-10,10));
parameters_.add(crop_bottom_.set("crop_bottom", 0,-10,10));
parameters_.add(crop_left_.set("crop_left", 0, -10, 10));
parameters_.add(crop_right_.set("crop_right", 0, -10, 10));
parameters_.add(crop_top_.set("crop_top", 0, -10, 10));
parameters_.add(crop_bottom_.set("crop_bottom", 0, -10, 10));
sticky_mesh_.setMode(OF_PRIMITIVE_POINTS);
parameters_.setName("ClientsManager");
......@@ -32,9 +32,6 @@ ClientsManager::ClientsManager()
gui_.setup();
gui_.setName("client editors visibiliy");
gui_.setPosition(10, ofGetHeight() - gui_.getHeight());
// add_player("player 1");
// add_player("player 2");
}
void ClientsManager::add_player(std::string player_name)
......@@ -119,8 +116,9 @@ bool ClientsManager::receive_mesh(ofMesh &mesh)
if (client.second->enabled_) {
ofLogNotice("ClientManager") << "merging " << client.second->client_name_ << " with " << client.second->get_mesh().getNumVertices();
// ofLogNotice("ClientManager") << "merging client " << client.second->client_name_ << " with " << client.second->get_mesh().getNumVertices() << " vertices";
int reject = 0;
for (const auto &v : client.second->get_mesh().getVertices()) {
if (v.x > crop_left_ && v.x < crop_right_) {
......@@ -129,8 +127,11 @@ bool ClientsManager::receive_mesh(ofMesh &mesh)
tmp_mesh.addVertex(v);
tmp_mesh.addColor(sticky_mesh_color_);
}
} else {
reject++;
}
}
ofLogNotice("ClientManager") << "rejected " << reject << "/" << client.second->get_mesh().getNumVertices() << " vertices (out-of-crop)";
}
}
......@@ -157,6 +158,7 @@ bool ClientsManager::receive_mesh(ofMesh &mesh)
sticky_mesh_.addColor(color);
}
}
// ofLogNotice("ClientManager") << "build mesh with " << mesh.getNumVertices() << " vertices.";
}
return is_new;
......
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