DEFINE_STANDARD_RTTIEXT(Graphic3d_ArrayOfTriangles, Graphic3d_ArrayOfPrimitives)
public:
- //! Creates an array of triangles, a triangle can be filled as:
+ //! Creates an array of triangles (Graphic3d_TOPA_TRIANGLES), a triangle can be filled as:
//! 1) Creating a set of triangles defined with his vertexes, i.e:
//! @code
//! myArray = Graphic3d_ArrayOfTriangles (6);
//! myArray->AddVertex (x1, y1, z1);
//! ....
//! myArray->AddVertex (x4, y4, z4);
- //! myArray->AddEdge (1);
- //! myArray->AddEdge (2);
- //! myArray->AddEdge (3);
- //! myArray->AddEdge (2);
- //! myArray->AddEdge (3);
- //! myArray->AddEdge (4);
+ //! myArray->AddEdges (1, 2, 3);
+ //! myArray->AddEdges (2, 3, 4);
//! @endcode
//! @param theMaxVertexs defines the maximum allowed vertex number in the array
//! @param theMaxEdges defines the maximum allowed edge number in the array
+ //! @param theArrayFlags array flags
+ Graphic3d_ArrayOfTriangles (Standard_Integer theMaxVertexs,
+ Standard_Integer theMaxEdges,
+ Graphic3d_ArrayFlags theArrayFlags)
+ : Graphic3d_ArrayOfPrimitives (Graphic3d_TOPA_TRIANGLES, theMaxVertexs, 0, theMaxEdges, theArrayFlags) {}
+
+ //! Creates an array of triangles (Graphic3d_TOPA_TRIANGLES).
+ //! @param theMaxVertexs defines the maximum allowed vertex number in the array
+ //! @param theMaxEdges defines the maximum allowed edge number in the array
//! @param theHasVNormals when TRUE, AddVertex(Point,Normal), AddVertex(Point,Normal,Color) or AddVertex(Point,Normal,Texel) should be used to specify vertex normal;
//! vertex normals should be specified coherent to triangle orientation (defined by order of vertexes within triangle) for proper rendering
//! @param theHasVColors when TRUE, AddVertex(Point,Color) or AddVertex(Point,Normal,Color) should be used to specify vertex color
//! @param theHasVTexels when TRUE, AddVertex(Point,Texel) or AddVertex(Point,Normal,Texel) should be used to specify vertex UV coordinates
- Graphic3d_ArrayOfTriangles (const Standard_Integer theMaxVertexs,
- const Standard_Integer theMaxEdges = 0,
- const Standard_Boolean theHasVNormals = Standard_False,
- const Standard_Boolean theHasVColors = Standard_False,
- const Standard_Boolean theHasVTexels = Standard_False)
- : Graphic3d_ArrayOfPrimitives (Graphic3d_TOPA_TRIANGLES, theMaxVertexs, 0, theMaxEdges, theHasVNormals, theHasVColors, Standard_False, theHasVTexels) {}
+ Graphic3d_ArrayOfTriangles (Standard_Integer theMaxVertexs,
+ Standard_Integer theMaxEdges = 0,
+ Standard_Boolean theHasVNormals = Standard_False,
+ Standard_Boolean theHasVColors = Standard_False,
+ Standard_Boolean theHasVTexels = Standard_False)
+ : Graphic3d_ArrayOfPrimitives (Graphic3d_TOPA_TRIANGLES, theMaxVertexs, 0, theMaxEdges,
+ (theHasVNormals ? Graphic3d_ArrayFlags_VertexNormal : Graphic3d_ArrayFlags_None)
+ | (theHasVColors ? Graphic3d_ArrayFlags_VertexColor : Graphic3d_ArrayFlags_None)
+ | (theHasVTexels ? Graphic3d_ArrayFlags_VertexTexel : Graphic3d_ArrayFlags_None)) {}
};