]> SALOME platform Git repositories - modules/geom.git/blobdiff - src/EntityGUI/EntityGUI_3DSketcherDlg.h
Salome HOME
Merge from V6_main 13/12/2012
[modules/geom.git] / src / EntityGUI / EntityGUI_3DSketcherDlg.h
index 8888cf0655a7d8ab5a2aa2ccd604ed45aeca8239..a4b4d98afeb6ec3bb8cb61d014a7e409fd50e165 100755 (executable)
 class QButtonGroup;
 class QDoubleSpinBox;
 class EntityGUI_3Spin;
+class EntityGUI_Type;
 class EntityGUI_Angles;
 class EntityGUI_Controls;
-class DlgRef_3Radio;
 class SOCC_Prs;
+class gp_Dir;
 
 #include <AIS_ListOfInteractive.hxx>
+#include <AIS_AngleDimension.hxx>
+#include <AIS_LengthDimension.hxx>
 
 #ifndef COORD_MIN
 #  define COORD_MIN -1e+15
@@ -42,6 +45,9 @@ class SOCC_Prs;
 #  define DBL_DIGITS_DISPLAY 16
 #endif // COORD_MIN
 
+// For convenience
+bool isSame (double d1, double d2);
+
 //=================================================================================
 // class    : EntityGUI_Dlg
 // purpose  :
@@ -52,11 +58,21 @@ class EntityGUI_3DSketcherDlg : public GEOMBase_Skeleton
 
   struct XYZ
   {
-    XYZ() { x = y = z = 0.0; command = params = ""; }
+    XYZ() { x = y = z = 0.0; command = params = ""; L=A=T=0; }
     double  x,  y,  z; // for preview only
+    int L, A, T;       // for preview only
     QString command;
     QString params;
   };
+  
+  struct prsType
+  {
+    prsType(){L=A=T=0;}
+    int L;
+    int A;
+    int T;
+  };
+  
   typedef QList<XYZ> XYZList;
 
 public:
@@ -82,10 +98,34 @@ private:
                                                      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                               displayText(std::string theText,
+                                                 gp_Pnt P,
+                                                 bool store = false);
+  
   void                               displayTrihedron( int );
   
-  void                               displayAngle( double, double, double, int, bool store = false );
-  void                               displayLength( double theLength = -1.0, bool store = false, int type = 1);
+  void                               displayDimensions(bool store = false);
 
   bool                               createShapes( GEOM::GEOM_Object_ptr,
                                                    TopoDS_Shape&,
@@ -95,27 +135,38 @@ private:
   XYZ                                getPenultimatePoint() const;
   XYZ                                getCurrentPoint() const;
   
+  gp_Dir                             getPresentationPlane() const;
+  
   std::string                        doubleToString( double );
   
-  void                               removeLastIOFromPrs( int );
-  void                               restoreLastIOToPrs( int );
+  gp_Trsf                            toReferenceSystem(gp_Pnt origin) const;
+  gp_Trsf                            toCurrentSystem(gp_Pnt origin) const;
+  
+  void                               removeLastIOFromPrs();
+  void                               restoreLastIOToPrs();
+  
+  double                             radius(gp_Pnt) const;
+  double                             height(gp_Pnt) const;
+  double                             longitude(gp_Pnt) const;
+  double                             latitude(gp_Pnt) const;
 
 private:
   XYZList                            myPointsList;
   XYZList                            myRedoList;
   AIS_ListOfInteractive              myLengthIORedoList;
   AIS_ListOfInteractive              myAngleIORedoList;
-  int                                myPrsType;
-  std::list<int>                     myPrsTypeList;
-  std::list<int>                     myPrsTypeRedoList;
+  AIS_ListOfInteractive              myTextIORedoList;
+  prsType                            myPrsType;
 
   EntityGUI_3Spin*                   Group3Spin;
   EntityGUI_Angles*                  GroupAngles;
   EntityGUI_Controls*                GroupControls;
-  DlgRef_3Radio*                     GroupType;
-  QButtonGroup*                      myTypeGroup;
+  EntityGUI_Type*                    GroupType;
+  QButtonGroup*                      myTypeGroup1;
+  QButtonGroup*                      myTypeGroup2;
 
   int                                myMode;
+  int                                myCoordType;
   int                                myOrientation;
   bool                               myOK;
   bool                               isLengthVisible;
@@ -125,6 +176,7 @@ private:
   GeometryGUI*                       myGeometryGUI;
   SOCC_Prs*                          myAnglePrs;
   SOCC_Prs*                          myLengthPrs;
+  SOCC_Prs*                          myTextPrs;
 
 private slots:
   void                               ClickOnOk();