X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FEntityGUI%2FEntityGUI_3DSketcherDlg.h;h=893bbe83ed7e62c8053e3c137106a8790ce3575e;hb=08a90cb03f6d2befe6f0b923bd690182ded48378;hp=cbff1a0a32aac0b4fcccb8bedbe6f97d7bccd53e;hpb=004197ec827d52331f0d529202eb4e52a1c4388f;p=modules%2Fgeom.git diff --git a/src/EntityGUI/EntityGUI_3DSketcherDlg.h b/src/EntityGUI/EntityGUI_3DSketcherDlg.h index cbff1a0a3..893bbe83e 100755 --- a/src/EntityGUI/EntityGUI_3DSketcherDlg.h +++ b/src/EntityGUI/EntityGUI_3DSketcherDlg.h @@ -1,26 +1,25 @@ -// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE // -// 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. +// 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. // -// 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. +// 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 +// 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_3DSketcherDlg.h // Author : DMV, OCN -// + #ifndef ENTITYGUI_3DSKETCHERDLG_H #define ENTITYGUI_3DSKETCHERDLG_H @@ -29,7 +28,15 @@ class QButtonGroup; class QDoubleSpinBox; class EntityGUI_3Spin; -class DlgRef_3Radio; +class EntityGUI_Type; +class EntityGUI_Angles; +class EntityGUI_Controls; +class SOCC_Prs; +class gp_Dir; + +#include +#include +#include #ifndef COORD_MIN # define COORD_MIN -1e+15 @@ -48,14 +55,24 @@ class EntityGUI_3DSketcherDlg : public GEOMBase_Skeleton struct XYZ { - XYZ() { x = y = z = 0.0; xt = yt = zt = "0.0"; } - double x, y, z; - QString xt, yt, zt; + XYZ() { x = y = z = 0.0; command = params = ""; L=A=0; } + double x, y, z; // for preview only + int L, A; // for preview only + QString command; + QString params; + }; + + struct prsType + { + prsType(){L=A=0;} + int L; + int A; }; + typedef QList XYZList; public: - EntityGUI_3DSketcherDlg( GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0, const double = 2. ); + EntityGUI_3DSketcherDlg (GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0, const double = 2.); ~EntityGUI_3DSketcherDlg(); protected: @@ -76,26 +93,72 @@ private: const double = -1, const int = -1, const int = -1); + + Handle(AIS_LengthDimension) createAISLengthDimension(double theLength, + gp_Pnt P1, + gp_Pnt P2, + gp_Dir theNormal); + + Handle(AIS_AngleDimension) createAISAngleDimension(double theAngle, + gp_Pnt P0, + gp_Pnt P1, + gp_Pnt P2); + + void displayAngle(double theAngle, + gp_Pnt P0, + gp_Pnt P1, + gp_Pnt P2, + bool store = false); + + void displayLength(gp_Pnt P1, + gp_Pnt P2, + gp_Dir theNormal, + bool store = false); + + void displayTrihedron( int ); + + void displayDimensions(bool store = false); bool createShapes( GEOM::GEOM_Object_ptr, TopoDS_Shape&, TopoDS_Shape& ); XYZ getLastPoint() const; + XYZ getPenultimatePoint() const; XYZ getCurrentPoint() const; + + gp_Dir getPresentationPlane() const; + + std::string doubleToString( double ); + + void removeLastIOFromPrs(); + void restoreLastIOToPrs(); private: XYZList myPointsList; XYZList myRedoList; + AIS_ListOfInteractive myLengthIORedoList; + AIS_ListOfInteractive myAngleIORedoList; + prsType myPrsType; EntityGUI_3Spin* Group3Spin; - DlgRef_3Radio* GroupType; - QButtonGroup* myTypeGroup; + EntityGUI_Angles* GroupAngles; + EntityGUI_Controls* GroupControls; + EntityGUI_Type* GroupType; + QButtonGroup* myTypeGroup1; + QButtonGroup* myTypeGroup2; int myMode; + int myCoordType; + int myOrientation; bool myOK; + bool isLengthVisible; + bool isAngleVisible; + double myLineWidth; GeometryGUI* myGeometryGUI; + SOCC_Prs* myAnglePrs; + SOCC_Prs* myLengthPrs; private slots: void ClickOnOk(); @@ -103,6 +166,7 @@ private slots: bool ClickOnApply(); // bool isSameAsPrevious(); void UpdateButtonsState(); + void UpdatePointCoordinates(); void ClickOnUndo(); void ClickOnRedo(); @@ -112,6 +176,8 @@ private slots: void ActivateThisDialog(); void TypeClicked( int ); void ValueChangedInSpinBox( double ); + void ButtonClicked( bool ); + void BoxChecked ( bool ); void SetDoubleSpinBoxStep( double ); };