Skip to content

Commit

Permalink
Merge branch 'master' into feature/misc-improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
sliptonic committed Aug 16, 2019
2 parents 1800f29 + 64b4bb0 commit 2cb77a2
Show file tree
Hide file tree
Showing 61 changed files with 15,237 additions and 3,907 deletions.
3 changes: 1 addition & 2 deletions src/Gui/View3DInventorViewer.h
Expand Up @@ -379,7 +379,7 @@ class GuiExport View3DInventorViewer : public Quarter::SoQTQuarterAdaptor, publi

enum eWinGestureTuneState{
ewgtsDisabled, //suppress tuning/re-tuning after errors
ewgtsNeedTuning, //gestures are to be retuned upon next event
ewgtsNeedTuning, //gestures are to be re-tuned upon next event
ewgtsTuned
};
eWinGestureTuneState winGestureTuneState;//See ViewerEventFilter::eventFilter function for explanation
Expand Down Expand Up @@ -458,4 +458,3 @@ class GuiExport View3DInventorViewer : public Quarter::SoQTQuarterAdaptor, publi
} // namespace Gui

#endif // GUI_VIEW3DINVENTORVIEWER_H

22 changes: 22 additions & 0 deletions src/Gui/View3DPy.cpp
Expand Up @@ -182,6 +182,7 @@ void View3DInventorPy::init_type()
add_varargs_method("getActiveObject", &View3DInventorPy::getActiveObject, "getActiveObject(name)\nreturns the active object for the given type");
add_varargs_method("getViewProvidersOfType", &View3DInventorPy::getViewProvidersOfType, "getViewProvidersOfType(name)\nreturns a list of view providers for the given type");
add_varargs_method("redraw", &View3DInventorPy::redraw, "redraw(): renders the scene on screen (useful for animations)");
add_varargs_method("setName",&View3DInventorPy::setName,"setName(str): sets a name to this viewer\nThe name sets the widget's windowTitle and appears on the viewer tab");

}

Expand Down Expand Up @@ -2451,3 +2452,24 @@ Py::Object View3DInventorPy::redraw(const Py::Tuple& args)
_view->getViewer()->redraw();
return Py::None();
}

Py::Object View3DInventorPy::setName(const Py::Tuple& args)
{
char* buffer;
if (!PyArg_ParseTuple(args.ptr(), "s", &buffer))
throw Py::Exception();

try {
_view->setWindowTitle(QString::fromUtf8(buffer));
return Py::None();
}
catch (const Base::Exception& e) {
throw Py::RuntimeError(e.what());
}
catch (const std::exception& e) {
throw Py::RuntimeError(e.what());
}
catch(...) {
throw Py::RuntimeError("Unknown C++ exception");
}
}
1 change: 1 addition & 0 deletions src/Gui/View3DPy.h
Expand Up @@ -129,6 +129,7 @@ class View3DInventorPy : public Py::PythonExtension<View3DInventorPy>
Py::Object getActiveObject(const Py::Tuple&);
Py::Object getViewProvidersOfType(const Py::Tuple&);
Py::Object redraw(const Py::Tuple&);
Py::Object setName(const Py::Tuple&);

private:
static void eventCallback(void * ud, SoEventCallback * n);
Expand Down
7 changes: 5 additions & 2 deletions src/Mod/AddonManager/Resources/AddonManager.qrc
Expand Up @@ -2,11 +2,12 @@
<qresource>
<file>icons/3D_Printing_Tools_workbench_icon.svg</file>
<file>icons/A2plus_workbench_icon.svg</file>
<file>icons/AirPlaneDesign_workbench-icon.svg</file>
<file>icons/AirPlaneDesign_workbench_icon.svg</file>
<file>icons/ArchTextures_workbench_icon.svg</file>
<file>icons/BIMBots_workbench_icon.svg</file>
<file>icons/BIM_workbench_icon.svg</file>
<file>icons/BOLTSFC_workbench_icon.svg</file>
<file>icons/CADExchanger_workbench_icon.svg</file>
<file>icons/cadquery_module_workbench_icon.svg</file>
<file>icons/CfdOF_workbench_icon.svg</file>
<file>icons/CurvedShapes_workbench_icon.svg</file>
Expand All @@ -24,19 +25,21 @@
<file>icons/InventorLoader_workbench_icon.svg</file>
<file>icons/kicadStepUpMod_workbench_icon.svg</file>
<file>icons/lattice2_workbench_icon.svg</file>
<file>icons/LCInterlocking_workbench_icon.svg</file>
<file>icons/LCInterlocking_workbench_icon.svg</file>
<file>icons/Lithophane_workbench_icon.svg</file>
<file>icons/Manipulator_workbench_icon.svg</file>
<file>icons/MOOC_workbench_icon.svg</file>
<file>icons/Part-o-magic_workbench_icon.svg</file>
<file>icons/Plot_workbench_icon.svg</file>
<file>icons/pyrate_workbench_icon.svg</file>
<file>icons/Reinforcement_workbench_icon.svg</file>
<file>icons/Reporting_workbench_icon.svg</file>
<file>icons/Render_workbench_icon.svg</file>
<file>icons/sheetmetal_workbench_icon.svg</file>
<file>icons/slic3r-tools_workbench_icon.svg</file>
<file>icons/Ship_workbench_icon.svg</file>
<file>icons/timber_workbench_icon.svg</file>
<file>icons/ThreadProfile_workbench_icon.svg</file>
<file>icons/yaml-workspace_workbench_icon.svg</file>
<file>translations/AddonManager_af.qm</file>
<file>translations/AddonManager_ar.qm</file>
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
169 changes: 169 additions & 0 deletions src/Mod/AddonManager/Resources/icons/Reinforcement_workbench_icon.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions src/Mod/AddonManager/addonmanager_workers.py
Expand Up @@ -91,10 +91,11 @@ def run(self):
if url:
addondir = moddir + os.sep + name
#print ("found:",name," at ",url)
if not os.path.exists(addondir):
state = 0
else:
if os.path.exists(addondir) and os.listdir(addondir):
# make sure the folder exists and it contains files!
state = 1
else:
state = 0
repos.append([name,url,state])
# querying custom addons
customaddons = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Addons").GetString("CustomRepositories","").split("\n")
Expand Down
1 change: 1 addition & 0 deletions src/Mod/Arch/Arch.py
Expand Up @@ -43,6 +43,7 @@
from ArchWall import *
from ArchFloor import *
from ArchFence import *
from ArchProject import *
from ArchSite import *
from ArchBuilding import *
from ArchStructure import *
Expand Down
44 changes: 29 additions & 15 deletions src/Mod/Arch/ArchBuildingPart.py
Expand Up @@ -313,7 +313,7 @@ def Activated(self):



class BuildingPart:
class BuildingPart(ArchIFC.IfcProduct):


"The BuildingPart object"
Expand All @@ -326,7 +326,7 @@ def __init__(self,obj):
self.setProperties(obj)

def setProperties(self,obj):
ArchIFC.setProperties(obj)
ArchIFC.IfcProduct.setProperties(self, obj)

pl = obj.PropertiesList
if not "Height" in pl:
Expand Down Expand Up @@ -366,7 +366,7 @@ def onBeforeChange(self,obj,prop):

def onChanged(self,obj,prop):

ArchIFC.onChanged(obj, prop)
ArchIFC.IfcProduct.onChanged(self, obj, prop)

if prop == "Height":
for child in obj.Group:
Expand Down Expand Up @@ -483,28 +483,42 @@ def setProperties(self,vobj):
vobj.ShowLevel = True
if not "ShowUnit" in pl:
vobj.addProperty("App::PropertyBool","ShowUnit","BuildingPart",QT_TRANSLATE_NOOP("App::Property","If true, show the unit on the level tag"))
if not "SetWorkingPlane" in pl:
vobj.addProperty("App::PropertyBool","SetWorkingPlane","BuildingPart",QT_TRANSLATE_NOOP("App::Property","If true, when activated, the working plane will automatically adapt to this level"))
vobj.SetWorkingPlane = True
if not "OriginOffset" in pl:
vobj.addProperty("App::PropertyBool","OriginOffset","BuildingPart",QT_TRANSLATE_NOOP("App::Property","If true, when activated, Display offset will affect the origin mark too"))
vobj.addProperty("App::PropertyBool","OriginOffset","BuildingPart",QT_TRANSLATE_NOOP("App::Property","If true, display offset will affect the origin mark too"))
if not "ShowLabel" in pl:
vobj.addProperty("App::PropertyBool","ShowLabel","BuildingPart",QT_TRANSLATE_NOOP("App::Property","If true, when activated, the object's label is displayed"))
vobj.addProperty("App::PropertyBool","ShowLabel","BuildingPart",QT_TRANSLATE_NOOP("App::Property","If true, the object's label is displayed"))
vobj.ShowLabel = True
if not "FontName" in pl:
vobj.addProperty("App::PropertyFont","FontName","BuildingPart",QT_TRANSLATE_NOOP("App::Property","The font to be used for texts"))
vobj.FontName = Draft.getParam("textfont","Arial")
if not "FontSize" in pl:
vobj.addProperty("App::PropertyLength","FontSize","BuildingPart",QT_TRANSLATE_NOOP("App::Property","The font size of texts"))
vobj.FontSize = Draft.getParam("textheight",2.0)
if not "ViewData" in pl:
vobj.addProperty("App::PropertyFloatList","ViewData","BuildingPart",QT_TRANSLATE_NOOP("App::Property","Camera position data associated with this object"))
if not "RestoreView" in pl:
vobj.addProperty("App::PropertyBool","RestoreView","BuildingPart",QT_TRANSLATE_NOOP("App::Property","If set, the view stored in this object will be restored on double-click"))
if not "DiffuseColor" in pl:
vobj.addProperty("App::PropertyColorList","DiffuseColor","BuildingPart",QT_TRANSLATE_NOOP("App::Property","The individual face colors"))

# Interaction properties
if not "SetWorkingPlane" in pl:
vobj.addProperty("App::PropertyBool","SetWorkingPlane","Interaction",QT_TRANSLATE_NOOP("App::Property","If true, when activated, the working plane will automatically adapt to this level"))
vobj.SetWorkingPlane = True
if not "AutoWorkingPlane" in pl:
vobj.addProperty("App::PropertyBool","AutoWorkingPlane","BuildingPart",QT_TRANSLATE_NOOP("App::Property","If set to True, the working plane will be kept on Auto mode"))
vobj.addProperty("App::PropertyBool","AutoWorkingPlane","Interaction",QT_TRANSLATE_NOOP("App::Property","If set to True, the working plane will be kept on Auto mode"))
if not "ViewData" in pl:
vobj.addProperty("App::PropertyFloatList","ViewData","Interaction",QT_TRANSLATE_NOOP("App::Property","Camera position data associated with this object"))
vobj.setEditorMode("ViewData",2)
if not "RestoreView" in pl:
vobj.addProperty("App::PropertyBool","RestoreView","Interaction",QT_TRANSLATE_NOOP("App::Property","If set, the view stored in this object will be restored on double-click"))
if not "DoubleClickActivates" in pl:
vobj.addProperty("App::PropertyBool","DoubleClickActivates","Interaction",QT_TRANSLATE_NOOP("App::Property","If True, double-clicking this object in the tree turns it active"))

# inventor saving
if not "SaveInventor" in pl:
vobj.addProperty("App::PropertyBool","SaveInventor","Interaction",QT_TRANSLATE_NOOP("App::Property","If this is enabled, the inventor representation of this object will be saved in the FreeCAD file, allowing to reference it in other file sin lightweight mode."))
if not "SavedInventor" in pl:
vobj.addProperty("App::PropertyFileIncluded","SavedInventor","Interaction",QT_TRANSLATE_NOOP("App::Property","A slot to save the inventor representation of this object, if enabled"))
vobj.setEditorMode("SavedInventor",2)

# children properties
if not "ChildrenOverride" in pl:
vobj.addProperty("App::PropertyBool","ChildrenOverride","Children",QT_TRANSLATE_NOOP("App::Property","If true, show the objects contained in this Building Part will adopt these line, color and transparency settings"))
if not "ChildrenLineWidth" in pl:
Expand All @@ -520,15 +534,15 @@ def setProperties(self,vobj):
vobj.ChildrenLineColor = (float((c>>24)&0xFF)/255.0,float((c>>16)&0xFF)/255.0,float((c>>8)&0xFF)/255.0,0.0)
if not "ChildrenTransparency" in pl:
vobj.addProperty("App::PropertyPercent","ChildrenTransparency","Children",QT_TRANSLATE_NOOP("App::Property","The transparency of child objects"))

# clip properties
if not "CutView" in pl:
vobj.addProperty("App::PropertyBool","CutView","Clip",QT_TRANSLATE_NOOP("App::Property","Cut the view above this level"))
if not "CutMargin" in pl:
vobj.addProperty("App::PropertyLength","CutMargin","Clip",QT_TRANSLATE_NOOP("App::Property","The distance between the level plane and the cut line"))
vobj.CutMargin = 1600
if not "AutoCutView" in pl:
vobj.addProperty("App::PropertyBool","AutoCutView","Clip",QT_TRANSLATE_NOOP("App::Property","Turn cutting on when activating this level"))
if not "SaveInventor" in pl:
vobj.addProperty("App::PropertyBool","SaveInventor","BuildingPart",QT_TRANSLATE_NOOP("App::Property","If this is enabled, the inventor representation of this object will be saved in the FreeCAD file, allowing to reference it in other file sin lightweight mode."))

def onDocumentRestored(self,vobj):

Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Arch/ArchCommands.py
Expand Up @@ -116,7 +116,7 @@ def addComponents(objectsList,host):
if not isinstance(objectsList,list):
objectsList = [objectsList]
hostType = Draft.getType(host)
if hostType in ["Floor","Building","Site","BuildingPart"]:
if hostType in ["Floor","Building","Site","Project","BuildingPart"]:
for o in objectsList:
host.addObject(o)
elif hostType in ["Wall","Structure","Window","Roof","Stairs","StructuralSystem","Panel","Component"]:
Expand Down Expand Up @@ -744,7 +744,7 @@ def pruneIncluded(objectslist,strict=False):
if obj.isDerivedFrom("Part::Feature"):
if not (Draft.getType(obj) in ["Window","Clone","Pipe","Rebar"]):
for parent in obj.InList:
if parent.isDerivedFrom("Part::Feature") and not (Draft.getType(parent) in ["Space","Facebinder","Window","Roof","Clone","Site"]):
if parent.isDerivedFrom("Part::Feature") and not (Draft.getType(parent) in ["Space","Facebinder","Window","Roof","Clone","Site","Project"]):
if not parent.isDerivedFrom("Part::Part2DObject"):
# don't consider 2D objects based on arch elements
if hasattr(parent,"Host") and (parent.Host == obj):
Expand Down

0 comments on commit 2cb77a2

Please sign in to comment.