Salome HOME
merge master 2015/06/04
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Zone.h
1 // Copyright (C) 2014-2015  EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
6 //
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
10 // Lesser General Public License for more details.
11 //
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
15 //
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
17 //
18
19 #ifndef HYDROGUI_ZONE_H
20 #define HYDROGUI_ZONE_H
21
22 #include "HYDROGUI_DataObject.h"
23
24 #include <HYDROData_Zone.h>
25
26 #include <QString>
27 #include <QColor>
28
29 /**
30  * \class HYDROGUI_Zone
31  * \brief Browser item presenting a zone, used for object browser tree creation.
32  *
33  * This is an Object Browser item that contains reference to a zone data structure 
34  * element inside.
35  */
36 class HYDROGUI_Zone : public HYDROGUI_DataObject
37 {
38 public:
39   /**
40    * Constructor.
41    * \param theParent parent data object
42    * \param theData reference to the corresponding object from data structure
43    * \param theParentEntry entry of the parent data object (for reference objects)
44    * \param theIsInOperation if true then the tree is used for a browser within an operation, it is false by default
45    */
46   HYDROGUI_Zone( SUIT_DataObject*       theParent,
47                  Handle(HYDROData_Zone) theData,
48                  const QString&         theParentEntry,
49                  const bool             theIsInOperation = false );
50     
51   /**
52    * Returns the text for the specified column.
53    */
54   QString     text( const int = NameId ) const;
55
56   /**
57    * Returns the color for the specified column.
58    */
59   QColor      color( const ColorRole theColorRole, const int theColumnId = NameId ) const;
60
61   /**
62    * Return true because zones are draggable.
63    */
64   bool        isDraggable() const { return true; }
65
66   bool        renameAllowed( const int = NameId ) const;
67   //bool        setName( const QString& );
68
69   /**
70    * Returns true if it is a zone which needs merge of bathymetries.
71    */
72   bool        isMergingNeed() const;
73
74   /**
75    * Returns the list of altidude object names.
76    */
77   QStringList getAltitudes() const;
78
79   /**
80    * Returns the merging type for conflict altidudes.
81    */
82   HYDROData_Zone::MergeAltitudesType getMergeType() const;
83
84   /**
85    * Set the merging type for conflict altidudes. 
86    * If the type is Merge_Object then use the second parameter to set the merge bathymetry.
87    */
88   void        setMergeType( int theMergeType, QString theAltitudeName = QString() );
89
90 private:
91   QString getRefObjectNames() const;
92   QString getAltitudeName() const;
93 };
94 #endif