Hello,
After reading and cross reading of the docs on TPrsStd_AISPresentation and associated class, I come to ask for help since I couldn't find an answer to my problem.
So currently I have this code that display a Shape (It's python but should be understandable from C++ pov, the "_s" suffix indicates that it's a C++ static method) :
When I first create a Shape I pass it to this function and the shape is displayed correctly, no problem.
The problem arise when I want to edit the shape and update the view.
The only solution I got right now is to pass the modified shape to the same function but I feel that OCAF/OCCT can handle that and that I don't have to do that (which feels quite wrong)
Does someone know a better way ? OCAF visualisation and shape rebuilding seems quite linked to TFunctions but it looks quite heavy to implement and I'm trying to avoid using it yet, there's already so much to know/learn, it's a bit overwhelming
Thanks !
After reading and cross reading of the docs on TPrsStd_AISPresentation and associated class, I come to ask for help since I couldn't find an answer to my problem.
So currently I have this code that display a Shape (It's python but should be understandable from C++ pov, the "_s" suffix indicates that it's a C++ static method) :
Python:
def display(self, shape: TopoDS_Shape):
"""
Builds the display object and attach it to the OCAF tree
"""
self.bldr = TNaming_Builder(self._label) #_label is TDF_Label
self.bldr.Generated(shape)
named_shape = self.bldr.NamedShape()
self._label.FindAttribute(TNaming_NamedShape.GetID_s(), named_shape)
self.ais_shape = TPrsStd_AISPresentation.Set_s(named_shape)
self.ais_shape.Display(update=True)
When I first create a Shape I pass it to this function and the shape is displayed correctly, no problem.
The problem arise when I want to edit the shape and update the view.
The only solution I got right now is to pass the modified shape to the same function but I feel that OCAF/OCCT can handle that and that I don't have to do that (which feels quite wrong)
Does someone know a better way ? OCAF visualisation and shape rebuilding seems quite linked to TFunctions but it looks quite heavy to implement and I'm trying to avoid using it yet, there's already so much to know/learn, it's a bit overwhelming
Thanks !