Salome HOME
Deny to create landcovers on the self-intersection wires/polyline
[modules/hydro.git] / src / HYDROData / HYDROData_Object.cxx
index 7204f97fde1bf06c1bcdec4e5cf52457713122ba..25b9e2625187447f1a6a2ad224eb99c530b2da13 100644 (file)
@@ -1,3 +1,20 @@
+// Copyright (C) 2014-2015  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
+//
 
 #include "HYDROData_Object.h"
 
@@ -11,6 +28,7 @@
 #include <TNaming_NamedShape.hxx>
 
 #include <TopoDS_Shape.hxx>
+#include <TDataStd_Integer.hxx>
 
 #include <QColor>
 
@@ -359,3 +377,20 @@ void HYDROData_Object::removeShape3D()
     aLabel.ForgetAllAttributes();
 }
 
+bool HYDROData_Object::IsSubmersible() const
+{
+  Handle(TDataStd_Integer) aSubMersibleAttr;
+
+  bool isSubmersible = true; //default
+  if( myLab.FindAttribute(TDataStd_Integer::GetID(), aSubMersibleAttr ) )
+  {
+    int aValue = aSubMersibleAttr->Get();
+    isSubmersible = ( aValue != 0 );
+  }
+  return isSubmersible;
+}
+
+void HYDROData_Object::SetIsSubmersible( bool isSubmersible ) const
+{
+  TDataStd_Integer::Set( myLab, isSubmersible ? 1 : 0 );
+}