1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +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

8
src/ShapeBuild/FILES Normal file
View File

@@ -0,0 +1,8 @@
ShapeBuild.cxx
ShapeBuild.hxx
ShapeBuild_Edge.cxx
ShapeBuild_Edge.hxx
ShapeBuild_ReShape.cxx
ShapeBuild_ReShape.hxx
ShapeBuild_Vertex.cxx
ShapeBuild_Vertex.hxx

View File

@@ -1,48 +0,0 @@
-- Created on: 1998-06-03
-- Created by: data exchange team
-- Copyright (c) 1998-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 ShapeBuild
---Purpose: This package provides basic building tools for other packages in ShapeHealing.
-- These tools are rather internal for ShapeHealing .
uses
gp,
Geom,
Geom2d,
TopAbs,
TopLoc,
TopoDS,
TopTools,
BRep,
ShapeExtend,
BRepTools
is
class Vertex;
class Edge;
class ReShape;
---Purpose: Rebuilds a shape with substitution of some components
PlaneXOY returns Plane from Geom;
---Purpose: Returns a Geom_Surface which is the Plane XOY (Z positive)
-- This allows to consider an UV space homologous to a 3D space,
-- with this support surface
end ShapeBuild;

View File

@@ -14,13 +14,14 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <ShapeBuild.ixx>
#include <Geom_Plane.hxx>
#include <ShapeBuild.hxx>
//=======================================================================
//function : PlaneXOY
//purpose :
//=======================================================================
Handle(Geom_Plane) ShapeBuild::PlaneXOY()
{
static Handle(Geom_Plane) xoy;

View File

@@ -0,0 +1,71 @@
// Created on: 1998-06-03
// Created by: data exchange team
// Copyright (c) 1998-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 _ShapeBuild_HeaderFile
#define _ShapeBuild_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
class Geom_Plane;
class ShapeBuild_Vertex;
class ShapeBuild_Edge;
class ShapeBuild_ReShape;
//! This package provides basic building tools for other packages in ShapeHealing.
//! These tools are rather internal for ShapeHealing .
class ShapeBuild
{
public:
DEFINE_STANDARD_ALLOC
//! Rebuilds a shape with substitution of some components
//! Returns a Geom_Surface which is the Plane XOY (Z positive)
//! This allows to consider an UV space homologous to a 3D space,
//! with this support surface
Standard_EXPORT static Handle(Geom_Plane) PlaneXOY();
protected:
private:
friend class ShapeBuild_Vertex;
friend class ShapeBuild_Edge;
friend class ShapeBuild_ReShape;
};
#endif // _ShapeBuild_HeaderFile

View File

@@ -1,145 +0,0 @@
-- Created on: 1998-06-09
-- Created by: data exchange team
-- Copyright (c) 1998-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 Edge from ShapeBuild
---Purpose: This class provides low-level operators for building an edge
-- 3d curve, copying edge with replaced vertices etc.
uses
Trsf2d from gp,
Curve from Geom,
Surface from Geom,
Curve from Geom2d,
Location from TopLoc,
Vertex from TopoDS,
Face from TopoDS,
Edge from TopoDS
is
CopyReplaceVertices (me; edge: Edge from TopoDS; V1, V2: Vertex from TopoDS)
returns Edge from TopoDS;
---Purpose: Copy edge and replace one or both its vertices to a given
-- one(s). Vertex V1 replaces FORWARD vertex, and V2 - REVERSED,
-- as they are found by TopoDS_Iterator.
-- If V1 or V2 is NULL, the original vertex is taken
CopyRanges (me; toedge, fromedge: Edge from TopoDS;
alpha: Real = 0;
beta: Real = 1);
---Purpose: Copies ranges for curve3d and all common pcurves from
-- edge <fromedge> into edge <toedge>.
SetRange3d (me; edge: Edge from TopoDS; first, last : Real);
---Purpose: Sets range on 3d curve only.
CopyPCurves (me; toedge, fromedge: Edge from TopoDS);
---Purpose: Makes a copy of pcurves from edge <fromedge> into edge
-- <toedge>. Pcurves which are already present in <toedge>,
-- are replaced by copies, other are copied. Ranges are also
-- copied.
Copy (me; edge: Edge from TopoDS; sharepcurves: Boolean = Standard_True)
returns Edge from TopoDS;
---Purpose: Make a copy of <edge> by call to CopyReplaceVertices()
-- (i.e. construct new TEdge with the same pcurves and vertices).
-- If <sharepcurves> is False, pcurves are also replaced by
-- their copies with help of method CopyPCurves
RemovePCurve (me; edge: Edge from TopoDS; face: Face from TopoDS);
---Purpose : Removes the PCurve(s) which could be recorded in an Edge for
-- the given Face
RemovePCurve (me; edge: Edge from TopoDS; surf: Surface from Geom);
---Purpose : Removes the PCurve(s) which could be recorded in an Edge for
-- the given Surface
RemovePCurve (me; edge: Edge from TopoDS; surf: Surface from Geom;
loc: Location from TopLoc);
---Purpose : Removes the PCurve(s) which could be recorded in an Edge for
-- the given Surface, with given Location
ReplacePCurve (me; edge: Edge from TopoDS; pcurve: Curve from Geom2d;
face: Face from TopoDS);
---Purpose : Replace the PCurve in an Edge for the given Face
-- In case if edge is seam, i.e. has 2 pcurves on that face,
-- only pcurve corresponding to the orientation of the edge is
-- replaced
ReassignPCurve (me; edge: Edge from TopoDS;
old, sub: Face from TopoDS)
returns Boolean;
---Purpose: Reassign edge pcurve lying on face <old> to another face <sub>.
-- If edge has two pcurves on <old> face, only one of them will be
-- reassigned, and other will left alone. Similarly, if edge already
-- had a pcurve on face <sub>, it will have two pcurves on it.
-- Returns True if succeeded, False if no pcurve lying on <old> found.
TransformPCurve(me; pcurve: Curve from Geom2d;
trans : Trsf2d from gp;
uFact : Real;
aFirst: in out Real;
aLast : in out Real)
returns Curve from Geom2d;
---Purpose: Transforms the PCurve with given matrix and affinity U factor.
RemoveCurve3d (me; edge: Edge from TopoDS);
---Purpose : Removes the Curve3D recorded in an Edge
BuildCurve3d (me; edge: Edge from TopoDS) returns Boolean;
---Purpose: Calls BRepTools::BuildCurve3D
---Returns: True if curve computed OK, False if any error occured
---Extension of BRepAPI_MakeEdge
MakeEdge (me; edge : out Edge from TopoDS;
curve: Curve from Geom;
L : Location from TopLoc);
---Purpose: Makes edge with curve and location
MakeEdge (me; edge : out Edge from TopoDS;
curve : Curve from Geom;
L : Location from TopLoc;
p1, p2: Real);
---Purpose: Makes edge with curve, location and range [p1, p2]
MakeEdge (me; edge : out Edge from TopoDS;
pcurve: Curve from Geom2d;
face : Face from TopoDS) ;
---Purpose: Makes edge with pcurve and face
MakeEdge (me; edge : out Edge from TopoDS;
pcurve: Curve from Geom2d;
face :Face from TopoDS;
p1, p2: Real) ;
---Purpose: Makes edge with pcurve, face and range [p1, p2]
MakeEdge (me; edge : out Edge from TopoDS;
pcurve: Curve from Geom2d;
S : Surface from Geom;
L : Location from TopLoc) ;
---Purpose: Makes edge with pcurve, surface and location
MakeEdge (me; edge : out Edge from TopoDS;
pcurve: Curve from Geom2d;
S : Surface from Geom;
L : Location from TopLoc;
p1, p2: Real) ;
---Purpose: Makes edge with pcurve, surface, location and range [p1, p2]
end Edge;

View File

@@ -14,50 +14,53 @@
//#4 szv S4163: optimizing
// pdn 20.04.99 S4181 Moving algorithm for transforming pcurves from IGES processor
// abv 05.05.99 S4137: adding methods for copying ranges, reassigning pcurves etc.
#include <ShapeBuild_Edge.ixx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopExp.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <BRep_TEdge.hxx>
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
#include <BRep_GCurve.hxx>
#include <BRepLib.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <gp_Pnt.hxx>
#include <gp_Lin2d.hxx>
#include <gp_GTrsf2d.hxx>
#include <gp_Pln.hxx>
#include <ElCLib.hxx>
#include <Precision.hxx>
#include <Geom2d_TrimmedCurve.hxx>
#include <Geom2d_Line.hxx>
#include <Geom2d_BSplineCurve.hxx>
#include <Geom2d_Conic.hxx>
#include <Geom2dConvert.hxx>
#include <Geom2dConvert_ApproxCurve.hxx>
#include <GeomAPI.hxx>
#include <Geom2d_BezierCurve.hxx>
#include <Geom2d_TrimmedCurve.hxx>
#include <BRep_Curve3D.hxx>
#include <BRep_CurveOnSurface.hxx>
#include <Geom2d_OffsetCurve.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <Geom_OffsetCurve.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <BRep_GCurve.hxx>
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
#include <BRep_TEdge.hxx>
#include <BRep_Tool.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepLib.hxx>
#include <ElCLib.hxx>
#include <Geom2d_BezierCurve.hxx>
#include <Geom2d_BSplineCurve.hxx>
#include <Geom2d_Conic.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom2d_Line.hxx>
#include <Geom2d_OffsetCurve.hxx>
#include <Geom2d_TrimmedCurve.hxx>
#include <Geom2dConvert.hxx>
#include <Geom2dConvert_ApproxCurve.hxx>
#include <Geom_Curve.hxx>
#include <Geom_OffsetCurve.hxx>
#include <Geom_Surface.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <GeomAPI.hxx>
#include <gp_GTrsf2d.hxx>
#include <gp_Lin2d.hxx>
#include <gp_Pln.hxx>
#include <gp_Pnt.hxx>
#include <gp_Trsf2d.hxx>
#include <Precision.hxx>
#include <ShapeBuild_Edge.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
#include <TopExp.hxx>
#include <TopLoc_Location.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopTools_SequenceOfShape.hxx>
//=======================================================================
//function : CopyReplaceVertices
//purpose :
//=======================================================================
TopoDS_Edge ShapeBuild_Edge::CopyReplaceVertices (const TopoDS_Edge& edge,
const TopoDS_Vertex& V1,
const TopoDS_Vertex& V2) const

View File

@@ -0,0 +1,145 @@
// Created on: 1998-06-09
// Created by: data exchange team
// Copyright (c) 1998-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 _ShapeBuild_Edge_HeaderFile
#define _ShapeBuild_Edge_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
class TopoDS_Edge;
class TopoDS_Vertex;
class TopoDS_Face;
class Geom_Surface;
class TopLoc_Location;
class Geom2d_Curve;
class gp_Trsf2d;
class Geom_Curve;
//! This class provides low-level operators for building an edge
//! 3d curve, copying edge with replaced vertices etc.
class ShapeBuild_Edge
{
public:
DEFINE_STANDARD_ALLOC
//! Copy edge and replace one or both its vertices to a given
//! one(s). Vertex V1 replaces FORWARD vertex, and V2 - REVERSED,
//! as they are found by TopoDS_Iterator.
//! If V1 or V2 is NULL, the original vertex is taken
Standard_EXPORT TopoDS_Edge CopyReplaceVertices (const TopoDS_Edge& edge, const TopoDS_Vertex& V1, const TopoDS_Vertex& V2) const;
//! Copies ranges for curve3d and all common pcurves from
//! edge <fromedge> into edge <toedge>.
Standard_EXPORT void CopyRanges (const TopoDS_Edge& toedge, const TopoDS_Edge& fromedge, const Standard_Real alpha = 0, const Standard_Real beta = 1) const;
//! Sets range on 3d curve only.
Standard_EXPORT void SetRange3d (const TopoDS_Edge& edge, const Standard_Real first, const Standard_Real last) const;
//! Makes a copy of pcurves from edge <fromedge> into edge
//! <toedge>. Pcurves which are already present in <toedge>,
//! are replaced by copies, other are copied. Ranges are also
//! copied.
Standard_EXPORT void CopyPCurves (const TopoDS_Edge& toedge, const TopoDS_Edge& fromedge) const;
//! Make a copy of <edge> by call to CopyReplaceVertices()
//! (i.e. construct new TEdge with the same pcurves and vertices).
//! If <sharepcurves> is False, pcurves are also replaced by
//! their copies with help of method CopyPCurves
Standard_EXPORT TopoDS_Edge Copy (const TopoDS_Edge& edge, const Standard_Boolean sharepcurves = Standard_True) const;
//! Removes the PCurve(s) which could be recorded in an Edge for
//! the given Face
Standard_EXPORT void RemovePCurve (const TopoDS_Edge& edge, const TopoDS_Face& face) const;
//! Removes the PCurve(s) which could be recorded in an Edge for
//! the given Surface
Standard_EXPORT void RemovePCurve (const TopoDS_Edge& edge, const Handle(Geom_Surface)& surf) const;
//! Removes the PCurve(s) which could be recorded in an Edge for
//! the given Surface, with given Location
Standard_EXPORT void RemovePCurve (const TopoDS_Edge& edge, const Handle(Geom_Surface)& surf, const TopLoc_Location& loc) const;
//! Replace the PCurve in an Edge for the given Face
//! In case if edge is seam, i.e. has 2 pcurves on that face,
//! only pcurve corresponding to the orientation of the edge is
//! replaced
Standard_EXPORT void ReplacePCurve (const TopoDS_Edge& edge, const Handle(Geom2d_Curve)& pcurve, const TopoDS_Face& face) const;
//! Reassign edge pcurve lying on face <old> to another face <sub>.
//! If edge has two pcurves on <old> face, only one of them will be
//! reassigned, and other will left alone. Similarly, if edge already
//! had a pcurve on face <sub>, it will have two pcurves on it.
//! Returns True if succeeded, False if no pcurve lying on <old> found.
Standard_EXPORT Standard_Boolean ReassignPCurve (const TopoDS_Edge& edge, const TopoDS_Face& old, const TopoDS_Face& sub) const;
//! Transforms the PCurve with given matrix and affinity U factor.
Standard_EXPORT Handle(Geom2d_Curve) TransformPCurve (const Handle(Geom2d_Curve)& pcurve, const gp_Trsf2d& trans, const Standard_Real uFact, Standard_Real& aFirst, Standard_Real& aLast) const;
//! Removes the Curve3D recorded in an Edge
Standard_EXPORT void RemoveCurve3d (const TopoDS_Edge& edge) const;
//! Calls BRepTools::BuildCurve3D
Standard_EXPORT Standard_Boolean BuildCurve3d (const TopoDS_Edge& edge) const;
//! Makes edge with curve and location
Standard_EXPORT void MakeEdge (TopoDS_Edge& edge, const Handle(Geom_Curve)& curve, const TopLoc_Location& L) const;
//! Makes edge with curve, location and range [p1, p2]
Standard_EXPORT void MakeEdge (TopoDS_Edge& edge, const Handle(Geom_Curve)& curve, const TopLoc_Location& L, const Standard_Real p1, const Standard_Real p2) const;
//! Makes edge with pcurve and face
Standard_EXPORT void MakeEdge (TopoDS_Edge& edge, const Handle(Geom2d_Curve)& pcurve, const TopoDS_Face& face) const;
//! Makes edge with pcurve, face and range [p1, p2]
Standard_EXPORT void MakeEdge (TopoDS_Edge& edge, const Handle(Geom2d_Curve)& pcurve, const TopoDS_Face& face, const Standard_Real p1, const Standard_Real p2) const;
//! Makes edge with pcurve, surface and location
Standard_EXPORT void MakeEdge (TopoDS_Edge& edge, const Handle(Geom2d_Curve)& pcurve, const Handle(Geom_Surface)& S, const TopLoc_Location& L) const;
//! Makes edge with pcurve, surface, location and range [p1, p2]
Standard_EXPORT void MakeEdge (TopoDS_Edge& edge, const Handle(Geom2d_Curve)& pcurve, const Handle(Geom_Surface)& S, const TopLoc_Location& L, const Standard_Real p1, const Standard_Real p2) const;
protected:
private:
};
#endif // _ShapeBuild_Edge_HeaderFile

View File

@@ -1,93 +0,0 @@
-- Created on: 1998-06-03
-- Created by: data exchange team
-- Copyright (c) 1998-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 ReShape from ShapeBuild inherits ReShape from BRepTools
---Purpose: Rebuilds a Shape by making pre-defined substitutions on some
-- of its components
--
-- In a first phase, it records requests to replace or remove
-- some individual shapes
-- For each shape, the last given request is recorded
-- Requests may be applied "Oriented" (i.e. only to an item with
-- the SAME orientation) or not (the orientation of replacing
-- shape is respectful of that of the original one)
--
-- Then, these requests may be applied to any shape which may
-- contain one or more of these individual shapes
uses
ShapeEnum from TopAbs,
Shape from TopoDS,
Status from ShapeExtend
is
Create returns ReShape from ShapeBuild;
---Purpose: Returns an empty Reshape
Apply (me: mutable; shape: Shape from TopoDS; until: ShapeEnum from TopAbs; buildmode: Integer)
returns Shape from TopoDS is redefined;
---Purpose: Applies the substitutions requests to a shape
--
-- <until> gives the level of type until which requests are taken
-- into account. For subshapes of the type <until> no rebuild
-- and futher exploring are done.
-- ACTUALLY, NOT IMPLEMENTED BELOW TopAbs_FACE
--
-- <buildmode> says how to do on a SOLID,SHELL ... if one of its
-- sub-shapes has been changed:
-- 0: at least one Replace or Remove -> COMPOUND, else as such
-- 1: at least one Remove (Replace are ignored) -> COMPOUND
-- 2: Replace and Remove are both ignored
-- If Replace/Remove are ignored or absent, the result as same
-- type as the starting shape
Apply (me: mutable; shape: Shape from TopoDS; until: ShapeEnum from TopAbs = TopAbs_SHAPE)
returns Shape from TopoDS is redefined;
---Purpose: Applies the substitutions requests to a shape.
--
-- <until> gives the level of type until which requests are taken
-- into account. For subshapes of the type <until> no rebuild
-- and futher exploring are done.
--
-- NOTE: each subshape can be replaced by shape of the same type
-- or by shape containing only shapes of that type (for
-- example, TopoDS_Edge can be replaced by TopoDS_Edge,
-- TopoDS_Wire or TopoDS_Compound containing TopoDS_Edges).
-- If incompatible shape type is encountered, it is ignored
-- and flag FAIL1 is set in Status.
Status (me: mutable; shape: Shape from TopoDS; newsh: out Shape from TopoDS; last : Boolean = Standard_False)
returns Integer is redefined;
---Purpose: Returns a complete substitution status for a shape
-- 0 : not recorded, <newsh> = original <shape>
-- < 0: to be removed, <newsh> is NULL
-- > 0: to be replaced, <newsh> is a new item
-- If <last> is False, returns status and new shape recorded in
-- the map directly for the shape, if True and status > 0 then
-- recursively searches for the last status and new shape.
Status (me; status: Status from ShapeExtend) returns Boolean is virtual;
---Purpose: Queries the status of last call to Apply(shape,enum)
-- OK : no (sub)shapes replaced or removed
-- DONE1: source (starting) shape replaced
-- DONE2: source (starting) shape removed
-- DONE3: some subshapes replaced
-- DONE4: some subshapes removed
-- FAIL1: some replacements not done because of bad type of subshape
end ReShape;

View File

@@ -13,24 +13,24 @@
// abv 28.04.99 S4137: ading method Apply for work on all types of shapes
#include <ShapeBuild_ReShape.ixx>
#include <TopoDS_Shell.hxx>
#include <TopoDS_Solid.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopExp_Explorer.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <ShapeExtend.hxx>
#include <ShapeBuild_Edge.hxx>
#include <ShapeBuild_ReShape.hxx>
#include <ShapeExtend.hxx>
#include <Standard_Type.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Iterator.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Shell.hxx>
#include <TopoDS_Solid.hxx>
//=======================================================================
//function : ShapeBuild_ReShape
//purpose :
//=======================================================================
ShapeBuild_ReShape::ShapeBuild_ReShape()
{
}

View File

@@ -0,0 +1,126 @@
// Created on: 1998-06-03
// Created by: data exchange team
// Copyright (c) 1998-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 _ShapeBuild_ReShape_HeaderFile
#define _ShapeBuild_ReShape_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <BRepTools_ReShape.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
#include <ShapeExtend_Status.hxx>
class TopoDS_Shape;
class ShapeBuild_ReShape;
DEFINE_STANDARD_HANDLE(ShapeBuild_ReShape, BRepTools_ReShape)
//! Rebuilds a Shape by making pre-defined substitutions on some
//! of its components
//!
//! In a first phase, it records requests to replace or remove
//! some individual shapes
//! For each shape, the last given request is recorded
//! Requests may be applied "Oriented" (i.e. only to an item with
//! the SAME orientation) or not (the orientation of replacing
//! shape is respectful of that of the original one)
//!
//! Then, these requests may be applied to any shape which may
//! contain one or more of these individual shapes
class ShapeBuild_ReShape : public BRepTools_ReShape
{
public:
//! Returns an empty Reshape
Standard_EXPORT ShapeBuild_ReShape();
//! Applies the substitutions requests to a shape
//!
//! <until> gives the level of type until which requests are taken
//! into account. For subshapes of the type <until> no rebuild
//! and futher exploring are done.
//! ACTUALLY, NOT IMPLEMENTED BELOW TopAbs_FACE
//!
//! <buildmode> says how to do on a SOLID,SHELL ... if one of its
//! sub-shapes has been changed:
//! 0: at least one Replace or Remove -> COMPOUND, else as such
//! 1: at least one Remove (Replace are ignored) -> COMPOUND
//! 2: Replace and Remove are both ignored
//! If Replace/Remove are ignored or absent, the result as same
//! type as the starting shape
Standard_EXPORT virtual TopoDS_Shape Apply (const TopoDS_Shape& shape, const TopAbs_ShapeEnum until, const Standard_Integer buildmode) Standard_OVERRIDE;
//! Applies the substitutions requests to a shape.
//!
//! <until> gives the level of type until which requests are taken
//! into account. For subshapes of the type <until> no rebuild
//! and futher exploring are done.
//!
//! NOTE: each subshape can be replaced by shape of the same type
//! or by shape containing only shapes of that type (for
//! example, TopoDS_Edge can be replaced by TopoDS_Edge,
//! TopoDS_Wire or TopoDS_Compound containing TopoDS_Edges).
//! If incompatible shape type is encountered, it is ignored
//! and flag FAIL1 is set in Status.
Standard_EXPORT virtual TopoDS_Shape Apply (const TopoDS_Shape& shape, const TopAbs_ShapeEnum until = TopAbs_SHAPE) Standard_OVERRIDE;
//! Returns a complete substitution status for a shape
//! 0 : not recorded, <newsh> = original <shape>
//! < 0: to be removed, <newsh> is NULL
//! > 0: to be replaced, <newsh> is a new item
//! If <last> is False, returns status and new shape recorded in
//! the map directly for the shape, if True and status > 0 then
//! recursively searches for the last status and new shape.
Standard_EXPORT virtual Standard_Integer Status (const TopoDS_Shape& shape, TopoDS_Shape& newsh, const Standard_Boolean last = Standard_False) Standard_OVERRIDE;
//! Queries the status of last call to Apply(shape,enum)
//! OK : no (sub)shapes replaced or removed
//! DONE1: source (starting) shape replaced
//! DONE2: source (starting) shape removed
//! DONE3: some subshapes replaced
//! DONE4: some subshapes removed
//! FAIL1: some replacements not done because of bad type of subshape
Standard_EXPORT virtual Standard_Boolean Status (const ShapeExtend_Status status) const;
DEFINE_STANDARD_RTTI(ShapeBuild_ReShape,BRepTools_ReShape)
protected:
private:
};
#endif // _ShapeBuild_ReShape_HeaderFile

View File

@@ -1,44 +0,0 @@
-- Created on: 1998-06-11
-- Created by: data exchange team
-- Copyright (c) 1998-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 Vertex from ShapeBuild
---Purpose: Provides low-level functions used for constructing vertices
uses
Pnt from gp,
Vertex from TopoDS
is
CombineVertex ( me; V1, V2: Vertex from TopoDS; tolFactor: Real = 1.0001 )
returns Vertex from TopoDS;
---Purpose: Combines new vertex from two others. This new one is the
-- smallest vertex which comprises both of the source vertices.
-- The function takes into account the positions and tolerances
-- of the source vertices.
-- The tolerance of the new vertex will be equal to the minimal
-- tolerance that is required to comprise source vertices
-- multiplied by tolFactor (in order to avoid errors because
-- of discreteness of calculations).
CombineVertex ( me; pnt1, pnt2: Pnt from gp; tol1, tol2: Real;
tolFactor: Real = 1.0001 )
returns Vertex from TopoDS;
---Purpose: The same function as above, except that it accepts two points
-- and two tolerances instead of vertices
end Vertex;

View File

@@ -13,16 +13,18 @@
// rln 22.03.99: syntax correction in CombineVertex
//szv#4 S4163
#include <ShapeBuild_Vertex.ixx>
#include <BRep_Tool.hxx>
#include <Precision.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <gp_Pnt.hxx>
#include <Precision.hxx>
#include <ShapeBuild_Vertex.hxx>
#include <TopoDS_Vertex.hxx>
//=======================================================================
//function : CombineVertex
//purpose :
//=======================================================================
TopoDS_Vertex ShapeBuild_Vertex::CombineVertex (const TopoDS_Vertex& V1,
const TopoDS_Vertex& V2,
const Standard_Real tolFactor) const

View File

@@ -0,0 +1,74 @@
// Created on: 1998-06-11
// Created by: data exchange team
// Copyright (c) 1998-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 _ShapeBuild_Vertex_HeaderFile
#define _ShapeBuild_Vertex_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Real.hxx>
class TopoDS_Vertex;
class gp_Pnt;
//! Provides low-level functions used for constructing vertices
class ShapeBuild_Vertex
{
public:
DEFINE_STANDARD_ALLOC
//! Combines new vertex from two others. This new one is the
//! smallest vertex which comprises both of the source vertices.
//! The function takes into account the positions and tolerances
//! of the source vertices.
//! The tolerance of the new vertex will be equal to the minimal
//! tolerance that is required to comprise source vertices
//! multiplied by tolFactor (in order to avoid errors because
//! of discreteness of calculations).
Standard_EXPORT TopoDS_Vertex CombineVertex (const TopoDS_Vertex& V1, const TopoDS_Vertex& V2, const Standard_Real tolFactor = 1.0001) const;
//! The same function as above, except that it accepts two points
//! and two tolerances instead of vertices
Standard_EXPORT TopoDS_Vertex CombineVertex (const gp_Pnt& pnt1, const gp_Pnt& pnt2, const Standard_Real tol1, const Standard_Real tol2, const Standard_Real tolFactor = 1.0001) const;
protected:
private:
};
#endif // _ShapeBuild_Vertex_HeaderFile