Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/opencascade/BOPDS_Tools.lxx is written in an unsupported language. File is not indexed.

0001 // Created by: Peter KURNEV
0002 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0003 //
0004 // This file is part of Open CASCADE Technology software library.
0005 //
0006 // This library is free software; you can redistribute it and/or modify it under
0007 // the terms of the GNU Lesser General Public License version 2.1 as published
0008 // by the Free Software Foundation, with special exception defined in the file
0009 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0010 // distribution for complete text of the license and disclaimer of any warranty.
0011 //
0012 // Alternatively, this file may be used under the terms of Open CASCADE
0013 // commercial license or contractual agreement.
0014 
0015 //=======================================================================
0016 // function: HasBRep
0017 // purpose: 
0018 //=======================================================================
0019 inline Standard_Boolean BOPDS_Tools::HasBRep(const TopAbs_ShapeEnum aTi)
0020 {
0021   return (aTi==TopAbs_VERTEX || aTi==TopAbs_EDGE || aTi==TopAbs_FACE);
0022 }
0023 //=======================================================================
0024 // function: IsInterfering
0025 // purpose: 
0026 //=======================================================================
0027 inline Standard_Boolean BOPDS_Tools::IsInterfering
0028   (const TopAbs_ShapeEnum aTi)
0029 {
0030   return (BOPDS_Tools::HasBRep(aTi) || aTi==TopAbs_SOLID);
0031 }
0032 //=======================================================================
0033 //function : TypeToInteger
0034 //purpose  : 
0035 //=======================================================================
0036 inline Standard_Integer BOPDS_Tools::TypeToInteger(const TopAbs_ShapeEnum aType1,
0037                                                    const TopAbs_ShapeEnum aType2)
0038 {
0039   Standard_Integer iRet, iT1, iT2, iX;
0040   //
0041   iRet=-1;
0042   iT1=BOPDS_Tools::TypeToInteger(aType1);
0043   iT2=BOPDS_Tools::TypeToInteger(aType2);
0044   //
0045   iX=iT2*10+iT1;
0046   switch (iX) {
0047     case 77:
0048       iRet=0; // VV
0049       break;
0050     case 76:
0051     case 67:
0052       iRet=1; // VE
0053       break;
0054     case 66:
0055       iRet=2; // EE
0056       break;
0057     case 74:
0058     case 47:
0059       iRet=3; // VF
0060       break;
0061     case 64:
0062     case 46:
0063       iRet=4; // EF
0064       break;
0065     case 44:
0066       iRet=5; // FF
0067       break;
0068     case 72:
0069     case 27:
0070       iRet=6; // VZ
0071       break;
0072     case 62:
0073     case 26:
0074       iRet=7; // EZ
0075       break;
0076     case 42:
0077     case 24:
0078       iRet=8; // FZ
0079       break;
0080     case 22:
0081       iRet=9; // ZZ
0082       break;
0083     default:
0084       break;
0085   }
0086   return iRet; 
0087 }
0088 //=======================================================================
0089 //function : TypeToInteger
0090 //purpose  : 
0091 //=======================================================================
0092 inline Standard_Integer BOPDS_Tools::TypeToInteger(const TopAbs_ShapeEnum aType1)
0093 {
0094   Standard_Integer iRet=9;
0095   //
0096   switch(aType1) {
0097     case TopAbs_COMPOUND:
0098       iRet=0;
0099       break;
0100     case TopAbs_COMPSOLID:
0101       iRet=1;
0102       break;
0103     case TopAbs_SOLID:
0104       iRet=2;
0105       break;
0106     case TopAbs_SHELL:
0107       iRet=3;
0108       break;
0109     case TopAbs_FACE:
0110       iRet=4;
0111       break;
0112     case TopAbs_WIRE:
0113       iRet=5;
0114       break;
0115     case TopAbs_EDGE:
0116       iRet=6;
0117       break;
0118     case TopAbs_VERTEX:
0119       iRet=7;
0120       break;
0121     case TopAbs_SHAPE:
0122       iRet=8;
0123       break;
0124     default:
0125       break;
0126     }
0127   return iRet;
0128 
0129 }