Salome HOME
bdecce3cd666638c53911e53460db5d07c7954d5
[modules/geom.git] / src / GEOM / GEOM_Solver.cxx
1
2 #include "GEOM_Solver.hxx"
3 #include <TDF_Label.hxx>
4 #include <TFunction_Function.hxx>
5 #include <TFunction_Driver.hxx>
6 #include <TFunction_Logbook.hxx>
7 #include <TFunction_DriverTable.hxx>
8 #include "GEOM_Function.hxx"
9 #include <Standard_GUID.hxx>
10
11 //=============================================================================
12 /*!
13  *  Update
14  */
15 //=============================================================================
16 bool GEOM_Solver::Update(int theDocID, TDF_LabelSequence& theSeq)
17 {
18   return false;
19
20
21 //=============================================================================
22 /*!
23  *  UpdateObject
24  */
25 //=============================================================================
26 bool GEOM_Solver::UpdateObject(Handle(GEOM_Object) theObject, TDF_LabelSequence& theSeq)
27 {
28   return false;
29 }
30
31 //=============================================================================
32 /*!
33  *  ComputeFunction
34  */
35 //=============================================================================  
36 bool GEOM_Solver::ComputeFunction(Handle(GEOM_Function) theFunction)
37 {
38   if(theFunction == NULL) return false;
39   Standard_GUID aGUID = theFunction->GetDriverGUID();
40       
41   Handle(TFunction_Driver) aDriver;
42   if(!TFunction_DriverTable::Get()->FindDriver(aGUID, aDriver)) return false;
43           
44   aDriver->Init(theFunction->GetEntry());
45             
46   TFunction_Logbook aLog;
47   if(aDriver->Execute(aLog) == 0) return false;
48                 
49   return true;     
50 }