History:
In the recent 18.1 official installation in windows when using the image workbench and trying to put an image on a plane in 3D space I end up with an exception. But before that happens I see in the report window "QFSFileEngine::open: No file name specified", a message that was not present in FreeCAD 17 and definitely indicates an error. Thanks to the new libpack I could set up a debug environment where the exception doesn't happen but that message is still present.
Observation:
Hunting it down down brought me to the following code that looks rather suspicious to me and definitely causes the error message (and possibly also the exception in the current version).
It happens in addObject in the call to ViewProviderImagePlane::updateData(const App::Property* prop) from ViewProviderDocumentObject::updateView(). In updateView a map of App::Property * is created (getPropertyMap) and the Property* component of the elements of this map are then, in a loop, fed into the updateData method. In the specific case I am looking at there are actually 6 Property* and precisely one of them is an ImagePlane *. The first statements of the updateData method are
Code: Select all
...
void ViewProviderImagePlane::updateData(const App::Property* prop)
{
Image::ImagePlane* pcPlaneObj = static_cast<Image::ImagePlane*>(pcObject);
if (prop == &pcPlaneObj->XSize || prop == &pcPlaneObj->YSize) {
float x = pcPlaneObj->XSize.getValue();
float y = pcPlaneObj->YSize.getValue();
//pcCoords->point.setNum(4);
...
I think that this is an error and it can create all kinds of havoc or does anybody know of a good reason why this should actually work properly?
BTW: There are a few more cases where a static_cast is used in the above way in the updateData method of some ViewProviders. If the case above is an error all of them might have to be fixed.
Cheers
Hartmuth