XGL Test Suite User's Guide
  Procure somente este livro
Fazer download desta apostila em PDF

Picking Test Descriptions

21

This chapter describes the Picking test programs. The following is defined for each test program:
  • Name of the test program
  • Test types (See the section "Denizen Test Types" on page 2 for the different test types.)
  • Description of the test program
  • Attributes tested by the program
  • Operators tested by the program
  • Output from the test program
· pick_control
Test Types:INDEX, SM
Description:Tests that picking is allowed only when XGL_CTX_PICK_ENABLE is TRUE. The value of XGL_CTX_RENDERING is varied.
Attributes Tested: See Table 21-1, Column A at the end of this chapter.
Operators Tested: xgl_object_set
                    xgl_object_get
                    xgl_multipolyline
                    xgl_pick_get_identifiers
Output:             Tests xgl_multipolyline() with:

  • Default rendering mode true and default pick disabled (nothing should be picked)
  • Default rendering mode true and pick enabled polyline should be picked)
  • Rendering mode false and pick enabled (polyline should be picked)
· pick_control_rgb
Test Types:RGB, SM
Description:Tests that picking is allowed only when XGL_CTX_PICK_ENABLE is TRUE. The value of XGL_CTX_RENDERING is varied.
Attributes Tested: See Table 21-1, Column A at the end of this chapter.
Operators Tested: xgl_object_set
                    xgl_object_get
                    xgl_multipolyline
                    xgl_pick_get_identifiers
Output:             Tests xgl_multipolyline() with:
                    · Default rendering mode true and default pick disabled
                        (nothing should be picked)
                    · Default rendering mode true and pick enabled
                        (polyline should be picked)
                    · Rendering mode false and pick enabled (polyline
                        should be picked)

· pick_aperture
Test Types:INDEX, SM
Description:Tests that different 2D and 3D aperture sizes can be set. Also tries apertures that extend outside the DC viewport.
Attributes Tested: See Table 21-2, Column A at the end of this chapter.
Operators Tested: xgl_object_set
                    xgl_multirectangle
                    xgl_polygon
                    xgl_pick_get_identifiers
Output:             Tests nine 2D pick apertures with
                    xgl_multirectangle() (XGL_MULTIRECT_I2D). Tests
                    thirteen 3D pick apertures with xgl_polygon()
                    (XGL_PT_F3D).

· pick_aperture_rgb
Test Types:RGB, SM
Description:Tests that different 2D and 3D aperture sizes can be set. Also tries apertures that extend outside the DC viewport.
Attributes Tested: See Table 21-2, Column A at the end of this chapter.
Operators Tested: xgl_object_set
                    xgl_multirectangle
                    xgl_polygon
                    xgl_pick_get_identifiers
Output:             Tests nine 2D pick apertures with
                    xgl_multirectangle() (XGL_MULTIRECT_I2D). Tests
                    thirteen 3D pick apertures tested with xgl_polygon()
                    (XGL_PT_F3D).

· pick_set_get_id
Test Types:INDEX, SM
Description:Tests that xgl_object_set() can be used to change the pick identifiers (XGL_CTX_PICK_ID_1/2). Subsequent primitives will have the same pick identifiers until the application changes any one of them. Tries pick primitives with the same/different pick ids.
Attributes Tested: XGL_CTX_PICK_ID_2 and Table 21-2, Column A at the end of this chapter
Operators Tested: xgl_object_set
                    xgl_triangle_strip
                    xgl_multimarker
                    xgl_object_get
Output:             The following occurred:
                    · Checks for default XGL_CTX_PICK_ID_1/2 (should be
                        0) and the pick aperture set
                    · Displays 3D xgl_multimarker() (XGL_PT_F3D) and
                        xgl_triangle_strip() (XGL_PT_F3D,

XGL_FACET_COLOR_NORMAL) and verifies the display
  • Sets pick id1 and id2 and gets id1 and id2 and verifies
  • Displays the markers and the triangle strips again, and gets pick identifiers and verifies
· pick_2d_pp_id
Test Types:INDEX, SM
Description:Tests that the attributes XGL_CTX_PICK_ID_1 and XGL_CTX_PICK_ID_2 can be pushed and popped by
                    xgl_context_push() and xgl_context_pop().
Attributes Tested:  See Table 21-1, Column B at the end of this chapter.
Operators Tested:   xgl_object_set
                    xgl_multirectangle
                    xgl_context_push
                    xgl_pick_get_identifiers
                    xgl_object_get
                    xgl_context_pop
Output:             Pushes and pops the pick id attribute and displays

xgl_multirectangle(), and gets pick id (the multirectangle should be picked)
· pick_set_get_id_rgb
Test Types:RGB, SM
Description:Tests that xgl_object_set() can be used to change the pick identifiers (XGL_CTX_PICK_ID_1/2). Subsequent primitives will have the same pick identifiers until the application changes any one of them. Tries pick primitives with the same/different pick ids.
Attributes Tested: XGL_CTX_PICK_ID_2 and Table 21-2, Column A at the end of this chapter
Operators Tested: xgl_object_set
Output:.....The following occurred:
  • Checks for default XGL_CTX_PICK_ID_1/2 (should be 0) and the pick aperture set
  • Displays 3D xgl_multimarker() (XGL_PT_F3D) and xgl_triangle_strip() (XGL_PT_F3D, XGL_FACET_COLOR_NORMAL) and verifies the display
  • Sets pick id1 and id2 and gets id1 and id2 and verifies
  • Displays the markers and triangle strips again, and gets pick identifiers and verifies
· pick_2d_pp_id_rgb
Test Types:RGB, SM
Description:Tests that the attributes XGL_CTX_PICK_ID_1 and XGL_CTX_PICK_ID_2 can be pushed and popped by
                    xgl_context_push() and xgl_context_pop()
Attributes Tested:  See Table 21-1, Column B at the end of this chapter.
Operators Tested:   xgl_object_set
                    xgl_context_push
                    xgl_multirectangle
                    xgl_pick_get_identifiers
                    xgl_context_pop
Output:             Pushes and pops the pick id attribute and displays

xgl_multirectangle(), and gets pick id (the multirectangle should be picked)
· pick_2d_buf
Test Types:INDEX, SM
Description:Tests that xgl_pick_clear() can clear the contents of the pick buffer, and that xgl_pick_get_identifiers() implicitly calls xgl_pick_clear() to clear the pick buffer
Attributes Tested: See Table 21-1, Column A at the end of this chapter.
Operators Tested: xgl_object_set
                    xgl_multicircle
                    xgl_pick_clear
                    xgl_pick_get_identifiers
Output:             One xgl_multicircle() is picked

(XGL_MULTICIRCLE_F2D) with 10 different pick ids
· pick_2d_style
Test Types:INDEX, SM
Description:Tests that the value of XGL_CTX_PICK_STYLE controls the order in which the identifier pairs stored in the pick buffer are returned
Attributes Tested: XGL_CTX_PICK_STYLE and Table 21-2, Column B at the end of this chapter
Operators Tested: xgl_object_set
                    xgl_multiarc
                    xgl_nurbs_curve
                    xgl_pick_get_identifiers
                    xgl_object_get
Output:             Tests xgl_multiarc() (XGL_MULTIARC_F2D) and
                    xgl_nurbs_curve() (XGL_PT_F2H) with different pick
                    styles (default--XGL_PICK_FIRST_N,
                    XGL_PICK_LAST_N)

· pick_2d_buf_overflow
Test Types:INDEX, SM
Description:Tests that the correct list of identifier pairs of picked primitives is returned when the pick buffer overflows
Attributes Tested: XGL_CTX_PICK_STYLE XGL_CTX_PICK_BUFFER_SIZE and Table 21-2, Column B at the end of this chapter
Operators Tested: xgl_object_set
Output:.....Tests xgl_multiarc() (XGL_MULTIARC_F2D) and xgl_nurbs_curve()(XGL_PT_F2H) (total 300 primitives) with different pick buffer sizes and pick styles:
  • Default buffer size of 256 with default style XGL_PICK_LAST_N
  • Default buffer size of 256 with default style XGL_PICK_FIRST_N
  • Buffer size of 10 with style XGL_PICK_LAST_N
  • Buffer size of 10 with style XGL_PICK_FIRST_N
· pick_2d_buf_size
Test Types:INDEX, SM
Description:Tests that various pick buffer sizes can be set via the context attribute XGL_CTX_PICK_BUFFER_SIZE
Attributes Tested: XGL_CTX_PICK_BUFFER_SIZE
and Table 21-2, Column B at the end of this chapter
Operators Tested: xgl_object_set
Output:· pick_2d_buf_rgbTests xgl_multiarc() (XGL_MULTIARC_F2D) and xgl_nurbs_curve() (XGL_PT_F2H) with different pick buffer sizes: 1, 4, 50, 100, 258, 500
Test Types:RGB, SM
Description:Tests that xgl_pick_clear() can clear the contents of the pick buffer, and that xgl_pick_get_identifiers() implicitly calls xgl_pick_clear() to clear the pick buffer
Attributes Tested: See Table 21-1, Column A at the end of this chapter.
Operators Tested: xgl_pick_clear
                    xgl_object_set
                    xgl_multicircle
                    xgl_pick_get_identifiers
Output:             One xgl_multicircle() is picked

(XGL_MULTICIRCLE_F2D) with ten different pick ids
· pick_2d_style_rgb
Test Types:RGB, SM
Description:Tests that the value of XGL_CTX_PICK_STYLE controls the order in which the identifier pairs stored in the pick buffer are returned
Attributes Tested: XGL_CTX_PICK_STYLE and Table 21-2, Column B at the end of this chapter
Operators Tested: xgl_object_set
                    xgl_multiarc
                    xgl_nurbs_curve
                    xgl_pick_get_identifiers
                    xgl_object_get
Output:             Tests xgl_multiarc() (XGL_MULTIARC_F2D) and
                    xgl_nurbs_curve() (XGL_PT_F2H) with different pick
                    styles (default--XGL_PICK_FIRST_N,
                    XGL_PICK_LAST_N)

· pick_2d_buf_rgb_overflow
Test Types:RGB, SM
Description:Tests that the correct list of identifier pairs of picked primitives is returned when the pick buffer overflows
Attributes Tested: XGL_CTX_PICK_BUFFER_SIZE and Table 21-2, Column B at the end of this chapter
Operators Tested: xgl_object_set
                    xgl_multiarc
                    xgl_nurbs_curve
                    xgl_pick_get_identifiers
                    xgl_object_get
Output:             Tests xgl_multiarc() (XGL_MULTIARC_F2D) and
                    xgl_nurbs_curve() (XGL_PT_F2H) (total 300

primitives) with different pick buffer sizes and pick styles:
  • Default buffer size of 256 with default style XGL_PICK_LAST_N
  • Default buffer size of 256 with style XGL_PICK_FIRST_N
  • Buffer size of 10 with style XGL_PICK_LAST_N
  • Buffer size of 10 with style XGL_PICK_FIRST_N
· pick_2d_buf_size_rgb
Test Types:RGB, SM
Description:Tests that various pick buffer sizes can be set via the context attribute XGL_CTX_PICK_BUFFER_SIZE
Attributes Tested: XGL_CTX_PICK_BUFFER_SIZE
                    XGL_CTX_ARC_FILL_STYLE (XGL_ARC_SECTOR)
                    instead of (XGL_ARC_CHORD)
                    and Table 21-2, Column B at the end of this chapter
Operators Tested:   xgl_object_set
                    xgl_multiarc
                    xgl_nurbs_curve
                    xgl_pick_get_identifiers
                    xgl_object_get
Output:             Tests xgl_multiarc() (XGL_MULTIARC_F2D) and
                    xgl_nurbs_curve() (XGL_PT_F2H) with different pick
                    buffer sizes: 1, 4, 50, 100, 258, 500

· pick_rgb_primitives
Test Types:RGB, SM
Description:Tests that various primitives with default attributes can be picked
Attributes Tested: XGL_CTX_PICK_ID_1
                    XGL_CTX_PICK_ENABLE
                    XGL_CTX_PICK_APERTURE
                    XGL_3D_CTX_HLHSR_MODE
Operators Tested:   xgl_object_set
                    xgl_pick_get_identifiers
                    xgl_multiarc
                    xgl_multicircle
                    xgl_multimarker
                    xgl_multipolyline
                    xgl_multirectangle
                    xgl_polygon
                    xgl_nurbs_curve
                    xgl_quadrilateral_mesh
                    xgl_triangle_strip
                    xgl_stroke_text (2D)
Output:             Picks primitives xgl_multiarc(),
                    xgl_multicircle(), xgl_multimarker(),
                    xgl_multipolyline(), xgl_multirectangle(),
                    xgl_polygon(), xgl_nurbs_curve(),
                    xgl_quadrilateral_mesh(),
                    xgl_triangle_strip(), xgl_stroke_text (2D)

· pick_rgb_ndefault_primitives
Test Types:RGB, SM
Description:Tests that various primitives with nondefault attributes can be picked
Attributes Tested: See Table 21-3 at the end of this chapter.
Operators Tested: xgl_object_set
                    xgl_pick_get_identifiers
                    xgl_multiarc
                    xgl_multicircle
                    xgl_multimarker
                    xgl_multipolyline
                    xgl_multirectangle
                    xgl_polygon
                    xgl_nurbs_curve
                    xgl_quadrilateral_mesh
                    xgl_triangle_strip
                    xgl_stroke_text (3D)
Output:             Picks primitives xgl_multiarc(),
                    xgl_multicircle(), xgl_multimarker(),
                    xgl_multipolyline(), xgl_multirectangle(),
                    xgl_polygon(), xgl_nurbs_curve(),
                    xgl_quadrilateral_mesh(),
                    xgl_triangle_strip(), xgl_stroke_text (3D)

· pick_2d_rgb_trans_clip_prim
Test Types:RGB, SM
Description:Tests whether transformed and clipped primitives can be picked in different pick apertures
Attributes Tested: See Table 21-1, Column C at the end of this chapter.
Operators Tested: xgl_object_set
xgl_pick_get_identifiers
xgl_multirectangle
xgl_object_create
xgl_object_destroy
xgl_transform_scale
xgl_transform_rotate
xgl_transform_translate

Output:· pick_primitivesTests nine pick apertures: picks xgl_multirectangle() in the first five pick apertures but not in the rest of the pick apertures
Test Types:INDEX, SM
Description:Tests that various primitives with default attributes can be picked
Attributes Tested: XGL_CTX_PICK_ID_1
                    XGL_CTX_PICK_ENABLE
                    XGL_CTX_PICK_APERTURE
                    XGL_3D_CTX_HLHSR_MODE
Operators Tested:   xgl_object_set
                    xgl_pick_get_identifiers
                    xgl_multiarc
                    xgl_multicircle
                    xgl_multimarker
                    xgl_multipolyline
                    xgl_multirectangle
                    xgl_polygon
                    xgl_nurbs_curve
                    xgl_quadrilateral_mesh
                    xgl_triangle_strip
                    xgl_stroke_text (2D)
Output:             Picks primitives xgl_multiarc(),
                    xgl_multicircle(), xgl_multimarker(),
                    xgl_multipolyline(), xgl_multirectangle(),
                    xgl_polygon(), xgl_nurbs_curve(),
                    xgl_quadrilateral_mesh(),
                    xgl_triangle_strip(), xgl_stroke_text (2D)

· pick_ndefault_primitives
Test Types:INDEX, SM
Description:Tests that various primitives with nondefault attributes can be picked
Attributes Tested: See Table 21-3 at the end of this chapter.
Operators Tested: xgl_object_set
                    xgl_pick_get_identifiers
                    xgl_multiarc
                    xgl_multicircle
                    xgl_multimarker
                    xgl_multipolyline
                    xgl_multirectangle
                    xgl_polygon
                    xgl_nurbs_curve
                    xgl_quadrilateral_mesh
                    xgl_triangle_strip
                    xgl_stroke_text (3D)
Output:             Picks primitives xgl_multiarc(),
                    xgl_multicircle(), xgl_multimarker(),
                    xgl_multipolyline(), xgl_multirectangle(),
                    xgl_polygon(), xgl_nurbs_curve(),
                    xgl_quadrilateral_mesh(),
                    xgl_triangle_strip(), xgl_stroke_text (3D)

· pick_2d_trans_clip_prim
pick_prims3
Test Types:INDEX, SM
Description:Tests whether transformed and clipped primitive can be picked in different pick apertures
Attributes Tested: See Table 21-1, Column C at the end of this chapter.
Operators Tested: xgl_object_set

Output:.....Tests nine pick apertures: picks xgl_multirectangle() in the first five pick apertures but not in the rest of the pick apertures
Table 21-1
Column AColumn BColumn C
XGL_CTX_PICK_ID_1XGL_CTX_PICK_ID_1XGL_CTX_PICK_ID_1
XGL_CTX_PICK_ENABLEXGL_CTX_PICK_ID_2XGL_CTX_PICK_APERTURE
XGL_CTX_PICK_APERTUREXGL_CTX_PICK_ENABLEXGL_CTX_PICK_ENABLE
XGL_CTX_RENDERINGXGL_CTX_PICK_APERTUREXGL_CTX_VIEW_TRANS
XGL_CTX_VIEW_CLIP_BOUNDS
XGL_CTX_CLIP_PLANES
Table 21-2
Column AColumn B
XGL_CTX_PICK_ID_1XGL_CTX_PICK_ID_1
XGL_CTX_PICK_ENABLEXGL_CTX_PICK_ID_2
XGL_CTX_PICK_APERTUREXGL_CTX_PICK_ENABLE
XGL_3D_CTX_HLHSR_MODE (XGL_HLHSR_Z_BUFFER)XGL_CTX_PICK_APERTURE
XGL_CTX_NEW_FRAME_ACTION
(XGL_CTX_NEW_FRAME_CLEAR |
(XGL_CTX_NEW_FRAME_HLHSR_ACTION)
XGL_CTX_RENDERING
XGL_CTX_RENDERINGXGL_CTX_ARC_FILL_STYLE (XGL_ARC_CHORD)

XGL_CTX_NURBS_CURVE_APPROX
XGL_CTX_NURBS_CURVE_APPROX_VAL
Table 21-3
XGL_CTX_PICK_ID_1XGL_CTX_PICK_ENABLEXGL_CTX_PICK_APERTURE
XGL_CTX_EDGE_COLORXGL_CTX_SURF_EDGE_FLAGXGL_3D_CTX_HLHSR_MODE
XGL_CTX_ARC_FILL_STYLEXGL_CTX_SURF_FRONT_FILL_ STYLEXGL_CTX_MARKER_SCALE_ FACTOR
XGL_CTX_MARKERXGL_CTX_MARKER_COLORXGL_CTX_LINE_COLOR
XGL_CTX_LINE_CAPXGL_CTX_LINE_JOINXGL_CTX_LINE_PATTERN
XGL_CTX_LINE_STYLEXGL_CTX_LINE_WIDTH_SCALE_ FACTORXGL_CTX_NURBS_CURVE_APPROX
XGL_CTX_NURBS_CURVE_APPROX _VALXGL_CTX_STEXT_CHAR_HEIGHTXGL_CTX_STEXT_CHAR_SPACING
XGL_CTX_STEXT_CHAR_ EXPANSION_FACTORXGL_CTX_STEXT_PATHXGL_CTX_STEXT_CHAR_UP_ VECTOR,
XGL_CTX_STEXT_ALIGN_HORIZXGL_CTX_STEXT_ALIGN_VERTXGL_CTX_STEXT_COLOR