// Created on: 2013-12-20 // Created by: Denis BOGOLEPOV // Copyright (c) 2013-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. // ======================================================================= // function : BVH_ObjectSet // purpose : // ======================================================================= template BVH_ObjectSet::BVH_ObjectSet() { // } // ======================================================================= // function : ~BVH_ObjectSet // purpose : // ======================================================================= template BVH_ObjectSet::~BVH_ObjectSet() { // } // ======================================================================= // function : Clears all geometric objects // purpose : // ======================================================================= template void BVH_ObjectSet::Clear() { for (Standard_Integer anObjectIdx = 0; anObjectIdx < myObjects.Size(); ++anObjectIdx) { myObjects.ChangeValue (anObjectIdx).Nullify(); } myObjects.Clear(); } // ======================================================================= // function : Objects // purpose : // ======================================================================= template typename BVH_ObjectSet::BVH_ObjectList& BVH_ObjectSet::Objects() { return myObjects; } // ======================================================================= // function : Objects // purpose : // ======================================================================= template const typename BVH_ObjectSet::BVH_ObjectList& BVH_ObjectSet::Objects() const { return myObjects; } // ======================================================================= // function : Size // purpose : // ======================================================================= template Standard_Integer BVH_ObjectSet::Size() const { return myObjects.Size(); } // ======================================================================= // function : Box // purpose : // ======================================================================= template BVH_Box BVH_ObjectSet::Box (const Standard_Integer theIndex) const { return myObjects.Value (theIndex)->Box(); } // ======================================================================= // function : Center // purpose : // ======================================================================= template T BVH_ObjectSet::Center (const Standard_Integer theIndex, const Standard_Integer theAxis) const { // Note: general implementation, not optimal return BVH::CenterAxis::Center (myObjects.Value (theIndex)->Box(), theAxis); } // ======================================================================= // function : Swap // purpose : // ======================================================================= template void BVH_ObjectSet::Swap (const Standard_Integer theIndex1, const Standard_Integer theIndex2) { std::swap (myObjects.ChangeValue (theIndex1), myObjects.ChangeValue (theIndex2)); }