Salome HOME
Merge remote-tracking branch 'origin/BR_LAND_COVER' into BR_v14_rc
authorasl <asl@opencascade.com>
Mon, 15 Jun 2015 07:57:19 +0000 (10:57 +0300)
committerasl <asl@opencascade.com>
Mon, 15 Jun 2015 07:57:19 +0000 (10:57 +0300)
Conflicts:
src/HYDROData/HYDROData_CalculationCase.cxx

15 files changed:
1  2 
src/HYDROData/HYDROData_CalculationCase.cxx
src/HYDROData/HYDROData_CalculationCase.h
src/HYDROGUI/CMakeLists.txt
src/HYDROGUI/HYDROGUI_CalculationOp.cxx
src/HYDROGUI/HYDROGUI_CalculationOp.h
src/HYDROGUI/HYDROGUI_DataModel.cxx
src/HYDROGUI/HYDROGUI_DataModel.h
src/HYDROGUI/HYDROGUI_Module.cxx
src/HYDROGUI/HYDROGUI_Operations.cxx
src/HYDROGUI/HYDROGUI_Operations.h
src/HYDROGUI/HYDROGUI_Shape.cxx
src/HYDROGUI/HYDROGUI_Tool.cxx
src/HYDROGUI/HYDROGUI_Tool.h
src/HYDROGUI/resources/HYDROGUI_images.ts
src/HYDROGUI/resources/HYDROGUI_msg_en.ts

index 56f5259ac9eb0f9b9e817026cd5804f27af0b224,bfed4f10d357b74e775bfd9e9ad784c5cef330eb..5ab5b3093d38276baaeb547b4f72d018c2645984
@@@ -1126,9 -1192,56 +1192,10 @@@ bool HYDROData_CalculationCase::Export
    return true;
  }
  
- void HYDROData_CalculationCase::ClearRules( const bool theIsSetToUpdate )
 -GEOM::GEOM_Object_ptr HYDROData_CalculationCase::publishShapeInGEOM( 
 -  GEOM::GEOM_Gen_var theGeomEngine, SALOMEDS::Study_ptr theStudy,
 -  const TopoDS_Shape& theShape, const QString& theName,
 -  QString& theGeomObjEntry ) const
 -{
 -  theGeomObjEntry = "";
 -  GEOM::GEOM_Object_var aGeomObj;
 -
 -  if ( theGeomEngine->_is_nil() || theStudy->_is_nil() ||
 -       theShape.IsNull() ) {
 -    return aGeomObj._retn();
 -  }
 -
 -  std::ostringstream aStreamShape;
 -  // Write TopoDS_Shape in ASCII format to the stream
 -  BRepTools::Write( theShape, aStreamShape );
 -  // Returns the number of bytes that have been stored in the stream's buffer.
 -  int aSize = aStreamShape.str().size();
 -  // Allocate octect buffer of required size
 -  CORBA::Octet* anOctetBuf = SALOMEDS::TMPFile::allocbuf( aSize );
 -  // Copy ostrstream content to the octect buffer
 -  memcpy( anOctetBuf, aStreamShape.str().c_str(), aSize );
 -  // Create TMPFile
 -  SALOMEDS::TMPFile_var aSeqFile = new SALOMEDS::TMPFile( aSize, aSize, anOctetBuf, 1 );
 -
 -  // Restore shape from the stream and get the GEOM object
 -  GEOM::GEOM_IInsertOperations_var anInsOp = theGeomEngine->GetIInsertOperations( theStudy->StudyId() );
 -  aGeomObj = anInsOp->RestoreShape( aSeqFile );
 -  
 -  // Puplish the GEOM object
 -  if ( !aGeomObj->_is_nil() ) {
 -    QString aName = HYDROData_GeomTool::GetFreeName( theStudy, theName );
 -
 -    SALOMEDS::SObject_var aResultSO = 
 -      theGeomEngine->PublishInStudy( theStudy, SALOMEDS::SObject::_nil(), 
 -                                     aGeomObj, qPrintable( aName ) );
 -    if ( aResultSO->_is_nil() ) {
 -      aGeomObj = GEOM::GEOM_Object::_nil();
 -    }
 -    else
 -      theGeomObjEntry = aResultSO->GetID();
 -  }
 -
 -  return aGeomObj._retn();
 -}
 -
+ void HYDROData_CalculationCase::ClearRules( HYDROData_CalculationCase::DataTag theDataTag,
+                                             const bool theIsSetToUpdate )
  {
-   TDF_Label aRulesLab = myLab.FindChild( DataTag_CustomRules );
+   TDF_Label aRulesLab = myLab.FindChild( theDataTag );
    HYDROData_PriorityQueue::ClearRules( aRulesLab );
  
    // Indicate model of the need to update splitting
Simple merge
index bad592deedd2444f57fa8706e32827b28e3f1219,f8311d5a4f90c45bb0ef1dfa8626dd9995559e35..be424729bcabfd453be0b79ac0b5de76b01d7074
@@@ -230,9 -211,16 +213,16 @@@ HYDROGUI_InputPanel* HYDROGUI_Calculati
    connect( aPanel, SIGNAL( removeObjects() ), SLOT( onRemoveObjects() ) );
    connect( aPanel, SIGNAL( addGroups() ), SLOT( onAddGroups() ) );
    connect( aPanel, SIGNAL( removeGroups() ), SLOT( onRemoveGroups() ) );
+   connect( aPanel, SIGNAL( changeLandCoverMode( int ) ), SLOT( onChangeLandCoverMode( int ) ) );
+   connect( aPanel, SIGNAL( addLandCovers() ), SLOT( onAddLandCovers() ) );
+   connect( aPanel, SIGNAL( removeLandCovers() ), SLOT( onRemoveLandCovers() ) );
+   
    connect( aPanel, SIGNAL( orderChanged( bool& ) ), SLOT( onOrderChanged( bool& ) ) );
+   connect( aPanel, SIGNAL( orderLandCoverChanged( bool& ) ), SLOT( onOrderLandCoverChanged( bool& ) ) );
+     
    connect( aPanel, SIGNAL( Next( const int ) ), SLOT( onNext( const int ) ) );
 -  connect( aPanel, SIGNAL( Back( const int ) ), SLOT( onHideZones() ) );
 +  connect( aPanel, SIGNAL( Back( const int ) ), SLOT( onBack( const int ) ) );
    //connect( aPanel, SIGNAL( clicked( SUIT_DataObject* ) ), SLOT( onSelected( SUIT_DataObject* ) ) );
    connect( aPanel, SIGNAL( setMergeType( int, QString& ) ), SLOT( onSetMergeType( int, QString& ) ) );
    connect( aPanel, SIGNAL( moveZones( SUIT_DataObject*, const QList<SUIT_DataObject*>& ) ),
Simple merge
index 956015e624e16ab4f95388430448140b23ba1c3a,06a0ab41c2da1dcd98b9dd276a91b111a720b5c9..61f5453c82b9af3f3f129c9bab390edfee3fbbde
@@@ -1132,20 -1203,3 +1196,20 @@@ bool HYDROGUI_DataModel::rename( Handle
    }
    return true;
  }
- }
 +
 +void HYDROGUI_DataModel::setObjectVisibilityState( Handle(HYDROData_Entity) theModelObject,
 +                                                   HYDROGUI_DataObject* theObject )
 +{
 +  SUIT_AbstractModel* treeModel = 0;
 +  LightApp_Application* app = dynamic_cast<LightApp_Application*>( module()->application() );
 +  if ( app )
 +    treeModel = dynamic_cast<SUIT_AbstractModel*>( app->objectBrowser()->model() );
 +
 +  if ( treeModel )
 +  {
 +    HYDROGUI_Module* aModule = dynamic_cast<HYDROGUI_Module*>( module() );
 +    bool isVisible = aModule->isObjectVisible( -1, theModelObject );
 +    Qtx::VisibilityState aVisState = isVisible ? Qtx::ShownState : Qtx::HiddenState;
 +    treeModel->setVisibilityState( theObject->text( theObject->customData( Qtx::IdType ).toInt() ), aVisState, false );
 +  }
++}
Simple merge
Simple merge
index 7617747e95d2ee9bd85af1e567aa28083d6cfaeb,0a96e7986f8f9afffa28f14b8c0a29c913bfe757..3ebae5722f6977aa998ab7459a26809c074aa901
  #include "HYDROGUI_LocalCSOp.h"
  #include "HYDROGUI_RiverBottomOp.h"
  #include "HYDROGUI_ProfileInterpolateOp.h"
 +#include "HYDROGUI_RecognizeContoursOp.h"
  #include "HYDROGUI_SubmersibleOp.h"
+ #include "HYDROGUI_StricklerTableOp.h"
+ #include "HYDROGUI_DuplicateOp.h"
+ #include "HYDROGUI_LandCoverOp.h"
  
  #include <HYDROData_Document.h>
  #include <HYDROData_Obstacle.h>
index 3e551e0d2acce0c66adf28e1300ded19e84092ca,e9d10c02a64d6113ea30002b101de3dde8bfdd95..2669cae2c688749c6f47b0a557f1826a75a454cb
@@@ -107,11 -107,17 +107,18 @@@ enum OperationI
    RiverBottomContextId,
    ProfileInterpolateId,
  
 +  RecognizeContoursId,
    SubmersibleId,
    ImportPolylineId,
-   ExportPolylineId
+   ExportPolylineId,
  
+   ImportStricklerTableFromFileId,
+   ExportStricklerTableFromFileId,
+   EditStricklerTableId,
+   DuplicateStricklerTableId,
+   CreateLandCoverId,
+   EditLandCoverId
  };
  
  #endif
Simple merge
index 7370fa3150755baf2c1dde3169fcd584ee5a335c,45e356eba33aecb89808930ffa822a9753b8dbb1..c4e6b90b58cd43a80c3ec6fd3cc517c42edf1da4
@@@ -28,8 -28,8 +28,9 @@@
  #include <HYDROData_ImmersibleZone.h>
  #include <HYDROData_Tool.h>
  #include <HYDROData_Profile.h>
+ #include <HYDROData_LandCover.h>
  
 +#include <GeometryGUI.h>
  #include <GEOMBase.h>
  
  #include <GraphicsView_Viewer.h>
@@@ -774,39 -791,3 +792,39 @@@ Handle(Image_PixMap) HYDROGUI_Tool::Pix
  
      return pix;
  }
- }
 +
 +void HYDROGUI_Tool::DeleteGeomObjects( HYDROGUI_Module* theModule, const QStringList& theEntries )
 +{
 +  QStringList anEntryList;
 +
 +  // Get active SalomeApp_Study
 +  SalomeApp_Study* aStudy = NULL;
 +  if ( theModule && theModule->getApp() ) {
 +    aStudy = dynamic_cast<SalomeApp_Study*>( theModule->getApp()->activeStudy() );
 +  }
 +  if ( !aStudy ) {
 +    return;
 +  }
 + 
 +  // Get GEOM engine
 +  GEOM::GEOM_Gen_var aGeomEngine = GeometryGUI::GetGeomGen();
 +  if ( aGeomEngine->_is_nil() ) {
 +    return;
 +  }
 +  
 +  // Delete GEOM objects
 +  _PTR(StudyBuilder) aStudyBuilder( aStudy->studyDS()->NewBuilder() );
 +  foreach ( const QString anEntry, theEntries ) {
 +    _PTR(SObject) aSObject( aStudy->studyDS()->FindObjectID( qPrintable(anEntry) ) );
 +    if ( aSObject ) {
 +      GEOM::GEOM_Object_var aGeomObj = 
 +        GEOMBase::GetObjectFromIOR( aSObject->GetIOR().c_str() );
 +
 +      if ( !aGeomObj->_is_nil() ) {
 +        aGeomEngine->RemoveObject( aGeomObj );
 +      }
 +
 +      aStudyBuilder->RemoveObject( aSObject );
 +    }
 +  }
++}
Simple merge