sp-mesh-array.cpp revision 763176bacabff6cd0f23bf6be4c6c721c48c526e
120N/A A mesh is made up of an array of patches. Each patch has four sides and four corners. The sides can
3817N/A#include "sp-mesh-array.h"
3817N/A#include "sp-mesh-gradient.h"
3817N/A#include "sp-mesh-row.h"
120N/A#include "sp-mesh-patch.h"
120N/A#include "preferences.h"
120N/A#include "sp-ellipse.h"
1392N/A#include "svg/css-ostringstream.h"
3477N/A#include "display/drawing-context.h"
3477N/A#include "display/cairo-utils.h"
181N/A#include "document.h"
120N/A#include "svg/svg-color.h"
3817N/A// Includes bezier-curve.h, ray.h, crossing.h
#include <cmath>
#include <algorithm>
nodes = n;
guint i = 0;
guint j = 0;
return points;
return type;
if( tensorIsSet( i ) ) {
bool set = false;
return set;
guint i = 0;
guint j = 0;
p = coonsTensorPoint( k );
p[0][0] = getPoint( 0, 0 );
guint t = 0;
return color;
return opacity;
clear();
// std::cout << "SPMeshNodeArray::read: row size: " << nodes.size() << std::endl;
// std::cout << " after: " << nodes.size() << std::endl;
bool closed = false;
char path_type;
gdouble x, y;
switch ( path_type ) {
if( !closed ) {
os >> x >> y;
if( !closed ) {
os >> x >> y;
os >> x >> y;
p += current_p;
os >> x >> y;
++istop;
os >> x >> y;
++icolumn;
++irow;
drag_valid = false;
built = true;
using Geom::X;
using Geom::Y;
// std::cout << " SPMeshNodeArray::write: tensor: " << is.str() << std::endl;
switch ( path_type ) {
// std::cout << "SPMeshNodeArray::write: path: " << is.str().c_str() << std::endl;
if ( firstStop ) {
return color;
if( !bbox ) {
if( !bbox ) {
s += arc;
s += M_PI_2;
// (It should be easy to handle the rounded/randomized cases by making
if( nodes[i][j] ) {
delete nodes[i][j];
if( nodes[i][j] ) {
<< nodes[i][j]->p
bool adjacent = false;
c1 = j;
c2 = i;
adjacent = true;
adjacent = true;
return adjacent;
switch (path_type)
++toggled;
return toggled;
switch (path_type)
if( crossing ) {
++arced;
return arced;
c[0] = corners[i];
++toggled;
return toggled;
bool smooth = false;
smooth = true;
smooth = true;
if( smooth ) {
// << color0.v.c[c] << " "
// << color3.v.c[c] << " "
// << color6.v.c[c]
cdm = c;
++smoothed;
return smoothed;
pick_drawing->setRoot(pick_doc->getRoot()->invoke_show(*pick_drawing, pick_visionkey, SP_ITEM_SHOW_DISPLAY));
if( row == 0 ) {
if( col == 0 ) {
ink_cairo_surface_average_color(s, R, G, B, A);
delete pick_drawing;
return picked;
void SPMeshNodeArray::update_handles( guint corner, std::vector< guint > /*selected*/, Geom::Point p_old, MeshNodeOperation /*op*/ )
// Defined in gradient-chemistry.cpp
double nn = n;
double nn = n;
built = false;
guint n = k;
p[k] = nodes[i+n][j]->p;
// std::cout << b_new.first[n] << " " << b_new.second[n] << std::endl;
built = false;
p[k] = nodes[i][j+k]->p;