diff --git a/Core/Code/Rendering/mitkRenderWindowFrame.cpp b/Core/Code/Rendering/mitkRenderWindowFrame.cpp index 1423a8def5..018b91522f 100644 --- a/Core/Code/Rendering/mitkRenderWindowFrame.cpp +++ b/Core/Code/Rendering/mitkRenderWindowFrame.cpp @@ -1,148 +1,143 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "mitkRenderWindowFrame.h" #include "mitkVtkLayerController.h" +#include "vtkMitkRectangleProp.h" #include #include #include #include #include #include #include #include #include mitk::RenderWindowFrame::RenderWindowFrame() { m_RenderWindow = NULL; m_RectangleRenderer = vtkRenderer::New(); m_IsEnabled = false; } mitk::RenderWindowFrame::~RenderWindowFrame() { if ( m_RenderWindow != NULL ) if ( this->IsEnabled() ) this->Disable(); if ( m_RectangleRenderer != NULL ) m_RectangleRenderer->Delete(); - } /** * Sets the renderwindow, in which the text * will be shown. Make sure, you have called this function * before calling Enable() */ void mitk::RenderWindowFrame::SetRenderWindow( vtkRenderWindow* renderWindow ) { m_RenderWindow = renderWindow; } /** * Returns the vtkRenderWindow, which is used * for displaying the text */ vtkRenderWindow* mitk::RenderWindowFrame::GetRenderWindow() { return m_RenderWindow; } /** * Returns the renderer responsible for * rendering the text into the * vtkRenderWindow */ vtkRenderer* mitk::RenderWindowFrame::GetVtkRenderer() { return m_RectangleRenderer; } /** * Disables drawing of the text label collection. * If you want to enable it, call the Enable() function. */ void mitk::RenderWindowFrame::Disable() { if ( this->IsEnabled()) { m_RectangleRenderer->EraseOn(); mitk::VtkLayerController::GetInstance(m_RenderWindow)->RemoveRenderer(m_RectangleRenderer); m_IsEnabled = false; } } /** * Enables drawing of the text label collection. * If you want to disable it, call the Disable() function. */ void mitk::RenderWindowFrame::Enable(float col1, float col2, float col3) { -// vtkMitkRectangleProp* rect = vtkMitkRectangleProp::New(); -// rect->SetRenderWindow(m_RenderWindow); -// rect->SetColor(col1, col2, col3); - -// m_RectangleRenderer->AddViewProp(rect); - -// rect->Delete(); + vtkSmartPointer rect = vtkSmartPointer::New(); + rect->SetRenderWindow(m_RenderWindow); + rect->SetColor(col1, col2, col3); + m_RectangleRenderer->AddActor(rect); if(!mitk::VtkLayerController::GetInstance(m_RenderWindow)->IsRendererInserted( m_RectangleRenderer )) { - m_RectangleRenderer->EraseOff(); - m_RectangleRenderer->SetInteractive(0); mitk::VtkLayerController::GetInstance(m_RenderWindow)->InsertForegroundRenderer(m_RectangleRenderer,true); m_IsEnabled = true; } } /** * Checks, if the text is currently * enabled (visible) */ bool mitk::RenderWindowFrame::IsEnabled() { return m_IsEnabled; } void mitk::RenderWindowFrame::SetRequestedRegionToLargestPossibleRegion() { //nothing to do } bool mitk::RenderWindowFrame::RequestedRegionIsOutsideOfTheBufferedRegion() { return false; } bool mitk::RenderWindowFrame::VerifyRequestedRegion() { return true; } void mitk::RenderWindowFrame::SetRequestedRegion( const itk::DataObject*) { //nothing to do } diff --git a/Core/Code/Rendering/vtkMitkRectangleProp.cpp b/Core/Code/Rendering/vtkMitkRectangleProp.cpp new file mode 100644 index 0000000000..80fa686a3e --- /dev/null +++ b/Core/Code/Rendering/vtkMitkRectangleProp.cpp @@ -0,0 +1,118 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + +#include "vtkMitkRectangleProp.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +vtkStandardNewMacro(vtkMitkRectangleProp); + +vtkMitkRectangleProp::vtkMitkRectangleProp() +{ + vtkSmartPointer mapper = vtkSmartPointer::New(); + m_RectangleActor = vtkSmartPointer::New(); + m_PolyData = vtkSmartPointer::New(); + + vtkSmartPointer lines = vtkSmartPointer::New(); + vtkSmartPointer points = vtkSmartPointer::New(); + + m_PolyData->SetPoints(points); + m_PolyData->SetLines(lines); + + this->CreateRectangle(); + + mapper->SetInputData(m_PolyData); + m_RectangleActor->SetMapper(mapper); +} + +vtkMitkRectangleProp::~vtkMitkRectangleProp() +{ +} + +int vtkMitkRectangleProp::RenderOverlay(vtkViewport* viewport) +{ +// m_RenderWindow->MakeCurrent(); + + double right = m_RenderWindow->GetSize()[0]; + double top = m_RenderWindow->GetSize()[1]; + double bottom = 1.0; + double left = 1.0; + double defaultDepth = 0.0; + + vtkSmartPointer points = m_PolyData->GetPoints(); + //change the corners to adapt the size of the renderwindow was resized + points->SetPoint(m_BottomLeft, left, bottom, defaultDepth); + points->SetPoint(m_TopLeft, left, top, defaultDepth); + points->SetPoint(m_TopRight, right, top, defaultDepth); + points->SetPoint(m_BottomRight, right, bottom, defaultDepth); + + //adapt color + m_RectangleActor->GetProperty()->SetColor( m_Color[0], m_Color[1], m_Color[2]); + + //render the actor + m_RectangleActor->RenderOverlay(viewport); + return 1; +} + +void vtkMitkRectangleProp::CreateRectangle() +{ + vtkSmartPointer points = m_PolyData->GetPoints(); + vtkSmartPointer lines = m_PolyData->GetLines(); + + double bottom = 1.0; + double left = 1.0; + double right = 199.0; + double top = 199.0; + double defaultDepth = 0.0; + + //4 corner points + m_BottomLeft = points->InsertNextPoint(left, bottom, defaultDepth); + m_BottomRight = points->InsertNextPoint(right, bottom, defaultDepth); + m_TopLeft = points->InsertNextPoint(left, top, defaultDepth); + m_TopRight = points->InsertNextPoint(right, top, defaultDepth); + + vtkSmartPointer lineVtk = vtkSmartPointer::New(); + lineVtk->GetPointIds()->SetNumberOfIds(5); + //connect the lines + lineVtk->GetPointIds()->SetId(0,m_BottomLeft); + lineVtk->GetPointIds()->SetId(1,m_BottomRight); + lineVtk->GetPointIds()->SetId(2,m_TopRight); + lineVtk->GetPointIds()->SetId(3,m_TopLeft); + lineVtk->GetPointIds()->SetId(4,m_BottomLeft); + + lines->InsertNextCell(lineVtk); +} + +void vtkMitkRectangleProp::SetRenderWindow(vtkRenderWindow* renWin) +{ + m_RenderWindow = renWin; +} + +void vtkMitkRectangleProp::SetColor(float col1, float col2, float col3) +{ + m_Color[0] = col1; + m_Color[1] = col2; + m_Color[2] = col3; +} diff --git a/Core/Code/Rendering/vtkMitkRectangleProp.h b/Core/Code/Rendering/vtkMitkRectangleProp.h new file mode 100644 index 0000000000..9adbc71dbe --- /dev/null +++ b/Core/Code/Rendering/vtkMitkRectangleProp.h @@ -0,0 +1,95 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + +#ifndef vtkMitkRectangleProp2_h +#define vtkMitkRectangleProp2_h + +#include + +#include +#include +#include + +class vtkActor2D; +class vtkPolyData; + +/** + * @brief The vtkMitkRectangleProp2 class Renders a rectangle into a renderwindow as a frame. + * + * This class is a replacement for the deprecated vtkMitkRectangleProp, which + * used to render the same effect with pure OpenGL. + */ +class MITK_EXPORT vtkMitkRectangleProp : public vtkProp +{ + public: + static vtkMitkRectangleProp* New(); + vtkTypeMacro(vtkMitkRectangleProp,vtkProp); + + /** + * @brief RenderOverlay Calls the render method of the actor and renders it. + * @param viewport viewport of the renderwindow. + * @return + */ + int RenderOverlay(vtkViewport* viewport); + + /** + * @brief SetRenderWindow Set the renderwindow. + * @param renWin + */ + void SetRenderWindow(vtkRenderWindow* renWin); + + /** + * @brief SetColor Set the color of the rectangle. + * @param col1 red + * @param col2 green + * @param col3 blue + */ + void SetColor(float col1, float col2, float col3); + + protected: + + vtkMitkRectangleProp(); + virtual ~vtkMitkRectangleProp(); + + /** + * @brief m_RenderWindow renderwindow to add the rectangle to. + */ + vtkRenderWindow* m_RenderWindow; + + /** + * @brief m_Color color of thr rectangle. + */ + float m_Color[3]; + + /** + * @brief CreateRectangle internal helper to fill a vtkPolydata with a rectangle. + */ + void CreateRectangle(); + /** + * @brief m_PolyData holds the rectangle. + */ + vtkSmartPointer m_PolyData; + /** + * @brief m_RectangleActor actor to render the rectangle. + */ + vtkSmartPointer m_RectangleActor; + + /** + * @brief IDs of the corner points (the corners of the renderwindow). + */ + vtkIdType m_BottomLeft, m_BottomRight, m_TopRight, m_TopLeft; +}; +#endif /* vtkMitkRectangleProp2_h */ diff --git a/Core/Code/files.cmake b/Core/Code/files.cmake index 0136253940..80d17da680 100644 --- a/Core/Code/files.cmake +++ b/Core/Code/files.cmake @@ -1,420 +1,420 @@ set(H_FILES Algorithms/itkImportMitkImageContainer.h Algorithms/itkImportMitkImageContainer.txx Algorithms/itkMITKScalarImageToHistogramGenerator.h Algorithms/itkMITKScalarImageToHistogramGenerator.txx Algorithms/mitkInstantiateAccessFunctions.h Algorithms/mitkPixelTypeList.h Algorithms/mitkPPArithmeticDec.h Algorithms/mitkPPArgCount.h Algorithms/mitkPPCat.h Algorithms/mitkPPConfig.h Algorithms/mitkPPControlExprIIf.h Algorithms/mitkPPControlIf.h Algorithms/mitkPPControlIIf.h Algorithms/mitkPPDebugError.h Algorithms/mitkPPDetailAutoRec.h Algorithms/mitkPPDetailDMCAutoRec.h Algorithms/mitkPPExpand.h Algorithms/mitkPPFacilitiesEmpty.h Algorithms/mitkPPFacilitiesExpand.h Algorithms/mitkPPLogicalBool.h Algorithms/mitkPPRepetitionDetailDMCFor.h Algorithms/mitkPPRepetitionDetailEDGFor.h Algorithms/mitkPPRepetitionDetailFor.h Algorithms/mitkPPRepetitionDetailMSVCFor.h Algorithms/mitkPPRepetitionFor.h Algorithms/mitkPPSeqElem.h Algorithms/mitkPPSeqForEach.h Algorithms/mitkPPSeqForEachProduct.h Algorithms/mitkPPSeq.h Algorithms/mitkPPSeqEnum.h Algorithms/mitkPPSeqSize.h Algorithms/mitkPPSeqToTuple.h Algorithms/mitkPPStringize.h Algorithms/mitkPPTupleEat.h Algorithms/mitkPPTupleElem.h Algorithms/mitkPPTupleRem.h Algorithms/mitkClippedSurfaceBoundsCalculator.h Algorithms/mitkExtractSliceFilter.h Algorithms/mitkConvert2Dto3DImageFilter.h Algorithms/mitkPlaneClipping.h Common/mitkCommon.h Common/mitkExceptionMacro.h Common/mitkGetClassHierarchy.h DataManagement/mitkProportionalTimeGeometry.h DataManagement/mitkTimeGeometry.h DataManagement/mitkImageAccessByItk.h DataManagement/mitkImageCast.h DataManagement/mitkImagePixelAccessor.h DataManagement/mitkImagePixelReadAccessor.h DataManagement/mitkImagePixelWriteAccessor.h DataManagement/mitkImageReadAccessor.h DataManagement/mitkImageWriteAccessor.h DataManagement/mitkITKImageImport.h DataManagement/mitkITKImageImport.txx DataManagement/mitkImageToItk.h DataManagement/mitkShaderProperty.h DataManagement/mitkImageToItk.txx DataManagement/mitkTimeSlicedGeometry.h # Deprecated, empty for compatibility reasons. DataManagement/mitkPropertyListReplacedObserver.cpp DataManagement/mitkVectorDeprecated.h DataManagement/mitkArray.h DataManagement/mitkQuaternion.h DataManagement/mitkNumericTypes.h DataManagement/mitkVector.h DataManagement/mitkPoint.h DataManagement/mitkMatrix.h Interactions/mitkEventMapperAddOn.h Interfaces/mitkIDataNodeReader.h Interfaces/mitkIFileWriter.h Interfaces/mitkIFileWriter.cpp Interfaces/mitkIFileReader.h Interfaces/mitkIFileReader.cpp Rendering/mitkLocalStorageHandler.h Rendering/Colortables/HotIron.h Rendering/Colortables/Jet.h Rendering/Colortables/PET20.h Rendering/Colortables/PETColor.h IO/mitkPixelTypeTraits.h ) set(CPP_FILES Algorithms/mitkBaseDataSource.cpp Algorithms/mitkCompareImageDataFilter.cpp Algorithms/mitkMultiComponentImageDataComparisonFilter.cpp Algorithms/mitkDataNodeSource.cpp Algorithms/mitkPlaneGeometryDataToSurfaceFilter.cpp Algorithms/mitkHistogramGenerator.cpp Algorithms/mitkImageChannelSelector.cpp Algorithms/mitkImageSliceSelector.cpp Algorithms/mitkImageSource.cpp Algorithms/mitkImageTimeSelector.cpp Algorithms/mitkImageToImageFilter.cpp Algorithms/mitkImageToSurfaceFilter.cpp Algorithms/mitkPointSetSource.cpp Algorithms/mitkPointSetToPointSetFilter.cpp Algorithms/mitkRGBToRGBACastImageFilter.cpp Algorithms/mitkSubImageSelector.cpp Algorithms/mitkSurfaceSource.cpp Algorithms/mitkSurfaceToImageFilter.cpp Algorithms/mitkSurfaceToSurfaceFilter.cpp Algorithms/mitkUIDGenerator.cpp Algorithms/mitkVolumeCalculator.cpp Algorithms/mitkClippedSurfaceBoundsCalculator.cpp Algorithms/mitkExtractSliceFilter.cpp Algorithms/mitkConvert2Dto3DImageFilter.cpp Controllers/mitkBaseController.cpp Controllers/mitkCallbackFromGUIThread.cpp Controllers/mitkCameraController.cpp Controllers/mitkCameraRotationController.cpp Controllers/mitkFocusManager.cpp Controllers/mitkLimitedLinearUndo.cpp Controllers/mitkOperationEvent.cpp Controllers/mitkPlanePositionManager.cpp Controllers/mitkProgressBar.cpp Controllers/mitkRenderingManager.cpp Controllers/mitkSliceNavigationController.cpp Controllers/mitkSlicesCoordinator.cpp Controllers/mitkSlicesRotator.cpp Controllers/mitkSlicesSwiveller.cpp Controllers/mitkStatusBar.cpp Controllers/mitkStepper.cpp Controllers/mitkTestManager.cpp Controllers/mitkUndoController.cpp Controllers/mitkVerboseLimitedLinearUndo.cpp Controllers/mitkVtkInteractorCameraController.cpp Controllers/mitkVtkLayerController.cpp DataManagement/mitkProportionalTimeGeometry.cpp DataManagement/mitkTimeGeometry.cpp DataManagement/mitkAbstractTransformGeometry.cpp DataManagement/mitkAnnotationProperty.cpp DataManagement/mitkApplicationCursor.cpp DataManagement/mitkBaseData.cpp DataManagement/mitkBaseGeometry.cpp DataManagement/mitkBaseProperty.cpp DataManagement/mitkClippingProperty.cpp DataManagement/mitkChannelDescriptor.cpp DataManagement/mitkColorProperty.cpp DataManagement/mitkDataStorage.cpp # DataManagement/mitkDataTree.cpp DataManagement/mitkDataNode.cpp # DataManagement/mitkDataTreeStorage.cpp DataManagement/mitkDisplayGeometry.cpp DataManagement/mitkEnumerationProperty.cpp DataManagement/mitkPlaneGeometryData.cpp DataManagement/mitkGeometry3D.cpp DataManagement/mitkGeometryData.cpp DataManagement/mitkGroupTagProperty.cpp DataManagement/mitkImage.cpp DataManagement/mitkImageAccessorBase.cpp DataManagement/mitkImageCaster.cpp DataManagement/mitkImageCastPart1.cpp DataManagement/mitkImageCastPart2.cpp DataManagement/mitkImageCastPart3.cpp DataManagement/mitkImageCastPart4.cpp DataManagement/mitkImageDataItem.cpp DataManagement/mitkImageDescriptor.cpp DataManagement/mitkImageReadAccessor.cpp DataManagement/mitkImageStatisticsHolder.cpp DataManagement/mitkImageVtkAccessor.cpp DataManagement/mitkImageVtkReadAccessor.cpp DataManagement/mitkImageVtkWriteAccessor.cpp DataManagement/mitkImageWriteAccessor.cpp DataManagement/mitkLandmarkProjectorBasedCurvedGeometry.cpp DataManagement/mitkLandmarkProjector.cpp DataManagement/mitkLine.cpp DataManagement/mitkLevelWindow.cpp DataManagement/mitkLevelWindowManager.cpp DataManagement/mitkLevelWindowPreset.cpp DataManagement/mitkLevelWindowProperty.cpp DataManagement/mitkLookupTable.cpp DataManagement/mitkLookupTableProperty.cpp DataManagement/mitkLookupTables.cpp # specializations of GenericLookupTable DataManagement/mitkMemoryUtilities.cpp DataManagement/mitkModalityProperty.cpp DataManagement/mitkModeOperation.cpp DataManagement/mitkModifiedLock.cpp DataManagement/mitkNodePredicateAnd.cpp DataManagement/mitkNodePredicateBase.cpp DataManagement/mitkNodePredicateCompositeBase.cpp DataManagement/mitkNodePredicateData.cpp DataManagement/mitkNodePredicateDataType.cpp DataManagement/mitkNodePredicateDimension.cpp DataManagement/mitkNodePredicateFirstLevel.cpp DataManagement/mitkNodePredicateNot.cpp DataManagement/mitkNodePredicateOr.cpp DataManagement/mitkNodePredicateProperty.cpp DataManagement/mitkNodePredicateSource.cpp DataManagement/mitkPlaneOrientationProperty.cpp DataManagement/mitkPlaneGeometry.cpp DataManagement/mitkPlaneOperation.cpp DataManagement/mitkPointOperation.cpp DataManagement/mitkPointSet.cpp DataManagement/mitkProperties.cpp DataManagement/mitkPropertyList.cpp DataManagement/mitkPropertyObserver.cpp DataManagement/mitkRestorePlanePositionOperation.cpp DataManagement/mitkApplyTransformMatrixOperation.cpp DataManagement/mitkRotationOperation.cpp DataManagement/mitkSlicedData.cpp DataManagement/mitkSlicedGeometry3D.cpp DataManagement/mitkSmartPointerProperty.cpp DataManagement/mitkStandaloneDataStorage.cpp DataManagement/mitkStateTransitionOperation.cpp DataManagement/mitkStringProperty.cpp DataManagement/mitkSurface.cpp DataManagement/mitkSurfaceOperation.cpp DataManagement/mitkThinPlateSplineCurvedGeometry.cpp DataManagement/mitkTransferFunction.cpp DataManagement/mitkTransferFunctionProperty.cpp DataManagement/mitkTransferFunctionInitializer.cpp DataManagement/mitkVector.cpp DataManagement/mitkNumericConstants.cpp DataManagement/mitkVtkInterpolationProperty.cpp DataManagement/mitkVtkRepresentationProperty.cpp DataManagement/mitkVtkResliceInterpolationProperty.cpp DataManagement/mitkVtkScalarModeProperty.cpp DataManagement/mitkVtkVolumeRenderingProperty.cpp DataManagement/mitkWeakPointerProperty.cpp DataManagement/mitkRenderingModeProperty.cpp DataManagement/mitkResliceMethodProperty.cpp DataManagement/mitkMaterial.cpp DataManagement/mitkPointSetShapeProperty.cpp DataManagement/mitkFloatPropertyExtension.cpp DataManagement/mitkIntPropertyExtension.cpp DataManagement/mitkPropertyExtension.cpp DataManagement/mitkPropertyFilter.cpp DataManagement/mitkPropertyAliases.cpp DataManagement/mitkPropertyDescriptions.cpp DataManagement/mitkPropertyExtensions.cpp DataManagement/mitkPropertyFilters.cpp DataManagement/mitkShaderProperty.cpp Interactions/mitkAction.cpp Interactions/mitkAffineInteractor.cpp Interactions/mitkBindDispatcherInteractor.cpp Interactions/mitkCoordinateSupplier.cpp Interactions/mitkDataInteractor.cpp Interactions/mitkDispatcher.cpp Interactions/mitkDisplayCoordinateOperation.cpp Interactions/mitkDisplayInteractor.cpp Interactions/mitkDisplayPositionEvent.cpp # Interactions/mitkDisplayVectorInteractorLevelWindow.cpp # legacy, prob even now unneeded # Interactions/mitkDisplayVectorInteractorScroll.cpp Interactions/mitkEvent.cpp Interactions/mitkEventConfig.cpp Interactions/mitkEventDescription.cpp Interactions/mitkEventFactory.cpp Interactions/mitkInteractionEventHandler.cpp Interactions/mitkEventMapper.cpp Interactions/mitkEventRecorder.cpp Interactions/mitkEventStateMachine.cpp Interactions/mitkGlobalInteraction.cpp Interactions/mitkInteractor.cpp Interactions/mitkInternalEvent.cpp Interactions/mitkInteractionEvent.cpp Interactions/mitkInteractionEventConst.cpp Interactions/mitkInteractionPositionEvent.cpp Interactions/mitkInteractionKeyEvent.cpp Interactions/mitkMousePressEvent.cpp Interactions/mitkMouseMoveEvent.cpp Interactions/mitkMouseReleaseEvent.cpp Interactions/mitkMouseWheelEvent.cpp Interactions/mitkMouseDoubleClickEvent.cpp Interactions/mitkMouseModeSwitcher.cpp Interactions/mitkMouseMovePointSetInteractor.cpp Interactions/mitkMoveBaseDataInteractor.cpp Interactions/mitkNodeDepententPointSetInteractor.cpp Interactions/mitkPointSetDataInteractor.cpp Interactions/mitkPointSetInteractor.cpp Interactions/mitkPositionEvent.cpp Interactions/mitkPositionTracker.cpp Interactions/mitkSinglePointDataInteractor.cpp Interactions/mitkStateMachineAction.cpp Interactions/mitkStateMachineCondition.cpp Interactions/mitkStateMachineState.cpp Interactions/mitkStateMachineTransition.cpp Interactions/mitkState.cpp Interactions/mitkStateMachineContainer.cpp Interactions/mitkStateEvent.cpp Interactions/mitkStateMachine.cpp Interactions/mitkStateMachineFactory.cpp Interactions/mitkTransition.cpp Interactions/mitkWheelEvent.cpp Interactions/mitkKeyEvent.cpp Interactions/mitkVtkEventAdapter.cpp Interactions/mitkVtkInteractorStyle.cxx Interactions/mitkCrosshairPositionEvent.cpp Interactions/mitkXML2EventParser.cpp Interfaces/mitkIMimeTypeProvider.cpp Interfaces/mitkInteractionEventObserver.cpp Interfaces/mitkIShaderRepository.cpp Interfaces/mitkIPropertyAliases.cpp Interfaces/mitkIPropertyDescriptions.cpp Interfaces/mitkIPropertyExtensions.cpp Interfaces/mitkIPropertyFilters.cpp Interfaces/mitkIPersistenceService.cpp IO/mitkAbstractFileReader.cpp IO/mitkAbstractFileWriter.cpp IO/mitkAbstractFileIO.cpp IO/mitkCustomMimeType.cpp IO/mitkDicomSeriesReader.cpp IO/mitkDicomSR_LoadDICOMScalar.cpp IO/mitkDicomSR_LoadDICOMScalar4D.cpp IO/mitkDicomSR_LoadDICOMRGBPixel.cpp IO/mitkDicomSR_LoadDICOMRGBPixel4D.cpp IO/mitkDicomSR_ImageBlockDescriptor.cpp IO/mitkDicomSR_GantryTiltInformation.cpp IO/mitkDicomSR_SliceGroupingResult.cpp IO/mitkFileReader.cpp IO/mitkFileReaderRegistry.cpp IO/mitkFileReaderSelector.cpp IO/mitkFileWriter.cpp IO/mitkFileWriterRegistry.cpp IO/mitkFileWriterSelector.cpp IO/mitkIFileIO.cpp # IO/mitkIpPicGet.c IO/mitkImageGenerator.cpp IO/mitkIOConstants.cpp IO/mitkIOUtil.cpp IO/mitkIOMimeTypes.cpp IO/mitkItkLoggingAdapter.cpp IO/mitkMimeType.cpp IO/mitkOperation.cpp # IO/mitkPicFileIOFactory.cpp # IO/mitkPicFileReader.cpp # IO/mitkPicFileWriter.cpp # IO/mitkPicHelper.cpp # IO/mitkPicVolumeTimeSeriesIOFactory.cpp # IO/mitkPicVolumeTimeSeriesReader.cpp IO/mitkPixelType.cpp IO/mitkStandardFileLocations.cpp IO/mitkVtkLoggingAdapter.cpp IO/mitkLog.cpp Rendering/mitkBaseRenderer.cpp Rendering/mitkVtkMapper.cpp Rendering/mitkRenderWindowFrame.cpp Rendering/mitkPlaneGeometryDataMapper2D.cpp Rendering/mitkPlaneGeometryDataVtkMapper3D.cpp #Rendering/mitkGLMapper.cpp Moved to deprecated LegacyGL Module Rendering/mitkGradientBackground.cpp Rendering/mitkManufacturerLogo.cpp Rendering/mitkMapper.cpp Rendering/mitkPointSetVtkMapper2D.cpp Rendering/mitkPointSetVtkMapper3D.cpp Rendering/mitkSurfaceVtkMapper2D.cpp #Rendering/mitkSurfaceGLMapper2D.cpp Moved to deprecated LegacyGL Module Rendering/mitkSurfaceVtkMapper3D.cpp Rendering/mitkVolumeDataVtkMapper3D.cpp Rendering/mitkVtkPropRenderer.cpp Rendering/mitkVtkWidgetRendering.cpp -# Rendering/vtkMitkRectangleProp.cpp Moved to deprecated LegacyGL Module + Rendering/vtkMitkRectangleProp.cpp Rendering/vtkMitkRenderProp.cpp Rendering/mitkVtkEventProvider.cpp Rendering/mitkRenderWindow.cpp Rendering/mitkRenderWindowBase.cpp Rendering/mitkImageVtkMapper2D.cpp Rendering/vtkMitkThickSlicesFilter.cpp Rendering/vtkMitkLevelWindowFilter.cpp Rendering/vtkNeverTranslucentTexture.cpp Rendering/mitkOverlay.cpp Rendering/mitkVtkOverlay.cpp Rendering/mitkVtkOverlay2D.cpp Rendering/mitkVtkOverlay3D.cpp Rendering/mitkOverlayManager.cpp Rendering/mitkAbstractOverlayLayouter.cpp Common/mitkException.cpp Common/mitkCoreObjectFactoryBase.cpp Common/mitkCoreObjectFactory.cpp Common/mitkCoreServices.cpp Internal/mitkCoreActivator.cpp Internal/mitkDicomSeriesReaderService.cpp Internal/mitkFileReaderWriterBase.cpp Internal/mitkImageVtkLegacyIO.cpp Internal/mitkImageVtkXmlIO.cpp Internal/mitkItkImageIO.cpp Internal/mitkLegacyFileReaderService.cpp Internal/mitkLegacyFileWriterService.cpp Internal/mitkMimeTypeProvider.cpp Internal/mitkPointSetReaderService.cpp Internal/mitkPointSetWriterService.cpp Internal/mitkRawImageFileReader.cpp Internal/mitkSurfaceStlIO.cpp Internal/mitkSurfaceVtkIO.cpp Internal/mitkSurfaceVtkLegacyIO.cpp Internal/mitkSurfaceVtkXmlIO.cpp ) set(RESOURCE_FILES Interactions/globalConfig.xml Interactions/DisplayInteraction.xml Interactions/DisplayConfig.xml Interactions/DisplayConfigPACS.xml Interactions/DisplayConfigPACSPan.xml Interactions/DisplayConfigPACSScroll.xml Interactions/DisplayConfigPACSZoom.xml Interactions/DisplayConfigPACSLevelWindow.xml Interactions/DisplayConfigMITK.xml Interactions/PointSet.xml Interactions/Legacy/StateMachine.xml Interactions/Legacy/DisplayConfigMITKTools.xml Interactions/PointSetConfig.xml mitkLevelWindowPresets.xml ) diff --git a/Modules/LegacyGL/files.cmake b/Modules/LegacyGL/files.cmake index 4e278881c2..4fc7478a99 100644 --- a/Modules/LegacyGL/files.cmake +++ b/Modules/LegacyGL/files.cmake @@ -1,14 +1,13 @@ #We are deprecated. Please don't use us. set(H_FILES mitkGLMapper2D.h mitkGL.h ) set(CPP_FILES mitkPlaneGeometryDataGLMapper2D.cpp mitkGLMapper.cpp mitkPointSetGLMapper2D.cpp mitkSurfaceGLMapper2D.cpp - vtkMitkRectangleProp.cpp ) diff --git a/Modules/LegacyGL/vtkMitkRectangleProp.cpp b/Modules/LegacyGL/vtkMitkRectangleProp.cpp deleted file mode 100644 index 2dcfce782e..0000000000 --- a/Modules/LegacyGL/vtkMitkRectangleProp.cpp +++ /dev/null @@ -1,129 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - -#include "vtkMitkRectangleProp.h" -#include "vtkObjectFactory.h" - -#include "mitkGL.h" - -vtkStandardNewMacro(vtkMitkRectangleProp); - -vtkMitkRectangleProp::vtkMitkRectangleProp() -{ -} - -vtkMitkRectangleProp::~vtkMitkRectangleProp() -{ -} - -double *vtkMitkRectangleProp::GetBounds() -{ - return NULL; -} - -int vtkMitkRectangleProp::RenderOverlay(vtkViewport* /*viewport*/) -{ - m_RenderWindow->MakeCurrent(); - - Enable2DOpenGL(); - - //make it nicer - glEnable(GL_LINE_SMOOTH); - glHint(GL_LINE_SMOOTH_HINT,GL_NICEST); - glDisable(GL_LINE_STIPPLE); - - //size and position - int * i = m_RenderWindow->GetSize(); - GLdouble bbox[8] = {0.f , 0.f, (double)i[0], 0.f, (double)i[0], (double)i[1], 0.f, (double)i[1]}; - - //render rectangle - glLineWidth(5.0f); - glBegin(GL_LINE_LOOP); - for (int j = 0; j < 4; j++) - { - glColor3f(m_Color[0],m_Color[1],m_Color[2]); - glVertex2dv(&bbox[2*j]); - } - glEnd(); - glLineWidth(1.0f); - - glDisable(GL_LINE_SMOOTH); - - Disable2DOpenGL(); - - return 1; -} - -void vtkMitkRectangleProp::SetRenderWindow(vtkRenderWindow* renWin) -{ - m_RenderWindow = renWin; -} - -void vtkMitkRectangleProp::SetColor(float col1, float col2, float col3) -{ - m_Color[0] = col1; - m_Color[1] = col2; - m_Color[2] = col3; -} - - -int vtkMitkRectangleProp::RenderTranslucentGeometry(vtkViewport* /*viewport*/) -{ - return 0; -} - -int vtkMitkRectangleProp::RenderOpaqueGeometry(vtkViewport* /*viewport*/) -{ - return 0; -} - -void vtkMitkRectangleProp::Enable2DOpenGL() -{ - GLint iViewport[4]; - - // Get a copy of the viewport - glGetIntegerv( GL_VIEWPORT, iViewport ); - - // Save a copy of the projection matrix so that we can restore it - // when it's time to do 3D rendering again. - glMatrixMode( GL_PROJECTION ); - glPushMatrix(); - glLoadIdentity(); - - // Set up the orthographic projection - glOrtho( iViewport[0], iViewport[0]+iViewport[2], - iViewport[1]+iViewport[3], iViewport[1], -1, 1 ); - glMatrixMode( GL_MODELVIEW ); - glPushMatrix(); - glLoadIdentity(); - - // Make sure depth testing and lighting are disabled for 2D rendering until - // we are finished rendering in 2D - glPushAttrib( GL_DEPTH_BUFFER_BIT | GL_LIGHTING_BIT | GL_TEXTURE_2D); - glDisable( GL_DEPTH_TEST ); - glDisable( GL_LIGHTING ); - glDisable( GL_TEXTURE_2D ); -} - -void vtkMitkRectangleProp::Disable2DOpenGL() -{ - glPopAttrib(); - glMatrixMode( GL_PROJECTION ); - glPopMatrix(); - glMatrixMode( GL_MODELVIEW ); - glPopMatrix(); -} - diff --git a/Modules/LegacyGL/vtkMitkRectangleProp.h b/Modules/LegacyGL/vtkMitkRectangleProp.h deleted file mode 100644 index 56644cd42d..0000000000 --- a/Modules/LegacyGL/vtkMitkRectangleProp.h +++ /dev/null @@ -1,56 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - - -#ifndef vtkMitkRectangleProp_H_HEADER_INCLUDED_C1C53723 -#define vtkMitkRectangleProp_H_HEADER_INCLUDED_C1C53723 - -#include "vtkActor2D.h" -#include "vtkRenderWindow.h" -#include - -class MitkLegacyGL_EXPORT vtkMitkRectangleProp : public vtkProp -{ - public: - static vtkMitkRectangleProp* New(); - vtkTypeMacro(vtkMitkRectangleProp,vtkProp); - - int RenderOpaqueGeometry(vtkViewport* viewport); - int RenderTranslucentGeometry(vtkViewport* viewport); - int RenderOverlay(vtkViewport* viewport); - - void SetRenderWindow(vtkRenderWindow* renWin); - - void SetColor(float col1, float col2, float col3); - - double* GetBounds(); - - protected: - - vtkMitkRectangleProp(); - virtual ~vtkMitkRectangleProp(); - - void Enable2DOpenGL(); - void Disable2DOpenGL(); - - vtkRenderWindow* m_RenderWindow; - float m_Color[3]; -}; - - -#endif /* vtkMitkRectangleProp_H_HEADER_INCLUDED_C1C53723 */ - -