1 // Copyright (C) 2014-2015 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 "XTPlugin_IOperations_i.hh"
22 #include "XTPlugin_IOperations.hxx"
23 #include "XTPlugin_version.h"
26 #include <utilities.h>
28 //=============================================================================
32 //=============================================================================
33 XTPlugin_IOperations_i::XTPlugin_IOperations_i( PortableServer::POA_ptr thePOA,
34 GEOM::GEOM_Gen_ptr theEngine,
35 ::XTPlugin_IOperations* theImpl )
36 :GEOM_IOperations_i( thePOA, theEngine, theImpl )
38 MESSAGE( "XTPlugin_Operations_i::XTPlugin_Operations_i" );
41 //=============================================================================
45 //=============================================================================
46 XTPlugin_IOperations_i::~XTPlugin_IOperations_i()
48 MESSAGE( "XTPlugin_Operations_i::~XTPlugin_Operations_i" );
51 //=============================================================================
54 * Import a shape from XT format
55 * \param theFileName The name of the file to import
56 * \return List of GEOM_Objects, containing the created shape and propagation groups.
58 //=============================================================================
59 GEOM::ListOfGO* XTPlugin_IOperations_i::ImportXT( const char* theFileName )
61 GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
64 GetOperations()->SetNotDone();
66 //Import the shape from the file
67 Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->ImportXT( theFileName );
69 if( !GetOperations()->IsDone() || aHSeq.IsNull() )
72 // Copy created objects.
73 Standard_Integer aLength = aHSeq->Length();
74 aSeq->length( aLength );
75 for( Standard_Integer i = 1; i <= aLength; i++ )
76 aSeq[i-1] = GetObject( Handle(GEOM_Object)::DownCast( aHSeq->Value(i) ) );
81 XTPlugin_IOperations* XTPlugin_IOperations_i::GetOperations()
83 return (XTPlugin_IOperations*)GetImpl();