|
||||
File indexing completed on 2025-01-18 10:05:22
0001 // Created on: 1992-01-24 0002 // Created by: Remi LEQUETTE 0003 // Copyright (c) 1992-1999 Matra Datavision 0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS 0005 // 0006 // This file is part of Open CASCADE Technology software library. 0007 // 0008 // This library is free software; you can redistribute it and/or modify it under 0009 // the terms of the GNU Lesser General Public License version 2.1 as published 0010 // by the Free Software Foundation, with special exception defined in the file 0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT 0012 // distribution for complete text of the license and disclaimer of any warranty. 0013 // 0014 // Alternatively, this file may be used under the terms of Open CASCADE 0015 // commercial license or contractual agreement. 0016 0017 #ifndef _TopAbs_HeaderFile 0018 #define _TopAbs_HeaderFile 0019 0020 #include <Standard.hxx> 0021 #include <Standard_DefineAlloc.hxx> 0022 #include <Standard_Handle.hxx> 0023 0024 #include <TopAbs_Orientation.hxx> 0025 #include <Standard_OStream.hxx> 0026 #include <TopAbs_ShapeEnum.hxx> 0027 #include <TopAbs_State.hxx> 0028 0029 0030 //! This package gives resources for Topology oriented 0031 //! applications such as : Topological Data Structure, 0032 //! Topological Algorithms. 0033 //! 0034 //! It contains : 0035 //! 0036 //! * The ShapeEnum enumeration to describe the 0037 //! different topological shapes. 0038 //! 0039 //! * The Orientation enumeration to describe the 0040 //! orientation of a topological shape. 0041 //! 0042 //! * The State enumeration to describes the 0043 //! position of a point relative to a Shape. 0044 //! 0045 //! * Methods to manage the enumerations. 0046 0047 class TopAbs 0048 { 0049 public: 0050 0051 DEFINE_STANDARD_ALLOC 0052 0053 0054 //! Compose the Orientation <Or1> and <Or2>. This 0055 //! composition is not symmetric (if you switch <Or1> and 0056 //! <Or2> the result is different). It assumes that <Or1> 0057 //! is the Orientation of a Shape S1 containing a Shape S2 0058 //! of Orientation Or2. The result is the cumulated 0059 //! orientation of S2 in S1. The composition law is : 0060 //! 0061 //! \ Or2 FORWARD REVERSED INTERNAL EXTERNAL 0062 //! Or1 ------------------------------------- 0063 //! FORWARD | FORWARD REVERSED INTERNAL EXTERNAL 0064 //! | 0065 //! REVERSED | REVERSED FORWARD INTERNAL EXTERNAL 0066 //! | 0067 //! INTERNAL | INTERNAL INTERNAL INTERNAL INTERNAL 0068 //! | 0069 //! EXTERNAL | EXTERNAL EXTERNAL EXTERNAL EXTERNAL 0070 //! Note: The top corner in the table is the most important 0071 //! for the purposes of Open CASCADE topology and shape sharing. 0072 Standard_EXPORT static TopAbs_Orientation Compose (const TopAbs_Orientation Or1, const TopAbs_Orientation Or2); 0073 0074 //! xchanges the interior/exterior status of the two 0075 //! sides. This is what happens when the sense of 0076 //! direction is reversed. The following rules apply: 0077 //! 0078 //! FORWARD REVERSED 0079 //! REVERSED FORWARD 0080 //! INTERNAL INTERNAL 0081 //! EXTERNAL EXTERNAL 0082 //! 0083 //! Reverse exchange the material sides. 0084 Standard_EXPORT static TopAbs_Orientation Reverse (const TopAbs_Orientation Or); 0085 0086 //! Reverses the interior/exterior status of each side of 0087 //! the object. So, to take the complement of an object 0088 //! means to reverse the interior/exterior status of its 0089 //! boundary, i.e. inside becomes outside. 0090 //! The method returns the complementary orientation, 0091 //! following the rules in the table below: 0092 //! FORWARD REVERSED 0093 //! REVERSED FORWARD 0094 //! INTERNAL EXTERNAL 0095 //! EXTERNAL INTERNAL 0096 //! 0097 //! Complement complements the material side. Inside 0098 //! becomes outside. 0099 Standard_EXPORT static TopAbs_Orientation Complement (const TopAbs_Orientation Or); 0100 0101 //! Prints the name of Shape type as a String on the Stream. 0102 static Standard_OStream& Print (const TopAbs_ShapeEnum theShapeType, Standard_OStream& theStream) 0103 { 0104 return (theStream << ShapeTypeToString (theShapeType)); 0105 } 0106 0107 //! Prints the name of the Orientation as a String on the Stream. 0108 static Standard_OStream& Print (const TopAbs_Orientation theOrientation, Standard_OStream& theStream) 0109 { 0110 return (theStream << ShapeOrientationToString (theOrientation)); 0111 } 0112 0113 //! Prints the name of the State <St> as a String on 0114 //! the Stream <S> and returns <S>. 0115 Standard_EXPORT static Standard_OStream& Print (const TopAbs_State St, Standard_OStream& S); 0116 0117 //! Returns the string name for a given shape type. 0118 //! @param theType shape type 0119 //! @return string identifier from the list COMPOUND, COMPSOLID, SOLID, SHELL, FACE, WIRE, EDGE, VERTEX, SHAPE 0120 Standard_EXPORT static Standard_CString ShapeTypeToString (TopAbs_ShapeEnum theType); 0121 0122 //! Returns the shape type from the given string identifier (using case-insensitive comparison). 0123 //! @param theTypeString string identifier 0124 //! @return shape type or TopAbs_SHAPE if string identifier is invalid 0125 static TopAbs_ShapeEnum ShapeTypeFromString (Standard_CString theTypeString) 0126 { 0127 TopAbs_ShapeEnum aType = TopAbs_SHAPE; 0128 ShapeTypeFromString (theTypeString, aType); 0129 return aType; 0130 } 0131 0132 //! Determines the shape type from the given string identifier (using case-insensitive comparison). 0133 //! @param theTypeString string identifier 0134 //! @param theType detected shape type 0135 //! @return TRUE if string identifier is known 0136 Standard_EXPORT static Standard_Boolean ShapeTypeFromString (Standard_CString theTypeString, 0137 TopAbs_ShapeEnum& theType); 0138 0139 //! Returns the string name for a given shape orientation. 0140 //! @param theOrientation shape orientation 0141 //! @return string identifier from the list FORWARD, REVERSED, INTERNAL, EXTERNAL 0142 Standard_EXPORT static Standard_CString ShapeOrientationToString (TopAbs_Orientation theOrientation); 0143 0144 //! Returns the shape orientation from the given string identifier (using case-insensitive comparison). 0145 //! @param theOrientationString string identifier 0146 //! @return shape orientation or TopAbs_FORWARD if string identifier is invalid 0147 static TopAbs_Orientation ShapeOrientationFromString (const Standard_CString theOrientationString) 0148 { 0149 TopAbs_Orientation aType = TopAbs_FORWARD; 0150 ShapeOrientationFromString (theOrientationString, aType); 0151 return aType; 0152 } 0153 0154 //! Determines the shape orientation from the given string identifier (using case-insensitive comparison). 0155 //! @param theOrientationString string identifier 0156 //! @param theOrientation detected shape orientation 0157 //! @return TRUE if string identifier is known 0158 Standard_EXPORT static Standard_Boolean ShapeOrientationFromString (const Standard_CString theOrientationString, 0159 TopAbs_Orientation& theOrientation); 0160 }; 0161 0162 #endif // _TopAbs_HeaderFile
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |