Permalink
Browse files

Toolbar line pattern select fix

  • Loading branch information...
feragon committed Aug 5, 2016
1 parent 70abf1d commit 1412e5328d2dfbb2c6f2a0155647b1cc21d82a37
@@ -40,7 +40,7 @@ function active_metaInfo()
local linePattern = linePatternSelect:linePattern()
if(linePattern ~= nil) then
metaInfo:add(linePattern)
metaInfo:addDxfLinePattern(linePattern)
end
return metaInfo
@@ -97,8 +97,9 @@ void lua_openlckernel(lua_State* L) {
.endClass()
.beginClass<MetaInfo>("MetaInfo")
.addConstructor(LUA_SP(MetaInfo_SPtr), LUA_ARGS())
.addFunction("add", &MetaInfo::add)
.addConstructor(LUA_SP(MetaInfo_SPtr), LUA_ARGS())
.addFunction("add", &MetaInfo::add)
.addFunction("addDxfLinePattern", &MetaInfo::addDxfLinePattern)
.endClass()
.beginClass<geo::Coordinate>("Coord")
@@ -10,6 +10,12 @@ std::shared_ptr<MetaInfo> MetaInfo::add(EntityMetaType_CSPtr mt) {
return shared_from_this();
}
//Temp function to add DxfLinePatterns from Lua
std::shared_ptr<MetaInfo> MetaInfo::addDxfLinePattern(DxfLinePattern_CSPtr lp) {
this->emplace(lp->metaTypeID(), lp);
return shared_from_this();
}
//std::shared_ptr<MetaInfo> MetaInfo::add(std::string name, MetaType_CSPtr mt) {
// this->emplace(name, mt);
// return shared_from_this();
@@ -3,6 +3,7 @@
#include <unordered_map>
#include <string>
#include "cad/interface/metatype.h"
#include "cad/meta/dxflinepattern.h"
namespace lc {
/**
@@ -13,6 +14,8 @@ namespace lc {
public:
// COnvenience function to add a MetaType to the MetaInfo map
std::shared_ptr<MetaInfo> add(EntityMetaType_CSPtr mi);
std::shared_ptr<MetaInfo> addDxfLinePattern(DxfLinePattern_CSPtr lp);
// std::shared_ptr<MetaInfo> add(std::string name, MetaType_CSPtr mi);
virtual ~MetaInfo() = default;
@@ -20,7 +20,7 @@ void LCVLine::draw(LcPainter& painter, const LcDrawOptions &options, const lc::g
painter.line_to(end().x(), end().y());
painter.stroke();
auto c1 = lc::geo::Coordinate(0, 0);
/*auto c1 = lc::geo::Coordinate(0, 0);
auto rad = 100;
auto ell= lc::geo::Circle(c1, rad);
@@ -55,6 +55,6 @@ void LCVLine::draw(LcPainter& painter, const LcDrawOptions &options, const lc::g
}
painter.stroke();
painter.circle(ell.center().x(), ell.center().y(), ell.radius());
painter.stroke();
painter.stroke();*/
}

0 comments on commit 1412e53

Please sign in to comment.