Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-07 08:30:59

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_ArrayOfQuadrangles_HeaderFile
0016 #define _Graphic3d_ArrayOfQuadrangles_HeaderFile
0017 
0018 #include <Graphic3d_ArrayOfPrimitives.hxx>
0019 
0020 //! Contains quadrangles 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_ArrayOfQuadrangles : public Graphic3d_ArrayOfPrimitives
0024 {
0025   DEFINE_STANDARD_RTTIEXT(Graphic3d_ArrayOfQuadrangles, Graphic3d_ArrayOfPrimitives)
0026 public:
0027   //! Creates an array of quadrangles (Graphic3d_TOPA_QUADRANGLES), a quadrangle can be filled as:
0028   //! 1) Creating a set of quadrangles defined with his vertexes, i.e:
0029   //! @code
0030   //!   myArray = Graphic3d_ArrayOfQuadrangles (8);
0031   //!   myArray->AddVertex (x1, y1, z1);
0032   //!   ....
0033   //!   myArray->AddVertex (x8, y8, z8);
0034   //! @endcode
0035   //! 2) Creating a set of indexed quadrangles defined with his vertex ans edges, i.e:
0036   //! @code
0037   //!   myArray = Graphic3d_ArrayOfQuadrangles (6, 8);
0038   //!   myArray->AddVertex (x1, y1, z1);
0039   //!   ....
0040   //!   myArray->AddVertex (x6, y6, z6);
0041   //!   myArray->AddEdges (1, 2, 3, 4);
0042   //!   myArray->AddEdges (3, 4, 5, 6);
0043   //! @endcode
0044   //! @param theMaxVertexs defines the maximum allowed vertex number in the array
0045   //! @param theMaxEdges   defines the maximum allowed edge   number in the array (for indexed
0046   //! array)
0047   //! @param theArrayFlags array flags
0048   Graphic3d_ArrayOfQuadrangles(Standard_Integer     theMaxVertexs,
0049                                Standard_Integer     theMaxEdges,
0050                                Graphic3d_ArrayFlags theArrayFlags)
0051       : Graphic3d_ArrayOfPrimitives(Graphic3d_TOPA_QUADRANGLES,
0052                                     theMaxVertexs,
0053                                     0,
0054                                     theMaxEdges,
0055                                     theArrayFlags)
0056   {
0057   }
0058 
0059   //! Creates an array of quadrangles (Graphic3d_TOPA_QUADRANGLES).
0060   //! @param theMaxVertexs defines the maximum allowed vertex number in the array
0061   //! @param theMaxEdges   defines the maximum allowed edge   number in the array (for indexed
0062   //! array)
0063   Graphic3d_ArrayOfQuadrangles(Standard_Integer theMaxVertexs,
0064                                Standard_Integer theMaxEdges    = 0,
0065                                Standard_Boolean theHasVNormals = Standard_False,
0066                                Standard_Boolean theHasVColors  = Standard_False,
0067                                Standard_Boolean theHasVTexels  = Standard_False)
0068       : Graphic3d_ArrayOfPrimitives(
0069           Graphic3d_TOPA_QUADRANGLES,
0070           theMaxVertexs,
0071           0,
0072           theMaxEdges,
0073           (theHasVNormals ? Graphic3d_ArrayFlags_VertexNormal : Graphic3d_ArrayFlags_None)
0074             | (theHasVColors ? Graphic3d_ArrayFlags_VertexColor : Graphic3d_ArrayFlags_None)
0075             | (theHasVTexels ? Graphic3d_ArrayFlags_VertexTexel : Graphic3d_ArrayFlags_None))
0076   {
0077   }
0078 };
0079 
0080 DEFINE_STANDARD_HANDLE(Graphic3d_ArrayOfQuadrangles, Graphic3d_ArrayOfPrimitives)
0081 
0082 #endif // _Graphic3d_ArrayOfQuadrangles_HeaderFile