// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
const TopoDS_Shape& theShape,
const SMDS_MeshElement* theElem,
TopAbs_ShapeEnum theFindShapeEnum,
TopAbs_ShapeEnum theAvoidShapeEnum = TopAbs_SHAPE )
{
TopExp_Explorer anExp( theShape,theFindShapeEnum,theAvoidShapeEnum );
const TopoDS_Shape& theShape,
const SMDS_MeshElement* theElem,
TopAbs_ShapeEnum theFindShapeEnum,
TopAbs_ShapeEnum theAvoidShapeEnum = TopAbs_SHAPE )
{
TopExp_Explorer anExp( theShape,theFindShapeEnum,theAvoidShapeEnum );
-bool Controls::LyingOnGeom::Contains( SMESHDS_Mesh* theMeshDS,
- const TopoDS_Shape& theShape,
- const SMDS_MeshElement* theElem,
- TopAbs_ShapeEnum theFindShapeEnum,
- TopAbs_ShapeEnum theAvoidShapeEnum )
+bool Controls::LyingOnGeom::Contains( const SMESHDS_Mesh* theMeshDS,
+ const TopoDS_Shape& theShape,
+ const SMDS_MeshElement* theElem,
+ TopAbs_ShapeEnum theFindShapeEnum,
+ TopAbs_ShapeEnum theAvoidShapeEnum )
{
if (IsContains(theMeshDS, theShape, theElem, theFindShapeEnum, theAvoidShapeEnum))
return true;
{
if (IsContains(theMeshDS, theShape, theElem, theFindShapeEnum, theAvoidShapeEnum))
return true;
TopTools_IndexedMapOfShape aSubShapes;
TopExp::MapShapes( theShape, aSubShapes );
TopTools_IndexedMapOfShape aSubShapes;
TopExp::MapShapes( theShape, aSubShapes );
- {
- const TopoDS_Shape& aShape = aSubShapes.FindKey(i);
-
- if( SMESHDS_SubMesh* aSubMesh = theMeshDS->MeshElements( aShape ) ){
- if( aSubMesh->Contains( theElem ) )
- return true;
-
- SMDS_NodeIteratorPtr aNodeIt = aSubMesh->GetNodes();
- while ( aNodeIt->more() )
- {
- const SMDS_MeshNode* aNode = static_cast<const SMDS_MeshNode*>(aNodeIt->next());
- SMDS_ElemIteratorPtr anElemIt = aNode->GetInverseElementIterator();
- while ( anElemIt->more() )
- {
- const SMDS_MeshElement* anElement = static_cast<const SMDS_MeshElement*>(anElemIt->next());
- if (anElement == theElem)
- return true;
- }
- }
+ {
+ const TopoDS_Shape& aShape = aSubShapes.FindKey(i);
+
+ if( SMESHDS_SubMesh* aSubMesh = theMeshDS->MeshElements( aShape ) ){
+ if( aSubMesh->Contains( theElem ) )
+ return true;
+
+ SMDS_NodeIteratorPtr aNodeIt = aSubMesh->GetNodes();
+ while ( aNodeIt->more() )
+ {
+ const SMDS_MeshNode* aNode = static_cast<const SMDS_MeshNode*>(aNodeIt->next());
+ SMDS_ElemIteratorPtr anElemIt = aNode->GetInverseElementIterator();
+ while ( anElemIt->more() )
+ {
+ const SMDS_MeshElement* anElement = static_cast<const SMDS_MeshElement*>(anElemIt->next());
+ if (anElement == theElem)
+ return true;
+ }
{
SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
SALOMEDS::Study_ptr aStudy = aSMESHGen->GetCurrentStudy();
{
SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
SALOMEDS::Study_ptr aStudy = aSMESHGen->GetCurrentStudy();
{
SALOMEDS::Study::ListOfSObject_var aList =
aStudy->FindObjectByName( theName, "GEOM" );
{
SALOMEDS::Study::ListOfSObject_var aList =
aStudy->FindObjectByName( theName, "GEOM" );
GEOM::GEOM_Object_var aGeomObj = GEOM::GEOM_Object::_narrow( aList[ 0 ]->GetObject() );
if ( !aGeomObj->_is_nil() )
{
GEOM::GEOM_Object_var aGeomObj = GEOM::GEOM_Object::_narrow( aList[ 0 ]->GetObject() );
if ( !aGeomObj->_is_nil() )
{
}
void Functor_i::SetMesh( SMESH_Mesh_ptr theMesh )
{
myFunctorPtr->SetMesh( MeshPtr2SMDSMesh( theMesh ) );
}
void Functor_i::SetMesh( SMESH_Mesh_ptr theMesh )
{
myFunctorPtr->SetMesh( MeshPtr2SMDSMesh( theMesh ) );
void NumericalFunctor_i::SetPrecision( CORBA::Long thePrecision )
{
myNumericalFunctorPtr->SetPrecision( thePrecision );
void NumericalFunctor_i::SetPrecision( CORBA::Long thePrecision )
{
myNumericalFunctorPtr->SetPrecision( thePrecision );
+/*
+ Class : Volume3D_i
+ Description : Functor for calculating volume of 3D element
+*/
+Volume3D_i::Volume3D_i()
+{
+ myNumericalFunctorPtr.reset( new Controls::Volume() );
+ myFunctorPtr = myNumericalFunctorPtr;
+}
+
+FunctorType Volume3D_i::GetFunctorType()
+{
+ return SMESH::FT_Volume3D;
+}
+
INFOS("Length2D_i::GetValues");
SMESH::Controls::Length2D::TValues aValues;
myLength2DPtr->GetValues( aValues );
INFOS("Length2D_i::GetValues");
SMESH::Controls::Length2D::TValues aValues;
myLength2DPtr->GetValues( aValues );
long i = 0, iEnd = aValues.size();
SMESH::Length2D::Values_var aResult = new SMESH::Length2D::Values(iEnd);
long i = 0, iEnd = aValues.size();
SMESH::Length2D::Values_var aResult = new SMESH::Length2D::Values(iEnd);
{
const SMESH::Controls::Length2D::Value& aVal = *anIter;
SMESH::Length2D::Value &aValue = aResult[ i ];
{
const SMESH::Controls::Length2D::Value& aVal = *anIter;
SMESH::Length2D::Value &aValue = aResult[ i ];
aValue.myLength = aVal.myLength;
aValue.myPnt1 = aVal.myPntId[ 0 ];
aValue.myPnt2 = aVal.myPntId[ 1 ];
aValue.myLength = aVal.myLength;
aValue.myPnt1 = aVal.myPntId[ 0 ];
aValue.myPnt2 = aVal.myPntId[ 1 ];
INFOS("MultiConnection2D_i::GetValues");
SMESH::Controls::MultiConnection2D::MValues aValues;
myMulticonnection2DPtr->GetValues( aValues );
INFOS("MultiConnection2D_i::GetValues");
SMESH::Controls::MultiConnection2D::MValues aValues;
myMulticonnection2DPtr->GetValues( aValues );
long i = 0, iEnd = aValues.size();
SMESH::MultiConnection2D::Values_var aResult = new SMESH::MultiConnection2D::Values(iEnd);
long i = 0, iEnd = aValues.size();
SMESH::MultiConnection2D::Values_var aResult = new SMESH::MultiConnection2D::Values(iEnd);
{
const SMESH::Controls::MultiConnection2D::Value& aVal = (*anIter).first;
SMESH::MultiConnection2D::Value &aValue = aResult[ i ];
{
const SMESH::Controls::MultiConnection2D::Value& aVal = (*anIter).first;
SMESH::MultiConnection2D::Value &aValue = aResult[ i ];
aValue.myPnt1 = aVal.myPntId[ 0 ];
aValue.myPnt2 = aVal.myPntId[ 1 ];
aValue.myNbConnects = (*anIter).second;
aValue.myPnt1 = aVal.myPntId[ 0 ];
aValue.myPnt2 = aVal.myPntId[ 1 ];
aValue.myNbConnects = (*anIter).second;
+/*
+ Class : BadOrientedVolume_i
+ Description : Verify whether a mesh volume is incorrectly oriented from
+ the point of view of MED convention
+*/
+BadOrientedVolume_i::BadOrientedVolume_i()
+{
+ Controls::PredicatePtr control( new Controls::BadOrientedVolume() );
+ myFunctorPtr = myPredicatePtr = control;
+};
+
+FunctorType BadOrientedVolume_i::GetFunctorType()
+{
+ return SMESH::FT_BadOrientedVolume;
+}
GEOM::GEOM_Gen_var aGEOMGen = SMESH_Gen_i::GetGeomEngine();
TopoDS_Shape aLocShape = aSMESHGen->GetShapeReader()->GetShape( aGEOMGen, theGeom );
myBelongToGeomPtr->SetGeom( aLocShape );
GEOM::GEOM_Gen_var aGEOMGen = SMESH_Gen_i::GetGeomEngine();
TopoDS_Shape aLocShape = aSMESHGen->GetShapeReader()->GetShape( aGEOMGen, theGeom );
myBelongToGeomPtr->SetGeom( aLocShape );
void BelongToGeom_i::SetElementType(ElementType theType){
myBelongToGeomPtr->SetType(SMDSAbs_ElementType(theType));
void BelongToGeom_i::SetElementType(ElementType theType){
myBelongToGeomPtr->SetType(SMDSAbs_ElementType(theType));
delete myShapeName;
myShapeName = strdup( theName );
myElementsOnSurfacePtr->SetSurface( getShapeByName( myShapeName ), (SMDSAbs_ElementType)theType );
delete myShapeName;
myShapeName = strdup( theName );
myElementsOnSurfacePtr->SetSurface( getShapeByName( myShapeName ), (SMDSAbs_ElementType)theType );
void BelongToSurface_i::SetTolerance( CORBA::Double theToler )
{
myElementsOnSurfacePtr->SetTolerance( theToler );
void BelongToSurface_i::SetTolerance( CORBA::Double theToler )
{
myElementsOnSurfacePtr->SetTolerance( theToler );
void BelongToPlane_i::SetPlane( GEOM::GEOM_Object_ptr theGeom, ElementType theType )
{
BelongToSurface_i::SetSurface( theGeom, theType );
void BelongToPlane_i::SetPlane( GEOM::GEOM_Object_ptr theGeom, ElementType theType )
{
BelongToSurface_i::SetSurface( theGeom, theType );
void BelongToCylinder_i::SetCylinder( GEOM::GEOM_Object_ptr theGeom, ElementType theType )
{
BelongToSurface_i::SetSurface( theGeom, theType );
void BelongToCylinder_i::SetCylinder( GEOM::GEOM_Object_ptr theGeom, ElementType theType )
{
BelongToSurface_i::SetSurface( theGeom, theType );
GEOM::GEOM_Gen_var aGEOMGen = SMESH_Gen_i::GetGeomEngine();
TopoDS_Shape aLocShape = aSMESHGen->GetShapeReader()->GetShape( aGEOMGen, theGeom );
myLyingOnGeomPtr->SetGeom( aLocShape );
GEOM::GEOM_Gen_var aGEOMGen = SMESH_Gen_i::GetGeomEngine();
TopoDS_Shape aLocShape = aSMESHGen->GetShapeReader()->GetShape( aGEOMGen, theGeom );
myLyingOnGeomPtr->SetGeom( aLocShape );
void LyingOnGeom_i::SetElementType(ElementType theType){
myLyingOnGeomPtr->SetType(SMDSAbs_ElementType(theType));
void LyingOnGeom_i::SetElementType(ElementType theType){
myLyingOnGeomPtr->SetType(SMDSAbs_ElementType(theType));
INFOS("FreeEdges_i::GetBorders");
SMESH::Controls::FreeEdges::TBorders aBorders;
myFreeEdgesPtr->GetBoreders( aBorders );
INFOS("FreeEdges_i::GetBorders");
SMESH::Controls::FreeEdges::TBorders aBorders;
myFreeEdgesPtr->GetBoreders( aBorders );
long i = 0, iEnd = aBorders.size();
SMESH::FreeEdges::Borders_var aResult = new SMESH::FreeEdges::Borders(iEnd);
long i = 0, iEnd = aBorders.size();
SMESH::FreeEdges::Borders_var aResult = new SMESH::FreeEdges::Borders(iEnd);
{
const SMESH::Controls::FreeEdges::Border& aBord = *anIter;
SMESH::FreeEdges::Border &aBorder = aResult[ i ];
{
const SMESH::Controls::FreeEdges::Border& aBord = *anIter;
SMESH::FreeEdges::Border &aBorder = aResult[ i ];
aBorder.myElemId = aBord.myElemId;
aBorder.myPnt1 = aBord.myPntId[ 0 ];
aBorder.myPnt2 = aBord.myPntId[ 1 ];
aBorder.myElemId = aBord.myElemId;
aBorder.myPnt1 = aBord.myPntId[ 0 ];
aBorder.myPnt2 = aBord.myPntId[ 1 ];
CORBA::Long iEnd = theIds.length();
for ( CORBA::Long i = 0; i < iEnd; i++ )
myRangeOfIdsPtr->AddToRange( theIds[ i ] );
CORBA::Long iEnd = theIds.length();
for ( CORBA::Long i = 0; i < iEnd; i++ )
myRangeOfIdsPtr->AddToRange( theIds[ i ] );
void RangeOfIds_i::SetElementType( ElementType theType )
{
myRangeOfIdsPtr->SetType( SMDSAbs_ElementType( theType ) );
void RangeOfIds_i::SetElementType( ElementType theType )
{
myRangeOfIdsPtr->SetType( SMDSAbs_ElementType( theType ) );
if ( myNumericalFunctor )
{
myComparatorPtr->SetNumFunctor( myNumericalFunctor->GetNumericalFunctor() );
myNumericalFunctor->Register();
if ( myNumericalFunctor )
{
myComparatorPtr->SetNumFunctor( myNumericalFunctor->GetNumericalFunctor() );
myNumericalFunctor->Register();
MinimumAngle_ptr FilterManager_i::CreateMinimumAngle()
{
SMESH::MinimumAngle_i* aServant = new SMESH::MinimumAngle_i();
SMESH::MinimumAngle_var anObj = aServant->_this();
MinimumAngle_ptr FilterManager_i::CreateMinimumAngle()
{
SMESH::MinimumAngle_i* aServant = new SMESH::MinimumAngle_i();
SMESH::MinimumAngle_var anObj = aServant->_this();
{
SMESH::AspectRatio_i* aServant = new SMESH::AspectRatio_i();
SMESH::AspectRatio_var anObj = aServant->_this();
{
SMESH::AspectRatio_i* aServant = new SMESH::AspectRatio_i();
SMESH::AspectRatio_var anObj = aServant->_this();
{
SMESH::AspectRatio3D_i* aServant = new SMESH::AspectRatio3D_i();
SMESH::AspectRatio3D_var anObj = aServant->_this();
{
SMESH::AspectRatio3D_i* aServant = new SMESH::AspectRatio3D_i();
SMESH::AspectRatio3D_var anObj = aServant->_this();
+ TPythonDump()<<aServant<<" = "<<this<<".CreateArea()";
+ return anObj._retn();
+}
+
+
+Volume3D_ptr FilterManager_i::CreateVolume3D()
+{
+ SMESH::Volume3D_i* aServant = new SMESH::Volume3D_i();
+ SMESH::Volume3D_var anObj = aServant->_this();
+ TPythonDump()<<aServant<<" = "<<this<<".CreateVolume3D()";
{
SMESH::Length2D_i* aServant = new SMESH::Length2D_i();
SMESH::Length2D_var anObj = aServant->_this();
{
SMESH::Length2D_i* aServant = new SMESH::Length2D_i();
SMESH::Length2D_var anObj = aServant->_this();
{
SMESH::MultiConnection_i* aServant = new SMESH::MultiConnection_i();
SMESH::MultiConnection_var anObj = aServant->_this();
{
SMESH::MultiConnection_i* aServant = new SMESH::MultiConnection_i();
SMESH::MultiConnection_var anObj = aServant->_this();
{
SMESH::MultiConnection2D_i* aServant = new SMESH::MultiConnection2D_i();
SMESH::MultiConnection2D_var anObj = aServant->_this();
{
SMESH::MultiConnection2D_i* aServant = new SMESH::MultiConnection2D_i();
SMESH::MultiConnection2D_var anObj = aServant->_this();
{
SMESH::BelongToGeom_i* aServant = new SMESH::BelongToGeom_i();
SMESH::BelongToGeom_var anObj = aServant->_this();
{
SMESH::BelongToGeom_i* aServant = new SMESH::BelongToGeom_i();
SMESH::BelongToGeom_var anObj = aServant->_this();
{
SMESH::BelongToPlane_i* aServant = new SMESH::BelongToPlane_i();
SMESH::BelongToPlane_var anObj = aServant->_this();
{
SMESH::BelongToPlane_i* aServant = new SMESH::BelongToPlane_i();
SMESH::BelongToPlane_var anObj = aServant->_this();
{
SMESH::BelongToCylinder_i* aServant = new SMESH::BelongToCylinder_i();
SMESH::BelongToCylinder_var anObj = aServant->_this();
{
SMESH::BelongToCylinder_i* aServant = new SMESH::BelongToCylinder_i();
SMESH::BelongToCylinder_var anObj = aServant->_this();
{
SMESH::LyingOnGeom_i* aServant = new SMESH::LyingOnGeom_i();
SMESH::LyingOnGeom_var anObj = aServant->_this();
{
SMESH::LyingOnGeom_i* aServant = new SMESH::LyingOnGeom_i();
SMESH::LyingOnGeom_var anObj = aServant->_this();
{
SMESH::FreeBorders_i* aServant = new SMESH::FreeBorders_i();
SMESH::FreeBorders_var anObj = aServant->_this();
{
SMESH::FreeBorders_i* aServant = new SMESH::FreeBorders_i();
SMESH::FreeBorders_var anObj = aServant->_this();
{
SMESH::FreeEdges_i* aServant = new SMESH::FreeEdges_i();
SMESH::FreeEdges_var anObj = aServant->_this();
{
SMESH::FreeEdges_i* aServant = new SMESH::FreeEdges_i();
SMESH::FreeEdges_var anObj = aServant->_this();
{
SMESH::RangeOfIds_i* aServant = new SMESH::RangeOfIds_i();
SMESH::RangeOfIds_var anObj = aServant->_this();
{
SMESH::RangeOfIds_i* aServant = new SMESH::RangeOfIds_i();
SMESH::RangeOfIds_var anObj = aServant->_this();
+ TPythonDump()<<aServant<<" = "<<this<<".CreateRangeOfIds()";
+ return anObj._retn();
+}
+
+BadOrientedVolume_ptr FilterManager_i::CreateBadOrientedVolume()
+{
+ SMESH::BadOrientedVolume_i* aServant = new SMESH::BadOrientedVolume_i();
+ SMESH::BadOrientedVolume_var anObj = aServant->_this();
+ TPythonDump()<<aServant<<" = "<<this<<".CreateBadOrientedVolume()";
{
SMESH::LessThan_i* aServant = new SMESH::LessThan_i();
SMESH::LessThan_var anObj = aServant->_this();
{
SMESH::LessThan_i* aServant = new SMESH::LessThan_i();
SMESH::LessThan_var anObj = aServant->_this();
{
SMESH::MoreThan_i* aServant = new SMESH::MoreThan_i();
SMESH::MoreThan_var anObj = aServant->_this();
{
SMESH::MoreThan_i* aServant = new SMESH::MoreThan_i();
SMESH::MoreThan_var anObj = aServant->_this();
{
SMESH::LogicalNOT_i* aServant = new SMESH::LogicalNOT_i();
SMESH::LogicalNOT_var anObj = aServant->_this();
{
SMESH::LogicalNOT_i* aServant = new SMESH::LogicalNOT_i();
SMESH::LogicalNOT_var anObj = aServant->_this();
{
SMESH::LogicalAND_i* aServant = new SMESH::LogicalAND_i();
SMESH::LogicalAND_var anObj = aServant->_this();
{
SMESH::LogicalAND_i* aServant = new SMESH::LogicalAND_i();
SMESH::LogicalAND_var anObj = aServant->_this();
{
SMESH::LogicalOR_i* aServant = new SMESH::LogicalOR_i();
SMESH::LogicalOR_var anObj = aServant->_this();
{
SMESH::LogicalOR_i* aServant = new SMESH::LogicalOR_i();
SMESH::LogicalOR_var anObj = aServant->_this();
{
SMESH::FilterLibrary_i* aServant = new SMESH::FilterLibrary_i( aFileName );
SMESH::FilterLibrary_var anObj = aServant->_this();
{
SMESH::FilterLibrary_i* aServant = new SMESH::FilterLibrary_i( aFileName );
SMESH::FilterLibrary_var anObj = aServant->_this();
{
SMESH::FilterLibrary_i* aServant = new SMESH::FilterLibrary_i();
SMESH::FilterLibrary_var anObj = aServant->_this();
{
SMESH::FilterLibrary_i* aServant = new SMESH::FilterLibrary_i();
SMESH::FilterLibrary_var anObj = aServant->_this();
// name : Filter_i::SetMesh
// Purpose : Set mesh
//=======================================================================
// name : Filter_i::SetMesh
// Purpose : Set mesh
//=======================================================================
- if ( myPredicate )
- myPredicate->SetMesh( theMesh );
+ if(!CORBA::is_nil(theMesh))
+ theMesh->Register();
+
+ if(!CORBA::is_nil(myMesh))
+ myMesh->Destroy();
+
+ myMesh = theMesh;
+ TPythonDump()<<this<<".SetMesh("<<theMesh<<")";
+}
+
+SMESH::long_array*
+Filter_i::
+GetIDs()
+{
+ return GetElementsId(myMesh);
}
//=======================================================================
// name : Filter_i::GetElementsId
// Purpose : Get ids of entities
//=======================================================================
}
//=======================================================================
// name : Filter_i::GetElementsId
// Purpose : Get ids of entities
//=======================================================================
-SMESH::long_array* Filter_i::GetElementsId( SMESH_Mesh_ptr theMesh )
+void
+Filter_i::
+GetElementsId( Predicate_i* thePredicate,
+ const SMDS_Mesh* theMesh,
+ Controls::Filter::TIdSequence& theSequence )
- SMDS_Mesh* aMesh = MeshPtr2SMDSMesh(theMesh);
- Controls::Filter::TIdSequence aSequence = myFilter.GetElementsId(aMesh);
-
- SMESH::long_array_var anArray = new SMESH::long_array;
- long i = 0, iEnd = aSequence.size();
+ Controls::Filter::GetElementsId(theMesh,thePredicate->GetPredicate(),theSequence);
+}
- anArray->length( iEnd );
- for ( ; i < iEnd; i++ )
- anArray[ i ] = aSequence[i];
+void
+Filter_i::
+GetElementsId( Predicate_i* thePredicate,
+ SMESH_Mesh_ptr theMesh,
+ Controls::Filter::TIdSequence& theSequence )
+{
+ if(const SMDS_Mesh* aMesh = MeshPtr2SMDSMesh(theMesh))
+ Controls::Filter::GetElementsId(aMesh,thePredicate->GetPredicate(),theSequence);
+}
+SMESH::long_array*
+Filter_i::
+GetElementsId( SMESH_Mesh_ptr theMesh )
+{
+ SMESH::long_array_var anArray = new SMESH::long_array;
+ if(!CORBA::is_nil(theMesh)){
+ Controls::Filter::TIdSequence aSequence;
+ GetElementsId(myPredicate,theMesh,aSequence);
+ long i = 0, iEnd = aSequence.size();
+ anArray->length( iEnd );
+ for ( ; i < iEnd; i++ )
+ anArray[ i ] = aSequence[i];
+ }
theCriteria[ i ].ThresholdStr = aPred->GetRangeStr();
theCriteria[ i ].TypeOfElement = aPred->GetElementType();
theCriteria[ i ].ThresholdStr = aPred->GetRangeStr();
theCriteria[ i ].TypeOfElement = aPred->GetElementType();
+ return true;
+ }
+ case FT_BadOrientedVolume:
+ {
+ BadOrientedVolume_i* aPred = dynamic_cast<BadOrientedVolume_i*>( thePred );
+
+ CORBA::ULong i = theCriteria->length();
+ theCriteria->length( i + 1 );
+
+ theCriteria[ i ] = createCriterion();
+
+ theCriteria[ i ].Type = FT_BadOrientedVolume;
+ theCriteria[ i ].TypeOfElement = aPred->GetElementType();
+
- SMESH::FilterManager_i* aFilter = new SMESH::FilterManager_i();
- FilterManager_ptr aFilterMgr = aFilter->_this();
+ SMESH::FilterManager_i* aFilter = new SMESH::FilterManager_i();
+ FilterManager_ptr aFilterMgr = aFilter->_this();
std::list<SMESH::Predicate_ptr> aPredicates;
std::list<int> aBinaries;
for ( int i = 0, n = theCriteria.length(); i < n; i++ )
std::list<SMESH::Predicate_ptr> aPredicates;
std::list<int> aBinaries;
for ( int i = 0, n = theCriteria.length(); i < n; i++ )
const char* aThresholdStr = theCriteria[ i ].ThresholdStr;
ElementType aTypeOfElem = theCriteria[ i ].TypeOfElement;
long aPrecision = theCriteria[ i ].Precision;
const char* aThresholdStr = theCriteria[ i ].ThresholdStr;
ElementType aTypeOfElem = theCriteria[ i ].TypeOfElement;
long aPrecision = theCriteria[ i ].Precision;
+
+ TPythonDump()<<"aCriteria.append(SMESH.Filter.Criterion("<<
+ aCriterion<<","<<aCompare<<","<<aThreshold<<",'"<<aThresholdStr<<"',"<<
+ aUnary<<","<<aBinary<<","<<aTolerance<<","<<aTypeOfElem<<","<<aPrecision<<"))";
+
SMESH::Predicate_ptr aPredicate = SMESH::Predicate::_nil();
SMESH::NumericalFunctor_ptr aFunctor = SMESH::NumericalFunctor::_nil();
switch ( aCriterion )
{
// Functors
SMESH::Predicate_ptr aPredicate = SMESH::Predicate::_nil();
SMESH::NumericalFunctor_ptr aFunctor = SMESH::NumericalFunctor::_nil();
switch ( aCriterion )
{
// Functors
case SMESH::FT_MultiConnection:
aFunctor = aFilterMgr->CreateMultiConnection();
break;
case SMESH::FT_MultiConnection2D:
case SMESH::FT_MultiConnection:
aFunctor = aFilterMgr->CreateMultiConnection();
break;
case SMESH::FT_MultiConnection2D:
case FT_Taper : return "Taper";
case FT_Skew : return "Skew";
case FT_Area : return "Area";
case FT_Taper : return "Taper";
case FT_Skew : return "Skew";
case FT_Area : return "Area";
case FT_BelongToGeom : return "Belong to Geom";
case FT_BelongToPlane : return "Belong to Plane";
case FT_BelongToCylinder: return "Belong to Cylinder";
case FT_LyingOnGeom : return "Lying on Geom";
case FT_BelongToGeom : return "Belong to Geom";
case FT_BelongToPlane : return "Belong to Plane";
case FT_BelongToCylinder: return "Belong to Cylinder";
case FT_LyingOnGeom : return "Lying on Geom";
case FT_RangeOfIds : return "Range of IDs";
case FT_FreeBorders : return "Free borders";
case FT_FreeEdges : return "Free edges";
case FT_RangeOfIds : return "Range of IDs";
case FT_FreeBorders : return "Free borders";
case FT_FreeEdges : return "Free edges";
else if ( theStr.equals( "Taper" ) ) return FT_Taper;
else if ( theStr.equals( "Skew" ) ) return FT_Skew;
else if ( theStr.equals( "Area" ) ) return FT_Area;
else if ( theStr.equals( "Taper" ) ) return FT_Taper;
else if ( theStr.equals( "Skew" ) ) return FT_Skew;
else if ( theStr.equals( "Area" ) ) return FT_Area;
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 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( "Length" ) ) return FT_Length;
// else if ( theStr.equals( "Length2D" ) ) return FT_Length2D;
else if ( theStr.equals( "Range of IDs" ) ) return FT_RangeOfIds;
else if ( theStr.equals( "Length" ) ) return FT_Length;
// else if ( theStr.equals( "Length2D" ) ) return FT_Length2D;
else if ( theStr.equals( "Range of IDs" ) ) return FT_RangeOfIds;
else if ( theStr.equals( "Less than" ) ) return FT_LessThan;
else if ( theStr.equals( "More than" ) ) return FT_MoreThan;
else if ( theStr.equals( "Equal to" ) ) return FT_EqualTo;
else if ( theStr.equals( "Less than" ) ) return FT_LessThan;
else if ( theStr.equals( "More than" ) ) return FT_MoreThan;
else if ( theStr.equals( "Equal to" ) ) return FT_EqualTo;
const char* aSectionName = getSectionName( theType );
if ( strcmp( aSectionName, "" ) == 0 )
return LDOM_Node();
const char* aSectionName = getSectionName( theType );
if ( strcmp( aSectionName, "" ) == 0 )
return LDOM_Node();
LDOM_NodeList aSections = theDoc.getElementsByTagName( "section" );
LDOM_Node aNode;
for ( int i = 0, n = aSections.getLength(); i < n; i++ )
LDOM_NodeList aSections = theDoc.getElementsByTagName( "section" );
LDOM_Node aNode;
for ( int i = 0, n = aSections.getLength(); i < n; i++ )
aCriterionItem.setAttribute( ATTR_THRESHOLD , toString( aCriteria[ i ].Threshold ) );
aCriterionItem.setAttribute( ATTR_UNARY , toString( aCriteria[ i ].UnaryOp ) );
aCriterionItem.setAttribute( ATTR_BINARY , toString( aCriteria[ i ].BinaryOp ) );
aCriterionItem.setAttribute( ATTR_THRESHOLD , toString( aCriteria[ i ].Threshold ) );
aCriterionItem.setAttribute( ATTR_UNARY , toString( aCriteria[ i ].UnaryOp ) );
aCriterionItem.setAttribute( ATTR_BINARY , toString( aCriteria[ i ].BinaryOp ) );
aCriterionItem.setAttribute( ATTR_THRESHOLD_STR, (const char*)aCriteria[ i ].ThresholdStr );
aCriterionItem.setAttribute( ATTR_TOLERANCE , toString( aCriteria[ i ].Tolerance ) );
aCriterionItem.setAttribute( ATTR_ELEMENT_TYPE ,
aCriterionItem.setAttribute( ATTR_THRESHOLD_STR, (const char*)aCriteria[ i ].ThresholdStr );
aCriterionItem.setAttribute( ATTR_TOLERANCE , toString( aCriteria[ i ].Tolerance ) );
aCriterionItem.setAttribute( ATTR_ELEMENT_TYPE ,
//=======================================================================
Filter_ptr FilterLibrary_i::Copy( const char* theFilterName )
{
//=======================================================================
Filter_ptr FilterLibrary_i::Copy( const char* theFilterName )
{
LDOM_Node aFilter = findFilter( theFilterName, myDoc );
if ( aFilter.isNull() )
return aRes;
std::list<SMESH::Filter::Criterion> aCriteria;
LDOM_Node aFilter = findFilter( theFilterName, myDoc );
if ( aFilter.isNull() )
return aRes;
std::list<SMESH::Filter::Criterion> aCriteria;
for ( LDOM_Node aCritNode = aFilter.getFirstChild();
!aCritNode.isNull() ; aCritNode = aCritNode.getNextSibling() )
{
for ( LDOM_Node aCritNode = aFilter.getFirstChild();
!aCritNode.isNull() ; aCritNode = aCritNode.getNextSibling() )
{
const char* aUnaryStr = aCrit->getAttribute( ATTR_UNARY ).GetString();
const char* aBinaryStr = aCrit->getAttribute( ATTR_BINARY ).GetString();
const char* anElemTypeStr = aCrit->getAttribute( ATTR_ELEMENT_TYPE ).GetString();
const char* aUnaryStr = aCrit->getAttribute( ATTR_UNARY ).GetString();
const char* aBinaryStr = aCrit->getAttribute( ATTR_BINARY ).GetString();
const char* anElemTypeStr = aCrit->getAttribute( ATTR_ELEMENT_TYPE ).GetString();
SMESH::Filter::Criterion aCriterion = createCriterion();
aCriterion.Type = toFunctorType( aTypeStr );
aCriterion.Compare = toFunctorType( aCompareStr );
aCriterion.UnaryOp = toFunctorType( aUnaryStr );
aCriterion.BinaryOp = toFunctorType( aBinaryStr );
SMESH::Filter::Criterion aCriterion = createCriterion();
aCriterion.Type = toFunctorType( aTypeStr );
aCriterion.Compare = toFunctorType( aCompareStr );
aCriterion.UnaryOp = toFunctorType( aUnaryStr );
aCriterion.BinaryOp = toFunctorType( aBinaryStr );
aCriterion.TypeOfElement = toElementType( anElemTypeStr );
LDOMString str = aCrit->getAttribute( ATTR_THRESHOLD );
aCriterion.TypeOfElement = toElementType( anElemTypeStr );
LDOMString str = aCrit->getAttribute( ATTR_THRESHOLD );
SMESH::Filter::Criteria_var aCriteriaVar = new SMESH::Filter::Criteria;
aCriteriaVar->length( aCriteria.size() );
SMESH::Filter::Criteria_var aCriteriaVar = new SMESH::Filter::Criteria;
aCriteriaVar->length( aCriteria.size() );
for( ; anIter != aCriteria.end(); ++anIter )
aCriteriaVar[ i++ ] = *anIter;
aRes = myFilterMgr->CreateFilter();
aRes->SetCriteria( aCriteriaVar.inout() );
for( ; anIter != aCriteria.end(); ++anIter )
aCriteriaVar[ i++ ] = *anIter;
aRes = myFilterMgr->CreateFilter();
aRes->SetCriteria( aCriteriaVar.inout() );
LDOM_Element aFilterItem = createFilterItem( theFilterName, aFilter, myDoc );
if ( aFilterItem.isNull() )
return false;
else
{
aSection.appendChild( aFilterItem );
LDOM_Element aFilterItem = createFilterItem( theFilterName, aFilter, myDoc );
if ( aFilterItem.isNull() )
return false;
else
{
aSection.appendChild( aFilterItem );
// Purpose : Replace existing filter with entry filter.
// IMPORTANT : If filter does not exist it is not created
//=======================================================================
CORBA::Boolean FilterLibrary_i::Replace( const char* theFilterName,
// Purpose : Replace existing filter with entry filter.
// IMPORTANT : If filter does not exist it is not created
//=======================================================================
CORBA::Boolean FilterLibrary_i::Replace( const char* theFilterName,