#include "SMESH_Filter_i.hxx"#include "SMESH_Gen_i.hxx"#include "SMESH_PythonDump.hxx"#include "SMDS_Mesh.hxx"#include "SMDS_MeshNode.hxx"#include "SMDS_MeshElement.hxx"#include "SMDS_ElemIterator.hxx"#include "SMDS_VolumeTool.hxx"#include "SMESHDS_Mesh.hxx"#include <BRep_Tool.hxx>#include <Geom_CylindricalSurface.hxx>#include <Geom_Plane.hxx>#include <LDOMParser.hxx>#include <LDOMString.hxx>#include <LDOM_Document.hxx>#include <LDOM_Element.hxx>#include <LDOM_Node.hxx>#include <LDOM_XmlWriter.hxx>#include <Precision.hxx>#include <TColStd_ListIteratorOfListOfInteger.hxx>#include <TColStd_ListIteratorOfListOfReal.hxx>#include <TColStd_ListOfInteger.hxx>#include <TColStd_ListOfReal.hxx>#include <TColStd_SequenceOfHAsciiString.hxx>#include <TCollection_HAsciiString.hxx>#include <TopExp.hxx>#include <TopExp_Explorer.hxx>#include <TopoDS.hxx>#include <TopoDS_Face.hxx>#include <TopoDS_Shape.hxx>#include <TopTools_IndexedMapOfShape.hxx>
Go to the source code of this file.
Packages | |
| package | SMESH |
Defines | |
| #define | ATTR_TYPE "type" |
| #define | ATTR_COMPARE "compare" |
| #define | ATTR_THRESHOLD "threshold" |
| #define | ATTR_UNARY "unary" |
| #define | ATTR_BINARY "binary" |
| #define | ATTR_THRESHOLD_STR "threshold_str" |
| #define | ATTR_TOLERANCE "tolerance" |
| #define | ATTR_ELEMENT_TYPE "ElementType" |
Functions | |
| Predicate_i * | SMESH.GetPredicate (Predicate_ptr thePredicate) |
| static bool | IsSubShape (const TopTools_IndexedMapOfShape &theMap, const TopoDS_Shape &theShape) |
| static bool | IsContains (const SMESHDS_Mesh *theMeshDS, const TopoDS_Shape &theShape, const SMDS_MeshElement *theElem, TopAbs_ShapeEnum theFindShapeEnum, TopAbs_ShapeEnum theAvoidShapeEnum=TopAbs_SHAPE) |
| const SMDS_Mesh * | MeshPtr2SMDSMesh (SMESH_Mesh_ptr theMesh) |
| SMESH::long_array * | toArray (const TColStd_ListOfInteger &aList) |
| SMESH::double_array * | toArray (const TColStd_ListOfReal &aList) |
| static SMESH::Filter::Criterion | createCriterion () |
| static TopoDS_Shape | getShapeByName (const char *theName) |
| static TopoDS_Shape | getShapeByID (const char *theID) |
| static char * | getShapeNameByID (const char *theID) |
| template<class TElement , class TIterator , class TPredicate > | |
| static void | collectMeshInfo (const TIterator &theItr, TPredicate &thePred, SMESH::long_array &theRes) |
| static bool | getCriteria (Predicate_i *thePred, SMESH::Filter::Criteria_out theCriteria) |
| static LDOMString | toString (CORBA::Boolean val) |
| static bool | toBool (const LDOMString &theStr) |
| static LDOMString | toString (CORBA::Double val) |
| static double | toDouble (const LDOMString &theStr) |
| static LDOMString | toString (CORBA::Long theType) |
| static SMESH::FunctorType | toFunctorType (const LDOMString &theStr) |
| static SMESH::ElementType | toElementType (const LDOMString &theStr) |
| static LDOMString | toString (const SMESH::ElementType theType) |
| static LDOM_Element | findFilter (const char *theFilterName, const LDOM_Document &theDoc, LDOM_Node *theParent=0) |
| static const char * | getSectionName (const ElementType theType) |
| static LDOM_Node | getSection (const ElementType theType, LDOM_Document &theDoc, const bool toCreate=false) |
| static LDOM_Element | createFilterItem (const char *theName, SMESH::Filter_ptr theFilter, LDOM_Document &theDoc) |
| #define ATTR_BINARY "binary" |
Definition at line 3071 of file SMESH_Filter_i.cxx.
Referenced by SMESH.FilterLibrary_i.Copy(), and createFilterItem().
| #define ATTR_COMPARE "compare" |
Definition at line 3068 of file SMESH_Filter_i.cxx.
Referenced by SMESH.FilterLibrary_i.Copy(), and createFilterItem().
| #define ATTR_ELEMENT_TYPE "ElementType" |
Definition at line 3074 of file SMESH_Filter_i.cxx.
Referenced by SMESH.FilterLibrary_i.Copy(), and createFilterItem().
| #define ATTR_THRESHOLD "threshold" |
Definition at line 3069 of file SMESH_Filter_i.cxx.
Referenced by SMESH.FilterLibrary_i.Copy(), and createFilterItem().
| #define ATTR_THRESHOLD_STR "threshold_str" |
Definition at line 3072 of file SMESH_Filter_i.cxx.
Referenced by SMESH.FilterLibrary_i.Copy(), and createFilterItem().
| #define ATTR_TOLERANCE "tolerance" |
Definition at line 3073 of file SMESH_Filter_i.cxx.
Referenced by SMESH.FilterLibrary_i.Copy(), and createFilterItem().
| #define ATTR_TYPE "type" |
Definition at line 3067 of file SMESH_Filter_i.cxx.
Referenced by SMESH.FilterLibrary_i.Copy(), and createFilterItem().
| #define ATTR_UNARY "unary" |
Definition at line 3070 of file SMESH_Filter_i.cxx.
Referenced by SMESH.FilterLibrary_i.Copy(), and createFilterItem().
| static void collectMeshInfo | ( | const TIterator & | theItr, |
| TPredicate & | thePred, | ||
| SMESH::long_array & | theRes | ||
| ) | [static] |
Definition at line 2373 of file SMESH_Filter_i.cxx.
References SMDS_MeshElement.GetEntityType(), and SMDS_MeshElement.GetID().
{
if (!theItr)
return;
while (theItr->more()) {
const SMDS_MeshElement* anElem = theItr->next();
if ( thePred->IsSatisfy( anElem->GetID() ) )
theRes[ anElem->GetEntityType() ]++;
}
}
| static SMESH::Filter::Criterion createCriterion | ( | ) | [static] |
Definition at line 469 of file SMESH_Filter_i.cxx.
References SMESH_freebord.aCriterion, SMESH.ALL, SMESH.Filter.Criterion.BinaryOp, SMESH.Filter.Criterion.Compare, SMESH.FT_Undefined, SMESH.Filter.Criterion.Precision, SMESH.Filter.Criterion.Threshold, SMESH.Filter.Criterion.ThresholdID, SMESH.Filter.Criterion.ThresholdStr, SMESH.Filter.Criterion.Tolerance, SMESH.Filter.Criterion.Type, SMESH.Filter.Criterion.TypeOfElement, and SMESH.Filter.Criterion.UnaryOp.
Referenced by SMESHGUI_FilterTable.Copy(), SMESH.FilterLibrary_i.Copy(), SMESHGUI_FilterLibraryDlg.createFilter(), and getCriteria().
{
SMESH::Filter::Criterion aCriterion;
aCriterion.Type = FT_Undefined;
aCriterion.Compare = FT_Undefined;
aCriterion.Threshold = 0;
aCriterion.UnaryOp = FT_Undefined;
aCriterion.BinaryOp = FT_Undefined;
aCriterion.ThresholdStr = "";
aCriterion.ThresholdID = "";
aCriterion.Tolerance = Precision::Confusion();
aCriterion.TypeOfElement = SMESH::ALL;
aCriterion.Precision = -1;
return aCriterion;
}
| static LDOM_Element createFilterItem | ( | const char * | theName, |
| SMESH::Filter_ptr | theFilter, | ||
| LDOM_Document & | theDoc | ||
| ) | [static] |
Definition at line 3341 of file SMESH_Filter_i.cxx.
References ATTR_BINARY, ATTR_COMPARE, ATTR_ELEMENT_TYPE, ATTR_THRESHOLD, ATTR_THRESHOLD_STR, ATTR_TOLERANCE, ATTR_TYPE, ATTR_UNARY, and toString().
Referenced by SMESH.FilterLibrary_i.Add(), SMESH.FilterLibrary_i.AddEmpty(), and SMESH.FilterLibrary_i.Replace().
{
// create new filter in document
LDOM_Element aFilterItem = theDoc.createElement( "filter" );
aFilterItem.setAttribute( "name", theName );
// save filter criterions
SMESH::Filter::Criteria_var aCriteria = new SMESH::Filter::Criteria;
if ( !theFilter->GetCriteria( aCriteria ) )
return LDOM_Element();
for ( CORBA::ULong i = 0, n = aCriteria->length(); i < n; i++ )
{
LDOM_Element aCriterionItem = theDoc.createElement( "criterion" );
aCriterionItem.setAttribute( ATTR_TYPE , toString( aCriteria[ i ].Type) );
aCriterionItem.setAttribute( ATTR_COMPARE , toString( aCriteria[ i ].Compare ) );
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 ,
toString( (SMESH::ElementType)aCriteria[ i ].TypeOfElement ) );
aFilterItem.appendChild( aCriterionItem );
}
return aFilterItem;
}
| static LDOM_Element findFilter | ( | const char * | theFilterName, |
| const LDOM_Document & | theDoc, | ||
| LDOM_Node * | theParent = 0 |
||
| ) | [static] |
Definition at line 3245 of file SMESH_Filter_i.cxx.
Referenced by SMESH.FilterLibrary_i.Add(), SMESH.FilterLibrary_i.AddEmpty(), SMESH.FilterLibrary_i.Copy(), SMESH.FilterLibrary_i.Delete(), SMESH.FilterLibrary_i.IsPresent(), and SMESH.FilterLibrary_i.Replace().
{
LDOM_Element aRootElement = theDoc.getDocumentElement();
if ( aRootElement.isNull() || !aRootElement.hasChildNodes() )
return LDOM_Element();
for ( LDOM_Node aTypeNode = aRootElement.getFirstChild();
!aTypeNode.isNull(); aTypeNode = aTypeNode.getNextSibling() )
{
for ( LDOM_Node aFilter = aTypeNode.getFirstChild();
!aFilter.isNull(); aFilter = aFilter.getNextSibling() )
{
LDOM_Element* anElem = ( LDOM_Element* )&aFilter;
if ( anElem->getTagName().equals( LDOMString( "filter" ) ) &&
anElem->getAttribute( "name" ).equals( LDOMString( theFilterName ) ) )
{
if ( theParent != 0 )
*theParent = aTypeNode;
return (LDOM_Element&)aFilter;
}
}
}
return LDOM_Element();
}
| static bool getCriteria | ( | Predicate_i * | thePred, |
| SMESH::Filter::Criteria_out | theCriteria | ||
| ) | [static] |
Definition at line 2455 of file SMESH_Filter_i.cxx.
References createCriterion(), SMESH.FT_BadOrientedVolume, SMESH.FT_BareBorderFace, SMESH.FT_BareBorderVolume, SMESH.FT_BelongToCylinder, SMESH.FT_BelongToGenSurface, SMESH.FT_BelongToGeom, SMESH.FT_BelongToPlane, SMESH.FT_CoplanarFaces, SMESH.FT_ElemGeomType, SMESH.FT_EqualTo, SMESH.FT_FreeBorders, SMESH.FT_FreeEdges, SMESH.FT_FreeFaces, SMESH.FT_FreeNodes, SMESH.FT_GroupColor, SMESH.FT_LessThan, SMESH.FT_LinearOrQuadratic, SMESH.FT_LogicalAND, SMESH.FT_LogicalNOT, SMESH.FT_LogicalOR, SMESH.FT_LyingOnGeom, SMESH.FT_MoreThan, SMESH.FT_OverConstrainedFace, SMESH.FT_OverConstrainedVolume, SMESH.FT_RangeOfIds, SMESH.FT_Undefined, SMESH.GroupColor_i.GetColorStr(), SMESH.Functor_i.GetElementType(), SMESH.CoplanarFaces_i.GetFaceAsString(), SMESH.ElemGeomType_i.GetGeometryType(), SMESH.Comparator_i.GetMargin(), SMESH.Comparator_i.GetNumFunctor_i(), SMESH.RangeOfIds_i.GetRangeStr(), SMESH.LyingOnGeom_i.GetShapeID(), SMESH.BelongToSurface_i.GetShapeID(), SMESH.BelongToGeom_i.GetShapeID(), SMESH.LyingOnGeom_i.GetShapeName(), SMESH.BelongToSurface_i.GetShapeName(), SMESH.BelongToGeom_i.GetShapeName(), SMESH.EqualTo_i.GetTolerance(), SMESH.CoplanarFaces_i.GetTolerance(), SMESH.LyingOnGeom_i.GetTolerance(), SMESH.BelongToSurface_i.GetTolerance(), and SMESH.BelongToGeom_i.GetTolerance().
Referenced by SMESH.Filter_i.GetCriteria().
{
int aFType = thePred->GetFunctorType();
switch ( aFType )
{
case FT_FreeBorders:
case FT_FreeEdges:
case FT_FreeFaces:
case FT_LinearOrQuadratic:
case FT_FreeNodes:
{
CORBA::ULong i = theCriteria->length();
theCriteria->length( i + 1 );
theCriteria[ i ] = createCriterion();
theCriteria[ i ].Type = aFType;
theCriteria[ i ].TypeOfElement = thePred->GetElementType();
return true;
}
case FT_BelongToGeom:
{
BelongToGeom_i* aPred = dynamic_cast<BelongToGeom_i*>( thePred );
CORBA::ULong i = theCriteria->length();
theCriteria->length( i + 1 );
theCriteria[ i ] = createCriterion();
theCriteria[ i ].Type = FT_BelongToGeom;
theCriteria[ i ].ThresholdStr = aPred->GetShapeName();
theCriteria[ i ].ThresholdID = aPred->GetShapeID();
theCriteria[ i ].TypeOfElement = aPred->GetElementType();
theCriteria[ i ].Tolerance = aPred->GetTolerance();
return true;
}
case FT_BelongToPlane:
case FT_BelongToCylinder:
case FT_BelongToGenSurface:
{
BelongToSurface_i* aPred = dynamic_cast<BelongToSurface_i*>( thePred );
CORBA::ULong i = theCriteria->length();
theCriteria->length( i + 1 );
theCriteria[ i ] = createCriterion();
theCriteria[ i ].Type = aFType;
theCriteria[ i ].ThresholdStr = aPred->GetShapeName();
theCriteria[ i ].ThresholdID = aPred->GetShapeID();
theCriteria[ i ].TypeOfElement = aPred->GetElementType();
theCriteria[ i ].Tolerance = aPred->GetTolerance();
return true;
}
case FT_LyingOnGeom:
{
LyingOnGeom_i* aPred = dynamic_cast<LyingOnGeom_i*>( thePred );
CORBA::ULong i = theCriteria->length();
theCriteria->length( i + 1 );
theCriteria[ i ] = createCriterion();
theCriteria[ i ].Type = FT_LyingOnGeom;
theCriteria[ i ].ThresholdStr = aPred->GetShapeName();
theCriteria[ i ].ThresholdID = aPred->GetShapeID();
theCriteria[ i ].TypeOfElement = aPred->GetElementType();
theCriteria[ i ].Tolerance = aPred->GetTolerance();
return true;
}
case FT_CoplanarFaces:
{
CoplanarFaces_i* aPred = dynamic_cast<CoplanarFaces_i*>( thePred );
CORBA::ULong i = theCriteria->length();
theCriteria->length( i + 1 );
theCriteria[ i ] = createCriterion();
CORBA::String_var faceId = aPred->GetFaceAsString();
theCriteria[ i ].Type = FT_CoplanarFaces;
theCriteria[ i ].ThresholdID = faceId;
theCriteria[ i ].Tolerance = aPred->GetTolerance();
return true;
}
case FT_RangeOfIds:
{
RangeOfIds_i* aPred = dynamic_cast<RangeOfIds_i*>( thePred );
CORBA::ULong i = theCriteria->length();
theCriteria->length( i + 1 );
theCriteria[ i ] = createCriterion();
theCriteria[ i ].Type = FT_RangeOfIds;
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();
return true;
}
case FT_BareBorderVolume:
{
BareBorderVolume_i* aPred = dynamic_cast<BareBorderVolume_i*>( thePred );
CORBA::ULong i = theCriteria->length();
theCriteria->length( i + 1 );
theCriteria[ i ] = createCriterion();
theCriteria[ i ].Type = FT_BareBorderVolume;
theCriteria[ i ].TypeOfElement = aPred->GetElementType();
return true;
}
case FT_BareBorderFace:
{
BareBorderFace_i* aPred = dynamic_cast<BareBorderFace_i*>( thePred );
CORBA::ULong i = theCriteria->length();
theCriteria->length( i + 1 );
theCriteria[ i ] = createCriterion();
theCriteria[ i ].Type = FT_BareBorderFace;
theCriteria[ i ].TypeOfElement = aPred->GetElementType();
return true;
}
case FT_OverConstrainedVolume:
{
OverConstrainedVolume_i* aPred = dynamic_cast<OverConstrainedVolume_i*>( thePred );
CORBA::ULong i = theCriteria->length();
theCriteria->length( i + 1 );
theCriteria[ i ] = createCriterion();
theCriteria[ i ].Type = FT_OverConstrainedVolume;
theCriteria[ i ].TypeOfElement = aPred->GetElementType();
return true;
}
case FT_OverConstrainedFace:
{
OverConstrainedFace_i* aPred = dynamic_cast<OverConstrainedFace_i*>( thePred );
CORBA::ULong i = theCriteria->length();
theCriteria->length( i + 1 );
theCriteria[ i ] = createCriterion();
theCriteria[ i ].Type = FT_OverConstrainedFace;
theCriteria[ i ].TypeOfElement = aPred->GetElementType();
return true;
}
case FT_LessThan:
case FT_MoreThan:
case FT_EqualTo:
{
Comparator_i* aCompar = dynamic_cast<Comparator_i*>( thePred );
CORBA::ULong i = theCriteria->length();
theCriteria->length( i + 1 );
theCriteria[ i ] = createCriterion();
theCriteria[ i ].Type = aCompar->GetNumFunctor_i()->GetFunctorType();
theCriteria[ i ].Compare = aFType;
theCriteria[ i ].Threshold = aCompar->GetMargin();
theCriteria[ i ].TypeOfElement = aCompar->GetElementType();
if ( aFType == FT_EqualTo )
{
EqualTo_i* aCompar = dynamic_cast<EqualTo_i*>( thePred );
theCriteria[ i ].Tolerance = aCompar->GetTolerance();
}
}
return true;
case FT_LogicalNOT:
{
Predicate_i* aPred = ( dynamic_cast<LogicalNOT_i*>( thePred ) )->GetPredicate_i();
getCriteria( aPred, theCriteria );
theCriteria[ theCriteria->length() - 1 ].UnaryOp = FT_LogicalNOT;
}
return true;
case FT_LogicalAND:
case FT_LogicalOR:
{
Predicate_i* aPred1 = ( dynamic_cast<LogicalBinary_i*>( thePred ) )->GetPredicate1_i();
Predicate_i* aPred2 = ( dynamic_cast<LogicalBinary_i*>( thePred ) )->GetPredicate2_i();
if ( !getCriteria( aPred1, theCriteria ) )
return false;
theCriteria[ theCriteria->length() - 1 ].BinaryOp = aFType;
return getCriteria( aPred2, theCriteria );
}
case FT_GroupColor:
{
CORBA::ULong i = theCriteria->length();
theCriteria->length( i + 1 );
theCriteria[ i ] = createCriterion();
GroupColor_i* aPred = dynamic_cast<GroupColor_i*>( thePred );
theCriteria[ i ].Type = aFType;
theCriteria[ i ].TypeOfElement = aPred->GetElementType();
theCriteria[ i ].ThresholdStr = aPred->GetColorStr();
return true;
}
case FT_ElemGeomType:
{
CORBA::ULong i = theCriteria->length();
theCriteria->length( i + 1 );
theCriteria[ i ] = createCriterion();
ElemGeomType_i* aPred = dynamic_cast<ElemGeomType_i*>( thePred );
theCriteria[ i ].Type = aFType;
theCriteria[ i ].TypeOfElement = aPred->GetElementType();
theCriteria[ i ].Threshold = (double)aPred->GetGeometryType();
return true;
}
case FT_Undefined:
return false;
default:
return false;
}
}
| static LDOM_Node getSection | ( | const ElementType | theType, |
| LDOM_Document & | theDoc, | ||
| const bool | toCreate = false |
||
| ) | [static] |
Definition at line 3293 of file SMESH_Filter_i.cxx.
References getSectionName().
Referenced by SMESH.FilterLibrary_i.Add(), SMESH.FilterLibrary_i.AddEmpty(), and SMESH.FilterLibrary_i.GetNames().
{
LDOM_Element aRootElement = theDoc.getDocumentElement();
if ( aRootElement.isNull() )
return LDOM_Node();
// Find section
bool anExist = false;
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++ )
{
aNode = aSections.item( i );
LDOM_Element& anItem = ( LDOM_Element& )aNode;
if ( anItem.getAttribute( "name" ).equals( LDOMString( aSectionName ) ) )
{
anExist = true;
break;
}
}
// Create new section if necessary
if ( !anExist )
{
if ( toCreate )
{
LDOM_Element aNewItem = theDoc.createElement( "section" );
aNewItem.setAttribute( "name", aSectionName );
aRootElement.appendChild( aNewItem );
return aNewItem;
}
else
return LDOM_Node();
}
return
aNode;
}
| static const char* getSectionName | ( | const ElementType | theType | ) | [static] |
Definition at line 3276 of file SMESH_Filter_i.cxx.
References SMESH.ALL, SMESH.EDGE, SMESH.FACE, SMESH.NODE, and SMESH.VOLUME.
Referenced by getSection().
{
switch ( theType )
{
case SMESH::NODE : return "Filters for nodes";
case SMESH::EDGE : return "Filters for edges";
case SMESH::FACE : return "Filters for faces";
case SMESH::VOLUME : return "Filters for volumes";
case SMESH::ALL : return "Filters for elements";
default : return "";
}
}
| static TopoDS_Shape getShapeByID | ( | const char * | theID | ) | [static] |
Definition at line 512 of file SMESH_Filter_i.cxx.
References SMESH_Gen_i.GetCurrentStudy(), SMESH_Gen_i.GetGeomEngine(), SMESH_Gen_i.GetShapeReader(), and SMESH_Gen_i.GetSMESHGen().
Referenced by SMESH.LyingOnGeom_i.SetShape(), SMESH.BelongToSurface_i.SetShape(), and SMESH.BelongToGeom_i.SetShape().
{
if (theID != 0 && theID != "") {
SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
SALOMEDS::Study_ptr aStudy = aSMESHGen->GetCurrentStudy();
if (aStudy != 0) {
SALOMEDS::SObject_var aSObj = aStudy->FindObjectID(theID);
SALOMEDS::GenericAttribute_var anAttr;
if (!aSObj->_is_nil() && aSObj->FindAttribute(anAttr, "AttributeIOR")) {
SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
CORBA::String_var aVal = anIOR->Value();
CORBA::Object_var obj = aStudy->ConvertIORToObject(aVal);
GEOM::GEOM_Object_var aGeomObj = GEOM::GEOM_Object::_narrow(obj);
if (!aGeomObj->_is_nil()) {
GEOM::GEOM_Gen_ptr aGEOMGen = SMESH_Gen_i::GetGeomEngine();
TopoDS_Shape aLocShape = aSMESHGen->GetShapeReader()->GetShape( aGEOMGen, aGeomObj );
return aLocShape;
}
}
}
}
return TopoDS_Shape();
}
| static TopoDS_Shape getShapeByName | ( | const char * | theName | ) | [static] |
Definition at line 487 of file SMESH_Filter_i.cxx.
References SMESH_Gen_i.GetCurrentStudy(), SMESH_Gen_i.GetGeomEngine(), SMESH_Gen_i.GetShapeReader(), and SMESH_Gen_i.GetSMESHGen().
Referenced by SMESH.LyingOnGeom_i.SetShape(), SMESH.BelongToSurface_i.SetShape(), SMESH.BelongToGeom_i.SetShape(), SMESH.LyingOnGeom_i.SetShapeName(), SMESH.BelongToSurface_i.SetShapeName(), and SMESH.BelongToGeom_i.SetShapeName().
{
if ( theName != 0 )
{
SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
SALOMEDS::Study_ptr aStudy = aSMESHGen->GetCurrentStudy();
if (!CORBA::is_nil(aStudy))
{
SALOMEDS::Study::ListOfSObject_var aList =
aStudy->FindObjectByName( theName, "GEOM" );
if ( aList->length() > 0 )
{
GEOM::GEOM_Object_var aGeomObj = GEOM::GEOM_Object::_narrow( aList[ 0 ]->GetObject() );
if ( !aGeomObj->_is_nil() )
{
GEOM::GEOM_Gen_ptr aGEOMGen = SMESH_Gen_i::GetGeomEngine();
TopoDS_Shape aLocShape = aSMESHGen->GetShapeReader()->GetShape( aGEOMGen, aGeomObj );
return aLocShape;
}
}
}
}
return TopoDS_Shape();
}
| static char* getShapeNameByID | ( | const char * | theID | ) | [static] |
Definition at line 537 of file SMESH_Filter_i.cxx.
References SMESH_Gen_i.GetCurrentStudy(), and SMESH_Gen_i.GetSMESHGen().
Referenced by SMESH.LyingOnGeom_i.SetShape(), SMESH.BelongToSurface_i.SetShape(), and SMESH.BelongToGeom_i.SetShape().
{
char* aName = (char*)"";
if (theID != 0 && theID != "") {
SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen();
SALOMEDS::Study_ptr aStudy = aSMESHGen->GetCurrentStudy();
if (aStudy != 0) {
//SALOMEDS::SObject_var aSObj = aStudy->FindObjectIOR( theID );
SALOMEDS::SObject_var aSObj = aStudy->FindObjectID(theID);
SALOMEDS::GenericAttribute_var anAttr;
if (!aSObj->_is_nil() && aSObj->FindAttribute(anAttr, "AttributeName")) {
SALOMEDS::AttributeName_var aNameAttr = SALOMEDS::AttributeName::_narrow(anAttr);
aName = aNameAttr->Value();
}
}
}
return aName;
}
| static bool IsContains | ( | const SMESHDS_Mesh * | theMeshDS, |
| const TopoDS_Shape & | theShape, | ||
| const SMDS_MeshElement * | theElem, | ||
| TopAbs_ShapeEnum | theFindShapeEnum, | ||
| TopAbs_ShapeEnum | theAvoidShapeEnum = TopAbs_SHAPE |
||
| ) | [static] |
Definition at line 149 of file SMESH_Filter_i.cxx.
References SMESH_fixation.aShape, and SMESHDS_Mesh.MeshElements().
Referenced by SMESH.Controls.LyingOnGeom.Contains(), SMESH.Controls.LyingOnGeom.IsSatisfy(), and SMESH.Controls.BelongToGeom.IsSatisfy().
{
TopExp_Explorer anExp( theShape,theFindShapeEnum,theAvoidShapeEnum );
while( anExp.More() )
{
const TopoDS_Shape& aShape = anExp.Current();
if( SMESHDS_SubMesh* aSubMesh = theMeshDS->MeshElements( aShape ) ){
if( aSubMesh->Contains( theElem ) )
return true;
}
anExp.Next();
}
return false;
}
| static bool IsSubShape | ( | const TopTools_IndexedMapOfShape & | theMap, |
| const TopoDS_Shape & | theShape | ||
| ) | [static] |
Definition at line 103 of file SMESH_Filter_i.cxx.
Referenced by SMESH_subMesh.AlgoStateEngine(), StdMeshers_Projection_3D.CheckHypothesis(), SMESH.Controls.LyingOnGeom.init(), SMESH.Controls.BelongToGeom.init(), and SMESH_HypoFilter.IsMoreLocalThanPredicate.IsOk().
{
if (theMap.Contains(theShape)) return true;
if (theShape.ShapeType() == TopAbs_COMPOUND ||
theShape.ShapeType() == TopAbs_COMPSOLID)
{
TopoDS_Iterator anIt (theShape, Standard_True, Standard_True);
for (; anIt.More(); anIt.Next())
{
if (!IsSubShape(theMap, anIt.Value())) {
return false;
}
}
return true;
}
return false;
}
| const SMDS_Mesh* MeshPtr2SMDSMesh | ( | SMESH_Mesh_ptr | theMesh | ) |
Definition at line 435 of file SMESH_Filter_i.cxx.
References SMESH_Mesh_i.GetImpl().
Referenced by SMESH.Filter_i.GetElementsId(), SMESH.Filter_i.GetMeshInfo(), and SMESH.Functor_i.SetMesh().
{
SMESH_Mesh_i* anImplPtr = DownCast<SMESH_Mesh_i*>(theMesh);
return anImplPtr ? anImplPtr->GetImpl().GetMeshDS() : 0;
}
| SMESH::long_array* toArray | ( | const TColStd_ListOfInteger & | aList | ) |
Definition at line 443 of file SMESH_Filter_i.cxx.
{
SMESH::long_array_var anArray = new SMESH::long_array;
anArray->length( aList.Extent() );
TColStd_ListIteratorOfListOfInteger anIter( aList );
int i = 0;
for( ; anIter.More(); anIter.Next() )
anArray[ i++ ] = anIter.Value();
return anArray._retn();
}
| SMESH::double_array* toArray | ( | const TColStd_ListOfReal & | aList | ) |
Definition at line 457 of file SMESH_Filter_i.cxx.
{
SMESH::double_array_var anArray = new SMESH::double_array;
anArray->length( aList.Extent() );
TColStd_ListIteratorOfListOfReal anIter( aList );
int i = 0;
for( ; anIter.More(); anIter.Next() )
anArray[ i++ ] = anIter.Value();
return anArray._retn();
}
| static bool toBool | ( | const LDOMString & | theStr | ) | [static] |
Definition at line 3089 of file SMESH_Filter_i.cxx.
{
return theStr.equals( "logical not" );
}
| static double toDouble | ( | const LDOMString & | theStr | ) | [static] |
Definition at line 3109 of file SMESH_Filter_i.cxx.
Referenced by SMESHGUI_FilterTable.SetCriterion().
{
return atof( theStr.GetString() );
}
| static SMESH::ElementType toElementType | ( | const LDOMString & | theStr | ) | [static] |
Definition at line 3215 of file SMESH_Filter_i.cxx.
References SMESH.ALL, SMESH.EDGE, SMESH.FACE, SMESH.NODE, and SMESH.VOLUME.
Referenced by SMESH.FilterLibrary_i.Copy().
{
if ( theStr.equals( "NODE" ) ) return SMESH::NODE;
else if ( theStr.equals( "EDGE" ) ) return SMESH::EDGE;
else if ( theStr.equals( "FACE" ) ) return SMESH::FACE;
else if ( theStr.equals( "VOLUME" ) ) return SMESH::VOLUME;
else return SMESH::ALL;
}
| static SMESH::FunctorType toFunctorType | ( | const LDOMString & | theStr | ) | [static] |
Definition at line 3168 of file SMESH_Filter_i.cxx.
References SMESH.FT_Area, SMESH.FT_AspectRatio, SMESH.FT_BadOrientedVolume, SMESH.FT_BareBorderFace, SMESH.FT_BareBorderVolume, SMESH.FT_BelongToCylinder, SMESH.FT_BelongToGenSurface, SMESH.FT_BelongToGeom, SMESH.FT_BelongToPlane, SMESH.FT_ElemGeomType, SMESH.FT_EqualTo, SMESH.FT_FreeBorders, SMESH.FT_FreeEdges, SMESH.FT_FreeFaces, SMESH.FT_FreeNodes, SMESH.FT_GroupColor, SMESH.FT_Length, SMESH.FT_LessThan, SMESH.FT_LinearOrQuadratic, SMESH.FT_LogicalAND, SMESH.FT_LogicalNOT, SMESH.FT_LogicalOR, SMESH.FT_LyingOnGeom, SMESH.FT_MaxElementLength2D, SMESH.FT_MaxElementLength3D, SMESH.FT_MinimumAngle, SMESH.FT_MoreThan, SMESH.FT_MultiConnection, SMESH.FT_OverConstrainedFace, SMESH.FT_OverConstrainedVolume, SMESH.FT_RangeOfIds, SMESH.FT_Skew, SMESH.FT_Taper, SMESH.FT_Undefined, SMESH.FT_Volume3D, and SMESH.FT_Warping.
Referenced by SMESH.FilterLibrary_i.Copy().
{
if ( theStr.equals( "Aspect ratio" ) ) return FT_AspectRatio;
else if ( theStr.equals( "Warping" ) ) return FT_Warping;
else if ( theStr.equals( "Minimum angle" ) ) return FT_MinimumAngle;
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( "Volume3D" ) ) return FT_Volume3D;
else if ( theStr.equals( "Max element length 2D" ) ) return FT_MaxElementLength2D;
else if ( theStr.equals( "Max element length 3D" ) ) return FT_MaxElementLength3D;
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;
else if ( theStr.equals( "Free faces" ) ) return FT_FreeFaces;
else if ( theStr.equals( "Free nodes" ) ) return FT_FreeNodes;
else if ( theStr.equals( "Borders at multi-connections" ) ) return FT_MultiConnection;
// else if ( theStr.equals( "Borders at multi-connections 2D" ) ) return FT_MultiConnection2D;
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( "Bad Oriented Volume" ) ) return FT_BadOrientedVolume;
else if ( theStr.equals( "Volumes with bare border" ) ) return FT_BareBorderVolume;
else if ( theStr.equals( "Faces with bare border" ) ) return FT_BareBorderFace;
else if ( theStr.equals( "Over-constrained Volumes" ) ) return FT_OverConstrainedVolume;
else if ( theStr.equals( "Over-constrained Faces" ) ) return FT_OverConstrainedFace;
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( "Not" ) ) return FT_LogicalNOT;
else if ( theStr.equals( "And" ) ) return FT_LogicalAND;
else if ( theStr.equals( "Or" ) ) return FT_LogicalOR;
else if ( theStr.equals( "Color of Group" ) ) return FT_GroupColor;
else if ( theStr.equals( "Linear or Quadratic" ) ) return FT_LinearOrQuadratic;
else if ( theStr.equals( "Element geomtry type" ) ) return FT_ElemGeomType;
else if ( theStr.equals( "" ) ) return FT_Undefined;
else return FT_Undefined;
}
| static LDOMString toString | ( | CORBA::Double | val | ) | [static] |
Definition at line 3098 of file SMESH_Filter_i.cxx.
References SMESH_demo_hexa2_upd.a.
{
char a[ 255 ];
sprintf( a, "%e", val );
return LDOMString( a );
}
| static LDOMString toString | ( | CORBA::Boolean | val | ) | [static] |
Definition at line 3080 of file SMESH_Filter_i.cxx.
Referenced by createFilterItem().
{
return val ? "logical not" : "";
}
| static LDOMString toString | ( | CORBA::Long | theType | ) | [static] |
Definition at line 3118 of file SMESH_Filter_i.cxx.
References SMESH.FT_Area, SMESH.FT_AspectRatio, SMESH.FT_BadOrientedVolume, SMESH.FT_BareBorderFace, SMESH.FT_BareBorderVolume, SMESH.FT_BelongToCylinder, SMESH.FT_BelongToGenSurface, SMESH.FT_BelongToGeom, SMESH.FT_BelongToPlane, SMESH.FT_ElemGeomType, SMESH.FT_EqualTo, SMESH.FT_FreeBorders, SMESH.FT_FreeEdges, SMESH.FT_FreeFaces, SMESH.FT_FreeNodes, SMESH.FT_GroupColor, SMESH.FT_Length, SMESH.FT_Length2D, SMESH.FT_LessThan, SMESH.FT_LinearOrQuadratic, SMESH.FT_LogicalAND, SMESH.FT_LogicalNOT, SMESH.FT_LogicalOR, SMESH.FT_LyingOnGeom, SMESH.FT_MaxElementLength2D, SMESH.FT_MaxElementLength3D, SMESH.FT_MinimumAngle, SMESH.FT_MoreThan, SMESH.FT_MultiConnection, SMESH.FT_MultiConnection2D, SMESH.FT_OverConstrainedFace, SMESH.FT_OverConstrainedVolume, SMESH.FT_RangeOfIds, SMESH.FT_Skew, SMESH.FT_Taper, SMESH.FT_Undefined, SMESH.FT_Volume3D, and SMESH.FT_Warping.
{
switch ( theType )
{
case FT_AspectRatio : return "Aspect ratio";
case FT_Warping : return "Warping";
case FT_MinimumAngle : return "Minimum angle";
case FT_Taper : return "Taper";
case FT_Skew : return "Skew";
case FT_Area : return "Area";
case FT_Volume3D : return "Volume3D";
case FT_MaxElementLength2D: return "Max element length 2D";
case FT_MaxElementLength3D: return "Max element length 3D";
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_BareBorderVolume: return "Volumes with bare border";
case FT_BareBorderFace : return "Faces with bare border";
case FT_OverConstrainedVolume: return "Over-constrained Volumes";
case FT_OverConstrainedFace : return "Over-constrained Faces";
case FT_RangeOfIds : return "Range of IDs";
case FT_FreeBorders : return "Free borders";
case FT_FreeEdges : return "Free edges";
case FT_FreeFaces : return "Free faces";
case FT_FreeNodes : return "Free nodes";
case FT_MultiConnection : return "Borders at multi-connections";
case FT_MultiConnection2D: return "Borders at multi-connections 2D";
case FT_Length : return "Length";
case FT_Length2D : return "Length 2D";
case FT_LessThan : return "Less than";
case FT_MoreThan : return "More than";
case FT_EqualTo : return "Equal to";
case FT_LogicalNOT : return "Not";
case FT_LogicalAND : return "And";
case FT_LogicalOR : return "Or";
case FT_GroupColor : return "Color of Group";
case FT_LinearOrQuadratic : return "Linear or Quadratic";
case FT_ElemGeomType : return "Element geomtry type";
case FT_Undefined : return "";
default : return "";
}
}
| static LDOMString toString | ( | const SMESH::ElementType | theType | ) | [static] |
Definition at line 3228 of file SMESH_Filter_i.cxx.
References SMESH.ALL, SMESH.EDGE, SMESH.FACE, SMESH.NODE, and SMESH.VOLUME.
{
switch ( theType )
{
case SMESH::NODE : return "NODE";
case SMESH::EDGE : return "EDGE";
case SMESH::FACE : return "FACE";
case SMESH::VOLUME : return "VOLUME";
case SMESH::ALL : return "ALL";
default : return "";
}
}