Interface for drawing to screen

Feel free to ask any question here
Post Reply
rechenknecht
Posts: 4
Joined: Thu Apr 24, 2025 10:52 am

Interface for drawing to screen

Post by rechenknecht »

Hey,
is there a high level Interface to draw to the screen of CloudCompare?
As discussed here I would like to fix the inconsistency of the CoR. Looking at the Code I expect to draw the pivot it seems to be visualized using OpenGL 2.1 directly. Is there no Interface to abstract from that to draw "primitive" geometry?

I would love a small guide how drawing to the screen is intended to be handled.
daniel
Site Admin
Posts: 8158
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Interface for drawing to screen

Post by daniel »

Yes, all legacy OpenGL code :-D

Everything starts in ccGLWindowInterface::draw3D (https://github.com/CloudCompare/CloudCo ... .cpp#L4829)

The 3D entities are displayed first (recursively). Then the CoR ('pivot' in the code) can be automatically picked depending on the current display option), and then the pivot symbol is displayed: https://github.com/CloudCompare/CloudCo ... .cpp#L5008

Mind that this only applies to the standard mode.

The center of rotation for the Rotate/translate tool is managed differently. You can track it via the 'INTERACT_TRANSFORM_ENTITIES' flag. Basically, any interaction with the screen is forwarded to the ccGraphicalTransformationTool class in this mode:
https://github.com/CloudCompare/CloudCo ... .cpp#L6620
https://github.com/CloudCompare/CloudCo ... l.cpp#L868

And the rotation matrix is applied about the 'm_rotationCenter' member of this last class.
Daniel, CloudCompare admin
Post Reply