Avoid warnings by means of ifdef/ifndef or removing unused code.
aCurrent = clock_t(anUserSeconds + aSystemSeconds);
anElapCurrent = clock_t(aTimer.ElapsedTime());
- if ((aCurrent - CPU_CURRENT) >= CPU_LIMIT)
+ if (CPU_LIMIT > 0 && (aCurrent - CPU_CURRENT) >= CPU_LIMIT)
{
cout << "Process killed by CPU limit (" << CPU_LIMIT << " sec)" << endl;
aTimer.Stop();
ExitProcess (2);
}
- if ((anElapCurrent) >= CPU_LIMIT)
+ if (CPU_LIMIT > 0 && anElapCurrent >= CPU_LIMIT)
{
cout << "Process killed by elapsed limit (" << CPU_LIMIT << " sec)" << endl;
aTimer.Stop();
{
sleep (5);
anElapCurrent = clock_t(aTimer.ElapsedTime());
- if ( CPU_LIMIT < 0 )
- return NULL;
- if ((anElapCurrent) >= CPU_LIMIT) {
+ if (CPU_LIMIT >0 && (anElapCurrent) >= CPU_LIMIT) {
cout << "Process killed by elapsed limit (" << CPU_LIMIT << " sec)" << endl;
exit(2);
}
#include <dirent.h>
#include <stdio.h>
#include <sys/stat.h>
-//const OSD_WhoAmI Iam = OSD_WDirectoryIterator;
-OSD_DirectoryIterator::OSD_DirectoryIterator() {
- myDescr = NULL ;
+OSD_DirectoryIterator::OSD_DirectoryIterator()
+: myFlag(0),
+ myDescr(0),
+ myEntry(0),
+ myInit(0)
+{
}
OSD_DirectoryIterator::OSD_DirectoryIterator(const OSD_Path& where,
- const TCollection_AsciiString& Mask){
- myDescr = NULL ;
+ const TCollection_AsciiString& Mask)
+: myFlag(0),
+ myDescr(0),
+ myEntry(0),
+ myInit(0)
+{
Initialize(where, Mask) ;
}
//! Returns error number if 'Failed' is TRUE.
Standard_EXPORT Standard_Integer Error() const;
-
-
-
-protected:
-
-
-
-
-
private:
-
-
-
OSD_Directory TheIterator;
Standard_Integer myFlag;
TCollection_AsciiString myMask;
TCollection_AsciiString myPlace;
- Standard_Address myDescr;
- Standard_Address myEntry;
- Standard_Integer myInit;
OSD_Error myError;
+
+ // platform-specific fields
+#ifdef _WIN32
Standard_Address myHandle;
Standard_Address myData;
Standard_Boolean myFirstCall;
-
-
+#else
+ Standard_Address myDescr;
+ Standard_Address myEntry;
+ Standard_Integer myInit;
+#endif
};
-
-
-
-
-
-
#endif // _OSD_DirectoryIterator_HeaderFile
//const OSD_WhoAmI Iam = OSD_WFileIterator;
-OSD_FileIterator::OSD_FileIterator() {
- myDescr = NULL ;
+OSD_FileIterator::OSD_FileIterator()
+: myFlag(0),
+ myDescr(0),
+ myEntry(0),
+ myInit(0)
+{
}
OSD_FileIterator::OSD_FileIterator(const OSD_Path& where,
- const TCollection_AsciiString& Mask){
- myDescr = NULL ;
+ const TCollection_AsciiString& Mask)
+: myFlag(0),
+ myDescr(0),
+ myEntry(0),
+ myInit(0)
+{
Initialize(where, Mask) ;
}
#ifndef _OSD_FileIterator_HeaderFile
#define _OSD_FileIterator_HeaderFile
-#include <Standard.hxx>
-#include <Standard_DefineAlloc.hxx>
-#include <Standard_Handle.hxx>
-
#include <OSD_File.hxx>
-#include <Standard_Integer.hxx>
-#include <TCollection_AsciiString.hxx>
-#include <Standard_Address.hxx>
#include <OSD_Error.hxx>
-#include <Standard_Boolean.hxx>
+#include <TCollection_AsciiString.hxx>
+
class OSD_OSDError;
class OSD_Path;
-class TCollection_AsciiString;
class OSD_File;
-
-//! Manages a breadth-only search for files in the specified
-//! Path.
+//! Manages a breadth-only search for files in the specified Path.
//! There is no specific order of results.
class OSD_FileIterator
{
//! Returns error number if 'Failed' is TRUE.
Standard_EXPORT Standard_Integer Error() const;
-
-
-
-protected:
-
-
-
-
-
private:
-
-
OSD_File TheIterator;
Standard_Integer myFlag;
TCollection_AsciiString myMask;
TCollection_AsciiString myPlace;
- Standard_Address myDescr;
- Standard_Address myEntry;
- Standard_Integer myInit;
OSD_Error myError;
+
+ // platform-specific fields
+#ifdef _WIN32
Standard_Address myHandle;
Standard_Address myData;
Standard_Boolean myFirstCall;
-
-
+#else
+ Standard_Address myDescr;
+ Standard_Address myEntry;
+ Standard_Integer myInit;
+#endif
};
-
-
-
-
-
-
#endif // _OSD_FileIterator_HeaderFile
static const OpenGl_AspectFace myDefaultAspectFace;
static const OpenGl_AspectMarker myDefaultAspectMarker;
- static const OpenGl_TextParam myDefaultTextParam =
- {
- 16, Graphic3d_HTA_LEFT, Graphic3d_VTA_BOTTOM
- };
-
static const OpenGl_Matrix myDefaultMatrix =
{
{{ 1.0F, 0.0F, 0.0F, 0.0F },
const Standard_Boolean theIsInterior)
: Select3D_SensitiveSet (theOwnerId),
myTriangul (theTrg),
- myInitLocation (theInitLoc),
- myDetectedTr (-1)
+ myInitLocation (theInitLoc)
{
myInvInitLocation = myInitLocation.Transformation().Inverted();
mySensType = theIsInterior ? Select3D_TOS_INTERIOR : Select3D_TOS_BOUNDARY;
myTriangul (theTrg),
myInitLocation (theInitLoc),
myCDG3D (theCOG),
- myFreeEdges (theFreeEdges),
- myDetectedTr (-1)
+ myFreeEdges (theFreeEdges)
{
myInvInitLocation = myInitLocation.Transformation().Inverted();
mySensType = theIsInterior ? Select3D_TOS_INTERIOR : Select3D_TOS_BOUNDARY;
gp_Pnt myCDG3D; //!< Center of the whole triangulation
Handle(TColStd_HArray1OfInteger) myFreeEdges;
Standard_Boolean mySensType; //!< Type of sensitivity: boundary or interior
- Standard_Integer myDetectedTr;
Standard_Integer myPrimitivesNb; //!< Amount of free edges or triangles depending on sensitivity type
Handle(TColStd_HArray1OfInteger) myBVHPrimIndexes; //!< Indexes of edges or triangles for BVH build
mutable Select3D_BndBox3d myBndBox; //!< Bounding box of the whole triangulation
TopOpeBRepTool_SC.hxx
TopOpeBRepTool_ShapeClassifier.cxx
TopOpeBRepTool_ShapeClassifier.hxx
-TopOpeBRepTool_ShapeExplorer.cxx
TopOpeBRepTool_ShapeExplorer.hxx
TopOpeBRepTool_ShapeTool.cxx
TopOpeBRepTool_ShapeTool.hxx
+++ /dev/null
-// Created on: 1995-07-13
-// Created by: Jean Yves LEBEY
-// 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.
-
-
-#include <Standard_NoMoreObject.hxx>
-#include <Standard_NoSuchObject.hxx>
-#include <TopAbs.hxx>
-#include <TopoDS_Shape.hxx>
-#include <TopOpeBRepTool_ShapeExplorer.hxx>
-
-//=======================================================================
-//function : TopOpeBRepTool_ShapeExplorer
-//purpose :
-//=======================================================================
-TopOpeBRepTool_ShapeExplorer::TopOpeBRepTool_ShapeExplorer() :
- myIndex(0),
- myNbShapes(0)
-{
-}
-
-
-//=======================================================================
-//function : TopOpeBRepTool_ShapeExplorer
-//purpose :
-//=======================================================================
-
-TopOpeBRepTool_ShapeExplorer::TopOpeBRepTool_ShapeExplorer
- (const TopoDS_Shape& S,
- const TopAbs_ShapeEnum ToFind,
- const TopAbs_ShapeEnum ToAvoid)
-{
- Init(S,ToFind,ToAvoid);
-}
-
-
-//=======================================================================
-//function : Init
-//purpose :
-//=======================================================================
-
-void TopOpeBRepTool_ShapeExplorer::Init(const TopoDS_Shape& S,
- const TopAbs_ShapeEnum ToFind,
- const TopAbs_ShapeEnum ToAvoid)
-{
- myExplorer.Init(S,ToFind,ToAvoid);
-
-#ifdef OCCT_DEBUG
- myIndex = myNbShapes = 0;
- for (;More();Next()) myNbShapes++;
- myExplorer.ReInit();
- if (More()) myIndex = 1;
-#endif
-
-}
-
-//=======================================================================
-//function : More
-//purpose :
-//=======================================================================
-
-Standard_Boolean TopOpeBRepTool_ShapeExplorer::More()const
-{
- Standard_Boolean b = myExplorer.More();
- return b;
-}
-
-//=======================================================================
-//function : Next
-//purpose :
-//=======================================================================
-
-void TopOpeBRepTool_ShapeExplorer::Next()
-{
- myExplorer.Next();
-#ifdef OCCT_DEBUG
- myIndex++;
-#endif
-}
-
-//=======================================================================
-//function : Current
-//purpose :
-//=======================================================================
-
-const TopoDS_Shape& TopOpeBRepTool_ShapeExplorer::Current()const
-{
- const TopoDS_Shape& S = myExplorer.Current();
- return S;
-}
-
-
-//=======================================================================
-//function : NbShapes
-//purpose :
-//=======================================================================
-
-Standard_Integer TopOpeBRepTool_ShapeExplorer::NbShapes()const
-{
- Standard_Integer n = 0;
-#ifdef OCCT_DEBUG
- n = myNbShapes;
-#endif
- return n;
-}
-
-
-//=======================================================================
-//function : Index
-//purpose :
-//=======================================================================
-
-Standard_Integer TopOpeBRepTool_ShapeExplorer::Index()const
-{
- Standard_Integer n = 0;
-#ifdef OCCT_DEBUG
- n = myIndex;
-#endif
- return n;
-}
-
-//=======================================================================
-//function : DumpCurrent
-//purpose :
-//=======================================================================
-
-Standard_OStream& TopOpeBRepTool_ShapeExplorer::DumpCurrent
-(Standard_OStream& OS)const
-{
-#ifdef OCCT_DEBUG
- if ( More() ) {
- const TopoDS_Shape& S = Current();
- TopAbs_ShapeEnum T = S.ShapeType();
- TopAbs_Orientation O = S.Orientation();
- Standard_Integer I = Index();
- TopAbs::Print(T,cout);
- cout<<"("<<I<<","; TopAbs::Print(O,cout); cout<<") ";
- }
-#endif
- return OS;
-}
#ifndef _TopOpeBRepTool_ShapeExplorer_HeaderFile
#define _TopOpeBRepTool_ShapeExplorer_HeaderFile
-#include <Standard.hxx>
-#include <Standard_DefineAlloc.hxx>
-#include <Standard_Handle.hxx>
-
#include <TopExp_Explorer.hxx>
-#include <Standard_Integer.hxx>
-#include <TopAbs_ShapeEnum.hxx>
-#include <Standard_Boolean.hxx>
-#include <Standard_OStream.hxx>
-class TopoDS_Shape;
-
+#include <TopAbs.hxx>
+//! Extends TopExp_Explorer by counting index of current item
+//! (for tracing and debug)
-class TopOpeBRepTool_ShapeExplorer
+class TopOpeBRepTool_ShapeExplorer : public TopExp_Explorer
{
public:
- DEFINE_STANDARD_ALLOC
-
-
//! Creates an empty explorer, becomes usefull after Init.
- Standard_EXPORT TopOpeBRepTool_ShapeExplorer();
+ TopOpeBRepTool_ShapeExplorer() : myIndex(0)
+ {
+ }
//! Creates an Explorer on the Shape <S>.
//!
//! exploration. If <ToAvoid> is equal or less
//! complex than <ToFind> or if <ToAVoid> is SHAPE it
//! has no effect on the exploration.
- Standard_EXPORT TopOpeBRepTool_ShapeExplorer(const TopoDS_Shape& S, const TopAbs_ShapeEnum ToFind, const TopAbs_ShapeEnum ToAvoid = TopAbs_SHAPE);
+ TopOpeBRepTool_ShapeExplorer(const TopoDS_Shape& S, const TopAbs_ShapeEnum ToFind, const TopAbs_ShapeEnum ToAvoid = TopAbs_SHAPE)
+ : TopExp_Explorer (S, ToFind, ToAvoid), myIndex(More() ? 1 : 0)
+ {
+ }
- Standard_EXPORT void Init (const TopoDS_Shape& S, const TopAbs_ShapeEnum ToFind, const TopAbs_ShapeEnum ToAvoid = TopAbs_SHAPE);
-
- //! Returns True if there are more shapes in the
- //! exploration.
- Standard_EXPORT Standard_Boolean More() const;
+ void Init (const TopoDS_Shape& S, const TopAbs_ShapeEnum ToFind, const TopAbs_ShapeEnum ToAvoid = TopAbs_SHAPE)
+ {
+ TopExp_Explorer::Init(S,ToFind,ToAvoid);
+ myIndex = (More() ? 1 : 0);
+ }
//! Moves to the next Shape in the exploration.
- Standard_EXPORT void Next();
-
- //! Returns the current shape in the exploration.
- Standard_EXPORT const TopoDS_Shape& Current() const;
-
- Standard_EXPORT Standard_Integer NbShapes() const;
-
- Standard_EXPORT Standard_Integer Index() const;
-
- Standard_EXPORT Standard_OStream& DumpCurrent (Standard_OStream& OS) const;
-
-
-
-
-protected:
-
-
-
-
+ void Next()
+ {
+ if (More())
+ myIndex++;
+ TopExp_Explorer::Next();
+ }
+
+ //! Index of current sub-shape
+ Standard_Integer Index() const { return myIndex; }
+
+ //! Dump info on current shape to stream
+ Standard_OStream& DumpCurrent (Standard_OStream& OS) const
+ {
+ if (More())
+ {
+ TopAbs::Print (Current().ShapeType(), OS);
+ OS << "(" << Index() << ",";
+ TopAbs::Print (Current().Orientation(), OS);
+ OS << ") ";
+ }
+ return OS;
+ }
private:
-
-
-
- TopExp_Explorer myExplorer;
Standard_Integer myIndex;
- Standard_Integer myNbShapes;
-
-
};
-
-
-
-
-
-
#endif // _TopOpeBRepTool_ShapeExplorer_HeaderFile