8000 Remove PyCXX dependency for core extension modules by mdboom · Pull Request #3646 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Remove PyCXX dependency for core extension modules #3646

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Oct 18, 2014
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix curve simplification
  • Loading branch information
mdboom committed Oct 17, 2014
commit 339537d58374e8c2f7dd62299a9869d819956937
25 changes: 12 additions & 13 deletions src/path_converters.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class EmbeddedQueue
{
}

inline void set(const unsigned cmd_, const double &x_, const double &y_)
inline void set(const unsigned cmd_, const double x_, const double y_)
{
cmd = cmd_;
x = x_;
Expand All @@ -73,7 +73,7 @@ class EmbeddedQueue
int m_queue_write;
item m_queue[QueueSize];

inline void queue_push(const unsigned cmd, const double &x, const double &y)
inline void queue_push(const unsigned cmd, const double x, const double y)
{
m_queue[m_queue_write++].set(cmd, x, y);
}
Expand Down Expand Up @@ -107,6 +107,14 @@ class EmbeddedQueue
}
};

/* Defines when path segment types have more than one vertex */
static const size_t num_extra_points_map[] =
{0, 0, 0, 1,
2, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0
};

/*
PathNanRemover is a vertex converter that removes non-finite values
from the vertices list, and inserts MOVETO commands as necessary to
Expand All @@ -119,7 +127,6 @@ class PathNanRemover : protected EmbeddedQueue<4>
VertexSource *m_source;
bool m_remove_nans;
bool m_has_curves;
static const unsigned char num_extra_points_map[16];

public:
/* has_curves should be true if the path contains bezier curve
Expand Down Expand Up @@ -171,11 +178,12 @@ class PathNanRemover : protected EmbeddedQueue<4>
size_t num_extra_points = num_extra_points_map[code & 0xF];
bool has_nan = (MPL_notisfinite64(*x) || MPL_notisfinite64(*y));
queue_push(code, *x, *y);

/* Note: this test can not be short-circuited, since we need to
advance through the entire curve no matter what */
for (size_t i = 0; i < num_extra_points; ++i) {
m_source->vertex(x, y);
has_nan |= (MPL_notisfinite64(*x) || MPL_notisfinite64(*y));
has_nan = has_nan || (MPL_notisfinite64(*x) || MPL_notisfinite64(*y));
queue_push(code, *x, *y);
}

Expand Down Expand Up @@ -227,15 +235,6 @@ class PathNanRemover : protected EmbeddedQueue<4>
}
};

/* Defines when path segment types have more than one vertex */
template<class VertexSource>
const unsigned char PathNanRemover<VertexSource>::num_extra_points_map[] =
{0, 0, 0, 1,
2, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0
};

/************************************************************
PathClipper uses the Liang-Barsky line clipping algorithm (as
implemented in Agg) to clip the path to a given rectangle. Lines
Expand Down
0