Page MenuHomePhabricator

4598_RenderingManager_Changes.patch

Authored By
goch
Dec 1 2010, 5:35 PM
Size
1 KB
Referenced Files
None
Subscribers
None

4598_RenderingManager_Changes.patch

Index: Core/Code/Controllers/mitkRenderingManager.cpp
===================================================================
--- Core/Code/Controllers/mitkRenderingManager.cpp (revision 28116)
+++ Core/Code/Controllers/mitkRenderingManager.cpp (working copy)
@@ -443,7 +443,6 @@
}
-
int warningLevel = vtkObject::GetGlobalWarningDisplay();
vtkObject::GlobalWarningDisplayOff();
@@ -453,6 +452,28 @@
boundingBoxInitialized = true;
}
+ if (geometry.IsNotNull() )
+ {// make sure bounding box has an extent bigger than zero in any direction
+ // clone the input geometry
+ Geometry3D::Pointer modifiedGeometry = dynamic_cast<Geometry3D*>( dataGeometry->Clone().GetPointer() );
+ assert(modifiedGeometry.IsNotNull());
+ Geometry3D::BoundsArrayType newBounds = modifiedGeometry->GetBounds();
+ for( unsigned int dimension = 0; ( 2 * dimension ) < newBounds.Size() ; dimension++ )
+ {
+ if( std::abs( newBounds[ 2 * dimension ] - newBounds[ 2 * dimension + 1 ] )
+ < mitk::eps
+ )
+ {
+ newBounds[ 2 * dimension + 1 ] += 1;
+ }
+ }
+
+ // set the newly calculated bounds array
+ modifiedGeometry->SetBounds(newBounds);
+
+ geometry = modifiedGeometry;
+ }
+
RenderWindowList::iterator it;
for ( it = m_RenderWindowList.begin(); it != m_RenderWindowList.end(); ++it )
{

File Metadata

Mime Type
text/plain
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
532
Default Alt Text
4598_RenderingManager_Changes.patch (1 KB)

Event Timeline

Setting all (near-)zero extents of the bounding box to one