Salome HOME
Update copyright information
[modules/geom.git] / src / GEOMImpl / GEOMImpl_Template.cxx
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 #include <Standard_Stream.hxx>
23
24 #include <GEOMImpl_Template.hxx>
25 #include <GEOM_Function.hxx>
26 #include <TopoDS_Shape.hxx>
27
28 //=======================================================================
29 //function : GetID
30 //purpose  :
31 //======================================================================= 
32 const Standard_GUID& GEOMImpl_Template::GetID()
33 {
34   static Standard_GUID aTemplate("Insert the correct GUID here");
35   return aTemplate; 
36 }
37
38
39 //=======================================================================
40 //function : GEOMImpl_Template
41 //purpose  : 
42 //=======================================================================
43
44 GEOMImpl_Template::GEOMImpl_Template() 
45 {
46 }
47
48 //=======================================================================
49 //function : Execute
50 //purpose  :
51 //======================================================================= 
52 Standard_Integer GEOMImpl_Template::Execute(TFunction_Logbook& log) const
53 {
54   if (Label().IsNull()) return 0;
55   Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label()); 
56   if(aFunction.IsNull()) return 0;
57   
58   //Add implemetation here
59   
60   log.SetTouched(Label());
61   return 1;    
62 }
63
64
65 //=======================================================================
66 //function :  GEOMImpl_Template_Type_
67 //purpose  :
68 //======================================================================= 
69 Standard_EXPORT Handle_Standard_Type& GEOMImpl_Template_Type_()
70 {
71
72   static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver);
73   if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver);
74   static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
75   if ( aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared); 
76   static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
77   if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);
78  
79
80   static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
81   static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_Template",
82                                                          sizeof(GEOMImpl_Template),
83                                                          1,
84                                                          (Standard_Address)_Ancestors,
85                                                          (Standard_Address)NULL);
86
87   return _aType;
88 }
89
90 //=======================================================================
91 //function : DownCast
92 //purpose  :
93 //======================================================================= 
94
95 const Handle(GEOMImpl_Template) Handle(GEOMImpl_Template)::DownCast(const Handle(Standard_Transient)& AnObject)
96 {
97   Handle(GEOMImpl_Template) _anOtherObject;
98
99   if (!AnObject.IsNull()) {
100      if (AnObject->IsKind(STANDARD_TYPE(GEOMImpl_Template))) {
101        _anOtherObject = Handle(GEOMImpl_Template)((Handle(GEOMImpl_Template)&)AnObject);
102      }
103   }
104
105   return _anOtherObject ;
106 }
107
108