Lines Matching refs:patch
4 A mesh is made up of an array of patches. Each patch has four sides and four corners. The sides can
52 #include "sp-mesh-patch.h"
80 row = r*3; // Convert from patch array to node array
107 Returns point for side in proper order for patch
134 Returns vector of points for a side in proper order for a patch (clockwise order).
150 Set point for side in proper order for patch
357 Equivalent to 1/3 of side length from corner for square patch.
474 Return color for corner of patch.
502 Set color for corner of patch.
525 Return opacity for corner of patch.
552 Set opacity for corner of patch.
634 guint irow = 0; // Corresponds to top of patch being read in.
639 guint icolumn = 0; // Corresponds to left of patch being read in.
644 SPMeshpatch *patch = SP_MESHPATCH(po);
667 // First patch in mesh.
673 // If side closes patch, then we read one less point.
786 if( patch->tensor_string ) {
787 std::string tensor_string = *(patch->tensor_string);
854 for ( SPObject *patch = row->firstChild(); patch; patch = patch->getNext() ) {
855 descendant_reprs = g_slist_prepend (descendant_reprs, patch->getRepr());
856 descendant_objects = g_slist_prepend (descendant_objects, patch );
857 for ( SPObject *stop = patch->firstChild(); stop; stop = stop->getNext() ) {
898 // Write patch
899 Inkscape::XML::Node *patch = xml_doc->createElement("svg:meshpatch");
914 patch->setAttribute("tensor", is.str().c_str());
918 row->appendChild( patch );
991 patch->appendChild( stop );
1137 SPMeshPatchI patch( &nodes, 0, i );
1150 patch.setPoint( 0, 0, Geom::Point( x0, y0 ) );
1151 patch.setPoint( 0, 1, Geom::Point( x1, y1 ) );
1152 patch.setPoint( 0, 2, Geom::Point( x2, y2 ) );
1153 patch.setPoint( 0, 3, Geom::Point( x3, y3 ) );
1155 patch.setPoint( 2, 0, center );
1156 patch.setPoint( 3, 0, center );
1159 patch.setPathType( k, 'l' );
1160 patch.setColor( k, color );
1161 patch.setOpacity( k, 1.0 );
1163 patch.setPathType( 0, 'c' );
1166 patch.updateNodes();
1195 SPMeshPatchI patch( &nodes, 0, 0 );
1212 patch.setPoint( i, 1, p1 );
1213 patch.setPoint( i, 2, p2 );
1214 patch.setPoint( i, 3, p3 );
1216 patch.setPathType( i, 'c' );
1218 patch.setColor( i, color );
1219 patch.setOpacity( i, 1.0 );
1223 patch.updateNodes();
1249 SPMeshPatchI patch( &nodes, 0, i );
1251 patch.setPoint( 0, 0, sp_star_get_xy( star, SP_STAR_POINT_KNOT1, i ) );
1254 patch.setPoint( 1, 0, sp_star_get_xy( star, SP_STAR_POINT_KNOT1, ii ) );
1255 patch.setPoint( 2, 0, star->center );
1256 patch.setPoint( 3, 0, star->center );
1259 patch.setPathType( s, 'l' );
1260 patch.setColor( s, color );
1261 patch.setOpacity( s, 1.0 );
1265 patch.updateNodes();
1589 Fill 'smooth' with a smoothed version of the array by subdividing each patch into smaller patches.
1693 // Next split each patch into 8x8 smaller patches.
1767 Number of patch rows.
1775 Number of patch columns.
2012 // Check we have four corners of one patch selected
2023 // Upper left node of patch
2040 SPMeshPatchI patch( &nodes, prow, pcol );
2041 patch.updateNodes();
2043 if( patch.tensorIsSet() ) {
2354 // Find number of patch rows and columns
2389 bool patch[4];
2390 patch[0] = patch[1] = patch[2] = patch[3] = false;
2391 if( ccol > 0 && crow > 0 ) patch[0] = true;
2392 if( ccol < mcol && crow > 0 ) patch[1] = true;
2393 if( ccol < mcol && crow < mrow ) patch[2] = true;
2394 if( ccol > 0 && crow < mrow ) patch[3] = true;
2396 // std::cout << patch[0] << " "
2397 // << patch[1] << " "
2398 // << patch[2] << " "
2399 // << patch[3] << std::endl;
2402 if( patch[0] || patch[1] ) {
2413 if( patch[1] || patch[2] ) {
2424 if( patch[2] || patch[3] ) {
2435 if( patch[3] || patch[0] ) {
2448 if( patch[0] ) nodes[nrow-1][ncol-1]->p += dp;
2449 if( patch[1] ) nodes[nrow-1][ncol+1]->p += dp;
2450 if( patch[2] ) nodes[nrow+1][ncol+1]->p += dp;
2451 if( patch[3] ) nodes[nrow+1][ncol-1]->p += dp;
2503 // // Bottom right patch
2518 // // Bottom left patch (note x, y swapped)
2533 // // Top left patch
2548 // // Top right patch (note x, y swapped)
2659 SPMeshPatchI patch( &nodes, row, j );
2660 patch.updateNodes();
2673 guint i = 3 * row; // Convert from patch row to node row
2681 if( k == 3 ) n = 6; // Bottom patch row has been shifted by new rows
2782 SPMeshPatchI patch( &nodes, i, col );
2783 patch.updateNodes();
2786 guint j = 3 * col; // Convert from patch column to node column