diff --git a/idl/GEOM_Gen.idl b/idl/GEOM_Gen.idl index d1428637a..f61853859 100644 --- a/idl/GEOM_Gen.idl +++ b/idl/GEOM_Gen.idl @@ -2664,12 +2664,14 @@ module GEOM * \param theShape - the shape to explore * \param theShapeType - type of sub-shape of theShape * \param theState - required state + * \param theTolerance - tolerance * \return List of IDs of all found sub-shapes. */ ListOfLong GetShapesOnShapeIDs (in GEOM_Object theCheckShape, in GEOM_Object theShape, in short theShapeType, - in shape_state theState); + in shape_state theState, + in double theTolerance); /*! * \brief Find sub-shapes complying with given status @@ -2677,12 +2679,14 @@ module GEOM * \param theShape - the shape to explore * \param theShapeType - type of sub-shape of theShape * \param theState - required state + * \param theTolerance - tolerance * \return List of all found sub-shapes. */ ListOfGO GetShapesOnShape (in GEOM_Object theCheckShape, in GEOM_Object theShape, in short theShapeType, - in shape_state theState); + in shape_state theState, + in double theTolerance); /*! * \brief Find sub-shapes complying with given status @@ -2690,12 +2694,14 @@ module GEOM * \param theShape - the shape to explore * \param theShapeType - type of sub-shape of theShape * \param theState - required state + * \param theTolerance - tolerance * \return compound includes all found sub-shapes. */ GEOM_Object GetShapesOnShapeAsCompound (in GEOM_Object theCheckShape, in GEOM_Object theShape, in short theShapeType, - in shape_state theState); + in shape_state theState, + in double theTolerance); /*! * \brief Get sub-shape(s) of \a theShapeWhere, which are diff --git a/idl/GEOM_Superv.idl b/idl/GEOM_Superv.idl index 0f6ddc0f9..333826852 100644 --- a/idl/GEOM_Superv.idl +++ b/idl/GEOM_Superv.idl @@ -413,11 +413,13 @@ module GEOM GEOM_List GetShapesOnShape (in GEOM_Object theCheckShape, in GEOM_Object theShape, in short theShapeType, - in shape_state theState); + in shape_state theState, + in double theTolerance); GEOM_Object GetShapesOnShapeAsCompound (in GEOM_Object theCheckShape, in GEOM_Object theShape, in short theShapeType, - in shape_state theState); + in shape_state theState, + in double theTolerance); //-----------------------------------------------------------// // BlocksOperations // diff --git a/src/AdvancedEngine/AdvancedEngine_IOperations.cxx b/src/AdvancedEngine/AdvancedEngine_IOperations.cxx index d43f44952..edfa89e16 100644 --- a/src/AdvancedEngine/AdvancedEngine_IOperations.cxx +++ b/src/AdvancedEngine/AdvancedEngine_IOperations.cxx @@ -396,7 +396,7 @@ bool AdvancedEngine_IOperations::MakeGroups(Handle(GEOM_Object) theShape, int sh Handle(GEOM_Object) junctionFaces1 = myShapesOperations->GetInPlace(theShape, aPln1); if (junctionFaces1.IsNull()) junctionFaces1 = myShapesOperations->GetShapesOnShapeAsCompound - (aPln1, theShape, TopAbs_FACE, GEOMAlgo_ST_ONIN); + (aPln1, theShape, TopAbs_FACE, GEOMAlgo_ST_ONIN, Precision::Confusion()); if (!junctionFaces1.IsNull()) { junctionFaces1->GetLastFunction()->SetDescription(""); junctionFaces1->SetName("JUNCTION_FACE_1"); @@ -410,7 +410,7 @@ bool AdvancedEngine_IOperations::MakeGroups(Handle(GEOM_Object) theShape, int sh Handle(GEOM_Object) junctionFaces2 = myShapesOperations->GetInPlace(theShape, aPln2); if (junctionFaces2.IsNull()) junctionFaces2 = myShapesOperations->GetShapesOnShapeAsCompound - (aPln2, theShape, TopAbs_FACE, GEOMAlgo_ST_ONIN); + (aPln2, theShape, TopAbs_FACE, GEOMAlgo_ST_ONIN, Precision::Confusion()); if (!junctionFaces2.IsNull()) { junctionFaces2->GetLastFunction()->SetDescription(""); junctionFaces2->SetName("JUNCTION_FACE_2"); @@ -424,7 +424,7 @@ bool AdvancedEngine_IOperations::MakeGroups(Handle(GEOM_Object) theShape, int sh Handle(GEOM_Object) junctionFaces3 = myShapesOperations->GetInPlace(theShape, aPln3); if (junctionFaces3.IsNull()) junctionFaces3 = myShapesOperations->GetShapesOnShapeAsCompound - (aPln3, theShape, TopAbs_FACE, GEOMAlgo_ST_ONIN); + (aPln3, theShape, TopAbs_FACE, GEOMAlgo_ST_ONIN, Precision::Confusion()); if (!junctionFaces3.IsNull()) { junctionFaces3->GetLastFunction()->SetDescription(""); junctionFaces3->SetName("JUNCTION_FACE_3"); diff --git a/src/GEOMGUI/GEOM_msg_en.ts b/src/GEOMGUI/GEOM_msg_en.ts index 41c3fa5de..4d4fdc972 100644 --- a/src/GEOMGUI/GEOM_msg_en.ts +++ b/src/GEOMGUI/GEOM_msg_en.ts @@ -5279,6 +5279,10 @@ Please, select face, shell or solid and try again GEOM_SHAPES_ON_SHAPE_STATE State + + + GEOM_SHAPES_ON_SHAPE_TOLERANCE + Tolerance GEOM_KIND_OF_SHAPE diff --git a/src/GEOMGUI/GEOM_msg_fr.ts b/src/GEOMGUI/GEOM_msg_fr.ts index 6605a135e..199ae0ef3 100644 --- a/src/GEOMGUI/GEOM_msg_fr.ts +++ b/src/GEOMGUI/GEOM_msg_fr.ts @@ -5272,6 +5272,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau GEOM_SHAPES_ON_SHAPE_STATE Etat + + GEOM_SHAPES_ON_SHAPE_TOLERANCE + Tolérance + GEOM_KIND_OF_SHAPE Type d'objet : diff --git a/src/GEOMGUI/GEOM_msg_ja.ts b/src/GEOMGUI/GEOM_msg_ja.ts index 46a0ea135..1db457448 100644 --- a/src/GEOMGUI/GEOM_msg_ja.ts +++ b/src/GEOMGUI/GEOM_msg_ja.ts @@ -5275,6 +5275,10 @@ GEOM_SHAPES_ON_SHAPE_STATE 状態 + + GEOM_SHAPES_ON_SHAPE_TOLERANCE + 公差 + GEOM_KIND_OF_SHAPE 形状の種類: diff --git a/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx b/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx index edc8d56fd..08a9a6d0f 100644 --- a/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx @@ -2901,7 +2901,8 @@ Handle(TColStd_HSequenceOfInteger) (const Handle(GEOM_Object)& theCheckShape, const Handle(GEOM_Object)& theShape, const Standard_Integer theShapeType, - GEOMAlgo_State theState) + GEOMAlgo_State theState, + const Standard_Real theTolerance) { Handle(TColStd_HSequenceOfInteger) aSeqOfIDs; @@ -2917,7 +2918,7 @@ Handle(TColStd_HSequenceOfInteger) // Compute classification tolerance. TopTools_IndexedMapOfShape aMapVtx; - Standard_Real aTol = Precision::Confusion(); + Standard_Real aTol = theTolerance; TopExp::MapShapes(aShape, TopAbs_VERTEX, aMapVtx); @@ -3010,10 +3011,11 @@ Handle(TColStd_HSequenceOfInteger) (const Handle(GEOM_Object)& theCheckShape, const Handle(GEOM_Object)& theShape, const Standard_Integer theShapeType, - GEOMAlgo_State theState) + GEOMAlgo_State theState, + const Standard_Real theTolerance) { Handle(TColStd_HSequenceOfInteger) aSeqOfIDs = - getShapesOnShapeIDs (theCheckShape, theShape, theShapeType, theState); + getShapesOnShapeIDs (theCheckShape, theShape, theShapeType, theState, theTolerance); if ( aSeqOfIDs.IsNull() || aSeqOfIDs->Length() == 0 ) return NULL; @@ -3030,7 +3032,8 @@ Handle(TColStd_HSequenceOfInteger) << theCheckShape << ", " << theShape << ", " << TopAbs_ShapeEnum(theShapeType) << ", " - << theState << ")"; + << theState << ", " + << theTolerance << ")"; #endif // DUMP_SUBSHAPE_IDS SetErrorCode(OK); @@ -3053,10 +3056,11 @@ Handle(TColStd_HSequenceOfTransient) (const Handle(GEOM_Object)& theCheckShape, const Handle(GEOM_Object)& theShape, const Standard_Integer theShapeType, - GEOMAlgo_State theState) + GEOMAlgo_State theState, + const Standard_Real theTolerance) { Handle(TColStd_HSequenceOfInteger) aSeqOfIDs = - getShapesOnShapeIDs (theCheckShape, theShape, theShapeType, theState); + getShapesOnShapeIDs (theCheckShape, theShape, theShapeType, theState, theTolerance); if ( aSeqOfIDs.IsNull() || aSeqOfIDs->Length() == 0 ) return NULL; @@ -3078,7 +3082,8 @@ Handle(TColStd_HSequenceOfTransient) << theCheckShape << ", " << theShape << ", " << TopAbs_ShapeEnum(theShapeType) << ", " - << theState << ")"; + << theState << ", " + << theTolerance << ")"; SetErrorCode(OK); return aSeq; @@ -3089,12 +3094,13 @@ Handle(TColStd_HSequenceOfTransient) //======================================================================= Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetShapesOnShapeAsCompound (const Handle(GEOM_Object)& theCheckShape, - const Handle(GEOM_Object)& theShape, + const Handle(GEOM_Object)& theShape, const Standard_Integer theShapeType, - GEOMAlgo_State theState) + GEOMAlgo_State theState, + const Standard_Real theTolerance) { Handle(TColStd_HSequenceOfInteger) aSeqOfIDs = - getShapesOnShapeIDs (theCheckShape, theShape, theShapeType, theState); + getShapesOnShapeIDs (theCheckShape, theShape, theShapeType, theState, theTolerance); if ( aSeqOfIDs.IsNull() || aSeqOfIDs->Length() == 0 ) return NULL; @@ -3137,8 +3143,8 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetShapesOnShapeAsCompound << theCheckShape << ", " << theShape << ", " << TopAbs_ShapeEnum(theShapeType) << ", " - << theState << ")"; - + << theState << ", " + << theTolerance << ")"; SetErrorCode(OK); return aRes; diff --git a/src/GEOMImpl/GEOMImpl_IShapesOperations.hxx b/src/GEOMImpl/GEOMImpl_IShapesOperations.hxx index dc352ba58..1dd9b1e02 100644 --- a/src/GEOMImpl/GEOMImpl_IShapesOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IShapesOperations.hxx @@ -397,13 +397,15 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations * \param theShape - the shape to explore * \param theShapeType - type of sub-shape of theShape * \param theState - required state + * \param theTolerance - tolerance * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes */ Standard_EXPORT Handle(TColStd_HSequenceOfInteger) GetShapesOnShapeIDs(const Handle(GEOM_Object)& theCheckShape, const Handle(GEOM_Object)& theShape, const Standard_Integer theShapeType, - GEOMAlgo_State theState); + GEOMAlgo_State theState, + const Standard_Real theTolerance); /*! * \brief Find sub-shapes complying with given status about surface @@ -411,18 +413,21 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations * \param theShape - the shape to explore * \param theShapeType - type of sub-shape of theShape * \param theState - required state + * \param theTolerance - tolerance * \retval Handle(TColStd_HSequenceOfTransient) - found shape objects */ Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetShapesOnShape(const Handle(GEOM_Object)& theCheckShape, const Handle(GEOM_Object)& theShape, const Standard_Integer theShapeType, - GEOMAlgo_State theState); + GEOMAlgo_State theState, + const Standard_Real theTolerance); Standard_EXPORT Handle(GEOM_Object) GetShapesOnShapeAsCompound(const Handle(GEOM_Object)& theCheckShape, const Handle(GEOM_Object)& theShape, const Standard_Integer theShapeType, - GEOMAlgo_State theState); + GEOMAlgo_State theState, + const Standard_Real theTolerance); /*! * \brief Resize the input edge with the new Min and Max parameters. @@ -628,7 +633,8 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations (const Handle(GEOM_Object)& theCheckShape, const Handle(GEOM_Object)& theShape, const Standard_Integer theShapeType, - GEOMAlgo_State theState); + GEOMAlgo_State theState, + const Standard_Real theTolerance); /*! * \brief Find shape objects and their entries by their ids diff --git a/src/GEOM_I/GEOM_Gen_i.cc b/src/GEOM_I/GEOM_Gen_i.cc index 18d4ca581..96ab9cdb4 100644 --- a/src/GEOM_I/GEOM_Gen_i.cc +++ b/src/GEOM_I/GEOM_Gen_i.cc @@ -1188,7 +1188,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(GEOM::GEOM_Object_ptr theObject, { // Use GetShapesOnShape. Can work only on solids, so it has sense to search only solids aSubO = aShapesOp->GetShapesOnShapeAsCompound(anArgO, theObject, - (short)GEOM::SOLID, GEOM::ST_ONIN); + (short)GEOM::SOLID, GEOM::ST_ONIN, Precision::Confusion()); } break; case GEOM::FSM_GetInPlaceByHistory: @@ -1469,7 +1469,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesOneLevel (SALOMEDS::SObject_ptr th { // Use GetShapesOnShape. Can work only on solids, so it has sense to search only solids aNewSubO = aShapesOp->GetShapesOnShapeAsCompound(anOldSubO, theNewO, - (short)GEOM::SOLID, GEOM::ST_ONIN); + (short)GEOM::SOLID, GEOM::ST_ONIN, Precision::Confusion()); } break; case GEOM::FSM_GetInPlaceByHistory: @@ -1753,7 +1753,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapes(GEOM::GEOM_Object_ptr theObj { // Use GetShapesOnShape. Can work only on solids, so it has sense to search only solids aSubO = aShapesOp->GetShapesOnShapeAsCompound(anArgO, theObject, - (short)GEOM::SOLID, GEOM::ST_ONIN); + (short)GEOM::SOLID, GEOM::ST_ONIN, Precision::Confusion()); } break; case GEOM::FSM_GetInPlaceByHistory: @@ -2032,7 +2032,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapesOneLevel (SALOMEDS::SObject_ptr { // Use GetShapesOnShape. Can work only on solids, so it has sense to search only solids aNewSubO = aShapesOp->GetShapesOnShapeAsCompound(anOldSubO, theNewO, - (short)GEOM::SOLID, GEOM::ST_ONIN); + (short)GEOM::SOLID, GEOM::ST_ONIN, Precision::Confusion()); } break; case GEOM::FSM_GetInPlaceByHistory: diff --git a/src/GEOM_I/GEOM_IShapesOperations_i.cc b/src/GEOM_I/GEOM_IShapesOperations_i.cc index 1e02554d7..d42816d28 100644 --- a/src/GEOM_I/GEOM_IShapesOperations_i.cc +++ b/src/GEOM_I/GEOM_IShapesOperations_i.cc @@ -1850,7 +1850,8 @@ GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnShape (GEOM::GEOM_Object_ptr theCheckShape, GEOM::GEOM_Object_ptr theShape, CORBA::Short theShapeType, - GEOM::shape_state theState) + GEOM::shape_state theState, + CORBA::Double theTolerance) { GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO; @@ -1866,7 +1867,7 @@ GEOM::ListOfGO* GEOM_IShapesOperations_i::GetShapesOnShape //Get Shapes On Shape Handle(TColStd_HSequenceOfTransient) aHSeq = GetOperations()->GetShapesOnShape - (aCheckShape,aShape, theShapeType,ShapeState(theState)); + (aCheckShape,aShape, theShapeType,ShapeState(theState), theTolerance); if (!GetOperations()->IsDone() || aHSeq.IsNull()) return aSeq._retn(); @@ -1889,7 +1890,8 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetShapesOnShapeAsCompound (GEOM::GEOM_Object_ptr theCheckShape, GEOM::GEOM_Object_ptr theShape, CORBA::Short theShapeType, - GEOM::shape_state theState) + GEOM::shape_state theState, + CORBA::Double theTolerance) { GEOM::GEOM_Object_var aGEOMObject; @@ -1905,7 +1907,7 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::GetShapesOnShapeAsCompound //Get Shapes On Shape Handle(::GEOM_Object) anObject = GetOperations()->GetShapesOnShapeAsCompound - (aCheckShape,aShape, theShapeType,ShapeState(theState)); + (aCheckShape,aShape, theShapeType,ShapeState(theState), theTolerance); if (anObject.IsNull()) return aGEOMObject._retn(); @@ -1923,7 +1925,8 @@ GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnShapeIDs (GEOM::GEOM_Object_ptr theCheckShape, GEOM::GEOM_Object_ptr theShape, CORBA::Short theShapeType, - GEOM::shape_state theState) + GEOM::shape_state theState, + CORBA::Double theTolerance) { GEOM::ListOfLong_var aSeq = new GEOM::ListOfLong; @@ -1939,7 +1942,7 @@ GEOM::ListOfLong* GEOM_IShapesOperations_i::GetShapesOnShapeIDs //Get Shapes On Shape Handle(TColStd_HSequenceOfInteger) aHSeq = GetOperations()->GetShapesOnShapeIDs - (aCheckShape,aShape, theShapeType,ShapeState(theState)); + (aCheckShape,aShape, theShapeType,ShapeState(theState), theTolerance); if (!GetOperations()->IsDone() || aHSeq.IsNull()) return aSeq._retn(); diff --git a/src/GEOM_I/GEOM_IShapesOperations_i.hh b/src/GEOM_I/GEOM_IShapesOperations_i.hh index 2d8cdf36e..f4aa86321 100644 --- a/src/GEOM_I/GEOM_IShapesOperations_i.hh +++ b/src/GEOM_I/GEOM_IShapesOperations_i.hh @@ -262,18 +262,21 @@ class GEOM_I_EXPORT GEOM_IShapesOperations_i : GEOM::ListOfGO* GetShapesOnShape (GEOM::GEOM_Object_ptr theSheckShape, GEOM::GEOM_Object_ptr theShape, CORBA::Short theShapeType, - GEOM::shape_state theState); + GEOM::shape_state theState, + CORBA::Double theTolerance); GEOM::GEOM_Object_ptr GetShapesOnShapeAsCompound (GEOM::GEOM_Object_ptr theSheckShape, GEOM::GEOM_Object_ptr theShape, CORBA::Short theShapeType, - GEOM::shape_state theState); + GEOM::shape_state theState, + CORBA::Double theTolerance); GEOM::ListOfLong* GetShapesOnShapeIDs (GEOM::GEOM_Object_ptr theCheckShape, GEOM::GEOM_Object_ptr theShape, CORBA::Short theShapeType, - GEOM::shape_state theState); + GEOM::shape_state theState, + CORBA::Double theTolerance); GEOM::GEOM_Object_ptr GetInPlace (GEOM::GEOM_Object_ptr theShapeWhere, GEOM::GEOM_Object_ptr theShapeWhat); diff --git a/src/GEOM_I_Superv/GEOM_Superv_i.cc b/src/GEOM_I_Superv/GEOM_Superv_i.cc index c510ec9a3..85a77fa66 100644 --- a/src/GEOM_I_Superv/GEOM_Superv_i.cc +++ b/src/GEOM_I_Superv/GEOM_Superv_i.cc @@ -2424,13 +2424,14 @@ GEOM::GEOM_List_ptr GEOM_Superv_i::GetShapesOnShape (GEOM::GEOM_Object_ptr theCheckShape, GEOM::GEOM_Object_ptr theShape, CORBA::Short theShapeType, - GEOM::shape_state theState) + GEOM::shape_state theState, + CORBA::Double theTolerance) { beginService( " GEOM_Superv_i::GetShapesOnShape" ); MESSAGE("GEOM_Superv_i::GetShapesOnShape"); getShapesOp(); GEOM::ListOfGO* aList = - myShapesOp->GetShapesOnShape(theCheckShape, theShape, theShapeType, theState); + myShapesOp->GetShapesOnShape(theCheckShape, theShape, theShapeType, theState, theTolerance); GEOM_List_i* aListPtr = new GEOM_List_i(*(aList)); MESSAGE(" List of "<GetList().length()<<" element(s)"); endService( " GEOM_Superv_i::GetShapesOnShape" ); @@ -2445,13 +2446,14 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::GetShapesOnShapeAsCompound (GEOM::GEOM_Object_ptr theCheckShape, GEOM::GEOM_Object_ptr theShape, CORBA::Short theShapeType, - GEOM::shape_state theState) + GEOM::shape_state theState, + CORBA::Double theTolerance) { beginService( " GEOM_Superv_i::GetShapesOnShapeAsCompound" ); MESSAGE("GEOM_Superv_i::GetShapesOnShapeAsCompound"); getShapesOp(); GEOM::GEOM_Object_ptr anObj = - myShapesOp->GetShapesOnShapeAsCompound(theCheckShape, theShape, theShapeType, theState); + myShapesOp->GetShapesOnShapeAsCompound(theCheckShape, theShape, theShapeType, theState, theTolerance); endService( " GEOM_Superv_i::GetShapesOnShapeAsCompound" ); return anObj; } diff --git a/src/GEOM_I_Superv/GEOM_Superv_i.hh b/src/GEOM_I_Superv/GEOM_Superv_i.hh index b07a82e0d..611045029 100644 --- a/src/GEOM_I_Superv/GEOM_Superv_i.hh +++ b/src/GEOM_I_Superv/GEOM_Superv_i.hh @@ -528,12 +528,14 @@ public: GEOM::GEOM_List_ptr GetShapesOnShape (GEOM::GEOM_Object_ptr theCheckShape, GEOM::GEOM_Object_ptr theShape, CORBA::Short theShapeType, - GEOM::shape_state theState); + GEOM::shape_state theState, + CORBA::Double theTolerance); GEOM::GEOM_Object_ptr GetShapesOnShapeAsCompound (GEOM::GEOM_Object_ptr theCheckShape, GEOM::GEOM_Object_ptr theShape, CORBA::Short theShapeType, - GEOM::shape_state theState); + GEOM::shape_state theState, + CORBA::Double theTolerance); //-----------------------------------------------------------// // BlocksOperations // diff --git a/src/GEOM_SWIG/geomBuilder.py b/src/GEOM_SWIG/geomBuilder.py index 7cf3edc64..fd91f2ae6 100644 --- a/src/GEOM_SWIG/geomBuilder.py +++ b/src/GEOM_SWIG/geomBuilder.py @@ -5915,7 +5915,6 @@ class geomBuilder(GEOM._objref_GEOM_Gen): # @param theShape Shape to find sub-shapes of. # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType()) # @param theState The state of the sub-shapes to find (see GEOM::shape_state) - # # @return List of all found sub-shapes indices. # # @ref swig_GetShapesOnBoxIDs "Example" @@ -5946,6 +5945,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen): # @param theShape Shape to find sub-shapes of. # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType()) # @param theState The state of the sub-shapes to find (see GEOM::shape_state) + # @param theTol tolerance that can be set by the user # @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. @@ -5954,7 +5954,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen): # # @ref swig_GetShapesOnShape "Example" @ManageTransactions("ShapesOp") - def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theName=None): + def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState, theTol = 1e-07, theName=None): """ Find in theShape all sub-shapes of type theShapeType, situated relatively the specified theCheckShape by the @@ -5974,7 +5974,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen): """ # Example: see GEOM_TestOthers.py aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape, - theShapeType, theState) + theShapeType, theState, theTol) RaiseIfFailed("GetShapesOnShape", self.ShapesOp) self._autoPublish(aList, theName, "shapeOnShape") return aList @@ -5986,6 +5986,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen): # @param theShape Shape to find sub-shapes of. # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType()) # @param theState The state of the sub-shapes to find (see GEOM::shape_state) + # @param theTol tolerance that can be set by the user # @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. @@ -5994,7 +5995,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen): # # @ref swig_GetShapesOnShapeAsCompound "Example" @ManageTransactions("ShapesOp") - def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theName=None): + def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState, theTol = 1e-07, theName=None): """ Find in theShape all sub-shapes of type theShapeType, situated relatively the specified theCheckShape by the @@ -6014,7 +6015,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen): """ # Example: see GEOM_TestOthers.py anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape, - theShapeType, theState) + theShapeType, theState, theTol) RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp) self._autoPublish(anObj, theName, "shapeOnShape") return anObj @@ -6026,12 +6027,13 @@ class geomBuilder(GEOM._objref_GEOM_Gen): # @param theShape Shape to find sub-shapes of. # @param theShapeType Type of sub-shapes to be retrieved (see ShapeType()) # @param theState The state of the sub-shapes to find (see GEOM::shape_state) + # @param theTol tolerance that can be set by the user # # @return List of all found sub-shapes indices. # # @ref swig_GetShapesOnShapeIDs "Example" @ManageTransactions("ShapesOp") - def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState): + def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState, theTol = 1e-07): """ Find in theShape all sub-shapes of type theShapeType, situated relatively the specified theCheckShape by the @@ -6048,7 +6050,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen): """ # Example: see GEOM_TestOthers.py aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape, - theShapeType, theState) + theShapeType, theState, theTol) RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp) return aList diff --git a/src/OperationGUI/OperationGUI_GetShapesOnShapeDlg.cxx b/src/OperationGUI/OperationGUI_GetShapesOnShapeDlg.cxx index da0575b37..bcc9a47ce 100644 --- a/src/OperationGUI/OperationGUI_GetShapesOnShapeDlg.cxx +++ b/src/OperationGUI/OperationGUI_GetShapesOnShapeDlg.cxx @@ -32,6 +32,11 @@ #include #include +class SalomeApp_DoubleSpinBox; + +#define MAX_TOL 0.0001 +#define TOL 1e-07 + //============================================================================== // class : OperationGUI_GetShapesOnShapeDlg() // purpose : Constructs a OperationGUI_GetShapesOnShapeDlg which is a child of @@ -69,6 +74,11 @@ OperationGUI_GetShapesOnShapeDlg::OperationGUI_GetShapesOnShapeDlg (GeometryGUI* GroupPoints->LineEdit1->setReadOnly(true); GroupPoints->LineEdit2->setReadOnly(true); + QLabel *aTolLbl = new QLabel(tr("GEOM_SHAPES_ON_SHAPE_TOLERANCE")); + myTolSpinBox = new SalomeApp_DoubleSpinBox; + GroupPoints->gridLayout1->addWidget(aTolLbl, 4, 0); + GroupPoints->gridLayout1->addWidget(myTolSpinBox, 4, 1, 1, 2); + QVBoxLayout* layout = new QVBoxLayout(centralWidget()); layout->setMargin(0); layout->setSpacing(6); layout->addWidget(GroupPoints); @@ -114,6 +124,9 @@ void OperationGUI_GetShapesOnShapeDlg::Init() GroupPoints->LineEdit2->clear(); myObject1 = myObject2 = GEOM::GEOM_Object::_nil(); + initSpinBox(myTolSpinBox, 0., MAX_TOL, TOL, "param_tol_precision"); + myTolSpinBox->setValue(TOL); + showOnlyPreviewControl(); // signals and slots connections @@ -132,6 +145,8 @@ void OperationGUI_GetShapesOnShapeDlg::Init() connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); + connect(myTolSpinBox, SIGNAL(valueChanged(const QString&)), this, SLOT(processPreview())); + initName(mainFrame()->GroupConstructors->title()); GroupPoints->TextLabel3->show(); @@ -335,7 +350,7 @@ bool OperationGUI_GetShapesOnShapeDlg::execute (ObjectList& objects) GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow(getOperation()); GEOM::GEOM_Object_var anObj = anOper->GetShapesOnShapeAsCompound(myObject2, myObject1, (CORBA::Short) aLimit, - aState); // todo: aState must be explicitly initialized to avoid warning (see above) + aState, myTolSpinBox->value()); // todo: aState must be explicitly initialized to avoid warning (see above) if (!anObj->_is_nil()) objects.push_back(anObj._retn()); diff --git a/src/OperationGUI/OperationGUI_GetShapesOnShapeDlg.h b/src/OperationGUI/OperationGUI_GetShapesOnShapeDlg.h index e416747f7..a77a6d316 100644 --- a/src/OperationGUI/OperationGUI_GetShapesOnShapeDlg.h +++ b/src/OperationGUI/OperationGUI_GetShapesOnShapeDlg.h @@ -59,6 +59,7 @@ private: GEOMAlgo_State myState; DlgRef_2Sel2List* GroupPoints; + SalomeApp_DoubleSpinBox* myTolSpinBox; private slots: void ClickOnOk();