Salome HOME
Adding test for bos #41748 [CEA] Issue in interpolation edition
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI_Selection.h
index c89b414fb8fe56c33cf750c97c596bbba6806c12..dc27c474fce58e15dbb22f2446401bc859c29afe 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2024  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef SRC_MODELHIGHAPI_MODELHIGHAPI_SELECTION_H_
 //--------------------------------------------------------------------------------------
 #include "ModelHighAPI.h"
 
+#include <list>
 #include <memory>
 #include <string>
 #include <utility>
 //--------------------------------------------------------------------------------------
+class GeomAPI_Pnt;
 class GeomAPI_Shape;
 class ModelAPI_AttributeSelection;
 class ModelAPI_AttributeSelectionList;
+class ModelAPI_FiltersFeature;
 class ModelAPI_Result;
 //--------------------------------------------------------------------------------------
 typedef std::pair<std::shared_ptr<ModelAPI_Result>, std::shared_ptr<GeomAPI_Shape> >
   ResultSubShapePair;
-typedef std::pair<std::string, std::string> TypeSubShapeNamePair;
+typedef std::pair<std::string, std::wstring> TypeSubShapeNamePair;
+typedef std::pair<std::string, std::shared_ptr<GeomAPI_Pnt> > TypeInnerPointPair;
+typedef std::pair<std::string, std::pair<std::wstring, int> > TypeWeakNamingPair;
 //--------------------------------------------------------------------------------------
 /**\class ModelHighAPI_Selection
  * \ingroup CPPHighAPI
@@ -47,7 +51,10 @@ public:
   enum VariantType {
     VT_Empty,
     VT_ResultSubShapePair,
-    VT_TypeSubShapeNamePair
+    VT_TypeSubShapeNamePair,
+    VT_TypeInnerPointPair,
+    VT_WeakNamingPair,
+    VT_Filtering
   };
 
 public:
@@ -63,7 +70,24 @@ public:
   /// Constructor for sub-shape by the textual Name
   MODELHIGHAPI_EXPORT
   ModelHighAPI_Selection(const std::string& theType,
-                         const std::string& theSubShapeName);
+                         const std::wstring& theSubShapeName);
+
+  /// Constructor for sub-shape by inner point coordinates
+  MODELHIGHAPI_EXPORT
+  ModelHighAPI_Selection(const std::string& theType,
+                         const std::shared_ptr<GeomAPI_Pnt>& theSubShapeInnerPoint);
+
+  /// Constructor for sub-shape by inner point coordinates given by a tuple
+  MODELHIGHAPI_EXPORT
+  ModelHighAPI_Selection(const std::string& theType,
+                         const std::list<double>& theSubShapeInnerPoint);
+
+
+  /// Constructor for sub-shape by weak naming identifier
+  MODELHIGHAPI_EXPORT
+    ModelHighAPI_Selection(const std::string& theType,
+      const std::wstring& theContextName, const int theIndex);
+
   /// Destructor
   MODELHIGHAPI_EXPORT
   virtual ~ModelHighAPI_Selection();
@@ -88,22 +112,38 @@ public:
   MODELHIGHAPI_EXPORT
   virtual TypeSubShapeNamePair typeSubShapeNamePair() const;
 
+  /// \return pair of sub-shape type and inner point to identify sub-shape.
+  MODELHIGHAPI_EXPORT
+  virtual TypeInnerPointPair typeInnerPointPair() const;
+
+  /// \return pair of sub-shape type and pair of context name and sub-shape index.
+  MODELHIGHAPI_EXPORT
+    virtual TypeWeakNamingPair typeWeakNamingPair() const;
+
   /// \return shape type.
   MODELHIGHAPI_EXPORT
   virtual std::string shapeType() const;
 
   /// Shortcut for result()->data()->setName()
   MODELHIGHAPI_EXPORT
-  void setName(const std::string& theName);
+  void setName(const std::wstring& theName);
+
+  /// Shortcut for result()->data()->name()
+  MODELHIGHAPI_EXPORT
+  std::wstring name() const;
 
   /// Change result's color
   MODELHIGHAPI_EXPORT
-  void setColor(int theRed, int theGreen, int theBlue);
+  void setColor(int theRed = 0, int theGreen = 0, int theBlue = 0, bool random = false);
 
   /// Change result's deflection
   MODELHIGHAPI_EXPORT
   void setDeflection(double theValue);
 
+  /// Change result's transparency
+  MODELHIGHAPI_EXPORT
+  void setTransparency(double theValue);
+
   /// Returns the number of sub-elements.
   MODELHIGHAPI_EXPORT
   int numberOfSubs() const;
@@ -112,10 +152,13 @@ public:
   MODELHIGHAPI_EXPORT
   ModelHighAPI_Selection subResult(int theIndex) const;
 
-private:
+protected:
   VariantType myVariantType;
   ResultSubShapePair myResultSubShapePair;
   TypeSubShapeNamePair myTypeSubShapeNamePair;
+  TypeInnerPointPair myTypeInnerPointPair;
+  TypeWeakNamingPair myWeakNamingPair;
+  std::shared_ptr<ModelAPI_FiltersFeature> myFilterFeature;
 };
 
 //--------------------------------------------------------------------------------------