Bug PAL7334

DEVELOPMENT : Control Improvement
This commit is contained in:
apo 2004-12-27 11:58:51 +00:00
parent 212f14870c
commit 30f78ce578
8 changed files with 74 additions and 95 deletions

View File

@ -285,7 +285,6 @@ SMESH_ActorDef::SMESH_ActorDef(){
myIO = NULL;
myControlMode = eNone;
my1DColorMode = e1DNone;
myControlActor = my2DActor;
//Definition of myScalarBarActor
@ -624,7 +623,6 @@ void SMESH_ActorDef::SetCellsLabeled(bool theIsCellsLabeled){
void SMESH_ActorDef::SetControlMode(eControl theMode){
myControlMode = eNone;
my1DColorMode = e1DNone;
my1DActor->GetMapper()->SetScalarVisibility(false);
my2DActor->GetMapper()->SetScalarVisibility(false);
@ -636,7 +634,7 @@ void SMESH_ActorDef::SetControlMode(eControl theMode){
if(anIsScalarVisible){
SMESH::Controls::FunctorPtr aFunctor;
switch(theMode){
case eLengthEdges:
case eLength:
{
SMESH::Controls::Length* aControl = new SMESH::Controls::Length();
aControl->SetPrecision( myControlsPrecision );
@ -644,7 +642,7 @@ void SMESH_ActorDef::SetControlMode(eControl theMode){
myControlActor = my1DActor;
break;
}
case eLength:
case eLength2D:
{
aFunctor.reset(new SMESH::Controls::Length2D());
myControlActor = my2DActor;
@ -726,15 +724,15 @@ void SMESH_ActorDef::SetControlMode(eControl theMode){
vtkIdType aNbCells = aGrid->GetNumberOfCells();
if(aNbCells){
myControlMode = theMode;
if(theMode == eFreeBorders || theMode == eFreeEdges){
my1DColorMode = e1DHighlited;
switch(myControlMode){
case eFreeEdges:
case eFreeBorders:
my1DExtActor->SetExtControlMode(aFunctor,myControlActor);
} else if (theMode == eLength){
my1DColorMode = e1DColored;
my1DExtActor->SetLength2DControlMode(aFunctor,myControlActor,myScalarBarActor,myLookupTable);
} else{
if(myControlActor == my1DActor)
my1DColorMode = e1DColored;
break;
case eLength2D:
my1DExtActor->SetExtControlMode(aFunctor,myControlActor,myScalarBarActor,myLookupTable);
break;
default:
myControlActor->SetControlMode(aFunctor,myScalarBarActor,myLookupTable);
}
}
@ -993,28 +991,7 @@ void SMESH_ActorDef::SetVisibility(int theMode){
void SMESH_ActorDef::SetVisibility(int theMode, bool theIsUpdateRepersentation){
SALOME_Actor::SetVisibility(theMode);
if(GetVisibility()){
if(theIsUpdateRepersentation)
SetRepresentation(GetRepresentation());
if(myControlMode != eNone){
if(my1DColorMode == e1DHighlited || myControlMode == eLength)
my1DExtActor->VisibilityOn();
else if(myControlActor->GetUnstructuredGrid()->GetNumberOfCells())
myScalarBarActor->VisibilityOn();
}
if(myRepresentation != ePoint)
myPickableActor->VisibilityOn();
my1DActor->VisibilityOn();
my2DActor->VisibilityOn();
my3DActor->VisibilityOn();
if(myIsPointsLabeled) myPointLabels->VisibilityOn();
if(myIsCellsLabeled) myCellsLabels->VisibilityOn();
}else{
myNodeActor->VisibilityOff();
myBaseActor->VisibilityOff();
@ -1027,24 +1004,44 @@ void SMESH_ActorDef::SetVisibility(int theMode, bool theIsUpdateRepersentation){
myScalarBarActor->VisibilityOff();
myPointLabels->VisibilityOff();
myCellsLabels->VisibilityOff();
if(GetVisibility()){
if(theIsUpdateRepersentation)
SetRepresentation(GetRepresentation());
switch(myControlMode){
case eNone:
break;
case eFreeEdges:
case eFreeBorders:
my1DExtActor->VisibilityOn();
break;
case eLength2D:
my1DExtActor->VisibilityOn();
default:
if(myControlActor->GetUnstructuredGrid()->GetNumberOfCells())
myScalarBarActor->VisibilityOn();
}
if(myRepresentation != ePoint)
myPickableActor->VisibilityOn();
if(myEntityMode & eEdges)
my1DActor->VisibilityOn();
if(myEntityMode & eFaces)
my2DActor->VisibilityOn();
if(myEntityMode & eVolumes)
my3DActor->VisibilityOn();
if(myIsPointsLabeled) myPointLabels->VisibilityOn();
if(myIsCellsLabeled) myCellsLabels->VisibilityOn();
}
Modified();
}
namespace{
inline bool UpdateEntityMode(unsigned int& theOutputMode,
unsigned int theInputMode,
unsigned int theMode,
int theCondition)
{
if(!theCondition)
theOutputMode &= ~theMode;
return theOutputMode & theMode && theCondition;
}
}
void SMESH_ActorDef::SetEntityMode(unsigned int theMode){
if(!myVisualObj->GetNbEntities(SMDSAbs_Edge))
@ -1059,24 +1056,9 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode){
if(!theMode)
return;
myScalarBarActor->VisibilityOff();
my1DExtActor->VisibilityOff();
my1DActor->VisibilityOff();
my2DActor->VisibilityOff();
my3DActor->VisibilityOff();
if(theMode & eEdges)
my1DActor->VisibilityOn();
if(theMode & eFaces)
my2DActor->VisibilityOn();
if(theMode & eVolumes)
my3DActor->VisibilityOn();
myEntityMode = theMode;
SetVisibility(GetVisibility(),false);
}
void SMESH_ActorDef::SetRepresentation(int theMode){
@ -1146,22 +1128,19 @@ void SMESH_ActorDef::SetRepresentation(int theMode){
my3DActor->SetRepresentation(aReperesent);
my1DExtActor->SetVisibility(false);
// switch(my1DColorMode){
// case e1DColored:
// aProp = aBackProp = my1DProp;
// if(myRepresentation != ePoint)
// aReperesent = SMESH_DeviceActor::eInsideframe;
// break;
// case e1DHighlited:
// my1DExtActor->SetVisibility(true);
// break;
// }
if (my1DColorMode == e1DColored){
switch(myControlMode){
case eLength:
case eMultiConnection:
aProp = aBackProp = my1DProp;
if(myRepresentation != ePoint)
aReperesent = SMESH_DeviceActor::eInsideframe;
} else if (my1DColorMode == e1DHighlited || myControlMode == eLength){
break;
case eLength2D:
case eFreeEdges:
case eFreeBorders:
my1DExtActor->SetVisibility(true);
break;
}
my1DActor->SetProperty(aProp);

View File

@ -93,7 +93,7 @@ class SMESH_Actor: public SALOME_Actor
virtual void SetCellsLabeled(bool theIsCellsLabeled) = 0;
virtual bool GetCellsLabeled() = 0;
enum eControl{eNone, eLengthEdges, eLength, eFreeBorders, eFreeEdges, eMultiConnection,
enum eControl{eNone, eLength, eLength2D, eFreeBorders, eFreeEdges, eMultiConnection,
eArea, eTaper, eAspectRatio, eMinimumAngle, eWarping, eSkew,
eAspectRatio3D};
virtual void SetControlMode(eControl theMode) = 0;

View File

@ -148,9 +148,6 @@ class SMESH_ActorDef : public SMESH_Actor{
virtual void SetControlMode(eControl theMode);
virtual eControl GetControlMode(){ return myControlMode;}
enum e1DControl{e1DNone, e1DColored, e1DHighlited};
e1DControl Get1DControlMode(){ return my1DColorMode;}
virtual vtkScalarBarActor* GetScalarBarActor(){ return myScalarBarActor;}
virtual void SetPlaneParam(float theDir[3], float theDist, vtkPlane* thePlane);
@ -189,7 +186,6 @@ class SMESH_ActorDef : public SMESH_Actor{
SMESH_DeviceActor* my3DActor;
SMESH_DeviceActor* myControlActor;
e1DControl my1DColorMode;
vtkProperty* my1DProp;
SMESH_DeviceActor* my1DActor;
vtkProperty* my1DExtProp;

View File

@ -24,7 +24,7 @@
// File : SMESH_Actor.cxx
// Author : Nicolas REJNERI
// Module : SMESH
// $Header$Header: /home/server/cvs/SMESH/SMESH_SRC/src/OBJECT/SMESH_DeviceActor.cxx,v 1.5.2.1 2004/12/23 10:31:24 apo Exp $
// $Header$Header$
#include "SMESH_DeviceActor.h"
@ -260,7 +260,7 @@ void SMESH_DeviceActor::SetControlMode(SMESH::Controls::FunctorPtr theFunctor,
theScalarBarActor->SetVisibility(anIsInitialized);
}
void SMESH_DeviceActor::SetLength2DControlMode(SMESH::Controls::FunctorPtr theFunctor,
void SMESH_DeviceActor::SetExtControlMode(SMESH::Controls::FunctorPtr theFunctor,
SMESH_DeviceActor* theDeviceActor,
vtkScalarBarActor* theScalarBarActor,
vtkLookupTable* theLookupTable)

View File

@ -94,7 +94,7 @@ class SMESH_DeviceActor: public vtkLODActor{
void SetControlMode(SMESH::Controls::FunctorPtr theFunctor,
vtkScalarBarActor* theScalarBarActor,
vtkLookupTable* theLookupTable);
void SetLength2DControlMode(SMESH::Controls::FunctorPtr theFunctor,
void SetExtControlMode(SMESH::Controls::FunctorPtr theFunctor,
SMESH_DeviceActor* theDeviceActor,
vtkScalarBarActor* theScalarBarActor,
vtkLookupTable* theLookupTable);

View File

@ -545,11 +545,11 @@ namespace{
switch ( theCommandID ){
case 6001:
aTitle = QObject::tr( "LENGTH_EDGES" );
aControl = SMESH_Actor::eLengthEdges;
aControl = SMESH_Actor::eLength;
break;
case 6018:
aTitle = QObject::tr( "LENGTH2D_EDGES" );
aControl = SMESH_Actor::eLength;
aControl = SMESH_Actor::eLength2D;
break;
case 6002:
aTitle = QObject::tr( "FREE_EDGES" );
@ -2445,9 +2445,9 @@ bool SMESHGUI::CustomPopup(QAD_Desktop* parent, QPopupMenu* popup, const QString
if ( mi && mi->popup() ) {
SMESH_Actor::eControl cMode = anActor->GetControlMode();
switch ( cMode ) {
case SMESH_Actor::eLengthEdges:
mi->popup()->setItemChecked( 6001, true ); break;
case SMESH_Actor::eLength:
mi->popup()->setItemChecked( 6001, true ); break;
case SMESH_Actor::eLength2D:
mi->popup()->setItemChecked( 6018, true ); break;
case SMESH_Actor::eFreeEdges:
mi->popup()->setItemChecked( 6002, true );

View File

@ -1286,6 +1286,7 @@ const QMap<int, QString>& SMESHGUI_FilterTable::getCriteria( const int theType )
static QMap<int, QString> aCriteria;
if ( aCriteria.isEmpty() )
{
aCriteria[ SMESH::FT_AspectRatio3D] = tr( "ASPECT_RATIO_3D" );
aCriteria[ SMESH::FT_RangeOfIds ] = tr( "RANGE_OF_IDS" );
aCriteria[ SMESH::FT_BelongToGeom ] = tr( "BELONG_TO_GEOM" );
}

View File

@ -967,6 +967,9 @@ msgstr "Length"
msgid "SMESHGUI_FilterTable::ASPECT_RATIO"
msgstr "Aspect ratio"
msgid "SMESHGUI_FilterTable::ASPECT_RATIO_3D"
msgstr "Aspect ratio 3D"
msgid "SMESHGUI_FilterTable::WARPING"
msgstr "Warping"