+//================================================================================
+/*! ConsistMesh
+ * Determines, what elements this mesh does not contain.
+ */
+//================================================================================
+
+SMESHGUI_ConvToQuadOp::MeshDestinationType
+SMESHGUI_ConvToQuadOp::DestinationMesh( const SMESH::SMESH_IDSource_var& idSource,
+ bool* isMixOrder)
+{
+ SMESH::smIdType_array_var nbElemOfType = idSource->GetMeshInfo();
+
+ bool hasBiQuad = ( nbElemOfType[SMDSEntity_BiQuad_Triangle ] ||
+ nbElemOfType[SMDSEntity_BiQuad_Quadrangle ] ||
+ nbElemOfType[SMDSEntity_BiQuad_Penta ] ||
+ nbElemOfType[SMDSEntity_TriQuad_Hexa ] );
+ bool hasLinBiQuad = ( nbElemOfType[SMDSEntity_Triangle ] ||
+ nbElemOfType[SMDSEntity_Quadrangle ] ||
+ nbElemOfType[SMDSEntity_Hexa ] );
+ bool hasQuadBiQuad = ( nbElemOfType[SMDSEntity_Quad_Triangle ] ||
+ nbElemOfType[SMDSEntity_Quad_Quadrangle ] ||
+ nbElemOfType[SMDSEntity_Quad_Hexa ] );
+
+ bool hasQuad = ( nbElemOfType[SMDSEntity_Quad_Edge ] ||
+ nbElemOfType[SMDSEntity_Quad_Triangle ] ||
+ nbElemOfType[SMDSEntity_Quad_Quadrangle] ||
+ nbElemOfType[SMDSEntity_Quad_Tetra ] ||
+ nbElemOfType[SMDSEntity_Quad_Hexa ] ||
+ nbElemOfType[SMDSEntity_Quad_Pyramid ] ||
+ nbElemOfType[SMDSEntity_Quad_Polygon ] ||
+ nbElemOfType[SMDSEntity_Quad_Penta ] );
+
+ bool hasLin = ( nbElemOfType[SMDSEntity_Edge ] ||
+ nbElemOfType[SMDSEntity_Triangle ] ||
+ nbElemOfType[SMDSEntity_Quadrangle] ||
+ nbElemOfType[SMDSEntity_Tetra ] ||
+ nbElemOfType[SMDSEntity_Hexa ] ||
+ nbElemOfType[SMDSEntity_Pyramid ] ||
+ nbElemOfType[SMDSEntity_Polygon ] ||
+ nbElemOfType[SMDSEntity_Penta ] );
+
+ int tgtType = 0;
+ if ( hasBiQuad )
+ tgtType |= ( Quadratic | Linear );
+ if ( hasLinBiQuad )
+ tgtType |= ( BiQuadratic | Quadratic );
+ if ( hasQuadBiQuad )
+ tgtType |= ( BiQuadratic | Linear );
+ if ( hasQuad )
+ tgtType |= Linear;
+ if ( hasLin )
+ tgtType |= Quadratic;
+
+ if ( tgtType == 0 )
+ tgtType = Quadratic;
+
+ if ( isMixOrder )
+ *isMixOrder = ( hasLin && ( hasQuad || hasBiQuad ));
+
+ return MeshDestinationType( tgtType );
+}