Skip to content

Commit

Permalink
Show correctly large models
Browse files Browse the repository at this point in the history
  • Loading branch information
LafCorentin committed Jul 29, 2020
1 parent 30b86fa commit 5d78d69
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/plugins/editing/MappingView/src/mappingviewwidget.cpp
Expand Up @@ -118,6 +118,7 @@ MappingViewWidget::MappingViewWidget(QWidget *pParent) :

mFieldModule.beginChange();
OpenCMISS::Zinc::Field coordinates = mFieldModule.findFieldByName("Coordinates");

OpenCMISS::Zinc::FieldMagnitude magnitude = mFieldModule.createFieldMagnitude(coordinates);

magnitude.setManaged(true);
Expand Down Expand Up @@ -155,7 +156,7 @@ MappingViewWidget::MappingViewWidget(QWidget *pParent) :
OpenCMISS::Zinc::GraphicsLines lines = scene.createGraphicsLines();

lines.setCoordinateField(coordinates);
lines.setMaterial(materialModule.findMaterialByName("black"));
lines.setMaterial(materialModule.findMaterialByName("red"));

// Green spheres limiting our scene

Expand Down Expand Up @@ -348,7 +349,7 @@ void MappingViewWidget::graphicsInitialized()

OpenCMISS::Zinc::Sceneviewer sceneViewer = mZincWidget->sceneViewer();

sceneViewer.readDescription(mZincSceneViewerDescription);
//sceneViewer.readDescription(mZincSceneViewerDescription);

// Our Zinc widget has had its graphics initialised, so now we can set its
// background colour
Expand All @@ -358,7 +359,7 @@ void MappingViewWidget::graphicsInitialized()
sceneViewer.setBackgroundColourRGBA(backgroundColor.data());

// Our initial look at and eye positions, and up vector

/* TODO free when it works
sceneViewer.setViewingVolume(-1.922499, 1.922499, -1.922499, 1.922499, 0.632076, 22.557219);
//TODO adapt to the model
Expand All @@ -369,6 +370,10 @@ void MappingViewWidget::graphicsInitialized()
sceneViewer.setLookatPosition(lookAtPosition.data());
sceneViewer.setEyePosition(eyePosition.data());
sceneViewer.setUpVector(upVector.data());
*/
OpenCMISS::Zinc::Region defaultRegion = mZincContext->getDefaultRegion();

sceneViewer.setScene(defaultRegion.getScene());

}

Expand Down

0 comments on commit 5d78d69

Please sign in to comment.