refactor: rename Vtk classes by removing the vtk prefix to follow project naming conventions
This commit is contained in:
@@ -60,7 +60,7 @@ VTK_MODULE_INIT(vtkInteractionStyle);
|
||||
namespace uLib {
|
||||
namespace Vtk {
|
||||
|
||||
void vtkVoxImage::GetContent() {
|
||||
void VoxImage::UpdateFromContent() {
|
||||
Vector3i ev_dims = m_Content.GetDims();
|
||||
m_Image->SetDimensions(ev_dims.data());
|
||||
|
||||
@@ -91,7 +91,7 @@ void vtkVoxImage::GetContent() {
|
||||
}
|
||||
}
|
||||
|
||||
void vtkVoxImage::SetContent() {
|
||||
void VoxImage::UpdateToContent() {
|
||||
int *ext = m_Image->GetExtent();
|
||||
int dims[3] = {ext[1] - ext[0] + 1, ext[3] - ext[2] + 1, ext[5] - ext[4] + 1};
|
||||
m_Content.SetDims(Vector3i(dims[0], dims[1], dims[2]));
|
||||
@@ -124,7 +124,7 @@ void vtkVoxImage::SetContent() {
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// VTK VOXIMAGE
|
||||
|
||||
vtkVoxImage::vtkVoxImage(Content &content)
|
||||
VoxImage::VoxImage(Content &content)
|
||||
: m_Content(content), m_Actor(vtkVolume::New()),
|
||||
m_Asm(vtkAssembly::New()),
|
||||
m_Image(vtkImageData::New()), m_Outline(vtkCubeSource::New()),
|
||||
@@ -134,15 +134,15 @@ vtkVoxImage::vtkVoxImage(Content &content)
|
||||
// Transfer functions
|
||||
m_ColorFun = vtkColorTransferFunction::New();
|
||||
m_OpacityFun = vtkPiecewiseFunction::New();
|
||||
m_UpdateConnection = Object::connect(&m_Content, &uLib::Object::Updated, this, &vtkVoxImage::Update);
|
||||
m_UpdateConnection = Object::connect(&m_Content, &uLib::Object::Updated, this, &VoxImage::Update);
|
||||
|
||||
GetContent();
|
||||
UpdateFromContent();
|
||||
InstallPipe();
|
||||
RescaleShaderRange();
|
||||
ULIB_ACTIVATE_DISPLAY_PROPERTIES;
|
||||
}
|
||||
|
||||
vtkVoxImage::~vtkVoxImage() {
|
||||
VoxImage::~VoxImage() {
|
||||
m_Image->Delete();
|
||||
m_Actor->Delete();
|
||||
m_Asm->Delete();
|
||||
@@ -152,16 +152,16 @@ vtkVoxImage::~vtkVoxImage() {
|
||||
m_OpacityFun->Delete();
|
||||
}
|
||||
|
||||
vtkImageData *vtkVoxImage::GetImageData() {
|
||||
GetContent();
|
||||
vtkImageData *VoxImage::GetImageData() {
|
||||
UpdateFromContent();
|
||||
return m_Image;
|
||||
}
|
||||
|
||||
void vtkVoxImage::SaveToXMLFile(const char *fname) {
|
||||
void VoxImage::SaveToXMLFile(const char *fname) {
|
||||
vtkSmartPointer<vtkXMLImageDataWriter> writer =
|
||||
vtkSmartPointer<vtkXMLImageDataWriter>::New();
|
||||
writer->SetFileName(fname);
|
||||
GetContent();
|
||||
UpdateFromContent();
|
||||
vtkSmartPointer<vtkImageShiftScale> vtkscale =
|
||||
vtkSmartPointer<vtkImageShiftScale>::New();
|
||||
|
||||
@@ -177,7 +177,7 @@ void vtkVoxImage::SaveToXMLFile(const char *fname) {
|
||||
writer->Write();
|
||||
}
|
||||
|
||||
void vtkVoxImage::ReadFromVKTFile(const char *fname) {
|
||||
void VoxImage::ReadFromVKTFile(const char *fname) {
|
||||
vtkSmartPointer<vtkGenericDataObjectReader> reader =
|
||||
vtkSmartPointer<vtkGenericDataObjectReader>::New();
|
||||
reader->SetFileName(fname);
|
||||
@@ -190,7 +190,7 @@ void vtkVoxImage::ReadFromVKTFile(const char *fname) {
|
||||
vtkscale->Update();
|
||||
|
||||
m_Image->DeepCopy(vtkscale->GetOutput());
|
||||
SetContent();
|
||||
UpdateToContent();
|
||||
RescaleShaderRange();
|
||||
} else {
|
||||
std::cerr << "Error: file does not contain structured points\n";
|
||||
@@ -198,7 +198,7 @@ void vtkVoxImage::ReadFromVKTFile(const char *fname) {
|
||||
m_Actor->Update();
|
||||
}
|
||||
|
||||
void vtkVoxImage::ReadFromXMLFile(const char *fname) {
|
||||
void VoxImage::ReadFromXMLFile(const char *fname) {
|
||||
vtkSmartPointer<vtkXMLImageDataReader> reader =
|
||||
vtkSmartPointer<vtkXMLImageDataReader>::New();
|
||||
reader->SetFileName(fname);
|
||||
@@ -210,11 +210,11 @@ void vtkVoxImage::ReadFromXMLFile(const char *fname) {
|
||||
vtkscale->Update();
|
||||
|
||||
m_Image->DeepCopy(vtkscale->GetOutput());
|
||||
SetContent();
|
||||
UpdateToContent();
|
||||
RescaleShaderRange();
|
||||
}
|
||||
|
||||
void vtkVoxImage::setShadingPreset(int blendType) {
|
||||
void VoxImage::setShadingPreset(int blendType) {
|
||||
m_ShadingPreset = blendType;
|
||||
vtkSmartVolumeMapper *mapper = (vtkSmartVolumeMapper *)m_Actor->GetMapper();
|
||||
if (!mapper) return;
|
||||
@@ -270,7 +270,7 @@ void vtkVoxImage::setShadingPreset(int blendType) {
|
||||
}
|
||||
}
|
||||
|
||||
void vtkVoxImage::RescaleShaderRange() {
|
||||
void VoxImage::RescaleShaderRange() {
|
||||
double range[2];
|
||||
m_Image->GetScalarRange(range);
|
||||
m_Level = (range[0] + range[1]) / 2.0;
|
||||
@@ -280,7 +280,7 @@ void vtkVoxImage::RescaleShaderRange() {
|
||||
setShadingPreset(m_ShadingPreset);
|
||||
}
|
||||
|
||||
void vtkVoxImage::SetRepresentation(Representation mode) {
|
||||
void VoxImage::SetRepresentation(Representation mode) {
|
||||
Puppet::SetRepresentation(mode); // Ensure base class data state is updated
|
||||
|
||||
if (mode == Wireframe) {
|
||||
@@ -297,7 +297,7 @@ void vtkVoxImage::SetRepresentation(Representation mode) {
|
||||
}
|
||||
}
|
||||
|
||||
void vtkVoxImage::serialize_display(uLib::Archive::display_properties_archive & ar, const unsigned int version) {
|
||||
void VoxImage::serialize_display(uLib::Archive::display_properties_archive & ar, const unsigned int version) {
|
||||
// Call base class to show Transform and Appearance properties
|
||||
// Puppet::serialize_display(ar, version);
|
||||
|
||||
@@ -308,7 +308,7 @@ void vtkVoxImage::serialize_display(uLib::Archive::display_properties_archive &
|
||||
{"MIP", "Composite", "Composite Shaded", "MIP Bone", "MIP Hot", "Additive"});
|
||||
}
|
||||
|
||||
void vtkVoxImage::SyncFromVtk() {
|
||||
void VoxImage::SyncFromVtk() {
|
||||
if (auto *root = this->GetProxyProp()) {
|
||||
vtkMatrix4x4 *rootMat = root->GetUserMatrix();
|
||||
if (rootMat) {
|
||||
@@ -320,13 +320,13 @@ void vtkVoxImage::SyncFromVtk() {
|
||||
}
|
||||
}
|
||||
|
||||
void vtkVoxImage::Update() {
|
||||
void VoxImage::Update() {
|
||||
if (auto *root = vtkProp3D::SafeDownCast(this->GetProp())) {
|
||||
vtkNew<vtkMatrix4x4> m;
|
||||
Matrix4fToVtk(m_Content.GetMatrix(), m); // * m_Content.GetLocalMatrix(), m);
|
||||
root->SetUserMatrix(m);
|
||||
root->Modified();
|
||||
// std::cout << "[vtkVoxImage::Update] Set Proxy UserMatrix:" << std::endl;
|
||||
// std::cout << "[VoxImage::Update] Set Proxy UserMatrix:" << std::endl;
|
||||
// std::cout << m_Content.GetMatrix() << std::endl;
|
||||
}
|
||||
setShadingPreset(m_ShadingPreset);
|
||||
@@ -339,7 +339,7 @@ void vtkVoxImage::Update() {
|
||||
}
|
||||
|
||||
|
||||
void vtkVoxImage::InstallPipe() {
|
||||
void VoxImage::InstallPipe() {
|
||||
vtkSmartPointer<vtkSmartVolumeMapper> mapper =
|
||||
vtkSmartPointer<vtkSmartVolumeMapper>::New();
|
||||
#if VTK_MAJOR_VERSION <= 5
|
||||
|
||||
Reference in New Issue
Block a user