1 // Created on: 2013-12-20
2 // Created by: Denis BOGOLEPOV
3 // Copyright (c) 2013 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and / or modify it
8 // under the terms of the GNU Lesser General Public version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _BVH_Triangulation_Header
17 #define _BVH_Triangulation_Header
19 #include <BVH_PrimitiveSet.hxx>
21 //! Triangulation as an example of primitive set.
22 template<class T, int N>
23 class BVH_Triangulation : public BVH_PrimitiveSet<T, N>
27 typedef typename BVHTools::VectorType<T, N>::Type BVH_VecNt;
31 //! Creates new triangulation.
34 //! Releases resources of geometric object.
35 virtual ~BVH_Triangulation();
39 //! Array of vertex coordinates.
40 typename BVHTools::ArrayType<T, N>::Type Vertices;
42 //! Array of indices of triangle indicies vertices.
47 //! Return total number of triangles.
48 virtual Standard_Integer Size() const;
50 //! Returns AABB of specified triangle.
51 virtual BVH_Box<T, N> Box (const Standard_Integer theIndex) const;
53 //! Returns centroid position in specified axis.
54 virtual T Center (const Standard_Integer theIndex,
55 const Standard_Integer theAxis) const;
57 //! Swaps indices of two specified triangles.
58 virtual void Swap (const Standard_Integer theIndex1,
59 const Standard_Integer theIndex2);
63 #include <BVH_Triangulation.lxx>
65 #endif // _BVH_Triangulation_Header