|
AvogadroLibs 2.1.0-20261111
|
Visitor that converts every drawable into triangle meshes. More...
#include <tessellatingvisitor.h>
Public Member Functions | |
| void | begin () |
| void | clear () |
| const std::vector< TessellatedMesh > & | meshes () const |
| bool | bounds (Vector3f &minimum, Vector3f &maximum) const |
| void | setSphereLevelRange (unsigned int minLevel, unsigned int maxLevel) |
| unsigned int | sphereLevelForRadius (float radius) |
| float | sphereMaxEdgeAngle (unsigned int level) |
| void | visit (Node &) override |
| void | visit (GroupNode &) override |
| void | visit (GeometryNode &) override |
| void | visit (Drawable &) override |
| void | visit (SphereGeometry &geometry) override |
| void | visit (CurveGeometry &geometry) override |
| void | visit (CylinderGeometry &geometry) override |
| void | visit (MeshGeometry &geometry) override |
| void | visit (TextLabel2D &) override |
| void | visit (TextLabel3D &) override |
| void | visit (LineStripGeometry &geometry) override |
| void | visit (WideLineGeometry &geometry) override |
| void | visit (DashedLineGeometry &geometry) override |
| void | visit (ArrowGeometry &geometry) override |
| void | visit (VolumeGeometry &) override |
| void | setTessellationTolerance (float angstrom) |
| float | tessellationTolerance () const |
| void | setSphereSubdivisions (unsigned int level) |
| unsigned int | sphereSubdivisions () const |
| void | useAdaptiveSpheres () |
| void | setCylinderSides (unsigned int sides) |
| unsigned int | cylinderSides () const |
| void | useAdaptiveCylinders () |
| unsigned int | cylinderSidesForRadius (float radius) const |
| void | setLineRadius (float radius) |
| float | lineRadius () const |
<avogadro/rendering/tessellatingvisitor.h>
This is the shared basis of the mesh-based scene exporters (PLY, glTF, ...). One TessellatedMesh is recorded per visited drawable (curve geometry with several lines is merged into a single mesh), in visiting order. Colors are not shaded: lighting is left to the consumer.
Text labels and volume rendering cannot be expressed as triangle meshes and are skipped.
| void begin | ( | ) |
Discard all meshes recorded so far. Equivalent to clear().
| bool bounds | ( | Vector3f & | minimum, |
| Vector3f & | maximum ) const |
Axis-aligned bounding box of all vertices in meshes().
| void setTessellationTolerance | ( | float | angstrom | ) |
Geometric tolerance in Angstrom: the largest distance between a tessellated sphere or cylinder surface and the true surface. Unless fixed explicitly (below), the sphere subdivision level and the cylinder side count are chosen per primitive from its radius to meet this tolerance. Non-finite or non-positive values are ignored. Default 0.05.
| float tessellationTolerance | ( | ) | const |
Geometric tolerance in Angstrom: the largest distance between a tessellated sphere or cylinder surface and the true surface. Unless fixed explicitly (below), the sphere subdivision level and the cylinder side count are chosen per primitive from its radius to meet this tolerance. Non-finite or non-positive values are ignored. Default 0.05.
| void setSphereLevelRange | ( | unsigned int | minLevel, |
| unsigned int | maxLevel ) |
Range (0 to 6) of icosphere subdivision levels the adaptive choice may use. Default 1 (42 vertices) to 5 (10242 vertices).
| unsigned int sphereLevelForRadius | ( | float | radius | ) |
Smallest level in the range whose maximum sagitta, radius * (1 - cos(theta / 2)) with theta the largest angle subtended by an edge of that level's icosphere, is within the tolerance (the maximum level if none is).
| float sphereMaxEdgeAngle | ( | unsigned int | level | ) |
The largest angle (radians) subtended by an edge of a level's mesh.
| void setSphereSubdivisions | ( | unsigned int | level | ) |
Use a fixed number of icosphere subdivisions (0 to 6) for every sphere, instead of the adaptive choice. Level 3 has 1280 triangles, 642 vertices.
| unsigned int sphereSubdivisions | ( | ) | const |
The fixed level, or the minimum level of the range when adaptive.
| void useAdaptiveSpheres | ( | ) |
Use a fixed number of icosphere subdivisions (0 to 6) for every sphere, instead of the adaptive choice. Level 3 has 1280 triangles, 642 vertices.
| void setCylinderSides | ( | unsigned int | sides | ) |
Use a fixed number of sides (at least 3) for every cylinder instead of the adaptive choice, which is the smallest n >= 8 (at most 48) with radius * (1 - cos(pi / n)) within the tolerance.
| unsigned int cylinderSides | ( | ) | const |
Use a fixed number of sides (at least 3) for every cylinder instead of the adaptive choice, which is the smallest n >= 8 (at most 48) with radius * (1 - cos(pi / n)) within the tolerance.
| void useAdaptiveCylinders | ( | ) |
Use a fixed number of sides (at least 3) for every cylinder instead of the adaptive choice, which is the smallest n >= 8 (at most 48) with radius * (1 - cos(pi / n)) within the tolerance.
| unsigned int cylinderSidesForRadius | ( | float | radius | ) | const |
Use a fixed number of sides (at least 3) for every cylinder instead of the adaptive choice, which is the smallest n >= 8 (at most 48) with radius * (1 - cos(pi / n)) within the tolerance.
| void setLineRadius | ( | float | radius | ) |
Tube radius (in scene units, Angstrom) of one pixel of GL line width. Dashed lines, line strips and flat curves have no world-space width, only a width in pixels, so their tubes get radius lineRadius * width (width is at least 1). WideLineGeometry already has a world-space width and ignores this value. Default 0.02.
| float lineRadius | ( | ) | const |
Tube radius (in scene units, Angstrom) of one pixel of GL line width. Dashed lines, line strips and flat curves have no world-space width, only a width in pixels, so their tubes get radius lineRadius * width (width is at least 1). WideLineGeometry already has a world-space width and ignores this value. Default 0.02.
|
overridevirtual |
The overloaded visit functions, the base versions of which do nothing.
Reimplemented from Visitor.
|
overridevirtual |
Reimplemented from Visitor.
|
overridevirtual |
Reimplemented from Visitor.
|
overridevirtual |
Reimplemented from Visitor.
|
overridevirtual |
Reimplemented from Visitor.
|
overridevirtual |
Reimplemented from Visitor.
|
overridevirtual |
Reimplemented from Visitor.
|
overridevirtual |
Reimplemented from Visitor.
|
overridevirtual |
Reimplemented from Visitor.
|
overridevirtual |
Reimplemented from Visitor.
|
overridevirtual |
Reimplemented from Visitor.
|
overridevirtual |
Reimplemented from Visitor.
|
overridevirtual |
Reimplemented from Visitor.