Salome HOME
df38078059118445d3b3e78b5570c32f4f87caaa
[modules/gui.git] / src / OBJECT / SALOME_AISObject.ixx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  SALOME OBJECT : implementation of interactive object visualization for OCC and VTK viewers
23 //  File   : SALOME_AISObject.ixx
24 //  Module : SALOME
25 //
26 #include "SALOME_AISObject.jxx"
27
28 #ifndef _Standard_TypeMismatch_HeaderFile
29 #include <Standard_TypeMismatch.hxx>
30 #endif
31
32 SALOME_AISObject::~SALOME_AISObject() {}
33  
34
35
36 Standard_EXPORT Handle_Standard_Type& SALOME_AISObject_Type_()
37 {
38
39     static Handle_Standard_Type aType1 = STANDARD_TYPE(AIS_InteractiveObject);
40   if ( aType1.IsNull()) aType1 = STANDARD_TYPE(AIS_InteractiveObject);
41   static Handle_Standard_Type aType2 = STANDARD_TYPE(SelectMgr_SelectableObject);
42   if ( aType2.IsNull()) aType2 = STANDARD_TYPE(SelectMgr_SelectableObject);
43   static Handle_Standard_Type aType3 = STANDARD_TYPE(PrsMgr_PresentableObject);
44   if ( aType3.IsNull()) aType3 = STANDARD_TYPE(PrsMgr_PresentableObject);
45   static Handle_Standard_Type aType4 = STANDARD_TYPE(MMgt_TShared);
46   if ( aType4.IsNull()) aType4 = STANDARD_TYPE(MMgt_TShared);
47   static Handle_Standard_Type aType5 = STANDARD_TYPE(Standard_Transient);
48   if ( aType5.IsNull()) aType5 = STANDARD_TYPE(Standard_Transient);
49  
50
51   static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,aType4,aType5,NULL};
52   static Handle_Standard_Type _aType = new Standard_Type("SALOME_AISObject",
53                                                          sizeof(SALOME_AISObject),
54                                                          1,
55                                                          (Standard_Address)_Ancestors,
56                                                          (Standard_Address)NULL);
57
58   return _aType;
59 }
60
61
62 // DownCast method
63 //   allow safe downcasting
64 //
65 const Handle(SALOME_AISObject) Handle(SALOME_AISObject)::DownCast(const Handle(Standard_Transient)& AnObject) 
66 {
67   Handle(SALOME_AISObject) _anOtherObject;
68
69   if (!AnObject.IsNull()) {
70      if (AnObject->IsKind(STANDARD_TYPE(SALOME_AISObject))) {
71        _anOtherObject = Handle(SALOME_AISObject)((Handle(SALOME_AISObject)&)AnObject);
72      }
73   }
74
75   return _anOtherObject ;
76 }
77 const Handle(Standard_Type)& SALOME_AISObject::DynamicType() const 
78
79   return STANDARD_TYPE(SALOME_AISObject) ; 
80 }
81 Standard_Boolean SALOME_AISObject::IsKind(const Handle(Standard_Type)& AType) const 
82
83   return (STANDARD_TYPE(SALOME_AISObject) == AType || AIS_InteractiveObject::IsKind(AType)); 
84 }
85 Handle_SALOME_AISObject::~Handle_SALOME_AISObject() {}
86