refactor: rename Puppet class to Prop3D across the codebase

This commit is contained in:
AndreaRigoni
2026-04-08 15:47:33 +00:00
parent 77f00a2b8a
commit f7ba4b1a17
63 changed files with 412 additions and 413 deletions

View File

@@ -52,7 +52,7 @@ namespace Archive {
class display_properties_archive;
}
namespace Vtk {
class Puppet;
class Prop3D;
class Viewer;
} // namespace Vtk
} // namespace uLib
@@ -60,13 +60,13 @@ class Viewer;
namespace uLib {
namespace Vtk {
class Puppet : public uLib::Object {
class Prop3D : public uLib::Object {
uLibTypeMacro(Puppet, uLib::Object)
uLibTypeMacro(Prop3D, uLib::Object)
public:
Puppet();
virtual ~Puppet();
Prop3D();
virtual ~Prop3D();
virtual vtkProp *GetProp();
virtual vtkProp3D *GetProxyProp();
@@ -152,17 +152,17 @@ protected:
virtual void ApplyAppearance(vtkProp *prop);
virtual void ApplyTransform(vtkProp3D *p3d);
virtual void ApplyPuppetTransform(vtkProp3D *p3d);
virtual void ApplyProp3DTransform(vtkProp3D *p3d);
std::vector<uLib::PropertyBase *> m_DisplayProperties;
mutable uLib::RecursiveMutex m_UpdateMutex;
private:
Puppet(const Puppet &) = delete;
Puppet &operator=(const Puppet &) = delete;
Prop3D(const Prop3D &) = delete;
Prop3D &operator=(const Prop3D &) = delete;
friend class PuppetData;
class PuppetData *pd;
friend class Prop3DData;
class Prop3DData *pd;
};
} // namespace Vtk
@@ -181,7 +181,7 @@ namespace Archive {
/**
* @brief Specialized archive for registering display-only properties in
* Puppets.
* Prop3Ds.
*/
class display_properties_archive
: public boost::archive::detail::common_oarchive<
@@ -191,10 +191,10 @@ public:
friend class boost::archive::save_access;
using boost::archive::detail::common_oarchive<display_properties_archive>::save_override;
display_properties_archive(Vtk::Puppet *p)
display_properties_archive(Vtk::Prop3D *p)
: boost::archive::detail::common_oarchive<display_properties_archive>(
boost::archive::no_header),
m_Puppet(p) {
m_Prop3D(p) {
if (p)
m_Visited.insert(dynamic_cast<const void *>(p));
}
@@ -210,9 +210,9 @@ public:
}
template <class T> void save_override(const boost::serialization::hrp<T> &t) {
if (m_Puppet) {
if (m_Prop3D) {
uLib::Property<T> *p = new uLib::Property<T>(
m_Puppet, t.name(),
m_Prop3D, t.name(),
&const_cast<boost::serialization::hrp<T> &>(t).value(),
t.units() ? t.units() : "", GetCurrentGroup());
if (t.has_range())
@@ -220,24 +220,24 @@ public:
if (t.has_default())
p->SetDefault(t.default_val());
m_Puppet->RegisterDisplayProperty(p);
Vtk::Puppet *puppet = m_Puppet;
m_Prop3D->RegisterDisplayProperty(p);
Vtk::Prop3D *prop3d = m_Prop3D;
uLib::Object::connect(p, &uLib::PropertyBase::Updated,
[puppet]() { puppet->Update(); });
[prop3d]() { prop3d->Update(); });
}
}
template <class T>
void save_override(const boost::serialization::hrp_enum<T> &t) {
if (m_Puppet) {
if (m_Prop3D) {
uLib::EnumProperty *p = new uLib::EnumProperty(
m_Puppet, t.name(),
m_Prop3D, t.name(),
(int *)&const_cast<boost::serialization::hrp_enum<T> &>(t).value(),
t.labels(), t.units() ? t.units() : "", GetCurrentGroup());
m_Puppet->RegisterDisplayProperty(p);
Vtk::Puppet *puppet = m_Puppet;
m_Prop3D->RegisterDisplayProperty(p);
Vtk::Prop3D *prop3d = m_Prop3D;
uLib::Object::connect(p, &uLib::PropertyBase::Updated,
[puppet]() { puppet->Update(); });
[prop3d]() { prop3d->Update(); });
}
}
@@ -292,11 +292,11 @@ public:
// Called by Property<T>::serialize() and EnumProperty::serialize() to
// directly register an existing property object as a display property.
void register_property(uLib::PropertyBase &p) {
if (m_Puppet) {
m_Puppet->RegisterDisplayProperty(&p);
Vtk::Puppet *puppet = m_Puppet;
if (m_Prop3D) {
m_Prop3D->RegisterDisplayProperty(&p);
Vtk::Prop3D *prop3d = m_Prop3D;
uLib::Object::connect(&p, &uLib::PropertyBase::Updated,
[puppet]() { puppet->Update(); });
[prop3d]() { prop3d->Update(); });
}
}
@@ -305,14 +305,14 @@ public:
}
private:
Vtk::Puppet *m_Puppet;
Vtk::Prop3D *m_Prop3D;
std::vector<std::string> m_GroupStack;
std::set<const void *> m_Visited;
};
} // namespace Archive
// This macro MUST be defined after both Puppet and display_properties_archive
// This macro MUST be defined after both Prop3D and display_properties_archive
// are fully defined.
#define ULIB_ACTIVATE_DISPLAY_PROPERTIES \
{ \