Salome HOME
67a5ca547117478581f2576a5dceefedd92534b2
[modules/geom.git] / src / GEOM_I / GEOM_ITestOperations_i.cc
1 // Copyright (C) 2007-2023  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 #include "GEOM_ITestOperations_i.hh"
24
25 #include "utilities.h"
26 #include "OpUtil.hxx"
27 #include "Utils_ExceptHandlers.hxx"
28
29 #include "GEOM_Engine.hxx"
30 #include "GEOM_Object.hxx"
31
32 //=============================================================================
33 /*!
34  *   constructor:
35  */
36 //=============================================================================
37 GEOM_ITestOperations_i::GEOM_ITestOperations_i (PortableServer::POA_ptr thePOA,
38                                                 GEOM::GEOM_Gen_ptr theEngine,
39                                                 ::GEOMImpl_ITestOperations* theImpl)
40   :GEOM_IOperations_i(thePOA, theEngine, theImpl)
41 {
42   MESSAGE("GEOM_ITestOperations_i::GEOM_ITestOperations_i");
43 }
44
45 //=============================================================================
46 /*!
47  *  destructor
48  */
49 //=============================================================================
50 GEOM_ITestOperations_i::~GEOM_ITestOperations_i()
51 {
52   MESSAGE("GEOM_ITestOperations_i::~GEOM_ITestOperations_i");
53 }
54
55
56 //=============================================================================
57 /*!
58  *  Tesselate
59  */
60 //=============================================================================
61 CORBA::Boolean GEOM_ITestOperations_i::Tesselate(GEOM::GEOM_Object_ptr theShape,
62                                                  CORBA::Double theLinearDeflection,
63                                                  CORBA::Boolean theIsRelative,
64                                                  CORBA::Double theAngularDeflection)
65 {
66   // Set a not done flag
67   GetOperations()->SetNotDone();
68
69   // Get the source object
70   Handle(::GEOM_Object) aShape = GetObjectImpl(theShape);
71   if (aShape.IsNull()) return false;
72
73   // Tesselate
74   return GetOperations()->Tesselate(aShape, theLinearDeflection, theIsRelative, theAngularDeflection);
75 }