Files
test/source/blender/freestyle/intern/stroke/StrokeIO.cpp
Campbell Barton c434782e3a File headers: SPDX License migration
Use a shorter/simpler license convention, stops the header taking so
much space.

Follow the SPDX license specification: https://spdx.org/licenses

- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile

While most of the source tree has been included

- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
  use different header conventions.

doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.

See P2788 for the script that automated these edits.

Reviewed By: brecht, mont29, sergey

Ref D14069
2022-02-11 09:14:36 +11:00

54 lines
1.9 KiB
C++

/* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup freestyle
* \brief Functions to manage I/O for the stroke
*/
#include "StrokeAdvancedIterators.h"
#include "StrokeIO.h"
namespace Freestyle {
ostream &operator<<(ostream &out, const StrokeAttribute &iStrokeAttribute)
{
out << " StrokeAttribute" << endl;
out << " color : (" << iStrokeAttribute.getColorR() << ","
<< iStrokeAttribute.getColorG() << "," << iStrokeAttribute.getColorB() << ")" << endl;
out << " alpha : " << iStrokeAttribute.getAlpha() << endl;
out << " thickness : " << iStrokeAttribute.getThicknessR() << ", "
<< iStrokeAttribute.getThicknessL() << endl;
out << " visible : " << iStrokeAttribute.isVisible() << endl;
return out;
}
ostream &operator<<(ostream &out, const StrokeVertex &iStrokeVertex)
{
out << " StrokeVertex" << endl;
out << " id : " << iStrokeVertex.getId() << endl;
out << " curvilinear length : " << iStrokeVertex.curvilinearAbscissa() << endl;
out << " 2d coordinates : (" << iStrokeVertex.getProjectedX() << ","
<< iStrokeVertex.getProjectedY() << "," << iStrokeVertex.getProjectedZ() << ")" << endl;
out << " 3d coordinates : (" << iStrokeVertex.getX() << "," << iStrokeVertex.getY() << ","
<< iStrokeVertex.getZ() << ")" << endl;
out << iStrokeVertex.attribute() << endl;
return out;
}
ostream &operator<<(ostream &out, const Stroke &iStroke)
{
out << "Stroke" << endl;
out << " id : " << iStroke.getId() << endl;
out << " length : " << iStroke.getLength2D() << endl;
out << " medium type : " << iStroke.getMediumType() << endl;
for (Stroke::const_vertex_iterator v = iStroke.vertices_begin(), vend = iStroke.vertices_end();
v != vend;
++v) {
out << *(*v) << endl;
}
return out;
}
} /* namespace Freestyle */