TopoDS_Shape& OutOutlet,
bool Create3dPres,
bool Create2dPres,
- std::set<int> InvInd)
+ std::set<int>& InvInd)
{
int aLower = InpProfiles.Lower(), anUpper = InpProfiles.Upper();
TopoDS_Shape& OutOutlet,
bool Create3dPres,
bool Create2dPres,
- std::set<int> InvInd)
+ std::set<int>& InvInd)
{
if (theProfiles.empty())
return;
AltitudePoints& theLeft,
AltitudePoints& theRight,
std::vector<AltitudePoints>& theMainProfiles,
- std::set<int> invalInd)
+ std::set<int>& invalInd)
{
AltitudePoints points;
size_t n = theProfiles.size();
AltitudePoints& theLeft,
AltitudePoints& theRight,
std::vector<AltitudePoints>& theMainProfiles,
- std::set<int> invalInd );
+ std::set<int>& invalInd );
static void PointToWire(const AltitudePoints& pnts, TopoDS_Wire& W );
TopoDS_Shape& OutOutlet,
bool Create3dPres,
bool Create2dPres,
- std::set<int> InvInd );
+ std::set<int>& InvInd );
static void Get2dFaceFrom3dPres(const TopoDS_Compound& cmp, TopoDS_Face& outF );
public:
HYDRODATA_EXPORT static void CreateProfilesFromDTM ( const HYDROData_SequenceOfObjects& InpProfiles,
- double ddz,
- double step,
- AltitudePoints& points,
- TopoDS_Shape& Out3dPres,
- TopoDS_Shape& Out2dPres,
- TopoDS_Shape& OutLeftB,
- TopoDS_Shape& OutRightB,
- TopoDS_Shape& OutInlet,
- TopoDS_Shape& OutOutlet,
- bool Create3dPres,
- bool Create2dPres,
- std::set<int> InvInd );
+ double ddz,
+ double step,
+ AltitudePoints& points,
+ TopoDS_Shape& Out3dPres,
+ TopoDS_Shape& Out2dPres,
+ TopoDS_Shape& OutLeftB,
+ TopoDS_Shape& OutRightB,
+ TopoDS_Shape& OutInlet,
+ TopoDS_Shape& OutOutlet,
+ bool Create3dPres,
+ bool Create2dPres,
+ std::set<int>& InvInd );
};
{
}
+void HYDROGUI_ListModel::setBackgroundColor(int theInd, QColor theColor)
+{
+ myColoredRow[theInd] = theColor;
+}
+
+void HYDROGUI_ListModel::clearAllBackgroundColors()
+{
+ myColoredRow.clear();
+}
+
+QColor HYDROGUI_ListModel::getBackgroundColor(int theInd) const
+{
+ if (myColoredRow.count( theInd ))
+ return myColoredRow[theInd];
+ else
+ return QColor();
+}
+
/**
*/
QVariant HYDROGUI_ListModel::data( const QModelIndex &theIndex, int theRole ) const
return QVariant();
}
break;
+ case Qt::BackgroundRole:
+ {
+ if( aColumn==0 && aRow >=0 && aRow < myObjects.count() && myColoredRow.contains(aRow))
+ {
+ QBrush aBackgr(myColoredRow[aRow]);
+ return aBackgr;
+ }
+ else
+ return QVariant();
+ }
case Qt::DecorationRole:
{
#include <HYDROData_Entity.h>
#include <QAbstractListModel>
#include <QPixmap>
+#include <QMap>
+#include <QColor>
const int HYDROGUI_VisibleRole = Qt::UserRole + 1;
const int HYDROGUI_EntryRole = Qt::UserRole + 2;
void undoLastMove();
+ void setBackgroundColor(int theInd, const QColor theColor);
+ QColor getBackgroundColor(int theInd) const;
+ void clearAllBackgroundColors ();
+
protected:
bool isObjectVisible( int theIndex ) const;
bool isDragAndDropAllowed( const QList<int>& theItems, const int theDropItem ) const;
Object2VisibleList myObjects, myPrevObjects;
QPixmap myEmpty, myEye;
+ QMap<int, QColor> myColoredRow;
bool myIsDecorationEnabled;
};
}
}
+void HYDROGUI_OrderedListWidget::setBackgroundColor (int theInd, QColor theColor)
+{
+ HYDROGUI_ListModel* aModel = getSourceModel();
+ if( aModel ) {
+ aModel->setBackgroundColor( theInd, theColor );
+ }
+}
+
+void HYDROGUI_OrderedListWidget::clearAllBackgroundColors ()
+{
+ HYDROGUI_ListModel* aModel = getSourceModel();
+ if( aModel ) {
+ aModel->clearAllBackgroundColors( );
+ }
+}
+
+
+ QColor HYDROGUI_OrderedListWidget::getBackgroundColor (int theInd) const
+ {
+ HYDROGUI_ListModel* aModel = getSourceModel();
+ if( aModel ) {
+ return aModel->getBackgroundColor( theInd );
+ }
+ }
+
/**
Returns the ordered list of objects.
@return the list of objects
QStringList getSelectedNames() const;
QStringList getAllNames() const;
+ void setBackgroundColor (int theInd, QColor theColor);
+ QColor getBackgroundColor (int theInd) const;
+ void clearAllBackgroundColors ();
+
void undoLastMove();
signals:
myAxes = new QComboBox( aParamGroup );
myAxes->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myDDZ = new QDoubleSpinBox( aParamGroup );
- myDDZ->setRange( 1E-2, 100 );
- myDDZ->setSingleStep( 1E-2 );
+ myDDZ->setRange( 0.1, 100 );
+ myDDZ->setSingleStep( 0.1 );
myDDZ->setValue( 0.1 );
myDDZ->setDecimals( 2 );
mySpatialStep = new QDoubleSpinBox( aParamGroup );
- mySpatialStep->setRange( 1E-2, 100 );
- mySpatialStep->setSingleStep( 1.0 );
+ mySpatialStep->setRange( 0.1, 100 );
+ mySpatialStep->setSingleStep( 0.1 );
mySpatialStep->setValue( 1 );
mySpatialStep->setDecimals( 2 );
return mySpatialStep->value();
}
+void HYDROGUI_StreamDlg::setBackgroundColorForProfileList (int theInd, QColor theColor)
+{
+ myProfiles->setBackgroundColor(theInd, theColor);
+}
+
+QColor HYDROGUI_StreamDlg::getBackgroundColorForProfileList (int theInd) const
+{
+ return myProfiles->getBackgroundColor(theInd);
+}
+
+void HYDROGUI_StreamDlg::clearAllBackgroundColorsForProfileList ()
+{
+ myProfiles->clearAllBackgroundColors();
+}
+
void setSpatialStep( const double );
double getSpatialStep() const;
+ void setBackgroundColorForProfileList (int theInd, QColor theColor);
+ QColor getBackgroundColorForProfileList (int theInd) const;
+ void clearAllBackgroundColorsForProfileList ();
+
signals:
void AddProfiles();
void RemoveProfiles( const QStringList& );
#include <SUIT_MessageBox.h>
#include <SUIT_Desktop.h>
+#include <QColor>
#include <OCCViewer_ViewManager.h>
#include <OCCViewer_ViewModel.h>
HYDROData_DTM::CreateProfilesFromDTM( aRefProfiles, ddz, ss, HYDROData_Bathymetry::AltitudePoints(), Out3dPres, Out2dPres, OutLeftB, OutRightB,
OutInlet, OutOutlet, true, true, InvInd);
- //TODO!! aPanel->my---;
+ aPanel->clearAllBackgroundColorsForProfileList();
+ for (std::set<int>::const_iterator it = InvInd.begin(); it != InvInd.end(); it++)
+ aPanel->setBackgroundColorForProfileList(*it, QColor(Qt::yellow));
aPrsDef.myInlet = TopoDS::Wire(OutInlet);
aPrsDef.myOutlet = TopoDS::Wire(OutOutlet);