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
0017 inline bool BOPDS_Tools::HasBRep(const TopAbs_ShapeEnum aTi)
0018 {
0019 return (aTi == TopAbs_VERTEX || aTi == TopAbs_EDGE || aTi == TopAbs_FACE);
0020 }
0021
0022 //=================================================================================================
0023
0024 inline bool BOPDS_Tools::IsInterfering(const TopAbs_ShapeEnum aTi)
0025 {
0026 return (BOPDS_Tools::HasBRep(aTi) || aTi == TopAbs_SOLID);
0027 }
0028
0029 //=================================================================================================
0030
0031 inline int BOPDS_Tools::TypeToInteger(const TopAbs_ShapeEnum aType1, const TopAbs_ShapeEnum aType2)
0032 {
0033 int iRet, iT1, iT2, iX;
0034 //
0035 iRet = -1;
0036 iT1 = BOPDS_Tools::TypeToInteger(aType1);
0037 iT2 = BOPDS_Tools::TypeToInteger(aType2);
0038 //
0039 iX = iT2 * 10 + iT1;
0040 switch (iX)
0041 {
0042 case 77:
0043 iRet = 0; // VV
0044 break;
0045 case 76:
0046 case 67:
0047 iRet = 1; // VE
0048 break;
0049 case 66:
0050 iRet = 2; // EE
0051 break;
0052 case 74:
0053 case 47:
0054 iRet = 3; // VF
0055 break;
0056 case 64:
0057 case 46:
0058 iRet = 4; // EF
0059 break;
0060 case 44:
0061 iRet = 5; // FF
0062 break;
0063 case 72:
0064 case 27:
0065 iRet = 6; // VZ
0066 break;
0067 case 62:
0068 case 26:
0069 iRet = 7; // EZ
0070 break;
0071 case 42:
0072 case 24:
0073 iRet = 8; // FZ
0074 break;
0075 case 22:
0076 iRet = 9; // ZZ
0077 break;
0078 default:
0079 break;
0080 }
0081 return iRet;
0082 }
0083
0084 //=================================================================================================
0085
0086 inline int BOPDS_Tools::TypeToInteger(const TopAbs_ShapeEnum aType1)
0087 {
0088 int iRet = 9;
0089 //
0090 switch (aType1)
0091 {
0092 case TopAbs_COMPOUND:
0093 iRet = 0;
0094 break;
0095 case TopAbs_COMPSOLID:
0096 iRet = 1;
0097 break;
0098 case TopAbs_SOLID:
0099 iRet = 2;
0100 break;
0101 case TopAbs_SHELL:
0102 iRet = 3;
0103 break;
0104 case TopAbs_FACE:
0105 iRet = 4;
0106 break;
0107 case TopAbs_WIRE:
0108 iRet = 5;
0109 break;
0110 case TopAbs_EDGE:
0111 iRet = 6;
0112 break;
0113 case TopAbs_VERTEX:
0114 iRet = 7;
0115 break;
0116 case TopAbs_SHAPE:
0117 iRet = 8;
0118 break;
0119 default:
0120 break;
0121 }
0122 return iRet;
0123 }