How does CC render mesh(or point cloud) from a ccHObject?

Any question about the main GUI application (frontend)
Post Reply
Bonestan1
Posts: 1
Joined: Mon Feb 17, 2025 9:48 am

How does CC render mesh(or point cloud) from a ccHObject?

Post by Bonestan1 »

Hi Daniel, thanks for great open source software like CC!

I was looking into how CC loads and renders a mesh or point cloud. So I started tracing the call stack from loading to rendering, this started off relatively smoothly until I traced it to the draw3D method in ccGLWindow class, which seems to be the key to displaying the entity.

Code: Select all

void ccGLWindow::draw3D(CC_DRAW_CONTEXT& CONTEXT, RenderingParams& renderingParams)
{
	...
	//we draw 3D entities
	if (m_globalDBRoot)
	{
		m_globalDBRoot->draw(CONTEXT);
	}

	if (m_winDBRoot)
	{
		m_winDBRoot->draw(CONTEXT);
	}
	...
}
So I think ccHObject->draw(...) method is the part that draws the entity, but when I try to draw it in the draw(...) method, I tried to add breakpoints inside the draw(...) method, add all kinds of print statements and even remove the function body of draw, but it didn't affect the display, which makes me very puzzled, it's the other functions that really control the drawing of the entity, I sincerely hope to get your help.

Could you direct me to the call stack for CC entity rendering?

Thank in advance!!!
daniel
Site Admin
Posts: 7834
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: How does CC render mesh(or point cloud) from a ccHObject?

Post by daniel »

Look for the drawMeOnly() method in ccMesh. The draw() method is generic and recursively calls itself on the child entites, calling 'drawMeOnly()' on each entity each time.
Daniel, CloudCompare admin
Post Reply