Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1992-06-10
0002 // Created by: Laurent BUCHARD
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 #include <Standard_DomainError.hxx>
0018 
0019 std::ostream& operator<<(std::ostream&, IntRes2d_Transition&);
0020 
0021 inline IntRes2d_Transition::IntRes2d_Transition(const bool               Tangent,
0022                                                 const IntRes2d_Position  Pos,
0023                                                 const IntRes2d_TypeTrans Type)
0024     :
0025 
0026       tangent(Tangent),
0027       posit(Pos),
0028       typetra(Type),
0029       situat(IntRes2d_Unknown),
0030       oppos(false)
0031 
0032 {
0033 }
0034 
0035 inline IntRes2d_Transition::IntRes2d_Transition(const bool               Tangent,
0036                                                 const IntRes2d_Position  Pos,
0037                                                 const IntRes2d_Situation Situ,
0038                                                 const bool               Oppos)
0039     : tangent(Tangent),
0040       posit(Pos),
0041       typetra(IntRes2d_Touch),
0042       situat(Situ),
0043       oppos(Oppos)
0044 {
0045 }
0046 
0047 inline IntRes2d_Transition::IntRes2d_Transition(const IntRes2d_Position Pos)
0048     :
0049 
0050       tangent(true),
0051       posit(Pos),
0052       typetra(IntRes2d_Undecided),
0053       situat(IntRes2d_Unknown),
0054       oppos(false)
0055 {
0056 }
0057 
0058 inline void IntRes2d_Transition::SetValue(const bool               Tangent,
0059                                           const IntRes2d_Position  Pos,
0060                                           const IntRes2d_TypeTrans Type)
0061 {
0062 
0063   tangent = Tangent;
0064   posit   = Pos;
0065   typetra = Type;
0066 }
0067 
0068 inline void IntRes2d_Transition::SetValue(const bool               Tangent,
0069                                           const IntRes2d_Position  Pos,
0070                                           const IntRes2d_Situation Situ,
0071                                           const bool               Oppos)
0072 {
0073 
0074   tangent = Tangent;
0075   posit   = Pos;
0076   typetra = IntRes2d_Touch;
0077   situat  = Situ;
0078   oppos   = Oppos;
0079 }
0080 
0081 inline void IntRes2d_Transition::SetValue(const IntRes2d_Position Pos)
0082 {
0083 
0084   posit   = Pos;
0085   typetra = IntRes2d_Undecided;
0086 }
0087 
0088 inline void IntRes2d_Transition::SetPosition(const IntRes2d_Position Pos)
0089 {
0090 
0091   posit = Pos;
0092 }
0093 
0094 inline IntRes2d_Position IntRes2d_Transition::PositionOnCurve() const
0095 {
0096 
0097   return posit;
0098 }
0099 
0100 inline IntRes2d_TypeTrans IntRes2d_Transition::TransitionType() const
0101 {
0102 
0103   return typetra;
0104 }
0105 
0106 inline bool IntRes2d_Transition::IsTangent() const
0107 {
0108 
0109   if (typetra == IntRes2d_Undecided)
0110   {
0111     throw Standard_DomainError();
0112   }
0113   return tangent;
0114 }
0115 
0116 inline IntRes2d_Situation IntRes2d_Transition::Situation() const
0117 {
0118 
0119   if (typetra != IntRes2d_Touch)
0120   {
0121     throw Standard_DomainError();
0122   }
0123   return situat;
0124 }
0125 
0126 inline bool IntRes2d_Transition::IsOpposite() const
0127 {
0128 
0129   if (typetra != IntRes2d_Touch)
0130   {
0131     throw Standard_DomainError();
0132   }
0133   return oppos;
0134 }