Blender  V3.3
StrokeIO.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
9 
10 #include "StrokeIO.h"
11 
12 namespace Freestyle {
13 
14 ostream &operator<<(ostream &out, const StrokeAttribute &iStrokeAttribute)
15 {
16  out << " StrokeAttribute" << endl;
17  out << " color : (" << iStrokeAttribute.getColorR() << ","
18  << iStrokeAttribute.getColorG() << "," << iStrokeAttribute.getColorB() << ")" << endl;
19  out << " alpha : " << iStrokeAttribute.getAlpha() << endl;
20  out << " thickness : " << iStrokeAttribute.getThicknessR() << ", "
21  << iStrokeAttribute.getThicknessL() << endl;
22  out << " visible : " << iStrokeAttribute.isVisible() << endl;
23  return out;
24 }
25 
26 ostream &operator<<(ostream &out, const StrokeVertex &iStrokeVertex)
27 {
28  out << " StrokeVertex" << endl;
29  out << " id : " << iStrokeVertex.getId() << endl;
30  out << " curvilinear length : " << iStrokeVertex.curvilinearAbscissa() << endl;
31  out << " 2d coordinates : (" << iStrokeVertex.getProjectedX() << ","
32  << iStrokeVertex.getProjectedY() << "," << iStrokeVertex.getProjectedZ() << ")" << endl;
33  out << " 3d coordinates : (" << iStrokeVertex.getX() << "," << iStrokeVertex.getY() << ","
34  << iStrokeVertex.getZ() << ")" << endl;
35  out << iStrokeVertex.attribute() << endl;
36  return out;
37 }
38 
39 ostream &operator<<(ostream &out, const Stroke &iStroke)
40 {
41  out << "Stroke" << endl;
42  out << " id : " << iStroke.getId() << endl;
43  out << " length : " << iStroke.getLength2D() << endl;
44  out << " medium type : " << iStroke.getMediumType() << endl;
45  for (Stroke::const_vertex_iterator v = iStroke.vertices_begin(), vend = iStroke.vertices_end();
46  v != vend;
47  ++v) {
48  out << *(*v) << endl;
49  }
50  return out;
51 }
52 
53 } /* 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:70
virtual Id getId() const
Definition: Curve.h:108
virtual real getProjectedZ() const
Definition: Curve.h:94
virtual real getX() const
Definition: Curve.h:58
virtual real getProjectedX() const
Definition: Curve.h:82
virtual real getProjectedY() const
Definition: Curve.h:88
virtual real getY() const
Definition: Curve.h:64
const float getThicknessR() const
Definition: Stroke.h:140
const float getColorR() const
Definition: Stroke.h:101
const float getColorB() const
Definition: Stroke.h:113
bool isVisible() const
Definition: Stroke.h:159
const float getThicknessL() const
Definition: Stroke.h:146
float getAlpha() const
Definition: Stroke.h:125
const float getColorG() const
Definition: Stroke.h:107
float curvilinearAbscissa() const
Definition: Stroke.h:386
const StrokeAttribute & attribute() const
Definition: Stroke.h:374
const_vertex_iterator vertices_begin() const
embedding vertex iterator
Definition: Stroke.cpp:735
virtual Id getId() const
Definition: Stroke.h:498
const_vertex_iterator vertices_end() const
Definition: Stroke.cpp:740
MediumType getMediumType() const
Definition: Stroke.h:628
real getLength2D() const
Definition: Stroke.h:621
inherits from class Rep
Definition: AppCanvas.cpp:18
ostream & operator<<(ostream &out, const StrokeAttribute &iStrokeAttribute)
Definition: StrokeIO.cpp:14
static const pxr::TfToken out("out", pxr::TfToken::Immortal)