Blender  V2.93
StrokeIO.cpp
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
23 
24 #include "StrokeIO.h"
25 
26 namespace Freestyle {
27 
28 ostream &operator<<(ostream &out, const StrokeAttribute &iStrokeAttribute)
29 {
30  out << " StrokeAttribute" << endl;
31  out << " color : (" << iStrokeAttribute.getColorR() << ","
32  << iStrokeAttribute.getColorG() << "," << iStrokeAttribute.getColorB() << ")" << endl;
33  out << " alpha : " << iStrokeAttribute.getAlpha() << endl;
34  out << " thickness : " << iStrokeAttribute.getThicknessR() << ", "
35  << iStrokeAttribute.getThicknessL() << endl;
36  out << " visible : " << iStrokeAttribute.isVisible() << endl;
37  return out;
38 }
39 
40 ostream &operator<<(ostream &out, const StrokeVertex &iStrokeVertex)
41 {
42  out << " StrokeVertex" << endl;
43  out << " id : " << iStrokeVertex.getId() << endl;
44  out << " curvilinear length : " << iStrokeVertex.curvilinearAbscissa() << endl;
45  out << " 2d coordinates : (" << iStrokeVertex.getProjectedX() << ","
46  << iStrokeVertex.getProjectedY() << "," << iStrokeVertex.getProjectedZ() << ")" << endl;
47  out << " 3d coordinates : (" << iStrokeVertex.getX() << "," << iStrokeVertex.getY() << ","
48  << iStrokeVertex.getZ() << ")" << endl;
49  out << iStrokeVertex.attribute() << endl;
50  return out;
51 }
52 
53 ostream &operator<<(ostream &out, const Stroke &iStroke)
54 {
55  out << "Stroke" << endl;
56  out << " id : " << iStroke.getId() << endl;
57  out << " length : " << iStroke.getLength2D() << endl;
58  out << " medium type : " << iStroke.getMediumType() << endl;
59  for (Stroke::const_vertex_iterator v = iStroke.vertices_begin(), vend = iStroke.vertices_end();
60  v != vend;
61  ++v) {
62  out << *(*v) << endl;
63  }
64  return out;
65 }
66 
67 } /* 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:84
virtual Id getId() const
Definition: Curve.h:122
virtual real getProjectedZ() const
Definition: Curve.h:108
virtual real getX() const
Definition: Curve.h:72
virtual real getProjectedX() const
Definition: Curve.h:96
virtual real getProjectedY() const
Definition: Curve.h:102
virtual real getY() const
Definition: Curve.h:78
const float getThicknessR() const
Definition: Stroke.h:154
const float getColorR() const
Definition: Stroke.h:115
const float getColorB() const
Definition: Stroke.h:127
bool isVisible() const
Definition: Stroke.h:173
const float getThicknessL() const
Definition: Stroke.h:160
float getAlpha() const
Definition: Stroke.h:139
const float getColorG() const
Definition: Stroke.h:121
float curvilinearAbscissa() const
Definition: Stroke.h:400
const StrokeAttribute & attribute() const
Definition: Stroke.h:388
const_vertex_iterator vertices_begin() const
embedding vertex iterator
Definition: Stroke.cpp:749
virtual Id getId() const
Definition: Stroke.h:512
const_vertex_iterator vertices_end() const
Definition: Stroke.cpp:754
MediumType getMediumType() const
Definition: Stroke.h:642
real getLength2D() const
Definition: Stroke.h:635
inherits from class Rep
Definition: AppCanvas.cpp:32
ostream & operator<<(ostream &out, const StrokeAttribute &iStrokeAttribute)
Definition: StrokeIO.cpp:28