Salome HOME
Join modifications from branch OCC_development_for_3_2_0a2
[modules/geom.git] / src / GEOMImpl / GEOMImpl_Template.cxx
1 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 // 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either 
7 // version 2.1 of the License.
8 // 
9 // This library is distributed in the hope that it will be useful 
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 // Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public  
15 // License along with this library; if not, write to the Free Software 
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 // See http://www.salome-platform.org/
19 //
20
21 #include <Standard_Stream.hxx>
22
23 #include <GEOMImpl_Template.hxx>
24 #include <GEOM_Function.hxx>
25 #include <TopoDS_Shape.hxx>
26
27 //=======================================================================
28 //function : GetID
29 //purpose  :
30 //======================================================================= 
31 const Standard_GUID& GEOMImpl_Template::GetID()
32 {
33   static Standard_GUID aTemplate("Insert the correct GUID here");
34   return aTemplate; 
35 }
36
37
38 //=======================================================================
39 //function : GEOMImpl_Template
40 //purpose  : 
41 //=======================================================================
42
43 GEOMImpl_Template::GEOMImpl_Template() 
44 {
45 }
46
47 //=======================================================================
48 //function : Execute
49 //purpose  :
50 //======================================================================= 
51 Standard_Integer GEOMImpl_Template::Execute(TFunction_Logbook& log) const
52 {
53   if (Label().IsNull()) return 0;
54   Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label()); 
55   if(aFunction.IsNull()) return 0;
56   
57   //Add implemetation here
58   
59   log.SetTouched(Label());
60   return 1;    
61 }
62
63
64 //=======================================================================
65 //function :  GEOMImpl_Template_Type_
66 //purpose  :
67 //======================================================================= 
68 Standard_EXPORT Handle_Standard_Type& GEOMImpl_Template_Type_()
69 {
70
71   static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver);
72   if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver);
73   static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
74   if ( aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared); 
75   static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
76   if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);
77  
78
79   static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
80   static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_Template",
81                                                          sizeof(GEOMImpl_Template),
82                                                          1,
83                                                          (Standard_Address)_Ancestors,
84                                                          (Standard_Address)NULL);
85
86   return _aType;
87 }
88
89 //=======================================================================
90 //function : DownCast
91 //purpose  :
92 //======================================================================= 
93
94 const Handle(GEOMImpl_Template) Handle(GEOMImpl_Template)::DownCast(const Handle(Standard_Transient)& AnObject)
95 {
96   Handle(GEOMImpl_Template) _anOtherObject;
97
98   if (!AnObject.IsNull()) {
99      if (AnObject->IsKind(STANDARD_TYPE(GEOMImpl_Template))) {
100        _anOtherObject = Handle(GEOMImpl_Template)((Handle(GEOMImpl_Template)&)AnObject);
101      }
102   }
103
104   return _anOtherObject ;
105 }
106
107