Newer
Older
/*
* Copyright (c) 2015 Tricoire Sebastien 3dsman@free.fr
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software
* in a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
*/
#include "OE_pattern.h"
3dsman
committed
OE_pattern::OE_pattern(std::vector<vector_2d> _pts, float _defaultOffset, bool _endPoints, std::string _name)
3dsman
committed
defaultOffset = _defaultOffset;
void OE_pattern::persist(Pakal::Archive* archive)
{
archive->value("pts", pts);
archive->value("endPoints", endPoints);
3dsman
committed
archive->value("defaultOffset", defaultOffset);
std::list<OE_pattern*> OE_pattern::createStandardPatterns()
{
std::list<OE_pattern*> standardPattern;
3dsman
committed
standardPattern.push_back(new OE_pattern({vector_2d(0, 0)},0, false, "straight"));
standardPattern.push_back(new OE_pattern({vector_2d(0, 0),
vector_2d(1, 0),
3dsman
committed
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
vector_2d(0, 0)},0, false, "triple straight"));
standardPattern.push_back(new OE_pattern({vector_2d(0, 1),
vector_2d(0.5, 0)},0.5, false, "satin"));
standardPattern.push_back(new OE_pattern({vector_2d(0, 0),
vector_2d(0, 1)},0.5, false, "stretch"));
standardPattern.push_back(new OE_pattern({vector_2d(0, 0),
vector_2d(0.3, 1),
vector_2d(0.6, 0)},0.5, false, "overcast"));
standardPattern.push_back(new OE_pattern({vector_2d(0, 0),
vector_2d(0, 1),
vector_2d(0, 0)},0.5, false, "applique"));
standardPattern.push_back(new OE_pattern({vector_2d(1, 1),
vector_2d(0.5, 0.5),
vector_2d(0, 1),
vector_2d(1, 0)},0.5, false, "cross"));
standardPattern.push_back(new OE_pattern({vector_2d(0, 0),
vector_2d(0.5, 0),
vector_2d(0.5, 0.6),
vector_2d(0.3, 0.8),
vector_2d(0.5, 1),
vector_2d(0.7, 0.8),
vector_2d(0.5, 0.6),
vector_2d(0.5, 0)},0.5, false, "applique circle"));
standardPattern.push_back(new OE_pattern({vector_2d(0.5, 0.5),
vector_2d(0.8, 0.5),
vector_2d(0.2, 0.5),
vector_2d(0.5, 0.5),
vector_2d(0.5, 0.2),
vector_2d(0.5, 0.8),
vector_2d(0.5, 0.5),
vector_2d(0.3, 0.3),
vector_2d(0.7, 0.7),
vector_2d(0.5, 0.5),
vector_2d(0.7, 0.3),
vector_2d(0.3, 0.7),
vector_2d(0.5, 0.5)},0.5, false, "flower"));