#include <glibmm.h>
#include "attributes.h"
#include "display/cairo-utils.h"
#include "sp-mesh.h"
/*
* Mesh Gradient
*/
//#define MESH_DEBUG
// Start coordinate of mesh
}
}
// Start coordinate of mesh
this->readAttr( "x" );
this->readAttr( "y" );
this->readAttr( "type" );
}
switch (key) {
case SP_ATTR_X:
}
break;
case SP_ATTR_Y:
}
break;
case SP_ATTR_TYPE:
if (value) {
this->type = SP_MESH_TYPE_COONS;
this->type = SP_MESH_TYPE_BICUBIC;
} else {
}
} else {
// std::cout << "SPMesh::set() No value " << std::endl;
this->type = SP_MESH_TYPE_COONS;
}
break;
default:
break;
}
}
/**
* Write mesh gradient attributes to associated repr.
*/
Inkscape::XML::Node* SPMesh::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) {
#ifdef MESH_DEBUG
#endif
}
}
}
switch (this->type) {
case SP_MESH_TYPE_COONS:
break;
case SP_MESH_TYPE_BICUBIC:
break;
default:
// Do nothing
break;
}
}
return repr;
}
void
{
}
double opacity
#else
double /*opacity*/
#endif
)
{
using Geom::X;
using Geom::Y;
#ifdef MESH_DEBUG
std::cout << "sp_mesh_create_pattern: (" << bbox->x0 << "," << bbox->y0 << ") (" << bbox->x1 << "," << bbox->y1 << ") " << opacity << std::endl;
#endif
this->ensureArray();
if( type_set ) {
switch (type) {
case SP_MESH_TYPE_COONS:
// std::cout << "SPMesh::pattern_new: Coons" << std::endl;
break;
case SP_MESH_TYPE_BICUBIC:
break;
}
}
for( unsigned int i = 0; i < my_array->patch_rows(); ++i ) {
for( unsigned int j = 0; j < my_array->patch_columns(); ++j ) {
for( unsigned int k = 0; k < 4; ++k ) {
#ifdef DEBUG_MESH
for( int p = 0; p < 4; ++p ) {
}
#endif
switch ( patch.getPathType( k ) ) {
case 'l':
case 'L':
case 'z':
case 'Z':
break;
case 'c':
case 'C':
{
break;
}
default:
// Shouldn't happen
}
if( patch.tensorIsSet(k) ) {
// Tensor point defined relative to corner.
cairo_mesh_pattern_set_control_point( cp, k, t[X], t[Y] );
//std::cout << " sp_mesh_create_pattern: tensor " << k
// << " set to " << t << "." << std::endl;
} else {
// Geom::Point t = patch.coonsTensorPoint(k);
//std::cout << " sp_mesh_create_pattern: tensor " << k
// << " calculated as " << t << "." <<std::endl;
}
cp, k,
}
}
}
// set pattern matrix
if (this->getUnits() == SP_GRADIENT_UNITS_OBJECTBOUNDINGBOX) {
}
#else
static bool shown = false;
if( !shown ) {
shown = true;
}
#endif
/*
cairo_pattern_t *cp = cairo_pattern_create_radial(
sp_gradient_pattern_common_setup(cp, gr, bbox, opacity);
*/
return cp;
}