Index: mitk/Core/Algorithms/mitkManualSegmentationToSurfaceFilter.cpp =================================================================== --- mitk/Core/Algorithms/mitkManualSegmentationToSurfaceFilter.cpp (revision 14912) +++ mitk/Core/Algorithms/mitkManualSegmentationToSurfaceFilter.cpp (working copy) @@ -17,6 +17,7 @@ #include +#include mitk::ManualSegmentationToSurfaceFilter::ManualSegmentationToSurfaceFilter() { @@ -49,11 +50,8 @@ for( int t=tstart; tGetVtkImageData(t); + vtkSmartPointer vtkimage = image->GetVtkImageData(t); - //Inkrement Referenzcounter Counter (hier: RC) - vtkimage->Register(NULL); - // Median -->smooth 3D if(m_MedianFilter3D) { @@ -63,9 +61,7 @@ median->ReleaseDataFlagOn(); median->UpdateInformation(); median->Update(); - vtkimage->Delete(); //->Input vtkimage = median->GetOutput(); //->Out - vtkimage->Register(NULL); median->Delete(); } @@ -81,9 +77,7 @@ imageresample->SetAxisOutputSpacing(2, m_MedianKernelSizeZ); imageresample->UpdateInformation(); imageresample->Update(); - vtkimage->Delete(); //->Input vtkimage=imageresample->GetOutput();//->Output - vtkimage->Register(NULL); imageresample->Delete(); } @@ -101,15 +95,14 @@ vtkImageGaussianSmooth *gaussian = vtkImageGaussianSmooth::New(); gaussian->SetInput(vtkimagethreshold->GetOutput()); + vtkimagethreshold->Delete(); gaussian->SetDimensionality(3); gaussian->SetRadiusFactor(0.49); gaussian->SetStandardDeviation( m_GaussianStandardDeviation ); gaussian->ReleaseDataFlagOn(); gaussian->UpdateInformation(); gaussian->Update(); - vtkimage->Delete();//->Input vtkimage = gaussian->GetOutput(); //->Out - gaussian->Register(NULL); gaussian->Delete(); } Index: mitk/Core/Controllers/mitkSlicesRotator.cpp =================================================================== --- mitk/Core/Controllers/mitkSlicesRotator.cpp (revision 14912) +++ mitk/Core/Controllers/mitkSlicesRotator.cpp (working copy) @@ -48,12 +48,7 @@ SlicesRotator::Pointer SlicesRotator::New() { - // from itkNewMacro() - Pointer smartPtr; - SlicesRotator* rawPtr = new SlicesRotator("slices-rotator"); - smartPtr = rawPtr; - rawPtr->UnRegister(); - return smartPtr; + return SlicesRotator::New("slices-rotator"); } SlicesRotator::SlicesRotator(const char* machine) Index: mitk/Core/Controllers/mitkSlicesRotator.h =================================================================== --- mitk/Core/Controllers/mitkSlicesRotator.h (revision 14912) +++ mitk/Core/Controllers/mitkSlicesRotator.h (working copy) @@ -66,11 +66,13 @@ mitkClassMacro(SlicesRotator, SlicesCoordinator); - /// @TODO FIX StateMachine smart pointer handling (or learn about the reason) static Pointer New(); - /// @TODO public ONLY because of StateMachine's meddling with m_ReferenceCount - SlicesRotator(const char* machine); + /** + * @brief New Macro with one parameter for creating this object with static New(..) method + **/ + mitkNewMacro1Param(Self, const char*); + virtual void SetGeometry(const itk::EventObject& EventObject); virtual void RotateToPoint( SliceNavigationController *rotationPlaneSNC, @@ -79,6 +81,7 @@ protected: + SlicesRotator(const char* machine); // clear list of controllers virtual ~SlicesRotator(); Index: mitk/Core/Controllers/mitkSlicesSwiveller.cpp =================================================================== --- mitk/Core/Controllers/mitkSlicesSwiveller.cpp (revision 14912) +++ mitk/Core/Controllers/mitkSlicesSwiveller.cpp (working copy) @@ -47,12 +47,7 @@ SlicesSwiveller::Pointer SlicesSwiveller::New() { - // from itkNewMacro() - Pointer smartPtr; - SlicesSwiveller* rawPtr = new SlicesSwiveller("slices-rotator"); - smartPtr = rawPtr; - rawPtr->UnRegister(); - return smartPtr; + return SlicesSwiveller::New("slices-rotator"); } SlicesSwiveller::SlicesSwiveller(const char* machine) Index: mitk/Core/Controllers/mitkSlicesSwiveller.h =================================================================== --- mitk/Core/Controllers/mitkSlicesSwiveller.h (revision 14912) +++ mitk/Core/Controllers/mitkSlicesSwiveller.h (working copy) @@ -67,14 +67,16 @@ mitkClassMacro(SlicesSwiveller, SlicesCoordinator); - /// @TODO FIX StateMachine smart pointer handling (or learn about the reason) static Pointer New(); - /// @TODO public ONLY because of StateMachine's meddling with m_ReferenceCount - SlicesSwiveller(const char* machine); + /** + * @brief New Macro with one parameter for creating this object with static New(..) method + **/ + mitkNewMacro1Param(Self, const char*); virtual void SetGeometry(const itk::EventObject& EventObject); protected: + SlicesSwiveller(const char* machine); // clear list of controllers virtual ~SlicesSwiveller(); Index: mitk/Core/Controllers/mitkUndoController.cpp =================================================================== --- mitk/Core/Controllers/mitkUndoController.cpp (revision 14912) +++ mitk/Core/Controllers/mitkUndoController.cpp (working copy) @@ -58,6 +58,18 @@ } } +mitk::UndoController::~UndoController() +{ + // sth like the following has to be done here + //UndoModelMapIter undoModelIter = m_UndoModelList.begin(); + //while(undoModelIter != m_UndoModelList.end()) + //{ + // delete (*undoModelIter).second; + // ++undoModelIter; + //} + //m_UndoModelList.clear(); +} + bool mitk::UndoController::SetOperationEvent(UndoStackItem* operationEvent) { m_CurUndoModel->SetOperationEvent(operationEvent); Index: mitk/Core/Controllers/mitkUndoController.h =================================================================== --- mitk/Core/Controllers/mitkUndoController.h (revision 14912) +++ mitk/Core/Controllers/mitkUndoController.h (working copy) @@ -42,6 +42,7 @@ //## Constructor; Adds the new UndoType or if undoType exists , //## switches it to undoType; for UndoTypes see definitionmitkInteractionConst.h UndoController(UndoType undoType = DEFAULTUNDOMODEL); + virtual ~UndoController(); bool SetOperationEvent(UndoStackItem* operationEvent); Index: mitk/Core/DataStructures/itkVtkAbstractTransform.txx =================================================================== --- mitk/Core/DataStructures/itkVtkAbstractTransform.txx (revision 14912) +++ mitk/Core/DataStructures/itkVtkAbstractTransform.txx (working copy) @@ -16,6 +16,8 @@ template itk::VtkAbstractTransform::~VtkAbstractTransform() { + if(m_VtkAbstractTransform!=NULL) + m_VtkAbstractTransform->UnRegister(NULL); } template @@ -39,15 +41,11 @@ if(m_VtkAbstractTransform!=NULL) m_VtkAbstractTransform->UnRegister(NULL); - if(m_InverseVtkAbstractTransform!=NULL) - m_InverseVtkAbstractTransform->UnRegister(NULL); - m_VtkAbstractTransform=aVtkAbstractTransform; if(m_VtkAbstractTransform!=NULL) { m_VtkAbstractTransform->Register(NULL); - m_InverseVtkAbstractTransform=m_VtkAbstractTransform->GetInverse(); - m_InverseVtkAbstractTransform->Register(NULL); + m_InverseVtkAbstractTransform=m_VtkAbstractTransform->GetInverse(); // memory managed by m_VtkAbstractTransform } m_LastVtkAbstractTransformTimeStamp = m_VtkAbstractTransform->GetMTime(); Index: mitk/Core/DataStructures/mitkDataTreeNode.cpp =================================================================== --- mitk/Core/DataStructures/mitkDataTreeNode.cpp (revision 14912) +++ mitk/Core/DataStructures/mitkDataTreeNode.cpp (working copy) @@ -104,10 +104,12 @@ { Interactor* interactor = this->GetInteractor(); - if ( interactor ) + if ( ( interactor ) && ( mitk::GlobalInteraction::HasInstance() ) ) { mitk::GlobalInteraction::GetInstance()->RemoveInteractor( interactor ); } + m_Mappers.clear(); + m_Data = NULL; } //##ModelId=3E33F5D7032D Index: mitk/Core/DataStructures/mitkLevelWindowPreset.cpp =================================================================== --- mitk/Core/DataStructures/mitkLevelWindowPreset.cpp (revision 14912) +++ mitk/Core/DataStructures/mitkLevelWindowPreset.cpp (working copy) @@ -17,11 +17,14 @@ #include "mitkLevelWindowPreset.h" #include "mitkStandardFileLocations.h" +#include namespace mitk { - const std::string LevelWindowPreset::PRESET = "preset"; +const std::string LevelWindowPreset::PRESET = "preset"; +vtkStandardNewMacro(LevelWindowPreset); + LevelWindowPreset::LevelWindowPreset() { } @@ -142,4 +145,5 @@ m_Window = newWindow; save(); } + } Index: mitk/Core/DataStructures/mitkLevelWindowPreset.h =================================================================== --- mitk/Core/DataStructures/mitkLevelWindowPreset.h (revision 14912) +++ mitk/Core/DataStructures/mitkLevelWindowPreset.h (working copy) @@ -25,38 +25,39 @@ namespace mitk { - class MITK_CORE_EXPORT LevelWindowPreset : public vtkXMLParser - { - public: - LevelWindowPreset(); - ~LevelWindowPreset(); +class MITK_CORE_EXPORT LevelWindowPreset : public vtkXMLParser +{ +public: + static LevelWindowPreset *New(); + vtkTypeMacro(LevelWindowPreset,vtkXMLParser); - bool LoadPreset(); - bool LoadPreset(std::string fileName); - double getLevel(std::string name); - double getWindow(std::string window); - std::map& getLevelPresets(); - std::map& getWindowPresets(); - void newPresets(std::map newLevel, std::map newWindow); - + bool LoadPreset(); + bool LoadPreset(std::string fileName); + double getLevel(std::string name); + double getWindow(std::string window); + std::map& getLevelPresets(); + std::map& getWindowPresets(); + void newPresets(std::map newLevel, std::map newWindow); +protected: + LevelWindowPreset(); + ~LevelWindowPreset(); - private: +private: + //##Documentation + //## @brief method used in XLM-Reading; gets called when a start-tag is read + void StartElement (const char *elementName, const char **atts); - //##Documentation - //## @brief method used in XLM-Reading; gets called when a start-tag is read - void StartElement (const char *elementName, const char **atts); - - void saveXML(mitk::XMLWriter& xmlWriter); - void save(); + void saveXML(mitk::XMLWriter& xmlWriter); + void save(); - //##Documentation - //## @brief reads an XML-String-Attribute - std::string ReadXMLStringAttribut( std::string name, const char** atts); + //##Documentation + //## @brief reads an XML-String-Attribute + std::string ReadXMLStringAttribut( std::string name, const char** atts); - static const std::string PRESET; - std::map m_Level; - std::map m_Window; - std::string m_XmlFileName; - }; + static const std::string PRESET; + std::map m_Level; + std::map m_Window; + std::string m_XmlFileName; +}; } #endif Index: mitk/Core/DataStructures/mitkThinPlateSplineCurvedGeometry.cpp =================================================================== --- mitk/Core/DataStructures/mitkThinPlateSplineCurvedGeometry.cpp (revision 14912) +++ mitk/Core/DataStructures/mitkThinPlateSplineCurvedGeometry.cpp (working copy) @@ -31,6 +31,14 @@ mitk::ThinPlateSplineCurvedGeometry::~ThinPlateSplineCurvedGeometry() { + // don't need to delete m_ThinPlateSplineTransform, because it is + // the same as m_InterpolatingAbstractTransform, which will be deleted + // by the superclass. + + if(m_VtkTargetLandmarks!=NULL) + m_VtkTargetLandmarks->Delete(); + if(m_VtkProjectedLandmarks!=NULL) + m_VtkProjectedLandmarks->Delete(); } bool mitk::ThinPlateSplineCurvedGeometry::IsValid() const Index: mitk/Core/DataStructures/mitkTransferFunctionProperty.h =================================================================== --- mitk/Core/DataStructures/mitkTransferFunctionProperty.h (revision 14912) +++ mitk/Core/DataStructures/mitkTransferFunctionProperty.h (working copy) @@ -83,6 +83,10 @@ : BaseProperty() {}; + virtual ~TransferFunctionProperty() + { + }; + TransferFunctionProperty( mitk::TransferFunction::Pointer value ) : BaseProperty(), m_Value( value ) {}; Index: mitk/Core/Interactions/mitkCoordinateSupplier.cpp =================================================================== --- mitk/Core/Interactions/mitkCoordinateSupplier.cpp (revision 14912) +++ mitk/Core/Interactions/mitkCoordinateSupplier.cpp (working copy) @@ -31,14 +31,17 @@ #include "mitkAction.h" -//##ModelId=3F0189F0025B mitk::CoordinateSupplier::CoordinateSupplier(const char * type, mitk::OperationActor* operationActor) : mitk::StateMachine(type), m_Destination(operationActor) { m_CurrentPoint.Fill(0); } -//##ModelId=3F0189F00269 +mitk::CoordinateSupplier::~CoordinateSupplier() +{ + +} + bool mitk::CoordinateSupplier::ExecuteAction(Action* action, mitk::StateEvent const* stateEvent) { bool ok = false; Index: mitk/Core/Interactions/mitkCoordinateSupplier.h =================================================================== --- mitk/Core/Interactions/mitkCoordinateSupplier.h (revision 14912) +++ mitk/Core/Interactions/mitkCoordinateSupplier.h (working copy) @@ -49,6 +49,8 @@ //## @param operationActor: the Data, operations (+ points) are send to CoordinateSupplier(const char * type, OperationActor* operationActor); + ~CoordinateSupplier(); + //##Documentation //## @brief executes the actions that are sent to this statemachine //## derived from StateMachine Index: mitk/Core/Interactions/mitkEventMapper.cpp =================================================================== --- mitk/Core/Interactions/mitkEventMapper.cpp (revision 14912) +++ mitk/Core/Interactions/mitkEventMapper.cpp (working copy) @@ -44,6 +44,12 @@ #include #include "mitkCoreObjectFactory.h" +#include +namespace mitk +{ +vtkStandardNewMacro(EventMapper); +} + #ifdef MBI_INTERNAL_CONFERENCE #include #include @@ -554,7 +560,7 @@ if ( fileName.empty() ) return false; - mitk::EventMapper* eventMapper = new EventMapper(); + mitk::EventMapper* eventMapper = EventMapper::New(); eventMapper->SetFileName( fileName.c_str() ); if ( ! eventMapper->Parse() ) Index: mitk/Core/Interactions/mitkEventMapper.h =================================================================== --- mitk/Core/Interactions/mitkEventMapper.h (revision 14912) +++ mitk/Core/Interactions/mitkEventMapper.h (working copy) @@ -60,10 +60,8 @@ class MITK_CORE_EXPORT EventMapper : public vtkXMLParser { public: - //##ModelId=3F02F896006D - EventMapper(); - //##ModelId=3F02F896008C - ~EventMapper(); + static EventMapper *New(); + vtkTypeMacro(EventMapper,vtkXMLParser); //##ModelId=3F0177080269 typedef std::vector EventDescriptionVec; @@ -124,6 +122,9 @@ friend class mitk::GlobalInteraction; protected: + EventMapper(); + ~EventMapper(); + //##Documentation //##@brief method only for GlobalInteraction to change the Event (from DiplayPositionEvent to PositionEvent) static void SetStateEvent(Event* event); Index: mitk/Core/Interactions/mitkGlobalInteraction.cpp =================================================================== --- mitk/Core/Interactions/mitkGlobalInteraction.cpp (revision 14912) +++ mitk/Core/Interactions/mitkGlobalInteraction.cpp (working copy) @@ -349,6 +349,11 @@ return s_GlobalInteraction.GetPointer(); } +bool mitk::GlobalInteraction::HasInstance() +{ + return s_GlobalInteraction.IsNotNull(); +} + bool mitk::GlobalInteraction::AddToSelectedInteractors(mitk::Interactor* interactor) { InteractorListIter position = std::find(m_SelectedList.begin(), m_SelectedList.end(),interactor); Index: mitk/Core/Interactions/mitkGlobalInteraction.h =================================================================== --- mitk/Core/Interactions/mitkGlobalInteraction.h (revision 14912) +++ mitk/Core/Interactions/mitkGlobalInteraction.h (working copy) @@ -135,8 +135,15 @@ static bool StandardInteractionSetup(const char * XMLbehaviorFile = NULL, const char * globalInteractionName = NULL); + //##Documentation + //## @brief Returns the global (singleton) instance of + //## GlobalInteraction. Create it, if it does not exist. static GlobalInteraction* GetInstance(); + //##Documentation + //## @brief Returns whether an instance exists + static bool HasInstance(); + //so that the interactors can call AddToSelectedInteractors() and RemoveFromSelectedInteractors() friend class Interactor; Index: mitk/Core/Interactions/mitkStateMachineFactory.cpp =================================================================== --- mitk/Core/Interactions/mitkStateMachineFactory.cpp (revision 14912) +++ mitk/Core/Interactions/mitkStateMachineFactory.cpp (working copy) @@ -55,6 +55,12 @@ const std::string mitk::StateMachineFactory::STRING_PARAMETER = "stringParameter"; const std::string mitk::StateMachineFactory::VALUE = "VALUE"; +#include +namespace mitk +{ +vtkStandardNewMacro(StateMachineFactory); +} + mitk::StateMachineFactory::StateMachineFactory() : m_AktStateMachineName("") {} @@ -97,7 +103,7 @@ s_LastLoadedBehavior = fileName; //call a new instance of this class and let it build up static containers - mitk::StateMachineFactory* stateMachineFactory = new StateMachineFactory(); + mitk::StateMachineFactory* stateMachineFactory = StateMachineFactory::New(); stateMachineFactory->SetFileName( fileName.c_str() ); InteractionDebug::SetXMLFileName( "StateMachine.xml" ); Index: mitk/Core/Interactions/mitkStateMachineFactory.h =================================================================== --- mitk/Core/Interactions/mitkStateMachineFactory.h (revision 14912) +++ mitk/Core/Interactions/mitkStateMachineFactory.h (working copy) @@ -43,6 +43,9 @@ class MITK_CORE_EXPORT StateMachineFactory : public vtkXMLParser { public: + static StateMachineFactory *New(); + vtkTypeMacro(StateMachineFactory,vtkXMLParser); + /** * @brief Typedef for all states that are defined as start-states **/ @@ -66,16 +69,6 @@ typedef std::map AllStateMachineMapType; /** - * @brief Default Constructor - **/ - StateMachineFactory(); - - /** - * @brief Default Destructor - **/ - ~StateMachineFactory(); - - /** * @brief Returns the StartState of the StateMachine with the name type; * * Returns NULL if no entry with name type is found. @@ -119,6 +112,17 @@ **/ friend class StateMachine; + protected: + /** + * @brief Default Constructor + **/ + StateMachineFactory(); + + /** + * @brief Default Destructor + **/ + ~StateMachineFactory(); + private: /** * @brief Derived from XMLReader Index: mitk/Core/IO/mitkPointSetReader.cpp =================================================================== --- mitk/Core/IO/mitkPointSetReader.cpp (revision 14912) +++ mitk/Core/IO/mitkPointSetReader.cpp (working copy) @@ -53,7 +53,7 @@ } in.close(); - mitk::vtkPointSetXMLParser* parser = new mitk::vtkPointSetXMLParser(); + mitk::vtkPointSetXMLParser* parser = mitk::vtkPointSetXMLParser::New(); parser->SetFileName( m_FileName.c_str() ); if ( parser->Parse() == 0 ) //Parse returns zero as error indicator { Index: mitk/Core/IO/vtkPointSetXMLParser.cpp =================================================================== --- mitk/Core/IO/vtkPointSetXMLParser.cpp (revision 14912) +++ mitk/Core/IO/vtkPointSetXMLParser.cpp (working copy) @@ -1,12 +1,24 @@ #include "vtkPointSetXMLParser.h" +#include "vtkObjectFactory.h" #include "mitkPointSetWriter.h" #include "mitkOperation.h" #include "mitkInteractionConst.h" #include "mitkPointOperation.h" +namespace mitk +{ +vtkStandardNewMacro(vtkPointSetXMLParser); +} +mitk::vtkPointSetXMLParser::vtkPointSetXMLParser() +{ +} +mitk::vtkPointSetXMLParser::~vtkPointSetXMLParser() +{ +} + void mitk::vtkPointSetXMLParser::StartElement ( const char *name, const char ** /*atts */) { std::string currentElement = name; Index: mitk/Core/IO/vtkPointSetXMLParser.h =================================================================== --- mitk/Core/IO/vtkPointSetXMLParser.h (revision 14912) +++ mitk/Core/IO/vtkPointSetXMLParser.h (working copy) @@ -22,6 +22,10 @@ class MITK_CORE_EXPORT vtkPointSetXMLParser : public vtkXMLParser { public: + vtkTypeMacro(vtkPointSetXMLParser,vtkXMLParser); + + static vtkPointSetXMLParser* New(); + typedef mitk::PointSet PointSetType; typedef std::stack< std::string > ParseStack; @@ -69,6 +73,8 @@ virtual PointSetList GetParsedPointSets(); protected: + vtkPointSetXMLParser(); + virtual ~vtkPointSetXMLParser(); /** * A stack containing the parsed start-tags. Index: mitk/Core/Rendering/mitkColoredRectangleRendering.cpp =================================================================== --- mitk/Core/Rendering/mitkColoredRectangleRendering.cpp (revision 14912) +++ mitk/Core/Rendering/mitkColoredRectangleRendering.cpp (working copy) @@ -92,7 +92,9 @@ rect->SetColor(col1, col2, col3); m_RectangleRenderer->AddViewProp(rect); - + + rect->Delete(); + if(!mitk::VtkLayerController::GetInstance(m_RenderWindow)->IsRendererInserted( m_RectangleRenderer )) { #if ( VTK_MAJOR_VERSION >= 5 ) Index: mitk/Core/Rendering/mitkGeometry2DDataVtkMapper3D.cpp =================================================================== --- mitk/Core/Rendering/mitkGeometry2DDataVtkMapper3D.cpp (revision 14912) +++ mitk/Core/Rendering/mitkGeometry2DDataVtkMapper3D.cpp (working copy) @@ -156,6 +156,16 @@ // Delete entries in m_ImageActors list one by one m_ImageActors.clear(); + + LookupTablePropertiesList::iterator it; + for(it = m_LookupTableProperties.begin(); it != m_LookupTableProperties.end();++it) + { + if ( it->second.LookupTableSource != NULL ) + { + it->second.LookupTableSource->Delete(); + it->second.LookupTableSource = NULL; + } + } } @@ -791,6 +801,3 @@ } } // namespace mitk - - - Index: mitk/Core/Rendering/mitkGradientBackground.cpp =================================================================== --- mitk/Core/Rendering/mitkGradientBackground.cpp (revision 14912) +++ mitk/Core/Rendering/mitkGradientBackground.cpp (working copy) @@ -68,6 +68,10 @@ m_Plane->SetPolys( cellArray ); m_Plane->GetPointData()->SetScalars( data ); + points->Delete(); + cellArray->Delete(); + data->Delete(); + m_Lut->SetNumberOfColors( 2 ); m_Lut->Build(); m_Lut->SetTableValue( m_Lut->GetIndex(0), 1, 1, 1 ); Index: mitk/Core/Rendering/mitkLogoRendering.cpp =================================================================== --- mitk/Core/Rendering/mitkLogoRendering.cpp (revision 14912) +++ mitk/Core/Rendering/mitkLogoRendering.cpp (working copy) @@ -188,7 +188,7 @@ *dest++ = a; } - m_VtkImageImport->SetImportVoidPointer(m_ImageData); + m_VtkImageImport->SetImportVoidPointer(m_ImageData, 0 /*delete on destruct*/); m_VtkImageImport->Modified(); m_VtkImageImport->Update(); Index: mitk/Core/Rendering/mitkPointSetVtkMapper3D.cpp =================================================================== --- mitk/Core/Rendering/mitkPointSetVtkMapper3D.cpp (revision 14912) +++ mitk/Core/Rendering/mitkPointSetVtkMapper3D.cpp (working copy) @@ -80,7 +80,7 @@ { m_PointsAssembly->Delete(); - //m_SelectedActor->Delete(); //leads to an exeption + m_SelectedActor->Delete(); m_UnselectedActor->Delete(); m_ContourActor->Delete(); } Index: mitk/Core/Rendering/mitkVolumeDataVtkMapper3D.cpp =================================================================== --- mitk/Core/Rendering/mitkVolumeDataVtkMapper3D.cpp (revision 14912) +++ mitk/Core/Rendering/mitkVolumeDataVtkMapper3D.cpp (working copy) @@ -131,6 +131,8 @@ // BoundingBox rendering is not working due to problem with assembly // transformation; see bug #454 + // If commenting in the following, do not forget to comment in the + // m_Prop3DAssembly->Delete() line in the destructor. //m_Prop3DAssembly = vtkAssembly::New(); //m_Prop3DAssembly->AddPart( m_VolumeLOD ); //m_Prop3DAssembly->AddPart( m_BoundingBoxActor ); @@ -182,7 +184,18 @@ m_VolumeLOD->Delete(); m_ClippingPlane->Delete(); m_PlaneWidget->Delete(); + // m_Prop3DAssembly->Delete(); + m_BoundingBox->Delete(); + m_BoundingBoxMapper->Delete(); + m_BoundingBoxActor->Delete(); m_ImageMaskFilter->Delete(); + m_DummyProp->Delete(); + m_DefaultColorTransferFunction->Delete(); + m_DefaultOpacityTransferFunction->Delete(); + m_DefaultGradientTransferFunction->Delete(); + m_AbortCallbackCommand->Delete(); + m_StartCallbackCommand->Delete(); + m_EndCallbackCommand->Delete(); if (m_Mask) { Index: mitk/Core/Rendering/vtkMitkRectangleProp.h =================================================================== --- mitk/Core/Rendering/vtkMitkRectangleProp.h (revision 14912) +++ mitk/Core/Rendering/vtkMitkRectangleProp.h (working copy) @@ -27,8 +27,8 @@ class MITK_CORE_EXPORT vtkMitkRectangleProp : public vtkProp { public: - static vtkMitkRectangleProp* New(); + vtkTypeMacro(vtkMitkRectangleProp,vtkProp); int RenderOpaqueGeometry(vtkViewport* viewport); int RenderTranslucentGeometry(vtkViewport* viewport); Index: mitk/Core/Rendering/vtkMitkRenderProp.h =================================================================== --- mitk/Core/Rendering/vtkMitkRenderProp.h (revision 14912) +++ mitk/Core/Rendering/vtkMitkRenderProp.h (working copy) @@ -38,8 +38,8 @@ class MITK_CORE_EXPORT vtkMitkRenderProp : public vtkProp { public: - static vtkMitkRenderProp *New(); + vtkTypeMacro(vtkMitkRenderProp,vtkProp); void SetPropRenderer(mitk::VtkPropRenderer::Pointer propRenderer); Index: mitk/QApplications/Tutorial/Step6.cpp =================================================================== --- mitk/QApplications/Tutorial/Step6.cpp (revision 14912) +++ mitk/QApplications/Tutorial/Step6.cpp (working copy) @@ -106,9 +106,6 @@ // Part I: Basic initialization //************************************************************************* - // Create a tree - m_Tree=mitk::DataTree::New(); - // Create an iterator on the tree mitk::DataTreePreOrderIterator it(m_Tree); Index: mitk/Qmitk/QmitkApplicationBase/QmitkMainTemplate.ui =================================================================== --- mitk/Qmitk/QmitkApplicationBase/QmitkMainTemplate.ui (revision 14912) +++ mitk/Qmitk/QmitkApplicationBase/QmitkMainTemplate.ui (working copy) @@ -1327,6 +1327,7 @@ class QmitkSimpleExampleFunctionality class QmitkStdMultiWidget class QmitkSelectableGLWidget + class posOutputType bool m_InOptionsUpdate; @@ -1343,6 +1344,7 @@ mitk::UndoController* m_UndoController; static QmitkMainTemplate* m_Instance; QPalette m_StandardPalette; + posOutputType* m_PosOutput; ShowWidgetPlanesToggled(bool) Index: mitk/Qmitk/QmitkApplicationBase/QmitkMainTemplate.ui.h =================================================================== --- mitk/Qmitk/QmitkApplicationBase/QmitkMainTemplate.ui.h (revision 14912) +++ mitk/Qmitk/QmitkApplicationBase/QmitkMainTemplate.ui.h (working copy) @@ -724,6 +724,7 @@ m_StandardPalette = QApplication::palette(); m_FirstFileOpen = true; m_NoMITKOptions = false; + m_PosOutput = NULL; //creating a QmitkStatusBar for Output on the QStatusBar and connecting it with the MainStatusBar QmitkStatusBar *statusBar = new QmitkStatusBar(this->statusBar()); @@ -807,9 +808,9 @@ //could the behavior file be found? if ( smLoadOK ) { - posOutputType* posOutput = new posOutputType(&it); + m_PosOutput = new posOutputType(&it); - mitk::GlobalInteraction::GetInstance()->AddListener(mitk::CoordinateSupplier::New("navigation", posOutput)); //sends PointOperations + mitk::GlobalInteraction::GetInstance()->AddListener(mitk::CoordinateSupplier::New("navigation", m_PosOutput)); //sends PointOperations } else { @@ -1284,6 +1285,8 @@ delete m_SceneWidget; #endif + delete m_PosOutput; + m_Tree = NULL; } Index: mitk/Qmitk/QmitkLevelWindowWidgetContextMenu.cpp =================================================================== --- mitk/Qmitk/QmitkLevelWindowWidgetContextMenu.cpp (revision 14912) +++ mitk/Qmitk/QmitkLevelWindowWidgetContextMenu.cpp (working copy) @@ -24,7 +24,7 @@ QmitkLevelWindowWidgetContextMenu::QmitkLevelWindowWidgetContextMenu(QWidget * parent, const char * name, WFlags f ) : QWidget( parent, name, f ) { - m_LevelWindowPreset = new mitk::LevelWindowPreset(); + m_LevelWindowPreset = mitk::LevelWindowPreset::New(); m_LevelWindowPreset->LoadPreset(); } Index: mitk/Qmitk/QmitkStdMultiWidget.ui =================================================================== --- mitk/Qmitk/QmitkStdMultiWidget.ui (revision 14912) +++ mitk/Qmitk/QmitkStdMultiWidget.ui (working copy) @@ -191,8 +191,8 @@ mitk::PositionTracker::Pointer m_PositionTracker; mitk::DataTreeNode::Pointer m_PositionTrackerNode; mitk::DataTreeBase::Pointer m_Tree; - mitk::SlicesRotator *m_SlicesRotator; - mitk::SlicesSwiveller *m_SlicesSwiveller; + mitk::SlicesRotator::Pointer m_SlicesRotator; + mitk::SlicesSwiveller::Pointer m_SlicesSwiveller; mitk::GradientBackground::Pointer m_GradientBackground1; mitk::GradientBackground::Pointer m_GradientBackground2; mitk::LogoRendering::Pointer m_LogoRendering1; Index: mitk/Qmitk/QmitkStdMultiWidget.ui.h =================================================================== --- mitk/Qmitk/QmitkStdMultiWidget.ui.h (revision 14912) +++ mitk/Qmitk/QmitkStdMultiWidget.ui.h (working copy) @@ -98,7 +98,7 @@ // m_SlicesRotator = mitk::SlicesRotator::New(); // @TODO next line causes sure memory leak // rotator will be created nonetheless (will be switched on and off) - m_SlicesRotator = new mitk::SlicesRotator("slices-rotator"); + m_SlicesRotator = mitk::SlicesRotator::New("slices-rotator"); m_SlicesRotator->AddSliceController( mitkWidget1->GetSliceNavigationController() ); m_SlicesRotator->AddSliceController( @@ -107,7 +107,7 @@ mitkWidget3->GetSliceNavigationController() ); // create a slice swiveller (using the same state-machine as SlicesRotator) - m_SlicesSwiveller = new mitk::SlicesSwiveller("slices-rotator"); + m_SlicesSwiveller = mitk::SlicesSwiveller::New("slices-rotator"); m_SlicesSwiveller->AddSliceController( mitkWidget1->GetSliceNavigationController() ); m_SlicesSwiveller->AddSliceController( Index: mitk/Testing/mitkManualSegmentationToSurfaceFilterTest.cpp =================================================================== --- mitk/Testing/mitkManualSegmentationToSurfaceFilterTest.cpp (revision 14912) +++ mitk/Testing/mitkManualSegmentationToSurfaceFilterTest.cpp (working copy) @@ -52,7 +52,7 @@ mitk::DataTreeNodeFactory::Pointer factory = mitk::DataTreeNodeFactory::New(); try { - std::cout << "Loading file: "; + std::cout << "Loading file: "<SetFileName( fileIn.c_str() ); factory->Update(); Index: mitk/Testing/mitkStateMachineFactoryTest.cpp =================================================================== --- mitk/Testing/mitkStateMachineFactoryTest.cpp (revision 14912) +++ mitk/Testing/mitkStateMachineFactoryTest.cpp (working copy) @@ -23,7 +23,7 @@ int mitkStateMachineFactoryTest(int /*argc*/, char* /*argv*/[]) { //create statemachinefactory - mitk::StateMachineFactory* statemachineFactory = new mitk::StateMachineFactory(); + mitk::StateMachineFactory* statemachineFactory = mitk::StateMachineFactory::New(); //load standard behavior std::cout << "Testing LoadStandardBehavior(): ";