Files
OCCT/src/BRepExtrema/BRepExtrema_TriangleSet.hxx
abv 201c22081b 0025076: Hidden overloaded virtual functions
Implementation of virtual functions is made more consistent in places where warning was issued:

- Missing implementation of virtual method Closed() added in classes inheriting Intf_Polygon2d
- Empty implementation of virtual method Read() accepting stream is moved from PCDM_RetrievalDriver to StdLDrivers_DocumentRetrievalDriver
- Method BRepFill::Delete() is renamed to DeleteProfile() to avoid confusion with method Delete() inherited from MMgt_TShared
- Virtual method AIS_Dimenaion::ComputePlane() is removed from base class; each dimension defines and uses its own method with the same name (but different arguments)
- Inherited virtual method Dump() with single argument in class XCAFDoc_ShapeTool is now defined as short-cut to own method Dump(), also calling parent's one
- Inherited virtual method BoundingBox(void) is made visible in AIS_Shape
- Inherited virtual method Box(void) is made visible in classes inheriting BVH_PrimitiveSet
2016-01-12 01:55:10 +03:00

93 lines
3.1 KiB
C++

// Created on: 2014-10-20
// Created by: Denis BOGOLEPOV
// Copyright (c) 2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BRepExtrema_TriangleSet_HeaderFile
#define _BRepExtrema_TriangleSet_HeaderFile
#include <TopoDS_Face.hxx>
#include <BVH_PrimitiveSet.hxx>
//! List of shapes and their IDs for collision detection.
typedef NCollection_Vector<TopoDS_Face> BRepExtrema_ShapeList;
//! Triangle set corresponding to specific face.
class BRepExtrema_TriangleSet : public BVH_PrimitiveSet<Standard_Real, 3>, public Standard_Transient
{
public:
//! Creates empty triangle set.
Standard_EXPORT BRepExtrema_TriangleSet();
//! Creates triangle set from the given face.
Standard_EXPORT BRepExtrema_TriangleSet (const BRepExtrema_ShapeList& theFaces);
//! Releases resources of triangle set.
Standard_EXPORT ~BRepExtrema_TriangleSet();
public: //! @name methods implementing BVH set interface
//! Returns total number of triangles.
Standard_Integer Size() const Standard_OVERRIDE;
//! Returns AABB of the given triangle.
BVH_Box<Standard_Real, 3> Box (const Standard_Integer theIndex) const Standard_OVERRIDE;
//! Make inherited method Box() visible to avoid CLang warning
using BVH_PrimitiveSet<Standard_Real, 3>::Box;
//! Returns centroid position along specified axis.
Standard_Real Center (const Standard_Integer theIndex, const Standard_Integer theAxis) const Standard_OVERRIDE;
//! Swaps indices of two specified triangles.
void Swap (const Standard_Integer theIndex1, const Standard_Integer theIndex2) Standard_OVERRIDE;
public:
//! Clears triangle set data.
Standard_EXPORT void Clear();
//! Initializes triangle set.
Standard_EXPORT Standard_Boolean Init (const BRepExtrema_ShapeList& theFaces);
//! Returns vertices of the given triangle.
Standard_EXPORT void GetVertices (const Standard_Integer theIndex,
BVH_Vec3d& theVertex1,
BVH_Vec3d& theVertex2,
BVH_Vec3d& theVertex3) const;
//! Returns face ID of the given triangle.
Standard_EXPORT Standard_Integer GetFaceID (const Standard_Integer theIndex) const;
protected:
//! Array of vertex indices.
BVH_Array4i myTriangles;
//! Array of vertex UV params.
BVH_Array2d myVertUVArray;
//! Array of vertex coordinates.
BVH_Array3d myVertexArray;
public:
DEFINE_STANDARD_RTTIEXT(BRepExtrema_TriangleSet,Standard_Transient)
};
DEFINE_STANDARD_HANDLE (BRepExtrema_TriangleSet, Standard_Transient)
#endif // _BRepExtrema_TriangleSet_HeaderFile