Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
kovacsv committed Aug 10, 2015
2 parents 3eff265 + 68fa290 commit 41e3f92
Show file tree
Hide file tree
Showing 192 changed files with 15,137 additions and 9,427 deletions.
478 changes: 245 additions & 233 deletions build/jsmodeler.js

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions build/jsmodeler.viewer.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions documentation/demo/include/settingscontrols.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ JSM.PolygonControl.prototype.AddCoord = function (mouseCoord)
canAddCoord = true;
} else {
var lastCoord = this.coords[this.coords.length - 1];
if (!JSM.CoordIsEqual2D (lastCoord, mouseCoord)) {
if (!lastCoord.IsEqual (mouseCoord)) {
canAddCoord = true;
}
}
Expand Down Expand Up @@ -456,13 +456,13 @@ JSM.PolygonControl.prototype.UpdateMarker = function (mouseCoord)
refCoordIndex = this.coords.length - 1;
}
var refCoord = this.coords[refCoordIndex];
if (JSM.CoordDistance2D (mouseCoord, refCoord) < this.styles.editor.gridStep) {
if (mouseCoord.DistanceTo (refCoord) < this.styles.editor.gridStep) {
this.marker = refCoordIndex;
}
} else if (this.mode == 'Finished') {
var i;
for (i = 0; i < this.coords.length; i++) {
if (JSM.CoordDistance2D (mouseCoord, this.coords[i]) < this.styles.editor.gridStep) {
if (mouseCoord.DistanceTo (this.coords[i]) < this.styles.editor.gridStep) {
this.marker = i;
break;
}
Expand Down
46 changes: 41 additions & 5 deletions documentation/demo/include/shapegenerators.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
JSM.CreatePolygonFromVertices = function (vertices)
{
var polygon = new JSM.Polygon2D ();

var i, current;
for (i = 0; i < vertices.length; i++) {
current = vertices[i];
polygon.AddVertex (current.x, current.y);
}

return polygon;
};

JSM.ChangePolygonOrientation2D = function (polygon)
{
var oldPolygon = polygon.Clone ();
polygon.Clear ();

var i, oldVertex;
for (i = oldPolygon.VertexCount () - 1; i >= 0; i--) {
oldVertex = oldPolygon.GetVertex (i);
polygon.AddVertex (oldVertex.x, oldVertex.y);
}
};

JSM.CreateCCWPolygonFromVertices = function (vertices)
{
var polygon = JSM.CreatePolygonFromVertices (vertices);
if (polygon.GetOrientation () != JSM.Orientation.CounterClockwise) {
JSM.ChangePolygonOrientation2D (polygon);
}
return polygon;
};

JSM.ShapeGenerator = function ()
{
this.parameters = null;
Expand Down Expand Up @@ -353,6 +387,7 @@ JSM.PrismGenerator = function ()
]], 'left'),
direction : new JSM.Parameter ('direction', 'coord', new JSM.Coord (0.0, 0.0, 1.0), 'right'),
height : new JSM.Parameter ('height', 'number', 1.0, 'right'),
curveAngle : new JSM.Parameter ('curve angle', 'number', 150, 'right'),
withTopAndBottom : new JSM.Parameter ('top and bottom', 'check', true, 'right')
};
};
Expand All @@ -367,7 +402,7 @@ JSM.PrismGenerator.prototype.Check = function ()
if (!JSM.IsPositive (this.parameters.height.value)) {
return false;
}
if (JSM.IsZero (JSM.VectorLength (this.parameters.direction.value))) {
if (JSM.IsZero (this.parameters.direction.value.Length ())) {
return false;
}
return true;
Expand All @@ -386,7 +421,8 @@ JSM.PrismGenerator.prototype.Generate = function ()
basePolygon,
this.parameters.direction.value,
this.parameters.height.value,
this.parameters.withTopAndBottom.value
this.parameters.withTopAndBottom.value,
this.parameters.curveAngle.value * JSM.DegRad
);
};

Expand Down Expand Up @@ -421,7 +457,7 @@ JSM.PrismShellGenerator.prototype.Check = function ()
if (!JSM.IsPositive (this.parameters.width.value)) {
return false;
}
if (JSM.IsZero (JSM.VectorLength (this.parameters.direction.value))) {
if (JSM.IsZero (this.parameters.direction.value.Length ())) {
return false;
}
return true;
Expand Down Expand Up @@ -477,7 +513,7 @@ JSM.LineShellGenerator.prototype.Check = function ()
if (!JSM.IsPositive (this.parameters.width.value)) {
return false;
}
if (JSM.IsZero (JSM.VectorLength (this.parameters.direction.value))) {
if (JSM.IsZero (this.parameters.direction.value.Length ())) {
return false;
}
return true;
Expand Down Expand Up @@ -570,7 +606,7 @@ JSM.RevolveGenerator.prototype.Check = function ()
if (this.parameters.basePolyLine.value[1].length < 2) {
return false;
}
if (JSM.IsZero (JSM.CoordDistance (this.parameters.axisBeg.value, this.parameters.axisEnd.value))) {
if (JSM.IsZero (this.parameters.axisBeg.value.DistanceTo (this.parameters.axisEnd.value))) {
return false;
}
if (!JSM.IsPositive (this.parameters.angle.value)) {
Expand Down
96 changes: 11 additions & 85 deletions documentation/examples/svgto3d.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
return;
}

var modelAndMaterials = JSM.SvgToModel (svgObjects[index], 8, 5);
var modelAndMaterials = JSM.SvgToModel (svgObjects[index], 8, 5, null);
var meshes = JSM.ConvertModelToThreeMeshes (modelAndMaterials[0], modelAndMaterials[1]);
viewer.AddMeshes (meshes);

Expand Down Expand Up @@ -161,26 +161,6 @@
</div>
<div class="box">
<a href="javascript:OpenSVG (3);">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="180" height="180" viewBox="0 0 180 180" segmentlength="2">
<path
style="fill:#71c837;fill-opacity:1;stroke:none"
d="M 30 10 C 18.92 10 10 18.92 10 30 L 10 150 C 10 161.08 18.92 170 30 170 L 150 170 C 161.08 170 170 161.08 170 150 L 170 30 C 170 18.92 161.08 10 150 10 L 30 10 z M 89.8125 25.90625 C 90.203526 25.89623 90.606587 25.90625 91 25.90625 C 116.17857 25.90625 136.59375 46.290184 136.59375 71.46875 C 136.59375 96.647317 116.55356 152.375 91.375 152.375 C 66.196427 152.375 45.40625 96.647317 45.40625 71.46875 C 45.40625 46.6836 65.177753 26.530376 89.8125 25.90625 z "
id="rect4084" />
<path
style="fill:#71c837;fill-opacity:1;stroke:none"
d="M 88.849925,113.80428 C 47.819071,126.15153 50.098511,75.623731 50.098511,75.623731 78.418648,70.527686 87.026905,91.589058 88.849925,113.80428 z"
id="path4088"
inkscape:connector-curvature="0" />
<path
style="fill:#71c837;fill-opacity:1;stroke:none"
d="m 131.63095,75.674102 c 0,0 2.27944,50.544588 -38.751417,38.197338 C 96.009524,91.814199 107.5849,70.825978 131.63095,75.674102 z"
id="path3901"
inkscape:connector-curvature="0" />
</svg>
</a>
</div>
<div class="box">
<a href="javascript:OpenSVG (4);">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="180" height="180" viewBox="0 0 180 180" segmentlength="2">
<path
style="fill:#cc6699;fill-opacity:1;stroke:none"
Expand All @@ -192,7 +172,7 @@
</a>
</div>
<div class="box">
<a href="javascript:OpenSVG (5);">
<a href="javascript:OpenSVG (4);">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="180" height="180" viewBox="0 0 180 180" segmentlength="3">
<path
style="fill:#ff6600;fill-rule:evenodd;stroke:none"
Expand All @@ -206,7 +186,7 @@
</a>
</div>
<div class="box">
<a href="javascript:OpenSVG (6);">
<a href="javascript:OpenSVG (5);">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="180" height="180" viewBox="0 0 180 180" segmentlength="3">
<path
style="fill:#ff0000;fill-opacity:1;stroke:none"
Expand Down Expand Up @@ -236,51 +216,7 @@
</a>
</div>
<div class="box">
<a href="javascript:OpenSVG (7);">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="180" height="180" viewBox="0 0 180 180" segmentlength="2">
<path
style="fill:#dd0000;fill-opacity:1;stroke:none"
d="M 97.749998,10 108.41667,33.291667 74.958332,11.041666 91.749998,30.374999 53.416665,18.499999 74.916666,32.291667 34.833332,31.75 59.333333,38.875 20.708333,49.708332 46.249999,49.625 12.208333,70.916671 36.666666,63.625 10,93.708338 31.458333,79.791668 14.291667,116.16666 30.958332,96.750003 l -6.249999,39.750007 10.541666,-23.33335 5.125,39.91667 3.583333,-25.375 16.166667,36.875 -3.708334,-25.375 L 82.249999,170 71.583332,146.70834 105.04167,168.95833 88.249999,149.625 126.58334,161.5 l -21.5,-13.79167 40.08333,0.54167 -24.50001,-7.125 38.625,-10.83334 -25.54166,0.0834 34.04166,-21.29166 -24.45833,7.29166 L 170,86.291689 148.54167,100.20836 165.70833,63.833361 149.04166,83.250024 155.29167,43.500028 144.75,66.833361 139.625,26.916695 136.04166,52.291694 119.875,15.416696 123.58332,40.791695 97.749998,10 z M 89.999999,49.999999 C 112.09139,49.999999 130,67.90861 130,89.999999 130,112.09139 112.09139,130 89.999999,130 c -22.091391,0 -40,-17.90861 -40,-40.000001 0,-22.091389 17.908609,-40 40,-40 z"
id="path3824" />
<path
style="fill:#222222;fill-opacity:1;stroke:none"
d="M 90 55 C 70.670035 55 55 70.670034 55 90 C 55 109.32996 70.670035 125 90 125 C 109.32997 125 125 109.32996 125 90 C 125 70.670034 109.32997 55 90 55 z M 90 70 C 101.0457 70 110 78.954304 110 90 C 110 101.04569 101.0457 110 90 110 C 78.954312 110 70 101.04569 70 90 C 70 78.954304 78.954312 70 90 70 z "
id="path3831" />
</svg>
</a>
</div>
<div class="box">
<a href="javascript:OpenSVG (8);">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="180" height="180" viewBox="0 0 180 180" segmentlength="2">
<path
style="fill:#008000;fill-opacity:1;stroke:none"
d="m 90,20 c -38.659933,0 -70,31.340067 -70,70 0,38.65993 31.340067,70 70,70 38.65993,0 70,-31.34007 70,-70 0,-2.360107 -0.1,-4.699918 -0.32813,-7 -3.05123,28.5346 -27.20227,50.75 -56.54687,50.75 C 71.713806,133.75 46.25,108.2862 46.25,76.875 46.25,47.530393 68.4654,23.379365 97,20.328125 94.699922,20.099991 92.360111,20 90,20 z"
id="path3007"
inkscape:connector-curvature="0" />
<path
style="fill:#ff0000;fill-opacity:1;stroke:none"
d="M 150,74.999998 C 150,99.852811 129.85282,120 105,120 80.147186,120 60,99.852811 60,74.999998 60,50.147188 80.147186,30 105,30 c 24.85282,0 45,20.147188 45,44.999998 z"
id="path3069"
inkscape:connector-curvature="0" />
</svg>
</a>
</div> <div class="box">
<a href="javascript:OpenSVG (9);">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="180" height="180" viewBox="0 0 180 180" segmentlength="2">
<path
style="fill:#ff0000;fill-opacity:1;stroke:none"
d="m 53.278202,36.394506 c -20.347346,0.465296 -40.727994,14.508279 -40.9375,40.875 0.253284,49.615044 78.25,77.750004 78.25,77.750004 0,0 73.906908,-27.91298 74.624998,-78.406254 0.58038,-40.810493 -57.1135,-54.210053 -73.999998,-16.0625 -6.298063,-16.662192 -22.111786,-24.518147 -37.9375,-24.15625 z m 6.75,10.875 c 12.961398,0.184992 25.650032,6.904652 30.8125,20.5625 C 105.19507,35.404683 154.27155,46.7973 153.7782,81.488256 153.16778,124.41006 90.309452,148.11326 90.309452,148.11326 c 0,0 -66.284699,-23.88724 -66.5,-66.062504 0.183035,-23.035613 18.456834,-35.034758 36.21875,-34.78125 z"
id="rect2997"
inkscape:connector-curvature="0" />
<path
style="fill:#ff0000;fill-opacity:1;stroke:none"
d="M 64.21875,60.65625 C 50.134946,60.978313 36.020015,70.718525 35.875,88.96875 c 0.175319,34.34201 54.15625,53.8125 54.15625,53.8125 0,0 51.1592,-19.33137 51.65625,-54.28125 C 142.08922,60.252231 102.15707,50.970443 90.46875,77.375 86.109426,65.841946 75.17282,60.405757 64.21875,60.65625 z"
id="path3003" />
</svg>
</a>
</div>
<div class="box">
<a href="javascript:OpenSVG (10);">
<a href="javascript:OpenSVG (6);">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="180" height="180" viewBox="0 0 180 180" segmentlength="3">
<path
style="fill:#ff0000;fill-opacity:1;stroke:none"
Expand Down Expand Up @@ -335,26 +271,16 @@
</a>
</div>
<div class="box">
<a href="javascript:OpenSVG (11);">
<a href="javascript:OpenSVG (7);">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="180" height="180" viewBox="0 0 180 180" segmentlength="2">
<path
style="fill:#71c837;fill-opacity:1;stroke:none"
d="m 88.427596,16.757034 c -22.473484,0.56937 -40.513504,18.974997 -40.513504,41.585695 0,22.969599 18.968389,73.812681 41.937987,73.812681 22.969601,0 41.248721,-50.843082 41.248721,-73.812681 0,-22.969599 -18.63141,-41.585695 -41.601013,-41.585695 -0.3589,0 -0.71547,-0.0091 -1.072191,0 z M 87.539209,96.956922 C 50.108082,108.22092 52.18754,62.126032 52.18754,62.126032 78.023085,57.477074 85.876127,76.690688 87.539209,96.956922 z M 126.56696,62.171984 c 0,0 2.07946,46.110206 -35.351667,34.846208 2.855391,-20.122115 13.415237,-39.268996 35.351667,-34.846208 z"
id="path3901"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cssssccccccc" />
<path
d="m 78.937984,151.39107 c -1.9e-5,1.20118 -0.09767,2.22657 -0.292968,3.07617 -0.302754,1.31836 -1.025409,2.51953 -2.167969,3.60352 -1.621109,1.5332 -3.789076,2.2998 -6.503906,2.2998 -2.76368,0 -4.921881,-0.78125 -6.47461,-2.34375 -0.820315,-0.82031 -1.381838,-1.85058 -1.68457,-3.09082 -0.214846,-0.8789 -0.322268,-2.06054 -0.322266,-3.54492 l 0,-11.52832 5.200196,0 0,10.82519 c -8e-6,0.86915 0.01464,1.51856 0.04395,1.94824 0.09765,1.35743 0.717765,2.3047 1.860352,2.8418 0.46874,0.22462 0.986318,0.33692 1.552734,0.33692 1.269519,0 2.226549,-0.44434 2.871094,-1.33301 0.478501,-0.65429 0.717759,-1.91894 0.717773,-3.79395 l 0,-10.82519 5.200195,0 z"
style="fill:#71c837;fill-opacity:1"
id="path4062" />
<path
d="m 94.567867,144.21333 -6.254883,0 0,3.38379 5.698243,0 0,4.35059 -5.698243,0 0,7.91015 -5.200195,0 0,-19.99511 11.455078,0 z"
style="fill:#71c837;fill-opacity:1"
id="path4064" />
style="fill:#dd0000;fill-opacity:1;stroke:none"
d="M 97.749998,10 108.41667,33.291667 74.958332,11.041666 91.749998,30.374999 53.416665,18.499999 74.916666,32.291667 34.833332,31.75 59.333333,38.875 20.708333,49.708332 46.249999,49.625 12.208333,70.916671 36.666666,63.625 10,93.708338 31.458333,79.791668 14.291667,116.16666 30.958332,96.750003 l -6.249999,39.750007 10.541666,-23.33335 5.125,39.91667 3.583333,-25.375 16.166667,36.875 -3.708334,-25.375 L 82.249999,170 71.583332,146.70834 105.04167,168.95833 88.249999,149.625 126.58334,161.5 l -21.5,-13.79167 40.08333,0.54167 -24.50001,-7.125 38.625,-10.83334 -25.54166,0.0834 34.04166,-21.29166 -24.45833,7.29166 L 170,86.291689 148.54167,100.20836 165.70833,63.833361 149.04166,83.250024 155.29167,43.500028 144.75,66.833361 139.625,26.916695 136.04166,52.291694 119.875,15.416696 123.58332,40.791695 97.749998,10 z M 89.999999,49.999999 C 112.09139,49.999999 130,67.90861 130,89.999999 130,112.09139 112.09139,130 89.999999,130 c -22.091391,0 -40,-17.90861 -40,-40.000001 0,-22.091389 17.908609,-40 40,-40 z"
id="path3824" />
<path
d="m 118.94287,149.92622 c -3e-5,2.71485 -0.90335,5.09766 -2.70996,7.14844 -2.06057,2.33399 -4.84865,3.50098 -8.36426,3.50098 -3.50587,0 -6.28907,-1.16699 -8.349611,-3.50098 -1.806643,-2.05078 -2.709962,-4.43359 -2.709961,-7.14844 -10e-7,-1.24022 0.244139,-2.51219 0.732422,-3.81591 0.488279,-1.3037 1.142575,-2.41942 1.962891,-3.34717 2.060539,-2.33397 4.848619,-3.50096 8.364259,-3.50098 3.51561,2e-5 6.30369,1.16701 8.36426,3.50098 1.80661,2.05079 2.70993,4.43849 2.70996,7.16308 z m -5.40528,0 c -10e-6,-1.40623 -0.44923,-2.62205 -1.34765,-3.64746 -1.15236,-1.30858 -2.59279,-1.96287 -4.32129,-1.96289 -1.19142,2e-5 -2.27052,0.33449 -3.23731,1.00342 -0.9668,0.66896 -1.65528,1.56007 -2.06543,2.67334 -0.23438,0.63478 -0.35156,1.27931 -0.35156,1.93359 0,1.34767 0.44921,2.55372 1.34766,3.61817 1.11327,1.31836 2.54882,1.97754 4.30664,1.97754 1.7578,0 3.19823,-0.6543 4.32129,-1.96289 0.89842,-1.04492 1.34764,-2.25585 1.34765,-3.63282 z"
style="fill:#71c837;fill-opacity:1"
id="path4066" />
style="fill:#222222;fill-opacity:1;stroke:none"
d="M 90 55 C 70.670035 55 55 70.670034 55 90 C 55 109.32996 70.670035 125 90 125 C 109.32997 125 125 109.32996 125 90 C 125 70.670034 109.32997 55 90 55 z M 90 70 C 101.0457 70 110 78.954304 110 90 C 110 101.04569 101.0457 110 90 110 C 78.954312 110 70 101.04569 70 90 C 70 78.954304 78.954312 70 90 70 z "
id="path3831" />
</svg>
</a>
</div>
Expand Down
10 changes: 8 additions & 2 deletions documentation/jsmdoc/include/jsmdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,22 @@ div.entrymark
float : left;
}

div.entrymark.enum
{
color : #ffffff;
background : #008ab8;
}

div.entrymark.function
{
color : #ffffff;
background : #279b61;
background : #cc3333;
}

div.entrymark.class
{
color : #ffffff;
background : #cc3333;
background : #279b61;
}

div.entryname
Expand Down
Loading

0 comments on commit 41e3f92

Please sign in to comment.