1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-10 18:51:21 +03:00

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
This commit is contained in:
kgv 2016-08-25 14:58:51 +03:00 committed by abv
parent 3fe9ce0edd
commit dde6883382
211 changed files with 1324 additions and 2667 deletions
dox/dev_guides/upgrade
samples/mfc/standard
src
Adaptor3d
BOPDS
BOPTest
BOPTools
BRep
BRepAlgo
BRepBuilderAPI
BRepFill
BRepMesh
BRepPrim
BRepTest
BRepToIGES
BRepToIGESBRep
BRepTools
BinLDrivers
BinMDataStd
BinMDataXtd
BinObjMgt
BinTools
Bnd
ChFi2d
ChFi3d
ChFiDS
DDataStd
DNaming
Draw
Extrema
FSD
FilletSurf
GeometryTest
Graphic3d
HLRAlgo
HLRBRep

@ -1014,6 +1014,7 @@ Now such code would produce unexpected result and therefore should be updated to
@subsection upgrade_710_types Typedefs
The following type definitions in OCCT has been modified to use C++11 types:
- *Standard_Boolean* is now *bool* (previously *unsigned int*).
- *Standard_ExtCharacter* is now *char16_t* (previously *short*).
- *Standard_ExtString;* is now *const char16_t* (previously *const short*).
- *Standard_Utf16Char* is now *char16_t* (previously *uint16_t* for compatibility with old compilers).

@ -136,7 +136,7 @@ void CSelectionDialog::OnDisplay (bool isFit)
Handle(WNT_Window) aWNTWindow = new WNT_Window (GetDlgItem (IDC_HlrDlgView)->GetSafeHwnd(),
Quantity_NOC_GRAY);
myActiveView->SetComputedMode (m_HlrModeIsOn);
myActiveView->SetComputedMode (m_HlrModeIsOn != 0);
myActiveView->SetWindow(aWNTWindow);
myInteractiveContext = new AIS_InteractiveContext (myActiveViewer);
@ -434,12 +434,12 @@ void CSelectionDialog::OnHlrMode()
if (!m_HlrModeIsOn)
{
myActiveView->SetComputedMode (m_HlrModeIsOn);
myActiveView->SetComputedMode (m_HlrModeIsOn != 0);
}
else
{
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
myActiveView->SetComputedMode (m_HlrModeIsOn);
myActiveView->SetComputedMode (m_HlrModeIsOn != 0);
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
}
OnDisplay(false);
@ -500,7 +500,7 @@ void CSelectionDialog::OnRButtonUp(UINT nFlags, CPoint point)
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
// reset the good HLR mode according to the stored one
// --> dynamic rotation may have change it
myActiveView->SetComputedMode (m_HlrModeIsOn);
myActiveView->SetComputedMode (m_HlrModeIsOn != 0);
OnDisplay(false);
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW));
}

@ -124,7 +124,7 @@ void CColoredMeshDlg::OnRadio3()
void CColoredMeshDlg::OnCheckX1()
{
X1OnOff = m_CheckX1OnOff;
X1OnOff = m_CheckX1OnOff != 0;
}
void CColoredMeshDlg::OnCHECKXBlue()
@ -156,7 +156,7 @@ void CColoredMeshDlg::OnCHECKXRed()
void CColoredMeshDlg::OnCheckY1()
{
Y1OnOff = m_CheckY1OnOff;
Y1OnOff = m_CheckY1OnOff != 0;
}
void CColoredMeshDlg::OnCHECKYBlue()
@ -188,7 +188,7 @@ void CColoredMeshDlg::OnCHECKYRed()
void CColoredMeshDlg::OnCheckZ1()
{
Z1OnOff = m_CheckZ1OnOff;
Z1OnOff = m_CheckZ1OnOff != 0;
}
void CColoredMeshDlg::OnCHECKZBlue()

@ -602,7 +602,7 @@ void CDimensionDlg::OnDestroy()
const Standard_Boolean CDimensionDlg::GetTextType() const
{
CButton* a3DButton = (CButton*)GetDlgItem (IDC_3DText);
return a3DButton->GetCheck();
return a3DButton->GetCheck() != 0;
}
//=======================================================================

@ -124,21 +124,21 @@ case 6: //color
myX1OnOff = Dlg.X1OnOff;
myXBlueOnOff = Dlg.m_CheckXBlueOnOff;
myXGreenOnOff = Dlg.m_CheckXGreenOnOff;
myXRedOnOff = Dlg.m_CheckXRedOnOff;
myXBlueOnOff = Dlg.m_CheckXBlueOnOff != 0;
myXGreenOnOff = Dlg.m_CheckXGreenOnOff != 0;
myXRedOnOff = Dlg.m_CheckXRedOnOff != 0;
myY1OnOff = Dlg.Y1OnOff;
myYBlueOnOff = Dlg.m_CheckYBlueOnOff;
myYGreenOnOff = Dlg.m_CheckYGreenOnOff;
myYRedOnOff = Dlg.m_CheckYRedOnOff;
myYBlueOnOff = Dlg.m_CheckYBlueOnOff != 0;
myYGreenOnOff = Dlg.m_CheckYGreenOnOff != 0;
myYRedOnOff = Dlg.m_CheckYRedOnOff != 0;
myZ1OnOff = Dlg.Z1OnOff;
myZBlueOnOff = Dlg.m_CheckZBlueOnOff;
myZGreenOnOff = Dlg.m_CheckZGreenOnOff;
myZRedOnOff = Dlg.m_CheckZRedOnOff;
myZBlueOnOff = Dlg.m_CheckZBlueOnOff != 0;
myZGreenOnOff = Dlg.m_CheckZGreenOnOff != 0;
myZRedOnOff = Dlg.m_CheckZRedOnOff != 0;
// Adds a triangulation of the shape myShape to its topological data structure.
// This triangulation is computed with the deflection myDeflection.

@ -917,7 +917,7 @@ Standard_Integer Adaptor3d_IsoCurve::Degree() const
Standard_Boolean Adaptor3d_IsoCurve::IsRational() const
{
Standard_Integer is_rational = Standard_False ;
Standard_Boolean is_rational = Standard_False;
GeomAbs_SurfaceType type = mySurface->GetType() ;
switch(type) {
case GeomAbs_BezierSurface:

@ -86,7 +86,8 @@
//function : Contains
//purpose :
//=======================================================================
inline Standard_Boolean BOPDS_IndexRange::Contains(const Standard_Integer aIndex)const
inline Standard_Boolean BOPDS_IndexRange::Contains(const Standard_Integer aIndex)const
{
return (Standard_Boolean)(aIndex>=myFirst && aIndex<=myLast);
return aIndex >= myFirst
&& aIndex <= myLast;
}

@ -163,7 +163,7 @@ class BOPDS_Interf {
* @return true if the interference has index of new shape
*/
Standard_Boolean HasIndexNew() const {
return (myIndexNew+1);
return (myIndexNew+1) != 0;
}
//
protected:

@ -119,7 +119,7 @@ Standard_Integer brunparallel(Draw_Interpretor& di,
return 0;
}
//
bRunParallel=(Standard_Boolean)(iX);
bRunParallel = (iX != 0);
BOPTest_Objects::SetRunParallel(bRunParallel);
//
return 0;
@ -146,7 +146,7 @@ Standard_Integer bnondestructive(Draw_Interpretor& di,
return 0;
}
//
bNonDestructive = (Standard_Boolean)(iX);
bNonDestructive = (iX != 0);
BOPTest_Objects::SetNonDestructive(bNonDestructive);
//
return 0;

@ -592,7 +592,7 @@ TopAbs_State BOPTools_AlgoTools::ComputeState
//function : IsInternalFace
//purpose :
//=======================================================================
Standard_Integer BOPTools_AlgoTools::IsInternalFace
Standard_Boolean BOPTools_AlgoTools::IsInternalFace
(const TopoDS_Face& theFace,
const TopoDS_Solid& theSolid,
BOPCol_IndexedDataMapOfShapeListOfShape& theMEF,
@ -640,7 +640,7 @@ Standard_Integer BOPTools_AlgoTools::IsInternalFace
BOPCol_ListOfShape& aLF=theMEF.ChangeFromKey(aE);
aNbF=aLF.Extent();
if (!aNbF) {
return iRet; // it can not be so
return iRet != 0; // it can not be so
}
//
else if (aNbF==1) {
@ -670,8 +670,7 @@ Standard_Integer BOPTools_AlgoTools::IsInternalFace
}
//
if (aNbF%2) {
iRet=0;
return iRet; // it can not be so
return Standard_False; // it can not be so
}
else { // aNbF=2,4,6,8,...
iRet=BOPTools_AlgoTools::IsInternalFace(theFace, aE, aLF,
@ -686,7 +685,7 @@ Standard_Integer BOPTools_AlgoTools::IsInternalFace
}
//
if (iRet!=2) {
return iRet;
return iRet == 1;
}
//
//========================================
@ -699,10 +698,7 @@ Standard_Integer BOPTools_AlgoTools::IsInternalFace
//
aState=BOPTools_AlgoTools::ComputeState(theFace, theSolid,
theTol, aBounds, theContext);
//
iRet=(aState==TopAbs_IN)? 1 : 0;
//
return iRet;
return aState == TopAbs_IN;
}
//=======================================================================
//function : IsInternalFace

@ -101,12 +101,19 @@ public:
//! couple of faces theFace1, theFace2.
//! The faces theFace, theFace1, theFace2 must
//! share the edge theEdge
//! Return values:
//! * 0 state is not IN
//! * 1 state is IN
//! * 2 state can not be found by the method of angles
Standard_EXPORT static Standard_Integer IsInternalFace (const TopoDS_Face& theFace, const TopoDS_Edge& theEdge, const TopoDS_Face& theFace1, const TopoDS_Face& theFace2, Handle(IntTools_Context)& theContext);
//! Returns True if the face theFace is inside of the
//! appropriate couple of faces (from the set theLF) .
//! The faces of the set theLF and theFace must
//! share the edge theEdge
//! * 0 state is not IN
//! * 1 state is IN
//! * 2 state can not be found by the method of angles
Standard_EXPORT static Standard_Integer IsInternalFace (const TopoDS_Face& theFace, const TopoDS_Edge& theEdge, BOPCol_ListOfShape& theLF, Handle(IntTools_Context)& theContext);
//! Returns True if the face theFace is inside the
@ -114,7 +121,7 @@ public:
//! theMEF - Map Edge/Faces for theSolid
//! theTol - value of precision of computation
//! theContext- cahed geometrical tools
Standard_EXPORT static Standard_Integer IsInternalFace (const TopoDS_Face& theFace, const TopoDS_Solid& theSolid, BOPCol_IndexedDataMapOfShapeListOfShape& theMEF, const Standard_Real theTol, Handle(IntTools_Context)& theContext);
Standard_EXPORT static Standard_Boolean IsInternalFace (const TopoDS_Face& theFace, const TopoDS_Solid& theSolid, BOPCol_IndexedDataMapOfShapeListOfShape& theMEF, const Standard_Real theTol, Handle(IntTools_Context)& theContext);
//! For the face theFace gets the edge theEdgeOnF
//! that is the same as theEdge

@ -50,9 +50,9 @@ BRep_TEdge::BRep_TEdge() :
//purpose :
//=======================================================================
Standard_Boolean BRep_TEdge::SameParameter()const
Standard_Boolean BRep_TEdge::SameParameter() const
{
return myFlags & ParameterMask;
return (myFlags & ParameterMask) != 0;
}
@ -73,12 +73,11 @@ BRep_TEdge::BRep_TEdge() :
//purpose :
//=======================================================================
Standard_Boolean BRep_TEdge::SameRange()const
Standard_Boolean BRep_TEdge::SameRange() const
{
return myFlags & RangeMask;
return (myFlags & RangeMask) != 0;
}
//=======================================================================
//function : SameRange
//purpose :
@ -96,12 +95,11 @@ BRep_TEdge::BRep_TEdge() :
//purpose :
//=======================================================================
Standard_Boolean BRep_TEdge::Degenerated()const
Standard_Boolean BRep_TEdge::Degenerated() const
{
return myFlags & DegeneratedMask;
return (myFlags & DegeneratedMask) != 0;
}
//=======================================================================
//function : Degenerated
//purpose :

@ -72,7 +72,7 @@ TopoDS_Shape BRepAlgo_Tool::Deboucle3D(const TopoDS_Shape& S,
// iterate on sub-shapes and add non-empty.
TopoDS_Iterator it(S);
TopoDS_Shape SubShape;
Standard_Boolean NbSub = 0;
Standard_Integer NbSub = 0;
BRep_Builder B;
if (S.ShapeType() == TopAbs_COMPOUND) {
B.MakeCompound(TopoDS::Compound(SS));

@ -342,7 +342,7 @@ void BRepBuilderAPI_Sewing::SameParameter(const TopoDS_Edge& edge) const
TopoDS_Edge BRepBuilderAPI_Sewing::SameParameterEdge(const TopoDS_Shape& edge,
const TopTools_SequenceOfShape& seqEdges,
const TColStd_SequenceOfInteger& seqForward,
const TColStd_SequenceOfBoolean& seqForward,
TopTools_MapOfShape& mapMerged,
const Handle(BRepTools_ReShape)& locReShape)
{
@ -405,8 +405,8 @@ TopoDS_Edge BRepBuilderAPI_Sewing::SameParameterEdge(const TopoDS_Shape& edge,
if (locReShape != myReShape) Edge2 = TopoDS::Edge(aTmpShape);
// Calculate relative orientation
Standard_Integer Orientation = seqForward(i);
if (!isForward) Orientation = (Orientation? 0 : 1);
Standard_Boolean Orientation = seqForward(i);
if (!isForward) Orientation = !Orientation;
// Retrieve faces information for the second edge
TopoDS_Shape bnd2 = oedge2;
@ -1335,7 +1335,7 @@ Standard_Boolean BRepBuilderAPI_Sewing::IsMergedClosed(const TopoDS_Edge& Edge1,
void BRepBuilderAPI_Sewing::AnalysisNearestEdges(const TopTools_SequenceOfShape& sequenceSec,
TColStd_SequenceOfInteger& seqIndCandidate,
TColStd_SequenceOfInteger& seqOrientations,
TColStd_SequenceOfBoolean& seqOrientations,
const Standard_Boolean evalDist)
{
@ -1465,7 +1465,7 @@ void BRepBuilderAPI_Sewing::AnalysisNearestEdges(const TopTools_SequenceOfShape&
Standard_Boolean BRepBuilderAPI_Sewing::FindCandidates(TopTools_SequenceOfShape& seqSections,
TColStd_IndexedMapOfInteger& mapReference,
TColStd_SequenceOfInteger& seqCandidates,
TColStd_SequenceOfInteger& seqOrientations)
TColStd_SequenceOfBoolean& seqOrientations)
{
Standard_Integer i, nbSections = seqSections.Length();
if(nbSections <= 1)
@ -1521,8 +1521,8 @@ Standard_Boolean BRepBuilderAPI_Sewing::FindCandidates(TopTools_SequenceOfShape&
// Reference section is connected to section #i
Standard_Boolean isInserted = Standard_False;
Standard_Integer j, ori = (arrForward(i)? 1 : 0);
for (j = 1; (j <= seqCandidates.Length()) && !isInserted; j++) {
Standard_Boolean ori = arrForward(i);
for (Standard_Integer j = 1; (j <= seqCandidates.Length()) && !isInserted; j++) {
Standard_Real aDelta = arrDistance(i) - arrDistance(seqCandidates.Value(j));
if( aDelta < Precision::Confusion()) {
@ -1558,9 +1558,9 @@ Standard_Boolean BRepBuilderAPI_Sewing::FindCandidates(TopTools_SequenceOfShape&
if (myNonmanifold && nbCandidates >1) {
TColStd_SequenceOfInteger seqNewCandidates;
TColStd_SequenceOfInteger seqOrientationsNew;
TColStd_SequenceOfBoolean seqOrientationsNew;
seqCandidates.Prepend(1);
seqOrientations.Prepend(1);
seqOrientations.Prepend(Standard_True);
for(Standard_Integer k = 1; k <= seqSections.Length() && seqCandidates.Length() > 1 ; k++) {
AnalysisNearestEdges(seqSections,seqCandidates,seqOrientations,(k==1));
if(k == 1 && !seqCandidates.Length()) return Standard_False;
@ -1660,7 +1660,8 @@ Standard_Boolean BRepBuilderAPI_Sewing::FindCandidates(TopTools_SequenceOfShape&
if (mapReference.Contains(indCandidate)) break;
// Find candidates for candidate #indCandidate
mapReference.Add(indCandidate); // Push candidate in the map
TColStd_SequenceOfInteger seqCandidates1, seqOrientations1;
TColStd_SequenceOfInteger seqCandidates1;
TColStd_SequenceOfBoolean seqOrientations1;
Standard_Boolean isFound =
FindCandidates(seqSections,mapReference,seqCandidates1,seqOrientations1);
mapReference.RemoveLast(); // Pop candidate from the map
@ -3185,7 +3186,7 @@ void BRepBuilderAPI_Sewing::Merging(const Standard_Boolean /* firstTime */,
if (!isPrevSplit) {
// Obtain sequence of edges merged with bound
TopTools_SequenceOfShape seqMergedWithBound;
TColStd_SequenceOfInteger seqMergedWithBoundOri;
TColStd_SequenceOfBoolean seqMergedWithBoundOri;
if (MergedNearestEdges(bound,seqMergedWithBound,seqMergedWithBoundOri)) {
// Store bound in the map
MergedWithBound.Bind(bound,bound);
@ -3262,7 +3263,7 @@ void BRepBuilderAPI_Sewing::Merging(const Standard_Boolean /* firstTime */,
if (!nbMerged) MergedWithBound.UnBind(bound);
}
}
Standard_Boolean isMerged = MergedWithBound.Extent();
const Standard_Boolean isMerged = !MergedWithBound.IsEmpty();
// Merge with cutting sections
Handle(BRepTools_ReShape) SectionsReShape = new BRepTools_ReShape;
@ -3277,7 +3278,7 @@ void BRepBuilderAPI_Sewing::Merging(const Standard_Boolean /* firstTime */,
if (myMergedEdges.Contains(section)) continue;
// Merge cutting section
TopTools_SequenceOfShape seqMergedWithSection;
TColStd_SequenceOfInteger seqMergedWithSectionOri;
TColStd_SequenceOfBoolean seqMergedWithSectionOri;
if (MergedNearestEdges(section,seqMergedWithSection,seqMergedWithSectionOri)) {
// Store section in the map
MergedWithSections.Bind(section,section);
@ -3363,7 +3364,7 @@ void BRepBuilderAPI_Sewing::Merging(const Standard_Boolean /* firstTime */,
}
}
}
Standard_Boolean isMergedSplit = MergedWithSections.Extent();
const Standard_Boolean isMergedSplit = !MergedWithSections.IsEmpty();
if (!isMerged && !isMergedSplit) {
// Nothing was merged in this iteration
@ -3464,7 +3465,7 @@ void BRepBuilderAPI_Sewing::Merging(const Standard_Boolean /* firstTime */,
Standard_Boolean BRepBuilderAPI_Sewing::MergedNearestEdges(const TopoDS_Shape& edge,
TopTools_SequenceOfShape& SeqMergedEdge,
TColStd_SequenceOfInteger& SeqMergedOri)
TColStd_SequenceOfBoolean& SeqMergedOri)
{
// Retrieve edge nodes
TopoDS_Vertex no1, no2;
@ -3580,7 +3581,7 @@ Standard_Boolean BRepBuilderAPI_Sewing::MergedNearestEdges(const TopoDS_Shape& e
}
// Find merging candidates
TColStd_SequenceOfInteger seqForward;
TColStd_SequenceOfBoolean seqForward;
TColStd_SequenceOfInteger seqCandidates;
TColStd_IndexedMapOfInteger mapReference;
mapReference.Add(indRef); // Add index of reference section
@ -3590,12 +3591,12 @@ Standard_Boolean BRepBuilderAPI_Sewing::MergedNearestEdges(const TopoDS_Shape& e
for (i = 1; i <= nbCandidates; i++) {
// Retrieve merged edge
TopoDS_Shape iedge = seqEdges(seqCandidates(i));
Standard_Integer ori = (seqForward(i))? 1 : 0;
Standard_Boolean ori = seqForward(i) != 0;
SeqMergedEdge.Append(iedge);
SeqMergedOri.Append(ori);
if (!myNonmanifold) break;
}
success = nbCandidates;
success = (nbCandidates != 0);
}
}

@ -34,6 +34,7 @@
#include <TopTools_ListOfShape.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <TColStd_IndexedMapOfInteger.hxx>
#include <TColStd_SequenceOfBoolean.hxx>
#include <TColStd_SequenceOfInteger.hxx>
#include <TColStd_Array1OfBoolean.hxx>
#include <TColStd_Array1OfReal.hxx>
@ -254,12 +255,12 @@ protected:
Standard_EXPORT Standard_Boolean IsMergedClosed (const TopoDS_Edge& Edge1, const TopoDS_Edge& Edge2, const TopoDS_Face& fase) const;
Standard_EXPORT Standard_Boolean FindCandidates (TopTools_SequenceOfShape& seqSections, TColStd_IndexedMapOfInteger& mapReference, TColStd_SequenceOfInteger& seqCandidates, TColStd_SequenceOfInteger& seqOrientations);
Standard_EXPORT Standard_Boolean FindCandidates (TopTools_SequenceOfShape& seqSections, TColStd_IndexedMapOfInteger& mapReference, TColStd_SequenceOfInteger& seqCandidates, TColStd_SequenceOfBoolean& seqOrientations);
Standard_EXPORT void AnalysisNearestEdges (const TopTools_SequenceOfShape& sequenceSec, TColStd_SequenceOfInteger& seqIndCandidate, TColStd_SequenceOfInteger& seqOrientations, const Standard_Boolean evalDist = Standard_True);
Standard_EXPORT void AnalysisNearestEdges (const TopTools_SequenceOfShape& sequenceSec, TColStd_SequenceOfInteger& seqIndCandidate, TColStd_SequenceOfBoolean& seqOrientations, const Standard_Boolean evalDist = Standard_True);
//! Merged nearest edges.
Standard_EXPORT Standard_Boolean MergedNearestEdges (const TopoDS_Shape& edge, TopTools_SequenceOfShape& SeqMergedEdge, TColStd_SequenceOfInteger& SeqMergedOri);
Standard_EXPORT Standard_Boolean MergedNearestEdges (const TopoDS_Shape& edge, TopTools_SequenceOfShape& SeqMergedEdge, TColStd_SequenceOfBoolean& SeqMergedOri);
Standard_EXPORT void EdgeProcessing (const Handle(Message_ProgressIndicator)& thePI = 0);
@ -311,7 +312,7 @@ protected:
//! This method is called from Merging only
Standard_EXPORT virtual TopoDS_Edge SameParameterEdge (const TopoDS_Shape& edge, const TopTools_SequenceOfShape& seqEdges, const TColStd_SequenceOfInteger& seqForward, TopTools_MapOfShape& mapMerged, const Handle(BRepTools_ReShape)& locReShape);
Standard_EXPORT virtual TopoDS_Edge SameParameterEdge (const TopoDS_Shape& edge, const TopTools_SequenceOfShape& seqEdges, const TColStd_SequenceOfBoolean& seqForward, TopTools_MapOfShape& mapMerged, const Handle(BRepTools_ReShape)& locReShape);
//! This method is called from Merging only

@ -73,6 +73,7 @@
#include <TColgp_Array1OfPnt.hxx>
#include <TColStd_Array1OfBoolean.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array2OfBoolean.hxx>
#include <TColStd_Array2OfInteger.hxx>
#include <TColStd_Array2OfReal.hxx>
#include <TColStd_HArray1OfInteger.hxx>
@ -1957,10 +1958,10 @@ BRepFill_Sweep::BRepFill_Sweep(const Handle(BRepFill_SectionLaw)& Section,
// (1.1) Construction of Tables
TColStd_Array2OfInteger ExchUV(1, NbLaw, 1, NbPath);
TColStd_Array2OfInteger UReverse(1, NbLaw, 1, NbPath);
TColStd_Array2OfInteger Degenerated(1, NbLaw, 1, NbPath);
Degenerated.Init(0);
TColStd_Array2OfBoolean ExchUV (1, NbLaw, 1, NbPath);
TColStd_Array2OfBoolean UReverse (1, NbLaw, 1, NbPath);
TColStd_Array2OfBoolean Degenerated(1, NbLaw, 1, NbPath);
Degenerated.Init (false);
// No VReverse for the moment...
TColStd_Array2OfReal TabErr(1, NbLaw , 1, NbPath);
TColGeom_Array2OfSurface TabS(1, NbLaw , 1, NbPath);

@ -435,7 +435,7 @@ Standard_Boolean MakeFacesNonSec(const Standard_Integer theI
// search common vertices between uedges. begin
TopTools_ListOfShape aCommonVertices;
Standard_Boolean acommonflag = 0; // 0 - no, 1 - first pair, 2 - second pair, 3 - both
Standard_Integer acommonflag = 0; // 0 - no, 1 - first pair, 2 - second pair, 3 - both
Standard_Integer ueit = 0, eindex = 0;
for(ueit = 1, eindex = theIndex; ueit <= 2; ueit++, eindex++) {
@ -705,7 +705,7 @@ Standard_Boolean MakeFacesSec(const Standard_Integer theInde
}
TopTools_ListOfShape aCommonVertices;
// Standard_Boolean acommonflag = 0; // 0 - no, 1 - first pair, 2 - second pair, 3 - both
// Standard_Integer acommonflag = 0; // 0 - no, 1 - first pair, 2 - second pair, 3 - both
Standard_Integer fit = 0; //, ueit = 0, eindex = 0, i = 0;
Handle(BRepTools_ReShape) aSubstitutor = new BRepTools_ReShape();

@ -314,7 +314,7 @@ void BRepMesh_Delaun::createTriangles(const Standard_Integer theVertexIn
Standard_Integer anEdgeId = anEdges.Key();
const BRepMesh_Edge& anEdge = GetEdge( anEdgeId );
Standard_Boolean isPositive = (Standard_Boolean)thePoly( anEdgeId );
const Standard_Boolean isPositive = thePoly (anEdgeId) != 0;
Standard_Integer aNodes[3];
if ( isPositive )
@ -2007,7 +2007,7 @@ void BRepMesh_Delaun::RemoveVertex( const BRepMesh_Vertex& theVertex )
Standard_Integer aPivotNode = anEdge.LastNode();
Standard_Integer anEdgeId = aLoopEdgesIt.Key();
Standard_Boolean isPositive = (Standard_Boolean)aLoopEdges( anEdgeId );
Standard_Boolean isPositive = (aLoopEdges (anEdgeId) != 0);
if ( !isPositive )
{
Standard_Integer aTmp;

@ -222,8 +222,9 @@ void BRepMesh_FastDiscretFace::initDataStructure()
thetype == GeomAbs_BSplineSurface);
const Standard_Boolean useUVParam = (thetype == GeomAbs_Torus || IsCompexSurface (thetype));
myUParam.Clear(aAllocator);
myVParam.Clear(aAllocator);
Handle(NCollection_BaseAllocator) aBaseAlloc = aAllocator;
myUParam.Clear (aBaseAlloc);
myVParam.Clear (aBaseAlloc);
// essai de determination de la longueur vraie:
// akm (bug OCC16) : We must calculate these measures in non-singular

@ -127,7 +127,7 @@ BRepMesh_IncrementalMesh::~BRepMesh_IncrementalMesh()
void BRepMesh_IncrementalMesh::clear()
{
// the allocator will be alive while the structures are alive
Handle(NCollection_IncAllocator) anAlloc =
Handle(NCollection_BaseAllocator) anAlloc =
new NCollection_IncAllocator(BRepMesh::MEMORY_BLOCK_SIZE_HUGE);
myEdges.Clear(anAlloc);
myEdgeDeflection.Clear(anAlloc);

@ -34,12 +34,6 @@
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Wire.hxx>
#undef Standard_True
#undef Standard_False
#define Standard_True ((Standard_Boolean) 1)
#define Standard_False ((Standard_Boolean) 0)
#define NBFACES 6
#define NBWIRES 6
#define NBEDGES 12

@ -35,13 +35,6 @@
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Wire.hxx>
#undef Standard_True
#undef Standard_False
#define Standard_True ((Standard_Boolean) 1)
#define Standard_False ((Standard_Boolean) 0)
#define NBVERTICES 6
#define VAXISTOP 0
#define VAXISBOT 1

@ -355,7 +355,7 @@ static Standard_Integer checkdiff(Draw_Interpretor& di,
di << syntaxe << "\n";
return 1;
}
closedSolid=Draw::Atoi(a[narg-1]);
closedSolid = Draw::Atoi(a[narg-1]) != 0;
resu = DBRep::Get(a[narg-2]);
lastArg=narg-3;
if (resu.IsNull()) {
@ -365,7 +365,7 @@ static Standard_Integer checkdiff(Draw_Interpretor& di,
return 1;
}
geomCtrl=closedSolid;
closedSolid=Draw::Atoi(a[narg-2]);
closedSolid = Draw::Atoi(a[narg-2]) != 0;
resu = DBRep::Get(a[narg-3]);
lastArg=narg-4;
if (resu.IsNull()) {

@ -999,8 +999,8 @@ static Standard_Integer bsplineprof(Draw_Interpretor& di,
0.0e0) ;
gp_Pnt2d first_point(0.0e0,
0.0e0) ;
Standard_Integer i = 2,
wait = 1 ;
Standard_Integer i = 2;
Standard_Boolean wait = Standard_True;
// Standard_Real x0 = 0, y0 = 0, x = 0, y = 0, dx = 1, dy = 0;
Standard_Real x = 0, y = 0, dx = 1, dy = 0;
BRepBuilderAPI_MakeWire MW;

@ -127,11 +127,7 @@ static Standard_Integer NDEP(Draw_Interpretor& theCommands,
return 1;
}
//#ifdef OCCT_DEBUG
// Flag = Draw::Atof(a[9*ii+7]); // BUG?? Real -> Boolean ???
//#else
Flag = (Standard_Boolean ) Draw::Atof(a[9*ii+7]);
//#endif
Flag = Draw::Atoi(a[9*ii+7]) != 0;
Angle = Draw::Atof(a[9*ii+8])*M_PI/180.;
Pax.SetCoord(Draw::Atof(a[9*ii+9]),Draw::Atof(a[9*ii+10]),Draw::Atof(a[9*ii+11]));
Dax.SetCoord(Draw::Atof(a[9*ii+12]),Draw::Atof(a[9*ii+13]),Draw::Atof(a[9*ii+14]));

@ -330,7 +330,7 @@ static Standard_Integer CONTROL(Draw_Interpretor& theCommands,
Standard_Integer narg, const char** a)
{
if (narg >= 2) {
WithControl = strcmp("0",a[1]);
WithControl = strcmp("0", a[1]) != 0;
}
if (WithControl) {
theCommands << "Mode avec controle";
@ -787,7 +787,7 @@ static Standard_Integer SPLS(Draw_Interpretor& ,
for (; aExpE.More(); aExpE.Next())
aSplitEdges.Append(aExpE.Current());
isSplittingEdges = (aSplitEdges.Length());
isSplittingEdges = !aSplitEdges.IsEmpty();
}
}
@ -1050,7 +1050,7 @@ Standard_Integer offsetparameter(Draw_Interpretor& di,
if ( n < 4 ) return 1;
//
TheTolerance = Draw::Atof(a[1]);
TheInter = strcmp(a[2],"p");
TheInter = strcmp(a[2],"p") != 0;
//
if ( !strcmp(a[3],"a")) TheJoin = GeomAbs_Arc;
else if ( !strcmp(a[3],"i")) TheJoin = GeomAbs_Intersection;

@ -669,7 +669,7 @@ static Standard_Integer fillingparam( Draw_Interpretor & di, Standard_Integer n,
Degree = Draw::Atoi( a[2] );
NbPtsOnCur = Draw::Atoi( a[3] );
NbIter = Draw::Atoi( a[4] );
Anisotropie = Draw::Atoi( a[5] );
Anisotropie = Draw::Atoi( a[5] ) != 0;
}
else if (strcmp( flag, "-c" ) == 0 && n == 6)
{

@ -529,7 +529,7 @@ static Standard_Integer setsweep(Draw_Interpretor& di,
else
{
TopoDS_Shape Guide = DBRep::Get(a[2],TopAbs_WIRE);
Standard_Integer CurvilinearEquivalence = Draw::Atoi(a[3]);
Standard_Boolean CurvilinearEquivalence = Draw::Atoi(a[3]) != 0;
Standard_Integer KeepContact = Draw::Atoi(a[4]);
Sweep->SetMode(TopoDS::Wire(Guide),
CurvilinearEquivalence,

@ -56,8 +56,8 @@ char Name[100];
BRepToIGES_BREntity::BRepToIGES_BREntity()
: TheUnitFactor(1.0),
myConvSurface(Interface_Static::IVal("write.convertsurface.mode")),
myPCurveMode (Interface_Static::IVal("write.surfacecurve.mode")),
myConvSurface(Interface_Static::IVal("write.convertsurface.mode") != 0),
myPCurveMode (Interface_Static::IVal("write.surfacecurve.mode") != 0),
TheMap (new Transfer_FinderProcess())
{
}
@ -71,8 +71,8 @@ void BRepToIGES_BREntity::Init()
{
TheMap = new Transfer_FinderProcess();
TheUnitFactor = 1.;
myConvSurface = Interface_Static::IVal("write.convertsurface.mode");
myPCurveMode = Interface_Static::IVal("write.surfacecurve.mode");
myConvSurface = Interface_Static::IVal("write.convertsurface.mode") != 0;
myPCurveMode = Interface_Static::IVal("write.surfacecurve.mode") != 0;
}
//=======================================================================

@ -724,10 +724,10 @@ Handle(IGESSolid_ManifoldSolid) BRepToIGESBRep_Entity ::TransferSolid (const Top
FirstShell = GetCasted(IGESSolid_Shell, Seq->Value(1));
ShellFlag = SeqFlag.Value(1);
Tab.Nullify(); TabFlag.Nullify();
mysol->Init(FirstShell, ShellFlag, Tab, TabFlag);
mysol->Init(FirstShell, ShellFlag != 0, Tab, TabFlag);
}
else if (nbshells >=2 ) {
mysol->Init(FirstShell, ShellFlag, Tab, TabFlag);
mysol->Init(FirstShell, ShellFlag != 0, Tab, TabFlag);
}
else
AddWarning (start, " no Result ");

@ -504,7 +504,7 @@ TopoDS_Shape BRepTools_Quilt::Shells() const
// Unclose all shells having free edges
for (TopTools_DataMapIteratorOfDataMapOfShapeShape it(M); it.More(); it.Next()) {
TopoDS_Shape S = it.Value();
S.Closed(Standard_Boolean(Standard_False));
S.Closed (Standard_False);
}
TopTools_MapIteratorOfMapOfShape itother(MapOtherShape); //gka version for free edges

@ -165,7 +165,7 @@ void BinLDrivers_DocumentSection::Write (Standard_OStream& theStream,
Standard_Integer aVal[3] = {
Standard_Integer(myValue[0]),
Standard_Integer(myValue[1]),
Standard_Integer(myIsPostRead)
Standard_Integer(myIsPostRead ? 1 : 0)
};
#if DO_INVERSE
aVal[0] = InverseSize(aVal[0]);
@ -204,6 +204,6 @@ void BinLDrivers_DocumentSection::ReadTOC
#endif
theSection.myValue[0] = (Standard_Size)aValue[0];
theSection.myValue[1] = (Standard_Size)aValue[1];
theSection.myIsPostRead = (Standard_Boolean)aValue[2];
theSection.myIsPostRead = aValue[2] != 0;
}
}

@ -76,7 +76,7 @@ Standard_Boolean BinMDataStd_ByteArrayDriver::Paste(const BinObjMgt_Persistent&
if (! (theSource >> aDeltaValue))
return Standard_False;
else
aDelta = (Standard_Boolean)aDeltaValue;
aDelta = (aDeltaValue != 0);
}
anAtt->SetDelta(aDelta);
return Standard_True;
@ -106,5 +106,5 @@ void BinMDataStd_ByteArrayDriver::Paste(const Handle(TDF_Attribute)& theSource,
}
Standard_Byte *aPtr = (Standard_Byte *) &aSourceArray(lower);
theTarget.PutByteArray(aPtr, bytes->Length());
theTarget << (Standard_Byte)anAtt->GetDelta();
theTarget << (Standard_Byte)(anAtt->GetDelta() ? 1 : 0);
}

@ -87,7 +87,7 @@ Standard_Boolean BinMDataStd_ExtStringArrayDriver::Paste
return Standard_False;
}
else
aDelta = (Standard_Boolean)aDeltaValue;
aDelta = (aDeltaValue != 0);
}
anAtt->SetDelta(aDelta);
}
@ -113,5 +113,5 @@ void BinMDataStd_ExtStringArrayDriver::Paste
for (Standard_Integer i = aFirstInd; i <= aLastInd; i ++)
theTarget << anAtt->Value( i );
theTarget << (Standard_Byte)anAtt->GetDelta();
theTarget << (Standard_Byte)(anAtt->GetDelta() ? 1 : 0);
}

@ -92,7 +92,7 @@ Standard_Boolean BinMDataStd_IntPackedMapDriver::Paste
if (! (Source >> aDeltaValue))
return Standard_False;
else
aDelta = (Standard_Boolean)aDeltaValue;
aDelta = (aDeltaValue != 0);
}
aTagAtt->SetDelta(aDelta);
return Standard_True;
@ -120,5 +120,5 @@ void BinMDataStd_IntPackedMapDriver::Paste
for(;anIt.More();anIt.Next())
Target << anIt.Key();
}
Target << (Standard_Byte)anAtt->GetDelta();
Target << (Standard_Byte)(anAtt->GetDelta() ? 1 : 0);
}

@ -74,7 +74,7 @@ Standard_Boolean BinMDataStd_IntegerArrayDriver::Paste
if (! (theSource >> aDeltaValue))
return Standard_False;
else
aDelta = (Standard_Boolean)aDeltaValue;
aDelta = (aDeltaValue != 0);
}
#ifdef OCCT_DEBUG
else if(BinMDataStd::DocumentVersion() == -1)
@ -103,5 +103,5 @@ void BinMDataStd_IntegerArrayDriver::Paste
theTarget << aFirstInd << aLastInd;
Standard_Integer *aPtr = (Standard_Integer *) &aSourceArray(aFirstInd);
theTarget.PutIntArray (aPtr, aLength);
theTarget << (Standard_Byte)anAtt->GetDelta();
theTarget << (Standard_Byte)(anAtt->GetDelta() ? 1 : 0);
}

@ -75,7 +75,7 @@ Standard_Boolean BinMDataStd_RealArrayDriver::Paste
if (! (theSource >> aDeltaValue))
return Standard_False;
else
aDelta = (Standard_Boolean)aDeltaValue;
aDelta = (aDeltaValue != 0);
}
anAtt->SetDelta(aDelta);
return Standard_True;
@ -100,5 +100,5 @@ void BinMDataStd_RealArrayDriver::Paste
theTarget << aFirstInd << aLastInd;
Standard_Real *aPtr = (Standard_Real *) &aSourceArray(aFirstInd);
theTarget.PutRealArray (aPtr, aLength);
theTarget << (Standard_Byte)anAtt->GetDelta();
theTarget << (Standard_Byte)(anAtt->GetDelta() ? 1 : 0);
}

@ -124,9 +124,9 @@ Standard_Boolean BinMDataXtd_ConstraintDriver::Paste
Standard_Integer flags;
if (! (theSource >> flags))
return Standard_False;
aC->Verified( flags & 1);
aC->Inverted( flags & 2);
aC->Reversed( flags & 4);
aC->Verified ((flags & 1) != 0);
aC->Inverted ((flags & 2) != 0);
aC->Reversed ((flags & 4) != 0);
return Standard_True;
}

@ -69,8 +69,8 @@ Standard_Boolean BinMDataXtd_PatternStdDriver::Paste
Standard_Integer revFlags;
if (! (theSource >> revFlags))
return Standard_False;
aP->Axis1Reversed( revFlags & 1 );
aP->Axis2Reversed( revFlags & 2 );
aP->Axis1Reversed ((revFlags & 1) != 0);
aP->Axis2Reversed ((revFlags & 2) != 0);
Handle(TNaming_NamedShape) TNS;
Standard_Integer aNb;

@ -58,7 +58,7 @@ Standard_Boolean BinMDataXtd_PresentationDriver::Paste
Standard_Integer aValue;
ok = theSource >> aValue;
if (!ok) return ok;
anAttribute->SetDisplayed(static_cast<Standard_Boolean>(aValue));
anAttribute->SetDisplayed (aValue != 0);
// GUID
Standard_GUID aGUID;

@ -227,6 +227,6 @@ inline const BinObjMgt_Persistent& BinObjMgt_Persistent::GetBoolean
// Standard_Integer anIntVal = (Standard_Integer) theValue;
Standard_Integer anIntVal;
GetInteger (anIntVal);
theValue = (Standard_Boolean) anIntVal;
theValue = anIntVal != 0;
return *this;
}

@ -26,7 +26,7 @@
//=======================================================================
Standard_OStream& BinTools::PutBool(Standard_OStream& OS, const Standard_Boolean aValue)
{
OS.put((Standard_Byte)aValue);
OS.put((Standard_Byte)(aValue ? 1 : 0));
return OS;
}
@ -128,7 +128,7 @@ Standard_IStream& BinTools::GetExtChar(Standard_IStream& IS, Standard_ExtCharact
Standard_IStream& BinTools::GetBool(Standard_IStream& IS, Standard_Boolean& aValue)
{
aValue = (Standard_Boolean)IS.get();
aValue = (IS.get() != 0);
return IS;
}

@ -14,7 +14,6 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Bnd_Box.hxx>
#include <gp_Dir.hxx>
#include <gp_Lin.hxx>
@ -23,35 +22,7 @@
#include <gp_Trsf.hxx>
#include <Standard_ConstructionError.hxx>
#define VoidMask 0x01
#define XminMask 0x02
#define XmaxMask 0x04
#define YminMask 0x08
#define YmaxMask 0x10
#define ZminMask 0x20
#define ZmaxMask 0x40
#define WholeMask 0x7e
// Standard_True if the flag is one
#define VoidFlag() ( Flags & VoidMask )
#define XminFlag() ( Flags & XminMask )
#define XmaxFlag() ( Flags & XmaxMask )
#define YminFlag() ( Flags & YminMask )
#define YmaxFlag() ( Flags & YmaxMask )
#define ZminFlag() ( Flags & ZminMask )
#define ZmaxFlag() ( Flags & ZmaxMask )
#define WholeFlag() ( (Flags & WholeMask) == WholeMask )
// set the flag to one
#define SetVoidFlag() ( Flags = VoidMask )
#define SetXminFlag() ( Flags |= XminMask )
#define SetXmaxFlag() ( Flags |= XmaxMask )
#define SetYminFlag() ( Flags |= YminMask )
#define SetYmaxFlag() ( Flags |= YmaxMask )
#define SetZminFlag() ( Flags |= ZminMask )
#define SetZmaxFlag() ( Flags |= ZmaxMask )
#define SetWholeFlag() ( Flags = WholeMask )
#define ClearVoidFlag() ( Flags &= ~VoidMask )
#include <Standard_Stream.hxx>
@ -70,27 +41,6 @@ Bnd_Box::Bnd_Box()
SetVoid();
}
//=======================================================================
//function : SetWhole
//purpose :
//=======================================================================
void Bnd_Box::SetWhole ()
{
SetWholeFlag();
}
//=======================================================================
//function : SetVoid
//purpose :
//=======================================================================
void Bnd_Box::SetVoid ()
{
SetVoidFlag();
Gap=0.;
}
//=======================================================================
//function : Set
//purpose :
@ -126,7 +76,8 @@ void Bnd_Box::Update (const Standard_Real x,
const Standard_Real Y,
const Standard_Real Z)
{
if (VoidFlag()) {
if (IsVoid())
{
Xmin = x;
Ymin = y;
Zmin = z;
@ -136,12 +87,12 @@ void Bnd_Box::Update (const Standard_Real x,
ClearVoidFlag();
}
else {
if (!XminFlag() && (x < Xmin)) Xmin = x;
if (!XmaxFlag() && (X > Xmax)) Xmax = X;
if (!YminFlag() && (y < Ymin)) Ymin = y;
if (!YmaxFlag() && (Y > Ymax)) Ymax = Y;
if (!ZminFlag() && (z < Zmin)) Zmin = z;
if (!ZmaxFlag() && (Z > Zmax)) Zmax = Z;
if (!IsOpenXmin() && (x < Xmin)) Xmin = x;
if (!IsOpenXmax() && (X > Xmax)) Xmax = X;
if (!IsOpenYmin() && (y < Ymin)) Ymin = y;
if (!IsOpenYmax() && (Y > Ymax)) Ymax = Y;
if (!IsOpenZmin() && (z < Zmin)) Zmin = z;
if (!IsOpenZmax() && (Z > Zmax)) Zmax = Z;
}
}
@ -154,7 +105,8 @@ void Bnd_Box::Update (const Standard_Real X,
const Standard_Real Y,
const Standard_Real Z)
{
if (VoidFlag()) {
if (IsVoid())
{
Xmin = X;
Ymin = Y;
Zmin = Z;
@ -164,12 +116,12 @@ void Bnd_Box::Update (const Standard_Real X,
ClearVoidFlag();
}
else {
if (!XminFlag() && (X < Xmin)) Xmin = X;
else if (!XmaxFlag() && (X > Xmax)) Xmax = X;
if (!YminFlag() && (Y < Ymin)) Ymin = Y;
else if (!YmaxFlag() && (Y > Ymax)) Ymax = Y;
if (!ZminFlag() && (Z < Zmin)) Zmin = Z;
else if (!ZmaxFlag() && (Z > Zmax)) Zmax = Z;
if (!IsOpenXmin() && (X < Xmin)) Xmin = X;
else if (!IsOpenXmax() && (X > Xmax)) Xmax = X;
if (!IsOpenYmin() && (Y < Ymin)) Ymin = Y;
else if (!IsOpenYmax() && (Y > Ymax)) Ymax = Y;
if (!IsOpenZmin() && (Z < Zmin)) Zmin = Z;
else if (!IsOpenZmax() && (Z > Zmax)) Zmax = Z;
}
}
@ -215,23 +167,23 @@ void Bnd_Box::Get (Standard_Real& theXmin,
Standard_Real& theYmax,
Standard_Real& theZmax) const
{
if (VoidFlag())
if (IsVoid())
{
Standard_ConstructionError::Raise ("Bnd_Box is void");
}
if (XminFlag()) theXmin = -Bnd_Precision_Infinite;
else theXmin = Xmin - Gap;
if (XmaxFlag()) theXmax = Bnd_Precision_Infinite;
else theXmax = Xmax + Gap;
if (YminFlag()) theYmin = -Bnd_Precision_Infinite;
else theYmin = Ymin - Gap;
if (YmaxFlag()) theYmax = Bnd_Precision_Infinite;
else theYmax = Ymax + Gap;
if (ZminFlag()) theZmin = -Bnd_Precision_Infinite;
else theZmin = Zmin - Gap;
if (ZmaxFlag()) theZmax = Bnd_Precision_Infinite;
else theZmax = Zmax + Gap;
if (IsOpenXmin()) theXmin = -Bnd_Precision_Infinite;
else theXmin = Xmin - Gap;
if (IsOpenXmax()) theXmax = Bnd_Precision_Infinite;
else theXmax = Xmax + Gap;
if (IsOpenYmin()) theYmin = -Bnd_Precision_Infinite;
else theYmin = Ymin - Gap;
if (IsOpenYmax()) theYmax = Bnd_Precision_Infinite;
else theYmax = Ymax + Gap;
if (IsOpenZmin()) theZmin = -Bnd_Precision_Infinite;
else theZmin = Zmin - Gap;
if (IsOpenZmax()) theZmax = Bnd_Precision_Infinite;
else theZmax = Zmax + Gap;
}
//=======================================================================
@ -242,17 +194,17 @@ void Bnd_Box::Get (Standard_Real& theXmin,
gp_Pnt Bnd_Box::CornerMin() const
{
gp_Pnt aCornerMin;
if (VoidFlag())
if (IsVoid())
{
Standard_ConstructionError::Raise ("Bnd_Box is void");
return aCornerMin;
}
if (XminFlag()) aCornerMin.SetX (-Bnd_Precision_Infinite);
else aCornerMin.SetX (Xmin - Gap);
if (YminFlag()) aCornerMin.SetY (-Bnd_Precision_Infinite);
else aCornerMin.SetY (Ymin - Gap);
if (ZminFlag()) aCornerMin.SetZ (-Bnd_Precision_Infinite);
else aCornerMin.SetZ (Zmin - Gap);
if (IsOpenXmin()) aCornerMin.SetX (-Bnd_Precision_Infinite);
else aCornerMin.SetX (Xmin - Gap);
if (IsOpenYmin()) aCornerMin.SetY (-Bnd_Precision_Infinite);
else aCornerMin.SetY (Ymin - Gap);
if (IsOpenZmin()) aCornerMin.SetZ (-Bnd_Precision_Infinite);
else aCornerMin.SetZ (Zmin - Gap);
return aCornerMin;
}
@ -264,160 +216,20 @@ gp_Pnt Bnd_Box::CornerMin() const
gp_Pnt Bnd_Box::CornerMax() const
{
gp_Pnt aCornerMax;
if(VoidFlag())
if (IsVoid())
{
Standard_ConstructionError::Raise ("Bnd_Box is void");
return aCornerMax;
}
if (XmaxFlag()) aCornerMax.SetX (Bnd_Precision_Infinite);
else aCornerMax.SetX (Xmax + Gap);
if (YminFlag()) aCornerMax.SetY (Bnd_Precision_Infinite);
else aCornerMax.SetY (Ymax + Gap);
if (ZminFlag()) aCornerMax.SetZ (Bnd_Precision_Infinite);
else aCornerMax.SetZ (Zmax + Gap);
if (IsOpenXmax()) aCornerMax.SetX (Bnd_Precision_Infinite);
else aCornerMax.SetX (Xmax + Gap);
if (IsOpenYmin()) aCornerMax.SetY (Bnd_Precision_Infinite);
else aCornerMax.SetY (Ymax + Gap);
if (IsOpenZmin()) aCornerMax.SetZ (Bnd_Precision_Infinite);
else aCornerMax.SetZ (Zmax + Gap);
return aCornerMax;
}
//=======================================================================
//function : OpenXmin
//purpose :
//=======================================================================
void Bnd_Box::OpenXmin ()
{
SetXminFlag();
}
//=======================================================================
//function : OpenXmax
//purpose :
//=======================================================================
void Bnd_Box::OpenXmax ()
{
SetXmaxFlag();
}
//=======================================================================
//function : OpenYmin
//purpose :
//=======================================================================
void Bnd_Box::OpenYmin ()
{
SetYminFlag();
}
//=======================================================================
//function : OpenYmax
//purpose :
//=======================================================================
void Bnd_Box::OpenYmax ()
{
SetYmaxFlag();
}
//=======================================================================
//function : OpenZmin
//purpose :
//=======================================================================
void Bnd_Box::OpenZmin ()
{
SetZminFlag();
}
//=======================================================================
//function : OpenZmax
//purpose :
//=======================================================================
void Bnd_Box::OpenZmax ()
{
SetZmaxFlag();
}
//=======================================================================
//function : IsOpenXmin
//purpose :
//=======================================================================
Standard_Boolean Bnd_Box::IsOpenXmin () const
{
return XminFlag();
}
//=======================================================================
//function : IsOpenXmax
//purpose :
//=======================================================================
Standard_Boolean Bnd_Box::IsOpenXmax () const
{
return XmaxFlag();
}
//=======================================================================
//function : IsOpenYmin
//purpose :
//=======================================================================
Standard_Boolean Bnd_Box::IsOpenYmin () const
{
return YminFlag();
}
//=======================================================================
//function : IsOpenYmax
//purpose :
//=======================================================================
Standard_Boolean Bnd_Box::IsOpenYmax () const
{
return YmaxFlag();
}
//=======================================================================
//function : IsOpenZmin
//purpose :
//=======================================================================
Standard_Boolean Bnd_Box::IsOpenZmin () const
{
return ZminFlag();
}
//=======================================================================
//function : IsOpenZmax
//purpose :
//=======================================================================
Standard_Boolean Bnd_Box::IsOpenZmax () const
{
return ZmaxFlag();
}
//=======================================================================
//function : IsWhole
//purpose :
//=======================================================================
Standard_Boolean Bnd_Box::IsWhole () const
{
return WholeFlag();
}
//=======================================================================
//function : IsVoid
//purpose :
//=======================================================================
Standard_Boolean Bnd_Box::IsVoid () const
{
return VoidFlag();
}
//=======================================================================
//function : IsXThin
//purpose :
@ -427,8 +239,8 @@ Standard_Boolean Bnd_Box::IsXThin (const Standard_Real tol) const
{
if (IsWhole()) return Standard_False;
if (IsVoid()) return Standard_True;
if (XminFlag()) return Standard_False;
if (XmaxFlag()) return Standard_False;
if (IsOpenXmin()) return Standard_False;
if (IsOpenXmax()) return Standard_False;
if (Xmax-Xmin < tol) return Standard_True;
return Standard_False;
}
@ -442,8 +254,8 @@ Standard_Boolean Bnd_Box::IsYThin (const Standard_Real tol) const
{
if (IsWhole()) return Standard_False;
if (IsVoid()) return Standard_True;
if (YminFlag()) return Standard_False;
if (YmaxFlag()) return Standard_False;
if (IsOpenYmin()) return Standard_False;
if (IsOpenYmax()) return Standard_False;
if (Ymax-Ymin < tol) return Standard_True;
return Standard_False;
}
@ -457,8 +269,8 @@ Standard_Boolean Bnd_Box::IsZThin (const Standard_Real tol) const
{
if (IsWhole()) return Standard_False;
if (IsVoid()) return Standard_True;
if (ZminFlag()) return Standard_False;
if (ZmaxFlag()) return Standard_False;
if (IsOpenZmin()) return Standard_False;
if (IsOpenZmax()) return Standard_False;
if (Zmax-Zmin < tol) return Standard_True;
return Standard_False;
}
@ -491,12 +303,12 @@ Bnd_Box Bnd_Box::Transformed (const gp_Trsf& T) const
else if (F == gp_Translation) {
Standard_Real DX,DY,DZ;
(T.TranslationPart()).Coord(DX,DY,DZ);
if (!XminFlag()) newb.Xmin += DX;
if (!XmaxFlag()) newb.Xmax += DX;
if (!YminFlag()) newb.Ymin += DY;
if (!YmaxFlag()) newb.Ymax += DY;
if (!ZminFlag()) newb.Zmin += DZ;
if (!ZmaxFlag()) newb.Zmax += DZ;
if (!IsOpenXmin()) newb.Xmin += DX;
if (!IsOpenXmax()) newb.Xmax += DX;
if (!IsOpenYmin()) newb.Ymin += DY;
if (!IsOpenYmax()) newb.Ymax += DY;
if (!IsOpenZmin()) newb.Zmin += DZ;
if (!IsOpenZmax()) newb.Zmax += DZ;
}
else {
gp_Pnt P[8];
@ -507,32 +319,38 @@ Bnd_Box Bnd_Box::Transformed (const gp_Trsf& T) const
// Standard_Integer vertices = 0;
Standard_Integer directions = 0;
if (XminFlag()) {
if (IsOpenXmin())
{
directions++;
D[directions-1].SetCoord(-1., 0., 0.);
Vertex[0] = Vertex[2] = Vertex[4] = Vertex[6] = Standard_False;
}
if (XmaxFlag()) {
if (IsOpenXmax())
{
directions++;
D[directions-1].SetCoord( 1., 0., 0.);
Vertex[1] = Vertex[3] = Vertex[5] = Vertex[7] = Standard_False;
}
if (YminFlag()) {
if (IsOpenYmin())
{
directions++;
D[directions-1].SetCoord( 0.,-1., 0.);
Vertex[0] = Vertex[1] = Vertex[4] = Vertex[5] = Standard_False;
}
if (YmaxFlag()) {
if (IsOpenYmax())
{
directions++;
D[directions-1].SetCoord( 0., 1., 0.);
Vertex[2] = Vertex[3] = Vertex[6] = Vertex[7] = Standard_False;
}
if (ZminFlag()) {
if (IsOpenZmin())
{
directions++;
D[directions-1].SetCoord( 0., 0.,-1.);
Vertex[0] = Vertex[1] = Vertex[2] = Vertex[3] = Standard_False;
}
if (ZmaxFlag()) {
if (IsOpenZmax())
{
directions++;
D[directions-1].SetCoord( 0., 0., 1.);
Vertex[4] = Vertex[5] = Vertex[6] = Vertex[7] = Standard_False;
@ -671,12 +489,12 @@ Standard_Boolean Bnd_Box::IsOut (const gp_Pnt& P) const
else {
Standard_Real X,Y,Z;
P.Coord(X,Y,Z);
if (!XminFlag() && (X < (Xmin-Gap))) return Standard_True;
else if (!XmaxFlag() && (X > (Xmax+Gap))) return Standard_True;
else if (!YminFlag() && (Y < (Ymin-Gap))) return Standard_True;
else if (!YmaxFlag() && (Y > (Ymax+Gap))) return Standard_True;
else if (!ZminFlag() && (Z < (Zmin-Gap))) return Standard_True;
else if (!ZmaxFlag() && (Z > (Zmax+Gap))) return Standard_True;
if (!IsOpenXmin() && (X < (Xmin-Gap))) return Standard_True;
else if (!IsOpenXmax() && (X > (Xmax+Gap))) return Standard_True;
else if (!IsOpenYmin() && (Y < (Ymin-Gap))) return Standard_True;
else if (!IsOpenYmax() && (Y > (Ymax+Gap))) return Standard_True;
else if (!IsOpenZmin() && (Z < (Zmin-Gap))) return Standard_True;
else if (!IsOpenZmax() && (Z > (Zmax+Gap))) return Standard_True;
else return Standard_False;
}
}
@ -839,19 +657,19 @@ Standard_Boolean Bnd_Box::IsOut (const Bnd_Box& Other) const
Standard_Real delta = Other.Gap + Gap;
if (!XminFlag() && !Other.IsOpenXmax())
if (!IsOpenXmin() && !Other.IsOpenXmax())
if (Xmin - Other.Xmax > delta) return Standard_True;
if (!XmaxFlag() && !Other.IsOpenXmin())
if (!IsOpenXmax() && !Other.IsOpenXmin())
if (Other.Xmin - Xmax > delta) return Standard_True;
if (!YminFlag() && !Other.IsOpenYmax())
if (!IsOpenYmin() && !Other.IsOpenYmax())
if (Ymin - Other.Ymax > delta) return Standard_True;
if (!YmaxFlag() && !Other.IsOpenYmin())
if (!IsOpenYmax() && !Other.IsOpenYmin())
if (Other.Ymin - Ymax > delta) return Standard_True;
if (!ZminFlag() && !Other.IsOpenZmax())
if (!IsOpenZmin() && !Other.IsOpenZmax())
if (Zmin - Other.Zmax > delta) return Standard_True;
if (!ZmaxFlag() && !Other.IsOpenZmin())
if (!IsOpenZmax() && !Other.IsOpenZmin())
if (Other.Zmin - Zmax > delta) return Standard_True;
return Standard_False;

@ -71,10 +71,14 @@ public:
//! Sets this bounding box so that it covers the whole of 3D space.
//! It is infinitely long in all directions.
Standard_EXPORT void SetWhole();
void SetWhole() { Flags = WholeMask; }
//! Sets this bounding box so that it is empty. All points are outside a void box.
Standard_EXPORT void SetVoid();
void SetVoid()
{
Flags = VoidMask;
Gap = 0.0;
}
//! Sets this bounding box so that it bounds
//! - the point P. This involves first setting this bounding box
@ -135,51 +139,51 @@ public:
//! The Box will be infinitely long in the Xmin
//! direction.
Standard_EXPORT void OpenXmin();
void OpenXmin() { Flags |= XminMask; }
//! The Box will be infinitely long in the Xmax
//! direction.
Standard_EXPORT void OpenXmax();
void OpenXmax() { Flags |= XmaxMask; }
//! The Box will be infinitely long in the Ymin
//! direction.
Standard_EXPORT void OpenYmin();
void OpenYmin() { Flags |= YminMask; }
//! The Box will be infinitely long in the Ymax
//! direction.
Standard_EXPORT void OpenYmax();
void OpenYmax() { Flags |= YmaxMask; }
//! The Box will be infinitely long in the Zmin
//! direction.
Standard_EXPORT void OpenZmin();
void OpenZmin() { Flags |= ZminMask; }
//! The Box will be infinitely long in the Zmax
//! direction.
Standard_EXPORT void OpenZmax();
void OpenZmax() { Flags |= ZmaxMask; }
//! Returns true if this bounding box is open in the Xmin direction.
Standard_EXPORT Standard_Boolean IsOpenXmin() const;
Standard_Boolean IsOpenXmin() const { return (Flags & XminMask) != 0; }
//! Returns true if this bounding box is open in the Xmax direction.
Standard_EXPORT Standard_Boolean IsOpenXmax() const;
Standard_Boolean IsOpenXmax() const { return (Flags & XmaxMask) != 0; }
//! Returns true if this bounding box is open in the Ymix direction.
Standard_EXPORT Standard_Boolean IsOpenYmin() const;
Standard_Boolean IsOpenYmin() const { return (Flags & YminMask) != 0; }
//! Returns true if this bounding box is open in the Ymax direction.
Standard_EXPORT Standard_Boolean IsOpenYmax() const;
Standard_Boolean IsOpenYmax() const { return (Flags & YmaxMask) != 0; }
//! Returns true if this bounding box is open in the Zmin direction.
Standard_EXPORT Standard_Boolean IsOpenZmin() const;
Standard_Boolean IsOpenZmin() const { return (Flags & ZminMask) != 0; }
//! Returns true if this bounding box is open in the Zmax direction.
Standard_EXPORT Standard_Boolean IsOpenZmax() const;
Standard_Boolean IsOpenZmax() const { return (Flags & ZmaxMask) != 0; }
//! Returns true if this bounding box is infinite in all 6 directions (WholeSpace flag).
Standard_EXPORT Standard_Boolean IsWhole() const;
Standard_Boolean IsWhole() const { return (Flags & WholeMask) == WholeMask; }
//! Returns true if this bounding box is empty (Void flag).
Standard_EXPORT Standard_Boolean IsVoid() const;
Standard_Boolean IsVoid() const { return (Flags & VoidMask) != 0; }
//! true if xmax-xmin < tol.
Standard_EXPORT Standard_Boolean IsXThin (const Standard_Real tol) const;
@ -247,21 +251,36 @@ public:
Standard_EXPORT void Dump() const;
//! Computes the squared diagonal of me.
Standard_Real SquareExtent() const;
Standard_Real SquareExtent() const
{
if (IsVoid())
{
return 0.0;
}
const Standard_Real aDx = Xmax - Xmin + Gap + Gap;
const Standard_Real aDy = Ymax - Ymin + Gap + Gap;
const Standard_Real aDz = Zmax - Zmin + Gap + Gap;
return aDx * aDx + aDy * aDy + aDz * aDz;
}
protected:
//! Bit flags.
enum MaskFlags
{
VoidMask = 0x01,
XminMask = 0x02,
XmaxMask = 0x04,
YminMask = 0x08,
YmaxMask = 0x10,
ZminMask = 0x20,
ZmaxMask = 0x40,
WholeMask = 0x7e
};
private:
Standard_Real Xmin;
Standard_Real Xmax;
Standard_Real Ymin;
@ -271,14 +290,6 @@ private:
Standard_Real Gap;
Standard_Integer Flags;
};
#include <Bnd_Box.lxx>
#endif // _Bnd_Box_HeaderFile

@ -1,28 +0,0 @@
// Created on: 2005-02-14
// Created by: Alexey MORENOV
// Copyright (c) 2005-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 : SquareExtent
//purpose : Computes the squared diagonal
//=======================================================================
inline Standard_Real Bnd_Box::SquareExtent() const
{
if ( IsVoid() ) return 0.;
const Standard_Real aDx = Xmax - Xmin + Gap + Gap;
const Standard_Real aDy = Ymax - Ymin + Gap + Gap;
const Standard_Real aDz = Zmax - Zmin + Gap + Gap;
return aDx*aDx + aDy*aDy + aDz*aDz;
}

@ -17,6 +17,7 @@
#ifndef _Bnd_Box2d_HeaderFile
#define _Bnd_Box2d_HeaderFile
#include <gp_Pnt2d.hxx>
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
@ -25,7 +26,6 @@
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
class Standard_ConstructionError;
class gp_Pnt2d;
class gp_Dir2d;
class gp_Trsf2d;
@ -54,29 +54,42 @@ public:
DEFINE_STANDARD_ALLOC
//! Creates an empty 2D bounding box.
//! The constructed box is qualified Void. Its gap is null.
Bnd_Box2d();
Bnd_Box2d() : Xmin(0.), Xmax(0.), Ymin(0.), Ymax(0.), Gap(0.), Flags (VoidMask) {}
//! Sets this bounding box so that it covers the whole 2D
//! space, i.e. it is infinite in all directions.
void SetWhole();
void SetWhole() { Flags = WholeMask; }
//! Sets this 2D bounding box so that it is empty. All points are outside a void box.
void SetVoid();
void SetVoid()
{
Flags = VoidMask;
Gap = 0.0;
}
//! Sets this 2D bounding box so that it bounds
//! the point P. This involves first setting this bounding box
//! to be void and then adding the point PThe rectangle bounds the point <P>.
void Set (const gp_Pnt2d& P);
void Set (const gp_Pnt2d& thePnt)
{
Flags = VoidMask;
Gap = 0.0;
Add (thePnt);
}
//! Sets this 2D bounding box so that it bounds
//! the half-line defined by point P and direction D, i.e. all
//! points M defined by M=P+u*D, where u is greater than
//! or equal to 0, are inside the bounding area. This involves
//! first setting this 2D box to be void and then adding the half-line.
void Set (const gp_Pnt2d& P, const gp_Dir2d& D);
void Set (const gp_Pnt2d& thePnt, const gp_Dir2d& theDir)
{
Flags = VoidMask;
Gap = 0.0;
Add (thePnt, theDir);
}
//! Enlarges this 2D bounding box, if required, so that it
//! contains at least:
@ -88,17 +101,21 @@ public:
Standard_EXPORT void Update (const Standard_Real X, const Standard_Real Y);
//! Returns the gap of this 2D bounding box.
Standard_Real GetGap() const;
Standard_Real GetGap() const { return Gap; }
//! Set the gap of this 2D bounding box to abs(Tol).
void SetGap (const Standard_Real Tol);
void SetGap (const Standard_Real Tol) { Gap = Tol; }
//! Enlarges the box with a tolerance value.
//! This means that the minimum values of its X and Y
//! intervals of definition, when they are finite, are reduced by
//! the absolute value of Tol, while the maximum values are
//! increased by the same amount.
void Enlarge (const Standard_Real Tol);
void Enlarge (const Standard_Real theTol)
{
Standard_Real aTol = theTol < 0.0 ? -theTol : theTol;
if (Gap < aTol) Gap = aTol;
}
//! Returns the bounds of this 2D bounding box.
//! The gap is included. If this bounding box is infinite (i.e. "open"), returned values
@ -107,37 +124,35 @@ public:
Standard_EXPORT void Get (Standard_Real& aXmin, Standard_Real& aYmin, Standard_Real& aXmax, Standard_Real& aYmax) const;
//! The Box will be infinitely long in the Xmin direction.
void OpenXmin();
void OpenXmin() { Flags |= XminMask; }
//! The Box will be infinitely long in the Xmax direction.
void OpenXmax();
void OpenXmax() { Flags |= XmaxMask; }
//! The Box will be infinitely long in the Ymin direction.
void OpenYmin();
void OpenYmin() { Flags |= YminMask; }
//! The Box will be infinitely long in the Ymax direction.
void OpenYmax();
void OpenYmax() { Flags |= YmaxMask; }
//! Returns true if this bounding box is open in the Xmin direction.
Standard_Boolean IsOpenXmin() const;
Standard_Boolean IsOpenXmin() const { return (Flags & XminMask) != 0; }
//! Returns true if this bounding box is open in the Xmax direction.
Standard_Boolean IsOpenXmax() const;
Standard_Boolean IsOpenXmax() const { return (Flags & XmaxMask) != 0; }
//! Returns true if this bounding box is open in the Ymin direction.
Standard_Boolean IsOpenYmin() const;
Standard_Boolean IsOpenYmin() const { return (Flags & YminMask) != 0; }
//! Returns true if this bounding box is open in the Ymax direction.
Standard_Boolean IsOpenYmax() const;
Standard_Boolean IsOpenYmax() const { return (Flags & YmaxMask) != 0; }
//! Returns true if this bounding box is infinite in all 4
//! directions (Whole Space flag).
Standard_Boolean IsWhole() const;
Standard_Boolean IsWhole() const { return (Flags & WholeMask) == WholeMask; }
//! Returns true if this 2D bounding box is empty (Void flag).
Standard_Boolean IsVoid() const;
Standard_Boolean IsVoid() const { return (Flags & VoidMask) != 0; }
//! Returns a bounding box which is the result of applying the
//! transformation T to this bounding box.
@ -150,11 +165,15 @@ public:
//! Adds the 2d box <Other> to <me>.
Standard_EXPORT void Add (const Bnd_Box2d& Other);
//! Adds the 2d pnt <P> to <me>.
void Add (const gp_Pnt2d& P);
//! Adds the 2d point.
void Add (const gp_Pnt2d& thePnt) { Update (thePnt.X(), thePnt.Y()); }
//! Extends <me> from the Pnt <P> in the direction <D>.
void Add (const gp_Pnt2d& P, const gp_Dir2d& D);
//! Extends bounding box from thePnt in the direction theDir.
void Add (const gp_Pnt2d& thePnt, const gp_Dir2d& theDir)
{
Add (thePnt);
Add (theDir);
}
//! Extends the Box in the given Direction, i.e. adds
//! a half-line. The box may become infinite in 1 or 2
@ -168,31 +187,45 @@ public:
Standard_EXPORT Standard_Boolean IsOut (const Bnd_Box2d& Other) const;
//! Returns True if transformed <Box2d> is out <me>.
Standard_Boolean IsOut (const Bnd_Box2d& Other, const gp_Trsf2d& T) const;
Standard_Boolean IsOut (const Bnd_Box2d& theOther, const gp_Trsf2d& theTrsf) const
{
return IsOut (theOther.Transformed (theTrsf));
}
//! Compares a transformed bounding with a transformed
//! bounding. The default implementation is to make a copy
//! of <me> and <Other>, to transform them and to test.
Standard_Boolean IsOut (const gp_Trsf2d& T1, const Bnd_Box2d& Other, const gp_Trsf2d& T2) const;
Standard_Boolean IsOut (const gp_Trsf2d& T1, const Bnd_Box2d& Other, const gp_Trsf2d& T2) const
{
return Transformed(T1).IsOut (Other.Transformed(T2));
}
Standard_EXPORT void Dump() const;
//! Computes the squared diagonal of me.
Standard_Real SquareExtent() const;
Standard_Real SquareExtent() const
{
if (IsVoid()) return 0.0;
const Standard_Real aDx = Xmax - Xmin + Gap + Gap;
const Standard_Real aDy = Ymax - Ymin + Gap + Gap;
return aDx*aDx + aDy*aDy;
}
protected:
//! Bit flags.
enum MaskFlags
{
VoidMask = 0x01,
XminMask = 0x02,
XmaxMask = 0x04,
YminMask = 0x08,
YmaxMask = 0x10,
WholeMask = 0x1e
};
private:
Standard_Real Xmin;
Standard_Real Xmax;
Standard_Real Ymin;
@ -200,14 +233,6 @@ private:
Standard_Real Gap;
Standard_Integer Flags;
};
#include <Bnd_Box2d.lxx>
#endif // _Bnd_Box2d_HeaderFile

@ -1,245 +0,0 @@
// Created on: 1997-11-27
// Created by: Christophe MARION
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2012 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.
#define VoidMask 0x01
#define XminMask 0x02
#define XmaxMask 0x04
#define YminMask 0x08
#define YmaxMask 0x10
#define WholeMask 0x1e
#include <gp_Pnt2d.hxx>
//=======================================================================
//function : Bnd_Box2d
//purpose :
//=======================================================================
inline Bnd_Box2d::Bnd_Box2d()
: Xmin(0.), Xmax(0.), Ymin(0.), Ymax(0.), Gap(0.), Flags (VoidMask)
{
}
//=======================================================================
//function : SetWhole
//purpose :
//=======================================================================
inline void Bnd_Box2d::SetWhole ()
{ Flags = WholeMask; }
//=======================================================================
//function : SetVoid
//purpose :
//=======================================================================
inline void Bnd_Box2d::SetVoid ()
{
Flags = VoidMask;
Gap=0.;
}
//=======================================================================
//function : Set
//purpose :
//=======================================================================
inline void Bnd_Box2d::Set(const gp_Pnt2d& P)
{
Flags = VoidMask;
Gap=0.;
Add(P);
}
//=======================================================================
//function : Set
//purpose :
//=======================================================================
inline void Bnd_Box2d::Set(const gp_Pnt2d& P, const gp_Dir2d& D)
{
Flags = VoidMask;
Gap=0.;
Add(P,D);
}
//=======================================================================
//function : GetGap
//purpose :
//=======================================================================
inline Standard_Real Bnd_Box2d::GetGap () const
{
return Gap;
}
//=======================================================================
//function : SetGap
//purpose :
//=======================================================================
inline void Bnd_Box2d::SetGap (const Standard_Real Tol)
{
Gap = Tol;
}
//=======================================================================
//function : Enlarge
//purpose :
//=======================================================================
inline void Bnd_Box2d::Enlarge (const Standard_Real Tol)
{
Standard_Real t = Tol;
if (t < 0) t = - t;
if (Gap < t) Gap = t;
}
//=======================================================================
//function : OpenXmin
//purpose :
//=======================================================================
inline void Bnd_Box2d::OpenXmin ()
{ Flags |= XminMask; }
//=======================================================================
//function : OpenXmax
//purpose :
//=======================================================================
inline void Bnd_Box2d::OpenXmax ()
{ Flags |= XmaxMask; }
//=======================================================================
//function : OpenYmin
//purpose :
//=======================================================================
inline void Bnd_Box2d::OpenYmin ()
{ Flags |= YminMask; }
//=======================================================================
//function : OpenYmax
//purpose :
//=======================================================================
inline void Bnd_Box2d::OpenYmax ()
{ Flags |= YmaxMask; }
//=======================================================================
//function : IsOpenXmin
//purpose :
//=======================================================================
inline Standard_Boolean Bnd_Box2d::IsOpenXmin () const
{ return Flags & XminMask; }
//=======================================================================
//function : IsOpenXmax
//purpose :
//=======================================================================
inline Standard_Boolean Bnd_Box2d::IsOpenXmax () const
{ return Flags & XmaxMask; }
//=======================================================================
//function : IsOpenYmin
//purpose :
//=======================================================================
inline Standard_Boolean Bnd_Box2d::IsOpenYmin () const
{ return Flags & YminMask; }
//=======================================================================
//function : IsOpenYmax
//purpose :
//=======================================================================
inline Standard_Boolean Bnd_Box2d::IsOpenYmax () const
{ return Flags & YmaxMask; }
//=======================================================================
//function : IsWhole
//purpose :
//=======================================================================
inline Standard_Boolean Bnd_Box2d::IsWhole () const
{ return (Flags & WholeMask) == WholeMask; }
//=======================================================================
//function : IsVoid
//purpose :
//=======================================================================
inline Standard_Boolean Bnd_Box2d::IsVoid () const
{ return Flags & VoidMask; }
//=======================================================================
//function : Add
//purpose :
//=======================================================================
inline void Bnd_Box2d::Add (const gp_Pnt2d& P)
{
Update(P.X(),P.Y());
}
//=======================================================================
//function : Add
//purpose :
//=======================================================================
inline void Bnd_Box2d::Add (const gp_Pnt2d& P, const gp_Dir2d& D)
{
Add(P);
Add(D);
}
//=======================================================================
//function : IsOut
//purpose :
//=======================================================================
inline Standard_Boolean Bnd_Box2d::IsOut (const Bnd_Box2d& Other,
const gp_Trsf2d& T) const
{
return IsOut(Other.Transformed(T));
}
//=======================================================================
//function : IsOut
//purpose :
//=======================================================================
inline Standard_Boolean Bnd_Box2d::IsOut (const gp_Trsf2d& T1,
const Bnd_Box2d& Other,
const gp_Trsf2d& T2) const
{
return Transformed(T1).IsOut (Other.Transformed(T2));
}
//=======================================================================
//function : SquareExtent
//purpose : Computes the squared diagonal
//=======================================================================
inline Standard_Real Bnd_Box2d::SquareExtent() const
{
if ( IsVoid() ) return 0.;
const Standard_Real aDx = Xmax - Xmin + Gap + Gap;
const Standard_Real aDy = Ymax - Ymin + Gap + Gap;
return aDx*aDx + aDy*aDy;
}

@ -19,10 +19,8 @@ Bnd_BoundSortBox2d.cxx
Bnd_BoundSortBox2d.hxx
Bnd_Box.cxx
Bnd_Box.hxx
Bnd_Box.lxx
Bnd_Box2d.cxx
Bnd_Box2d.hxx
Bnd_Box2d.lxx
Bnd_HArray1OfBox.hxx
Bnd_HArray1OfBox2d.hxx
Bnd_HArray1OfSphere.hxx

@ -654,12 +654,12 @@ void FilletPoint::appendValue(Standard_Real theValue, Standard_Boolean theValid)
if (theValue < myV.Value(a))
{
myV.InsertBefore(a, theValue);
myValid.InsertBefore(a, (int)theValid);
myValid.InsertBefore(a, theValid);
return;
}
}
myV.Append(theValue);
myValid.Append((int)theValid);
myValid.Append(theValid);
}
Standard_Boolean FilletPoint::calculateDiff(FilletPoint* thePoint)

@ -23,6 +23,7 @@
#include <Geom_Plane.hxx>
#include <TColStd_ListOfReal.hxx>
#include <TColStd_SequenceOfReal.hxx>
#include <TColStd_SequenceOfBoolean.hxx>
#include <TColStd_SequenceOfInteger.hxx>
class FilletPoint;
@ -163,7 +164,7 @@ public:
Standard_Real getDiff(int theIndex) {return myD.Value(theIndex);}
//! Returns true if function is valid (rediuses vectors of fillet do not intersect any curve).
Standard_Boolean isValid(int theIndex) {return (Standard_Boolean)myValid.Value(theIndex);}
Standard_Boolean isValid(int theIndex) {return myValid.Value(theIndex);}
//! Returns the index of the nearest value
int getNear(int theIndex) {return myNear.Value(theIndex);}
@ -225,7 +226,8 @@ private:
gp_Pnt2d myCenter;
//! Flags for storage the validity of solutions. Indexes corresponds to indexes
//! in sequences myV, myD.
TColStd_SequenceOfInteger myValid, myNear;
TColStd_SequenceOfBoolean myValid;
TColStd_SequenceOfInteger myNear;
};
#endif // _FILLETALGO_H_

@ -191,7 +191,7 @@ public:
//! chamfer).
Standard_EXPORT Standard_Boolean SplitKPart (const Handle(ChFiDS_SurfData)& Data, ChFiDS_SequenceOfSurfData& SetData, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Iedge, const Handle(Adaptor3d_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(Adaptor3d_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, Standard_Boolean& Intf, Standard_Boolean& Intl);
Standard_EXPORT Standard_Integer PerformTwoCornerbyInter (const Standard_Integer Index);
Standard_EXPORT Standard_Boolean PerformTwoCornerbyInter (const Standard_Integer Index);
@ -203,7 +203,7 @@ protected:
Standard_EXPORT virtual void SimulKPart (const Handle(ChFiDS_SurfData)& SD) const = 0;
Standard_EXPORT virtual Standard_Boolean SimulSurf (Handle(ChFiDS_SurfData)& Data, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, const math_Vector& Soldep, Standard_Boolean& Intf, Standard_Boolean& Intl) = 0;
Standard_EXPORT virtual Standard_Boolean SimulSurf (Handle(ChFiDS_SurfData)& Data, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, const math_Vector& Soldep, Standard_Integer& Intf, Standard_Integer& Intl) = 0;
Standard_EXPORT virtual void SimulSurf (Handle(ChFiDS_SurfData)& Data, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HCurve2d)& PC1, const Handle(BRepAdaptor_HSurface)& Sref1, const Handle(BRepAdaptor_HCurve2d)& PCref1, Standard_Boolean& Decroch1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const TopAbs_Orientation Or2, const Standard_Real Fleche, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecP, const Standard_Boolean RecS, const Standard_Boolean RecRst, const math_Vector& Soldep);
@ -231,12 +231,12 @@ protected:
Standard_EXPORT void Trunc (const Handle(ChFiDS_SurfData)& SD, const Handle(ChFiDS_Spine)& Spine, const Handle(Adaptor3d_HSurface)& S1, const Handle(Adaptor3d_HSurface)& S2, const Standard_Integer iedge, const Standard_Boolean isfirst, const Standard_Integer cntlFiOnS);
Standard_EXPORT void CallPerformSurf (Handle(ChFiDS_Stripe)& Stripe, const Standard_Boolean Simul, ChFiDS_SequenceOfSurfData& SeqSD, Handle(ChFiDS_SurfData)& SD, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Handle(BRepAdaptor_HSurface)& HS1, const Handle(BRepAdaptor_HSurface)& HS3, const gp_Pnt2d& P1, const gp_Pnt2d& P3, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HSurface)& HS2, const Handle(BRepAdaptor_HSurface)& HS4, const gp_Pnt2d& P2, const gp_Pnt2d& P4, const Handle(Adaptor3d_TopolTool)& I2, const Standard_Real MaxStep, const Standard_Real Fleche, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, math_Vector& Soldep, Standard_Boolean& Intf, Standard_Boolean& Intl, Handle(BRepAdaptor_HSurface)& Surf1, Handle(BRepAdaptor_HSurface)& Surf2);
Standard_EXPORT void CallPerformSurf (Handle(ChFiDS_Stripe)& Stripe, const Standard_Boolean Simul, ChFiDS_SequenceOfSurfData& SeqSD, Handle(ChFiDS_SurfData)& SD, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Handle(BRepAdaptor_HSurface)& HS1, const Handle(BRepAdaptor_HSurface)& HS3, const gp_Pnt2d& P1, const gp_Pnt2d& P3, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HSurface)& HS2, const Handle(BRepAdaptor_HSurface)& HS4, const gp_Pnt2d& P2, const gp_Pnt2d& P4, const Handle(Adaptor3d_TopolTool)& I2, const Standard_Real MaxStep, const Standard_Real Fleche, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, math_Vector& Soldep, Standard_Integer& Intf, Standard_Integer& Intl, Handle(BRepAdaptor_HSurface)& Surf1, Handle(BRepAdaptor_HSurface)& Surf2);
//! Method, implemented in the inheritants, calculating
//! elements of construction of the surface (fillet or
//! chamfer).
Standard_EXPORT virtual Standard_Boolean PerformSurf (ChFiDS_SequenceOfSurfData& Data, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const Standard_Real MaxStep, const Standard_Real Fleche, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, const math_Vector& Soldep, Standard_Boolean& Intf, Standard_Boolean& Intl) = 0;
Standard_EXPORT virtual Standard_Boolean PerformSurf (ChFiDS_SequenceOfSurfData& Data, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const Standard_Real MaxStep, const Standard_Real Fleche, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, const math_Vector& Soldep, Standard_Integer& Intf, Standard_Integer& Intl) = 0;
//! Method, implemented in inheritants, calculates
//! the elements of construction of the surface (fillet
@ -272,7 +272,7 @@ protected:
Standard_EXPORT Standard_Boolean StripeOrientations (const Handle(ChFiDS_Spine)& Sp, TopAbs_Orientation& Or1, TopAbs_Orientation& Or2, Standard_Integer& ChoixConge) const;
//! Calculates a Line of contact face/face.
Standard_EXPORT Standard_Boolean ComputeData (Handle(ChFiDS_SurfData)& Data, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, Handle(BRepBlend_Line)& Lin, const Handle(Adaptor3d_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(Adaptor3d_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, Blend_Function& Func, Blend_FuncInv& FInv, const Standard_Real PFirst, const Standard_Real MaxStep, const Standard_Real Fleche, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const math_Vector& Soldep, Standard_Boolean& Intf, Standard_Boolean& Intl, Standard_Boolean& Gd1, Standard_Boolean& Gd2, Standard_Boolean& Gf1, Standard_Boolean& Gf2, const Standard_Boolean RecOnS1 = Standard_False, const Standard_Boolean RecOnS2 = Standard_False);
Standard_EXPORT Standard_Boolean ComputeData (Handle(ChFiDS_SurfData)& Data, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, Handle(BRepBlend_Line)& Lin, const Handle(Adaptor3d_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(Adaptor3d_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, Blend_Function& Func, Blend_FuncInv& FInv, const Standard_Real PFirst, const Standard_Real MaxStep, const Standard_Real Fleche, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const math_Vector& Soldep, Standard_Integer& Intf, Standard_Integer& Intl, Standard_Boolean& Gd1, Standard_Boolean& Gd2, Standard_Boolean& Gf1, Standard_Boolean& Gf2, const Standard_Boolean RecOnS1 = Standard_False, const Standard_Boolean RecOnS2 = Standard_False);
//! Calculates a Line of contact edge/face.
Standard_EXPORT Standard_Boolean ComputeData (Handle(ChFiDS_SurfData)& Data, const Handle(ChFiDS_HElSpine)& HGuide, Handle(BRepBlend_Line)& Lin, const Handle(Adaptor3d_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(Adaptor3d_HSurface)& S2, const Handle(Adaptor2d_HCurve2d)& PC2, const Handle(Adaptor3d_TopolTool)& I2, Standard_Boolean& Decroch, Blend_SurfRstFunction& Func, Blend_FuncInv& FInv, Blend_SurfPointFuncInv& FInvP, Blend_SurfCurvFuncInv& FInvC, const Standard_Real PFirst, const Standard_Real MaxStep, const Standard_Real Fleche, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const math_Vector& Soldep, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecP, const Standard_Boolean RecS, const Standard_Boolean RecRst);

@ -609,8 +609,8 @@ CallPerformSurf(Handle(ChFiDS_Stripe)& Stripe,
const Standard_Boolean RecOnS1,
const Standard_Boolean RecOnS2,
math_Vector& Soldep,
Standard_Boolean& intf,
Standard_Boolean& intl,
Standard_Integer& intf,
Standard_Integer& intl,
Handle(BRepAdaptor_HSurface)& Surf1,
Handle(BRepAdaptor_HSurface)& Surf2)
{
@ -1747,8 +1747,8 @@ static void ChFi3d_Purge (Handle(ChFiDS_Stripe)& Stripe,
const ChFiDS_CommonPoint& VRef,
const Standard_Boolean isfirst,
const Standard_Integer ons,
Standard_Boolean& intf,
Standard_Boolean& intl)
Standard_Integer& intf,
Standard_Integer& intl)
{
if (isfirst) intf = 1; else intl = 1; // End.
Standard_Integer opp = 3-ons;
@ -2000,7 +2000,7 @@ void ChFi3d_Builder::PerformSetOfSurfOnElSpine
}
Standard_Real MaxStep = (bidl-bidf)*0.05/nbed;
Standard_Real Firstsov = 0.;
Standard_Boolean intf = 0, intl = 0;
Standard_Integer intf = 0, intl = 0;
while(!fini){
// are these the ends (no extension on periodic).
Ok1 = 1,Ok2 = 1;
@ -2322,7 +2322,7 @@ void ChFi3d_Builder::PerformSetOfKPart(Handle(ChFiDS_Stripe)& Stripe,
Standard_Real WFirst,WLast = 0.;
gp_Vec TFirst,TLast,TEndPeriodic;
gp_Pnt PFirst,PLast,PEndPeriodic;
Standard_Boolean intf = 0, intl = 0;
Standard_Boolean intf = Standard_False, intl = Standard_False;
Handle(ChFiDS_HElSpine) CurrentHE = new ChFiDS_HElSpine();
Spine->D1(Spine->FirstParameter(),PFirst,TFirst);

@ -1479,8 +1479,8 @@ Standard_Boolean ChFi3d_Builder::ComputeData
const Standard_Boolean Appro,
const Standard_Boolean Forward,
const math_Vector& Soldep,
Standard_Boolean& intf,
Standard_Boolean& intl,
Standard_Integer& intf,
Standard_Integer& intl,
Standard_Boolean& Gd1,
Standard_Boolean& Gd2,
Standard_Boolean& Gf1,

@ -2648,7 +2648,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
Pl=C1->Value(C1->LastParameter());
//Standard_Boolean sens;
sens=Pl.Distance(pext)<tolpt;
GeomLib::ExtendCurveToPoint(C1,CV1.Point(),1,sens);
GeomLib::ExtendCurveToPoint (C1, CV1.Point(), 1, sens != 0);
csau=C1;
}
}
@ -2658,7 +2658,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index)
Pl=C1->Value(C1->LastParameter());
//Standard_Boolean sens;
sens=Pl.Distance(pext)<tolpt;
GeomLib::ExtendCurveToPoint(C1,CV2.Point(),1,sens);
GeomLib::ExtendCurveToPoint (C1, CV2.Point(), 1, sens != 0);
csau=C1;
}
}

@ -140,7 +140,7 @@ static void Reduce(const Standard_Real& p1,
// path is used; 3D curve and 2 pcurves are approximated.
//=======================================================================
Standard_Integer ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer Index)
Standard_Boolean ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer Index)
{
done = 0;

@ -800,8 +800,8 @@ ChFi3d_ChBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data,
const Standard_Boolean RecOnS1,
const Standard_Boolean RecOnS2,
const math_Vector& Soldep,
Standard_Boolean& intf,
Standard_Boolean& intl)
Standard_Integer& intf,
Standard_Integer& intl)
{
Handle(ChFiDS_ChamfSpine)
@ -887,12 +887,13 @@ ChFi3d_ChBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data,
Standard_Boolean reverse = (!Forward || Inside);
if(intf && reverse){
Standard_Boolean ok = 0;
Standard_Boolean ok = Standard_False;
const ChFiDS_CommonPoint& cp1 = Data->VertexFirstOnS1();
if(cp1.IsOnArc()){
TopoDS_Face F1 = S1->ChangeSurface().Face();
TopoDS_Face bid;
ok = intf = !SearchFace(Spine,cp1,F1,bid);
intf = !SearchFace(Spine,cp1,F1,bid);
ok = intf != 0;
}
const ChFiDS_CommonPoint& cp2 = Data->VertexFirstOnS2();
if(cp2.IsOnArc() && !ok){
@ -902,12 +903,13 @@ ChFi3d_ChBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data,
}
}
if(intl){
Standard_Boolean ok = 0;
Standard_Boolean ok = Standard_False;
const ChFiDS_CommonPoint& cp1 = Data->VertexLastOnS1();
if(cp1.IsOnArc()){
TopoDS_Face F1 = S1->ChangeSurface().Face();
TopoDS_Face bid;
ok = intl = !SearchFace(Spine,cp1,F1,bid);
intl = !SearchFace(Spine,cp1,F1,bid);
ok = intl != 0;
}
const ChFiDS_CommonPoint& cp2 = Data->VertexLastOnS2();
if(cp2.IsOnArc() && !ok){
@ -967,12 +969,13 @@ ChFi3d_ChBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data,
Standard_Boolean reverse = (!Forward || Inside);
if(intf && reverse){
Standard_Boolean ok = 0;
Standard_Boolean ok = Standard_False;
const ChFiDS_CommonPoint& cp1 = Data->VertexFirstOnS1();
if(cp1.IsOnArc()){
TopoDS_Face F1 = S1->ChangeSurface().Face();
TopoDS_Face bid;
ok = intf = !SearchFace(Spine,cp1,F1,bid);
intf = !SearchFace(Spine,cp1,F1,bid);
ok = intf != 0;
}
const ChFiDS_CommonPoint& cp2 = Data->VertexFirstOnS2();
if(cp2.IsOnArc() && !ok){
@ -982,12 +985,13 @@ ChFi3d_ChBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data,
}
}
if(intl){
Standard_Boolean ok = 0;
Standard_Boolean ok = Standard_False;
const ChFiDS_CommonPoint& cp1 = Data->VertexLastOnS1();
if(cp1.IsOnArc()){
TopoDS_Face F1 = S1->ChangeSurface().Face();
TopoDS_Face bid;
ok = intl = !SearchFace(Spine,cp1,F1,bid);
intl = !SearchFace(Spine,cp1,F1,bid);
ok = intl != 0;
}
const ChFiDS_CommonPoint& cp2 = Data->VertexLastOnS2();
if(cp2.IsOnArc() && !ok){
@ -1052,12 +1056,13 @@ ChFi3d_ChBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data,
Standard_Boolean reverse = (!Forward || Inside);
if(intf && reverse){
Standard_Boolean ok = 0;
Standard_Boolean ok = Standard_False;
const ChFiDS_CommonPoint& cp1 = Data->VertexFirstOnS1();
if(cp1.IsOnArc()){
TopoDS_Face F1 = S1->ChangeSurface().Face();
TopoDS_Face bid;
ok = intf = !SearchFace(Spine,cp1,F1,bid);
intf = !SearchFace(Spine,cp1,F1,bid);
ok = intf != 0;
}
const ChFiDS_CommonPoint& cp2 = Data->VertexFirstOnS2();
if(cp2.IsOnArc() && !ok){
@ -1068,12 +1073,13 @@ ChFi3d_ChBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data,
}
if(intl){
Standard_Boolean ok = 0;
Standard_Boolean ok = Standard_False;
const ChFiDS_CommonPoint& cp1 = Data->VertexLastOnS1();
if(cp1.IsOnArc()){
TopoDS_Face F1 = S1->ChangeSurface().Face();
TopoDS_Face bid;
ok = intl = !SearchFace(Spine,cp1,F1,bid);
intl = !SearchFace(Spine,cp1,F1,bid);
ok = intl != 0;
}
const ChFiDS_CommonPoint& cp2 = Data->VertexLastOnS2();
if(cp2.IsOnArc() && !ok){
@ -1136,12 +1142,13 @@ ChFi3d_ChBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data,
Standard_Boolean reverse = (!Forward || Inside);
if(intf && reverse){
Standard_Boolean ok = 0;
Standard_Boolean ok = Standard_False;
const ChFiDS_CommonPoint& cp1 = Data->VertexFirstOnS1();
if(cp1.IsOnArc()){
TopoDS_Face F1 = S1->ChangeSurface().Face();
TopoDS_Face bid;
ok = intf = !SearchFace(Spine,cp1,F1,bid);
intf = !SearchFace(Spine,cp1,F1,bid);
ok = intf != 0;
}
const ChFiDS_CommonPoint& cp2 = Data->VertexFirstOnS2();
if(cp2.IsOnArc() && !ok){
@ -1152,12 +1159,13 @@ ChFi3d_ChBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data,
}
if(intl){
Standard_Boolean ok = 0;
Standard_Boolean ok = Standard_False;
const ChFiDS_CommonPoint& cp1 = Data->VertexLastOnS1();
if(cp1.IsOnArc()){
TopoDS_Face F1 = S1->ChangeSurface().Face();
TopoDS_Face bid;
ok = intl = !SearchFace(Spine,cp1,F1,bid);
intl = !SearchFace(Spine,cp1,F1,bid);
ok = intl != 0;
}
const ChFiDS_CommonPoint& cp2 = Data->VertexLastOnS2();
if(cp2.IsOnArc() && !ok){
@ -1585,8 +1593,8 @@ ChFi3d_ChBuilder::PerformSurf(ChFiDS_SequenceOfSurfData& SeqData,
const Standard_Boolean RecOnS1,
const Standard_Boolean RecOnS2,
const math_Vector& Soldep,
Standard_Boolean& intf,
Standard_Boolean& intl)
Standard_Integer& intf,
Standard_Integer& intl)
{
Handle(ChFiDS_SurfData) Data = SeqData(1);

@ -135,7 +135,7 @@ public:
//! Methode, implemented in inheritants, calculates
//! the elements of construction of the surface (fillet
//! or chamfer).
Standard_EXPORT virtual Standard_Boolean PerformSurf (ChFiDS_SequenceOfSurfData& Data, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const Standard_Real MaxStep, const Standard_Real Fleche, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, const math_Vector& Soldep, Standard_Boolean& Intf, Standard_Boolean& Intl) Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean PerformSurf (ChFiDS_SequenceOfSurfData& Data, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const Standard_Real MaxStep, const Standard_Real Fleche, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, const math_Vector& Soldep, Standard_Integer& Intf, Standard_Integer& Intl) Standard_OVERRIDE;
//! Method, implemented in the inheritants, calculates
//! the elements of construction of the surface (fillet
@ -162,7 +162,7 @@ protected:
Standard_EXPORT void SimulKPart (const Handle(ChFiDS_SurfData)& SD) const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean SimulSurf (Handle(ChFiDS_SurfData)& Data, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, const math_Vector& Soldep, Standard_Boolean& Intf, Standard_Boolean& Intl) Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean SimulSurf (Handle(ChFiDS_SurfData)& Data, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, const math_Vector& Soldep, Standard_Integer& Intf, Standard_Integer& Intl) Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean PerformFirstSection (const Handle(ChFiDS_Spine)& S, const Handle(ChFiDS_HElSpine)& HGuide, const Standard_Integer Choix, Handle(BRepAdaptor_HSurface)& S1, Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I1, const Handle(Adaptor3d_TopolTool)& I2, const Standard_Real Par, math_Vector& SolDep, TopAbs_State& Pos1, TopAbs_State& Pos2) const Standard_OVERRIDE;

@ -82,13 +82,11 @@
// la distance de PntD par rapport au plan passant par les trois
// points PntA, PntB, PntC
//=======================================================================
static int CoPlanar(const gp_Pnt PntA,
static Standard_Boolean CoPlanar(const gp_Pnt PntA,
const gp_Pnt PntB,
const gp_Pnt PntC,
const gp_Pnt PntD)
{
Standard_Boolean IsCoplanar;
gp_Vec vecAB(PntA, PntB);
gp_Vec vecAC(PntA, PntC);
gp_Vec vecAD(PntA, PntD);
@ -101,20 +99,16 @@ static int CoPlanar(const gp_Pnt PntA,
Standard_Real Alpha = nor2AB * nor2AC - ProABAC * ProABAC;
if (Alpha < Precision::Confusion()) {
IsCoplanar = Standard_True;
}
else {
Standard_Real ProABAD = vecAB.Dot(vecAD);
Standard_Real ProACAD = vecAC.Dot(vecAD);
Standard_Real Alpha1 = ProABAD * nor2AC - ProABAC * ProACAD;
Standard_Real Alpha2 = ProACAD * nor2AB - ProABAC * ProABAD;
gp_Vec vecDABC = Alpha1 * vecAB + Alpha2 * vecAC - Alpha * vecAD;
IsCoplanar = (vecDABC.Magnitude() / Alpha < Precision::Confusion() );
return Standard_True;
}
return IsCoplanar;
Standard_Real ProABAD = vecAB.Dot(vecAD);
Standard_Real ProACAD = vecAC.Dot(vecAD);
Standard_Real Alpha1 = ProABAD * nor2AC - ProABAC * ProACAD;
Standard_Real Alpha2 = ProACAD * nor2AB - ProABAC * ProABAD;
gp_Vec vecDABC = Alpha1 * vecAB + Alpha2 * vecAC - Alpha * vecAD;
return (vecDABC.Magnitude() / Alpha) < Precision::Confusion();
}

@ -616,8 +616,8 @@ ChFi3d_FilBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data,
const Standard_Boolean RecOnS1,
const Standard_Boolean RecOnS2,
const math_Vector& Soldep,
Standard_Boolean& intf,
Standard_Boolean& intl)
Standard_Integer& intf,
Standard_Integer& intl)
{
Handle(ChFiDS_FilSpine) fsp = Handle(ChFiDS_FilSpine)::DownCast(Spine);
if(fsp.IsNull()) Standard_ConstructionError::Raise
@ -701,12 +701,13 @@ ChFi3d_FilBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data,
Standard_False, Data->ChangeVertexLastOnS2(),tolesp);
Standard_Boolean reverse = (!Forward || Inside);
if(intf && reverse){
Standard_Boolean ok = 0;
Standard_Boolean ok = Standard_False;
const ChFiDS_CommonPoint& cp1 = Data->VertexFirstOnS1();
if(cp1.IsOnArc()){
TopoDS_Face F1 = S1->ChangeSurface().Face();
TopoDS_Face bid;
ok = intf = !SearchFace(Spine,cp1,F1,bid);
intf = !SearchFace(Spine,cp1,F1,bid);
ok = intf != 0;
}
const ChFiDS_CommonPoint& cp2 = Data->VertexFirstOnS2();
if(cp2.IsOnArc() && !ok){
@ -721,7 +722,8 @@ ChFi3d_FilBuilder::SimulSurf(Handle(ChFiDS_SurfData)& Data,
if(cp1.IsOnArc()){
TopoDS_Face F1 = S1->ChangeSurface().Face();
TopoDS_Face bid;
ok = intl = !SearchFace(Spine,cp1,F1,bid);
intl = !SearchFace(Spine,cp1,F1,bid);
ok = intl != 0;
}
const ChFiDS_CommonPoint& cp2 = Data->VertexLastOnS2();
if(cp2.IsOnArc() && !ok){
@ -1237,8 +1239,8 @@ ChFi3d_FilBuilder::PerformSurf(ChFiDS_SequenceOfSurfData& SeqData,
const Standard_Boolean RecOnS1,
const Standard_Boolean RecOnS2,
const math_Vector& Soldep,
Standard_Boolean& intf,
Standard_Boolean& intl)
Standard_Integer& intf,
Standard_Integer& intl)
{
#ifdef OCCT_DEBUG
OSD_Chronometer ch;

@ -136,7 +136,7 @@ protected:
Standard_EXPORT void SimulKPart (const Handle(ChFiDS_SurfData)& SD) const Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean SimulSurf (Handle(ChFiDS_SurfData)& Data, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, const math_Vector& Soldep, Standard_Boolean& Intf, Standard_Boolean& Intl) Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean SimulSurf (Handle(ChFiDS_SurfData)& Data, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, const math_Vector& Soldep, Standard_Integer& Intf, Standard_Integer& Intl) Standard_OVERRIDE;
Standard_EXPORT virtual void SimulSurf (Handle(ChFiDS_SurfData)& Data, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HCurve2d)& PC1, const Handle(BRepAdaptor_HSurface)& Sref1, const Handle(BRepAdaptor_HCurve2d)& PCref1, Standard_Boolean& Decroch1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const TopAbs_Orientation Or2, const Standard_Real Fleche, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecP, const Standard_Boolean RecS, const Standard_Boolean RecRst, const math_Vector& Soldep) Standard_OVERRIDE;
@ -148,7 +148,7 @@ protected:
//! Method calculates the elements of construction of the
//! fillet (constant or evolutive).
Standard_EXPORT Standard_Boolean PerformSurf (ChFiDS_SequenceOfSurfData& SeqData, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const Standard_Real MaxStep, const Standard_Real Fleche, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, const math_Vector& Soldep, Standard_Boolean& Intf, Standard_Boolean& Intl) Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean PerformSurf (ChFiDS_SequenceOfSurfData& SeqData, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const Standard_Real MaxStep, const Standard_Real Fleche, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, const math_Vector& Soldep, Standard_Integer& Intf, Standard_Integer& Intl) Standard_OVERRIDE;
Standard_EXPORT virtual void PerformSurf (ChFiDS_SequenceOfSurfData& SeqData, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HCurve2d)& PC1, const Handle(BRepAdaptor_HSurface)& Sref1, const Handle(BRepAdaptor_HCurve2d)& PCref1, Standard_Boolean& Decroch1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const TopAbs_Orientation Or2, const Standard_Real MaxStep, const Standard_Real Fleche, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecP, const Standard_Boolean RecS, const Standard_Boolean RecRst, const math_Vector& Soldep) Standard_OVERRIDE;

@ -583,7 +583,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
finv.Set(Rdeb,choix);
Standard_Real TolGuide = cornerspine->Resolution(tolesp);
Standard_Boolean intf = 3, intl = 3;
Standard_Integer intf = 3, intl = 3;
done = ComputeData(coin,cornerspine,NullSpine,lin,Fac,IFac,Surf,ISurf,
func,finv,ffi,pasmax,locfleche,TolGuide,ffi,lla,
0,0,1,Soldep,intf,intl,Gd1,Gd2,Gf1,Gf2,0,1);
@ -605,7 +605,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex)
func.Set(myShape);
finv.Set(choix);
Standard_Real TolGuide = cornerspine->Resolution(tolesp);
Standard_Boolean intf = 3, intl = 3;
Standard_Integer intf = 3, intl = 3;
done = ComputeData(coin,cornerspine,NullSpine,lin,Fac,IFac,Surf,ISurf,
func,finv,ffi,pasmax,locfleche,TolGuide,ffi,lla,
0,0,1,Soldep,intf,intl,Gd1,Gd2,Gf1,Gf2,0,1);

@ -50,9 +50,10 @@ inline Standard_Integer ChFiDS_SurfData::IndexOfC1() const
//purpose :
//=======================================================================
inline void ChFiDS_SurfData::SetIndexOfC1(const Standard_Integer Index)
inline void ChFiDS_SurfData::SetIndexOfC1 (const Standard_Integer theIndex)
{
indexOfC1 = isoncurv1 = Index;
indexOfC1 = theIndex;
isoncurv1 = (theIndex != 0);
}
//=======================================================================
@ -91,9 +92,10 @@ inline Standard_Integer ChFiDS_SurfData::IndexOfC2() const
//purpose :
//=======================================================================
inline void ChFiDS_SurfData::SetIndexOfC2(const Standard_Integer Index)
inline void ChFiDS_SurfData::SetIndexOfC2 (const Standard_Integer theIndex)
{
indexOfC2 = isoncurv2 = Index;
indexOfC2 = theIndex;
isoncurv2 = (theIndex != 0);
}
//=======================================================================

@ -437,7 +437,7 @@ static Standard_Integer DDataStd_SetIntArray (Draw_Interpretor& di,
if (!DDF::GetDF(arg[1],DF)) return 1;
TDF_Label label;
DDF::AddLabel(DF, arg[2], label);
Standard_Integer isDelta = Draw::Atoi(arg[3]);
Standard_Boolean isDelta = Draw::Atoi(arg[3]) != 0;
Standard_Integer From = Draw::Atoi(arg[4]), To = Draw::Atoi( arg[5] ), j;
di << "Array of Standard_Integer with bounds from = " << From << " to = " << To << "\n";
Handle(TDataStd_IntegerArray) A = TDataStd_IntegerArray::Set(label, From, To, isDelta);
@ -623,7 +623,7 @@ static Standard_Integer DDataStd_SetIntArrayTest (Draw_Interpretor& di,
if (!DDF::GetDF(arg[1],DF)) return 1;
TDF_Label label;
DDF::AddLabel(DF, arg[2], label);
Standard_Integer isDelta = Draw::Atoi(arg[3]);
Standard_Boolean isDelta = Draw::Atoi(arg[3]) != 0;
Standard_Integer From = Draw::Atoi(arg[4]), To = Draw::Atoi( arg[5] ), j;
di << "Array of Standard_Integer with bounds from = " << From << " to = " << To << "\n";
Handle(TDataStd_IntegerArray) A = TDataStd_IntegerArray::Set(label, From, To, isDelta);
@ -651,7 +651,7 @@ static Standard_Integer DDataStd_SetRealArray (Draw_Interpretor& di,
if (!DDF::GetDF(arg[1],DF)) return 1;
TDF_Label label;
DDF::AddLabel(DF, arg[2], label);
Standard_Integer isDelta = Draw::Atoi(arg[3]);
Standard_Boolean isDelta = Draw::Atoi(arg[3]) != 0;
Standard_Integer From = Draw::Atoi(arg[4]), To = Draw::Atoi( arg[5] ), j;
di << " Array of Standard_Real with bounds from = " << From << " to = " << To << "\n";
@ -843,7 +843,7 @@ static Standard_Integer DDataStd_SetVariable (Draw_Interpretor& di,
const char* aUnits = arg[4];
aV->Unit(Standard_CString(aUnits));
aV->Constant(Standard_Boolean(Draw::Atoi(arg[3])));
aV->Constant (Draw::Atoi(arg[3]) != 0);
return 0;
}
@ -1043,7 +1043,7 @@ static Standard_Integer DDataStd_SetExtStringArray (Draw_Interpretor& di,
if (!DDF::GetDF(arg[1],DF)) return 1;
TDF_Label label;
DDF::AddLabel(DF, arg[2], label);
Standard_Integer isDelta = Draw::Atoi(arg[3]);
Standard_Boolean isDelta = Draw::Atoi(arg[3]) != 0;
Standard_Integer From = Draw::Atoi(arg[4]), To = Draw::Atoi( arg[5] ), j;
di << "Array of ExtString with bounds from = " << From << " to = " << To << "\n";
@ -1340,7 +1340,7 @@ static Standard_Integer DDataStd_SetByteArray (Draw_Interpretor& di,
if (!DDF::GetDF(arg[1],DF)) return 1;
TDF_Label label;
DDF::AddLabel(DF, arg[2], label);
Standard_Integer isDelta = Draw::Atoi(arg[3]);
Standard_Boolean isDelta = Draw::Atoi(arg[3]) != 0;
Standard_Integer From = Draw::Atoi(arg[4]), To = Draw::Atoi( arg[5] ), j;
di << "Array of Standard_Byte with bounds from = " << From << " to = " << To << "\n";
Handle(TDataStd_ByteArray) A = TDataStd_ByteArray::Set(label, From, To, isDelta);
@ -1430,7 +1430,7 @@ static Standard_Integer DDataStd_SetBooleanArray (Draw_Interpretor& di,
cout << "Bad value = " << ival<< ". 0 or 1 is expected." << endl;
return 1;
}
A->SetValue(i, (Standard_Boolean)ival);
A->SetValue(i, ival != 0);
j++;
}
}
@ -1471,7 +1471,7 @@ static Standard_Integer DDataStd_SetBooleanArrayValue (Draw_Interpretor& di,
Handle(TDataStd_BooleanArray) arr;
if (label.FindAttribute(TDataStd_BooleanArray::GetID(), arr))
{
arr->SetValue(index, (Standard_Boolean) value);
arr->SetValue(index, value != 0);
return 0;
}
@ -1561,7 +1561,7 @@ static Standard_Integer DDataStd_SetBooleanList (Draw_Interpretor& di,
cout << "Bad value = " << ival<< ". 0 or 1 is expected." << endl;
return 1;
}
A->Append((Standard_Boolean)ival);
A->Append (ival != 0);
}
return 0;
}
@ -1739,7 +1739,7 @@ static Standard_Integer DDataStd_InsertBeforeBooleanList (Draw_Interpretor& di,
return 1;
Standard_Integer index = Draw::Atoi(arg[3]);
Standard_Boolean value = (Standard_Boolean) Draw::Atoi(arg[4]);
Standard_Boolean value = Draw::Atoi(arg[4]) != 0;
if (A->InsertBefore(index, value))
return 0;
@ -1771,7 +1771,7 @@ static Standard_Integer DDataStd_InsertAfterBooleanList (Draw_Interpretor& di,
return 1;
Standard_Integer index = Draw::Atoi(arg[3]);
Standard_Boolean value = (Standard_Boolean) Draw::Atoi(arg[4]);
Standard_Boolean value = Draw::Atoi(arg[4]) != 0;
if (A->InsertAfter(index, value))
return 0;
@ -2541,7 +2541,7 @@ static Standard_Integer DDataStd_SetIntPackedMap (Draw_Interpretor& di,
if (!DDF::GetDF(arg[1],DF)) return 1;
TDF_Label aLabel;
DDF::AddLabel(DF, arg[2], aLabel);
Standard_Integer isDelta = Draw::Atoi(arg[3]);
Standard_Boolean isDelta = Draw::Atoi(arg[3]) != 0;
Standard_Integer aNum = nb - 4;
Handle(TDataStd_IntPackedMap) anAtt;
if(!aLabel.FindAttribute(TDataStd_IntPackedMap::GetID(), anAtt))
@ -2741,7 +2741,7 @@ static Standard_Integer DDataStd_SetIntPHugeMap (Draw_Interpretor& di,
if (!DDF::GetDF(arg[1],DF)) return 1;
TDF_Label aLabel;
DDF::AddLabel(DF, arg[2], aLabel);
Standard_Integer isDelta = Draw::Atoi(arg[3]);
Standard_Boolean isDelta = Draw::Atoi(arg[3]) != 0;
Standard_Integer aNum = Draw::Atoi(arg[4]);
Handle(TDataStd_IntPackedMap) anAtt;
if(!aLabel.FindAttribute(TDataStd_IntPackedMap::GetID(), anAtt))

@ -376,7 +376,7 @@ static Standard_Integer DDataStd_ChildNodeIterate (Draw_Interpretor& di,
if (n >= 4) {
Handle(TDF_Data) DF;
if (!DDF::GetDF(a[1],DF)) return 1;
const Standard_Boolean AllLevels(Draw::Atoi(a[3]));
const Standard_Boolean AllLevels = (Draw::Atoi(a[3]) != 0);
Handle(TDataStd_TreeNode) TN, Value;
Standard_GUID ID;
@ -439,7 +439,7 @@ static Standard_Integer DDataStd_InitChildNodeIterator (Draw_Interpretor& di,
}
if (!DDF::Find(DF, a[2], ID, TN)) return 1;
const Standard_Boolean AllLevels(Draw::Atoi(a[3]));
const Standard_Boolean AllLevels = (Draw::Atoi(a[3]) != 0);
cni.Initialize(TN, AllLevels);
return 0;
}

@ -336,7 +336,7 @@ static Standard_Boolean GetDangleShapes(const TopoDS_Shape& ShapeIn,
const TopTools_ListOfShape& ancestors = subShapeAndAncestors.FindFromIndex(i);
if (ancestors.Extent() == 1) Dangles.Bind(ancestors.First(), mayBeDangle);
}
return Dangles.Extent();
return !Dangles.IsEmpty();
}
//=======================================================================

@ -383,7 +383,7 @@ static Standard_Integer Collect (Draw_Interpretor& di,
if (!DDF::GetDF(arg[1],DF)) return 1;
if (!DDF::Find(DF,arg[2],TNaming_NamedShape::GetID(),A)) return 1;
if (nb >= 4) {
OnlyModif = Draw::Atoi(arg[3]);
OnlyModif = (Draw::Atoi(arg[3]) != 0);
}
TNaming_Tool::Collect(A,MNS,OnlyModif);
for (TNaming_MapIteratorOfMapOfNamedShape it(MNS); it.More(); it.Next()) {
@ -484,7 +484,7 @@ static Standard_Integer CheckIter (Draw_Interpretor& di,
const TopoDS_Shape& aShape = DBRep::Get(arg[3]);
aNB.Generated(aShape);
TNaming_Iterator aNameIter(aLabel);
if(nb == 5) aNew = (Standard_Boolean) atoi(arg[4]);
if(nb == 5) aNew = (Draw::Atoi (arg[4]) != 0);
if(aNew) {
TNaming_NewShapeIterator aNewShapeIter(aNameIter);
di << "DNaming_CheckIterator : New It is OK\n";

@ -97,7 +97,7 @@ Standard_Integer DNaming_Line3DDriver::Execute(Handle(TFunction_Logbook)& theLog
}
const Standard_Integer aType = DNaming::GetInteger(aFunction, LINE3D_TYPE)->Get();
Standard_Boolean isClosed(aType);
Standard_Boolean isClosed = (aType != 0);
Standard_Integer aCounter(0), aLength = DNaming::GetInteger(aFunction, LINE3D_PNTNB)->Get();
if(aLength < 2) {
aFunction->SetFailure(WRONG_ARGUMENT);

@ -682,10 +682,10 @@ static Standard_Integer DNaming_AttachShape (Draw_Interpretor& di,
aResultLabel.ForgetAllAttributes(Standard_True);
Standard_Boolean aKeepOrientation(Standard_False);
if (nb >= 6)
aKeepOrientation = (Standard_Boolean) Draw::Atoi(a[5]);
aKeepOrientation = Draw::Atoi(a[5]) != 0;
Standard_Boolean aGeometry(Standard_False);
if (nb == 7)
aGeometry = (Standard_Boolean) Draw::Atoi(a[6]);
aGeometry = Draw::Atoi(a[6]) != 0;
Handle(TNaming_NamedShape) aCont = DNaming::GetObjectValue(aContext);
#ifdef OCCT_DEBUG
if(aCont.IsNull() || aCont->IsEmpty())
@ -759,10 +759,10 @@ static Standard_Integer DNaming_XAttachShape (Draw_Interpretor& di,
aResultLabel.ForgetAllAttributes(Standard_True);
Standard_Boolean aKeepOrientation(Standard_False);
if (nb >= 5)
aKeepOrientation = (Standard_Boolean) Draw::Atoi(a[4]);
aKeepOrientation = Draw::Atoi(a[4]) != 0;
Standard_Boolean aGeometry(Standard_False);
if (nb == 6)
aGeometry = (Standard_Boolean) Draw::Atoi(a[5]);
aGeometry = Draw::Atoi(a[5]) != 0;
Handle(TNaming_NamedShape) aCont = DNaming::GetObjectValue(aContext);
if(aCont.IsNull() || aCont->IsEmpty())
@ -1536,17 +1536,17 @@ static Standard_Integer DNaming_PntOffset (Draw_Interpretor& theDI,
Handle(TFunction_Function) aFun = GetFunction(objLabel,funGUID);
if(!aFun.IsNull()) {
Standard_Real value(0.0);
Standard_Boolean isDX = (strcmp(theArg[3],"skip"));
Standard_Boolean isDX = strcmp(theArg[3],"skip") != 0;
if(isDX) {
value = Draw::Atof(theArg[3]);
DNaming::GetReal(aFun,PNT_DX)->Set(value);
}
Standard_Boolean isDY = (strcmp(theArg[4],"skip"));
Standard_Boolean isDY = strcmp(theArg[4],"skip") != 0;
if(isDY) {
value = Draw::Atof(theArg[4]);
DNaming::GetReal(aFun,PNT_DY)->Set(value);
}
Standard_Boolean isDZ = (strcmp(theArg[5],"skip"));
Standard_Boolean isDZ = strcmp(theArg[5],"skip") != 0;
if(isDZ) {
value = Draw::Atof(theArg[5]);
DNaming::GetReal(aFun,PNT_DZ)->Set(value);
@ -1903,11 +1903,11 @@ static Standard_Integer DNaming_TestSingle (Draw_Interpretor& theDI,
Standard_Boolean XSelection(Standard_False);
Standard_Boolean Geometry(Standard_False);
if(theNb == 4)
Orientation = (Standard_Boolean)Draw::Atoi(theArg[3]);
Orientation = Draw::Atoi(theArg[3]) != 0;
if(theNb == 5)
XSelection = (Standard_Boolean)Draw::Atoi(theArg[4]);
XSelection = Draw::Atoi(theArg[4]) != 0;
if (theNb == 6)
Geometry = (Standard_Boolean) Draw::Atoi(theArg[5]);
Geometry = Draw::Atoi(theArg[5]) != 0;
Handle(TNaming_NamedShape) aNS = DNaming::GetObjectValue( aCntObj);
if(!aNS.IsNull() && !aNS->IsEmpty()) {
@ -2042,11 +2042,11 @@ static Standard_Integer DNaming_Multiple (Draw_Interpretor& theDI,
Standard_Boolean XSelection(Standard_False);
Standard_Boolean Geometry(Standard_False);
if(theNb == 4)
Orientation = (Standard_Boolean)Draw::Atoi(theArg[3]);
Orientation = Draw::Atoi(theArg[3]) != 0;
if(theNb == 5)
XSelection = (Standard_Boolean)Draw::Atoi(theArg[4]);
XSelection = Draw::Atoi(theArg[4]) != 0;
if (theNb == 6)
Geometry = (Standard_Boolean) Draw::Atoi(theArg[5]);
Geometry = Draw::Atoi(theArg[5]) != 0;
Handle(TNaming_NamedShape) aNS = DNaming::GetObjectValue( aCntObj);
if(!aNS.IsNull() && !aNS->IsEmpty()) {

@ -123,7 +123,7 @@ static Standard_Integer DNaming_Select (Draw_Interpretor& di, Standard_Integer n
}
if (n > 4) {
Standard_Boolean Orient(Standard_False);
if(n == 6) Orient = (Standard_Boolean)Draw::Atoi(a[5]);
if(n == 6) Orient = (Draw::Atoi(a[5]) != 0);
TopoDS_Shape S = DBRep::Get(a[3], TopAbs_SHAPE);
TopoDS_Shape C = DBRep::Get(a[4], TopAbs_SHAPE);
SL.Select (S, C, geometry, Orient);

@ -363,14 +363,16 @@ void Draw_Appli(Standard_Integer argc, char** argv,const FDraw_InitAppli Draw_In
else
{
char cmd[255];
do {
for (;;)
{
cout << "Viewer>";
i = -1;
do {
cin.get(cmd[++i]);
} while ((cmd[i] != '\n') && (!cin.fail()));
cmd[i] = '\0';
} while (Draw_Interprete(cmd) != (unsigned int ) -2);
Draw_Interprete(cmd);
}
}
#ifdef _WIN32
// Destruction de l'application

@ -530,7 +530,7 @@ Standard_Boolean Draw_Interpretor::Complete(const Standard_CString line)
Standard_PCharacter pLine;
//
pLine=(Standard_PCharacter)line;
return Tcl_CommandComplete(pLine);
return Tcl_CommandComplete (pLine) != 0;
}
//=======================================================================

@ -279,9 +279,9 @@ inline void Extrema_Curve2dTool::D2(const Adaptor2d_Curve2d& C,
//purpose :
//=======================================================================
inline Standard_Boolean Extrema_Curve2dTool::IsRational(const Adaptor2d_Curve2d& C)
inline Standard_Boolean Extrema_Curve2dTool::IsRational(const Adaptor2d_Curve2d& C)
{
return C.Degree();
return C.Degree() != 0;
}

@ -286,11 +286,10 @@ Storage_BaseDriver& FSD_BinaryFile::PutBoolean(const Standard_Boolean aValue)
{
#if OCCT_BINARY_FILE_DO_INVERSE
Standard_Integer t = InverseInt ((Standard_Integer) aValue);
if (!fwrite(&t,sizeof(Standard_Integer),1,myStream)) Storage_StreamWriteError::Raise();
#else
if (!fwrite(&aValue,sizeof(Standard_Boolean),1,myStream)) Storage_StreamWriteError::Raise();
Standard_Integer t = aValue ? 1 : 0;
#endif
if (!fwrite(&t,sizeof(Standard_Integer),1,myStream)) Storage_StreamWriteError::Raise();
return *this;
}
@ -429,11 +428,13 @@ void FSD_BinaryFile::GetInteger (Standard_IStream& theIStream, Standard_Integer&
Storage_BaseDriver& FSD_BinaryFile::GetBoolean(Standard_Boolean& aValue)
{
if (!fread(&aValue,sizeof(Standard_Boolean),1,myStream))
Standard_Integer anInt = 0;
if (!fread(&anInt,sizeof(Standard_Integer),1,myStream))
Storage_StreamTypeMismatchError::Raise();
#if OCCT_BINARY_FILE_DO_INVERSE
aValue = InverseInt ((Standard_Integer) aValue);
anInt = InverseInt (anInt);
#endif
aValue = (anInt != 0);
return *this;
}

@ -320,8 +320,8 @@ Standard_Boolean
const Standard_Boolean RecOnS1,
const Standard_Boolean RecOnS2,
const math_Vector& Soldep,
Standard_Boolean& Intf,
Standard_Boolean& Intl)
Standard_Integer& Intf,
Standard_Integer& Intl)
{
Handle(ChFiDS_SurfData) Data = SeqData(1);
Handle(ChFiDS_FilSpine) fsp = Handle(ChFiDS_FilSpine)::DownCast(Spine);
@ -372,14 +372,15 @@ Standard_Boolean
done = CompleteData(Data,Func,lin,S1,S2,Or,0,0,0,0);
if(!done) Standard_Failure::Raise("PerformSurf : Failed approximation!");
// maybesingular = (Func.GetMinimalDistance()<=100*tolapp3d);
Standard_Boolean ok = 0;
Standard_Boolean ok = Standard_False;
if(!Forward){
Intf = 0;
const ChFiDS_CommonPoint& cpf1 = Data->VertexFirstOnS1();
if(cpf1.IsOnArc()){
TopoDS_Face F1 = S1->ChangeSurface().Face();
TopoDS_Face bid;
ok = Intf = !SearchFace(Spine,cpf1,F1,bid);
Intf = !SearchFace(Spine,cpf1,F1,bid);
ok = Intf != 0;
}
const ChFiDS_CommonPoint& cpf2 = Data->VertexFirstOnS2();
if(cpf2.IsOnArc() && !ok){
@ -389,12 +390,13 @@ Standard_Boolean
}
}
Intl = 0;
ok = 0;
ok = Standard_False;
const ChFiDS_CommonPoint& cpl1 = Data->VertexLastOnS1();
if(cpl1.IsOnArc()){
TopoDS_Face F1 = S1->ChangeSurface().Face();
TopoDS_Face bid;
ok = Intl = !SearchFace(Spine,cpl1,F1,bid);
Intl = !SearchFace(Spine,cpl1,F1,bid);
ok = Intl != 0;
}
const ChFiDS_CommonPoint& cpl2 = Data->VertexLastOnS2();
if(cpl2.IsOnArc() && !ok){
@ -410,17 +412,17 @@ Standard_Boolean
return Standard_True;
}
void FilletSurf_InternalBuilder::PerformSurf(ChFiDS_SequenceOfSurfData&, const Handle(ChFiDS_HElSpine)&, const Handle(ChFiDS_Spine)&, const int, const Handle(BRepAdaptor_HSurface)&, const Handle(Adaptor3d_TopolTool)&, const Handle(BRepAdaptor_HCurve2d)&, const Handle(BRepAdaptor_HSurface)&, const Handle(BRepAdaptor_HCurve2d)&, unsigned int&, const Handle(BRepAdaptor_HSurface)&, const Handle(Adaptor3d_TopolTool)&, const TopAbs_Orientation, const double, const double, const double, double&, double&, const unsigned int, const unsigned int, const unsigned int, const unsigned int, const unsigned int, const unsigned int, const math_Vector&)
void FilletSurf_InternalBuilder::PerformSurf (ChFiDS_SequenceOfSurfData& , const Handle(ChFiDS_HElSpine)& , const Handle(ChFiDS_Spine)& , const Standard_Integer , const Handle(BRepAdaptor_HSurface)& , const Handle(Adaptor3d_TopolTool)& , const Handle(BRepAdaptor_HCurve2d)& , const Handle(BRepAdaptor_HSurface)& , const Handle(BRepAdaptor_HCurve2d)& , Standard_Boolean& , const Handle(BRepAdaptor_HSurface)& , const Handle(Adaptor3d_TopolTool)& , const TopAbs_Orientation , const Standard_Real , const Standard_Real , const Standard_Real , Standard_Real& , Standard_Real& , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const math_Vector& )
{
Standard_DomainError::Raise("BlendFunc_CSConstRad::Section : Not implemented");
}
void FilletSurf_InternalBuilder::PerformSurf(ChFiDS_SequenceOfSurfData&, const Handle(ChFiDS_HElSpine)&, const Handle(ChFiDS_Spine)&, const int, const Handle(BRepAdaptor_HSurface)&, const Handle(Adaptor3d_TopolTool)&, const Handle(BRepAdaptor_HCurve2d)&, const Handle(BRepAdaptor_HSurface)&, const Handle(BRepAdaptor_HCurve2d)&, unsigned int&, const TopAbs_Orientation, const Handle(BRepAdaptor_HSurface)&, const Handle(Adaptor3d_TopolTool)&, const Handle(BRepAdaptor_HCurve2d)&, const Handle(BRepAdaptor_HSurface)&, const Handle(BRepAdaptor_HCurve2d)&, unsigned int&, const TopAbs_Orientation, const double, const double, const double, double&, double&, const unsigned int, const unsigned int, const unsigned int, const unsigned int, const unsigned int, const unsigned int, const unsigned int, const math_Vector&)
void FilletSurf_InternalBuilder::PerformSurf (ChFiDS_SequenceOfSurfData& , const Handle(ChFiDS_HElSpine)& , const Handle(ChFiDS_Spine)& , const Standard_Integer , const Handle(BRepAdaptor_HSurface)& , const Handle(Adaptor3d_TopolTool)& , const TopAbs_Orientation , const Handle(BRepAdaptor_HSurface)& , const Handle(Adaptor3d_TopolTool)& , const Handle(BRepAdaptor_HCurve2d)& , const Handle(BRepAdaptor_HSurface)& , const Handle(BRepAdaptor_HCurve2d)& , Standard_Boolean& , const Standard_Real , const Standard_Real , const Standard_Real , Standard_Real& , Standard_Real& , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const math_Vector& )
{
Standard_DomainError::Raise("BlendFunc_CSConstRad::Section : Not implemented");
}
void FilletSurf_InternalBuilder::PerformSurf(ChFiDS_SequenceOfSurfData&, const Handle(ChFiDS_HElSpine)&, const Handle(ChFiDS_Spine)&, const int, const Handle(BRepAdaptor_HSurface)&, const Handle(Adaptor3d_TopolTool)&, const TopAbs_Orientation, const Handle(BRepAdaptor_HSurface)&, const Handle(Adaptor3d_TopolTool)&, const Handle(BRepAdaptor_HCurve2d)&, const Handle(BRepAdaptor_HSurface)&, const Handle(BRepAdaptor_HCurve2d)&, unsigned int&, const double, const double, const double, double&, double&, const unsigned int, const unsigned int, const unsigned int, const unsigned int, const unsigned int, const unsigned int, const math_Vector&)
void FilletSurf_InternalBuilder::PerformSurf (ChFiDS_SequenceOfSurfData& , const Handle(ChFiDS_HElSpine)& , const Handle(ChFiDS_Spine)& , const Standard_Integer , const Handle(BRepAdaptor_HSurface)& , const Handle(Adaptor3d_TopolTool)& , const Handle(BRepAdaptor_HCurve2d)& , const Handle(BRepAdaptor_HSurface)& , const Handle(BRepAdaptor_HCurve2d)& , Standard_Boolean& , const TopAbs_Orientation , const Handle(BRepAdaptor_HSurface)& , const Handle(Adaptor3d_TopolTool)& , const Handle(BRepAdaptor_HCurve2d)& , const Handle(BRepAdaptor_HSurface)& , const Handle(BRepAdaptor_HCurve2d)& , Standard_Boolean& , const TopAbs_Orientation , const Standard_Real , const Standard_Real , const Standard_Real , Standard_Real& , Standard_Real& , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const Standard_Boolean , const math_Vector& )
{
Standard_DomainError::Raise("BlendFunc_CSConstRad::Section : Not implemented");
}

@ -126,7 +126,7 @@ protected:
//! This method calculates the elements of construction of the
//! fillet (constant or evolutive).
Standard_EXPORT virtual Standard_Boolean PerformSurf (ChFiDS_SequenceOfSurfData& SeqData, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const Standard_Real MaxStep, const Standard_Real Fleche, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, const math_Vector& Soldep, Standard_Boolean& Intf, Standard_Boolean& Intl) Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean PerformSurf (ChFiDS_SequenceOfSurfData& SeqData, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const Standard_Real MaxStep, const Standard_Real Fleche, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecOnS1, const Standard_Boolean RecOnS2, const math_Vector& Soldep, Standard_Integer& Intf, Standard_Integer& Intl) Standard_OVERRIDE;
Standard_EXPORT virtual void PerformSurf (ChFiDS_SequenceOfSurfData& SeqData, const Handle(ChFiDS_HElSpine)& Guide, const Handle(ChFiDS_Spine)& Spine, const Standard_Integer Choix, const Handle(BRepAdaptor_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& I1, const Handle(BRepAdaptor_HCurve2d)& PC1, const Handle(BRepAdaptor_HSurface)& Sref1, const Handle(BRepAdaptor_HCurve2d)& PCref1, Standard_Boolean& Decroch1, const Handle(BRepAdaptor_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& I2, const TopAbs_Orientation Or2, const Standard_Real MaxStep, const Standard_Real Fleche, const Standard_Real TolGuide, Standard_Real& First, Standard_Real& Last, const Standard_Boolean Inside, const Standard_Boolean Appro, const Standard_Boolean Forward, const Standard_Boolean RecP, const Standard_Boolean RecS, const Standard_Boolean RecRst, const math_Vector& Soldep) Standard_OVERRIDE;

@ -296,7 +296,7 @@ static Standard_Integer gproject(Draw_Interpretor& di, Standard_Integer n, const
Standard_Integer k;
Standard_Real Udeb, Ufin, UIso, VIso;
Standard_Integer Only2d, Only3d;
Standard_Boolean Only2d, Only3d;
gp_Pnt2d P2d, Pdeb, Pfin;
gp_Pnt P;
Handle(Adaptor2d_HCurve2d) HPCur;

@ -148,7 +148,7 @@ const Handle(Image_PixMap)& Graphic3d_MarkerImage::GetImage()
Standard_Byte* anImageRow = myImage->ChangeRow (aRowIter + aRowOffset);
for (Standard_Integer aColumnIter = 0; aColumnIter < myWidth; aColumnIter++)
{
Standard_Boolean aBitOn = myBitMap->Value (aLowerIndex + aNumOfBytesInRow * aRowIter + aColumnIter / 8) & (0x80 >> (aColumnIter % 8));
Standard_Boolean aBitOn = (myBitMap->Value (aLowerIndex + aNumOfBytesInRow * aRowIter + aColumnIter / 8) & (0x80 >> (aColumnIter % 8))) != 0;
anImageRow[aColumnIter + aColumnOffset] = aBitOn ? 255 : 0;
}
}

@ -6,7 +6,6 @@ HLRAlgo_Array1OfPISeg.hxx
HLRAlgo_Array1OfTData.hxx
HLRAlgo_BiPoint.cxx
HLRAlgo_BiPoint.hxx
HLRAlgo_BiPoint.lxx
HLRAlgo_Coincidence.cxx
HLRAlgo_Coincidence.hxx
HLRAlgo_Coincidence.lxx
@ -15,10 +14,8 @@ HLRAlgo_EdgeIterator.hxx
HLRAlgo_EdgeIterator.lxx
HLRAlgo_EdgesBlock.cxx
HLRAlgo_EdgesBlock.hxx
HLRAlgo_EdgesBlock.lxx
HLRAlgo_EdgeStatus.cxx
HLRAlgo_EdgeStatus.hxx
HLRAlgo_EdgeStatus.lxx
HLRAlgo_HArray1OfPHDat.hxx
HLRAlgo_HArray1OfPINod.hxx
HLRAlgo_HArray1OfPISeg.hxx

@ -109,7 +109,7 @@ HLRAlgo_BiPoint::HLRAlgo_BiPoint (const Standard_Real X1,
const Standard_Real YT2,
const Standard_Real ZT2,
const Standard_Integer Index,
const Standard_Boolean flag)
const Standard_Integer flag)
{
PntX1 = X1;
PntY1 = Y1;
@ -202,7 +202,7 @@ HLRAlgo_BiPoint::HLRAlgo_BiPoint (const Standard_Real X1,
const Standard_Integer i1,
const Standard_Integer i1p1,
const Standard_Integer i1p2,
const Standard_Boolean flag)
const Standard_Integer flag)
{
PntX1 = X1;
PntY1 = Y1;
@ -305,7 +305,7 @@ HLRAlgo_BiPoint::HLRAlgo_BiPoint (const Standard_Real X1,
const Standard_Integer i2,
const Standard_Integer i2p1,
const Standard_Integer i2p2,
const Standard_Boolean flag)
const Standard_Integer flag)
{
PntX1 = X1;
PntY1 = Y1;

@ -34,69 +34,80 @@ public:
DEFINE_STANDARD_ALLOC
HLRAlgo_BiPoint();
HLRAlgo_BiPoint() {}
Standard_EXPORT HLRAlgo_BiPoint(const Standard_Real X1, const Standard_Real Y1, const Standard_Real Z1, const Standard_Real X2, const Standard_Real Y2, const Standard_Real Z2, const Standard_Real XT1, const Standard_Real YT1, const Standard_Real ZT1, const Standard_Real XT2, const Standard_Real YT2, const Standard_Real ZT2, const Standard_Integer Index, const Standard_Boolean reg1, const Standard_Boolean regn, const Standard_Boolean outl, const Standard_Boolean intl);
Standard_EXPORT HLRAlgo_BiPoint(const Standard_Real X1, const Standard_Real Y1, const Standard_Real Z1, const Standard_Real X2, const Standard_Real Y2, const Standard_Real Z2, const Standard_Real XT1, const Standard_Real YT1, const Standard_Real ZT1, const Standard_Real XT2, const Standard_Real YT2, const Standard_Real ZT2, const Standard_Integer Index, const Standard_Boolean flag);
Standard_EXPORT HLRAlgo_BiPoint(const Standard_Real X1, const Standard_Real Y1, const Standard_Real Z1, const Standard_Real X2, const Standard_Real Y2, const Standard_Real Z2, const Standard_Real XT1, const Standard_Real YT1, const Standard_Real ZT1, const Standard_Real XT2, const Standard_Real YT2, const Standard_Real ZT2, const Standard_Integer Index, const Standard_Integer flag);
Standard_EXPORT HLRAlgo_BiPoint(const Standard_Real X1, const Standard_Real Y1, const Standard_Real Z1, const Standard_Real X2, const Standard_Real Y2, const Standard_Real Z2, const Standard_Real XT1, const Standard_Real YT1, const Standard_Real ZT1, const Standard_Real XT2, const Standard_Real YT2, const Standard_Real ZT2, const Standard_Integer Index, const Standard_Integer i1, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Boolean reg1, const Standard_Boolean regn, const Standard_Boolean outl, const Standard_Boolean intl);
Standard_EXPORT HLRAlgo_BiPoint(const Standard_Real X1, const Standard_Real Y1, const Standard_Real Z1, const Standard_Real X2, const Standard_Real Y2, const Standard_Real Z2, const Standard_Real XT1, const Standard_Real YT1, const Standard_Real ZT1, const Standard_Real XT2, const Standard_Real YT2, const Standard_Real ZT2, const Standard_Integer Index, const Standard_Integer i1, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Boolean flag);
Standard_EXPORT HLRAlgo_BiPoint(const Standard_Real X1, const Standard_Real Y1, const Standard_Real Z1, const Standard_Real X2, const Standard_Real Y2, const Standard_Real Z2, const Standard_Real XT1, const Standard_Real YT1, const Standard_Real ZT1, const Standard_Real XT2, const Standard_Real YT2, const Standard_Real ZT2, const Standard_Integer Index, const Standard_Integer i1, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Integer flag);
Standard_EXPORT HLRAlgo_BiPoint(const Standard_Real X1, const Standard_Real Y1, const Standard_Real Z1, const Standard_Real X2, const Standard_Real Y2, const Standard_Real Z2, const Standard_Real XT1, const Standard_Real YT1, const Standard_Real ZT1, const Standard_Real XT2, const Standard_Real YT2, const Standard_Real ZT2, const Standard_Integer Index, const Standard_Integer i1, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Integer i2, const Standard_Integer i2p1, const Standard_Integer i2p2, const Standard_Boolean reg1, const Standard_Boolean regn, const Standard_Boolean outl, const Standard_Boolean intl);
Standard_EXPORT HLRAlgo_BiPoint(const Standard_Real X1, const Standard_Real Y1, const Standard_Real Z1, const Standard_Real X2, const Standard_Real Y2, const Standard_Real Z2, const Standard_Real XT1, const Standard_Real YT1, const Standard_Real ZT1, const Standard_Real XT2, const Standard_Real YT2, const Standard_Real ZT2, const Standard_Integer Index, const Standard_Integer i1, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Integer i2, const Standard_Integer i2p1, const Standard_Integer i2p2, const Standard_Boolean flag);
Standard_EXPORT HLRAlgo_BiPoint(const Standard_Real X1, const Standard_Real Y1, const Standard_Real Z1, const Standard_Real X2, const Standard_Real Y2, const Standard_Real Z2, const Standard_Real XT1, const Standard_Real YT1, const Standard_Real ZT1, const Standard_Real XT2, const Standard_Real YT2, const Standard_Real ZT2, const Standard_Integer Index, const Standard_Integer i1, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Integer i2, const Standard_Integer i2p1, const Standard_Integer i2p2, const Standard_Integer flag);
Standard_Boolean Rg1Line() const;
Standard_Boolean Rg1Line() const { return (myIndices[9] & EMskRg1Line) != 0; }
void Rg1Line (const Standard_Boolean B);
void Rg1Line (const Standard_Boolean B)
{
if (B) myIndices[9] |= EMskRg1Line;
else myIndices[9] &= ~EMskRg1Line;
}
Standard_Boolean RgNLine() const;
Standard_Boolean RgNLine() const { return (myIndices[9] & EMskRgNLine) != 0; }
void RgNLine (const Standard_Boolean B);
void RgNLine (const Standard_Boolean B)
{
if (B) myIndices[9] |= EMskRgNLine;
else myIndices[9] &= ~EMskRgNLine;
}
Standard_Boolean OutLine() const;
Standard_Boolean OutLine() const { return (myIndices[9] & EMskOutLine) != 0; }
void OutLine (const Standard_Boolean B);
void OutLine (const Standard_Boolean B)
{
if (B) myIndices[9] |= EMskOutLine;
else myIndices[9] &= ~EMskOutLine;
}
Standard_Boolean IntLine() const;
Standard_Boolean IntLine() const { return (myIndices[9] & EMskIntLine) != 0; }
void IntLine (const Standard_Boolean B);
void IntLine (const Standard_Boolean B)
{
if (B) myIndices[9] |= EMskIntLine;
else myIndices[9] &= ~EMskIntLine;
}
Standard_Boolean Hidden() const;
void Hidden (const Standard_Boolean B);
Standard_Address Indices() const;
Standard_Address Coordinates() const;
Standard_Boolean Hidden() const { return (myIndices[9] & EMskHidden) != 0; }
void Hidden (const Standard_Boolean B)
{
if (B) myIndices[9] |= EMskHidden;
else myIndices[9] &= ~EMskHidden;
}
Standard_Address Indices() const { return const_cast<Standard_Integer* >(myIndices); }
Standard_Address Coordinates() const { return const_cast<Standard_Real* >(myCoordinates); }
protected:
enum EMskFlags
{
EMskRg1Line = 1,
EMskRgNLine = 2,
EMskOutLine = 4,
EMskIntLine = 8,
EMskHidden = 16
};
private:
Standard_Integer myIndices[10];
Standard_Real myCoordinates[12];
};
#include <HLRAlgo_BiPoint.lxx>
#endif // _HLRAlgo_BiPoint_HeaderFile

@ -1,141 +0,0 @@
// Created on: 1995-06-22
// Created by: Christophe MARION
// Copyright (c) 1995-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.
#define EMskRg1Line ((Standard_Boolean)1)
#define EMskRgNLine ((Standard_Boolean)2)
#define EMskOutLine ((Standard_Boolean)4)
#define EMskIntLine ((Standard_Boolean)8)
#define EMskHidden ((Standard_Boolean)16)
//=======================================================================
//function : HLRAlgo_BiPoint
//purpose :
//=======================================================================
inline HLRAlgo_BiPoint::HLRAlgo_BiPoint ()
{
}
//=======================================================================
//function : Rg1Line
//purpose :
//=======================================================================
inline Standard_Boolean HLRAlgo_BiPoint::Rg1Line () const
{ return (myIndices[9] & EMskRg1Line) != 0; }
//=======================================================================
//function : Rg1Line
//purpose :
//=======================================================================
inline void HLRAlgo_BiPoint::Rg1Line (const Standard_Boolean B)
{
if (B) myIndices[9] |= EMskRg1Line;
else myIndices[9] &= ~EMskRg1Line;
}
//=======================================================================
//function : RgNLine
//purpose :
//=======================================================================
inline Standard_Boolean HLRAlgo_BiPoint::RgNLine () const
{ return (myIndices[9] & EMskRgNLine) != 0; }
//=======================================================================
//function : RgNLine
//purpose :
//=======================================================================
inline void HLRAlgo_BiPoint::RgNLine (const Standard_Boolean B)
{
if (B) myIndices[9] |= EMskRgNLine;
else myIndices[9] &= ~EMskRgNLine;
}
//=======================================================================
//function : OutLine
//purpose :
//=======================================================================
inline Standard_Boolean HLRAlgo_BiPoint::OutLine () const
{ return (myIndices[9] & EMskOutLine) != 0; }
//=======================================================================
//function : OutLine
//purpose :
//=======================================================================
inline void HLRAlgo_BiPoint::OutLine (const Standard_Boolean B)
{
if (B) myIndices[9] |= EMskOutLine;
else myIndices[9] &= ~EMskOutLine;
}
//=======================================================================
//function : IntLine
//purpose :
//=======================================================================
inline Standard_Boolean HLRAlgo_BiPoint::IntLine () const
{ return (myIndices[9] & EMskIntLine) != 0; }
//=======================================================================
//function : IntLine
//purpose :
//=======================================================================
inline void HLRAlgo_BiPoint::IntLine (const Standard_Boolean B)
{
if (B) myIndices[9] |= EMskIntLine;
else myIndices[9] &= ~EMskIntLine;
}
//=======================================================================
//function : Hidden
//purpose :
//=======================================================================
inline Standard_Boolean HLRAlgo_BiPoint::Hidden () const
{ return (myIndices[9] & EMskHidden) != 0; }
//=======================================================================
//function : Hidden
//purpose :
//=======================================================================
inline void HLRAlgo_BiPoint::Hidden (const Standard_Boolean B)
{
if (B) myIndices[9] |= EMskHidden;
else myIndices[9] &= ~EMskHidden;
}
//=======================================================================
//function : Indices
//purpose :
//=======================================================================
inline Standard_Address HLRAlgo_BiPoint::Indices () const
{ return (Standard_Address)myIndices; }
//=======================================================================
//function : Coordinates
//purpose :
//=======================================================================
inline Standard_Address HLRAlgo_BiPoint::Coordinates () const
{ return (Standard_Address)myCoordinates; }

@ -26,7 +26,13 @@
//function : HLRAlgo_EdgeStatus
//purpose :
//=======================================================================
HLRAlgo_EdgeStatus::HLRAlgo_EdgeStatus ()
HLRAlgo_EdgeStatus::HLRAlgo_EdgeStatus()
: myStart (0.0),
myEnd (0.0),
myTolStart (0.0f),
myTolEnd (0.0f),
myAllHidden (false),
myAllVisible(false)
{
}
@ -43,7 +49,8 @@ HLRAlgo_EdgeStatus::HLRAlgo_EdgeStatus (const Standard_Real Start,
myEnd (End),
myTolStart (TolStart),
myTolEnd (TolEnd),
myFlags (0)
myAllHidden (false),
myAllVisible(false)
{
ShowAll();
}

@ -57,7 +57,13 @@ public:
//! with the tolerances <TolStart>, <TolEnd>.
Standard_EXPORT void Initialize (const Standard_Real Start, const Standard_ShortReal TolStart, const Standard_Real End, const Standard_ShortReal TolEnd);
void Bounds (Standard_Real& Start, Standard_ShortReal& TolStart, Standard_Real& End, Standard_ShortReal& TolEnd) const;
void Bounds (Standard_Real& theStart, Standard_ShortReal& theTolStart, Standard_Real& theEnd, Standard_ShortReal& theTolEnd) const
{
theStart = myStart;
theTolStart = myTolStart;
theEnd = myEnd;
theTolEnd = myTolEnd;
}
Standard_EXPORT Standard_Integer NbVisiblePart() const;
@ -73,47 +79,37 @@ public:
Standard_EXPORT void Hide (const Standard_Real Start, const Standard_ShortReal TolStart, const Standard_Real End, const Standard_ShortReal TolEnd, const Standard_Boolean OnFace, const Standard_Boolean OnBoundary);
//! Hide the whole Edge.
void HideAll();
void HideAll()
{
AllVisible(Standard_False);
AllHidden (Standard_True);
}
//! Show the whole Edge.
void ShowAll();
Standard_Boolean AllHidden() const;
void AllHidden (const Standard_Boolean B);
Standard_Boolean AllVisible() const;
void AllVisible (const Standard_Boolean B);
protected:
void ShowAll()
{
AllVisible(Standard_True);
AllHidden (Standard_False);
}
Standard_Boolean AllHidden() const { return myAllHidden; }
void AllHidden (const Standard_Boolean B) { myAllHidden = B; }
Standard_Boolean AllVisible() const { return myAllVisible; }
void AllVisible (const Standard_Boolean B) { myAllVisible = B; }
private:
Standard_Real myStart;
Standard_Real myEnd;
Standard_ShortReal myTolStart;
Standard_ShortReal myTolEnd;
Standard_Boolean myFlags;
Standard_Boolean myAllHidden;
Standard_Boolean myAllVisible;
Intrv_Intervals myVisibles;
};
#include <HLRAlgo_EdgeStatus.lxx>
#endif // _HLRAlgo_EdgeStatus_HeaderFile

@ -1,93 +0,0 @@
// Created on: 1992-02-18
// Created by: Christophe MARION
// Copyright (c) 1992-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.
#define EMaskAllHidden ((Standard_Boolean)1)
#define EMaskAllVisible ((Standard_Boolean)2)
//=======================================================================
//function : Bounds
//purpose :
//=======================================================================
inline void HLRAlgo_EdgeStatus::Bounds
( Standard_Real& Start, Standard_ShortReal& TolStart,
Standard_Real& End , Standard_ShortReal& TolEnd ) const
{
Start = myStart;
TolStart = myTolStart;
End = myEnd;
TolEnd = myTolEnd;
}
//=======================================================================
//function : HideAll
//purpose :
//=======================================================================
inline void HLRAlgo_EdgeStatus::HideAll()
{
AllVisible(Standard_False);
AllHidden (Standard_True);
}
//=======================================================================
//function : ShowAll
//purpose :
//=======================================================================
inline void HLRAlgo_EdgeStatus::ShowAll()
{
AllVisible(Standard_True);
AllHidden (Standard_False);
}
//=======================================================================
//function : AllHidden
//purpose :
//=======================================================================
inline Standard_Boolean HLRAlgo_EdgeStatus::AllHidden () const
{ return (myFlags & EMaskAllHidden) != 0; }
//=======================================================================
//function : AllHidden
//purpose :
//=======================================================================
inline void HLRAlgo_EdgeStatus::AllHidden (const Standard_Boolean B)
{
if (B) myFlags |= EMaskAllHidden;
else myFlags &= ~EMaskAllHidden;
}
//=======================================================================
//function : AllVisible
//purpose :
//=======================================================================
inline Standard_Boolean HLRAlgo_EdgeStatus::AllVisible () const
{ return (myFlags & EMaskAllVisible) != 0; }
//=======================================================================
//function : AllVisible
//purpose :
//=======================================================================
inline void HLRAlgo_EdgeStatus::AllVisible (const Standard_Boolean B)
{
if (B) myFlags |= EMaskAllVisible;
else myFlags &= ~EMaskAllVisible;
}

@ -49,65 +49,81 @@ class HLRAlgo_EdgesBlock : public MMgt_TShared
public:
//! Create a Block of Edges for a wire.
Standard_EXPORT HLRAlgo_EdgesBlock(const Standard_Integer NbEdges);
Standard_Integer NbEdges() const;
Standard_Integer NbEdges() const { return myEdges.Upper(); }
void Edge (const Standard_Integer I, const Standard_Integer EI);
void Edge (const Standard_Integer I, const Standard_Integer EI) { myEdges(I) = EI; }
Standard_Integer Edge (const Standard_Integer I) const;
Standard_Integer Edge (const Standard_Integer I) const { return myEdges(I); }
void Orientation (const Standard_Integer I, const TopAbs_Orientation Or);
void Orientation (const Standard_Integer I, const TopAbs_Orientation Or)
{
myFlags(I) &= ~EMaskOrient;
myFlags(I) |= (Or & EMaskOrient);
}
TopAbs_Orientation Orientation (const Standard_Integer I) const;
TopAbs_Orientation Orientation (const Standard_Integer I) const
{
return ((TopAbs_Orientation)(myFlags(I) & EMaskOrient));
}
Standard_Boolean OutLine (const Standard_Integer I) const;
Standard_Boolean OutLine (const Standard_Integer I) const { return (myFlags(I) & EMaskOutLine) != 0; }
void OutLine (const Standard_Integer I, const Standard_Boolean B);
void OutLine (const Standard_Integer I, const Standard_Boolean B)
{
if (B) myFlags(I) |= EMaskOutLine;
else myFlags(I) &= ~EMaskOutLine;
}
Standard_Boolean Internal (const Standard_Integer I) const;
Standard_Boolean Internal (const Standard_Integer I) const { return (myFlags(I) & EMaskInternal) != 0; }
void Internal (const Standard_Integer I, const Standard_Boolean B);
void Internal (const Standard_Integer I, const Standard_Boolean B)
{
if (B) myFlags(I) |= EMaskInternal;
else myFlags(I) &= ~EMaskInternal;
}
Standard_Boolean Double (const Standard_Integer I) const;
Standard_Boolean Double (const Standard_Integer I) const { return (myFlags(I) & EMaskDouble) != 0; }
void Double (const Standard_Integer I, const Standard_Boolean B);
void Double (const Standard_Integer I, const Standard_Boolean B)
{
if (B) myFlags(I) |= EMaskDouble;
else myFlags(I) &= ~EMaskDouble;
}
Standard_Boolean IsoLine (const Standard_Integer I) const;
Standard_Boolean IsoLine (const Standard_Integer I) const { return (myFlags(I) & EMaskIsoLine) != 0; }
void IsoLine (const Standard_Integer I, const Standard_Boolean B);
void IsoLine (const Standard_Integer I, const Standard_Boolean B)
{
if (B) myFlags(I) |= EMaskIsoLine;
else myFlags(I) &= ~EMaskIsoLine;
}
Standard_EXPORT void UpdateMinMax (const Standard_Address TotMinMax);
Standard_Address MinMax() const;
Standard_Address MinMax() const { return (Standard_Address )&myMinMax; }
DEFINE_STANDARD_RTTIEXT(HLRAlgo_EdgesBlock,MMgt_TShared)
protected:
enum EMskFlags
{
EMaskOrient = 15,
EMaskOutLine = 16,
EMaskInternal = 32,
EMaskDouble = 64,
EMaskIsoLine = 128
};
private:
TColStd_Array1OfInteger myEdges;
TColStd_Array1OfBoolean myFlags;
TColStd_Array1OfInteger myFlags;
Standard_Integer myMinMax[16];
};
#include <HLRAlgo_EdgesBlock.lxx>
#endif // _HLRAlgo_EdgesBlock_HeaderFile

@ -1,179 +0,0 @@
// Created on: 1995-04-20
// Created by: Christophe MARION
// Copyright (c) 1995-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.
#define EMaskOrient ((Standard_Boolean)15)
#define EMaskOutLine ((Standard_Boolean)16)
#define EMaskInternal ((Standard_Boolean)32)
#define EMaskDouble ((Standard_Boolean)64)
#define EMaskIsoLine ((Standard_Boolean)128)
//=======================================================================
//function : NbEdges
//purpose :
//=======================================================================
inline Standard_Integer HLRAlgo_EdgesBlock::NbEdges() const
{
return myEdges.Upper();
}
//=======================================================================
//function : Edge
//purpose :
//=======================================================================
inline void HLRAlgo_EdgesBlock::Edge (const Standard_Integer I,
const Standard_Integer EI)
{
myEdges(I) = EI;
}
//=======================================================================
//function : Edge
//purpose :
//=======================================================================
inline Standard_Integer
HLRAlgo_EdgesBlock::Edge (const Standard_Integer I) const
{
return myEdges(I);
}
//=======================================================================
//function : Orientation
//purpose :
//=======================================================================
inline TopAbs_Orientation
HLRAlgo_EdgesBlock::Orientation (const Standard_Integer I) const
{
return ((TopAbs_Orientation)(myFlags(I) & EMaskOrient));
}
//=======================================================================
//function : Orientation
//purpose :
//=======================================================================
inline void
HLRAlgo_EdgesBlock::Orientation (const Standard_Integer I,
const TopAbs_Orientation Or)
{
myFlags(I) &= ~EMaskOrient;
myFlags(I) |= (((Standard_Boolean)Or) & EMaskOrient);
}
//=======================================================================
//function : OutLine
//purpose :
//=======================================================================
inline Standard_Boolean
HLRAlgo_EdgesBlock::OutLine (const Standard_Integer I) const
{
return (myFlags(I) & EMaskOutLine) != 0;
}
//=======================================================================
//function : OutLine
//purpose :
//=======================================================================
inline void
HLRAlgo_EdgesBlock::OutLine (const Standard_Integer I,
const Standard_Boolean B)
{
if (B) myFlags(I) |= EMaskOutLine;
else myFlags(I) &= ~EMaskOutLine;
}
//=======================================================================
//function : Internal
//purpose :
//=======================================================================
inline Standard_Boolean
HLRAlgo_EdgesBlock::Internal (const Standard_Integer I) const
{
return (myFlags(I) & EMaskInternal) != 0;
}
//=======================================================================
//function : Internal
//purpose :
//=======================================================================
inline void
HLRAlgo_EdgesBlock::Internal (const Standard_Integer I,
const Standard_Boolean B)
{
if (B) myFlags(I) |= EMaskInternal;
else myFlags(I) &= ~EMaskInternal;
}
//=======================================================================
//function : Double
//purpose :
//=======================================================================
inline Standard_Boolean
HLRAlgo_EdgesBlock::Double (const Standard_Integer I) const
{
return (myFlags(I) & EMaskDouble) != 0;
}
//=======================================================================
//function : Double
//purpose :
//=======================================================================
inline void HLRAlgo_EdgesBlock::Double (const Standard_Integer I,
const Standard_Boolean B)
{
if (B) myFlags(I) |= EMaskDouble;
else myFlags(I) &= ~EMaskDouble;
}
//=======================================================================
//function : IsoLine
//purpose :
//=======================================================================
inline Standard_Boolean
HLRAlgo_EdgesBlock::IsoLine (const Standard_Integer I) const
{
return (myFlags(I) & EMaskIsoLine) != 0;
}
//=======================================================================
//function : IsoLine
//purpose :
//=======================================================================
inline void HLRAlgo_EdgesBlock::IsoLine (const Standard_Integer I,
const Standard_Boolean B)
{
if (B) myFlags(I) |= EMaskIsoLine;
else myFlags(I) &= ~EMaskIsoLine;
}
//=======================================================================
//function : MinMax
//purpose :
//=======================================================================
inline Standard_Address HLRAlgo_EdgesBlock::MinMax () const
{ return (Standard_Address)&myMinMax; }

@ -30,15 +30,15 @@
IMPLEMENT_STANDARD_RTTIEXT(HLRAlgo_PolyAlgo,MMgt_TShared)
#define EMskGrALin1 ((Standard_Boolean) 8)
#define EMskGrALin2 ((Standard_Boolean) 16)
#define EMskGrALin3 ((Standard_Boolean) 32)
#define FMskHiding ((Standard_Boolean) 256)
#define EMskGrALin1 ((Standard_Integer) 8)
#define EMskGrALin2 ((Standard_Integer) 16)
#define EMskGrALin3 ((Standard_Integer) 32)
#define FMskHiding ((Standard_Integer) 256)
#define TriNode1 ((Standard_Integer*)TriIndices)[0]
#define TriNode2 ((Standard_Integer*)TriIndices)[1]
#define TriNode3 ((Standard_Integer*)TriIndices)[2]
#define TriFlags ((Standard_Boolean*)TriIndices)[3]
#define TriFlags ((Standard_Integer*)TriIndices)[3]
#define XV1 myRealPtr[0]
#define XV2 myRealPtr[1]

@ -14,21 +14,18 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef No_Exception
//#define No_Exception
#endif
#include <HLRAlgo_PolyData.hxx>
#include <HLRAlgo_EdgeStatus.hxx>
#include <HLRAlgo_PolyData.hxx>
#include <Standard_Type.hxx>
IMPLEMENT_STANDARD_RTTIEXT(HLRAlgo_PolyData,MMgt_TShared)
#define EMskGrALin1 ((Standard_Boolean) 8)
#define EMskGrALin2 ((Standard_Boolean) 16)
#define EMskGrALin3 ((Standard_Boolean) 32)
#define FMskHiding ((Standard_Boolean) 256)
#define EMskGrALin1 ((Standard_Integer) 8)
#define EMskGrALin2 ((Standard_Integer) 16)
#define EMskGrALin3 ((Standard_Integer) 32)
#define FMskHiding ((Standard_Integer) 256)
#define FIndex myIndices[0]
#define MinFac myIndices[1]
@ -37,15 +34,7 @@ IMPLEMENT_STANDARD_RTTIEXT(HLRAlgo_PolyData,MMgt_TShared)
#define TriNode1 ((Standard_Integer*)TriIndices)[0]
#define TriNode2 ((Standard_Integer*)TriIndices)[1]
#define TriNode3 ((Standard_Integer*)TriIndices)[2]
#define TriFlags ((Standard_Boolean*)TriIndices)[3]
#define Crossing ((Standard_Boolean*)BooleanPtr)[0]
#define HideBefore ((Standard_Boolean*)BooleanPtr)[1]
#define TrFlags ((Standard_Boolean*)BooleanPtr)[2]
#define Crosi BooleanPtr[0]
#define HdBef BooleanPtr[1]
#define TFlag BooleanPtr[2]
#define TriFlags ((Standard_Integer*)TriIndices)[3]
#define PntX1 ((Standard_Real*)Coordinates)[ 0]
#define PntY1 ((Standard_Real*)Coordinates)[ 1]
@ -201,7 +190,10 @@ void HLRAlgo_PolyData::HideByPolyData (const Standard_Address Coordinates,
HLRAlgo_Array1OfPHDat& PHDat = myHPHDat->ChangeArray1();
const HLRAlgo_Array1OfTData& TData = myHTData->Array1();
Standard_Real d1,d2;
Standard_Boolean NotConnex,BooleanPtr[3];
Standard_Boolean NotConnex = Standard_False;
Standard_Boolean isCrossing = Standard_False;
Standard_Boolean toHideBefore = Standard_False;
Standard_Integer TFlag = 0;
Standard_Address PlanPtr,MinMaxPtr,TriIndices;
Standard_Integer h,h2 = PHDat.Upper();
HLRAlgo_PolyHidingData* PH = &(PHDat(1));
@ -237,8 +229,8 @@ void HLRAlgo_PolyData::HideByPolyData (const Standard_Address Coordinates,
if (d1 > Tolerance) {
if (d2 < -Tolerance) {
Param = d1 / ( d1 - d2 );
HdBef = Standard_False;
Crosi = Standard_True;
toHideBefore = Standard_False;
isCrossing = Standard_True;
TFlag = TriFlags;
const TColgp_Array1OfXYZ& Nodes = myHNodes->Array1();
const gp_XYZ & P1 = Nodes(TriNode1);
@ -250,18 +242,14 @@ void HLRAlgo_PolyData::HideByPolyData (const Standard_Address Coordinates,
YV2 = P2.Y();
XV3 = P3.X();
YV3 = P3.Y();
HideByOneTriangle(Coordinates,
RealPtr,
&BooleanPtr,
PlanPtr,
status);
hideByOneTriangle (Coordinates, RealPtr, isCrossing, toHideBefore, TFlag, status);
}
}
else if (d1 < -Tolerance) {
if (d2 > Tolerance) {
Param = d1 / ( d1 - d2 );
HdBef = Standard_True;
Crosi = Standard_True;
toHideBefore = Standard_True;
isCrossing = Standard_True;
TFlag = TriFlags;
const TColgp_Array1OfXYZ& Nodes = myHNodes->Array1();
const gp_XYZ & P1 = Nodes(TriNode1);
@ -273,14 +261,10 @@ void HLRAlgo_PolyData::HideByPolyData (const Standard_Address Coordinates,
YV2 = P2.Y();
XV3 = P3.X();
YV3 = P3.Y();
HideByOneTriangle(Coordinates,
RealPtr,
&BooleanPtr,
PlanPtr,
status);
hideByOneTriangle (Coordinates, RealPtr, isCrossing, toHideBefore, TFlag, status);
}
else {
Crosi = Standard_False;
isCrossing = Standard_False;
TFlag = TriFlags;
const TColgp_Array1OfXYZ& Nodes = myHNodes->Array1();
const gp_XYZ & P1 = Nodes(TriNode1);
@ -292,15 +276,11 @@ void HLRAlgo_PolyData::HideByPolyData (const Standard_Address Coordinates,
YV2 = P2.Y();
XV3 = P3.X();
YV3 = P3.Y();
HideByOneTriangle(Coordinates,
RealPtr,
&BooleanPtr,
PlanPtr,
status);
hideByOneTriangle (Coordinates, RealPtr, isCrossing, toHideBefore, TFlag, status);
}
}
else if (d2 < -Tolerance) {
Crosi = Standard_False;
isCrossing = Standard_False;
TFlag = TriFlags;
const TColgp_Array1OfXYZ& Nodes = myHNodes->Array1();
const gp_XYZ & P1 = Nodes(TriNode1);
@ -312,11 +292,7 @@ void HLRAlgo_PolyData::HideByPolyData (const Standard_Address Coordinates,
YV2 = P2.Y();
XV3 = P3.X();
YV3 = P3.Y();
HideByOneTriangle(Coordinates,
RealPtr,
&BooleanPtr,
PlanPtr,
status);
hideByOneTriangle(Coordinates, RealPtr, isCrossing, toHideBefore, TFlag, status);
}
}
}
@ -326,16 +302,16 @@ void HLRAlgo_PolyData::HideByPolyData (const Standard_Address Coordinates,
}
//=======================================================================
//function : HideByOneTriangle
//function : hideByOneTriangle
//purpose :
//=======================================================================
void HLRAlgo_PolyData::
HideByOneTriangle (const Standard_Address Coordinates,
const Standard_Address RealPtr,
const Standard_Address BooleanPtr,
const Standard_Address ,
HLRAlgo_EdgeStatus& status)
void HLRAlgo_PolyData::hideByOneTriangle (const Standard_Address Coordinates,
const Standard_Address RealPtr,
const Standard_Boolean Crossing,
const Standard_Boolean HideBefore,
const Standard_Integer TrFlags,
HLRAlgo_EdgeStatus& status)
{
Standard_Boolean o[2],m[2];
Standard_Integer l,n1=0,nn1,nn2,npi=-1,npiRej=0;

@ -70,35 +70,25 @@ public:
Standard_Address Indices();
DEFINE_STANDARD_RTTIEXT(HLRAlgo_PolyData,MMgt_TShared)
protected:
private:
//! evident.
Standard_EXPORT void HideByOneTriangle (const Standard_Address Coordinates, const Standard_Address RealPtr, const Standard_Address BooleanPtr, const Standard_Address PlanPtr, HLRAlgo_EdgeStatus& status);
void hideByOneTriangle (const Standard_Address Coordinates,
const Standard_Address RealPtr,
const Standard_Boolean Crossing,
const Standard_Boolean HideBefore,
const Standard_Integer TrFlags,
HLRAlgo_EdgeStatus& status);
Standard_Integer myIndices[3];
Handle(TColgp_HArray1OfXYZ) myHNodes;
Handle(HLRAlgo_HArray1OfTData) myHTData;
Handle(HLRAlgo_HArray1OfPHDat) myHPHDat;
};
#include <HLRAlgo_PolyData.lxx>
#endif // _HLRAlgo_PolyData_HeaderFile

@ -9,12 +9,8 @@ HLRBRep_Array1OfFData.hxx
HLRBRep_BCurveTool.cxx
HLRBRep_BCurveTool.hxx
HLRBRep_BCurveTool.lxx
HLRBRep_BiPnt2D.cxx
HLRBRep_BiPnt2D.hxx
HLRBRep_BiPnt2D.lxx
HLRBRep_BiPoint.cxx
HLRBRep_BiPoint.hxx
HLRBRep_BiPoint.lxx
HLRBRep_BSurfaceTool.cxx
HLRBRep_BSurfaceTool.hxx
HLRBRep_BSurfaceTool.lxx

@ -1,53 +0,0 @@
// Created on: 1992-08-25
// Created by: Christophe MARION
// Copyright (c) 1992-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.
#include <gp_Pnt2d.hxx>
#include <HLRBRep_BiPnt2D.hxx>
#include <TopoDS_Shape.hxx>
//=======================================================================
//function : HLRBRep_BiPnt2D
//purpose :
//=======================================================================
HLRBRep_BiPnt2D::HLRBRep_BiPnt2D ()
{
}
//=======================================================================
//function : HLRBRep_BiPnt2D
//purpose :
//=======================================================================
HLRBRep_BiPnt2D::HLRBRep_BiPnt2D (const Standard_Real x1,
const Standard_Real y1,
const Standard_Real x2,
const Standard_Real y2,
const TopoDS_Shape& S,
const Standard_Boolean reg1,
const Standard_Boolean regn,
const Standard_Boolean outl,
const Standard_Boolean intl) :
myP1(x1,y1),
myP2(x2,y2),
myShape(S),
myFlags(0)
{
Rg1Line(reg1);
RgNLine(regn);
OutLine(outl);
IntLine(intl);
}

@ -25,9 +25,6 @@
#include <TopoDS_Shape.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Real.hxx>
class TopoDS_Shape;
class gp_Pnt2d;
//! Contains the colors of a shape.
class HLRBRep_BiPnt2D
@ -36,61 +33,55 @@ public:
DEFINE_STANDARD_ALLOC
HLRBRep_BiPnt2D()
: myRg1Line (false),
myRgNLine (false),
myOutLine (false),
myIntLine (false) {}
Standard_EXPORT HLRBRep_BiPnt2D();
HLRBRep_BiPnt2D(const Standard_Real x1, const Standard_Real y1, const Standard_Real x2, const Standard_Real y2, const TopoDS_Shape& S, const Standard_Boolean reg1, const Standard_Boolean regn, const Standard_Boolean outl, const Standard_Boolean intl)
: myP1(x1,y1),
myP2(x2,y2),
myShape(S),
myRg1Line (reg1),
myRgNLine (regn),
myOutLine (outl),
myIntLine (intl) {}
Standard_EXPORT HLRBRep_BiPnt2D(const Standard_Real x1, const Standard_Real y1, const Standard_Real x2, const Standard_Real y2, const TopoDS_Shape& S, const Standard_Boolean reg1, const Standard_Boolean regn, const Standard_Boolean outl, const Standard_Boolean intl);
const gp_Pnt2d& P1() const { return myP1; }
const gp_Pnt2d& P1() const;
const gp_Pnt2d& P2() const { return myP2; }
const gp_Pnt2d& P2() const;
const TopoDS_Shape& Shape() const { return myShape; }
const TopoDS_Shape& Shape() const;
void Shape (const TopoDS_Shape& S) { myShape = S; }
void Shape (const TopoDS_Shape& S);
Standard_Boolean Rg1Line() const { return myRg1Line; }
Standard_Boolean Rg1Line() const;
void Rg1Line (const Standard_Boolean B) { myRg1Line = B; }
void Rg1Line (const Standard_Boolean B);
Standard_Boolean RgNLine() const { return myRgNLine; }
Standard_Boolean RgNLine() const;
void RgNLine (const Standard_Boolean B);
Standard_Boolean OutLine() const;
void OutLine (const Standard_Boolean B);
Standard_Boolean IntLine() const;
void IntLine (const Standard_Boolean B);
protected:
void RgNLine (const Standard_Boolean B) { myRgNLine = B; }
Standard_Boolean OutLine() const { return myOutLine; }
void OutLine (const Standard_Boolean B) { myOutLine = B; }
Standard_Boolean IntLine() const { return myIntLine; }
void IntLine (const Standard_Boolean B) { myIntLine = B; }
private:
gp_Pnt2d myP1;
gp_Pnt2d myP2;
TopoDS_Shape myShape;
Standard_Boolean myFlags;
bool myRg1Line;
bool myRgNLine;
bool myOutLine;
bool myIntLine;
};
#include <HLRBRep_BiPnt2D.lxx>
#endif // _HLRBRep_BiPnt2D_HeaderFile

@ -1,128 +0,0 @@
// Created on: 1992-08-25
// Created by: Christophe MARION
// Copyright (c) 1992-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.
#define EMskRg1Line ((Standard_Boolean)1)
#define EMskRgNLine ((Standard_Boolean)2)
#define EMskOutLine ((Standard_Boolean)4)
#define EMskIntLine ((Standard_Boolean)8)
//=======================================================================
//function : P1
//purpose :
//=======================================================================
inline const gp_Pnt2d & HLRBRep_BiPnt2D::P1 () const
{ return myP1; }
//=======================================================================
//function : P2
//purpose :
//=======================================================================
inline const gp_Pnt2d & HLRBRep_BiPnt2D::P2 () const
{ return myP2; }
//=======================================================================
//function : Shape
//purpose :
//=======================================================================
inline const TopoDS_Shape & HLRBRep_BiPnt2D::Shape () const
{ return myShape; }
//=======================================================================
//function : Shape
//purpose :
//=======================================================================
inline void HLRBRep_BiPnt2D::Shape (const TopoDS_Shape& S)
{ myShape = S; }
//=======================================================================
//function : Rg1Line
//purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_BiPnt2D::Rg1Line () const
{ return (myFlags & EMskRg1Line) != 0; }
//=======================================================================
//function : Rg1Line
//purpose :
//=======================================================================
inline void HLRBRep_BiPnt2D::Rg1Line (const Standard_Boolean B)
{
if (B) myFlags |= EMskRg1Line;
else myFlags &= ~EMskRg1Line;
}
//=======================================================================
//function : RgNLine
//purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_BiPnt2D::RgNLine () const
{ return (myFlags & EMskRgNLine) != 0; }
//=======================================================================
//function : RgNLine
//purpose :
//=======================================================================
inline void HLRBRep_BiPnt2D::RgNLine (const Standard_Boolean B)
{
if (B) myFlags |= EMskRgNLine;
else myFlags &= ~EMskRgNLine;
}
//=======================================================================
//function : OutLine
//purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_BiPnt2D::OutLine () const
{ return (myFlags & EMskOutLine) != 0; }
//=======================================================================
//function : OutLine
//purpose :
//=======================================================================
inline void HLRBRep_BiPnt2D::OutLine (const Standard_Boolean B)
{
if (B) myFlags |= EMskOutLine;
else myFlags &= ~EMskOutLine;
}
//=======================================================================
//function : IntLine
//purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_BiPnt2D::IntLine () const
{ return (myFlags & EMskIntLine) != 0; }
//=======================================================================
//function : IntLine
//purpose :
//=======================================================================
inline void HLRBRep_BiPnt2D::IntLine (const Standard_Boolean B)
{
if (B) myFlags |= EMskIntLine;
else myFlags &= ~EMskIntLine;
}

@ -1,55 +0,0 @@
// Created on: 1992-08-25
// Created by: Christophe MARION
// Copyright (c) 1992-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.
#include <gp_Pnt.hxx>
#include <HLRBRep_BiPoint.hxx>
#include <TopoDS_Shape.hxx>
//=======================================================================
//function : HLRBRep_BiPoint
//purpose :
//=======================================================================
HLRBRep_BiPoint::HLRBRep_BiPoint ()
{
}
//=======================================================================
//function : HLRBRep_BiPoint
//purpose :
//=======================================================================
HLRBRep_BiPoint::HLRBRep_BiPoint (const Standard_Real x1,
const Standard_Real y1,
const Standard_Real z1,
const Standard_Real x2,
const Standard_Real y2,
const Standard_Real z2,
const TopoDS_Shape& S,
const Standard_Boolean reg1,
const Standard_Boolean regn,
const Standard_Boolean outl,
const Standard_Boolean intl) :
myP1(x1,y1,z1),
myP2(x2,y2,z2),
myShape(S),
myFlags(0)
{
Rg1Line(reg1);
RgNLine(regn);
OutLine(outl);
IntLine(intl);
}

@ -28,7 +28,6 @@
class TopoDS_Shape;
class gp_Pnt;
//! Contains the colors of a shape.
class HLRBRep_BiPoint
{
@ -36,61 +35,61 @@ public:
DEFINE_STANDARD_ALLOC
HLRBRep_BiPoint()
: myRg1Line (false),
myRgNLine (false),
myOutLine (false),
myIntLine (false) {}
Standard_EXPORT HLRBRep_BiPoint();
HLRBRep_BiPoint (const Standard_Real x1, const Standard_Real y1, const Standard_Real z1,
const Standard_Real x2, const Standard_Real y2, const Standard_Real z2,
const TopoDS_Shape& S,
const Standard_Boolean reg1,
const Standard_Boolean regn,
const Standard_Boolean outl,
const Standard_Boolean intl)
: myP1 (x1, y1, z1),
myP2 (x2, y2, z2),
myShape (S),
myRg1Line (reg1),
myRgNLine (regn),
myOutLine (outl),
myIntLine (intl) {}
Standard_EXPORT HLRBRep_BiPoint(const Standard_Real x1, const Standard_Real y1, const Standard_Real z1, const Standard_Real x2, const Standard_Real y2, const Standard_Real z2, const TopoDS_Shape& S, const Standard_Boolean reg1, const Standard_Boolean regn, const Standard_Boolean outl, const Standard_Boolean intl);
const gp_Pnt& P1() const { return myP1; }
const gp_Pnt& P1() const;
const gp_Pnt& P2() const { return myP2; }
const gp_Pnt& P2() const;
const TopoDS_Shape& Shape() const { return myShape; }
const TopoDS_Shape& Shape() const;
void Shape (const TopoDS_Shape& S) { myShape = S; }
void Shape (const TopoDS_Shape& S);
Standard_Boolean Rg1Line() const { return myRg1Line; }
Standard_Boolean Rg1Line() const;
void Rg1Line (const Standard_Boolean B) { myRg1Line = B; }
void Rg1Line (const Standard_Boolean B);
Standard_Boolean RgNLine() const { return myRgNLine; }
Standard_Boolean RgNLine() const;
void RgNLine (const Standard_Boolean B);
Standard_Boolean OutLine() const;
void OutLine (const Standard_Boolean B);
Standard_Boolean IntLine() const;
void IntLine (const Standard_Boolean B);
protected:
void RgNLine (const Standard_Boolean B) { myRgNLine = B; }
Standard_Boolean OutLine() const { return myOutLine; }
void OutLine (const Standard_Boolean B) { myOutLine = B; }
Standard_Boolean IntLine() const { return myIntLine; }
void IntLine (const Standard_Boolean B) { myIntLine = B; }
private:
gp_Pnt myP1;
gp_Pnt myP2;
TopoDS_Shape myShape;
Standard_Boolean myFlags;
Standard_Boolean myRg1Line;
Standard_Boolean myRgNLine;
Standard_Boolean myOutLine;
Standard_Boolean myIntLine;
};
#include <HLRBRep_BiPoint.lxx>
#endif // _HLRBRep_BiPoint_HeaderFile

@ -1,128 +0,0 @@
// Created on: 1992-08-25
// Created by: Christophe MARION
// Copyright (c) 1992-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.
#define EMskRg1Line ((Standard_Boolean)1)
#define EMskRgNLine ((Standard_Boolean)2)
#define EMskOutLine ((Standard_Boolean)4)
#define EMskIntLine ((Standard_Boolean)8)
//=======================================================================
//function : P1
//purpose :
//=======================================================================
inline const gp_Pnt & HLRBRep_BiPoint::P1 () const
{ return myP1; }
//=======================================================================
//function : P2
//purpose :
//=======================================================================
inline const gp_Pnt & HLRBRep_BiPoint::P2 () const
{ return myP2; }
//=======================================================================
//function : Shape
//purpose :
//=======================================================================
inline const TopoDS_Shape & HLRBRep_BiPoint::Shape () const
{ return myShape; }
//=======================================================================
//function : Shape
//purpose :
//=======================================================================
inline void HLRBRep_BiPoint::Shape (const TopoDS_Shape& S)
{ myShape = S; }
//=======================================================================
//function : Rg1Line
//purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_BiPoint::Rg1Line () const
{ return (myFlags & EMskRg1Line) != 0; }
//=======================================================================
//function : Rg1Line
//purpose :
//=======================================================================
inline void HLRBRep_BiPoint::Rg1Line (const Standard_Boolean B)
{
if (B) myFlags |= EMskRg1Line;
else myFlags &= ~EMskRg1Line;
}
//=======================================================================
//function : RgNLine
//purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_BiPoint::RgNLine () const
{ return (myFlags & EMskRgNLine) != 0; }
//=======================================================================
//function : RgNLine
//purpose :
//=======================================================================
inline void HLRBRep_BiPoint::RgNLine (const Standard_Boolean B)
{
if (B) myFlags |= EMskRgNLine;
else myFlags &= ~EMskRgNLine;
}
//=======================================================================
//function : OutLine
//purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_BiPoint::OutLine () const
{ return (myFlags & EMskOutLine) != 0; }
//=======================================================================
//function : OutLine
//purpose :
//=======================================================================
inline void HLRBRep_BiPoint::OutLine (const Standard_Boolean B)
{
if (B) myFlags |= EMskOutLine;
else myFlags &= ~EMskOutLine;
}
//=======================================================================
//function : IntLine
//purpose :
//=======================================================================
inline Standard_Boolean HLRBRep_BiPoint::IntLine () const
{ return (myFlags & EMskIntLine) != 0; }
//=======================================================================
//function : IntLine
//purpose :
//=======================================================================
inline void HLRBRep_BiPoint::IntLine (const Standard_Boolean B)
{
if (B) myFlags |= EMskIntLine;
else myFlags &= ~EMskIntLine;
}

@ -123,20 +123,28 @@ public:
Standard_ShortReal Tolerance() const;
protected:
enum EMaskFlags
{
EMaskSelected = 1,
EMaskUsed = 2,
EMaskRg1Line = 4,
EMaskVertical = 8,
EMaskSimple = 16,
EMaskOutLVSta = 32,
EMaskOutLVEnd = 64,
EMaskIntDone = 128,
EMaskCutAtSta = 256,
EMaskCutAtEnd = 512,
EMaskVerAtSta = 1024,
EMaskVerAtEnd = 2048,
EMaskRgNLine = 4096
};
private:
Standard_Boolean myFlags;
Standard_Integer myFlags;
Standard_Integer myHideCount;
Standard_Integer myVSta;
Standard_Integer myVEnd;
@ -145,14 +153,8 @@ private:
HLRBRep_Curve myGeometry;
Standard_ShortReal myTolerance;
};
#include <HLRBRep_EdgeData.lxx>
#endif // _HLRBRep_EdgeData_HeaderFile

@ -14,20 +14,6 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#define EMaskSelected ((Standard_Boolean)1)
#define EMaskUsed ((Standard_Boolean)2)
#define EMaskRg1Line ((Standard_Boolean)4)
#define EMaskVertical ((Standard_Boolean)8)
#define EMaskSimple ((Standard_Boolean)16)
#define EMaskOutLVSta ((Standard_Boolean)32)
#define EMaskOutLVEnd ((Standard_Boolean)64)
#define EMaskIntDone ((Standard_Boolean)128)
#define EMaskCutAtSta ((Standard_Boolean)256)
#define EMaskCutAtEnd ((Standard_Boolean)512)
#define EMaskVerAtSta ((Standard_Boolean)1024)
#define EMaskVerAtEnd ((Standard_Boolean)2048)
#define EMaskRgNLine ((Standard_Boolean)4096)
//=======================================================================
//function : Selected
//purpose :

@ -121,33 +121,36 @@ public:
Standard_ShortReal Tolerance() const;
protected:
enum EMaskFlags
{
EMaskOrient = 15,
FMaskSelected = 16,
FMaskBack = 32,
FMaskSide = 64,
FMaskClosed = 128,
FMaskHiding = 256,
FMaskSimple = 512,
FMaskCut = 1024,
FMaskWithOutL = 2048,
FMaskPlane = 4096,
FMaskCylinder = 8192,
FMaskCone = 16384,
FMaskSphere = 32768,
FMaskTorus = 65536
};
private:
Standard_Boolean myFlags;
Standard_Integer myFlags;
Handle(HLRAlgo_WiresBlock) myWires;
HLRBRep_Surface myGeometry;
Standard_Real mySize;
Standard_ShortReal myTolerance;
};
#include <HLRBRep_FaceData.lxx>
#endif // _HLRBRep_FaceData_HeaderFile

@ -14,21 +14,6 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#define EMaskOrient ((Standard_Boolean)15)
#define FMaskSelected ((Standard_Boolean)16)
#define FMaskBack ((Standard_Boolean)32)
#define FMaskSide ((Standard_Boolean)64)
#define FMaskClosed ((Standard_Boolean)128)
#define FMaskHiding ((Standard_Boolean)256)
#define FMaskSimple ((Standard_Boolean)512)
#define FMaskCut ((Standard_Boolean)1024)
#define FMaskWithOutL ((Standard_Boolean)2048)
#define FMaskPlane ((Standard_Boolean)4096)
#define FMaskCylinder ((Standard_Boolean)8192)
#define FMaskCone ((Standard_Boolean)16384)
#define FMaskSphere ((Standard_Boolean)32768)
#define FMaskTorus ((Standard_Boolean)65536)
//=======================================================================
//function : Selected
//purpose :
@ -308,7 +293,7 @@ inline TopAbs_Orientation HLRBRep_FaceData::Orientation() const
inline void HLRBRep_FaceData::Orientation(const TopAbs_Orientation O)
{
myFlags &= ~EMaskOrient;
myFlags |= (((Standard_Boolean)O) & EMaskOrient);
myFlags |= (O & EMaskOrient);
}
//=======================================================================

Some files were not shown because too many files have changed in this diff Show More