Skip to content

Commit

Permalink
Merge branch 'master' into bugfix/path-length
Browse files Browse the repository at this point in the history
  • Loading branch information
mlampert committed Jan 18, 2020
2 parents 8ce4692 + d62eda5 commit 0788ce1
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 19 deletions.
1 change: 1 addition & 0 deletions src/Gui/DlgGeneralImp.cpp
Expand Up @@ -223,6 +223,7 @@ void DlgGeneralImp::loadSettings()

int index = 1;
TStringMap list = Translator::instance()->supportedLocales();
ui->Languages->clear();
ui->Languages->addItem(QString::fromLatin1("English"), QByteArray("English"));
for (TStringMap::iterator it = list.begin(); it != list.end(); ++it, index++) {
QByteArray lang = it->first.c_str();
Expand Down
6 changes: 3 additions & 3 deletions src/Gui/GestureNavigationStyle.cpp
Expand Up @@ -324,16 +324,16 @@ class NS::IdleState : public sc::state<NS::IdleState, NS::NaviMachine>
bool press = (kbev->getState() == SoKeyboardEvent::DOWN);
switch (kbev->getKey()) {
case SoKeyboardEvent::H:
if (press)
if (!press)
ns.onSetRotationCenter(kbev->getPosition());
break;
case SoKeyboardEvent::PAGE_UP:
if(press){
if(!press){
ns.doZoom(ns.viewer->getSoRenderManager()->getCamera(), true, posn);
}
break;
case SoKeyboardEvent::PAGE_DOWN:
if(press){
if(!press){
ns.doZoom(ns.viewer->getSoRenderManager()->getCamera(), false, posn);
}
break;
Expand Down
25 changes: 25 additions & 0 deletions src/Gui/ManualAlignment.cpp
Expand Up @@ -244,6 +244,21 @@ int AlignmentGroup::count() const
return this->_views.size();
}

Base::BoundBox3d AlignmentGroup::getBoundingBox() const
{
Base::BoundBox3d box;
std::vector<Gui::ViewProviderDocumentObject*>::const_iterator it;
for (it = this->_views.begin(); it != this->_views.end(); ++it) {
if ((*it)->isDerivedFrom(Gui::ViewProviderGeometryObject::getClassTypeId())) {
App::GeoFeature* geo = static_cast<App::GeoFeature*>((*it)->getObject());
const App::PropertyComplexGeoData* prop = geo->getPropertyOfGeometry();
if (prop)
box.Add(prop->getBoundingBox());
}
}
return box;
}

// ------------------------------------------------------------------

MovableGroup::MovableGroup()
Expand Down Expand Up @@ -334,6 +349,16 @@ const MovableGroup& MovableGroupModel::getGroup(int i) const
return this->_groups[i];
}

Base::BoundBox3d MovableGroupModel::getBoundingBox() const
{
Base::BoundBox3d box;
std::vector<MovableGroup>::const_iterator it;
for (it = this->_groups.begin(); it != this->_groups.end(); ++it) {
box.Add(it->getBoundingBox());
}
return box;
}

// ------------------------------------------------------------------

namespace Gui {
Expand Down
6 changes: 6 additions & 0 deletions src/Gui/ManualAlignment.h
Expand Up @@ -25,6 +25,7 @@
#define GUI_MANUALALIGNMENT_H

#include <QPointer>
#include <Base/BoundBox.h>
#include <Base/Placement.h>
#include <Base/Vector3D.h>
#include <Gui/Application.h>
Expand Down Expand Up @@ -123,6 +124,10 @@ class GuiExport AlignmentGroup
* Return the number of added views.
*/
int count() const;
/**
* Get the overall bounding box of all views.
*/
Base::BoundBox3d getBoundingBox() const;

protected:
std::vector<PickedPoint> _pickedPoints;
Expand Down Expand Up @@ -170,6 +175,7 @@ class GuiExport MovableGroupModel
bool isEmpty() const;
int count() const;
const MovableGroup& getGroup(int i) const;
Base::BoundBox3d getBoundingBox() const;

protected:
void removeActiveGroup();
Expand Down
27 changes: 17 additions & 10 deletions src/Mod/Fem/femtest/app/test_ccxtools.py
Expand Up @@ -549,24 +549,31 @@ def test_5_Flow1D_thermomech_analysis(
def test_6_contact_shell_shell(
self
):
test_name = "contact shell shell analysis test"
base_name = "contact_shell_shell"
test_dir = "FEM_ccx_contact_shell_shell"
# set up the example
from femexamples import contact_shell_shell as shellcontact
shellcontact.setup(self.active_doc, "ccxtools")

# test input file writing
self.input_file_writing_test(
test_name="contact shell shell analysis test",
base_name="contact_shell_shell",
test_dir="FEM_ccx_contact_shell_shell",
)

# ********************************************************************************************
def input_file_writing_test(
self,
test_name,
base_name,
test_dir
):
fcc_print(
"\n--------------- "
"Start of FEM ccxtools {}"
"---------------"
.format(test_name)
)

# set up the example
from femexamples import contact_shell_shell as shellcontact
shellcontact.setup(self.active_doc, "ccxtools")

# code from here is independent, TODO put in separate def
# adding more inp file tests would be very simple ...
# set up analysis
analysis = self.active_doc.Analysis
solver_object = self.active_doc.CalculiXccxTools
analysis_dir = testtools.get_unit_test_tmp_dir(
Expand Down
15 changes: 9 additions & 6 deletions src/Mod/Import/App/AppImportPy.cpp
Expand Up @@ -163,7 +163,6 @@ class Module : public Py::ExtensionModule<Module>
Handle(XCAFApp_Application) hApp = XCAFApp_Application::GetApplication();
Handle(TDocStd_Document) hDoc;
hApp->NewDocument(TCollection_ExtendedString("MDTV-CAF"), hDoc);
ImportOCAFExt ocaf(hDoc, pcDoc, file.fileNamePure());

if (file.hasExtension("stp") || file.hasExtension("step")) {
try {
Expand Down Expand Up @@ -230,23 +229,27 @@ class Module : public Py::ExtensionModule<Module>
}

#if 1
if(merge!=Py_None)
ImportOCAFExt ocaf(hDoc, pcDoc, file.fileNamePure());
if (merge != Py_None)
ocaf.setMerge(PyObject_IsTrue(merge));
if(importHidden!=Py_None)
if (importHidden != Py_None)
ocaf.setImportHiddenObject(PyObject_IsTrue(importHidden));
if(useLinkGroup!=Py_None)
if (useLinkGroup != Py_None)
ocaf.setUseLinkGroup(PyObject_IsTrue(useLinkGroup));
if(mode>=0)
if (mode >= 0)
ocaf.setMode(mode);
ocaf.loadShapes();
#elif 1
Import::ImportOCAFCmd ocaf(hDoc, pcDoc, file.fileNamePure());
ocaf.loadShapes();
#else
Import::ImportXCAF xcaf(hDoc, pcDoc, file.fileNamePure());
xcaf.loadShapes();
pcDoc->recompute();
#endif
hApp->Close(hDoc);

if (!ocaf.partColors.size()) {
if (!ocaf.partColors.empty()) {
Py::List list;
for (auto &it : ocaf.partColors) {
Py::Tuple tuple(2);
Expand Down

0 comments on commit 0788ce1

Please sign in to comment.