geom/src/MeasureGUI/MeasureGUI_AnnotationDlg.h

115 lines
4.0 KiB
C
Raw Normal View History

2016-09-30 12:01:23 +03:00
// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
//
// 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
// version 2.1 of the License, or (at your option) any later version.
//
// 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 : MeasureGUI_AnnotationDlg.h
#ifndef MeasureGUI_AnnotationDlg_H
#define MeasureGUI_AnnotationDlg_H
#include <GEOMBase_Skeleton.h>
#include <GEOM_Constants.h>
#include <GEOMGUI_ShapeAnnotations.h>
#include <TopAbs_ShapeEnum.hxx>
//#include <TColStd_DataMapOfIntegerInteger.hxx>
//#include <TColStd_IndexedMapOfInteger.hxx>
//#include <TopTools_IndexedMapOfShape.hxx>
2016-09-30 12:01:23 +03:00
//#include <QMap>
//#include <QSet>
//#include <QVector>
//#include <QTableWidget>
2016-09-30 12:01:23 +03:00
class QGroupBox;
class QLineEdit;
class QPushButton;
class QComboBox;
class SalomeApp_IntSpinBox;
2016-10-07 21:18:28 +03:00
class MeasureGUI_AnnotationInteractor;
2016-09-30 12:01:23 +03:00
//=================================================================================
// class : MeasureGUI_AnnotationDlg
// purpose :
//=================================================================================
class MeasureGUI_AnnotationDlg : public GEOMBase_Skeleton
{
Q_OBJECT
public:
MeasureGUI_AnnotationDlg (GeometryGUI* theGeometryGUI,
const bool theIsCreate,
QWidget* parent=0,
bool modal=false, Qt::WindowFlags fl=0);
~MeasureGUI_AnnotationDlg();
protected:
// redefined from GEOMBase_Helper
virtual bool isValid (QString&);
virtual bool execute ();
SALOME_Prs* buildPrs();
void updateSubShapeEnableState();
void redisplayPreview();
2016-09-30 12:01:23 +03:00
private slots:
void ClickOnOk();
bool ClickOnApply();
void SelectionIntoArgument();
void SetEditCurrentArgument();
void onTextChange();
void onTypeChange();
void onSubShapeTypeChange();
private:
void Init();
void activateSelectionArgument(QPushButton* theSelectionButton);
2016-10-06 14:33:25 +03:00
void activateSelection();
2016-09-30 12:01:23 +03:00
TopAbs_ShapeEnum getShapeType() const;
gp_Pnt getAttachPoint(const TopoDS_Shape& theShape);
2016-09-30 12:01:23 +03:00
private:
2016-10-06 14:33:25 +03:00
TopAbs_ShapeEnum mySelectionMode;
2016-09-30 12:01:23 +03:00
GEOMGUI_ShapeAnnotations::ShapeAnnotation myAnnotationProperties;
/// an index of edited annotation in the list shape annotations, -1 in create operation
bool myIsCreation;
GEOM::GeomObjPtr myShape;
QLineEdit* myTextEdit;
QPushButton* myShapeSelBtn;
QLineEdit* myShapeName;
QComboBox* myTypeCombo;
QComboBox* mySubShapeTypeCombo;
QPushButton* mySubShapeSelBtn;
QLineEdit* mySubShapeName;
2016-10-07 21:18:28 +03:00
MeasureGUI_AnnotationInteractor* myInteractor;
2016-09-30 12:01:23 +03:00
};
#endif