VisualizationFoundation CAT2DPolygonGP

Usage: you must use this class as is. You should never derive it.


public class CAT2DPolygonGP

Class to create the graphic primitive of a 2D polygon.
Role:

           Example of a CAT2DPolygon with 4 points :

             point 1 X--------------------X point 2
                     |                    |
                     |                    |
             point 4 X--------------------X point 3
              


Constructor and Destructor Index


o CAT2DPolygonGP()
Default constructor.
o CAT2DPolygonGP(float[],int,int)
Constructs a 2D polygon graphic primitive from a list of points.

Method Index


o Draw(CATRender&)
Draws the 2D line.
o Get(float**,int*,int*,int*,int**,int**,int**)
Retrieves polygon parameters.
o IsFilled()
Returns whether or not the 2D polygon is filled.

Constructor and Destructor


o CAT2DPolygonGP
public CAT2DPolygonGP()
Default constructor.
o CAT2DPolygonGP
public CAT2DPolygonGP( const iPoints,
const iNbPoints,
const iFill= FILL)
Constructs a 2D polygon graphic primitive from a list of points. The last point is linked to the first point.
Parameters:
iPoints
Array containing the x, y coordinates for each point of the polygon. Its size is equal to two times the number of points. So, the coordinates x, y of the first point are respectively stored in iPoints[0], and iPoints[1], the coordinates x, y of the second point, in iPoints[2], iPoints[3], and so on...
iNbPoints
The number of points used to define the polygon.
iFill
the integer which allows to construct a 2D polygon just with edges or filled with graphic attributes.
legal values:
  • NOFILL : just edges are drawn.
  • FILL : the 2D circle arc or the 2D circle is filled with graphic attributes.
  • FILL_ANTIALIASED : the 2D circle arc or the 2D circle is filled with graphic attributes and antialiasing.
  • The default value is FILL.

    Methods


    o Draw
    public virtual Draw( iRender)
    Draws the 2D line.
    Parameters:
    iRender
    The render through which the 2D polygon is drawn.
    o Get
    public Get( oPoints,
    oNbPoint,
    oFill,
    oNbTriangle,
    oType,
    oTriangle,
    oVertex)
    Retrieves polygon parameters.
    Parameters:
    oPoints
    Array containing the x, y coordinates for each point of the polygon. Its size is equal to two times the number of points. So, the coordinates x, y of the first point are respectively stored in iPoints[0], and iPoints[1], the coordinates x, y of the second point, in iPoints[2], iPoints[3], and so on...
    oNbPoint
    The number of points used to define the polygon.
    oFill
    the integer which allows to construct a 2D polygon just with edges or filled with graphic attributes.
    legal values:
    • NOFILL : just edges are drawn.
    • FILL : the 2D circle arc or the 2D circle is filled with graphic attributes.
    oNbTriangles
    The number of group of triangles which compose the 2D polygon after the tesselation.
    oType
    Array which contain the type of each group of triangles.
    legal values:
    • 0 : single triangles
    • 1 : triangle strip
    • 2 : triangle fan
    • 4 : same as 0
    • 5 : same as 1
    • 6 : same as 2
    Its size is equal to oNbTriangles.
    oTriangles
    Array which contain the number of vertex for each group of triangles. Its size is equal to oNbTriangles.
    oVertex
    Array of indices of vertex which compose the 2D polygon.
    This array is composed of various arrays which represent one group of triangles. And each group of triangles have a type defined by the array "oType".
    • If the group is made of single triangles, indices are written like in the following sample :
      	1              4
      	|\           /|
      	| \         / |
      	|  \       /  |
      	|   \     /   |
      	|____\   /____|
      	2     3  5    6  
      	
    • if the group is a triangle strip, indices are written like in the following sample :
      	1     3      4
      	-------------
      	\     |\     |\
      	 \    | \    | \
      	  \   |  \   |  \
      	   \  |   \  |   \
      	    \ |    \ |    \
      	     \|_____\|_____\
      	      2      5       6
      	
    • if the group is a triangle fan, indices are written like in the following sample :
      	2      1
      	 _______    
      	|     /|\
      	|    / | \
      	|   /  |  \
      	|  /   |   \
      	| /    |    \
      	|/_____|_____\
      	3      4      5
      	
    o IsFilled
    public IsFilled()
    Returns whether or not the 2D polygon is filled.

    This object is included in the file: CAT2DPolygonGP.h
    If needed, your Imakefile.mk should include the module: CATVisFoundation

    Copyright © 1999-2015, Dassault Systèmes. All rights reserved.