#include <QFile>
#include <QStringList>
#include <QTextStream>
+#include <QSet>
#include <BRep_Tool.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <BRepTopAdaptor_FClass2d.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
static int aMaxNameId = INT_MAX;
+static int aMaxColorNb = 92000;
void HYDROData_Tool::WriteStringsToFile( QFile& theFile,
const QStringList& theStrings,
const QString& theSep )
return QColor( r, g, b );
}
+QColor HYDROData_Tool::GenerateRandColor()
+{
+ float aHue = ( rand()%1000 ) * 0.001f;
+
+ QColor aColor;
+ aColor.setHsl( (int)(aHue*255.), 200, 128 );
+ int r = aColor.red();
+ int g = aColor.green();
+ int b = aColor.blue();
+ return ( aColor.isValid() ? aColor : Qt::darkBlue );
+}
+
+void HYDROData_Tool::GenerateRepeatableRandColors(int nbColorsToGen, QVector<QColor>& theColors)
+{
+ for (int i = 1; i <= nbColorsToGen; i++)
+ theColors.append(HYDROData_Tool::GenerateRandColor());
+}
+
+bool HYDROData_Tool::GenerateNonRepeatableRandColors(int nbColorsToGen, QVector<QColor>& theColors)
+{
+ if (nbColorsToGen > aMaxColorNb)
+ return false;
+ QSet<int> Codes;
+ float aHue;
+ theColors.clear();
+ do
+ {
+ QColor aColor;
+ int H = rand()%360;
+ int S = rand()%256;
+ int Code = H*256+S;
+ if (Codes.contains(Code))
+ continue;
+ aColor.setHsl( H, S, 128 );
+ if (aColor.isValid())
+ {
+ theColors.append(aColor);
+ Codes.insert(Code);
+ }
+ } while (theColors.size() <= nbColorsToGen);
+ return true;
+}
+
+
bool HYDROData_Tool::IsNan( double theValue )
{
#ifdef WIN32
#include "HYDROData.h"
#include <QStringList>
#include <Precision.hxx>
+#include <QVector>
class HYDROData_Document;
class HYDROData_Entity;
class TopoDS_Shape;
class TopoDS_Wire;
class Quantity_Color;
+class QColor;
class HYDRODATA_EXPORT HYDROData_Tool {
* Computes Point State from TopAbs (simplified & limited method).
*/
- static TopAbs_State ComputePointState( const gp_XY& thePnt2d,
- const TopoDS_Face& theFace );
+ static TopAbs_State ComputePointState( const gp_XY& thePnt2d,
+ const TopoDS_Face& theFace );
static double GetAltitudeForEdge( const TopoDS_Edge& theEdge,
const gp_XY& thePoint,
static Quantity_Color toOccColor( const QColor& );
static QColor toQtColor( const Quantity_Color& );
+ static QColor GenerateRandColor();
+ static bool GenerateNonRepeatableRandColors(int nbColorsToGen, QVector<QColor>& theColors);
+ static void GenerateRepeatableRandColors(int nbColorsToGen, QVector<QColor>& theColors);
+
static bool IsNan( double theValue );
static bool IsInf( double theValue );
{
Handle(AIS_InteractiveContext) aCtx = aViewer->getAISContext();
if ( !aCtx.IsNull() )
- {
- int aCounter = 0;
+ {
for ( ; aRegionsIter.More(); aRegionsIter.Next() )
{
aRegion = Handle(HYDROData_Region)::DownCast( aRegionsIter.Value() );
Handle(HYDROData_Zone) aZone = Handle(HYDROData_Zone)::DownCast( aZonesIter.Value() );
if ( !aZone.IsNull() )
{
- QColor aFillingColor = GenerateDefaultZonesColor(++aCounter);
+ QColor aFillingColor = HYDROData_Tool::GenerateRandColor();
while (aFillingColor == Qt::red)
- aFillingColor = GenerateDefaultZonesColor(++aCounter);
+ aFillingColor = HYDROData_Tool::GenerateRandColor();
aZone->SetColor(aFillingColor);
}
}
}
-QColor HYDROGUI_CalculationOp::GenerateDefaultZonesColor( int theIndex,
- float theSaturation/* = 0.5*/,
- float theValue/* = 0.95*/ ) const
-{
- float aHue = ( rand()%1000 ) * 0.001f;
-
- QColor aColor;
- aColor.setHsl( (int)(aHue*255.), 128, 128 );
- int r = aColor.red();
- int g = aColor.green();
- int b = aColor.blue();
- return ( aColor.isValid() ? aColor : Qt::darkBlue );
-}
-
void HYDROGUI_CalculationOp::setRules( HYDROData_CalculationCase::DataTag theDataTag )
{
HYDROGUI_CalculationDlg* aPanel =
* Internal method that used to assign unique default colors for zones
*/
void AssignDefaultZonesColors();
- /**
- * Internal method that used to generate default color for zone
- * @param theIndex the index of color to be generated
- * @param theSaturation the saturation of the color in the range 0 to 1,
- * and the bigger it is, the stronger the color is. Grayish colors have
- * saturation near 0, very strong colors have saturation near 1.
- * The defalt value is 0.5.
- * @param theValue the value in the range 0 to 1, represents lightness or
- * brightness of the color. 0 is black, 1 is as far from black as possible.
- * The defalt value is 0.95.
- * \return the generated color
- */
- QColor GenerateDefaultZonesColor( int theIndex,
- float theSaturation = 0.5,
- float theValue = 0.95 ) const;
-
void setRules( HYDROData_CalculationCase::DataTag theDataTag );
bool createRegion( const QList<SUIT_DataObject*>& theZonesList );
}
if ( res )
- redisplayCurve();
+ redisplayCurve(false);
return res;
}
aRes = addPointsInternal( theSectionsMap );
if ( aRes )
- redisplayCurve();
+ redisplayCurve(false);
return aRes;
}
Handle(HYDROData_Stream) aStream =
Handle(HYDROData_Stream)::DownCast( anObject );
if ( !aStream.IsNull() )
- isStreamHasBottom = !aStream->GetBottomPolyline().IsNull();
+ isStreamHasBottom = !aStream->GetBottomPolyline().IsNull();
}
else if( anObjectKind == KIND_CHANNEL )
anIsChannel = true;
// Check if all selected objects are profiles
anAllAreProfiles = ( aNbOfSelectedProfiles > 0 ) &&
- ( aNbOfSelectedProfiles == aSeq.Length() );
+ ( aNbOfSelectedProfiles == aSeq.Length() );
// check the selected partitions
if( !anIsSelectedDataObjects && anIsObjectBrowser )
{
switch( aSelectedPartition )
{
- case KIND_IMAGE:
- theMenu->addAction( action( ImportImageId ) );
- break;
- case KIND_BATHYMETRY:
- theMenu->addAction( action( ImportBathymetryId ) );
- break;
- case KIND_ARTIFICIAL_OBJECT:
- theMenu->addAction( action( CreateChannelId ) );
- theMenu->addAction( action( CreateDigueId ) );
- break;
- case KIND_NATURAL_OBJECT:
- theMenu->addAction( action( CreateImmersibleZoneId ) );
- theMenu->addAction( action( CreateStreamId ) );
- break;
- case KIND_OBSTACLE:
- theMenu->addAction( action( ImportObstacleFromFileId ) );
- theMenu->addAction( action( CreateBoxId ) );
- theMenu->addAction( action( CreateCylinderId ) );
- break;
- case KIND_STRICKLER_TABLE:
- theMenu->addAction( action( ImportStricklerTableFromFileId ) );
- break;
- case KIND_LAND_COVER_MAP:
- theMenu->addAction( action( CreateLandCoverMapId ) );
- theMenu->addAction( action( ImportLandCoverMapId ) );
- break;
- case KIND_CALCULATION:
- theMenu->addAction( action( CreateCalculationId ) );
- break;
- case KIND_POLYLINEXY:
- theMenu->addAction( action( ImportPolylineId ) );
- theMenu->addAction( action( CreatePolylineId ) );
- break;
- case KIND_POLYLINE:
- theMenu->addAction( action( CreatePolyline3DId ) );
- break;
- case KIND_PROFILE:
- theMenu->addAction( action( CreateProfileId ) );
- theMenu->addAction( action( ImportProfilesId ) );
- theMenu->addAction( action( AllGeoreferencementId ) );
- break;
- case KIND_VISUAL_STATE:
- theMenu->addAction( action( SaveVisualStateId ) );
- break;
+ case KIND_IMAGE:
+ theMenu->addAction( action( ImportImageId ) );
+ break;
+ case KIND_BATHYMETRY:
+ theMenu->addAction( action( ImportBathymetryId ) );
+ break;
+ case KIND_ARTIFICIAL_OBJECT:
+ theMenu->addAction( action( CreateChannelId ) );
+ theMenu->addAction( action( CreateDigueId ) );
+ break;
+ case KIND_NATURAL_OBJECT:
+ theMenu->addAction( action( CreateImmersibleZoneId ) );
+ theMenu->addAction( action( CreateStreamId ) );
+ break;
+ case KIND_OBSTACLE:
+ theMenu->addAction( action( ImportObstacleFromFileId ) );
+ theMenu->addAction( action( CreateBoxId ) );
+ theMenu->addAction( action( CreateCylinderId ) );
+ break;
+ case KIND_STRICKLER_TABLE:
+ theMenu->addAction( action( ImportStricklerTableFromFileId ) );
+ break;
+ case KIND_LAND_COVER_MAP:
+ theMenu->addAction( action( CreateLandCoverMapId ) );
+ theMenu->addAction( action( ImportLandCoverMapId ) );
+ break;
+ case KIND_CALCULATION:
+ theMenu->addAction( action( CreateCalculationId ) );
+ break;
+ case KIND_POLYLINEXY:
+ theMenu->addAction( action( ImportPolylineId ) );
+ theMenu->addAction( action( CreatePolylineId ) );
+ break;
+ case KIND_POLYLINE:
+ theMenu->addAction( action( CreatePolyline3DId ) );
+ break;
+ case KIND_PROFILE:
+ theMenu->addAction( action( CreateProfileId ) );
+ theMenu->addAction( action( ImportProfilesId ) );
+ theMenu->addAction( action( AllGeoreferencementId ) );
+ break;
+ case KIND_VISUAL_STATE:
+ theMenu->addAction( action( SaveVisualStateId ) );
+ break;
}
theMenu->addSeparator();
}
theMenu->addAction( action( EditStreamId ) );
if ( action( RiverBottomContextId ) )
{
- theMenu->addAction( action( RiverBottomContextId ) );
- action( RiverBottomContextId )->setEnabled( !isStreamHasBottom );
+ theMenu->addAction( action( RiverBottomContextId ) );
+ action( RiverBottomContextId )->setEnabled( !isStreamHasBottom );
}
theMenu->addAction( action( ProfileInterpolateId ) );
theMenu->addSeparator();
theMenu->addAction( action( SetTransparencyId ) );
theMenu->addSeparator();
}
- } else if ( anAllAreProfiles ) {
+ }
+ else if ( anAllAreProfiles )
+ {
+ theMenu->addAction( action( EditProfileId ) );
theMenu->addAction( action( SelectedGeoreferencementId ) );
theMenu->addSeparator();
}
theMenu->addSeparator();
if( anIsImage || anIsPolyline || anIsPolyline3D ||
- anIsImmersibleZone || anIsZone || anIsRegion ||
- anIsBathymetry || anIsObstacle || anIsStream ||
- anIsChannel || anIsDigue || anIsDummyObject3D ||
- anIsValidProfile || anIsGroup || anIsLandCoverMap )
+ anIsImmersibleZone || anIsZone || anIsRegion ||
+ anIsBathymetry || anIsObstacle || anIsStream ||
+ anIsChannel || anIsDigue || anIsDummyObject3D ||
+ anIsValidProfile || anIsGroup || anIsLandCoverMap )
{
if( anIsHiddenInSelection )
theMenu->addAction( action( ShowId ) );
theMenu->addAction( action( HideAllId ) );
theMenu->addSeparator();
}
-
+
if ( anIsOCCView || anIsVTKView )
{
theMenu->addSeparator();
#include "HYDROGUI_Module.h"
#include "HYDROGUI_Tool.h"
#include "HYDROGUI_AISTrihedron.h"
+#include "HYDROGUI_Tool2.h"
#include <CurveCreator_Widget.h>
#include <CurveCreator_ICurve.hxx>
#include <CurveCreator_Utils.hxx>
+#include <HYDROGUI_CurveCreatorProfile.h>
+#include <CurveCreator_Displayer.hxx>
#include <OCCViewer_ViewPort3d.h>
#include <OCCViewer_Utilities.h>
#include <QMouseEvent>
#include <QSplitter>
#include <QSettings>
+#include <QListWidget>
+#include <QPushButton>
+
const QString splitter_key = "HYDROGUI_ProfileDlg::splitter";
-HYDROGUI_ProfileDlg::HYDROGUI_ProfileDlg( HYDROGUI_Module* theModule, const QString& theTitle )
+HYDROGUI_ProfileDlg::HYDROGUI_ProfileDlg( HYDROGUI_Module* theModule, const QString& theTitle,
+ bool theSingleProfileMode )
: HYDROGUI_ViewerDlg( theModule, theTitle, true ),
- myName( NULL )
+ myName( NULL ), myProfileNames (NULL), myProfilesPointer (NULL),
+ mySingleProfileMode (theSingleProfileMode)
{
QFrame* name_frame = new QFrame( mainFrame() );
QHBoxLayout* name_layout = new QHBoxLayout( name_frame );
name_layout->setMargin( 0 );
QLabel* aNameLabel = new QLabel(tr("PROFILE_NAME_TLT"), this);
name_layout->addWidget(aNameLabel);
- myName = new QLineEdit(this);
- name_layout->addWidget(myName);
+ if (theSingleProfileMode)
+ {
+ myName = new QLineEdit(this);
+ name_layout->addWidget(myName);
+ }
+ else
+ {
+ myProfileNames = new QListWidget(this);
+ myProfileNames->setSelectionMode(QAbstractItemView::SingleSelection);
+ //myProfileNames->setEditable(true);
+ //myProfileNames->setInsertPolicy(QComboBox::InsertPolicy::NoInsert);
+ name_layout->addWidget(myProfileNames);
+ //
+ myAddProfBtn = new QPushButton("Add Profile(s)", this);
+ myRemProfBtn = new QPushButton("Remove Profile(s)", this);
+ name_layout->addWidget(myAddProfBtn);
+ name_layout->addWidget(myRemProfBtn);
+ }
insertWidget( name_frame, 0, 0 );
connect( myEditorWidget, SIGNAL( selectionChanged() ), this, SIGNAL( selectionChanged() ) );
connect( myEditorWidget, SIGNAL( subOperationStarted(QWidget*, bool) ), this, SLOT( processStartedSubOperation(QWidget*, bool) ) );
connect( myEditorWidget, SIGNAL( subOperationFinished(QWidget*) ), this, SLOT( processFinishedSubOperation(QWidget*) ) );
-
+ if (!mySingleProfileMode)
+ {
+ //connect( myProfileNames, SIGNAL( currentTextChanged(QString)), SLOT(ProfileNameChanged(QString)) );
+ connect( myProfileNames, SIGNAL( itemSelectionChanged()), this, SLOT( onProfileIndexChanged()));
+ connect( myProfileNames, SIGNAL( itemChanged(QListWidgetItem*)), this, SLOT( onProfileNameChanged(QListWidgetItem*)));
+ connect( myAddProfBtn, SIGNAL( clicked(bool)), this, SLOT( onAddBtnPressed(bool)));
+ connect( myRemProfBtn, SIGNAL( clicked(bool)), this, SLOT( onRemoveBtnPressed(bool)));
+ }
myAddElementBox->hide();
QList<int> sizes;
myEditorWidget->reset();
myEditorWidget->setActionMode( CurveCreator_Widget::AdditionMode );
viewer()->setTrihedronShown( false ); // Issue #548
+ myProfileNames->clear();
}
void HYDROGUI_ProfileDlg::setProfileName( const QString& theName )
{
+ if (!mySingleProfileMode)
+ return;
myName->setText(theName);
+ //myProfileNames->setItemText(theInd, theName); //should used TODO check this
+ //myName->setText(theName);
+}
+
+void HYDROGUI_ProfileDlg::eraseProfile( int index )
+{
+ myProfileNames->takeItem(index);
}
-QString HYDROGUI_ProfileDlg::getProfileName() const
+void HYDROGUI_ProfileDlg::addProfileName( const QString& theName, const QColor& theColor )
{
- return myName->text();
+ if (mySingleProfileMode)
+ return;
+ myProfileNames->blockSignals(true);
+ myProfileNames->addItem(theName);
+ int count = myProfileNames->count();
+ QListWidgetItem* anItem = myProfileNames->item(count - 1);
+ anItem->setFlags (anItem->flags () | Qt::ItemIsEditable);
+ QPixmap SPixmap(16, 16);
+ SPixmap.fill(theColor);
+ QIcon SIcon(SPixmap);
+ anItem->setIcon( SIcon );
+ //anItem->setBackground(QBrush(theColor));
+ if (count == 1)
+ anItem->setSelected(true);
+ myProfileNames->blockSignals(false);
+}
+
+QStringList HYDROGUI_ProfileDlg::getProfileNames() const
+{
+ QStringList aProfNames;
+ if (mySingleProfileMode)
+ aProfNames << myName->text();
+ else
+ for (int i = 0; i < myProfileNames->count(); i++)
+ aProfNames << myProfileNames->item(i)->text();
+ return aProfNames;
}
void HYDROGUI_ProfileDlg::setProfile( CurveCreator_ICurve* theProfile )
myEditorWidget->setSelectedSections( aSections );
}
+void HYDROGUI_ProfileDlg::setProfilesPointer(std::vector<HYDROGUI_CurveCreatorProfile*>* theProfilesPointer)
+{
+ myProfilesPointer = theProfilesPointer;
+}
+
QList<int> HYDROGUI_ProfileDlg::getSelectedSections()
{
return myEditorWidget->getSelectedSections();
}
+void HYDROGUI_ProfileDlg::switchToFirstProfile()
+{
+ emit onProfileIndexChanged();
+}
+
/**
* Redirect the delete action to editor widget
*/
myAddElementBox->hide();
}
+//void HYDROGUI_ProfileDlg::ProfileNameChanged(QString theNewText)
+//{
+// myProfileNames->setItemText( myProfileNames->currentIndex(), theNewText ); //TODO???
+//}
+
+void HYDROGUI_ProfileDlg::onProfileIndexChanged()
+{
+ int theIndex = GetProfileSelectionIndex();
+ if (theIndex > -1)
+ SwitchToProfile(theIndex);
+}
+
+int HYDROGUI_ProfileDlg::GetProfileSelectionIndex()
+{
+ if (!myProfilesPointer)
+ return -1;
+ QModelIndexList MI = myProfileNames->selectionModel()->selectedIndexes();
+ if (MI.size() != 1)
+ return -1;
+ return MI.first().row();
+}
+
+void HYDROGUI_ProfileDlg::BlockProfileNameSignals(bool state)
+{
+ myProfileNames->blockSignals(state);
+}
+
+void HYDROGUI_ProfileDlg::SwitchToProfile(int theIndex)
+{
+ myEditorWidget->setCurve(NULL);
+ myEditorWidget->reset();
+ myEditorWidget->setActionMode( CurveCreator_Widget::AdditionMode );
+ myEditorWidget->setSelectedSections(QList<int>());
+ setProfile( (*myProfilesPointer)[theIndex] );
+ for (int i = 0; i < myProfilesPointer->size(); i++)
+ {
+ HYDROGUI_CurveCreatorProfile* aCurve = (*myProfilesPointer)[i];
+ if (i == theIndex)
+ {
+ aCurve->myLineWidth = 3;
+ Handle(AIS_InteractiveObject) anAISObject = aCurve->getAISObject();
+ if (anAISObject)
+ anAISObject->SetWidth(3);
+ }
+ else
+ {
+ aCurve->myLineWidth = 1;
+ Handle(AIS_InteractiveObject) anAISObject = aCurve->getAISObject();
+ if (anAISObject)
+ anAISObject->SetWidth(1);
+ }
+ }
+ (*myProfilesPointer)[0]->getDisplayer()->Update();
+}
+
+void HYDROGUI_ProfileDlg::onAddBtnPressed(bool)
+{
+ emit AddProfiles();
+}
+
+void HYDROGUI_ProfileDlg::onRemoveBtnPressed(bool)
+{
+ int theIndex = GetProfileSelectionIndex();
+ if (theIndex > -1)
+ emit RemoveProfile(theIndex);
+}
+
+void HYDROGUI_ProfileDlg::onProfileNameChanged(QListWidgetItem* item)
+{
+ int ind = GetProfileSelectionIndex();
+ //if (ind > -1)
+ //TODO
+ QString text = item->text();
+}
+
+void HYDROGUI_ProfileDlg::SetSingleProfileMode(bool SingleMode)
+{
+ mySingleProfileMode = SingleMode;
+}
+
+bool HYDROGUI_ProfileDlg::GetSingleProfileMode() const
+{
+ return mySingleProfileMode;
+}
+
Handle(AIS_Trihedron) HYDROGUI_ProfileDlg::trihedron()
{
- SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
- Handle(AIS_Trihedron) aTrihedron =
- HYDROGUI_AISTrihedron::createTrihedron( aResMgr->doubleValue( "3DViewer", "trihedron_size", viewer()->trihedronSize() ) );
- return aTrihedron;
+ SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+ Handle(AIS_Trihedron) aTrihedron =
+ HYDROGUI_AISTrihedron::createTrihedron( aResMgr->doubleValue( "3DViewer", "trihedron_size", viewer()->trihedronSize() ) );
+ return aTrihedron;
}
#include "HYDROGUI_ViewerDlg.h"
#include <AIS_InteractiveContext.hxx>
+#include <vector>
class CurveCreator_Widget;
class CurveCreator_ICurve;
class QGroupBox;
class QLineEdit;
class QLabel;
+class QListWidget;
+class HYDROGUI_CurveCreatorProfile;
+class HYDROData_SequenceOfObjects;
+class QListWidgetItem;
class HYDROGUI_ProfileDlg : public HYDROGUI_ViewerDlg
{
Q_OBJECT
public:
- HYDROGUI_ProfileDlg( HYDROGUI_Module* theModule, const QString& theTitle );
+ HYDROGUI_ProfileDlg( HYDROGUI_Module* theModule, const QString& theTitle, bool theSingleProfileMode );
virtual ~HYDROGUI_ProfileDlg();
- void setProfileName( const QString& theName );
- QString getProfileName() const;
+ void setProfileName( const QString& theName );
+ void addProfileName( const QString& theName, const QColor& theColor );
+ void eraseProfile( int index );
+ QStringList getProfileNames() const;
void setProfile( CurveCreator_ICurve* theProfile );
+ void setProfilesPointer(std::vector<HYDROGUI_CurveCreatorProfile*>* theProfilesPointer);
+ void switchToFirstProfile();
+ void SetSingleProfileMode(bool SingleMode);
+ bool GetSingleProfileMode() const;
+ void SwitchToProfile(int theIndex);
+ void BlockProfileNameSignals(bool state);
+ int GetProfileSelectionIndex();
void reset();
protected slots:
void processStartedSubOperation( QWidget*, bool );
void processFinishedSubOperation( QWidget* );
+ //void ProfileNameChanged(QString);
+ void onProfileIndexChanged();
+ void onAddBtnPressed(bool);
+ void onRemoveBtnPressed(bool);
+ void onProfileNameChanged(QListWidgetItem* item);
signals:
void createPreview( QString );
void widgetCreated(QWidget*);
void subOperationStarted(QWidget*);
void subOperationFinished(QWidget*);
+ void AddProfiles();
+ void RemoveProfile(int);
+
protected:
virtual Handle(AIS_Trihedron) trihedron();
private:
QLineEdit* myName;
+ QListWidget* myProfileNames;
+ QPushButton* myAddProfBtn;
+ QPushButton* myRemProfBtn;
+public://temp TODO
CurveCreator_Widget* myEditorWidget;
QGroupBox* myAddElementBox;
+ std::vector<HYDROGUI_CurveCreatorProfile*>* myProfilesPointer;
+ bool mySingleProfileMode;
};
#endif
#include <HYDROData_Profile.h>
#include <HYDROGUI_CurveCreatorProfile.h>
#include <HYDROGUI_DeleteOp.h>
+#include <HYDROData_Tool.h>
#include <CurveCreator_Displayer.hxx>
+#include <HYDROData_Entity.h>
+#include <QSet>
#include <LightApp_Application.h>
#include <LightApp_SelectionMgr.h>
//static int ZValueIncrement = 0;
+static void ProfileUZToCurveCrProfile(const Handle(HYDROData_ProfileUZ)& aProfileUZ,
+ HYDROGUI_CurveCreatorProfile* outProfile)
+{
+ CurveCreator::Coordinates aCurveCoords;
+ CurveCreator::SectionsMap aSectionsMap;
+
+ HYDROData_ProfileUZ::PointsList aSectPointsList = aProfileUZ->GetPoints();
+ CurveCreator::PosPointsList aPoints;
+ for ( int k = 1, aNbPoints = aSectPointsList.Size(); k <= aNbPoints; ++k )
+ {
+ const HYDROData_ProfileUZ::Point& aSectPoint = aSectPointsList.Value( k );
+ aCurveCoords.clear();
+ aCurveCoords.push_back( aSectPoint.X() );
+ aCurveCoords.push_back( aSectPoint.Y() );
+
+ CurveCreator_PosPoint* aPosPoint = new CurveCreator_PosPoint( k, aCurveCoords );
+ aPoints.push_back( aPosPoint );
+ }
+
+ aSectionsMap[0] = aPoints;
+ outProfile->addPointsInternal( aSectionsMap );
+
+ HYDROData_ProfileUZ::SectionType aSectType = aProfileUZ->GetSectionType( 0 );
+
+ CurveCreator::SectionType aCurveType = CurveCreator::Polyline;
+ if( aSectType == HYDROData_ProfileUZ::SECTION_SPLINE )
+ aCurveType = CurveCreator::Spline;
+
+ outProfile->setSectionType( 0, aCurveType );
+}
+
+static int CurveCrProfileToHProfile(const HYDROGUI_CurveCreatorProfile* outProfile,
+ Handle(HYDROData_Profile) theProfileObj,
+ const QString theProfileName,
+ bool IsEdit)
+{
+ if( theProfileObj.IsNull() )
+ return 0;
+
+ Handle(HYDROData_ProfileUZ) aProfileUZ = theProfileObj->GetProfileUZ();
+ if ( aProfileUZ.IsNull() )
+ return 0;
+
+ theProfileObj->SetName(theProfileName);
+
+ HYDROData_ProfileUZ::PointsList aProfileParamPoints;
+
+ Handle(TColgp_HArray1OfPnt) aCurveCoords = outProfile->GetDifferentPoints( 0 );
+ if ( aCurveCoords.IsNull() || aCurveCoords->Size() <= 2 )
+ return -1;
+
+ for ( int k = aCurveCoords->Lower(); k <= aCurveCoords->Upper() ; k++ )
+ {
+ HYDROData_ProfileUZ::Point aProfileParamPoint;
+
+ aProfileParamPoint.SetX( aCurveCoords->Value( k ).X() );
+ aProfileParamPoint.SetY( aCurveCoords->Value( k ).Y() );
+
+ aProfileParamPoints.Append( aProfileParamPoint );
+ }
+ theProfileObj->SetParametricPoints( aProfileParamPoints );
+
+ HYDROData_ProfileUZ::SectionType aSectType = HYDROData_ProfileUZ::SECTION_POLYLINE;
+ if ( outProfile->getSectionType( 0 ) == CurveCreator::Spline )
+ aSectType = HYDROData_ProfileUZ::SECTION_SPLINE;
+
+ aProfileUZ->SetSectionType( 0, aSectType );
+
+ if ( !IsEdit )
+ theProfileObj->SetBorderColor( theProfileObj->DefaultBorderColor() );
+
+ // At first we update the child u,z profile object
+ aProfileUZ->Changed( HYDROData_Entity::Geom_2d );
+ aProfileUZ->Update();
+
+ // And now we update our edited object
+ theProfileObj->Update();
+ return 1;
+}
+
HYDROGUI_ProfileOp::HYDROGUI_ProfileOp( HYDROGUI_Module* theModule, bool theIsEdit )
-: HYDROGUI_Operation( theModule ), myIsEdit(theIsEdit), myProfile(NULL)
+: HYDROGUI_Operation( theModule ), myIsEdit(theIsEdit),
+ myDisplayer (NULL), mySingleProfileMode (false)
{
setName( theIsEdit ? tr( "EDIT_PROFILE" ) : tr( "CREATE_PROFILE" ) );
}
/**
* Checks whether there are some to delete
*/
+#include <CurveCreator_Widget.h>
bool HYDROGUI_ProfileOp::deleteEnabled()
{
HYDROGUI_ProfileDlg* aPanel = (HYDROGUI_ProfileDlg*)inputPanel();
void HYDROGUI_ProfileOp::startOperation()
{
- if( myProfile )
- delete myProfile;
+ if (!myProfiles.empty())
+ {
+ for (int i = 0; i < myProfiles.size(); i++)
+ {
+ delete myProfiles[i];
+ myProfiles[i] = NULL;
+ }
+ myProfiles.clear();
+ }
+
+ if (!myIsEdit)
+ myEditedObjects.Clear();
- myProfile = new HYDROGUI_CurveCreatorProfile();
+ if (myCurveToProfile.IsEmpty())
+ myCurveToProfile.Clear();
+ if( myIsEdit && isApplyAndClose() )
+ myEditedObjects = HYDROGUI_Tool::GetSelectedObjects(module());
+
+ int lenP = myEditedObjects.Length();
+ myProfiles.resize(lenP == 0 ? 1 : myEditedObjects.Length());
+ for (int i = 0; i < myProfiles.size(); i++)
+ myProfiles[i] = new HYDROGUI_CurveCreatorProfile();
+
+ mySingleProfileMode = myEditedObjects.IsEmpty() || lenP == 1;
HYDROGUI_Operation::startOperation();
HYDROGUI_ProfileDlg* aPanel = (HYDROGUI_ProfileDlg*)inputPanel();
+ aPanel->myEditorWidget->setCurve(NULL);
aPanel->reset();
setPreviewManager( aPanel->viewManager() );
setCursor();
- if( myIsEdit )
- if ( isApplyAndClose() )
- myEditedObject = Handle(HYDROData_Profile)::DownCast( HYDROGUI_Tool::GetSelectedObject( module() ) );
-
- QString aProfileName;
- if( !myEditedObject.IsNull() )
+ aPanel->SetSingleProfileMode(mySingleProfileMode);
+ QMap<HYDROGUI_CurveCreatorProfile*, QColor> CurveToColor;
+ if( lenP )
{
- Handle(HYDROData_ProfileUZ) aProfileUZ = myEditedObject->GetProfileUZ( false );
- if ( !aProfileUZ.IsNull() )
+ for (int i = 1; i <= lenP; i++)
{
- CurveCreator::Coordinates aCurveCoords;
- CurveCreator::SectionsMap aSectionsMap;
-
- HYDROData_ProfileUZ::PointsList aSectPointsList = aProfileUZ->GetPoints();
- CurveCreator::PosPointsList aPoints;
- for ( int k = 1, aNbPoints = aSectPointsList.Size(); k <= aNbPoints; ++k )
+ Handle(HYDROData_Profile) aCProfile = Handle(HYDROData_Profile)::DownCast(myEditedObjects(i));
+ QString aProfileName;
+ if( !aCProfile.IsNull() )
{
- const HYDROData_ProfileUZ::Point& aSectPoint = aSectPointsList.Value( k );
- aCurveCoords.clear();
- aCurveCoords.push_back( aSectPoint.X() );
- aCurveCoords.push_back( aSectPoint.Y() );
-
- CurveCreator_PosPoint* aPosPoint = new CurveCreator_PosPoint( k, aCurveCoords );
- aPoints.push_back( aPosPoint );
+ Handle(HYDROData_ProfileUZ) aProfileUZ = aCProfile->GetProfileUZ( false );
+ if ( !aProfileUZ.IsNull() )
+ {
+ HYDROGUI_CurveCreatorProfile* CP = new HYDROGUI_CurveCreatorProfile();
+ myProfiles[i-1] = CP;
+ ProfileUZToCurveCrProfile(aProfileUZ, CP);
+ myCurveToProfile.Bind(CP, aCProfile);
+ }
}
+ }
+ int ext = myCurveToProfile.Extent(); //ext should be equal to lenP
+ QVector<QColor> PColors;
+ if (!mySingleProfileMode)
+ HYDROData_Tool::GenerateRepeatableRandColors(ext, PColors);
+ else
+ PColors << QColor(0,0,255); //default color
+
+ for (int i = 0; i < myProfiles.size(); i++)
+ {
+ HYDROGUI_CurveCreatorProfile* CC = myProfiles[i];
+ const Handle(HYDROData_Profile)& CP = myCurveToProfile.Find(CC);
+ const QColor& CurCol = PColors[i];
+ CurveToColor[CC] = CurCol;
+ const QString& profName = CP->GetName();
+ const QColor& PColor = CurCol;
+ if (!mySingleProfileMode)
+ aPanel->addProfileName(profName, PColor);
+ else
+ aPanel->setProfileName(profName);
+ }
+ }
- aSectionsMap[0] = aPoints;
- myProfile->addPointsInternal( aSectionsMap );
+ if (!myIsEdit)
+ {
+ QString aProfileName = HYDROGUI_Tool::GenerateObjectName( module(), tr( "DEFAULT_PROFILE_NAME" ) );
+ aPanel->setProfileName( aProfileName );
+ }
- HYDROData_ProfileUZ::SectionType aSectType = aProfileUZ->GetSectionType( 0 );
+ if (!myProfiles.empty())
+ {
+ aPanel->setProfile( myProfiles[0] );
+ aPanel->setProfilesPointer( &myProfiles );
+ }
+ displayPreviews(CurveToColor, 0, myProfiles.size(), true, true );
+}
- CurveCreator::SectionType aCurveType = CurveCreator::Polyline;
- if( aSectType == HYDROData_ProfileUZ::SECTION_SPLINE )
- aCurveType = CurveCreator::Spline;
+void HYDROGUI_ProfileOp::onAddProfiles()
+{
+ if( !myIsEdit )
+ return;
- myProfile->setSectionType( 0, aCurveType );
- }
+ QSet<QString> edObjNamesMap;
+ for (int i = 1; i <= myEditedObjects.Length(); i++)
+ edObjNamesMap.insert( myEditedObjects(i)->GetName());
- aProfileName = myEditedObject->GetName();
- }
- else
+ HYDROData_SequenceOfObjects aSelectedObj = HYDROGUI_Tool::GetSelectedObjects( module() );;
+ int ExistingProfLen = myEditedObjects.Length();
+ for (int i = 1; i <= aSelectedObj.Length(); i++)
{
- aProfileName = HYDROGUI_Tool::GenerateObjectName( module(), tr( "DEFAULT_PROFILE_NAME" ) );
+ Handle(HYDROData_Entity) CurProf = Handle(HYDROData_Entity)::DownCast(aSelectedObj(i));
+ if (CurProf.IsNull())
+ continue;
+ if (!edObjNamesMap.contains(CurProf->GetName()))
+ myEditedObjects.Append(CurProf);
}
- aPanel->setProfileName( aProfileName );
- aPanel->setProfile( myProfile );
- displayPreview();
+ int NewLen = myEditedObjects.Length();
+ myProfiles.resize(myEditedObjects.Length());
+ for (int i = myProfiles.size() - 1; i < myEditedObjects.Length(); i++)
+ myProfiles[i] = new HYDROGUI_CurveCreatorProfile();
+
+ HYDROGUI_ProfileDlg* aPanel = (HYDROGUI_ProfileDlg*)inputPanel();
+ QMap<HYDROGUI_CurveCreatorProfile*, QColor> CurveToColor;
+ if( NewLen - ExistingProfLen )
+ {
+ //TODO move to ext func!
+ for (int i = ExistingProfLen + 1; i <= NewLen; i++)
+ {
+ Handle(HYDROData_Profile) aCProfile = Handle(HYDROData_Profile)::DownCast(myEditedObjects(i));
+ QString aProfileName;
+ if( !aCProfile.IsNull() )
+ {
+ Handle(HYDROData_ProfileUZ) aProfileUZ = aCProfile->GetProfileUZ( false );
+ if ( !aProfileUZ.IsNull() )
+ {
+ HYDROGUI_CurveCreatorProfile* CP = new HYDROGUI_CurveCreatorProfile();
+ myProfiles[i-1] = CP;
+ ProfileUZToCurveCrProfile(aProfileUZ, CP);
+ myCurveToProfile.Bind(CP, aCProfile);
+ }
+ }
+ }
+ //int ext = myCurveToProfile.Extent(); //ext should be equal to lenP
+ QVector<QColor> PColors;
+ HYDROData_Tool::GenerateRepeatableRandColors(NewLen - ExistingProfLen, PColors);
+
+ for (int i = ExistingProfLen; i < NewLen; i++)
+ {
+ HYDROGUI_CurveCreatorProfile* CC = myProfiles[i];
+ const Handle(HYDROData_Profile)& CP = myCurveToProfile.Find(CC);
+ const QColor& CurCol = PColors[i-ExistingProfLen];
+ CurveToColor[CC] = CurCol;
+ const QString& profName = CP->GetName();
+ const QColor& PColor = CurCol;
+ if (!mySingleProfileMode)
+ aPanel->addProfileName(profName, PColor);
+ else
+ aPanel->setProfileName(profName);
+ }
+ }
+ displayPreviews(CurveToColor, ExistingProfLen, NewLen, false, false);
}
void HYDROGUI_ProfileOp::abortOperation()
HYDROGUI_InputPanel* HYDROGUI_ProfileOp::createInputPanel() const
{
- HYDROGUI_ProfileDlg* aDlg = new HYDROGUI_ProfileDlg( module(), getName() );
+ HYDROGUI_ProfileDlg* aDlg = new HYDROGUI_ProfileDlg( module(), getName(), mySingleProfileMode );
+ connect( aDlg, SIGNAL( AddProfiles() ), this,
+ SLOT( onAddProfiles() ) );
+ connect( aDlg, SIGNAL( RemoveProfile(int) ), this,
+ SLOT( onRemoveProfile(int) ) );
return aDlg;
}
if ( !aPanel )
return false;
- QString aProfileName = aPanel->getProfileName().simplified();
- if ( aProfileName.isEmpty() )
+ QStringList aProfileNames = aPanel->getProfileNames();
+ QVector<QString> aProfileNamesFiltered;
+ int i = 0;
+ foreach (QString profName, aProfileNames)
{
- theErrorMsg = tr( "INCORRECT_OBJECT_NAME" );
- return false;
- }
-
- if( !myIsEdit || ( !myEditedObject.IsNull() && myEditedObject->GetName() != aProfileName ) )
- {
- // check that there are no other objects with the same name in the document
- Handle(HYDROData_Entity) anObject = HYDROGUI_Tool::FindObjectByName( module(), aProfileName );
- if( !anObject.IsNull() )
+ i++;
+ if ( profName.isEmpty() )
{
- theErrorMsg = tr( "OBJECT_EXISTS_IN_DOCUMENT" ).arg( aProfileName );
- return false;
+ theErrorMsg = tr( "INCORRECT_OBJECT_NAME" ); //?
+ continue;
}
+ Handle(HYDROData_Entity) anObject = HYDROGUI_Tool::FindObjectByName( module(), profName );
+ if( !myIsEdit || (!anObject.IsNull() && myEditedObjects(i)->GetName() != anObject->GetName() ) )
+ {
+ profName = HYDROData_Tool::GenerateObjectName(doc(), "Profile");
+ //theErrorMsg = tr( "OBJECT_EXISTS_IN_DOCUMENT" ).arg( profName );
+ continue;
+ }
+ aProfileNamesFiltered.append(profName);
}
-
- Handle(HYDROData_Profile) aProfileObj;
- if( myIsEdit ){
- aProfileObj = myEditedObject;
- }
- else{
- aProfileObj = Handle(HYDROData_Profile)::DownCast( doc()->CreateObject( KIND_PROFILE ) );
- }
-
- if( aProfileObj.IsNull() )
- return false;
-
- Handle(HYDROData_ProfileUZ) aProfileUZ = aProfileObj->GetProfileUZ();
- if ( aProfileUZ.IsNull() )
- return false;
-
- aProfileObj->SetName(aProfileName);
-
- HYDROData_ProfileUZ::PointsList aProfileParamPoints;
-
- Handle(TColgp_HArray1OfPnt) aCurveCoords = myProfile->GetDifferentPoints( 0 );
- if ( aCurveCoords.IsNull() || aCurveCoords->Size() <= 2 )
- {
- theErrorMsg = tr( "NUMBER_OF_PROFILE_POINTS_INCORRECT" );
- return false;
- }
-
- for ( int k = aCurveCoords->Lower(); k <= aCurveCoords->Upper() ; k++ )
- {
- HYDROData_ProfileUZ::Point aProfileParamPoint;
-
- aProfileParamPoint.SetX( aCurveCoords->Value( k ).X() );
- aProfileParamPoint.SetY( aCurveCoords->Value( k ).Y() );
-
- aProfileParamPoints.Append( aProfileParamPoint );
- }
- aProfileObj->SetParametricPoints( aProfileParamPoints );
-
- HYDROData_ProfileUZ::SectionType aSectType = HYDROData_ProfileUZ::SECTION_POLYLINE;
- if ( myProfile->getSectionType( 0 ) == CurveCreator::Spline )
- aSectType = HYDROData_ProfileUZ::SECTION_SPLINE;
-
- aProfileUZ->SetSectionType( 0, aSectType );
-
- if ( !myIsEdit )
- {
- aProfileObj->SetBorderColor( aProfileObj->DefaultBorderColor() );
- }
-
- // At first we update the child u,z profile object
- aProfileUZ->Changed( HYDROData_Entity::Geom_2d );
- aProfileUZ->Update();
-
- // And now we update our edited object
- aProfileObj->Update();
- module()->setIsToUpdate( aProfileObj );
-
+ //
theUpdateFlags = UF_Model;
- if ( myIsEdit )
+ if (myIsEdit)
+ {
+ for (int i = 1; i <= myEditedObjects.Size(); i++)
+ {
+ Handle(HYDROData_Profile) HProf = Handle(HYDROData_Profile)::DownCast(myEditedObjects(i));
+ int stat = CurveCrProfileToHProfile(myProfiles[i-1], HProf, aProfileNamesFiltered[i-1], true);
+ if (stat == 0)
+ continue;
+ else if (stat == -1)
+ {
+ theErrorMsg = tr( "NUMBER_OF_PROFILE_POINTS_INCORRECT" ); //TODO resolve this
+ continue;
+ }
+ module()->setIsToUpdate( HProf );
+ }
theUpdateFlags |= UF_OCCViewer | UF_OCC_Forced | UF_VTKViewer;
+ }
else
{
- QString anEntry = HYDROGUI_DataObject::dataObjectEntry( aProfileObj );
+ Handle(HYDROData_Profile) aNewProfileObj = Handle(HYDROData_Profile)::DownCast( doc()->CreateObject( KIND_PROFILE ) );
+ int stat = CurveCrProfileToHProfile(myProfiles[0], aNewProfileObj, aProfileNamesFiltered[0], false);
+ if (stat == 0)
+ return false;
+ else if (stat == -1)
+ {
+ theErrorMsg = tr( "NUMBER_OF_PROFILE_POINTS_INCORRECT" );
+ return false;
+ }
+ module()->setIsToUpdate( aNewProfileObj );
+ QString anEntry = HYDROGUI_DataObject::dataObjectEntry( aNewProfileObj );
theBrowseObjectsEntries.append( anEntry );
}
return true;
}
-void HYDROGUI_ProfileOp::displayPreview()
+/*void HYDROGUI_ProfileOp::displayPreview()
{
- HYDROGUI_ProfileDlg* aPanel = dynamic_cast<HYDROGUI_ProfileDlg*>( inputPanel() );
+ /* HYDROGUI_ProfileDlg* aPanel = dynamic_cast<HYDROGUI_ProfileDlg*>( inputPanel() );
if( aPanel )
{
Handle(AIS_InteractiveContext) aCtx = aPanel->getAISContext();
aDisplayer->display( myProfile->getAISObject( true ), true );
}
}
+}*/
+
+void HYDROGUI_ProfileOp::displayPreviews(
+ const QMap<HYDROGUI_CurveCreatorProfile*, QColor>& CurveToColor,
+ int firstIndProf, int lastIndProf, bool createNewDisplayer, bool SwitchToFirstProf)
+{
+ HYDROGUI_ProfileDlg* aPanel = dynamic_cast<HYDROGUI_ProfileDlg*>( inputPanel() );
+ if( aPanel )
+ {
+ Handle(AIS_InteractiveContext) aCtx = aPanel->getAISContext();
+ if( !aCtx.IsNull() )
+ {
+ if (myDisplayer)
+ {
+ //delete myDisplayer;
+ //myDisplayer = NULL;
+ }
+ if (createNewDisplayer)
+ myDisplayer = new CurveCreator_Displayer( aCtx );
+ for (int i = firstIndProf; i < lastIndProf; i++ )
+ {
+ HYDROGUI_CurveCreatorProfile* CC = myProfiles[i];
+ QColor QCurCol = QColor(0,0,255); //def color
+ if (myIsEdit)
+ QCurCol = CurveToColor[CC];
+ Quantity_Color CurOCCCol = HYDROData_Tool::toOccColor(QCurCol);
+ CC->setDisplayer( myDisplayer );
+ CC->myPointAspectColor = CurOCCCol;
+ CC->myCurveColor = CurOCCCol;
+ CC->myLineWidth = 1;
+ myDisplayer->display( CC->getAISObject( true ), true );
+ }
+ }
+ if (SwitchToFirstProf && !myProfiles.empty())
+ aPanel->switchToFirstProfile();
+ }
}
void HYDROGUI_ProfileOp::erasePreview()
{
HYDROGUI_ProfileDlg* aPanel = dynamic_cast<HYDROGUI_ProfileDlg*>( inputPanel() );
- CurveCreator_Displayer* aDisplayer = myProfile ? myProfile->getDisplayer() : 0;
- if( aPanel && aDisplayer )
+ //CurveCreator_Displayer* aDisplayer = myProfiles[0] ? myProfile[0]->getDisplayer() : 0;
+ if( aPanel && myDisplayer )
{
Handle(AIS_InteractiveContext) aCtx = aPanel->getAISContext();
if( !aCtx.IsNull() )
{
- aDisplayer->eraseAll( true );
+ myDisplayer->eraseAll( true );
}
}
+ myCurveToProfile.Clear();
+}
+
+void HYDROGUI_ProfileOp::onRemoveProfile(int index)
+{
+ if (index >= myProfiles.size() )
+ return;
+
+ if (!myIsEdit)
+ return;
+
+ HYDROGUI_CurveCreatorProfile* CP = myProfiles[index];
+ myProfiles.erase (myProfiles.begin()+index);
+ myEditedObjects.Remove(index+1);
+ myCurveToProfile.UnBind(CP);
+
+ HYDROGUI_ProfileDlg* aPanel = (HYDROGUI_ProfileDlg*)inputPanel();
+ //aPanel->reset();
+ //setPreviewManager( aPanel->viewManager() );
+ //setCursor();
+
+ aPanel->BlockProfileNameSignals(true);
+ aPanel->eraseProfile(index);
+
+ Handle(AIS_InteractiveContext) aCtx = aPanel->getAISContext();
+ if( !aCtx.IsNull() && myDisplayer)
+ myDisplayer->erase( CP->getAISObject(false), true);
+ CP->SetEraseAllState(false);
+ delete CP;
+ int selectedInd = aPanel->GetProfileSelectionIndex();
+ if (selectedInd > -1)
+ aPanel->SwitchToProfile(selectedInd);
+ aPanel->BlockProfileNameSignals(false);
}
bool HYDROGUI_ProfileOp::isValid( SUIT_Operation* theOtherOp ) const
#include "HYDROGUI_Operation.h"
#include <HYDROData_Profile.h>
-
+#include <vector>
+#include <QMap>
+#include <NCollection_DataMap.hxx>
+class QColor;
class HYDROGUI_CurveCreatorProfile;
+class CurveCreator_Displayer;
class HYDROGUI_ProfileOp : public HYDROGUI_Operation
{
QStringList& theBrowseObjectsEntries );
private:
- void displayPreview();
+ void displayPreviews(const QMap<HYDROGUI_CurveCreatorProfile*, QColor>& CurveToColor,
+ int firstIndProf, int lastIndProf,
+ bool createNewDisplayer, bool SwitchToFirstProf);
+
void erasePreview();
+
+protected slots:
+ virtual void onAddProfiles();
+
+ virtual void onRemoveProfile(int index);
+
private:
- bool myIsEdit;
- Handle(HYDROData_Profile) myEditedObject;
- HYDROGUI_CurveCreatorProfile* myProfile;
+ bool myIsEdit;
+ bool mySingleProfileMode;
+ HYDROData_SequenceOfObjects myEditedObjects;
+ std::vector<HYDROGUI_CurveCreatorProfile*> myProfiles;
+ CurveCreator_Displayer* myDisplayer;
+ NCollection_DataMap<HYDROGUI_CurveCreatorProfile*, Handle(HYDROData_Profile)> myCurveToProfile;
+
};
#endif
void test_HYDROGUI_ProfilesDlg::test_default_size()
{
- HYDROGUI_ProfileDlg* dlg = new HYDROGUI_ProfileDlg( 0, "test" );
+ HYDROGUI_ProfileDlg* dlg = new HYDROGUI_ProfileDlg( 0, "test", true );
dlg->resize( 320, 640 );
dlg->show();
QTest::qWaitForWindowExposed( dlg );
void test_HYDROGUI_ProfilesDlg::test_points_table()
{
- HYDROGUI_ProfileDlg* dlg = new HYDROGUI_ProfileDlg( 0, "test" );
+ HYDROGUI_ProfileDlg* dlg = new HYDROGUI_ProfileDlg( 0, "test", false );
dlg->resize( 320, 800 );
dlg->setProfile( profile() );
dlg->show();