default behavior.
<b>Detect Self-intersections</b> check box is used to check self-intersection of arguments.
-- If this option is switched on (by default), each input shape is checked for self-intersection.
+It is enabled only if <b>No sub-shapes intersection (Compounds only)</b> is checked.
+- If this option is switched off (by default), the partition algorithm is
+performed without self-intersection checks.
+- If this option is switched on, each input shape is checked for self-intersection.
If self-intersection is detected, the operation is aborted.
-- If this option is switched off, the partition algorithm is performed without self-intersection
-checks.
\note This algorithm does not find all types of self-intersections. It is tuned
to detect vertex/vertex, vertex/edge, edge/edge, vertex/face and edge/face
<em>geompy.MakePartition(ListOfShapes, ListOfTools, ListOfKeepInside,
ListOfRemoveInside, Limit, RemoveWebs, ListOfMaterials,
-KeepNonlimitShapes, checkSelfInte)</em>
+KeepNonlimitShapes)</em>
<b>TUI Command (without sub-shapes intersection):</b>
<b>TUI Command:</b>
-<em>geompy.MakeHalfPartition(Shape, Plane, checkSelfInte)</em>, where:
+<em>geompy.MakeHalfPartition(Shape, Plane)</em>, where:
- \em Shape is a source shape to be intersected by the \em Plane
- \em Plane is a tool shape, to intersect the \em Shape.
-- \em checkSelfInte is a flag that indicates if the arguments should
-be checked for self-intersection prior to the operation.
<b>Examples:</b>
* Each shape from theRemoveInside must belong to theShapes also.
* \param theRemoveWebs If TRUE, perform Glue 3D algorithm.
* \param theMaterials Material indices for each shape. Make sence, only if theRemoveWebs is TRUE.
- * \param IsCheckSelfInte If TRUE, perform check self intersection
- * of arguments before an operation.
*
* \return New GEOM_Object, containing the result shapes.
*/
in short theLimit,
in boolean theRemoveWebs,
in ListOfLong theMaterials,
- in short theKeepNonlimitShapes,
- in boolean IsCheckSelfInte);
+ in short theKeepNonlimitShapes);
/*!
* \brief Perform partition operation.
* a compound containing nonintersected shapes. Performance will be better
* since intersection between shapes from compound is not performed.
*
- * Description of all parameters as in previous method MakePartition()
+ * Description of all parameters as in previous method MakePartition().
+ * One additional parameter is provided:
+ * \param IsCheckSelfInte If TRUE, perform check self intersection
+ * of arguments before an operation.
*
* \note Passed compounds (via ListShapes or via ListTools)
* have to consist of nonintersecting shapes.
* \brief Perform partition of the Shape with the Plane
* \param theShape Shape to be intersected.
* \param thePlane Tool shape, to intersect theShape.
- * \param IsCheckSelfInte If TRUE, perform check self intersection
- * of arguments before an operation.
* \return New GEOM_Object, containing the result shape.
*/
GEOM_Object MakeHalfPartition (in GEOM_Object theShape,
- in GEOM_Object thePlane,
- in boolean IsCheckSelfInte);
+ in GEOM_Object thePlane);
};
// # GEOM_ICurvesOperations:
}
pd << "], " << theKeepNonlimitShapes;
- if (IsCheckSelfInte) {
+ if (IsCheckSelfInte && !thePerformSelfIntersections) {
pd << ", True";
}
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeHalfPartition
- (Handle(GEOM_Object) theShape, Handle(GEOM_Object) thePlane,
- const Standard_Boolean IsCheckSelfInte)
+ (Handle(GEOM_Object) theShape, Handle(GEOM_Object) thePlane)
{
SetErrorCode(KO);
aCI.SetShape(aRef1);
aCI.SetPlane(aRef2);
- aCI.SetCheckSelfIntersection(IsCheckSelfInte);
//Compute the Partition value
try {
//Make a Python command
GEOM::TPythonDump pd (aFunction);
pd << aPart << " = geompy.MakeHalfPartition("
- << theShape << ", " << thePlane;
-
- if (IsCheckSelfInte) {
- pd << ", True";
- }
-
- pd << ")";
+ << theShape << ", " << thePlane << ")";
SetErrorCode(OK);
return aPart;
const Standard_Boolean IsCheckSelfInte);
Standard_EXPORT Handle(GEOM_Object) MakeHalfPartition (Handle(GEOM_Object) theShape,
- Handle(GEOM_Object) thePlane,
- const Standard_Boolean IsCheckSelfInte);
+ Handle(GEOM_Object) thePlane);
private:
}
// Check self-intersection.
- if (isCheckSelfInte) {
+ if (isCheckSelfInte && aType == PARTITION_NO_SELF_INTERSECTIONS) {
CheckSelfIntersection(aShape_i);
}
}
// Check self-intersection.
- if (isCheckSelfInte) {
+ if (isCheckSelfInte && aType == PARTITION_NO_SELF_INTERSECTIONS) {
CheckSelfIntersection(aShape_i);
}
Standard_NullObject::Raise("In Half Partition a shape or a plane is null");
}
- // Check self-intersection.
- if (isCheckSelfInte) {
- CheckSelfIntersection(aShapeArg);
- CheckSelfIntersection(aPlaneArg);
- }
-
TopoDS_Shape aShapeArg_copy;
TopoDS_Shape aPlaneArg_copy;
{
}
// add object shapes that are in ListShapes;
- PS.AddArgument(aShapeArg_copy);
- //PS.AddShape(aShapeArg);
+ TopTools_ListOfShape aSimpleShapes;
+ TopTools_MapOfShape aShapesMap;
+
+ PrepareShapes(aShapeArg_copy, aType, aSimpleShapes);
+
+ TopTools_ListIteratorOfListOfShape aSimpleIter (aSimpleShapes);
+
+ for (; aSimpleIter.More(); aSimpleIter.Next()) {
+ const TopoDS_Shape& aSimpleSh = aSimpleIter.Value();
+
+ if (aShapesMap.Add(aSimpleSh)) {
+ PS.AddArgument(aSimpleSh);
+ }
+ }
// add tool shapes that are in ListTools and not in ListShapes;
PS.AddTool(aPlaneArg_copy);
AddParam( theParams, "Resulting type", (TopAbs_ShapeEnum) aCI.GetLimit());
AddParam( theParams, "Keep shapes of lower type", aCI.GetKeepNonlimitShapes());
AddParam( theParams, "No object intersections", ( aType == PARTITION_NO_SELF_INTERSECTIONS ));
+
+ if (aType == PARTITION_NO_SELF_INTERSECTIONS) {
+ AddParam( theParams, "Check self-intersections", aCI.GetCheckSelfIntersection());
+ }
break;
case PARTITION_HALF:
AddParam( theParams, "Object", aCI.GetShape() );
CORBA::Short theLimit,
CORBA::Boolean theRemoveWebs,
const GEOM::ListOfLong& theMaterials,
- CORBA::Short theKeepNonlimitShapes,
- CORBA::Boolean IsCheckSelfInte)
+ CORBA::Short theKeepNonlimitShapes)
{
GEOM::GEOM_Object_var aGEOMObject;
theLimit, theRemoveWebs, aMaterials,
theKeepNonlimitShapes,
/*PerformSelfIntersections*/Standard_True,
- IsCheckSelfInte);
+ /*IsCheckSelfInte*/Standard_False);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakeHalfPartition
(GEOM::GEOM_Object_ptr theShape,
- GEOM::GEOM_Object_ptr thePlane,
- CORBA::Boolean IsCheckSelfInte)
+ GEOM::GEOM_Object_ptr thePlane)
{
GEOM::GEOM_Object_var aGEOMObject;
// Make Half Partition
Handle(GEOM_Object) anObject =
- GetOperations()->MakeHalfPartition(aSh, aPl, IsCheckSelfInte);
+ GetOperations()->MakeHalfPartition(aSh, aPl);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
CORBA::Short theLimit,
CORBA::Boolean theRemoveWebs,
const GEOM::ListOfLong& theMaterials,
- CORBA::Short theKeepNonlimitShapes,
- CORBA::Boolean IsCheckSelfInte);
+ CORBA::Short theKeepNonlimitShapes);
GEOM::GEOM_Object_ptr MakePartitionNonSelfIntersectedShape (const GEOM::ListOfGO& theShapes,
const GEOM::ListOfGO& theTools,
GEOM::GEOM_Object_ptr MakeHalfPartition (GEOM::GEOM_Object_ptr theShape,
- GEOM::GEOM_Object_ptr thePlane,
- CORBA::Boolean IsCheckSelfInte);
+ GEOM::GEOM_Object_ptr thePlane);
::GEOMImpl_IBooleanOperations* GetOperations()
{ return (::GEOMImpl_IBooleanOperations*)GetImpl(); }
myBoolOp->MakePartition(aListImplS->GetList(), aListImplT->GetList(),
aListImplKI->GetList(), aListImplRI->GetList(),
theLimit, theRemoveWebs, aListImplM->GetList(),
- theKeepNonlimitShapes, false);
+ theKeepNonlimitShapes);
endService( " GEOM_Superv_i::MakePartition" );
return anObj;
}
MESSAGE("GEOM_Superv_i::MakeHalfPartition");
getBoolOp();
GEOM::GEOM_Object_ptr anObj =
- myBoolOp->MakeHalfPartition(theShape, thePlane, false);
+ myBoolOp->MakeHalfPartition(theShape, thePlane);
endService( " GEOM_Superv_i::MakeHalfPartition" );
return anObj;
}
# target type (equal to Limit) are kept in the result,
# else standalone shapes of lower dimension
# are kept also (if they exist).
- # @param checkSelfInte The flag that tells if the arguments should
- # be checked for self-intersection prior to the operation.
- #
- # @note This algorithm doesn't find all types of self-intersections.
- # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
- # vertex/face and edge/face intersections. Face/face
- # intersections detection is switched off as it is a
- # time-consuming operation that gives an impact on performance.
- # To find all self-intersections please use
- # CheckSelfIntersections() method.
#
# @param theName Object name; when specified, this parameter is used
# for result publication in the study. Otherwise, if automatic
# @ref tui_partition "Example"
def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
- KeepNonlimitShapes=0, checkSelfInte=False, theName=None):
+ KeepNonlimitShapes=0, theName=None):
"""
Perform partition operation.
target type (equal to Limit) are kept in the result,
else standalone shapes of lower dimension
are kept also (if they exist).
- checkSelfInte The flag that tells if the arguments should
- be checked for self-intersection prior to
- the operation.
-
- Note:
- This algorithm doesn't find all types of self-intersections.
- It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
- vertex/face and edge/face intersections. Face/face
- intersections detection is switched off as it is a
- time-consuming operation that gives an impact on performance.
- To find all self-intersections please use
- CheckSelfIntersections() method.
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
ListKeepInside, ListRemoveInside,
Limit, RemoveWebs, ListMaterials,
- KeepNonlimitShapes, checkSelfInte);
+ KeepNonlimitShapes);
RaiseIfFailed("MakePartition", self.BoolOp)
self._autoPublish(anObj, theName, "partition")
return anObj
# compound contains nonintersected shapes. Performance will be better
# since intersection between shapes from compound is not performed.
#
- # Description of all parameters as in previous method MakePartition()
+ # Description of all parameters as in previous method MakePartition().
+ # One additional parameter is provided:
+ # @param checkSelfInte The flag that tells if the arguments should
+ # be checked for self-intersection prior to the operation.
+ #
+ # @note This algorithm doesn't find all types of self-intersections.
+ # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
+ # vertex/face and edge/face intersections. Face/face
+ # intersections detection is switched off as it is a
+ # time-consuming operation that gives an impact on performance.
+ # To find all self-intersections please use
+ # CheckSelfIntersections() method.
#
# @note Passed compounds (via ListShapes or via ListTools)
# have to consist of nonintersecting shapes.
since intersection between shapes from compound is not performed.
Parameters:
- Description of all parameters as in method geompy.MakePartition
+ Description of all parameters as in method geompy.MakePartition.
+ One additional parameter is provided:
+ checkSelfInte The flag that tells if the arguments should
+ be checked for self-intersection prior to
+ the operation.
+
+ Note:
+ This algorithm doesn't find all types of self-intersections.
+ It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
+ vertex/face and edge/face intersections. Face/face
+ intersections detection is switched off as it is a
+ time-consuming operation that gives an impact on performance.
+ To find all self-intersections please use
+ CheckSelfIntersections() method.
NOTE:
Passed compounds (via ListShapes or via ListTools)
# \n @ref swig_Partition "Example 2"
def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
- KeepNonlimitShapes=0, checkSelfInte=False, theName=None):
+ KeepNonlimitShapes=0, theName=None):
"""
See method geompy.MakePartition for more information.
"""
anObj = self.MakePartition(ListShapes, ListTools,
ListKeepInside, ListRemoveInside,
Limit, RemoveWebs, ListMaterials,
- KeepNonlimitShapes, checkSelfInte,
- theName);
+ KeepNonlimitShapes, theName);
return anObj
## Perform partition of the Shape with the Plane
# @param theShape Shape to be intersected.
# @param thePlane Tool shape, to intersect theShape.
- # @param checkSelfInte The flag that tells if the arguments should
- # be checked for self-intersection prior to the operation.
# @param theName Object name; when specified, this parameter is used
# for result publication in the study. Otherwise, if automatic
# publication is switched on, default value is used for result name.
#
- # @note This algorithm doesn't find all types of self-intersections.
- # It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
- # vertex/face and edge/face intersections. Face/face
- # intersections detection is switched off as it is a
- # time-consuming operation that gives an impact on performance.
- # To find all self-intersections please use
- # CheckSelfIntersections() method.
- #
# @return New GEOM.GEOM_Object, containing the result shape.
#
# @ref tui_partition "Example"
- def MakeHalfPartition(self, theShape, thePlane, checkSelfInte=False, theName=None):
+ def MakeHalfPartition(self, theShape, thePlane, theName=None):
"""
Perform partition of the Shape with the Plane
Parameters:
theShape Shape to be intersected.
thePlane Tool shape, to intersect theShape.
- checkSelfInte The flag that tells if the arguments should
- be checked for self-intersection prior to
- the operation.
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
- Note:
- This algorithm doesn't find all types of self-intersections.
- It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
- vertex/face and edge/face intersections. Face/face
- intersections detection is switched off as it is a
- time-consuming operation that gives an impact on performance.
- To find all self-intersections please use
- CheckSelfIntersections() method.
-
Returns:
New GEOM.GEOM_Object, containing the result shape.
"""
# Example: see GEOM_TestAll.py
- anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane, checkSelfInte)
+ anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
RaiseIfFailed("MakeHalfPartition", self.BoolOp)
self._autoPublish(anObj, theName, "partition")
return anObj
GroupPoints->ComboBox1->addItem( tr( "GEOM_RECONSTRUCTION_LIMIT_VERTEX" ) );
GroupPoints->ComboBox1->setItemData(GroupPoints->ComboBox1->count()-1, GEOM::VERTEX);
GroupPoints->CheckButton1->setChecked( false );
- mySelfInte->setChecked(true);
+ mySelfInte->setChecked(false);
mainFrame()->GroupBoxPublish->show();
connect( GroupPoints->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(processPreview()) );
connect( GroupPoints->CheckButton2, SIGNAL(toggled(bool)), this, SLOT(processPreview()) );
+ connect( GroupPoints->CheckButton2, SIGNAL(toggled(bool)), mySelfInte, SLOT(setEnabled(bool)) );
connect( mySelfInte, SIGNAL(toggled(bool)), this, SLOT(processPreview()) );
+ mySelfInte->setEnabled(GroupPoints->CheckButton2->isChecked());
initName( tr( "GEOM_PARTITION" ) );
ConstructorsClicked( 0 );
GroupPoints->ComboBox1->setCurrentIndex( 0 );
GroupPoints->CheckButton1->show();
GroupPoints->CheckButton2->show();
+ mySelfInte->show();
GroupPoints->PushButton1->setDown( true );
GroupPoints->PushButton2->setDown( false );
GroupPoints->LineEdit1->setEnabled(true);
GroupPoints->TextLabel2->setText( tr( "GEOM_PLANE" ) );
GroupPoints->CheckButton1->hide();
GroupPoints->CheckButton2->hide();
+ mySelfInte->hide();
GroupPoints->PushButton1->setDown( true );
GroupPoints->LineEdit1->setEnabled(true);
break;
{
bool res = false;
GEOM::GEOM_Object_var anObj;
- bool isDetectSelfInte = mySelfInte->isChecked();
GEOM::GEOM_IBooleanOperations_var anOper = GEOM::GEOM_IBooleanOperations::_narrow(getOperation());
switch ( getConstructorId() ) {
case 0:
{
+ bool isDetectSelfInte = mySelfInte->isChecked();
int aLimit = GetLimit();
int aKeepNonlimitShapes = GroupPoints->CheckButton1->isChecked();
bool aNoSelfIntersection = GroupPoints->CheckButton2->isChecked();
isDetectSelfInte) :
anOper->MakePartition(myListShapes, myListTools,
myListKeepInside, myListRemoveInside,
- aLimit, false, myListMaterials, aKeepNonlimitShapes,
- isDetectSelfInte);
+ aLimit, false, myListMaterials, aKeepNonlimitShapes);
res = true;
}
break;
case 1:
{
- anObj = anOper->MakeHalfPartition( myListShapes[0].in(), myListTools[0].in(),
- isDetectSelfInte );
+ anObj = anOper->MakeHalfPartition(myListShapes[0].in(), myListTools[0].in());
res = true;
}
break;