//-------------------------------------------------
anId = popupMgr()->insert( tr( "MEN_QUADRATIC_REPRESENT" ), -1, -1 );
popupMgr()->insert( action( SMESHOp::OpRepresentationLines ), anId, -1 );
- popupMgr()->setRule( action( SMESHOp::OpRepresentationLines ), aMeshInVTK + "and isVisible",QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( SMESHOp::OpRepresentationLines ), aMeshInVTK + "&& isVisible && isQuadratic",QtxPopupMgr::VisibleRule );
popupMgr()->setRule( action( SMESHOp::OpRepresentationLines ), "quadratic2DMode = 'eLines'", QtxPopupMgr::ToggleRule );
popupMgr()->insert( action( SMESHOp::OpRepresentationArcs ), anId, -1 );
- popupMgr()->setRule( action( SMESHOp::OpRepresentationArcs ), aMeshInVTK + "and isVisible", QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( SMESHOp::OpRepresentationArcs ), aMeshInVTK + "&& isVisible && isQuadratic", QtxPopupMgr::VisibleRule );
popupMgr()->setRule( action( SMESHOp::OpRepresentationArcs ), "quadratic2DMode = 'eArcs'", QtxPopupMgr::ToggleRule );
//-------------------------------------------------
SMESHGUI_ConvToQuadOp::MeshDestinationType
SMESHGUI_ConvToQuadOp::DestinationMesh( const SMESH::SMESH_IDSource_var& idSource,
- bool* isMixOrder) const
+ bool* isMixOrder)
{
SMESH::long_array_var nbElemOfType = idSource->GetMeshInfo();
virtual LightApp_Dialog* dlg() const;
+ static MeshDestinationType DestinationMesh( const SMESH::SMESH_IDSource_var& ,
+ bool* isMixOrder = 0);
protected:
virtual void startOperation();
virtual void selectionDone();
virtual SUIT_SelectionFilter* createFilter( const int ) const;
- MeshDestinationType DestinationMesh( const SMESH::SMESH_IDSource_var& ,
- bool* isMixOrder = 0) const;
protected slots:
virtual bool onApply();
#include "SMESHGUI_VTKUtils.h"
#include "SMESHGUI_GEOMGenUtils.h"
#include "SMESHGUI_ComputeDlg.h"
+#include "SMESHGUI_ConvToQuadOp.h"
#include <SMESH_Type.h>
#include <SMESH_Actor.h>
else if ( p=="isImported" ) val = QVariant( isImported( ind ) );
else if ( p=="facesOrientationMode" ) val = QVariant( facesOrientationMode( ind ) );
else if ( p=="groupType" ) val = QVariant( groupType( ind ) );
+ else if ( p=="isQuadratic" ) val = QVariant( isQuadratic( ind ) );
else if ( p=="quadratic2DMode") val = QVariant( quadratic2DMode( ind ) );
else if ( p=="isDistributionVisible") val = QVariant( isDistributionVisible( ind ) );
else if ( p=="isScalarBarVisible") val = QVariant( isScalarBarVisible( ind ) );
return "Unknown";
}
+//=======================================================================
+//function : isQuadratic
+//purpose : return true if the mesh has quadratic/bi-quadratic type
+//=======================================================================
+
+bool SMESHGUI_Selection::isQuadratic( int ind ) const
+{
+ _PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
+ if ( !so )
+ return false;
+ SMESH::SMESH_IDSource_var idSource = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( so );
+ if ( idSource->_is_nil() )
+ return false;
+ SMESHGUI_ConvToQuadOp::MeshDestinationType meshTgtType = SMESHGUI_ConvToQuadOp::DestinationMesh( idSource );
+ if ( meshTgtType & SMESHGUI_ConvToQuadOp::MeshDestinationType::Linear )
+ return true;
+ return false;
+}
//=======================================================================
//function : quadratic2DMode
virtual bool isEditableHyp( int ) const;
virtual bool isVisible( int ) const;
+ virtual bool isQuadratic( int ) const;
virtual QString quadratic2DMode( int ) const;
virtual bool isDistributionVisible( int ) const;