1 // VISU OBJECT : interactive object for VISU entities implementation
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // File : VISU_View_i.cc
24 // Author : Alexey PETROV
27 #include "VISU_View_i.hh"
29 #include "VISU_Gen_i.hh"
30 #include "VISU_Prs3d_i.hh"
31 #include "VISU_Table_i.hh"
32 #include "VISU_ScalarMap_i.hh"
33 #include "VISU_ViewManager_i.hh"
35 #include "VisuGUI_TableDlg.h"
37 #include "VISU_Actor.h"
38 #include "VISU_ScalarMapAct.h"
40 #include "SALOME_Event.hxx"
42 #include "SUIT_ViewWindow.h"
43 #include "SUIT_ViewManager.h"
44 #include "SUIT_Tools.h"
46 #include "STD_MDIDesktop.h"
47 #include "STD_TabDesktop.h"
49 #include "SVTK_ViewWindow.h"
50 #include "SVTK_ViewModel.h"
52 #include "SPlot2d_ViewModel.h"
53 #include "Plot2d_ViewFrame.h"
55 #include "SalomeApp_Application.h"
56 #include "SalomeApp_Study.h"
58 #include <QtxWorkstack.h>
60 #include <qworkspace.h>
63 #include <vtkCamera.h>
64 #include <vtkRenderer.h>
69 static int MYDEBUG = 0;
71 static int MYDEBUG = 0;
76 typedef TVoidMemFunEvent<SUIT_ViewWindow> TFrameActionEvent;
78 struct TNewViewEvent: public SALOME_Event
80 SalomeApp_Application* myApplication;
81 typedef QWidget* TResult;
84 TNewViewEvent (SalomeApp_Application* theApplication):
85 myApplication(theApplication),
93 if (STD_MDIDesktop* aDesktop = dynamic_cast<STD_MDIDesktop*>(myApplication->desktop())) {
94 myResult = aDesktop->workspace();
100 View_i (SalomeApp_Application *theApplication,
101 SUIT_ViewManager* theViewManager):
102 myApplication(theApplication),
104 myViewManager(theViewManager)
106 if(MYDEBUG) MESSAGE("View_i::View_i - "<<this);
107 myWorkspace = ProcessEvent(new TNewViewEvent(theApplication));
113 if(MYDEBUG) MESSAGE("View_i::~View_i - "<<this);
117 struct TApplicationEvent: public SALOME_Event
119 SalomeApp_Application* myApplication;
121 TApplicationEvent(SalomeApp_Application* theApplication):
122 myApplication(theApplication)
128 ShowPart (VISU::View::ViewRepresentation theViewRepresentation,
129 CORBA::Boolean theState)
131 struct TEvent: public TApplicationEvent
133 VISU::View::ViewRepresentation myViewRepresentation;
134 CORBA::Boolean myState;
136 TEvent(SalomeApp_Application* theApplication,
137 VISU::View::ViewRepresentation theViewRepresentation,
138 CORBA::Boolean theState):
139 TApplicationEvent(theApplication),
140 myViewRepresentation(theViewRepresentation),
148 switch(myViewRepresentation){
149 case VISU::View::OBJECTBROWSER:
150 myApplication->setWindowShown(SalomeApp_Application::WT_ObjectBrowser,myState);
152 case VISU::View::PYTHON:
153 myApplication->setWindowShown(SalomeApp_Application::WT_PyConsole,myState);
155 case VISU::View::MESSAGES:
156 myApplication->setWindowShown(SalomeApp_Application::WT_LogWindow,myState);
158 case VISU::View::VIEWER:{
159 ViewManagerList aViewManagerList = myApplication->viewManagers();
167 ProcessVoidEvent(new TEvent(myApplication,theViewRepresentation,theState));
170 struct TPartShownEvent: public TApplicationEvent
172 VISU::View::ViewRepresentation myViewRepresentation;
173 typedef bool TResult;
176 TPartShownEvent(SalomeApp_Application* theApplication,
177 VISU::View::ViewRepresentation theViewRepresentation):
178 TApplicationEvent(theApplication),
179 myViewRepresentation(theViewRepresentation),
187 switch(myViewRepresentation){
188 case VISU::View::OBJECTBROWSER:
189 myResult = myApplication->isWindowVisible(SalomeApp_Application::WT_ObjectBrowser);
191 case VISU::View::PYTHON:
192 myResult = myApplication->isWindowVisible(SalomeApp_Application::WT_PyConsole);
194 case VISU::View::MESSAGES:
195 myResult = myApplication->isWindowVisible(SalomeApp_Application::WT_LogWindow);
197 case VISU::View::VIEWER:{
198 ViewManagerList aViewManagerList = myApplication->viewManagers();
208 IsPartShown (VISU::View::ViewRepresentation theViewRepresentation)
210 return ProcessEvent(new TPartShownEvent(myApplication,theViewRepresentation));
213 // Begin: New methods for view parameters management
214 struct TSplitEvent: public SALOME_Event
216 SalomeApp_Application * myApplication;
217 SUIT_ViewWindow * myVW;
218 Qt::Orientation myOrientation;
219 QtxWorkstack::SplitType mySplitType;
222 TSplitEvent (SalomeApp_Application * theApplication,
223 SUIT_ViewWindow * theViewWindow,
224 Qt::Orientation theOrientation,
225 QtxWorkstack::SplitType theSplitType):
226 myApplication(theApplication),
228 myOrientation(theOrientation),
229 mySplitType(theSplitType)
232 virtual void Execute()
234 SUIT_Desktop* desk = myApplication->desktop();
235 STD_TabDesktop* tabDesk = dynamic_cast<STD_TabDesktop*>(desk);
237 QtxWorkstack* workstack = tabDesk->workstack();
239 workstack->Split(myVW, myOrientation, mySplitType);
249 SUIT_ViewWindow* aVW = GetViewWindow();
251 ProcessVoidEvent(new TSplitEvent(myApplication, aVW,
252 Qt::Horizontal, QtxWorkstack::SPLIT_MOVE));
259 SUIT_ViewWindow* aVW = GetViewWindow();
261 ProcessVoidEvent(new TSplitEvent(myApplication, aVW,
262 Qt::Horizontal, QtxWorkstack::SPLIT_STAY));
269 SUIT_ViewWindow* aVW = GetViewWindow();
271 ProcessVoidEvent(new TSplitEvent(myApplication, aVW,
272 Qt::Vertical, QtxWorkstack::SPLIT_MOVE));
279 SUIT_ViewWindow* aVW = GetViewWindow();
281 ProcessVoidEvent(new TSplitEvent(myApplication, aVW,
282 Qt::Vertical, QtxWorkstack::SPLIT_STAY));
289 struct TOnTopEvent: public SALOME_Event
291 SUIT_ViewWindow * myVW;
294 TOnTopEvent (SUIT_ViewWindow * theViewWindow):
298 virtual void Execute()
306 SUIT_ViewWindow* aVW = GetViewWindow();
308 ProcessVoidEvent(new TOnTopEvent(aVW));
311 struct TAttractEvent: public SALOME_Event
313 SalomeApp_Application * myApplication;
314 SUIT_ViewWindow * myVW1;
315 SUIT_ViewWindow * myVW2;
319 TAttractEvent (SalomeApp_Application * theApplication,
320 SUIT_ViewWindow * theViewWindow1,
321 SUIT_ViewWindow * theViewWindow2,
323 myApplication(theApplication),
324 myVW1(theViewWindow1),
325 myVW2(theViewWindow2),
326 myAttractAll(theAttractAll)
329 virtual void Execute()
331 SUIT_Desktop* desk = myApplication->desktop();
332 STD_TabDesktop* tabDesk = dynamic_cast<STD_TabDesktop*>(desk);
334 QtxWorkstack* workstack = tabDesk->workstack();
336 workstack->Attract(myVW1, myVW2, myAttractAll);
344 Attract (VISU::View_ptr theView)
346 if (!CORBA::is_nil(theView)) {
347 if (VISU::View_i* pView = dynamic_cast<VISU::View_i*>(VISU::GetServant(theView).in())) {
349 SUIT_ViewWindow* aVW1 = GetViewWindow();
350 SUIT_ViewWindow* aVW2 = pView->GetViewWindow();
352 ProcessVoidEvent(new TAttractEvent(myApplication, aVW1, aVW2, false));
360 AttractAll (VISU::View_ptr theView)
362 if (!CORBA::is_nil(theView)) {
363 if (VISU::View_i* pView = dynamic_cast<VISU::View_i*>(VISU::GetServant(theView).in())) {
365 SUIT_ViewWindow* aVW1 = GetViewWindow();
366 SUIT_ViewWindow* aVW2 = pView->GetViewWindow();
368 ProcessVoidEvent(new TAttractEvent(myApplication, aVW1, aVW2, true));
374 struct TSizePositionEvent: public SALOME_Event
376 SalomeApp_Application * myApplication;
377 SUIT_ViewWindow * myVW;
382 TSizePositionEvent (SalomeApp_Application * theApplication,
383 SUIT_ViewWindow * theViewWindow,
386 myApplication(theApplication),
392 virtual void Execute()
394 MESSAGE("TSizePositionEvent::Execute()");
395 SUIT_Desktop* desk = myApplication->desktop();
396 STD_TabDesktop* tabDesk = dynamic_cast<STD_TabDesktop*>(desk);
398 QtxWorkstack* workstack = tabDesk->workstack();
401 //jfa to do:workstack->SetRelativeSizeInSplitter(myVW, myValue);
403 workstack->SetRelativePositionInSplitter(myVW, myValue);
412 SetRelativePositionInSplitter (CORBA::Double thePosition)
414 if (thePosition < 0.0 || 1.0 < thePosition) {
417 SUIT_ViewWindow* aVW = GetViewWindow();
419 ProcessVoidEvent(new TSizePositionEvent(myApplication, aVW, thePosition, false));
424 SetRelativeSizeInSplitter (CORBA::Double theSize)
426 if (theSize < 0.0 || 1.0 < theSize) {
429 SUIT_ViewWindow* aVW = GetViewWindow();
431 ProcessVoidEvent(new TSizePositionEvent(myApplication, aVW, theSize, true));
434 struct TWSSizePositionEvent: public SALOME_Event
436 SalomeApp_Application * myApplication;
437 SUIT_ViewWindow * myVW;
438 Qt::Orientation myOrientation;
443 TWSSizePositionEvent (SalomeApp_Application * theApplication,
444 SUIT_ViewWindow * theViewWindow,
445 Qt::Orientation theOrientation,
448 myApplication(theApplication),
450 myOrientation(theOrientation),
455 virtual void Execute()
457 MESSAGE("TWSSizePositionEvent::Execute()");
458 SUIT_Desktop* desk = myApplication->desktop();
459 STD_TabDesktop* tabDesk = dynamic_cast<STD_TabDesktop*>(desk);
461 QtxWorkstack* workstack = tabDesk->workstack();
464 //jfa to do:workstack->SetRelativeSize(myVW, myOrientation, myValue);
466 workstack->SetRelativePosition(myVW, myOrientation, myValue);
475 SetRelativePositionX (CORBA::Double thePosition)
477 if (thePosition < 0.0 || 1.0 < thePosition) {
480 SUIT_ViewWindow* aVW = GetViewWindow();
482 ProcessVoidEvent(new TWSSizePositionEvent(myApplication, aVW,
483 Qt::Horizontal, thePosition, false));
488 SetRelativePositionY (CORBA::Double thePosition)
490 if (thePosition < 0.0 || 1.0 < thePosition) {
493 SUIT_ViewWindow* aVW = GetViewWindow();
495 ProcessVoidEvent(new TWSSizePositionEvent(myApplication, aVW,
496 Qt::Vertical, thePosition, false));
501 SetRelativeSizeX (CORBA::Double theSize)
503 if (theSize < 0.0 || 1.0 < theSize) {
506 SUIT_ViewWindow* aVW = GetViewWindow();
508 ProcessVoidEvent(new TWSSizePositionEvent(myApplication, aVW,
509 Qt::Horizontal, theSize, true));
514 SetRelativeSizeY (CORBA::Double theSize)
516 if (theSize < 0.0 || 1.0 < theSize) {
519 SUIT_ViewWindow* aVW = GetViewWindow();
521 ProcessVoidEvent(new TWSSizePositionEvent(myApplication, aVW,
522 Qt::Vertical, theSize, true));
524 // End: New methods for view parameters management
526 // Begin: Old methods for view parameters management, they don't work now
527 struct TSetViewSize: public SALOME_Event
529 SUIT_ViewWindow* myVW;
530 typedef void (QRect::* TAction)(int);
535 TSetViewSize(SUIT_ViewWindow* theViewWindow,
537 CORBA::Long theSize):
547 if (QWidget* aParent = myVW->parentWidget(true)) {
548 QRect aQRect = aParent->frameGeometry();
549 (aQRect.*myAction)(mySize);
550 aParent->setGeometry(aQRect);
557 SetViewWidth(CORBA::Long theWidth)
559 ProcessVoidEvent(new TSetViewSize(myViewWindow,&QRect::setWidth,theWidth));
564 SetViewHeight(CORBA::Long theHeight)
566 ProcessVoidEvent(new TSetViewSize(myViewWindow,&QRect::setHeight,theHeight));
570 struct TGetViewSize: public SALOME_Event
572 SUIT_ViewWindow* myVW;
574 typedef int (QRect::* TAction)() const;
577 typedef CORBA::Long TResult;
581 TGetViewSize(SUIT_ViewWindow* theViewWindow,
591 if(QWidget* aParent = myVW->parentWidget(true)){
592 QRect aQRect = aParent->frameGeometry();
593 myResult = (aQRect.*myAction)();
603 return ProcessEvent(new TGetViewSize(myViewWindow,&QRect::width));
610 return ProcessEvent(new TGetViewSize(myViewWindow,&QRect::height));
614 class TWorkspaceEvent: public SALOME_Event
618 QWidget* myWorkspace;
621 TWorkspaceEvent(QWidget* theViewWindow,
622 QWidget* theWorkspace):
624 myWorkspace(theWorkspace)
629 class TAlignEvent: public TWorkspaceEvent
632 Qt::AlignmentFlags myAligment;
635 TAlignEvent(QWidget* theViewWindow,
636 QWidget* theWorkspace,
637 Qt::AlignmentFlags theAligment):
638 TWorkspaceEvent(theViewWindow,theWorkspace),
639 myAligment(theAligment)
646 if(QWidget* aParent = myVW->parentWidget(true))
647 SUIT_Tools::alignWidget(aParent,myWorkspace,myAligment);
654 SetViewPositionHorizontal (VISU::View::ViewPosition theViewPosition)
657 switch (theViewPosition) {
658 case VISU::View::LEFT:
659 ProcessVoidEvent(new TAlignEvent(myViewWindow,myWorkspace,Qt::AlignLeft));
661 case VISU::View::CENTER:
662 ProcessVoidEvent(new TAlignEvent(myViewWindow,myWorkspace,Qt::AlignHCenter));
664 case VISU::View::RIGHT:
665 ProcessVoidEvent(new TAlignEvent(myViewWindow,myWorkspace,Qt::AlignRight));
674 SetViewPositionVertical (VISU::View::ViewPosition theViewPosition)
677 switch (theViewPosition) {
678 case VISU::View::TOP:
679 ProcessVoidEvent(new TAlignEvent(myViewWindow,myWorkspace,Qt::AlignTop));
681 case VISU::View::CENTER:
682 ProcessVoidEvent(new TAlignEvent(myViewWindow,myWorkspace,Qt::AlignVCenter));
684 case VISU::View::BOTTOM:
685 ProcessVoidEvent(new TAlignEvent(myViewWindow,myWorkspace,Qt::AlignBottom));
692 class TXYEvent: public TWorkspaceEvent
695 CORBA::Double myX, myY;
698 TXYEvent(QWidget* theViewWindow,
699 QWidget* theWorkspace,
702 TWorkspaceEvent(theViewWindow,theWorkspace),
711 SetRelativePosition (CORBA::Double theX, CORBA::Double theY)
713 struct TEvent: public TXYEvent
716 TEvent(QWidget* theViewWindow,
717 QWidget* theWorkspace,
720 TXYEvent(theViewWindow,theWorkspace,theX,theY)
727 if(QWidget* aParent = myVW->parentWidget(true))
728 aParent->move(int(myX*myWorkspace->width()),int(myY*myWorkspace->height()));
733 ProcessVoidEvent(new TEvent(myViewWindow,myWorkspace,theX,theY));
738 SetRelativeSize (CORBA::Double theX, CORBA::Double theY)
740 struct TEvent: public TXYEvent
743 TEvent(QWidget* theViewWindow,
744 QWidget* theWorkspace,
747 TXYEvent(theViewWindow,theWorkspace,theX,theY)
754 if(QWidget* aParent = myVW->parentWidget(true))
755 aParent->setGeometry(aParent->x(),
757 int(myX*myWorkspace->width()),
758 int(myY*myWorkspace->height()));
763 ProcessVoidEvent(new TEvent(myViewWindow,myWorkspace,theX,theY));
765 // End: Old methods for view parameters management, they don't work now
769 SetBackground (const SALOMEDS::Color& theColor)
771 struct TEvent: public SALOME_Event
774 SALOMEDS::Color myColor;
776 TEvent(QWidget* theWidget,
777 const SALOMEDS::Color& theColor):
781 virtual void Execute(){
783 aColor[0] = int(255.0*myColor.R);
784 aColor[1] = int(255.0*myColor.G);
785 aColor[2] = int(255.0*myColor.B);
786 myWidget->setBackgroundColor(QColor(aColor[0],aColor[1],aColor[2]));
790 SUIT_ViewWindow* aVW = GetViewWindow();
792 ProcessVoidEvent(new TEvent(aVW, theColor));
796 struct TBackgroundEvent: public SALOME_Event
799 typedef SALOMEDS::Color TResult;
802 TBackgroundEvent(QWidget* theWidget):
810 const QColor& aColor = myWidget->backgroundColor();
811 myResult.R = aColor.red()/255.0;
812 myResult.G = aColor.green()/255.0;
813 myResult.B = aColor.blue()/255.0;
821 SUIT_ViewWindow* aVW = GetViewWindow();
823 return ProcessEvent(new TBackgroundEvent(aVW));
825 SALOMEDS::Color aBlack;
836 SUIT_ViewWindow* aVW = GetViewWindow();
838 ProcessVoidEvent(new TFrameActionEvent(aVW, &SUIT_ViewWindow::showMinimized));
845 SUIT_ViewWindow* aVW = GetViewWindow();
847 ProcessVoidEvent(new TFrameActionEvent(aVW, &SUIT_ViewWindow::showNormal));
854 SUIT_ViewWindow* aVW = GetViewWindow();
856 ProcessVoidEvent(new TFrameActionEvent(aVW, &SUIT_ViewWindow::showMaximized));
871 Erase (PrsObject_ptr thePrsObj)
876 Display (PrsObject_ptr thePrsObj)
881 DisplayOnly (PrsObject_ptr thePrsObj)
889 class TSavePictureEvent: public SALOME_Event
891 SUIT_ViewWindow * myVW;
892 const char * myFileName;
894 typedef CORBA::Boolean TResult;
896 TSavePictureEvent (SUIT_ViewWindow * theViewWindow, const char * theFileName)
897 : myVW(theViewWindow),
898 myFileName(theFileName),
903 virtual void Execute()
906 QImage img = myVW->dumpView();
908 QString fileName (myFileName);
909 if (!fileName.isEmpty()) {
910 QString fmt = SUIT_Tools::extension(fileName).upper();
911 if (fmt.isEmpty()) fmt = QString("BMP"); // default format
912 if (fmt == "JPG" ) fmt = "JPEG";
913 //QApplication::setOverrideCursor(Qt::waitCursor);
914 img.save(fileName, fmt.latin1());
916 //QApplication::restoreOverrideCursor();
924 View_i::SavePicture(const char* theFileName)
926 return ProcessEvent(new TSavePictureEvent (GetViewWindow(), theFileName));
930 View_i::GetComment() const
937 ToStream (std::ostringstream& theStr)
941 SUIT_ViewWindow* View_i::GetViewWindow()
944 QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
945 int aPos = aViews.find(myViewWindow);
952 void View_i::SetViewWindow(SUIT_ViewWindow* theViewWindow)
954 myViewWindow = theViewWindow;
958 //===========================================================================
959 XYPlot_i::XYPlot_i (SalomeApp_Application* theApplication)
960 : View_i(theApplication, NULL)
962 if (MYDEBUG) MESSAGE("XYPlot_i::XYPlot_i");
965 struct TCreatePlot2dViewEvent: public SALOME_Event
967 XYPlot_i * myPlot2dView;
970 typedef Plot2d_ViewFrame* TResult;
973 TCreatePlot2dViewEvent (XYPlot_i * thePlot2dView,
975 myPlot2dView(thePlot2dView),
984 if (!myPlot2dView->myApplication)
987 SUIT_ViewManager* aViewMgr =
988 myPlot2dView->myApplication->getViewManager(SPlot2d_Viewer::Type(), false);
989 SUIT_ViewWindow* aVW = NULL;
993 aVW = aViewMgr->createViewWindow();
995 aVW = aViewMgr->getActiveView();
998 aViewMgr = myPlot2dView->myApplication->getViewManager(SPlot2d_Viewer::Type(), true);
999 aVW = aViewMgr->getActiveView();
1001 return; // there are no current Plot2d view
1006 Plot2d_ViewWindow* aPlot2dVW = dynamic_cast<Plot2d_ViewWindow*>(aVW);
1008 myResult = aPlot2dVW->getViewFrame();
1010 myResult->Repaint();
1013 myPlot2dView->myViewManager = aViewMgr;
1014 myPlot2dView->SetViewWindow(aVW);
1020 Storable* XYPlot_i::Create (int theNew)
1022 myView = ProcessEvent(new TCreatePlot2dViewEvent(this, theNew));
1028 void XYPlot_i::Update()
1030 ProcessVoidEvent(new TVoidMemFunEvent<Plot2d_ViewFrame>(myView,&Plot2d_ViewFrame::Repaint));
1033 void XYPlot_i::Close()
1035 //jfa: may be need to be enclosed in SALOME_Event?
1036 SUIT_ViewWindow* aVW = GetViewWindow();
1039 //QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
1040 //int aPos = aViews.find(myViewWindow);
1042 // myViewWindow->close();
1045 XYPlot_i::~XYPlot_i() {
1046 if(MYDEBUG) MESSAGE("XYPlot_i::~XYPlot_i");
1049 void XYPlot_i::SetTitle (const char* theTitle)
1051 SUIT_ViewWindow* aVW = GetViewWindow();
1053 ProcessVoidEvent(new TVoidMemFun1ArgEvent<SUIT_ViewWindow,const QString&,QString>
1054 (aVW, &SUIT_ViewWindow::setCaption, QString(theTitle)));
1056 char* XYPlot_i::GetTitle()
1058 SUIT_ViewWindow* aVW = GetViewWindow();
1060 return CORBA::string_dup(aVW->caption().latin1());
1061 return CORBA::string_dup("");
1064 void XYPlot_i::SetSubTitle (const char* theTitle)
1066 if (GetViewWindow())
1067 ProcessVoidEvent(new TVoidMemFun1ArgEvent<Plot2d_ViewFrame,const QString&,QString>
1068 (myView, &Plot2d_ViewFrame::setTitle, QString(theTitle)));
1071 char* XYPlot_i::GetSubTitle()
1073 if (GetViewWindow())
1074 return CORBA::string_dup(myView->getTitle());
1075 return CORBA::string_dup("");
1078 void XYPlot_i::SetCurveType (VISU::XYPlot::CurveType theType)
1080 if (GetViewWindow())
1081 ProcessVoidEvent(new TVoidMemFun2ArgEvent<Plot2d_ViewFrame,int,bool>
1082 (myView,&Plot2d_ViewFrame::setCurveType,theType,true));
1085 VISU::XYPlot::CurveType XYPlot_i::GetCurveType()
1087 if (GetViewWindow())
1088 return (VISU::XYPlot::CurveType)myView->getCurveType();
1089 return VISU::XYPlot::POINTS;
1092 void XYPlot_i::SetMarkerSize (CORBA::Long theSize)
1094 if (GetViewWindow())
1095 ProcessVoidEvent(new TVoidMemFun2ArgEvent<Plot2d_ViewFrame,int,bool>
1096 (myView,&Plot2d_ViewFrame::setMarkerSize,theSize,true));
1099 CORBA::Long XYPlot_i::GetMarkerSize()
1101 if (GetViewWindow())
1102 return myView->getMarkerSize();
1106 class TEnableGridEvent: public SALOME_Event
1109 typedef void (Plot2d_ViewFrame::* TFun)(bool, const int, bool, const int, bool);
1110 TEnableGridEvent (Plot2d_ViewFrame* theView, TFun theFun,
1111 CORBA::Boolean theMajor, CORBA::Long theNumMajor,
1112 CORBA::Boolean theMinor, CORBA::Long theNumMinor):
1113 myView(theView), myFun(theFun),
1114 myMajor(theMajor), myNumMajor(theNumMajor),
1115 myMinor(theMinor), myNumMinor(theNumMinor)
1118 virtual void Execute()
1120 (myView->*myFun)(myMajor,myNumMajor,myMinor,myNumMinor,true);
1123 Plot2d_ViewFrame* myView;
1125 CORBA::Boolean myMajor, myMinor;
1126 CORBA::Long myNumMajor, myNumMinor;
1129 void XYPlot_i::EnableXGrid (CORBA::Boolean theMajor, CORBA::Long theNumMajor,
1130 CORBA::Boolean theMinor, CORBA::Long theNumMinor)
1132 if (GetViewWindow())
1133 ProcessVoidEvent(new TEnableGridEvent(myView,&Plot2d_ViewFrame::setXGrid,
1134 theMajor,theNumMajor,theMinor,theNumMinor));
1136 void XYPlot_i::EnableYGrid(CORBA::Boolean theMajor, CORBA::Long theNumMajor,
1137 CORBA::Boolean theMinor, CORBA::Long theNumMinor)
1139 //asl: Plot2d_ViewFrame::setYGrid has more parameters
1140 //if (GetViewWindow())
1141 // ProcessVoidEvent(new TEnableGridEvent(myView,&Plot2d_ViewFrame::setYGrid,
1142 // theMajor,theNumMajor,theMinor,theNumMinor));
1145 class TSetScaleModeEvent: public SALOME_Event
1148 typedef void (Plot2d_ViewFrame::* TFun)(const int, bool);
1149 TSetScaleModeEvent (Plot2d_ViewFrame* theView, TFun theFun, int theScaling):
1150 myView(theView), myFun(theFun), myScaling(theScaling)
1153 virtual void Execute()
1155 (myView->*myFun)(myScaling,true);
1158 Plot2d_ViewFrame* myView;
1163 void XYPlot_i::SetHorScaling (VISU::Scaling theScaling)
1165 if (GetViewWindow())
1166 ProcessVoidEvent(new TSetScaleModeEvent(myView,&Plot2d_ViewFrame::setHorScaleMode,
1167 theScaling == VISU::LOGARITHMIC));
1170 VISU::Scaling XYPlot_i::GetHorScaling()
1172 //jfa: may be need to be enclosed in SALOME_Event?
1173 if (GetViewWindow())
1174 return (VISU::Scaling)myView->getHorScaleMode();
1175 return VISU::LINEAR;
1178 void XYPlot_i::SetVerScaling(VISU::Scaling theScaling)
1180 if (GetViewWindow())
1181 ProcessVoidEvent(new TSetScaleModeEvent(myView,&Plot2d_ViewFrame::setVerScaleMode,
1182 theScaling == VISU::LOGARITHMIC));
1185 VISU::Scaling XYPlot_i::GetVerScaling()
1187 if (GetViewWindow())
1188 return (VISU::Scaling)myView->getVerScaleMode();
1189 return VISU::LINEAR;
1192 class TSetTitleEvent: public SALOME_Event
1195 TSetTitleEvent (Plot2d_ViewFrame* theView, Plot2d_ViewFrame::ObjectType theType, const char* theTitle):
1196 myView(theView), myType(theType), myTitle(theTitle)
1198 virtual void Execute()
1200 myView->setTitle(true,myTitle,myType);
1203 Plot2d_ViewFrame* myView;
1204 Plot2d_ViewFrame::ObjectType myType;
1205 const char* myTitle;
1208 void XYPlot_i::SetXTitle (const char* theTitle)
1210 if (GetViewWindow())
1211 ProcessVoidEvent(new TSetTitleEvent(myView, Plot2d_ViewFrame::XTitle, theTitle));
1213 char* XYPlot_i::GetXTitle()
1215 if (GetViewWindow())
1216 return CORBA::string_dup(myView->getTitle(Plot2d_ViewFrame::XTitle));
1217 return CORBA::string_dup("");
1220 void XYPlot_i::SetYTitle (const char* theTitle)
1222 if (GetViewWindow())
1223 ProcessVoidEvent(new TSetTitleEvent(myView, Plot2d_ViewFrame::YTitle, theTitle));
1225 char* XYPlot_i::GetYTitle()
1227 if (GetViewWindow())
1228 return CORBA::string_dup(myView->getTitle(Plot2d_ViewFrame::YTitle));
1229 return CORBA::string_dup("");
1232 void XYPlot_i::ShowLegend (CORBA::Boolean theShowing)
1234 if (GetViewWindow())
1235 ProcessVoidEvent(new TVoidMemFun2ArgEvent<Plot2d_ViewFrame,bool,bool>
1236 (myView,&Plot2d_ViewFrame::showLegend,theShowing,true));
1239 class TXYPlotViewEvent: public SALOME_Event
1241 SalomeApp_Application* myApplication;
1242 Plot2d_ViewFrame* myView;
1243 PrsObject_ptr myPrsObj;
1247 TXYPlotViewEvent(SalomeApp_Application* theApplication,
1248 Plot2d_ViewFrame* theView,
1249 PrsObject_ptr thePrsObj,
1251 : myApplication(theApplication),
1253 myPrsObj(thePrsObj),
1254 myDisplaing(theDisplaing)
1258 virtual void Execute()
1261 if (Curve_i* aCurve = dynamic_cast<Curve_i*>(VISU::GetServant(myPrsObj).in())) {
1262 UpdatePlot2d(myView,myDisplaing,aCurve);
1264 // is it Container ?
1265 if (Container_i* aContainer = dynamic_cast<Container_i*>(VISU::GetServant(myPrsObj).in())) {
1266 int nbCurves = aContainer->GetNbCurves();
1267 for ( int i = 1; i <= nbCurves; i++ ) {
1268 VISU::Curve_i* aCurve = aContainer->GetCurve( i );
1269 if ( aCurve && aCurve->IsValid() ) {
1270 UpdatePlot2d(myView,myDisplaing,aCurve);
1276 if (Table_i* aTable = dynamic_cast<Table_i*>(VISU::GetServant(myPrsObj).in())) {
1277 _PTR(Study) aCStudy;
1278 if (SUIT_Study* aSStudy = myApplication->activeStudy()) {
1279 if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy)) {
1280 aCStudy = aStudy->studyDS();
1283 if (!aCStudy) return;
1284 _PTR(SObject) TableSO = aCStudy->FindObjectID(aTable->GetEntry().latin1());
1286 _PTR(ChildIterator) Iter = aCStudy->NewChildIterator(TableSO);
1287 for (; Iter->More(); Iter->Next()) {
1288 CORBA::Object_var childObject = VISU::ClientSObjectToObject(Iter->Value());
1289 if (!CORBA::is_nil(childObject)) {
1290 CORBA::Object_ptr aCurve = VISU::Curve::_narrow(childObject);
1291 if (!CORBA::is_nil(aCurve))
1292 UpdatePlot2d(myView, myDisplaing,
1293 dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurve).in()));
1302 void XYPlot_i::Display (PrsObject_ptr thePrsObj)
1304 if (GetViewWindow())
1305 ProcessVoidEvent(new TXYPlotViewEvent (myApplication,myView,thePrsObj,eDisplay));
1308 void XYPlot_i::Erase (PrsObject_ptr thePrsObj)
1310 if (GetViewWindow())
1311 ProcessVoidEvent(new TXYPlotViewEvent (myApplication,myView,thePrsObj,eErase));
1314 void XYPlot_i::DisplayOnly (PrsObject_ptr thePrsObj)
1316 if (GetViewWindow())
1317 ProcessVoidEvent(new TXYPlotViewEvent (myApplication,myView,thePrsObj,eDisplayOnly));
1320 void XYPlot_i::EraseAll()
1322 if (GetViewWindow())
1323 ProcessVoidEvent(new TVoidMemFunEvent<Plot2d_ViewFrame> (myView,&Plot2d_ViewFrame::EraseAll));
1326 void XYPlot_i::FitAll()
1328 if (GetViewWindow())
1329 ProcessVoidEvent(new TVoidMemFunEvent<Plot2d_ViewFrame> (myView,&Plot2d_ViewFrame::fitAll));
1332 class TFitRangeEvent: public SALOME_Event
1335 TFitRangeEvent (Plot2d_ViewFrame* theView,
1337 const double xMin, const double xMax,
1338 const double yMin, const double yMax):
1341 myXMin(xMin),myXMax(xMax),
1342 myYMin(yMin),myYMax(yMax)
1344 virtual void Execute()
1346 myView->fitData(myMode,myXMin,myXMax,myYMin,myYMax);
1350 const double myXMin;
1351 const double myXMax;
1352 const double myYMin;
1353 const double myYMax;
1354 Plot2d_ViewFrame* myView;
1357 void XYPlot_i::FitXRange(const CORBA::Double xMin,const CORBA::Double xMax)
1359 const CORBA::Long mode = 1;
1360 const CORBA::Double yMin = 0.0;
1361 const CORBA::Double yMax = 0.0;
1362 ProcessVoidEvent(new TFitRangeEvent(myView,mode,xMin,xMax,yMin,yMax));
1365 void XYPlot_i::FitYRange(const CORBA::Double yMin,const CORBA::Double yMax)
1367 const CORBA::Long mode = 2;
1368 const CORBA::Double xMin = 0.0;
1369 const CORBA::Double xMax = 0.0;
1370 ProcessVoidEvent(new TFitRangeEvent(myView,mode,xMin,xMax,yMin,yMax));
1373 void XYPlot_i::FitRange(const CORBA::Double xMin,const CORBA::Double xMax,
1374 const CORBA::Double yMin,const CORBA::Double yMax)
1376 const CORBA::Long mode = 0;
1377 ProcessVoidEvent(new TFitRangeEvent(myView,mode,xMin,xMax,yMin,yMax));
1380 void XYPlot_i::GetFitRanges(double& xMin, double& xMax, double& yMin, double& yMax)
1383 myView->getFitRanges(xMin,xMax,yMin,yMax,y2Min,y2Max);
1386 //===========================================================================
1387 TableView_i::TableView_i (SalomeApp_Application* theApplication)
1388 : View_i(theApplication, NULL)
1392 struct TCreateTableViewEvent: public SALOME_Event
1394 SalomeApp_Application* myApplication;
1395 VISU::Table_i* myTable;
1397 typedef VisuGUI_TableDlg* TResult;
1400 TCreateTableViewEvent (SalomeApp_Application* theApplication,
1401 VISU::Table_i* theTable):
1402 myApplication(theApplication),
1411 if (myTable != NULL) {
1412 if (SUIT_Study* aSStudy = myApplication->activeStudy()) {
1413 if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy)) {
1414 if (_PTR(Study) aCStudy = aStudy->studyDS()) {
1415 _PTR(SObject) aSObject = aCStudy->FindObjectID(myTable->GetObjectEntry());
1417 myResult = new VisuGUI_TableDlg (myApplication->desktop(),
1420 VisuGUI_TableDlg::ttAuto,
1431 Storable* TableView_i::Create (VISU::Table_ptr theTable)
1433 if (MYDEBUG) MESSAGE("TableView_i::Create - " << (!theTable->_is_nil()));
1434 if (!theTable->_is_nil()) {
1435 VISU::Table_i* table =
1436 dynamic_cast<VISU::Table_i*>(VISU::GetServant(theTable).in());
1437 if (MYDEBUG) MESSAGE("TableView_i::Create - dynamic_cast = " << table);
1439 myView = ProcessEvent(new TCreateTableViewEvent(myApplication, table));
1446 TableView_i::~TableView_i()
1448 if(MYDEBUG) MESSAGE("TableView_i::~TableView_i");
1452 void TableView_i::SetTitle (const char* theTitle)
1454 ProcessVoidEvent(new TVoidMemFun1ArgEvent<VisuGUI_TableDlg,const QString&,QString>
1455 (myView, &VisuGUI_TableDlg::setCaption, QString(theTitle)));
1458 char* TableView_i::GetTitle()
1460 //jfa: may be need to be enclosed in SALOME_Event?
1461 return CORBA::string_dup(myView->caption().latin1());
1464 void TableView_i::Close()
1466 //jfa: may be need to be enclosed in SALOME_Event?
1471 //===========================================================================
1472 int View3D_i::myNbViewParams = 0;
1473 const string View3D_i::myComment = "VIEW3D";
1474 const char* View3D_i::GetComment() const { return myComment.c_str();}
1476 QString View3D_i::GenerateViewParamsName()
1478 return VISU::GenerateName("ViewParams", ++myNbViewParams);
1481 View3D_i::View3D_i (SalomeApp_Application* theApplication)
1482 : View_i(theApplication, NULL)
1484 if (MYDEBUG) MESSAGE("View3D_i::View3D_i");
1487 struct TCreateView3dEvent: public SALOME_Event
1489 SalomeApp_Application *myApplication;
1490 View3D_i * myView3D;
1493 typedef SUIT_ViewWindow* TResult;
1496 TCreateView3dEvent (SalomeApp_Application *theApplication,
1497 View3D_i * theView3D,
1499 myApplication(theApplication),
1500 myView3D(theView3D),
1513 if(SUIT_ViewManager* aViewManager = myApplication->getViewManager(SVTK_Viewer::Type(),false)){
1514 myResult = aViewManager->createViewWindow();
1515 myView3D->myViewManager = aViewManager;
1517 if(SUIT_ViewManager* aViewManager = myApplication->getViewManager(SVTK_Viewer::Type(),true)){
1518 myResult = aViewManager->getActiveView();
1519 myView3D->myViewManager = aViewManager;
1523 if(SUIT_ViewManager* aViewManager = myApplication->activeViewManager()){
1524 if(SUIT_ViewWindow* aView = aViewManager->getActiveView()){
1525 if(dynamic_cast<SVTK_ViewWindow*>(aView)){
1526 myView3D->myViewManager = aViewManager;
1527 myResult = aViewManager->getActiveView();
1531 if(SUIT_ViewManager* aViewManager = myApplication->getViewManager(SVTK_Viewer::Type(),false)){
1532 myView3D->myViewManager = aViewManager;
1533 myResult = aViewManager->getActiveView();
1540 Storable* View3D_i::Create (int theNew)
1542 if (MYDEBUG) MESSAGE("View3D_i::Create");
1543 SUIT_ViewWindow* aVW = ProcessEvent(new TCreateView3dEvent(myApplication, this, theNew));
1551 void View3D_i::Update()
1553 class TEvent: public SALOME_Event
1555 SUIT_ViewWindow* myVW;
1557 TEvent(SUIT_ViewWindow* theViewWindow):
1560 virtual void Execute()
1562 SVTK_ViewWindow* vf = dynamic_cast<SVTK_ViewWindow*>(myVW);
1563 vtkRenderer* Renderer = vf->getRenderer();
1564 vtkActorCollection* theActors = Renderer->GetActors();
1565 theActors->InitTraversal();
1566 while (vtkActor *anAct = theActors->GetNextActor()) {
1567 if (VISU_Actor* anActor = dynamic_cast<VISU_Actor*>(anAct)) {
1568 VISU::Prs3d_i* aPrs3d = anActor->GetPrs3d();
1569 if (anActor->GetVisibility() && aPrs3d) {
1571 aPrs3d->UpdateActor(anActor);
1579 SUIT_ViewWindow* aVW = GetViewWindow();
1581 ProcessVoidEvent(new TEvent(aVW));
1584 bool View3D_i::SaveViewParams (SUIT_ViewManager* theViewManager, const char* theName)
1586 MESSAGE("View3D_i::SaveViewParams()");
1588 if (!theViewManager || !theName)
1591 _PTR(Study) aCStudy;
1592 if (SUIT_Study* aSStudy = theViewManager->study()) {
1593 if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy)) {
1594 aCStudy = aStudy->studyDS();
1600 if (strcmp(theName, "") != 0) {
1601 std::vector<_PTR(SObject)> aList = aCStudy->FindObjectByName(theName, "VISU");
1602 _PTR(GenericAttribute) anAttr;
1603 int iEnd = aList.size();
1604 for (int i = 0; i < iEnd; i++) {
1605 _PTR(SObject) anObj = aList[i];
1606 string anEntry = anObj->GetID();
1607 if(MYDEBUG) MESSAGE("View3D_i::SaveViewParams - anEntry = " << anEntry);
1608 if (anObj->FindAttribute(anAttr, "AttributeComment")) {
1609 _PTR(AttributeComment) aCmnt (anAttr);
1610 string aComm (aCmnt->Value());
1611 if (MYDEBUG) MESSAGE("View3D_i::SaveViewPoint - aComm = " << aComm);
1612 if (aComm.compare(View3D_i::myComment) >= 0) {
1613 aCmnt->SetValue(ToString(theViewManager->getActiveView()).c_str());
1619 _PTR(SComponent) aSComponent = ClientFindOrCreateVisuComponent(aCStudy);
1620 string aSComponentEntry = aSComponent->GetID();
1621 string anEntry = CreateAttributes(aCStudy, aSComponentEntry.c_str(), "", "", theName, "",
1622 ToString(theViewManager->getActiveView()).c_str());
1626 class TSaveViewParamsEvent: public SALOME_Event
1628 SUIT_ViewManager* myViewMgr;
1631 TSaveViewParamsEvent (SUIT_ViewManager* theViewManager,
1632 const char* theName):
1633 myViewMgr(theViewManager),
1637 virtual void Execute()
1639 myResult = View3D_i::SaveViewParams(myViewMgr, myName);
1641 typedef CORBA::Boolean TResult;
1645 CORBA::Boolean View3D_i::SaveViewParams (const char* theName)
1647 return ProcessEvent(new TSaveViewParamsEvent (myViewManager, theName));
1650 bool View3D_i::RestoreViewParams (SUIT_ViewManager* theViewManager, const char* theName)
1652 _PTR(Study) aCStudy;
1653 if (SUIT_Study* aSStudy = theViewManager->study()) {
1654 if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy)) {
1655 aCStudy = aStudy->studyDS();
1661 std::vector<_PTR(SObject)> aList = aCStudy->FindObjectByName(theName, "VISU");
1662 _PTR(GenericAttribute) anAttr;
1663 int iEnd = aList.size();
1664 if (MYDEBUG) MESSAGE("View3D_i::RestoreViewPoint - iEnd = " << iEnd);
1665 for (int i = 0; i < iEnd; i++) {
1666 _PTR(SObject) anObj = aList[i];
1667 string anEntry = anObj->GetID();
1668 if (MYDEBUG) MESSAGE("View3D_i::RestoreViewPoint - anEntry = " << anEntry);
1669 if (anObj->FindAttribute(anAttr, "AttributeComment")) {
1670 _PTR(AttributeComment) aCmnt (anAttr);
1671 QString strIn(aCmnt->Value().c_str());
1672 Storable::TRestoringMap aMap;
1673 Storable::StrToMap(strIn, aMap);
1674 if (Storable::FindValue(aMap, "myComment").compare
1675 (View3D_i::myComment.c_str()) >= 0) {
1676 if (MYDEBUG) MESSAGE("View3D_i::RestoreViewPoint - aComm = " << strIn);
1677 Restore(theViewManager->getActiveView(), aMap);
1685 class TRestoreViewParamsEvent: public SALOME_Event
1687 SUIT_ViewManager* myViewMgr;
1690 TRestoreViewParamsEvent (SUIT_ViewManager* theViewManager,
1691 const char* theName):
1692 myViewMgr(theViewManager),
1696 virtual void Execute()
1698 myResult = View3D_i::RestoreViewParams(myViewMgr, myName);
1700 typedef CORBA::Boolean TResult;
1704 CORBA::Boolean View3D_i::RestoreViewParams (const char* theName)
1706 return ProcessEvent(new TRestoreViewParamsEvent (myViewManager, theName));
1709 void View3D_i::Restore (SUIT_ViewWindow* theViewWindow,
1710 const Storable::TRestoringMap& theMap)
1712 SALOMEDS::Color aColor;
1713 aColor.R = VISU::Storable::FindValue(theMap,"myColor.R").toDouble();
1714 aColor.G = VISU::Storable::FindValue(theMap,"myColor.G").toDouble();
1715 aColor.B = VISU::Storable::FindValue(theMap,"myColor.B").toDouble();
1717 double aPosition[3];
1718 aPosition[0] = VISU::Storable::FindValue(theMap,"myPosition[0]").toDouble();
1719 aPosition[1] = VISU::Storable::FindValue(theMap,"myPosition[1]").toDouble();
1720 aPosition[2] = VISU::Storable::FindValue(theMap,"myPosition[2]").toDouble();
1722 double aFocalPnt[3];
1723 aFocalPnt[0] = VISU::Storable::FindValue(theMap,"myFocalPnt[0]").toDouble();
1724 aFocalPnt[1] = VISU::Storable::FindValue(theMap,"myFocalPnt[1]").toDouble();
1725 aFocalPnt[2] = VISU::Storable::FindValue(theMap,"myFocalPnt[2]").toDouble();
1728 aViewUp[0] = VISU::Storable::FindValue(theMap,"myViewUp[0]").toDouble();
1729 aViewUp[1] = VISU::Storable::FindValue(theMap,"myViewUp[1]").toDouble();
1730 aViewUp[2] = VISU::Storable::FindValue(theMap,"myViewUp[2]").toDouble();
1732 double aParallelScale = VISU::Storable::FindValue(theMap,"myParallelScale").toDouble();
1734 double aScaleFactor[3];
1735 aScaleFactor[0] = VISU::Storable::FindValue(theMap,"myScaleFactor[0]").toDouble();
1736 aScaleFactor[1] = VISU::Storable::FindValue(theMap,"myScaleFactor[1]").toDouble();
1737 aScaleFactor[2] = VISU::Storable::FindValue(theMap,"myScaleFactor[2]").toDouble();
1739 SetBackground(theViewWindow,aColor);
1740 SetPointOfView(theViewWindow,aPosition);
1741 SetViewUp(theViewWindow,aViewUp);
1742 SetFocalPoint(theViewWindow,aFocalPnt);
1743 SetParallelScale(theViewWindow,aParallelScale);
1744 ScaleView(theViewWindow,VISU::View3D::XAxis,aScaleFactor[0]);
1745 ScaleView(theViewWindow,VISU::View3D::YAxis,aScaleFactor[1]);
1746 ScaleView(theViewWindow,VISU::View3D::ZAxis,aScaleFactor[2]);
1750 string View3D_i::ToString (SUIT_ViewWindow* theViewWindow)
1752 ostringstream strOut;
1753 Storable::DataToStream(strOut, "myComment", myComment.c_str());
1754 ToStream(theViewWindow, strOut);
1756 if(MYDEBUG) MESSAGE("View3D_i::ToString - " << strOut.str());
1757 return strOut.str();
1760 void View3D_i::ToStream (SUIT_ViewWindow* theViewWindow, std::ostringstream& theStr)
1762 Storable::DataToStream(theStr,"myType",VISU::TVIEW3D);
1764 vtkFloatingPointType backint[3];
1765 GetRenderer(theViewWindow)->GetBackground(backint);
1766 Storable::DataToStream(theStr,"myColor.R",backint[0]);
1767 Storable::DataToStream(theStr,"myColor.G",backint[1]);
1768 Storable::DataToStream(theStr,"myColor.B",backint[2]);
1770 double aPosition[3];
1771 GetPointOfView(theViewWindow,aPosition);
1772 Storable::DataToStream(theStr,"myPosition[0]",aPosition[0]);
1773 Storable::DataToStream(theStr,"myPosition[1]",aPosition[1]);
1774 Storable::DataToStream(theStr,"myPosition[2]",aPosition[2]);
1776 double aFocalPnt[3];
1777 GetFocalPoint(theViewWindow,aFocalPnt);
1778 Storable::DataToStream(theStr,"myFocalPnt[0]",aFocalPnt[0]);
1779 Storable::DataToStream(theStr,"myFocalPnt[1]",aFocalPnt[1]);
1780 Storable::DataToStream(theStr,"myFocalPnt[2]",aFocalPnt[2]);
1783 GetCamera(theViewWindow)->GetViewUp(aViewUp);
1784 Storable::DataToStream(theStr,"myViewUp[0]",aViewUp[0]);
1785 Storable::DataToStream(theStr,"myViewUp[1]",aViewUp[1]);
1786 Storable::DataToStream(theStr,"myViewUp[2]",aViewUp[2]);
1788 Storable::DataToStream(theStr,"myParallelScale",GetParallelScale(theViewWindow));
1790 double aScaleFactor[3];
1791 (dynamic_cast<SVTK_ViewWindow*>(theViewWindow))->GetScale(aScaleFactor);
1792 Storable::DataToStream(theStr,"myScaleFactor[0]",aScaleFactor[0]);
1793 Storable::DataToStream(theStr,"myScaleFactor[1]",aScaleFactor[1]);
1794 Storable::DataToStream(theStr,"myScaleFactor[2]",aScaleFactor[2]);
1797 void View3D_i::ToStream(std::ostringstream& theStr)
1799 SUIT_ViewWindow* aVW = GetViewWindow();
1801 ToStream(aVW, theStr);
1804 void View3D_i::Close()
1806 //jfa: may be need to be enclosed in SALOME_Event?
1807 SUIT_ViewWindow* aVW = GetViewWindow();
1810 //QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
1811 //int aPos = aViews.find(myViewWindow);
1813 // myViewWindow->close();
1816 View3D_i::~View3D_i()
1818 if(MYDEBUG) MESSAGE("View3D_i::~View3D_i");
1821 void View3D_i::SetTitle (const char* theTitle)
1823 SUIT_ViewWindow* aVW = GetViewWindow();
1825 ProcessVoidEvent(new TVoidMemFun1ArgEvent<SUIT_ViewWindow,const QString&,QString>
1826 (aVW,&SUIT_ViewWindow::setCaption,QString(theTitle)));
1829 char* View3D_i::GetTitle()
1831 SUIT_ViewWindow* aVW = GetViewWindow();
1833 return CORBA::string_dup(aVW->caption().latin1());
1834 return CORBA::string_dup("");
1837 void View3D_i::SetBackground (SUIT_ViewWindow* theViewWindow,
1838 const SALOMEDS::Color& theColor)
1840 //jfa: may be need to be enclosed in SALOME_Event?
1842 aColor[0] = int(255.0*theColor.R);
1843 aColor[1] = int(255.0*theColor.G);
1844 aColor[2] = int(255.0*theColor.B);
1845 QColor aNewColor (aColor[0],aColor[1],aColor[2]);
1846 (dynamic_cast<SVTK_ViewWindow*>(theViewWindow))->setBackgroundColor(aNewColor);
1849 SALOMEDS::Color View3D_i::GetBackground (SUIT_ViewWindow* theViewWindow)
1851 SALOMEDS::Color aColor;
1852 vtkFloatingPointType backint[3];
1853 GetRenderer(theViewWindow)->GetBackground(backint);
1854 aColor.R = backint[0]; aColor.G = backint[1]; aColor.B = backint[2];
1858 class TUpdateViewerEvent: public SALOME_Event
1860 SUIT_ViewWindow* myVW;
1864 TUpdateViewerEvent(SUIT_ViewWindow* theViewWindow,
1867 myVW(theViewWindow),
1869 myDisplaing(theDisplaing)
1871 virtual void Execute(){
1872 UpdateViewer(myVW, myDisplaing, myPrs3d);
1876 void View3D_i::EraseAll()
1878 if(MYDEBUG) MESSAGE("View3D_i::EraseAll");
1879 SUIT_ViewWindow* aVW = GetViewWindow();
1881 ProcessVoidEvent(new TUpdateViewerEvent(aVW,NULL,eEraseAll));
1884 void View3D_i::DisplayAll()
1886 if(MYDEBUG) MESSAGE("View3D_i::DisplayAll");
1887 SUIT_ViewWindow* aVW = GetViewWindow();
1889 ProcessVoidEvent(new TUpdateViewerEvent(aVW,NULL,eDisplayAll));
1892 void View3D_i::Erase (PrsObject_ptr thePrsObj)
1894 if(MYDEBUG) MESSAGE("View3D_i::Erase");
1895 SUIT_ViewWindow* aVW = GetViewWindow();
1896 CORBA::Object_ptr anObj = thePrsObj;
1897 Prs3d_i* aPrs = dynamic_cast<Prs3d_i*>(VISU::GetServant(anObj).in());
1899 ProcessVoidEvent(new TUpdateViewerEvent(aVW,aPrs,eErase));
1902 void View3D_i::Display (PrsObject_ptr thePrsObj)
1904 if(MYDEBUG) MESSAGE("View3D_i::Display");
1905 SUIT_ViewWindow* aVW = GetViewWindow();
1906 CORBA::Object_ptr anObj = thePrsObj;
1907 Prs3d_i* aPrs = dynamic_cast<Prs3d_i*>(VISU::GetServant(anObj).in());
1909 ProcessVoidEvent(new TUpdateViewerEvent(aVW,aPrs,eDisplay));
1912 void View3D_i::DisplayOnly (PrsObject_ptr thePrsObj)
1914 if(MYDEBUG) MESSAGE("View3D_i::DisplayOnly");
1915 SUIT_ViewWindow* aVW = GetViewWindow();
1916 CORBA::Object_ptr anObj = thePrsObj;
1917 Prs3d_i* aPrs = dynamic_cast<Prs3d_i*>(VISU::GetServant(anObj).in());
1919 ProcessVoidEvent(new TUpdateViewerEvent(aVW,aPrs,eDisplayOnly));
1922 void View3D_i::FitAll()
1924 SUIT_ViewWindow* aVW = GetViewWindow();
1926 ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
1927 (dynamic_cast<SVTK_ViewWindow*>(aVW), &SVTK_ViewWindow::onFitAll));
1932 void View3D_i::SetView (VISU::View3D::ViewType theType)
1934 SUIT_ViewWindow* aVW = GetViewWindow();
1939 case VISU::View3D::FRONT :
1940 ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
1941 (dynamic_cast<SVTK_ViewWindow*>(aVW), &SVTK_ViewWindow::onFrontView));
1943 case VISU::View3D::BACK :
1944 ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
1945 (dynamic_cast<SVTK_ViewWindow*>(aVW), &SVTK_ViewWindow::onBackView));
1947 case VISU::View3D::LEFT :
1948 ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
1949 (dynamic_cast<SVTK_ViewWindow*>(aVW),&SVTK_ViewWindow::onLeftView));
1951 case VISU::View3D::RIGHT :
1952 ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
1953 (dynamic_cast<SVTK_ViewWindow*>(aVW),&SVTK_ViewWindow::onRightView));
1955 case VISU::View3D::TOP :
1956 ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
1957 (dynamic_cast<SVTK_ViewWindow*>(aVW),&SVTK_ViewWindow::onTopView));
1959 case VISU::View3D::BOTTOM :
1960 ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
1961 (dynamic_cast<SVTK_ViewWindow*>(aVW),&SVTK_ViewWindow::onBottomView));
1967 class TSet3DViewParamEvent: public SALOME_Event
1970 typedef void (*TFun)(SUIT_ViewWindow* theViewWindow, const CORBA::Double theParam[3]);
1971 TSet3DViewParamEvent (TFun theFun,
1972 SUIT_ViewWindow* theViewWindow,
1973 const CORBA::Double theParam[3]):
1975 myVW(theViewWindow),
1978 virtual void Execute() {
1979 myFun(myVW,myParam);
1983 SUIT_ViewWindow* myVW;
1984 const CORBA::Double* myParam;
1987 void View3D_i::SetPointOfView (SUIT_ViewWindow* theViewWindow,
1988 const CORBA::Double thePosition[3])
1990 //jfa: may be need to be enclosed in SALOME_Event?
1991 GetCamera(theViewWindow)->SetPosition(thePosition);
1994 void View3D_i::SetPointOfView (const VISU::View3D::XYZ thePosition)
1996 if(MYDEBUG) MESSAGE("View3D_i::SetPointOfView");
1997 SUIT_ViewWindow* aVW = GetViewWindow();
1999 ProcessVoidEvent(new TSet3DViewParamEvent(&SetPointOfView,aVW,thePosition));
2002 void View3D_i::GetPointOfView (SUIT_ViewWindow* theViewWindow,
2003 CORBA::Double thePosition[3])
2005 GetCamera(theViewWindow)->GetPosition(thePosition);
2008 VISU::View3D::XYZ_slice* View3D_i::GetPointOfView()
2010 if(MYDEBUG) MESSAGE("View3D_i::GetPointOfView");
2011 CORBA::Double aPosition[3];
2012 SUIT_ViewWindow* aVW = GetViewWindow();
2014 GetPointOfView(aVW,aPosition);
2015 return VISU::View3D::XYZ_dup(aPosition);
2018 void View3D_i::SetViewUp (SUIT_ViewWindow* theViewWindow,
2019 const CORBA::Double theViewUp[3])
2021 GetCamera(theViewWindow)->SetViewUp(theViewUp);
2024 void View3D_i::SetViewUp (const VISU::View3D::XYZ theViewUp)
2026 if(MYDEBUG) MESSAGE("View3D_i::SetViewUp");
2027 SUIT_ViewWindow* aVW = GetViewWindow();
2029 ProcessVoidEvent(new TSet3DViewParamEvent(&SetViewUp,aVW,theViewUp));
2032 void View3D_i::GetViewUp (SUIT_ViewWindow* theViewWindow,
2033 CORBA::Double theViewUp[3])
2035 GetCamera(theViewWindow)->GetViewUp(theViewUp);
2038 VISU::View3D::XYZ_slice* View3D_i::GetViewUp()
2040 if(MYDEBUG) MESSAGE("View3D_i::GetViewUp");
2041 CORBA::Double aViewUp[3];
2042 SUIT_ViewWindow* aVW = GetViewWindow();
2044 GetCamera(aVW)->GetViewUp(aViewUp);
2045 return VISU::View3D::XYZ_dup(aViewUp);
2048 void View3D_i::SetFocalPoint (SUIT_ViewWindow* theViewWindow,
2049 const CORBA::Double theFocalPnt[3])
2051 GetCamera(theViewWindow)->SetFocalPoint(theFocalPnt);
2054 void View3D_i::SetFocalPoint (const VISU::View3D::XYZ theCoord)
2056 if(MYDEBUG) MESSAGE("View3D_i::SetFocalPoint");
2057 SUIT_ViewWindow* aVW = GetViewWindow();
2059 ProcessVoidEvent(new TSet3DViewParamEvent(&SetFocalPoint,aVW,theCoord));
2063 void View3D_i::GetFocalPoint (SUIT_ViewWindow* theViewWindow,
2064 CORBA::Double theFocalPnt[3])
2066 GetCamera(theViewWindow)->GetFocalPoint(theFocalPnt);
2069 VISU::View3D::XYZ_slice* View3D_i::GetFocalPoint()
2071 if(MYDEBUG) MESSAGE("View3D_i::GetFocalPoint");
2072 CORBA::Double aFocalPnt[3];
2073 SUIT_ViewWindow* aVW = GetViewWindow();
2075 GetFocalPoint(aVW,aFocalPnt);
2076 return VISU::View3D::XYZ_dup(aFocalPnt);
2079 class TSetViewParamEvent: public SALOME_Event
2082 typedef void (*TFun)(SUIT_ViewWindow* theViewWindow, CORBA::Double theParam);
2083 TSetViewParamEvent (TFun theFun,
2084 SUIT_ViewWindow* theViewWindow,
2085 CORBA::Double theParam):
2087 myVW(theViewWindow),
2090 virtual void Execute()
2092 myFun(myVW,myParam);
2096 SUIT_ViewWindow* myVW;
2097 CORBA::Double myParam;
2100 void View3D_i::SetParallelScale (SUIT_ViewWindow* theViewWindow,
2101 CORBA::Double theScale)
2103 GetCamera(theViewWindow)->SetParallelScale(theScale);
2106 void View3D_i::SetParallelScale (CORBA::Double theScale)
2108 if(MYDEBUG) MESSAGE("View3D_i::SetParallelScale");
2109 SUIT_ViewWindow* aVW = GetViewWindow();
2111 ProcessVoidEvent(new TSetViewParamEvent(&SetParallelScale,aVW,theScale));
2114 CORBA::Double View3D_i::GetParallelScale (SUIT_ViewWindow* theViewWindow)
2116 return GetCamera(theViewWindow)->GetParallelScale();
2119 CORBA::Double View3D_i::GetParallelScale()
2121 if(MYDEBUG) MESSAGE("View3D_i::GetParallelScale");
2122 SUIT_ViewWindow* aVW = GetViewWindow();
2124 return GetParallelScale(aVW);
2128 void View3D_i::ScaleView (SUIT_ViewWindow* theViewWindow,
2129 VISU::View3D::Axis theAxis, CORBA::Double theParam)
2131 SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(theViewWindow);
2132 double aScaleFactor[3];
2133 aViewWindow->GetScale(aScaleFactor);
2134 aScaleFactor[theAxis] = theParam;
2135 aViewWindow->SetScale(aScaleFactor);
2138 void SetScaleView (SUIT_ViewWindow* theViewWindow, const CORBA::Double theScale[3])
2140 double aScale[3] = {theScale[0], theScale[1], theScale[2]};
2141 (dynamic_cast<SVTK_ViewWindow*>(theViewWindow))->SetScale(aScale);
2144 void View3D_i::ScaleView(VISU::View3D::Axis theAxis, CORBA::Double theParam)
2146 if(MYDEBUG) MESSAGE("View3D_i::ScaleView");
2147 SUIT_ViewWindow* aVW = GetViewWindow();
2150 (dynamic_cast<SVTK_ViewWindow*>(aVW))->GetScale(aScale);
2151 aScale[theAxis] = theParam;
2152 ProcessVoidEvent(new TSet3DViewParamEvent(&SetScaleView,aVW,aScale));
2156 void View3D_i::RemoveScale()
2158 if(MYDEBUG) MESSAGE("View3D_i::RemoveScale");
2159 SUIT_ViewWindow* aVW = GetViewWindow();
2161 double aScale[3] = {1.0, 1.0, 1.0};
2162 ProcessVoidEvent(new TSet3DViewParamEvent(&SetScaleView,aVW,aScale));
2166 //================================================
2167 // Certain presentation view parameters management
2168 //================================================
2169 class TPrsManageEvent: public SALOME_Event
2173 ScalarMap_ptr myPrs;
2176 TPrsManageEvent(View3D_i* theView3D, ScalarMap_ptr thePrs):
2177 myView3D(theView3D),
2178 myPrs(ScalarMap::_duplicate(thePrs)),
2179 myError("Unknown error occured")
2181 VISU_Actor* GetMyActor()
2183 SUIT_ViewWindow* aVW = myView3D->GetViewWindow();
2184 SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(aVW);
2186 myError = "Corrupted view window";
2188 ScalarMap_i* aPrs = dynamic_cast<ScalarMap_i*>(VISU::GetServant(myPrs).in());
2190 myError = "Corrupted presentation";
2192 VISU_Actor* anActor = VISU::GetActor(aPrs, vw);
2194 myError = "No actor found. Display the presentation at first.";
2206 class TGetPrsTypeEvent: public TPrsManageEvent {
2208 typedef VISU::PresentationType TResult;
2210 TGetPrsTypeEvent(View3D_i* theView3D, ScalarMap_ptr thePrs):
2211 TPrsManageEvent(theView3D, thePrs), myResult(VISU::SHRINK) {}
2212 virtual void Execute() {
2213 if (VISU_Actor* anActor = GetMyActor())
2214 myResult = (VISU::PresentationType)anActor->GetRepresentation();
2218 class TGetShrinkedEvent: public TPrsManageEvent {
2220 typedef bool TResult;
2222 TGetShrinkedEvent(View3D_i* theView3D, ScalarMap_ptr thePrs):
2223 TPrsManageEvent(theView3D, thePrs), myResult(false) {}
2224 virtual void Execute() {
2225 if (VISU_Actor* anActor = GetMyActor()) {
2226 if (anActor->IsShrunkable())
2227 myResult = anActor->IsShrunk();
2234 class TGetShadedEvent: public TPrsManageEvent {
2236 typedef bool TResult;
2238 TGetShadedEvent(View3D_i* theView3D, ScalarMap_ptr thePrs):
2239 TPrsManageEvent(theView3D, thePrs), myResult(false) {}
2240 virtual void Execute() {
2241 if (VISU_Actor* anActor = GetMyActor())
2242 if (VISU_ScalarMapAct* aScalarMapActor = dynamic_cast<VISU_ScalarMapAct*>(anActor))
2243 myResult = aScalarMapActor->IsShading();
2247 class TGetOpacityEvent: public TPrsManageEvent {
2249 typedef double TResult;
2251 TGetOpacityEvent(View3D_i* theView3D, ScalarMap_ptr thePrs):
2252 TPrsManageEvent(theView3D, thePrs), myResult(-1.0) {}
2253 virtual void Execute() {
2254 if (VISU_Actor* anActor = GetMyActor()) {
2255 vtkFloatingPointType oldvalue = anActor->GetOpacity();
2256 myResult = (double)oldvalue;
2261 class TGetLineWidthEvent: public TPrsManageEvent {
2263 typedef double TResult;
2265 TGetLineWidthEvent(View3D_i* theView3D, ScalarMap_ptr thePrs):
2266 TPrsManageEvent(theView3D, thePrs), myResult(-1.0) {}
2267 virtual void Execute() {
2268 if (VISU_Actor* anActor = GetMyActor()) {
2269 vtkFloatingPointType oldvalue = anActor->GetLineWidth();
2270 myResult = (double)oldvalue;
2276 class TSetPrsTypeEvent: public TPrsManageEvent {
2278 PresentationType myPrsType;
2280 typedef string TResult;
2282 TSetPrsTypeEvent(View3D_i* theView3D, ScalarMap_ptr thePrs, PresentationType thePrsType):
2283 TPrsManageEvent(theView3D, thePrs), myPrsType(thePrsType),
2284 myResult("Unknown error occured")
2286 virtual void Execute() {
2287 switch (myPrsType) {
2288 case VISU::INSIDEFRAME:
2290 VISU::VISUType aType = myPrs->GetType();
2291 if (aType != VISU::TSCALARMAP &&
2292 aType != VISU::TDEFORMEDSHAPE &&
2293 aType != VISU::TSCALARMAPONDEFORMEDSHAPE) {
2294 myResult = "Insideframe representation is not available for this type of presentations.";
2299 case VISU::SURFACEFRAME:
2300 myResult = "Surfaceframe representation is available only for mesh presentation.";
2303 myResult = "Use SetShrinked() method to shrink/unshrink presentation.";
2308 if (VISU_Actor* anActor = GetMyActor()) {
2309 anActor->SetRepresentation((int)myPrsType);
2310 SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(myView3D->GetViewWindow());
2319 class TSetShrinkedEvent: public TPrsManageEvent {
2323 typedef string TResult;
2325 TSetShrinkedEvent(View3D_i* theView3D, ScalarMap_ptr thePrs, bool isOn):
2326 TPrsManageEvent(theView3D, thePrs), myIsOn(isOn),
2327 myResult("Unknown error occured")
2329 virtual void Execute() {
2330 VISU::VISUType aType = myPrs->GetType();
2331 if (aType == VISU::TVECTORS || aType == VISU::TSTREAMLINES) {
2332 myResult = "Shrinked representation is not available for this type of presentations.";
2334 if (VISU_Actor* anActor = GetMyActor()) {
2335 if (anActor->IsShrunkable()) {
2336 if (myIsOn) anActor->SetShrink();
2337 else anActor->UnShrink();
2338 SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(myView3D->GetViewWindow());
2342 myResult = "This presentation is not shrunkable.";
2351 class TSetShadedEvent: public TPrsManageEvent {
2355 typedef string TResult;
2357 TSetShadedEvent(View3D_i* theView3D, ScalarMap_ptr thePrs, bool isOn):
2358 TPrsManageEvent(theView3D, thePrs), myIsOn(isOn),
2359 myResult("Unknown error occured")
2361 virtual void Execute() {
2362 if (VISU_Actor* anActor = GetMyActor()) {
2363 if (VISU_ScalarMapAct* aScalarMapActor =
2364 dynamic_cast<VISU_ScalarMapAct*>(anActor)) {
2365 aScalarMapActor->SetShading(myIsOn);
2366 SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(myView3D->GetViewWindow());
2370 myResult = "Corrupted actor";
2378 class TSetOpacityEvent: public TPrsManageEvent {
2382 typedef string TResult;
2384 TSetOpacityEvent(View3D_i* theView3D, ScalarMap_ptr thePrs, double theOpacity):
2385 TPrsManageEvent(theView3D, thePrs), myOpacity(theOpacity),
2386 myResult("Unknown error occured")
2388 virtual void Execute() {
2389 VISU::VISUType aType = myPrs->GetType();
2390 if (aType == VISU::TVECTORS || aType == VISU::TSTREAMLINES) {
2391 myResult = "Opacity is meaningless for this type of presentations.";
2394 if (VISU_Actor* anActor = GetMyActor()) {
2395 anActor->SetOpacity((vtkFloatingPointType)myOpacity);
2396 SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(myView3D->GetViewWindow());
2405 class TSetLineWidthEvent: public TPrsManageEvent {
2409 typedef string TResult;
2411 TSetLineWidthEvent(View3D_i* theView3D, ScalarMap_ptr thePrs, double theLineWidth):
2412 TPrsManageEvent(theView3D, thePrs), myLineWidth(theLineWidth),
2413 myResult("Unknown error occured")
2415 virtual void Execute() {
2416 if (myPrs->GetType() == VISU::TVECTORS) {
2417 myResult = "Line Width is meaningless for Vectors presentation.";
2420 if (VISU_Actor* anActor = GetMyActor()) {
2421 anActor->SetLineWidth((vtkFloatingPointType)myLineWidth);
2422 SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(myView3D->GetViewWindow());
2431 PresentationType View3D_i::GetPresentationType(ScalarMap_ptr thePrs)
2433 return ProcessEvent(new TGetPrsTypeEvent(this,thePrs));
2435 CORBA::Boolean View3D_i::IsShrinked(ScalarMap_ptr thePrs)
2437 return ProcessEvent(new TGetShrinkedEvent(this,thePrs));
2439 CORBA::Boolean View3D_i::IsShaded(ScalarMap_ptr thePrs)
2441 return ProcessEvent(new TGetShadedEvent(this,thePrs));
2443 CORBA::Double View3D_i::GetOpacity(ScalarMap_ptr thePrs)
2445 return ProcessEvent(new TGetOpacityEvent(this,thePrs));
2447 CORBA::Double View3D_i::GetLineWidth(ScalarMap_ptr thePrs)
2449 return ProcessEvent(new TGetLineWidthEvent(this,thePrs));
2452 char* View3D_i::SetPresentationType(ScalarMap_ptr thePrs, PresentationType thePrsType)
2454 string aRet = ProcessEvent(new TSetPrsTypeEvent(this,thePrs,thePrsType));
2455 return CORBA::string_dup(aRet.c_str());
2457 char* View3D_i::SetShrinked(ScalarMap_ptr thePrs, CORBA::Boolean isShrinked)
2459 string aRet = ProcessEvent(new TSetShrinkedEvent(this,thePrs,isShrinked));
2460 return CORBA::string_dup(aRet.c_str());
2462 char* View3D_i::SetShaded(ScalarMap_ptr thePrs, CORBA::Boolean isShaded)
2464 string aRet = ProcessEvent(new TSetShadedEvent(this,thePrs,isShaded));
2465 return CORBA::string_dup(aRet.c_str());
2467 char* View3D_i::SetOpacity(ScalarMap_ptr thePrs, CORBA::Double theOpacity)
2469 string aRet = ProcessEvent(new TSetOpacityEvent(this,thePrs,theOpacity));
2470 return CORBA::string_dup(aRet.c_str());
2472 char* View3D_i::SetLineWidth(ScalarMap_ptr thePrs, CORBA::Double theLineWidth)
2474 string aRet = ProcessEvent(new TSetLineWidthEvent(this,thePrs,theLineWidth));
2475 return CORBA::string_dup(aRet.c_str());