0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / IntPatch / IntPatch_PrmPrmIntersection_T3Bits.cxx
CommitLineData
b311480e 1// Created on: 1999-12-16
2// Created by: Atelier CAS2000
3// Copyright (c) 1999-1999 Matra Datavision
973c2be1 4// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5//
973c2be1 6// This file is part of Open CASCADE Technology software library.
b311480e 7//
d5f74e42 8// This library is free software; you can redistribute it and/or modify it under
9// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 10// by the Free Software Foundation, with special exception defined in the file
11// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12// distribution for complete text of the license and disclaimer of any warranty.
b311480e 13//
973c2be1 14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
7fd59977 16
42cf5bc1 17#include <IntPatch_PrmPrmIntersection_T3Bits.hxx>
7fd59977 18
19IntPatch_PrmPrmIntersection_T3Bits::IntPatch_PrmPrmIntersection_T3Bits(const Standard_Integer size)
20{
21 //-- ex: size=4 -> 4**3 = 64 bits -> 2 mots 32bits
22 Standard_Integer nb = (size*size*size)>>5;
23 Isize = nb;
24 p = new Standard_Integer [nb];
57c5e9e8 25 do { p[--nb] = 0; } while(nb);
7fd59977 26}
27
57c5e9e8 28IntPatch_PrmPrmIntersection_T3Bits::~IntPatch_PrmPrmIntersection_T3Bits()
7fd59977 29{
57c5e9e8 30 if (p) { delete[] p; p = NULL; }
7fd59977 31}
32
33void IntPatch_PrmPrmIntersection_T3Bits::ResetAnd()
34{
35 //ind = 0;
36}
37
38Standard_Integer IntPatch_PrmPrmIntersection_T3Bits::And(IntPatch_PrmPrmIntersection_T3Bits& Oth,
39 Standard_Integer& indice)
40{
41 int k=indice>>5;
7fd59977 42 while(k<Isize)
43 {
57c5e9e8 44 Standard_Integer r = p[k] & Oth.p[k];
7fd59977 45 if(r)
46 {
57c5e9e8 47 unsigned int c = 0;
7fd59977 48 do
49 {
50 if(r&1)
51 {
52 const Standard_Integer op = (k<<5)|(c);
53 Raz(op);
54 Oth.Raz(op);
55 indice = op;
56 return(1);
57 }
58 c++;
59 r>>=1;
60 }
61 while(c<32);
62 }
63 k++;
64 }
65 return(0);
66}