0023948: Wrong intersection between a surface of revolution and a plane.
[occt.git] / src / BVH / BVH_Triangulation.hxx
CommitLineData
3c4e78f2 1// Created on: 2013-12-20
2// Created by: Denis BOGOLEPOV
d5f74e42 3// Copyright (c) 2013-2014 OPEN CASCADE SAS
3c4e78f2 4//
5// This file is part of Open CASCADE Technology software library.
6//
d5f74e42 7// This library is free software; you can redistribute it and/or modify it under
8// the terms of the GNU Lesser General Public License version 2.1 as published
3c4e78f2 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.
12//
13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
15
16#ifndef _BVH_Triangulation_Header
17#define _BVH_Triangulation_Header
18
19#include <BVH_PrimitiveSet.hxx>
20
21//! Triangulation as an example of primitive set.
22template<class T, int N>
23class BVH_Triangulation : public BVH_PrimitiveSet<T, N>
24{
25public:
26
27 typedef typename BVHTools::VectorType<T, N>::Type BVH_VecNt;
28
29public:
30
31 //! Creates new triangulation.
32 BVH_Triangulation();
33
34 //! Releases resources of geometric object.
35 virtual ~BVH_Triangulation();
36
37public:
38
39 //! Array of vertex coordinates.
40 typename BVHTools::ArrayType<T, N>::Type Vertices;
41
42 //! Array of indices of triangle indicies vertices.
43 BVH_Array4i Elements;
44
45public:
46
47 //! Return total number of triangles.
48 virtual Standard_Integer Size() const;
49
50 //! Returns AABB of specified triangle.
51 virtual BVH_Box<T, N> Box (const Standard_Integer theIndex) const;
52
53 //! Returns centroid position in specified axis.
54 virtual T Center (const Standard_Integer theIndex,
55 const Standard_Integer theAxis) const;
56
57 //! Swaps indices of two specified triangles.
58 virtual void Swap (const Standard_Integer theIndex1,
59 const Standard_Integer theIndex2);
60
61};
62
63#include <BVH_Triangulation.lxx>
64
65#endif // _BVH_Triangulation_Header