From 92cfd328ef2c563fb138b9580a93b8f9a21098e1 Mon Sep 17 00:00:00 2001 From: apo Date: Tue, 26 Apr 2005 07:29:57 +0000 Subject: [PATCH] PostPro 2005, T1.5: 2D fields displayed in 3D --- src/VISUGUI/VisuGUI.cxx | 5 +++++ src/VISUGUI/VisuGUI.h | 31 +++++++++++++++++++------------ src/VISUGUI/VisuGUI_Plot3DDlg.cxx | 25 ++----------------------- src/VISUGUI/VisuGUI_Plot3DDlg.h | 18 ++++++++---------- src/VISU_I/VISU_Gen_i.cc | 11 +++++++++++ src/VISU_I/VISU_Gen_i.hh | 2 ++ src/VISU_I/VISU_Plot3D_i.hh | 2 +- 7 files changed, 48 insertions(+), 46 deletions(-) diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index d7420315..22eb785f 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -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) { diff --git a/src/VISUGUI/VisuGUI.h b/src/VISUGUI/VisuGUI.h index a65d75f8..9ac7d83d 100644 --- a/src/VISUGUI/VisuGUI.h +++ b/src/VISUGUI/VisuGUI.h @@ -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(); diff --git a/src/VISUGUI/VisuGUI_Plot3DDlg.cxx b/src/VISUGUI/VisuGUI_Plot3DDlg.cxx index d3d0e070..c872148b 100644 --- a/src/VISUGUI/VisuGUI_Plot3DDlg.cxx +++ b/src/VISUGUI/VisuGUI_Plot3DDlg.cxx @@ -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() diff --git a/src/VISUGUI/VisuGUI_Plot3DDlg.h b/src/VISUGUI/VisuGUI_Plot3DDlg.h index caa7094e..19eff939 100644 --- a/src/VISUGUI/VisuGUI_Plot3DDlg.h +++ b/src/VISUGUI/VisuGUI_Plot3DDlg.h @@ -26,11 +26,11 @@ // 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 #include @@ -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 diff --git a/src/VISU_I/VISU_Gen_i.cc b/src/VISU_I/VISU_Gen_i.cc index 5db5aed5..f75c6af2 100644 --- a/src/VISU_I/VISU_Gen_i.cc +++ b/src/VISU_I/VISU_Gen_i.cc @@ -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)); Storable::Registry(IsoSurfaces_i::myComment.c_str(),&(Restore)); Storable::Registry(StreamLines_i::myComment.c_str(),&(Restore)); + Storable::Registry(Plot3D_i::myComment.c_str(),&(Restore)); Storable::Registry(Vectors_i::myComment.c_str(),&(Restore)); 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(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(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn(); + } + CutPlanes_ptr VISU_Gen_i::CutPlanesOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, diff --git a/src/VISU_I/VISU_Gen_i.hh b/src/VISU_I/VISU_Gen_i.hh index 7869cd6c..b1a37d75 100644 --- a/src/VISU_I/VISU_Gen_i.hh +++ b/src/VISU_I/VISU_Gen_i.hh @@ -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); diff --git a/src/VISU_I/VISU_Plot3D_i.hh b/src/VISU_I/VISU_Plot3D_i.hh index adc45ff9..02ca0f28 100644 --- a/src/VISU_I/VISU_Plot3D_i.hh +++ b/src/VISU_I/VISU_Plot3D_i.hh @@ -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: -- 2.39.2