]> SALOME platform Git repositories - modules/hydro.git/blob - src/HYDROData/HYDROData_DummyObject3D.cxx
Salome HOME
Merge branch 'BR_LAND_COVER_MAP' of ssh://git.salome-platform.org/modules/hydro into...
[modules/hydro.git] / src / HYDROData / HYDROData_DummyObject3D.cxx
1 // Copyright (C) 2014-2015  EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
6 //
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
10 // Lesser General Public License for more details.
11 //
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
15 //
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
17 //
18
19 #include "HYDROData_DummyObject3D.h"
20
21 #include "HYDROData_Object.h"
22
23 #include <TopoDS_Shape.hxx>
24
25 #include <QString>
26 #include <QColor>
27
28 IMPLEMENT_STANDARD_HANDLE(HYDROData_DummyObject3D,HYDROData_Entity)
29 IMPLEMENT_STANDARD_RTTIEXT(HYDROData_DummyObject3D,HYDROData_Entity)
30
31 HYDROData_DummyObject3D::HYDROData_DummyObject3D()
32 : HYDROData_Entity( Geom_3d )
33 {
34 }
35
36 HYDROData_DummyObject3D::~HYDROData_DummyObject3D()
37 {
38 }
39
40 QString HYDROData_DummyObject3D::GetName() const
41 {
42   QString aName;
43
44   Handle(HYDROData_Object) aFatherObj = GetObject();
45   if ( !aFatherObj.IsNull() )
46     aName = aFatherObj->GetName();
47
48   aName += "_3D";
49
50   return aName;
51 }
52
53 bool HYDROData_DummyObject3D::CanBeUpdated() const
54 {
55   return false;
56 }
57
58 bool HYDROData_DummyObject3D::CanRemove()
59 {
60   return false;
61 }
62
63 Handle(HYDROData_Object) HYDROData_DummyObject3D::GetObject() const
64 {
65   return Handle(HYDROData_Object)::DownCast( GetFatherObject() );
66 }
67
68 TopoDS_Shape HYDROData_DummyObject3D::GetShape() const
69 {
70   TopoDS_Shape aResShape;
71
72   Handle(HYDROData_Object) aFatherObj = GetObject();
73   if ( !aFatherObj.IsNull() )
74     aResShape = aFatherObj->GetShape3D();
75
76   return aResShape;
77 }
78
79 QColor HYDROData_DummyObject3D::GetFillingColor() const
80 {
81   QColor aResColor( Qt::yellow );
82
83   Handle(HYDROData_Object) aFatherObj = GetObject();
84   if ( !aFatherObj.IsNull() )
85     aResColor = aFatherObj->GetFillingColor();
86
87   return aResColor;
88 }
89
90 QColor HYDROData_DummyObject3D::GetBorderColor() const
91 {
92   QColor aResColor( Qt::transparent );
93
94   Handle(HYDROData_Object) aFatherObj = GetObject();
95   if ( !aFatherObj.IsNull() )
96     aResColor = aFatherObj->GetBorderColor();
97
98   return aResColor;
99 }
100
101