mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-26 17:30:35 +05:00
PAL14419 (IMP: a filter predicate to find nodes/elements lying on any
kind of geom surface needed) BelongToGenSurface predicate created
This commit is contained in:
parent
a901ac3222
commit
7a9f3cc854
@ -55,6 +55,7 @@ module SMESH
|
||||
FT_BelongToGeom,
|
||||
FT_BelongToPlane,
|
||||
FT_BelongToCylinder,
|
||||
FT_BelongToGenSurface,
|
||||
FT_LyingOnGeom,
|
||||
FT_RangeOfIds,
|
||||
FT_BadOrientedVolume,
|
||||
@ -158,22 +159,28 @@ module SMESH
|
||||
|
||||
/*!
|
||||
* Logical functor (predicate) "Belong To Surface".
|
||||
* Base interface for "belong to plane" and "belong to cylinder interfaces"
|
||||
* Base interface for "belong to plane" and "belong to cylinder"
|
||||
* and "Belong To Generic Surface" interfaces
|
||||
*/
|
||||
interface BelongToSurface: Predicate
|
||||
{
|
||||
void SetTolerance( in double theToler );
|
||||
double GetTolerance();
|
||||
void SetShapeName( in string theName, in ElementType theType );
|
||||
void SetShape( in string theID, in string theName, in ElementType theType );
|
||||
string GetShapeName();
|
||||
string GetShapeID();
|
||||
void SetTolerance( in double theToler );
|
||||
double GetTolerance();
|
||||
void SetShapeName( in string theName, in ElementType theType );
|
||||
void SetShape( in string theID, in string theName, in ElementType theType );
|
||||
string GetShapeName();
|
||||
string GetShapeID();
|
||||
/*!
|
||||
* Limit surface extent to bounding box of boundaries (edges)
|
||||
* in surface parametric space. Boundaries are ignored by default
|
||||
*/
|
||||
void SetUseBoundaries( in boolean theUseBndRestrictions );
|
||||
boolean GetUseBoundaries();
|
||||
};
|
||||
|
||||
|
||||
/*!
|
||||
* Logical functor (predicate) "Belong To Plane".
|
||||
* Verify whether mesh element lie in pointed Geom planar object
|
||||
* Verify whether mesh element lie on pointed Geom planar object
|
||||
*/
|
||||
interface BelongToPlane: BelongToSurface
|
||||
{
|
||||
@ -181,14 +188,23 @@ module SMESH
|
||||
};
|
||||
|
||||
/*!
|
||||
* Logical functor (predicate) "Belong To Culinder".
|
||||
* Verify whether mesh element lie in pointed Geom cylindrical object
|
||||
* Logical functor (predicate) "Belong To Cylinder".
|
||||
* Verify whether mesh element lie on pointed Geom cylindrical object
|
||||
*/
|
||||
interface BelongToCylinder: BelongToSurface
|
||||
{
|
||||
void SetCylinder( in GEOM::GEOM_Object theGeom, in ElementType theType );
|
||||
};
|
||||
|
||||
/*!
|
||||
* Logical functor (predicate) "Belong To Generic Surface".
|
||||
* Verify whether mesh element lie in pointed Geom cylindrical object
|
||||
*/
|
||||
interface BelongToGenSurface: BelongToSurface
|
||||
{
|
||||
void SetSurface( in GEOM::GEOM_Object theGeom, in ElementType theType );
|
||||
};
|
||||
|
||||
/*!
|
||||
* Logical functor (predicate) "Lying On Geometry".
|
||||
* Verify whether mesh element or node lying or partially lying on the pointed Geom Object
|
||||
@ -391,6 +407,7 @@ module SMESH
|
||||
BelongToGeom CreateBelongToGeom();
|
||||
BelongToPlane CreateBelongToPlane();
|
||||
BelongToCylinder CreateBelongToCylinder();
|
||||
BelongToGenSurface CreateBelongToGenSurface();
|
||||
|
||||
LyingOnGeom CreateLyingOnGeom();
|
||||
|
||||
|
@ -21,25 +21,27 @@
|
||||
|
||||
#include <set>
|
||||
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <gp_Ax3.hxx>
|
||||
#include <gp_Cylinder.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp_XYZ.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_CylindricalSurface.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <TColgp_Array1OfXYZ.hxx>
|
||||
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
|
||||
#include <TColStd_MapOfInteger.hxx>
|
||||
#include <TColStd_SequenceOfAsciiString.hxx>
|
||||
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
|
||||
#include <TColgp_Array1OfXYZ.hxx>
|
||||
#include <TopAbs.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <gp_Ax3.hxx>
|
||||
#include <gp_Cylinder.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp_XYZ.hxx>
|
||||
|
||||
#include "SMDS_Mesh.hxx"
|
||||
#include "SMDS_Iterator.hxx"
|
||||
@ -2527,6 +2529,7 @@ ElementsOnSurface::ElementsOnSurface()
|
||||
myType = SMDSAbs_All;
|
||||
mySurf.Nullify();
|
||||
myToler = Precision::Confusion();
|
||||
myUseBoundaries = false;
|
||||
}
|
||||
|
||||
ElementsOnSurface::~ElementsOnSurface()
|
||||
@ -2539,7 +2542,6 @@ void ElementsOnSurface::SetMesh( const SMDS_Mesh* theMesh )
|
||||
if ( myMesh == theMesh )
|
||||
return;
|
||||
myMesh = theMesh;
|
||||
myIds.Clear();
|
||||
process();
|
||||
}
|
||||
|
||||
@ -2555,8 +2557,14 @@ void ElementsOnSurface::SetTolerance( const double theToler )
|
||||
{ myToler = theToler; }
|
||||
|
||||
double ElementsOnSurface::GetTolerance() const
|
||||
{ return myToler; }
|
||||
|
||||
void ElementsOnSurface::SetUseBoundaries( bool theUse )
|
||||
{
|
||||
return myToler;
|
||||
bool diff = ( myUseBoundaries != theUse );
|
||||
myUseBoundaries = theUse;
|
||||
if ( diff )
|
||||
SetSurface( mySurf, myType );
|
||||
}
|
||||
|
||||
void ElementsOnSurface::SetSurface( const TopoDS_Shape& theShape,
|
||||
@ -2565,12 +2573,17 @@ void ElementsOnSurface::SetSurface( const TopoDS_Shape& theShape,
|
||||
myType = theType;
|
||||
mySurf.Nullify();
|
||||
if ( theShape.IsNull() || theShape.ShapeType() != TopAbs_FACE )
|
||||
{
|
||||
mySurf.Nullify();
|
||||
return;
|
||||
}
|
||||
TopoDS_Face aFace = TopoDS::Face( theShape );
|
||||
mySurf = BRep_Tool::Surface( aFace );
|
||||
mySurf = TopoDS::Face( theShape );
|
||||
BRepAdaptor_Surface SA( mySurf, myUseBoundaries );
|
||||
Standard_Real
|
||||
u1 = SA.FirstUParameter(),
|
||||
u2 = SA.LastUParameter(),
|
||||
v1 = SA.FirstVParameter(),
|
||||
v2 = SA.LastVParameter();
|
||||
Handle(Geom_Surface) surf = BRep_Tool::Surface( mySurf );
|
||||
myProjector.Init( surf, u1,u2, v1,v2 );
|
||||
process();
|
||||
}
|
||||
|
||||
void ElementsOnSurface::process()
|
||||
@ -2584,6 +2597,7 @@ void ElementsOnSurface::process()
|
||||
|
||||
if ( myType == SMDSAbs_Face || myType == SMDSAbs_All )
|
||||
{
|
||||
myIds.ReSize( myMesh->NbFaces() );
|
||||
SMDS_FaceIteratorPtr anIter = myMesh->facesIterator();
|
||||
for(; anIter->more(); )
|
||||
process( anIter->next() );
|
||||
@ -2591,6 +2605,7 @@ void ElementsOnSurface::process()
|
||||
|
||||
if ( myType == SMDSAbs_Edge || myType == SMDSAbs_All )
|
||||
{
|
||||
myIds.ReSize( myMesh->NbEdges() );
|
||||
SMDS_EdgeIteratorPtr anIter = myMesh->edgesIterator();
|
||||
for(; anIter->more(); )
|
||||
process( anIter->next() );
|
||||
@ -2598,6 +2613,7 @@ void ElementsOnSurface::process()
|
||||
|
||||
if ( myType == SMDSAbs_Node )
|
||||
{
|
||||
myIds.ReSize( myMesh->NbNodes() );
|
||||
SMDS_NodeIteratorPtr anIter = myMesh->nodesIterator();
|
||||
for(; anIter->more(); )
|
||||
process( anIter->next() );
|
||||
@ -2621,32 +2637,34 @@ void ElementsOnSurface::process( const SMDS_MeshElement* theElemPtr )
|
||||
myIds.Add( theElemPtr->GetID() );
|
||||
}
|
||||
|
||||
bool ElementsOnSurface::isOnSurface( const SMDS_MeshNode* theNode ) const
|
||||
bool ElementsOnSurface::isOnSurface( const SMDS_MeshNode* theNode )
|
||||
{
|
||||
if ( mySurf.IsNull() )
|
||||
return false;
|
||||
|
||||
gp_Pnt aPnt( theNode->X(), theNode->Y(), theNode->Z() );
|
||||
double aToler2 = myToler * myToler;
|
||||
if ( mySurf->IsKind(STANDARD_TYPE(Geom_Plane)))
|
||||
{
|
||||
gp_Pln aPln = Handle(Geom_Plane)::DownCast(mySurf)->Pln();
|
||||
if ( aPln.SquareDistance( aPnt ) > aToler2 )
|
||||
return false;
|
||||
}
|
||||
else if ( mySurf->IsKind(STANDARD_TYPE(Geom_CylindricalSurface)))
|
||||
{
|
||||
gp_Cylinder aCyl = Handle(Geom_CylindricalSurface)::DownCast(mySurf)->Cylinder();
|
||||
double aRad = aCyl.Radius();
|
||||
gp_Ax3 anAxis = aCyl.Position();
|
||||
gp_XYZ aLoc = aCyl.Location().XYZ();
|
||||
double aXDist = anAxis.XDirection().XYZ() * ( aPnt.XYZ() - aLoc );
|
||||
double aYDist = anAxis.YDirection().XYZ() * ( aPnt.XYZ() - aLoc );
|
||||
if ( fabs(aXDist*aXDist + aYDist*aYDist - aRad*aRad) > aToler2 )
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
// double aToler2 = myToler * myToler;
|
||||
// if ( mySurf->IsKind(STANDARD_TYPE(Geom_Plane)))
|
||||
// {
|
||||
// gp_Pln aPln = Handle(Geom_Plane)::DownCast(mySurf)->Pln();
|
||||
// if ( aPln.SquareDistance( aPnt ) > aToler2 )
|
||||
// return false;
|
||||
// }
|
||||
// else if ( mySurf->IsKind(STANDARD_TYPE(Geom_CylindricalSurface)))
|
||||
// {
|
||||
// gp_Cylinder aCyl = Handle(Geom_CylindricalSurface)::DownCast(mySurf)->Cylinder();
|
||||
// double aRad = aCyl.Radius();
|
||||
// gp_Ax3 anAxis = aCyl.Position();
|
||||
// gp_XYZ aLoc = aCyl.Location().XYZ();
|
||||
// double aXDist = anAxis.XDirection().XYZ() * ( aPnt.XYZ() - aLoc );
|
||||
// double aYDist = anAxis.YDirection().XYZ() * ( aPnt.XYZ() - aLoc );
|
||||
// if ( fabs(aXDist*aXDist + aYDist*aYDist - aRad*aRad) > aToler2 )
|
||||
// return false;
|
||||
// }
|
||||
// else
|
||||
// return false;
|
||||
myProjector.Perform( aPnt );
|
||||
bool isOn = ( myProjector.IsDone() && myProjector.LowerDistance() <= myToler );
|
||||
|
||||
return true;
|
||||
return isOn;
|
||||
}
|
||||
|
@ -25,10 +25,12 @@
|
||||
#include <vector>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <gp_XYZ.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
//#include <Geom_Surface.hxx>
|
||||
#include <GeomAPI_ProjectPointOnSurf.hxx>
|
||||
#include <TColStd_SequenceOfInteger.hxx>
|
||||
#include <TColStd_MapOfInteger.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
|
||||
#include "SMDSAbs_ElementType.hxx"
|
||||
#include "SMDS_MeshNode.hxx"
|
||||
@ -44,7 +46,7 @@ class SMESHDS_Mesh;
|
||||
class SMESHDS_SubMesh;
|
||||
|
||||
class gp_Pnt;
|
||||
class TopoDS_Shape;
|
||||
//class TopoDS_Shape;
|
||||
|
||||
|
||||
namespace SMESH{
|
||||
@ -612,18 +614,23 @@ namespace SMESH{
|
||||
double GetTolerance() const;
|
||||
void SetSurface( const TopoDS_Shape& theShape,
|
||||
const SMDSAbs_ElementType theType );
|
||||
void SetUseBoundaries( bool theUse );
|
||||
bool GetUseBoundaries() const { return myUseBoundaries; }
|
||||
|
||||
private:
|
||||
void process();
|
||||
void process( const SMDS_MeshElement* theElem );
|
||||
bool isOnSurface( const SMDS_MeshNode* theNode ) const;
|
||||
bool isOnSurface( const SMDS_MeshNode* theNode );
|
||||
|
||||
private:
|
||||
const SMDS_Mesh* myMesh;
|
||||
TColStd_MapOfInteger myIds;
|
||||
SMDSAbs_ElementType myType;
|
||||
Handle(Geom_Surface) mySurf;
|
||||
//Handle(Geom_Surface) mySurf;
|
||||
TopoDS_Face mySurf;
|
||||
double myToler;
|
||||
bool myUseBoundaries;
|
||||
GeomAPI_ProjectPointOnSurf myProjector;
|
||||
};
|
||||
|
||||
typedef boost::shared_ptr<ElementsOnSurface> ElementsOnSurfacePtr;
|
||||
|
@ -1276,7 +1276,7 @@ bool SMDS_VolumeTool::IsFreeFace( int faceIndex )
|
||||
continue; // opposite side
|
||||
}
|
||||
// remove a volume from volNbShared map
|
||||
volNbShared.erase( vNbIt );
|
||||
volNbShared.erase( vNbIt-- );
|
||||
}
|
||||
|
||||
// here volNbShared contains only volumes laying on the
|
||||
|
@ -676,6 +676,7 @@ bool SMESHGUI_FilterTable::IsValid (const bool theMess, const int theEntityType)
|
||||
aCriterion == FT_BelongToGeom ||
|
||||
aCriterion == FT_BelongToPlane ||
|
||||
aCriterion == FT_BelongToCylinder ||
|
||||
aCriterion == FT_BelongToGenSurface ||
|
||||
aCriterion == FT_LyingOnGeom) {
|
||||
if (aTable->text(i, 2).isEmpty()) {
|
||||
if (theMess)
|
||||
@ -786,6 +787,7 @@ void SMESHGUI_FilterTable::GetCriterion (const int theRow,
|
||||
aCriterionType != FT_BelongToGeom &&
|
||||
aCriterionType != FT_BelongToPlane &&
|
||||
aCriterionType != FT_BelongToCylinder &&
|
||||
aCriterionType != FT_BelongToGenSurface &&
|
||||
aCriterionType != FT_LyingOnGeom)
|
||||
{
|
||||
theCriterion.Compare = ((ComboItem*)aTable->item(theRow, 1))->GetValue();
|
||||
@ -836,6 +838,7 @@ void SMESHGUI_FilterTable::SetCriterion (const int theRow,
|
||||
theCriterion.Type != FT_BelongToGeom &&
|
||||
theCriterion.Type != FT_BelongToPlane &&
|
||||
theCriterion.Type != FT_BelongToCylinder &&
|
||||
theCriterion.Type != FT_BelongToGenSurface &&
|
||||
theCriterion.Type != FT_LyingOnGeom &&
|
||||
theCriterion.Type != FT_FreeBorders &&
|
||||
theCriterion.Type != FT_FreeEdges &&
|
||||
@ -850,7 +853,8 @@ void SMESHGUI_FilterTable::SetCriterion (const int theRow,
|
||||
|
||||
if (theCriterion.Compare == FT_EqualTo ||
|
||||
theCriterion.Type == FT_BelongToPlane ||
|
||||
theCriterion.Type == FT_BelongToCylinder)
|
||||
theCriterion.Type == FT_BelongToCylinder ||
|
||||
theCriterion.Type == FT_BelongToGenSurface)
|
||||
{
|
||||
QTableItem* anItem = aTable->item(theRow, 0);
|
||||
if (!myAddWidgets.contains(anItem))
|
||||
@ -1081,6 +1085,7 @@ void SMESHGUI_FilterTable::onCriterionChanged (const int row, const int col, con
|
||||
aCriterionType == SMESH::FT_BelongToGeom ||
|
||||
aCriterionType == SMESH::FT_BelongToPlane ||
|
||||
aCriterionType == SMESH::FT_BelongToCylinder ||
|
||||
aCriterionType == SMESH::FT_BelongToGenSurface ||
|
||||
aCriterionType == SMESH::FT_LyingOnGeom)
|
||||
{
|
||||
QMap<int, QString> aMap;
|
||||
@ -1275,6 +1280,7 @@ const QMap<int, QString>& SMESHGUI_FilterTable::getCriteria (const int theType)
|
||||
aCriteria[ SMESH::FT_BelongToGeom ] = tr("BELONG_TO_GEOM");
|
||||
aCriteria[ SMESH::FT_BelongToPlane ] = tr("BELONG_TO_PLANE");
|
||||
aCriteria[ SMESH::FT_BelongToCylinder ] = tr("BELONG_TO_CYLINDER");
|
||||
aCriteria[ SMESH::FT_BelongToGenSurface]= tr("BELONG_TO_GENSURFACE");
|
||||
aCriteria[ SMESH::FT_LyingOnGeom ] = tr("LYING_ON_GEOM");
|
||||
}
|
||||
return aCriteria;
|
||||
@ -1291,6 +1297,7 @@ const QMap<int, QString>& SMESHGUI_FilterTable::getCriteria (const int theType)
|
||||
aCriteria[ SMESH::FT_BelongToGeom ] = tr("BELONG_TO_GEOM");
|
||||
aCriteria[ SMESH::FT_BelongToPlane ] = tr("BELONG_TO_PLANE");
|
||||
aCriteria[ SMESH::FT_BelongToCylinder ] = tr("BELONG_TO_CYLINDER");
|
||||
aCriteria[ SMESH::FT_BelongToGenSurface]= tr("BELONG_TO_GENSURFACE");
|
||||
aCriteria[ SMESH::FT_LyingOnGeom ] = tr("LYING_ON_GEOM");
|
||||
}
|
||||
return aCriteria;
|
||||
@ -1311,6 +1318,7 @@ const QMap<int, QString>& SMESHGUI_FilterTable::getCriteria (const int theType)
|
||||
aCriteria[ SMESH::FT_BelongToGeom ] = tr("BELONG_TO_GEOM");
|
||||
aCriteria[ SMESH::FT_BelongToPlane ] = tr("BELONG_TO_PLANE");
|
||||
aCriteria[ SMESH::FT_BelongToCylinder ] = tr("BELONG_TO_CYLINDER");
|
||||
aCriteria[ SMESH::FT_BelongToGenSurface]= tr("BELONG_TO_GENSURFACE");
|
||||
aCriteria[ SMESH::FT_LyingOnGeom ] = tr("LYING_ON_GEOM");
|
||||
aCriteria[ SMESH::FT_Length2D ] = tr("LENGTH2D");
|
||||
aCriteria[ SMESH::FT_MultiConnection2D] = tr("MULTI2D_BORDERS");
|
||||
@ -2106,6 +2114,7 @@ bool SMESHGUI_FilterDlg::isValid() const
|
||||
if (aType == FT_BelongToGeom ||
|
||||
aType == FT_BelongToPlane ||
|
||||
aType == FT_BelongToCylinder ||
|
||||
aType == FT_BelongToGenSurface ||
|
||||
aType == FT_LyingOnGeom) {
|
||||
QString aName;
|
||||
myTable->GetThreshold(i, aName);
|
||||
@ -2118,7 +2127,9 @@ bool SMESHGUI_FilterDlg::isValid() const
|
||||
return false;
|
||||
}
|
||||
|
||||
if (aType == FT_BelongToCylinder || aType == FT_BelongToPlane) {
|
||||
if (aType == FT_BelongToCylinder ||
|
||||
aType == FT_BelongToPlane ||
|
||||
aType == FT_BelongToGenSurface ) {
|
||||
CORBA::Object_var anObject = SMESH::SObjectToObject(aList[ 0 ]);
|
||||
//GEOM::GEOM_Object_var aGeomObj = GEOM::GEOM_Object::_narrow(aList[ 0 ]->GetObject());
|
||||
GEOM::GEOM_Object_var aGeomObj = GEOM::GEOM_Object::_narrow(anObject);
|
||||
@ -2514,6 +2525,7 @@ void SMESHGUI_FilterDlg::onSelectionDone()
|
||||
myTable->GetCriterionType(aRow) != FT_BelongToGeom &&
|
||||
myTable->GetCriterionType(aRow) != FT_BelongToPlane &&
|
||||
myTable->GetCriterionType(aRow) != FT_BelongToCylinder &&
|
||||
myTable->GetCriterionType(aRow) != FT_BelongToGenSurface &&
|
||||
myTable->GetCriterionType(aRow) != FT_LyingOnGeom)
|
||||
return;
|
||||
|
||||
@ -2569,9 +2581,11 @@ void SMESHGUI_FilterDlg::updateSelection()
|
||||
(myTable->GetCriterionType(aRow) == FT_BelongToGeom ||
|
||||
myTable->GetCriterionType(aRow) == FT_BelongToPlane ||
|
||||
myTable->GetCriterionType(aRow) == FT_BelongToCylinder ||
|
||||
myTable->GetCriterionType(aRow) == FT_BelongToGenSurface ||
|
||||
myTable->GetCriterionType(aRow) == FT_LyingOnGeom)) {
|
||||
|
||||
if (myTable->GetCriterionType(aRow) == FT_BelongToGeom ||
|
||||
myTable->GetCriterionType(aRow) == FT_BelongToGenSurface ||
|
||||
myTable->GetCriterionType(aRow) == FT_LyingOnGeom) {
|
||||
|
||||
mySelectionMgr->installFilter(new GEOM_SelectionFilter( aStudy, true ));
|
||||
|
@ -1,3 +1,18 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR Free Software Foundation, Inc.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"PO-Revision-Date: 2006-12-29 11:56+0300\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=CHARSET\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||
#
|
||||
@ -1139,6 +1154,9 @@ msgstr "Belong to Plane"
|
||||
msgid "SMESHGUI_FilterTable::BELONG_TO_CYLINDER"
|
||||
msgstr "Belong to Cylinder"
|
||||
|
||||
msgid "SMESHGUI_FilterTable::BELONG_TO_GENSURFACE"
|
||||
msgstr "Belong to Surface"
|
||||
|
||||
msgid "SMESHGUI_FilterTable::LYING_ON_GEOM"
|
||||
msgstr "Lying on Geom"
|
||||
|
||||
|
@ -231,6 +231,7 @@ namespace SMESH
|
||||
case FT_BelongToGeom: myStream<< "aBelongToGeom"; break;
|
||||
case FT_BelongToPlane: myStream<< "aBelongToPlane"; break;
|
||||
case FT_BelongToCylinder: myStream<< "aBelongToCylinder"; break;
|
||||
case FT_BelongToGenSurface:myStream<<"aBelongToGenSurface";break;
|
||||
case FT_LyingOnGeom: myStream<< "aLyingOnGeom"; break;
|
||||
case FT_RangeOfIds: myStream<< "aRangeOfIds"; break;
|
||||
case FT_BadOrientedVolume:myStream<< "aBadOrientedVolume";break;
|
||||
|
@ -885,7 +885,6 @@ void BelongToSurface_i::SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType t
|
||||
}
|
||||
|
||||
myElementsOnSurfacePtr->SetSurface( TopoDS_Shape(), (SMDSAbs_ElementType)theType );
|
||||
TPythonDump()<<this<<".SetSurface("<<theGeom<<",'"<<theType<<"')";
|
||||
}
|
||||
|
||||
void BelongToSurface_i::SetShapeName( const char* theName, ElementType theType )
|
||||
@ -933,6 +932,18 @@ CORBA::Double BelongToSurface_i::GetTolerance()
|
||||
return myElementsOnSurfacePtr->GetTolerance();
|
||||
}
|
||||
|
||||
void BelongToSurface_i::SetUseBoundaries( CORBA::Boolean theUseBndRestrictions )
|
||||
{
|
||||
myElementsOnSurfacePtr->SetUseBoundaries( theUseBndRestrictions );
|
||||
TPythonDump()<<this<<".SetUseBoundaries( " << theUseBndRestrictions << " )";
|
||||
}
|
||||
|
||||
CORBA::Boolean BelongToSurface_i::GetUseBoundaries()
|
||||
{
|
||||
return myElementsOnSurfacePtr->GetUseBoundaries();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Class : BelongToPlane_i
|
||||
Description : Verify whether mesh element lie in pointed Geom planar object
|
||||
@ -975,6 +986,33 @@ FunctorType BelongToCylinder_i::GetFunctorType()
|
||||
return FT_BelongToCylinder;
|
||||
}
|
||||
|
||||
/*
|
||||
Class : BelongToGenSurface_i
|
||||
Description : Verify whether mesh element lie in pointed Geom planar object
|
||||
*/
|
||||
|
||||
BelongToGenSurface_i::BelongToGenSurface_i()
|
||||
: BelongToSurface_i( STANDARD_TYPE( Geom_CylindricalSurface ) )
|
||||
{
|
||||
}
|
||||
|
||||
void BelongToGenSurface_i::SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType theType )
|
||||
{
|
||||
if ( theGeom->_is_nil() )
|
||||
return;
|
||||
TopoDS_Shape aLocShape = SMESH_Gen_i::GetSMESHGen()->GeomObjectToShape( theGeom );
|
||||
if ( !aLocShape.IsNull() && aLocShape.ShapeType() != TopAbs_FACE )
|
||||
aLocShape.Nullify();
|
||||
|
||||
BelongToSurface_i::myElementsOnSurfacePtr->SetSurface( aLocShape, (SMDSAbs_ElementType)theType );
|
||||
TPythonDump()<<this<<".SetGenSurface("<<theGeom<<","<<theType<<")";
|
||||
}
|
||||
|
||||
FunctorType BelongToGenSurface_i::GetFunctorType()
|
||||
{
|
||||
return FT_BelongToGenSurface;
|
||||
}
|
||||
|
||||
/*
|
||||
Class : LyingOnGeom_i
|
||||
Description : Predicate for selection on geometrical support
|
||||
@ -1556,6 +1594,14 @@ BelongToCylinder_ptr FilterManager_i::CreateBelongToCylinder()
|
||||
return anObj._retn();
|
||||
}
|
||||
|
||||
BelongToGenSurface_ptr FilterManager_i::CreateBelongToGenSurface()
|
||||
{
|
||||
SMESH::BelongToGenSurface_i* aServant = new SMESH::BelongToGenSurface_i();
|
||||
SMESH::BelongToGenSurface_var anObj = aServant->_this();
|
||||
TPythonDump()<<aServant<<" = "<<this<<".CreateBelongToGenSurface()";
|
||||
return anObj._retn();
|
||||
}
|
||||
|
||||
LyingOnGeom_ptr FilterManager_i::CreateLyingOnGeom()
|
||||
{
|
||||
SMESH::LyingOnGeom_i* aServant = new SMESH::LyingOnGeom_i();
|
||||
@ -1854,6 +1900,7 @@ static inline bool getCriteria( Predicate_i* thePred,
|
||||
}
|
||||
case FT_BelongToPlane:
|
||||
case FT_BelongToCylinder:
|
||||
case FT_BelongToGenSurface:
|
||||
{
|
||||
BelongToSurface_i* aPred = dynamic_cast<BelongToSurface_i*>( thePred );
|
||||
|
||||
@ -2006,7 +2053,7 @@ CORBA::Boolean Filter_i::SetCriteria( const SMESH::Filter::Criteria& theCriteria
|
||||
ElementType aTypeOfElem = theCriteria[ i ].TypeOfElement;
|
||||
long aPrecision = theCriteria[ i ].Precision;
|
||||
|
||||
TPythonDump()<<"aCriteria.append(SMESH.Filter.Criterion("<<
|
||||
TPythonDump()<<"aCriterion = SMESH.Filter.Criterion("<<
|
||||
aCriterion<<","<<aCompare<<","<<aThreshold<<",'"<<aThresholdStr<<"','"<<aThresholdID<<"',"<<
|
||||
aUnary<<","<<aBinary<<","<<aTolerance<<","<<aTypeOfElem<<","<<aPrecision<<"))";
|
||||
|
||||
@ -2072,12 +2119,17 @@ CORBA::Boolean Filter_i::SetCriteria( const SMESH::Filter::Criteria& theCriteria
|
||||
break;
|
||||
case SMESH::FT_BelongToPlane:
|
||||
case SMESH::FT_BelongToCylinder:
|
||||
case SMESH::FT_BelongToGenSurface:
|
||||
{
|
||||
SMESH::BelongToSurface_ptr tmpPred;
|
||||
if ( aCriterion == SMESH::FT_BelongToPlane )
|
||||
tmpPred = aFilterMgr->CreateBelongToPlane();
|
||||
else
|
||||
tmpPred = aFilterMgr->CreateBelongToCylinder();
|
||||
switch ( aCriterion ) {
|
||||
case SMESH::FT_BelongToPlane:
|
||||
tmpPred = aFilterMgr->CreateBelongToPlane(); break;
|
||||
case SMESH::FT_BelongToCylinder:
|
||||
tmpPred = aFilterMgr->CreateBelongToCylinder(); break;
|
||||
default:
|
||||
tmpPred = aFilterMgr->CreateBelongToGenSurface();
|
||||
}
|
||||
tmpPred->SetShape( aThresholdID, aThresholdStr, aTypeOfElem );
|
||||
tmpPred->SetTolerance( aTolerance );
|
||||
aPredicate = tmpPred;
|
||||
@ -2148,6 +2200,7 @@ CORBA::Boolean Filter_i::SetCriteria( const SMESH::Filter::Criteria& theCriteria
|
||||
// logical op
|
||||
aPredicates.push_back( aPredicate );
|
||||
aBinaries.push_back( aBinary );
|
||||
TPythonDump()<<"aCriteria.append(aCriterion)";
|
||||
|
||||
} // end of for
|
||||
TPythonDump()<<this<<".SetCriteria(aCriteria)";
|
||||
@ -2308,6 +2361,7 @@ static inline LDOMString toString( CORBA::Long theType )
|
||||
case FT_BelongToGeom : return "Belong to Geom";
|
||||
case FT_BelongToPlane : return "Belong to Plane";
|
||||
case FT_BelongToCylinder: return "Belong to Cylinder";
|
||||
case FT_BelongToGenSurface: return "Belong to Generic Surface";
|
||||
case FT_LyingOnGeom : return "Lying on Geom";
|
||||
case FT_BadOrientedVolume: return "Bad Oriented Volume";
|
||||
case FT_RangeOfIds : return "Range of IDs";
|
||||
@ -2344,6 +2398,7 @@ static inline SMESH::FunctorType toFunctorType( const LDOMString& theStr )
|
||||
else if ( theStr.equals( "Belong to Geom" ) ) return FT_BelongToGeom;
|
||||
else if ( theStr.equals( "Belong to Plane" ) ) return FT_BelongToPlane;
|
||||
else if ( theStr.equals( "Belong to Cylinder" ) ) return FT_BelongToCylinder;
|
||||
else if ( theStr.equals( "Belong to Generic Surface" ) ) return FT_BelongToGenSurface;
|
||||
else if ( theStr.equals( "Lying on Geom" ) ) return FT_LyingOnGeom;
|
||||
else if ( theStr.equals( "Free borders" ) ) return FT_FreeBorders;
|
||||
else if ( theStr.equals( "Free edges" ) ) return FT_FreeEdges;
|
||||
|
@ -391,6 +391,9 @@ namespace SMESH
|
||||
void SetTolerance( CORBA::Double );
|
||||
CORBA::Double GetTolerance();
|
||||
|
||||
void SetUseBoundaries( CORBA::Boolean theUseBndRestrictions );
|
||||
CORBA::Boolean GetUseBoundaries();
|
||||
|
||||
protected:
|
||||
Controls::ElementsOnSurfacePtr myElementsOnSurfacePtr;
|
||||
char* myShapeName;
|
||||
@ -424,6 +427,19 @@ namespace SMESH
|
||||
FunctorType GetFunctorType();
|
||||
};
|
||||
|
||||
/*
|
||||
Class : BelongToGenSurface_i
|
||||
Description : Verify whether mesh element lie on pointed Geom surfasic object
|
||||
*/
|
||||
class BelongToGenSurface_i: public virtual POA_SMESH::BelongToGenSurface,
|
||||
public virtual BelongToSurface_i
|
||||
{
|
||||
public:
|
||||
BelongToGenSurface_i();
|
||||
void SetSurface( GEOM::GEOM_Object_ptr theGeom, ElementType theType );
|
||||
FunctorType GetFunctorType();
|
||||
};
|
||||
|
||||
/*
|
||||
Class : LyingOnGeom_i
|
||||
Description : Predicate for selection on geometrical support(lying or partially lying)
|
||||
@ -770,6 +786,7 @@ namespace SMESH
|
||||
BelongToGeom_ptr CreateBelongToGeom();
|
||||
BelongToPlane_ptr CreateBelongToPlane();
|
||||
BelongToCylinder_ptr CreateBelongToCylinder();
|
||||
BelongToGenSurface_ptr CreateBelongToGenSurface();
|
||||
|
||||
LyingOnGeom_ptr CreateLyingOnGeom();
|
||||
|
||||
|
@ -241,11 +241,17 @@ def GetCriterion(elementType,
|
||||
|
||||
if Compare in [FT_LessThan, FT_MoreThan, FT_EqualTo]:
|
||||
aCriterion.Compare = EnumToLong(Compare)
|
||||
elif Compare == "=" or Compare == "==":
|
||||
aCriterion.Compare = EnumToLong(FT_EqualTo)
|
||||
elif Compare == "<":
|
||||
aCriterion.Compare = EnumToLong(FT_LessThan)
|
||||
elif Compare == ">":
|
||||
aCriterion.Compare = EnumToLong(FT_MoreThan)
|
||||
else:
|
||||
aCriterion.Compare = EnumToLong(FT_EqualTo)
|
||||
aTreshold = Compare
|
||||
|
||||
if CritType in [FT_BelongToGeom, FT_BelongToPlane,
|
||||
if CritType in [FT_BelongToGeom, FT_BelongToPlane, FT_BelongToGenSurface,
|
||||
FT_BelongToCylinder, FT_LyingOnGeom]:
|
||||
# Check treshold
|
||||
if isinstance(aTreshold, geompy.GEOM._objref_GEOM_Object):
|
||||
|
Loading…
Reference in New Issue
Block a user