Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-21 09:17:15

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   //! Creates an array of polylines (Graphic3d_TOPA_POLYLINES), a polyline can be filled as:
0026   //! 1) Creating a single polyline defined with his vertexes, i.e:
0027   //! @code
0028   //!   myArray = Graphic3d_ArrayOfPolylines (7);
0029   //!   myArray->AddVertex (x1, y1, z1);
0030   //!   ....
0031   //!   myArray->AddVertex (x7, y7, z7);
0032   //! @endcode
0033   //! 2) Creating separate polylines defined with a predefined number of bounds and the number of
0034   //! 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
0060   //! edges per bound, i.e:
0061   //! @code
0062   //!   myArray = Graphic3d_ArrayOfPolylines (6, 4, 14);
0063   //!   myArray->AddBound (3);
0064   //!   myArray->AddVertex (x1, y1, z1);
0065   //!   myArray->AddVertex (x2, y2, z2);
0066   //!   myArray->AddVertex (x3, y3, z3);
0067   //!   myArray->AddEdge (1);
0068   //!   myArray->AddEdge (2);
0069   //!   myArray->AddEdge (3);
0070   //!   myArray->AddBound (3);
0071   //!   myArray->AddVertex (x4, y4, z4);
0072   //!   myArray->AddVertex (x5, y5, z5);
0073   //!   myArray->AddVertex (x6, y6, z6);
0074   //!   myArray->AddEdge (4);
0075   //!   myArray->AddEdge (5);
0076   //!   myArray->AddEdge (6);
0077   //!   myArray->AddBound (4);
0078   //!   myArray->AddEdge (2);
0079   //!   myArray->AddEdge (3);
0080   //!   myArray->AddEdge (5);
0081   //!   myArray->AddEdge (6);
0082   //!   myArray->AddBound (4);
0083   //!   myArray->AddEdge (1);
0084   //!   myArray->AddEdge (3);
0085   //!   myArray->AddEdge (5);
0086   //!   myArray->AddEdge (4);
0087   //! @endcode
0088   //! @param theMaxVertexs defines the maximum allowed vertex number in the array
0089   //! @param theMaxBounds  defines the maximum allowed bound  number in the array
0090   //! @param theMaxEdges   defines the maximum allowed edge   number in the array
0091   //! @param theArrayFlags array flags
0092   Graphic3d_ArrayOfPolylines(int                  theMaxVertexs,
0093                              int                  theMaxBounds,
0094                              int                  theMaxEdges,
0095                              Graphic3d_ArrayFlags theArrayFlags)
0096       : Graphic3d_ArrayOfPrimitives(Graphic3d_TOPA_POLYLINES,
0097                                     theMaxVertexs,
0098                                     theMaxBounds,
0099                                     theMaxEdges,
0100                                     theArrayFlags)
0101   {
0102   }
0103 
0104   //! Creates an array of polylines (Graphic3d_TOPA_POLYLINES).
0105   //! @param theMaxVertexs defines the maximum allowed vertex number in the array
0106   //! @param theMaxBounds  defines the maximum allowed bound  number in the array
0107   //! @param theMaxEdges   defines the maximum allowed edge   number in the array
0108   //! @param theHasVColors when TRUE AddVertex(Point,Color) or AddVertex(Point,Normal,Color) should
0109   //! be used to specify per-vertex color values
0110   //! @param theHasBColors when TRUE AddBound(number,Color) should be used to specify sub-group
0111   //! color
0112   Graphic3d_ArrayOfPolylines(int  theMaxVertexs,
0113                              int  theMaxBounds  = 0,
0114                              int  theMaxEdges   = 0,
0115                              bool theHasVColors = false,
0116                              bool theHasBColors = false)
0117       : Graphic3d_ArrayOfPrimitives(
0118           Graphic3d_TOPA_POLYLINES,
0119           theMaxVertexs,
0120           theMaxBounds,
0121           theMaxEdges,
0122           (theHasVColors ? Graphic3d_ArrayFlags_VertexColor : Graphic3d_ArrayFlags_None)
0123             | (theHasBColors ? Graphic3d_ArrayFlags_BoundColor : Graphic3d_ArrayFlags_None))
0124   {
0125   }
0126 };
0127 
0128 #endif // _Graphic3d_ArrayOfPolylines_HeaderFile