Salome HOME
Mantis issue 0021191: GlueEdges and GlueFaces problem with tolerance 1. A fix by...
[modules/geom.git] / src / GEOM_I / GEOM_IMeasureOperations_i.cc
1 // Copyright (C) 2007-2011  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.
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 #include <Standard_Stream.hxx>
23
24 #include "GEOM_IMeasureOperations_i.hh"
25
26 #include "utilities.h"
27 #include "OpUtil.hxx"
28
29 #include "GEOM_Engine.hxx"
30 #include "GEOM_Object.hxx"
31
32 //=============================================================================
33 /*!
34  *   constructor:
35  */
36 //=============================================================================
37 GEOM_IMeasureOperations_i::GEOM_IMeasureOperations_i (PortableServer::POA_ptr thePOA,
38                                                       GEOM::GEOM_Gen_ptr theEngine,
39                                                       ::GEOMImpl_IMeasureOperations* theImpl)
40 :GEOM_IOperations_i(thePOA, theEngine, theImpl)
41 {
42   MESSAGE("GEOM_IMeasureOperations_i::GEOM_IMeasureOperations_i");
43 }
44
45 //=============================================================================
46 /*!
47  *  destructor
48  */
49 //=============================================================================
50 GEOM_IMeasureOperations_i::~GEOM_IMeasureOperations_i()
51 {
52   MESSAGE("GEOM_IMeasureOperations_i::~GEOM_IMeasureOperations_i");
53 }
54
55 //=============================================================================
56 /*!
57  *  KindOfShape
58  */
59 //=============================================================================
60 GEOM::GEOM_IKindOfShape::shape_kind GEOM_IMeasureOperations_i::KindOfShape
61                                    (GEOM::GEOM_Object_ptr  theShape,
62                                     GEOM::ListOfLong_out   theIntegers,
63                                     GEOM::ListOfDouble_out theDoubles)
64 {
65   GEOMImpl_IMeasureOperations::ShapeKind aKind = GEOMImpl_IMeasureOperations::SK_NO_SHAPE;
66
67   // allocate the CORBA arrays
68   GEOM::ListOfLong_var anIntegersArray = new GEOM::ListOfLong();
69   GEOM::ListOfDouble_var aDoublesArray = new GEOM::ListOfDouble();
70
71   //Get the reference shape
72   Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
73
74   if (!aShape.IsNull()) {
75     Handle(TColStd_HSequenceOfInteger) anIntegers = new TColStd_HSequenceOfInteger;
76     Handle(TColStd_HSequenceOfReal)    aDoubles   = new TColStd_HSequenceOfReal;
77
78     // Detect kind of shape and parameters
79     aKind = GetOperations()->KindOfShape(aShape, anIntegers, aDoubles);
80
81     int nbInts = anIntegers->Length();
82     int nbDbls = aDoubles->Length();
83
84     anIntegersArray->length(nbInts);
85     aDoublesArray->length(nbDbls);
86
87     for (int ii = 0; ii < nbInts; ii++) {
88       anIntegersArray[ii] = anIntegers->Value(ii + 1);
89     }
90     for (int id = 0; id < nbDbls; id++) {
91       aDoublesArray[id] = aDoubles->Value(id + 1);
92     }
93   }
94
95   // initialize out-parameters with local arrays
96   theIntegers = anIntegersArray._retn();
97   theDoubles  = aDoublesArray._retn();
98   return (GEOM::GEOM_IKindOfShape::shape_kind)aKind;
99 }
100
101 //=============================================================================
102 /*!
103  *  GetPosition
104  */
105 //=============================================================================
106 void GEOM_IMeasureOperations_i::GetPosition
107                  (GEOM::GEOM_Object_ptr theShape,
108                   CORBA::Double& Ox, CORBA::Double& Oy, CORBA::Double& Oz,
109                   CORBA::Double& Zx, CORBA::Double& Zy, CORBA::Double& Zz,
110                   CORBA::Double& Xx, CORBA::Double& Xy, CORBA::Double& Xz)
111 {
112   //Set a not done flag
113   GetOperations()->SetNotDone();
114
115   //Set default values: global CS
116   Ox = Oy = Oz = Zx = Zy = Xy = Xz = 0.;
117   Zz = Xx = 1.;
118
119   //Get the reference shape
120   Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
121   if (aShape.IsNull()) return;
122
123   // Get shape parameters
124   GetOperations()->GetPosition(aShape, Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz);
125 }
126
127 //=============================================================================
128 /*!
129  *  GetCentreOfMass
130  */
131 //=============================================================================
132 GEOM::GEOM_Object_ptr GEOM_IMeasureOperations_i::GetCentreOfMass
133                                               (GEOM::GEOM_Object_ptr theShape)
134 {
135   GEOM::GEOM_Object_var aGEOMObject;
136
137   //Set a not done flag
138   GetOperations()->SetNotDone();
139
140   //Get the reference shape
141   Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
142   if (aShape.IsNull()) return aGEOMObject._retn();
143
144   // Make Point - centre of mass of theShape
145   Handle(GEOM_Object) anObject = GetOperations()->GetCentreOfMass(aShape);
146   if (!GetOperations()->IsDone() || anObject.IsNull())
147     return aGEOMObject._retn();
148
149   return GetObject(anObject);
150 }
151
152 //=============================================================================
153 /*!
154  *  GetVertexByIndex
155  */
156 //=============================================================================
157 GEOM::GEOM_Object_ptr GEOM_IMeasureOperations_i::GetVertexByIndex
158   (GEOM::GEOM_Object_ptr theShape, CORBA::Long theIndex)
159 {
160   GEOM::GEOM_Object_var aGEOMObject;
161
162   //Set a not done flag
163   GetOperations()->SetNotDone();
164
165   //Get the reference shape
166   Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
167   if ( aShape.IsNull() ) return aGEOMObject._retn();
168
169   // Get vertex by index
170   Handle(GEOM_Object) anObject = GetOperations()->GetVertexByIndex(aShape, theIndex);
171   if (!GetOperations()->IsDone() || anObject.IsNull())
172     return aGEOMObject._retn();
173
174   return GetObject(anObject);
175 }
176
177 //=============================================================================
178 /*!
179  *  GetNormal
180  */
181 //=============================================================================
182 GEOM::GEOM_Object_ptr GEOM_IMeasureOperations_i::GetNormal
183                                        (GEOM::GEOM_Object_ptr theFace,
184                                         GEOM::GEOM_Object_ptr theOptionalPoint)
185 {
186   GEOM::GEOM_Object_var aGEOMObject;
187
188   //Set a not done flag
189   GetOperations()->SetNotDone();
190
191   //Get the reference shape
192   Handle(GEOM_Object) aFace = GetObjectImpl(theFace);
193   if (aFace.IsNull()) return aGEOMObject._retn();
194
195   // Get the OptionalPoint (can be not defined)
196   Handle(GEOM_Object) anOptionalPoint = GetObjectImpl(theOptionalPoint);
197
198   // Make Vector - normal to theFace (in point theOptionalPoint if the face is not planar)
199   Handle(GEOM_Object) anObject = GetOperations()->GetNormal(aFace, anOptionalPoint);
200   if (!GetOperations()->IsDone() || anObject.IsNull())
201     return aGEOMObject._retn();
202
203   return GetObject(anObject);
204 }
205
206 //=============================================================================
207 /*!
208  *  GetBasicProperties
209  */
210 //=============================================================================
211 void GEOM_IMeasureOperations_i::GetBasicProperties (GEOM::GEOM_Object_ptr theShape,
212                                                     CORBA::Double& theLength,
213                                                     CORBA::Double& theSurfArea,
214                                                     CORBA::Double& theVolume)
215 {
216   //Set a not done flag
217   GetOperations()->SetNotDone();
218
219   //Get the reference shape
220   Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
221   if (aShape.IsNull()) return;
222
223   // Get shape parameters
224   GetOperations()->GetBasicProperties(aShape, theLength, theSurfArea, theVolume);
225 }
226
227 //=============================================================================
228 /*!
229  *  GetInertia
230  */
231 //=============================================================================
232 void GEOM_IMeasureOperations_i::GetInertia
233   (GEOM::GEOM_Object_ptr theShape,
234    CORBA::Double& I11, CORBA::Double& I12, CORBA::Double& I13,
235    CORBA::Double& I21, CORBA::Double& I22, CORBA::Double& I23,
236    CORBA::Double& I31, CORBA::Double& I32, CORBA::Double& I33,
237    CORBA::Double& Ix , CORBA::Double& Iy , CORBA::Double& Iz)
238 {
239   //Set a not done flag
240   GetOperations()->SetNotDone();
241
242   //Get the reference shape
243   Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
244   if (aShape.IsNull()) return;
245
246   // Get shape parameters
247   GetOperations()->GetInertia(aShape,
248                               I11, I12, I13,
249                               I21, I22, I23,
250                               I31, I32, I33,
251                               Ix , Iy , Iz);
252 }
253
254 //=============================================================================
255 /*!
256  *  GetBoundingBox
257  */
258 //=============================================================================
259 void GEOM_IMeasureOperations_i::GetBoundingBox (GEOM::GEOM_Object_ptr theShape,
260                                                 CORBA::Double& Xmin, CORBA::Double& Xmax,
261                                                 CORBA::Double& Ymin, CORBA::Double& Ymax,
262                                                 CORBA::Double& Zmin, CORBA::Double& Zmax)
263 {
264   //Set a not done flag
265   GetOperations()->SetNotDone();
266
267   //Get the reference shape
268   Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
269   if (aShape.IsNull()) return;
270
271   // Get shape parameters
272   GetOperations()->GetBoundingBox(aShape, Xmin, Xmax, Ymin, Ymax, Zmin, Zmax);
273 }
274
275 //=============================================================================
276 /*!
277  *  GetTolerance
278  */
279 //=============================================================================
280 void GEOM_IMeasureOperations_i::GetTolerance
281                                 (GEOM::GEOM_Object_ptr theShape,
282                                  CORBA::Double& FaceMin, CORBA::Double& FaceMax,
283                                  CORBA::Double& EdgeMin, CORBA::Double& EdgeMax,
284                                  CORBA::Double& VertMin, CORBA::Double& VertMax)
285 {
286   //Set a not done flag
287   GetOperations()->SetNotDone();
288
289   //Get the reference shape
290   Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
291   if (aShape.IsNull()) return;
292
293   // Get shape parameters
294   GetOperations()->GetTolerance(aShape,
295                                 FaceMin, FaceMax,
296                                 EdgeMin, EdgeMax,
297                                 VertMin, VertMax);
298 }
299
300 //=============================================================================
301 /*!
302  *  CheckShape
303  */
304 //=============================================================================
305 CORBA::Boolean GEOM_IMeasureOperations_i::CheckShape (GEOM::GEOM_Object_ptr theShape,
306                                                       CORBA::String_out     theDescription)
307 {
308   //Set a not done flag
309   GetOperations()->SetNotDone();
310
311   if (CORBA::is_nil(theShape))
312   {
313     theDescription = CORBA::string_dup("null");
314     return 0;
315   }
316
317   //Get the reference shape
318   Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
319
320   if (aShape.IsNull())
321   {
322     theDescription = CORBA::string_dup("null2");
323     return 0;
324   }
325
326   // Get shape parameters
327   TCollection_AsciiString aDump;
328   if (GetOperations()->CheckShape(aShape, /*check_geom = */false, aDump))
329   {
330     theDescription = CORBA::string_dup("OK");
331     return 1;
332   }
333   theDescription = CORBA::string_dup(aDump.ToCString());
334   return 0;
335 }
336
337 CORBA::Boolean GEOM_IMeasureOperations_i::CheckShapeWithGeometry (GEOM::GEOM_Object_ptr theShape,
338                                                                   CORBA::String_out     theDescription)
339 {
340   //Set a not done flag
341   GetOperations()->SetNotDone();
342
343   if (CORBA::is_nil(theShape))
344   {
345     theDescription = CORBA::string_dup("null");
346     return 0;
347   }
348
349   //Get the reference shape
350   Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
351
352   if (aShape.IsNull())
353   {
354     theDescription = CORBA::string_dup("null2");
355     return 0;
356   }
357
358   // Get shape parameters
359   TCollection_AsciiString aDump;
360   if (GetOperations()->CheckShape(aShape, /*check_geom = */true, aDump))
361   {
362     theDescription = CORBA::string_dup("OK");
363     return 1;
364   }
365   theDescription = CORBA::string_dup(aDump.ToCString());
366   return 0;
367 }
368
369 //=============================================================================
370 /*!
371  *  CheckSelfIntersections
372  */
373 //=============================================================================
374 CORBA::Boolean GEOM_IMeasureOperations_i::CheckSelfIntersections (GEOM::GEOM_Object_ptr theShape,
375                                                                   GEOM::ListOfLong_out  theIntersections)
376 {
377   // Set a not done flag
378   GetOperations()->SetNotDone();
379
380   bool isGood = false;
381
382   // Allocate the CORBA arrays
383   GEOM::ListOfLong_var anIntegersArray = new GEOM::ListOfLong();
384
385   // Get the reference shape
386   Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
387
388   if (!aShape.IsNull()) {
389     Handle(TColStd_HSequenceOfInteger) anIntegers = new TColStd_HSequenceOfInteger;
390
391     // Detect self-intersections
392     isGood = GetOperations()->CheckSelfIntersections(aShape, anIntegers);
393
394     int nbInts = anIntegers->Length();
395
396     anIntegersArray->length(nbInts);
397
398     for (int ii = 0; ii < nbInts; ii++) {
399       anIntegersArray[ii] = anIntegers->Value(ii + 1);
400     }
401   }
402
403   // Initialize out-parameters with local arrays
404   theIntersections = anIntegersArray._retn();
405   return isGood;
406 }
407
408 //=============================================================================
409 /*!
410  *  IsGoodForSolid
411  */
412 //=============================================================================
413 char* GEOM_IMeasureOperations_i::IsGoodForSolid (GEOM::GEOM_Object_ptr theShape)
414 {
415   //Set a not done flag
416   GetOperations()->SetNotDone();
417
418   //Get the reference shape
419   Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
420   if (aShape.IsNull()) return CORBA::string_dup("WRN_NULL_OBJECT_OR_SHAPE");
421
422   // Get shape parameters
423   TCollection_AsciiString aDescription = GetOperations()->IsGoodForSolid(aShape);
424   return CORBA::string_dup(aDescription.ToCString());
425 }
426
427 //=============================================================================
428 /*!
429  *  WhatIs
430  */
431 //=============================================================================
432 char* GEOM_IMeasureOperations_i::WhatIs (GEOM::GEOM_Object_ptr theShape)
433 {
434   //Set a not done flag
435   GetOperations()->SetNotDone();
436
437   //Get the reference shape
438   Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
439   if (aShape.IsNull()) return NULL;
440
441   // Get shape parameters
442   TCollection_AsciiString aDescription = GetOperations()->WhatIs(aShape);
443   return CORBA::string_dup(aDescription.ToCString());
444 }
445
446 //=============================================================================
447 /*!
448  *  AreCoordsInside
449  */
450 //=============================================================================
451 GEOM::ListOfBool* GEOM_IMeasureOperations_i::AreCoordsInside (GEOM::GEOM_Object_ptr theShape,
452                                                               const GEOM::ListOfDouble& theCoords,
453                                                               CORBA::Double tolerance)
454 {
455   //Set a not done flag
456   GetOperations()->SetNotDone();
457   
458   unsigned int nb_points = theCoords.length()/3;
459
460   GEOM::ListOfBool_var aResults = new GEOM::ListOfBool;
461   aResults->length(nb_points);
462   
463   Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
464   
465   std::vector<double> tmp(3*nb_points);
466   for (int i = 0; i < 3*nb_points; i++)
467     tmp[i] = theCoords[i];
468   std::vector<bool> res = GetOperations()->AreCoordsInside(aShape, tmp, tolerance);
469   for (int i = 0; i < nb_points; i++)
470     aResults[i] = i < res.size() ? res[i] : false;
471   return aResults._retn();
472 }
473
474 //=============================================================================
475 /*!
476  *  GetMinDistance
477  */
478 //=============================================================================
479 CORBA::Double GEOM_IMeasureOperations_i::GetMinDistance
480   (GEOM::GEOM_Object_ptr theShape1, GEOM::GEOM_Object_ptr theShape2,
481    CORBA::Double& X1, CORBA::Double& Y1, CORBA::Double& Z1,
482    CORBA::Double& X2, CORBA::Double& Y2, CORBA::Double& Z2)
483 {
484   //Set a not done flag
485   GetOperations()->SetNotDone();
486
487   //Get the reference shape
488   Handle(GEOM_Object) aShape1 = GetObjectImpl(theShape1);
489   Handle(GEOM_Object) aShape2 = GetObjectImpl(theShape2);
490   if (aShape1.IsNull() || aShape2.IsNull()) return -1.0;
491
492   // Get shape parameters
493   return GetOperations()->GetMinDistance(aShape1, aShape2, X1, Y1, Z1, X2, Y2, Z2);
494 }
495
496 //=============================================================================
497 /*!
498  *  PointCoordinates
499  */
500 //=============================================================================
501 void GEOM_IMeasureOperations_i::PointCoordinates (GEOM::GEOM_Object_ptr theShape,
502                                                   CORBA::Double& X, CORBA::Double& Y, CORBA::Double& Z)
503
504 {
505   //Set a not done flag
506   GetOperations()->SetNotDone();
507
508   //Get the reference shape
509   Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
510   if (aShape.IsNull())
511     return;
512
513   // Get shape parameters
514   GetOperations()->PointCoordinates( aShape, X, Y, Z );
515 }
516
517 //=============================================================================
518 /*!
519  *  GetAngle
520  */
521 //=============================================================================
522 CORBA::Double GEOM_IMeasureOperations_i::GetAngle (GEOM::GEOM_Object_ptr theShape1,
523                                                    GEOM::GEOM_Object_ptr theShape2)
524 {
525   //Set a not done flag
526   GetOperations()->SetNotDone();
527
528   //Get the reference shapes
529   Handle(GEOM_Object) aShape1 = GetObjectImpl(theShape1);
530   Handle(GEOM_Object) aShape2 = GetObjectImpl(theShape2);
531   if (aShape1.IsNull() || aShape2.IsNull()) return -1.0;
532
533   // Get the angle
534   return GetOperations()->GetAngle(aShape1, aShape2);
535 }
536
537 //=============================================================================
538 /*!
539  *  GetAngle
540  */
541 //=============================================================================
542 CORBA::Double GEOM_IMeasureOperations_i::GetAngleBtwVectors (GEOM::GEOM_Object_ptr theShape1,
543                                                              GEOM::GEOM_Object_ptr theShape2)
544 {
545   //Set a not done flag
546   GetOperations()->SetNotDone();
547
548   //Get the reference shapes
549   Handle(GEOM_Object) aShape1 = GetObjectImpl(theShape1);
550   Handle(GEOM_Object) aShape2 = GetObjectImpl(theShape2);
551   if (aShape1.IsNull() || aShape2.IsNull()) return -1.0;
552
553   // Get the angle
554   return GetOperations()->GetAngleBtwVectors(aShape1, aShape2);
555 }
556
557
558 //=============================================================================
559 /*!
560  *  CurveCurvatureByParam
561  */
562 //=============================================================================
563 CORBA::Double GEOM_IMeasureOperations_i::CurveCurvatureByParam
564                        (GEOM::GEOM_Object_ptr theCurve, CORBA::Double theParam)
565 {
566   //Set a not done flag
567   GetOperations()->SetNotDone();
568
569   //Get the reference shape
570   Handle(GEOM_Object) aShape = GetObjectImpl(theCurve);
571   if(aShape.IsNull()) return -1.0;
572
573   return GetOperations()->CurveCurvatureByParam(aShape,theParam);
574 }
575
576 //=============================================================================
577 /*!
578  *  CurveCurvatureByPoint
579  */
580 //=============================================================================
581 CORBA::Double GEOM_IMeasureOperations_i::CurveCurvatureByPoint
582                (GEOM::GEOM_Object_ptr theCurve, GEOM::GEOM_Object_ptr thePoint)
583 {
584   //Set a not done flag
585   GetOperations()->SetNotDone();
586
587   //Get the reference shape
588   Handle(GEOM_Object) aShape = GetObjectImpl(theCurve);
589   Handle(GEOM_Object) aPoint = GetObjectImpl(thePoint);
590   if( aShape.IsNull() || aPoint.IsNull() ) return -1.0;
591
592   return GetOperations()->CurveCurvatureByPoint(aShape,aPoint);
593 }
594
595
596 //=============================================================================
597 /*!
598  *  MaxSurfaceCurvatureByParam
599  */
600 //=============================================================================
601 CORBA::Double GEOM_IMeasureOperations_i::MaxSurfaceCurvatureByParam
602                                                 (GEOM::GEOM_Object_ptr theSurf,
603                                                  CORBA::Double theUParam,
604                                                  CORBA::Double theVParam)
605 {
606   //Set a not done flag
607   GetOperations()->SetNotDone();
608
609   //Get the reference shape
610   Handle(GEOM_Object) aShape = GetObjectImpl(theSurf);
611   if(aShape.IsNull()) return -1.0;
612
613   return GetOperations()->MaxSurfaceCurvatureByParam(aShape,theUParam,theVParam);
614 }
615
616 //=============================================================================
617 /*!
618  *  MaxSurfaceCurvatureByPoint
619  */
620 //=============================================================================
621 CORBA::Double GEOM_IMeasureOperations_i::MaxSurfaceCurvatureByPoint
622                 (GEOM::GEOM_Object_ptr theSurf, GEOM::GEOM_Object_ptr thePoint)
623 {
624   //Set a not done flag
625   GetOperations()->SetNotDone();
626
627   //Get the reference shape
628   Handle(GEOM_Object) aShape = GetObjectImpl(theSurf);
629   Handle(GEOM_Object) aPoint = GetObjectImpl(thePoint);
630   if( aShape.IsNull() || aPoint.IsNull() ) return -1.0;
631
632   return GetOperations()->MaxSurfaceCurvatureByPoint(aShape,aPoint);
633 }
634
635 //=============================================================================
636 /*!
637  *  MinSurfaceCurvatureByParam
638  */
639 //=============================================================================
640 CORBA::Double GEOM_IMeasureOperations_i::MinSurfaceCurvatureByParam
641                                                 (GEOM::GEOM_Object_ptr theSurf,
642                                                  CORBA::Double theUParam,
643                                                  CORBA::Double theVParam)
644 {
645   //Set a not done flag
646   GetOperations()->SetNotDone();
647
648   //Get the reference shape
649   Handle(GEOM_Object) aShape = GetObjectImpl(theSurf);
650   if (aShape.IsNull()) return -1.0;
651
652   return GetOperations()->MinSurfaceCurvatureByParam(aShape,theUParam,theVParam);
653 }
654
655 //=============================================================================
656 /*!
657  *  MinSurfaceCurvatureByPoint
658  */
659 //=============================================================================
660 CORBA::Double GEOM_IMeasureOperations_i::MinSurfaceCurvatureByPoint
661                 (GEOM::GEOM_Object_ptr theSurf, GEOM::GEOM_Object_ptr thePoint)
662 {
663   //Set a not done flag
664   GetOperations()->SetNotDone();
665
666   //Get the reference shape
667   Handle(GEOM_Object) aShape = GetObjectImpl(theSurf);
668   Handle(GEOM_Object) aPoint = GetObjectImpl(thePoint);
669   if (aShape.IsNull() || aPoint.IsNull()) return -1.0;
670
671   return GetOperations()->MinSurfaceCurvatureByPoint(aShape,aPoint);
672 }