1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-03 14:10:33 +03:00

0024002: Overall code and build procedure refactoring -- automatic

Automatic upgrade of OCCT code by command "occt_upgrade . -nocdl":
- WOK-generated header files from inc and sources from drv are moved to src
- CDL files removed
- All packages are converted to nocdlpack
This commit is contained in:
abv
2015-07-12 07:42:38 +03:00
parent 543a996496
commit 42cf5bc1ca
15354 changed files with 623957 additions and 509844 deletions

6
src/TopExp/FILES Normal file
View File

@@ -0,0 +1,6 @@
TopExp.cxx
TopExp.hxx
TopExp_Explorer.cxx
TopExp_Explorer.hxx
TopExp_Explorer.lxx
TopExp_Stack.hxx

View File

@@ -1,113 +0,0 @@
-- Created on: 1990-12-20
-- Created by: Remi Lequette
-- Copyright (c) 1990-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.
package TopExp
---Purpose: This package provides basic tools to explore the
-- topological data structures.
--
-- * Explorer : A tool to find all sub-shapes of a given
-- type. e.g. all faces of a solid.
--
-- * Package methods to map sub-shapes of a shape.
--
-- Level : Public
-- All methods of all classes will be public.
uses
TCollection,
TopLoc,
TopAbs,
TopoDS,
TopTools
is
pointer Stack to Iterator from TopoDS;
class Explorer;
---Purpose: Tool to explore a topological data structure.
--
-- Package methods
--
MapShapes(S : Shape from TopoDS;
T : ShapeEnum from TopAbs;
M : in out IndexedMapOfShape from TopTools);
---Purpose: Stores in the map <M> all the sub-shapes of <S>
-- of type <T>.
--
-- Warning: The map is not cleared at first.
MapShapes(S : Shape from TopoDS;
M : in out IndexedMapOfShape from TopTools);
---Purpose: Stores in the map <M> all the sub-shapes of <S>.
MapShapesAndAncestors
(S : Shape from TopoDS;
TS : ShapeEnum from TopAbs;
TA : ShapeEnum from TopAbs;
M : in out IndexedDataMapOfShapeListOfShape from TopTools);
---Purpose: Stores in the map <M> all the subshape of <S> of
-- type <TS> for each one append to the list all
-- the ancestors of type <TA>. For example map all
-- the edges and bind the list of faces.
-- Warning: The map is not cleared at first.
FirstVertex(E : Edge from TopoDS;
CumOri : Boolean from Standard = Standard_False)
returns Vertex from TopoDS;
---Purpose: Returns the Vertex of orientation FORWARD in E. If
-- there is none returns a Null Shape.
-- CumOri = True : taking account the edge orientation
LastVertex(E : Edge from TopoDS;
CumOri : Boolean from Standard = Standard_False)
returns Vertex from TopoDS;
---Purpose: Returns the Vertex of orientation REVERSED in E. If
-- there is none returns a Null Shape.
-- CumOri = True : taking account the edge orientation
Vertices(E : Edge from TopoDS; Vfirst, Vlast : out Vertex from TopoDS;
CumOri : Boolean from Standard = Standard_False);
---Purpose: Returns in Vfirst, Vlast the FORWARD and REVERSED
-- vertices of the edge <E>. May be null shapes.
-- CumOri = True : taking account the edge orientation
Vertices(W : Wire from TopoDS; Vfirst, Vlast : out Vertex from TopoDS);
---Purpose: Returns in Vfirst, Vlast the first and last
-- vertices of the open wire <W>. May be null shapes.
-- if <W> is closed Vfirst and Vlast are a same
-- vertex on <W>.
-- if <W> is no manifold. VFirst and VLast are null
-- shapes.
CommonVertex( E1, E2 : Edge from TopoDS;
V : out Vertex from TopoDS)
returns Boolean;
---Purpose: Finds the vertex <V> common to the two edges
-- <E1,E2>, returns True if this vertex exists.
--
-- Warning: <V> has sense only if the value <True> is returned
end TopExp;

View File

@@ -18,19 +18,23 @@
#define No_Standard_NoSuchObject
#define No_Standard_TypeMismatch
#include <TopExp.ixx>
#include <TopoDS.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Wire.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TopTools_MapIteratorOfMapOfShape.hxx>
#include <TopTools_MapOfShape.hxx>
//=======================================================================
//function : MapShapes
//purpose :
//=======================================================================
void TopExp::MapShapes(const TopoDS_Shape& S,
const TopAbs_ShapeEnum T,
TopTools_IndexedMapOfShape& M)

122
src/TopExp/TopExp.hxx Normal file
View File

@@ -0,0 +1,122 @@
// Created on: 1990-12-20
// Created by: Remi Lequette
// Copyright (c) 1990-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.
#ifndef _TopExp_HeaderFile
#define _TopExp_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <Standard_Boolean.hxx>
class TopoDS_Shape;
class TopoDS_Vertex;
class TopoDS_Edge;
class TopoDS_Wire;
class TopExp_Explorer;
//! This package provides basic tools to explore the
//! topological data structures.
//!
//! * Explorer : A tool to find all sub-shapes of a given
//! type. e.g. all faces of a solid.
//!
//! * Package methods to map sub-shapes of a shape.
//!
//! Level : Public
//! All methods of all classes will be public.
class TopExp
{
public:
DEFINE_STANDARD_ALLOC
//! Tool to explore a topological data structure.
//! Stores in the map <M> all the sub-shapes of <S>
//! of type <T>.
//!
//! Warning: The map is not cleared at first.
Standard_EXPORT static void MapShapes (const TopoDS_Shape& S, const TopAbs_ShapeEnum T, TopTools_IndexedMapOfShape& M);
//! Stores in the map <M> all the sub-shapes of <S>.
Standard_EXPORT static void MapShapes (const TopoDS_Shape& S, TopTools_IndexedMapOfShape& M);
//! Stores in the map <M> all the subshape of <S> of
//! type <TS> for each one append to the list all
//! the ancestors of type <TA>. For example map all
//! the edges and bind the list of faces.
//! Warning: The map is not cleared at first.
Standard_EXPORT static void MapShapesAndAncestors (const TopoDS_Shape& S, const TopAbs_ShapeEnum TS, const TopAbs_ShapeEnum TA, TopTools_IndexedDataMapOfShapeListOfShape& M);
//! Returns the Vertex of orientation FORWARD in E. If
//! there is none returns a Null Shape.
//! CumOri = True : taking account the edge orientation
Standard_EXPORT static TopoDS_Vertex FirstVertex (const TopoDS_Edge& E, const Standard_Boolean CumOri = Standard_False);
//! Returns the Vertex of orientation REVERSED in E. If
//! there is none returns a Null Shape.
//! CumOri = True : taking account the edge orientation
Standard_EXPORT static TopoDS_Vertex LastVertex (const TopoDS_Edge& E, const Standard_Boolean CumOri = Standard_False);
//! Returns in Vfirst, Vlast the FORWARD and REVERSED
//! vertices of the edge <E>. May be null shapes.
//! CumOri = True : taking account the edge orientation
Standard_EXPORT static void Vertices (const TopoDS_Edge& E, TopoDS_Vertex& Vfirst, TopoDS_Vertex& Vlast, const Standard_Boolean CumOri = Standard_False);
//! Returns in Vfirst, Vlast the first and last
//! vertices of the open wire <W>. May be null shapes.
//! if <W> is closed Vfirst and Vlast are a same
//! vertex on <W>.
//! if <W> is no manifold. VFirst and VLast are null
//! shapes.
Standard_EXPORT static void Vertices (const TopoDS_Wire& W, TopoDS_Vertex& Vfirst, TopoDS_Vertex& Vlast);
//! Finds the vertex <V> common to the two edges
//! <E1,E2>, returns True if this vertex exists.
//!
//! Warning: <V> has sense only if the value <True> is returned
Standard_EXPORT static Standard_Boolean CommonVertex (const TopoDS_Edge& E1, const TopoDS_Edge& E2, TopoDS_Vertex& V);
protected:
private:
friend class TopExp_Explorer;
};
#endif // _TopExp_HeaderFile

View File

@@ -1,174 +0,0 @@
-- Created on: 1993-01-14
-- Created by: Remi LEQUETTE
-- Copyright (c) 1993-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.
class Explorer from TopExp
---Purpose: An Explorer is a Tool to visit a Topological Data
-- Structure form the TopoDS package.
--
-- An Explorer is built with :
--
-- * The Shape to explore.
--
-- * The type of Shapes to find : e.g VERTEX, EDGE.
-- This type cannot be SHAPE.
--
-- * The type of Shapes to avoid. e.g SHELL, EDGE.
-- By default this type is SHAPE which means no
-- restriction on the exploration.
--
--
-- The Explorer visits all the structure to find
-- shapes of the requested type which are not
-- contained in the type to avoid.
--
-- Example to find all the Faces in the Shape S :
--
-- TopExp_Explorer Ex;
-- for (Ex.Init(S,TopAbs_FACE); Ex.More(); Ex.Next()) {
-- ProcessFace(Ex.Current());
-- }
--
-- // an other way
-- TopExp_Explorer Ex(S,TopAbs_FACE);
-- while (Ex.More()) {
-- ProcessFace(Ex.Current());
-- Ex.Next();
-- }
--
-- To find all the vertices which are not in an edge :
--
-- for (Ex.Init(S,TopAbs_VERTEX,TopAbs_EDGE); ...)
--
--
-- To find all the faces in a SHELL, then all the
-- faces not in a SHELL :
--
-- TopExp_Explorer Ex1, Ex2;
--
-- for (Ex1.Init(S,TopAbs_SHELL),...) {
-- // visit all shells
-- for (Ex2.Init(Ex1.Current(),TopAbs_FACE),...) {
-- // visit all the faces of the current shell
-- }
-- }
--
-- for (Ex1.Init(S,TopAbs_FACE,TopAbs_SHELL),...) {
-- // visit all faces not in a shell
-- }
--
--
-- If the type to avoid is the same or is less
-- complex than the type to find it has no effect.
--
-- For example searching edges not in a vertex does
-- not make a difference.
--
uses
ShapeEnum from TopAbs,
Shape from TopoDS,
Stack from TopExp
raises
NoMoreObject from Standard,
NoSuchObject from Standard
is
Create returns Explorer from TopExp;
---Purpose: Creates an empty explorer, becomes usefull after Init.
Create(S : Shape from TopoDS;
ToFind : ShapeEnum from TopAbs;
ToAvoid : ShapeEnum from TopAbs = TopAbs_SHAPE)
returns Explorer from TopExp;
---Purpose: Creates an Explorer on the Shape <S>.
--
-- <ToFind> is the type of shapes to search.
-- TopAbs_VERTEX, TopAbs_EDGE, ...
--
-- <ToAvoid> is the type of shape to skip in the
-- exploration. If <ToAvoid> is equal or less
-- complex than <ToFind> or if <ToAVoid> is SHAPE it
-- has no effect on the exploration.
--
Init(me : in out; S : Shape from TopoDS;
ToFind : ShapeEnum from TopAbs;
ToAvoid : ShapeEnum from TopAbs = TopAbs_SHAPE)
---Purpose: Resets this explorer on the shape S. It is initialized to
-- search the shape S, for shapes of type ToFind, that
-- are not part of a shape ToAvoid.
-- If the shape ToAvoid is equal to TopAbs_SHAPE, or
-- if it is the same as, or less complex than, the shape
-- ToFind it has no effect on the search.
is static;
More(me) returns Boolean
---Purpose: Returns True if there are more shapes in the
-- exploration.
---C++: inline
is static;
Next(me : in out)
---Purpose: Moves to the next Shape in the exploration.
-- Exceptions
-- Standard_NoMoreObject if there are no more shapes to explore.
raises
NoMoreObject
is static;
Current(me) returns Shape from TopoDS
---Purpose: Returns the current shape in the exploration.
-- Exceptions
-- Standard_NoSuchObject if this explorer has no more shapes to explore.
raises NoSuchObject from Standard
---C++: return const &
is static;
ReInit(me : in out)
---Purpose: Reinitialize the exploration with the original
-- arguments.
is static;
Depth(me) returns Integer
---Purpose: Returns the current depth of the exploration. 0 is
-- the shape to explore itself.
---C++: inline
is static;
Clear(me : in out)
---Purpose: Clears the content of the explorer. It will return
-- False on More().
---C++: inline
is static;
-- private implementation methods
Destroy(me : in out);
---C++: alias ~
fields
myStack : Stack from TopExp;
myTop : Integer from Standard;
mySizeOfStack : Integer from Standard;
myShape : Shape from TopoDS;
hasMore : Boolean from Standard;
toFind : ShapeEnum from TopAbs;
toAvoid : ShapeEnum from TopAbs;
end Explorer;

View File

@@ -17,12 +17,14 @@
#define No_Standard_NoMoreObject
#define No_Standard_NoSuchObject
#include <TopExp_Explorer.ixx>
#include <TopoDS_Iterator.hxx>
#include <TopAbs.hxx>
#include <Standard.hxx>
#include <Standard_NoMoreObject.hxx>
#include <Standard_NoSuchObject.hxx>
#include <TopAbs.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopoDS_Shape.hxx>
// macro to compare two types of shapes
// always True if the first one is SHAPE

View File

@@ -0,0 +1,183 @@
// Created on: 1993-01-14
// Created by: Remi LEQUETTE
// Copyright (c) 1993-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.
#ifndef _TopExp_Explorer_HeaderFile
#define _TopExp_Explorer_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <TopExp_Stack.hxx>
#include <Standard_Integer.hxx>
#include <TopoDS_Shape.hxx>
#include <Standard_Boolean.hxx>
#include <TopAbs_ShapeEnum.hxx>
class Standard_NoMoreObject;
class Standard_NoSuchObject;
class TopoDS_Shape;
//! An Explorer is a Tool to visit a Topological Data
//! Structure form the TopoDS package.
//!
//! An Explorer is built with :
//!
//! * The Shape to explore.
//!
//! * The type of Shapes to find : e.g VERTEX, EDGE.
//! This type cannot be SHAPE.
//!
//! * The type of Shapes to avoid. e.g SHELL, EDGE.
//! By default this type is SHAPE which means no
//! restriction on the exploration.
//!
//! The Explorer visits all the structure to find
//! shapes of the requested type which are not
//! contained in the type to avoid.
//!
//! Example to find all the Faces in the Shape S :
//!
//! TopExp_Explorer Ex;
//! for (Ex.Init(S,TopAbs_FACE); Ex.More(); Ex.Next()) {
//! ProcessFace(Ex.Current());
//! }
//!
//! // an other way
//! TopExp_Explorer Ex(S,TopAbs_FACE);
//! while (Ex.More()) {
//! ProcessFace(Ex.Current());
//! Ex.Next();
//! }
//!
//! To find all the vertices which are not in an edge :
//!
//! for (Ex.Init(S,TopAbs_VERTEX,TopAbs_EDGE); ...)
//!
//! To find all the faces in a SHELL, then all the
//! faces not in a SHELL :
//!
//! TopExp_Explorer Ex1, Ex2;
//!
//! for (Ex1.Init(S,TopAbs_SHELL),...) {
//! // visit all shells
//! for (Ex2.Init(Ex1.Current(),TopAbs_FACE),...) {
//! // visit all the faces of the current shell
//! }
//! }
//!
//! for (Ex1.Init(S,TopAbs_FACE,TopAbs_SHELL),...) {
//! // visit all faces not in a shell
//! }
//!
//! If the type to avoid is the same or is less
//! complex than the type to find it has no effect.
//!
//! For example searching edges not in a vertex does
//! not make a difference.
class TopExp_Explorer
{
public:
DEFINE_STANDARD_ALLOC
//! Creates an empty explorer, becomes usefull after Init.
Standard_EXPORT TopExp_Explorer();
//! Creates an Explorer on the Shape <S>.
//!
//! <ToFind> is the type of shapes to search.
//! TopAbs_VERTEX, TopAbs_EDGE, ...
//!
//! <ToAvoid> is the type of shape to skip in the
//! exploration. If <ToAvoid> is equal or less
//! complex than <ToFind> or if <ToAVoid> is SHAPE it
//! has no effect on the exploration.
Standard_EXPORT TopExp_Explorer(const TopoDS_Shape& S, const TopAbs_ShapeEnum ToFind, const TopAbs_ShapeEnum ToAvoid = TopAbs_SHAPE);
//! Resets this explorer on the shape S. It is initialized to
//! search the shape S, for shapes of type ToFind, that
//! are not part of a shape ToAvoid.
//! If the shape ToAvoid is equal to TopAbs_SHAPE, or
//! if it is the same as, or less complex than, the shape
//! ToFind it has no effect on the search.
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_Boolean More() const;
//! Moves to the next Shape in the exploration.
//! Exceptions
//! Standard_NoMoreObject if there are no more shapes to explore.
Standard_EXPORT void Next();
//! Returns the current shape in the exploration.
//! Exceptions
//! Standard_NoSuchObject if this explorer has no more shapes to explore.
Standard_EXPORT const TopoDS_Shape& Current() const;
//! Reinitialize the exploration with the original
//! arguments.
Standard_EXPORT void ReInit();
//! Returns the current depth of the exploration. 0 is
//! the shape to explore itself.
Standard_Integer Depth() const;
//! Clears the content of the explorer. It will return
//! False on More().
void Clear();
Standard_EXPORT void Destroy();
~TopExp_Explorer()
{
Destroy();
}
protected:
private:
TopExp_Stack myStack;
Standard_Integer myTop;
Standard_Integer mySizeOfStack;
TopoDS_Shape myShape;
Standard_Boolean hasMore;
TopAbs_ShapeEnum toFind;
TopAbs_ShapeEnum toAvoid;
};
#include <TopExp_Explorer.lxx>
#endif // _TopExp_Explorer_HeaderFile

View File

@@ -0,0 +1,23 @@
// Created on: 1990-12-20
// Created by: Remi Lequette
// Copyright (c) 1990-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.
#ifndef _TopExp_Stack_HeaderFile
#define _TopExp_Stack_HeaderFile
class TopoDS_Iterator;
typedef TopoDS_Iterator* TopExp_Stack;
#endif // _TopExp_Stack_HeaderFile