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
@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).
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);
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);
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));
}
void CColoredMeshDlg::OnCheckX1()
{
- X1OnOff = m_CheckX1OnOff;
+ X1OnOff = m_CheckX1OnOff != 0;
}
void CColoredMeshDlg::OnCHECKXBlue()
void CColoredMeshDlg::OnCheckY1()
{
- Y1OnOff = m_CheckY1OnOff;
+ Y1OnOff = m_CheckY1OnOff != 0;
}
void CColoredMeshDlg::OnCHECKYBlue()
void CColoredMeshDlg::OnCheckZ1()
{
- Z1OnOff = m_CheckZ1OnOff;
+ Z1OnOff = m_CheckZ1OnOff != 0;
}
void CColoredMeshDlg::OnCHECKZBlue()
const Standard_Boolean CDimensionDlg::GetTextType() const
{
CButton* a3DButton = (CButton*)GetDlgItem (IDC_3DText);
- return a3DButton->GetCheck();
+ return a3DButton->GetCheck() != 0;
}
//=======================================================================
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.
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:
//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;
}
* @return true if the interference has index of new shape
*/
Standard_Boolean HasIndexNew() const {
- return (myIndexNew+1);
+ return (myIndexNew+1) != 0;
}
//
protected:
return 0;
}
//
- bRunParallel=(Standard_Boolean)(iX);
+ bRunParallel = (iX != 0);
BOPTest_Objects::SetRunParallel(bRunParallel);
//
return 0;
return 0;
}
//
- bNonDestructive = (Standard_Boolean)(iX);
+ bNonDestructive = (iX != 0);
BOPTest_Objects::SetNonDestructive(bNonDestructive);
//
return 0;
//function : IsInternalFace
//purpose :
//=======================================================================
-Standard_Integer BOPTools_AlgoTools::IsInternalFace
+Standard_Boolean BOPTools_AlgoTools::IsInternalFace
(const TopoDS_Face& theFace,
const TopoDS_Solid& theSolid,
BOPCol_IndexedDataMapOfShapeListOfShape& theMEF,
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) {
}
//
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,
}
//
if (iRet!=2) {
- return iRet;
+ return iRet == 1;
}
//
//========================================
//
aState=BOPTools_AlgoTools::ComputeState(theFace, theSolid,
theTol, aBounds, theContext);
- //
- iRet=(aState==TopAbs_IN)? 1 : 0;
- //
- return iRet;
+ return aState == TopAbs_IN;
}
//=======================================================================
//function : IsInternalFace
//! 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
//! 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
//purpose :
//=======================================================================
- Standard_Boolean BRep_TEdge::SameParameter()const
+Standard_Boolean BRep_TEdge::SameParameter() const
{
- return myFlags & ParameterMask;
+ return (myFlags & ParameterMask) != 0;
}
//purpose :
//=======================================================================
- Standard_Boolean BRep_TEdge::SameRange()const
+Standard_Boolean BRep_TEdge::SameRange() const
{
- return myFlags & RangeMask;
+ return (myFlags & RangeMask) != 0;
}
-
//=======================================================================
//function : SameRange
//purpose :
//purpose :
//=======================================================================
- Standard_Boolean BRep_TEdge::Degenerated()const
+Standard_Boolean BRep_TEdge::Degenerated() const
{
- return myFlags & DegeneratedMask;
+ return (myFlags & DegeneratedMask) != 0;
}
-
//=======================================================================
//function : Degenerated
//purpose :
// 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));
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)
{
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;
void BRepBuilderAPI_Sewing::AnalysisNearestEdges(const TopTools_SequenceOfShape& sequenceSec,
TColStd_SequenceOfInteger& seqIndCandidate,
- TColStd_SequenceOfInteger& seqOrientations,
+ TColStd_SequenceOfBoolean& seqOrientations,
const Standard_Boolean evalDist)
{
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)
// 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()) {
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;
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
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);
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;
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);
}
}
}
- Standard_Boolean isMergedSplit = MergedWithSections.Extent();
+ const Standard_Boolean isMergedSplit = !MergedWithSections.IsEmpty();
if (!isMerged && !isMergedSplit) {
// Nothing was merged in this iteration
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;
}
// Find merging candidates
- TColStd_SequenceOfInteger seqForward;
+ TColStd_SequenceOfBoolean seqForward;
TColStd_SequenceOfInteger seqCandidates;
TColStd_IndexedMapOfInteger mapReference;
mapReference.Add(indRef); // Add index of reference section
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);
}
}
#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>
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);
//! 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
#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>
// (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);
// 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++) {
}
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();
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 )
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;
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
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);
#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
#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
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()) {
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()) {
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;
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]));
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";
for (; aExpE.More(); aExpE.Next())
aSplitEdges.Append(aExpE.Current());
- isSplittingEdges = (aSplitEdges.Length());
+ isSplittingEdges = !aSplitEdges.IsEmpty();
}
}
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;
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)
{
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,
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())
{
}
{
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;
}
//=======================================================================
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 ");
// 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
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]);
#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;
}
}
if (! (theSource >> aDeltaValue))
return Standard_False;
else
- aDelta = (Standard_Boolean)aDeltaValue;
+ aDelta = (aDeltaValue != 0);
}
anAtt->SetDelta(aDelta);
return Standard_True;
}
Standard_Byte *aPtr = (Standard_Byte *) &aSourceArray(lower);
theTarget.PutByteArray(aPtr, bytes->Length());
- theTarget << (Standard_Byte)anAtt->GetDelta();
+ theTarget << (Standard_Byte)(anAtt->GetDelta() ? 1 : 0);
}
return Standard_False;
}
else
- aDelta = (Standard_Boolean)aDeltaValue;
+ aDelta = (aDeltaValue != 0);
}
anAtt->SetDelta(aDelta);
}
for (Standard_Integer i = aFirstInd; i <= aLastInd; i ++)
theTarget << anAtt->Value( i );
- theTarget << (Standard_Byte)anAtt->GetDelta();
+ theTarget << (Standard_Byte)(anAtt->GetDelta() ? 1 : 0);
}
if (! (Source >> aDeltaValue))
return Standard_False;
else
- aDelta = (Standard_Boolean)aDeltaValue;
+ aDelta = (aDeltaValue != 0);
}
aTagAtt->SetDelta(aDelta);
return Standard_True;
for(;anIt.More();anIt.Next())
Target << anIt.Key();
}
- Target << (Standard_Byte)anAtt->GetDelta();
+ Target << (Standard_Byte)(anAtt->GetDelta() ? 1 : 0);
}
if (! (theSource >> aDeltaValue))
return Standard_False;
else
- aDelta = (Standard_Boolean)aDeltaValue;
+ aDelta = (aDeltaValue != 0);
}
#ifdef OCCT_DEBUG
else if(BinMDataStd::DocumentVersion() == -1)
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);
}
if (! (theSource >> aDeltaValue))
return Standard_False;
else
- aDelta = (Standard_Boolean)aDeltaValue;
+ aDelta = (aDeltaValue != 0);
}
anAtt->SetDelta(aDelta);
return Standard_True;
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);
}
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;
}
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;
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;
// Standard_Integer anIntVal = (Standard_Integer) theValue;
Standard_Integer anIntVal;
GetInteger (anIntVal);
- theValue = (Standard_Boolean) anIntVal;
+ theValue = anIntVal != 0;
return *this;
}
//=======================================================================
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;
}
Standard_IStream& BinTools::GetBool(Standard_IStream& IS, Standard_Boolean& aValue)
{
- aValue = (Standard_Boolean)IS.get();
+ aValue = (IS.get() != 0);
return IS;
}
// 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>
#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>
SetVoid();
}
-//=======================================================================
-//function : SetWhole
-//purpose :
-//=======================================================================
-
-void Bnd_Box::SetWhole ()
-{
- SetWholeFlag();
-}
-
-//=======================================================================
-//function : SetVoid
-//purpose :
-//=======================================================================
-
-void Bnd_Box::SetVoid ()
-{
- SetVoidFlag();
- Gap=0.;
-}
-
//=======================================================================
//function : Set
//purpose :
const Standard_Real Y,
const Standard_Real Z)
{
- if (VoidFlag()) {
+ if (IsVoid())
+ {
Xmin = x;
Ymin = y;
Zmin = z;
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;
}
}
const Standard_Real Y,
const Standard_Real Z)
{
- if (VoidFlag()) {
+ if (IsVoid())
+ {
Xmin = X;
Ymin = Y;
Zmin = Z;
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;
}
}
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;
}
//=======================================================================
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;
}
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 :
{
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;
}
{
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;
}
{
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;
}
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];
// 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;
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;
}
}
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;
//! Creates an empty Box.
//! The constructed box is qualified Void. Its gap is null.
Standard_EXPORT Bnd_Box();
-
+
//! 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
//! to be void and then adding the point P.
//! Standard_ConstructionError exception will be thrown if the box is void.
//! if IsVoid()
Standard_EXPORT gp_Pnt CornerMax() const;
-
+
//! 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;
Standard_EXPORT Standard_Real Distance (const Bnd_Box& Other) const;
Standard_EXPORT void Dump() const;
-
- //! Computes the squared diagonal of me.
- Standard_Real SquareExtent() const;
-
+ //! Computes the squared diagonal of me.
+ 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;
Standard_Real Gap;
Standard_Integer Flags;
-
};
-
-#include <Bnd_Box.lxx>
-
-
-
-
-
#endif // _Bnd_Box_HeaderFile
+++ /dev/null
-// 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;
-}
#ifndef _Bnd_Box2d_HeaderFile
#define _Bnd_Box2d_HeaderFile
+#include <gp_Pnt2d.hxx>
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
class Standard_ConstructionError;
-class gp_Pnt2d;
class gp_Dir2d;
class gp_Trsf2d;
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:
//! - interval [ aXmin,aXmax ] in the "X Direction",
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
//! may be equal to +/- Precision::Infinite().
//! if IsVoid()
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.
//! Warning
//! 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);
-
- //! Extends <me> from the Pnt <P> in the direction <D>.
- void Add (const gp_Pnt2d& P, const gp_Dir2d& D);
+ //! Adds the 2d point.
+ void Add (const gp_Pnt2d& thePnt) { Update (thePnt.X(), thePnt.Y()); }
+
+ //! 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
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;
Standard_Real Gap;
Standard_Integer Flags;
-
};
-
-#include <Bnd_Box2d.lxx>
-
-
-
-
-
#endif // _Bnd_Box2d_HeaderFile
+++ /dev/null
-// 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;
-}
-
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
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)
#include <Geom_Plane.hxx>
#include <TColStd_ListOfReal.hxx>
#include <TColStd_SequenceOfReal.hxx>
+#include <TColStd_SequenceOfBoolean.hxx>
#include <TColStd_SequenceOfInteger.hxx>
class FilletPoint;
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);}
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_
//! 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);
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);
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
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);
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)
{
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;
}
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;
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);
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,
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;
}
}
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;
}
}
// 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;
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)
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){
}
}
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){
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){
}
}
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){
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){
}
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){
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){
}
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){
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);
//! 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
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;
// 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);
Standard_Real Alpha = nor2AB * nor2AC - ProABAC * ProABAC;
if (Alpha < Precision::Confusion()) {
- IsCoplanar = Standard_True;
+ return 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() );
-
- }
+ 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 IsCoplanar;
+ return (vecDABC.Magnitude() / Alpha) < Precision::Confusion();
}
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
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){
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){
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;
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;
//! 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;
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);
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);
//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);
}
//=======================================================================
//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);
}
//=======================================================================
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);
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);
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";
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;
}
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";
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);
cout << "Bad value = " << ival<< ". 0 or 1 is expected." << endl;
return 1;
}
- A->SetValue(i, (Standard_Boolean)ival);
+ A->SetValue(i, ival != 0);
j++;
}
}
Handle(TDataStd_BooleanArray) arr;
if (label.FindAttribute(TDataStd_BooleanArray::GetID(), arr))
{
- arr->SetValue(index, (Standard_Boolean) value);
+ arr->SetValue(index, value != 0);
return 0;
}
cout << "Bad value = " << ival<< ". 0 or 1 is expected." << endl;
return 1;
}
- A->Append((Standard_Boolean)ival);
+ A->Append (ival != 0);
}
return 0;
}
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;
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;
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))
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))
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;
}
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;
}
const TopTools_ListOfShape& ancestors = subShapeAndAncestors.FindFromIndex(i);
if (ancestors.Extent() == 1) Dangles.Bind(ancestors.First(), mayBeDangle);
}
- return Dangles.Extent();
+ return !Dangles.IsEmpty();
}
//=======================================================================
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()) {
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";
}
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);
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())
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())
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);
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()) {
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()) {
}
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);
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
Standard_PCharacter pLine;
//
pLine=(Standard_PCharacter)line;
- return Tcl_CommandComplete(pLine);
+ return Tcl_CommandComplete (pLine) != 0;
}
//=======================================================================
//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;
}
{
#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;
}
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;
}
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);
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){
}
}
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){
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");
}
//! 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;
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;
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;
}
}
HLRAlgo_Array1OfTData.hxx
HLRAlgo_BiPoint.cxx
HLRAlgo_BiPoint.hxx
-HLRAlgo_BiPoint.lxx
HLRAlgo_Coincidence.cxx
HLRAlgo_Coincidence.hxx
HLRAlgo_Coincidence.lxx
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
const Standard_Real YT2,
const Standard_Real ZT2,
const Standard_Integer Index,
- const Standard_Boolean flag)
+ const Standard_Integer flag)
{
PntX1 = X1;
PntY1 = Y1;
const Standard_Integer i1,
const Standard_Integer i1p1,
const Standard_Integer i1p2,
- const Standard_Boolean flag)
+ const Standard_Integer flag)
{
PntX1 = X1;
PntY1 = Y1;
const Standard_Integer i2,
const Standard_Integer i2p1,
const Standard_Integer i2p2,
- const Standard_Boolean flag)
+ const Standard_Integer flag)
{
PntX1 = X1;
PntY1 = Y1;
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_Boolean Rg1Line() const;
-
- void Rg1Line (const Standard_Boolean B);
-
- 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);
-
- Standard_Boolean Hidden() const;
-
- void Hidden (const Standard_Boolean B);
-
- Standard_Address Indices() const;
-
- Standard_Address Coordinates() const;
-
+ 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 { return (myIndices[9] & EMskRg1Line) != 0; }
+ void Rg1Line (const Standard_Boolean B)
+ {
+ if (B) myIndices[9] |= EMskRg1Line;
+ else myIndices[9] &= ~EMskRg1Line;
+ }
-protected:
+ Standard_Boolean RgNLine() const { return (myIndices[9] & EMskRgNLine) != 0; }
+ void RgNLine (const Standard_Boolean B)
+ {
+ if (B) myIndices[9] |= EMskRgNLine;
+ else myIndices[9] &= ~EMskRgNLine;
+ }
+ Standard_Boolean OutLine() const { return (myIndices[9] & EMskOutLine) != 0; }
+ void OutLine (const Standard_Boolean B)
+ {
+ if (B) myIndices[9] |= EMskOutLine;
+ else myIndices[9] &= ~EMskOutLine;
+ }
+ Standard_Boolean IntLine() const { return (myIndices[9] & EMskIntLine) != 0; }
-private:
+ void IntLine (const Standard_Boolean B)
+ {
+ if (B) myIndices[9] |= EMskIntLine;
+ else myIndices[9] &= ~EMskIntLine;
+ }
+ 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_Integer myIndices[10];
- Standard_Real myCoordinates[12];
-
-
-};
+ Standard_Address Indices() const { return const_cast<Standard_Integer* >(myIndices); }
+ Standard_Address Coordinates() const { return const_cast<Standard_Real* >(myCoordinates); }
-#include <HLRAlgo_BiPoint.lxx>
+protected:
+ enum EMskFlags
+ {
+ EMskRg1Line = 1,
+ EMskRgNLine = 2,
+ EMskOutLine = 4,
+ EMskIntLine = 8,
+ EMskHidden = 16
+ };
+private:
+ Standard_Integer myIndices[10];
+ Standard_Real myCoordinates[12];
+};
#endif // _HLRAlgo_BiPoint_HeaderFile
+++ /dev/null
-// 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; }
//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)
{
}
myEnd (End),
myTolStart (TolStart),
myTolEnd (TolEnd),
- myFlags (0)
+ myAllHidden (false),
+ myAllVisible(false)
{
ShowAll();
}
//! Edge is bounded by the interval <Start>, <End>
//! 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;
Standard_EXPORT void VisiblePart (const Standard_Integer Index, Standard_Real& Start, Standard_ShortReal& TolStart, Standard_Real& End, Standard_ShortReal& TolEnd) const;
//! or inside ) the boundary of the face the flag
//! <OnBoundary> is True ( or False ).
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();
-
- //! 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);
-
-
+ //! Hide the whole Edge.
+ void HideAll()
+ {
+ AllVisible(Standard_False);
+ AllHidden (Standard_True);
+ }
-protected:
+ //! Show the whole Edge.
+ 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
+++ /dev/null
-// 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;
-}
public:
-
//! Create a Block of Edges for a wire.
Standard_EXPORT HLRAlgo_EdgesBlock(const Standard_Integer NbEdges);
-
- Standard_Integer NbEdges() const;
-
- void Edge (const Standard_Integer I, const Standard_Integer EI);
-
- Standard_Integer Edge (const Standard_Integer I) const;
-
- void Orientation (const Standard_Integer I, const TopAbs_Orientation Or);
-
- TopAbs_Orientation Orientation (const Standard_Integer I) const;
-
- Standard_Boolean OutLine (const Standard_Integer I) const;
-
- void OutLine (const Standard_Integer I, const Standard_Boolean B);
-
- Standard_Boolean Internal (const Standard_Integer I) const;
-
- void Internal (const Standard_Integer I, const Standard_Boolean B);
-
- Standard_Boolean Double (const Standard_Integer I) const;
-
- void Double (const Standard_Integer I, const Standard_Boolean B);
-
- Standard_Boolean IsoLine (const Standard_Integer I) const;
-
- void IsoLine (const Standard_Integer I, const Standard_Boolean B);
-
- Standard_EXPORT void UpdateMinMax (const Standard_Address TotMinMax);
-
- Standard_Address MinMax() const;
+ Standard_Integer NbEdges() const { return myEdges.Upper(); }
+ void Edge (const Standard_Integer I, const Standard_Integer EI) { myEdges(I) = EI; }
+ Standard_Integer Edge (const Standard_Integer I) const { return myEdges(I); }
- DEFINE_STANDARD_RTTIEXT(HLRAlgo_EdgesBlock,MMgt_TShared)
+ void Orientation (const Standard_Integer I, const TopAbs_Orientation Or)
+ {
+ myFlags(I) &= ~EMaskOrient;
+ myFlags(I) |= (Or & EMaskOrient);
+ }
-protected:
+ TopAbs_Orientation Orientation (const Standard_Integer I) const
+ {
+ return ((TopAbs_Orientation)(myFlags(I) & EMaskOrient));
+ }
+ Standard_Boolean OutLine (const Standard_Integer I) const { return (myFlags(I) & EMaskOutLine) != 0; }
+ 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 { return (myFlags(I) & EMaskInternal) != 0; }
-private:
+ 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 { return (myFlags(I) & EMaskDouble) != 0; }
- TColStd_Array1OfInteger myEdges;
- TColStd_Array1OfBoolean myFlags;
- Standard_Integer myMinMax[16];
+ 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 { return (myFlags(I) & EMaskIsoLine) != 0; }
-};
+ 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 { return (Standard_Address )&myMinMax; }
+ DEFINE_STANDARD_RTTIEXT(HLRAlgo_EdgesBlock,MMgt_TShared)
-#include <HLRAlgo_EdgesBlock.lxx>
+protected:
+ enum EMskFlags
+ {
+ EMaskOrient = 15,
+ EMaskOutLine = 16,
+ EMaskInternal = 32,
+ EMaskDouble = 64,
+ EMaskIsoLine = 128
+ };
+private:
+ TColStd_Array1OfInteger myEdges;
+ TColStd_Array1OfInteger myFlags;
+ Standard_Integer myMinMax[16];
+};
#endif // _HLRAlgo_EdgesBlock_HeaderFile
+++ /dev/null
-// 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; }
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]
// 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]
#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]
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));
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);
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);
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);
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);
YV2 = P2.Y();
XV3 = P3.X();
YV3 = P3.Y();
- HideByOneTriangle(Coordinates,
- RealPtr,
- &BooleanPtr,
- PlanPtr,
- status);
+ hideByOneTriangle(Coordinates, RealPtr, isCrossing, toHideBefore, TFlag, status);
}
}
}
}
//=======================================================================
-//function : HideByOneTriangle
-//purpose :
+//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;
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
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
+++ /dev/null
-// 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);
-}
#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
DEFINE_STANDARD_ALLOC
-
- Standard_EXPORT HLRBRep_BiPnt2D();
-
- 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;
-
- const gp_Pnt2d& P2() const;
-
- const TopoDS_Shape& Shape() const;
-
- void Shape (const TopoDS_Shape& S);
-
- Standard_Boolean Rg1Line() const;
-
- void Rg1Line (const Standard_Boolean B);
-
- 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);
+ HLRBRep_BiPnt2D()
+ : myRg1Line (false),
+ myRgNLine (false),
+ myOutLine (false),
+ myIntLine (false) {}
+ 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) {}
+ const gp_Pnt2d& P1() const { return myP1; }
+ const gp_Pnt2d& P2() const { return myP2; }
-protected:
+ const TopoDS_Shape& Shape() const { return myShape; }
+ void Shape (const TopoDS_Shape& S) { myShape = S; }
+ Standard_Boolean Rg1Line() const { return myRg1Line; }
+ void Rg1Line (const Standard_Boolean B) { myRg1Line = B; }
+ Standard_Boolean RgNLine() const { return myRgNLine; }
-private:
+ 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
+++ /dev/null
-// 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;
-}
+++ /dev/null
-// 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);
-}
class TopoDS_Shape;
class gp_Pnt;
-
//! Contains the colors of a shape.
class HLRBRep_BiPoint
{
DEFINE_STANDARD_ALLOC
-
- Standard_EXPORT HLRBRep_BiPoint();
-
- 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;
-
- const gp_Pnt& P2() const;
-
- const TopoDS_Shape& Shape() const;
-
- void Shape (const TopoDS_Shape& S);
-
- Standard_Boolean Rg1Line() const;
-
- void Rg1Line (const Standard_Boolean B);
-
- 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);
+ HLRBRep_BiPoint()
+ : myRg1Line (false),
+ myRgNLine (false),
+ myOutLine (false),
+ myIntLine (false) {}
+ 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) {}
+ const gp_Pnt& P1() const { return myP1; }
+ const gp_Pnt& P2() const { return myP2; }
-protected:
+ const TopoDS_Shape& Shape() const { return myShape; }
+ void Shape (const TopoDS_Shape& S) { myShape = S; }
+ Standard_Boolean Rg1Line() const { return myRg1Line; }
+ void Rg1Line (const Standard_Boolean B) { myRg1Line = B; }
+ Standard_Boolean RgNLine() const { return myRgNLine; }
-private:
+ 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
+++ /dev/null
-// 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;
-}
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;
HLRBRep_Curve myGeometry;
Standard_ShortReal myTolerance;
-
};
-
#include <HLRBRep_EdgeData.lxx>
-
-
-
-
#endif // _HLRBRep_EdgeData_HeaderFile
// 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 :
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
// 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 :
inline void HLRBRep_FaceData::Orientation(const TopAbs_Orientation O)
{
myFlags &= ~EMaskOrient;
- myFlags |= (((Standard_Boolean)O) & EMaskOrient);
+ myFlags |= (O & EMaskOrient);
}
//=======================================================================
IMPLEMENT_STANDARD_RTTIEXT(HLRBRep_PolyAlgo,MMgt_TShared)
-#define EMskOutLin1 ((Standard_Boolean) 1)
-#define EMskOutLin2 ((Standard_Boolean) 2)
-#define EMskOutLin3 ((Standard_Boolean) 4)
-#define EMskGrALin1 ((Standard_Boolean) 8)
-#define EMskGrALin2 ((Standard_Boolean) 16)
-#define EMskGrALin3 ((Standard_Boolean) 32)
-#define FMskBack ((Standard_Boolean) 64)
-#define FMskSide ((Standard_Boolean) 128)
-#define FMskHiding ((Standard_Boolean) 256)
-#define FMskFlat ((Standard_Boolean) 512)
-#define FMskOnOutL ((Standard_Boolean)1024)
-#define FMskOrBack ((Standard_Boolean)2048)
-#define FMskFrBack ((Standard_Boolean)4096)
-
-#define NMskVert ((Standard_Boolean) 1)
-#define NMskOutL ((Standard_Boolean) 2)
-#define NMskNorm ((Standard_Boolean) 4)
-#define NMskFuck ((Standard_Boolean) 8)
-#define NMskEdge ((Standard_Boolean)16)
-#define NMskMove ((Standard_Boolean)32)
+#define EMskOutLin1 ((Standard_Integer) 1)
+#define EMskOutLin2 ((Standard_Integer) 2)
+#define EMskOutLin3 ((Standard_Integer) 4)
+#define EMskGrALin1 ((Standard_Integer) 8)
+#define EMskGrALin2 ((Standard_Integer) 16)
+#define EMskGrALin3 ((Standard_Integer) 32)
+#define FMskBack ((Standard_Integer) 64)
+#define FMskSide ((Standard_Integer) 128)
+#define FMskHiding ((Standard_Integer) 256)
+#define FMskFlat ((Standard_Integer) 512)
+#define FMskOnOutL ((Standard_Integer)1024)
+#define FMskOrBack ((Standard_Integer)2048)
+#define FMskFrBack ((Standard_Integer)4096)
+
+#define NMskVert ((Standard_Integer) 1)
+#define NMskOutL ((Standard_Integer) 2)
+#define NMskNorm ((Standard_Integer) 4)
+#define NMskFuck ((Standard_Integer) 8)
+#define NMskEdge ((Standard_Integer)16)
+#define NMskMove ((Standard_Integer)32)
#define PntXTI1 ((Standard_Real*)Coordinates)[ 0]
#define PntYTI1 ((Standard_Real*)Coordinates)[ 1]
#define Tri1Node1 ((Standard_Integer*)Tri1Indices)[0]
#define Tri1Node2 ((Standard_Integer*)Tri1Indices)[1]
#define Tri1Node3 ((Standard_Integer*)Tri1Indices)[2]
-#define Tri1Flags ((Standard_Boolean*)Tri1Indices)[3]
+#define Tri1Flags ((Standard_Integer*)Tri1Indices)[3]
#define Tri2Node1 ((Standard_Integer*)Tri2Indices)[0]
#define Tri2Node2 ((Standard_Integer*)Tri2Indices)[1]
#define Tri2Node3 ((Standard_Integer*)Tri2Indices)[2]
-#define Tri2Flags ((Standard_Boolean*)Tri2Indices)[3]
+#define Tri2Flags ((Standard_Integer*)Tri2Indices)[3]
#define Tri3Node1 ((Standard_Integer*)Tri3Indices)[0]
#define Tri3Node2 ((Standard_Integer*)Tri3Indices)[1]
#define Tri3Node3 ((Standard_Integer*)Tri3Indices)[2]
-#define Tri3Flags ((Standard_Boolean*)Tri3Indices)[3]
+#define Tri3Flags ((Standard_Integer*)Tri3Indices)[3]
#define Seg1LstSg1 ((Standard_Integer*)Seg1Indices)[0]
#define Seg1LstSg2 ((Standard_Integer*)Seg1Indices)[1]
#define Seg2Conex2 ((Standard_Integer*)Seg2Indices)[5]
#define Nod1NdSg ((Standard_Integer*)Nod1Indices)[0]
-#define Nod1Flag ((Standard_Boolean*)Nod1Indices)[1]
-#define Nod1Edg1 ((Standard_Boolean*)Nod1Indices)[2]
-#define Nod1Edg2 ((Standard_Boolean*)Nod1Indices)[3]
+#define Nod1Flag ((Standard_Integer*)Nod1Indices)[1]
+#define Nod1Edg1 ((Standard_Integer*)Nod1Indices)[2]
+#define Nod1Edg2 ((Standard_Integer*)Nod1Indices)[3]
#define Nod1PntX ((Standard_Real*)Nod1RValues)[ 0]
#define Nod1PntY ((Standard_Real*)Nod1RValues)[ 1]
#define Nod1Scal ((Standard_Real*)Nod1RValues)[10]
#define NodANdSg ((Standard_Integer*)NodAIndices)[0]
-#define NodAFlag ((Standard_Boolean*)NodAIndices)[1]
-#define NodAEdg1 ((Standard_Boolean*)NodAIndices)[2]
-#define NodAEdg2 ((Standard_Boolean*)NodAIndices)[3]
+#define NodAFlag ((Standard_Integer*)NodAIndices)[1]
+#define NodAEdg1 ((Standard_Integer*)NodAIndices)[2]
+#define NodAEdg2 ((Standard_Integer*)NodAIndices)[3]
#define NodAPntX ((Standard_Real*)NodARValues)[ 0]
#define NodAPntY ((Standard_Real*)NodARValues)[ 1]
#define NodAScal ((Standard_Real*)NodARValues)[10]
#define NodBNdSg ((Standard_Integer*)NodBIndices)[0]
-#define NodBFlag ((Standard_Boolean*)NodBIndices)[1]
-#define NodBEdg1 ((Standard_Boolean*)NodBIndices)[2]
-#define NodBEdg2 ((Standard_Boolean*)NodBIndices)[3]
+#define NodBFlag ((Standard_Integer*)NodBIndices)[1]
+#define NodBEdg1 ((Standard_Integer*)NodBIndices)[2]
+#define NodBEdg2 ((Standard_Integer*)NodBIndices)[3]
#define NodBPntX ((Standard_Real*)NodBRValues)[ 0]
#define NodBPntY ((Standard_Real*)NodBRValues)[ 1]
#define NodBScal ((Standard_Real*)NodBRValues)[10]
#define Nod2NdSg ((Standard_Integer*)Nod2Indices)[0]
-#define Nod2Flag ((Standard_Boolean*)Nod2Indices)[1]
-#define Nod2Edg1 ((Standard_Boolean*)Nod2Indices)[2]
-#define Nod2Edg2 ((Standard_Boolean*)Nod2Indices)[3]
+#define Nod2Flag ((Standard_Integer*)Nod2Indices)[1]
+#define Nod2Edg1 ((Standard_Integer*)Nod2Indices)[2]
+#define Nod2Edg2 ((Standard_Integer*)Nod2Indices)[3]
#define Nod2PntX ((Standard_Real*)Nod2RValues)[ 0]
#define Nod2PntY ((Standard_Real*)Nod2RValues)[ 1]
#define Nod2Scal ((Standard_Real*)Nod2RValues)[10]
#define Nod3NdSg ((Standard_Integer*)Nod3Indices)[0]
-#define Nod3Flag ((Standard_Boolean*)Nod3Indices)[1]
-#define Nod3Edg1 ((Standard_Boolean*)Nod3Indices)[2]
-#define Nod3Edg2 ((Standard_Boolean*)Nod3Indices)[3]
+#define Nod3Flag ((Standard_Integer*)Nod3Indices)[1]
+#define Nod3Edg1 ((Standard_Integer*)Nod3Indices)[2]
+#define Nod3Edg2 ((Standard_Integer*)Nod3Indices)[3]
#define Nod3PntX ((Standard_Real*)Nod3RValues)[ 0]
#define Nod3PntY ((Standard_Real*)Nod3RValues)[ 1]
#define Nod3Scal ((Standard_Real*)Nod3RValues)[10]
#define Nod4NdSg ((Standard_Integer*)Nod4Indices)[0]
-#define Nod4Flag ((Standard_Boolean*)Nod4Indices)[1]
-#define Nod4Edg1 ((Standard_Boolean*)Nod4Indices)[2]
-#define Nod4Edg2 ((Standard_Boolean*)Nod4Indices)[3]
+#define Nod4Flag ((Standard_Integer*)Nod4Indices)[1]
+#define Nod4Edg1 ((Standard_Integer*)Nod4Indices)[2]
+#define Nod4Edg2 ((Standard_Integer*)Nod4Indices)[3]
#define Nod4PntX ((Standard_Real*)Nod4RValues)[ 0]
#define Nod4PntY ((Standard_Real*)Nod4RValues)[ 1]
#define Nod4Scal ((Standard_Real*)Nod4RValues)[10]
#define Nod11NdSg ((Standard_Integer*)Nod11Indices)[0]
-#define Nod11Flag ((Standard_Boolean*)Nod11Indices)[1]
-#define Nod11Edg1 ((Standard_Boolean*)Nod11Indices)[2]
-#define Nod11Edg2 ((Standard_Boolean*)Nod11Indices)[3]
+#define Nod11Flag ((Standard_Integer*)Nod11Indices)[1]
+#define Nod11Edg1 ((Standard_Integer*)Nod11Indices)[2]
+#define Nod11Edg2 ((Standard_Integer*)Nod11Indices)[3]
#define Nod11PntX ((Standard_Real*)Nod11RValues)[ 0]
#define Nod11PntY ((Standard_Real*)Nod11RValues)[ 1]
#define Nod11Scal ((Standard_Real*)Nod11RValues)[10]
#define Nod1ANdSg ((Standard_Integer*)Nod1AIndices)[0]
-#define Nod1AFlag ((Standard_Boolean*)Nod1AIndices)[1]
-#define Nod1AEdg1 ((Standard_Boolean*)Nod1AIndices)[2]
-#define Nod1AEdg2 ((Standard_Boolean*)Nod1AIndices)[3]
+#define Nod1AFlag ((Standard_Integer*)Nod1AIndices)[1]
+#define Nod1AEdg1 ((Standard_Integer*)Nod1AIndices)[2]
+#define Nod1AEdg2 ((Standard_Integer*)Nod1AIndices)[3]
#define Nod1APntX ((Standard_Real*)Nod1ARValues)[ 0]
#define Nod1APntY ((Standard_Real*)Nod1ARValues)[ 1]
#define Nod1AScal ((Standard_Real*)Nod1ARValues)[10]
#define Nod1BNdSg ((Standard_Integer*)Nod1BIndices)[0]
-#define Nod1BFlag ((Standard_Boolean*)Nod1BIndices)[1]
-#define Nod1BEdg1 ((Standard_Boolean*)Nod1BIndices)[2]
-#define Nod1BEdg2 ((Standard_Boolean*)Nod1BIndices)[3]
+#define Nod1BFlag ((Standard_Integer*)Nod1BIndices)[1]
+#define Nod1BEdg1 ((Standard_Integer*)Nod1BIndices)[2]
+#define Nod1BEdg2 ((Standard_Integer*)Nod1BIndices)[3]
#define Nod1BPntX ((Standard_Real*)Nod1BRValues)[ 0]
#define Nod1BPntY ((Standard_Real*)Nod1BRValues)[ 1]
#define Nod1BScal ((Standard_Real*)Nod1BRValues)[10]
#define Nod12NdSg ((Standard_Integer*)Nod12Indices)[0]
-#define Nod12Flag ((Standard_Boolean*)Nod12Indices)[1]
-#define Nod12Edg1 ((Standard_Boolean*)Nod12Indices)[2]
-#define Nod12Edg2 ((Standard_Boolean*)Nod12Indices)[3]
+#define Nod12Flag ((Standard_Integer*)Nod12Indices)[1]
+#define Nod12Edg1 ((Standard_Integer*)Nod12Indices)[2]
+#define Nod12Edg2 ((Standard_Integer*)Nod12Indices)[3]
#define Nod12PntX ((Standard_Real*)Nod12RValues)[ 0]
#define Nod12PntY ((Standard_Real*)Nod12RValues)[ 1]
#define Nod12Scal ((Standard_Real*)Nod12RValues)[10]
#define Nod13NdSg ((Standard_Integer*)Nod13Indices)[0]
-#define Nod13Flag ((Standard_Boolean*)Nod13Indices)[1]
-#define Nod13Edg1 ((Standard_Boolean*)Nod13Indices)[2]
-#define Nod13Edg2 ((Standard_Boolean*)Nod13Indices)[3]
+#define Nod13Flag ((Standard_Integer*)Nod13Indices)[1]
+#define Nod13Edg1 ((Standard_Integer*)Nod13Indices)[2]
+#define Nod13Edg2 ((Standard_Integer*)Nod13Indices)[3]
#define Nod13PntX ((Standard_Real*)Nod13RValues)[ 0]
#define Nod13PntY ((Standard_Real*)Nod13RValues)[ 1]
#define Nod13Scal ((Standard_Real*)Nod13RValues)[10]
#define Nod14NdSg ((Standard_Integer*)Nod14Indices)[0]
-#define Nod14Flag ((Standard_Boolean*)Nod14Indices)[1]
-#define Nod14Edg1 ((Standard_Boolean*)Nod14Indices)[2]
-#define Nod14Edg2 ((Standard_Boolean*)Nod14Indices)[3]
+#define Nod14Flag ((Standard_Integer*)Nod14Indices)[1]
+#define Nod14Edg1 ((Standard_Integer*)Nod14Indices)[2]
+#define Nod14Edg2 ((Standard_Integer*)Nod14Indices)[3]
#define Nod14PntX ((Standard_Real*)Nod14RValues)[ 0]
#define Nod14PntY ((Standard_Real*)Nod14RValues)[ 1]
#define Nod14Scal ((Standard_Real*)Nod14RValues)[10]
#define Nod21NdSg ((Standard_Integer*)Nod21Indices)[0]
-#define Nod21Flag ((Standard_Boolean*)Nod21Indices)[1]
-#define Nod21Edg1 ((Standard_Boolean*)Nod21Indices)[2]
-#define Nod21Edg2 ((Standard_Boolean*)Nod21Indices)[3]
+#define Nod21Flag ((Standard_Integer*)Nod21Indices)[1]
+#define Nod21Edg1 ((Standard_Integer*)Nod21Indices)[2]
+#define Nod21Edg2 ((Standard_Integer*)Nod21Indices)[3]
#define Nod21PntX ((Standard_Real*)Nod21RValues)[ 0]
#define Nod21PntY ((Standard_Real*)Nod21RValues)[ 1]
#define Nod21Scal ((Standard_Real*)Nod21RValues)[10]
#define Nod2ANdSg ((Standard_Integer*)Nod2AIndices)[0]
-#define Nod2AFlag ((Standard_Boolean*)Nod2AIndices)[1]
-#define Nod2AEdg1 ((Standard_Boolean*)Nod2AIndices)[2]
-#define Nod2AEdg2 ((Standard_Boolean*)Nod2AIndices)[3]
+#define Nod2AFlag ((Standard_Integer*)Nod2AIndices)[1]
+#define Nod2AEdg1 ((Standard_Integer*)Nod2AIndices)[2]
+#define Nod2AEdg2 ((Standard_Integer*)Nod2AIndices)[3]
#define Nod2APntX ((Standard_Real*)Nod2ARValues)[ 0]
#define Nod2APntY ((Standard_Real*)Nod2ARValues)[ 1]
#define Nod2AScal ((Standard_Real*)Nod2ARValues)[10]
#define Nod2BNdSg ((Standard_Integer*)Nod2BIndices)[0]
-#define Nod2BFlag ((Standard_Boolean*)Nod2BIndices)[1]
-#define Nod2BEdg1 ((Standard_Boolean*)Nod2BIndices)[2]
-#define Nod2BEdg2 ((Standard_Boolean*)Nod2BIndices)[3]
+#define Nod2BFlag ((Standard_Integer*)Nod2BIndices)[1]
+#define Nod2BEdg1 ((Standard_Integer*)Nod2BIndices)[2]
+#define Nod2BEdg2 ((Standard_Integer*)Nod2BIndices)[3]
#define Nod2BPntX ((Standard_Real*)Nod2BRValues)[ 0]
#define Nod2BPntY ((Standard_Real*)Nod2BRValues)[ 1]
#define Nod2BScal ((Standard_Real*)Nod2BRValues)[10]
#define Nod22NdSg ((Standard_Integer*)Nod22Indices)[0]
-#define Nod22Flag ((Standard_Boolean*)Nod22Indices)[1]
-#define Nod22Edg1 ((Standard_Boolean*)Nod22Indices)[2]
-#define Nod22Edg2 ((Standard_Boolean*)Nod22Indices)[3]
+#define Nod22Flag ((Standard_Integer*)Nod22Indices)[1]
+#define Nod22Edg1 ((Standard_Integer*)Nod22Indices)[2]
+#define Nod22Edg2 ((Standard_Integer*)Nod22Indices)[3]
#define Nod22PntX ((Standard_Real*)Nod22RValues)[ 0]
#define Nod22PntY ((Standard_Real*)Nod22RValues)[ 1]
#define Nod22Scal ((Standard_Real*)Nod22RValues)[10]
#define Nod23NdSg ((Standard_Integer*)Nod23Indices)[0]
-#define Nod23Flag ((Standard_Boolean*)Nod23Indices)[1]
-#define Nod23Edg1 ((Standard_Boolean*)Nod23Indices)[2]
-#define Nod23Edg2 ((Standard_Boolean*)Nod23Indices)[3]
+#define Nod23Flag ((Standard_Integer*)Nod23Indices)[1]
+#define Nod23Edg1 ((Standard_Integer*)Nod23Indices)[2]
+#define Nod23Edg2 ((Standard_Integer*)Nod23Indices)[3]
#define Nod23PntX ((Standard_Real*)Nod23RValues)[ 0]
#define Nod23PntY ((Standard_Real*)Nod23RValues)[ 1]
#define Nod23Scal ((Standard_Real*)Nod23RValues)[10]
#define Nod24NdSg ((Standard_Integer*)Nod24Indices)[0]
-#define Nod24Flag ((Standard_Boolean*)Nod24Indices)[1]
-#define Nod24Edg1 ((Standard_Boolean*)Nod24Indices)[2]
-#define Nod24Edg2 ((Standard_Boolean*)Nod24Indices)[3]
+#define Nod24Flag ((Standard_Integer*)Nod24Indices)[1]
+#define Nod24Edg1 ((Standard_Integer*)Nod24Indices)[2]
+#define Nod24Edg2 ((Standard_Integer*)Nod24Indices)[3]
#define Nod24PntX ((Standard_Real*)Nod24RValues)[ 0]
#define Nod24PntY ((Standard_Real*)Nod24RValues)[ 1]
&(((HLRAlgo_Array1OfPINod*)PINod1)->ChangeValue(Pol1(iPol)));
Standard_Address Nod1AIndices = (*pi1pA)->Indices();
Standard_Address Nod1ARValues = (*pi1pA)->RValues();
- if (Nod1AEdg1 == 0 || Nod1AEdg1 == (Standard_Boolean) e) {
+ if (Nod1AEdg1 == 0 || Nod1AEdg1 == e) {
Nod1AEdg1 = e;
Nod1APCu1 = par->Value(iPol);
}
XTI2 = X2 = Nod12PntX;
YTI2 = Y2 = Nod12PntY;
ZTI2 = Z2 = Nod12PntZ;
- if (Nod12Edg1 == (Standard_Boolean) e) U2 = Nod12PCu1;
- else if (Nod12Edg2 == (Standard_Boolean) e) U2 = Nod12PCu2;
+ if (Nod12Edg1 == e) U2 = Nod12PCu1;
+ else if (Nod12Edg2 == e) U2 = Nod12PCu2;
#ifdef OCCT_DEBUG
else {
cout << " HLRBRep_PolyAlgo::InitBiPointsWithConnexity : ";
XTI2 = X2 = Nod12PntX;
YTI2 = Y2 = Nod12PntY;
ZTI2 = Z2 = Nod12PntZ;
- if (Nod12Edg1 == (Standard_Boolean) e) U2 = Nod12PCu1;
- else if (Nod12Edg2 == (Standard_Boolean) e) U2 = Nod12PCu2;
+ if (Nod12Edg1 == e) U2 = Nod12PCu1;
+ else if (Nod12Edg2 == e) U2 = Nod12PCu2;
#ifdef OCCT_DEBUG
else {
cout << " HLRBRep_PolyAlgo::InitBiPointsWithConnexity : ";
Standard_Address Nod2AIndices = (*pi2pA)->Indices();
Standard_Address Nod2ARValues = (*pi2pA)->RValues();
Standard_Real PCu = par->Value(iPol);
- if (Nod1AEdg1 == 0 || Nod1AEdg1 == (Standard_Boolean) e) {
+ if (Nod1AEdg1 == 0 || Nod1AEdg1 == e) {
Nod1AEdg1 = e;
Nod1APCu1 = PCu;
}
Nod1AEdg2 = e;
Nod1APCu2 = PCu;
}
- if (Nod2AEdg1 == 0 || Nod2AEdg1 == (Standard_Boolean) e) {
+ if (Nod2AEdg1 == 0 || Nod2AEdg1 == e) {
Nod2AEdg1 = e;
Nod2APCu1 = PCu;
}
XTI2 = X2 = Nod12PntX;
YTI2 = Y2 = Nod12PntY;
ZTI2 = Z2 = Nod12PntZ;
- if (Nod12Edg1 == (Standard_Boolean) e) U2 = Nod12PCu1;
- else if (Nod12Edg2 == (Standard_Boolean) e) U2 = Nod12PCu2;
+ if (Nod12Edg1 == e) U2 = Nod12PCu1;
+ else if (Nod12Edg2 == e) U2 = Nod12PCu2;
#ifdef OCCT_DEBUG
else {
cout << " HLRBRep_PolyAlgo::InitBiPointsWithConnexity : ";
XTI2 = X2 = Nod12PntX;
YTI2 = Y2 = Nod12PntY;
ZTI2 = Z2 = Nod12PntZ;
- if (Nod12Edg1 == (Standard_Boolean) e) U2 = Nod12PCu1;
- else if (Nod12Edg2 == (Standard_Boolean) e) U2 = Nod12PCu2;
+ if (Nod12Edg1 == e) U2 = Nod12PCu1;
+ else if (Nod12Edg2 == e) U2 = Nod12PCu2;
#ifdef OCCT_DEBUG
else {
cout << " HLRBRep_PolyAlgo::InitBiPointsWithConnexity : ";
Standard_Real X3,Y3,Z3,XTI3,YTI3,ZTI3,coef3,U3;
Standard_Real X4,Y4,Z4,XTI4,YTI4,ZTI4,coef4,U4;
// gp_Pnt P3,PT3,P4,PT4;
- Standard_Boolean flag = 0;
+ Standard_Integer flag = 0;
if (rg >= GeomAbs_G1) flag += 1;
if (rg >= GeomAbs_G2) flag += 2;
insP3 = Interpolation(U1,U2,Nod11RValues,Nod12RValues,
const Standard_Real U3,
const Standard_Boolean insP3,
const Standard_Boolean mP3P1,
- const Standard_Boolean flag) const
+ const Standard_Integer flag) const
{
Standard_Address TData2 = 0;
Standard_Address PISeg2 = 0;
Nod11PntX = X3;
Nod11PntY = Y3;
Nod11PntZ = Z3;
- if (Nod11Edg1 == (Standard_Boolean) e) Nod11PCu1 = U3;
- else if (Nod11Edg2 == (Standard_Boolean) e) Nod11PCu2 = U3;
+ if (Nod11Edg1 == e) Nod11PCu1 = U3;
+ else if (Nod11Edg2 == e) Nod11PCu2 = U3;
#ifdef OCCT_DEBUG
else {
cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
Nod12PntX = X3;
Nod12PntY = Y3;
Nod12PntZ = Z3;
- if (Nod12Edg1 == (Standard_Boolean) e) Nod12PCu1 = U3;
- else if (Nod12Edg2 == (Standard_Boolean) e) Nod12PCu2 = U3;
+ if (Nod12Edg1 == e) Nod12PCu1 = U3;
+ else if (Nod12Edg2 == e) Nod12PCu2 = U3;
#ifdef OCCT_DEBUG
else {
cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
const Standard_Real U3,
const Standard_Boolean insP3,
const Standard_Boolean mP3P1,
- const Standard_Boolean flag) const
+ const Standard_Integer flag) const
{
Standard_Boolean ins3 = insP3;
if (ins3 && mP3P1) { // P1 ---> P3
Nod11PntX = X3;
Nod11PntY = Y3;
Nod11PntZ = Z3;
- if (Nod11Edg1 == (Standard_Boolean) e) Nod11PCu1 = U3;
- else if (Nod11Edg2 == (Standard_Boolean) e) Nod11PCu2 = U3;
+ if (Nod11Edg1 == e) Nod11PCu1 = U3;
+ else if (Nod11Edg2 == e) Nod11PCu2 = U3;
#ifdef OCCT_DEBUG
else {
cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
Nod21PntX = X3;
Nod21PntY = Y3;
Nod21PntZ = Z3;
- if (Nod21Edg1 == (Standard_Boolean) e) Nod21PCu1 = U3;
- else if (Nod21Edg2 == (Standard_Boolean) e) Nod21PCu2 = U3;
+ if (Nod21Edg1 == e) Nod21PCu1 = U3;
+ else if (Nod21Edg2 == e) Nod21PCu2 = U3;
#ifdef OCCT_DEBUG
else {
cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
Nod12PntX = X3;
Nod12PntY = Y3;
Nod12PntZ = Z3;
- if (Nod12Edg1 == (Standard_Boolean) e) Nod12PCu1 = U3;
- else if (Nod12Edg2 == (Standard_Boolean) e) Nod12PCu2 = U3;
+ if (Nod12Edg1 == e) Nod12PCu1 = U3;
+ else if (Nod12Edg2 == e) Nod12PCu2 = U3;
#ifdef OCCT_DEBUG
else {
cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
Nod22PntX = X3;
Nod22PntY = Y3;
Nod22PntZ = Z3;
- if (Nod22Edg1 == (Standard_Boolean) e) Nod22PCu1 = U3;
- else if (Nod22Edg2 == (Standard_Boolean) e) Nod22PCu2 = U3;
+ if (Nod22Edg1 == e) Nod22PCu1 = U3;
+ else if (Nod22Edg2 == e) Nod22PCu2 = U3;
#ifdef OCCT_DEBUG
else {
cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
const Standard_Real U4,
const Standard_Boolean insP4,
const Standard_Boolean mP4P1,
- const Standard_Boolean flag) const
+ const Standard_Integer flag) const
{
Standard_Boolean ins3 = insP3;
Standard_Boolean ins4 = insP4;
Nod11PntX = X3;
Nod11PntY = Y3;
Nod11PntZ = Z3;
- if (Nod11Edg1 == (Standard_Boolean) e) Nod11PCu1 = U3;
- else if (Nod11Edg2 == (Standard_Boolean) e) Nod11PCu2 = U3;
+ if (Nod11Edg1 == e) Nod11PCu1 = U3;
+ else if (Nod11Edg2 == e) Nod11PCu2 = U3;
#ifdef OCCT_DEBUG
else {
cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
Nod21PntX = X3;
Nod21PntY = Y3;
Nod21PntZ = Z3;
- if (Nod21Edg1 == (Standard_Boolean) e) Nod21PCu1 = U3;
- else if (Nod21Edg2 == (Standard_Boolean) e) Nod21PCu2 = U3;
+ if (Nod21Edg1 == e) Nod21PCu1 = U3;
+ else if (Nod21Edg2 == e) Nod21PCu2 = U3;
#ifdef OCCT_DEBUG
else {
cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
Nod12PntX = X4;
Nod12PntY = Y4;
Nod12PntZ = Z4;
- if (Nod12Edg1 == (Standard_Boolean) e) Nod12PCu1 = U4;
- else if (Nod12Edg2 == (Standard_Boolean) e) Nod12PCu2 = U4;
+ if (Nod12Edg1 == e) Nod12PCu1 = U4;
+ else if (Nod12Edg2 == e) Nod12PCu2 = U4;
#ifdef OCCT_DEBUG
else {
cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
Nod22PntX = X4;
Nod22PntY = Y4;
Nod22PntZ = Z4;
- if (Nod22Edg1 == (Standard_Boolean) e) Nod22PCu1 = U4;
- else if (Nod22Edg2 == (Standard_Boolean) e) Nod22PCu2 = U4;
+ if (Nod22Edg1 == e) Nod22PCu1 = U4;
+ else if (Nod22Edg2 == e) Nod22PCu2 = U4;
#ifdef OCCT_DEBUG
else {
cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
const Standard_Address Nod3Indices,
const Standard_Address Nod3RValues) const
{
- Standard_Boolean o1 = Nod1Flag & NMskOutL;
- Standard_Boolean o2 = Nod2Flag & NMskOutL;
- Standard_Boolean o3 = Nod3Flag & NMskOutL;
+ Standard_Boolean o1 = (Nod1Flag & NMskOutL) != 0;
+ Standard_Boolean o2 = (Nod2Flag & NMskOutL) != 0;
+ Standard_Boolean o3 = (Nod3Flag & NMskOutL) != 0;
Tri1Flags &= ~FMskFlat;
Tri1Flags &= ~FMskOnOutL;
if (o1 && o2 && o3) {
Standard_EXPORT Standard_Boolean Interpolation (const Standard_Real U1, const Standard_Real U2, const Standard_Address Nod1RValues, const Standard_Address Nod2RValues, Standard_Real& X3, Standard_Real& Y3, Standard_Real& Z3, Standard_Real& XT3, Standard_Real& YT3, Standard_Real& ZT3, Standard_Real& coef3, Standard_Real& U3, Standard_Boolean& mP3P1) const;
- Standard_EXPORT void MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List, Standard_Real& X1, Standard_Real& Y1, Standard_Real& Z1, Standard_Real& X2, Standard_Real& Y2, Standard_Real& Z2, Standard_Real& XTI1, Standard_Real& YTI1, Standard_Real& ZTI1, Standard_Real& XTI2, Standard_Real& YTI2, Standard_Real& ZTI2, const Standard_Integer e, Standard_Real& U1, Standard_Real& U2, Standard_Address& Nod11Indices, Standard_Address& Nod11RValues, Standard_Address& Nod12Indices, Standard_Address& Nod12RValues, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Integer i1, const Handle(HLRAlgo_PolyInternalData)& pid1, Standard_Address& TData1, Standard_Address& PISeg1, Standard_Address& PINod1, const Standard_Real X3, const Standard_Real Y3, const Standard_Real Z3, const Standard_Real XT3, const Standard_Real YT3, const Standard_Real ZT3, const Standard_Real coef3, const Standard_Real U3, const Standard_Boolean insP3, const Standard_Boolean mP3P1, const Standard_Boolean flag) const;
+ Standard_EXPORT void MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List, Standard_Real& X1, Standard_Real& Y1, Standard_Real& Z1, Standard_Real& X2, Standard_Real& Y2, Standard_Real& Z2, Standard_Real& XTI1, Standard_Real& YTI1, Standard_Real& ZTI1, Standard_Real& XTI2, Standard_Real& YTI2, Standard_Real& ZTI2, const Standard_Integer e, Standard_Real& U1, Standard_Real& U2, Standard_Address& Nod11Indices, Standard_Address& Nod11RValues, Standard_Address& Nod12Indices, Standard_Address& Nod12RValues, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Integer i1, const Handle(HLRAlgo_PolyInternalData)& pid1, Standard_Address& TData1, Standard_Address& PISeg1, Standard_Address& PINod1, const Standard_Real X3, const Standard_Real Y3, const Standard_Real Z3, const Standard_Real XT3, const Standard_Real YT3, const Standard_Real ZT3, const Standard_Real coef3, const Standard_Real U3, const Standard_Boolean insP3, const Standard_Boolean mP3P1, const Standard_Integer flag) const;
- Standard_EXPORT void MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List, Standard_Real& X1, Standard_Real& Y1, Standard_Real& Z1, Standard_Real& X2, Standard_Real& Y2, Standard_Real& Z2, Standard_Real& XTI1, Standard_Real& YTI1, Standard_Real& ZTI1, Standard_Real& XTI2, Standard_Real& YTI2, Standard_Real& ZTI2, const Standard_Integer e, Standard_Real& U1, Standard_Real& U2, Standard_Address& Nod11Indices, Standard_Address& Nod11RValues, Standard_Address& Nod12Indices, Standard_Address& Nod12RValues, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Integer i1, const Handle(HLRAlgo_PolyInternalData)& pid1, Standard_Address& TData1, Standard_Address& PISeg1, Standard_Address& PINod1, Standard_Address& Nod21Indices, Standard_Address& Nod21RValues, Standard_Address& Nod22Indices, Standard_Address& Nod22RValues, const Standard_Integer i2p1, const Standard_Integer i2p2, const Standard_Integer i2, const Handle(HLRAlgo_PolyInternalData)& pid2, Standard_Address& TData2, Standard_Address& PISeg2, Standard_Address& PINod2, const Standard_Real X3, const Standard_Real Y3, const Standard_Real Z3, const Standard_Real XT3, const Standard_Real YT3, const Standard_Real ZT3, const Standard_Real coef3, const Standard_Real U3, const Standard_Boolean insP3, const Standard_Boolean mP3P1, const Standard_Boolean flag) const;
+ Standard_EXPORT void MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List, Standard_Real& X1, Standard_Real& Y1, Standard_Real& Z1, Standard_Real& X2, Standard_Real& Y2, Standard_Real& Z2, Standard_Real& XTI1, Standard_Real& YTI1, Standard_Real& ZTI1, Standard_Real& XTI2, Standard_Real& YTI2, Standard_Real& ZTI2, const Standard_Integer e, Standard_Real& U1, Standard_Real& U2, Standard_Address& Nod11Indices, Standard_Address& Nod11RValues, Standard_Address& Nod12Indices, Standard_Address& Nod12RValues, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Integer i1, const Handle(HLRAlgo_PolyInternalData)& pid1, Standard_Address& TData1, Standard_Address& PISeg1, Standard_Address& PINod1, Standard_Address& Nod21Indices, Standard_Address& Nod21RValues, Standard_Address& Nod22Indices, Standard_Address& Nod22RValues, const Standard_Integer i2p1, const Standard_Integer i2p2, const Standard_Integer i2, const Handle(HLRAlgo_PolyInternalData)& pid2, Standard_Address& TData2, Standard_Address& PISeg2, Standard_Address& PINod2, const Standard_Real X3, const Standard_Real Y3, const Standard_Real Z3, const Standard_Real XT3, const Standard_Real YT3, const Standard_Real ZT3, const Standard_Real coef3, const Standard_Real U3, const Standard_Boolean insP3, const Standard_Boolean mP3P1, const Standard_Integer flag) const;
- Standard_EXPORT void MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List, Standard_Real& X1, Standard_Real& Y1, Standard_Real& Z1, Standard_Real& X2, Standard_Real& Y2, Standard_Real& Z2, Standard_Real& XTI1, Standard_Real& YTI1, Standard_Real& ZTI1, Standard_Real& XTI2, Standard_Real& YTI2, Standard_Real& ZTI2, const Standard_Integer e, Standard_Real& U1, Standard_Real& U2, Standard_Address& Nod11Indices, Standard_Address& Nod11RValues, Standard_Address& Nod12Indices, Standard_Address& Nod12RValues, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Integer i1, const Handle(HLRAlgo_PolyInternalData)& pid1, Standard_Address& TData1, Standard_Address& PISeg1, Standard_Address& PINod1, Standard_Address& Nod21Indices, Standard_Address& Nod21RValues, Standard_Address& Nod22Indices, Standard_Address& Nod22RValues, const Standard_Integer i2p1, const Standard_Integer i2p2, const Standard_Integer i2, const Handle(HLRAlgo_PolyInternalData)& pid2, Standard_Address& TData2, Standard_Address& PISeg2, Standard_Address& PINod2, const Standard_Real X3, const Standard_Real Y3, const Standard_Real Z3, const Standard_Real XT3, const Standard_Real YT3, const Standard_Real ZT3, const Standard_Real coef3, const Standard_Real U3, const Standard_Boolean insP3, const Standard_Boolean mP3P1, const Standard_Real X4, const Standard_Real Y4, const Standard_Real Z4, const Standard_Real XT4, const Standard_Real YT4, const Standard_Real ZT4, const Standard_Real coef4, const Standard_Real U4, const Standard_Boolean insP4, const Standard_Boolean mP4P1, const Standard_Boolean flag) const;
+ Standard_EXPORT void MoveOrInsertPoint (HLRAlgo_ListOfBPoint& List, Standard_Real& X1, Standard_Real& Y1, Standard_Real& Z1, Standard_Real& X2, Standard_Real& Y2, Standard_Real& Z2, Standard_Real& XTI1, Standard_Real& YTI1, Standard_Real& ZTI1, Standard_Real& XTI2, Standard_Real& YTI2, Standard_Real& ZTI2, const Standard_Integer e, Standard_Real& U1, Standard_Real& U2, Standard_Address& Nod11Indices, Standard_Address& Nod11RValues, Standard_Address& Nod12Indices, Standard_Address& Nod12RValues, const Standard_Integer i1p1, const Standard_Integer i1p2, const Standard_Integer i1, const Handle(HLRAlgo_PolyInternalData)& pid1, Standard_Address& TData1, Standard_Address& PISeg1, Standard_Address& PINod1, Standard_Address& Nod21Indices, Standard_Address& Nod21RValues, Standard_Address& Nod22Indices, Standard_Address& Nod22RValues, const Standard_Integer i2p1, const Standard_Integer i2p2, const Standard_Integer i2, const Handle(HLRAlgo_PolyInternalData)& pid2, Standard_Address& TData2, Standard_Address& PISeg2, Standard_Address& PINod2, const Standard_Real X3, const Standard_Real Y3, const Standard_Real Z3, const Standard_Real XT3, const Standard_Real YT3, const Standard_Real ZT3, const Standard_Real coef3, const Standard_Real U3, const Standard_Boolean insP3, const Standard_Boolean mP3P1, const Standard_Real X4, const Standard_Real Y4, const Standard_Real Z4, const Standard_Real XT4, const Standard_Real YT4, const Standard_Real ZT4, const Standard_Real coef4, const Standard_Real U4, const Standard_Boolean insP4, const Standard_Boolean mP4P1, const Standard_Integer flag) const;
Standard_EXPORT void InsertOnOutLine (TColStd_Array1OfTransient& PID);
(const Standard_Integer /* nbent */, Standard_Integer& pcount) const
{ pcount = 1; return Standard_True; }
- Standard_Boolean IFSelect_DispGlobal::PacketsCount
- (const Interface_Graph& /* G */, Standard_Integer& pcount) const
- { pcount = 1; return Standard_True; }
-
// 1 packet ( a partir de UniqueResult)
void IFSelect_DispGlobal::Packets
(const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const
//! Returns True : maximum equates 1
Standard_EXPORT virtual Standard_Boolean LimitedMax (const Standard_Integer nbent, Standard_Integer& max) const Standard_OVERRIDE;
-
- //! Returns True (count of packets is well known) and count is 1
- Standard_EXPORT virtual Standard_Boolean PacketsCount (const Interface_Graph& G, Standard_Integer& count) const Standard_OVERRIDE;
-
+
//! Computes the list of produced Packets. It is made of only ONE
//! Packet, which gets the RootResult from the Final Selection.
//! Remark : the inherited exception raising is never activated.
return Standard_True;
}
- Standard_Boolean IFSelect_DispPerCount::PacketsCount
- (const Interface_Graph& G, Standard_Integer& /*count*/) const
- { return 1 + G.Size() / CountValue(); }
-
void IFSelect_DispPerCount::Packets
(const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const
{
//! Returns True, maximum count is given as <nbent>
Standard_EXPORT virtual Standard_Boolean LimitedMax (const Standard_Integer nbent, Standard_Integer& max) const Standard_OVERRIDE;
-
- //! Returns True (count is easy to know) and count is computed
- //! from length of input list (RootResult from Final Selection)
- Standard_EXPORT virtual Standard_Boolean PacketsCount (const Interface_Graph& G, Standard_Integer& count) const Standard_OVERRIDE;
-
+
//! Computes the list of produced Packets. It defines Packets in
//! order to have at most <Count> Entities per Packet, Entities
//! are given by RootResult from the Final Selection.
return Standard_True;
}
- Standard_Boolean IFSelect_DispPerFiles::PacketsCount
- (const Interface_Graph& G, Standard_Integer& /*count*/) const
- { return (G.Size() < CountValue() ? G.Size() : CountValue()); }
-
void IFSelect_DispPerFiles::Packets
(const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const
{
//! Returns True, maximum count is given as CountValue
Standard_EXPORT virtual Standard_Boolean LimitedMax (const Standard_Integer nbent, Standard_Integer& max) const Standard_OVERRIDE;
-
- //! Returns True (count is easy to know) and count is the minimum
- //! value between length of input list and CountValue
- Standard_EXPORT virtual Standard_Boolean PacketsCount (const Interface_Graph& G, Standard_Integer& count) const Standard_OVERRIDE;
-
+
//! Computes the list of produced Packets. It defines Packets in
//! order to have <Count> Packets, except if the input count of
//! Entities is lower. Entities are given by RootResult from the
(const Standard_Integer nbent, Standard_Integer& pcount) const
{ pcount = nbent; return Standard_True; }
- Standard_Boolean IFSelect_DispPerOne::PacketsCount
- (const Interface_Graph& G, Standard_Integer& pcount) const
-{ pcount = G.Size(); return Standard_True; }
-
void IFSelect_DispPerOne::Packets
(const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const
{
//! Returns True, maximum limit is given as <nbent>
Standard_EXPORT virtual Standard_Boolean LimitedMax (const Standard_Integer nbent, Standard_Integer& max) const Standard_OVERRIDE;
-
- //! Returns True (count is easy to know) and count is the length
- //! of the input list (RootResult from FinalSelection)
- Standard_EXPORT virtual Standard_Boolean PacketsCount (const Interface_Graph& G, Standard_Integer& count) const Standard_OVERRIDE;
-
+
//! Returns the list of produced Packets. It defines one Packet
//! per Entity given by RootResult from the Final Selection.
Standard_EXPORT void Packets (const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const Standard_OVERRIDE;
(const Interface_Graph& G) const
{ return thefinal->UniqueResult(G); }
- Standard_Boolean IFSelect_Dispatch::PacketsCount
- (const Interface_Graph& , Standard_Integer& pcount) const
- { pcount = 0; return Standard_False; } // par defaut 0
-
Interface_EntityIterator IFSelect_Dispatch::Packeted
(const Interface_Graph& G) const
{
//! input Graph
//! This the starting step for an Evaluation (Packets - Remainder)
Standard_EXPORT Interface_EntityIterator GetEntities (const Interface_Graph& G) const;
-
- //! Returns True if Count of Packets is actually known, and the
- //! value of the count in argument "count". Returns False if
- //! this count is unknown. Input is given as a Graph.
- //! This method is intended to be quick (used for file names)
- //! hence if this count is long to compute (that is, as a result
- //! of complete evaluation made by method Packets), it is
- //! preferable to answer "unknown" by returning False
- //! Default answer if False. Can be redefined.
- Standard_EXPORT virtual Standard_Boolean PacketsCount (const Interface_Graph& G, Standard_Integer& count) const;
-
+
//! Returns the list of produced Packets into argument <pack>.
//! Each Packet corresponds to a Part, the Entities listed are the
//! Roots given by the Selection. Input is given as a Graph.
{
Handle(IFSelect_WorkSession) WS = pilot->Session();
// **** ToggleHandler ****
- int hand = !WS->ErrorHandle();
+ Standard_Boolean hand = !WS->ErrorHandle();
Handle(Message_Messenger) sout = Message::DefaultMessenger();
if (hand) sout << " -- Mode Catch Error now Active" <<endl;
else sout << " -- Mode Catch Error now Inactive" <<endl;
// (N.B.: on prend inp1, qui donne UNE entite par composant, simple ou cycle)
for (inp1.Start(); inp1.More(); inp1.Next()) {
Handle(Standard_Transient) ent = inp1.Value();
- if ((Standard_Boolean)(GC.NbTimes(ent) <= 1) == IsDirect()) iter.GetOneItem(ent);
+ if ((GC.NbTimes(ent) <= 1) == IsDirect()) iter.GetOneItem(ent);
}
return iter;
}
// A present, on retient, parmi les inputs, celles comptees une seule fois
for (input.Start(); input.More(); input.Next()) {
Handle(Standard_Transient) ent = input.Value();
- if ((Standard_Boolean)(GC.NbTimes(ent) <= 1) == IsDirect()) iter.GetOneItem(ent);
+ if ((GC.NbTimes(ent) <= 1) == IsDirect()) iter.GetOneItem(ent);
}
return iter;
}
// Ici, resultat non nomme; Resultat nomme par commande x (plus loin)
if (!theobjrec.IsNull()) {
thesession->RemoveItem(theobjrec); //// depannage ?
- Standard_Boolean addws = thesession->AddItem(theobjrec);
- if (!addws) { cout<<"Could not add item to session, sorry"<<endl; return IFSelect_RetFail; }
+ Standard_Integer addws = thesession->AddItem(theobjrec);
+ if (addws == 0) { cout<<"Could not add item to session, sorry"<<endl; return IFSelect_RetFail; }
}
if (stat == IFSelect_RetVoid || stat == IFSelect_RetDone) {
// Prise en compte des commandes a resultat
if (!theobjrec.IsNull()) {
thesession->RemoveItem(theobjrec); //// depannage ?
- Standard_Boolean addws =
+ Standard_Integer addws =
thesession->AddNamedItem(name.ToCString(),theobjrec);
theobjrec.Nullify();
- if (!addws) { cout<<"Could not add named item:"<<name<<", sorry"<<endl; return IFSelect_RetFail; }
+ if (addws == 0) { cout<<"Could not add named item:"<<name<<", sorry"<<endl; return IFSelect_RetFail; }
}
else cout<<"Remark : xsnew with name:"<<name<<" and no result"<<endl;
Standard_Boolean IGESData_IGESEntity::ArePresentAssociativities () const
{
if (!theAssocs.IsEmpty()) return Standard_True;
- return (theStatusNum & IGESFlagAssocs);
+ return (theStatusNum & IGESFlagAssocs) != 0;
}
Standard_Integer IGESData_IGESEntity::NbAssociativities () const
Standard_Boolean IGESData_IGESEntity::ArePresentProperties () const
{
if (!theProps.IsEmpty()) return Standard_True;
- return (theStatusNum & IGESFlagProps);
+ return (theStatusNum & IGESFlagProps) != 0;
}
Standard_Integer IGESData_IGESEntity::NbProperties () const
theRadius = aRadius;
theStartAngle = aStAngle;
theDeltaAngle = aDelAngle;
- theDoDontFlag = aFlag;
+ theDoDontFlag = aFlag != 0;
thePositions = allNumPos;
InitTypeAndForm(414,0);
}
Standard_Boolean IGESDraw_CircArraySubfigure::DoDontFlag () const
{
- return (theDoDontFlag == 1);
+ return theDoDontFlag;
}
Standard_Boolean IGESDraw_CircArraySubfigure::PositionNum
Standard_Real theRadius;
Standard_Real theStartAngle;
Standard_Real theDeltaAngle;
- Standard_Integer theDoDontFlag;
+ Standard_Boolean theDoDontFlag;
Handle(TColStd_HArray1OfInteger) thePositions;
theFunctionTemplate = aFunctionTemplate;
thePointIdentifier = aPointIdentifier;
theFunctionCode = aFunctionCode;
- theSwapFlag = aSwapFlag;
+ theSwapFlag = aSwapFlag != 0;
theOwnerSubfigure = anOwnerSubfigure;
InitTypeAndForm(132,0);
}
Handle(IGESGraph_TextDisplayTemplate) theFunctionTemplate;
Standard_Integer thePointIdentifier;
Standard_Integer theFunctionCode;
- Standard_Integer theSwapFlag;
+ Standard_Boolean theSwapFlag;
Handle(IGESData_IGESEntity) theOwnerSubfigure;
theColumnSeparation = hDisp;
theRowSeparation = vtDisp;
theRotationAngle = rotationAngle;
- theDoDontFlag = doDont;
+ theDoDontFlag = doDont != 0;
thePositions = allNumPos;
InitTypeAndForm(412,0);
}
Standard_Real theColumnSeparation;
Standard_Real theRowSeparation;
Standard_Real theRotationAngle;
- Standard_Integer theDoDontFlag;
+ Standard_Boolean theDoDontFlag;
Handle(TColStd_HArray1OfInteger) thePositions;
if (surface.IsNull())
Standard_DomainError::Raise ("IGESSolid_TopoBuilder : MakeFace");
thesurf = surface;
- theouter = 0;
+ theouter = Standard_False;
theinner->Clear();
theface = new IGESSolid_Face;
}
void IGESSolid_TopoBuilder::SetOuter ()
{
EndLoop();
- theouter = 1;
+ theouter = Standard_True;
theinner->Append (theloop);
theloop.Nullify();
}
{
EndShell();
themains = theshell;
- themflag = orientation;
+ themflag = orientation != 0;
theshell.Nullify();
}
Handle(IGESSolid_ManifoldSolid) thesolid;
Handle(IGESSolid_Shell) themains;
- Standard_Integer themflag;
+ Standard_Boolean themflag;
Handle(TColStd_HSequenceOfTransient) thevoids;
Handle(TColStd_HSequenceOfInteger) thevflag;
Handle(IGESSolid_Shell) theshell;
Handle(TColStd_HSequenceOfInteger) thefflag;
Handle(IGESSolid_Face) theface;
Handle(IGESData_IGESEntity) thesurf;
- Standard_Integer theouter;
+ Standard_Boolean theouter;
Handle(TColStd_HSequenceOfTransient) theinner;
Handle(IGESSolid_Loop) theloop;
Handle(TColStd_HSequenceOfInteger) theetype;
if (mymodel.IsNull() || ent.IsNull()) return NullResult();
Standard_Integer anum = mymodel->Number(start);
- if(!Interface_Static::IVal("read.iges.faulty.entities") && mymodel->IsErrorEntity(anum))
+ if (Interface_Static::IVal("read.iges.faulty.entities") == 0 && mymodel->IsErrorEntity(anum))
return NullResult();
TopoDS_Shape shape;
if (theArgNum == 3)
{
aMode = atoi (theArgs[1]);
- isTurnOn = atoi (theArgs[2]);
+ isTurnOn = (atoi (theArgs[2]) != 0);
if (aMode < 0 || aMode > 8)
{
theDI << theArgs[0] << " error: only 0-8 selection modes are supported\n";
if (theArgNum == 4)
{
aMode = atoi (theArgs[2]);
- isTurnOn = atoi (theArgs[3]);
+ isTurnOn = (atoi (theArgs[3]) != 0);
if (aMode < 0 || aMode > 8)
{
//===========================================================
Standard_Boolean IVtkDraw_Interactor::IsEnabled() const
{
- return Enabled;
+ return (Enabled != 0);
}
//===========================================================
// Introducing a local scope here to simplify variable naming
{
buildIsoLines (aSurfAdaptor,
- myNbIsos[0],
+ myNbIsos[0] != 0,
Standard_False,
myNbIsos[0],
0,
aPolylines.Clear();
buildIsoLines (aSurfAdaptor,
Standard_False,
- myNbIsos[1],
+ myNbIsos[1] != 0,
0,
myNbIsos[1],
aPolylines);
}
}
- Standard_Boolean nbTreated = 0;
+ Standard_Integer nbTreated = 0;
for (Standard_Integer ip=0; ip < nbpt; ip++) {
GetLinePoint2d (L, W1[ip]+1, !OnFirst, U,V);
Standard_Real CurveDeflection(const BRepAdaptor_Curve& theBAC,
const IntTools_Range& theRange);
static
- Standard_Integer IsClosed(const Handle(Geom_Curve)& theCurve,
+ Standard_Boolean IsClosed(const Handle(Geom_Curve)& theCurve,
const Standard_Real aT1,
const Standard_Real aT2,
const Standard_Real theTol,
//function : IsClosed
//purpose :
//=======================================================================
-Standard_Integer IsClosed(const Handle(Geom_Curve)& theCurve,
+Standard_Boolean IsClosed(const Handle(Geom_Curve)& theCurve,
const Standard_Real aT1,
const Standard_Real aT2,
const Standard_Real theTol,
const Standard_Real theRes)
{
- Standard_Boolean bClosed;
- Standard_Real aD;
- gp_Pnt aP1, aP2;
- //
- bClosed = Standard_False;
- if (Abs(aT1 - aT2) < theRes) {
- return bClosed;
+ if (Abs(aT1 - aT2) < theRes)
+ {
+ return Standard_False;
}
- //
+
+ gp_Pnt aP1, aP2;
theCurve->D0(aT1, aP1);
theCurve->D0(aT2, aP2);
//
- aD = aP1.Distance(aP2);
- bClosed = aD < theTol;
- //
- return bClosed;
+ Standard_Real aD = aP1.Distance(aP2);
+ return aD < theTol;
}
GetDirection(theResEdge, F, plst, dlst, Standard_False);
}
- return (imin);
+ return imin != 0;
}
//=======================================================================
}
}
- return (anUsedEdges.Extent());
+ return !anUsedEdges.IsEmpty();
}
#include <sys/stat.h>
OSD_DirectoryIterator::OSD_DirectoryIterator()
-: myFlag(0),
+: myFlag(false),
myDescr(0),
myEntry(0),
myInit(0)
OSD_DirectoryIterator::OSD_DirectoryIterator(const OSD_Path& where,
const TCollection_AsciiString& Mask)
-: myFlag(0),
+: myFlag(false),
myDescr(0),
myEntry(0),
myInit(0)
Next(); // Now find first entry
}
}
- return (myFlag);
+ return myFlag;
}
// Private : See if directory name matches with a mask (like "*.c")
struct stat stat_buf;
char full_name[255];
- myFlag = 0; // Initialize to nothing found
+ myFlag = false; // Initialize to nothing found
do{
myEntry = readdir((DIR *)myDescr);
private:
OSD_Directory TheIterator;
- Standard_Integer myFlag;
+ Standard_Boolean myFlag;
TCollection_AsciiString myMask;
TCollection_AsciiString myPlace;
OSD_Error myError;
OSD_FileIterator::OSD_FileIterator()
-: myFlag(0),
+: myFlag(false),
myDescr(0),
myEntry(0),
myInit(0)
OSD_FileIterator::OSD_FileIterator(const OSD_Path& where,
const TCollection_AsciiString& Mask)
-: myFlag(0),
+: myFlag(false),
myDescr(0),
myEntry(0),
myInit(0)
Next(); // Now find first entry
}
}
- return (myFlag);
+ return myFlag;
}
// Private : See if file name matches with a mask (like "*.c")
struct stat stat_buf;
char full_name[255];
- myFlag = 0; // Initialize to nothing found
+ myFlag = false; // Initialize to nothing found
do {
myEntry = readdir((DIR *)myDescr);
private:
OSD_File TheIterator;
- Standard_Integer myFlag;
+ Standard_Boolean myFlag;
TCollection_AsciiString myMask;
TCollection_AsciiString myPlace;
OSD_Error myError;
Graphic3d_SequenceOfHClipPlane myPlanes; //!< defined clipping planes
OpenGl_MapOfPlaneStates myPlaneStates; //!< map of clip planes bound for the props
OpenGl_EmptyPlaneIds myEmptyPlaneIds; //!< generator of empty ids
- Standard_Boolean myNbClipping; //!< number of enabled clipping-only planes (NOT capping)
- Standard_Boolean myNbCapping; //!< number of enabled capping planes
+ Standard_Integer myNbClipping; //!< number of enabled clipping-only planes (NOT capping)
+ Standard_Integer myNbCapping; //!< number of enabled capping planes
private:
Standard_Boolean IsReversed() const
{
- return flags & Poly_MakeLoops::LF_Reversed;
+ return (flags & Poly_MakeLoops::LF_Reversed) != 0;
}
void Nullify()
if (getboollist->Last() != Standard_True)
return 3;
const TDataStd_ListOfByte& boollist = getboollist->List();
- TDataStd_ListIteratorOfListOfByte itr_boollist(boollist);
- for (; itr_boollist.More(); itr_boollist.Next())
+ for (TDataStd_ListIteratorOfListOfByte itr_boollist(boollist); itr_boollist.More(); itr_boollist.Next())
{
- if (itr_boollist.Value() != Standard_True &&
- itr_boollist.Value() != Standard_False)
+ if (itr_boollist.Value() != 1
+ && itr_boollist.Value() != 0)
{
return 4;
}
Standard_Boolean toPrint = Standard_False;
if (theArgNb % 2 == 0)
{
- toPrint = Draw::Atoi (theArgVec[theArgNb - 1]);
+ toPrint = Draw::Atoi (theArgVec[theArgNb - 1]) != 0;
}
SelectMgr_SelectingVolumeManager* aMgr = new SelectMgr_SelectingVolumeManager();
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()) {
const TopTools_ListOfShape& ancestors = subShapeAndAncestors.FindFromIndex(i);
if (ancestors.Extent() == 1) Dangles.Bind(ancestors.First(), mayBeDangle);
}
- return Dangles.Extent();
+ return !Dangles.IsEmpty();
}
//=======================================================================
const TopTools_ListOfShape& ancestors = subShapeAndAncestors.FindFromIndex(i);
if (ancestors.Extent() == 1) Dangles.Add(mayBeDangle);
}
- return Dangles.Extent();
+ return !Dangles.IsEmpty();
}
//=======================================================================
const TopTools_ListOfShape& ancestors = subShapeAndAncestors.FindFromIndex(i);
if (ancestors.Extent() == 1) Dangles.Bind(ancestors.First(), mayBeDangle);
}
- return Dangles.Extent();
+ return !Dangles.IsEmpty();
}
//=======================================================================
const TopTools_ListOfShape& ancestors = subShapeAndAncestors.FindFromIndex(i);
if (ancestors.Extent() == 1) Dangles.Add(mayBeDangle);
}
- return Dangles.Extent();
+ return !Dangles.IsEmpty();
}
*/
//=======================================================================
namePrism.Load(mkPrism, Basis);
}
else if (nb == 9) {
- BRepPrimAPI_MakePrism mkPrism(Basis, Direction, (Standard_Boolean)Draw::Atoi(arg[8]));
+ BRepPrimAPI_MakePrism mkPrism(Basis, Direction, Draw::Atoi(arg[8]) != 0);
mkPrism.Build();
if(!mkPrism.IsDone()) {
(const BOPAlgo_PBuilder& theBuilder,
const TopoDS_Shape& theFace)
{
- Standard_Integer bRet;
- bRet = Standard_False;
- //
if(theFace.IsNull() || (theFace.ShapeType() != TopAbs_FACE))
- return bRet;
+ return Standard_False;
BOPCol_ListIteratorOfListOfShape aIt;
const BOPCol_DataMapOfShapeListOfShape& aImages = theBuilder->Images();
if (!aImages.IsBound(theFace)) {
- return bRet;
+ return Standard_False;
}
const BOPCol_ListOfShape& aLF=aImages.Find(theFace);
if (aLF.Extent() == 0) {
- return bRet;
+ return Standard_False;
}
const BOPCol_DataMapOfShapeShape& aShapesSD = theBuilder->ShapesSD();
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aFsp = aIt.Value();
if (aShapesSD.IsBound(aFsp)) {
- bRet = Standard_True;
- break;
+ return Standard_True;
}
}
- return bRet;
+ return Standard_False;
}
// ========================================================================================
inline static Standard_Real ReadFloat2Double(OSD_File &aFile)
{
union {
- Standard_Boolean i; // don't be afraid, this is just an unsigned int
- Standard_ShortReal f;
+ uint32_t i;
+ float f;
}bidargum;
char c[4];
* Write names for the sub-shapes
* ================================ */
- if ( Interface_Static::IVal("write.stepcaf.subshapes.name") )
+ if (Interface_Static::IVal("write.stepcaf.subshapes.name") != 0)
{
const Handle(XSControl_TransferWriter) &TW = this->ChangeWriter().WS()->TransferWriter();
const Handle(Transfer_FinderProcess) &FP = TW->FinderProcess();
Message_ProgressSentry PS ( TP->GetProgress(), "Sub-assembly", 0, nb, 1 );
// [BEGIN] Proceed with non-manifold topology (ssv; 12.11.2010)
- Standard_Boolean isNMMode = Interface_Static::IVal("read.step.nonmanifold");
+ Standard_Boolean isNMMode = Interface_Static::IVal("read.step.nonmanifold") != 0;
Standard_Boolean isManifold = Standard_True;
if ( isNMMode && sr->IsKind(STANDARD_TYPE(StepShape_NonManifoldSurfaceShapeRepresentation)) ) {
isManifold = Standard_False;
return TransferCompound(start, SDR0, FP);
// [BEGIN] Separate manifold topology from non-manifold in group mode 0 (ssv; 18.11.2010)
- Standard_Boolean isNMMode = Interface_Static::IVal("write.step.nonmanifold");
+ Standard_Boolean isNMMode = Interface_Static::IVal("write.step.nonmanifold") != 0;
Handle(Transfer_Binder) aNMBinder;
if (isNMMode && !GroupMode() && theShape.ShapeType() == TopAbs_COMPOUND) {
TopoDS_Compound aNMCompound;
TopoDS_Shape theShape = mapper->Value();
// Inspect non-manifold topology case (ssv; 10.11.2010)
- Standard_Boolean isNMMode = Interface_Static::IVal("write.step.nonmanifold");
+ Standard_Boolean isNMMode = Interface_Static::IVal("write.step.nonmanifold") != 0;
Standard_Boolean isManifold;
if (isNMMode)
isManifold = IsManifoldShape(theShape);
nbFind++;
}
-
- return (nbFind);
+
+ return nbFind != 0;
}
-
if (shape.IsNull()) return 1;
Standard_Real toler = Draw::Atof (a[2]);
Standard_Boolean splitclosed = Standard_False, splitopen = Standard_False;
- if ( n > 3) splitclosed = Draw::Atoi (a[3]);
- if ( n > 4) splitopen = Draw::Atoi (a[4]);
+ if ( n > 3) splitclosed = Draw::Atoi (a[3]) != 0;
+ if ( n > 4) splitopen = Draw::Atoi (a[4]) != 0;
ShapeAnalysis_FreeBounds F;
if (toler <= 0)
Standard_Real toler = 0.;
Standard_Boolean splitclosed = Standard_False, splitopen = Standard_False;
if (n > 2) toler = Draw::Atof(a[2]);
- if (n > 3) splitclosed = Draw::Atoi(a[3]);
- if (n > 4) splitopen = Draw::Atoi(a[4]);
+ if (n > 3) splitclosed = Draw::Atoi(a[3]) != 0;
+ if (n > 4) splitopen = Draw::Atoi(a[4]) != 0;
ShapeAnalysis_FreeBoundsProperties analyzer;
if (toler > 0)
analyzer.Init(source, toler, splitclosed, splitopen);
if (shape.IsNull()) return 1;
Standard_Real sewtoler = Draw::Atof (a[2]), closetoler = Draw::Atof (a[3]);
Standard_Boolean splitclosed = Standard_False, splitopen = Standard_False;
- if ( n > 4) splitclosed = Draw::Atoi (a[3]);
- if ( n > 5) splitopen = Draw::Atoi (a[4]);
+ if ( n > 4) splitclosed = Draw::Atoi (a[3]) != 0;
+ if ( n > 5) splitopen = Draw::Atoi (a[4]) != 0;
ShapeFix_FreeBounds F;
if (sewtoler <= 0)
if (aCurve->IsKind(STANDARD_TYPE(Geom2d_BezierCurve))) {
Handle(Geom2d_BezierCurve) Bs = Handle(Geom2d_BezierCurve)::DownCast(aCurve);
if(Bs->Degree() > Degree) Nb.ChangeValue(2,1)++;
- if(Bs->IsRational() > ((unsigned int)MaxSeg) ) Nb.ChangeValue(2,3)++;
+ if(Bs->IsRational()) Nb.ChangeValue(2,3)++;
if(aCont < theCont)
{
if (aCurve->IsKind(STANDARD_TYPE(Geom_BezierCurve))) {
Handle(Geom_BezierCurve) Bs = Handle(Geom_BezierCurve)::DownCast(aCurve);
if(Bs->Degree() > Degree) Nb.ChangeValue(2,1)++;
- if(Bs->IsRational() > ((unsigned int)MaxSeg) ) Nb.ChangeValue(2,3)++;
+ if(Bs->IsRational()) Nb.ChangeValue(2,3)++;
if(aCont < theCont)
Nb.ChangeValue(2,4)++;
return;
di<< "Invalid argument Cont3e\n"; return 1; }
Handle(ShapeCustom_RestrictionParameters) aParameters = new ShapeCustom_RestrictionParameters;
- TopoDS_Shape result = ShapeCustom::BSplineRestriction (Shape, Draw::Atof(argv[3]), Draw::Atof(argv[4]), Draw::Atoi(argv[5]),Draw::Atoi(argv[6]),aCont3,aCont2,(Standard_Boolean) Draw::Atoi(argv[9]),(Standard_Boolean) Draw::Atoi(argv[10]),aParameters);
+ TopoDS_Shape result = ShapeCustom::BSplineRestriction (Shape, Draw::Atof(argv[3]), Draw::Atof(argv[4]), Draw::Atoi(argv[5]),Draw::Atoi(argv[6]),aCont3,aCont2, Draw::Atoi(argv[9]) != 0, Draw::Atoi(argv[10]) != 0,aParameters);
if (result.IsNull()) { di << "NO RESULT\n"; return 1; }
else if (result == Shape) {
di << "NO MODIFICATIONS\n";
if (argc < 4) {
ShapeExtend_Explorer sbx;
for (int i = 0; i < 2; i ++) {
- TopAbs_ShapeEnum ts = sbx.ShapeType(Shape,i);
+ Standard_Boolean viaCompound = (i != 0);
+ TopAbs_ShapeEnum ts = sbx.ShapeType(Shape, viaCompound);
//cout<<" Type "<<(i ? " (via Compound) : " : "(True) : ");
- if (i == 0) {
+ if (!viaCompound) {
di<<" Type (True) : ";
} else {
di<<" Type (via Compound) : ";
//=======================================================================
void SelectMgr_BaseFrustum::SetCamera (const Graphic3d_Mat4d& theProjection,
const Graphic3d_Mat4d& theWorldView,
- const Standard_Integer theIsOrthographic,
+ const Standard_Boolean theIsOrthographic,
const Graphic3d_WorldViewProjState& theWVPState)
{
myCamera.Nullify();
//! Passes camera projection and orientation matrices to builder
Standard_EXPORT void SetCamera (const Graphic3d_Mat4d& theProjection,
const Graphic3d_Mat4d& theWorldView,
- const Standard_Integer theIsOrthographic,
+ const Standard_Boolean theIsOrthographic,
const Graphic3d_WorldViewProjState& theWVPState = Graphic3d_WorldViewProjState());
//! @return current camera projection transformation common for all selecting volumes
//function : SurfaceNewton
//purpose : Newton algo (S4030)
//=======================================================================
-Standard_Boolean ShapeAnalysis_Surface::SurfaceNewton(const gp_Pnt2d &p2dPrev,
+Standard_Integer ShapeAnalysis_Surface::SurfaceNewton(const gp_Pnt2d &p2dPrev,
const gp_Pnt& P3D,
const Standard_Real preci,
gp_Pnt2d &sol)
// cout << "Newton: solution found in " << i+1 << " iterations" << endl;
sol.SetCoord( U, V );
- return ( nrm2 < 0.01 * ru2 * rv2 ? 2 : Standard_True ); //:q6
+ return ( nrm2 < 0.01 * ru2 * rv2 ? 2 : 1 ); //:q6
}
// cout << "Newton: failed after " << i+1 << " iterations (fail " << fail << " )" << endl;
return Standard_False;
}
gp_Pnt2d sol;
- Standard_Boolean res = SurfaceNewton(p2dPrev,P3D,preci,sol);
- if ( res )
+ Standard_Integer res = SurfaceNewton(p2dPrev,P3D,preci,sol);
+ if (res != 0)
{
Standard_Real gap = P3D.Distance ( Value(sol) );
if ( res == 2 || //:q6 abv 19 Mar 99: protect against strange attractors
//conic case
gp_Pnt2d prev(S,T);
gp_Pnt2d solution;
- if (SurfaceNewton(prev,P3D,preci,solution)) {
+ if (SurfaceNewton(prev,P3D,preci,solution) != 0)
+ {
#ifdef OCCT_DEBUG
cout <<"Newton found point on conic extrusion"<<endl;
#endif
Standard_Boolean possLockal = Standard_False; //:study S4030 (optimizing)
if (disSurf > preci) {
gp_Pnt2d pp(UU,VV);
- if ( SurfaceNewton(pp,P3D,preci,pp)) { //:q2 abv 16 Mar 99: PRO7226 #412920
+ if (SurfaceNewton (pp, P3D, preci, pp) != 0)
+ { //:q2 abv 16 Mar 99: PRO7226 #412920
Standard_Real dist = P3D.Distance ( Value(pp) );
if ( dist < disSurf ) {
disSurf = dist;
Standard_EXPORT void ComputeSingularities();
Standard_EXPORT void ComputeBoxes();
-
- Standard_EXPORT Standard_Boolean SurfaceNewton (const gp_Pnt2d& p2dPrev, const gp_Pnt& P3D, const Standard_Real preci, gp_Pnt2d& sol);
-
+
+ //! @return 0, 1 or 2.
+ Standard_EXPORT Standard_Integer SurfaceNewton (const gp_Pnt2d& p2dPrev, const gp_Pnt& P3D, const Standard_Real preci, gp_Pnt2d& sol);
+
Standard_EXPORT void SortSingularities();
Standard_Boolean neg = t.IsNegative();
Standard_Boolean det = ( t.VectorialPart().Determinant() < 0.0 );
Standard_Boolean dir = ES->Position().Direct();
- if ( (Standard_Boolean)( neg != det ) == dir ) result = 1;
+ if ((neg != det) == dir) result = 1;
Handle(Geom_ConicalSurface) CS = Handle(Geom_ConicalSurface)::DownCast(ES);
if (!CS.IsNull()) {
// does the cone have negative semiangle ?
//purpose : auxilary
//=======================================================================
// check points coincidence
-static inline Standard_Integer IsCoincided (const gp_Pnt2d &p1, const gp_Pnt2d &p2,
+static inline Standard_Boolean IsCoincided (const gp_Pnt2d &p1, const gp_Pnt2d &p2,
const Standard_Real UResolution,
const Standard_Real VResolution,
const Standard_Real tol)
for ( i=1; i <= indexes.Length() && indexes(i) < index; i++ );
for ( Standard_Integer shift = 1; i <= indexes.Length() && indexes(i) == index; i++ ) {
- while ( shift < nsplit && isreversed != (Standard_Boolean) ( values(i) > params(shift) ) ) shift++;
+ while ( shift < nsplit && isreversed != (values(i) > params(shift)) ) shift++;
indexes.SetValue ( i, index + shift - 1 );
}
for ( ; i <= indexes.Length(); i++ )
B.SameRange(newEdge, Standard_False);
//pdn take into account 0 codes (if ext)
if(code == 0 && wire.Orientation()==TopAbs_EXTERNAL){
- code = ( ( isCutByU == (Standard_Boolean)( j == 1 ) ) ? 1 : 2 );
+ code = ( ( isCutByU == (j == 1) ) ? 1 : 2 );
}
result.AddEdge ( 0, newEdge, iumin, iumax, ivmin, ivmax );
result.AddEdge ( 0, edge, iumin, iumax, ivmin, ivmax );
if(code == 0 && wire.Orientation()==TopAbs_EXTERNAL){
//pdn defining code for intersection of two isos
- code = ( ( isCutByU == (Standard_Boolean)( Abs(firstPar-currPar) < Abs(lastPar-currPar) ) ) ? 2 : 1 );
+ code = ( ( isCutByU == ( Abs(firstPar-currPar) < Abs(lastPar-currPar) ) ) ? 2 : 1 );
}
DefinePatch ( result, code, isCutByU, cutIndex );
}
// Sort by parameter on edge
for ( i = IntEdgePar.Length(); i > start; i-- )
for ( Standard_Integer j = start; j < i; j++ ) {
- if ( isreversed == (Standard_Boolean) ( IntEdgePar(j+1) < IntEdgePar(j) ) ) continue;
+ if ( isreversed == ( IntEdgePar(j+1) < IntEdgePar(j) ) ) continue;
IntLinePar.Exchange ( j, j+1 );
IntEdgePar.Exchange ( j, j+1 );
}
}
// check whether current segment is on the same patch with previous
- Standard_Integer sp = IsSamePatch ( seg, myGrid->NbUPatches(), myGrid->NbVPatches(),
+ Standard_Boolean sp = IsSamePatch ( seg, myGrid->NbUPatches(), myGrid->NbVPatches(),
iumin, iumax, ivmin, ivmax );
// not same patch has lowest priority
if ( ! endV.IsSame ( j ? seg.LastVertex() : seg.FirstVertex() ) ) continue;
// check for misorientation only if nothing better is found
- Standard_Integer misor = ( anOr == ( j ? TopAbs_REVERSED : TopAbs_FORWARD ) );
+ Standard_Boolean misor = ( anOr == ( j ? TopAbs_REVERSED : TopAbs_FORWARD ) );
// if ( misor ) continue; // temporarily, to be improved
// returning back by the same edge is lowest priority
if ( lastEdge.IsSame ( wire->Edge ( j ? wire->NbEdges() : 1 ) ) ) {
if ( ! index && ! canBeClosed ) { // || ( sp && ! samepatch ) ) {
index = i;
- reverse = j;
+ reverse = j != 0;
connected = Standard_True;
misoriented = misor;
samepatch = sp;
continue;
index = i;
- reverse = j;
+ reverse = j != 0;
angle = ang;
mindist = dist;
connected = conn;
for ( Standard_Integer k=1; k <= sbwd->NbEdges(); k++ ) {
if ( !V.IsSame ( sae.FirstVertex ( sbwd->Edge(k) ) ) ) continue; //pdn I suppose that short segment should be inserted into the SAME vertex.
- Standard_Integer sp = IsSamePatch ( wires(j), myGrid->NbUPatches(), myGrid->NbVPatches(),
+ Standard_Boolean sp = IsSamePatch ( wires(j), myGrid->NbUPatches(), myGrid->NbVPatches(),
iumin, iumax, ivmin, ivmax );
if ( samepatch && !sp) continue;
gp_Pnt2d pp;
else
continue;
TopAbs_State state = clas.Perform (unp,Standard_False);
- if ( (Standard_Boolean) ( state == TopAbs_OUT ) == reverse ) {
+ if ((state == TopAbs_OUT) == reverse) {
holes.Append ( loops(j) );
loops.Remove ( j-- );
}
TopoDS_Face af = TopoDS::Face ( dummy );
af.Orientation ( TopAbs_FORWARD );
B.Add (af,ws.Value(1));
- if ((myFixAddNaturalBoundMode != Standard_True || //: abv 29.08.01: Spatial_firex_lofting.sat
+ if ((myFixAddNaturalBoundMode != 1 ||
!IsSurfaceUVPeriodic (mySurf->Surface()) ) &&
!ShapeAnalysis::IsOuterBound (af) )
{
case TopAbs_COMPOUND:
case TopAbs_COMPSOLID: {
TopoDS_Shape shape = myShape;
- Standard_Boolean savFixSameParameterMode = myFixSameParameterMode;
+ Standard_Integer savFixSameParameterMode = myFixSameParameterMode;
myFixSameParameterMode = Standard_False;
myFixVertexTolMode = Standard_False;
Standard_Integer aShapesNb = 0;
case TopAbs_FACE: {
if ( ! NeedFix ( myFixFaceMode ) ) break;
Handle(ShapeFix_Face) sff = FixFaceTool();
- Standard_Integer savTopoMode = sff->FixWireTool()->ModifyTopologyMode();
+ Standard_Boolean savTopoMode = sff->FixWireTool()->ModifyTopologyMode();
sff->FixWireTool()->ModifyTopologyMode() = Standard_True;
sff->Init(TopoDS::Face(S));
sff->SetContext(Context());
case TopAbs_WIRE: {
if ( ! NeedFix ( myFixWireMode ) ) break;
Handle(ShapeFix_Wire) sfw = FixWireTool();
- Standard_Integer savTopoMode = sfw->ModifyTopologyMode();
- Standard_Integer savClosedMode = sfw->ClosedWireMode();
+ Standard_Boolean savTopoMode = sfw->ModifyTopologyMode();
+ Standard_Boolean savClosedMode = sfw->ClosedWireMode();
sfw->ModifyTopologyMode() = Standard_True;
if ( ! S.Closed() )
sfw->ClosedWireMode() = Standard_False;
else MapEdges.Remove(edge);
}
}
- return (MapEdges.Extent());
+ return !MapEdges.IsEmpty();
}
//=======================================================================
// function : GetShells
//Filling map MapOtherShells which contains candidate to creation of closed shell
// with aShell.
-
- TopTools_DataMapOfShapeInteger MapOtherShells;
-
+ NCollection_DataMap<TopoDS_Shape, Standard_Boolean, TopTools_ShapeMapHasher> MapOtherShells;
for(Standard_Integer j = i+1 ; j <= OpenShells.Length();j++ ) {
Standard_Boolean isAddShell = Standard_True;
Standard_Boolean isReversed = Standard_False;
if(!isAddShell) continue;
MapOtherShells.Bind(OpenShells.Value(j),isReversed);
}
- if(!MapOtherShells.Extent()) continue;
+ if(MapOtherShells.IsEmpty()) continue;
- if(MapOtherShells.Extent() >1) {
-
+ if (!MapOtherShells.IsEmpty())
+ {
// Case of compsolid when more than two shells have the same free boundary.
TopTools_SequenceOfShape aSeqCandidate;
aSeqCandidate.Append(OpenShells.Value(i));
- for(TopTools_DataMapIteratorOfDataMapOfShapeInteger aIt(MapOtherShells); aIt.More(); aIt.Next())
- aSeqCandidate.Append(aIt.Key());
+ for (NCollection_DataMap<TopoDS_Shape, Standard_Boolean, TopTools_ShapeMapHasher>::Iterator aIt(MapOtherShells); aIt.More(); aIt.Next())
+ {
+ aSeqCandidate.Append(aIt.Key());
+ }
//Creation all possibly shells from choosen candidate.And
// addition of them to temporary sequence.
aB.MakeShell(aNewSh);
for(TopoDS_Iterator aIt1(aSeqCandidate.Value(k),Standard_False); aIt1.More(); aIt1.Next())
aB.Add(aNewSh,aIt1.Value());
- Standard_Integer isRev = MapOtherShells.Find(aSeqCandidate.Value(l));
+ Standard_Boolean isRev = MapOtherShells.Find(aSeqCandidate.Value(l));
if(k !=1) {
- isRev = ((isRev == MapOtherShells.Find(aSeqCandidate.Value(k))) ? 1 : 0);
+ isRev = (isRev == MapOtherShells.Find(aSeqCandidate.Value(k)));
}
for(TopExp_Explorer aExp(aSeqCandidate.Value(l),TopAbs_FACE); aExp.More(); aExp.Next()) {
TopoDS_Shape aFace = (isRev ? aExp.Current().Reversed(): aExp.Current());
TopoDS_Shape addShell;
Standard_Boolean isReversed = Standard_False;
for(Standard_Integer j1 = i+1 ; j1 <= OpenShells.Length();j1++ ) {
- if(!MapOtherShells.IsBound(OpenShells.Value(j1))) continue;
+ if(!MapOtherShells.Find (OpenShells.Value(j1), isReversed)) continue;
addShell = OpenShells.Value(j1);
- isReversed = MapOtherShells.Find(addShell);
OpenShells.Remove(j1);
break;
}
//purpose :
//=======================================================================
- Standard_Boolean ShapeFix_Solid::Status(const ShapeExtend_Status /*status*/) const
+Standard_Boolean ShapeFix_Solid::Status (const ShapeExtend_Status theStatus) const
{
- return myStatus;
+ return ShapeExtend::DecodeStatus (myStatus, theStatus);
}
//=======================================================================
if ( !Context().IsNull() )
myFixEdge->SetContext( Context() );
- Standard_Integer Fixed = Standard_False;
+ Standard_Boolean Fixed = Standard_False;
// FixReorder is first, because as a rule wire is required to be ordered
// We shall analyze the order of edges in the wire and set appropriate
Handle(BRep_TEdge) aTEdge = new BRep_TEdge;
aTEdge->Tolerance (myTolerance);
- aTEdge->SameParameter (myFlags & ParameterMask);
- aTEdge->SameRange (myFlags & RangeMask);
- aTEdge->Degenerated (myFlags & DegeneratedMask);
+ aTEdge->SameParameter ((myFlags & ParameterMask) != 0);
+ aTEdge->SameRange ((myFlags & RangeMask) != 0);
+ aTEdge->Degenerated ((myFlags & DegeneratedMask) != 0);
myCurves->Import (aTEdge->ChangeCurves());
(const Handle(TopoDS_TShape)& theTShape) const
{
theTShape->Free (Standard_False); // Always frozen when coming from DB
- theTShape->Modified (myFlags & ModifiedMask);
- theTShape->Checked (myFlags & CheckedMask);
- theTShape->Orientable (myFlags & OrientableMask);
- theTShape->Closed (myFlags & ClosedMask);
- theTShape->Infinite (myFlags & InfiniteMask);
- theTShape->Convex (myFlags & ConvexMask);
+ theTShape->Modified ((myFlags & ModifiedMask) != 0);
+ theTShape->Checked ((myFlags & CheckedMask) != 0);
+ theTShape->Orientable ((myFlags & OrientableMask) != 0);
+ theTShape->Closed ((myFlags & ClosedMask) != 0);
+ theTShape->Infinite ((myFlags & InfiniteMask) != 0);
+ theTShape->Convex ((myFlags & ConvexMask) != 0);
}
static inline void AddShape
if ( myRC.IsNull() ) return Standard_False;
try {
OCC_CATCH_SIGNALS
- val = (Standard_Boolean)myRC->Integer ( MakeName ( myScope, param )->ToCString() );
+ val = myRC->Integer (MakeName (myScope, param)->ToCString()) != 0;
return Standard_True;
}
catch (Standard_Failure) {
if ( ! ctx->Messages().IsNull() ) msg = new ShapeExtend_MsgRegistrator;
ShapeFix::SameParameter ( ctx->Result(),
- ctx->IntegerVal ( "Force", Standard_False ),
+ ctx->BooleanVal ( "Force", Standard_False ),
ctx->RealVal ( "Tolerance3d", Precision::Confusion() /* -1 */),
NULL, msg );
Handle(ShapeExtend_MsgRegistrator) msg;
if ( ! ctx->Messages().IsNull() ) msg = new ShapeExtend_MsgRegistrator;
- Standard_Boolean ModeSurf = ctx->IntegerVal ( "SurfaceMode", Standard_True );
- Standard_Boolean ModeC3d = ctx->IntegerVal ( "Curve3dMode", Standard_True );
- Standard_Boolean ModeC2d = ctx->IntegerVal ( "Curve2dMode", Standard_True );
+ Standard_Boolean ModeSurf = ctx->BooleanVal ( "SurfaceMode", Standard_True );
+ Standard_Boolean ModeC3d = ctx->BooleanVal ( "Curve3dMode", Standard_True );
+ Standard_Boolean ModeC2d = ctx->BooleanVal ( "Curve2dMode", Standard_True );
Standard_Real aTol3d = ctx->RealVal ( "Tolerance3d", 0.01 );
Standard_Real aTol2d = ctx->RealVal ( "Tolerance2d", 1e-06 );
Standard_Integer aMaxDeg = ctx->IntegerVal ( "RequiredDegree", 9 );
Standard_Integer aMaxSeg = ctx->IntegerVal ( "RequiredNbSegments", 10000 );
- Standard_Boolean ModeDeg = ctx->IntegerVal ( "PreferDegree", Standard_True );
- Standard_Boolean Rational = ctx->IntegerVal ( "RationalToPolynomial", Standard_False );
+ Standard_Boolean ModeDeg = ctx->BooleanVal ( "PreferDegree", Standard_True );
+ Standard_Boolean Rational = ctx->BooleanVal ( "RationalToPolynomial", Standard_False );
Handle(ShapeCustom_RestrictionParameters) aParameters = new ShapeCustom_RestrictionParameters;
ctx->GetInteger ( "MaxDegree", aParameters->GMaxDegree() );
sfs->FixVertexPositionMode() = ctx->IntegerVal ( "FixVertexPositionMode", 0 );
sfs->FixSolidTool()->FixShellMode() = ctx->IntegerVal ( "FixShellMode", -1 );
- sfs->FixSolidTool()->CreateOpenSolidMode() = ctx->IntegerVal ( "CreateOpenSolidMode", 1 );
+ sfs->FixSolidTool()->CreateOpenSolidMode() = ctx->BooleanVal ( "CreateOpenSolidMode", Standard_True );
sfs->FixShellTool()->FixFaceMode() = ctx->IntegerVal ( "FixFaceMode", -1 );
// IsAlphabetic : Returns Standard_True if a character is alphabetic
// ==================================================================
inline Standard_Boolean IsAlphabetic(const Standard_Character me)
-{ return std::isalpha ((unsigned char)me); }
+{ return std::isalpha ((unsigned char)me) != 0; }
// ==================================================================
// IsDigit : Returns Standard_True if a character is a digit
// ==================================================================
inline Standard_Boolean IsDigit(const Standard_Character me)
-{ return std::isdigit ((unsigned char)me); }
+{ return std::isdigit ((unsigned char)me) != 0; }
// ==================================================================
// IsXDigit : Returns Standard_True if a character is a digit
// ==================================================================
inline Standard_Boolean IsXDigit(const Standard_Character me)
-{ return std::isxdigit((unsigned char)me); }
+{ return std::isxdigit((unsigned char)me) != 0; }
// ==================================================================
// IsAlphanumeric : Returns Standard_True if a character is alphanumeric
// IsControl : Returns Standard_True if a character is a control character
// ==================================================================
inline Standard_Boolean IsControl(const Standard_Character me)
-{ return std::iscntrl((unsigned char)me); }
+{ return std::iscntrl((unsigned char)me) != 0; }
// ==================================================================
// IsGraphic : Returns Standard_True if a character is graphic
// ==================================================================
inline Standard_Boolean IsGraphic(const Standard_Character me)
-{ return std::isgraph((unsigned char)me); }
+{ return std::isgraph((unsigned char)me) != 0; }
// ==================================================================
// IsLowerCase : Returns Standard_True if a character is lowercase
// ==================================================================
inline Standard_Boolean IsLowerCase(const Standard_Character me)
-{ return std::islower((unsigned char)me); }
+{ return std::islower((unsigned char)me) != 0; }
// ==================================================================
// IsPrintable : Returns Standard_True if a character is printable
// ==================================================================
inline Standard_Boolean IsPrintable(const Standard_Character me)
-{ return std::isprint((unsigned char)me); }
+{ return std::isprint((unsigned char)me) != 0; }
// ==================================================================
// IsPunctuation : Returns Standard_True if a character is a graphic and
// IsSpace : Returns Standard_True if a character is a space
// ==================================================================
inline Standard_Boolean IsSpace(const Standard_Character me)
-{ return std::isspace((unsigned char)me); }
+{ return std::isspace((unsigned char)me) != 0; }
// ==================================================================
// IsUppercase : Returns Standard_True if a character is uppercase
// ==================================================================
inline Standard_Boolean IsUpperCase(const Standard_Character me)
-{ return std::isupper((unsigned char)me); }
+{ return std::isupper((unsigned char)me) != 0; }
// ==================================================================
// LowerCase : Returns a lowercase character
//
Standard_Boolean Standard_Transient::IsInstance(const Handle(Standard_Type) &AType) const
{
- return (Standard_Boolean) (AType == DynamicType());
+ return (AType == DynamicType());
}
//
#include <inttypes.h>
#endif
-#define Standard_False (Standard_Boolean)0
-#define Standard_True (Standard_Boolean)1
+#define Standard_False false
+#define Standard_True true
#include <Standard_Macro.hxx>
typedef int Standard_Integer;
typedef double Standard_Real;
-typedef unsigned int Standard_Boolean;
+typedef bool Standard_Boolean;
typedef float Standard_ShortReal;
typedef char Standard_Character;
typedef unsigned char Standard_Byte;
{ return static_cast<Standard_Byte> (theValue); }
};
+struct StdLPersistent_Collection::boolConverter
+{
+ boolConverter (const Handle(TDF_Data)&) {}
+
+ Standard_Boolean operator() (Standard_Integer theValue) const
+ { return theValue != 0; }
+};
+
struct StdLPersistent_Collection::stringConverter
{
stringConverter (const Handle(TDF_Data)&) {}
<StdLPersistent_Collection::listBase,
StdLPersistent_Collection::integer,
TDataStd_BooleanList,
- StdLPersistent_Collection::noConversion>;
+ StdLPersistent_Collection::boolConverter>;
template class StdLPersistent_Collection::instance
<StdLPersistent_Collection::listBase,
// Converters
struct noConversion;
struct byteConverter;
+ struct boolConverter;
struct stringConverter;
struct referenceConverter;
typedef listT <real, TDataStd_RealList>
RealList;
- typedef listT <integer, TDataStd_BooleanList>
+ typedef listT <integer, TDataStd_BooleanList, boolConverter>
BooleanList;
typedef listT <persistent, TDataStd_ExtStringList, stringConverter>
gp_Pnt &P1, gp_Pnt &P2)
{
for ( Standard_Integer i=1; i<=2; i++ ) {
- const Handle(StepShape_Vertex) V = ( (Standard_Boolean)(i==1) == EC->SameSense() ? EC->EdgeStart() : EC->EdgeEnd() );
+ const Handle(StepShape_Vertex) V = ((i == 1) == EC->SameSense() ? EC->EdgeStart() : EC->EdgeEnd() );
const Handle(StepShape_VertexPoint) VP = Handle(StepShape_VertexPoint)::DownCast(V);
if ( VP.IsNull() ) continue;
const Handle(StepGeom_CartesianPoint) P = Handle(StepGeom_CartesianPoint)::DownCast(VP->VertexGeometry());
inline Standard_Integer Extent () const
{ return Standard_Integer (myExtent); }
- inline Standard_Integer IsEmpty () const
+ inline Standard_Boolean IsEmpty () const
{ return TCollection_BasicMap::IsEmpty(); }
inline void Statistics (Standard_OStream& outStream) const
TDataStd_ListIteratorOfListOfByte itr(aList->List());
for (; itr.More(); itr.Next())
{
- myList.Append(itr.Value());
+ myList.Append (itr.Value() ? 1 : 0);
}
}
TDataStd_ListIteratorOfListOfByte itr(myList);
for (; itr.More(); itr.Next())
{
- aList->Append(itr.Value());
+ aList->Append (itr.Value() != 0);
}
}
TFunction_ExecutionStatus.hxx
TFunction_Function.cxx
TFunction_Function.hxx
-TFunction_Function.lxx
TFunction_GraphNode.cxx
TFunction_GraphNode.hxx
TFunction_HArray1OfDataMapOfGUIDDriver.hxx
Standard_EXPORT static const Standard_GUID& GetID();
Standard_EXPORT TFunction_Function();
-
+
//! Returns the GUID for this function's driver.
- const Standard_GUID& GetDriverGUID() const;
-
+ const Standard_GUID& GetDriverGUID() const { return myDriverGUID; }
+
//! Sets the driver for this function as that
//! indentified by the GUID guid.
Standard_EXPORT void SetDriverGUID (const Standard_GUID& guid);
-
+
//! Returns true if the execution failed
- Standard_Boolean Failed() const;
-
+ Standard_Boolean Failed() const { return myFailure != 0; }
+
//! Sets the failed index.
Standard_EXPORT void SetFailure (const Standard_Integer mode = 0);
-
//! Returns an index of failure if the execution of this function failed.
//! If this integer value is 0, no failure has occurred.
//! Implementation of Attribute methods:
//! ===================================
- Standard_Integer GetFailure() const;
-
+ Standard_Integer GetFailure() const { return myFailure; }
+
Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE;
Standard_EXPORT virtual void Restore (const Handle(TDF_Attribute)& with) Standard_OVERRIDE;
Standard_EXPORT virtual Standard_OStream& Dump (Standard_OStream& anOS) const Standard_OVERRIDE;
-
-
-
DEFINE_STANDARD_RTTIEXT(TFunction_Function,TDF_Attribute)
-protected:
-
-
-
-
private:
-
Standard_GUID myDriverGUID;
Standard_Integer myFailure;
-
};
-
-#include <TFunction_Function.lxx>
-
-
-
-
-
#endif // _TFunction_Function_HeaderFile
+++ /dev/null
-// Created on: 1999-06-11
-// Created by: Vladislav ROMASHKO
-// Copyright (c) 1999-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.
-
-inline const Standard_GUID& TFunction_Function::GetDriverGUID() const
-{
- return myDriverGUID;
-}
-
-inline Standard_Boolean TFunction_Function::Failed() const
-{
- return myFailure;
-}
-
-inline Standard_Integer TFunction_Function::GetFailure() const
-{
- return myFailure;
-}
-
-
-
Standard_Boolean TObj_Object::TestFlags(const Standard_Integer theMask) const
{
Standard_Integer aFlags = getInteger(DataTag_Flags);
- return aFlags & theMask;
+ return (aFlags & theMask) != 0;
}
//=======================================================================
else if (!strcmp(thea,"-c")) {
suppressarg(na,a,ia);
if (ia < na) {
- VT.SetClear((Standard_Boolean)Draw::Atoi(a[ia]));
+ VT.SetClear (Draw::Atoi(a[ia]) != 0);
suppressarg(na,a,ia);
}
else VT.SetClear(Standard_True);
#ifdef OCCT_DEBUG
Standard_Boolean tend = TopOpeBRepTool_GettraceEND();
- TopOpeBRepTool_SettraceEND(PT.ChangeVarsTopo().GetVerbose());
+ TopOpeBRepTool_SettraceEND(PT.ChangeVarsTopo().GetVerbose() != 0);
#endif
err = 0;
if ( C2.IsNull() ) {
return Standard_False;
}
- Standard_Real res = Standard_False;
-
+
GeomAPI_ProjectPointOnCurve mydist(P1,C2,FC2,LC2);
if ( mydist.Extrema().IsDone() ) {
if ( mydist.NbPoints() ) {
T2 = mydist.LowerDistanceParameter();
- res = Standard_True;
+ return Standard_True;
}
}
-//#ifdef OCCT_DEBUG
-// return res; // BUG ???
-//#else
- return (Standard_Boolean ) res ;
-//#endif
+ return Standard_False;
}
// -------------------------------------------------
TopTools_ListOfShape myERL;
TopTools_DataMapOfShapeListOfShape myDataforDegenEd;
Standard_Boolean myLastVPison0;
- Standard_Boolean mykeptVPnbr;
+ Standard_Integer mykeptVPnbr;
Standard_Integer myDSCIndex;
TopOpeBRepDS_ListOfInterference myDSCIL;
TopOpeBRep_PointClassifier myPointClassifier;
Standard_Boolean TopOpeBRep_FacesFiller::GetFFGeometry(const TopOpeBRep_VPointInter& VP,TopOpeBRepDS_Kind& K,Standard_Integer& G) const
{
TopOpeBRepDS_Point DSP = TopOpeBRep_PointGeomTool::MakePoint(VP);
- Standard_Integer found = GetFFGeometry(DSP,K,G);
+ Standard_Boolean found = GetFFGeometry(DSP,K,G);
return found;
}
}
Standard_EXPORT Standard_Boolean TopOpeBRep_GettraceNVP(Standard_Integer n,char**a)
-{ Standard_Integer b = BOOPNVP.Get(n,a); return b; }
+{
+ return BOOPNVP.Get(n,a);
+}
Standard_EXPORT Standard_Boolean TopOpeBRep_GettraceNVP(Standard_Integer i1,Standard_Integer i2,Standard_Integer i3,Standard_Integer i4,Standard_Integer i5)
{
}
Standard_EXPORT Standard_Boolean TopOpeBRep_GettraceSHA(Standard_Integer n,char**a)
-{ Standard_Integer b = BOOPSHA.Get(n,a); return b; }
+{
+ return BOOPSHA.Get(n,a);
+}
Standard_EXPORT Standard_Boolean TopOpeBRep_GettraceSHA(const Standard_Integer i1)
{
char* t[1]; t[0]=AS(i1);
- Standard_Boolean b = BOOPSHA.Get(1,t);return b;
+ return BOOPSHA.Get(1,t);
}
// #ifdef OCCT_DEBUG
{
Standard_Integer absindex = VP.ShapeIndex(); // 0,1,2,3
Standard_Integer iVP = VP.Index();
- Standard_Boolean OOShapeIndex = (ShapeIndex == 1) ? 2 : 1;
+ Standard_Integer OOShapeIndex = (ShapeIndex == 1) ? 2 : 1;
Standard_Boolean on2edges = (absindex == 3);
Standard_Boolean hasONedge = (VP.State(OOShapeIndex) == TopAbs_ON);
Standard_Boolean hasOOedge = (on2edges) ? Standard_True : hasONedge;
// Standard_Boolean isvertex = VP.IsVertex(ShapeIndex);
Standard_Boolean isvertex = (PVKind == TopOpeBRepDS_VERTEX);
Standard_Integer absindex = VP.ShapeIndex(); // 0,1,2,3
- Standard_Boolean OOShapeIndex = (ShapeIndex == 1) ? 2 : 1;
+ Standard_Integer OOShapeIndex = (ShapeIndex == 1) ? 2 : 1;
Standard_Boolean on2edges = (absindex == 3);
Standard_Boolean hasONedge = (VP.State(OOShapeIndex) == TopAbs_ON);
Standard_Boolean hasOOedge = (on2edges) ? Standard_True : hasONedge;
//=======================================================================
TopAbs_Orientation TopOpeBRepBuild_Builder::Orient(const TopAbs_Orientation Ori,const Standard_Boolean Reverse)
{
- TopAbs_Orientation result=TopAbs_FORWARD;
- switch (Reverse) {
- case Standard_True : result = TopAbs::Complement(Ori); break;
- case Standard_False : result = Ori; break;
- }
- return result;
+ return !Reverse
+ ? Ori
+ : TopAbs::Complement(Ori);
}
//=======================================================================
Standard_Boolean rev = Standard_False;
for(Standard_Integer i = 1; i <= aEM.Extent(); i++) {
const TopoDS_Shape& anEdge = aEM(i);
- if(myMapOfEdgeWithFaceState.IsBound(anEdge)) {
- rev = (Standard_Boolean)myMapOfEdgeWithFaceState.Find(anEdge);
- break;
+ if (myMapOfEdgeWithFaceState.Find (anEdge, rev)) {
+ break;
}
}
if(OrigRev)
WES.AddStartElement(EOR);
}
- myMapOfEdgeWithFaceState.Bind(EOR, (Standard_Integer)stateOfFaceOri);
+ myMapOfEdgeWithFaceState.Bind (EOR, stateOfFaceOri);
}
if(!UseEdges) {
OrientateEdgeOnFace(TopoDS::Edge(EOR), TopoDS::Face(myBaseFaceToFill),
TopoDS::Face(mySDFaceToFill), G1, stateOfFaceOri);
- myMapOfEdgeWithFaceState.Bind(EOR, (Standard_Integer)stateOfFaceOri);
+ myMapOfEdgeWithFaceState.Bind (EOR, stateOfFaceOri);
WES.AddElement(EOR);
}
}
Standard_Boolean stateOfFaceOri = Standard_False;
OrientateEdgeOnFace(newE, TopoDS::Face(myBaseFaceToFill),
TopoDS::Face(mySDFaceToFill), G1, stateOfFaceOri);
- myMapOfEdgeWithFaceState.Bind(newE, (Standard_Integer)stateOfFaceOri);
+ myMapOfEdgeWithFaceState.Bind (newE, stateOfFaceOri);
WES.AddStartElement(newE);
}
if(!IsRev)
aPieceToKeep.Reverse();
- myMapOfEdgeWithFaceState.Bind(aPieceToKeep, (Standard_Integer)stateOfFaceOri);
+ myMapOfEdgeWithFaceState.Bind (aPieceToKeep, stateOfFaceOri);
WES.AddStartElement(aPieceToKeep);
}
Standard_Boolean stateOfFaceOri = Standard_False;
OrientateEdgeOnFace(aSplitPart, TopoDS::Face(myBaseFaceToFill),
TopoDS::Face(mySDFaceToFill), G1, stateOfFaceOri);
- myMapOfEdgeWithFaceState.Bind(aSplitPart, (Standard_Integer)stateOfFaceOri);
+ myMapOfEdgeWithFaceState.Bind (aSplitPart, stateOfFaceOri);
WES.AddStartElement(aSplitPart);
}
//compute orientation of the future face
Standard_Boolean stateOfFaceOri = Standard_False;
OrientateEdgeOnFace(aSplitPart, TopoDS::Face(myBaseFaceToFill), aSDFace, G1, stateOfFaceOri);
- myMapOfEdgeWithFaceState.Bind(aSplitPart, (Standard_Integer)stateOfFaceOri);
+ myMapOfEdgeWithFaceState.Bind (aSplitPart, stateOfFaceOri);
if(myBaseFaceToFill == mySDFaceToFill) {
mySourceShapes.Add(aSplitPart);
}
newE.Orientation(neworiE);
- myMapOfEdgeWithFaceState.Bind(newE, (Standard_Integer)stateOfFaceOri);
+ myMapOfEdgeWithFaceState.Bind (newE, stateOfFaceOri);
WES.AddStartElement(newE);
}
}//end iteration on splON
private:
-
-
TopTools_IndexedMapOfShape mySameDomMap;
TopoDS_Shape mySDFaceToFill;
TopoDS_Shape myBaseFaceToFill;
TopTools_IndexedDataMapOfShapeListOfShape myMapOfEdgeFaces;
- TopTools_DataMapOfOrientedShapeInteger myMapOfEdgeWithFaceState;
+ NCollection_DataMap<TopoDS_Shape, Standard_Boolean, TopTools_OrientedShapeMapHasher> myMapOfEdgeWithFaceState;
TopTools_IndexedMapOfShape myProcessedPartsOut2d;
TopTools_IndexedMapOfShape myProcessedPartsON2d;
TopTools_IndexedMapOfShape mySplitsONtoKeep;
TopTools_IndexedMapOfOrientedShape mySourceShapes;
TopTools_IndexedDataMapOfShapeShape myMapOfCorrect2dEdges;
-
};
-
-
-
-
-
-
#endif // _TopOpeBRepBuild_Builder1_HeaderFile
TopOpeBRepBuild_GTopo TopOpeBRepBuild_GTool::GFusUnsh
(const TopAbs_ShapeEnum t1, const TopAbs_ShapeEnum t2)
{
- return TopOpeBRepBuild_GTopo(0,0,0,
- 0,0,1,
- 0,1,0,
+ return TopOpeBRepBuild_GTopo(false, false, false,
+ false, false, true,
+ false, true, false,
t1,t2,
TopOpeBRepDS_UNSHGEOMETRY,TopOpeBRepDS_UNSHGEOMETRY);
}
TopOpeBRepBuild_GTopo TopOpeBRepBuild_GTool::GFusSame
(const TopAbs_ShapeEnum t1, const TopAbs_ShapeEnum t2)
{
- return TopOpeBRepBuild_GTopo(0,0,0,
- 0,1,1,
- 0,1,0,
+ return TopOpeBRepBuild_GTopo(false, false, false,
+ false, true, true,
+ false, true, false,
t1,t2,
TopOpeBRepDS_SAMEORIENTED,TopOpeBRepDS_SAMEORIENTED);
}
TopOpeBRepBuild_GTopo TopOpeBRepBuild_GTool::GFusDiff
(const TopAbs_ShapeEnum t1, const TopAbs_ShapeEnum t2)
{
- return TopOpeBRepBuild_GTopo(0,0,0,
- 0,0,1,
- 0,1,0,
+ return TopOpeBRepBuild_GTopo(false, false, false,
+ false, false, true,
+ false, true, false,
t1,t2,
TopOpeBRepDS_DIFFORIENTED,TopOpeBRepDS_SAMEORIENTED);
}
TopOpeBRepBuild_GTopo TopOpeBRepBuild_GTool::GCutUnsh
(const TopAbs_ShapeEnum t1, const TopAbs_ShapeEnum t2)
{
- return TopOpeBRepBuild_GTopo(0,1,0,
- 0,0,1,
- 0,0,0,
+ return TopOpeBRepBuild_GTopo(false, true, false,
+ false, false, true,
+ false, false, false,
t1,t2,
TopOpeBRepDS_UNSHGEOMETRY,TopOpeBRepDS_UNSHGEOMETRY);
}
TopOpeBRepBuild_GTopo TopOpeBRepBuild_GTool::GCutSame
(const TopAbs_ShapeEnum t1, const TopAbs_ShapeEnum t2)
{
- return TopOpeBRepBuild_GTopo(0,1,0,
- 0,0,1,
- 0,0,0,
+ return TopOpeBRepBuild_GTopo(false, true, false,
+ false, false, true,
+ false, false, false,
t1,t2,
TopOpeBRepDS_SAMEORIENTED,TopOpeBRepDS_SAMEORIENTED);
}
TopOpeBRepBuild_GTopo TopOpeBRepBuild_GTool::GCutDiff
(const TopAbs_ShapeEnum t1, const TopAbs_ShapeEnum t2)
{
- return TopOpeBRepBuild_GTopo(0,1,0,
- 0,1,1,
- 0,0,0,
+ return TopOpeBRepBuild_GTopo(false, true, false,
+ false, true, true,
+ false, false, false,
t1,t2,
TopOpeBRepDS_DIFFORIENTED,TopOpeBRepDS_SAMEORIENTED);
}
TopOpeBRepBuild_GTopo TopOpeBRepBuild_GTool::GComUnsh
(const TopAbs_ShapeEnum t1, const TopAbs_ShapeEnum t2)
{
- return TopOpeBRepBuild_GTopo(0,1,0,
- 1,0,0,
- 0,0,0,
+ return TopOpeBRepBuild_GTopo(false, true, false,
+ true, false, false,
+ false, false, false,
t1,t2,
TopOpeBRepDS_UNSHGEOMETRY,TopOpeBRepDS_UNSHGEOMETRY);
}
TopOpeBRepBuild_GTopo TopOpeBRepBuild_GTool::GComSame
(const TopAbs_ShapeEnum t1, const TopAbs_ShapeEnum t2)
{
- return TopOpeBRepBuild_GTopo(0,1,0,
- 1,1,0,
- 0,0,0,
+ return TopOpeBRepBuild_GTopo(false, true, false,
+ true, true, false,
+ false, false, false,
t1,t2,
TopOpeBRepDS_SAMEORIENTED,TopOpeBRepDS_SAMEORIENTED);
}
TopOpeBRepBuild_GTopo TopOpeBRepBuild_GTool::GComDiff
(const TopAbs_ShapeEnum t1, const TopAbs_ShapeEnum t2)
{
- return TopOpeBRepBuild_GTopo(0,1,0,
- 1,0,0,
- 0,0,0,
+ return TopOpeBRepBuild_GTopo(false, true, false,
+ true, false, false,
+ false, false, false,
t1,t2,
TopOpeBRepDS_DIFFORIENTED,TopOpeBRepDS_SAMEORIENTED);
}
//=======================================================================
TopOpeBRepBuild_GTopo::TopOpeBRepBuild_GTopo
-(const Standard_Integer ii,const Standard_Integer in,const Standard_Integer io,
- const Standard_Integer ni,const Standard_Integer nn,const Standard_Integer no,
- const Standard_Integer oi,const Standard_Integer on,const Standard_Integer oo,
+(const Standard_Boolean ii,const Standard_Boolean in,const Standard_Boolean io,
+ const Standard_Boolean ni,const Standard_Boolean nn,const Standard_Boolean no,
+ const Standard_Boolean oi,const Standard_Boolean on,const Standard_Boolean oo,
const TopAbs_ShapeEnum t1, const TopAbs_ShapeEnum t2,
const TopOpeBRepDS_Config C1, const TopOpeBRepDS_Config C2)
{
Reset();
- Set((Standard_Boolean)ii,(Standard_Boolean)in,(Standard_Boolean)io,
- (Standard_Boolean)ni,(Standard_Boolean)nn,(Standard_Boolean)no,
- (Standard_Boolean)oi,(Standard_Boolean)on,(Standard_Boolean)oo);
+ Set (ii, in, io,
+ ni, nn, no,
+ oi, on, oo);
myt1 = t1;
myt2 = t2;
myConfig1 = C1;
Standard_EXPORT TopOpeBRepBuild_GTopo();
- Standard_EXPORT TopOpeBRepBuild_GTopo(const Standard_Integer II, const Standard_Integer IN, const Standard_Integer IO, const Standard_Integer NI, const Standard_Integer NN, const Standard_Integer NO, const Standard_Integer OI, const Standard_Integer ON, const Standard_Integer OO, const TopAbs_ShapeEnum t1, const TopAbs_ShapeEnum t2, const TopOpeBRepDS_Config C1, const TopOpeBRepDS_Config C2);
-
+ Standard_EXPORT TopOpeBRepBuild_GTopo (const Standard_Boolean II, const Standard_Boolean IN, const Standard_Boolean IO,
+ const Standard_Boolean NI, const Standard_Boolean NN, const Standard_Boolean NO,
+ const Standard_Boolean OI, const Standard_Boolean ON, const Standard_Boolean OO,
+ const TopAbs_ShapeEnum t1, const TopAbs_ShapeEnum t2,
+ const TopOpeBRepDS_Config C1, const TopOpeBRepDS_Config C2);
+
Standard_EXPORT void Reset();
Standard_EXPORT void Set (const Standard_Boolean II, const Standard_Boolean IN, const Standard_Boolean IO, const Standard_Boolean NI, const Standard_Boolean NN, const Standard_Boolean NO, const Standard_Boolean OI, const Standard_Boolean ON, const Standard_Boolean OO);
if (!changev) return Standard_False;
changev = HDS->HasSameDomain(v);
if (!changev) return Standard_False;
- Standard_Boolean rankv = HDS->DS().AncestorRank(v);
+ Standard_Integer rankv = HDS->DS().AncestorRank(v);
changev = (rankv == 2);
return changev;
}
/*#ifdef OCCT_DEBUG
Standard_Boolean TKPB = TopOpeBRepBuild_GettraceKPB();
#endif*/
-
- Standard_Boolean iskp1 = KPisfafash(myShape1);
- if ( !iskp1 ) return 0;
-
- Standard_Boolean iskp2 = KPisfafash(myShape2);
- if ( !iskp2 ) return 0;
-
- return 1;
+
+ return KPisfafash(myShape1) != 0
+ && KPisfafash(myShape2) != 0
+ ? 1
+ : 0;
}
//=======================================================================
/*#ifdef OCCT_DEBUG
Standard_Boolean TKPB = TopOpeBRepBuild_GettraceKPB();
#endif*/
-
- Standard_Boolean iskp1 = KPissososh(myShape1);
- if ( !iskp1 ) return 0;
-
- Standard_Boolean iskp2 = KPissososh(myShape2);
- if ( !iskp2 ) return 0;
-
- return 1;
+
+ return KPissososh(myShape1) != 0
+ && KPissososh(myShape2) != 0
+ ? 1
+ : 0;
}
//=======================================================================
TopOpeBRepDS_ListOfInterference l1dFOR,l1dREV,l1dINT,l1dEXT; Standard_Integer FOR1d,REV1d,INT1d,EXT1d;
::FUN_scanloi(l1d, l1dFOR,FOR1d, l1dREV,REV1d, l1dINT,INT1d, l1dEXT,EXT1d);
- Standard_Boolean beforeIN1d = (REV1d + INT1d > 0); Standard_Boolean beforeOU1d = (FOR1d + EXT1d);
- Standard_Boolean afterIN1d = (FOR1d + INT1d > 0); Standard_Boolean afterOU1d = (REV1d + EXT1d);
+ Standard_Boolean beforeIN1d = (REV1d + INT1d > 0); Standard_Boolean beforeOU1d = (FOR1d + EXT1d) != 0;
+ Standard_Boolean afterIN1d = (FOR1d + INT1d > 0); Standard_Boolean afterOU1d = (REV1d + EXT1d) != 0;
TopOpeBRepDS_ListOfInterference l2dFOR,l2dREV,l2dINT,l2dEXT; Standard_Integer FOR2d,REV2d,INT2d,EXT2d;
::FUN_scanloi(l2d, l2dFOR,FOR2d, l2dREV,REV2d, l2dINT,INT2d, l2dEXT,EXT2d);
- Standard_Boolean beforeIN2d = (REV2d + INT2d > 0); Standard_Boolean beforeOU2d = (FOR2d + EXT2d);
- Standard_Boolean afterIN2d = (FOR2d + INT2d > 0); Standard_Boolean afterOU2d = (REV2d + EXT2d);
+ Standard_Boolean beforeIN2d = (REV2d + INT2d > 0); Standard_Boolean beforeOU2d = (FOR2d + EXT2d) != 0;
+ Standard_Boolean afterIN2d = (FOR2d + INT2d > 0); Standard_Boolean afterOU2d = (REV2d + EXT2d) != 0;
TopOpeBRepDS_ListOfInterference l3dFOR,l3dREV,l3dINT,l3dEXT; Standard_Integer FOR3d,REV3d,INT3d,EXT3d;
::FUN_scanloi(l3d, l3dFOR,FOR3d, l3dREV,REV3d, l3dINT,INT3d, l3dEXT,EXT3d);
- Standard_Boolean beforeIN3d = (REV3d + INT3d > 0); Standard_Boolean beforeOU3d = (FOR3d + EXT3d);
- Standard_Boolean afterIN3d = (FOR3d + INT3d > 0); Standard_Boolean afterOU3d = (REV3d + EXT3d);
+ Standard_Boolean beforeIN3d = (REV3d + INT3d > 0); Standard_Boolean beforeOU3d = (FOR3d + EXT3d) != 0;
+ Standard_Boolean afterIN3d = (FOR3d + INT3d > 0); Standard_Boolean afterOU3d = (REV3d + EXT3d) != 0;
// state before
stb = TopAbs_UNKNOWN; isb=0; bdim=0;
Standard_Boolean ispoint = (GT == TopOpeBRepDS_POINT);
Standard_Boolean isvertex = (GT == TopOpeBRepDS_VERTEX);
- Standard_Boolean nLI = LI.Extent();
+ Standard_Integer nLI = LI.Extent();
TopOpeBRepDS_ListIteratorOfListOfInterference it1(LI);
while (it1.More()) {
aTool.SetCurrentEdge(aEdge);
// [BEGIN] Processing non-manifold topology (ssv; 11.11.2010)
- Standard_Boolean isNMMode = Interface_Static::IVal("write.step.nonmanifold");
+ Standard_Boolean isNMMode = Interface_Static::IVal("write.step.nonmanifold") != 0;
if (isNMMode) {
Handle(StepShape_EdgeCurve) anEC;
Handle(TransferBRep_ShapeMapper) aSTEPMapper = TransferBRep::ShapeMapper(FP, aEdge);
new TransferBRep_ShapeMapper(aFace); // on ne sait jamais
// [BEGIN] Processing non-manifold topology (another approach) (ssv; 10.11.2010)
- Standard_Boolean isNMMode = Interface_Static::IVal("write.step.nonmanifold");
+ Standard_Boolean isNMMode = Interface_Static::IVal("write.step.nonmanifold") != 0;
if (isNMMode) {
Handle(StepShape_AdvancedFace) anAF;
Handle(TransferBRep_ShapeMapper) aSTEPMapper = TransferBRep::ShapeMapper(FP, aFace);
aTool.SetCurrentVertex(aVertex);
// [BEGIN] Processing non-manifold topology (ssv; 11.11.2010)
- Standard_Boolean isNMMode = Interface_Static::IVal("write.step.nonmanifold");
+ Standard_Boolean isNMMode = Interface_Static::IVal("write.step.nonmanifold") != 0;
if (isNMMode) {
Handle(StepShape_VertexPoint) aVP;
Handle(TransferBRep_ShapeMapper) aSTEPMapper = TransferBRep::ShapeMapper(FP, aVertex);
return 0;
}
-//==============================================================================
-//function : Displays,Erase...
-//purpose :
-//Draw arg :
-//==============================================================================
-static int VwrTst_DispErase(const Handle(AIS_InteractiveObject)& IO,
- const Standard_Integer Mode,
- const Standard_Integer TypeOfOperation,
- const Standard_Boolean Upd)
+enum TypeOfDispOperation
{
- Handle(AIS_InteractiveContext) Ctx = ViewerTest::GetAISContext();
+ TypeOfDispOperation_SetDispMode,
+ TypeOfDispOperation_UnsetDispMode
+};
- switch(TypeOfOperation){
- case 1:
- Ctx->Display(IO,Mode,Upd);
- break;
- case 2:{
- Ctx->Erase(IO,Upd);
- break;
- }
- case 3:{
- if(IO.IsNull())
- Ctx->SetDisplayMode((AIS_DisplayMode)Mode,Upd);
- else
- Ctx->SetDisplayMode(IO,Mode,Upd);
- break;
- }
- case 4:{
- if(IO.IsNull())
- Ctx->SetDisplayMode(0,Upd);
- else
- Ctx->UnsetDisplayMode(IO,Upd);
- break;
- }
+//! Displays,Erase...
+static void VwrTst_DispErase (const Handle(AIS_InteractiveObject)& thePrs,
+ const Standard_Integer theMode,
+ const TypeOfDispOperation theType,
+ const Standard_Boolean theToUpdate)
+{
+ Handle(AIS_InteractiveContext) aCtx = ViewerTest::GetAISContext();
+ switch (theType)
+ {
+ case TypeOfDispOperation_SetDispMode:
+ {
+ if (!thePrs.IsNull())
+ {
+ aCtx->SetDisplayMode (thePrs, theMode, theToUpdate);
+ }
+ else
+ {
+ aCtx->SetDisplayMode ((AIS_DisplayMode )theMode, theToUpdate);
+ }
+ break;
+ }
+ case TypeOfDispOperation_UnsetDispMode:
+ {
+ if (!thePrs.IsNull())
+ {
+ aCtx->UnsetDisplayMode (thePrs, theToUpdate);
+ }
+ else
+ {
+ aCtx->SetDisplayMode (AIS_WireFrame, theToUpdate);
+ }
+ break;
+ }
}
- return 0;
}
//=======================================================================
//=======================================================================
static int VDispMode (Draw_Interpretor& , Standard_Integer argc, const char** argv)
{
-
- TCollection_AsciiString name;
- if(argc>3)
+ if (argc < 1
+ || argc > 3)
+ {
+ std::cout << "Syntax error: wrong number of arguments\n";
return 1;
- // display others presentations
- Standard_Integer TypeOfOperation = (strcasecmp(argv[0],"vdispmode")==0)? 1:
- (strcasecmp(argv[0],"verasemode")==0) ? 2 :
- (strcasecmp(argv[0],"vsetdispmode")==0) ? 3 :
- (strcasecmp(argv[0],"vunsetdispmode")==0) ? 4 : -1;
-
- Handle(AIS_InteractiveContext) Ctx = ViewerTest::GetAISContext();
+ }
- //unset displaymode.. comportement particulier...
- if(TypeOfOperation==4){
- if(argc==1){
- if(Ctx->NbSelected()==0){
- Handle(AIS_InteractiveObject) IO;
- VwrTst_DispErase(IO,-1,4,Standard_False);
+ TypeOfDispOperation aType = TCollection_AsciiString (argv[0]) == "vunsetdispmode"
+ ? TypeOfDispOperation_UnsetDispMode
+ : TypeOfDispOperation_SetDispMode;
+ Handle(AIS_InteractiveContext) aCtx = ViewerTest::GetAISContext();
+ if (aType == TypeOfDispOperation_UnsetDispMode)
+ {
+ if (argc == 1)
+ {
+ if (aCtx->NbSelected() == 0)
+ {
+ VwrTst_DispErase (Handle(AIS_InteractiveObject)(), -1, TypeOfDispOperation_UnsetDispMode, Standard_False);
+ }
+ else
+ {
+ for (aCtx->InitSelected(); aCtx->MoreSelected(); aCtx->NextSelected())
+ {
+ VwrTst_DispErase (aCtx->SelectedInteractive(), -1, TypeOfDispOperation_UnsetDispMode, Standard_False);
+ }
}
- else{
- for(Ctx->InitSelected();Ctx->MoreSelected();Ctx->NextSelected())
- VwrTst_DispErase(Ctx->SelectedInteractive(),-1,4,Standard_False);}
- Ctx->UpdateCurrentViewer();
+ aCtx->UpdateCurrentViewer();
}
- else{
- Handle(AIS_InteractiveObject) IO;
- name = argv[1];
- if(GetMapOfAIS().IsBound2(name)){
- IO = Handle(AIS_InteractiveObject)::DownCast(GetMapOfAIS().Find2(name));
- if (!IO.IsNull())
- VwrTst_DispErase(IO,-1,4,Standard_True);
+ else
+ {
+ TCollection_AsciiString aName = argv[1];
+ if (GetMapOfAIS().IsBound2 (aName))
+ {
+ Handle(AIS_InteractiveObject) aPrs = Handle(AIS_InteractiveObject)::DownCast(GetMapOfAIS().Find2 (aName));
+ if (!aPrs.IsNull())
+ {
+ VwrTst_DispErase (aPrs, -1, TypeOfDispOperation_UnsetDispMode, Standard_True);
+ }
}
}
}
- else if(argc==2){
- Standard_Integer Dmode = Draw::Atoi(argv[1]);
- if(Ctx->NbSelected()==0 && TypeOfOperation==3){
- Handle(AIS_InteractiveObject) IO;
- VwrTst_DispErase(IO,Dmode,TypeOfOperation,Standard_True);
- }
- if(!Ctx->HasOpenedContext()){
- // set/unset display mode sur le Contexte...
- for(Ctx->InitSelected();Ctx->MoreSelected();Ctx->NextSelected()){
- VwrTst_DispErase(Ctx->SelectedInteractive(),Dmode,TypeOfOperation,Standard_False);
- }
- Ctx->UpdateCurrentViewer();
+ else if (argc == 2)
+ {
+ Standard_Integer aDispMode = Draw::Atoi (argv[1]);
+ if (aCtx->NbSelected() == 0
+ && aType == TypeOfDispOperation_SetDispMode)
+ {
+ VwrTst_DispErase (Handle(AIS_InteractiveObject)(), aDispMode, TypeOfDispOperation_SetDispMode, Standard_True);
}
- else{
- for(Ctx->InitSelected();Ctx->MoreSelected();Ctx->NextSelected())
- Ctx->Display(Ctx->SelectedInteractive(),Dmode);
+ for (aCtx->InitSelected(); aCtx->MoreSelected(); aCtx->NextSelected())
+ {
+ VwrTst_DispErase (aCtx->SelectedInteractive(), aDispMode, aType, Standard_False);
}
+ aCtx->UpdateCurrentViewer();
}
- else{
- Handle(AIS_InteractiveObject) IO;
- name = argv[1];
- if(GetMapOfAIS().IsBound2(name))
- IO = Handle(AIS_InteractiveObject)::DownCast(GetMapOfAIS().Find2(name));
- if (!IO.IsNull())
- VwrTst_DispErase(IO,Draw::Atoi(argv[2]),TypeOfOperation,Standard_True);
+ else
+ {
+ Handle(AIS_InteractiveObject) aPrs;
+ TCollection_AsciiString aName (argv[1]);
+ if (GetMapOfAIS().IsBound2 (aName))
+ {
+ aPrs = Handle(AIS_InteractiveObject)::DownCast(GetMapOfAIS().Find2 (aName));
+ }
+ if (!aPrs.IsNull())
+ {
+ VwrTst_DispErase (aPrs, Draw::Atoi(argv[2]), aType, Standard_True);
+ }
}
return 0;
}
}
else
{
- Standard_Boolean toActivate = Draw::Atoi (theArgVec[1]);
+ Standard_Boolean toActivate = Draw::Atoi (theArgVec[1]) != 0;
aCtx->SetAutoActivateSelection (toActivate);
}
"vdisplaytype : vdisplaytype <Type> <Signature> \n\t display all the objects of one given kind (see vtypes) which are stored the AISContext ",
__FILE__,VDisplayType,group);
- theCommands.Add("vdisplaymode",
- "vdispmode : vdispmode [name] mode(1,2,..) : no name -> on selected objects ",
- __FILE__,VDispMode,group);
-
- theCommands.Add("verasemode",
- "verasemode : verasemode [name] mode(1,2,..) : no name -> on selected objects",
- __FILE__,VDispMode,group);
-
theCommands.Add("vsetdispmode",
"vsetdispmode [name] mode(1,2,..)"
"\n\t\t: Sets display mode for all, selected or named objects.",
//===============================================================================================
Standard_Boolean ViewerTest_CmdParser::ArgBool (const std::string& theOptionName, const Standard_Integer theArgumentIndex)
{
- return static_cast<Standard_Boolean> (Draw::Atoi (Arg (theOptionName, theArgumentIndex).c_str()));
+ return Draw::Atoi (Arg (theOptionName, theArgumentIndex).c_str()) != 0;
}
{
// Get arguments
TCollection_AsciiString aName(argv[1]);
- Standard_Boolean isFilled = (Standard_Boolean)Draw::Atoi(argv[5]);
+ Standard_Boolean isFilled = Draw::Atoi(argv[5]) != 0;
Handle(AIS_InteractiveObject) theShapeA;
Handle(AIS_InteractiveObject) theShapeB;
}
const Standard_Integer aSelectionMode = Draw::Atoi (anArgNb == 3 ? theArgv[1] : theArgv[2]);
- const Standard_Boolean toTurnOn = Draw::Atoi (anArgNb == 3 ? theArgv[2] : theArgv[3]);
+ const Standard_Boolean toTurnOn = Draw::Atoi (anArgNb == 3 ? theArgv[2] : theArgv[3]) != 0;
if (aSelectionMode == 0 && anAISContext->HasOpenedContext())
{
anAISContext->CloseLocalContext();
ViewerTest::GetAISContext()->CurrentViewer()->RedrawImmediate();
}
- VT_ProcessButton1Release (fwKeys & MK_SHIFT);
+ VT_ProcessButton1Release ((fwKeys & MK_SHIFT) != 0);
}
IsDragged = Standard_False;
return ViewerWindowProc( hwnd, Msg, wParam, lParam );
if (Msg == WM_LBUTTONDOWN)
{
- if (fwKeys & MK_CONTROL)
+ if ((fwKeys & MK_CONTROL) != 0)
{
- Ppick = VT_ProcessButton1Press (Pargc, Pargv, Ppick, (fwKeys & MK_SHIFT));
+ Ppick = VT_ProcessButton1Press (Pargc, Pargv, Ppick, (fwKeys & MK_SHIFT) != 0);
}
else
{
- VT_ProcessButton1Press (Pargc, Pargv, Ppick, (fwKeys & MK_SHIFT));
+ VT_ProcessButton1Press (Pargc, Pargv, Ppick, (fwKeys & MK_SHIFT) != 0);
}
}
else if (Msg == WM_RBUTTONDOWN)
Y_Motion = HIWORD(lParam);
if ( Up &&
- fwKeys & ( MK_LBUTTON|MK_MBUTTON|MK_RBUTTON ) ) {
+ (fwKeys & ( MK_LBUTTON|MK_MBUTTON|MK_RBUTTON )) != 0 )
+ {
Up = 0;
X_ButtonPress = LOWORD(lParam);
Y_ButtonPress = HIWORD(lParam);
- if ( fwKeys & MK_RBUTTON ) {
+ if ((fwKeys & MK_RBUTTON) != 0) {
// Start rotation
VT_ProcessButton3Press();
}
}
- if ( fwKeys & MK_CONTROL ) {
- if ( fwKeys & MK_LBUTTON ) {
+ if ((fwKeys & MK_CONTROL) != 0)
+ {
+ if ((fwKeys & MK_LBUTTON) != 0)
+ {
ProcessControlButton1Motion();
}
- else if ( fwKeys & MK_MBUTTON ||
- ((fwKeys&MK_LBUTTON) &&
- (fwKeys&MK_RBUTTON) ) ){
- VT_ProcessControlButton2Motion();
- }
- else if ( fwKeys & MK_RBUTTON ) {
+ else if ((fwKeys & MK_MBUTTON) != 0
+ || ((fwKeys & MK_LBUTTON) != 0
+ && (fwKeys & MK_RBUTTON) != 0))
+ {
+ VT_ProcessControlButton2Motion();
+ }
+ else if ((fwKeys & MK_RBUTTON) != 0)
+ {
VT_ProcessControlButton3Motion();
}
}
}
Standard_Integer isToAllow = isShiftSelection ? Draw::Atoi(argv[argc - 2]) : Draw::Atoi(argv[argc - 1]);
- myAIScontext->MainSelector()->AllowOverlapDetection((Standard_Boolean)isToAllow);
+ myAIScontext->MainSelector()->AllowOverlapDetection (isToAllow != 0);
aCoordsNb -= 2;
}
if(Label().FindChild(ChildLab_Class).FindAttribute(TDataStd_IntegerArray::GetID(), aClass)
&& !aClass->Array().IsNull() && aClass->Array()->Length() > 0)
{
- anObj->SetClassOfTolerance(aClass->Array()->Value(1), (XCAFDimTolObjects_DimensionFormVariance)aClass->Array()->Value(2), (XCAFDimTolObjects_DimensionGrade)aClass->Array()->Value(3));
+ anObj->SetClassOfTolerance(aClass->Array()->Value(1) != 0, (XCAFDimTolObjects_DimensionFormVariance)aClass->Array()->Value(2), (XCAFDimTolObjects_DimensionGrade)aClass->Array()->Value(3));
}
Handle(TDataStd_IntegerArray) aDec;
Handle(MeshVS_Mesh) aMesh = getMesh (theArgv[1], theDI);
if (!aMesh.IsNull())
{
- Standard_Integer aFlag = Draw::Atoi (theArgv[2]);
+ Standard_Boolean aFlag = Draw::Atoi (theArgv[2]) != 0;
aMesh->GetDrawer()->SetBoolean (MeshVS_DA_SupressBackFaces, aFlag);
Handle( AIS_InteractiveContext ) aContext = ViewerTest::GetAISContext();
aMesh->AddBuilder(aBuilder, Standard_True);
}
- aMesh->GetDrawer()->SetBoolean ( MeshVS_DA_ColorReflection, Standard_Boolean(aReflection) );
+ aMesh->GetDrawer()->SetBoolean (MeshVS_DA_ColorReflection, aReflection != 0);
anIC->Redisplay( aMesh );
}
}
else if (aParam == "-issimple")
{
- isSimplePrs = Draw::Atoi(argv[anIdx]);
+ isSimplePrs = Draw::Atoi(argv[anIdx]) != 0;
}
aParam.Clear();
}
return Standard_False;
}
else
- aDelta = (Standard_Boolean)aDeltaValue;
+ aDelta = aDeltaValue != 0;
}
#ifdef OCCT_DEBUG
else if(XmlMDataStd::DocumentVersion() == -1)
theTarget.Element().setAttribute(::FirstIndexString(), aL);
theTarget.Element().setAttribute(::LastIndexString(), anU);
- theTarget.Element().setAttribute(::IsDeltaOn(),aByteArray->GetDelta());
+ theTarget.Element().setAttribute(::IsDeltaOn(),aByteArray->GetDelta() ? 1 : 0);
const Handle(TColStd_HArray1OfByte)& hArr = aByteArray->InternalArray();
if (!hArr.IsNull() && hArr->Length())
return Standard_False;
}
else
- aDelta = (Standard_Boolean)aDeltaValue;
+ aDelta = aDeltaValue != 0;
}
#ifdef OCCT_DEBUG
else if(XmlMDataStd::DocumentVersion() == -1)
if (aL != 1) anElement.setAttribute(::FirstIndexString(), aL);
anElement.setAttribute(::LastIndexString(), anU);
- anElement.setAttribute(::IsDeltaOn(), aExtStringArray->GetDelta());
+ anElement.setAttribute(::IsDeltaOn(), aExtStringArray->GetDelta() ? 1 : 0);
// Find a separator.
Standard_Boolean found(Standard_True);
return Standard_False;
}
else
- aDelta = (Standard_Boolean)aDeltaValue;
+ aDelta = aDeltaValue != 0;
}
#ifdef OCCT_DEBUG
else if(XmlMDataStd::DocumentVersion() == -1)
Standard_Integer aSize = (aS->IsEmpty()) ? 0 : aS->Extent();
theTarget.Element().setAttribute(::IntPackedMapSize(), aSize);
- theTarget.Element().setAttribute(::IsDeltaOn(),aS->GetDelta());
+ theTarget.Element().setAttribute(::IsDeltaOn(), aS->GetDelta() ? 1 : 0);
if(aSize)
{
return Standard_False;
}
else
- aDelta = (Standard_Boolean)aDeltaValue;
+ aDelta = aDeltaValue != 0;
}
#ifdef OCCT_DEBUG
else if(XmlMDataStd::DocumentVersion() == -1)
if (aL != 1)
theTarget.Element().setAttribute(::FirstIndexString(), aL);
theTarget.Element().setAttribute(::LastIndexString(), anU);
- theTarget.Element().setAttribute(::IsDeltaOn(), anIntArray->GetDelta());
+ theTarget.Element().setAttribute(::IsDeltaOn(), anIntArray->GetDelta() ? 1 : 0);
// Allocation of 12 chars for each integer including the space.
// An example: -2 147 483 648
return Standard_False;
}
else
- aDelta = (Standard_Boolean)aDeltaValue;
+ aDelta = aDeltaValue != 0;
}
#ifdef OCCT_DEBUG
else if(XmlMDataStd::DocumentVersion() == -1)
if (aL != 1) theTarget.Element().setAttribute(::FirstIndexString(), aL);
theTarget.Element().setAttribute(::LastIndexString(), anU);
- theTarget.Element().setAttribute(::IsDeltaOn(), aRealArray->GetDelta());
+ theTarget.Element().setAttribute(::IsDeltaOn(), aRealArray->GetDelta() ? 1 : 0);
// Allocation of 25 chars for each double value including the space:
// An example: -3.1512678732195273e+020