1 // Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #include "XAOPlugin_Driver.hxx"
22 #include "XAOPlugin_IImportExport.hxx"
25 #include "GEOMImpl_Types.hxx"
26 #include "GEOM_Function.hxx"
28 #include <XAO_Xao.hxx>
29 #include <XAO_Geometry.hxx>
30 #include <XAO_Group.hxx>
31 #include <XAO_XaoUtils.hxx>
34 #include <Standard_Stream.hxx>
35 #include <TFunction_Logbook.hxx>
36 #include <StdFail_NotDone.hxx>
38 //=======================================================================
41 //=======================================================================
42 const Standard_GUID& XAOPlugin_Driver::GetID()
44 static Standard_GUID aGUID("FF1BBB71-5D14-4df2-980B-3A668264EA16");
48 //=======================================================================
49 //function : XAOPlugin_Driver
51 //=======================================================================
52 XAOPlugin_Driver::XAOPlugin_Driver()
56 //=======================================================================
57 //function : ~XAOPlugin_Driver
59 //=======================================================================
60 XAOPlugin_Driver::~XAOPlugin_Driver()
64 Standard_Boolean XAOPlugin_Driver::MustExecute(const TFunction_Logbook&) const
69 //=======================================================================
72 //=======================================================================
73 Standard_Integer XAOPlugin_Driver::Execute(TFunction_Logbook& log) const
75 if (Label().IsNull()) return 0;
76 Handle(GEOM_Function) function = GEOM_Function::GetFunction(Label());
78 XAOPlugin_IImportExport iexao(function);
79 TCollection_AsciiString xao = iexao.GetData();
83 Standard_Integer functionType = function->GetType();
84 if (functionType == EXPORT_SHAPE)
87 else if (functionType == IMPORT_SHAPE)
92 // other construction modes here
95 if (shape.IsNull()) return 0;
96 function->SetValue(shape);
98 log.SetTouched(Label());
103 IMPLEMENT_STANDARD_HANDLE (XAOPlugin_Driver, TFunction_Driver);
104 IMPLEMENT_STANDARD_RTTIEXT(XAOPlugin_Driver, TFunction_Driver);