]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Merge branch 'csgroup_IS2'
authorArtem Zhidkov <Artem.Zhidkov@gmail.com>
Fri, 2 Apr 2021 06:25:58 +0000 (09:25 +0300)
committerArtem Zhidkov <Artem.Zhidkov@gmail.com>
Fri, 2 Apr 2021 06:25:58 +0000 (09:25 +0300)
69 files changed:
1  2 
src/BuildPlugin/BuildPlugin_Validators.cpp
src/CollectionAPI/CMakeLists.txt
src/CollectionAPI/CollectionAPI.i
src/CollectionPlugin/CMakeLists.txt
src/CollectionPlugin/CollectionPlugin_GroupAddition.cpp
src/CollectionPlugin/CollectionPlugin_GroupAddition.h
src/CollectionPlugin/CollectionPlugin_Plugin.cpp
src/ConnectorPlugin/ConnectorPlugin_ExportFeature.py
src/ConnectorPlugin/ConnectorPlugin_PublishToStudyFeature.py
src/ConstructionPlugin/ConstructionPlugin_Axis.cpp
src/ConstructionPlugin/ConstructionPlugin_Axis.h
src/ConstructionPlugin/ConstructionPlugin_Plane.cpp
src/ConstructionPlugin/ConstructionPlugin_Plane.h
src/ConstructionPlugin/ConstructionPlugin_Plugin.cpp
src/ConstructionPlugin/ConstructionPlugin_Point.cpp
src/ConstructionPlugin/ConstructionPlugin_Point.h
src/ExchangeAPI/ExchangeAPI.i
src/ExchangeAPI/ExchangeAPI_Import.cpp
src/ExchangeAPI/ExchangeAPI_Import.h
src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp
src/ExchangePlugin/ExchangePlugin_Import.cpp
src/ExchangePlugin/ExchangePlugin_Import.h
src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp
src/ExchangePlugin/ExchangePlugin_ImportFeature.h
src/ExchangePlugin/ExchangePlugin_Plugin.cpp
src/ExchangePlugin/plugin-Exchange.xml
src/FeaturesPlugin/FeaturesPlugin_Measurement.cpp
src/FeaturesPlugin/FeaturesPlugin_MultiRotation.cpp
src/FeaturesPlugin/FeaturesPlugin_MultiTranslation.cpp
src/FeaturesPlugin/FeaturesPlugin_Placement.cpp
src/FeaturesPlugin/FeaturesPlugin_Rotation.cpp
src/FeaturesPlugin/FeaturesPlugin_Scale.cpp
src/FeaturesPlugin/FeaturesPlugin_Symmetry.cpp
src/FeaturesPlugin/FeaturesPlugin_Symmetry.h
src/FeaturesPlugin/FeaturesPlugin_Tools.cpp
src/FeaturesPlugin/FeaturesPlugin_Tools.h
src/FeaturesPlugin/FeaturesPlugin_Translation.cpp
src/GeomAPI/GeomAPI_ICustomPrs.h
src/GeomAlgoAPI/CMakeLists.txt
src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.cpp
src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.h
src/Model/Model_ResultBody.cpp
src/Model/Model_ResultBody.h
src/Model/Model_ResultConstruction.cpp
src/ModelAPI/ModelAPI_Object.h
src/ModelAPI/ModelAPI_ResultConstruction.cpp
src/ModelAPI/ModelAPI_ResultConstruction.h
src/ModelHighAPI/ModelHighAPI_RefAttr.h
src/PartSet/CMakeLists.txt
src/PartSet/PartSet_CustomPrs.cpp
src/PartSet/PartSet_Module.cpp
src/PartSet/PartSet_Module.h
src/PartSet/PartSet_SketcherMgr.cpp
src/PartSet/PartSet_Tools.cpp
src/PythonAPI/model/collection/__init__.py
src/PythonAPI/model/exchange/__init__.py
src/PythonAddons/CMakeLists.txt
src/PythonAddons/macros/rectangle/feature.py
src/PythonAddons/tests.set
src/SketchAPI/SketchAPI_Rectangle.cpp
src/SketchAPI/SketchAPI_Rectangle.h
src/SketchAPI/SketchAPI_Sketch.cpp
src/SketchAPI/SketchAPI_Sketch.h
src/SketchPlugin/SketchPlugin_ConstraintBase.h
src/SketchPlugin/doc/examples/rectangle.py
src/XGUI/XGUI_FacesPanel.cpp
src/XGUI/XGUI_FacesPanel.h
src/XGUI/XGUI_Workshop.cpp
src/XGUI/XGUI_Workshop.h

Simple merge
Simple merge
Simple merge
index 5c21259db8b6575457fb83abedf77342479293b3,a5d8ed26e7dd7f2d485e49a0bfb69712e285a4f8..8da67a31e500acbca80415d537c4c02ffd7e82ec
@@@ -90,8 -90,11 +90,11 @@@ class PublishToStudyFeature(ModelAPI.Mo
            # Map from feature index to index of result. If index is zero (initial), no surrfix to entry is added.
            aFeaturesIndices = {}
            for aResId in range(aPartDoc.size(model.ModelAPI_ResultBody_group())):
 -            aResObject = aPartDoc.object(model.ModelAPI_ResultBody_group(), aResId)         
 +            aResObject = aPartDoc.object(model.ModelAPI_ResultBody_group(), aResId)
              aRes = model.objectToResult(aResObject)
 -              continue    
+             #do not export images
+             if aRes.hasTextureFile() is True:
++              continue
              aResFeatureId = str(aPartDoc.feature(aRes).data().featureId())
              if aResFeatureId in aFeaturesIndices:
                aFeaturesIndices[aResFeatureId] += 1
Simple merge
index 50fcec25357d736da1bf92bbedc0c95add480f4b,eee356406124576f5ba4a1dc588b5e34c803bfe6..cee25a91a359be46e5c3cf43256676ac8ac71d40
@@@ -205,3 -205,52 +205,51 @@@ void importPart(const std::shared_ptr<M
    if (aCurrentFeature)
      thePart->setCurrentFeature(aCurrentFeature, THE_VISIBLE_FEATURE);
  }
 -
+ //-------------------------------------------------------------------------------------------------
+ //-------------------------------------------------------------------------------------------------
+ ExchangeAPI_Import_Image::ExchangeAPI_Import_Image(
+     const std::shared_ptr<ModelAPI_Feature> & theFeature)
+ : ModelHighAPI_Interface(theFeature)
+ {
+   initialize();
+ }
+ ExchangeAPI_Import_Image::ExchangeAPI_Import_Image(
+     const std::shared_ptr<ModelAPI_Feature> & theFeature,
+     const std::string & theFilePath)
+ : ModelHighAPI_Interface(theFeature)
+ {
+   if (initialize())
+     setFilePath(theFilePath);
+ }
+ void ExchangeAPI_Import_Image::setFilePath(const std::string & theFilePath)
+ {
+   fillAttribute(theFilePath, myfilePath);
+   execute();
+ }
+ ImportImagePtr addImportImage(
+     const std::shared_ptr<ModelAPI_Document> & thePart,
+     const std::string & theFilePath)
+ {
+   std::shared_ptr<ModelAPI_Feature> aFeature = thePart->addFeature(ExchangeAPI_Import_Image::ID());
+   return ImportImagePtr(new ExchangeAPI_Import_Image(aFeature, theFilePath));
+ }
+ void ExchangeAPI_Import_Image::dump(ModelHighAPI_Dumper& theDumper) const
+ {
+   FeaturePtr aBase = feature();
+   std::string aPartName = theDumper.name(aBase->document());
+   std::string aFilePath =
+       aBase->string(ExchangePlugin_Import_ImageFeature::FILE_PATH_ID())->value();
+   theDumper << aBase << " = model.addImportImage(" << aPartName << ", \""
+             << aFilePath << "\")" << std::endl;
+   // to make import have results
+   theDumper << "model.do()" << std::endl;
+ }
Simple merge
index 16b5c015877f9a18ee450012330d2910d037e9df,37376e1983248029d42732f24eb02bd79fca6c4c..46618aba5893e100dec2f281c00c18e1db96310a
   *
   * The list of supported formats is defined in the configuration file.
   */
- class ExchangePlugin_ImportFeature : public ModelAPI_CompositeFeature
+ class ExchangePlugin_ImportFeatureBase : public ModelAPI_CompositeFeature
  {
-  public:
-   /// Feature kind
-   inline static const std::string& ID()
-   {
-     static const std::string MY_IMPORT_ID("Import");
-     return MY_IMPORT_ID;
-   }
-   /// Feature kind
-   inline static const std::string& IMPORT_TYPE_ID()
-   {
-     static const std::string MY_IMPORT_TYPE_ID("ImportType");
-     return MY_IMPORT_TYPE_ID;
-   }
 - public:  
++public:
    /// attribute name of file path
    inline static const std::string& FILE_PATH_ID()
    {
index 8f2445633b0dab154da16465c5bc8ad8023cefa5,c6f58a196aa9842bbace3d4d88e2a2fa2f78deb6..80f60a429cc83eebbba294f2de2b09819fea8ace
                </groupbox>
              </groupbox>
            </case>
 -        </switch>      
 +        </switch>
+ </feature>
+       <feature id="ImportImageMacro" title="Import" tooltip="Import a file" icon="icons/Exchange/import.png"
+                helpfile="importFeature.html"
+                internal="1">
+         <file_selector id="file_path" title="Import image file" path="">
+           <validator id="ExchangePlugin_ImportFormat" parameters="GIF|TIFF|PNG|JPG|JPEG|BMP|PPM|JPE:Image" />
+         </file_selector>
+         <choice id="target_part"
+                 string_list_attribute="target_parts_list"
+                 label="Import to"
+                 tooltip="Select the image to import the document" />
        </feature>
        <feature id="Import" title="Import" tooltip="Import a file" icon="icons/Exchange/import.png"
                 helpfile="importFeature.html" internal="1">
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index ecda87d267d28f202397a436d1e2630626e31748,0000000000000000000000000000000000000000..a71c233376167b1a215b8cb37e15261b4afdea32
mode 100644,000000..100644
--- /dev/null
@@@ -1,24 -1,0 +1,25 @@@
 +# Copyright (C) 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
 +#
 +
 +SET(TEST_NAMES
 +  TestRectangle.py
++  TestRectangleCentered.py
 +  TestcompoundVertices.py
 +  TestimportParameters.py
 +)
Simple merge
Simple merge
Simple merge
Simple merge
index 1795cf62c376b06387bf84204e60e04fd07824b0,c9f785103cd7f6aa6711d4c772dfdd8ce345386f..81d8910ff176c1e3e56c41d9aa796dad6d18bd22
@@@ -6,5 -7,10 +7,10 @@@ Part_1 = model.addPart(partSet
  Part_1_doc = Part_1.document()
  Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
  Rectangle_1 = Sketch_1.addRectangle(5.5, 8.5, 31.3, 78.9)
 -# rectangle from center and end points 
++# rectangle from center and end points
+ center = geom.Pnt2d(10, 5)
+ corner = geom.Pnt2d(25, 75)
+ rectangle_2 = sketch.addRectangleCentered(center, corner)
  model.do()
  model.end()
Simple merge
Simple merge
Simple merge
Simple merge