1 // Copyright (C) 2013-2021 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 <StdFail_NotDone.hxx>
37 //=======================================================================
40 //=======================================================================
41 const Standard_GUID& XAOPlugin_Driver::GetID()
43 static Standard_GUID aGUID("FF1BBB71-5D14-4df2-980B-3A668264EA16");
47 //=======================================================================
48 //function : XAOPlugin_Driver
50 //=======================================================================
51 XAOPlugin_Driver::XAOPlugin_Driver()
55 //=======================================================================
56 //function : ~XAOPlugin_Driver
58 //=======================================================================
59 XAOPlugin_Driver::~XAOPlugin_Driver()
65 //=======================================================================
66 Standard_Integer XAOPlugin_Driver::Execute(Handle(TFunction_Logbook)& log) const
68 if (Label().IsNull()) return 0;
69 Handle(GEOM_Function) function = GEOM_Function::GetFunction(Label());
71 XAOPlugin_IImportExport iexao(function);
72 TCollection_AsciiString xao = iexao.GetData();
76 Standard_Integer functionType = function->GetType();
77 if (functionType == EXPORT_SHAPE)
80 else if (functionType == IMPORT_SHAPE)
85 // other construction modes here
88 if (shape.IsNull()) return 0;
89 function->SetValue(shape);
91 log->SetTouched(Label());
96 //=======================================================================
97 //function : GetCreationInformation
98 //purpose : Returns a name of creation operation and names and values of
99 // creation parameters
100 //=======================================================================
102 bool XAOPlugin_Driver::GetCreationInformation(std::string& theOperationName,
103 std::vector<GEOM_Param>& theParams)
105 if (Label().IsNull()) return false;
106 Handle(GEOM_Function) function = GEOM_Function::GetFunction(Label());
108 theOperationName = "ImportXAO";
109 AddParam( theParams, "File name", function->GetString( GetFileNameTag() ));
113 IMPLEMENT_STANDARD_RTTIEXT(XAOPlugin_Driver, GEOM_BaseDriver)