Creating and Editing Lines
QuickDraw 3D provides routines that you can use to create and manipulate lines. See
"Lines"
for the definition of a line.
Q3Line_New
You can use the
Q3Line_New
function to create a new line.
TQ3GeometryObject Q3Line_New (const TQ3LineData *lineData);
-
lineData
-
A pointer to a
TQ3LineData
structure.
DESCRIPTION
The
Q3Line_New
function returns, as its function result, a new line having the endpoints and attributes specified by the
lineData
parameter. If a new line could not be created,
Q3Line_New
returns the value
NULL
.
Q3Line_Submit
You can use the
Q3Line_Submit
function to submit an immediate line for drawing, picking, bounding, or writing.
TQ3Status Q3Line_Submit (
const TQ3LineData *lineData,
TQ3ViewObject view);
-
lineData
-
A pointer to a
TQ3LineData
structure.
-
view
-
A view.
DESCRIPTION
The
Q3Line_Submit
function submits for drawing, picking, bounding, or writing the immediate line whose location and attribute set are specified by the
lineData
parameter. The line is drawn, picked, bounded, or written according to the view characteristics specified in the
view
parameter.
SPECIAL CONSIDERATIONS
You should call this function only in a submitting loop.
Q3Line_GetData
You can use the
Q3Line_GetData
function to get the data that defines a line and its attributes.
TQ3Status Q3Line_GetData (
TQ3GeometryObject line,
TQ3LineData *lineData);
-
line
-
A line.
-
lineData
-
On exit, a pointer to a
TQ3LineData
structure that contains information about the line specified by the
line
parameter.
DESCRIPTION
The
Q3Line_GetData
function returns, through the
lineData
parameter, information about the line specified by the
line
parameter. QuickDraw 3D allocates memory for the
TQ3LineData
structure internally; you must call
Q3Line_EmptyData
to dispose of that memory.
Q3Line_SetData
You can use the
Q3Line_SetData
function to set the data that defines a line and its attributes.
TQ3Status Q3Line_SetData (
TQ3GeometryObject line,
const TQ3LineData *lineData);
-
line
-
A line.
-
lineData
-
A pointer to a
TQ3LineData
structure.
DESCRIPTION
The
Q3Line_SetData
function sets the data associated with the line specified by the
line
parameter to the data specified by the
lineData
parameter.
Q3Line_GetVertexPosition
You can use the
Q3Line_GetVertexPosition
function to get the position of a vertex of a line.
TQ3Status Q3Line_GetVertexPosition (
TQ3GeometryObject line,
unsigned long index,
TQ3Point3D *position);
-
line
-
A line.
-
index
-
An index into the
vertices
array of the specified line. This parameter should have the value 0 or 1.
-
position
-
On exit, the position of the specified vertex.
DESCRIPTION
The
Q3Line_GetVertexPosition
function returns, in the
position
parameter, the position of the vertex having the index specified by the
index
parameter in the
vertices
array of the line specified by the
line
parameter.
Q3Line_SetVertexPosition
You can use the
Q3Line_SetVertexPosition
function to set the position of a vertex of a line.
TQ3Status Q3Line_SetVertexPosition (
TQ3GeometryObject line,
unsigned long index,
const TQ3Point3D *position);
-
line
-
A line.
-
index
-
An index into the
vertices
array of the specified line. This parameter should have the value 0 or 1.
-
position
-
The desired position of the specified vertex.
DESCRIPTION
The
Q3Line_SetVertexPosition
function sets the position of the vertex having the index specified by the
index
parameter in the
vertices
array of the line specified by the
line
parameter to that specified in the
position
parameter.
Q3Line_GetVertexAttributeSet
You can use the
Q3Line_GetVertexAttributeSet
function to get the attribute set of a vertex of a line.
TQ3Status Q3Line_GetVertexAttributeSet (
TQ3GeometryObject line,
unsigned long index,
TQ3AttributeSet *attributeSet);
-
line
-
A line.
-
index
-
An index into the
vertices
array of the specified line. This parameter should have the value 0 or 1.
-
attributeSet
-
On exit, a pointer to a vertex attribute set for the specified vertex.
DESCRIPTION
The
Q3Line_GetVertexAttributeSet
function returns, in the
attributeSet
parameter, the set of attributes for the vertex having the index specified by the
index
parameter in the
vertices
array of the line specified by the
line
parameter. The reference count of the set is incremented.
Q3Line_SetVertexAttributeSet
You can use the
Q3Line_SetVertexAttributeSet
function to set the attribute set of a vertex of a line.
TQ3Status Q3Line_SetVertexAttributeSet (
TQ3GeometryObject line,
unsigned long index,
TQ3AttributeSet attributeSet);
-
line
-
A line.
-
index
-
An index into the
vertices
array of the specified line. This parameter should have the value 0 or 1.
-
attributeSet
-
The desired set of attributes for the specified vertex.
DESCRIPTION
The
Q3Line_SetVertexAttributeSet
function sets the attribute set of a vertex to the set specified in the
attributeSet
parameter. The vertex is identified by the specified index into the
vertices
array of the line specified by the
line
parameter.
Q3Line_EmptyData
You can use the
Q3Line_EmptyData
function to release the memory occupied by the data structure returned by a previous call to
Q3Line_GetData
.
TQ3Status Q3Line_EmptyData (TQ3LineData *lineData);
-
lineData
-
A pointer to a
TQ3LineData
structure.
DESCRIPTION
The
Q3Line_EmptyData
function releases the memory occupied by the
TQ3LineData
structure pointed to by the
lineData
parameter; that memory was allocated by a previous call to
Q3Line_GetData
.
© 1997 Apple Computer, Inc.