struct TSplitEvent: public SALOME_Event
{
SalomeApp_Application * myApplication;
- SUIT_ViewWindow * myVW;
+ SUIT_ViewWindow * myViewWindow;
Qt::Orientation myOrientation;
QtxWorkstack::SplitType mySplitType;
Qt::Orientation theOrientation,
QtxWorkstack::SplitType theSplitType):
myApplication(theApplication),
- myVW(theViewWindow),
+ myViewWindow(theViewWindow),
myOrientation(theOrientation),
mySplitType(theSplitType)
{}
if (tabDesk) {
QtxWorkstack* workstack = tabDesk->workstack();
if (workstack) {
- workstack->Split(myVW, myOrientation, mySplitType);
+ workstack->Split(myViewWindow, myOrientation, mySplitType);
}
}
}
View_i::
SplitRight()
{
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- ProcessVoidEvent(new TSplitEvent(myApplication, aVW,
- Qt::Horizontal, QtxWorkstack::SPLIT_MOVE));
+ ProcessVoidEvent(new TSplitEvent(myApplication,myViewWindow,
+ Qt::Horizontal,QtxWorkstack::SPLIT_MOVE));
}
void
View_i::
SplitLeft()
{
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- ProcessVoidEvent(new TSplitEvent(myApplication, aVW,
- Qt::Horizontal, QtxWorkstack::SPLIT_STAY));
+ ProcessVoidEvent(new TSplitEvent(myApplication,myViewWindow,
+ Qt::Horizontal,QtxWorkstack::SPLIT_STAY));
}
void
View_i::
SplitBottom()
{
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- ProcessVoidEvent(new TSplitEvent(myApplication, aVW,
- Qt::Vertical, QtxWorkstack::SPLIT_MOVE));
+ ProcessVoidEvent(new TSplitEvent(myApplication,myViewWindow,
+ Qt::Vertical,QtxWorkstack::SPLIT_MOVE));
}
void
View_i::
SplitTop()
{
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- ProcessVoidEvent(new TSplitEvent(myApplication, aVW,
- Qt::Vertical, QtxWorkstack::SPLIT_STAY));
+ ProcessVoidEvent(new TSplitEvent(myApplication,myViewWindow,
+ Qt::Vertical,QtxWorkstack::SPLIT_STAY));
}
void
{
struct TOnTopEvent: public SALOME_Event
{
- SUIT_ViewWindow * myVW;
+ SUIT_ViewWindow * myViewWindow;
public:
TOnTopEvent (SUIT_ViewWindow * theViewWindow):
- myVW(theViewWindow)
+ myViewWindow(theViewWindow)
{}
virtual void Execute()
{
- if (myVW) {
- myVW->setFocus();
+ if (myViewWindow) {
+ myViewWindow->setFocus();
}
}
};
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- ProcessVoidEvent(new TOnTopEvent(aVW));
+ ProcessVoidEvent(new TOnTopEvent(myViewWindow));
}
struct TAttractEvent: public SALOME_Event
{
SalomeApp_Application * myApplication;
- SUIT_ViewWindow * myVW1;
- SUIT_ViewWindow * myVW2;
+ SUIT_ViewWindow * myViewWindow1;
+ SUIT_ViewWindow * myViewWindow2;
bool myAttractAll;
public:
SUIT_ViewWindow * theViewWindow2,
bool theAttractAll):
myApplication(theApplication),
- myVW1(theViewWindow1),
- myVW2(theViewWindow2),
+ myViewWindow1(theViewWindow1),
+ myViewWindow2(theViewWindow2),
myAttractAll(theAttractAll)
{}
if (tabDesk) {
QtxWorkstack* workstack = tabDesk->workstack();
if (workstack) {
- workstack->Attract(myVW1, myVW2, myAttractAll);
+ workstack->Attract(myViewWindow1, myViewWindow2, myAttractAll);
}
}
}
{
if (!CORBA::is_nil(theView)) {
if (VISU::View_i* pView = dynamic_cast<VISU::View_i*>(VISU::GetServant(theView).in())) {
- if (pView) {
- SUIT_ViewWindow* aVW1 = GetViewWindow();
- SUIT_ViewWindow* aVW2 = pView->GetViewWindow();
- if (aVW1 && aVW2)
- ProcessVoidEvent(new TAttractEvent(myApplication, aVW1, aVW2, false));
- }
+ ProcessVoidEvent(new TAttractEvent(myApplication,myViewWindow,pView->myViewWindow,false));
}
}
}
{
if (!CORBA::is_nil(theView)) {
if (VISU::View_i* pView = dynamic_cast<VISU::View_i*>(VISU::GetServant(theView).in())) {
- if (pView) {
- SUIT_ViewWindow* aVW1 = GetViewWindow();
- SUIT_ViewWindow* aVW2 = pView->GetViewWindow();
- if (aVW1 && aVW2)
- ProcessVoidEvent(new TAttractEvent(myApplication, aVW1, aVW2, true));
- }
+ ProcessVoidEvent(new TAttractEvent(myApplication,myViewWindow,pView->myViewWindow,true));
}
}
}
struct TSizePositionEvent: public SALOME_Event
{
SalomeApp_Application * myApplication;
- SUIT_ViewWindow * myVW;
+ SUIT_ViewWindow * myViewWindow;
double myValue;
bool myIsSize;
double theValue,
bool theIsSize):
myApplication(theApplication),
- myVW(theViewWindow),
+ myViewWindow(theViewWindow),
myValue(theValue),
myIsSize(theIsSize)
{}
QtxWorkstack* workstack = tabDesk->workstack();
if (workstack) {
if (myIsSize) {
- //jfa to do:workstack->SetRelativeSizeInSplitter(myVW, myValue);
+ //jfa to do:workstack->SetRelativeSizeInSplitter(myViewWindow, myValue);
} else {
- workstack->SetRelativePositionInSplitter(myVW, myValue);
+ workstack->SetRelativePositionInSplitter(myViewWindow, myValue);
}
}
}
if (thePosition < 0.0 || 1.0 < thePosition) {
return;
}
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- ProcessVoidEvent(new TSizePositionEvent(myApplication, aVW, thePosition, false));
+ ProcessVoidEvent(new TSizePositionEvent(myApplication,myViewWindow,thePosition,false));
}
void
if (theSize < 0.0 || 1.0 < theSize) {
return;
}
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- ProcessVoidEvent(new TSizePositionEvent(myApplication, aVW, theSize, true));
+ ProcessVoidEvent(new TSizePositionEvent(myApplication,myViewWindow,theSize,true));
}
struct TWSSizePositionEvent: public SALOME_Event
{
SalomeApp_Application * myApplication;
- SUIT_ViewWindow * myVW;
+ SUIT_ViewWindow * myViewWindow;
Qt::Orientation myOrientation;
double myValue;
bool myIsSize;
double theValue,
bool theIsSize):
myApplication(theApplication),
- myVW(theViewWindow),
+ myViewWindow(theViewWindow),
myOrientation(theOrientation),
myValue(theValue),
myIsSize(theIsSize)
QtxWorkstack* workstack = tabDesk->workstack();
if (workstack) {
if (myIsSize) {
- //jfa to do:workstack->SetRelativeSize(myVW, myOrientation, myValue);
+ //jfa to do:workstack->SetRelativeSize(myViewWindow, myOrientation, myValue);
} else {
- workstack->SetRelativePosition(myVW, myOrientation, myValue);
+ workstack->SetRelativePosition(myViewWindow, myOrientation, myValue);
}
}
}
if (thePosition < 0.0 || 1.0 < thePosition) {
return;
}
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- ProcessVoidEvent(new TWSSizePositionEvent(myApplication, aVW,
- Qt::Horizontal, thePosition, false));
+ ProcessVoidEvent(new TWSSizePositionEvent(myApplication,myViewWindow,
+ Qt::Horizontal,thePosition,false));
}
void
if (thePosition < 0.0 || 1.0 < thePosition) {
return;
}
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- ProcessVoidEvent(new TWSSizePositionEvent(myApplication, aVW,
- Qt::Vertical, thePosition, false));
+ ProcessVoidEvent(new TWSSizePositionEvent(myApplication,myViewWindow,
+ Qt::Vertical,thePosition,false));
}
void
if (theSize < 0.0 || 1.0 < theSize) {
return;
}
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- ProcessVoidEvent(new TWSSizePositionEvent(myApplication, aVW,
- Qt::Horizontal, theSize, true));
+ ProcessVoidEvent(new TWSSizePositionEvent(myApplication,myViewWindow,
+ Qt::Horizontal,theSize,true));
}
void
if (theSize < 0.0 || 1.0 < theSize) {
return;
}
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- ProcessVoidEvent(new TWSSizePositionEvent(myApplication, aVW,
- Qt::Vertical, theSize, true));
+ ProcessVoidEvent(new TWSSizePositionEvent(myApplication,myViewWindow,
+ Qt::Vertical,theSize,true));
}
// End: New methods for view parameters management
// Begin: Old methods for view parameters management, they don't work now
struct TSetViewSize: public SALOME_Event
{
- SUIT_ViewWindow* myVW;
+ SUIT_ViewWindow* myViewWindow;
typedef void (QRect::* TAction)(int);
TAction myAction;
CORBA::Long mySize;
TSetViewSize(SUIT_ViewWindow* theViewWindow,
TAction theAction,
CORBA::Long theSize):
- myVW(theViewWindow),
+ myViewWindow(theViewWindow),
myAction(theAction),
mySize(theSize)
{}
void
Execute()
{
- if (QWidget* aParent = myVW->parentWidget(true)) {
+ if (QWidget* aParent = myViewWindow->parentWidget(true)) {
QRect aQRect = aParent->frameGeometry();
(aQRect.*myAction)(mySize);
aParent->setGeometry(aQRect);
struct TGetViewSize: public SALOME_Event
{
- SUIT_ViewWindow* myVW;
+ SUIT_ViewWindow* myViewWindow;
typedef int (QRect::* TAction)() const;
TAction myAction;
public:
TGetViewSize(SUIT_ViewWindow* theViewWindow,
TAction theAction):
- myVW(theViewWindow),
+ myViewWindow(theViewWindow),
myAction(theAction)
{}
void
Execute()
{
- if(QWidget* aParent = myVW->parentWidget(true)){
+ if(QWidget* aParent = myViewWindow->parentWidget(true)){
QRect aQRect = aParent->frameGeometry();
myResult = (aQRect.*myAction)();
}
class TWorkspaceEvent: public SALOME_Event
{
protected:
- QWidget* myVW;
+ QWidget* myViewWindow;
QWidget* myWorkspace;
public:
TWorkspaceEvent(QWidget* theViewWindow,
QWidget* theWorkspace):
- myVW(theViewWindow),
+ myViewWindow(theViewWindow),
myWorkspace(theWorkspace)
{}
};
void
Execute()
{
- if(QWidget* aParent = myVW->parentWidget(true))
+ if(QWidget* aParent = myViewWindow->parentWidget(true))
SUIT_Tools::alignWidget(aParent,myWorkspace,myAligment);
}
};
void
Execute()
{
- if(QWidget* aParent = myVW->parentWidget(true))
+ if(QWidget* aParent = myViewWindow->parentWidget(true))
aParent->move(int(myX*myWorkspace->width()),int(myY*myWorkspace->height()));
}
};
void
Execute()
{
- if(QWidget* aParent = myVW->parentWidget(true))
+ if(QWidget* aParent = myViewWindow->parentWidget(true))
aParent->setGeometry(aParent->x(),
aParent->y(),
int(myX*myWorkspace->width()),
}
};
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- ProcessVoidEvent(new TEvent(aVW, theColor));
+ ProcessVoidEvent(new TEvent(myViewWindow,theColor));
}
View_i::
GetBackground()
{
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- return ProcessEvent(new TBackgroundEvent(aVW));
-
- SALOMEDS::Color aBlack;
- aBlack.R = 0.0;
- aBlack.G = 0.0;
- aBlack.B = 0.0;
- return aBlack;
+ return ProcessEvent(new TBackgroundEvent(myViewWindow));
}
void
View_i::
Minimize()
{
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- ProcessVoidEvent(new TFrameActionEvent(aVW, &SUIT_ViewWindow::showMinimized));
+ ProcessVoidEvent(new TFrameActionEvent(myViewWindow,&SUIT_ViewWindow::showMinimized));
}
void
View_i::
Restore()
{
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- ProcessVoidEvent(new TFrameActionEvent(aVW, &SUIT_ViewWindow::showNormal));
+ ProcessVoidEvent(new TFrameActionEvent(myViewWindow,&SUIT_ViewWindow::showNormal));
}
void
View_i::
Maximize()
{
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- ProcessVoidEvent(new TFrameActionEvent(aVW, &SUIT_ViewWindow::showMaximized));
+ ProcessVoidEvent(new TFrameActionEvent(myViewWindow,&SUIT_ViewWindow::showMaximized));
}
void
class TSavePictureEvent: public SALOME_Event
{
- SUIT_ViewWindow * myVW;
+ SUIT_ViewWindow * myViewWindow;
const char * myFileName;
public:
typedef CORBA::Boolean TResult;
TResult myResult;
TSavePictureEvent (SUIT_ViewWindow * theViewWindow, const char * theFileName)
- : myVW(theViewWindow),
+ : myViewWindow(theViewWindow),
myFileName(theFileName),
myResult(false)
{
virtual void Execute()
{
- if (myVW) {
- QImage img = myVW->dumpView();
+ if (myViewWindow) {
+ QImage img = myViewWindow->dumpView();
if (!img.isNull()) {
QString fileName (myFileName);
if (!fileName.isEmpty()) {
if (fmt == "JPG" ) fmt = "JPEG";
//QApplication::setOverrideCursor(Qt::waitCursor);
img.save(fileName, fmt.latin1());
- myResult = true;
//QApplication::restoreOverrideCursor();
}
}
CORBA::Boolean
View_i::SavePicture(const char* theFileName)
{
- return ProcessEvent(new TSavePictureEvent (GetViewWindow(), theFileName));
+ return ProcessEvent(new TSavePictureEvent (myViewWindow,theFileName));
}
const char*
- View_i::GetComment() const
+ View_i::
+ GetComment() const
{
return "";
}
{
}
- SUIT_ViewWindow* View_i::GetViewWindow()
- {
- if (myViewWindow) {
- QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
- int aPos = aViews.find(myViewWindow);
- if (aPos < 0)
- myViewWindow = NULL;
- }
- return myViewWindow;
- }
- void View_i::SetViewWindow(SUIT_ViewWindow* theViewWindow)
+ //================= OLD CODE ===================
+
+ //QAD_Study* CheckStudy (SALOMEDS::Study_ptr theStudy)
+ //{
+ // //QAD_Desktop* aDesktop = QAD_Application::getDesktop();
+ // //QAD_Study* aStudy = aDesktop->findStudy(theStudy);
+ // if (!aStudy) {
+ // CORBA::String_var aName = theStudy->Name();
+ // aFileInfo.setFile(aName.in());
+ // if (aFileInfo.exists())
+ // aStudy = aDesktop->loadStudy(aFileInfo.baseName());
+ // else
+ // aStudy = aDesktop->loadStudy(aName.in());
+ // if (!aStudy) {
+ // MESSAGE("CheckStudy()::ERROR: Can't load study");
+ // }
+ // }
+ // return aStudy;
+ //}
+
+ template<class TViewer>
+ struct TNewSpecViewEvent: public SALOME_Event
{
- myViewWindow = theViewWindow;
- }
+ SalomeApp_Application* myApplication;
+ typedef SUIT_ViewManager* TResult;
+ TResult myResult;
+
+ TNewSpecViewEvent (SalomeApp_Application* theApplication):
+ myApplication(theApplication),
+ myResult(NULL)
+ {}
+
+ virtual
+ void
+ Execute()
+ {
+ myResult = myApplication->getViewManager(TViewer::Type(), false);
+ if (!myResult) {
+ myResult = myApplication->getViewManager(TViewer::Type(), true);
+ myResult->closeAllViews();
+ }
+ }
+ };
//===========================================================================
XYPlot_i::XYPlot_i (SalomeApp_Application* theApplication)
: View_i(theApplication, NULL)
{
if (MYDEBUG) MESSAGE("XYPlot_i::XYPlot_i");
+ if (theApplication) {
+ myViewManager = ProcessEvent(new TNewSpecViewEvent<SPlot2d_Viewer>(theApplication));
+ }
}
+
struct TCreatePlot2dViewEvent: public SALOME_Event
{
- XYPlot_i * myPlot2dView;
- int myNew;
+ SUIT_ViewManager* myViewManager;
+ XYPlot_i * myPlot2dView;
+ int myNew;
typedef Plot2d_ViewFrame* TResult;
TResult myResult;
- TCreatePlot2dViewEvent (XYPlot_i * thePlot2dView,
- const int theNew):
+ TCreatePlot2dViewEvent (SUIT_ViewManager* theViewManager,
+ XYPlot_i * thePlot2dView,
+ const int theNew):
+ myViewManager(theViewManager),
myPlot2dView(thePlot2dView),
myNew(theNew),
myResult(NULL)
void
Execute()
{
- if (!myPlot2dView->myApplication)
- return;
-
- SUIT_ViewManager* aViewMgr =
- myPlot2dView->myApplication->getViewManager(SPlot2d_Viewer::Type(), false);
- SUIT_ViewWindow* aVW = NULL;
-
- if (aViewMgr) {
- if (myNew)
- aVW = aViewMgr->createViewWindow();
- else
- aVW = aViewMgr->getActiveView();
+ if (myNew) {
+ myPlot2dView->myViewWindow = myViewManager->createViewWindow();
} else {
- if (myNew) {
- aViewMgr = myPlot2dView->myApplication->getViewManager(SPlot2d_Viewer::Type(), true);
- aVW = aViewMgr->getActiveView();
- } else {
- return; // there are no current Plot2d view
- }
+ myPlot2dView->myViewWindow = myViewManager->getActiveView();
}
-
- if (aVW) {
- Plot2d_ViewWindow* aPlot2dVW = dynamic_cast<Plot2d_ViewWindow*>(aVW);
+ if (myPlot2dView->myViewWindow) {
+ Plot2d_ViewWindow* aPlot2dVW = dynamic_cast<Plot2d_ViewWindow*>(myPlot2dView->myViewWindow);
if (aPlot2dVW) {
myResult = aPlot2dVW->getViewFrame();
if (myResult) {
myResult->Repaint();
- }
-
- myPlot2dView->myViewManager = aViewMgr;
- myPlot2dView->SetViewWindow(aVW);
- }
+ }
+ }
}
}
};
Storable* XYPlot_i::Create (int theNew)
{
- myView = ProcessEvent(new TCreatePlot2dViewEvent(this, theNew));
- if (myView)
- return this;
- return NULL;
+ myView = ProcessEvent(new TCreatePlot2dViewEvent(myViewManager, this, theNew));
+ return this;
}
void XYPlot_i::Update()
void XYPlot_i::Close()
{
//jfa: may be need to be enclosed in SALOME_Event?
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- aVW->close();
- //QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
- //int aPos = aViews.find(myViewWindow);
- //if (aPos >= 0)
- // myViewWindow->close();
+ myViewWindow->close();
}
XYPlot_i::~XYPlot_i() {
void XYPlot_i::SetTitle (const char* theTitle)
{
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- ProcessVoidEvent(new TVoidMemFun1ArgEvent<SUIT_ViewWindow,const QString&,QString>
- (aVW, &SUIT_ViewWindow::setCaption, QString(theTitle)));
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<SUIT_ViewWindow,const QString&,QString>
+ (myViewWindow, &SUIT_ViewWindow::setCaption, QString(theTitle)));
}
char* XYPlot_i::GetTitle()
{
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- return CORBA::string_dup(aVW->caption().latin1());
- return CORBA::string_dup("");
+ //jfa: may be need to be enclosed in SALOME_Event?
+ return CORBA::string_dup(myViewWindow->caption().latin1());
}
void XYPlot_i::SetSubTitle (const char* theTitle)
{
- if (GetViewWindow())
- ProcessVoidEvent(new TVoidMemFun1ArgEvent<Plot2d_ViewFrame,const QString&,QString>
- (myView, &Plot2d_ViewFrame::setTitle, QString(theTitle)));
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<Plot2d_ViewFrame,const QString&,QString>
+ (myView, &Plot2d_ViewFrame::setTitle, QString(theTitle)));
}
char* XYPlot_i::GetSubTitle()
{
- if (GetViewWindow())
- return CORBA::string_dup(myView->getTitle());
- return CORBA::string_dup("");
+ //jfa: may be need to be enclosed in SALOME_Event?
+ return CORBA::string_dup(myView->getTitle());
}
void XYPlot_i::SetCurveType (VISU::XYPlot::CurveType theType)
{
- if (GetViewWindow())
- ProcessVoidEvent(new TVoidMemFun2ArgEvent<Plot2d_ViewFrame,int,bool>
- (myView,&Plot2d_ViewFrame::setCurveType,theType,true));
+ ProcessVoidEvent(new TVoidMemFun2ArgEvent<Plot2d_ViewFrame,int,bool>
+ (myView,&Plot2d_ViewFrame::setCurveType,theType,true));
}
VISU::XYPlot::CurveType XYPlot_i::GetCurveType()
{
- if (GetViewWindow())
- return (VISU::XYPlot::CurveType)myView->getCurveType();
- return VISU::XYPlot::POINTS;
+ //jfa: may be need to be enclosed in SALOME_Event?
+ return (VISU::XYPlot::CurveType)myView->getCurveType();
}
void XYPlot_i::SetMarkerSize (CORBA::Long theSize)
{
- if (GetViewWindow())
- ProcessVoidEvent(new TVoidMemFun2ArgEvent<Plot2d_ViewFrame,int,bool>
- (myView,&Plot2d_ViewFrame::setMarkerSize,theSize,true));
+ ProcessVoidEvent(new TVoidMemFun2ArgEvent<Plot2d_ViewFrame,int,bool>
+ (myView,&Plot2d_ViewFrame::setMarkerSize,theSize,true));
}
CORBA::Long XYPlot_i::GetMarkerSize()
{
- if (GetViewWindow())
- return myView->getMarkerSize();
- return -1;
+ //jfa: may be need to be enclosed in SALOME_Event?
+ return myView->getMarkerSize();
}
class TEnableGridEvent: public SALOME_Event
void XYPlot_i::EnableXGrid (CORBA::Boolean theMajor, CORBA::Long theNumMajor,
CORBA::Boolean theMinor, CORBA::Long theNumMinor)
{
- if (GetViewWindow())
- ProcessVoidEvent(new TEnableGridEvent(myView,&Plot2d_ViewFrame::setXGrid,
- theMajor,theNumMajor,theMinor,theNumMinor));
+ ProcessVoidEvent(new TEnableGridEvent(myView,&Plot2d_ViewFrame::setXGrid,
+ theMajor,theNumMajor,theMinor,theNumMinor));
}
void XYPlot_i::EnableYGrid(CORBA::Boolean theMajor, CORBA::Long theNumMajor,
CORBA::Boolean theMinor, CORBA::Long theNumMinor)
{
//asl: Plot2d_ViewFrame::setYGrid has more parameters
- //if (GetViewWindow())
- // ProcessVoidEvent(new TEnableGridEvent(myView,&Plot2d_ViewFrame::setYGrid,
- // theMajor,theNumMajor,theMinor,theNumMinor));
+ //ProcessVoidEvent(new TEnableGridEvent(myView,&Plot2d_ViewFrame::setYGrid,
+ // theMajor,theNumMajor,theMinor,theNumMinor));
}
class TSetScaleModeEvent: public SALOME_Event
void XYPlot_i::SetHorScaling (VISU::Scaling theScaling)
{
- if (GetViewWindow())
- ProcessVoidEvent(new TSetScaleModeEvent(myView,&Plot2d_ViewFrame::setHorScaleMode,
- theScaling == VISU::LOGARITHMIC));
+ ProcessVoidEvent(new TSetScaleModeEvent(myView,&Plot2d_ViewFrame::setHorScaleMode,
+ theScaling == VISU::LOGARITHMIC));
}
VISU::Scaling XYPlot_i::GetHorScaling()
{
//jfa: may be need to be enclosed in SALOME_Event?
- if (GetViewWindow())
- return (VISU::Scaling)myView->getHorScaleMode();
- return VISU::LINEAR;
+ return (VISU::Scaling)myView->getHorScaleMode();
}
void XYPlot_i::SetVerScaling(VISU::Scaling theScaling)
{
- if (GetViewWindow())
- ProcessVoidEvent(new TSetScaleModeEvent(myView,&Plot2d_ViewFrame::setVerScaleMode,
- theScaling == VISU::LOGARITHMIC));
+ ProcessVoidEvent(new TSetScaleModeEvent(myView,&Plot2d_ViewFrame::setVerScaleMode,
+ theScaling == VISU::LOGARITHMIC));
}
VISU::Scaling XYPlot_i::GetVerScaling()
{
- if (GetViewWindow())
- return (VISU::Scaling)myView->getVerScaleMode();
- return VISU::LINEAR;
+ //jfa: may be need to be enclosed in SALOME_Event?
+ return (VISU::Scaling)myView->getVerScaleMode();
}
class TSetTitleEvent: public SALOME_Event
void XYPlot_i::SetXTitle (const char* theTitle)
{
- if (GetViewWindow())
- ProcessVoidEvent(new TSetTitleEvent(myView, Plot2d_ViewFrame::XTitle, theTitle));
+ ProcessVoidEvent(new TSetTitleEvent(myView, Plot2d_ViewFrame::XTitle, theTitle));
}
char* XYPlot_i::GetXTitle()
{
- if (GetViewWindow())
- return CORBA::string_dup(myView->getTitle(Plot2d_ViewFrame::XTitle));
- return CORBA::string_dup("");
+ //jfa: may be need to be enclosed in SALOME_Event?
+ return CORBA::string_dup(myView->getTitle(Plot2d_ViewFrame::XTitle));
}
void XYPlot_i::SetYTitle (const char* theTitle)
{
- if (GetViewWindow())
- ProcessVoidEvent(new TSetTitleEvent(myView, Plot2d_ViewFrame::YTitle, theTitle));
+ ProcessVoidEvent(new TSetTitleEvent(myView, Plot2d_ViewFrame::YTitle, theTitle));
}
char* XYPlot_i::GetYTitle()
{
- if (GetViewWindow())
- return CORBA::string_dup(myView->getTitle(Plot2d_ViewFrame::YTitle));
- return CORBA::string_dup("");
+ //jfa: may be need to be enclosed in SALOME_Event?
+ return CORBA::string_dup(myView->getTitle(Plot2d_ViewFrame::YTitle));
}
void XYPlot_i::ShowLegend (CORBA::Boolean theShowing)
{
- if (GetViewWindow())
- ProcessVoidEvent(new TVoidMemFun2ArgEvent<Plot2d_ViewFrame,bool,bool>
- (myView,&Plot2d_ViewFrame::showLegend,theShowing,true));
+ ProcessVoidEvent(new TVoidMemFun2ArgEvent<Plot2d_ViewFrame,bool,bool>
+ (myView,&Plot2d_ViewFrame::showLegend,theShowing,true));
}
class TXYPlotViewEvent: public SALOME_Event
void XYPlot_i::Display (PrsObject_ptr thePrsObj)
{
- if (GetViewWindow())
- ProcessVoidEvent(new TXYPlotViewEvent (myApplication,myView,thePrsObj,eDisplay));
+ ProcessVoidEvent(new TXYPlotViewEvent (myApplication,myView,thePrsObj,eDisplay));
}
void XYPlot_i::Erase (PrsObject_ptr thePrsObj)
{
- if (GetViewWindow())
- ProcessVoidEvent(new TXYPlotViewEvent (myApplication,myView,thePrsObj,eErase));
+ ProcessVoidEvent(new TXYPlotViewEvent (myApplication,myView,thePrsObj,eErase));
}
void XYPlot_i::DisplayOnly (PrsObject_ptr thePrsObj)
{
- if (GetViewWindow())
- ProcessVoidEvent(new TXYPlotViewEvent (myApplication,myView,thePrsObj,eDisplayOnly));
+ ProcessVoidEvent(new TXYPlotViewEvent (myApplication,myView,thePrsObj,eDisplayOnly));
}
void XYPlot_i::EraseAll()
{
- if (GetViewWindow())
- ProcessVoidEvent(new TVoidMemFunEvent<Plot2d_ViewFrame> (myView,&Plot2d_ViewFrame::EraseAll));
+ ProcessVoidEvent(new TVoidMemFunEvent<Plot2d_ViewFrame> (myView,&Plot2d_ViewFrame::EraseAll));
}
void XYPlot_i::FitAll()
{
- if (GetViewWindow())
- ProcessVoidEvent(new TVoidMemFunEvent<Plot2d_ViewFrame> (myView,&Plot2d_ViewFrame::fitAll));
+ ProcessVoidEvent(new TVoidMemFunEvent<Plot2d_ViewFrame> (myView,&Plot2d_ViewFrame::fitAll));
}
class TFitRangeEvent: public SALOME_Event
: View_i(theApplication, NULL)
{
if (MYDEBUG) MESSAGE("View3D_i::View3D_i");
+ if (theApplication) {
+ myViewManager = ProcessEvent(new TNewSpecViewEvent<SVTK_Viewer>(theApplication));
+ }
}
struct TCreateView3dEvent: public SALOME_Event
{
- View3D_i * myView3D;
- int myNew;
+ SUIT_ViewManager* myViewManager;
+ int myNew;
typedef SUIT_ViewWindow* TResult;
TResult myResult;
- TCreateView3dEvent (View3D_i * theView3D,
- const int theNew):
- myView3D(theView3D),
+ TCreateView3dEvent (SUIT_ViewManager* theViewManager,
+ const int theNew):
+ myViewManager(theViewManager),
myNew(theNew),
myResult(NULL)
{}
void
Execute()
{
- if (!myView3D->myApplication)
- return;
-
- SUIT_ViewManager * aViewMgr =
- myView3D->myApplication->getViewManager(SVTK_Viewer::Type(), false);
-
- if (aViewMgr) {
- if (myNew) {
- myResult = aViewMgr->createViewWindow();
- } else {
- myResult = aViewMgr->getActiveView();
- }
+ if (myNew) {
+ myResult = myViewManager->createViewWindow();
} else {
- if (myNew) {
- aViewMgr = myView3D->myApplication->getViewManager(SVTK_Viewer::Type(), true);
- myResult = aViewMgr->getActiveView();
- } else {
- return; // there are no current 3D view
- }
+ myResult = myViewManager->getActiveView();
}
-
- myView3D->myViewManager = aViewMgr;
}
};
Storable* View3D_i::Create (int theNew)
{
if (MYDEBUG) MESSAGE("View3D_i::Create");
- SUIT_ViewWindow* aVW = ProcessEvent(new TCreateView3dEvent(this, theNew));
- if (aVW) {
- SetViewWindow(aVW);
- return this;
- }
- return NULL;
+ myViewWindow = ProcessEvent(new TCreateView3dEvent(myViewManager, theNew));
+ return this;
}
void View3D_i::Update()
{
class TEvent: public SALOME_Event
{
- SUIT_ViewWindow* myVW;
+ SUIT_ViewWindow* myViewWindow;
public:
- TEvent(SUIT_ViewWindow* theViewWindow):
- myVW(theViewWindow)
+ TEvent(SUIT_ViewWindow* theStudyFrame):
+ myViewWindow(theStudyFrame)
{}
virtual void Execute()
{
- SVTK_ViewWindow* vf = VISU::GetViewWindow(myVW);
+ SVTK_ViewWindow* vf = GetViewWindow(myViewWindow);
vtkRenderer* Renderer = vf->getRenderer();
vtkActorCollection* theActors = Renderer->GetActors();
theActors->InitTraversal();
}
}
}
- RepaintView(myVW);
+ RepaintView(myViewWindow);
}
};
-
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- ProcessVoidEvent(new TEvent(aVW));
+ ProcessVoidEvent(new TEvent(myViewWindow));
}
bool View3D_i::SaveViewParams (SUIT_ViewManager* theViewManager, const char* theName)
{
MESSAGE("View3D_i::SaveViewParams()");
-
- if (!theViewManager || !theName)
- return false;
-
_PTR(Study) aCStudy;
if (SUIT_Study* aSStudy = theViewManager->study()) {
if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy)) {
if (!aCStudy)
return false;
- if (strcmp(theName, "") != 0) {
+ if (theName) {
std::vector<_PTR(SObject)> aList = aCStudy->FindObjectByName(theName, "VISU");
_PTR(GenericAttribute) anAttr;
int iEnd = aList.size();
class TSaveViewParamsEvent: public SALOME_Event
{
- SUIT_ViewManager* myViewMgr;
+ SUIT_ViewManager* myViewManager;
const char* myName;
public:
TSaveViewParamsEvent (SUIT_ViewManager* theViewManager,
const char* theName):
- myViewMgr(theViewManager),
+ myViewManager(theViewManager),
myName(theName)
{}
virtual void Execute()
{
- myResult = View3D_i::SaveViewParams(myViewMgr, myName);
+ myResult = View3D_i::SaveViewParams(myViewManager, myName);
}
typedef CORBA::Boolean TResult;
TResult myResult;
class TRestoreViewParamsEvent: public SALOME_Event
{
- SUIT_ViewManager* myViewMgr;
+ SUIT_ViewManager* myViewManager;
const char* myName;
public:
TRestoreViewParamsEvent (SUIT_ViewManager* theViewManager,
const char* theName):
- myViewMgr(theViewManager),
+ myViewManager(theViewManager),
myName(theName)
{}
virtual void Execute()
{
- myResult = View3D_i::RestoreViewParams(myViewMgr, myName);
+ myResult = View3D_i::RestoreViewParams(myViewManager, myName);
}
typedef CORBA::Boolean TResult;
TResult myResult;
return ProcessEvent(new TRestoreViewParamsEvent (myViewManager, theName));
}
- void View3D_i::Restore (SUIT_ViewWindow* theViewWindow,
+ void View3D_i::Restore (SUIT_ViewWindow* theStudyFrame,
const Storable::TRestoringMap& theMap)
{
SALOMEDS::Color aColor;
aScaleFactor[1] = VISU::Storable::FindValue(theMap,"myScaleFactor[1]").toDouble();
aScaleFactor[2] = VISU::Storable::FindValue(theMap,"myScaleFactor[2]").toDouble();
- SetBackground(theViewWindow,aColor);
- SetPointOfView(theViewWindow,aPosition);
- SetViewUp(theViewWindow,aViewUp);
- SetFocalPoint(theViewWindow,aFocalPnt);
- SetParallelScale(theViewWindow,aParallelScale);
- ScaleView(theViewWindow,VISU::View3D::XAxis,aScaleFactor[0]);
- ScaleView(theViewWindow,VISU::View3D::YAxis,aScaleFactor[1]);
- ScaleView(theViewWindow,VISU::View3D::ZAxis,aScaleFactor[2]);
+ SetBackground(theStudyFrame,aColor);
+ SetPointOfView(theStudyFrame,aPosition);
+ SetViewUp(theStudyFrame,aViewUp);
+ SetFocalPoint(theStudyFrame,aFocalPnt);
+ SetParallelScale(theStudyFrame,aParallelScale);
+ ScaleView(theStudyFrame,VISU::View3D::XAxis,aScaleFactor[0]);
+ ScaleView(theStudyFrame,VISU::View3D::YAxis,aScaleFactor[1]);
+ ScaleView(theStudyFrame,VISU::View3D::ZAxis,aScaleFactor[2]);
}
- string View3D_i::ToString (SUIT_ViewWindow* theViewWindow)
+ string View3D_i::ToString (SUIT_ViewWindow* theStudyFrame)
{
ostringstream strOut;
- Storable::DataToStream(strOut, "myComment", myComment.c_str());
- ToStream(theViewWindow, strOut);
- strOut << ends;
- if(MYDEBUG) MESSAGE("View3D_i::ToString - " << strOut.str());
+ Storable::DataToStream( strOut, "myComment", myComment.c_str() );
+ ToStream(theStudyFrame,strOut);
+ strOut<<ends;
+ if(MYDEBUG) MESSAGE("View3D_i::ToString - "<<strOut.str());
return strOut.str();
}
- void View3D_i::ToStream (SUIT_ViewWindow* theViewWindow, std::ostringstream& theStr)
+ void View3D_i::ToStream (SUIT_ViewWindow* theStudyFrame, std::ostringstream& theStr)
{
Storable::DataToStream(theStr,"myType",VISU::TVIEW3D);
float backint[3];
- GetRenderer(theViewWindow)->GetBackground(backint);
+ GetRenderer(theStudyFrame)->GetBackground(backint);
Storable::DataToStream(theStr,"myColor.R",backint[0]);
Storable::DataToStream(theStr,"myColor.G",backint[1]);
Storable::DataToStream(theStr,"myColor.B",backint[2]);
double aPosition[3];
- GetPointOfView(theViewWindow,aPosition);
+ GetPointOfView(theStudyFrame,aPosition);
Storable::DataToStream(theStr,"myPosition[0]",aPosition[0]);
Storable::DataToStream(theStr,"myPosition[1]",aPosition[1]);
Storable::DataToStream(theStr,"myPosition[2]",aPosition[2]);
double aFocalPnt[3];
- GetFocalPoint(theViewWindow,aFocalPnt);
+ GetFocalPoint(theStudyFrame,aFocalPnt);
Storable::DataToStream(theStr,"myFocalPnt[0]",aFocalPnt[0]);
Storable::DataToStream(theStr,"myFocalPnt[1]",aFocalPnt[1]);
Storable::DataToStream(theStr,"myFocalPnt[2]",aFocalPnt[2]);
double aViewUp[3];
- GetCamera(theViewWindow)->GetViewUp(aViewUp);
+ GetCamera(theStudyFrame)->GetViewUp(aViewUp);
Storable::DataToStream(theStr,"myViewUp[0]",aViewUp[0]);
Storable::DataToStream(theStr,"myViewUp[1]",aViewUp[1]);
Storable::DataToStream(theStr,"myViewUp[2]",aViewUp[2]);
- Storable::DataToStream(theStr,"myParallelScale",GetParallelScale(theViewWindow));
+ Storable::DataToStream(theStr,"myParallelScale",GetParallelScale(theStudyFrame));
double aScaleFactor[3];
- VISU::GetViewWindow(theViewWindow)->GetScale(aScaleFactor);
+ GetViewWindow(theStudyFrame)->GetScale(aScaleFactor);
Storable::DataToStream(theStr,"myScaleFactor[0]",aScaleFactor[0]);
Storable::DataToStream(theStr,"myScaleFactor[1]",aScaleFactor[1]);
Storable::DataToStream(theStr,"myScaleFactor[2]",aScaleFactor[2]);
void View3D_i::ToStream(std::ostringstream& theStr)
{
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- ToStream(aVW, theStr);
+ ToStream(myViewWindow,theStr);
}
void View3D_i::Close()
{
//jfa: may be need to be enclosed in SALOME_Event?
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- aVW->close();
- //QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
- //int aPos = aViews.find(myViewWindow);
- //if (aPos >= 0)
- // myViewWindow->close();
+ myViewWindow->close();
}
View3D_i::~View3D_i()
void View3D_i::SetTitle (const char* theTitle)
{
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- ProcessVoidEvent(new TVoidMemFun1ArgEvent<SUIT_ViewWindow,const QString&,QString>
- (aVW,&SUIT_ViewWindow::setCaption,QString(theTitle)));
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<SUIT_ViewWindow,const QString&,QString>
+ (myViewWindow,&SUIT_ViewWindow::setCaption,QString(theTitle)));
}
char* View3D_i::GetTitle()
{
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- return CORBA::string_dup(aVW->caption().latin1());
- return CORBA::string_dup("");
+ //jfa: may be need to be enclosed in SALOME_Event?
+ return CORBA::string_dup(myViewWindow->caption().latin1());
}
- void View3D_i::SetBackground (SUIT_ViewWindow* theViewWindow,
+ void View3D_i::SetBackground (SUIT_ViewWindow* theStudyFrame,
const SALOMEDS::Color& theColor)
{
//jfa: may be need to be enclosed in SALOME_Event?
aColor[0] = int(255.0*theColor.R);
aColor[1] = int(255.0*theColor.G);
aColor[2] = int(255.0*theColor.B);
- QColor aNewColor (aColor[0],aColor[1],aColor[2]);
- VISU::GetViewWindow(theViewWindow)->setBackgroundColor(aNewColor);
+ QColor aNewColor(aColor[0],aColor[1],aColor[2]);
+ GetViewWindow(theStudyFrame)->setBackgroundColor(aNewColor);
}
- SALOMEDS::Color View3D_i::GetBackground (SUIT_ViewWindow* theViewWindow)
+ SALOMEDS::Color View3D_i::GetBackground (SUIT_ViewWindow* theStudyFrame)
{
+ //jfa: may be need to be enclosed in SALOME_Event?
SALOMEDS::Color aColor;
float backint[3];
- GetRenderer(theViewWindow)->GetBackground(backint);
+ GetRenderer(theStudyFrame)->GetBackground(backint);
aColor.R = backint[0]; aColor.G = backint[1]; aColor.B = backint[2];
return aColor;
}
class TUpdateViewerEvent: public SALOME_Event
{
- SUIT_ViewWindow* myVW;
+ SUIT_ViewWindow* myViewWindow;
Prs3d_i* myPrs3d;
int myDisplaing;
public:
- TUpdateViewerEvent(SUIT_ViewWindow* theViewWindow,
+ TUpdateViewerEvent(SUIT_ViewWindow* theStudyFrame,
Prs3d_i* thePrs3d,
int theDisplaing):
- myVW(theViewWindow),
+ myViewWindow(theStudyFrame),
myPrs3d(thePrs3d),
myDisplaing(theDisplaing)
{}
virtual void Execute(){
- UpdateViewer(myVW, myDisplaing, myPrs3d);
+ UpdateViewer(myViewWindow,myDisplaing,myPrs3d);
}
};
void View3D_i::EraseAll()
{
if(MYDEBUG) MESSAGE("View3D_i::EraseAll");
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- ProcessVoidEvent(new TUpdateViewerEvent(aVW,NULL,eEraseAll));
+ ProcessVoidEvent(new TUpdateViewerEvent(myViewWindow,NULL,eEraseAll));
}
void View3D_i::DisplayAll()
{
if(MYDEBUG) MESSAGE("View3D_i::DisplayAll");
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- ProcessVoidEvent(new TUpdateViewerEvent(aVW,NULL,eDisplayAll));
+ ProcessVoidEvent(new TUpdateViewerEvent(myViewWindow,NULL,eDisplayAll));
}
void View3D_i::Erase (PrsObject_ptr thePrsObj)
{
if(MYDEBUG) MESSAGE("View3D_i::Erase");
- SUIT_ViewWindow* aVW = GetViewWindow();
CORBA::Object_ptr anObj = thePrsObj;
- Prs3d_i* aPrs = dynamic_cast<Prs3d_i*>(VISU::GetServant(anObj).in());
- if (aVW && aPrs)
- ProcessVoidEvent(new TUpdateViewerEvent(aVW,aPrs,eErase));
+ if(Prs3d_i* aPrs = dynamic_cast<Prs3d_i*>(VISU::GetServant(anObj).in())){
+ ProcessVoidEvent(new TUpdateViewerEvent(myViewWindow,aPrs,eErase));
+ }
}
void View3D_i::Display (PrsObject_ptr thePrsObj)
{
if(MYDEBUG) MESSAGE("View3D_i::Display");
- SUIT_ViewWindow* aVW = GetViewWindow();
CORBA::Object_ptr anObj = thePrsObj;
- Prs3d_i* aPrs = dynamic_cast<Prs3d_i*>(VISU::GetServant(anObj).in());
- if (aVW && aPrs)
- ProcessVoidEvent(new TUpdateViewerEvent(aVW,aPrs,eDisplay));
+ if(Prs3d_i* aPrs = dynamic_cast<Prs3d_i*>(VISU::GetServant(anObj).in())){
+ ProcessVoidEvent(new TUpdateViewerEvent(myViewWindow,aPrs,eDisplay));
+ }
}
void View3D_i::DisplayOnly (PrsObject_ptr thePrsObj)
{
if(MYDEBUG) MESSAGE("View3D_i::DisplayOnly");
- SUIT_ViewWindow* aVW = GetViewWindow();
CORBA::Object_ptr anObj = thePrsObj;
- Prs3d_i* aPrs = dynamic_cast<Prs3d_i*>(VISU::GetServant(anObj).in());
- if (aVW && aPrs)
- ProcessVoidEvent(new TUpdateViewerEvent(aVW,aPrs,eDisplayOnly));
+ if(Prs3d_i* aPrs = dynamic_cast<Prs3d_i*>(VISU::GetServant(anObj).in())){
+ ProcessVoidEvent(new TUpdateViewerEvent(myViewWindow,aPrs,eDisplayOnly));
+ }
}
void View3D_i::FitAll()
{
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW) {
- ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
- (VISU::GetViewWindow(aVW), &SVTK_ViewWindow::onFitAll));
- Update();
- }
+ ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
+ (GetViewWindow(myViewWindow), &SVTK_ViewWindow::onFitAll));
+ Update();
}
void View3D_i::SetView (VISU::View3D::ViewType theType)
{
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (!aVW)
- return;
-
switch (theType) {
case VISU::View3D::FRONT :
ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
- (VISU::GetViewWindow(aVW), &SVTK_ViewWindow::onFrontView));
+ (GetViewWindow(myViewWindow), &SVTK_ViewWindow::onFrontView));
break;
case VISU::View3D::BACK :
ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
- (VISU::GetViewWindow(aVW), &SVTK_ViewWindow::onBackView));
+ (GetViewWindow(myViewWindow), &SVTK_ViewWindow::onBackView));
break;
case VISU::View3D::LEFT :
ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
- (VISU::GetViewWindow(aVW),&SVTK_ViewWindow::onLeftView));
+ (GetViewWindow(myViewWindow),&SVTK_ViewWindow::onLeftView));
break;
case VISU::View3D::RIGHT :
ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
- (VISU::GetViewWindow(aVW),&SVTK_ViewWindow::onRightView));
+ (GetViewWindow(myViewWindow),&SVTK_ViewWindow::onRightView));
break;
case VISU::View3D::TOP :
ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
- (VISU::GetViewWindow(aVW),&SVTK_ViewWindow::onTopView));
+ (GetViewWindow(myViewWindow),&SVTK_ViewWindow::onTopView));
break;
case VISU::View3D::BOTTOM :
ProcessVoidEvent(new TVoidMemFunEvent<SVTK_ViewWindow>
- (VISU::GetViewWindow(aVW),&SVTK_ViewWindow::onBottomView));
+ (GetViewWindow(myViewWindow),&SVTK_ViewWindow::onBottomView));
break;
}
Update();
class TSet3DViewParamEvent: public SALOME_Event
{
public:
- typedef void (*TFun)(SUIT_ViewWindow* theViewWindow, const CORBA::Double theParam[3]);
+ typedef void (*TFun)(SUIT_ViewWindow* theStudyFrame, const CORBA::Double theParam[3]);
TSet3DViewParamEvent (TFun theFun,
- SUIT_ViewWindow* theViewWindow,
+ SUIT_ViewWindow* theStudyFrame,
const CORBA::Double theParam[3]):
myFun(theFun),
- myVW(theViewWindow),
+ myViewWindow(theStudyFrame),
myParam(theParam)
{}
- virtual void Execute() {
- myFun(myVW,myParam);
+ virtual void Execute(){
+ myFun(myViewWindow,myParam);
}
private:
TFun myFun;
- SUIT_ViewWindow* myVW;
+ SUIT_ViewWindow* myViewWindow;
const CORBA::Double* myParam;
};
- void View3D_i::SetPointOfView (SUIT_ViewWindow* theViewWindow,
+ void View3D_i::SetPointOfView (SUIT_ViewWindow* theStudyFrame,
const CORBA::Double thePosition[3])
{
//jfa: may be need to be enclosed in SALOME_Event?
- GetCamera(theViewWindow)->SetPosition(thePosition);
+ GetCamera(theStudyFrame)->SetPosition(thePosition);
}
void View3D_i::SetPointOfView (const VISU::View3D::XYZ thePosition)
{
if(MYDEBUG) MESSAGE("View3D_i::SetPointOfView");
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- ProcessVoidEvent(new TSet3DViewParamEvent(&SetPointOfView,aVW,thePosition));
+ ProcessVoidEvent(new TSet3DViewParamEvent(&SetPointOfView,myViewWindow,thePosition));
}
- void View3D_i::GetPointOfView (SUIT_ViewWindow* theViewWindow,
+ void View3D_i::GetPointOfView (SUIT_ViewWindow* theStudyFrame,
CORBA::Double thePosition[3])
{
- GetCamera(theViewWindow)->GetPosition(thePosition);
+ //jfa: may be need to be enclosed in SALOME_Event?
+ GetCamera(theStudyFrame)->GetPosition(thePosition);
}
VISU::View3D::XYZ_slice* View3D_i::GetPointOfView()
{
+ //jfa: may be need to be enclosed in SALOME_Event?
if(MYDEBUG) MESSAGE("View3D_i::GetPointOfView");
CORBA::Double aPosition[3];
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- GetPointOfView(aVW,aPosition);
+ GetPointOfView(myViewWindow,aPosition);
return VISU::View3D::XYZ_dup(aPosition);
}
- void View3D_i::SetViewUp (SUIT_ViewWindow* theViewWindow,
+ void View3D_i::SetViewUp (SUIT_ViewWindow* theStudyFrame,
const CORBA::Double theViewUp[3])
{
- GetCamera(theViewWindow)->SetViewUp(theViewUp);
+ GetCamera(theStudyFrame)->SetViewUp(theViewUp);
}
void View3D_i::SetViewUp (const VISU::View3D::XYZ theViewUp)
{
if(MYDEBUG) MESSAGE("View3D_i::SetViewUp");
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- ProcessVoidEvent(new TSet3DViewParamEvent(&SetViewUp,aVW,theViewUp));
+ ProcessVoidEvent(new TSet3DViewParamEvent(&SetViewUp,myViewWindow,theViewUp));
}
- void View3D_i::GetViewUp (SUIT_ViewWindow* theViewWindow,
+ void View3D_i::GetViewUp (SUIT_ViewWindow* theStudyFrame,
CORBA::Double theViewUp[3])
{
- GetCamera(theViewWindow)->GetViewUp(theViewUp);
+ GetCamera(theStudyFrame)->GetViewUp(theViewUp);
}
VISU::View3D::XYZ_slice* View3D_i::GetViewUp()
{
+ //jfa: may be need to be enclosed in SALOME_Event?
if(MYDEBUG) MESSAGE("View3D_i::GetViewUp");
CORBA::Double aViewUp[3];
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- GetCamera(aVW)->GetViewUp(aViewUp);
+ GetCamera(myViewWindow)->GetViewUp(aViewUp);
return VISU::View3D::XYZ_dup(aViewUp);
}
- void View3D_i::SetFocalPoint (SUIT_ViewWindow* theViewWindow,
+ void View3D_i::SetFocalPoint (SUIT_ViewWindow* theStudyFrame,
const CORBA::Double theFocalPnt[3])
{
- GetCamera(theViewWindow)->SetFocalPoint(theFocalPnt);
+ GetCamera(theStudyFrame)->SetFocalPoint(theFocalPnt);
}
void View3D_i::SetFocalPoint (const VISU::View3D::XYZ theCoord)
{
if(MYDEBUG) MESSAGE("View3D_i::SetFocalPoint");
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- ProcessVoidEvent(new TSet3DViewParamEvent(&SetFocalPoint,aVW,theCoord));
+ ProcessVoidEvent(new TSet3DViewParamEvent(&SetFocalPoint,myViewWindow,theCoord));
}
- void View3D_i::GetFocalPoint (SUIT_ViewWindow* theViewWindow,
+ void View3D_i::GetFocalPoint (SUIT_ViewWindow* theStudyFrame,
CORBA::Double theFocalPnt[3])
{
- GetCamera(theViewWindow)->GetFocalPoint(theFocalPnt);
+ GetCamera(theStudyFrame)->GetFocalPoint(theFocalPnt);
}
VISU::View3D::XYZ_slice* View3D_i::GetFocalPoint()
{
+ //jfa: may be need to be enclosed in SALOME_Event?
if(MYDEBUG) MESSAGE("View3D_i::GetFocalPoint");
CORBA::Double aFocalPnt[3];
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- GetFocalPoint(aVW,aFocalPnt);
+ GetFocalPoint(myViewWindow,aFocalPnt);
return VISU::View3D::XYZ_dup(aFocalPnt);
}
class TSetViewParamEvent: public SALOME_Event
{
public:
- typedef void (*TFun)(SUIT_ViewWindow* theViewWindow, CORBA::Double theParam);
+ typedef void (*TFun)(SUIT_ViewWindow* theStudyFrame, CORBA::Double theParam);
TSetViewParamEvent (TFun theFun,
- SUIT_ViewWindow* theViewWindow,
+ SUIT_ViewWindow* theStudyFrame,
CORBA::Double theParam):
myFun(theFun),
- myVW(theViewWindow),
+ myViewWindow(theStudyFrame),
myParam(theParam)
{}
virtual void Execute()
{
- myFun(myVW,myParam);
+ myFun(myViewWindow,myParam);
}
private:
TFun myFun;
- SUIT_ViewWindow* myVW;
+ SUIT_ViewWindow* myViewWindow;
CORBA::Double myParam;
};
- void View3D_i::SetParallelScale (SUIT_ViewWindow* theViewWindow,
+ void View3D_i::SetParallelScale (SUIT_ViewWindow* theStudyFrame,
CORBA::Double theScale)
{
- GetCamera(theViewWindow)->SetParallelScale(theScale);
+ GetCamera(theStudyFrame)->SetParallelScale(theScale);
}
void View3D_i::SetParallelScale (CORBA::Double theScale)
{
if(MYDEBUG) MESSAGE("View3D_i::SetParallelScale");
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- ProcessVoidEvent(new TSetViewParamEvent(&SetParallelScale,aVW,theScale));
+ ProcessVoidEvent(new TSetViewParamEvent(&SetParallelScale,myViewWindow,theScale));
}
- CORBA::Double View3D_i::GetParallelScale (SUIT_ViewWindow* theViewWindow)
+ CORBA::Double View3D_i::GetParallelScale (SUIT_ViewWindow* theStudyFrame)
{
- return GetCamera(theViewWindow)->GetParallelScale();
+ return GetCamera(theStudyFrame)->GetParallelScale();
}
CORBA::Double View3D_i::GetParallelScale()
{
+ //jfa: may be need to be enclosed in SALOME_Event?
if(MYDEBUG) MESSAGE("View3D_i::GetParallelScale");
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- return GetParallelScale(aVW);
- return 1.0;
+ return GetParallelScale(myViewWindow);
}
- void View3D_i::ScaleView (SUIT_ViewWindow* theViewWindow,
+ void View3D_i::ScaleView (SUIT_ViewWindow* theStudyFrame,
VISU::View3D::Axis theAxis, CORBA::Double theParam)
{
- SVTK_ViewWindow* aViewWindow = VISU::GetViewWindow(theViewWindow);
+ SVTK_ViewWindow* aViewFrame = GetViewWindow(theStudyFrame);
double aScaleFactor[3];
- aViewWindow->GetScale(aScaleFactor);
+ aViewFrame->GetScale(aScaleFactor);
aScaleFactor[theAxis] = theParam;
- aViewWindow->SetScale(aScaleFactor);
+ aViewFrame->SetScale(aScaleFactor);
}
- void SetScaleView (SUIT_ViewWindow* theViewWindow, const CORBA::Double theScale[3])
+ void SetScaleView (SUIT_ViewWindow* theStudyFrame, const CORBA::Double theScale[3])
{
double aScale[3] = {theScale[0], theScale[1], theScale[2]};
- VISU::GetViewWindow(theViewWindow)->SetScale(aScale);
+ GetViewWindow(theStudyFrame)->SetScale(aScale);
}
void View3D_i::ScaleView(VISU::View3D::Axis theAxis, CORBA::Double theParam)
{
if(MYDEBUG) MESSAGE("View3D_i::ScaleView");
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW) {
- double aScale[3];
- VISU::GetViewWindow(aVW)->GetScale(aScale);
- aScale[theAxis] = theParam;
- ProcessVoidEvent(new TSet3DViewParamEvent(&SetScaleView,aVW,aScale));
- }
+ double aScale[3];
+ GetViewWindow(myViewWindow)->GetScale(aScale);
+ aScale[theAxis] = theParam;
+ ProcessVoidEvent(new TSet3DViewParamEvent(&SetScaleView,myViewWindow,aScale));
}
void View3D_i::RemoveScale()
{
if(MYDEBUG) MESSAGE("View3D_i::RemoveScale");
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW) {
- double aScale[3] = {1.0, 1.0, 1.0};
- ProcessVoidEvent(new TSet3DViewParamEvent(&SetScaleView,aVW,aScale));
- }
+ double aScale[3] = {1.0, 1.0, 1.0};
+ ProcessVoidEvent(new TSet3DViewParamEvent(&SetScaleView,myViewWindow,aScale));
}
}