Polyline 2D display problem

Any question about the main GUI application (frontend)
Post Reply
Jälv
Posts: 28
Joined: Sun Jul 02, 2017 8:35 pm

Polyline 2D display problem

Post by Jälv »

Hello,

When I load a Shape file that contains 2D polylines and that I set the 2DMode to true, CloudCompare cannot zoom to the loaded polylines.
Here what is looks like.
Image
On the left I set the 2DMode to false (loading the 2D polyline as 3D) and it shows properly.
On the right I set the 2DMode to true and the viewer cannot zoom to it so the polylines are there but extremely tiny.

It seems that what is causing the problem is the ccPolyline::getOwnBB which sets the bBox as being invalid.

Code: Select all

ccBBox ccPolyline::getOwnBB(bool withGLFeatures/*=false*/)
{
	ccBBox emptyBox;
	getBoundingBox(emptyBox.minCorner(), emptyBox.maxCorner());
	ccLog::Print(QString("3D: %1 GL: %2").arg(!is2DMode()).arg(!withGLFeatures));
	emptyBox.setValidity((!is2DMode() || !withGLFeatures) && size() != 0); //a 2D polyline is considered as a purely 'GL' fature
	return emptyBox;
}
The validity is set to false because (is2DMode == true) => (!i2DMode == false) and !withGLFeatures == false

Is there something that can be done or should I force loading 2D polylines as 3D ?
daniel
Site Admin
Posts: 7713
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Polyline 2D display problem

Post by daniel »

Actually 2D polylines are not meant to be used / selected in the 3D world.

If the '2D' mode is enabled, CC considers that the polyline coordinates are expressed in pixels, and that the polyline should be displayed in screen space (i.e. overlayed on top of the 3D view). Therefore you can't select them, and they are modified by any 3D interaction (zoom, pan, rotation, etc.).
Daniel, CloudCompare admin
Jälv
Posts: 28
Joined: Sun Jul 02, 2017 8:35 pm

Re: Polyline 2D display problem

Post by Jälv »

Okay, I didn't know that, Thanks for the quick response
daniel
Site Admin
Posts: 7713
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Polyline 2D display problem

Post by daniel »

Friday is my CloudCompare day :D
Daniel, CloudCompare admin
Post Reply