Files
test/source/blender/blenkernel/intern/spline_poly.cc
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

98 lines
1.7 KiB
C++

/* SPDX-License-Identifier: GPL-2.0-or-later */
#include "BLI_span.hh"
#include "BLI_virtual_array.hh"
#include "BKE_spline.hh"
using blender::float3;
using blender::MutableSpan;
using blender::Span;
using blender::fn::GVArray;
void PolySpline::copy_settings(Spline &UNUSED(dst)) const
{
/* Poly splines have no settings not covered by the base class. */
}
void PolySpline::copy_data(Spline &dst) const
{
PolySpline &poly = static_cast<PolySpline &>(dst);
poly.positions_ = positions_;
poly.radii_ = radii_;
poly.tilts_ = tilts_;
}
int PolySpline::size() const
{
const int size = positions_.size();
BLI_assert(size == radii_.size());
BLI_assert(size == tilts_.size());
return size;
}
void PolySpline::resize(const int size)
{
positions_.resize(size);
radii_.resize(size);
tilts_.resize(size);
this->mark_cache_invalid();
attributes.reallocate(size);
}
MutableSpan<float3> PolySpline::positions()
{
return positions_;
}
Span<float3> PolySpline::positions() const
{
return positions_;
}
MutableSpan<float> PolySpline::radii()
{
return radii_;
}
Span<float> PolySpline::radii() const
{
return radii_;
}
MutableSpan<float> PolySpline::tilts()
{
return tilts_;
}
Span<float> PolySpline::tilts() const
{
return tilts_;
}
void PolySpline::reverse_impl()
{
}
void PolySpline::mark_cache_invalid()
{
tangent_cache_dirty_ = true;
normal_cache_dirty_ = true;
length_cache_dirty_ = true;
}
int PolySpline::evaluated_points_size() const
{
return this->size();
}
void PolySpline::correct_end_tangents() const
{
}
Span<float3> PolySpline::evaluated_positions() const
{
return this->positions();
}
GVArray PolySpline::interpolate_to_evaluated(const GVArray &src) const
{
BLI_assert(src.size() == this->size());
return src;
}