refactor: rename Vtk classes by removing the vtk prefix to follow project naming conventions
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////*/
|
||||
|
||||
#include "Math/ContainerBox.h"
|
||||
#include "Vtk/Math/vtkContainerBox.h"
|
||||
#include "Vtk/uLibVtkViewer.h"
|
||||
#include "Vtk/Math/vtkContainerBox.h"
|
||||
#include "Vtk/vtkHandlerWidget.h"
|
||||
@@ -39,7 +39,7 @@
|
||||
using namespace uLib;
|
||||
|
||||
int main() {
|
||||
BEGIN_TESTING(vtkHandlerWidget with ContainerBox);
|
||||
BEGIN_TESTING(HandlerWidget with ContainerBox);
|
||||
|
||||
// 1. Create a ContainerBox (Math object)
|
||||
ContainerBox box;
|
||||
@@ -49,16 +49,16 @@ int main() {
|
||||
// 3. Setup the Viewer
|
||||
Vtk::Viewer viewer;
|
||||
|
||||
// 2. Wrap it in a Vtk::vtkContainerBox (Vtk Puppet)
|
||||
Vtk::vtkContainerBox v_box(&box);
|
||||
// 2. Wrap it in a Vtk::ContainerBox (Vtk Puppet)
|
||||
Vtk::ContainerBox v_box(&box);
|
||||
v_box.SetRepresentation(Vtk::Puppet::Surface);
|
||||
v_box.SetOpacity(0.5);
|
||||
|
||||
viewer.AddPuppet(v_box);
|
||||
|
||||
// 4. Create and setup the vtkHandlerWidget
|
||||
vtkSmartPointer<Vtk::vtkHandlerWidget> handler =
|
||||
vtkSmartPointer<Vtk::vtkHandlerWidget>::New();
|
||||
// 4. Create and setup the HandlerWidget
|
||||
vtkSmartPointer<Vtk::HandlerWidget> handler =
|
||||
vtkSmartPointer<Vtk::HandlerWidget>::New();
|
||||
|
||||
handler->SetInteractor(viewer.GetInteractor());
|
||||
|
||||
@@ -83,20 +83,20 @@ int main() {
|
||||
auto key_callback = vtkSmartPointer<vtkCallbackCommand>::New();
|
||||
key_callback->SetCallback([](vtkObject *caller, unsigned long, void *clientData, void *) {
|
||||
auto interactor = static_cast<vtkRenderWindowInteractor *>(caller);
|
||||
auto h = static_cast<Vtk::vtkHandlerWidget *>(clientData);
|
||||
auto h = static_cast<Vtk::HandlerWidget *>(clientData);
|
||||
std::string key = interactor->GetKeySym();
|
||||
if (key == "g") {
|
||||
std::cout << "Switching to GLOBAL frame" << std::endl;
|
||||
h->SetReferenceFrame(Vtk::vtkHandlerWidget::GLOBAL);
|
||||
h->SetReferenceFrame(Vtk::HandlerWidget::GLOBAL);
|
||||
} else if (key == "l") {
|
||||
std::cout << "Switching to LOCAL frame" << std::endl;
|
||||
h->SetReferenceFrame(Vtk::vtkHandlerWidget::LOCAL);
|
||||
h->SetReferenceFrame(Vtk::HandlerWidget::LOCAL);
|
||||
} else if (key == "c") {
|
||||
std::cout << "Switching to CENTER frame" << std::endl;
|
||||
h->SetReferenceFrame(Vtk::vtkHandlerWidget::CENTER);
|
||||
h->SetReferenceFrame(Vtk::HandlerWidget::CENTER);
|
||||
} else if (key == "k") {
|
||||
std::cout << "Switching to CENTER_LOCAL frame" << std::endl;
|
||||
h->SetReferenceFrame(Vtk::vtkHandlerWidget::CENTER_LOCAL);
|
||||
h->SetReferenceFrame(Vtk::HandlerWidget::CENTER_LOCAL);
|
||||
}
|
||||
});
|
||||
key_callback->SetClientData(handler.GetPointer());
|
||||
|
||||
Reference in New Issue
Block a user