]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
PAL7358. Add BadOrientedVolume predicate
authoreap <eap@opencascade.com>
Fri, 21 Jan 2005 12:21:36 +0000 (12:21 +0000)
committereap <eap@opencascade.com>
Fri, 21 Jan 2005 12:21:36 +0000 (12:21 +0000)
src/Controls/SMESH_Controls.cxx
src/Controls/SMESH_ControlsDef.hxx

index 2bf885a7a29a0d1500bc03e04f0818c4e2eda230..4aa92f1d286bdc826d53061b31d4f8753dbdec10 100644 (file)
@@ -45,6 +45,7 @@
 #include "SMDS_Iterator.hxx"
 #include "SMDS_MeshElement.hxx"
 #include "SMDS_MeshNode.hxx"
+#include "SMDS_VolumeTool.hxx"
 
 
 /*
@@ -1165,6 +1166,37 @@ void MultiConnection2D::GetValues(MValues& theValues){
                             PREDICATES
 */
 
+/*
+  Class       : BadOrientedVolume
+  Description : Predicate bad oriented volumes
+*/
+
+BadOrientedVolume::BadOrientedVolume()
+{
+  myMesh = 0;
+}
+
+void BadOrientedVolume::SetMesh( SMDS_Mesh* theMesh )
+{
+  myMesh = theMesh;
+}
+
+bool BadOrientedVolume::IsSatisfy( long theId )
+{
+  if ( myMesh == 0 )
+    return false;
+
+  SMDS_VolumeTool vTool( myMesh->FindElement( theId ));
+  return !vTool.IsForward();
+}
+
+SMDSAbs_ElementType BadOrientedVolume::GetType() const
+{
+  return SMDSAbs_Volume;
+}
+
+
+
 /*
   Class       : FreeBorders
   Description : Predicate for free borders
index 50fb06558b6a8a8ae904dab61ee4ae52bec7bb57..339157e6cc12e262d5cbc61d1112a3663dfd6cf1 100644 (file)
@@ -304,6 +304,22 @@ namespace SMESH{
     };
    
 
+    /*
+      Class       : BadOrientedVolume
+      Description : Predicate bad oriented volumes
+    */
+    class BadOrientedVolume: public virtual Predicate{
+    public:
+      BadOrientedVolume();
+      virtual void SetMesh( SMDS_Mesh* theMesh );
+      virtual bool IsSatisfy( long theElementId );
+      virtual SMDSAbs_ElementType GetType() const;
+            
+    protected:
+      SMDS_Mesh* myMesh;
+    };
+   
+
     /*
       Class       : FreeEdges
       Description : Predicate for free Edges