Blender
V3.3
|
#include <Stroke.h>
Public Types | |
enum | MediumType { DRY_MEDIUM , HUMID_MEDIUM , OPAQUE_MEDIUM } |
typedef std::deque< StrokeVertex * > | vertex_container |
typedef std::vector< ViewEdge * > | viewedge_container |
typedef StrokeInternal::vertex_iterator_base< StrokeInternal::vertex_nonconst_traits > | vertex_iterator |
typedef StrokeInternal::vertex_iterator_base< StrokeInternal::vertex_const_traits > | const_vertex_iterator |
Additional Inherited Members | |
![]() | |
unsigned | _timeStamp |
Class to define a stroke. A stroke is made of a set of 2D vertices (StrokeVertex), regularly spaced out. This set of vertices defines the stroke's backbone geometry. Each of these stroke vertices defines the stroke's shape and appearance at this vertex position.
typedef std::deque<StrokeVertex *> Freestyle::Stroke::vertex_container |
Freestyle::Stroke::Stroke | ( | ) |
default constructor
Definition at line 391 of file Stroke.cpp.
References Freestyle::a, MAX_MTEX, and OPAQUE_MEDIUM.
Freestyle::Stroke::Stroke | ( | const Stroke & | iBrother | ) |
copy constructor
Definition at line 408 of file Stroke.cpp.
References Freestyle::a, MAX_MTEX, and v.
Freestyle::Stroke::Stroke | ( | InputVertexIterator | iBegin, |
InputVertexIterator | iEnd | ||
) |
Builds a stroke from a set of StrokeVertex. This constructor is templated by an iterator type. This iterator type must allow the vertices parsing using the ++ operator.
iBegin | The iterator pointing to the first vertex. |
iEnd | The iterator pointing to the end of the vertex list. |
Definition at line 869 of file Stroke.h.
References v.
|
virtual |
float Freestyle::Stroke::ComputeSampling | ( | int | iNVertices | ) |
Compute the sampling needed to get iNVertices vertices. If the specified number of vertices is less than the actual number of vertices, the actual sampling value is returned. (To remove Vertices, use the RemoveVertex() method of this class).
iNVertices | The number of StrokeVertices we eventually want in our Stroke. |
Definition at line 487 of file Stroke.cpp.
References float().
Referenced by Freestyle::StrokeShaders::BezierCurveShader::shade().
|
inline |
|
inline |
Definition at line 705 of file Stroke.h.
References Freestyle::VecMat::Vec2< T >::x().
|
inline |
Definition at line 710 of file Stroke.h.
References Freestyle::VecMat::Vec2< T >::y().
|
inline |
|
inline |
Definition at line 720 of file Stroke.h.
References Freestyle::VecMat::Vec2< T >::x().
|
inline |
Definition at line 725 of file Stroke.h.
References Freestyle::VecMat::Vec2< T >::y().
|
inlinevirtual |
Returns the string "Stroke"
Reimplemented from Freestyle::Interface1D.
|
inlinevirtual |
Reimplemented from Freestyle::Interface1D.
Definition at line 498 of file Stroke.h.
Referenced by Freestyle::operator<<(), Freestyle::StrokeShaders::BezierCurveShader::shade(), and Freestyle::StrokeTesselator::Tesselate().
|
inlinevirtual |
Returns the 2D length of the Stroke
Reimplemented from Freestyle::Interface1D.
Definition at line 621 of file Stroke.h.
Referenced by Freestyle::operator<<(), Freestyle::StrokeShaders::ConstrainedIncreasingThicknessShader::shade(), Freestyle::StrokeShaders::LengthDependingThicknessShader::shade(), and Freestyle::StrokeShaders::BackboneStretcherShader::shade().
|
inline |
Returns a reference to the time stamp value of the stroke. Returns the MediumType used for this Stroke.
Definition at line 628 of file Stroke.h.
Referenced by Freestyle::operator<<(), and Freestyle::StrokeRep::StrokeRep().
|
inline |
Returns the texture used at given index to simulate the marks system for this Stroke
Definition at line 646 of file Stroke.h.
Referenced by Freestyle::StrokeRep::StrokeRep().
|
inline |
Return the shader node tree to define textures.
Definition at line 652 of file Stroke.h.
Referenced by Freestyle::StrokeRep::StrokeRep().
|
inline |
Returns the id of the texture used to simulate th marks system for this Stroke
Definition at line 634 of file Stroke.h.
Referenced by Freestyle::StrokeRep::StrokeRep().
|
inline |
Returns the spacing of texture coordinates along the stroke length
Definition at line 640 of file Stroke.h.
Referenced by Freestyle::StrokeRep::StrokeRep().
|
inline |
Returns true if this Stroke has textures assigned, false otherwise.
Definition at line 658 of file Stroke.h.
References NULL.
Referenced by Freestyle::StrokeRep::StrokeRep().
|
inline |
void Freestyle::Stroke::InsertVertex | ( | StrokeVertex * | iVertex, |
StrokeInternal::StrokeVertexIterator | next | ||
) |
Inserts the stroke vertex iVertex in the stroke before next. The length, curvilinear abscissa are updated consequently.
iVertex | The StrokeVertex to insert in the Stroke. |
next | A StrokeVertexIterator pointing to the StrokeVertex before which iVertex must be inserted. |
Definition at line 710 of file Stroke.cpp.
References next, and UpdateLength().
|
virtual |
Returns an iterator over the Interface1D points, pointing to the first point. The difference with verticesBegin() is that here we can iterate over points of the 1D element at a any given sampling. Indeed, for each iteration, a virtual point is created.
t | The sampling with which we want to iterate over points of this 1D element. |
Reimplemented from Freestyle::Interface1D.
Definition at line 779 of file Stroke.cpp.
References verticesBegin().
|
virtual |
Returns an iterator over the Interface1D points, pointing after the last point. The difference with verticesEnd() is that here we can iterate over points of the 1D element at a any given sampling. Indeed, for each iteration, a virtual point is created.
t | The sampling with which we want to iterate over points of this 1D element. |
Reimplemented from Freestyle::Interface1D.
Definition at line 784 of file Stroke.cpp.
References verticesEnd().
|
inline |
Definition at line 782 of file Stroke.h.
Referenced by Freestyle::createStroke().
|
inline |
void Freestyle::Stroke::RemoveAllVertices | ( | ) |
Removes all vertices from the Stroke.
Definition at line 687 of file Stroke.cpp.
References UpdateLength().
void Freestyle::Stroke::RemoveVertex | ( | StrokeVertex * | iVertex | ) |
Removes the stroke vertex iVertex from the stroke. The length and curvilinear abscissa are updated consequently.
Definition at line 697 of file Stroke.cpp.
References UpdateLength().
Referenced by Freestyle::StrokeShaders::BezierCurveShader::shade(), and Freestyle::StrokeShaders::TipRemoverShader::shade().
void Freestyle::Stroke::Render | ( | const StrokeRenderer * | iRenderer | ) |
Definition at line 798 of file Stroke.cpp.
References Freestyle::StrokeRenderer::RenderStrokeRep().
Referenced by Freestyle::AppCanvas::RenderStroke().
void Freestyle::Stroke::RenderBasic | ( | const StrokeRenderer * | iRenderer | ) |
Definition at line 806 of file Stroke.cpp.
References Freestyle::StrokeRenderer::RenderStrokeRep().
Referenced by Freestyle::AppCanvas::RenderStroke().
int Freestyle::Stroke::Resample | ( | float | iSampling | ) |
Resampling method. Resamples the curve with a given sampling. If this sampling is < to the actual sampling value, no resampling is done.
iSampling | The new sampling value. |
Definition at line 630 of file Stroke.cpp.
References Freestyle::a, usdtokens::b(), next, Freestyle::VecMat::Vec< T, N >::norm(), strokeVerticesBegin(), strokeVerticesEnd(), and t.
int Freestyle::Stroke::Resample | ( | int | iNPoints | ) |
Resampling method. Resamples the curve so that it eventually has iNPoints. That means it is going to add iNPoints-vertices_size, if vertices_size is the number of points we already have. If vertices_size >= iNPoints, no resampling is done.
iNPoints | The number of vertices we eventually want in our stroke. |
Definition at line 521 of file Stroke.cpp.
References Freestyle::a, usdtokens::b(), float(), blender::math::floor(), N, next, Freestyle::VecMat::Vec< T, N >::norm(), strokeVerticesBegin(), strokeVerticesEnd(), strokeVerticesSize(), and t.
Referenced by Freestyle::StrokeShaders::SamplingShader::shade(), Freestyle::StrokeShaders::BezierCurveShader::shade(), Freestyle::StrokeShaders::TipRemoverShader::shade(), strokeVerticesBegin(), and vertices_begin().
Definition at line 789 of file Stroke.cpp.
References Freestyle::StrokeAttribute::getThicknessL(), Freestyle::StrokeAttribute::getThicknessR(), and Freestyle::StrokeAttribute::setThickness().
Definition at line 802 of file Stroke.h.
References Freestyle::x, and y.
Definition at line 812 of file Stroke.h.
References Freestyle::x, and y.
sets the 2D length of the Stroke.
Definition at line 479 of file Stroke.cpp.
References v.
Referenced by Freestyle::createStroke().
|
inline |
|
inline |
assigns a blender texture to the first available slot.
Definition at line 759 of file Stroke.h.
References Freestyle::a, and MAX_MTEX.
Referenced by Freestyle::StrokeShaders::BlenderTextureShader::shade().
assigns a node tree (of new shading nodes) to define textures.
Definition at line 771 of file Stroke.h.
Referenced by Freestyle::StrokeShaders::BlenderTextureShader::shade().
|
inline |
sets the spacing of texture coordinates along the stroke length.
Definition at line 753 of file Stroke.h.
Referenced by Freestyle::StrokeShaders::StrokeTextureStepShader::shade().
|
inline |
Returns the i-th StrokeVertex constituting the Stroke.
StrokeInternal::StrokeVertexIterator Freestyle::Stroke::strokeVerticesBegin | ( | float | t = 0.0f | ) |
Returns a StrokeVertexIterator pointing on the first StrokeVertex of the Stroke. One can specify a sampling value to re-sample the Stroke on the fly if needed.
t | The resampling value with which we want our Stroke to be resampled. If 0 is specified, no resampling is done. |
Definition at line 750 of file Stroke.cpp.
References Resample(), and t.
Referenced by Freestyle::Smoother::copyVertices(), Freestyle::createStroke(), Freestyle::TextStrokeRenderer::RenderStrokeRepBasic(), Resample(), Freestyle::StrokeShaders::ConstantThicknessShader::shade(), Freestyle::StrokeShaders::ConstantExternThicknessShader::shade(), Freestyle::StrokeShaders::IncreasingThicknessShader::shade(), Freestyle::StrokeShaders::ConstrainedIncreasingThicknessShader::shade(), Freestyle::StrokeShaders::LengthDependingThicknessShader::shade(), Freestyle::StrokeShaders::ThicknessNoiseShader::shade(), Freestyle::StrokeShaders::ConstantColorShader::shade(), Freestyle::StrokeShaders::IncreasingColorShader::shade(), Freestyle::StrokeShaders::ColorNoiseShader::shade(), Freestyle::StrokeShaders::BackboneStretcherShader::shade(), Freestyle::StrokeShaders::BezierCurveShader::shade(), Freestyle::StrokeShaders::PolygonalizationShader::shade(), Freestyle::StrokeShaders::GuidingLinesShader::shade(), Freestyle::StrokeShaders::TipRemoverShader::shade(), and Freestyle::Smoother::Smoother().
StrokeInternal::StrokeVertexIterator Freestyle::Stroke::strokeVerticesEnd | ( | ) |
Returns a StrokeVertexIterator pointing after the last StrokeVertex of the Stroke.
Definition at line 759 of file Stroke.cpp.
Referenced by Freestyle::Smoother::copyVertices(), Resample(), Freestyle::StrokeShaders::ConstantThicknessShader::shade(), Freestyle::StrokeShaders::ConstantExternThicknessShader::shade(), Freestyle::StrokeShaders::IncreasingThicknessShader::shade(), Freestyle::StrokeShaders::ConstrainedIncreasingThicknessShader::shade(), Freestyle::StrokeShaders::LengthDependingThicknessShader::shade(), Freestyle::StrokeShaders::ThicknessNoiseShader::shade(), Freestyle::StrokeShaders::ConstantColorShader::shade(), Freestyle::StrokeShaders::IncreasingColorShader::shade(), Freestyle::StrokeShaders::ColorNoiseShader::shade(), Freestyle::StrokeShaders::BackboneStretcherShader::shade(), Freestyle::StrokeShaders::BezierCurveShader::shade(), Freestyle::StrokeShaders::PolygonalizationShader::shade(), Freestyle::StrokeShaders::GuidingLinesShader::shade(), Freestyle::StrokeShaders::TipRemoverShader::shade(), and Freestyle::Smoother::Smoother().
|
inline |
Returns the number of StrokeVertex constituting the Stroke.
Definition at line 837 of file Stroke.h.
Referenced by Freestyle::createStroke(), Resample(), Freestyle::StrokeShaders::ConstantThicknessShader::shade(), Freestyle::StrokeShaders::ConstantExternThicknessShader::shade(), Freestyle::StrokeShaders::IncreasingThicknessShader::shade(), Freestyle::StrokeShaders::ConstrainedIncreasingThicknessShader::shade(), Freestyle::StrokeShaders::LengthDependingThicknessShader::shade(), Freestyle::StrokeShaders::IncreasingColorShader::shade(), Freestyle::StrokeShaders::BezierCurveShader::shade(), Freestyle::StrokeShaders::PolygonalizationShader::shade(), Freestyle::StrokeShaders::GuidingLinesShader::shade(), and Freestyle::StrokeShaders::TipRemoverShader::shade().
void Freestyle::Stroke::UpdateLength | ( | ) |
Updates the 2D length of the Stroke
Definition at line 717 of file Stroke.cpp.
References norm().
Referenced by Freestyle::Smoother::copyVertices(), InsertVertex(), RemoveAllVertices(), RemoveVertex(), Freestyle::SpatialNoiseShader::shade(), Freestyle::StrokeShaders::BackboneStretcherShader::shade(), Freestyle::StrokeShaders::SamplingShader::shade(), Freestyle::StrokeShaders::ExternalContourStretcherShader::shade(), Freestyle::StrokeShaders::BezierCurveShader::shade(), Freestyle::StrokeShaders::PolygonalizationShader::shade(), and Freestyle::StrokeShaders::GuidingLinesShader::shade().
Stroke::const_vertex_iterator Freestyle::Stroke::vertices_begin | ( | ) | const |
embedding vertex iterator
Definition at line 735 of file Stroke.cpp.
Referenced by Freestyle::operator<<(), and Freestyle::StrokeTesselator::Tesselate().
Stroke::vertex_iterator Freestyle::Stroke::vertices_begin | ( | float | sampling = 0.0f | ) |
Definition at line 814 of file Stroke.cpp.
References Resample().
Stroke::vertex_iterator Freestyle::Stroke::vertices_end | ( | ) |
Definition at line 745 of file Stroke.cpp.
Stroke::const_vertex_iterator Freestyle::Stroke::vertices_end | ( | ) | const |
Definition at line 740 of file Stroke.cpp.
Referenced by Freestyle::operator<<(), and Freestyle::StrokeTesselator::Tesselate().
|
inline |
Definition at line 670 of file Stroke.h.
Referenced by Freestyle::Smoother::Smoother(), and Freestyle::StrokeTesselator::Tesselate().
|
virtual |
Returns an Interface0DIterator pointing on the first StrokeVertex of the Stroke.
Reimplemented from Freestyle::Interface1D.
Definition at line 765 of file Stroke.cpp.
References ret.
Referenced by Freestyle::createStroke(), pointsBegin(), Freestyle::CalligraphicShader::shade(), Freestyle::SpatialNoiseShader::shade(), Freestyle::StrokeShaders::MaterialColorShader::shade(), and Freestyle::StrokeShaders::ExternalContourStretcherShader::shade().
|
virtual |
Returns an Interface0DIterator pointing after the last StrokeVertex of the Stroke.
Reimplemented from Freestyle::Interface1D.
Definition at line 772 of file Stroke.cpp.
References ret.
Referenced by pointsEnd(), and Freestyle::StrokeShaders::MaterialColorShader::shade().
|
inline |
|
inline |
|
inline |
|
inline |