Displays a text string for existing locators
Synopsis
#include <AlAnnotationLocator.h>
class AlAnnotationLocator : public AlLocator
AlAnnotationLocator();
virtual ~AlAnnotationLocator();
virtual AlObject * copyWrapper() const;
virtual AlObjectType type() const;
statusCode create(const AlPointLocator *, const char *, double, double, double);
statusCode setString(const char *);
statusCode setWorldLeaderPosition(double x = 0.0, double y = 0.0, double z = 0.0);
statusCode setLocalLeaderPosition(double x = 0.0, double y = 0.0, double z = 0.0);
statusCode setLeftJustify(boolean);
const char * string() const;
statusCode worldLeaderPosition(double &, double &, double &) const;
statusCode localLeaderPosition(double &, double &, double &) const;
statusCode leftJustify(boolean &) const;
Description
This class creates an annotation to existing point locators (for example, the space locator, curve locator, curve on surface
locator, and surface locator). An annotation is a line of text and a leader (line with arrow) that is drawn relative to a
locator (point type).
To create an annotation locator, first create a point locator and then attach the annotation string through this class using
its create method. There are also methods to manipulate the position and starting point of the leader line for the annotation.
AlAnnotationLocator::AlAnnotationLocator(void)
Description
Constructs an AlAnnotationLocator wrapper object.
AlAnnotationLocator::~AlAnnotationLocator()
Description
Deletes an AlAnnotationLocator wrapper object.
AlObject *AlAnnotationLocator::copyWrapper() const
Description
Returns an exact copy of the AlAnnotationLocator wrapper.
AlObjectType AlAnnotationLocator::type() const
Description
Returns the class identifier kAnnotationLocatorType.
statusCode AlAnnotationLocator::create(const AlPointLocator *pointLocator, const char *string, double x, double y, double
z)
Description
Creates an annotation locator on another point locator.
Arguments
> pointLocator - The AlPointLocator on which the annotation locator is created. The pointLocator should be created before
creating the annotation locator.
> string - The string to be displayed in the annotation.
> x, y, z - The coordinates relative to the point locator on which annotation depends, at which the leader line of the text
starts.
Return Codes
sSuccess - the text change was successful
sAlreadyCreated - the annotation locator was created already
sInvalidArgument - the point locator has not been created, or the string argument is NULL
sFailure - the method failed to create an annotation locator
statusCode AlAnnotationLocator::setString(const char *string)
Description
Changes the string in an annotation locator.
Arguments
< string - the string to substitute in the present annotation locator
Return Codes
sSuccess - the text change was successful
sInvalidObject - the object is not valid
sInsufficientMemory - there was not enough memory to create a copy of the string
sInvalidArgument - a NULL argument was supplied
const char *AlAnnotationLocator::string() const
Description
Returns a pointer to the annotation string.
Return Codes
NULL - if the annotation locator is not valid, or the string is NULL
statusCode AlAnnotationLocator::setWorldLeaderPosition(double x, double y, double z)
Description
Sets the position of the annotation leader line in world coordinates.
Arguments
> x, y, z - the world coordinates at which the leader line starts
Return Codes
sInvalidObject - the object is not valid
sSuccess - change was successful
statusCode AlAnnotationLocator::setLocalLeaderPosition(double x, double y, double z)
Description
Sets the position of the annotation leader line, relative to the point locator on which the annotation locator is created.
Arguments
> x, y, z - the local coordinates at which the leader line starts
Return Codes
sInvalidObject - the object is not valid
sSuccess - change was successful
statusCode AlAnnotationLocator::setLeftJustify(boolean leftJustify)
Description
Sets the justification of the annotation text for the annotation locator. The text can be right justified or left justified.
Arguments
< leftJustify - a value of true left-justifies the text; a value of false right-justifies it.
Return Codes
sSuccess - the setting was successful
sInvalidObject - the object is not valid
statusCode AlAnnotationLocator::worldLeaderPosition(double &x, double &y, double &z) const
Description
Gets the position of the annotation leader line in world coordinates.
Arguments
< x, y, z - the world coordinates at which the leader line starts
Return Codes
sInvalidObject - the object is not valid
sSuccess - the change was successful
statusCode AlAnnotationLocator::localLeaderPosition(double &x, double &y, double &z) const
Description
Gets the position of the annotation leader line, relative to the point locator on which the annotation locator is created.
Arguments
< x, y, z - the local coordinates at which the leader line starts.
Return Codes
sInvalidObject - the object is not valid
sSuccess - the change was successful
statusCode AlAnnotationLocator::leftJustify(boolean &leftJustify) const
Description
Determines whether the annotation text is left-justified or right-justified.
Arguments
> leftJustify - a value of true indicates that it is left-justified; false indicates right-justification
Return Codes
sSuccess - the justification was found
sInvalidObject - the object is not valid