VisualizationFoundation class CAT3DCurvedPipeGP

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


public class CAT3DCurvedPipeGP

Class to create the graphic primitive of a 3D curved pipe.
Role: A 3D curved pipe can be assimilated to the extrusion of a circle along a main 3D curve.


Constructor and Destructor Index


o CAT3DCurvedPipeGP(void)
Default constructor.
o CAT3DCurvedPipeGP(float*,int,float*,int,float*,float*,float)
Constructs a 3D curved pipe from tesselation informations on the main curve and on circles belonging to the curved pipe.

Method Index


o Draw(CATRender&)
Draws the curved pipe.
o Get(float**,int*,float**,int*,float**,float**,float*)
Retrieves the attributes of the class.
o Get(int*,float**,int*,float**,int*,int**,int*,int**,int*,int**,int**,int*,int**)
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 curved pipe.
o GetTextureCoordinates(float**)
o GetTextureCoordinates(float**,int*)
o GetTextureCoordinatesReadOnly(float const**)
o GetTextureCoordinatesReadOnly(float const**,int*)
Retrieves the texture coordinates.
o GetVertices(int*,float**,int*)
o GetVerticesReadOnly(int*,float const**,int*)
Retrieves curved pipe vertices coordinates.
o SetTextureCoordinates(float*,int)

Constructor and Destructor


o CAT3DCurvedPipeGP
public CAT3DCurvedPipeGP(void )
Default constructor.
o CAT3DCurvedPipeGP
public CAT3DCurvedPipeGP(float* iCurveVertices,
int iNbCurveVertices,
float* iCirclesVertices,
int iNbVerticesPerCircle,
float* iBaseNormal,
float* iEndNormal,
float iPipeRadius)
Constructs a 3D curved pipe from tesselation informations on the main curve and on circles belonging to the curved pipe.
Parameters:
iCurveVertices
Array made of main curve vertices coordinates: XYZXYZXYZ... Its size is equal to three times the number of vertices used to describe the main curve.
iNbCurveVertices
The number of vertices used to describe the main curve.
iCirclesVertices
Array made of curved pipe's circles coordinates. There is one circle per curve vertex, and a constant number of vertices to describe each of these circles.So, this array size is equal to iNbCurveVertices * iNbVerticesPerCircle * 3. For example, if we choose to describe each circle of the pipe with 20 points, the pipe second circle first point coordinates are : x = iCirclesVertices[3*iNbVerticesPerCircle], y = iCirclesVertices[3*iNbVerticesPerCircle+1] and z = iCirclesVertices[3*iNbVerticesPerCircle+2].
iNbVerticesPerCircle
The number of vertices used to describe every circles of the pipe.
iBaseNormal
Array of curved pipe base circle normal coordinates. Its size is three
iEndNormal
Array of curved pipe end circle normal coordinates. Its size is three
iPipeRadius
The global pipe radius.

Methods


o Draw
public virtual void Draw(CATRender& iRender)
Draws the curved pipe.
Parameters:
iRender
The render through which the curved pipe is drawn.
o Get
public void Get(float** oCurveVertex,
int* oNbCurveVertex,
float** oCircleVertex,
int* oNbCircleVertex,
float** oBaseNormal,
float** oEndNormal,
float* oRadiusInverse)
Retrieves the attributes of the class.
Role: As this method is designed to return values on its parameters, it has to be called like this :
 float * curveVertices;
 int nCurveVertices;
 ...
 Get(&curveVertices, &nCurveVertices, ...);
 

Parameters:
oCurveVertices
Retrieves an array made of main curve vertices coordinates: XYZXYZXYZ... Its size is equal to three times the number of vertices used to describe the main curve.
oNbCurveVertices
Retrieves the number of vertices used to describe the main curve.
oCirclesVertices
Retrieves an Array made of curved pipe's circles coordinates. There is one circle per curve vertex, and a constant number of vertices to describe each of these circles. So, this array size is equal to oNbCurveVertices * oNbVerticesPerCircle * 3. For example, if we choose to describe each circle of the pipe with 20 points, the pipe second circle first point coordinates are : x = oCirclesVertices[3*oNbVerticesPerCircle], y = oCirclesVertices[3*oNbVerticesPerCircle+1] and z = oCirclesVertices[3*oNbVerticesPerCircle+2].
oNbVerticesPerCircle
Retrieves the number of vertices used to describe every circles of the pipe.
oBaseNormal
Retrieves the array made of curved pipe base circle normal coordinates. Its size is three.
oEndNormal
Retrieves the array made of curved pipe end circle normal coordinates. Its size is three.
iPipeRadius
Retrieves the global pipe radius.
o Get
public void Get(int* oAllocate,
float** oVertices,
int* oVerticesArraySize,
float** oNormals,
int* oNormalsArraySize,
int** oTriangleIndices,
int* oNbTriangle,
int** oTriangleStripIndices,
int* oNbTriangleStrip,
int** oNbVertexPerTriangleStrip,
int** oTriangleFanIndices,
int* oNbTriangleFan,
int** oNbVertexPerTriangleFan)
Deprecated:
R216 See GetReadOnly
o GetReadOnly
public void GetReadOnly(int* oAllocate,
float const** oVertices,
int* oVerticesArraySize,
float const** oNormals,
int* oNormalsArraySize,
int const** oTriangleIndices,
int* oNbTriangle,
int const** oTriangleStripIndices,
int* oNbTriangleStrip,
int const** oNbVertexPerTriangleStrip,
int const** oTriangleFanIndices,
int* oNbTriangleFan,
int const** oNbVertexPerTriangleFan)const
Retrieves the tesselation information from the curved pipe.
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 1: GetVertices always allocates the returned arrays.
oVertices
Retrieves an array made of curved pipe vertices coordinates: XYZXYZXYZ... If we have a pipe made with NCircles circles and that each circle is described with NCirclePoints points, oVertices array size is equal to NCircles * NCirclePoints * 3 * 2. The array is structured like this: the first NCirclePoints*3 coordinates stored correspond to the NCirclePoints points of the first circle of the pipe. Then, are stored, respectively, the first point of the first circle, its corresponding point on the next circle, the second point of the first circle, its corresponding point on the next circle, ... Finally, the last NCirclePoints*3 coordinates correspond to the last circle. This kind of organization allows the drawing of the curved pipe body thanks to triangles strips, by taking the points in the order they are stored. For example, let's assume that we have a curved pipe made with a 3 vertices curve and 4 vertices circles. We have 3 circles called C1, C2 and C3. If we use the notation C1.P1 to designate the first point of the first circle, the array will look like this :
      
                               -----------
                              | oVertices |
                               -----------
                           {  |   C1.P1   |  
       first circle points {  |   C1.P2   |   
                           {  |   C1.P3   |   
                           {  |   C1.P4   |   
                              |   C1.P1   | }
                              |   C2.P1   | }
                              |   C1.P2   | }
                              |   C2.P2   | } 
                              |   C1.P3   | }
                              |   C2.P3   | }
                              |   C1.P4   | }
                              |   C2.P4   | }
                              |   C2.P1   | } intermediate pipe body
                              |   C3.P1   | }
                              |   C2.P2   | }
                              |   C3.P2   | }
                              |   C2.P3   | }
                              |   C3.P3   | }
                              |   C2.P4   | }
                              |   C3.P4   | }
                            { |   C3.P1   |
         last circle points { |   C3.P2   |
                            { |   C3.P3   |
                            { |   C3.P4   |   
                               -----------
                

   
Of course, for each point we have in reality 3 fields in the array, corresponding to this point's coordinates.
oVerticesArraySize
the oVertices array size. This size is equal to three times the number of vertices used to describe the main curve, cross the number of vertices used to describe each circle, cross two.
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.
oTriangleIndices
Indices of pipe single triangles vertices. Always equal to NULL.
oNbTriangle
Number of pipe single triangles. Always equal to 0.
oTriangleStripIndices
Retrieves the array used to store the pipe triangles strips vertices. The pipe body is made with triangles strips. 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 pipe 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 triangles strips used to describe the pipe body.
oNbVertexPerTriangleStrip
Retrieves an array containing the number of vertices for each pipe 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 pipe triangles fans vertices indices. There is only 2 triangles fans in a curved pipe: one for each extremities circle. 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 n0 indices
                  |           .          |   }
                  |          i0n0        |   }
                  |                      |
                  |          i10         |   }
                  |          i11         |   }
                  |           .          |   } second triangle fan 
                  |           .          |   } with n1 vertices
                  |          i1n1        |   }
                   ----------------------


   
For example, index i10 allows to access the pipe second fan first vertex wich coordinates are X = *oVertices[i10], Y = *oVertices[i10 + 1] and Z = *oVertices[i10 + 2], and which normal coordinates are Nx = *oNormals[i10], Ny = *oNormals[i10 + 1] and Nz = *oNormals[i10 + 2].
oNbTriangleFan
Retrieves the number of pipe triangles fans. Always equal to 2.
oNbVertexPerTriangleFan
Retrieves the array containing the number of vertices for each pipe triangles fan. The size of this array is equal to 2. For example, the first fan is made with *oNbVertexPerTriangleStrip[0] vertices.
                --------------------------
               | *oNbVertexPerTriangleFan |
                --------------------------
               |             n0           |
               |             n1           |   n1 = number of vertices of the second fan. (*oNbVertexPerTriangleFan[1]
                --------------------------    

   
o GetTextureCoordinates
public inline void GetTextureCoordinates(float** oTextureCoord)
Deprecated:
V5R14
o GetTextureCoordinates
public inline void GetTextureCoordinates(float** oTextureCoord,
int* oDimension)
Deprecated:
R216 see GetTextureCoordinatesReadOnly
o GetTextureCoordinatesReadOnly
public inline void GetTextureCoordinatesReadOnly(float const** oTextureCoord)const
Deprecated:
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 inline void GetTextureCoordinatesReadOnly(float const** oTextureCoord,
int* oDimension)const
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 GetVertices
public void GetVertices(int* oAllocate,
float** oVertices,
int* oVerticesArraySize)
Deprecated:
R216 see GetVerticesReadOnly
o GetVerticesReadOnly
public void GetVerticesReadOnly(int* oAllocate,
float const** oVertices,
int* oVerticesArraySize)const
Retrieves curved pipe vertices coordinates.
Role: As this method is designed to return values on its parameters, it has to be called like this :
 int allocate;
 float * vertices;
 ...
 GetVertices(&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 1: GetVertices always allocates the returned arrays.
oVertices
Retrieves an array made of curved pipe vertices coordinates: XYZXYZXYZ... If we have a pipe made with NCircles circles and that each circle is described with NCirclePoints points, oVertices array size is equal to NCircles * NCirclePoints * 3 * 2. The array is structured like this: the first NCirclePoints*3 coordinates stored correspond to the NCirclePoints points of the first circle of the pipe. Then, are stored, respectively, the first point of the first circle, its corresponding point on the next circle, the second point of the first circle, its corresponding point on the next circle, ... Finally, the last NCirclePoints*3 coordinates correspond to the last circle. This kind of organization allows the drawing of curved pipe thanks to triangles strips, by taking the points in the order they are stored. For example, let's assume that we have a curved pipe made with a 3 vertices curve and 4 vertices circles. We have 3 circles called C1, C2 and C3. If we use the notation C1.P1 to designate the first vertex of the first circle, the array will look like this :
      
                               -----------
                              | oVertices |
                               -----------
                           {  |   C1.P1   |  
       first circle points {  |   C1.P2   |   
                           {  |   C1.P3   |   
                           {  |   C1.P4   |   
                              |   C1.P1   | }
                              |   C2.P1   | }
                              |   C1.P2   | }
                              |   C2.P2   | } 
                              |   C1.P3   | }
                              |   C2.P3   | }
                              |   C1.P4   | }
                              |   C2.P4   | }
                              |   C2.P1   | } intermediate pipe body
                              |   C3.P1   | }
                              |   C2.P2   | }
                              |   C3.P2   | }
                              |   C2.P3   | }
                              |   C3.P3   | }
                              |   C2.P4   | }
                              |   C3.P4   | }
                            { |   C3.P1   |
         last circle points { |   C3.P2   |
                            { |   C3.P3   |
                            { |   C3.P4   |   
                               -----------
                

   
Of course, for each point we have in reality 3 fields in the array, corresponding to this point's coordinates.
oVerticesArraySize
the oVertices array size. This size is equal to three times the number of vertices used to describe the main curve, cross the number of vertices used to describe each circle, cross two.
o SetTextureCoordinates
public PROTECT_DEPRECATED void SetTextureCoordinates(float* iTextureCoord,
int iFormat)
Deprecated:
R216 see CAT3DCurvedPipeGPEditHelper Sets the 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.
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

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

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