Blender V4.3
StrokeIO.cpp
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2009-2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
11
12#include "StrokeIO.h"
13
14namespace Freestyle {
15
16ostream &operator<<(ostream &out, const StrokeAttribute &iStrokeAttribute)
17{
18 out << " StrokeAttribute" << endl;
19 out << " color : (" << iStrokeAttribute.getColorR() << ","
20 << iStrokeAttribute.getColorG() << "," << iStrokeAttribute.getColorB() << ")" << endl;
21 out << " alpha : " << iStrokeAttribute.getAlpha() << endl;
22 out << " thickness : " << iStrokeAttribute.getThicknessR() << ", "
23 << iStrokeAttribute.getThicknessL() << endl;
24 out << " visible : " << iStrokeAttribute.isVisible() << endl;
25 return out;
26}
27
28ostream &operator<<(ostream &out, const StrokeVertex &iStrokeVertex)
29{
30 out << " StrokeVertex" << endl;
31 out << " id : " << iStrokeVertex.getId() << endl;
32 out << " curvilinear length : " << iStrokeVertex.curvilinearAbscissa() << endl;
33 out << " 2d coordinates : (" << iStrokeVertex.getProjectedX() << ","
34 << iStrokeVertex.getProjectedY() << "," << iStrokeVertex.getProjectedZ() << ")" << endl;
35 out << " 3d coordinates : (" << iStrokeVertex.getX() << "," << iStrokeVertex.getY() << ","
36 << iStrokeVertex.getZ() << ")" << endl;
37 out << iStrokeVertex.attribute() << endl;
38 return out;
39}
40
41ostream &operator<<(ostream &out, const Stroke &iStroke)
42{
43 out << "Stroke" << endl;
44 out << " id : " << iStroke.getId() << endl;
45 out << " length : " << iStroke.getLength2D() << endl;
46 out << " medium type : " << iStroke.getMediumType() << endl;
47 for (Stroke::const_vertex_iterator v = iStroke.vertices_begin(), vend = iStroke.vertices_end();
48 v != vend;
49 ++v)
50 {
51 out << *(*v) << endl;
52 }
53 return out;
54}
55
56} /* namespace Freestyle */
Iterators used to iterate over the elements of the Stroke. Can't be used in python.
Functions to manage I/O for the stroke.
ATTR_WARN_UNUSED_RESULT const BMVert * v
virtual real getZ() const
Definition Curve.h:72
virtual Id getId() const
Definition Curve.h:110
virtual real getProjectedZ() const
Definition Curve.h:96
virtual real getX() const
Definition Curve.h:60
virtual real getProjectedX() const
Definition Curve.h:84
virtual real getProjectedY() const
Definition Curve.h:90
virtual real getY() const
Definition Curve.h:66
const float getThicknessR() const
Definition Stroke.h:142
const float getColorR() const
Definition Stroke.h:103
const float getColorB() const
Definition Stroke.h:115
bool isVisible() const
Definition Stroke.h:161
const float getThicknessL() const
Definition Stroke.h:148
float getAlpha() const
Definition Stroke.h:127
const float getColorG() const
Definition Stroke.h:109
float curvilinearAbscissa() const
Definition Stroke.h:388
const StrokeAttribute & attribute() const
Definition Stroke.h:376
const_vertex_iterator vertices_begin() const
embedding vertex iterator
Definition Stroke.cpp:741
virtual Id getId() const
Definition Stroke.h:500
const_vertex_iterator vertices_end() const
Definition Stroke.cpp:746
MediumType getMediumType() const
Definition Stroke.h:630
real getLength2D() const
Definition Stroke.h:623
inherits from class Rep
Definition AppCanvas.cpp:20
ostream & operator<<(ostream &out, const StrokeAttribute &iStrokeAttribute)
Definition StrokeIO.cpp:16