]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
PostPro 2005, T1.5: 2D fields displayed in 3D
authorapo <apo@opencascade.com>
Tue, 26 Apr 2005 07:29:57 +0000 (07:29 +0000)
committerapo <apo@opencascade.com>
Tue, 26 Apr 2005 07:29:57 +0000 (07:29 +0000)
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI.h
src/VISUGUI/VisuGUI_Plot3DDlg.cxx
src/VISUGUI/VisuGUI_Plot3DDlg.h
src/VISU_I/VISU_Gen_i.cc
src/VISU_I/VISU_Gen_i.hh
src/VISU_I/VISU_Plot3D_i.hh

index d742031520a528267ba4722467c23907144738a7..22eb785fa343d0878bb626f84ffe01f170dcf939 100644 (file)
@@ -44,6 +44,7 @@
 #include "VISU_CutLines_i.hh"
 #include "VISU_Vectors_i.hh"
 #include "VISU_StreamLines_i.hh"
+#include "VISU_Plot3D_i.hh"
 #include "VISU_Table_i.hh"
 
 #include "VISU_Actor.h"
@@ -61,6 +62,7 @@
 #include "VisuGUI_EditContainerDlg.h"
 #include "VisuGUI_TimeAnimation.h"
 #include "VisuGUI_ClippingDlg.h"
+#include "VisuGUI_Plot3DDlg.h"
 
 #include "VisuGUI_Selection.h"
 #include "VisuGUI_NonIsometricDlg.h"
@@ -838,6 +840,7 @@ CREATEPRESENTATION(VisuGUI::CreateIsoSurfaces);
 CREATEPRESENTATION(VisuGUI::CreateCutPlanes);
 CREATEPRESENTATION(VisuGUI::CreateCutLines);
 CREATEPRESENTATION(VisuGUI::CreateStreamLines);
+CREATEPRESENTATION(VisuGUI::CreatePlot3D);
 
 
 
@@ -3613,6 +3616,7 @@ CREATEPRS(VISU::IsoSurfaces_i, VisuGUI::CreateIsoSurfacesPrs, IsoSurfacesOnField
 CREATEPRS(VISU::CutPlanes_i, VisuGUI::CreateCutPlanesPrs, CutPlanesOnField);
 CREATEPRS(VISU::CutLines_i, VisuGUI::CreateCutLinesPrs, CutLinesOnField);
 CREATEPRS(VISU::StreamLines_i, VisuGUI::CreateStreamLinesPrs, StreamLinesOnField);
+CREATEPRS(VISU::Plot3D_i, VisuGUI::CreatePlot3DPrs, Plot3DOnField);
 
 
 #define BUILDPRS(TYPE, FCREATE, FNAME, DLGNAME) \
@@ -3663,6 +3667,7 @@ BUILDPRS(VISU::IsoSurfaces_i, CreateIsoSurfacesPrs, VisuGUI::CreateIsoSurfaces,
 //BUILDPRS(VISU::CutPlanes_i, CreateCutPlanesPrs, VisuGUI::CreateCutPlanes, VisuGUI_CutPlanesDlg);
 //BUILDPRS(VISU::CutLines_i, CreateCutLinesPrs, VisuGUI::CreateCutLines, VisuGUI_CutLinesDlg);
 BUILDPRS(VISU::StreamLines_i, CreateStreamLinesPrs, VisuGUI::CreateStreamLines, VisuGUI_StreamLinesDlg);
+BUILDPRS(VISU::Plot3D_i, CreatePlot3DPrs, VisuGUI::CreatePlot3D, VisuGUI_Plot3DDlg);
 
 
 bool VisuGUI::CreateCutPlanes(SALOMEDS::SObject_var theField) { 
index a65d75f8bbf12e13a6e236de32d3c52e6d76d2ea..9ac7d83d83288d82bff89c9ad1912b50238da13c 100644 (file)
@@ -70,6 +70,7 @@ namespace VISU{
   class CutLines_i;
   class Vectors_i;
   class StreamLines_i;
+  class Plot3D_i;
 
   class Table_i;
   class Curve_i;
@@ -133,6 +134,10 @@ class VisuGUI : public SALOMEGUI{
   static VISU::StreamLines_i* CreateStreamLinesPrs(SALOMEDS::SObject_var theField, 
                                                   const char* theMeshName, VISU::Entity theEntity, 
                                                   const char* theFieldName, int theTimeId);
+  bool CreatePlot3D(SALOMEDS::SObject_var theField);
+  static VISU::Plot3D_i* CreatePlot3DPrs(SALOMEDS::SObject_var theField, 
+                                        const char* theMeshName, VISU::Entity theEntity, 
+                                        const char* theFieldName, int theTimeId);
   bool TestObjectBrowser(SALOMEDS::SObject_var& objVisu);
  
   static void ShowTrihedron(bool Show);
@@ -185,24 +190,24 @@ class VisuGUI : public SALOMEGUI{
   virtual bool OnGUIEvent(int theCommandID, QAD_Desktop* parent);
   virtual bool SetSettings(QAD_Desktop* parent);
   virtual void DefinePopup(QString & theContext,
-                                         QString & theParent, 
-                                         QString & theObject ) ;
+                          QString & theParent, 
+                          QString & theObject ) ;
   virtual bool CustomPopup(QAD_Desktop* parent,
-                                         QPopupMenu* popup,
-                                         const QString & theContext,
-                                         const QString & theParent,
-                                         const QString & theObject);
+                          QPopupMenu* popup,
+                          const QString & theContext,
+                          const QString & theParent,
+                          const QString & theObject);
   virtual void BuildPresentation( const Handle(SALOME_InteractiveObject)&,
                                   QAD_ViewFrame*  = 0 );
   virtual bool OnMousePress(QMouseEvent* pe ,
-                                          QAD_Desktop* parent, 
-                                          QAD_StudyFrame* studyFrame);
+                           QAD_Desktop* parent, 
+                           QAD_StudyFrame* studyFrame);
   virtual bool OnMouseMove(QMouseEvent* pe ,
-                                         QAD_Desktop* parent, 
-                                         QAD_StudyFrame* studyFrame);
+                          QAD_Desktop* parent, 
+                          QAD_StudyFrame* studyFrame);
   virtual bool OnKeyPress(QKeyEvent* pe,
-                                        QAD_Desktop* parent,
-                                        QAD_StudyFrame* studyFrame);
+                         QAD_Desktop* parent,
+                         QAD_StudyFrame* studyFrame);
   virtual void SupportedViewType (int* buffer, int bufferSize);
 
 public slots:
@@ -222,6 +227,8 @@ public slots:
   void CreateCutPlanes();
   void CreateCutLines();
   void CreateStreamLines();
+  void CreatePlot3D();
+
   void CreateManyMesh();
   void CreatePlot2dView();
   
index d3d0e07093bcb3917a217bac42de4aed8a4c6a3c..c872148b7af28fce407421ddf602c985bc77db5b 100644 (file)
@@ -27,7 +27,6 @@
 //  $Header$
 
 #include "VisuGUI_Plot3DDlg.h"
-#include "VISU_IsoSurfaces_i.hh"
 
 #include "QAD_Application.h"
 #include "QAD_Desktop.h"
@@ -98,31 +97,11 @@ VisuGUI_Plot3DPane::VisuGUI_Plot3DPane(QWidget* parent)
 
 
 
-void VisuGUI_Plot3DPane::initFromPrsObject(VISU::IsoSurfaces_i* thePrs) {
-  NbrIso->setValue(thePrs->GetNbSurfaces());
-  MinIso->setText(QString::number(thePrs->GetSubMin()));
-  MaxIso->setText(QString::number(thePrs->GetSubMax()));
-//   switch(thePrs->GetScaling()){
-//   case VISU::LOGARITHMIC : 
-//     CBLog->setChecked(true);
-//     break;
-//   default:  
-//     CBLog->setChecked(false);
-//   }
+void VisuGUI_Plot3DPane::initFromPrsObject(VISU::Plot3D_i* thePrs) {
 }
 
-int VisuGUI_Plot3DPane::storeToPrsObject(VISU::IsoSurfaces_i* thePrs) {
-  thePrs->SetNbSurfaces(NbrIso->value());
-  thePrs->SetSubRange(MinIso->text().toDouble(), MaxIso->text().toDouble());
+int VisuGUI_Plot3DPane::storeToPrsObject(VISU::Plot3D_i* thePrs) {
   return 1;
-//   if (CBUpdate->isChecked())
-//     {
-//       thePrs->SetRange(MinIso->text().toDouble(), MaxIso->text().toDouble());
-//       if (CBLog->isChecked())
-//     thePrs->SetScaling(VISU::LOGARITHMIC);
-//       else 
-//     thePrs->SetScaling(VISU::LINEAR);
-//    }
 }
 
 void VisuGUI_Plot3DPane::onCBUpdate()
index caa7094e0b6a0a1d364d6133a419e2ea2844c226..19eff93930271a592c64d30d6d074722fd8fcb9f 100644 (file)
 //  Module : VISU
 //  $Header$
 
-#ifndef VISUGUI_ISOSURFACESDLG_H
-#define VISUGUI_ISOSURFACESDLG_H
+#ifndef VISUGUI_PLOT3D_H
+#define VISUGUI_PLOT3D_H
 
 #include "VisuGUI_ScalarBarDlg.h"
-#include "VISU_IsoSurfaces_i.hh"
+#include "VISU_Plot3D_i.hh"
 
 #include <qdialog.h>
 #include <qlabel.h>
@@ -50,8 +50,8 @@ public:
     VisuGUI_Plot3DPane(QWidget* parent);
     ~VisuGUI_Plot3DPane() {};
 
-    void initFromPrsObject(VISU::IsoSurfaces_i* thePrs);
-    int storeToPrsObject(VISU::IsoSurfaces_i* thePrs);
+    void initFromPrsObject(VISU::Plot3D_i* thePrs);
+    int storeToPrsObject(VISU::Plot3D_i* thePrs);
 
     void setScalarBarPane(VisuGUI_ScalarBarPane* theScalarPane) {myScalarPane = theScalarPane;}
     VisuGUI_ScalarBarPane* getScalarBarPane() {return myScalarPane;}      
@@ -65,9 +65,7 @@ private:
   QLineEdit* MinIso;
   QLineEdit* MaxIso;
   QSpinBox*  NbrIso;
-  //QCheckBox* CBUpdate;
   VisuGUI_ScalarBarPane* myScalarPane;  
-  //  QCheckBox* CBLog;
 };
 
 
@@ -81,10 +79,10 @@ public:
     VisuGUI_Plot3DDlg();
     ~VisuGUI_Plot3DDlg() {};
     
-    void initFromPrsObject(VISU::IsoSurfaces_i* thePrs) 
+    void initFromPrsObject(VISU::Plot3D_i* thePrs) 
       {myScalarPane->initFromPrsObject(thePrs); myIsoPane->initFromPrsObject(thePrs);}
 
-    int storeToPrsObject(VISU::IsoSurfaces_i* thePrs)
+    int storeToPrsObject(VISU::Plot3D_i* thePrs)
       {return myScalarPane->storeToPrsObject(thePrs) && myIsoPane->storeToPrsObject(thePrs);}
     
 protected slots:
@@ -95,4 +93,4 @@ private:
  VisuGUI_ScalarBarPane* myScalarPane;
 };
 
-#endif // VISUGUI_ISOSURFACESDLG_H
+#endif // VISUGUI_PLOT3D_H
index 5db5aed55b5d09867b69460f7d969c6eabe1563f..f75c6af2858e6009d9502ea61c960fe046c7a5db 100644 (file)
@@ -38,6 +38,7 @@
 #include "VISU_CutLines_i.hh"
 #include "VISU_Vectors_i.hh"
 #include "VISU_StreamLines_i.hh"
+#include "VISU_Plot3D_i.hh"
 #include "VISU_Table_i.hh"
 #include "VISU_TimeAnimation.h"
 
@@ -130,6 +131,7 @@ namespace VISU{
     Storable::Registry(CutLines_i::myComment.c_str(),&(Restore<CutLines_i>));
     Storable::Registry(IsoSurfaces_i::myComment.c_str(),&(Restore<IsoSurfaces_i>));
     Storable::Registry(StreamLines_i::myComment.c_str(),&(Restore<StreamLines_i>));
+    Storable::Registry(Plot3D_i::myComment.c_str(),&(Restore<Plot3D_i>));
     Storable::Registry(Vectors_i::myComment.c_str(),&(Restore<Vectors_i>));
     Storable::Registry(Table_i::myComment.c_str(),&(Table_i::Restore));
     Storable::Registry(Curve_i::myComment.c_str(),&(Curve_i::Restore));
@@ -524,6 +526,15 @@ namespace VISU{
     return Prs3dOnField<VISU::StreamLines_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
   }
 
+  Plot3D_ptr VISU_Gen_i::Plot3DOnField(Result_ptr theResult, 
+                                      const char* theMeshName, 
+                                      VISU::Entity theEntity, 
+                                      const char* theFieldName, 
+                                      CORBA::Double theIteration)
+  {
+    return Prs3dOnField<VISU::Plot3D_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
+  }
+
   CutPlanes_ptr VISU_Gen_i::CutPlanesOnField(Result_ptr theResult, 
                                             const char* theMeshName, 
                                             VISU::Entity theEntity, 
index 7869cd6c55e89b4d0a9639689f7c39d4102304d0..b1a37d75332e071cd7b32412ac45694fb723423e 100644 (file)
@@ -89,6 +89,8 @@ namespace VISU{
                                         const char* theFieldName, CORBA::Double theIteration);
     virtual StreamLines_ptr StreamLinesOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, 
                                               const char* theFieldName, CORBA::Double theIteration);
+    virtual Plot3D_ptr Plot3DOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, 
+                                    const char* theFieldName, CORBA::Double theIteration);
     //Create Digital Presentation
     virtual Table_ptr CreateTable(const char* theTableEntry);
     virtual Curve_ptr CreateCurve(Table_ptr theTable, CORBA::Long theHRow, CORBA::Long theVRow);
index adc45ff95e1e07d1b6d086162e0f4ffd34df57d3..02ca0f281a193b865960af59e7e48104e0b214a8 100644 (file)
@@ -41,7 +41,7 @@ namespace VISU {
     virtual void SetNbOfContours (CORBA::Long theNb);
     virtual CORBA::Long GetNbOfContours();
 
-    //typedef VISU::Plot3D TInterface;
+    typedef VISU::Plot3D TInterface;
     VISU_Plot3DPL* GetPlot3DPL() { return myPlot3DPL; }
 
   protected: