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
20 #include "CANRECPluginEngine_IOperations_i.hh"
21 #include "CANRECPluginImpl_IOperations.hxx"
23 #include <utilities.h>
25 CANRECPluginEngine_IOperations_i::CANRECPluginEngine_IOperations_i( PortableServer::POA_ptr thePOA,
26 GEOM::GEOM_Gen_ptr theEngine,
27 CANRECPluginImpl_IOperations* theImpl )
28 : GEOM_IOperations_i( thePOA, theEngine, theImpl )
30 MESSAGE( "CANRECPluginEngine_IOperations_i::CANRECPluginEngine_IOperations_i()" );
33 CANRECPluginEngine_IOperations_i::~CANRECPluginEngine_IOperations_i()
35 MESSAGE( "CANRECPluginEngine_IOperations_i::~CANRECPluginEngine_IOperations_i()" );
38 //=============================================================================
40 * Create a canonical recognition for the object
41 * \param theMergeSurf set merging surfaces
42 * \param theMergeCurves set merging curves
43 * \param theTolerance set tolerance
44 * \param theObject is initial object
45 * \return New GEOM_Object, containing the created shape.
47 //=============================================================================
49 CANRECPluginEngine_IOperations_i::MakeCanonicalRecognition( GEOM::GEOM_Object_ptr theObject,
50 CORBA::Boolean theMergeSurf,
51 CORBA::Boolean theMergeCurves,
52 CORBA::Double theTolerance )
54 // Set a not done flag
55 GetOperations()->SetNotDone();
57 // Get the reference points
58 Handle(GEOM_Object) anInitObject = GetObjectImpl( theObject );
60 if ( anInitObject.IsNull() ) return GEOM::GEOM_Object::_nil();
62 // Make Canonical Recognition
63 Handle(GEOM_Object) anObject = GetOperations()->MakeCanonicalRecognition( anInitObject,
67 if ( !GetOperations()->IsDone() || anObject.IsNull() )
68 return GEOM::GEOM_Object::_nil();
70 return GetObject( anObject );
73 ::CANRECPluginImpl_IOperations* CANRECPluginEngine_IOperations_i::GetOperations()
75 return (::CANRECPluginImpl_IOperations*)GetImpl();