mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-21 10:13:43 +03:00
115 lines
3.4 KiB
Plaintext
Executable File
115 lines
3.4 KiB
Plaintext
Executable File
// Copyright (c) 1995-1999 Matra Datavision
|
|
// Copyright (c) 1999-2012 OPEN CASCADE SAS
|
|
//
|
|
// The content of this file is subject to the Open CASCADE Technology Public
|
|
// License Version 6.5 (the "License"). You may not use the content of this file
|
|
// except in compliance with the License. Please obtain a copy of the License
|
|
// at http://www.opencascade.org and read it completely before using this file.
|
|
//
|
|
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
|
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
|
//
|
|
// The Original Code and all software distributed under the License is
|
|
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
|
// Initial Developer hereby disclaims all such warranties, including without
|
|
// limitation, any warranties of merchantability, fitness for a particular
|
|
// purpose or non-infringement. Please see the License for the specific terms
|
|
// and conditions governing the rights and limitations under the License.
|
|
|
|
#include <StdFail_NotDone.hxx>
|
|
#include <IntPatch_Line.hxx>
|
|
|
|
|
|
|
|
#define _DECAL 7
|
|
#define _DECAL2 14
|
|
#define _BASE 128
|
|
#define _BASEM1 127
|
|
|
|
|
|
//======================================================================
|
|
inline Standard_Integer IntPatch_PrmPrmIntersection::NbLines() const {
|
|
if(!done)
|
|
StdFail_NotDone::Raise(" IntPatch_PrmPrmIntersection ");
|
|
return(SLin.Length());
|
|
}
|
|
|
|
//======================================================================
|
|
inline const Handle(IntPatch_Line)& IntPatch_PrmPrmIntersection::Line
|
|
(const Standard_Integer n) const {
|
|
if(!done)
|
|
StdFail_NotDone::Raise(" IntPatch_PrmPrmIntersection ");
|
|
return(SLin.Value(n));
|
|
}
|
|
|
|
//======================================================================
|
|
inline Standard_Boolean IntPatch_PrmPrmIntersection::IsEmpty() const {
|
|
if(!done)
|
|
StdFail_NotDone::Raise(" IntPatch_PrmPrmIntersection ");
|
|
return(empt);
|
|
}
|
|
|
|
//======================================================================
|
|
inline Standard_Boolean IntPatch_PrmPrmIntersection::IsDone() const {
|
|
return(done);
|
|
}
|
|
|
|
inline Standard_Integer IntPatch_PrmPrmIntersection::GrilleInteger(const Standard_Integer ix,
|
|
const Standard_Integer iy,
|
|
const Standard_Integer iz) const
|
|
{
|
|
Standard_Integer tz = iz<<_DECAL2;
|
|
Standard_Integer ty = iy<<_DECAL;
|
|
Standard_Integer t = ix;
|
|
t|=ty;
|
|
t|=tz;
|
|
return(t);
|
|
}
|
|
|
|
inline void IntPatch_PrmPrmIntersection::IntegerGrille(const Standard_Integer tt,
|
|
Standard_Integer &ix,
|
|
Standard_Integer &iy,
|
|
Standard_Integer &iz) const
|
|
{
|
|
Standard_Integer t = tt;
|
|
ix = t & _BASEM1;
|
|
t>>=_DECAL;
|
|
iy = t & _BASEM1;
|
|
t>>=_DECAL;
|
|
iz = t;
|
|
}
|
|
|
|
inline Standard_Integer IntPatch_PrmPrmIntersection::DansGrille(const Standard_Integer t) const
|
|
{
|
|
if(t>=0) {
|
|
if(t<_BASE){
|
|
return(1);
|
|
}
|
|
}
|
|
return(0);
|
|
}
|
|
|
|
inline Standard_Integer IntPatch_PrmPrmIntersection::NbPointsGrille() const
|
|
{ return(_BASE); }
|
|
|
|
|
|
inline Standard_Integer IntPatch_PrmPrmIntersection::CodeReject(const Standard_Real x0,
|
|
const Standard_Real y0,
|
|
const Standard_Real z0,
|
|
const Standard_Real x1,
|
|
const Standard_Real y1,
|
|
const Standard_Real z1,
|
|
const Standard_Real x,
|
|
const Standard_Real y,
|
|
const Standard_Real z) const
|
|
{
|
|
int code = 0;
|
|
if(x<x0) code =1;
|
|
if(y<y0) code|=2;
|
|
if(z<z0) code|=4;
|
|
if(x>x1) code|=8;
|
|
if(y>y1) code|=16;
|
|
if(z>z1) code|=32;
|
|
return(code);
|
|
}
|