Merge branch 'master' of ssh://free-cad.git.sourceforge.net/gitroot/free-cad/free-cad into sanguinariojoe-ship

This commit is contained in:
Jose Luis Cercós pita
2012-06-11 18:23:43 +02:00
19 changed files with 974 additions and 67 deletions

View File

@@ -148,26 +148,7 @@ class Snapper:
return None
# setup trackers if needed
v = Draft.get3DView()
if v in self.trackers[0]:
i = self.trackers[0].index(v)
self.grid = self.trackers[1][i]
self.tracker = self.trackers[2][i]
self.extLine = self.trackers[3][i]
self.radiusTracker = self.trackers[4][i]
else:
if Draft.getParam("grid"):
self.grid = DraftTrackers.gridTracker()
else:
self.grid = None
self.tracker = DraftTrackers.snapTracker()
self.extLine = DraftTrackers.lineTracker(dotted=True)
self.radiusTracker = DraftTrackers.radiusTracker()
self.trackers[0].append(v)
self.trackers[1].append(self.grid)
self.trackers[2].append(self.tracker)
self.trackers[3].append(self.extLine)
self.trackers[4].append(self.radiusTracker)
self.setTrackers()
# getting current snap Radius
self.radius = self.getScreenDist(Draft.getParam("snapRange"),screenpos)
@@ -175,10 +156,6 @@ class Snapper:
self.radiusTracker.update(self.radius)
self.radiusTracker.off()
# set the grid
if self.grid and (not self.forceGridOff):
self.grid.set()
# activate snap
oldActive = False
if Draft.getParam("alwaysSnap"):
@@ -362,6 +339,19 @@ class Snapper:
self.extLine.on()
self.setCursor(tsnap[1])
return tsnap[2],eline
else:
tsnap = self.snapToExtPerpendicular(last)
if tsnap:
if (tsnap[0].sub(point)).Length < self.radius:
if self.tracker:
self.tracker.setCoords(tsnap[2])
self.tracker.setMarker(self.mk[tsnap[1]])
self.tracker.on()
if self.extLine:
self.extLine.p2(tsnap[2])
self.extLine.on()
self.setCursor(tsnap[1])
return tsnap[2],eline
for o in [self.lastObj[1],self.lastObj[0]]:
if o:
@@ -541,6 +531,14 @@ class Snapper:
return None
return None
def snapToExtPerpendicular(self,last):
"returns a perpendicular X extension snap location"
if self.isEnabled("extension") and self.isEnabled("perpendicular"):
if last and self.extLine:
tmpEdge = Part.Line(self.extLine.p1(),self.extLine.p2()).toShape()
np = self.getPerpendicular(tmpEdge,last)
return [np,'perpendicular',np]
def snapToElines(self,e1,e2):
"returns a snap location at the infinite intersection of the given edges"
snaps = []
@@ -920,16 +918,31 @@ class Snapper:
mw.addToolBar(self.toolbar)
self.toolbar.show()
if FreeCADGui.ActiveDocument:
if not self.forceGridOff:
if not self.grid:
self.grid = DraftTrackers.gridTracker()
self.grid.set()
self.setTrackers()
def setGrid(self):
"sets the grid, if visible"
if self.grid and (not self.forceGridOff):
if self.grid.Visible:
self.grid.set()
def setTrackers(self):
v = Draft.get3DView()
if v in self.trackers[0]:
i = self.trackers[0].index(v)
self.grid = self.trackers[1][i]
self.tracker = self.trackers[2][i]
self.extLine = self.trackers[3][i]
self.radiusTracker = self.trackers[4][i]
else:
if Draft.getParam("grid"):
self.grid = DraftTrackers.gridTracker()
else:
self.grid = None
self.tracker = DraftTrackers.snapTracker()
self.extLine = DraftTrackers.lineTracker(dotted=True)
self.radiusTracker = DraftTrackers.radiusTracker()
self.trackers[0].append(v)
self.trackers[1].append(self.grid)
self.trackers[2].append(self.tracker)
self.trackers[3].append(self.extLine)
self.trackers[4].append(self.radiusTracker)
if not self.forceGridOff:
self.grid.set()
if not hasattr(FreeCADGui,"Snapper"):
FreeCADGui.Snapper = Snapper()

View File

@@ -212,7 +212,7 @@ Sweep::Sweep()
ADD_PROPERTY_TYPE(Spine,(0),"Sweep",App::Prop_None,"Path to sweep along");
ADD_PROPERTY_TYPE(Solid,(false),"Sweep",App::Prop_None,"Create solid");
ADD_PROPERTY_TYPE(Frenet,(false),"Sweep",App::Prop_None,"Frenet");
ADD_PROPERTY_TYPE(Transition,(long(0)),"Sweep",App::Prop_None,"Transition mode");
ADD_PROPERTY_TYPE(Transition,(long(1)),"Sweep",App::Prop_None,"Transition mode");
Transition.setEnums(TransitionEnums);
}
@@ -244,16 +244,19 @@ App::DocumentObjectExecReturn *Sweep::execute(void)
if (!(spine && spine->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId())))
return new App::DocumentObjectExecReturn("No spine linked.");
const std::vector<std::string>& subedge = Spine.getSubValues();
if (subedge.size() != 1)
return new App::DocumentObjectExecReturn("Not exactly one sub-shape linked.");
TopoDS_Shape path;
const Part::TopoShape& shape = static_cast<Part::Feature*>(spine)->Shape.getValue();
if (!shape._Shape.IsNull()) {
if (!subedge[0].empty()) {
path = shape.getSubShape(subedge[0].c_str());
try {
BRepBuilderAPI_MakeWire mkWire;
for (std::vector<std::string>::const_iterator it = subedge.begin(); it != subedge.end(); ++it) {
TopoDS_Shape subshape = shape.getSubShape(it->c_str());
mkWire.Add(TopoDS::Edge(subshape));
}
path = mkWire.Wire();
}
else {
catch (Standard_Failure) {
if (shape._Shape.ShapeType() == TopAbs_EDGE)
path = shape._Shape;
else if (shape._Shape.ShapeType() == TopAbs_WIRE)
@@ -273,8 +276,12 @@ App::DocumentObjectExecReturn *Sweep::execute(void)
const TopoDS_Shape& shape = static_cast<Part::Feature*>(*it)->Shape.getValue();
if (shape.IsNull())
return new App::DocumentObjectExecReturn("Linked shape is invalid.");
// There is a weird behaviour of BRepOffsetAPI_MakePipeShell when trying to add the wire as is.
// If we re-create the wire then everything works fine.
// https://sourceforge.net/apps/phpbb/free-cad/viewtopic.php?f=10&t=2673&sid=fbcd2ff4589f0b2f79ed899b0b990648#p20268
if (shape.ShapeType() == TopAbs_WIRE) {
profiles.Append(shape);
BRepBuilderAPI_MakeWire mkWire(TopoDS::Wire(shape));
profiles.Append(mkWire.Wire());
}
else if (shape.ShapeType() == TopAbs_EDGE) {
BRepBuilderAPI_MakeWire mkWire(TopoDS::Edge(shape));

View File

@@ -442,7 +442,6 @@ CmdPartImport::CmdPartImport()
sPixmap = "Part_Import";
}
void CmdPartImport::activated(int iMsg)
{
QStringList filter;
@@ -471,6 +470,11 @@ void CmdPartImport::activated(int iMsg)
doCommand(Doc, "Part.insert(\"%s\",\"%s\")", (const char*)fn.toUtf8(), pDoc->getName());
}
commitCommand();
std::list<Gui::MDIView*> views = getActiveGuiDocument()->getMDIViewsOfType(Gui::View3DInventor::getClassTypeId());
for (std::list<Gui::MDIView*>::iterator it = views.begin(); it != views.end(); ++it) {
(*it)->viewAll();
}
}
}
@@ -947,6 +951,7 @@ CmdPartLoft::CmdPartLoft()
sToolTipText = QT_TR_NOOP("Advanced utility to lofts");
sWhatsThis = sToolTipText;
sStatusTip = sToolTipText;
sPixmap = "Part_Loft";
}
void CmdPartLoft::activated(int iMsg)
@@ -972,6 +977,7 @@ CmdPartSweep::CmdPartSweep()
sToolTipText = QT_TR_NOOP("Advanced utility to sweep");
sWhatsThis = sToolTipText;
sStatusTip = sToolTipText;
sPixmap = "Part_Sweep";
}
void CmdPartSweep::activated(int iMsg)

View File

@@ -200,12 +200,14 @@ EXTRA_DIST = \
Resources/icons/Part_Fillet.svg \
Resources/icons/Part_Revolve.svg \
Resources/icons/Part_Import.svg \
Resources/icons/Part_Loft.svg \
Resources/icons/Part_Mirror.svg \
Resources/icons/Part_MirrorPNG.png \
Resources/icons/Part_RuledSurface.svg \
Resources/icons/Part_Shapebuilder.png \
Resources/icons/Part_Shapebuilder.svg \
Resources/icons/Part_ShapeInfo.svg \
Resources/icons/Part_Sweep.svg \
Resources/icons/Tree_Part.svg \
Resources/icons/preferences-part_design.svg \
Resources/icons/PartFeature.svg \

View File

@@ -16,6 +16,7 @@
<file>icons/Part_Fillet.svg</file>
<file>icons/Part_Fuse.svg</file>
<file>icons/Part_Import.svg</file>
<file>icons/Part_Loft.svg</file>
<file>icons/Part_Mirror.svg</file>
<file>icons/Part_MirrorPNG.png</file>
<file>icons/Part_Revolve.svg</file>
@@ -24,6 +25,7 @@
<file>icons/Part_Shapebuilder.png</file>
<file>icons/Part_ShapeInfo.svg</file>
<file>icons/Part_Sphere.svg</file>
<file>icons/Part_Sweep.svg</file>
<file>icons/Part_Torus.svg</file>
<file>icons/preferences-part_design.svg</file>
<file>icons/Tree_Part.svg</file>

View File

@@ -0,0 +1,280 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64px"
height="64px"
id="svg3364"
sodipodi:version="0.32"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="Part_Loft.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
version="1.1">
<defs
id="defs3366">
<linearGradient
id="linearGradient3864">
<stop
id="stop3866"
offset="0"
style="stop-color:#71b2f8;stop-opacity:1;" />
<stop
id="stop3868"
offset="1"
style="stop-color:#002795;stop-opacity:1;" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3864"
id="radialGradient2571"
gradientUnits="userSpaceOnUse"
cx="342.58258"
cy="27.256668"
fx="342.58258"
fy="27.256668"
r="19.571428"
gradientTransform="matrix(1.6258409,0.5434973,-8.8819886e-2,0.2656996,-215.02413,-170.90186)" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3593"
id="radialGradient3352"
gradientUnits="userSpaceOnUse"
cx="345.28433"
cy="15.560534"
fx="345.28433"
fy="15.560534"
r="19.571428"
gradientTransform="translate(-0.1767767,-2.6516504)" />
<linearGradient
id="linearGradient3593">
<stop
style="stop-color:#c8e0f9;stop-opacity:1;"
offset="0"
id="stop3595" />
<stop
style="stop-color:#637dca;stop-opacity:1;"
offset="1"
id="stop3597" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3593"
id="radialGradient3354"
gradientUnits="userSpaceOnUse"
cx="330.63791"
cy="39.962704"
fx="330.63791"
fy="39.962704"
r="19.571428"
gradientTransform="translate(-0.1767767,-2.6516504)" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 32 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="64 : 32 : 1"
inkscape:persp3d-origin="32 : 21.333333 : 1"
id="perspective3372" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3864"
id="radialGradient3369"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.6258409,0.5434973,-8.8819886e-2,0.2656996,-461.81066,-173.06271)"
cx="342.58258"
cy="27.256668"
fx="342.58258"
fy="27.256668"
r="19.571428" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3593"
id="radialGradient3372"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.0012324,0,0,0.9421773,-327.50313,-4.3316646)"
cx="345.28433"
cy="15.560534"
fx="345.28433"
fy="15.560534"
r="19.571428" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3593"
id="radialGradient3375"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.0012324,0,0,0.9421773,-287.81791,-28.143054)"
cx="330.63791"
cy="39.962704"
fx="330.63791"
fy="39.962704"
r="19.571428" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3864"
id="radialGradient3380"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.9829174,1.3240854,-1.2330051,0.8105158,-131.04134,-483.74563)"
cx="320.44025"
cy="113.23357"
fx="320.44025"
fy="113.23357"
r="19.571428" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3864"
id="linearGradient3914"
x1="6.94525"
y1="36.838673"
x2="48.691113"
y2="36.838673"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.0012324,0,0,0.9421773,-4.8699606,-2.3863162)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3864"
id="linearGradient3792"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.0012324,0,0,0.9421773,-4.8699606,-2.3863162)"
x1="6.8300767"
y1="34.146042"
x2="48.691113"
y2="36.838673" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3864"
id="radialGradient3812"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.0012324,0,0,0.9421773,-287.81791,-28.143054)"
cx="330.63791"
cy="39.962704"
fx="330.63791"
fy="39.962704"
r="19.571428" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3593"
id="radialGradient3814"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.0012324,0,0,0.9421773,-327.50313,-4.3316646)"
cx="345.28433"
cy="15.560534"
fx="345.28433"
fy="15.560534"
r="19.571428" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3864"
id="radialGradient3816"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.9829174,1.3240854,-1.2330051,0.8105158,-131.04134,-483.74563)"
cx="320.44025"
cy="113.23357"
fx="320.44025"
fy="113.23357"
r="19.571428" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3864"
id="linearGradient3828"
x1="20.383333"
y1="32.634235"
x2="52.726578"
y2="32.634235"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3864-1"
id="linearGradient3828-2"
x1="20.383333"
y1="32.634235"
x2="52.726578"
y2="32.634235"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient3864-1">
<stop
id="stop3866-6"
offset="0"
style="stop-color:#71b2f8;stop-opacity:1;" />
<stop
id="stop3868-7"
offset="1"
style="stop-color:#002795;stop-opacity:1;" />
</linearGradient>
<linearGradient
gradientTransform="translate(-20.410811,9.5711709)"
y2="32.634235"
x2="52.726578"
y1="32.634235"
x1="20.383333"
gradientUnits="userSpaceOnUse"
id="linearGradient3845"
xlink:href="#linearGradient3864-1"
inkscape:collect="always" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="8.671875"
inkscape:cx="12.742342"
inkscape:cy="32"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:document-units="px"
inkscape:grid-bbox="true"
inkscape:window-width="1276"
inkscape:window-height="758"
inkscape:window-x="0"
inkscape:window-y="19"
inkscape:window-maximized="0" />
<metadata
id="metadata3369">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<path
style="fill:url(#linearGradient3828);fill-opacity:1;stroke:#4b4dba;stroke-width:1.89999998;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 21.333333,38.054054 0,13.722523 28.82883,-7.956757 0.461261,-29.405405 z"
id="path3820"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc" />
<path
style="fill:url(#linearGradient3845);fill-opacity:1;stroke:#4b4dba;stroke-width:1.89999998;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="M 12.108108,34.825225 20.526126,38.054054 50.392793,14.068468 23.985586,5.9963967 z"
id="path3820-1"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc" />
<path
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc"
id="path3918-3"
d="m 12.242668,35.119547 8.794991,3.372715 0.04859,13.032456 C 17.83723,50.533286 15.209236,49.226417 12.558166,47.931269 z"
style="fill:none;stroke:#ff0900;stroke-width:2.21737432;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
<path
style="fill:none;stroke:#ff0900;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
d="m 24.100901,6.227027 26.176576,8.187387 0,29.290091"
id="path3864"
inkscape:connector-curvature="0" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 9.3 KiB

View File

@@ -0,0 +1,232 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64px"
height="64px"
id="svg3364"
sodipodi:version="0.32"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="Part_Sweep_red_thickened_path.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
version="1.1">
<defs
id="defs3366">
<linearGradient
id="linearGradient4513"
osb:paint="solid">
<stop
style="stop-color:#ff0900;stop-opacity:1;"
offset="0"
id="stop4515" />
</linearGradient>
<marker
inkscape:stockid="Arrow2Lstart"
orient="auto"
refY="0.0"
refX="0.0"
id="Arrow2Lstart"
style="overflow:visible">
<path
id="path3909"
style="fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
transform="scale(1.1) translate(1,0)" />
</marker>
<linearGradient
id="linearGradient3864"
osb:paint="gradient">
<stop
id="stop3866"
offset="0"
style="stop-color:#71b2f8;stop-opacity:0.44347826;" />
<stop
id="stop3868"
offset="1"
style="stop-color:#002795;stop-opacity:1;" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3864"
id="radialGradient2571"
gradientUnits="userSpaceOnUse"
cx="342.58258"
cy="27.256668"
fx="342.58258"
fy="27.256668"
r="19.571428"
gradientTransform="matrix(1.6258409,0.5434973,-8.8819886e-2,0.2656996,-215.02413,-170.90186)" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3593"
id="radialGradient3352"
gradientUnits="userSpaceOnUse"
cx="345.28433"
cy="15.560534"
fx="345.28433"
fy="15.560534"
r="19.571428"
gradientTransform="translate(-0.1767767,-2.6516504)" />
<linearGradient
id="linearGradient3593">
<stop
style="stop-color:#c8e0f9;stop-opacity:1;"
offset="0"
id="stop3595" />
<stop
style="stop-color:#637dca;stop-opacity:1;"
offset="1"
id="stop3597" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3593"
id="radialGradient3354"
gradientUnits="userSpaceOnUse"
cx="330.63791"
cy="39.962704"
fx="330.63791"
fy="39.962704"
r="19.571428"
gradientTransform="translate(-0.1767767,-2.6516504)" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 32 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="64 : 32 : 1"
inkscape:persp3d-origin="32 : 21.333333 : 1"
id="perspective3372" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3864"
id="radialGradient3369"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.6258409,0.5434973,-8.8819886e-2,0.2656996,-461.81066,-173.06271)"
cx="342.58258"
cy="27.256668"
fx="342.58258"
fy="27.256668"
r="19.571428" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3864"
id="linearGradient3828"
x1="20.383333"
y1="32.634235"
x2="52.726578"
y2="32.634235"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.1630793,0,0,1.1396343,-2.5165983,3.4151415)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3864-1"
id="linearGradient3828-2"
x1="20.383333"
y1="32.634235"
x2="52.726578"
y2="32.634235"
gradientUnits="userSpaceOnUse" />
<linearGradient
id="linearGradient3864-1">
<stop
id="stop3866-6"
offset="0"
style="stop-color:#71b2f8;stop-opacity:1;" />
<stop
id="stop3868-7"
offset="1"
style="stop-color:#002795;stop-opacity:1;" />
</linearGradient>
<linearGradient
gradientTransform="matrix(1.1630793,0,0,1.1396343,-26.255988,14.322778)"
y2="32.634235"
x2="52.726578"
y1="32.634235"
x1="20.383333"
gradientUnits="userSpaceOnUse"
id="linearGradient3845"
xlink:href="#linearGradient3864-1"
inkscape:collect="always" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="9.0078335"
inkscape:cx="-3.106479"
inkscape:cy="32.608572"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:document-units="px"
inkscape:grid-bbox="true"
inkscape:window-width="1102"
inkscape:window-height="758"
inkscape:window-x="29"
inkscape:window-y="33"
inkscape:window-maximized="0" />
<metadata
id="metadata3369">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<path
style="opacity:0.85;fill:url(#linearGradient3845);fill-opacity:1;stroke:#4b4dba;stroke-width:2.18746471;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 11.201557,37.130882 c 0.252178,-0.07113 10.905391,3.84229 14.378208,5.296596 C 45.31682,39.628785 46.26631,22.510259 52.095791,10.58178 L 28.627124,6.652762 c -1.621192,11.174906 -3.334532,23.98441 -17.425567,30.47812 z"
id="path3820-1"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc" />
<path
style="fill:none;stroke:#ff0900;stroke-width:2.55285668;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
d="m 11.414852,53.329345 c -0.162971,-6.91565 0.10332,-4.922865 -0.144914,-16.265896"
id="path3918-3"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#ff0900;stroke-width:6;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:30.29999923999999822;stroke-opacity:1;stroke-dasharray:18, 6;stroke-dashoffset:0;marker-start:none"
d="M 0.88417837,48.039022 C 11.330775,48.513224 32.686249,53.004323 42.745293,41.872435 51.278061,32.429606 53.4974,19.758654 61.595219,2.2398862"
id="path3885"
inkscape:connector-curvature="0"
sodipodi:nodetypes="csc" />
<path
style="fill:url(#linearGradient3828);fill-opacity:1;fill-rule:nonzero;stroke:#4b4dba;stroke-width:2.18746471;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 26.040147,42.43608 0.226329,18.152407 C 44.9786,59.94313 58.160467,44.639618 60.629125,31.212185 L 51.67214,11.437294 C 43.6375,30.278349 43.168055,38.742321 26.040147,42.43608 z"
id="path3820"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccc" />
<path
style="fill:none;stroke:#ff0c00;stroke-width:2.87824273;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 28.798855,6.2907134 23.256841,4.5887046 8.726353,20.099536"
id="path3864"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccc" />
<path
style="fill:none;stroke:#ff0900;stroke-width:2.55299997;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
d="m 11.380951,37.174463 14.558836,5.397865 0.389553,17.96064 C 22.550473,59.403098 14.498258,55.027369 11.414853,53.551374"
id="path3918-3-1"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 8.7 KiB

View File

@@ -32,6 +32,7 @@
#include "TaskLoft.h"
#include <Gui/Application.h>
#include <Gui/BitmapFactory.h>
#include <Gui/Document.h>
#include <Gui/Selection.h>
#include <Gui/ViewProvider.h>
@@ -198,7 +199,8 @@ TaskLoft::TaskLoft()
{
widget = new LoftWidget();
taskbox = new Gui::TaskView::TaskBox(
QPixmap(), widget->windowTitle(), true, 0);
Gui::BitmapFactory().pixmap("Part_Loft"),
widget->windowTitle(), true, 0);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
}

View File

@@ -32,6 +32,7 @@
#include "TaskSweep.h"
#include <Gui/Application.h>
#include <Gui/BitmapFactory.h>
#include <Gui/Document.h>
#include <Gui/Selection.h>
#include <Gui/SelectionFilter.h>
@@ -117,7 +118,7 @@ void SweepWidget::findShapes()
bool SweepWidget::accept()
{
Gui::SelectionFilter edgeFilter ("SELECT Part::Feature SUBELEMENT Edge COUNT 1");
Gui::SelectionFilter edgeFilter ("SELECT Part::Feature SUBELEMENT Edge COUNT 1..");
Gui::SelectionFilter partFilter ("SELECT Part::Feature COUNT 1");
bool matchEdge = edgeFilter.match();
bool matchPart = partFilter.match();
@@ -127,16 +128,14 @@ bool SweepWidget::accept()
}
// get the selected object
std::string objectName, subShape;
std::string selection;
if (matchEdge) {
const std::vector<Gui::SelectionObject>& result = edgeFilter.Result[0];
const std::vector<std::string>& edges = result[0].getSubNames();
objectName = result.front().getFeatName();
subShape = edges.front();
selection = result.front().getAsPropertyLinkSubString();
}
else {
const std::vector<Gui::SelectionObject>& result = partFilter.Result[0];
objectName = result.front().getFeatName();
selection = result.front().getAsPropertyLinkSubString();
}
QString list, solid, frenet;
@@ -166,15 +165,17 @@ bool SweepWidget::accept()
try {
QString cmd;
cmd = QString::fromAscii(
"App.getDocument('%6').addObject('Part::Sweep','Sweep')\n"
"App.getDocument('%6').ActiveObject.Sections=[%1]\n"
"App.getDocument('%6').ActiveObject.Spine=(FreeCAD.ActiveDocument.%2,['%3'])\n"
"App.getDocument('%6').ActiveObject.Solid=%4\n"
"App.getDocument('%6').ActiveObject.Frenet=%5\n"
"App.getDocument('%5').addObject('Part::Sweep','Sweep')\n"
"App.getDocument('%5').ActiveObject.Sections=[%1]\n"
"App.getDocument('%5').ActiveObject.Spine=%2\n"
"App.getDocument('%5').ActiveObject.Solid=%3\n"
"App.getDocument('%5').ActiveObject.Frenet=%4\n"
)
.arg(list).arg(QLatin1String(objectName.c_str()))
.arg(QLatin1String(subShape.c_str()))
.arg(solid).arg(frenet).arg(QString::fromAscii(d->document.c_str()));
.arg(list)
.arg(QLatin1String(selection.c_str()))
.arg(solid)
.arg(frenet)
.arg(QString::fromAscii(d->document.c_str()));
Gui::Document* doc = Gui::Application::Instance->getDocument(d->document.c_str());
if (!doc) throw Base::Exception("Document doesn't exist anymore");
@@ -225,7 +226,8 @@ TaskSweep::TaskSweep()
{
widget = new SweepWidget();
taskbox = new Gui::TaskView::TaskBox(
QPixmap(), widget->windowTitle(), true, 0);
Gui::BitmapFactory().pixmap("Part_Sweep"),
widget->windowTitle(), true, 0);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
}

View File

@@ -54,6 +54,8 @@ SET(StartPage_Resources
StartPage/PartDesignExample.png
StartPage/ArchExample.png
StartPage/web.png
StartPage/blank.png
StartPage/complete.jpg
)
add_library(StartGui SHARED ${StartGui_SRCS})

View File

@@ -24,6 +24,8 @@ SET(StartPage_DATA
PartDesignExample.png
ArchExample.png
web.png
blank.png
complete.jpg
)
INSTALL(FILES ${StartPage_SRCS}

View File

@@ -28,7 +28,9 @@ data_DATA = \
Complete.png \
PartDesignExample.png \
ArchExample.png \
web.png
web.png \
blank.png \
complete.jpg
EXTRA_DIST = \
$(data_DATA) $(python_DATA)

View File

@@ -309,10 +309,10 @@ def getWebExamples():
def getExamples():
return """
<ul>
<li><a href="LoadSchenkel.py">""" + text10 + """</a></li>
<li><a href="LoadPartDesignExample.py">""" + text11 + """</a></li>
<li><a href="LoadDrawingExample.py">""" + text12 + """</a></li>
<li><a href="LoadRobotExample.py">""" + text13 + """</a></li>
<li><img src="FreeCAD.png" style="width: 16px">&nbsp;<a href="LoadSchenkel.py">""" + text10 + """</a></li>
<li><img src="FreeCAD.png" style="width: 16px">&nbsp;<a href="LoadPartDesignExample.py">""" + text11 + """</a></li>
<li><img src="FreeCAD.png" style="width: 16px">&nbsp;<a href="LoadDrawingExample.py">""" + text12 + """</a></li>
<li><img src="FreeCAD.png" style="width: 16px">&nbsp;<a href="LoadRobotExample.py">""" + text13 + """</a></li>
</ul>"""
def getLinks():
@@ -366,7 +366,7 @@ def getWorkbenches():
<li><img src="Complete.png">&nbsp;
<a onMouseover="show('<h3>""" + text30 +"""</h3> \
<p>This is the <b>""" + text31 + """</b>, \
""" + text32 + """</p>')"
""" + text32 + """</p><img src=complete.jpg>')"
onMouseout="show('')"
href="DefaultWorkbench.py">""" + text31 + """</a>
</li>
@@ -399,7 +399,7 @@ def getInfo(filename):
html += text35 + " " + getLocalTime(s.st_mtime) + "<br/>"
html += "<span>" + text36 + " " + filename + "</span></p>"
# get additional info from fcstd files
if os.path.splitext(filename)[1] in [".fcstd",".FcStd"]:
if os.path.splitext(filename)[1].upper() in [".FCSTD"]:
zfile=zipfile.ZipFile(filename)
files=zfile.namelist()
# check for meta-file if it's really a FreeCAD document
@@ -429,7 +429,12 @@ def getRecentFiles():
if i < ct:
mr = rf.GetString("MRU%d" % (i))
fn = os.path.basename(mr)
html += '<li><a '
html += '<li>'
if mr[-5:].upper() == "FCSTD":
html += '<img src="FreeCAD.png" style="width: 16px">&nbsp;'
else:
html += '<img src="blank.png" style="width: 16px">&nbsp;'
html += '<a '
html += 'onMouseover="show(\''+getInfo(mr)+'\')" '
html += 'onMouseout="show(\'\')" '
html += 'href="LoadMRU'+str(i)+'.py">'

BIN
src/Mod/Start/StartPage/blank.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB