Permalink
Browse files

Note about DxfLinePattern cache

  • Loading branch information...
feragon committed Jul 22, 2016
1 parent 6c86b39 commit 6ee16669c9a1a725a5efcd478ca6abe29383f13e
Showing with 6 additions and 3 deletions.
  1. +1 −2 lckernel/cad/meta/dxflinepattern.cpp
  2. +5 −1 lckernel/cad/meta/dxflinepattern.h
@@ -9,11 +9,10 @@
using namespace lc;
DxfLinePattern::DxfLinePattern(const std::string &name, const std::string &description, const std::vector<double> &path, const double length, const double lineWidth) :
DxfLinePattern::DxfLinePattern(const std::string &name, const std::string &description, const std::vector<double> &path, const double length) :
_name(name), _description(description), _path(path), _length(length) {
assert(!StringHelper::isBlank(name) > 0 && "Name of DxfLinePattern must be given");
// Continues has a path length of 0 assert(_path.size() > 0 && "Path length must be > 0");
_lcPatterns[lineWidth] = generatePattern(path, length, lineWidth);
}
double DxfLinePattern::calculatePathLength(const std::vector<double> &_path) {
@@ -21,7 +21,7 @@ namespace lc {
DxfLinePattern() {}
DxfLinePattern(const std::string &_name, const std::string &_description, const std::vector<double> &_path, const double length, const double lineWidth = 1);
DxfLinePattern(const std::string &_name, const std::string &_description, const std::vector<double> &_path, const double length);
virtual ~DxfLinePattern() = default;
@@ -67,7 +67,11 @@ namespace lc {
std::string _name;
std::string _description;
std::vector<double> _path;
//Might grow out of proportions if too much line sizes are rendered
//We should find a way to remove widths unrendered for x drawing cycles
mutable std::map<double, std::vector<double>> _lcPatterns;
double _length;
};
using DxfLinePattern_SPtr = std::shared_ptr<DxfLinePattern>;

0 comments on commit 6ee1666

Please sign in to comment.