View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0000589 | VTK | (No Category) | public | 2004-02-13 10:03 | 2004-04-22 11:32 | ||||
Reporter | Luca Antiga | ||||||||
Assigned To | Brad King | ||||||||
Priority | normal | Severity | feature | Reproducibility | always | ||||
Status | closed | Resolution | fixed | ||||||
Platform | OS | OS Version | |||||||
Product Version | |||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0000589: No need of class vtkDICOMImageReaderVector | ||||||||
Description | class vtkDICOMImageReaderVector is defined (in vtkDICOMImageReader.cxx) as class vtkDICOMImageReaderVector : public vtkstd::vector<vtkstd::string> { }; If one wants to derive a class from vtkDICOMImageReader and access vtkDICOMImageReaderVector, he has to cast DICOMFileNames from vtkDICOMImageReaderVector* to vtkstd::vector<vtkstd::string>* in order to avoid to include vtkDICOMImageReader.cxx, which is not a good solution. Solution: - remove the definition of vtkDICOMImageReaderVector in vtkDICOMImageReader.cxx and the forward to vtkDICOMImageReaderVector in vtkDICOMImageReader.h - add typedef vtkDICOMImageReaderVector vtkstd::vector<vtkstd::string> in vtkDICOMImageReader.h - add #include <vtkstd/vector> #include <vtkstd/string> in vtkDICOMImageReader.h I understand that this will imply a compile-time penalty, but it's the price to pay to make a derived class access the list of file names. | ||||||||
Tags | No tags attached. | ||||||||
Project | |||||||||
Type | |||||||||
Attached Files | |||||||||
Relationships | |
Relationships |
Notes | |
(0000638) Luca Antiga (reporter) 2004-02-13 10:05 |
typo: typedef vtkstd::vector<vtkstd::string> vtkDICOMImageReaderVector |
(0000641) Brad King (developer) 2004-02-13 13:03 |
The current design is following the "pimpl" (private implementation) idiom to avoid the compile time penalty you mentioned. The solution is to provide protected methods in the reader class to access the vector indirectly. Then subclasses can use these methods to access the list of filenames without the compile-time penalty. This change will not be made on the 4.4 release branch. I'm changing this bug entry to a feature request on the development tree. |
(0000933) Brad King (developer) 2004-04-21 18:31 |
I have added GetNumberOfFileNames and GetFileName methods to access DICOMFileNames vector from subclasses while preserving the PIMPL idiom: Checking in vtkDICOMImageReader.cxx; /cvsroot/VTK/VTK/IO/vtkDICOMImageReader.cxx,v <-- vtkDICOMImageReader.cxx new revision: 1.26; previous revision: 1.25 done Checking in vtkDICOMImageReader.h; /cvsroot/VTK/VTK/IO/vtkDICOMImageReader.h,v <-- vtkDICOMImageReader.h new revision: 1.15; previous revision: 1.14 done This should provide read access to the set of file names from subclasses. Once ExecuteInformation or ExecuteData have been invoked, the list will be valid. If write access is needed, more accessor methods will have to be added. |
Notes |
Issue History | |||
Date Modified | Username | Field | Change |
2011-06-16 13:11 | Zack Galbreath | Category | => (No Category) |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |