Example #1
0
static PyObject *Stroke_stroke_vertices_begin(BPy_Stroke *self, PyObject *args, PyObject *kwds)
{
	static const char *kwlist[] = {"t", NULL};
	float f = 0.0f;

	if (!PyArg_ParseTupleAndKeywords(args, kwds, "|f", (char **)kwlist, &f))
		return NULL;
	StrokeInternal::StrokeVertexIterator sv_it(self->s->strokeVerticesBegin(f));
	return BPy_StrokeVertexIterator_from_StrokeVertexIterator(sv_it, 0);
}
static PyObject *StrokeVertexIterator_incremented(BPy_StrokeVertexIterator *self)
{
	if (self->sv_it->isEnd()) {
		PyErr_SetString(PyExc_RuntimeError, "cannot increment any more");
		return NULL;
	}
	StrokeInternal::StrokeVertexIterator *copy = new StrokeInternal::StrokeVertexIterator(*self->sv_it);
	copy->increment();
	return BPy_StrokeVertexIterator_from_StrokeVertexIterator(*copy, self->reversed);
}
Example #3
0
static PyObject *Stroke_iter(PyObject *self)
{
	StrokeInternal::StrokeVertexIterator sv_it( ((BPy_Stroke *)self)->s->strokeVerticesBegin() );
	return BPy_StrokeVertexIterator_from_StrokeVertexIterator( sv_it, 0 );
}
Example #4
0
static PyObject *Stroke_stroke_vertices_end(BPy_Stroke *self)
{
	StrokeInternal::StrokeVertexIterator sv_it(self->s->strokeVerticesEnd());
	return BPy_StrokeVertexIterator_from_StrokeVertexIterator(sv_it, 1);
}
static PyObject *StrokeVertexIterator_reversed(BPy_StrokeVertexIterator *self)
{
	StrokeInternal::StrokeVertexIterator *copy = new StrokeInternal::StrokeVertexIterator(*self->sv_it);
	return BPy_StrokeVertexIterator_from_StrokeVertexIterator(*copy, !self->reversed);
}