2016-03-15 17:26:56 +05:00
|
|
|
// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
|
2013-10-03 20:12:04 +06:00
|
|
|
//
|
|
|
|
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
|
|
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
|
|
|
//
|
|
|
|
// This library is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU Lesser General Public
|
|
|
|
// License as published by the Free Software Foundation; either
|
2014-02-18 12:44:41 +06:00
|
|
|
// version 2.1 of the License, or (at your option) any later version.
|
2013-10-03 20:12:04 +06:00
|
|
|
//
|
|
|
|
// This library is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public
|
|
|
|
// License along with this library; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
//
|
|
|
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
|
|
|
//
|
|
|
|
|
|
|
|
// GEOM GEOMGUI : GUI for Geometry component
|
|
|
|
// File : EntityGUI_FieldDlg.h
|
|
|
|
|
|
|
|
#ifndef EntityGUI_FieldDlg_H
|
|
|
|
#define EntityGUI_FieldDlg_H
|
|
|
|
|
|
|
|
#include <GEOMBase_Skeleton.h>
|
|
|
|
|
|
|
|
#include <TopAbs_ShapeEnum.hxx>
|
|
|
|
#include <TColStd_DataMapOfIntegerInteger.hxx>
|
|
|
|
#include <TColStd_IndexedMapOfInteger.hxx>
|
|
|
|
#include <TopTools_IndexedMapOfShape.hxx>
|
|
|
|
|
|
|
|
#include <QMap>
|
|
|
|
#include <QSet>
|
|
|
|
#include <QVector>
|
2013-10-17 22:55:54 +06:00
|
|
|
#include <QTableWidget>
|
2013-10-03 20:12:04 +06:00
|
|
|
|
|
|
|
class QGroupBox;
|
|
|
|
class QLineEdit;
|
|
|
|
class QPushButton;
|
|
|
|
class QComboBox;
|
|
|
|
class SalomeApp_IntSpinBox;
|
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
// class : EntityGUI_FieldDlg
|
|
|
|
// purpose :
|
|
|
|
//=================================================================================
|
|
|
|
class EntityGUI_FieldDlg : public GEOMBase_Skeleton
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
class StepTable;
|
|
|
|
class IntSpinItem;
|
|
|
|
class DoubleSpinItem;
|
|
|
|
class CheckItem;
|
|
|
|
class Delegate;
|
|
|
|
|
|
|
|
public:
|
|
|
|
EntityGUI_FieldDlg (GeometryGUI* theGeometryGUI,
|
|
|
|
GEOM::GEOM_Field_ptr theField, int stepID=0,
|
|
|
|
QWidget* parent=0,
|
|
|
|
bool modal=false, Qt::WindowFlags fl=0);
|
|
|
|
~EntityGUI_FieldDlg();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
// redefined from GEOMBase_Helper
|
|
|
|
virtual GEOM::GEOM_IOperations_ptr createOperation();
|
|
|
|
virtual bool isValid (QString&);
|
|
|
|
virtual bool execute ();
|
2015-03-04 18:05:30 +05:00
|
|
|
virtual QList<GEOM::GeomObjPtr> getSourceObjects();
|
2013-10-03 20:12:04 +06:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void ClickOnOk();
|
|
|
|
bool ClickOnApply();
|
|
|
|
void ActivateThisDialog();
|
|
|
|
void SelectionIntoArgument();
|
|
|
|
void SetEditCurrentArgument();
|
|
|
|
|
|
|
|
void onPrevStep();
|
|
|
|
void onNextStep();
|
|
|
|
void onAddStep();
|
|
|
|
void onRmStep();
|
|
|
|
void onStampChange();
|
|
|
|
void onDimChange();
|
|
|
|
void onTypeChange();
|
|
|
|
void onNbCompsChange();
|
|
|
|
void showCurStep();
|
|
|
|
void highlightSubShapes();
|
|
|
|
|
|
|
|
private:
|
|
|
|
void Init();
|
|
|
|
void enterEvent (QEvent*);
|
|
|
|
void activateSelection();
|
|
|
|
|
|
|
|
TopAbs_ShapeEnum getShapeType(int* dim=0) const;
|
|
|
|
int getDim() const;
|
|
|
|
int getDataType() const;
|
|
|
|
int getCurStepID() const;
|
|
|
|
int getNbComps() const;
|
|
|
|
void updateShapeIDs();
|
|
|
|
void updateDims(int curDim=-1);
|
|
|
|
int getSelectedSubshapes (TColStd_IndexedMapOfInteger& map);
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool myIsCreation;
|
|
|
|
GEOM::GEOM_Field_var myField;
|
|
|
|
GEOM::GEOM_Object_var myShape;
|
|
|
|
QVector< int > myShapeIDs;
|
|
|
|
TopTools_IndexedMapOfShape myShapeMap;
|
|
|
|
|
|
|
|
int myCurStepID;
|
|
|
|
StepTable* myCurStepTable;
|
|
|
|
QMap< int, StepTable* > myStepTables;
|
|
|
|
QSet< int > myRemovedSteps;
|
|
|
|
|
|
|
|
int myDmMode;
|
|
|
|
bool myIsHiddenMain;
|
|
|
|
|
2013-10-18 20:00:58 +06:00
|
|
|
QList<int> myHiddenFieldStepIds;
|
|
|
|
|
2013-10-03 20:12:04 +06:00
|
|
|
QPushButton* myShapeSelBtn;
|
|
|
|
QLineEdit* myShapeName;
|
|
|
|
QComboBox* myTypeCombo;
|
|
|
|
QComboBox* myDimCombo;
|
|
|
|
QPushButton* myPrevStepBtn;
|
|
|
|
QPushButton* myNextStepBtn;
|
|
|
|
QPushButton* myRmStepBtn;
|
|
|
|
|
|
|
|
SalomeApp_IntSpinBox* myNbCompsSpin;
|
|
|
|
QWidget* mySwitchTableWdg;
|
|
|
|
QComboBox* myStepsCombo;
|
2013-11-07 23:01:53 +06:00
|
|
|
QLineEdit* myStepEdit;
|
2013-10-03 20:12:04 +06:00
|
|
|
SalomeApp_IntSpinBox* myStampSpin;
|
2013-10-17 22:55:54 +06:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
Class : EntityGUI_FieldDlg::StepTable
|
|
|
|
Description : Table widget
|
|
|
|
*/
|
|
|
|
|
|
|
|
class EntityGUI_FieldDlg::StepTable : public QTableWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
int myDataType;
|
|
|
|
int myStepID;
|
|
|
|
int myStamp;
|
|
|
|
GEOM::GEOM_FieldStep_var myStep;
|
|
|
|
bool myIsChanged;
|
|
|
|
|
|
|
|
QTableWidgetItem * newDefaultItem();
|
2013-11-06 15:49:34 +06:00
|
|
|
|
2013-10-17 22:55:54 +06:00
|
|
|
public:
|
|
|
|
StepTable( int stepID, int dataType, int nbRows, int nbColumns,
|
|
|
|
QString shapeName, QStringList headers,
|
|
|
|
GEOM::GEOM_FieldStep_ptr stepVar, QWidget* = 0 );
|
|
|
|
virtual ~StepTable();
|
|
|
|
|
|
|
|
QSize minimumSizeHint() const;
|
|
|
|
|
|
|
|
void setEditable( bool, int, int );
|
|
|
|
bool isEditable( int, int ) const;
|
|
|
|
|
|
|
|
void setReadOnly( bool );
|
|
|
|
bool isReadOnly() const;
|
|
|
|
|
|
|
|
void insertRows( int, int = 1 );
|
|
|
|
QString text( int, int );
|
|
|
|
|
|
|
|
QList<int> selectedRows();
|
|
|
|
void selectRows(const QList<int>& rows);
|
|
|
|
|
|
|
|
void setDim( int nbRows, QString shapeName, bool setDefault=true );
|
|
|
|
void setNbComps( int nbComps );
|
|
|
|
void setDataType( int dataType );
|
|
|
|
void setStamp( int stamp ) { myStamp = stamp; }
|
|
|
|
int getStamp() { return myStamp; }
|
|
|
|
int getStepID() { return myStepID; }
|
|
|
|
QStringList getHeaders();
|
|
|
|
void setHeaders(const QStringList& headers);
|
|
|
|
GEOM::GEOM_FieldStep_var getStep() { return myStep; }
|
|
|
|
void setValues(GEOM::GEOM_FieldStep_var& step);
|
2013-11-06 15:49:34 +06:00
|
|
|
|
2013-10-17 22:55:54 +06:00
|
|
|
public slots:
|
|
|
|
void setIsChanged() { myIsChanged = true; }
|
2013-11-06 15:49:34 +06:00
|
|
|
void headerDblClicked( int );
|
2013-10-03 20:12:04 +06:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|