Salome HOME
Fix coding style problems.
[modules/shaper.git] / src / ModelAPI / ModelAPI_Tools.h
old mode 100755 (executable)
new mode 100644 (file)
index e302d19..b0af552
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  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
 //
 // 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 ModelAPI_Tools_HeaderFile
@@ -126,7 +125,8 @@ MODELAPI_EXPORT bool hasSubResults(const std::shared_ptr<ModelAPI_Result>& theRe
 *  collects recursively all subs of the given result
 */
 MODELAPI_EXPORT void allSubs(const std::shared_ptr<ModelAPI_ResultBody>& theResult,
-                             std::list<std::shared_ptr<ModelAPI_Result> >& theResults);
+                             std::list<std::shared_ptr<ModelAPI_Result> >& theResults,
+                             const bool theLowerOnly = false);
 
 /*!
 * Adds the results of the given feature to theResults list: including disabled and sub-results
@@ -200,6 +200,42 @@ MODELAPI_EXPORT void getConcealedResults(const std::shared_ptr<ModelAPI_Feature>
  */
 MODELAPI_EXPORT std::pair<std::string, bool> getDefaultName(
   const std::shared_ptr<ModelAPI_Result>& theResult, const bool theInherited = true);
+
+/*! Collect all parents for the given feature, including the Part
+ */
+MODELAPI_EXPORT std::set<std::shared_ptr<ModelAPI_Feature> >
+    getParents(const std::shared_ptr<ModelAPI_Feature>& theFeature);
+
+/*! Creates a remove result features with the given results
+*/
+MODELAPI_EXPORT void removeResults(const std::list<std::shared_ptr<ModelAPI_Result> >& theResults);
+
+/*! Returns current deflection in the given result
+* \param theResult a result object
+* \return a deflection value or -1 if it was not defined
+*/
+MODELAPI_EXPORT double getDeflection(const std::shared_ptr<ModelAPI_Result>& theResult);
+
+/*! Returns current color of the current result
+* \param[in] theResult a result object
+* \param[out] theColor a color values if it is defined
+*/
+MODELAPI_EXPORT void getColor(const std::shared_ptr<ModelAPI_Result>& theResult,
+  std::vector<int>& theColor);
+
+/*! Returns current transparency in the given result
+* \param theResult a result object
+* \return a transparency value or -1 if it was not defined
+*/
+MODELAPI_EXPORT double getTransparency(const std::shared_ptr<ModelAPI_Result>& theResult);
+
+/*! Copies all visualization attributes from one result to another.
+* \param theSource a result that contains the copied attributes
+* \param theDest a destination result that takes the visualization attributes
+*/
+MODELAPI_EXPORT void copyVisualizationAttrs(std::shared_ptr<ModelAPI_Result> theSource,
+                                            std::shared_ptr<ModelAPI_Result> theDest);
+
 }
 
 #endif