Salome HOME
Porting to the current version of TInspector.
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI_Dumper.h
index ee432d271dad58dee3cf395d979d814d9324e456..b9478e61c2c00321c44acf6730943678c62adde0 100644 (file)
@@ -1,8 +1,22 @@
-// Copyright (C) 2016-20xx CEA/DEN, EDF R&D -->
-
-// File:        ModelHighAPI_Dumper.h
-// Created:     1 August 2016
-// Author:      Artem ZHIDKOV
+// 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>
+//
 
 #ifndef ModelHighAPI_Dumper_H_
 #define ModelHighAPI_Dumper_H_
@@ -103,6 +117,11 @@ public:
   /// Dump given feature
   virtual void dumpFeature(const FeaturePtr& theFeature, const bool theForce = false) = 0;
 
+  /// Set a feature that should not be dumped anyway
+  MODELHIGHAPI_EXPORT
+  void doNotDumpFeature(const FeaturePtr& theFeature)
+  { myFeaturesToSkip.insert(theFeature); }
+
   /// Dump sub-feature name and color, without dumping feature creation.
   /// Used for features which creates sub-features in their execute method.
   /// \param theSubFeatureGet [in] method for getting sub-feature (e.g. "Feature_1.subFeature(0)")
@@ -264,11 +283,15 @@ private:
     std::string myCurrentName; ///< default name of current feature
     std::string myUserName;    ///< user-defined name
     bool        myIsDefault;   ///< \c true if the name is default
+    bool        myIsDumped;    ///< shows that the names of the feature are already stored
 
     EntityName() {}
 
     EntityName(const std::string& theCurName, const std::string& theUserName, bool theDefault)
-      : myCurrentName(theCurName), myUserName(theUserName), myIsDefault(theDefault)
+      : myCurrentName(theCurName),
+        myUserName(theUserName),
+        myIsDefault(theDefault),
+        myIsDumped(false)
     {}
   };
 
@@ -300,6 +323,9 @@ private:
 
   NbFeaturesMap       myFeatureCount;       ///< number of features of each kind
 
+  /// features which should not be dumped (like coincidence and tangency created by tangent arc)
+  std::set<FeaturePtr> myFeaturesToSkip;
+
 protected:
    /// list of entities, used by other features but not dumped yet
   std::set<EntityPtr> myNotDumpedEntities;