Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:46

0001 // Created on: 2001-01-04
0002 // Copyright (c) 2001-2014 OPEN CASCADE SAS
0003 //
0004 // This file is part of Open CASCADE Technology software library.
0005 //
0006 // This library is free software; you can redistribute it and/or modify it under
0007 // the terms of the GNU Lesser General Public License version 2.1 as published
0008 // by the Free Software Foundation, with special exception defined in the file
0009 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0010 // distribution for complete text of the license and disclaimer of any warranty.
0011 //
0012 // Alternatively, this file may be used under the terms of Open CASCADE
0013 // commercial license or contractual agreement.
0014 
0015 #ifndef _Graphic3d_ArrayOfPolylines_HeaderFile
0016 #define _Graphic3d_ArrayOfPolylines_HeaderFile
0017 
0018 #include <Graphic3d_ArrayOfPrimitives.hxx>
0019 
0020 //! Contains polylines array definition.
0021 class Graphic3d_ArrayOfPolylines : public Graphic3d_ArrayOfPrimitives
0022 {
0023   DEFINE_STANDARD_RTTIEXT(Graphic3d_ArrayOfPolylines, Graphic3d_ArrayOfPrimitives)
0024 public:
0025 
0026   //! Creates an array of polylines (Graphic3d_TOPA_POLYLINES), a polyline can be filled as:
0027   //! 1) Creating a single polyline defined with his vertexes, i.e:
0028   //! @code
0029   //!   myArray = Graphic3d_ArrayOfPolylines (7);
0030   //!   myArray->AddVertex (x1, y1, z1);
0031   //!   ....
0032   //!   myArray->AddVertex (x7, y7, z7);
0033   //! @endcode
0034   //! 2) Creating separate polylines defined with a predefined number of bounds and the number of vertex per bound, i.e:
0035   //! @code
0036   //!   myArray = Graphic3d_ArrayOfPolylines (7, 2);
0037   //!   myArray->AddBound (4);
0038   //!   myArray->AddVertex (x1, y1, z1);
0039   //!   ....
0040   //!   myArray->AddVertex (x4, y4, z4);
0041   //!   myArray->AddBound (3);
0042   //!   myArray->AddVertex (x5, y5, z5);
0043   //!   ....
0044   //!   myArray->AddVertex (x7, y7, z7);
0045   //! @endcode
0046   //! 3) Creating a single indexed polyline defined with his vertex and edges, i.e:
0047   //! @code
0048   //!   myArray = Graphic3d_ArrayOfPolylines (4, 0, 6);
0049   //!   myArray->AddVertex (x1, y1, z1);
0050   //!   ....
0051   //!   myArray->AddVertex (x4, y4, z4);
0052   //!   myArray->AddEdge (1);
0053   //!   myArray->AddEdge (2);
0054   //!   myArray->AddEdge (3);
0055   //!   myArray->AddEdge (1);
0056   //!   myArray->AddEdge (2);
0057   //!   myArray->AddEdge (4);
0058   //! @endcode
0059   //! 4) creating separate polylines defined with a predefined number of bounds and the number of edges per bound, i.e:
0060   //! @code
0061   //!   myArray = Graphic3d_ArrayOfPolylines (6, 4, 14);
0062   //!   myArray->AddBound (3);
0063   //!   myArray->AddVertex (x1, y1, z1);
0064   //!   myArray->AddVertex (x2, y2, z2);
0065   //!   myArray->AddVertex (x3, y3, z3);
0066   //!   myArray->AddEdge (1);
0067   //!   myArray->AddEdge (2);
0068   //!   myArray->AddEdge (3);
0069   //!   myArray->AddBound (3);
0070   //!   myArray->AddVertex (x4, y4, z4);
0071   //!   myArray->AddVertex (x5, y5, z5);
0072   //!   myArray->AddVertex (x6, y6, z6);
0073   //!   myArray->AddEdge (4);
0074   //!   myArray->AddEdge (5);
0075   //!   myArray->AddEdge (6);
0076   //!   myArray->AddBound (4);
0077   //!   myArray->AddEdge (2);
0078   //!   myArray->AddEdge (3);
0079   //!   myArray->AddEdge (5);
0080   //!   myArray->AddEdge (6);
0081   //!   myArray->AddBound (4);
0082   //!   myArray->AddEdge (1);
0083   //!   myArray->AddEdge (3);
0084   //!   myArray->AddEdge (5);
0085   //!   myArray->AddEdge (4);
0086   //! @endcode
0087   //! @param theMaxVertexs defines the maximum allowed vertex number in the array
0088   //! @param theMaxBounds  defines the maximum allowed bound  number in the array
0089   //! @param theMaxEdges   defines the maximum allowed edge   number in the array
0090   //! @param theArrayFlags array flags
0091   Graphic3d_ArrayOfPolylines (Standard_Integer theMaxVertexs,
0092                               Standard_Integer theMaxBounds,
0093                               Standard_Integer theMaxEdges,
0094                               Graphic3d_ArrayFlags theArrayFlags)
0095   : Graphic3d_ArrayOfPrimitives (Graphic3d_TOPA_POLYLINES, theMaxVertexs, theMaxBounds, theMaxEdges, theArrayFlags) {}
0096 
0097   //! Creates an array of polylines (Graphic3d_TOPA_POLYLINES).
0098   //! @param theMaxVertexs defines the maximum allowed vertex number in the array
0099   //! @param theMaxBounds  defines the maximum allowed bound  number in the array
0100   //! @param theMaxEdges   defines the maximum allowed edge   number in the array
0101   //! @param theHasVColors when TRUE AddVertex(Point,Color) or AddVertex(Point,Normal,Color) should be used to specify per-vertex color values
0102   //! @param theHasBColors when TRUE AddBound(number,Color) should be used to specify sub-group color
0103   Graphic3d_ArrayOfPolylines (Standard_Integer theMaxVertexs,
0104                               Standard_Integer theMaxBounds  = 0,
0105                               Standard_Integer theMaxEdges   = 0,
0106                               Standard_Boolean theHasVColors = Standard_False,
0107                               Standard_Boolean theHasBColors = Standard_False)
0108   : Graphic3d_ArrayOfPrimitives (Graphic3d_TOPA_POLYLINES, theMaxVertexs, theMaxBounds, theMaxEdges,
0109                                  (theHasVColors  ? Graphic3d_ArrayFlags_VertexColor  : Graphic3d_ArrayFlags_None)
0110                                | (theHasBColors  ? Graphic3d_ArrayFlags_BoundColor   : Graphic3d_ArrayFlags_None)) {}
0111 
0112 };
0113 
0114 DEFINE_STANDARD_HANDLE(Graphic3d_ArrayOfPolylines, Graphic3d_ArrayOfPrimitives)
0115 
0116 #endif // _Graphic3d_ArrayOfPolylines_HeaderFile