VisualizationFoundation CAT3DBoundingGP

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


public class CAT3DBoundingGP

Class to create a graphic primitive which geometry is enclosed in a bounding element.
Role: The box can either be an Axis Aligned Bounding Box (AABB) or an Object Bounding Box (OBB). - The AABB is aligned on the 3D axis system and so, of easy use with the GP coordinates system, that can be obtained by reading the Representation tree. - The OBB is the best bounding box enclosing an object, and it is built through the use of the convex hull of the GP. Presently, the box is computed in the GP axis coordinate system and is an AABB. We although store a Bounding Sphere. Box and sphere are separately computed and have no common parameters, but are both enclosing the GP's geometry. Don't worry about how to build it... The GP that inherits from this GP have to update the box included in this object, with the provided methods. As for the children, we have a provided method to retrieve tesselation parameters. This method will only be efficient in the subclasses that have overloaded it.


Constructor and Destructor Index


o CAT3DBoundingGP(void)
Constructs a boxed graphic primitive.

Method Index


o Clear(int*,float**,int*,float**,int*,int**,int*,int**,int*,int**,int**,int*,int**)
o Clear(int*,float const**,int*,float const**,int*,int const**,int*,int const**,int*,int const**,int const**,int*,int const**)
Clears tesselation data by deallocating memory.
o ClearUV(int*,float**,int*)
o ClearUV(int*,float const**,int*)
Clears surfacic mesh parameters data structure by deallocating memory.
o ClearVertices(int*,float**,int*)
o ClearVertices(int*,float const**,int*)
Clears vertices data structure by deallocating memory.
o ComputeBox(void)
Box and sphere computation method prototype.
o Draw(CATRender&)
Draws the 3D bounding GP.
o Get(int*,float**,int*,float**,int*,int**,int*,int**,int*,int**,int**,int*,int**)
o GetBoxCenter(void)
Gets the box center coordinates.
o GetBoxDimensions(void)
Gets the X,Y,Z half box spans.
o GetReadOnly(int*,float const**,int*,float const**,int*,int const**,int*,int const**,int*,int const**,int const**,int*,int const**)
Retrieves the tesselation information from the 3D bounding GP.
o GetSphereCenter(void)
Gets the bounding sphere center coordinates.
o GetSphereRadius(void)
Gets the bounding sphere radius.
o GetTextureCoordinates(float**)
o GetTextureCoordinates(float**,int*)
o GetTextureCoordinatesReadOnly(float const**)
o GetTextureCoordinatesReadOnly(float const**,int*)
Retrieves the texture coordinates.
o GetUV(int*,float**,int*)
o GetUVReadOnly(int*,float const**,int*)
Retrieves the 3D bounding GP surfacic mesh parameters.
o GetVertices(int*,float**,int*)
o GetVerticesReadOnly(int*,float const**,int*)
Retrieves 3D bounding GP vertices.
o HasNormals(void)
Tests whether the 3D bounding GP is owner of its normals informations.
o HasVertices(void)
Tests whether the 3D bounding GP is owner of its vertices informations.
o SetBoxCenter(float*)
Sets the box center coordinates.
o SetBoxDimensions(float*)
Sets the X,Y,Z half box spans.
o SetSphereCenter(float*)
Sets the bounding sphere center.
o SetSphereRadius(float)
Sets the bounding sphere radius.
o SetTextureCoordinates(float*,int)

Constructor and Destructor


o CAT3DBoundingGP
public CAT3DBoundingGP( )
Constructs a boxed graphic primitive.

Methods


o Clear
public Clear( iAllocate,
iVertices,
iVerticesArraySize,
iNormals,
iNormalsArraySize,
iTriangleIndices,
iNbTriangle,
iTriangleStripIndices,
iNbTriangleStrip,
iNbVertexPerTriangleStrip,
iTriangleFanIndices,
iNbTriangleFan,
iNbVertexPerTriangleFan)
Deprecated:
R216
o Clear
public Clear( iAllocate,
iVertices,
iVerticesArraySize,
iNormals,
iNormalsArraySize,
iTriangleIndices,
iNbTriangle,
iTriangleStripIndices,
iNbTriangleStrip,
iNbVertexPerTriangleStrip,
iTriangleFanIndices,
iNbTriangleFan,
iNbVertexPerTriangleFan)
Clears tesselation data by deallocating memory. The following parameters description does not explain in detail each of them. It is only an overview of these parameters regarding to the Clear method. The full description can be found in the method comments.
Parameters:
iAllocate
Flag to specify whether the data you are passing on were allocated by this 3D bounding GP or not.
Legal values:
1
passed data were allocated by this 3D bounding GP and must be deallocated
0
passed data were not allocated by this 3D bounding GP and nothing is done
iVertices
Array of 3D bounding GP vertices coordinates.
iVerticesArraySize
Size of iVertices array. If equal to zero, iVertices is not deleted.
iNormals
Array of 3D bounding GP normals coordinates.
iNormalsArraySize
Size of iNormals array. If equal to zero, iNormals is not deleted.
iTriangleIndices
Array of 3D bounding GP single triangles vertices coordinates.
iNbTriangle
The number of single triangles in the 3D bounding GP. If equal to zero, iTriangleIndices is not deleted.
iTriangleStripIndices
Array of 3D bounding GP strips triangles vertices coordinates.
iNbTriangleStrip
The number of triangles strips in the 3D bounding GP. If equal to zero, iTriangleStripIndices and iNbVertexPerTriangleStrip are not deleted.
iNbVertexPerTriangleStrip
Array containing the number of vertices for each 3D bounding GP triangles strip.
iTriangleFanIndices
Array of 3D bounding GP fans triangles vertices coordinates.
iNbTriangleFan
The number of triangles fans in the 3D bounding GP. If equal to zero, iTriangleFanIndices and iNbVertexPerTriangleFan are not deleted.
iNbVertexPerTriangleFan
Array containing the number of vertices for each 3D bounding GP triangles fan.
o ClearUV
public ClearUV( iAllocate,
iUV,
iUVArraySize)
Deprecated:
R216
o ClearUV
public ClearUV( iAllocate,
iUV,
iUVArraySize)
Clears surfacic mesh parameters data structure by deallocating memory. The following parameters description does not explain in detail each of them. It is only an overview of these parameters regarding to the ClearUV method. The full description can be found in the method comments.
Parameters:
iAllocate
Flag to specify whether the data you are passing on were allocated by this 3D bounding GP or not.
Legal values:
1
passed data were allocated by this 3D bounding GP and must be deallocated
0
passed data were not allocated by this 3D bounding GP and nothing is done
iUV
UV array. Each vertex has an associated UV couple.
iUVArraySize
UV array size. If equal to 0, iUVArray is not deleted.
o ClearVertices
public ClearVertices( iAllocate,
iVertices,
iVerticesArraySize)
Deprecated:
R216
o ClearVertices
public ClearVertices( iAllocate,
iVertices,
iVerticesArraySize)
Clears vertices data structure by deallocating memory. The following parameters description does not explain in detail each of them. It is only an overview of these parameters regarding to the ClearVertices method. The full description can be found in the method comments.
Parameters:
iAllocate
Flag to specify whether the data you are passing on were allocated by this 3D bounding GP or not.
Legal values:
1
passed data were allocated by this 3D bounding GP and must be deallocated
0
passed data were not allocated by this 3D bounding GP and nothing is done
iVertices
Array of 3D bounding GP vertices coordinates.
iVerticesArraySize
Size of iVertices array. If equal to zero, iVertices is not deleted.
o ComputeBox
public virtual ComputeBox( )
Box and sphere computation method prototype.
o Draw
public virtual Draw( )
Draws the 3D bounding GP.
Parameters:
iRender
The render through which the 3D bounding GP is drawn.
o Get
public virtual Get( oAllocate,
oVertices,
oVerticesArraySize,
oNormals,
oNormalsArraySize,
oTriangleIndices,
oNbTriangle,
oTriangleStripIndices,
oNbTriangleStrip,
oNbVertexPerTriangleStrip,
oTriangleFanIndices,
oNbTriangleFan,
oNbVertexPerTriangleFan)
Deprecated:
R216 See GeatReadOnly for read access and derived classes for write access
o GetBoxCenter
public GetBoxCenter( )
Gets the box center coordinates.
Returns:
returns the array containing the box center coordinates. This array size is equal to three.
o GetBoxDimensions
public GetBoxDimensions( )
Gets the X,Y,Z half box spans.
Returns:
returns the array containing the half box spans coordinates. Its size is equal to three.
o GetReadOnly
public virtual GetReadOnly( oAllocate,
oVertices,
oVerticesArraySize,
oNormals,
oNormalsArraySize,
oTriangleIndices,
oNbTriangle,
oTriangleStripIndices,
oNbTriangleStrip,
oNbVertexPerTriangleStrip,
oTriangleFanIndices,
oNbTriangleFan,
oNbVertexPerTriangleFan)
Retrieves the tesselation information from the 3D bounding GP.
Role: As this method is designed to return values on its parameters, it has to be called like this :
 int allocate;
 float const* vertices;
 ...
 GetReadOnly(&allocate, &vertices, ...);
 

Parameters:
oAllocate
Flag specifiying whether retrieved data is copied or not.
Legal values:
1
retrieved data is copied.
0
retrieves references on data.
oAllocate flag is always returned equal to 0: Get() only retrieves references on stored data.
oVertices
Retrieves an array made of face vertices coordinates: XYZXYZXYZ... Its size is equal to three times the 3D bounding GP vertices number.
oVerticesArraySize
Retrieves the size, in floats, of the oVertices array. Equal to three times the vertices number. If information on vertices is shared with another element, returned size for this parameter is equal to 0.
oNormals
Retrieves an array made of normals coordinates. It is organized as oVertices : one vertex has exactly one normal at the same field entry.
oNormalsArraySize
Retrieves The size, in floats, of the oNormal array. Equal to three times the number of normals. If information on normals is shared with another element, returned size for this parameter is equal to 0.
oTriangleIndices
Retrieves the array used to store the single triangles vertices. Each of its field represents a vertex index, in the oVertices array. As, we find, in the *oVertices 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 *oTriangleIndices array, are the indices of the 3D bounding GP first single triangle three vertices.

                 -----------------       
                |*oTriangleIndices |
                 -----------------
                |       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 3D bounding GP j-th single triangle first vertex, which coordinates are X = *oVertices[ij0], Y = *oVertices[ij0+1] and Z = *oVertices[ij0+2], and which normal has coordinates Nx = *oNormals[ij0], Ny = *oNormals[ij0+1] and Nz = *oNormals[ij0+2].
oNbTriangle
Retrieves the number of single triangles in the 3D bounding GP.
oTriangleStripIndices
Retrieves the array used to store the 3D bounding GP triangles strips vertices. Each field contains a vertex index, belonging to one of the strips, in the oVertices array. As, we find, in the oVertices array, the XYZ coordinates for each vertex, the indices used to designate the vertices are multiples of three.


                   ----------------------
                  | oTriangleStripIndices |
                   ----------------------
                  |          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 3D bounding GP j-th strip first vertex wich coordinates are X = *oVertices[ij0], Y = *oVertices[ij0 + 1] and Z = *oVertices[ij0 + 2], and which normal coordinates are Nx = *oNormals[ij0], Ny = *oNormals[ij0 + 1] and Nz = *oNormals[ij0 + 2].
oNbTriangleStrip
Retrieves the number of 3D bounding GP triangles strips.
oNbVertexPerTriangleStrip
Retrieves an array containing the number of vertices for each 3D bounding GP triangles strip. The size of this array is equal to *oNbTriangleStrip. For example, the first strip is made with *oNbVertexPerTriangleStrip[0] vertices.
                --------------------------
               |*oNbVertexPerTriangleStrip|
                --------------------------
               |             n1           |
               |             .            |
               |             .            |   m = Number of triangle strips(*oNbTriangleStrip)
               |             nm           |   nm = number of vertices of the m-th strip. (*oNbVertexPerTriangleStrip[m]
                --------------------------    

   
oTriangleFanIndices
Retrieves the array used to store the 3D bounding GP triangles fans vertices. Each field contains a vertex index, belonging to one of the fans, in the oVertices array. As, we find, in the oVertices array, the XYZ coordinates for each vertex, the indices used to designate the vertices are multiples of three.


                   ----------------------
                  | *oTriangleFanIndices  |
                   ----------------------
                  |          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 3D bounding GP j-th fan first vertex wich coordinates are X = *oVertices[ij0], Y = *oVertices[ij0 + 1] and Z = *oVertices[ij0 + 2], and which normal coordinates are Nx = *oNormals[ij0], Ny = *oNormals[ij0 + 1] and Nz = *oNormals[ij0 + 2]. Each ij0, j in [0, jn], represents the j-th fan center.
oNbTriangleFan
Retrieves the number of 3D bounding GP triangles fans.
oNbVertexPerTriangleFan
Retrieves the array containing the number of vertices for each 3D bouning GP triangles fan. The size of this array is equal to *oNbTriangleFan. For example, the first fan is made with *oNbVertexPerTriangleStrip[0] vertices.
                --------------------------
               | *oNbVertexPerTriangleFan |
                --------------------------
               |             n1           |
               |             .            |
               |             .            |   m = Number of triangle fans(*oNbTriangleFan)
               |             nm           |   nm = number of vertices of the m-th fan. (*oNbVertexPerTriangleFan[m]
                --------------------------    

   
o GetSphereCenter
public GetSphereCenter( )
Gets the bounding sphere center coordinates.
Returns:
returns a 3 fields array containing the sphere center coordinates.
o GetSphereRadius
public GetSphereRadius( )
Gets the bounding sphere radius.
o GetTextureCoordinates
public virtual GetTextureCoordinates( oTextureCoord)
Deprecated:
V5R14
o GetTextureCoordinates
public virtual GetTextureCoordinates( oTextureCoord,
oDimension)
Deprecated:
R216 See GetTextureCoordinatesReadOnly for read access and derived classes for write access
o GetTextureCoordinatesReadOnly
public virtual GetTextureCoordinatesReadOnly( oTextureCoord)
Deprecated:
V5R14 In favor of GetTextureCoordinates (float ** oTextureCoord, int * oDimension). Retrieves the texture coordinates. This method must be used like this:
 float * textureCoord;
 GetTextureCoord(&textureCoord);
 
Parameters:
oTextureCoord
Retrieves the 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.
o GetTextureCoordinatesReadOnly
public virtual GetTextureCoordinatesReadOnly( oTextureCoord,
oDimension)
Retrieves the texture coordinates. This method must be used like this:
 float * textureCoord;
 GetTextureCoord(&textureCoord);
 
Parameters:
oTextureCoord
Retrieves the 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.
oDimension
Retrieve the number of coordinates per vertex.
o GetUV
public virtual GetUV( oAllocate,
oUV,
oUVArraySize)
Deprecated:
R216 see GetUVReadOnly for read access and derived classes for write access
o GetUVReadOnly
public virtual GetUVReadOnly( oAllocate,
oUV,
oUVArraySize)
Retrieves the 3D bounding GP surfacic mesh parameters.
Parameters:
oAllocate
Flag specifiying whether retrieved data is copied or not.
Legal values:
1
retrieved data is copied.
0
retrieves references on data.
oAllocate flag is always returned equal to 0: GetUV() only retrieves references on stored data.
oUV
Retrieves the UV array. Each vertex has an associated UV couple.
oUVArraySize
Retrieves the size of the UV array. Equals 0 if the mesh is shared with another element or if the array is NULL, two times the number of vertices elsewhere.
o GetVertices
public virtual GetVertices( oAllocate,
oVertices,
oVerticesArraySize)
Deprecated:
R216 see GetVerticesReadOnly for read access and derived classes for write access
o GetVerticesReadOnly
public virtual GetVerticesReadOnly( oAllocate,
oVertices,
oVerticesArraySize)
Retrieves 3D bounding GP vertices.
Role: As this method is designed to return values on its parameters, it must be called like this :
 int allocate;
 float const* vertices;
 ...
 GetVerticesReadOnly(&allocate, &vertices, ...);
 

Parameters:
oAllocate
Flag specifiying whether retrieved data is copied or not.
Legal values:
1
retrieved data is copied.
0
retrieves references on data.
oAllocate flag is always returned equal to 0: GetVertices only retrieves references on stored data.
oVertices
Retrieves an array made of 3D bounding GP vertices coordinates: XYZXYZXYZ... Its size is equal to three times the 3D bounding GP vertices number.
oVerticesArraySize
Retrieves the size, in floats, of the oVertices array. Equal to three times the vertices number. If information on vertices is shared with another element, returned size for this parameter is equal to 0.
o HasNormals
public virtual HasNormals( )
Tests whether the 3D bounding GP is owner of its normals informations.
Returns:

Legal values:
1
The 3D bounding GP is owner of its normals informations
0
The 3D bounding GP is not owner of its normals informations
o HasVertices
public virtual HasVertices( )
Tests whether the 3D bounding GP is owner of its vertices informations.
Returns:

Legal values:
1
The 3D bounding GP is owner of its vertices informations
0
The 3D bounding GP is not owner of its vertices informations
o SetBoxCenter
public SetBoxCenter( iNewCenter)
Sets the box center coordinates.
Parameters:
iNewCenter
Array containing the new center coordinates: XYZ. Its size is equal to three.
o SetBoxDimensions
public SetBoxDimensions( iNewDimensions)
Sets the X,Y,Z half box spans.
Parameters:
iNewDimensions
Array containing the half box spans new coordinates. Its size is equal to three.
o SetSphereCenter
public SetSphereCenter( iNewCenter)
Sets the bounding sphere center.
Parameters:
iNewCenter
3 fields array containing the sphere center coordinates.
o SetSphereRadius
public SetSphereRadius( iNewRadius)
Sets the bounding sphere radius.
Parameters:
iNewRadius
The new bounding sphere radius.
o SetTextureCoordinates
public virtual SetTextureCoordinates( iTextureCoord,
iTextureFormat)
Deprecated:
R216 see derived classes. Sets the texture coordinates. If the 3D bounding GP shares its vertices, it also shares its texture coordinates.
Parameters:
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 3D bounding GP creation, texture coordinates are to be generated with the tessellation parameters that are retrieved after the 3D bounding GP creation (ie with properly translated indices). Nevertheless, a mapping operator can be applied at anytime, when the 3D bounding GP is the owner of it's vertex data. If computed before the 3D bounding GP creation, texture coordinates can be given at the 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
If data is shared, the format for the given texture coordinates must be three.

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

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