X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_Measurements.h;h=3d583f06a55e4995a3bfe5cac5fa020907166d2b;hb=bf5b17018697d54ce132019e34782a007c0cea5a;hp=f4cd672fb9632faa7159003dee7b99a72507646e;hpb=bd8f1aee7c78f7d2eb82bd4fec5e08c9e3d280ce;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_Measurements.h b/src/SMESHGUI/SMESHGUI_Measurements.h index f4cd672fb..3d583f06a 100644 --- a/src/SMESHGUI/SMESHGUI_Measurements.h +++ b/src/SMESHGUI/SMESHGUI_Measurements.h @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// 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 @@ -6,7 +6,7 @@ // 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. +// 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 @@ -32,14 +32,18 @@ class QButtonGroup; class QLineEdit; class QTabWidget; +class QGroupBox; class SUIT_SelectionFilter; class SALOME_Actor; class SMESH_Actor; class SMESHGUI_IdValidator; +class SMESHGUI_MeshEditPreview; #include #include CORBA_SERVER_HEADER(SMESH_Mesh) +#include + class SMESHGUI_EXPORT SMESHGUI_MinDistance : public QWidget { Q_OBJECT; @@ -101,9 +105,9 @@ public: void updateSelection(); void deactivate(); + void erasePreview(); private: - void erasePreview(); void displayPreview(); void createPreview( double, double, double, double, double, double ); @@ -135,6 +139,71 @@ private: SALOME_Actor* myPreview; }; +class SMESHGUI_EXPORT SMESHGUI_BasicProperties : public QWidget +{ + Q_OBJECT; + +public: + //! Property type + enum Mode { Length, Area, Volume }; + + SMESHGUI_BasicProperties( QWidget* = 0 ); + ~SMESHGUI_BasicProperties(); + + void setMode( const Mode ); + + void updateSelection(); + void deactivate(); + +private slots: + void selectionChanged(); + void modeChanged( int); + void compute(); + void clear(); + +private: + QButtonGroup* myMode; + QLineEdit* mySource; + QGroupBox* myResultGrp; + QLineEdit* myResult; + SMESH::SMESH_IDSource_var mySrc; + SUIT_SelectionFilter* myFilter; +}; + +class SMESHGUI_EXPORT SMESHGUI_Angle : public QWidget +{ + Q_OBJECT; + +public: + + SMESHGUI_Angle( QWidget* = 0 ); + ~SMESHGUI_Angle(); + + void deactivate(); + void updateSelection(); + +private slots: + void selectionChanged(); + void nodesEdited(); + void compute(); + void clear(); + +private: + + bool addPointByActor( int id ); + bool addPointByIDSource( int id ); + gp_Vec getNormal(const gp_Vec& vec10 ); + + QLineEdit* myNodes; + QLineEdit* myResult; + + SMESH::SMESH_IDSource_var myIDSrc; + SMESH_Actor* myActor; + + std::vector< SMESH::PointStruct > myPoints; + SMESHGUI_MeshEditPreview* myPreview; +}; + class SMESHGUI_EXPORT SMESHGUI_MeasureDlg : public QDialog { Q_OBJECT; @@ -145,7 +214,11 @@ public: //! Measurement type enum { MinDistance, //!< minimum distance - BoundingBox //!< bounding box + BoundingBox, //!< bounding box + Length, //!< length + Area, //!< area + Volume, //!< volume + Angle }; SMESHGUI_MeasureDlg( QWidget* = 0, int = MinDistance ); @@ -167,6 +240,8 @@ private: QTabWidget* myTabWidget; SMESHGUI_MinDistance* myMinDist; SMESHGUI_BoundingBox* myBndBox; + SMESHGUI_BasicProperties* myBasicProps; + SMESHGUI_Angle* myAngle; }; #endif // SMESHGUI_MEASUREMENTS_H