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
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*>& ) ),
}
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 );
+ }
++}
#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>
RiverBottomContextId,
ProfileInterpolateId,
+ RecognizeContoursId,
SubmersibleId,
ImportPolylineId,
- ExportPolylineId
+ ExportPolylineId,
+ ImportStricklerTableFromFileId,
+ ExportStricklerTableFromFileId,
+ EditStricklerTableId,
+ DuplicateStricklerTableId,
+
+ CreateLandCoverId,
+ EditLandCoverId
};
#endif
#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>
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 );
+ }
+ }
++}