1 // Copyright (C) 2013-2022 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #include "GEOMImpl_IConformity.hxx"
21 //=============================================================================
23 * SetListOfShapesIndices
24 * Input 2D array of indexes converted into 1D array
26 //=============================================================================
27 void GEOMImpl_IConformity::SetListOfShapesIndices(const Handle(TColStd_HArray2OfInteger)& theArrayOfIndexes)
29 Handle(TColStd_HArray1OfInteger) anArray = new TColStd_HArray1OfInteger(1, theArrayOfIndexes->Size());
31 for (Standard_Integer aRow = 1; aRow <= theArrayOfIndexes->NbRows(); ++aRow)
33 anArray->SetValue(2 * aRow - 1, theArrayOfIndexes->Value(aRow, 1));
34 anArray->SetValue(2 * aRow, theArrayOfIndexes->Value(aRow, 2));
37 _func->SetIntegerArray(CHECKCONFORMITY_RET_LIST_OF_INDEXES, anArray);
40 //=============================================================================
42 * GetListOfShapesIndices
43 * Get cached 1D array of indexes and converted into 2D array of indexes
45 //=============================================================================
46 Handle(TColStd_HArray2OfInteger) GEOMImpl_IConformity::GetListOfShapesIndices()
48 Handle(TColStd_HArray1OfInteger) anArray = _func->GetIntegerArray(CHECKCONFORMITY_RET_LIST_OF_INDEXES);
50 Standard_Integer aLength = anArray->Size() / 2;
51 Handle(TColStd_HArray2OfInteger) aResArray = new TColStd_HArray2OfInteger(1, aLength, 1, 2);
53 for (Standard_Integer anIndex = 1; anIndex <= aLength; ++anIndex)
55 aResArray->SetValue(anIndex, 1, anArray->Value(2 * anIndex - 1));
56 aResArray->SetValue(anIndex, 2, anArray->Value(2 * anIndex));