From 833a89695f2b643fcd417c2ff9126444b14cc121 Mon Sep 17 00:00:00 2001 From: lucasjerome Date: Wed, 23 Dec 2020 12:38:23 +0100 Subject: [PATCH] #20500 : Update Geometry calculation and fix translation --- .../FeaturesAPI_GeometryCalculation.cpp | 9 +- .../FeaturesAPI_GeometryCalculation.h | 6 +- src/FeaturesPlugin/Bounding_Box_widget.xml | 2 +- src/FeaturesPlugin/CMakeLists.txt | 3 +- .../Create_Bounding_Box_widget.xml | 2 +- .../FeaturesPlugin_BoundingBox.cpp | 5 +- .../FeaturesPlugin_BoundingBox.h | 2 +- .../FeaturesPlugin_CreateBoundingBox.cpp | 2 +- .../FeaturesPlugin_CreateBoundingBox.h | 2 +- .../FeaturesPlugin_GeometryCalculation.cpp | 31 +++--- .../FeaturesPlugin_GeometryCalculation.h | 12 +-- src/FeaturesPlugin/FeaturesPlugin_msg_fr.ts | 99 +++++++++++++++++- src/FeaturesPlugin/Test/TestBoundingBox.py | 2 +- .../Test/TestGeometryCalculation.py | 80 ++++++++++++++ src/FeaturesPlugin/doc/FeaturesPlugin.rst | 1 + .../doc/TUI_geometry_calculation.rst | 12 +++ .../doc/examples/geometry_calculation.py | 13 +++ .../doc/geometryCalculationFeature.rst | 38 +++++++ .../doc/images/geometryCalculation.png | Bin 0 -> 809 bytes .../geometryCalculationPropertyPanel.png | Bin 0 -> 11752 bytes .../geometry_calculation_widget.xml | 13 +++ .../icons/geometryCalculation.png | Bin 0 -> 809 bytes src/FeaturesPlugin/plugin-Features.xml | 6 +- src/GeomAlgoAPI/CMakeLists.txt | 4 +- ...pp => GeomAlgoAPI_GeometryCalculation.cpp} | 36 +++---- ...es.h => GeomAlgoAPI_GeometryCalculation.h} | 18 ++-- src/ModuleBase/ModuleBase_WidgetLabel.cpp | 9 +- src/ModuleBase/ModuleBase_WidgetLabel.h | 2 + src/PythonAPI/model/features/__init__.py | 2 +- 29 files changed, 339 insertions(+), 72 deletions(-) create mode 100644 src/FeaturesPlugin/Test/TestGeometryCalculation.py create mode 100644 src/FeaturesPlugin/doc/TUI_geometry_calculation.rst create mode 100644 src/FeaturesPlugin/doc/examples/geometry_calculation.py create mode 100644 src/FeaturesPlugin/doc/geometryCalculationFeature.rst create mode 100644 src/FeaturesPlugin/doc/images/geometryCalculation.png create mode 100644 src/FeaturesPlugin/doc/images/geometryCalculationPropertyPanel.png create mode 100644 src/FeaturesPlugin/geometry_calculation_widget.xml create mode 100644 src/FeaturesPlugin/icons/geometryCalculation.png rename src/GeomAlgoAPI/{GeomAlgoAPI_BasicProperties.cpp => GeomAlgoAPI_GeometryCalculation.cpp} (61%) rename src/GeomAlgoAPI/{GeomAlgoAPI_BasicProperties.h => GeomAlgoAPI_GeometryCalculation.h} (72%) diff --git a/src/FeaturesAPI/FeaturesAPI_GeometryCalculation.cpp b/src/FeaturesAPI/FeaturesAPI_GeometryCalculation.cpp index 9bf0ae406..666489e0a 100644 --- a/src/FeaturesAPI/FeaturesAPI_GeometryCalculation.cpp +++ b/src/FeaturesAPI/FeaturesAPI_GeometryCalculation.cpp @@ -24,8 +24,9 @@ #include #include -std::list getBasicProperties(const std::shared_ptr& thePart, - const ModelHighAPI_Selection& theObject) +//================================================================================================= +std::list getGeometryCalculation(const std::shared_ptr& thePart, + const ModelHighAPI_Selection& theObject) { FeaturePtr aPointCoodFeat = thePart->addFeature(FeaturesPlugin_GeometryCalculation::ID()); @@ -37,8 +38,8 @@ std::list getBasicProperties(const std::shared_ptr& AttributeDoubleArrayPtr aResult = std::dynamic_pointer_cast( aPointCoodFeat->attribute(FeaturesPlugin_GeometryCalculation::RESULT_VALUES_ID())); - for ( int i : {0, 1, 2}) - res.push_back( aResult->value(i)); + for (int i : {0, 1, 2}) + res.push_back(aResult->value(i)); return res; } diff --git a/src/FeaturesAPI/FeaturesAPI_GeometryCalculation.h b/src/FeaturesAPI/FeaturesAPI_GeometryCalculation.h index abed69276..b1b6cb312 100644 --- a/src/FeaturesAPI/FeaturesAPI_GeometryCalculation.h +++ b/src/FeaturesAPI/FeaturesAPI_GeometryCalculation.h @@ -29,9 +29,9 @@ class ModelAPI_Document; class ModelHighAPI_Selection; /// \ingroup CPPHighAPI -/// \brief get the basic properties (lenght, Surface area, volume) +/// \brief get the geometry calculation (length, Surface area, volume) FEATURESAPI_EXPORT -std::list getBasicProperties(const std::shared_ptr& thePart, - const ModelHighAPI_Selection& theObject); +std::list getGeometryCalculation(const std::shared_ptr& thePart, + const ModelHighAPI_Selection& theObject); #endif // FeaturesAPI_GeometryCalculation_H_ \ No newline at end of file diff --git a/src/FeaturesPlugin/Bounding_Box_widget.xml b/src/FeaturesPlugin/Bounding_Box_widget.xml index 0dc8a0d12..b9a5e6f5a 100644 --- a/src/FeaturesPlugin/Bounding_Box_widget.xml +++ b/src/FeaturesPlugin/Bounding_Box_widget.xml @@ -1,5 +1,5 @@ - - selection(FeaturesPlugin_CreateBoundingBox::OBJECTS_LIST_ID()) ->setValue( selection(OBJECTS_LIST_ID())->context(), selection(OBJECTS_LIST_ID())->value() ); - + AttributeDoubleArrayPtr aValuesFeatures = - std::dynamic_pointer_cast(myCreateFeature->attribute(RESULT_VALUES_ID())); + std::dynamic_pointer_cast + (myCreateFeature->attribute(RESULT_VALUES_ID())); AttributeDoubleArrayPtr aValues = std::dynamic_pointer_cast(attribute(RESULT_VALUES_ID())); for (int anI=0; anI < 6; anI++) diff --git a/src/FeaturesPlugin/FeaturesPlugin_BoundingBox.h b/src/FeaturesPlugin/FeaturesPlugin_BoundingBox.h index cb1f1aacd..509df64e6 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_BoundingBox.h +++ b/src/FeaturesPlugin/FeaturesPlugin_BoundingBox.h @@ -44,7 +44,7 @@ public: /// Attribute name for object selected. inline static const std::string& OBJECTS_LIST_ID() { - static const std::string MY_OBJECTS_LIST_ID("main_objects"); + static const std::string MY_OBJECTS_LIST_ID("main_object"); return MY_OBJECTS_LIST_ID; } diff --git a/src/FeaturesPlugin/FeaturesPlugin_CreateBoundingBox.cpp b/src/FeaturesPlugin/FeaturesPlugin_CreateBoundingBox.cpp index fc5f5cf64..9baee5543 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_CreateBoundingBox.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_CreateBoundingBox.cpp @@ -106,7 +106,7 @@ void FeaturesPlugin_CreateBoundingBox::updateValues() if (!anIsCompute->value()) { myShape = aShape; anIsCompute->setValue(true); - } + } if (aShape && !aShape->isEqual(myShape)) { double aXmin, aXmax, aYmin,aYmax,aZmin,aZmax; diff --git a/src/FeaturesPlugin/FeaturesPlugin_CreateBoundingBox.h b/src/FeaturesPlugin/FeaturesPlugin_CreateBoundingBox.h index cac4347ea..fd942b9f4 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_CreateBoundingBox.h +++ b/src/FeaturesPlugin/FeaturesPlugin_CreateBoundingBox.h @@ -44,7 +44,7 @@ public: /// Attribute name for object selected. inline static const std::string& OBJECTS_LIST_ID() { - static const std::string MY_OBJECTS_LIST_ID("main_objects"); + static const std::string MY_OBJECTS_LIST_ID("main_object"); return MY_OBJECTS_LIST_ID; } diff --git a/src/FeaturesPlugin/FeaturesPlugin_GeometryCalculation.cpp b/src/FeaturesPlugin/FeaturesPlugin_GeometryCalculation.cpp index c16bc78a3..6a349920b 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_GeometryCalculation.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_GeometryCalculation.cpp @@ -29,37 +29,38 @@ #include #include -#include -#include -#include +#include #include #include +//================================================================================================= FeaturesPlugin_GeometryCalculation::FeaturesPlugin_GeometryCalculation() { } +//================================================================================================= void FeaturesPlugin_GeometryCalculation::initAttributes() { // attribute for point selected data()->addAttribute(OBJECT_SELECTED_ID(), ModelAPI_AttributeSelection::typeId()); // attributes for result message and values - data()->addAttribute(LENGHT_ID(), ModelAPI_AttributeString::typeId()); + data()->addAttribute(LENGTH_ID(), ModelAPI_AttributeString::typeId()); data()->addAttribute(AREA_ID(), ModelAPI_AttributeString::typeId()); data()->addAttribute(VOLUME_ID(), ModelAPI_AttributeString::typeId()); data()->addAttribute(RESULT_VALUES_ID(), ModelAPI_AttributeDoubleArray::typeId()); - data()->realArray(RESULT_VALUES_ID())->setSize(3); } +//================================================================================================= void FeaturesPlugin_GeometryCalculation::execute() { } +//================================================================================================= void FeaturesPlugin_GeometryCalculation::attributeChanged(const std::string& theID) { if (theID == OBJECT_SELECTED_ID()) { @@ -77,18 +78,18 @@ void FeaturesPlugin_GeometryCalculation::attributeChanged(const std::string& the if (!aShape && aSelection->context()) aShape = aSelection->context()->shape(); } - if (aShape){ + if (aShape) { double aTolerance = 0.0001; double aLength; double aSurfArea; double aVolume; std::string aError; - if( !GetBasicProperties( aShape, - aTolerance, - aLength, - aSurfArea, - aVolume, - aError) ) + if (!getGeometryCalculation(aShape, + aTolerance, + aLength, + aSurfArea, + aVolume, + aError)) setError("Error in Geometry calculation :" + aError); streamL << std::setprecision(14) << aLength; @@ -99,9 +100,9 @@ void FeaturesPlugin_GeometryCalculation::attributeChanged(const std::string& the aValues->setValue(2, aVolume); } - string(LENGHT_ID() )->setValue( "Lenght = " + streamL.str() ); - string(AREA_ID() )->setValue( "Area = " + streamA.str() ); - string(VOLUME_ID() )->setValue( "Volume = " + streamV.str() ); + string(LENGTH_ID())->setValue(streamL.str()); + string(AREA_ID())->setValue(streamA.str()); + string(VOLUME_ID())->setValue(streamV.str()); } } diff --git a/src/FeaturesPlugin/FeaturesPlugin_GeometryCalculation.h b/src/FeaturesPlugin/FeaturesPlugin_GeometryCalculation.h index a41e85365..bd90966f8 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_GeometryCalculation.h +++ b/src/FeaturesPlugin/FeaturesPlugin_GeometryCalculation.h @@ -33,7 +33,7 @@ class FeaturesPlugin_GeometryCalculation : public ModelAPI_Feature { public: - inline static const std::string& ID() + inline static const std::string& ID() { static const std::string MY_ID("GeometryCalculation"); return MY_ID; @@ -52,11 +52,11 @@ public: return MY_OBJECT_SELECTED_ID; } - /// Attribute name for lenght - inline static const std::string& LENGHT_ID() + /// Attribute name for length + inline static const std::string& LENGTH_ID() { - static const std::string MY_LENGHT_ID("lenght"); - return MY_LENGHT_ID; + static const std::string MY_LENGTH_ID("length"); + return MY_LENGTH_ID; } /// Attribute name for area @@ -73,7 +73,7 @@ public: return MY_VOLUME_ID; } - /// Attribute name for values of result. + /// Attribute name for values of result. inline static const std::string& RESULT_VALUES_ID() { static const std::string MY_RESULT_VALUES_ID("result_values"); diff --git a/src/FeaturesPlugin/FeaturesPlugin_msg_fr.ts b/src/FeaturesPlugin/FeaturesPlugin_msg_fr.ts index 6f821a2e2..46fd40148 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_msg_fr.ts +++ b/src/FeaturesPlugin/FeaturesPlugin_msg_fr.ts @@ -115,6 +115,14 @@ Angular Copy Copie angulaire + + Bounding box + Boite englobante + + + Geometry calculation + Calcul de la géométrie + Linear copy Copie linéaire @@ -140,7 +148,30 @@ Translation - + + + + BoundingBox + + BoundingBox + Boite englobante + + + Create box + Créer la boite + + + + BoundingBoxMacro + + BoundingBox + Boite englobante + + + Create box + Créer la boite + + Chamfer @@ -4327,7 +4358,73 @@ Pas pour la direction angulaire + + + BoundingBoxMacro + + Bounding box + Boîte englobante + + + + BoundingBoxMacro:main_object + + Object + Objet + + + + BoundingBoxMacro:createbox + + Create box + Créer la boite + + + + BoundingBox + + Bounding box + Boîte englobante + + + + BoundingBox:main_object + + Object + Objet + + + + + GeometryCalculation + + Geometry calculation + Calcul de la géometrie + + + + GeometryCalculation:main_object + + Object + Objet + + + + GeometryCalculation + + Length = + Longueur = + + + Area = + Surface = + + + Volume = + Volume = + + LinearCopy diff --git a/src/FeaturesPlugin/Test/TestBoundingBox.py b/src/FeaturesPlugin/Test/TestBoundingBox.py index 426a6df16..673445e86 100644 --- a/src/FeaturesPlugin/Test/TestBoundingBox.py +++ b/src/FeaturesPlugin/Test/TestBoundingBox.py @@ -52,7 +52,7 @@ def test_Bounding_Box(): model.end() myDelta = 1e-6 - Props = model.getBasicProperties(Part_1_doc,model.selection("SOLID", "BoundingBox_1_1")) + Props = model.getGeometryCalculation(Part_1_doc,model.selection("SOLID", "BoundingBox_1_1")) print(" Basic Properties:") print(" Wires length: ", Props[0]) diff --git a/src/FeaturesPlugin/Test/TestGeometryCalculation.py b/src/FeaturesPlugin/Test/TestGeometryCalculation.py new file mode 100644 index 000000000..a3e1f1ec2 --- /dev/null +++ b/src/FeaturesPlugin/Test/TestGeometryCalculation.py @@ -0,0 +1,80 @@ +# Copyright (C) 2014-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 +# + +""" + Unit test of ... +""" +#========================================================================= +# Initialization of the test +#========================================================================= + +import salome + +import os +import math + +from ModelAPI import * +from salome.shaper import model + + + +__updated__ = "2020-11-12" + + +#========================================================================= +# test Geometry calculation +#========================================================================= +def test_Geometry_Calculation(): + + model.begin() + file_path = os.path.join(os.getenv("DATA_DIR"),"Shapes","Brep","box1.brep") + partSet = model.moduleDocument() + Part_1 = model.addPart(partSet) + Part_1_doc = Part_1.document() + Import_1 = model.addImport(Part_1_doc,file_path) + model.do() + + myDelta = 1e-6 + Props = model.getGeometryCalculation(Part_1_doc,model.selection("SOLID", "box1_1")) + + print(" Geometry calculation:") + print(" Wires length: ", Props[0]) + print(" Surface area: ", Props[1]) + print(" Volume : ", Props[2]) + + aReflength = 2400 + aReslength = Props[0] + assert (math.fabs(aReslength - aReflength) < myDelta), "The surface is wrong: expected = {0}, real = {1}".format(aReflength, aReslength) + + aRefSurface = 240000 + aResSurface = Props[1] + assert (math.fabs(aResSurface - aRefSurface) < myDelta), "The surface is wrong: expected = {0}, real = {1}".format(aRefSurface, aResSurface) + + aRefVolume = 8000000 + aResVolume = Props[2] + assert (math.fabs(aResVolume - aRefVolume) < myDelta), "The volume is wrong: expected = {0}, real = {1}".format(aRefVolume, aResVolume) + + +if __name__ == '__main__': + + test_Geometry_Calculation() + + #========================================================================= + # End of test + #========================================================================= diff --git a/src/FeaturesPlugin/doc/FeaturesPlugin.rst b/src/FeaturesPlugin/doc/FeaturesPlugin.rst index b63fb696d..5304756f4 100644 --- a/src/FeaturesPlugin/doc/FeaturesPlugin.rst +++ b/src/FeaturesPlugin/doc/FeaturesPlugin.rst @@ -24,6 +24,7 @@ Features plug-in provides a set of common topological operations. It implements importResultFeature.rst linearCopyFeature.rst measurementFeature.rst + geometryCalculationFeature.rst boundingBoxFeature.rst pipeFeature.rst placementFeature.rst diff --git a/src/FeaturesPlugin/doc/TUI_geometry_calculation.rst b/src/FeaturesPlugin/doc/TUI_geometry_calculation.rst new file mode 100644 index 000000000..43a8f06a8 --- /dev/null +++ b/src/FeaturesPlugin/doc/TUI_geometry_calculation.rst @@ -0,0 +1,12 @@ + + .. _tui_geometry_calculation: + +Get Geometry Calculation +======================== + +.. literalinclude:: examples/geometry_calculation.py + :linenos: + :language: python + +:download:`Download this script ` + diff --git a/src/FeaturesPlugin/doc/examples/geometry_calculation.py b/src/FeaturesPlugin/doc/examples/geometry_calculation.py new file mode 100644 index 000000000..e1e340a3b --- /dev/null +++ b/src/FeaturesPlugin/doc/examples/geometry_calculation.py @@ -0,0 +1,13 @@ +import os +from salome.shaper import model + +model.begin() +partSet = model.moduleDocument() +Part_1 = model.addPart(partSet) +Part_1_doc = Part_1.document() +Box_1 = model.addBox(Part_1_doc, 10, 10, 10) +properties = model.getGeometryCalculation(Part_1_doc,model.selection("SOLID", "Box_1_1")) +print(" length: ", properties[0]) +print(" area: ", properties[1]) +print(" volume: ", properties[2]) +model.end() \ No newline at end of file diff --git a/src/FeaturesPlugin/doc/geometryCalculationFeature.rst b/src/FeaturesPlugin/doc/geometryCalculationFeature.rst new file mode 100644 index 000000000..2487d5317 --- /dev/null +++ b/src/FeaturesPlugin/doc/geometryCalculationFeature.rst @@ -0,0 +1,38 @@ +.. |GeometryCalculation.icon| image:: images/geometryCalculation.png + +Geometry calculation +==================== + +The **Geometry calculation** feature displays basic properties of sub-elements of a geometrical object (shape). + +The geometry calculation displayed in the property panel are length, area and volume. + +**Apply** button does not generate any result and has the same effect as **Cancel** for this feature. + +To display geometry calculation in the active part: + +#. select in the Main Menu *Inspection - > Geometry calculation* item or +#. click |GeometryCalculation.icon| **Geometry calculation** button in the toolbar + +The geometry calculation can be displayed for a selected object in the property panel : + +.. figure:: images/geometryCalculationPropertyPanel.png + :align: center + + Geometry calculation + +Input fields: + +- **Object** contains an object selected in 3D OCC viewer or object browser. + +The geometry calculation displayed can be selected. + +**TUI Command**: + +.. py:function:: model.getGeometryCalculation(Part_doc, shape) + + :param part: The current part object. + :param object: A shape in format *model.selection("type", shape)*. + :return: list containing length, area and volume. + +**See Also** a sample TUI Script of :ref:`tui_geometry_calculation` operation. \ No newline at end of file diff --git a/src/FeaturesPlugin/doc/images/geometryCalculation.png b/src/FeaturesPlugin/doc/images/geometryCalculation.png new file mode 100644 index 0000000000000000000000000000000000000000..f46c0da7a378a05f515f1b3583cec1a34526ddd7 GIT binary patch literal 809 zcmV+^1J?YBP)z@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ;pGibPRCwBA{Qv(y12q9a0I?u*7#SH;fs`8oJ&%BR z7ZC46mjF2qAb`LG3|&mZjg z<(tp{|NZ;-|NO-(-}w3Y_W;#9A{z=a10aA{&|J;*=N|(@dTBRYU|L5hLskWZUyvTn zz|YUapr)?Lxq0g@3wKwCs_#GmlsW~(|3GR00tnrOo4)@1|Nq?=O#I>N|NlqMKKTFT z*Z=?Tzy1IJ@%!)p+ji~y2n_cwpgtZ@6oAYC2q1J9GW`C_z))1v&Ct}|8*B3c&9Mf0Rum}x3xojzh!Hv20Bzd@3?|>NKOpXBVnEO! z@a_9ghL>+Y0O=nLTpa8Sa*})uN|HS1fd*y+rLO|b`UDU_7%uz;bYXof#AOv_r3@Wi z2v>sm3l=Vd^V@*F02;;&B=~`t4I~B-Ko~B(|K`8%hc7^v0fm_u5i~jgiHiU|EHBJ> z8OW^yMGVlaR{#OTge?pwPUvR%{u@G1p4bhhzy4xCp+Vw5|DdL85CITC7%sf}{J-yu zcf@5g2_XgsZArKbPXf()4G=(BV|npxM7V_{lrpSYfEwE{v4WCP3`+n42*ZV^AO81! z_zE-J{$VLY7CouAD z152)jgf$EgukS$-v+{=+a%^J{iWo>OIsgbD^e}vS@56tor*E;x zDigc}fB

1_mVo#*aW|3@i)*0tnrOeLw|4KpL228JLMIq;Eid3Qp4i0fcVg5+J?_ n#413{PNac9L2(J=00bBSI@)&56%FA}00000NkvXXu0mjfN^nc_ literal 0 HcmV?d00001 diff --git a/src/FeaturesPlugin/doc/images/geometryCalculationPropertyPanel.png b/src/FeaturesPlugin/doc/images/geometryCalculationPropertyPanel.png new file mode 100644 index 0000000000000000000000000000000000000000..17f8cd7ef35a4e3ef73b80f05ccea19b367dafcf GIT binary patch literal 11752 zcmb_?b8sfzw{9}Aor#T!ZB1<3w)MuC*qGS1ZB1-D6Wed>oP57i7w1;pd+MG#{YUTa zU8{GmUcL9To_h8QSCA7&fW?6Y0Rcgfln_w@0Re^lx?X_(=j_`UUHR33I}1swKz|+H z&?aGD_t-9?8ZOHAW-e}qPNpE{cJ{WWbk4?3rlxkz7WOVzU_JaGAVeUNB7!RJnHPWE z+?7pnhk^EUQI`;O=oTj+W1AVwB0r1k6UhVMvA@+P(y1or`uo$aN{fJEV2{P6Xx4_E zGi#60R(O%grg!?eKxYcUp$m2iEGNOGX96?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75+|Fo zGoRgYGgxq`_I2-P4!m1-;)?i%K{bYvd5CD9s+2iufz}7rGVYUOQ$;BfQyx1=v%7!o zeq2a%<<}wQYL@(2(cr%RuokUby7AD=sbsr-jr zuAVDUYezh$4V9Buth~)TQ8YEy1AdBAWJ`R@{_+)$$`P}%y1hq_sEL51D)`9+Zok%s zI9rw8NpXnWaJmI_B zl7T*119KBjbRcAv4+yCYip}nN__KE zqfM~yvzv1t-M;|HU9HXg`Ix`V(hLWRD4KrW2%Qm z_8tnW=N!ps!fZFD%J7Y0rdAvTX*qAnW1&z&3Yw<|2ZY59iS{70LVmMGLjQ`V^WX-T z)a>d|DguHQ@-kasghAX$F-E|OYQqqv18`-e4```!F3pjR?Mrvbj?O@G+%cmK2XZ{$ zzEVX!=}LD!Y_5O;e0433oDyNAW07r{k>eHj>izyf(8oKR6dJSIgL+WqyZ9)a6x}&% z9qyv#)(vhTj~r#X1aHEZ*_@Zg$UrgAsvG;c@TwYyyg zzd2kFU*9y)+!r>{T0+@gJ3qVlAhselZE~L-kpO+7&K!vBjOSO4H@eanzago%N1%|k zgr?5a{c>C5SayFoQEwT4N4N^I^#dc=8en+1E9Y(vYD3WTH8JBCs?oo2crEF_9f$vG nTXg@C9R4p<|NkEC1F7hlbMlZcQSqx(8$?o6PNZ7MAmHBs0#(p- literal 0 HcmV?d00001 diff --git a/src/FeaturesPlugin/geometry_calculation_widget.xml b/src/FeaturesPlugin/geometry_calculation_widget.xml new file mode 100644 index 000000000..55979378c --- /dev/null +++ b/src/FeaturesPlugin/geometry_calculation_widget.xml @@ -0,0 +1,13 @@ + + + + +

1_mVo#*aW|3@i)*0tnrOeLw|4KpL228JLMIq;Eid3Qp4i0fcVg5+J?_ n#413{PNac9L2(J=00bBSI@)&56%FA}00000NkvXXu0mjfN^nc_ literal 0 HcmV?d00001 diff --git a/src/FeaturesPlugin/plugin-Features.xml b/src/FeaturesPlugin/plugin-Features.xml index 5de92e7cd..64379ac67 100644 --- a/src/FeaturesPlugin/plugin-Features.xml +++ b/src/FeaturesPlugin/plugin-Features.xml @@ -173,9 +173,9 @@ - - + + diff --git a/src/GeomAlgoAPI/CMakeLists.txt b/src/GeomAlgoAPI/CMakeLists.txt index ed4b96a73..8e55582d9 100644 --- a/src/GeomAlgoAPI/CMakeLists.txt +++ b/src/GeomAlgoAPI/CMakeLists.txt @@ -33,7 +33,7 @@ SET(PROJECT_HEADERS GeomAlgoAPI_Prism.h GeomAlgoAPI_Revolution.h GeomAlgoAPI_Boolean.h - GeomAlgoAPI_BasicProperties.h + GeomAlgoAPI_GeometryCalculation.h GeomAlgoAPI_BoundingBox.h GeomAlgoAPI_ThroughAll.h GeomAlgoAPI_Rotation.h @@ -100,7 +100,7 @@ SET(PROJECT_SOURCES GeomAlgoAPI_Prism.cpp GeomAlgoAPI_Revolution.cpp GeomAlgoAPI_Boolean.cpp - GeomAlgoAPI_BasicProperties.cpp + GeomAlgoAPI_GeometryCalculation.cpp GeomAlgoAPI_BoundingBox.cpp GeomAlgoAPI_ThroughAll.cpp GeomAlgoAPI_Rotation.cpp diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_BasicProperties.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_GeometryCalculation.cpp similarity index 61% rename from src/GeomAlgoAPI/GeomAlgoAPI_BasicProperties.cpp rename to src/GeomAlgoAPI/GeomAlgoAPI_GeometryCalculation.cpp index 2a7530383..43af83cf2 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_BasicProperties.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_GeometryCalculation.cpp @@ -17,7 +17,7 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -#include "GeomAlgoAPI_BasicProperties.h" +#include "GeomAlgoAPI_GeometryCalculation.h" #include #include @@ -26,42 +26,42 @@ #include //================================================================================================= -bool GetBasicProperties( const std::shared_ptr& theShape, - const double theTolerance, - Standard_Real& theLength, - Standard_Real& theSurfArea, - Standard_Real& theVolume, - std::string& theError) +bool getGeometryCalculation(const std::shared_ptr& theShape, + const double theTolerance, + Standard_Real& theLength, + Standard_Real& theSurfArea, + Standard_Real& theVolume, + std::string& theError) { #ifdef _DEBUG - std::cout << "GetBasicProperties " << std::endl; + std::cout << "getGeometryCalculation " << std::endl; #endif if (!theShape.get()) { - theError = "GetBasicProperties : An invalid argument"; + theError = "getGeometryCalculation : An invalid argument"; return false; } TopoDS_Shape aShape = theShape->impl(); //Compute the parameters - GProp_GProps LProps, SProps; + GProp_GProps aLProps, aSProps; Standard_Real anEps = theTolerance >= 0 ? theTolerance : 1.e-6; try { OCC_CATCH_SIGNALS; - BRepGProp::LinearProperties(aShape, LProps, Standard_True); - theLength = LProps.Mass(); + BRepGProp::LinearProperties(aShape, aLProps, Standard_True); + theLength = aLProps.Mass(); - BRepGProp::SurfaceProperties(aShape, SProps, anEps, Standard_True); - theSurfArea = SProps.Mass(); + BRepGProp::SurfaceProperties(aShape, aSProps, anEps, Standard_True); + theSurfArea = aSProps.Mass(); theVolume = 0.0; if (aShape.ShapeType() < TopAbs_SHELL) { - for (TopExp_Explorer Exp (aShape, TopAbs_SOLID); Exp.More(); Exp.Next()) { - GProp_GProps VProps; - BRepGProp::VolumeProperties(Exp.Current(), VProps, anEps, Standard_True); - theVolume += VProps.Mass(); + for (TopExp_Explorer anExp (aShape, TopAbs_SOLID); anExp.More(); anExp.Next()) { + GProp_GProps aVProps; + BRepGProp::VolumeProperties(anExp.Current(), aVProps, anEps, Standard_True); + theVolume += aVProps.Mass(); } } } diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_BasicProperties.h b/src/GeomAlgoAPI/GeomAlgoAPI_GeometryCalculation.h similarity index 72% rename from src/GeomAlgoAPI/GeomAlgoAPI_BasicProperties.h rename to src/GeomAlgoAPI/GeomAlgoAPI_GeometryCalculation.h index 5450ea726..df1f2f2b3 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_BasicProperties.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_GeometryCalculation.h @@ -17,8 +17,8 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -#ifndef GeomAlgoAPI_BasicProperties_H_ -#define GeomAlgoAPI_BasicProperties_H_ +#ifndef GeomAlgoAPI_GeometryCalculation_H_ +#define GeomAlgoAPI_GeometryCalculation_H_ #include #include @@ -27,16 +27,16 @@ /// Run chamfer operation with two distances or with a distance and an angle . /// \param theShape the shape /// \param theTolerance tolerance desirated - /// \param theLength lenght calculated + /// \param theLength length calculated /// \param theSurfArea Surface Area calculated /// \param theVolume Volume calculated /// \param theError error GEOMALGOAPI_EXPORT -bool GetBasicProperties( const std::shared_ptr& theShape, - const Standard_Real theTolerance, - Standard_Real& theLength, - Standard_Real& theSurfArea, - Standard_Real& theVolume, - std::string& theError); +bool getGeometryCalculation(const std::shared_ptr& theShape, + const Standard_Real theTolerance, + Standard_Real& theLength, + Standard_Real& theSurfArea, + Standard_Real& theVolume, + std::string& theError); #endif diff --git a/src/ModuleBase/ModuleBase_WidgetLabel.cpp b/src/ModuleBase/ModuleBase_WidgetLabel.cpp index 7e3f86de0..3aada3be8 100644 --- a/src/ModuleBase/ModuleBase_WidgetLabel.cpp +++ b/src/ModuleBase/ModuleBase_WidgetLabel.cpp @@ -37,6 +37,9 @@ ModuleBase_WidgetLabel::ModuleBase_WidgetLabel(QWidget* theParent, : ModuleBase_ModelWidget(theParent, theData) { QString aText = translate(theData->getProperty("title")); + + myPrefix = theData->getProperty(ATTR_LABEL); + bool aIsHtml = theData->getBooleanAttribute(ATTR_HTML_STYLE, false); QString aLabelIcon = QString::fromStdString(theData->getProperty("icon")); @@ -99,7 +102,11 @@ bool ModuleBase_WidgetLabel::restoreValueCustom() aText = ModuleBase_Tools::translate(myFeature->getKind(), aMsg); } } - myLabel->setText(aText); + if (myPrefix == "") { + myLabel->setText(aText); + } else { + myLabel->setText( ModuleBase_Tools::translate(myFeature->getKind(), myPrefix) + aText); + } } return true; } diff --git a/src/ModuleBase/ModuleBase_WidgetLabel.h b/src/ModuleBase/ModuleBase_WidgetLabel.h index be90456c0..6c01efad9 100644 --- a/src/ModuleBase/ModuleBase_WidgetLabel.h +++ b/src/ModuleBase/ModuleBase_WidgetLabel.h @@ -61,6 +61,8 @@ protected: /// A label control QLabel* myLabel; + /// prefix for label + std::string myPrefix; }; #endif diff --git a/src/PythonAPI/model/features/__init__.py b/src/PythonAPI/model/features/__init__.py index 0d6aafd55..5d61b5ce8 100644 --- a/src/PythonAPI/model/features/__init__.py +++ b/src/PythonAPI/model/features/__init__.py @@ -30,7 +30,7 @@ from FeaturesAPI import addRecover from FeaturesAPI import addFillet, addChamfer from FeaturesAPI import addFusionFaces from FeaturesAPI import measureLength, measureDistance, measureRadius, measureAngle -from FeaturesAPI import getBasicProperties, getBoundingBox +from FeaturesAPI import getGeometryCalculation, getBoundingBox from FeaturesAPI import addRemoveResults from FeaturesAPI import addCopy, addImportResult from FeaturesAPI import addDefeaturing -- 2.39.2