VisuGUI
::OnArrangeActors()
{
- SVTK_ViewWindow* vw = GetActiveViewWindow<SVTK_ViewWindow>(this);
- if (vw) {
- ArrangeDlg* aDlg = new ArrangeDlg (GetDesktop(this), vw);
+ if(SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(this)){
+ ArrangeDlg* aDlg = new ArrangeDlg (GetDesktop(this), this, aViewWindow);
aDlg->exec();
delete aDlg;
}
mgr->setRule( action( VISU_RESTORE_VIEW_PARAMS ), "selcount=1 and type='VISU::TVIEW3D' and activeView='VTKViewer'", true );
//mgr->setRule( action( VISU_DELETE_VIEW_PARAMS ), "selcount=1 and type='VISU::TVIEW3D'", true );
- mgr->setRule( action( VISU_ARRANGE_ACTORS ), "client='VTKViewer' and selcount=0", true );
+ mgr->setRule( action( VISU_ARRANGE_ACTORS ), "$client in {'VTKViewer' 'VVTK'} and selcount=0", true );
// 3D presentations commands
QString aPrsType = " and $type in {'VISU::TMESH' " + aPrsAll + "}";
myFieldLst->setSelected(0, true);
}
-ArrangeDlg::ArrangeDlg(QWidget* theParent, SVTK_ViewWindow* theViewWindow)
+ArrangeDlg::ArrangeDlg(QWidget* theParent,
+ const SalomeApp_Module* theModule,
+ SVTK_ViewWindow* theViewWindow)
: QDialog(theParent, "ArrangeDlg", true, WStyle_Customize |
WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
- myAnimator(NULL), myViewWindow(theViewWindow)
+ myAnimator(NULL),
+ myViewWindow(theViewWindow)
{
myCurrent = 0;
init();
QStringList aPrsNames;
- vtkActor* anActor;
- vtkActorCollection *anActColl = myViewWindow->getRenderer()->GetActors();
- for (anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL;) {
- VISU_Actor* anVISUActor = dynamic_cast<VISU_Actor*>(anActor);
- if (anVISUActor)
- if (anVISUActor->GetVisibility() != 0) {
- VISU::Prs3d_i* aPrs = anVISUActor->GetPrs3d();
- if (aPrs) {
- if (!myPrsMap.contains(aPrs)) {
- SALOMEDS::SObject_var aSObject = aPrs->GetSObject();
- if(!aSObject->_is_nil()){
- SALOMEDS::GenericAttribute_var anAttr;
+ vtkActorCollection *aCollection = myViewWindow->getRenderer()->GetActors();
+ aCollection->InitTraversal();
+ while(vtkActor* anActor = aCollection->GetNextActor()){
+ if (VISU_Actor* anVISUActor = dynamic_cast<VISU_Actor*>(anActor))
+ if(anVISUActor->GetVisibility() != 0){
+ if (VISU::Prs3d_i* aPrs = anVISUActor->GetPrs3d()){
+ if(!myPrsMap.contains(aPrs)){
+ Handle(SALOME_InteractiveObject) anIO = aPrs->GetIO();
+ if(!anIO->hasEntry())
+ continue;
+ SalomeApp_Study* aStudy = VISU::GetAppStudy(theModule);
+ VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, anIO->getEntry());
+ if(_PTR(SObject) aSObject = anObjectInfo.mySObject){
+ _PTR(GenericAttribute) anAttr;
if (aSObject->FindAttribute(anAttr, "AttributeName")) {
- SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
- string aNam = aName->Value();
- QString strIn(aNam.c_str());
+ _PTR(AttributeName) aName(anAttr);
+ QString strIn(aName->Value().c_str());
aPrsNames.append(strIn);
myPrsMap[aPrs] = myOffsets.count();
Offset aOffs;
#include <map>
class VisuGUI;
+class SalomeApp_Module;
class VISU_TimeAnimation;
-namespace VISU {
+namespace VISU
+{
class Prs3d_i;
}
enum { AutoMode, ManualMode };
enum { XAxis, YAxis, ZAxis };
- ArrangeDlg(QWidget* theParent, VISU_TimeAnimation* theAnimator);
- ArrangeDlg(QWidget* theParent, SVTK_ViewWindow* theViewWindow);
+ ArrangeDlg(QWidget* theParent,
+ VISU_TimeAnimation* theAnimator);
+
+ ArrangeDlg(QWidget* theParent,
+ const SalomeApp_Module* theModule,
+ SVTK_ViewWindow* theViewWindow);
+
~ArrangeDlg() {};
int getMode() const { return myStackWgt->id(myStackWgt->visibleWidget()); }