refactor: improve vtkContainerBox constructor flexibility and clean up code formatting

This commit is contained in:
AndreaRigoni
2026-04-09 12:48:14 +00:00
parent db76513e79
commit 76f29328cd
3 changed files with 51 additions and 59 deletions

View File

@@ -25,7 +25,6 @@
#include "Vtk/uLibVtkViewer.h"
#include "Vtk/Math/vtkContainerBox.h"
#include "Math/Units.h"
#include "Vtk/Math/vtkContainerBox.h"
@@ -36,19 +35,23 @@ using namespace uLib;
int main() {
BEGIN_TESTING(vtk ContainerBox Test);
ContainerBox box;
box.Scale(Vector3f(1_m,2_m,1_m));
box.SetPosition(Vector3f(0,0,0));
Vtk::ContainerBox v_box(&box);
v_box.Update();
// v_box.SetRepresentation(Vtk::Prop3D::Surface);
// v_box.SetOpacity(0.5);
// v_box.SetSelectable(true);
box.findOrAddSignal(&Object::Updated)->connect([&box](){
std::cout << "box updated: " << box.GetWorldPoint(HPoint3f(1,1,1)) << std::endl;
{
ContainerBox box;
box.Scale(Vector3f(1_m, 2_m, 1_m));
box.SetPosition(Vector3f(0, 0, 0));
Vtk::ContainerBox v_box(&box);
v_box.Update();
v_box.SetRepresentation(Vtk::Prop3D::Surface);
v_box.SetOpacity(0.5);
v_box.SetSelectable(true);
}
Vtk::ContainerBox v_box;
v_box.findOrAddSignal(&Object::Updated)->connect([&v_box]() {
std::cout << "box updated: "
<< v_box.get()->GetWorldPoint(HPoint3f(1, 1, 1)) << std::endl;
});
if (std::getenv("CTEST_PROJECT_NAME") == nullptr) {