#ifndef GEOM_SMARTPTR_H #define GEOM_SMARTPTR_H #include template class GEOM_SmartPtr: public vtkSmartPointer { public: GEOM_SmartPtr() {} GEOM_SmartPtr(T* r, bool theIsOwner = false): vtkSmartPointer(r) { if(r && theIsOwner) r->Delete(); } GEOM_SmartPtr& operator()(T* r, bool theIsOwner = false){ vtkSmartPointer::operator=(r); if(r && theIsOwner) r->Delete(); return *this; } GEOM_SmartPtr& operator=(T* r){ vtkSmartPointer::operator=(r); return *this;} T* Get() const { return this->GetPointer();} }; class GEOM_DeviceActor; typedef GEOM_SmartPtr PDeviceActor; class vtkPolyDataMapper; typedef GEOM_SmartPtr PPolyDataMapper; #endif //GEOM_SMARTPTR_H