Sketcher: fix issues with single points

This commit is contained in:
logari81 2012-07-16 12:11:20 +02:00
parent 87bc9cbe74
commit 72cd746401
2 changed files with 47 additions and 38 deletions

View File

@ -224,7 +224,11 @@ Base::Vector3d SketchObject::getPoint(int GeoId, PointPos PosId) const
assert(GeoId == H_Axis || GeoId == V_Axis ||
(GeoId <= getHighestCurveIndex() && GeoId >= -getExternalGeometryCount()) );
const Part::Geometry *geo = getGeometry(GeoId);
if (geo->getTypeId() == Part::GeomLineSegment::getClassTypeId()) {
if (geo->getTypeId() == Part::GeomPoint::getClassTypeId()) {
const Part::GeomPoint *p = dynamic_cast<const Part::GeomPoint*>(geo);
if (PosId == start || PosId == mid || PosId == end)
return p->getPoint();
} else if (geo->getTypeId() == Part::GeomLineSegment::getClassTypeId()) {
const Part::GeomLineSegment *lineSeg = dynamic_cast<const Part::GeomLineSegment*>(geo);
if (PosId == start)
return lineSeg->getStartPoint();

View File

@ -14,8 +14,8 @@
height="64px"
id="svg2726"
sodipodi:version="0.32"
inkscape:version="0.48.1 r9760"
sodipodi:docname="Sketcher_Point.svg"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="Sketcher_CreatePoint.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
version="1.1"
inkscape:export-filename="/home/yorik/Sources/FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreatePoint.svg.png"
@ -87,6 +87,17 @@
id="radialGradient3888"
xlink:href="#linearGradient3144-3"
inkscape:collect="always" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3144"
id="radialGradient3767"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1,0,0,0.6985294,0,202.82863)"
cx="225.26402"
cy="672.79736"
fx="225.26402"
fy="672.79736"
r="34.345188" />
</defs>
<sodipodi:namedview
id="base"
@ -96,17 +107,17 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="3.8890873"
inkscape:cx="18.496032"
inkscape:cx="33.923816"
inkscape:cy="23.749836"
inkscape:current-layer="g4289"
showgrid="true"
inkscape:document-units="px"
inkscape:grid-bbox="true"
inkscape:window-width="1280"
inkscape:window-height="756"
inkscape:window-x="0"
inkscape:window-y="22"
inkscape:window-maximized="1" />
inkscape:window-width="657"
inkscape:window-height="716"
inkscape:window-x="710"
inkscape:window-y="24"
inkscape:window-maximized="0" />
<metadata
id="metadata2731">
<rdf:RDF>
@ -115,7 +126,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@ -133,35 +144,29 @@
sodipodi:cy="655.2193"
sodipodi:cx="197.14285"
id="path3162-2"
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:5.80000019000000044;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;opacity:0.67000001"
style="opacity:0.67000002;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:5.09976673;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
sodipodi:type="arc"
transform="matrix(-2.047093,-0.04650869,0.04650869,-2.047093,549.55577,1983.2711)" />
<g
inkscape:export-ydpi="7.0721951"
inkscape:export-xdpi="7.0721951"
inkscape:export-filename="/home/yorik/Documents/Lab/Draft/icons/line.png"
transform="matrix(-2.047093,-0.04650867,0.04650867,-2.047093,528.32631,1950.9451)"
id="g3160">
<path
sodipodi:type="arc"
style="fill:#ff2100;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:5.80000019;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
id="path3162"
sodipodi:cx="197.14285"
sodipodi:cy="655.2193"
sodipodi:rx="48.57143"
sodipodi:ry="48.57143"
d="m 245.71428,655.2193 c 0,26.82526 -21.74617,48.57143 -48.57143,48.57143 -26.82526,0 -48.57143,-21.74617 -48.57143,-48.57143 0,-26.82526 21.74617,-48.57143 48.57143,-48.57143 26.82526,0 48.57143,21.74617 48.57143,48.57143 z" />
<path
sodipodi:type="arc"
style="fill:url(#radialGradient3850);fill-opacity:1;stroke:none"
id="path3164"
sodipodi:cx="225.26402"
sodipodi:cy="672.79736"
sodipodi:rx="34.345188"
sodipodi:ry="23.991123"
d="m 259.60921,672.79736 c 0,13.24993 -15.37686,23.99113 -34.34519,23.99113 -18.96832,0 -34.34519,-10.7412 -34.34519,-23.99113 0,-13.24993 15.37687,-23.99112 34.34519,-23.99112 18.96833,0 34.34519,10.74119 34.34519,23.99112 z"
transform="matrix(0.8513023,-0.5246754,0.5246754,0.8513023,-338.69692,214.19328)" />
</g>
transform="matrix(-1.135537,-0.02584694,0.0257987,-1.13766,378.69194,1376.1392)" />
<path
d="m 245.71428,655.2193 a 48.57143,48.57143 0 1 1 -97.14286,0 48.57143,48.57143 0 1 1 97.14286,0 z"
sodipodi:ry="48.57143"
sodipodi:rx="48.57143"
sodipodi:cy="655.2193"
sodipodi:cx="197.14285"
id="path3162"
style="fill:#ff2100;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:5.09976673;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
sodipodi:type="arc"
transform="matrix(-1.135537,-0.02584692,0.02579869,-1.13766,366.91582,1358.1743)" />
<path
transform="matrix(-0.9802212,0.57489869,-0.57382585,-0.98205382,757.04461,1123.2494)"
d="m 259.60921,672.79736 a 34.345188,23.991123 0 1 1 -68.69038,0 34.345188,23.991123 0 1 1 68.69038,0 z"
sodipodi:ry="23.991123"
sodipodi:rx="34.345188"
sodipodi:cy="672.79736"
sodipodi:cx="225.26402"
id="path3164"
style="fill:url(#radialGradient3767);fill-opacity:1;stroke:none"
sodipodi:type="arc" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB