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_ArrayOfQuadrangleStrips_HeaderFile
0016 #define _Graphic3d_ArrayOfQuadrangleStrips_HeaderFile
0017 
0018 #include <Graphic3d_ArrayOfPrimitives.hxx>
0019 
0020 //! Contains quadrangles strip array definition.
0021 //! WARNING! Quadrangle primitives might be unsupported by graphics library.
0022 //! Triangulation should be used instead of quads for better compatibility.
0023 class Graphic3d_ArrayOfQuadrangleStrips : public Graphic3d_ArrayOfPrimitives
0024 {
0025   DEFINE_STANDARD_RTTIEXT(Graphic3d_ArrayOfQuadrangleStrips, Graphic3d_ArrayOfPrimitives)
0026 public:
0027 
0028   //! Creates an array of quadrangle strips (Graphic3d_TOPA_QUADRANGLESTRIPS), a polygon can be filled as:
0029   //! 1) Creating a single strip defined with his vertexes, i.e:
0030   //! @code
0031   //!   myArray = Graphic3d_ArrayOfQuadrangleStrips (7);
0032   //!   myArray->AddVertex (x1, y1, z1);
0033   //!   ....
0034   //!   myArray->AddVertex (x7, y7, z7);
0035   //! @endcode
0036   //! 2) Creating separate strips defined with a predefined number of strips and the number of vertex per strip, i.e:
0037   //! @code
0038   //!   myArray = Graphic3d_ArrayOfQuadrangleStrips (8, 2);
0039   //!   myArray->AddBound (4);
0040   //!   myArray->AddVertex (x1, y1, z1);
0041   //!   ....
0042   //!   myArray->AddVertex (x4, y4, z4);
0043   //!   myArray->AddBound (4);
0044   //!   myArray->AddVertex (x5, y5, z5);
0045   //!   ....
0046   //!   myArray->AddVertex (x8, y8, z8);
0047   //! @endcode
0048   //! The number of quadrangle really drawn is: VertexNumber()/2 - Min(1, BoundNumber()).
0049   //! @param theMaxVertexs defines the maximum allowed vertex number in the array
0050   //! @param theMaxStrips  defines the maximum allowed strip  number in the array
0051   //! @param theArrayFlags array flags
0052   Graphic3d_ArrayOfQuadrangleStrips (Standard_Integer theMaxVertexs,
0053                                      Standard_Integer theMaxStrips,
0054                                      Graphic3d_ArrayFlags theArrayFlags)
0055   : Graphic3d_ArrayOfPrimitives (Graphic3d_TOPA_QUADRANGLESTRIPS, theMaxVertexs, theMaxStrips, 0, theArrayFlags) {}
0056 
0057   //! Creates an array of quadrangle strips (Graphic3d_TOPA_QUADRANGLESTRIPS).
0058   //! @param theMaxVertexs defines the maximum allowed vertex number in the array
0059   //! @param theMaxStrips  defines the maximum allowed strip  number in the array
0060   Graphic3d_ArrayOfQuadrangleStrips (Standard_Integer theMaxVertexs,
0061                                      Standard_Integer theMaxStrips   = 0,
0062                                      Standard_Boolean theHasVNormals = Standard_False,
0063                                      Standard_Boolean theHasVColors  = Standard_False,
0064                                      Standard_Boolean theHasSColors  = Standard_False,
0065                                      Standard_Boolean theHasVTexels  = Standard_False)
0066   : Graphic3d_ArrayOfPrimitives (Graphic3d_TOPA_QUADRANGLESTRIPS, theMaxVertexs, theMaxStrips, 0,
0067                                  (theHasVNormals ? Graphic3d_ArrayFlags_VertexNormal : Graphic3d_ArrayFlags_None)
0068                                | (theHasVColors  ? Graphic3d_ArrayFlags_VertexColor  : Graphic3d_ArrayFlags_None)
0069                                | (theHasVTexels  ? Graphic3d_ArrayFlags_VertexTexel  : Graphic3d_ArrayFlags_None)
0070                                | (theHasSColors  ? Graphic3d_ArrayFlags_BoundColor   : Graphic3d_ArrayFlags_None)) {}
0071 
0072 
0073 
0074 };
0075 
0076 DEFINE_STANDARD_HANDLE(Graphic3d_ArrayOfQuadrangleStrips, Graphic3d_ArrayOfPrimitives)
0077 
0078 #endif // _Graphic3d_ArrayOfQuadrangleStrips_HeaderFile