SET(QT_LIBRARIES)
# Find Qt5Core to get Qt version
SET(Qt5_FIND_COMPONENTS QtCore)
+SET(Qt5_OPTIONAL_COMPONENTS)
SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Qt5Core Qt5Core_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR)
IF(Qt5Core_FOUND)
LIST(APPEND QT_INCLUDES ${Qt5Core_INCLUDE_DIRS})
SET(QT_VERSION "${Qt5Core_VERSION}")
ENDIF()
-SET(Qt5_FIND_COMPONENTS Gui Widgets Network Xml OpenGL PrintSupport Help Test Sql Sensors Positioning Quick Qml Multimedia MultimediaWidgets WebChannel UiTools)
+# Add mandatory Qt 5 components below
+SET(Qt5_FIND_COMPONENTS Gui Widgets Network Xml OpenGL PrintSupport Help Test)
+# Add optional Qt 5 components below
+SET(Qt5_OPTIONAL_COMPONENTS)
IF ("${QT_VERSION}" VERSION_LESS "5.6.0")
+ # QtWebKit package is used with Qt < 5.6
LIST(APPEND Qt5_FIND_COMPONENTS WebKit WebKitWidgets)
ELSE()
- LIST(APPEND Qt5_OPTIONAL_COMPONENTS WebEngine WebEngineWidgets)
+ # QtWebEngine package is (optionally) used with Qt >= 5.6
+ # Anyway, not available with Python 3
+ LIST(APPEND Qt5_OPTIONAL_COMPONENTS WebEngineCore WebEngine WebEngineWidgets)
ENDIF()
IF(NOT WIN32)
+ ## QtX11Extras package is used on Linux only
LIST(APPEND Qt5_FIND_COMPONENTS X11Extras)
ENDIF()
IF(${idx} GREATER -1)
SET(Salome${_Qt5_COMPONENT}_FIND_QUIETLY TRUE)
ENDIF()
- SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(${_Qt5_COMPONENT} ${_Qt5_COMPONENT}_INCLUDE_DIRS 1 ENVVAR QT5_ROOT_DIR)
+ FIND_PACKAGE(${_Qt5_COMPONENT})
LIST(APPEND QT_INCLUDES ${${_Qt5_COMPONENT}_INCLUDE_DIRS})
LIST(APPEND QT_DEFINITIONS ${${_Qt5_COMPONENT}_DEFINITIONS})
LIST(APPEND QT_LIBRARIES ${${_Qt5_COMPONENT}_LIBRARIES})
GET_FILENAME_COMPONENT(QT_BINARY_DIR ${QT_LRELEASE_EXECUTABLE} DIRECTORY)
MARK_AS_ADVANCED(QT_BINARY_DIR)
-# This is only needed to correctly detect Qt help generator tool, to workaround an error
+# This is only needed to correctly detect Qt help generator tool, to workaround an error
# coming from ParaView detection procedure
FIND_PROGRAM(QT_HELP_GENERATOR
qhelpgenerator
DOC "qhelpgenerator used to compile Qt help project files")
MARK_AS_ADVANCED(QT_HELP_GENERATOR)
-IF(Qt5Core_FOUND)
+IF(Qt5Core_FOUND)
SALOME_ACCUMULATE_HEADERS(QT_INCLUDES)
SALOME_ACCUMULATE_ENVIRONMENT(PATH ${LINGUIST_PATH})
SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${Qt5Core_LIBRARIES})
Box_1 = model.addBox(Part_1_doc, 10, 10, 10)
Export_1 = model.exportToFile(Part_1_doc, file_path,
[model.selection("SOLID", "Box_1_1")])
+
+file_xao = os.path.join(os.getenv("DATA_DIR"), "test.xao")
+Export_2 = model.exportToXAO(Part_1_doc, file_xao,
+ model.selection("SOLID", "Box_1_1"), "author", "box")
model.do()
model.end()
Selection list in the property panel contains a list of exported objects which can be selected in a viewer or object browser.
+*Note*: For XAO format, selection list is not available, the whole part is exported.
**Apply** button exports the file.
:param list: A list of exporting objects
-.. py:function:: model.exportToXAO(Part_doc, FileNameString, [ObjectsList, Author, GeometryName])
+.. py:function:: model.exportToXAO(Part_doc, FileNameString, Author="", GeometryName="")
+.. py:function:: model.exportToXAO(Part_doc, FileNameString, Object, Author="", GeometryName="")
:param part: The current part object
:param string: The file name
- :param list: A list of exporting objects, if necessary
- :param string: The name of the author
- :param string: The name for the shape processed in GEOMETRY module
-
-Result
-""""""
-
-The Result of operation is an exported file.
-
-**See Also** a sample TUI Script of :ref:`tui_export_file` operation.
+ :param object: An exporting object, if necessary
+ :param string: The name of the author, empty by default
+ :param string: The name for the shape processed in GEOMETRY module, empty by default
Result
""""""
Test20245_2.py
Test20245_3.py
Test20247.py
+ Test22847.py
)
// Store result.
ResultBodyPtr aResultBody = document()->createBody(data());
- aResultBody->storeModified(aBaseShape, aResultShape);
+ std::list<GeomShapePtr> anOldShapes;
+ anOldShapes.push_back(aBaseShape);
+ aResultBody->storeModified(anOldShapes, aResultShape, aMakeShapeList);
for (std::set<GeomAPI_Shape::ShapeType>::iterator aTypeIter = aTypes.begin();
aTypeIter != aTypes.end();
++aTypeIter)
--- /dev/null
+# Copyright (C) 2020 CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+
+### Create Part
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
+SketchLine_1 = Sketch_1.addLine(22, 23, 60, 70)
+SketchLine_2 = Sketch_1.addLine(60, 70, 90, 23)
+Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
+SketchLine_3 = Sketch_1.addLine(90, 23, 22, 23)
+Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchLine_3.startPoint())
+Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchLine_3.endPoint())
+Sketch_1.setHorizontal(SketchLine_3.result())
+SketchLine_4 = Sketch_1.addLine(60, 72, 54, 23)
+Sketch_1.setCoincident(SketchLine_4.endPoint(), SketchLine_3.result())
+Sketch_1.setCoincident(SketchLine_4.startPoint(), SketchLine_2.startPoint())
+model.do()
+
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "all-in-Sketch_1")], model.selection(), 10, 0, "Faces|Wires")
+LinearCopy_1 = model.addMultiTranslation(Part_1_doc, [model.selection("COMPSOLID", "Extrusion_1_1")], model.selection("EDGE", "PartSet/OY"), 60, 2, model.selection("EDGE", "PartSet/OX"), 75, 2, keepSubResults = True)
+
+### Create Group
+Group_1 = model.addGroup(Part_1_doc, "Faces", [model.selection("FACE", "LinearCopy_1_1_1_2/MF:Translated&Sketch_1/SketchLine_2")])
+
+### Create Remove_SubShapes
+Remove_SubShapes_1 = model.addRemoveSubShapes(Part_1_doc, model.selection("COMPOUND", "LinearCopy_1_1"))
+Remove_SubShapes_1.setSubShapesToRemove([model.selection("SOLID", "LinearCopy_1_1_4_2")])
+model.end()
+
+# Move the group to the end of history
+model.begin()
+Part_1_doc.moveFeature(Group_1.feature(), Remove_SubShapes_1.feature())
+model.end()
+
+# check that all groups are correct
+from ModelAPI import *
+aFactory = ModelAPI_Session.get().validators()
+
+assert(aFactory.validate(Group_1.feature()))
+assert(Group_1.groupList().size() == 1)
+assert(Group_1.groupList().value(0).value().shapeTypeStr() == "FACE")
+assert(len(Group_1.groupList().value(0).namingName()) > 0)
+
+assert(model.checkPythonDump())
#include <TopoDS_Wire.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
-#include <ShapeFix_Wire.hxx>
#include <cmath>
#include <map>
setImpl(aWireBuilder);
setBuilderType(OCCT_BRepBuilderAPI_MakeShape);
- // fix edges order (bos #20546)
- TopoDS_Wire aWire = aWireBuilder->Wire();
- Handle(ShapeFix_Wire) aFW = new ShapeFix_Wire;
- aFW->Load(aWire);
- aFW->FixReorder();
- if (aFW->StatusReorder(ShapeExtend_DONE))
- aWire = aFW->WireAPIMake();
-
// split the result wire
+ TopoDS_Wire aWire = aWireBuilder->Wire();
if (isSplitWire && BRep_Tool::IsClosed(aWire)) {
TopoDS_Wire aNewWire;
BRep_Builder aBuilder;
}
return false;
-}
+}
\ No newline at end of file
}
Set(aShape);
- // Activate individual repaintng if this is a part of compsolid
- ResultBodyPtr aResOwner = ModelAPI_Tools::bodyOwner(myResult);
- SetAutoHilight(aResOwner.get() == NULL);
+ // VSV: bos22744: The AutoHilight mode is swithced off because it produces different
+ // behaviour of selection for simple shape and compound. For example when selection mode
+ // is Vertex the shape is selected by vertex, but compound is selected by whole shape
+ //ResultBodyPtr aResOwner = ModelAPI_Tools::bodyOwner(myResult);
+ //SetAutoHilight(aResOwner.get() == NULL);
// Set own free boundaries aspect in order to have free
// and unfree boundaries with different colors