mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0026780: Coding rules - eliminate warnings on Linux and Mac
Avoid warnings by means of ifdef/ifndef or removing unused code.
This commit is contained in:
@@ -75,7 +75,6 @@ TopOpeBRepTool_SC.cxx
|
||||
TopOpeBRepTool_SC.hxx
|
||||
TopOpeBRepTool_ShapeClassifier.cxx
|
||||
TopOpeBRepTool_ShapeClassifier.hxx
|
||||
TopOpeBRepTool_ShapeExplorer.cxx
|
||||
TopOpeBRepTool_ShapeExplorer.hxx
|
||||
TopOpeBRepTool_ShapeTool.cxx
|
||||
TopOpeBRepTool_ShapeTool.hxx
|
||||
|
@@ -1,153 +0,0 @@
|
||||
// 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;
|
||||
}
|
@@ -17,28 +17,20 @@
|
||||
#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>.
|
||||
//!
|
||||
@@ -49,50 +41,43 @@ public:
|
||||
//! 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
|
||||
|
Reference in New Issue
Block a user