Carna
Version 3.3.2
|
Simplifies the creation and maintenance of point markers. More...
#include <PointMarkerHelper.h>
Public Member Functions | |
PointMarkerHelper (unsigned int geometryType, unsigned int pointSize=DEFAULT_POINT_SIZE) | |
Instantiates. | |
PointMarkerHelper (unsigned int geometryType, unsigned int meshRole, unsigned int materialRole, unsigned int pointSize=DEFAULT_POINT_SIZE) | |
~PointMarkerHelper () | |
Releases all previously acquired materials. | |
void | releaseGeometryFeatures () |
Releases all previously acquired materials. Invoke this method when it is sure that no further markers will be created. More... | |
base::Geometry * | createPointMarker () const |
Creates new point marker of preferred pixel size, colored differently than the last point marker created by any PointMarkerHelper instance. More... | |
base::Geometry * | createPointMarker (unsigned int pointSize) const |
Creates new point marker of pointSize colored differently than the last point marker created by any PointMarkerHelper instance. This method creates a new material each time it is used. | |
base::Geometry * | createPointMarker (const base::Color &color) const |
Creates new point marker of preferred pixel size with color. This method creates a new material each time it is used. | |
base::Geometry * | createPointMarker (const base::Color &color, unsigned int pointSize) const |
Creates new point marker of pointSize with color. This method creates a new material each time it is used. | |
Static Public Member Functions | |
static void | resetDefaultColor () |
Resets the color that the next invocation to the argument-less version of createPointMarker uses. | |
Public Attributes | |
const unsigned int | geometryType |
Holds the markers' geometry type. | |
const unsigned int | meshRole |
Holds the role used to attach the mesh to the markers. | |
const unsigned int | materialRole |
Holds the role used to attach the material to the markers. | |
const unsigned int | pointSize |
Holds the preferred pixel size of the markers. | |
Static Public Attributes | |
static const unsigned int | DEFAULT_POINT_SIZE = 6 |
Holds the default point marker pixel size. | |
Simplifies the creation and maintenance of point markers.
A point marker is considered a 2D shape of fixed pixel size that is yet positioned in 3D space. Point markers are rendered as point-primitives and using the pointmarker
material shader. That material shader produces the white edge around the markers.
Each instance of this class creates point markers of a preferred pixel size. It provides basically two methods for the creation of point markers. The first type takes no arguments and creates point markers from a predefined color palette and using the preferred pixel size. This method is a little faster in theory because it recycles materials once they have been instantiated for a particular color. The other methods take the color, the pixel size, or both as arguments and repeat the instantiation of a material every time they are used.
The following example creates a sequence of marker points in rotating colors:
Definition at line 60 of file PointMarkerHelper.h.
|
explicit |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
base::Geometry* Carna::helpers::PointMarkerHelper::createPointMarker | ( | ) | const |
Creates new point marker of preferred pixel size, colored differently than the last point marker created by any PointMarkerHelper
instance.
This method cycles through a predefined palette of colors. It recycles the materials instantiates once per color.
void Carna::helpers::PointMarkerHelper::releaseGeometryFeatures | ( | ) |
Releases all previously acquired materials. Invoke this method when it is sure that no further markers will be created.
Invoking this method and than instantiating markers will cause redundant base::Material instantiations.
Documentation generated by Doxygen