Example #1
0
	std::string pointlines()  {
		tmp.str("");
		tmp << "\n\n  <!-- draw straight lines between points -->";
		tmp << "\n  <path fill='none' stroke='green' d='";
		tmp << "\n   M " << ftpoints[0].x << "," << ftpoints[0].y << "\n";
		tmp << "\n  '/>";
		for ( int i = 0 ; i < ftoutline.n_points-1 ; i++ ) {
			std::string dash_mod("");
			for (int j = 0 ; j < ftoutline.n_contours; j++ ) {
				if (i==contours[j])
					dash_mod = " stroke-dasharray='3'";
			}
			tmp << "\n  <path fill='none' stroke='green'";
			tmp << dash_mod;
			tmp << " d='";
 			tmp << " M " << ftpoints[i].x << "," << ftpoints[i].y;
 			tmp << " L " << ftpoints[(i+1)%ftoutline.n_points].x << "," << ftpoints[(i+1)%ftoutline.n_points].y;
			tmp << "\n  '/>";
		}
		return tmp.str();
	}
Example #2
0
 // Draw straight lines between points
 std::string pointlines()
 {
     std::stringstream tmp("");
     tmp << "\n  <path fill='none' stroke='green' d='";
     tmp << "\n   M " << _points[0].x << "," << _points[0].y << "\n";
     tmp << "\n  '/>";
     
     for ( int i = 0 ; i < _outline.n_points-1 ; i++ ) {
         std::string dash_mod("");
         for (int j = 0 ; j < _outline.n_contours; j++ ) {
             if (i== _contours[j])
                 dash_mod = " stroke-dasharray='3'";
         }
         tmp << "\n  <path fill='none' stroke='green'";
         tmp << dash_mod;
         tmp << " d='";
         tmp << " M " << _points[i].x << "," << _points[i].y;
         tmp << " L " << _points[(i+1) % _outline.n_points].x << "," << _points[(i+1) % _outline.n_points].y;
         tmp << "\n  '/>";
     }
     return tmp.str();
 }