VisualizationFoundation CAT3DPlanarFaceGP
Usage: you must use this class as is. You should never derive it.
public class CAT3DPlanarFaceGP
Class to create the graphic primitive of a 3D planar face.
Role: Special face with only one normal for every vertices.
To be used like a CAT3DFaceGP, but with only one normal.
Constructor and Destructor Index
- o
CAT3DPlanarFaceGP(void)
- Default constructor
- o
CAT3DPlanarFaceGP(float[],int,float[],int[],int,int[],int,int[],int[],int,int[],float*,int,char,float*,float*)
- Constructs a 3D planar face graphic primitive from the face vertices coordinates list,
and their texture coordinates.
- o
CAT3DPlanarFaceGP(float[],int,float[],int[],int,int[],int,int[],int[],int,int[],float*,int,char,float*,float,float*)
- Constructs a 3D planar face graphic primitive from the face vertices coordinates list,
and their texture coordinates.
Method Index
- o
Draw(CATRender&)
- Draws the face.
Constructor and Destructor
o CAT3DPlanarFaceGP
public CAT3DPlanarFaceGP( | | ) |
-
Default constructor
o CAT3DPlanarFaceGP
public CAT3DPlanarFaceGP( | const | iVertices, |
| const | iVerticesArraySize, |
| const | iNormals, |
| const | iTriangleIndice, |
| const | iNbTriangle, |
| const | iTriangleStripIndice, |
| const | iNbTriangleStrip, |
| const | iNbVertexPerTriangleStrip, |
| const | iTriangleFanIndice, |
| const | iNbTriangleFan, |
| const | iNbVertexPerTriangleFan, |
| const | iTextureCoord | =NULL, |
| const | iTextureFormat | =3, |
| const | iAllocMode | = ALLOCATE_VERTICES | ALLOCATE_NORMALS | ALLOCATE_TEXTURES, |
| const | iTanBinorm | =NULL, |
| const | iUV | =NULL) |
-
Constructs a 3D planar face graphic primitive from the face vertices coordinates list,
and their texture coordinates. Relying on the allocation mode, parameter data may have to be freed
after the face is created. Set, strip and fan information is always
duplicated at the face creation. Texture information can be provided
at this stage when the texture coordinates have already been computed.
- Parameters:
-
- iVertices
- Array made of vertices coordinates: XYZXYZXYZ...
Its size is equal to three times the face vertices number.
- iVerticesArraySize
- The size, in floats, of the iVertices array. Equal to three times the
vertices number.
- iNormals
- Array made of the normal coordinates. Its size is always equal to three.
- iTriangleIndices
- This array is used to store the single triangles vertices. Each of its field represents
a vertex index in the iVertices array.
As we find, in the iVertices array, the XYZ coordinates for each
vertex, the indices used to designate the vertices are multiples of three.
So, the first three indices of the iTriangleIndices array, are the three vertices indices of the face first
single triangle.
-----------------
| iTriangleIndices|
-----------------
| i00 | }
| i01 | } triangle 0 defined by index i00, i01 and i02
| i02 | }
| . |
| . |
| ij0 | }
| ij1 | } triangle j defined by index ij0, ij1 and ij2.
| ij2 | }
| . |
| . |
-----------------
For example, index ij0 enables access to the face j-th single triangle first vertex,
which coordinates are X = iVertices[ij0], Y = iVertices[ij0 + 1] and Z = iVertices[ij0 + 2], and
which normal has coordinates Nx = iNormals[ij0], Ny = iNormals[ij0 + 1] and Nz = iNormals[ij0 + 2].
- iNbTriangle
- The number of single triangles in the face.
- iTriangleStripIndices
- Array used to store the face triangles strips vertices. Each field contains a
vertex index, in the iVertices array. As, we find, in the
iVertices array, the XYZ coordinates for each
vertex, the indices used to designate the vertices are multiples of three.
----------------------
| iTriangleStripIndices|
----------------------
| i00 | }
| i01 | } first triangle strip defined
| . | } by the first n1 indices
| . | }
| i0n1 | }
| . |
| . |
| . |
| ij0 | }
| ij1 | }
| . | } triangle strip j
| . | } with nj vertices
| ijnj | }
----------------------
For example, index ij0 allows to access to the face j-th strip first vertex
wich coordinates are X = iVertices[ij0], Y = iVertices[ij0 + 1] and Z = iVertices[ij0 + 2], and
which normal coordinates are Nx = iNormals[ij0], Ny = iNormals[ij0 + 1] and Nz = iNormals[ij0 + 2].
- iNbTriangleStrip
- The number of face triangles strips.
- iNbVertexPerTriangleStrip
- Array containing the number of vertices for each face triangles strip.
The size of this array is equal to iNbTriangleStrip. For example, the first strip
is made with iNbVertexPerTriangleStrip[0] vertices.
--------------------------
|iNbVertexPerTriangleStrip |
--------------------------
| n1 |
| . |
| . | m = Number of triangle strips(iNbTriangleStrip)
| nm | nm = number of vertices of the m-th strip. (iNbVertexPerTriangleStrip[m]
--------------------------
- iTriangleFanIndices
- Array used to store the face triangles fans vertices. Each field contains a
vertex index, in the iVertices array. As, we find, in the
iVertices array, the XYZ coordinates for each
vertex, the indices used to designate the vertices are multiples of three.
----------------------
| iTriangleFanIndices |
----------------------
| i00 | }
| i01 | } first triangle fan defined
| . | } by the first n1 indices
| . | }
| i0n1 | }
| . |
| . |
| . |
| ij0 | }
| ij1 | }
| . | } triangle fan j
| . | } with nj vertices
| ijnj | }
----------------------
For example, index ij0 allows to access to the face j-th fan first vertex
wich coordinates are X = iVertices[ij0], Y = iVertices[ij0 + 1] and Z = iVertices[ij0 + 2], and
which normal coordinates are Nx = iNormals[ij0], Ny = iNormals[ij0 + 1] and Nz = iNormals[ij0 + 2].
Each ij0, j in [0, jn], represents the j-th fan center.
- iNbTriangleFan
- The number of face triangles fans.
- iNbVertexPerTriangleFan
- Array containing the number of vertices for each face triangles fan.
The size of this array is equal to iNbTriangleFan. For example, the first fan
is made with iNbVertexPerTriangleStrip[0] vertices.
--------------------------
| iNbVertexPerTriangleFan |
--------------------------
| n1 |
| . |
| . | m = Number of triangle fans(iNbTriangleFan)
| nm | nm = number of vertices of the m-th fan. (iNbVertexPerTriangleFan[m]
--------------------------
- iTextureCoord
- Array of texture coordinates. Each vertex has an associated position
in the texture map. The number of texture coordinates groups is always equal to the number of
vertices.
Because vertex and normal information is being sorted at the face
creation, texture coordinates are to be generated with the tessellation
parameters that are retrieved after the face creation (ie with
properly translated indices). Nevertheless, a mapping operator can be
applied at anytime, when the face is the owner of it's vertex data.
If computed before the face creation, texture coordinates can be given
at the face construction method. In this case, coordinates order is
rearranged in parallel with vertices coordinates.
- iTextureFormat
- iTextureFormat is the number of fields associated to one vertex in the iTextureCoord array.
It is also the number of texture coordinates associated to each vertex.
Indeed, each vertex has associated coordinates in the texture map. The
number of coordinates depends on the map dimension: the texture map
may be in 1D, 2D or 3D.
Legal values:
- 1
- The texture map is a one dimension map. Each vertex has a single associated texture coordinate
- 2
- The texture map is a two-dimension map. Each vertex has two associated texture coordinates
- 3
- The texture map is a three-dimension map. Each vertex has three associated texture coordinates
- iAllocMode
- The CAT3DFaceGP, and it's planar inherited object, the CAT3DPlanarFaceGP
have allocation flags ruling their memory comsumption for vertices and
normals:
The default value is ALLOCATE_VERTICES | ALLOCATE_NORMALS.
CAUTION: The CAT3DPlanarFaceGP is an immutable object. GET_***** alloc mode only avoid an expensive copy
Modifying the iVertices pointer used with GET_VERTICES or the iNormals pointer used with GET_NORMALS won't update the CAT3DPlanarFaceGP's data.
You need to create a new GP, or recycle the old one with CAT3DFaceGPEditHelper, even if you used GET_****** alloc mode.
Legal values:
- ALLOCATE_VERTICES
- Vertex array is the property of the face and
is to be deleted with it. If textures are defined, texture coordinates
are to be destroyed too.
- GET_VERTICES
- Vertex array is not duplicated at the face creation, but
is to be deleted during the object deletion. Texture coordinates are
to be shared, but in this case, their format must be 3.
- ALLOCATE_NORMALS
- Normal array is the property of the face and
is to be deleted with it. Planar faces always allocate their normals.
- GET_NORMALS
- Normal array is not duplicated at the face creation
although, as for vertices, it will be destroyed in the same time the object
is deleted.
o CAT3DPlanarFaceGP
public CAT3DPlanarFaceGP( | const | iVertices, |
| const | iVerticesArraySize, |
| const | iNormals, |
| const | iTriangleIndice, |
| const | iNbTriangle, |
| const | iTriangleStripIndice, |
| const | iNbTriangleStrip, |
| const | iNbVertexPerTriangleStrip, |
| const | iTriangleFanIndice, |
| const | iNbTriangleFan, |
| const | iNbVertexPerTriangleFan, |
| const | iTextureCoord, |
| const | iTextureFormat, |
| const | iAllocMode, |
| const | iTanBinorm, |
| const | iToleranceScale, |
| const | iUV | = NULL) |
-
Constructs a 3D planar face graphic primitive from the face vertices coordinates list,
and their texture coordinates. Relying on the allocation mode, parameter data may have to be freed
after the face is created. Set, strip and fan information is always
duplicated at the face creation. Texture information can be provided
at this stage when the texture coordinates have already been computed.
- Parameters:
-
- iVertices
- Array made of vertices coordinates: XYZXYZXYZ...
Its size is equal to three times the face vertices number.
- iVerticesArraySize
- The size, in floats, of the iVertices array. Equal to three times the
vertices number.
- iNormals
- Array made of the normal coordinates. Its size is always equal to three.
- iTriangleIndices
- This array is used to store the single triangles vertices. Each of its field represents
a vertex index in the iVertices array.
As we find, in the iVertices array, the XYZ coordinates for each
vertex, the indices used to designate the vertices are multiples of three.
So, the first three indices of the iTriangleIndices array, are the three vertices indices of the face first
single triangle.
-----------------
| iTriangleIndices|
-----------------
| i00 | }
| i01 | } triangle 0 defined by index i00, i01 and i02
| i02 | }
| . |
| . |
| ij0 | }
| ij1 | } triangle j defined by index ij0, ij1 and ij2.
| ij2 | }
| . |
| . |
-----------------
For example, index ij0 enables access to the face j-th single triangle first vertex,
which coordinates are X = iVertices[ij0], Y = iVertices[ij0 + 1] and Z = iVertices[ij0 + 2], and
which normal has coordinates Nx = iNormals[ij0], Ny = iNormals[ij0 + 1] and Nz = iNormals[ij0 + 2].
- iNbTriangle
- The number of single triangles in the face.
- iTriangleStripIndices
- Array used to store the face triangles strips vertices. Each field contains a
vertex index, in the iVertices array. As, we find, in the
iVertices array, the XYZ coordinates for each
vertex, the indices used to designate the vertices are multiples of three.
----------------------
| iTriangleStripIndices|
----------------------
| i00 | }
| i01 | } first triangle strip defined
| . | } by the first n1 indices
| . | }
| i0n1 | }
| . |
| . |
| . |
| ij0 | }
| ij1 | }
| . | } triangle strip j
| . | } with nj vertices
| ijnj | }
----------------------
For example, index ij0 allows to access to the face j-th strip first vertex
wich coordinates are X = iVertices[ij0], Y = iVertices[ij0 + 1] and Z = iVertices[ij0 + 2], and
which normal coordinates are Nx = iNormals[ij0], Ny = iNormals[ij0 + 1] and Nz = iNormals[ij0 + 2].
- iNbTriangleStrip
- The number of face triangles strips.
- iNbVertexPerTriangleStrip
- Array containing the number of vertices for each face triangles strip.
The size of this array is equal to iNbTriangleStrip. For example, the first strip
is made with iNbVertexPerTriangleStrip[0] vertices.
--------------------------
|iNbVertexPerTriangleStrip |
--------------------------
| n1 |
| . |
| . | m = Number of triangle strips(iNbTriangleStrip)
| nm | nm = number of vertices of the m-th strip. (iNbVertexPerTriangleStrip[m]
--------------------------
- iTriangleFanIndices
- Array used to store the face triangles fans vertices. Each field contains a
vertex index, in the iVertices array. As, we find, in the
iVertices array, the XYZ coordinates for each
vertex, the indices used to designate the vertices are multiples of three.
----------------------
| iTriangleFanIndices |
----------------------
| i00 | }
| i01 | } first triangle fan defined
| . | } by the first n1 indices
| . | }
| i0n1 | }
| . |
| . |
| . |
| ij0 | }
| ij1 | }
| . | } triangle fan j
| . | } with nj vertices
| ijnj | }
----------------------
For example, index ij0 allows to access to the face j-th fan first vertex
wich coordinates are X = iVertices[ij0], Y = iVertices[ij0 + 1] and Z = iVertices[ij0 + 2], and
which normal coordinates are Nx = iNormals[ij0], Ny = iNormals[ij0 + 1] and Nz = iNormals[ij0 + 2].
Each ij0, j in [0, jn], represents the j-th fan center.
- iNbTriangleFan
- The number of face triangles fans.
- iNbVertexPerTriangleFan
- Array containing the number of vertices for each face triangles fan.
The size of this array is equal to iNbTriangleFan. For example, the first fan
is made with iNbVertexPerTriangleStrip[0] vertices.
--------------------------
| iNbVertexPerTriangleFan |
--------------------------
| n1 |
| . |
| . | m = Number of triangle fans(iNbTriangleFan)
| nm | nm = number of vertices of the m-th fan. (iNbVertexPerTriangleFan[m]
--------------------------
- iTextureCoord
- Array of texture coordinates. Each vertex has an associated position
in the texture map. The number of texture coordinates groups is always equal to the number of
vertices.
Because vertex and normal information is being sorted at the face
creation, texture coordinates are to be generated with the tessellation
parameters that are retrieved after the face creation (ie with
properly translated indices). Nevertheless, a mapping operator can be
applied at anytime, when the face is the owner of it's vertex data.
If computed before the face creation, texture coordinates can be given
at the face construction method. In this case, coordinates order is
rearranged in parallel with vertices coordinates.
- iTextureFormat
- iTextureFormat is the number of fields associated to one vertex in the iTextureCoord array.
It is also the number of texture coordinates associated to each vertex.
Indeed, each vertex has associated coordinates in the texture map. The
number of coordinates depends on the map dimension: the texture map
may be in 1D, 2D or 3D.
Legal values:
- 1
- The texture map is a one dimension map. Each vertex has a single associated texture coordinate
- 2
- The texture map is a two-dimension map. Each vertex has two associated texture coordinates
- 3
- The texture map is a three-dimension map. Each vertex has three associated texture coordinates
- iAllocMode
- The CAT3DFaceGP, and it's planar inherited object, the CAT3DPlanarFaceGP
have allocation flags ruling their memory comsumption for vertices and
normals:
The default value is ALLOCATE_VERTICES | ALLOCATE_NORMALS.
CAUTION: The CAT3DPlanarFaceGP is an immutable object. GET_***** alloc mode only avoid an expensive copy
Modifying the iVertices pointer used with GET_VERTICES or the iNormals pointer used with GET_NORMALS won't update the CAT3DPlanarFaceGP's data.
You need to create a new GP, or recycle the old one with CAT3DFaceGPEditHelper, even if you used GET_****** alloc mode.
Legal values:
- ALLOCATE_VERTICES
- Vertex array is the property of the face and
is to be deleted with it. If textures are defined, texture coordinates
are to be destroyed too.
- GET_VERTICES
- Vertex array is not duplicated at the face creation, but
is to be deleted during the object deletion. Texture coordinates are
to be shared, but in this case, their format must be 3.
- ALLOCATE_NORMALS
- Normal array is the property of the face and
is to be deleted with it. Planar faces always allocate their normals.
- GET_NORMALS
- Normal array is not duplicated at the face creation
although, as for vertices, it will be destroyed in the same time the object
is deleted.
Methods
o Draw
public virtual Draw( | | iRender) |
-
Draws the face.
- Parameters:
-
- iRender
- The render through which the face is drawn.
This object is included in the file: CAT3DPlanarFaceGP.h
If needed, your Imakefile.mk should include the module: CATVisFoundation
Copyright © 1999-2015, Dassault Systèmes. All rights reserved.