Salome HOME
0020082: EDF 869 GEOM : Edges Orientation indicator/reverse
authordmv <dmv@opencascade.com>
Wed, 8 Jul 2009 10:34:09 +0000 (10:34 +0000)
committerdmv <dmv@opencascade.com>
Wed, 8 Jul 2009 10:34:09 +0000 (10:34 +0000)
35 files changed:
doc/salome/gui/SMESH/images/a-arithmetic1d.png
doc/salome/gui/SMESH/images/a-nbsegments1.png
doc/salome/gui/SMESH/images/a-nbsegments2.png
doc/salome/gui/SMESH/images/a-startendlength.png
doc/salome/gui/SMESH/images/distributionwithanalyticdensity.png
doc/salome/gui/SMESH/images/distributionwithtabledensity.png
doc/salome/gui/SMESH/input/1d_meshing_hypo.doc
idl/SMESH_BasicHypothesis.idl
src/OBJECT/Makefile.am
src/OBJECT/SMESH_PreviewActorsCollection.cxx [new file with mode: 0644]
src/OBJECT/SMESH_PreviewActorsCollection.h [new file with mode: 0644]
src/SMESHGUI/SMESHGUI_Hypotheses.cxx
src/SMESHGUI/SMESHGUI_Hypotheses.h
src/SMESHGUI/SMESHGUI_MeshOp.cxx
src/StdMeshers/StdMeshers_Arithmetic1D.cxx
src/StdMeshers/StdMeshers_Arithmetic1D.hxx
src/StdMeshers/StdMeshers_NumberOfSegments.cxx
src/StdMeshers/StdMeshers_NumberOfSegments.hxx
src/StdMeshers/StdMeshers_Regular_1D.cxx
src/StdMeshers/StdMeshers_Regular_1D.hxx
src/StdMeshers/StdMeshers_StartEndLength.cxx
src/StdMeshers/StdMeshers_StartEndLength.hxx
src/StdMeshersGUI/Makefile.am
src/StdMeshersGUI/StdMeshersGUI_EdgeDirectionParamWdg.cxx [new file with mode: 0644]
src/StdMeshersGUI/StdMeshersGUI_EdgeDirectionParamWdg.h [new file with mode: 0644]
src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx
src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.h
src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx
src/StdMeshersGUI/StdMeshers_msg_en.ts
src/StdMeshers_I/StdMeshers_Arithmetic1D_i.cxx
src/StdMeshers_I/StdMeshers_Arithmetic1D_i.hxx
src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx
src/StdMeshers_I/StdMeshers_NumberOfSegments_i.hxx
src/StdMeshers_I/StdMeshers_StartEndLength_i.cxx
src/StdMeshers_I/StdMeshers_StartEndLength_i.hxx

index d34a5e24cf55507697450e297255e8c99a9c6698..aa43beb5fba8e483c67be55bbec8e90627d6fcd5 100755 (executable)
Binary files a/doc/salome/gui/SMESH/images/a-arithmetic1d.png and b/doc/salome/gui/SMESH/images/a-arithmetic1d.png differ
index 27668505c45da70a23f6f807219bac4ec45b0acd..0cd778fc43dea4d6f45b809c0fa0a550aa319919 100755 (executable)
Binary files a/doc/salome/gui/SMESH/images/a-nbsegments1.png and b/doc/salome/gui/SMESH/images/a-nbsegments1.png differ
index 8d4f277d98363844aa5a7d7e8f2f211694ab3753..2a7c9fcaaf93bd47eb44db2cce667775015f5769 100755 (executable)
Binary files a/doc/salome/gui/SMESH/images/a-nbsegments2.png and b/doc/salome/gui/SMESH/images/a-nbsegments2.png differ
index 947567d7f8d9172ab6aa8bc73ead4e13fb112f4b..ba29d91dffc017315911b93648a0da8c61e58dd7 100755 (executable)
Binary files a/doc/salome/gui/SMESH/images/a-startendlength.png and b/doc/salome/gui/SMESH/images/a-startendlength.png differ
index 7dea248c62f0f07df95e5cc39a1f4186b7f5fd68..83c086b438f0f500646e431a10f0fb4898fe0842 100755 (executable)
Binary files a/doc/salome/gui/SMESH/images/distributionwithanalyticdensity.png and b/doc/salome/gui/SMESH/images/distributionwithanalyticdensity.png differ
index 3bd40bc458fa3f23233ee829ee152edadb3e1a7b..60847cde5ffe148afd4d31f4ac30c4125a6d3aa6 100755 (executable)
Binary files a/doc/salome/gui/SMESH/images/distributionwithtabledensity.png and b/doc/salome/gui/SMESH/images/distributionwithtabledensity.png differ
index 7053546924bfff0525b9728b2dd3ffe029b4a75a..38c0055df41090a429ccbee77ba79966cf8b7e98 100644 (file)
 length that changes in arithmetic progression (Lk = Lk-1 + d)
 beginning from a given starting length and up to a given end length.
 
+The direction of the splitting is defined by the orientation of the underlying geometrical edge. 
+<b>"Reverse Edges"</b> list box allows to specify the edges for which the splitting should be made 
+in the direction opposing to their orientation. This list box is enabled only if the geometry object 
+is selected for the meshing. In this case the user can select edges to be reversed either directly 
+picking them in the 3D viewer or by selecting the edges or groups of edges in the Object browser.
+
 \image html a-arithmetic1d.png
 
 \image html b-ithmetic1d.png "Arithmetic 1D hypothesis - the size of mesh elements gradually increases"
@@ -106,6 +112,12 @@ edges generated by these segments will represent nodes of your
 mesh. Later these nodes will be used for meshing of the faces abutting
 to these edges.
 
+The direction of the splitting is defined by the orientation of the underlying geometrical edge. 
+<b>"Reverse Edges"</b> list box allows to specify the edges for which the splitting should be made 
+in the direction opposing to their orientation. This list box is enabled only if the geometry object 
+is selected for the meshing. In this case the user can select edges to be reversed either directly 
+picking them in the 3D viewer or by selecting the edges or groups of edges in the Object browser.
+
 \image html image46.gif
 
 You can set the type of distribution for this hypothesis in the
@@ -149,6 +161,12 @@ geometric progression. Then mesh nodes are
 constructed at segment ends location and 1D mesh elements are
 constructed on them.
 
+The direction of the splitting is defined by the orientation of the underlying geometrical edge. 
+<b>"Reverse Edges"</b> list box allows to specify the edges for which the splitting should be made 
+in the direction opposing to their orientation. This list box is enabled only if the geometry object 
+is selected for the meshing. In this case the user can select edges to be reversed either directly 
+picking them in the 3D viewer or by selecting the edges or groups of edges in the Object browser.
+
 \image html a-startendlength.png
 
 \image html b-art_end_length.png "The lengths of the first and the last segment are strictly defined"
index 9c428ba145934922c7e2515b42cd2846d847fbb8..db057f860934b539a89ba5ca17c6a9277d97d9dc 100644 (file)
@@ -29,7 +29,6 @@
 #include "SMESH_Hypothesis.idl"
 #include "SMESH_Mesh.idl"
 
-
 /*!
  * StdMeshers: interfaces to standard hypotheses and algorithms
  */
@@ -209,6 +208,26 @@ module StdMeshers
      */
     long ConversionMode()
       raises (SALOME::SALOME_Exception);
+
+    /*!
+     * Set list of edges to reverse
+     */
+    void SetReversedEdges( in SMESH::long_array list );
+    
+    /*!
+     * Returns list of edges to reverse
+     */
+    SMESH::long_array GetReversedEdges();
+    
+    /*!
+     * Set entry of the main object
+     */
+    void SetObjectEntry( in string entry );
+    
+    /*!
+     * Get the entry of the main object
+     */
+    string GetObjectEntry();
   };
 
   /*!
@@ -226,6 +245,26 @@ module StdMeshers
      * Returns <start segment length> or <end segment length> parameter value
      */
     double GetLength(in boolean isStartLength);
+    
+    /*!
+     * Set list of edges to reverse
+     */
+    void SetReversedEdges( in SMESH::long_array list );
+    
+    /*!
+     * Returns list of edges to reverse
+     */
+    SMESH::long_array GetReversedEdges();
+    
+    /*!
+     * Set entry of the main object
+     */
+    void SetObjectEntry( in string entry );
+    
+    /*!
+     * Get the entry of the main object
+     */
+    string GetObjectEntry();
   };
 
   /*!
@@ -277,6 +316,26 @@ module StdMeshers
      * Returns <start segment length> or <end segment length> parameter value
      */
     double GetLength(in boolean isStartLength);
+
+    /*!
+     * Set list of edges to reverse
+     */
+    void SetReversedEdges( in SMESH::long_array list );
+    
+    /*!
+     * Returns list of edges to reverse
+     */
+    SMESH::long_array GetReversedEdges();
+    
+    /*!
+     * Set entry of the main object
+     */
+    void SetObjectEntry( in string entry );
+    
+    /*!
+     * Get the entry of the main object
+     */
+    string GetObjectEntry();
   };
 
 
index bd233661a84bf813d3273bb3500d0078a16541eb..8ef36754fc6d1723b19109fc10f9037c7d216db5 100644 (file)
@@ -34,6 +34,7 @@ salomeinclude_HEADERS = \
        SMESH_ActorUtils.h \
        SMESH_ActorDef.h \
        SMESH_DeviceActor.h \
+       SMESH_PreviewActorsCollection.h \
        SMESH_ExtractGeometry.h \
        SMESH_ActorUtils.h \
        SMESH_FaceOrientationFilter.h
@@ -45,11 +46,13 @@ dist_libSMESHObject_la_SOURCES = \
        SMESH_Object.cxx \
        SMESH_DeviceActor.cxx \
        SMESH_Actor.cxx \
+       SMESH_PreviewActorsCollection.cxx \
        SMESH_ExtractGeometry.cxx \
        SMESH_ActorUtils.cxx \
        SMESH_FaceOrientationFilter.cxx
 
 libSMESHObject_la_CPPFLAGS = \
+        $(QT_INCLUDES) \
         $(KERNEL_CXXFLAGS) \
         $(GUI_CXXFLAGS) \
        $(MED_CXXFLAGS) \
diff --git a/src/OBJECT/SMESH_PreviewActorsCollection.cxx b/src/OBJECT/SMESH_PreviewActorsCollection.cxx
new file mode 100644 (file)
index 0000000..59238dc
--- /dev/null
@@ -0,0 +1,206 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SMESH OBJECT : interactive object for SMESH visualization
+//  File   : SMESH_PreviewActorsCollection.cxx
+//  Author : 
+//  Module : SMESH
+//
+
+#include "SMESH_PreviewActorsCollection.h"
+
+#include "utilities.h"
+
+#include "SALOME_InteractiveObject.hxx"
+
+// OCC includes
+#include <TopoDS.hxx>
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
+
+// VTK includes
+#include <vtkUnstructuredGrid.h>
+#include <vtkScalarBarActor.h>
+#include <vtkPlane.h>
+#include <vtkRenderer.h>
+#include <vtkProperty.h>
+
+#include "VTKViewer_Actor.h"
+
+#include "SVTK_DeviceActor.h"
+#include "SALOME_Actor.h"
+
+// QT
+#include <QString>
+#include <QColor>
+
+#ifdef _DEBUG_
+static int MYDEBUG = 0;
+#else
+static int MYDEBUG = 0;
+#endif
+
+using namespace std;
+
+
+//vtkStandardNewMacro(SMESH_PreviewActorsCollection);
+
+
+SMESH_PreviewActorsCollection
+::SMESH_PreviewActorsCollection()
+{
+  if(MYDEBUG) MESSAGE("SMESH_PreviewActorsCollection - "<<this);
+}
+
+
+SMESH_PreviewActorsCollection
+::~SMESH_PreviewActorsCollection()
+{
+  if(MYDEBUG) MESSAGE("~SMESH_PreviewActorsCollection - "<<this);
+  if (myRenderer)
+    RemoveFromRender(myRenderer);
+
+  myMapOfActors.clear();
+}
+
+bool SMESH_PreviewActorsCollection::Init( const TopoDS_Shape& theShape, TopAbs_ShapeEnum theType, const QString& theEntry )
+{
+  myMainShape = theShape;
+  myMapOfActors.clear();
+  myMapOfShapes.Clear();
+
+  if ( theShape.IsNull() )
+    return false;
+
+  Handle( SALOME_InteractiveObject ) anIO = new SALOME_InteractiveObject();
+  anIO->setEntry( theEntry.toLatin1().constData() );
+  
+  // get indexes of seleted elements
+  TopExp::MapShapes(theShape, myMapOfShapes);
+
+  TopExp_Explorer exp( theShape, theType );
+  for ( ; exp.More(); exp.Next() ) {
+    int index = myMapOfShapes.FindIndex( exp.Current() );
+    if ( index ) { 
+      // create actor if the index is present
+      if ( GEOM_Actor* anActor = createActor( exp.Current() )) {
+       // Create new entry for actor
+       QString aString = theEntry;
+       aString += QString("_%1").arg( index ); // add index to actor entry
+
+       // Create interactive object
+       Handle( SALOME_InteractiveObject ) anIO = new SALOME_InteractiveObject();
+       anIO->setEntry( aString.toLatin1().constData() );
+
+       // Init Actor
+       anActor->SetVectorMode( true );
+       anActor->setIO( anIO );
+       anActor->SetSelector( mySelector );
+       anActor->SetPickable( true );
+       anActor->SetResolveCoincidentTopology( true );
+
+       // Add Actor to the Actors Map
+       myMapOfActors.insert(index, anActor);
+      }
+    }
+  }
+  mySelector->ClearIObjects();
+
+  return true;
+}
+
+GEOM_Actor* SMESH_PreviewActorsCollection::createActor(const TopoDS_Shape& shape)
+{
+  GEOM_Actor* actor = GEOM_Actor::New();
+  actor->SetShape(shape,0,0);
+
+  //Color Properties
+  /*   
+       vtkProperty* aProp = vtkProperty::New();
+       vtkProperty* aHLProp = vtkProperty::New();
+       vtkProperty* aPHLProp = vtkProperty::New();
+       
+       aProp->SetColor( 255, 0, 0);
+       actor->SetProperty(aProp);
+
+       aHLProp->SetColor( 255, 255, 255);
+       actor->SetHighlightProperty(aHLProp);
+
+       aPHLProp->SetColor( 155, 155, 155);
+       aPHLProp->SetLineWidth ( 3 );
+       aPHLProp->SetOpacity ( 0.75 );
+       actor->SetPreHighlightProperty(aPHLProp);
+
+       aProp->Delete();
+       aHLProp->Delete();
+       aPHLProp->Delete();
+  */
+
+  return actor;
+}
+
+GEOM_Actor* SMESH_PreviewActorsCollection::GetActorByIndex(int index)
+{
+  return myMapOfActors.value(index);
+}
+
+int SMESH_PreviewActorsCollection::GetIndexByShape( const TopoDS_Shape& theShape )
+{
+  return myMapOfShapes.FindIndex( theShape );
+}
+
+void SMESH_PreviewActorsCollection::AddToRender(vtkRenderer* theRenderer)
+{
+  myRenderer = theRenderer;
+
+  QMap<int, GEOM_Actor*>::iterator iter = myMapOfActors.begin();
+  for ( ; iter != myMapOfActors.end(); ++iter )
+    iter.value()->AddToRender( theRenderer );
+}
+
+void SMESH_PreviewActorsCollection::RemoveFromRender(vtkRenderer* theRenderer){
+  QMap<int, GEOM_Actor*>::iterator iter = myMapOfActors.begin();
+  for ( ; iter != myMapOfActors.end(); ++iter )
+    iter.value()->RemoveFromRender( theRenderer );
+}
+
+void SMESH_PreviewActorsCollection::SetSelector(SVTK_Selector* theSelector)
+{
+  mySelector = theSelector;
+}
+
+void SMESH_PreviewActorsCollection::HighlightAll( bool theHighlight ){
+  QMap<int, GEOM_Actor*>::iterator iter = myMapOfActors.begin();
+  for ( ; iter != myMapOfActors.end(); ++iter )
+    iter.value()->Highlight( theHighlight );
+}
+
+void SMESH_PreviewActorsCollection::HighlightID( int index ){
+  GEOM_Actor* anActor = GetActorByIndex( index );
+  if ( anActor && !anActor->isHighlighted() )
+    anActor->Highlight( true );
+}
+
+void SMESH_PreviewActorsCollection::SetShown( bool shown ){
+  QMap<int, GEOM_Actor*>::iterator iter = myMapOfActors.begin();
+  for ( ; iter != myMapOfActors.end(); ++iter )
+    iter.value()->SetVisibility( shown );
+}
diff --git a/src/OBJECT/SMESH_PreviewActorsCollection.h b/src/OBJECT/SMESH_PreviewActorsCollection.h
new file mode 100644 (file)
index 0000000..857570a
--- /dev/null
@@ -0,0 +1,78 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  SMESH OBJECT : interactive object for SMESH visualization
+//  File   : SMESH_PreviewActorsCollection.h
+//  Author : OCN
+//  Module : SMESH
+//  $Header: /home/server/cvs/SMESH/SMESH_SRC/src/OBJECT/SMESH_PreviewActorsCollection.h,v 1
+//
+#ifndef SMESH_PREVIEW_ACTOR_COLLECTION_H
+#define SMESH_PREVIEW_ACTOR_COLLECTION_H
+
+#include <SMESH_Actor.h>
+#include <GEOM_Actor.h>
+#include "SMESH_Object.h"
+#include <TopoDS_Shape.hxx>
+#include <SMDS_SetIterator.hxx>
+#include <TopAbs_ShapeEnum.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
+#include <QString>
+#include <QMap>
+
+class vtkRenderer;
+class GEOM_Actor;
+
+class SMESHOBJECT_EXPORT SMESH_PreviewActorsCollection
+{
+ public:
+  SMESH_PreviewActorsCollection();
+  ~SMESH_PreviewActorsCollection();
+
+  virtual void    AddToRender(vtkRenderer* theRenderer);
+  virtual void    RemoveFromRender(vtkRenderer* theRenderer);
+
+  bool            Init( const TopoDS_Shape& theShape, TopAbs_ShapeEnum subShapeType = TopAbs_EDGE, const QString& = QString("") );
+
+  void            SetSelector( SVTK_Selector* );
+
+  void            HighlightAll( bool );
+  void            HighlightID( int );
+
+  GEOM_Actor*     GetActorByIndex( int );
+
+  int             GetIndexByShape( const TopoDS_Shape& );
+
+  void            SetShown( bool );
+
+ protected:
+   GEOM_Actor*    createActor( const TopoDS_Shape& );
+
+ protected:
+  TopoDS_Shape                 myMainShape;
+  SVTK_Selector*               mySelector;
+  vtkRenderer*                 myRenderer;
+  TopTools_IndexedMapOfShape   myMapOfShapes;
+  QMap<int, GEOM_Actor*>       myMapOfActors;
+};
+
+
+#endif //SMESH_DEVICE_ACTOR_COLLECTION_H
index e636ea8d6d7fe7cbc08d31cc82caff9ffa13a172..3e3c6338fdf0e5c19ce0f9acf178525eb7b1ac46 100644 (file)
@@ -159,6 +159,7 @@ bool SMESHGUI_GenericHypothesisCreator::editHypothesis( SMESH::SMESH_Hypothesis_
     Dlg->setType( type() );
     retrieveParams();
     Dlg->show();
+    Dlg->resize( Dlg->minimumSizeHint() );
     if ( !myEventLoop )
       myEventLoop = new QEventLoop( this );
     myEventLoop->exec(); // make myDlg not modal
@@ -383,6 +384,11 @@ SMESH::SMESH_Hypothesis_var SMESHGUI_GenericHypothesisCreator::hypothesis() cons
   return myHypo;
 }
 
+void SMESHGUI_GenericHypothesisCreator::setShapeEntry( const QString& theEntry )
+{
+  myShapeEntry = theEntry;
+}
+
 //================================================================================
 /*!
  * \brief Return hypothesis containing initial parameters
index 6cf6c524dcd9e78bd7aff30f014367703606ea5a..f4db07a2ed5e55d305ed73518deaf410d45d6f27 100644 (file)
@@ -64,6 +64,9 @@ public:
   QString                      hypType() const;
   QString                      hypName() const;
   bool                         isCreation() const;
+  
+  QString                      getShapeEntry() const { return myShapeEntry; }
+  void                         setShapeEntry( const QString& theEntry );
 
 protected:
   struct StdParam
@@ -121,6 +124,7 @@ private:
   bool                         myIsCreate;
   QtxDialog*                   myDlg;
   QEventLoop*                  myEventLoop;
+  QString                      myShapeEntry;
 };
 
 class SMESHGUI_HypothesisDlg : public QtxDialog
index ae29fc4b167d01e90325338a9e9be1c321ee33c2..c617ecc794d76f7f1196500a866ec8cb2d22b75d 100644 (file)
@@ -1063,6 +1063,15 @@ void SMESHGUI_MeshOp::createHypothesis (const int theDim,
 
       int obj = myDlg->getActiveObject();
       removeCustomFilters(); // Issue 0020170
+
+      // Set Geometry
+      QStringList aList;
+      myDlg->selectedObject( SMESHGUI_MeshDlg::Geom, aList );
+      if (aList.count() != 0)
+       aCreator->setShapeEntry( aList.first() );
+      else
+       aCreator->setShapeEntry( QString() );
+      
       myDlg->setEnabled( false );
       aCreator->create(initParamHyp, aHypName, myDlg);
       onActivateObject( obj ); // Issue 0020170. Restore filters
@@ -1116,6 +1125,14 @@ void SMESHGUI_MeshOp::onEditHyp( const int theHypType, const int theIndex )
       getInitParamsHypothesis( aHyp->GetName(), aHyp->GetLibName());
     aCreator->setInitParamsHypothesis( initParamHyp );
 
+    // Set Geometry
+    QStringList aList;
+    myDlg->selectedObject( SMESHGUI_MeshDlg::Geom, aList );
+    if (aList.count() > 0)
+      aCreator->setShapeEntry( aList.first() );
+    else
+      aCreator->setShapeEntry( "" );
+
     int obj = myDlg->getActiveObject();
     removeCustomFilters(); // Issue 0020170
     myDlg->setEnabled( false );
index d2e0b1bf20d3f6dcb102bd58420c8ee69689288c..a24909a0cf37b34438aef5da709871c2dcfc8491 100644 (file)
@@ -104,9 +104,32 @@ double StdMeshers_Arithmetic1D::GetLength(bool isStartLength) const
  */
 //=============================================================================
 
+void StdMeshers_Arithmetic1D::SetReversedEdges( std::vector<int>& ids )
+{
+  if ( ids != _edgeIDs ) {
+    _edgeIDs = ids;
+
+    NotifySubMeshesHypothesisModification();
+  }
+}
+
+//=============================================================================
+/*!
+ *  
+ */
+//=============================================================================
+
 ostream & StdMeshers_Arithmetic1D::SaveTo(ostream & save)
 {
-  save << _begLength << " " << _endLength;
+  int listSize = _edgeIDs.size();
+  save << _begLength << " " << _endLength << " " << listSize;
+
+  if ( listSize > 0 ) {
+    for ( int i = 0; i < listSize; i++)
+      save << " " << _edgeIDs[i];
+    save << " " << _objEntry;
+  }
+
   return save;
 }
 
@@ -119,12 +142,25 @@ ostream & StdMeshers_Arithmetic1D::SaveTo(ostream & save)
 istream & StdMeshers_Arithmetic1D::LoadFrom(istream & load)
 {
   bool isOK = true;
+  int intVal;
   isOK = (load >> _begLength);
   if (!isOK)
     load.clear(ios::badbit | load.rdstate());
   isOK = (load >> _endLength);
+
   if (!isOK)
     load.clear(ios::badbit | load.rdstate());
+
+  isOK = (load >> intVal);
+  if (isOK && intVal > 0) {
+    _edgeIDs.reserve( intVal );
+    for (int i = 0; i < _edgeIDs.capacity() && isOK; i++) {
+      isOK = (load >> intVal);
+      if ( isOK ) _edgeIDs.push_back( intVal );
+    }
+    isOK = (load >> _objEntry);
+  }
+
   return load;
 }
 
index 94952b774da39110650b247447f60b0b348e2479..e3f3c37a8f1018a97cb736fef0980f366df1d2de 100644 (file)
 #ifndef _SMESH_ARITHMETIC1D_HXX_
 #define _SMESH_ARITHMETIC1D_HXX_
 
+
+
 #include "SMESH_StdMeshers.hxx"
 
 #include "SMESH_Hypothesis.hxx"
 #include "Utils_SALOME_Exception.hxx"
 
+#include <vector>
+
 class STDMESHERS_EXPORT StdMeshers_Arithmetic1D:
   public SMESH_Hypothesis
 {
@@ -43,6 +47,14 @@ public:
 
   double GetLength(bool isStartLength) const;
 
+  void SetReversedEdges( std::vector<int>& ids);
+
+  void SetObjectEntry( const char* entry ) { _objEntry = entry; }
+
+  const char* GetObjectEntry() { return _objEntry.c_str(); }
+
+  const std::vector<int>& GetReversedEdges() const { return _edgeIDs; }
+
   virtual std::ostream & SaveTo(std::ostream & save);
   virtual std::istream & LoadFrom(std::istream & load);
   friend std::ostream& operator << (std::ostream & save, StdMeshers_Arithmetic1D & hyp);
@@ -64,6 +76,8 @@ public:
 
 protected:
   double _begLength, _endLength;
+  std::vector<int>   _edgeIDs;
+  std::string        _objEntry;
 };
 
 #endif
index 0d05c5b1cacdabc87d93d69157f4f437356159f7..e03a921e85db59d00dd55e409503ec1082e36980 100644 (file)
@@ -481,6 +481,7 @@ int StdMeshers_NumberOfSegments::ConversionMode() const
 
 ostream & StdMeshers_NumberOfSegments::SaveTo(ostream & save)
 {
+  int listSize = _edgeIDs.size();
   save << _numberOfSegments << " " << (int)_distrType;
   switch (_distrType)
   {
@@ -503,6 +504,13 @@ ostream & StdMeshers_NumberOfSegments::SaveTo(ostream & save)
 
   if (_distrType == DT_TabFunc || _distrType == DT_ExprFunc)
     save << " " << _convMode;
+
+  if ( _distrType != DT_Regular && listSize > 0 ) {
+    save << " " << listSize;
+    for ( int i = 0; i < listSize; i++ )
+      save << " " << _edgeIDs[i];
+    save << " " << _objEntry;
+  }
   
   return save;
 }
@@ -619,6 +627,18 @@ istream & StdMeshers_NumberOfSegments::LoadFrom(istream & load)
       load.clear(ios::badbit | load.rdstate());
   }
 
+  // load reversed edges IDs
+  int intVal;
+  isOK = (load >> intVal);
+  if ( isOK && _distrType != DT_Regular && intVal > 0 ) {
+    _edgeIDs.reserve( intVal );
+    for (int i = 0; i < _edgeIDs.capacity() && isOK; i++) {
+      isOK = (load >> intVal);
+      if ( isOK ) _edgeIDs.push_back( intVal );
+    }
+    isOK = (load >> _objEntry);
+  }
+
   return load;
 }
 
@@ -695,3 +715,18 @@ bool StdMeshers_NumberOfSegments::SetParametersByDefaults(const TDefaults&  dflt
   return (_numberOfSegments = dflts._nbSegments );
 }
 
+//=============================================================================
+/*!
+ *  
+ */
+//=============================================================================
+
+void StdMeshers_NumberOfSegments::SetReversedEdges( std::vector<int>& ids )
+{
+  if ( ids != _edgeIDs ) {
+    _edgeIDs = ids;
+
+    NotifySubMeshesHypothesisModification();
+  }
+}
+
index 1be5b9176f61929055bdee75e90807b0f9d56e1f..985d192b22bb853c05b3765f590e29b38bb0e8cd 100644 (file)
@@ -161,6 +161,13 @@ public:
   int ConversionMode() const
     throw (SALOME_Exception);
 
+  void SetReversedEdges( std::vector<int>& ids);
+
+  void SetObjectEntry( const char* entry ) { _objEntry = entry; }
+
+  const char* GetObjectEntry() { return _objEntry.c_str(); }
+
+  const std::vector<int>& GetReversedEdges() const { return _edgeIDs; }
 
   /*!
    * \brief Initialize number of segments by the mesh built on the geometry
@@ -188,6 +195,8 @@ protected:
   std::vector<double> _table, _distr;    //!< the table for DT_TabFunc, a sequence of pairs of numbers
   std::string         _func;             //!< the expression of the function for DT_ExprFunc
   int                 _convMode;         //!< flag of conversion mode: 0=exponent, 1=cut negative
+  std::vector<int>    _edgeIDs;          //!< list of reversed edges ids
+  std::string         _objEntry;          //!< Entry of the main object to reverse edges
 };
 
 #endif
index 6edeeb03664f7713dc0e0b7bc7bc376933d6befd..3b5abcbee4b54adbc74d55b999008f90a482bb02 100644 (file)
@@ -180,12 +180,15 @@ bool StdMeshers_Regular_1D::CheckHypothesis
     {
     case StdMeshers_NumberOfSegments::DT_Scale:
       _value[ SCALE_FACTOR_IND ] = hyp->GetScaleFactor();
+      _revEdgesIDs = hyp->GetReversedEdges();
       break;
     case StdMeshers_NumberOfSegments::DT_TabFunc:
       _vvalue[ TAB_FUNC_IND ] = hyp->GetTableFunction();
+      _revEdgesIDs = hyp->GetReversedEdges();
       break;
     case StdMeshers_NumberOfSegments::DT_ExprFunc:
       _svalue[ EXPR_FUNC_IND ] = hyp->GetExpressionFunction();
+      _revEdgesIDs = hyp->GetReversedEdges();
       break;
     case StdMeshers_NumberOfSegments::DT_Regular:
       break;
@@ -209,6 +212,9 @@ bool StdMeshers_Regular_1D::CheckHypothesis
     _value[ END_LENGTH_IND ] = hyp->GetLength( false );
     ASSERT( _value[ BEG_LENGTH_IND ] > 0 && _value[ END_LENGTH_IND ] > 0 );
     _hypType = ARITHMETIC_1D;
+
+    _revEdgesIDs = hyp->GetReversedEdges();
+
     aStatus = SMESH_Hypothesis::HYP_OK;
   }
 
@@ -221,6 +227,9 @@ bool StdMeshers_Regular_1D::CheckHypothesis
     _value[ END_LENGTH_IND ] = hyp->GetLength( false );
     ASSERT( _value[ BEG_LENGTH_IND ] > 0 && _value[ END_LENGTH_IND ] > 0 );
     _hypType = BEG_END_LENGTH;
+
+    _revEdgesIDs = hyp->GetReversedEdges();
+
     aStatus = SMESH_Hypothesis::HYP_OK;
   }
 
@@ -821,6 +830,11 @@ bool StdMeshers_Regular_1D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape & t
     bool reversed = false;
     if ( !_mainEdge.IsNull() )
       reversed = ( _mainEdge.Orientation() == TopAbs_REVERSED );
+    else if ( _revEdgesIDs.size() > 0 ) {
+      for ( int i = 0; i < _revEdgesIDs.size(); i++)
+       if ( _revEdgesIDs[i] == shapeID )
+         reversed = true;
+    }
 
     BRepAdaptor_Curve C3d( E );
     double length = EdgeLength( E );
@@ -948,7 +962,7 @@ bool StdMeshers_Regular_1D::Evaluate(SMESH_Mesh & theMesh,
 
   const TopoDS_Edge & EE = TopoDS::Edge(theShape);
   TopoDS_Edge E = TopoDS::Edge(EE.Oriented(TopAbs_FORWARD));
-  int shapeID = meshDS->ShapeToIndex( E );
+  //  int shapeID = meshDS->ShapeToIndex( E );
 
   double f, l;
   Handle(Geom_Curve) Curve = BRep_Tool::Curve(E, f, l);
index 244ebe6a1b203935b981f72fe0d8b1041dd8f2a2..0ee10b45bb2c8e4e96b6d98c9d51ac5612a84377 100644 (file)
@@ -127,6 +127,7 @@ protected:
   int    _ivalue[3];
   std::vector<double> _vvalue[1];
   std::string         _svalue[1];
+  std::vector<int>    _revEdgesIDs;
 
   // a source of propagated hypothesis, is set by CheckHypothesis()
   // always called before Compute()
index d22555ffb9c6f694b6cf4ff42aef28b3d6ac2a78..46e9a7cc3ea4ae1b57be703c731e71554fb39d5c 100644 (file)
@@ -105,9 +105,33 @@ double StdMeshers_StartEndLength::GetLength(bool isStartLength) const
  */
 //=============================================================================
 
+void StdMeshers_StartEndLength::SetReversedEdges( std::vector<int>& ids )
+{
+  if ( ids != _edgeIDs ) {
+    _edgeIDs = ids;
+
+    NotifySubMeshesHypothesisModification();
+  }
+}
+
+//=============================================================================
+/*!
+ *  
+ */
+//=============================================================================
+
 ostream & StdMeshers_StartEndLength::SaveTo(ostream & save)
 {
-  save << _begLength << " " <<_endLength;
+  int listSize = _edgeIDs.size();
+  save << _begLength << " " << _endLength << " " << listSize;
+
+  if ( listSize > 0 ) {
+    for ( int i = 0; i < listSize; i++) {
+      save << " " << _edgeIDs[i];
+    }
+    save << " " << _objEntry;
+  }
+
   return save;
 }
 
@@ -120,12 +144,25 @@ ostream & StdMeshers_StartEndLength::SaveTo(ostream & save)
 istream & StdMeshers_StartEndLength::LoadFrom(istream & load)
 {
   bool isOK = true;
+  int intVal;
   isOK = (load >> _begLength);
   if (!isOK)
     load.clear(ios::badbit | load.rdstate());
   isOK = (load >> _endLength);
+
   if (!isOK)
     load.clear(ios::badbit | load.rdstate());
+  
+  isOK = (load >> intVal);
+  if (isOK && intVal > 0) {
+    _edgeIDs.reserve( intVal );
+    for (int i = 0; i < _edgeIDs.capacity() && isOK; i++) {
+      isOK = (load >> intVal);
+      if ( isOK ) _edgeIDs.push_back( intVal );
+    }
+    isOK = (load >> _objEntry);
+  }
+
   return load;
 }
 
index 00f228771fee69fa82d1f726a0888b2ed6bcfcbb..35ae4e0c45c05551955b3f19a1c2092767c7a9e9 100644 (file)
@@ -31,6 +31,8 @@
 #include "SMESH_Hypothesis.hxx"
 #include "Utils_SALOME_Exception.hxx"
 
+#include <vector>
+
 class STDMESHERS_EXPORT StdMeshers_StartEndLength:public SMESH_Hypothesis
 {
  public:
@@ -40,6 +42,14 @@ class STDMESHERS_EXPORT StdMeshers_StartEndLength:public SMESH_Hypothesis
   void SetLength(double length, bool isStartLength) throw(SALOME_Exception);
 
   double GetLength(bool isStartLength) const;
+
+  void SetReversedEdges( std::vector<int>& ids);
+
+  const std::vector<int>& GetReversedEdges() const { return _edgeIDs; }
+
+  void SetObjectEntry( const char* entry ) { _objEntry = entry; }
+
+  const char* GetObjectEntry() { return _objEntry.c_str(); }
   
   virtual std::ostream & SaveTo(std::ostream & save);
   virtual std::istream & LoadFrom(std::istream & load);
@@ -63,6 +73,8 @@ class STDMESHERS_EXPORT StdMeshers_StartEndLength:public SMESH_Hypothesis
 
 protected:
   double _begLength, _endLength;
+  std::vector<int>   _edgeIDs;
+  std::string        _objEntry;
 };
 
 #endif
index 38425ec0c078b36fa6e36d6cf46fd06c4a6f7fdc..6d1ceae87891e3a0892bbd302d96c42c65ecf81b 100644 (file)
@@ -35,7 +35,8 @@ salomeinclude_HEADERS = \
        StdMeshersGUI_DistrTable.h \
        StdMeshersGUI_NbSegmentsCreator.h \
        StdMeshersGUI_ObjectReferenceParamWdg.h \
-       StdMeshersGUI_LayerDistributionParamWdg.h
+       StdMeshersGUI_LayerDistributionParamWdg.h \
+       StdMeshersGUI_EdgeDirectionParamWdg.h
 
 # Libraries targets
 lib_LTLIBRARIES = libStdMeshersGUI.la
@@ -46,7 +47,8 @@ dist_libStdMeshersGUI_la_SOURCES = \
        StdMeshersGUI_DistrTable.cxx \
        StdMeshersGUI_NbSegmentsCreator.cxx \
        StdMeshersGUI_ObjectReferenceParamWdg.cxx \
-       StdMeshersGUI_LayerDistributionParamWdg.cxx
+       StdMeshersGUI_LayerDistributionParamWdg.cxx \
+       StdMeshersGUI_EdgeDirectionParamWdg.cxx
 
 MOC_FILES = \
        StdMeshersGUI_StdHypothesisCreator_moc.cxx \
@@ -54,7 +56,8 @@ MOC_FILES = \
        StdMeshersGUI_DistrTable_moc.cxx \
        StdMeshersGUI_NbSegmentsCreator_moc.cxx \
        StdMeshersGUI_ObjectReferenceParamWdg_moc.cxx \
-       StdMeshersGUI_LayerDistributionParamWdg_moc.cxx
+       StdMeshersGUI_LayerDistributionParamWdg_moc.cxx \
+       StdMeshersGUI_EdgeDirectionParamWdg_moc.cxx
 
 nodist_libStdMeshersGUI_la_SOURCES= \
        $(MOC_FILES)
diff --git a/src/StdMeshersGUI/StdMeshersGUI_EdgeDirectionParamWdg.cxx b/src/StdMeshersGUI/StdMeshersGUI_EdgeDirectionParamWdg.cxx
new file mode 100644 (file)
index 0000000..01b64b3
--- /dev/null
@@ -0,0 +1,417 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : StdMeshersGUI_EdgeDirectionParamWdg.cxx
+// Author : Open CASCADE S.A.S. (dmv)
+// SMESH includes
+//
+#include "StdMeshersGUI_EdgeDirectionParamWdg.h"
+
+// SMESH Includes
+#include <SMESH_Type.h>
+#include "SMESHGUI_MeshUtils.h"
+#include <SMESH_Actor.h>
+#include <SMESH_PreviewActorsCollection.h>
+#include <SMESH_ActorUtils.h>
+#include "SMESHGUI_GroupUtils.h"
+#include "SMESH_Gen_i.hxx"
+#include "SMESHGUI_GEOMGenUtils.h"
+
+// SVTK Includes
+#include <SVTK_ViewWindow.h>
+#include <SVTK_ViewModel.h>
+#include <SVTK_ViewWindow.h>
+#include <SVTK_Selector.h>
+
+// SALOME GUI includes
+#include <SALOME_ListIO.hxx>
+#include <LightApp_SelectionMgr.h>
+#include <SALOME_ListIteratorOfListIO.hxx>
+
+// SUIT Includes
+#include <SUIT_ResourceMgr.h>
+
+// GEOM Includes
+#include <GEOMBase.h>
+
+// Qt includes
+#include <QPushButton>
+#include <QGridLayout>
+#include <QListWidget>
+#include <QCheckBox>
+#include <QLineEdit>
+
+// OCCT includes
+#include <TColStd_MapOfInteger.hxx>
+#include <TColStd_IndexedMapOfInteger.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
+
+// SALOME KERNEL includes
+#include <SALOMEDS_SObject.hxx>
+
+#define SPACING 6
+#define MARGIN 0
+
+//================================================================================
+/*!
+ *  Constructor
+ */
+//================================================================================
+
+StdMeshersGUI_EdgeDirectionParamWdg
+::StdMeshersGUI_EdgeDirectionParamWdg( QWidget * parent ): 
+  QWidget( parent )
+{
+  QPixmap image0( SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap( "SMESH", tr( "ICON_SELECT" ) ) );
+
+  QGridLayout* edgesLayout = new QGridLayout( this );
+  edgesLayout->setMargin( MARGIN );
+  edgesLayout->setSpacing( SPACING );
+  
+  myListWidget    = new QListWidget( this );
+  myAddButton    = new QPushButton( tr( "SMESH_BUT_ADD" ),    this );
+  myRemoveButton = new QPushButton( tr( "SMESH_BUT_REMOVE" ), this );      
+  myListWidget->setSelectionMode( QListWidget::ExtendedSelection );
+
+  edgesLayout->addWidget(myListWidget,   0, 0, 3, 3);
+  edgesLayout->addWidget(myAddButton,    0, 4);
+  edgesLayout->addWidget(myRemoveButton, 1, 4);
+
+  edgesLayout->setRowStretch(2, 5);
+  edgesLayout->setColumnStretch(2, 5);
+
+  setLayout( edgesLayout );
+  setMinimumWidth( 300 );
+
+  init();
+}
+
+//================================================================================
+/*!
+ *  Destructor
+ */
+//================================================================================
+
+StdMeshersGUI_EdgeDirectionParamWdg::~StdMeshersGUI_EdgeDirectionParamWdg()
+{
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) {
+    myPreviewActor->RemoveFromRender( myRenderer );
+    aViewWindow->Repaint();
+  }
+  myEntry = "";
+  myParamValue = "";
+  myMainShape.Nullify();
+  
+  delete myPreviewActor;
+}
+
+//================================================================================
+/*!
+ *  Create a layout, initialize fields
+ */
+//================================================================================
+
+void StdMeshersGUI_EdgeDirectionParamWdg::init()
+{
+  myParamValue = "";
+  myListOfIDs.clear();
+  mySelectedIDs.clear();
+
+  mySMESHGUI     = SMESHGUI::GetSMESHGUI();
+  mySelectionMgr = SMESH::GetSelectionMgr( mySMESHGUI );
+  mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
+
+  if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+    aViewWindow->SetSelectionMode( ActorSelection );
+
+  connect( myAddButton,    SIGNAL(clicked()), SLOT(onAdd()));
+  connect( myRemoveButton, SIGNAL(clicked()), SLOT(onRemove()));
+  
+  connect( mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+  connect( myListWidget,   SIGNAL(itemSelectionChanged()),    this, SLOT(onListSelectionChanged()));
+
+  updateState();
+}
+
+//================================================================================
+/*!
+ *  Create a layout, initialize fields
+ */
+//================================================================================
+
+void StdMeshersGUI_EdgeDirectionParamWdg::showPreview( bool visible)
+{
+  if ( myIsShown != visible ) {
+    myPreviewActor->SetShown( visible );
+    
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+      aViewWindow->Repaint();
+
+    myIsShown = visible;
+  }
+}
+
+//=================================================================================
+// function : SelectionIntoArgument()
+// purpose  : Called when selection as changed or other case
+//=================================================================================
+void StdMeshersGUI_EdgeDirectionParamWdg::SelectionIntoArgument()
+{
+  mySelectedIDs.clear();
+
+  // get selected mesh
+  SALOME_ListIO aList;
+  mySelectionMgr->selectedObjects( aList );
+  int nbSel = aList.Extent();
+
+  if (nbSel < 1)
+    return;
+
+  SALOME_ListIteratorOfListIO anIt (aList);
+    
+  for ( ; anIt.More(); anIt.Next()) { // Loop on selected objects
+    Handle(SALOME_InteractiveObject) IO = anIt.Value();
+
+    GEOM::GEOM_Object_var aGeomObj = GetGeomObjectByEntry( IO->getEntry() );  
+    if ( !CORBA::is_nil( aGeomObj ) ) { // Selected Object From Study
+      GEOM::GEOM_Object_ptr aGeomFatherObj = aGeomObj->GetMainShape();
+      QString aFatherEntry = "";
+      QString aMainFatherEntry = "";
+      TopoDS_Shape shape;
+      if ( !CORBA::is_nil( aGeomFatherObj ) ) {
+       // Get Main Shape
+       GEOM::GEOM_Object_var aGeomMain = GetGeomObjectByEntry( myEntry );
+       if ( !CORBA::is_nil( aGeomMain ) || aGeomMain->GetType() == 37 ) {  // Main Shape is a Group
+         GEOM::GEOM_Object_ptr aMainFatherObj = aGeomMain->GetMainShape();
+         if ( !CORBA::is_nil( aMainFatherObj ) )
+           aMainFatherEntry = aMainFatherObj->GetStudyEntry();
+       }
+       aFatherEntry = aGeomFatherObj->GetStudyEntry();
+      }
+      
+      if ( aFatherEntry != "" && ( aFatherEntry == myEntry || aFatherEntry == aMainFatherEntry ) ) {
+       if ( aGeomObj->GetType() == 37 /*GEOM_GROUP*/ ) { // Selected Group that belongs the main object
+         GEOMBase::GetShape(aGeomObj, shape); 
+         if ( !shape.IsNull() ) {
+           TopExp_Explorer exp( shape, TopAbs_EDGE );
+           for ( ; exp.More(); exp.Next() ) {
+             int index = myPreviewActor->GetIndexByShape( exp.Current() );
+             if ( index ) {
+               mySelectedIDs.append( index );
+               myPreviewActor->HighlightID( index );
+             }
+           }
+         }
+       } else if ( aGeomObj->GetType() == 28 /*GEOM_SUBSHAPE*/  ) {
+         GEOMBase::GetShape(aGeomObj, shape); 
+         if ( !shape.IsNull() && shape.ShapeType() == TopAbs_EDGE ) {
+           int index = myPreviewActor->GetIndexByShape( shape );
+           if ( index ) {
+             mySelectedIDs.append( index );
+             myPreviewActor->HighlightID( index );
+           }
+         }
+       }
+      }
+    } else { // Selected Actor from Actor Collection
+      QString anEntry = IO->getEntry();
+      QString str = "_";
+      int index = anEntry.lastIndexOf( str );
+      anEntry.remove(0, index+1);
+      int ind = anEntry.toInt();
+      if ( ind )
+       mySelectedIDs.append( ind );
+    }
+  }
+}
+
+//=================================================================================
+// function : onAdd()
+// purpose  : Called when Add Button Clicked
+//=================================================================================
+void StdMeshersGUI_EdgeDirectionParamWdg::onAdd()
+{
+  if ( mySelectedIDs.size() < 1 )
+    return;
+
+  myListWidget->blockSignals( true );
+  for (int i = 0; i < mySelectedIDs.size(); i++) {
+    if ( myListOfIDs.indexOf( mySelectedIDs.at(i) ) == -1 ) {
+      QString anID = QString(" %1").arg( mySelectedIDs.at(i) );
+
+      QListWidgetItem* anItem = new QListWidgetItem( anID, myListWidget );
+      anItem->setSelected(true);
+      
+      myListOfIDs.append( mySelectedIDs.at(i) );
+    }
+  }
+  onListSelectionChanged();
+
+  myListWidget->blockSignals( false );
+}
+        
+//=================================================================================
+// function : onRemove()
+// purpose  : Called when Remove Button Clicked
+//=================================================================================
+void StdMeshersGUI_EdgeDirectionParamWdg::onRemove()
+{
+  if ( myListWidget->count() < 1 )
+    return;
+
+  myListWidget->blockSignals( true );
+  QList<QListWidgetItem*> selItems = myListWidget->selectedItems();
+  QListWidgetItem* item;
+  foreach(item, selItems) {
+    QString idStr = item->text();
+    int id = idStr.toInt();
+
+    int index = myListOfIDs.indexOf( id );
+    myListOfIDs.removeAt( index );
+    delete item;
+  }
+
+  onListSelectionChanged();
+  myListWidget->blockSignals( false );
+}
+
+//=================================================================================
+// function : onListSelectionChanged()
+// purpose  : Called when selection in element list is changed
+//=================================================================================
+void StdMeshersGUI_EdgeDirectionParamWdg::onListSelectionChanged()
+{
+  mySelectionMgr->clearSelected();
+  TColStd_MapOfInteger aIndexes;
+  QList<QListWidgetItem*> selItems = myListWidget->selectedItems();
+  QListWidgetItem* anItem;
+  foreach(anItem, selItems)
+    myPreviewActor->HighlightID( anItem->text().toInt() );
+}
+
+//=================================================================================
+// function : setGeomShape
+// purpose  : Called to set geometry
+//================================================================================
+void StdMeshersGUI_EdgeDirectionParamWdg::SetMainShapeEntry( const QString& theEntry )
+{
+  if ( theEntry != "") {
+    myParamValue = theEntry;
+    myEntry = theEntry;
+    myMainShape = GetTopoDSByEntry( theEntry );
+    updateState();
+  }
+}
+
+//=================================================================================
+// function : updateState
+// purpose  : update Widget state
+//=================================================================================
+void StdMeshersGUI_EdgeDirectionParamWdg::updateState()
+{
+  bool state = false;
+  if ( !myMainShape.IsNull() )
+    state = true;
+  
+  myListWidget->setEnabled( state );
+  myAddButton->setEnabled( state );
+  myRemoveButton->setEnabled( state );
+  
+  if (state = true) {
+    myPreviewActor = new SMESH_PreviewActorsCollection();
+    myPreviewActor->SetSelector( mySelector );
+    myPreviewActor->Init( myMainShape, TopAbs_EDGE, myEntry );
+    myPreviewActor->SetShown( false );
+    myIsShown = false;
+    if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) {
+      myRenderer = aViewWindow->getRenderer();
+      myPreviewActor->AddToRender( myRenderer );
+      aViewWindow->Repaint();
+    }
+  }
+}
+
+//=================================================================================
+// function : GetGeomObjectByEntry
+// purpose  : Called to get GeomObject
+//=================================================================================
+GEOM::GEOM_Object_var StdMeshersGUI_EdgeDirectionParamWdg::GetGeomObjectByEntry( const QString& theEntry )
+{
+  GEOM::GEOM_Object_var aGeomObj;
+  SALOMEDS::Study_var aStudy = SMESHGUI::GetSMESHGen()->GetCurrentStudy();
+  if (aStudy != 0) {
+    SALOMEDS::SObject_var aSObj = aStudy->FindObjectID( theEntry.toLatin1().data() );
+    SALOMEDS::GenericAttribute_var anAttr;
+
+    if (!aSObj->_is_nil() && aSObj->FindAttribute(anAttr, "AttributeIOR")) {
+      SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
+      CORBA::String_var aVal = anIOR->Value();
+      CORBA::Object_var obj = aStudy->ConvertIORToObject(aVal);
+      aGeomObj = GEOM::GEOM_Object::_narrow(obj);
+    }
+  }
+  return aGeomObj;
+}
+
+//=================================================================================
+// function : setObjectByEntry
+// purpose  : Called to get GeomObject
+//=================================================================================
+TopoDS_Shape StdMeshersGUI_EdgeDirectionParamWdg::GetTopoDSByEntry( const QString& theEntry )
+{
+  TopoDS_Shape shape;
+  GEOM::GEOM_Object_var aGeomObj = GetGeomObjectByEntry( theEntry );
+  GEOMBase::GetShape(aGeomObj, shape);
+  return shape;
+}
+
+//=================================================================================
+// function : GetListOfIds
+// purpose  : Called to get the list of Edges IDs
+//=================================================================================
+SMESH::long_array_var StdMeshersGUI_EdgeDirectionParamWdg::GetListOfIDs()
+{
+  SMESH::long_array_var anArray = new SMESH::long_array;
+  int size = myListOfIDs.size();
+  anArray->length( size );
+  if ( size ) {
+    for (int i = 0; i < size; i++) {
+       anArray[i] = myListOfIDs.at(i);
+    }
+  }
+  return anArray;
+}
+
+//=================================================================================
+// function : SetListOfIds
+// purpose  : Called to set the list of Edges IDs
+//=================================================================================
+void StdMeshersGUI_EdgeDirectionParamWdg::SetListOfIDs( SMESH::long_array_var theIds)
+{
+  mySelectedIDs.clear();
+  myListOfIDs.clear();
+  int size = theIds->length();
+  for ( int i = 0; i < size; i++ )
+    mySelectedIDs.append( theIds[ i ] );
+  onAdd();
+}
diff --git a/src/StdMeshersGUI/StdMeshersGUI_EdgeDirectionParamWdg.h b/src/StdMeshersGUI/StdMeshersGUI_EdgeDirectionParamWdg.h
new file mode 100644 (file)
index 0000000..e05df98
--- /dev/null
@@ -0,0 +1,107 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : StdMeshersGUI_EdgeDirectionParamWdg.h
+// Author : Open CASCADE S.A.S. (dmv)
+//
+#ifndef STDMESHERSGUI_EDGEDIRECTIONPARAMWGD_H
+#define STDMESHERSGUI_EDGEDIRECTIONPARAMWGD_H
+
+// SMESH includes
+#include <SMESHGUI.h>
+#include "SMESH_StdMeshersGUI.hxx"
+#include "SMESH_SMESHGUI.hxx"
+
+// Qt includes
+#include <QWidget>
+#include <QStringList>
+#include <TopoDS_Shape.hxx>
+
+#include <SMESHGUI_VTKUtils.h>
+
+class SMESHGUI;
+class LightApp_SelectionMgr;
+class SVTK_Selector;
+class QPushButton;
+class QLineEdit;
+class QCheckBox;
+class QListWidget;
+class SMESH_Actor;
+class SMESH_PreviewActorsCollection;
+class vtkRenderer;
+
+class STDMESHERSGUI_EXPORT StdMeshersGUI_EdgeDirectionParamWdg : public QWidget
+{
+  Q_OBJECT
+
+public:
+  StdMeshersGUI_EdgeDirectionParamWdg( QWidget* parent = 0 );
+  ~StdMeshersGUI_EdgeDirectionParamWdg();
+
+  SMESH::long_array_var          GetListOfIDs();
+  void                           SetListOfIDs( SMESH::long_array_var );
+
+  void                           SetMainShapeEntry( const QString& theEntry );
+  const char*                    GetMainShapeEntry() { return myEntry.toLatin1().data();}
+
+  TopoDS_Shape                   GetMainShape() { return myMainShape; }
+
+  static GEOM::GEOM_Object_var   GetGeomObjectByEntry( const QString& );
+  static TopoDS_Shape            GetTopoDSByEntry( const QString& );
+
+  QString                        GetValue() const { return myParamValue; }
+
+  void                           showPreview ( bool );
+
+private:
+  void                           updateState();
+
+private slots:
+  void                           onAdd(); 
+  void                           onRemove(); 
+  void                           SelectionIntoArgument();
+  void                           onListSelectionChanged();
+
+private:
+  void                           init();
+
+private:
+  SMESHGUI*                      mySMESHGUI;
+  LightApp_SelectionMgr*         mySelectionMgr;          /* User shape selection */
+  SVTK_Selector*                 mySelector;
+  SMESH::SMESH_Mesh_var          myMesh;
+  TopoDS_Shape                   myMainShape;
+  QString                        myEntry;
+  vtkRenderer*                   myRenderer;
+  
+  QListWidget*                   myListWidget;
+  QPushButton*                   myAddButton;
+  QPushButton*                   myRemoveButton;
+  QList<int>                     mySelectedIDs;
+  QList<int>                     myListOfIDs;
+  
+  QString                        myParamValue;
+  bool                           myIsShown;
+  
+  SMESH_PreviewActorsCollection* myPreviewActor;
+};
+
+#endif // STDMESHERSGUI_EDGEDIRECTIONPARAMWGD_H
index 9e8e0bda842b80b5672c123d7dacee87a15723ca..d8974605479d555e66196e2a357be71ed9b05714 100644 (file)
@@ -26,6 +26,7 @@
 #include "StdMeshersGUI_NbSegmentsCreator.h"
 #include "StdMeshersGUI_DistrTable.h"
 #include "StdMeshersGUI_DistrPreview.h"
+#include "StdMeshersGUI_EdgeDirectionParamWdg.h"
 
 #include <SMESHGUI.h>
 #include <SMESHGUI_Utils.h>
@@ -99,7 +100,7 @@ QFrame* StdMeshersGUI_NbSegmentsCreator::buildFrame()
 
   QVBoxLayout* lay = new QVBoxLayout( fr );
   lay->setMargin( 0 );
-  lay->setSpacing( 0 );
+  lay->setSpacing( SPACING );
 
   QGroupBox* GroupC1 = new QGroupBox( tr( "SMESH_ARGUMENTS" ), fr );
   lay->addWidget( GroupC1 );
@@ -195,11 +196,25 @@ QFrame* StdMeshersGUI_NbSegmentsCreator::buildFrame()
   myPreviewRow = row;
   row++;
 
+  // 8) reverce edge parameters
+  myReversedEdgesBox = new QGroupBox(tr( "SMESH_REVERCE_EDGES" ), fr);
+  QHBoxLayout* edgeLay = new QHBoxLayout( myReversedEdgesBox );
+
+  myDirectionWidget = new StdMeshersGUI_EdgeDirectionParamWdg();
+  QString anEntry = getShapeEntry();
+  if ( anEntry == "" )
+    anEntry = h->GetObjectEntry();
+  myDirectionWidget->SetMainShapeEntry( anEntry );
+  myDirectionWidget->SetListOfIDs( h->GetReversedEdges() );
+  edgeLay->addWidget( myDirectionWidget );
+
+  lay->addWidget( myReversedEdgesBox );
+
   connect( myNbSeg, SIGNAL( valueChanged( const QString& ) ), this, SLOT( onValueChanged() ) );
   connect( myDistr, SIGNAL( activated( int ) ), this, SLOT( onValueChanged() ) );
   connect( myTable, SIGNAL( valueChanged( int, int ) ), this, SLOT( onValueChanged() ) );
   connect( myExpr,  SIGNAL( textChanged( const QString& ) ), this, SLOT( onValueChanged() ) );
-  connect( myConv,  SIGNAL( cuttonClicked( int ) ), this, SLOT( onValueChanged() ) );
+  connect( myConv,  SIGNAL( buttonClicked( int ) ), this, SLOT( onValueChanged() ) );
 
   return fr;
 }
@@ -348,6 +363,11 @@ bool StdMeshersGUI_NbSegmentsCreator::storeParamsToHypo( const NbSegmentsHypothe
     if( distr==2 || distr==3 )
       h->SetConversionMode( h_data.myConv );
 
+    if( distr==1 || distr==2 || distr==3 ) {
+      h->SetReversedEdges( myDirectionWidget->GetListOfIDs() );
+      h->SetObjectEntry( myDirectionWidget->GetMainShapeEntry() );
+    }
+
     if( distr==2 )
       h->SetTableFunction( h_data.myTable );
 
@@ -400,6 +420,8 @@ void StdMeshersGUI_NbSegmentsCreator::onValueChanged()
 
   myScale->setShown( distr==1 );
   myLScale->setShown( distr==1 );
+  myReversedEdgesBox->setShown( !distr==0 );
+  myDirectionWidget->showPreview( !distr==0 );
 
   bool isFunc = distr==2 || distr==3;
   myPreview->setShown( isFunc );
@@ -434,8 +456,11 @@ void StdMeshersGUI_NbSegmentsCreator::onValueChanged()
 
   if ( (QtxComboBox*)sender() == myDistr && dlg() ) {
     QApplication::instance()->processEvents();
+    myGroupLayout->invalidate();
+    dlg()->layout()->invalidate();
     dlg()->updateGeometry();
-    dlg()->setMinimumSize( dlg()->minimumSizeHint().width(), dlg()->minimumSizeHint().height() );
+    dlg()->setMinimumSize( dlg()->minimumSizeHint() );
     dlg()->resize( dlg()->minimumSize() );
+    QApplication::instance()->processEvents();
   }
 }
index ba7c7bff85d840f0b10d33e1d9586a6251d5b530..188674497ddd47a4fe2f29903ba5fbc6c18fdc5b 100644 (file)
@@ -44,6 +44,7 @@ class QButtonGroup;
 class QGroupBox;
 class QGridLayout;
 class QRadioButton;
+class StdMeshersGUI_EdgeDirectionParamWdg;
 
 typedef struct
 {
@@ -91,6 +92,9 @@ private:
   QGridLayout*     myGroupLayout;
   int              myTableRow, myPreviewRow;
   QRadioButton*    myCutNeg;
+  QGroupBox*       myReversedEdgesBox;
+
+  StdMeshersGUI_EdgeDirectionParamWdg*    myDirectionWidget;
 };
 
 #endif // STDMESHERSGUI_NBSEGMENTSCREATOR_H
index cdcdcc8f1cad9a5284eaa72fb0eec2270238390c..df4370d6dcf1ff67e2a1c14741f43b62932e17cd 100644 (file)
@@ -33,6 +33,7 @@
 #include <SMESH_NumberFilter.hxx>
 #include "StdMeshersGUI_ObjectReferenceParamWdg.h"
 #include "StdMeshersGUI_LayerDistributionParamWdg.h"
+#include "StdMeshersGUI_EdgeDirectionParamWdg.h"
 #include <SALOMEDSClient_Study.hxx>
 
 // SALOME GUI includes
@@ -444,10 +445,18 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
       StdMeshers::StdMeshers_Arithmetic1D_var h =
        StdMeshers::StdMeshers_Arithmetic1D::_narrow( hypothesis() );
 
+      StdMeshersGUI_EdgeDirectionParamWdg* w = 
+        widget< StdMeshersGUI_EdgeDirectionParamWdg >( 2 );
+
       h->SetLength( params[0].myValue.toDouble(), true );
       h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
       h->SetLength( params[1].myValue.toDouble(), false );
       h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
+      if (w) {
+       h->SetReversedEdges( w->GetListOfIDs() );
+       const char * entry = w->GetMainShapeEntry();
+       h->SetObjectEntry( entry );
+      }
     }
     else if( hypType()=="MaxElementArea" )
     {
@@ -469,10 +478,17 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
       StdMeshers::StdMeshers_StartEndLength_var h =
        StdMeshers::StdMeshers_StartEndLength::_narrow( hypothesis() );
 
+      StdMeshersGUI_EdgeDirectionParamWdg* w = 
+        widget< StdMeshersGUI_EdgeDirectionParamWdg >( 2 );
+
       h->SetLength( params[0].myValue.toDouble(), true );
       h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
       h->SetLength( params[1].myValue.toDouble(), false );
       h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
+      if (w) {
+       h->SetReversedEdges( w->GetListOfIDs() );
+       h->SetObjectEntry( w->GetMainShapeEntry() );
+      }
     }
     else if( hypType()=="Deflection1D" )
     {
@@ -650,10 +666,26 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
       item.myValue = h->GetLength( true );
     p.append( item );
 
+    customWidgets()->append (0);
+
     item.myName = tr( "SMESH_END_LENGTH_PARAM" );
     if(!initVariableName(aParameters,item,1))
       item.myValue = h->GetLength( false );
     p.append( item );
+
+    customWidgets()->append (0);
+
+    item.myName = tr( "SMESH_REVERCE_EDGES" );
+    p.append( item );
+
+    StdMeshersGUI_EdgeDirectionParamWdg* aDirectionWidget = new StdMeshersGUI_EdgeDirectionParamWdg();
+    QString anEntry = SMESHGUI_GenericHypothesisCreator::getShapeEntry();
+    if ( anEntry == "" )
+      anEntry = h->GetObjectEntry();
+    aDirectionWidget->SetMainShapeEntry( anEntry );
+    aDirectionWidget->SetListOfIDs( h->GetReversedEdges() );
+    aDirectionWidget->showPreview( true );
+    customWidgets()->append ( aDirectionWidget );
   }
   else if( hypType()=="MaxElementArea" )
   {
@@ -686,12 +718,26 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
     if(!initVariableName(aParameters,item,0)) 
       item.myValue = h->GetLength( true );
     p.append( item );
+    customWidgets()->append(0);
 
     item.myName = tr( "SMESH_END_LENGTH_PARAM" );
     if(!initVariableName(aParameters,item,1)) 
       item.myValue = h->GetLength( false );
     p.append( item );
-    
+    customWidgets()->append(0);
+
+    item.myName = tr( "SMESH_REVERCE_EDGES" );
+    p.append( item );
+
+    StdMeshersGUI_EdgeDirectionParamWdg* aDirectionWidget = new StdMeshersGUI_EdgeDirectionParamWdg();
+    QString anEntry = SMESHGUI_GenericHypothesisCreator::getShapeEntry();
+    if ( anEntry == "" )
+      anEntry = h->GetObjectEntry();
+    aDirectionWidget->SetMainShapeEntry( anEntry );
+    aDirectionWidget->SetListOfIDs( h->GetReversedEdges() );
+    aDirectionWidget->SetMainShapeEntry( h->GetObjectEntry() );
+    aDirectionWidget->showPreview( true );
+    customWidgets()->append ( aDirectionWidget );
   }
   else if( hypType()=="Deflection1D" )
   {
@@ -1000,6 +1046,13 @@ bool StdMeshersGUI_StdHypothesisCreator::getParamFromCustomWidget( StdParam & pa
     param.myValue = w->GetValue();
     return true;
   }
+  if ( widget->inherits( "StdMeshersGUI_EdgeDirectionParamWdg" ))
+  {
+    const StdMeshersGUI_EdgeDirectionParamWdg * w =
+      static_cast<const StdMeshersGUI_EdgeDirectionParamWdg*>( widget );
+    param.myValue = w->GetValue();
+    return true;
+  }
   return false;
 }
 
index f11a5d675a1c0f3ceaa2f725fa9877772daf0798..30651e8130860047ee4060c04d8cd9180cff774d 100644 (file)
             <source>SMESH_REMOVE_ROW</source>
             <translation>Remove row</translation>
         </message>
+       <message>
+            <source>SMESH_REVERCE_EDGES</source>
+            <translation>Reverce Edges</translation>
+        </message>
         <message>
             <source>SMESH_SEGMENT_LENGTH_AROUND_VERTEX_HYPOTHESIS</source>
             <translation>Segment Length Around Vertex</translation>
index 20a0b29096165e87b4dea53f01df673c66ddd9e3..3bf9e825bcaea9c3a9eba69557ed8300d5951355 100644 (file)
@@ -107,11 +107,109 @@ void StdMeshers_Arithmetic1D_i::SetLength(CORBA::Double theLength,
 
 CORBA::Double StdMeshers_Arithmetic1D_i::GetLength( CORBA::Boolean theIsStart)
 {
-  MESSAGE( "StdMeshers_StartEndLength_i::GetLength" );
+  MESSAGE( "StdMeshers_Arithmetic1D_i::GetLength" );
   ASSERT( myBaseImpl );
   return this->GetImpl()->GetLength( theIsStart );
 }
 
+//=============================================================================
+/*!
+ *  StdMeshers_Arithmetic1D_i::SetReversedEdges
+ *
+ *  Set edges to reverse
+ */
+//=============================================================================
+
+void StdMeshers_Arithmetic1D_i::SetReversedEdges( const SMESH::long_array& theIds )
+{
+  MESSAGE( "StdMeshers_Arithmetic1D_i::SetReversedEdges" );
+  ASSERT( myBaseImpl );
+  try {
+    std::vector<int> ids( theIds.length() );
+    CORBA::Long iEnd = theIds.length();
+    for ( CORBA::Long i = 0; i < iEnd; i++ )
+      ids[ i ] = theIds[ i ];
+
+    this->GetImpl()->SetReversedEdges( ids );
+  }
+  catch ( SALOME_Exception& S_ex ) {
+    THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
+                                 SALOME::BAD_PARAM );
+  }
+
+  // Update Python script
+  /*  SMESH::TPythonDump() << _this() << ".SetEdgesToReverse( "
+      << theList << " )";*/
+}
+
+//=============================================================================
+/*!
+ *  StdMeshers_Arithmetic1D_i::SetObjectEntry
+ *
+ *  Set the Entry for the Main Object
+ */
+//=============================================================================
+
+void StdMeshers_Arithmetic1D_i::SetObjectEntry( const char* entry )
+{
+  MESSAGE( "StdMeshers_Arithmetic1D_i::SetObjectEntry" );
+  ASSERT( myBaseImpl );
+
+  try {
+    this->GetImpl()->SetObjectEntry( entry );
+    // Update Python script
+    //    SMESH::TPythonDump() << _this() << ".SetObjectEntry( '" << entry << "' )";
+  }
+  catch ( SALOME_Exception& S_ex ) {
+    THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
+                                  SALOME::BAD_PARAM );
+  }
+}
+
+//=============================================================================
+/*!
+ *  StdMeshers_Arithmetic1D_i::GetObjectEntry
+ *
+ *  Set the Entry for the Main Object
+ */
+//=============================================================================
+
+char* StdMeshers_Arithmetic1D_i::GetObjectEntry()
+{
+  MESSAGE( "StdMeshers_Arithmetic1D_i::SetObjectEntry" );
+  ASSERT( myBaseImpl );
+  const char* entry;
+  try {
+    entry = this->GetImpl()->GetObjectEntry();
+  }
+  catch ( SALOME_Exception& S_ex ) {
+    THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
+                                  SALOME::BAD_PARAM );
+  }
+  return CORBA::string_dup( entry );
+}
+
+//=============================================================================
+/*!
+ *  StdMeshers_Arithmetic1D_i::GetReversedEdges
+ *
+ *  Get reversed edges
+ */
+//=============================================================================
+
+SMESH::long_array* StdMeshers_Arithmetic1D_i::GetReversedEdges()
+{
+  MESSAGE( "StdMeshers_StartEndLength_i::GetReversedEdges" );
+  ASSERT( myBaseImpl );
+  SMESH::long_array_var anArray = new SMESH::long_array;
+  std::vector<int> ids = this->GetImpl()->GetReversedEdges();
+  anArray->length( ids.size() );
+  for ( CORBA::Long i = 0; i < ids.size(); i++)
+    anArray [ i ] = ids [ i ];
+
+  return anArray._retn();
+}
+
 //=============================================================================
 /*!
  *  StdMeshers_Arithmetic1D_i::GetImpl
index 3d8ec8642c095d4e9f25fb578f0dd97bc6ad52c7..7abea29e1011c41305d117fb84b384d9d37c8ca5 100644 (file)
@@ -54,9 +54,22 @@ public:
   // Set length
   void SetLength( CORBA::Double theLength, CORBA::Boolean theIsStart )
     throw ( SALOME::SALOME_Exception );
+
   // Get length
   CORBA::Double GetLength(CORBA::Boolean theIsStart);
 
+  //Set Reversed Edges
+  void SetReversedEdges( const SMESH::long_array& theIDs);
+
+  //Get Reversed Edges
+  SMESH::long_array*  GetReversedEdges();
+  
+  //Set the Entry of the Object
+  void SetObjectEntry( const char* theEntry);
+
+  //Get Object Entry
+  char* GetObjectEntry();
+
   // Get implementation
   ::StdMeshers_Arithmetic1D* GetImpl();
   
index 7b2d215a5f5fcdee169c1322aaafd62d777c114d..8efa554d3457ff983a262b1799dd8ae243b9bf14 100644 (file)
@@ -162,6 +162,105 @@ CORBA::Long StdMeshers_NumberOfSegments_i::GetNumberOfSegments()
   return this->GetImpl()->GetNumberOfSegments();
 }
 
+//=============================================================================
+/*!
+ *  StdMeshers_NumberOfSegments_i::SetReversedEdges
+ *
+ *  Set edges to reverse
+ */
+//=============================================================================
+
+void StdMeshers_NumberOfSegments_i::SetReversedEdges( const SMESH::long_array& theIds )
+{
+  MESSAGE( "StdMeshers_NumberOfSegments_i::SetReversedEdges" );
+  ASSERT( myBaseImpl );
+  try {
+    std::vector<int> ids( theIds.length() );
+    CORBA::Long iEnd = theIds.length();
+    for ( CORBA::Long i = 0; i < iEnd; i++ )
+      ids[ i ] = theIds[ i ];
+
+    this->GetImpl()->SetReversedEdges( ids );
+  }
+  catch ( SALOME_Exception& S_ex ) {
+    THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
+                                 SALOME::BAD_PARAM );
+  }
+
+  // Update Python script
+  /*  SMESH::TPythonDump() << _this() << ".SetEdgesToReverse( "
+      << theList << " )";*/
+}
+
+//=============================================================================
+/*!
+ *  StdMeshers_NumberOfSegments_i::SetObjectEntry
+ *
+ *  Set the Entry for the Main Object
+ */
+//=============================================================================
+
+void StdMeshers_NumberOfSegments_i::SetObjectEntry( const char* entry )
+{
+  MESSAGE( "StdMeshers_NumberOfSegments_i::SetObjectEntry" );
+  ASSERT( myBaseImpl );
+
+  try {
+    this->GetImpl()->SetObjectEntry( entry );
+    // Update Python script
+    //    SMESH::TPythonDump() << _this() << ".SetObjectEntry( '" << entry << "' )";
+  }
+  catch ( SALOME_Exception& S_ex ) {
+    THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
+                                  SALOME::BAD_PARAM );
+  }
+}
+
+//=============================================================================
+/*!
+ *  StdMeshers_NumberOfSegments_i::GetObjectEntry
+ *
+ *  Set the Entry for the Main Object
+ */
+//=============================================================================
+
+char* StdMeshers_NumberOfSegments_i::GetObjectEntry()
+{
+  MESSAGE( "StdMeshers_NumberOfSegments_i::SetObjectEntry" );
+  ASSERT( myBaseImpl );
+
+  const char* entry;
+  try {
+    entry = this->GetImpl()->GetObjectEntry();
+  }
+  catch ( SALOME_Exception& S_ex ) {
+    THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
+                                  SALOME::BAD_PARAM );
+  }
+  return CORBA::string_dup( entry );
+}
+
+//=============================================================================
+/*!
+ *  StdMeshers_NumberOfSegments_i::GetReversedEdges
+ *
+ *  Get reversed edges
+ */
+//=============================================================================
+
+SMESH::long_array* StdMeshers_NumberOfSegments_i::GetReversedEdges()
+{
+  MESSAGE( "StdMeshers_NumberOfSegments_i::GetReversedEdges" );
+  ASSERT( myBaseImpl );
+  SMESH::long_array_var anArray = new SMESH::long_array;
+  std::vector<int> ids = this->GetImpl()->GetReversedEdges();
+  anArray->length( ids.size() );
+  for ( CORBA::Long i = 0; i < ids.size(); i++)
+    anArray [ i ] = ids [ i ];
+
+  return anArray._retn();
+}
+
 //=============================================================================
 /*!
  */
index 208a59b0b0d404b33311688e77b04b749ac61961..30b9d08b7d8c606a1f5daf8d5765abd240517c73 100644 (file)
@@ -104,6 +104,18 @@ public:
   
   // Verify whether hypothesis supports given entity type 
   CORBA::Boolean IsDimSupported( SMESH::Dimension type );
+
+  //Set Reversed Edges
+  void SetReversedEdges( const SMESH::long_array& theIDs);
+
+  //Get Reversed Edges
+  SMESH::long_array*  GetReversedEdges();
+
+  //Set Object Entry
+  void SetObjectEntry( const char* entry);
+
+  //Get Object Entry
+  char* GetObjectEntry();
 };
 
 #endif
index 1154b63f2a2408046536a8f9fe8ebf123daa40e2..c9a75a3d53a7287164219fd62b7e6bd51c3cba49 100644 (file)
@@ -113,6 +113,103 @@ CORBA::Double StdMeshers_StartEndLength_i::GetLength( CORBA::Boolean theIsStart)
   return this->GetImpl()->GetLength( theIsStart );
 }
 
+//=============================================================================
+/*!
+ *  StdMeshers_StartEndLength_i::SetReversedEdges
+ *
+ *  Set edges to reverse
+ */
+//=============================================================================
+
+void StdMeshers_StartEndLength_i::SetReversedEdges( const SMESH::long_array& theIds )
+{
+  MESSAGE( "StdMeshers_StartEndLength_i::SetReversedEdges" );
+  ASSERT( myBaseImpl );
+  try {
+    std::vector<int> ids( theIds.length() );
+    CORBA::Long iEnd = theIds.length();
+    for ( CORBA::Long i = 0; i < iEnd; i++ )
+      ids[ i ] = theIds[ i ];
+
+    this->GetImpl()->SetReversedEdges( ids );
+  }
+  catch ( SALOME_Exception& S_ex ) {
+    THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
+                                 SALOME::BAD_PARAM );
+  }
+
+  // Update Python script
+  /*  SMESH::TPythonDump() << _this() << ".SetEdgesToReverse( "
+      << theList << " )";*/
+}
+
+//=============================================================================
+/*!
+ *  StdMeshers_StartEndLength_i::SetObjectEntry
+ *
+ *  Set the Entry for the Main Object
+ */
+//=============================================================================
+
+void StdMeshers_StartEndLength_i::SetObjectEntry( const char* entry )
+{
+  MESSAGE( "StdMeshers_StartEndLength_i::SetObjectEntry" );
+  ASSERT( myBaseImpl );
+  try {
+    this->GetImpl()->SetObjectEntry( entry );
+    // Update Python script
+    //    SMESH::TPythonDump() << _this() << ".SetObjectEntry( '" << entry << "' )";
+  }
+  catch ( SALOME_Exception& S_ex ) {
+    THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
+                                  SALOME::BAD_PARAM );
+  }
+}
+
+//=============================================================================
+/*!
+ *  StdMeshers_StartEndLength_i::GetObjectEntry
+ *
+ *  Set the Entry for the Main Object
+ */
+//=============================================================================
+
+char* StdMeshers_StartEndLength_i::GetObjectEntry()
+{
+  MESSAGE( "StdMeshers_StartEndLength_i::SetObjectEntry" );
+  ASSERT( myBaseImpl );
+  const char* entry;
+  try {
+    entry = this->GetImpl()->GetObjectEntry();
+  }
+  catch ( SALOME_Exception& S_ex ) {
+    THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
+                                  SALOME::BAD_PARAM );
+  }
+  return CORBA::string_dup( entry );
+}
+
+//=============================================================================
+/*!
+ *  StdMeshers_StartEndLength_i::GetReversedEdges
+ *
+ *  Get reversed edges
+ */
+//=============================================================================
+
+SMESH::long_array* StdMeshers_StartEndLength_i::GetReversedEdges()
+{
+  MESSAGE( "StdMeshers_StartEndLength_i::GetReversedEdges" );
+  ASSERT( myBaseImpl );
+  SMESH::long_array_var anArray = new SMESH::long_array;
+  std::vector<int> ids = this->GetImpl()->GetReversedEdges();
+  anArray->length( ids.size() );
+  for ( CORBA::Long i = 0; i < ids.size(); i++)
+    anArray [ i ] = ids [ i ];
+
+  return anArray._retn();
+}
+
 //=============================================================================
 /*!
  *  StdMeshers_StartEndLength_i::GetImpl
index d7a4c4bcd17795ca00ea63ab43db06376dc4bba9..3ce0e9db390529a730f2d55b591b9e504060b190 100644 (file)
@@ -65,6 +65,18 @@ public:
   
   // Verify whether hypothesis supports given entity type 
   CORBA::Boolean IsDimSupported( SMESH::Dimension type );
+
+  //Set Reversed Edges
+  void SetReversedEdges( const SMESH::long_array& theIDs);
+
+  //Get Reversed Edges
+  SMESH::long_array*  GetReversedEdges();
+
+  //Set Object Entry
+  void SetObjectEntry( const char* entry);
+
+  //Get Object Entry
+  char* GetObjectEntry();
 };
 
 #endif