FT_BelongToGeom,
FT_BelongToPlane,
FT_BelongToCylinder,
+ FT_BelongToGenSurface,
FT_LyingOnGeom,
FT_RangeOfIds,
FT_BadOrientedVolume,
/*!
* 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
{
};
/*!
- * 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
BelongToGeom CreateBelongToGeom();
BelongToPlane CreateBelongToPlane();
BelongToCylinder CreateBelongToCylinder();
+ BelongToGenSurface CreateBelongToGenSurface();
LyingOnGeom CreateLyingOnGeom();
CPPFLAGS+=$(OCC_INCLUDES) $(BOOST_CPPFLAGS) $(KERNEL_CXXFLAGS)
-LDFLAGS+=$(OCC_KERNEL_LIBS) $(KERNEL_LDFLAGS) -lOpUtil -lSMDS -lTKBRep -lTKG3d
+LDFLAGS+=$(OCC_KERNEL_LIBS) $(KERNEL_LDFLAGS) -lOpUtil -lSMDS -lTKBRep -lTKG3d -lTKGeomAlgo
-LDFLAGSFORBIN += -lSMDS $(KERNEL_LDFLAGS) -lOpUtil -lSALOMELocalTrace -lSALOMEBasics $(OCC_KERNEL_LIBS) -lTKBRep -lTKG3d
+LDFLAGSFORBIN += -lSMDS $(KERNEL_LDFLAGS) -lOpUtil -lSALOMELocalTrace -lSALOMEBasics $(OCC_KERNEL_LIBS) -lTKBRep -lTKG3d -lTKGeomAlgo
@CONCLUDE@
#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"
myType = SMDSAbs_All;
mySurf.Nullify();
myToler = Precision::Confusion();
+ myUseBoundaries = false;
}
ElementsOnSurface::~ElementsOnSurface()
if ( myMesh == theMesh )
return;
myMesh = theMesh;
- myIds.Clear();
process();
}
{ 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,
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()
if ( myType == SMDSAbs_Face || myType == SMDSAbs_All )
{
+ myIds.ReSize( myMesh->NbFaces() );
SMDS_FaceIteratorPtr anIter = myMesh->facesIterator();
for(; anIter->more(); )
process( anIter->next() );
if ( myType == SMDSAbs_Edge || myType == SMDSAbs_All )
{
+ myIds.ReSize( myMesh->NbEdges() );
SMDS_EdgeIteratorPtr anIter = myMesh->edgesIterator();
for(; anIter->more(); )
process( anIter->next() );
if ( myType == SMDSAbs_Node )
{
+ myIds.ReSize( myMesh->NbNodes() );
SMDS_NodeIteratorPtr anIter = myMesh->nodesIterator();
for(; anIter->more(); )
process( anIter->next() );
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;
-
- return true;
+ // 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 isOn;
}
#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"
class SMESHDS_SubMesh;
class gp_Pnt;
-class TopoDS_Shape;
+//class TopoDS_Shape;
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;
aCriterion == FT_BelongToGeom ||
aCriterion == FT_BelongToPlane ||
aCriterion == FT_BelongToCylinder ||
+ aCriterion == FT_BelongToGenSurface ||
aCriterion == FT_LyingOnGeom) {
if (aTable->text(i, 2).isEmpty()) {
if (theMess)
aCriterionType != FT_BelongToGeom &&
aCriterionType != FT_BelongToPlane &&
aCriterionType != FT_BelongToCylinder &&
+ aCriterionType != FT_BelongToGenSurface &&
aCriterionType != FT_LyingOnGeom)
{
theCriterion.Compare = ((ComboItem*)aTable->item(theRow, 1))->GetValue();
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 &&
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))
aCriterionType == SMESH::FT_BelongToGeom ||
aCriterionType == SMESH::FT_BelongToPlane ||
aCriterionType == SMESH::FT_BelongToCylinder ||
+ aCriterionType == SMESH::FT_BelongToGenSurface ||
aCriterionType == SMESH::FT_LyingOnGeom)
{
QMap<int, QString> aMap;
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;
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;
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");
if (aType == FT_BelongToGeom ||
aType == FT_BelongToPlane ||
aType == FT_BelongToCylinder ||
+ aType == FT_BelongToGenSurface ||
aType == FT_LyingOnGeom) {
QString aName;
myTable->GetThreshold(i, aName);
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);
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;
(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 ));
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"PO-Revision-Date: 2006-01-13 13:50+0300\n"
+"PO-Revision-Date: 2006-12-18 10:07+0300\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
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"
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;
}
myElementsOnSurfacePtr->SetSurface( TopoDS_Shape(), (SMDSAbs_ElementType)theType );
- TPythonDump()<<this<<".SetSurface("<<theGeom<<",'"<<theType<<"')";
}
void BelongToSurface_i::SetShapeName( const char* theName, ElementType theType )
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
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
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();
}
case FT_BelongToPlane:
case FT_BelongToCylinder:
+ case FT_BelongToGenSurface:
{
BelongToSurface_i* aPred = dynamic_cast<BelongToSurface_i*>( thePred );
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<<"))";
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;
// logical op
aPredicates.push_back( aPredicate );
aBinaries.push_back( aBinary );
+ TPythonDump()<<"aCriteria.append(aCriterion)";
} // end of for
TPythonDump()<<this<<".SetCriteria(aCriteria)";
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";
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;
void SetTolerance( CORBA::Double );
CORBA::Double GetTolerance();
+ void SetUseBoundaries( CORBA::Boolean theUseBndRestrictions );
+ CORBA::Boolean GetUseBoundaries();
+
protected:
Controls::ElementsOnSurfacePtr myElementsOnSurfacePtr;
char* myShapeName;
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)
BelongToGeom_ptr CreateBelongToGeom();
BelongToPlane_ptr CreateBelongToPlane();
BelongToCylinder_ptr CreateBelongToCylinder();
+ BelongToGenSurface_ptr CreateBelongToGenSurface();
LyingOnGeom_ptr CreateLyingOnGeom();
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):
if( !findBounds( t, i1, i2 ) )
return false;
+ if( i1==i2 ) {
+ f = myData[ 2*i1+1 ];
+ return true;
+ }
+
double
x1 = myData[2*i1], y1 = myData[2*i1+1],
x2 = myData[2*i2], y2 = myData[2*i2+1];
}
for( int i=0; i<n-1; i++ )
- if( myData[2*i]<=x && x<=myData[2*(i+1)] )
+ if( myData[2*i]<=x && x<myData[2*(i+1)] )
{
x_ind_1 = i;
x_ind_2 = i+1;
}
x_ind_1 = n-1;
x_ind_2 = n-1;
- return false;
+ return ( fabs( x - myData[2*x_ind_2] ) < 1.e-10 );
}
FunctionExpr::FunctionExpr( const char* str, const int conv )