====================
Geometry conventions
====================

The kinds of geometry that HOOPS supports are markers, text, lines, circles, ellipses, polygons, meshes, shells, NURBS curves, NURBS surfaces, cylinders grids, images, lights, and cutting planes. All HOOPS geometry obeys certain conventions. Geometry is inserted using ``HC_Insert_<GeometryType> (<args>)``. For example, ``Insert_Marker(1.0)``.


Boundary representation
=======================

All geometric entities in HOOPS are represented by their boundaries - there are no solid objects in HOOPS. To create an object that appears to be solid, you define the infinitely thin surface of the object, called the object's boundary representation. For example, a sphere is represented by its surface, like the surface of a balloon, and a cube is represented by six square polygons. Such a surface looks solid, but if you insert a cutting plane to cut away part of this surface, you will see that the object is hollow. In addition, if you are not careful when you define an object, you might inadvertently leave holes in the surface, which would also expose the object as hollow. 


Tessellation
============

The surfaces of objects are made up solely of flat polygons. For an object whose sides are all flat (such as a cube), flat sides are fine. But for objects with smoothly curved surfaces, such as cylinders and spheres, we must somehow represent the curved surfaces using only flat polygons. Creating a smoothly curved surface by breaking it up into polygons is called tessellating the surface. Unfortunately, such an object can look faceted, like a cut diamond. However, if the object contains enough facets and certain lighting attributes are enabled, we can get a surface that looks surprisingly smooth.


Editing and copying geometry
============================

Some geometry can become large - especially geometry inserted via a multiple form. For example, a polyline can contain hundreds, or even thousands, of line segments, and a shell can contain equally large numbers of polygons. If an application wants to make a small change to a large piece of geometry, it can delete the old geometry and then reinsert the new one, but that approach is excessively slow. Instead, HOOPS provides a way to make changes to geometry in its database. For example, you can change a polyline using ``Edit_Polyline``. There are routines to edit all the geometric primitives, with the exception of 'light' primitives since they can effectively be edited using the ``HC_Move`` routines. Geometric primitives can be copied using ``Copy_Geometry``. 


Attributes
==========

A few HOOPS attributes, such as transformations and cameras, can affect any kind of geometry, but other attributes were designed to affect only certain kinds of geometry. For example, line weight affects only lines. We shall discuss such attributes with each kind of geometry. 

Some attributes - such as color, visibility, and selectability - can be specified on individual kinds of geometry. For example:

.. tabs::

	.. group-tab:: C++
	
		.. literalinclude:: ../../../../hoops_3df/demo/common/sanity/0700_docs_0008.cpp
		   :start-after: //! [set_color]
		   :end-before: //! [set_color] 
		   
The syntax for specifying such attributes is flexible. Spaces before or after commas are optional, as are spaces before or after equal-to signs. The trailing "s" in words such as "lines" also is optional. You can use uppercase letters if you wish. Multiple specifications with the same color can be folded together for example, "lines = faces = red". 

You can also change the color of all geometry (of all kinds) - for example, 

.. tabs::

	.. group-tab:: C++
	
		.. literalinclude:: ../../../../hoops_3df/demo/common/sanity/0700_docs_0008.cpp
		   :start-after: //! [set_geometry_color]
		   :end-before: //! [set_geometry_color] 
		   
or just

.. tabs::

	.. group-tab:: C++
	
		.. literalinclude:: ../../../../hoops_3df/demo/common/sanity/0700_docs_0008.cpp
		   :start-after: //! [set_all_color]
		   :end-before: //! [set_all_color] 
	   
Either of these last two commands changes the color of lines, text, markers, faces, and edges to green (but does not affect lights or windows). For more information, see the HOOPS/3dGS Reference Manual entries for ``Set_Color``, ``Set_Visibility``, and ``Set_Selectability``. 
