]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
debug of profileOp
authorisn <isn@opencascade.com>
Tue, 14 Nov 2017 13:55:04 +0000 (16:55 +0300)
committerisn <isn@opencascade.com>
Tue, 14 Nov 2017 13:55:04 +0000 (16:55 +0300)
src/HYDROGUI/HYDROGUI_ProfileDlg.cxx
src/HYDROGUI/HYDROGUI_ProfileDlg.h
src/HYDROGUI/HYDROGUI_ProfileOp.cxx
src/HYDROGUI/HYDROGUI_ProfileOp.h
src/HYDROGUI/resources/HYDROGUI_msg_en.ts

index 239645b4c00491401ca5db19036c2cd8835e68d4..c6c49c1c682b4101a07831af174d1efbc134bb1f 100644 (file)
 const QString splitter_key = "HYDROGUI_ProfileDlg::splitter";
 
 HYDROGUI_ProfileDlg::HYDROGUI_ProfileDlg( HYDROGUI_Module* theModule, const QString& theTitle, 
-  bool theSingleProfileMode )
+  bool theIsEdit )
 : HYDROGUI_ViewerDlg( theModule, theTitle, true ),
   myName( NULL ), myProfileNames (NULL), myProfilesPointer (NULL),
-  mySingleProfileMode (theSingleProfileMode)
+  myIsEdit (theIsEdit)
 {
   QFrame* name_frame = new QFrame( mainFrame() );
   QHBoxLayout* name_layout = new QHBoxLayout( name_frame );
   name_layout->setMargin( 0 );
   QLabel* aNameLabel = new QLabel(tr("PROFILE_NAME_TLT"), this);
   name_layout->addWidget(aNameLabel);
-  if (theSingleProfileMode)
+  if (!theIsEdit)
   {
     myName = new QLineEdit(this);
     name_layout->addWidget(myName);
@@ -76,10 +76,7 @@ HYDROGUI_ProfileDlg::HYDROGUI_ProfileDlg( HYDROGUI_Module* theModule, const QStr
   {
     myProfileNames = new QListWidget(this);
     myProfileNames->setSelectionMode(QAbstractItemView::SingleSelection);
-    //myProfileNames->setEditable(true);
-    //myProfileNames->setInsertPolicy(QComboBox::InsertPolicy::NoInsert);
     name_layout->addWidget(myProfileNames);
-    //
     myAddProfBtn = new QPushButton(tr("ADD_PROFILES"), this);    
     myRemProfBtn = new QPushButton(tr("REMOVE_PROFILE"), this);
     name_layout->addWidget(myAddProfBtn);
@@ -108,7 +105,7 @@ HYDROGUI_ProfileDlg::HYDROGUI_ProfileDlg( HYDROGUI_Module* theModule, const QStr
   connect( myEditorWidget, SIGNAL( selectionChanged() ), this, SIGNAL( selectionChanged() ) );
   connect( myEditorWidget, SIGNAL( subOperationStarted(QWidget*, bool) ), this, SLOT( processStartedSubOperation(QWidget*, bool) ) );
   connect( myEditorWidget, SIGNAL( subOperationFinished(QWidget*) ), this, SLOT( processFinishedSubOperation(QWidget*) ) );
-  if (!mySingleProfileMode)
+  if (myIsEdit)
   {
     connect( myProfileNames, SIGNAL( currentTextChanged(QString)), SLOT(ProfileNameChanged(QString)) );
     connect( myProfileNames, SIGNAL( itemSelectionChanged()), this, SLOT( onProfileIndexChanged()));
@@ -151,11 +148,9 @@ void HYDROGUI_ProfileDlg::reset()
 
 void HYDROGUI_ProfileDlg::setProfileName( const QString& theName )
 {
-  if (!mySingleProfileMode)
+  if (myIsEdit)
     return;
   myName->setText(theName);
-  //myProfileNames->setItemText(theInd, theName); //should used TODO check this
-  //myName->setText(theName);
 }
 
 void HYDROGUI_ProfileDlg::eraseProfile( int index )
@@ -167,7 +162,7 @@ void HYDROGUI_ProfileDlg::eraseProfile( int index )
 
 void HYDROGUI_ProfileDlg::addProfileName( const QString& theName, const QColor& theColor )
 {
-  if (mySingleProfileMode)
+  if (!myIsEdit)
     return;
   myProfileNames->blockSignals(true);
   myProfileNames->addItem(theName);
@@ -178,18 +173,20 @@ void HYDROGUI_ProfileDlg::addProfileName( const QString& theName, const QColor&
   SPixmap.fill(theColor);
   QIcon SIcon(SPixmap);
   anItem->setIcon( SIcon );
-  //anItem->setBackground(QBrush(theColor));
   if (count == 1)
     anItem->setSelected(true);
+  if (count == 1 && myIsEdit)
+    myRemProfBtn->setEnabled(false);
   if (count > 1)
     myRemProfBtn->setEnabled(true);
+
   myProfileNames->blockSignals(false);
 }
 
 QStringList HYDROGUI_ProfileDlg::getProfileNames() const
 {
   QStringList aProfNames;
-  if (mySingleProfileMode)
+  if (!myIsEdit)
     aProfNames << myName->text();
   else
     for (int i = 0; i < myProfileNames->count(); i++)
@@ -360,7 +357,7 @@ void HYDROGUI_ProfileDlg::onProfileNameChanged(QListWidgetItem* item)
     myProfileNames->blockSignals(false);
   }
 }
-
+/*
 void HYDROGUI_ProfileDlg::SetSingleProfileMode(bool SingleMode)
 {
   mySingleProfileMode = SingleMode;
@@ -369,7 +366,7 @@ void HYDROGUI_ProfileDlg::SetSingleProfileMode(bool SingleMode)
 bool HYDROGUI_ProfileDlg::GetSingleProfileMode() const
 {
   return mySingleProfileMode;
-}
+}*/
 
 Handle(AIS_Trihedron) HYDROGUI_ProfileDlg::trihedron()
 {
index 36ad245df441cbd3e2f71be12ad8099196a19565..91f06f88a992df55abb416b54137c246682c482a 100644 (file)
@@ -52,8 +52,8 @@ public:
   void  setProfile( CurveCreator_ICurve* theProfile );
   void  setProfilesPointer(std::vector<HYDROGUI_CurveCreatorProfile*>* theProfilesPointer);
   void  switchToFirstProfile();
-  void  SetSingleProfileMode(bool SingleMode);
-  bool  GetSingleProfileMode() const;
+  //void  SetSingleProfileMode(bool SingleMode);
+  //bool  GetSingleProfileMode() const;
   void  SwitchToProfile(int theIndex);
   void  BlockProfileNameSignals(bool state);
   int   GetProfileSelectionIndex();
@@ -83,7 +83,6 @@ signals:
   void                  AddProfiles();
   void                  RemoveProfile(int);
 
-
 protected:
   virtual Handle(AIS_Trihedron) trihedron();
 
@@ -92,11 +91,12 @@ private:
   QListWidget*           myProfileNames;
   QPushButton*           myAddProfBtn;
   QPushButton*           myRemProfBtn; 
-public://temp TODO
+public:
   CurveCreator_Widget*   myEditorWidget;
   QGroupBox*             myAddElementBox;
   std::vector<HYDROGUI_CurveCreatorProfile*>* myProfilesPointer;
-  bool                   mySingleProfileMode;
+private:
+  bool                   myIsEdit;
   QString                myCurrentName;
 };
 
index fc470e6bf94d1dafcdb1206173cd5359863d7bbf..a7ae37ffb0e6844fe49b7f21c24e654074d6784c 100644 (file)
@@ -128,7 +128,7 @@ static int CurveCrProfileToHProfile(const HYDROGUI_CurveCreatorProfile* outProfi
 
 HYDROGUI_ProfileOp::HYDROGUI_ProfileOp( HYDROGUI_Module* theModule, bool theIsEdit )
 : HYDROGUI_Operation( theModule ), myIsEdit(theIsEdit), 
-   myDisplayer (NULL), mySingleProfileMode (false)
+   myDisplayer (NULL)
 {
   setName( theIsEdit ? tr( "EDIT_PROFILE" ) : tr( "CREATE_PROFILE" ) );
 }
@@ -183,7 +183,7 @@ void HYDROGUI_ProfileOp::startOperation()
   for (int i = 0; i < myProfiles.size(); i++)
     myProfiles[i] = new HYDROGUI_CurveCreatorProfile();
 
-  mySingleProfileMode = myEditedObjects.IsEmpty() || lenP == 1;  
+  //mySingleProfileMode = myEditedObjects.IsEmpty();  
   HYDROGUI_Operation::startOperation();
 
   HYDROGUI_ProfileDlg* aPanel = (HYDROGUI_ProfileDlg*)inputPanel();
@@ -192,7 +192,7 @@ void HYDROGUI_ProfileOp::startOperation()
   setPreviewManager( aPanel->viewManager() );
   setCursor();
 
-  aPanel->SetSingleProfileMode(mySingleProfileMode); 
+  //aPanel->SetSingleProfileMode(mySingleProfileMode); 
   QMap<HYDROGUI_CurveCreatorProfile*, QColor> CurveToColor;
   if( lenP )
   {
@@ -214,7 +214,7 @@ void HYDROGUI_ProfileOp::startOperation()
     }
     int ext = myCurveToProfile.Extent(); //ext should be equal to lenP
     QVector<QColor> PColors;
-    if (!mySingleProfileMode)
+    if (myIsEdit)
       HYDROData_Tool::GenerateRepeatableRandColors(ext, PColors);
     else
       PColors << QColor(0,0,255); //default color
@@ -227,7 +227,7 @@ void HYDROGUI_ProfileOp::startOperation()
       CurveToColor[CC] = CurCol;
       const QString& profName = CP->GetName();
       const QColor& PColor = CurCol;
-      if (!mySingleProfileMode)
+      if (myIsEdit)
         aPanel->addProfileName(profName, PColor);
       else
         aPanel->setProfileName(profName);
@@ -317,7 +317,7 @@ void HYDROGUI_ProfileOp::onAddProfiles()
       CurveToColor[CC] = CurCol;
       const QString& profName = CP->GetName();
       const QColor& PColor = CurCol;
-      if (!mySingleProfileMode)
+      if (myIsEdit)
         aPanel->addProfileName(profName, PColor);
       else
         aPanel->setProfileName(profName);
@@ -344,7 +344,7 @@ void HYDROGUI_ProfileOp::commitOperation()
 
 HYDROGUI_InputPanel* HYDROGUI_ProfileOp::createInputPanel() const
 {
-  HYDROGUI_ProfileDlg* aDlg = new HYDROGUI_ProfileDlg( module(), getName(), mySingleProfileMode );
+  HYDROGUI_ProfileDlg* aDlg = new HYDROGUI_ProfileDlg( module(), getName(), myIsEdit );
   connect( aDlg, SIGNAL( AddProfiles() ), this, 
     SLOT( onAddProfiles() ) );
   connect( aDlg, SIGNAL( RemoveProfile(int) ), this, 
index ecdfbf13d89805ba9a55482f70612d40e91dffda..a74472d374b8ba09d4481e78017400744028afdc 100644 (file)
@@ -67,7 +67,7 @@ protected slots:
 
 private:
   bool                        myIsEdit;
-  bool                        mySingleProfileMode;
+  //bool                        mySingleProfileMode;
   HYDROData_SequenceOfObjects myEditedObjects;
   std::vector<HYDROGUI_CurveCreatorProfile*> myProfiles;
   CurveCreator_Displayer*                    myDisplayer;
index da5bed2d56873b32500372b911ec6bcba8e7ae02..7af82b32984d8c89a0a0fa5da68986e04cf52562 100644 (file)
@@ -284,7 +284,7 @@ All supported formats (*.brep *.iges *.igs *.step *.stp)</translation>
     </message>
     <message>
       <source>PREF_VIEWER_ZOOM_SHUTOFF</source>
-      <translation>Turn on the conservation of zoom (zoom shutoff) when when front/top/left/etc called</translation>
+      <translation>Conservation of zoom when top-view/etc is activated</translation>
     </message>
     <message>
       <source>PREF_GROUP_STRICKLER_TABLE</source>