]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
Bug PAL7334
authorapo <apo@opencascade.com>
Mon, 27 Dec 2004 11:58:51 +0000 (11:58 +0000)
committerapo <apo@opencascade.com>
Mon, 27 Dec 2004 11:58:51 +0000 (11:58 +0000)
  DEVELOPMENT : Control Improvement

src/OBJECT/SMESH_Actor.cxx
src/OBJECT/SMESH_Actor.h
src/OBJECT/SMESH_ActorDef.h
src/OBJECT/SMESH_DeviceActor.cxx
src/OBJECT/SMESH_DeviceActor.h
src/SMESHGUI/SMESHGUI.cxx
src/SMESHGUI/SMESHGUI_FilterDlg.cxx
src/SMESHGUI/SMESH_msg_en.po

index 7f52d9b3f416084484fd53efc1f81569d14cbee7..f29273b4c9ed2b3ae031d8041e37f3e3344c58a1 100644 (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,58 +991,57 @@ void SMESH_ActorDef::SetVisibility(int theMode){
 
 void SMESH_ActorDef::SetVisibility(int theMode, bool theIsUpdateRepersentation){
   SALOME_Actor::SetVisibility(theMode);
+
+  myNodeActor->VisibilityOff();
+  myBaseActor->VisibilityOff();
+  
+  my1DActor->VisibilityOff();
+  my1DExtActor->VisibilityOff();
+  
+  my2DActor->VisibilityOff();
+  my3DActor->VisibilityOff();
+  
+  myScalarBarActor->VisibilityOff();
+  myPointLabels->VisibilityOff();
+  myCellsLabels->VisibilityOff();
+  
   if(GetVisibility()){
     if(theIsUpdateRepersentation)
       SetRepresentation(GetRepresentation());
 
-    if(myControlMode != eNone){
-      if(my1DColorMode == e1DHighlited || myControlMode == eLength)
-       my1DExtActor->VisibilityOn();
-      else if(myControlActor->GetUnstructuredGrid()->GetNumberOfCells())
+    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();
 
-    my1DActor->VisibilityOn();
-
-    my2DActor->VisibilityOn();
-    my3DActor->VisibilityOn();
-
+    if(myEntityMode & eEdges)
+      my1DActor->VisibilityOn();
+    
+    if(myEntityMode & eFaces)
+      my2DActor->VisibilityOn();
+    
+    if(myEntityMode & eVolumes)
+      my3DActor->VisibilityOn();
+    
     if(myIsPointsLabeled) myPointLabels->VisibilityOn();
     if(myIsCellsLabeled) myCellsLabels->VisibilityOn();
-  }else{
-    myNodeActor->VisibilityOff();
-    myBaseActor->VisibilityOff();
-
-    my1DActor->VisibilityOff();
-    my1DExtActor->VisibilityOff();
-
-    my2DActor->VisibilityOff();
-    my3DActor->VisibilityOff();
-
-    myScalarBarActor->VisibilityOff();
-    myPointLabels->VisibilityOff();
-    myCellsLabels->VisibilityOff();
   }
+
   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);
index 9ff83836661632a76997f6bddc684ff16c9aea87..cb49219174ec4a39cc80b0a1a544d6d6a5b8dd81 100644 (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;
index 4a9577aa2ec1663d0f700830c05ffde07fea8bbe..943fc5ee542ae5875c90f1f6d7bb3103f2b6b275 100644 (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;
index 7713b03017fe09c6e5f69766fa1e9ca10d8c7db3..9670ad3d03ac33c6965c03659c74dc0b1ae65fa8 100644 (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,10 +260,10 @@ void SMESH_DeviceActor::SetControlMode(SMESH::Controls::FunctorPtr theFunctor,
   theScalarBarActor->SetVisibility(anIsInitialized);
 }
 
-void SMESH_DeviceActor::SetLength2DControlMode(SMESH::Controls::FunctorPtr theFunctor,
-                                              SMESH_DeviceActor* theDeviceActor,
-                                              vtkScalarBarActor* theScalarBarActor,
-                                              vtkLookupTable* theLookupTable)
+void SMESH_DeviceActor::SetExtControlMode(SMESH::Controls::FunctorPtr theFunctor,
+                                         SMESH_DeviceActor* theDeviceActor,
+                                         vtkScalarBarActor* theScalarBarActor,
+                                         vtkLookupTable* theLookupTable)
 {
   bool anIsInitialized = theFunctor;
 
index 87930f91c72c1d3bd77573d61ff30e57598bfb17..90cd7894355db897a2153ce9d93d5b754c88e36f 100644 (file)
@@ -94,10 +94,10 @@ class SMESH_DeviceActor: public vtkLODActor{
   void SetControlMode(SMESH::Controls::FunctorPtr theFunctor,
                      vtkScalarBarActor* theScalarBarActor,
                      vtkLookupTable* theLookupTable);
-  void SetLength2DControlMode(SMESH::Controls::FunctorPtr theFunctor,
-                             SMESH_DeviceActor* theDeviceActor,
-                             vtkScalarBarActor* theScalarBarActor,
-                             vtkLookupTable* theLookupTable);
+  void SetExtControlMode(SMESH::Controls::FunctorPtr theFunctor,
+                        SMESH_DeviceActor* theDeviceActor,
+                        vtkScalarBarActor* theScalarBarActor,
+                        vtkLookupTable* theLookupTable);
   void SetExtControlMode(SMESH::Controls::FunctorPtr theFunctor,
                         SMESH_DeviceActor* theDeviceActor);
 
index e6272506555f39a3ac8897eaadd0ca3674ee1058..f407960d426c31f0ba759796162ed5b3ab0e2530 100644 (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 );
index 34c43884008451d73e89e8b0dd85217f675e5a65..fff798a30ce0c5b4ad66094ef62586937a76db4a 100755 (executable)
@@ -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" );
     }
index f608db365e9e67cb1a7786b495c682285ae838e5..a84e68a07a2ef4db21b79f7a844a8d1e888352c7 100644 (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"