Salome HOME
lots 3,8
[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_RTTIEXT(HYDROData_DummyObject3D,HYDROData_Entity)
29
30 HYDROData_DummyObject3D::HYDROData_DummyObject3D()
31 : HYDROData_Entity( Geom_3d )
32 {
33 }
34
35 HYDROData_DummyObject3D::~HYDROData_DummyObject3D()
36 {
37 }
38
39 QString HYDROData_DummyObject3D::GetName() const
40 {
41   QString aName;
42
43   Handle(HYDROData_Object) aFatherObj = GetObject();
44   if ( !aFatherObj.IsNull() )
45     aName = aFatherObj->GetName();
46
47   aName += "_3D";
48
49   return aName;
50 }
51
52 bool HYDROData_DummyObject3D::CanBeUpdated() const
53 {
54   return false;
55 }
56
57 bool HYDROData_DummyObject3D::CanRemove()
58 {
59   return false;
60 }
61
62 Handle(HYDROData_Object) HYDROData_DummyObject3D::GetObject() const
63 {
64   return Handle(HYDROData_Object)::DownCast( GetFatherObject() );
65 }
66
67 TopoDS_Shape HYDROData_DummyObject3D::GetShape() const
68 {
69   TopoDS_Shape aResShape;
70
71   Handle(HYDROData_Object) aFatherObj = GetObject();
72   if ( !aFatherObj.IsNull() )
73     aResShape = aFatherObj->GetShape3D();
74
75   return aResShape;
76 }
77
78 QColor HYDROData_DummyObject3D::GetFillingColor() const
79 {
80   QColor aResColor( Qt::yellow );
81
82   Handle(HYDROData_Object) aFatherObj = GetObject();
83   if ( !aFatherObj.IsNull() )
84     aResColor = aFatherObj->GetFillingColor();
85
86   return aResColor;
87 }
88
89 QColor HYDROData_DummyObject3D::GetBorderColor() const
90 {
91   QColor aResColor( Qt::transparent );
92
93   Handle(HYDROData_Object) aFatherObj = GetObject();
94   if ( !aFatherObj.IsNull() )
95     aResColor = aFatherObj->GetBorderColor();
96
97   return aResColor;
98 }
99
100