Salome HOME
Sorting alphabetically.
[modules/hydro.git] / src / HYDROData / HYDROData_Region.cxx
index 2550de1fc64a201805403504060d4227c42ee2a2..166806535995977ecdb0d576de304e449544c235 100644 (file)
@@ -1,6 +1,10 @@
 
 #include "HYDROData_Region.h"
 
+#include <TNaming_Builder.hxx>
+#include <TNaming_NamedShape.hxx>
+#include <TopoDS.hxx>
+
 #include <QString>
 
 #define PYTHON_REGION_ID "KIND_REGION"
@@ -18,6 +22,20 @@ HYDROData_Region::~HYDROData_Region()
 {
 }
 
+void HYDROData_Region::SetFace( const TopoDS_Face& theFace )
+{
+  TNaming_Builder aBuilder( myLab );
+  aBuilder.Generated( theFace );
+}
+
+TopoDS_Face HYDROData_Region::Face() const
+{
+  Handle(TNaming_NamedShape) aNamedShape;
+  if( myLab.FindAttribute( TNaming_NamedShape::GetID(), aNamedShape ) )
+    return TopoDS::Face( aNamedShape->Get() );
+  return TopoDS_Face();
+}
+
 QString HYDROData_Region::getPythonKindId() const
 {
   return QString( PYTHON_REGION_ID );