1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00
occt/src/HLRBRep/HLRBRep_FaceData.lxx
kgv dde6883382 0027772: Foundation Classes - define Standard_Boolean using C++ type "bool" instead of "unsigned int"
Code has been updated to remove no-op casts and implicit casts to Standard_Boolean.

Places of inproper use of Standard_Boolean instead of Standard_Integer
have been corrected:
- Bnd_Box, Bnd_Box2d
  Bit flags are now defined as private enum
- HLRAlgo_BiPoint, HLRAlgo_EdgesBlock, HLRBRep_EdgeData, HLRBRep_FaceData
  Bit flags are now defined as enum
- HLRAlgo_EdgeStatus, HLRBRep_BiPnt2D, HLRBRep_BiPoint
  Bit flags are now defined as bool fields
- HLRAlgo_PolyData
  Bit flags are now defined as Standard_Integer
- OSD_DirectoryIterator, OSD_FileIterator
  Boolean flag is now defined as Standard_Boolean
- ShapeAnalysis_Surface::SurfaceNewton()
  now returns Standard_Integer (values 0, 1 or 3)
- ChFi2d_FilletAlgo
  now uses TColStd_SequenceOfBoolean instead of TColStd_SequenceOfInteger
  for storing boolean flags

Method IFSelect_Dispatch::PacketsCount() has been dropped from interface.

ShapeFix_Solid::Status() has been fixed to decode requested status
instead of returning integer value.

TopOpeBRepBuild_Builder1 now defines map storing Standard_Boolean values
instead of Standard_Integer.

Persistence for Standard_Boolean type has been corrected
to keep backward compatibility:
- BinMDataStd, BinTools, FSD_BinaryFile

Broken Draw Harness commands vdisplaymode and verasemode have been removed.

BRepMesh_FastDiscretFace::initDataStructure() - workaround old gcc limitations

BRepMesh_IncrementalMesh::clear() - avoid ambiguity
2016-08-26 10:16:17 +03:00

322 lines
10 KiB
Plaintext

// Created on: 1997-04-17
// Created by: Christophe MARION
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
//=======================================================================
//function : Selected
//purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_FaceData::Selected() const
{ return (myFlags & FMaskSelected) != 0; }
//=======================================================================
//function : Selected
//purpose :
//=======================================================================
inline void HLRBRep_FaceData::Selected(const Standard_Boolean B)
{
if (B) myFlags |= FMaskSelected;
else myFlags &= ~FMaskSelected;
}
//=======================================================================
//function : Back
//purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_FaceData::Back() const
{ return (myFlags & FMaskBack) != 0; }
//=======================================================================
//function : Back
//purpose :
//=======================================================================
inline void HLRBRep_FaceData::Back(const Standard_Boolean B)
{
if (B) myFlags |= FMaskBack;
else myFlags &= ~FMaskBack;
}
//=======================================================================
//function : Side
//purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_FaceData::Side() const
{ return (myFlags & FMaskSide) != 0; }
//=======================================================================
//function : Side
//purpose :
//=======================================================================
inline void HLRBRep_FaceData::Side(const Standard_Boolean B)
{
if (B) myFlags |= FMaskSide;
else myFlags &= ~FMaskSide;
}
//=======================================================================
//function : Closed
//purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_FaceData::Closed() const
{ return (myFlags & FMaskClosed) != 0; }
//=======================================================================
//function : Closed
//purpose :
//=======================================================================
inline void HLRBRep_FaceData::Closed(const Standard_Boolean B)
{
if (B) myFlags |= FMaskClosed;
else myFlags &= ~FMaskClosed;
}
//=======================================================================
//function : Hiding
//purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_FaceData::Hiding() const
{ return (myFlags & FMaskHiding) != 0; }
//=======================================================================
//function : Hiding
//purpose :
//=======================================================================
inline void HLRBRep_FaceData::Hiding(const Standard_Boolean B)
{
if (B) myFlags |= FMaskHiding;
else myFlags &= ~FMaskHiding;
}
//=======================================================================
//function : Simple
//purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_FaceData::Simple() const
{ return (myFlags & FMaskSimple) != 0; }
//=======================================================================
//function : Simple
//purpose :
//=======================================================================
inline void HLRBRep_FaceData::Simple(const Standard_Boolean B)
{
if (B) myFlags |= FMaskSimple;
else myFlags &= ~FMaskSimple;
}
//=======================================================================
//function : Cut
//purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_FaceData::Cut() const
{ return (myFlags & FMaskCut) != 0; }
//=======================================================================
//function : Cut
//purpose :
//=======================================================================
inline void HLRBRep_FaceData::Cut(const Standard_Boolean B)
{
if (B) myFlags |= FMaskCut;
else myFlags &= ~FMaskCut;
}
//=======================================================================
//function : WithOutL
//purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_FaceData::WithOutL() const
{ return (myFlags & FMaskWithOutL) != 0; }
//=======================================================================
//function : WithOutL
//purpose :
//=======================================================================
inline void HLRBRep_FaceData::WithOutL(const Standard_Boolean B)
{
if (B) myFlags |= FMaskWithOutL;
else myFlags &= ~FMaskWithOutL;
}
//=======================================================================
//function : Plane
//purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_FaceData::Plane() const
{ return (myFlags & FMaskPlane) != 0; }
//=======================================================================
//function : Plane
//purpose :
//=======================================================================
inline void HLRBRep_FaceData::Plane(const Standard_Boolean B)
{
if (B) myFlags |= FMaskPlane;
else myFlags &= ~FMaskPlane;
}
//=======================================================================
//function : Cylinder
//purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_FaceData::Cylinder() const
{ return (myFlags & FMaskCylinder) != 0; }
//=======================================================================
//function : Cylinder
//purpose :
//=======================================================================
inline void HLRBRep_FaceData::Cylinder(const Standard_Boolean B)
{
if (B) myFlags |= FMaskCylinder;
else myFlags &= ~FMaskCylinder;
}
//=======================================================================
//function : Cone
//purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_FaceData::Cone() const
{ return (myFlags & FMaskCone) != 0; }
//=======================================================================
//function : Cone
//purpose :
//=======================================================================
inline void HLRBRep_FaceData::Cone(const Standard_Boolean B)
{
if (B) myFlags |= FMaskCone;
else myFlags &= ~FMaskCone;
}
//=======================================================================
//function : Sphere
//purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_FaceData::Sphere() const
{ return (myFlags & FMaskSphere) != 0; }
//=======================================================================
//function : Sphere
//purpose :
//=======================================================================
inline void HLRBRep_FaceData::Sphere(const Standard_Boolean B)
{
if (B) myFlags |= FMaskSphere;
else myFlags &= ~FMaskSphere;
}
//=======================================================================
//function : Torus
//purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_FaceData::Torus() const
{ return (myFlags & FMaskTorus) != 0; }
//=======================================================================
//function : Torus
//purpose :
//=======================================================================
inline void HLRBRep_FaceData::Torus(const Standard_Boolean B)
{
if (B) myFlags |= FMaskTorus;
else myFlags &= ~FMaskTorus;
}
//=======================================================================
//function : Size
//purpose :
//=======================================================================
inline Standard_Real HLRBRep_FaceData::Size() const
{ return mySize; }
//=======================================================================
//function : Size
//purpose :
//=======================================================================
inline void HLRBRep_FaceData::Size(const Standard_Real S)
{ mySize = S; }
//=======================================================================
//function : Orientation
//purpose :
//=======================================================================
inline TopAbs_Orientation HLRBRep_FaceData::Orientation() const
{ return ((TopAbs_Orientation)(myFlags & EMaskOrient)); }
//=======================================================================
//function : Orientation
//purpose :
//=======================================================================
inline void HLRBRep_FaceData::Orientation(const TopAbs_Orientation O)
{
myFlags &= ~EMaskOrient;
myFlags |= (O & EMaskOrient);
}
//=======================================================================
//function : Wires
//purpose :
//=======================================================================
inline Handle(HLRAlgo_WiresBlock)& HLRBRep_FaceData::Wires()
{ return myWires; }
//=======================================================================
//function : Geometry
//purpose :
//=======================================================================
inline HLRBRep_Surface& HLRBRep_FaceData::Geometry()
{ return myGeometry; }
//=======================================================================
//function : Tolerance
//purpose :
//=======================================================================
inline Standard_ShortReal HLRBRep_FaceData::Tolerance () const
{ return myTolerance; }