FDT_String
};
+ /**
+ * This enumeration represents the level of checking shape on
+ * self-interference. It defines which interferferences will be checked.
+ */
+ enum si_check_level
+ {
+ SI_V_V, // only V/V interferences
+ SI_V_E, // V/V and V/E interferences
+ SI_E_E, // V/V, V/E and E/E interferences
+ SI_V_F, // V/V, V/E, E/E and V/F interferences
+ SI_E_F, // V/V, V/E, E/E, V/F and E/F interferences
+ SI_ALL // all interferences
+ };
+
/*!
* \brief Object creation parameters
/*!
* \brief Check a topology of the given shape on self-intersections presence.
* \param theShape Shape to check validity of.
+ * \param theCheckLevel the level of self-interference check.
* \param theIntersections Output. List of intersected sub-shapes IDs, it contains pairs of IDs.
* \return TRUE, if the shape does not have any self-intersections.
*/
boolean CheckSelfIntersections (in GEOM_Object theShape,
+ in long theCheckLevel,
out ListOfLong theIntersections);
/*!
//=============================================================================
bool GEOMImpl_IMeasureOperations::CheckSelfIntersections
(Handle(GEOM_Object) theShape,
+ const SICheckLevel theCheckLevel,
Handle(TColStd_HSequenceOfInteger)& theIntersections)
{
SetErrorCode(KO);
//
BOPAlgo_CheckerSI aCSI; // checker of self-interferences
aCSI.SetArguments(aLCS);
+ aCSI.SetLevelOfCheck(theCheckLevel);
// 1. Launch the checker
aCSI.Perform();
SK_ADVANCED, // all advanced shapes (temporary implementation)
};
+ /**
+ * This enumeration represents the level of checking shape on
+ * self-interference. It defines which interferferences will be checked.
+ */
+ enum SICheckLevel
+ {
+ SI_V_V = 0, // only V/V interferences
+ SI_V_E, // V/V and V/E interferences
+ SI_E_E, // V/V, V/E and E/E interferences
+ SI_V_F, // V/V, V/E, E/E and V/F interferences
+ SI_E_F, // V/V, V/E, E/E, V/F and E/F interferences
+ SI_ALL // all interferences
+ };
+
Standard_EXPORT ShapeKind KindOfShape (Handle(GEOM_Object) theShape,
Handle(TColStd_HSequenceOfInteger)& theIntegers,
Handle(TColStd_HSequenceOfReal)& theDoubles);
const std::list<ShapeError> &theErrors);
Standard_EXPORT bool CheckSelfIntersections (Handle(GEOM_Object) theShape,
+ const SICheckLevel theCheckLevel,
Handle(TColStd_HSequenceOfInteger)& theIntersections);
Standard_EXPORT TCollection_AsciiString IsGoodForSolid (Handle(GEOM_Object) theShape);
*/
//=============================================================================
CORBA::Boolean GEOM_IMeasureOperations_i::CheckSelfIntersections (GEOM::GEOM_Object_ptr theShape,
+ CORBA::Long theCheckLevel,
GEOM::ListOfLong_out theIntersections)
{
// Set a not done flag
Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
if (!aShape.IsNull()) {
+ GEOMImpl_IMeasureOperations::SICheckLevel aCheckLevel;
+
+ switch(theCheckLevel) {
+ case GEOM::SI_V_V:
+ aCheckLevel = GEOMImpl_IMeasureOperations::SI_V_V;
+ break;
+ case GEOM::SI_V_E:
+ aCheckLevel = GEOMImpl_IMeasureOperations::SI_V_E;
+ break;
+ case GEOM::SI_E_E:
+ aCheckLevel = GEOMImpl_IMeasureOperations::SI_E_E;
+ break;
+ case GEOM::SI_V_F:
+ aCheckLevel = GEOMImpl_IMeasureOperations::SI_V_F;
+ break;
+ case GEOM::SI_E_F:
+ aCheckLevel = GEOMImpl_IMeasureOperations::SI_E_F;
+ break;
+ case GEOM::SI_ALL:
+ default:
+ aCheckLevel = GEOMImpl_IMeasureOperations::SI_ALL;
+ break;
+ }
+
Handle(TColStd_HSequenceOfInteger) anIntegers = new TColStd_HSequenceOfInteger;
// Detect self-intersections
- isGood = GetOperations()->CheckSelfIntersections(aShape, anIntegers);
+ isGood = GetOperations()->CheckSelfIntersections
+ (aShape, aCheckLevel, anIntegers);
int nbInts = anIntegers->Length();
const GEOM::GEOM_IMeasureOperations::ShapeErrors &theErrors);
CORBA::Boolean CheckSelfIntersections (GEOM::GEOM_Object_ptr theShape,
+ CORBA::Long theCheckLevel,
GEOM::ListOfLong_out theIntersections);
char* IsGoodForSolid (GEOM::GEOM_Object_ptr theShape);
## Detect self-intersections in the given shape.
# @param theShape Shape to check.
+ # @param theCheckLevel is the level of self-intersection check.
+ # Possible input values are:
+ # - GEOM.SI_V_V(0) - only V/V interferences
+ # - GEOM.SI_V_E(1) - V/V and V/E interferences
+ # - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
+ # - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
+ # - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
+ # - GEOM.SI_ALL(5) - all interferences.
# @return TRUE, if the shape contains no self-intersections.
#
# @ref tui_measurement_tools_page "Example"
@ManageTransactions("MeasuOp")
- def CheckSelfIntersections(self, theShape):
+ def CheckSelfIntersections(self, theShape, theCheckLevel = GEOM.SI_ALL):
"""
Detect self-intersections in the given shape.
Parameters:
theShape Shape to check.
-
+ theCheckLevel is the level of self-intersection check.
+ Possible input values are:
+ - GEOM.SI_V_V(0) - only V/V interferences
+ - GEOM.SI_V_E(1) - V/V and V/E interferences
+ - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
+ - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
+ - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
+ - GEOM.SI_ALL(5) - all interferences.
+
Returns:
TRUE, if the shape contains no self-intersections.
"""
# Example: see GEOM_TestMeasures.py
- (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
+ (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape, EnumToLong(theCheckLevel))
RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
return IsValid
int nbPairs = 0;
try {
- HasSelfInte = !anOper->CheckSelfIntersections(myObj, myInters);
+ HasSelfInte = !anOper->CheckSelfIntersections(myObj, GEOM::SI_ALL, myInters);
nbPairs = myInters->length()/2;
if (nbPairs*2 != myInters->length()) {
{
erasePreview();
int aCurItem = myGrp->ListBox1->currentRow();
- int aNbItems = myGrp->ListBox1->count();
+
if (aCurItem < 0)
return;
- //int nbPairs = myInters->length()/2;
-
QStringList aSubShapeList;
TopoDS_Shape aSelShape;
if (!myObj->_is_nil() && GEOMBase::GetShape(myObj, aSelShape)) {