import salome,geompy,smesh

import SMESH

def PrintHypothesisTypes(meshName):
	
	# Get the input mesh
	
	mesh=salome.myStudy.FindObjectByName(meshName,"SMESH")[0].GetObject()
	
	mesh=smesh.Mesh(mesh)
	
	# Get the mesh associated shape
	
	meshShape=mesh.GetShape()
	
	#-
	
	# Get the shape groups
	
	meshShapeGroups=geompy.GetGroups(meshShape)
	
	#-
	
	for group in meshShapeGroups:# For each group...
		
		# Find the associated hypotheses
		
		hypotheses=mesh.GetHypothesisList(group)
		
		#-
		
                for hypothesis in hypotheses:
				
                        print hypothesis.GetName()#### <- hypothesis type

                        print "Is algo:", isinstance( hypothesis, SMESH._objref_SMESH_Algo )
			
		
	

PrintHypothesisTypes('Mesh_1')
