Salome HOME
Adjust unit tests
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI_Selection.h
index b138b8f009962002f990485681593e80e997f573..21da1cdfe188790a4c1f30c6876c21c378f9472d 100644 (file)
@@ -1,8 +1,22 @@
-// Name   : ModelHighAPI_Selection.h
-// Purpose: 
+// Copyright (C) 2014-2017  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<mailto:webmaster.salome@opencascade.com>
 //
-// History:
-// 06/06/16 - Sergey POKHODENKO - Creation of the file
 
 #ifndef SRC_MODELHIGHAPI_MODELHIGHAPI_SELECTION_H_
 #define SRC_MODELHIGHAPI_MODELHIGHAPI_SELECTION_H_
@@ -19,7 +33,8 @@ class ModelAPI_AttributeSelection;
 class ModelAPI_AttributeSelectionList;
 class ModelAPI_Result;
 //--------------------------------------------------------------------------------------
-typedef std::pair<std::shared_ptr<ModelAPI_Result>, std::shared_ptr<GeomAPI_Shape> > ResultSubShapePair;
+typedef std::pair<std::shared_ptr<ModelAPI_Result>, std::shared_ptr<GeomAPI_Shape> >
+  ResultSubShapePair;
 typedef std::pair<std::string, std::string> TypeSubShapeNamePair;
 //--------------------------------------------------------------------------------------
 /**\class ModelHighAPI_Selection
@@ -43,7 +58,8 @@ public:
   /// Constructor for result and sub-shape
   MODELHIGHAPI_EXPORT
   ModelHighAPI_Selection(const std::shared_ptr<ModelAPI_Result>& theContext,
-                         const std::shared_ptr<GeomAPI_Shape>& theSubShape = std::shared_ptr<GeomAPI_Shape>());
+                         const std::shared_ptr<GeomAPI_Shape>& theSubShape =
+                         std::shared_ptr<GeomAPI_Shape>());
   /// Constructor for sub-shape by the textual Name
   MODELHIGHAPI_EXPORT
   ModelHighAPI_Selection(const std::string& theType,
@@ -53,12 +69,12 @@ public:
   virtual ~ModelHighAPI_Selection();
 
   /// Fill attribute values
-  MODELHIGHAPI_EXPORT
-  virtual void fillAttribute(const std::shared_ptr<ModelAPI_AttributeSelection> & theAttribute) const;
+  MODELHIGHAPI_EXPORT virtual
+    void fillAttribute(const std::shared_ptr<ModelAPI_AttributeSelection> & theAttribute) const;
 
   /// Append to list attribute
-  MODELHIGHAPI_EXPORT
-  virtual void appendToList(const std::shared_ptr<ModelAPI_AttributeSelectionList> & theAttribute) const;
+  MODELHIGHAPI_EXPORT virtual
+    void appendToList(const std::shared_ptr<ModelAPI_AttributeSelectionList> & theAttribute) const;
 
   /// \return variant type.
   MODELHIGHAPI_EXPORT
@@ -80,10 +96,30 @@ public:
   MODELHIGHAPI_EXPORT
   void setName(const std::string& theName);
 
+  /// Shortcut for result()->data()->name()
+  MODELHIGHAPI_EXPORT
+  std::string name() const;
+
   /// Change result's color
   MODELHIGHAPI_EXPORT
   void setColor(int theRed, int theGreen, int theBlue);
 
+  /// 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;
+
+  /// Returns the sub-result by zero-base index.
+  MODELHIGHAPI_EXPORT
+  ModelHighAPI_Selection subResult(int theIndex) const;
+
 private:
   VariantType myVariantType;
   ResultSubShapePair myResultSubShapePair;