mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-05-06 20:10:49 +05:00
A slight modification of the CheckShape function:
CheckShape(theShape, theIsCheckGeom = 0, theReturnStatus = 0) If theReturnStatus is set to 1, the validity of the shape and the status are returned. The status is not printed. If theReturnStatus is set to 0 (default behavior), the behavior is not changed: is validity is False, the status is printed.
This commit is contained in:
parent
9a00eb28aa
commit
c4b211375d
@ -6905,11 +6905,14 @@ class geompyDC(GEOM._objref_GEOM_Gen):
|
|||||||
# @param theShape Shape to check validity of.
|
# @param theShape Shape to check validity of.
|
||||||
# @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
|
# @param theIsCheckGeom If FALSE, only the shape's topology will be checked, \n
|
||||||
# if TRUE, the shape's geometry will be checked also.
|
# if TRUE, the shape's geometry will be checked also.
|
||||||
|
# @param theReturnStatus If FALSE and if theShape is invalid, a description \n
|
||||||
|
# of problem is printed.
|
||||||
|
# if TRUE and if theShape is invalid, the description
|
||||||
|
# of problem is also returned.
|
||||||
# @return TRUE, if the shape "seems to be valid".
|
# @return TRUE, if the shape "seems to be valid".
|
||||||
# If theShape is invalid, prints a description of problem.
|
|
||||||
#
|
#
|
||||||
# @ref tui_measurement_tools_page "Example"
|
# @ref tui_measurement_tools_page "Example"
|
||||||
def CheckShape(self,theShape, theIsCheckGeom = 0):
|
def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
|
||||||
"""
|
"""
|
||||||
Check a topology of the given shape.
|
Check a topology of the given shape.
|
||||||
|
|
||||||
@ -6917,10 +6920,15 @@ class geompyDC(GEOM._objref_GEOM_Gen):
|
|||||||
theShape Shape to check validity of.
|
theShape Shape to check validity of.
|
||||||
theIsCheckGeom If FALSE, only the shape's topology will be checked,
|
theIsCheckGeom If FALSE, only the shape's topology will be checked,
|
||||||
if TRUE, the shape's geometry will be checked also.
|
if TRUE, the shape's geometry will be checked also.
|
||||||
|
theReturnStatus If FALSE and if theShape is invalid, a description
|
||||||
|
of problem is printed.
|
||||||
|
if TRUE and if theShape is invalid, the description
|
||||||
|
of problem is returned.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
TRUE, if the shape "seems to be valid".
|
TRUE, if the shape "seems to be valid".
|
||||||
If theShape is invalid, prints a description of problem.
|
If theShape is invalid, prints a description of problem.
|
||||||
|
This description can also be returned.
|
||||||
"""
|
"""
|
||||||
# Example: see GEOM_TestMeasures.py
|
# Example: see GEOM_TestMeasures.py
|
||||||
if theIsCheckGeom:
|
if theIsCheckGeom:
|
||||||
@ -6930,7 +6938,10 @@ class geompyDC(GEOM._objref_GEOM_Gen):
|
|||||||
(IsValid, Status) = self.MeasuOp.CheckShape(theShape)
|
(IsValid, Status) = self.MeasuOp.CheckShape(theShape)
|
||||||
RaiseIfFailed("CheckShape", self.MeasuOp)
|
RaiseIfFailed("CheckShape", self.MeasuOp)
|
||||||
if IsValid == 0:
|
if IsValid == 0:
|
||||||
print Status
|
if theReturnStatus == 0:
|
||||||
|
print Status
|
||||||
|
if theReturnStatus == 1:
|
||||||
|
return (IsValid, Status)
|
||||||
return IsValid
|
return IsValid
|
||||||
|
|
||||||
## Detect self-intersections in the given shape.
|
## Detect self-intersections in the given shape.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user