// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : GEOMImpl_IShapesOperations.cxx
-// Created :
+// Created :
// Author : modified by Lioka RAZAFINDRAZAKA (CEA) 22/06/2007
// Project : SALOME
// $Header$
MESSAGE("GEOMImpl_IShapesOperations::~GEOMImpl_IShapesOperations");
}
-
//=============================================================================
/*!
* MakeEdge
return aSeq;
}
-
//=============================================================================
/*!
* MakeGlueFacesByList
}
//Make a Python command
-
+
GEOM::TPythonDump pd(aFunction);
pd << aGlued << " = geompy.MakeGlueFacesByList("
<< theShape << ", " << theTolerance << ", [";
}
pd << "])";
-
// to provide warning
if (!isWarning) SetErrorCode(OK);
return aGlued;
}
-
-
//=============================================================================
/*!
* MakeExplode
(Abs(curv.LastParameter()) >= 1E6))
aTypeName = "Line";
else
- aTypeName = "Edge" ;
+ aTypeName = "Edge";
} else if (curv.GetType() == GeomAbs_Circle) {
if (curv.IsClosed())
aTypeName = "Circle";
return aTypeName;
}
-
//=============================================================================
/*!
* NumberOfFaces
//function : GetSharedShapes
//purpose :
//=======================================================================
-
Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetSharedShapes
(Handle(GEOM_Object) theShape1,
Handle(GEOM_Object) theShape2,
* \retval bool - result of the check
*/
//=======================================================================
-
bool GEOMImpl_IShapesOperations::checkTypeShapesOn(const Standard_Integer theShapeType)
{
if (theShapeType != TopAbs_VERTEX &&
* \retval Handle(Geom_Surface) - resulting surface
*/
//=======================================================================
-
Handle(Geom_Surface) GEOMImpl_IShapesOperations::makePlane(const TopoDS_Shape& anAx1)
{
if (anAx1.ShapeType() != TopAbs_EDGE) return NULL;
* \retval Handle(Geom_Surface) - resulting surface
*/
//=======================================================================
-
Handle(Geom_Surface) GEOMImpl_IShapesOperations::makeCylinder(const TopoDS_Shape& anAxis,
const Standard_Real theRadius)
{
return new Geom_CylindricalSurface(anAx3, theRadius);
}
-
//=======================================================================
//function : getShapesOnBoxIDs
/*!
* \retval Handle(TColStd_HSequenceOfInteger) - IDs of found subshapes
*/
//=======================================================================
-
Handle(TColStd_HSequenceOfInteger)
GEOMImpl_IShapesOperations::getShapesOnBoxIDs(const Handle(GEOM_Object)& theBox,
const Handle(GEOM_Object)& theShape,
return aSeqOfIDs;
}
-
//=======================================================================
//function : GetShapesOnBoxIDs
/*!
* \retval Handle(TColStd_HSequenceOfInteger) - IDs of found subshapes
*/
//=======================================================================
-
Handle(TColStd_HSequenceOfInteger)
GEOMImpl_IShapesOperations::GetShapesOnBoxIDs(const Handle(GEOM_Object)& theBox,
const Handle(GEOM_Object)& theShape,
* \retval Handle(TColStd_HSequenceOfTransient) - found subshapes
*/
//=======================================================================
-
Handle(TColStd_HSequenceOfTransient)
GEOMImpl_IShapesOperations::GetShapesOnBox(const Handle(GEOM_Object)& theBox,
const Handle(GEOM_Object)& theShape,
return aSeq;
}
-
//=======================================================================
//function : getShapesOnShapeIDs
/*!
* \retval Handle(TColStd_HSequenceOfInteger) - IDs of found subshapes
*/
//=======================================================================
-
-Handle(TColStd_HSequenceOfInteger)
+Handle(TColStd_HSequenceOfInteger)
GEOMImpl_IShapesOperations::getShapesOnShapeIDs
(const Handle(GEOM_Object)& theCheckShape,
const Handle(GEOM_Object)& theShape,
return aSeqOfIDs;
}
-
//=======================================================================
//function : GetShapesOnShapeIDs
/*!
* \retval Handle(TColStd_HSequenceOfInteger) - IDs of found subshapes
*/
//=======================================================================
-
Handle(TColStd_HSequenceOfInteger)
GEOMImpl_IShapesOperations::GetShapesOnShapeIDs
(const Handle(GEOM_Object)& theCheckShape,
return aSeqOfIDs;
}
-
//=======================================================================
//function : GetShapesOnShape
/*!
* \retval Handle(TColStd_HSequenceOfTransient) - found subshapes
*/
//=======================================================================
-
Handle(TColStd_HSequenceOfTransient)
GEOMImpl_IShapesOperations::GetShapesOnShape
(const Handle(GEOM_Object)& theCheckShape,
<< TopAbs_ShapeEnum(theShapeType) << ", "
<< theState << ")";
-
SetErrorCode(OK);
return aSeq;
}
-
//=======================================================================
//function : GetShapesOnShapeAsCompound
//=======================================================================
-
Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetShapesOnShapeAsCompound
(const Handle(GEOM_Object)& theCheckShape,
const Handle(GEOM_Object)& theShape,
return aRes;
}
-
//=======================================================================
//function : getShapesOnSurfaceIDs
/*!
* \retval Handle(TColStd_HSequenceOfInteger) - IDs of found subshapes
*/
//=======================================================================
-
Handle(TColStd_HSequenceOfInteger)
GEOMImpl_IShapesOperations::getShapesOnSurfaceIDs(const Handle(Geom_Surface)& theSurface,
const TopoDS_Shape& theShape,
* \retval Handle(TColStd_HSequenceOfTransient) - found shape objects
*/
//=======================================================================
-
Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::
getObjectsShapesOn(const Handle(GEOM_Object)& theShape,
const Handle(TColStd_HSequenceOfInteger)& theShapeIDs,
* \retval Handle(TColStd_HSequenceOfInteger) - IDs of found subshapes
*/
//=======================================================================
-
Handle(TColStd_HSequenceOfTransient)
GEOMImpl_IShapesOperations::getShapesOnSurface(const Handle(Geom_Surface)& theSurface,
const Handle(GEOM_Object)& theShape,
* \retval Handle(TColStd_HSequenceOfInteger) - IDs of found subshapes
*/
//=======================================================================
-
Handle(TColStd_HSequenceOfInteger)
GEOMImpl_IShapesOperations::getShapesOnQuadrangleIDs (const Handle(GEOM_Object)& theShape,
const Standard_Integer theShapeType,
* \retval Handle(TColStd_HSequenceOfInteger) - IDs of found subshapes
*/
//=======================================================================
-
Handle(TColStd_HSequenceOfTransient)
GEOMImpl_IShapesOperations::GetShapesOnQuadrangle (const Handle(GEOM_Object)& theShape,
const Standard_Integer theShapeType,
* \retval Handle(TColStd_HSequenceOfInteger) - IDs of found subshapes
*/
//=======================================================================
-
Handle(TColStd_HSequenceOfInteger)
GEOMImpl_IShapesOperations::GetShapesOnQuadrangleIDs (const Handle(GEOM_Object)& theShape,
const Standard_Integer theShapeType,
return aSeqOfIDs;
}
-
//=============================================================================
/*!
* GetInPlaceOfShape
* GetShapeProperties
*/
//=============================================================================
-
void GEOMImpl_IShapesOperations::GetShapeProperties( const TopoDS_Shape aShape, Standard_Real tab[],
gp_Pnt & aVertex )
{
}
// Searching for the sub-shapes inside the ShapeWhere shape
+ TopTools_MapOfShape map_aWhere;
for ( Exp_aWhere.ReInit(); Exp_aWhere.More(); Exp_aWhere.Next() ) {
+ if (!map_aWhere.Add(Exp_aWhere.Current()))
+ continue; // skip repeated shape to avoid mass addition
GetShapeProperties( Exp_aWhere.Current(), tab_aWhere, aPnt );
for ( Exp_aWhat.ReInit(); Exp_aWhat.More(); Exp_aWhat.Next() ) {
GetShapeProperties( Exp_aWhat.Current(), tab_aWhat, aPnt_aWhat );
- if ( fabs(tab_aWhat[3] - tab_aWhere[3]) <= Tol_Mass && aPnt_aWhat.Distance(aPnt) <= Tol_1D ) isFound = true;
+ if ( fabs(tab_aWhat[3] - tab_aWhere[3]) <= Tol_Mass && aPnt_aWhat.Distance(aPnt) <= Tol_1D )
+ isFound = true;
else {
if ( (tab_aWhat[3] - tab_aWhere[3]) > Tol_Mass ) {
aPntShape = BRepBuilderAPI_MakeVertex( aPnt ).Shape();
aVertex = TopoDS::Vertex( aPntShape );
BRepExtrema_DistShapeShape aWhereDistance ( aVertex, Exp_aWhere.Current() );
BRepExtrema_DistShapeShape aWhatDistance ( aVertex, Exp_aWhat.Current() );
- if ( fabs(aWhereDistance.Value() - aWhatDistance.Value()) <= Tol_1D ) isFound = true;
+ if ( fabs(aWhereDistance.Value() - aWhatDistance.Value()) <= Tol_1D )
+ isFound = true;
}
}
if ( isFound ) {
//Make a Python command
Handle(GEOM_Function) aFunction = aResult->GetFunction(1);
- GEOM::TPythonDump(aFunction) << aResult << " = geompy.GetInPlace("
+ GEOM::TPythonDump(aFunction) << aResult << " = geompy.GetInPlaceByHistory("
<< theShapeWhere << ", " << theShapeWhat << ")";
SetErrorCode(OK);
}
}
}
-
+
for (Index=1; Index <= MaxShapes; Index++)
SL.Append( aShapes( OrderInd(Index) ));
}
#define MAX_TOLERANCE 1.e-7
-
//=======================================================================
//function : isSameEdge
//purpose : Returns True if two edges coincide
if(P.Z() > zmaxB2) zmaxB2 = P.Z();
}
-
//Compare the bounding boxes of both faces
if(gp_Pnt(xminB1, yminB1, zminB1).Distance(gp_Pnt(xminB2, yminB2, zminB2)) > MAX_TOLERANCE)
return false;
U = U11+rangeU*2.0/3.0;
V = V11+rangeV*2.0/3.0;
gp_Pnt P2 = S1->Value(U, V);
-
- if(!GeomLib_Tool::Parameters(S2, P1, MAX_TOLERANCE, U, V) || U < U21 || U > U22 || V < V21 || V > V22)
+
+ if (!GeomLib_Tool::Parameters(S2, P1, MAX_TOLERANCE, U, V) || U < U21 || U > U22 || V < V21 || V > V22)
return false;
-
- if(P1.Distance(S2->Value(U,V)) > MAX_TOLERANCE) return false;
-
- if(!GeomLib_Tool::Parameters(S2, P2, MAX_TOLERANCE, U, V) || U < U21 || U > U22 || V < V21 || V > V22)
+
+ if (P1.Distance(S2->Value(U,V)) > MAX_TOLERANCE) return false;
+
+ if (!GeomLib_Tool::Parameters(S2, P2, MAX_TOLERANCE, U, V) || U < U21 || U > U22 || V < V21 || V > V22)
return false;
-
- if(P2.Distance(S2->Value(U, V)) > MAX_TOLERANCE) return false;
+
+ if (P2.Distance(S2->Value(U, V)) > MAX_TOLERANCE) return false;
//Check that each edge of the Face1 has a counterpart in the Face2
TopTools_MapOfOrientedShape aMap;