@@ -111,17 +111,9 @@ AnimationWindowContainer::AnimationWindowContainer(QWidget *pParent)
111111 // connect(mpAnimationSlider, SIGNAL(sliderMoved(int)),mpAnimationWindowContainer, SLOT(sliderSetTimeSlotFunction(int)));
112112 addToolBar (Qt::TopToolBarArea,mpAnimationToolBar);
113113
114-
115-
116- // QVBoxLayout* mainLayout = new QVBoxLayout();
117- // mainLayout->addWidget(mpViewerWidget);
118- // QWidget* topWidget = new QWidget();
119- // topWidget->setLayout(mainLayout);
120114 mpViewerWidget->setParent (this );// important!!
121-
122- // mpViewerWidget->setParent(topWidget);//kein Einfluss
123-
124- // setCentralWidget(topWidget); //kein Einfluss
115+ // mpViewerWidget->setParent(topWidget);//no influence
116+ // setCentralWidget(topWidget);//no influence
125117
126118 connect (mpAnimationChooseFileAction, SIGNAL (triggered ()),this , SLOT (chooseAnimationFileSlotFunction ()));
127119 connect (mpAnimationInitializeAction, SIGNAL (triggered ()),this , SLOT (initSlotFunction ()));
@@ -143,7 +135,6 @@ QWidget* AnimationWindowContainer::setupViewWidget(osg::ref_ptr<osg::Node> rootN
143135 traits->windowDecoration = false ;
144136 traits->x = 0 ;
145137 traits->y = 0 ;
146-
147138 traits->width = 2000 ;
148139 traits->height = 1000 ;
149140 traits->doubleBuffer = true ;
@@ -160,7 +151,8 @@ QWidget* AnimationWindowContainer::setupViewWidget(osg::ref_ptr<osg::Node> rootN
160151 osg::ref_ptr<osg::Camera> camera = mpSceneView->getCamera ();
161152 camera->setGraphicsContext (gw);
162153 camera->setClearColor (osg::Vec4 (0.2 , 0.2 , 0.6 , 1.0 ));
163- camera->setViewport (new osg::Viewport (0 , 0 , traits->width , traits->height ));
154+ // camera->setViewport(new osg::Viewport(0, 0, traits->width, traits->height));
155+ camera->setViewport (new osg::Viewport (0 , 0 , 2000 , 1000 ));
164156 camera->setProjectionMatrixAsPerspective (30 .0f , static_cast <double >(traits->width /2 ) / static_cast <double >(traits->height /2 ), 1 .0f , 10000 .0f );
165157 mpSceneView->setSceneData (rootNode);
166158 mpSceneView->addEventHandler (new osgViewer::StatsHandler ());
@@ -185,24 +177,29 @@ void AnimationWindowContainer::loadVisualization(){
185177 std::cout<<" unknown visualization type. " <<std::endl;
186178
187179 // init visualizer
188- if (visType == VisType::MAT){
180+ if (visType == VisType::MAT)
181+ {
189182 mpVisualizer = new VisualizerMAT (mFileName , mPathName );
190183 }
191- else {
184+ else
185+ {
192186 std::cout<<" could not init " <<mPathName <<mFileName <<std::endl;
193187 }
194188
195189 // load the XML File, build osgTree, get initial values for the shapes
196190 bool xmlExists = checkForXMLFile (mFileName , mPathName );
197- if (!xmlExists){
191+ if (!xmlExists)
192+ {
198193 std::cout<<" Could not find the visual XML file " <<assembleXMLFileName (mFileName , mPathName )<<std::endl;
199194 }
200- mpVisualizer->initData ();
201- mpVisualizer->setUpScene ();
202- mpVisualizer->initVisualization ();
203-
204- // add scene for the chosen visualization
205- mpSceneView->setSceneData (mpVisualizer->getOMVisScene ()->getScene ().getRootNode ());
195+ else
196+ {
197+ mpVisualizer->initData ();
198+ mpVisualizer->setUpScene ();
199+ mpVisualizer->initVisualization ();
200+ // add scene for the chosen visualization
201+ mpSceneView->setSceneData (mpVisualizer->getOMVisScene ()->getScene ().getRootNode ());
202+ }
206203}
207204
208205
@@ -217,7 +214,7 @@ void AnimationWindowContainer::chooseAnimationFileSlotFunction(){
217214 std::size_t pos = file.find_last_of (" /\\ " );
218215 mPathName = file.substr (0 , pos + 1 );
219216 mFileName = file.substr (pos + 1 , file.length ());
220- // std::cout<<"file "<<mFileName<<" path "<<mPathName<<std::endl;
217+ std::cout<<" file " <<mFileName <<" path " <<mPathName <<std::endl;
221218 loadVisualization ();
222219 }
223220 else
@@ -312,3 +309,21 @@ double AnimationWindowContainer::getVisTime(){
312309 return mpVisualizer->getTimeManager ()->getVisTime ();
313310}
314311
312+ /* !
313+ * \brief AnimationWindowContainer::setPathName
314+ * sets mpPathName
315+ */
316+ void AnimationWindowContainer::setPathName (std::string pathName){
317+ mPathName = pathName;
318+ }
319+
320+
321+ /* !
322+ * \brief AnimationWindowContainer::setFileName
323+ * sets mpFileName
324+ */
325+ void AnimationWindowContainer::setFileName (std::string fileName){
326+ mFileName = fileName;
327+ }
328+
329+
0 commit comments