1 // Copyright (C) 2014-2023 CEA, EDF, 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 "VTKPlugin_IOperations_i.hh"
22 #include "VTKPlugin_IOperations.hxx"
25 #include <utilities.h>
27 //=============================================================================
31 //=============================================================================
32 VTKPlugin_IOperations_i::VTKPlugin_IOperations_i( PortableServer::POA_ptr thePOA,
33 GEOM::GEOM_Gen_ptr theEngine,
34 VTKPlugin_IOperations* theImpl )
35 :GEOM_IOperations_i( thePOA, theEngine, theImpl )
37 MESSAGE( "VTKPlugin_IOperations_i::VTKPlugin_IOperations_i" );
40 //=============================================================================
44 //=============================================================================
45 VTKPlugin_IOperations_i::~VTKPlugin_IOperations_i()
47 MESSAGE( "VTKPlugin_IOperations_i::~VTKPlugin_IOperations_i" );
50 //=============================================================================
53 * Export a shape to VTK format
54 * \param theOriginal The shape to export
55 * \param theFileName The name of the exported file
56 * \param theDeflection The deflection of the exported shape
58 //=============================================================================
59 void VTKPlugin_IOperations_i::ExportVTK( GEOM::GEOM_Object_ptr theOriginal,
60 const char* theFileName,
61 const double theDeflection )
63 // duplicate the original shape
64 GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate( theOriginal );
67 GetOperations()->SetNotDone();
69 //Get the reference shape
70 Handle(GEOM_Object) anOriginal = GetObjectImpl( theOriginal );
71 if (anOriginal.IsNull()) return;
73 //Export the shape to the file
74 GetOperations()->ExportVTK( anOriginal, theFileName, theDeflection );
77 VTKPlugin_IOperations* VTKPlugin_IOperations_i::GetOperations()
79 return (VTKPlugin_IOperations*)GetImpl();