AlAnnotationLocator

Displays a text string for existing locators

Synopsis

#include <AlAnnotationLocator.h>
class AlAnnotationLocator : public AlLocator
AlAnnotationLocator();
~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 the existing point locators such as a 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 another locator (point type).

To use this locator, create any point locator and attach the annotation string through this locator using the create method. There are also methods to manipulate the position and starting point of the leader line for the annotation.

SUMMARY

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 have been 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:

sAlreadyCreated - The annotation locator has been created.

sInvalidArgument - The point locator has not been created, or the string argument is NULL.

sFailure - The method failed to create an annotation locator.

sSuccess - The text change was successful.

statusCode AlAnnotationLocator::setString(const char *string)

Description:

Changes the string in an annotation locator.

Arguments:

< string - the string to subsitute 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 makes the text left justified and a value false makes it right justified.

Return codes:

sSuccess - 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 - 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 - change was successful.

statusCode AlAnnotationLocator::leftJustify(boolean &leftJustify) const

Description:

Finds whether the annotation text is left justified or right justified.

Arguments:

> leftJustify - a value of true indicates that it is left justified and false indicates right justification.

Return codes:

sSuccess - the justification was found.

sInvalidObject - the object is not valid.





aliasdocs@aw.sgi.com
Copyright © 1996, Alias|Wavefront, a Silicon Graphics Company. All rights reserved.