From: Nicolas RECHATIN Date: Thu, 29 Jul 2021 11:52:26 +0000 (+0200) Subject: volume v1.0 working, check test X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=25f46537f08b316f7174a5fb5cbd7b2dcdf7f549;p=modules%2Fshaper.git volume v1.0 working, check test --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 18d0dd973..0e36ac329 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -197,6 +197,7 @@ ADD_SUBDIRECTORY (src/CollectionAPI) ADD_SUBDIRECTORY (src/ParametersAPI) ADD_SUBDIRECTORY (src/PartSetAPI) ADD_SUBDIRECTORY (src/PrimitivesAPI) +ADD_SUBDIRECTORY (src/OperaAPI) ADD_SUBDIRECTORY (src/SketchAPI) ADD_SUBDIRECTORY (src/GDMLAPI) ADD_SUBDIRECTORY (src/ConnectorAPI) diff --git a/src/OperaAPI/CMakeLists.txt b/src/OperaAPI/CMakeLists.txt index 009c9f63b..bd057baf0 100644 --- a/src/OperaAPI/CMakeLists.txt +++ b/src/OperaAPI/CMakeLists.txt @@ -21,11 +21,11 @@ INCLUDE(Common) SET(PROJECT_HEADERS OperaAPI.h - OperaAPI_addVolume.h + OperaAPI_Volume.h ) SET(PROJECT_SOURCES - OperaAPI_addVolume.cpp + OperaAPI_Volume.cpp ) SET(PROJECT_LIBRARIES diff --git a/src/OperaAPI/OperaAPI.h b/src/OperaAPI/OperaAPI.h index 093042bb2..8a1808b1e 100644 --- a/src/OperaAPI/OperaAPI.h +++ b/src/OperaAPI/OperaAPI.h @@ -34,4 +34,4 @@ #endif #endif -#endif //PRIMITIVESAPI_H +#endif //OPERAAPI_H diff --git a/src/OperaAPI/OperaAPI_Volume.cpp b/src/OperaAPI/OperaAPI_Volume.cpp new file mode 100644 index 000000000..b90926804 --- /dev/null +++ b/src/OperaAPI/OperaAPI_Volume.cpp @@ -0,0 +1,89 @@ +// Copyright (C) 2014-2021 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 +// + +#include "OperaAPI_Volume.h" + +#include +#include + +//================================================================================================== +OperaAPI_Volume::OperaAPI_Volume(const std::shared_ptr& theFeature) +: ModelHighAPI_Interface(theFeature) +{ + initialize(); +} + +//================================================================================================== +OperaAPI_Volume::OperaAPI_Volume(const std::shared_ptr& theFeature, + const ModelHighAPI_Double& theMedium, + const std::list& theObjectList) +: ModelHighAPI_Interface(theFeature) +{ + if(initialize()) { + fillAttribute(OperaPlugin_Volume::MEDIUM(), medium()); + setObjectList(theObjectList); + } +} + +//================================================================================================== +OperaAPI_Volume::~OperaAPI_Volume() {} + +//================================================================================================== +void OperaAPI_Volume::setMedium(const ModelHighAPI_Double& theMedium) +{ + fillAttribute(OperaPlugin_Volume::MEDIUM(), medium()); + + execute(); +} + +//================================================================================================== +void OperaAPI_Volume::setObjectList(const std::list& theObjectList) +{ + fillAttribute(theObjectList, myvolumeList); + + execute(); +} + +//================================================================================================== +void OperaAPI_Volume::dump(ModelHighAPI_Dumper& theDumper) const +{ + FeaturePtr aBase = feature(); + const std::string& aDocName = theDumper.name(aBase->document()); + + AttributeStringPtr anAttrMedium = aBase->string(OperaPlugin_Volume::MEDIUM()); + theDumper << aBase << " = model.Volume(" << aDocName << ", " << anAttrMedium << ", "; + + AttributeSelectionListPtr anAttrList = aBase->selectionList(OperaPlugin_Volume::VOLUME_LIST_ID()); + if (anAttrList->isWholeResultAllowed() && !anAttrList->selectionType().empty()) + theDumper<<"\""<selectionType()<<"\", "; + theDumper << anAttrList; + if (anAttrList->isGeometricalSelection()) + theDumper <<", True"; + theDumper << ")" << std::endl; +} + +//================================================================================================== +VolumePtr Volume(const std::shared_ptr& thePart, + const ModelHighAPI_Double& theMedium, + const std::list& theObjectList) +{ + std::shared_ptr aFeature = thePart->addFeature(OperaAPI_Volume::ID()); + aFeature->selectionList(OperaPlugin_Volume::VOLUME_LIST_ID())->setGeometricalSelection(true); + return VolumePtr(new OperaAPI_Volume(aFeature, theMedium, theObjectList)); +} diff --git a/src/OperaAPI/OperaAPI_Volume.h b/src/OperaAPI/OperaAPI_Volume.h new file mode 100644 index 000000000..cf7f49045 --- /dev/null +++ b/src/OperaAPI/OperaAPI_Volume.h @@ -0,0 +1,81 @@ +// Copyright (C) 2014-2021 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 +// + +#ifndef OPERAAPI_VOLUME_H_ +#define OPERAAPI_VOLUME_H_ + +#include "OperaAPI.h" +#include + +#include +#include + +class ModelHighAPI_Double; +class ModelHighAPI_Selection; + +/// \class OperaAPI_Volume +/// \ingroup CPPHighAPI +/// \brief Interface for primitive Box feature. +class OperaAPI_Volume: public ModelHighAPI_Interface +{ +public: + /// Constructor without values. + OPERAAPI_EXPORT + explicit OperaAPI_Volume(const std::shared_ptr& theFeature); + + /// Constructor with values. + OPERAAPI_EXPORT + OperaAPI_Volume(const std::shared_ptr& theFeature, + const ModelHighAPI_Double& theMedium, + const std::list& theObjectList); + + /// Destructor. + OPERAAPI_EXPORT + virtual ~OperaAPI_Volume(); + + INTERFACE_2(OperaPlugin_Volume::ID(), + medium, OperaPlugin_Volume::MEDIUM(), + ModelAPI_AttributeString, /** Volume medium */, + volumeList, OperaPlugin_Volume::VOLUME_LIST_ID(), + ModelAPI_AttributeSelectionList, /** Group list*/) + + /// Set medium + OPERAAPI_EXPORT + void setMedium(const ModelHighAPI_Double& theMedium); + + /// Set main objects list. + OPERAAPI_EXPORT + void setObjectList(const std::list& theObjectList); + + /// Dump wrapped feature + OPERAAPI_EXPORT + virtual void dump(ModelHighAPI_Dumper& theDumper) const; +}; + +/// Pointer Volume feature +typedef std::shared_ptr VolumePtr; + +/// \ingroup CPPHighAPI +/// \brief Create Volume feature. +OPERAAPI_EXPORT +VolumePtr Volume(const std::shared_ptr& thePart, + const ModelHighAPI_Double& theMedium, + const std::list& theObjectList); + +#endif // OperaAPI_Volume_H_ diff --git a/src/OperaAPI/OperaAPI_addVolume.cpp b/src/OperaAPI/OperaAPI_addVolume.cpp deleted file mode 100644 index 8764ba593..000000000 --- a/src/OperaAPI/OperaAPI_addVolume.cpp +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (C) 2014-2021 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 -// - -#include "OperaAPI_addVolume.h" - -#include -#include - -//================================================================================================== -OperaAPI_addVolume::OperaAPI_addVolume(const std::shared_ptr& theFeature) -: ModelHighAPI_Interface(theFeature) -{ - initialize(); -} - -//================================================================================================== -OperaAPI_addVolume::OperaAPI_addVolume(const std::shared_ptr& theFeature, - const ModelHighAPI_Double& theMedium, - const std::list& theObjectList) -: ModelHighAPI_Interface(theFeature) -{ - if(initialize()) { - fillAttribute(OperaPlugin_Volume::MEDIUM(), medium()); - setObjectList(theObjectList); - } -} - -//================================================================================================== -OperaAPI_addVolume::~OperaAPI_addVolume() {} - -//================================================================================================== -void OperaAPI_addVolume::setMedium(const ModelHighAPI_Double& theMedium) -{ - fillAttribute(OperaPlugin_Volume::MEDIUM(), medium()); - - execute(); -} - -//================================================================================================== -void OperaAPI_addVolume::setObjectList(const std::list& theObjectList) -{ - fillAttribute(theObjectList, myvolumeList); - - execute(); -} - -//================================================================================================== -void OperaAPI_addVolume::dump(ModelHighAPI_Dumper& theDumper) const -{ - FeaturePtr aBase = feature(); - const std::string& aDocName = theDumper.name(aBase->document()); - - AttributeStringPtr anAttrMedium = aBase->string(OperaPlugin_Volume::MEDIUM()); - theDumper << aBase << " = model.addVolume(" << aDocName << ", " << anAttrMedium << ", "; - - AttributeSelectionListPtr anAttrList = aBase->selectionList(OperaPlugin_Volume::VOLUME_LIST_ID()); - if (anAttrList->isWholeResultAllowed() && !anAttrList->selectionType().empty()) - theDumper<<"\""<selectionType()<<"\", "; - theDumper << anAttrList; - if (anAttrList->isGeometricalSelection()) - theDumper <<", True"; - theDumper << ")" << std::endl; -} - -//================================================================================================== -VolumePtr addVolume(const std::shared_ptr& thePart, - const ModelHighAPI_Double& theMedium, - const std::list& theObjectList) -{ - std::shared_ptr aFeature = thePart->addFeature(OperaAPI_addVolume::ID()); - aFeature->selectionList(OperaPlugin_Volume::VOLUME_LIST_ID())->setGeometricalSelection(true); - return VolumePtr(new OperaAPI_addVolume(aFeature, theMedium, theObjectList)); -} diff --git a/src/OperaAPI/OperaAPI_addVolume.h b/src/OperaAPI/OperaAPI_addVolume.h deleted file mode 100644 index 6205698af..000000000 --- a/src/OperaAPI/OperaAPI_addVolume.h +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (C) 2014-2021 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 -// - -#ifndef OPERAAPI_ADDVOLUME_H_ -#define OPERAAPI_ADDVOLUME_H_ - -#include "OperaAPI.h" -#include - -#include -#include - -class ModelHighAPI_Double; -class ModelHighAPI_Selection; - -/// \class OperaAPI_addVolume -/// \ingroup CPPHighAPI -/// \brief Interface for primitive Box feature. -class OperaAPI_addVolume: public ModelHighAPI_Interface -{ -public: - /// Constructor without values. - OPERAAPI_EXPORT - explicit OperaAPI_addVolume(const std::shared_ptr& theFeature); - - /// Constructor with values. - OPERAAPI_EXPORT - OperaAPI_addVolume(const std::shared_ptr& theFeature, - const ModelHighAPI_Double& theMedium, - const std::list& theObjectList); - - /// Destructor. - OPERAAPI_EXPORT - virtual ~OperaAPI_addVolume(); - - INTERFACE_2(OperaPlugin_Volume::ID(), - medium, OperaPlugin_Volume::MEDIUM(), - ModelAPI_AttributeString, /** Volume medium */, - volumeList, OperaPlugin_Volume::VOLUME_LIST_ID(), - ModelAPI_AttributeSelectionList, /** Group list*/) - - /// Set medium - OPERAAPI_EXPORT - void setMedium(const ModelHighAPI_Double& theMedium); - - /// Set main objects list. - OPERAAPI_EXPORT - void setObjectList(const std::list& theObjectList); - - /// Dump wrapped feature - OPERAAPI_EXPORT - virtual void dump(ModelHighAPI_Dumper& theDumper) const; -}; - -/// Pointer addVolume feature -typedef std::shared_ptr VolumePtr; - -/// \ingroup CPPHighAPI -/// \brief Create addVolume feature. -OPERAAPI_EXPORT -VolumePtr addVolume(const std::shared_ptr& thePart, - const ModelHighAPI_Double& theMedium, - const std::list& theObjectList); - -#endif // OperaAPI_addVolume_H_ diff --git a/src/OperaPlugin/CMakeLists.txt b/src/OperaPlugin/CMakeLists.txt index be7b24ea5..fd574c6b8 100644 --- a/src/OperaPlugin/CMakeLists.txt +++ b/src/OperaPlugin/CMakeLists.txt @@ -31,7 +31,7 @@ SET(PROJECT_SOURCES SET(XML_RESOURCES plugin-Opera.xml - addvolume_widget.xml + volume_widget.xml ) SET(TEXT_RESOURCES diff --git a/src/OperaPlugin/OperaPlugin_Volume.cpp b/src/OperaPlugin/OperaPlugin_Volume.cpp index 571e481e5..1a285745e 100644 --- a/src/OperaPlugin/OperaPlugin_Volume.cpp +++ b/src/OperaPlugin/OperaPlugin_Volume.cpp @@ -64,7 +64,7 @@ void OperaPlugin_Volume::initAttributes() { // Get Medium data()->addAttribute(MEDIUM(), ModelAPI_AttributeString::typeId()); - + // Get Objects data()->addAttribute(VOLUME_LIST_ID(), ModelAPI_AttributeSelectionList::typeId()); } @@ -101,9 +101,11 @@ void OperaPlugin_Volume::execute() aResult = aSel->context()->shape(); } - std::set anExistingNames; - std::wstring aBaseName = aSel->context()->name(); + // Handle naming : Volume_ std::wstring aName; + std::set anExistingNames; + std::wstring aBaseName = aSel->context() ? aSel->context()->data()->name() : + aSel->contextFeature()->firstResult()->data()->name(); int anInd = 0; do { anInd++; diff --git a/src/OperaPlugin/OperaPlugin_Volume.h b/src/OperaPlugin/OperaPlugin_Volume.h index 1480ebb48..a31e92176 100644 --- a/src/OperaPlugin/OperaPlugin_Volume.h +++ b/src/OperaPlugin/OperaPlugin_Volume.h @@ -42,7 +42,7 @@ class OperaPlugin_Volume : public ModelAPI_Feature /// Box kind inline static const std::string& ID() { - static const std::string MY_VOLUME_ID("addVolume"); + static const std::string MY_VOLUME_ID("Volume"); return MY_VOLUME_ID; } inline static const std::string& MEDIUM() diff --git a/src/OperaPlugin/Test/TestAddVolume.py b/src/OperaPlugin/Test/TestAddVolume.py deleted file mode 100644 index a8b70d72c..000000000 --- a/src/OperaPlugin/Test/TestAddVolume.py +++ /dev/null @@ -1,83 +0,0 @@ -# Copyright (C) 2014-2021 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 -# - -""" - TestAddVolume.py - Test case of OperaPlugin_addVolume -""" -#========================================================================= -# Initialization of the test -#========================================================================= -from salome.shaper import model - -model.begin() -partSet = model.moduleDocument() -Part_1 = model.addPart(partSet) -Part_1_doc = Part_1.document() - -#========================================================================= -# Create a Box, a Torus and a Cylinder -#========================================================================= -Box_1 = model.addBox(Part_1_doc, 10, 20, 10) -Torus_1 = model.addTorus(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 15, 3) -Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10) - -#========================================================================= -# Create one Volume -#========================================================================= - -Volume_1 = model.addVolume(Part_1_doc, "Test_medium", [model.selection("SOLID", "Box_1")]) - -#========================================================================= -# Check results -#========================================================================= - -from GeomAPI import GeomAPI_Shape - -# TODO : Check this -# TODO : Do I need a testNbVolume ?? -model.testNbResults(Volume_1, 1) -model.testNbSubResults(Volume_1, [0]) -model.testNbSubShapes(Volume_1, GeomAPI_Shape.SOLID, [1]) -model.testNbSubShapes(Volume_1, GeomAPI_Shape.FACE, [6]) -model.testHaveNamingFaces(Volume_1, model, Part_1_doc) - -#========================================================================= -# Create two volumes at once -#========================================================================= - -Volume_2 = model.addVolume(Part_1_doc, "Test_medium_2", [model.selection("SOLID", "Torus_1"), - model.selection("SOLID", "Cylinder_1")]) - -#========================================================================= -# Check results -#========================================================================= - -# TODO : Check this - -model.testNbResults(Volume_2, 2) -model.testNbSubResults(Volume_2, [0]) -model.testNbSubShapes(Volume_2, GeomAPI_Shape.SOLID, [2]) - -#========================================================================= -# End of test -#========================================================================= - -from salome.shaper import model -assert(model.checkPythonDump()) diff --git a/src/OperaPlugin/Test/TestVolume.py b/src/OperaPlugin/Test/TestVolume.py new file mode 100644 index 000000000..09da4da42 --- /dev/null +++ b/src/OperaPlugin/Test/TestVolume.py @@ -0,0 +1,83 @@ +# Copyright (C) 2014-2021 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 +# + +""" + TestVolume.py + Test case of OperaPlugin_Volume +""" +#========================================================================= +# Initialization of the test +#========================================================================= +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() + +#========================================================================= +# Create a Box, a Torus and a Cylinder +#========================================================================= +Box_1 = model.addBox(Part_1_doc, 10, 20, 10) +Torus_1 = model.addTorus(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 15, 3) +Cylinder_1 = model.addCylinder(Part_1_doc, model.selection("VERTEX", "PartSet/Origin"), model.selection("EDGE", "PartSet/OZ"), 5, 10) + +#========================================================================= +# Create one Volume +#========================================================================= + +Volume_1 = model.Volume(Part_1_doc, "Test_medium", [model.selection("SOLID", "Box_1")]) + +#========================================================================= +# Check results +#========================================================================= + +from GeomAPI import GeomAPI_Shape + +# TODO : Check this +# TODO : Do I need a testNbVolume ?? +model.testNbResults(Volume_1, 1) +model.testNbSubResults(Volume_1, [0]) +model.testNbSubShapes(Volume_1, GeomAPI_Shape.SOLID, [1]) +model.testNbSubShapes(Volume_1, GeomAPI_Shape.FACE, [6]) +model.testHaveNamingFaces(Volume_1, model, Part_1_doc) + +#========================================================================= +# Create two volumes at once +#========================================================================= + +Volume_2 = model.Volume(Part_1_doc, "Test_medium_2", [model.selection("SOLID", "Torus_1"), + model.selection("SOLID", "Cylinder_1")]) + +#========================================================================= +# Check results +#========================================================================= + +# TODO : Check this + +model.testNbResults(Volume_2, 2) +model.testNbSubResults(Volume_2, [0]) +model.testNbSubShapes(Volume_2, GeomAPI_Shape.SOLID, [2]) + +#========================================================================= +# End of test +#========================================================================= + +from salome.shaper import model +assert(model.checkPythonDump()) diff --git a/src/OperaPlugin/addvolume_widget.xml b/src/OperaPlugin/addvolume_widget.xml deleted file mode 100644 index 8f18a004d..000000000 --- a/src/OperaPlugin/addvolume_widget.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - diff --git a/src/OperaPlugin/plugin-Opera.xml b/src/OperaPlugin/plugin-Opera.xml index 3fe8fce5e..9691814c6 100644 --- a/src/OperaPlugin/plugin-Opera.xml +++ b/src/OperaPlugin/plugin-Opera.xml @@ -2,13 +2,13 @@ - + helpfile="volumeFeature.html"> + diff --git a/src/OperaPlugin/tests.set b/src/OperaPlugin/tests.set index 805968390..019d00b2f 100644 --- a/src/OperaPlugin/tests.set +++ b/src/OperaPlugin/tests.set @@ -18,5 +18,5 @@ # SET(TEST_NAMES - TestAddVolume.py + TestVolume.py ) diff --git a/src/OperaPlugin/volume_widget.xml b/src/OperaPlugin/volume_widget.xml new file mode 100644 index 000000000..8f18a004d --- /dev/null +++ b/src/OperaPlugin/volume_widget.xml @@ -0,0 +1,13 @@ + + + + + + + diff --git a/src/PythonAPI/Test/TestFeatures.py b/src/PythonAPI/Test/TestFeatures.py index 0431d5e45..ae3041ab7 100644 --- a/src/PythonAPI/Test/TestFeatures.py +++ b/src/PythonAPI/Test/TestFeatures.py @@ -104,6 +104,9 @@ class FeaturesTestCase(FeaturesFixture): import PrimitivesAPI PrimitivesAPI.PrimitivesAPI_Box(self.part.addFeature("Box")) + import OperaAPI + OperaAPI.OperaAPI_Volume(self.part.addFeature("Volume")) + import ParametersAPI ParametersAPI.ParametersAPI_Parameter(self.part.addFeature("Parameter")) diff --git a/src/PythonAPI/model/opera/__init__.py b/src/PythonAPI/model/opera/__init__.py index a13965476..b30e3def7 100644 --- a/src/PythonAPI/model/opera/__init__.py +++ b/src/PythonAPI/model/opera/__init__.py @@ -19,4 +19,4 @@ """Package for Opera plugin for SHAPER Opera. """ -from OperaAPI import addVolume +from OperaAPI import Volume