Salome HOME
4bdb5712801d44cb9a77101492cb18b1cca9d431
[modules/geom.git] / src / GEOMImpl / GEOMImpl_Template.cxx
1
2 #include <Standard_Stream.hxx>
3
4 #include <GEOMImpl_Template.hxx>
5 #include <GEOM_Function.hxx>
6 #include <TopoDS_Shape.hxx>
7
8 //=======================================================================
9 //function : GetID
10 //purpose  :
11 //======================================================================= 
12 const Standard_GUID& GEOMImpl_Template::GetID()
13 {
14   static Standard_GUID aTemplate("Insert the correct GUID here");
15   return aTemplate; 
16 }
17
18
19 //=======================================================================
20 //function : GEOMImpl_Template
21 //purpose  : 
22 //=======================================================================
23
24 GEOMImpl_Template::GEOMImpl_Template() 
25 {
26 }
27
28 //=======================================================================
29 //function : Execute
30 //purpose  :
31 //======================================================================= 
32 Standard_Integer GEOMImpl_Template::Execute(TFunction_Logbook& log) const
33 {
34   if (Label().IsNull()) return 0;
35   Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label()); 
36   if(aFunction.IsNull()) return 0;
37   
38   //Add implemetation here
39   
40   log.SetTouched(Label());
41   return 1;    
42 }
43
44
45 //=======================================================================
46 //function :  GEOMImpl_Template_Type_
47 //purpose  :
48 //======================================================================= 
49 Standard_EXPORT Handle_Standard_Type& GEOMImpl_Template_Type_()
50 {
51
52   static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver);
53   if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver);
54   static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared);
55   if ( aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared); 
56   static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient);
57   if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient);
58  
59
60   static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL};
61   static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_Template",
62                                                          sizeof(GEOMImpl_Template),
63                                                          1,
64                                                          (Standard_Address)_Ancestors,
65                                                          (Standard_Address)NULL);
66
67   return _aType;
68 }
69
70 //=======================================================================
71 //function : DownCast
72 //purpose  :
73 //======================================================================= 
74
75 const Handle(GEOMImpl_Template) Handle(GEOMImpl_Template)::DownCast(const Handle(Standard_Transient)& AnObject)
76 {
77   Handle(GEOMImpl_Template) _anOtherObject;
78
79   if (!AnObject.IsNull()) {
80      if (AnObject->IsKind(STANDARD_TYPE(GEOMImpl_Template))) {
81        _anOtherObject = Handle(GEOMImpl_Template)((Handle(GEOMImpl_Template)&)AnObject);
82      }
83   }
84
85   return _anOtherObject ;
86 }
87
88