// ---------------------------------------------------------------------- void DrawablePLTTEdge::draw( cairo_t* cr, double t, const Context& C ) const throw(std::runtime_error) { Drawable::draw(cr,t,C); shawn::Vec pos1 = src_drawable_->position(t); shawn::Vec pos2 = tgt_drawable_->position(t); double lw = edge_properties().line_width(t); shawn::Vec col = edge_properties().color(t); double blend = edge_properties().blend(t); cairo_save(cr); cairo_set_line_width( cr, this->Width ); cairo_set_source_rgba(cr,R,G,B,1.0-blend); cairo_move_to(cr,pos1.x(),pos1.y()); cairo_line_to(cr,pos2.x(),pos2.y()); cairo_stroke(cr); cairo_restore(cr); }
void Surface_mesh:: property_stats() const { // qWarning() << "TODO: Surface_mesh::property_stats() broken under new compiler"; #if 0 std::vector<std::string> props; std::cout << "vertex properties:\n"; props = vertex_properties(); for (unsigned int i=0; i<props.size(); ++i) std::cout << "\t" << props[i] << std::endl; std::cout << "halfedge properties:\n"; props = halfedge_properties(); for (unsigned int i=0; i<props.size(); ++i) std::cout << "\t" << props[i] << std::endl; std::cout << "edge properties:\n"; props = edge_properties(); for (unsigned int i=0; i<props.size(); ++i) std::cout << "\t" << props[i] << std::endl; std::cout << "face properties:\n"; props = face_properties(); for (unsigned int i=0; i<props.size(); ++i) std::cout << "\t" << props[i] << std::endl; #endif }
// ---------------------------------------------------------------------- void DrawableEdgeDynamicTree:: draw( cairo_t* cr, double t, const Context& C ) const throw(std::runtime_error) { Drawable::draw(cr,t,C); if( visible() ) { double lw = edge_properties().line_width(t); shawn::Vec col = edge_properties().color(t); double blend = edge_properties().blend(t); const std::string taglabel = "predecessor"; cairo_save(cr); cairo_set_line_width( cr, lw ); cairo_set_source_rgba(cr,col.x(),col.y(),col.z(),1.0-blend); for( shawn::World::const_node_iterator it = visualization().world().begin_nodes(), endit = visualization().world().end_nodes(); it != endit; ++it ) { std::string pred = read_predecessor( *it, taglabel ); if ( pred.empty() ) continue; const shawn::Node *predecessor = visualization().world().find_node_by_label( pred ); if ( !predecessor ) continue; const DrawableNode* dsrc = drawable_node( *it, DrawableNodeDefault::PREFIX ); const DrawableNode* dtgt = drawable_node( *predecessor, DrawableNodeDefault::PREFIX ); shawn::Vec pos1 = dsrc->position(t); shawn::Vec pos2 = dtgt->position(t); cairo_move_to(cr,pos1.x(),pos1.y()); cairo_line_to(cr,pos2.x(),pos2.y()); cairo_stroke(cr); } cairo_restore(cr); } }