fix container box representation ( fix it )
This commit is contained in:
@@ -65,6 +65,7 @@ ContainerBox::ContainerBox(ContainerBox::Content *content)
|
|||||||
this->InstallPipe();
|
this->InstallPipe();
|
||||||
d->m_UpdateSignal = Object::connect(
|
d->m_UpdateSignal = Object::connect(
|
||||||
this->m_model.get(), &uLib::Object::Updated, this, &ContainerBox::Update);
|
this->m_model.get(), &uLib::Object::Updated, this, &ContainerBox::Update);
|
||||||
|
this->Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
ContainerBox::~ContainerBox() { delete d; }
|
ContainerBox::~ContainerBox() { delete d; }
|
||||||
@@ -81,13 +82,18 @@ void ContainerBox::Update() {
|
|||||||
|
|
||||||
vtkProp3D *prop = vtkProp3D::SafeDownCast(this->GetProp());
|
vtkProp3D *prop = vtkProp3D::SafeDownCast(this->GetProp());
|
||||||
if (prop) {
|
if (prop) {
|
||||||
// Apply the full volume matrix (TRS * m_LocalT)
|
// Apply the TRS matrix to the assembly
|
||||||
vtkNew<vtkMatrix4x4> m;
|
vtkNew<vtkMatrix4x4> m;
|
||||||
Matrix4fToVtk(this->m_model->GetMatrix(), m);
|
Matrix4fToVtk(this->m_model->GetMatrix(), m);
|
||||||
prop->SetUserMatrix(m);
|
prop->SetUserMatrix(m);
|
||||||
prop->Modified();
|
prop->Modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Apply the local shape transformation (Size/Origin) to the cube actor
|
||||||
|
vtkNew<vtkMatrix4x4> localM;
|
||||||
|
Matrix4fToVtk(this->m_model->GetLocalMatrix(), localM);
|
||||||
|
d->m_Cube->SetUserMatrix(localM);
|
||||||
|
|
||||||
// Delegate rest of update (appearance, render, etc)
|
// Delegate rest of update (appearance, render, etc)
|
||||||
ConnectionBlock blocker(d->m_UpdateSignal);
|
ConnectionBlock blocker(d->m_UpdateSignal);
|
||||||
this->Prop3D::Update();
|
this->Prop3D::Update();
|
||||||
@@ -121,11 +127,11 @@ void ContainerBox::InstallPipe() {
|
|||||||
Content *c = this->m_model;
|
Content *c = this->m_model;
|
||||||
|
|
||||||
// CUBE
|
// CUBE
|
||||||
|
|
||||||
|
vtkSmartPointer<vtkPolyDataMapper> mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
|
||||||
vtkSmartPointer<vtkCubeSource> cube = vtkSmartPointer<vtkCubeSource>::New();
|
vtkSmartPointer<vtkCubeSource> cube = vtkSmartPointer<vtkCubeSource>::New();
|
||||||
|
|
||||||
vtkSmartPointer<vtkPolyDataMapper> mapper =
|
// cube->SetBounds(-0.5, 0.5, -0.5, 0.5, -0.5, 0.5);
|
||||||
vtkSmartPointer<vtkPolyDataMapper>::New();
|
|
||||||
cube->SetBounds(0, 1, 0, 1, 0, 1);
|
|
||||||
mapper->SetInputConnection(cube->GetOutputPort());
|
mapper->SetInputConnection(cube->GetOutputPort());
|
||||||
mapper->Update();
|
mapper->Update();
|
||||||
d->m_Cube->SetMapper(mapper);
|
d->m_Cube->SetMapper(mapper);
|
||||||
|
|||||||
Reference in New Issue
Block a user