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

View File

@@ -1,66 +0,0 @@
-- Created on: 1993-01-12
-- Created by: Philippe DAUTRY
-- 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.
package BRepSweep
---Purpose: This package implements the package Sweep for the BRep
-- structure.
uses
Standard,
Quantity,
TCollection,
TColStd,
gp,
Geom,
TopAbs,
TopLoc,
TopTools,
TopoDS,
TopExp,
BRep,
Sweep
is
class Builder;
class Tool;
class Iterator;
deferred class NumLinearRegularSweep;
deferred class Trsf;
--- This class is inherited from LinearRegularSweep to implement
-- the simple swept primitives built moving a Shape with a Trsf.
class Translation;
--- This class is inherited from Trsf to implement the translation
-- sweep.
class Rotation;
--- This class is inherited from Trsf to implement the rotation
-- sweep.
class Prism;
--- This class provides simple methods to build prism.
class Revol;
--- This class provides simple methods to build Revol.
end BRepSweep;

View File

@@ -1,83 +0,0 @@
-- Created on: 1993-01-14
-- Created by: Philippe DAUTRY
-- 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 Builder from BRepSweep
---Purpose: implements the abstract Builder with the BRep Builder
uses
Builder from BRep,
Shape from TopoDS,
Shell from TopoDS,
Face from TopoDS,
Wire from TopoDS,
Edge from TopoDS,
Vertex from TopoDS,
Orientation from TopAbs
is
Create(aBuilder : Builder from BRep) returns Builder from BRepSweep;
---Purpose: Creates a Builder.
Builder(me) returns Builder from BRep
---C++: inline
---C++: return const &
is static;
-- implements the Builder methods
MakeCompound (me; aCompound : out Shape from TopoDS)
---Purpose: Returns an empty Compound.
is static;
MakeCompSolid (me; aCompSolid : out Shape from TopoDS)
---Purpose: Returns an empty CompSolid.
is static;
MakeSolid (me; aSolid : out Shape from TopoDS)
---Purpose: Returns an empty Solid.
is static;
MakeShell (me; aShell : out Shape from TopoDS)
---Purpose: Returns an empty Shell.
is static;
MakeWire (me; aWire : out Shape from TopoDS)
---Purpose: Returns an empty Wire.
is static;
Add(me; aShape1 : in out Shape from TopoDS;
aShape2 : in Shape from TopoDS;
Orient : in Orientation from TopAbs)
---Purpose: Adds the Shape 1 in the Shape 2, set to
-- <Orient> orientation.
is static;
Add(me; aShape1 : in out Shape from TopoDS;
aShape2 : in Shape from TopoDS)
---Purpose: Adds the Shape 1 in the Shape 2.
is static;
fields
myBuilder : Builder from BRep;
end Builder;

View File

@@ -14,14 +14,16 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepSweep_Builder.ixx>
#include <BRep_Builder.hxx>
#include <BRepSweep_Builder.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
//=======================================================================
//function : BRepSweep_Builder
//purpose :
//=======================================================================
BRepSweep_Builder::BRepSweep_Builder(const BRep_Builder& aBuilder) :
myBuilder(aBuilder)
{

View File

@@ -0,0 +1,90 @@
// Created on: 1993-01-14
// Created by: Philippe DAUTRY
// 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 _BRepSweep_Builder_HeaderFile
#define _BRepSweep_Builder_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <BRep_Builder.hxx>
#include <TopAbs_Orientation.hxx>
class BRep_Builder;
class TopoDS_Shape;
//! implements the abstract Builder with the BRep Builder
class BRepSweep_Builder
{
public:
DEFINE_STANDARD_ALLOC
//! Creates a Builder.
Standard_EXPORT BRepSweep_Builder(const BRep_Builder& aBuilder);
const BRep_Builder& Builder() const;
//! Returns an empty Compound.
Standard_EXPORT void MakeCompound (TopoDS_Shape& aCompound) const;
//! Returns an empty CompSolid.
Standard_EXPORT void MakeCompSolid (TopoDS_Shape& aCompSolid) const;
//! Returns an empty Solid.
Standard_EXPORT void MakeSolid (TopoDS_Shape& aSolid) const;
//! Returns an empty Shell.
Standard_EXPORT void MakeShell (TopoDS_Shape& aShell) const;
//! Returns an empty Wire.
Standard_EXPORT void MakeWire (TopoDS_Shape& aWire) const;
//! Adds the Shape 1 in the Shape 2, set to
//! <Orient> orientation.
Standard_EXPORT void Add (TopoDS_Shape& aShape1, const TopoDS_Shape& aShape2, const TopAbs_Orientation Orient) const;
//! Adds the Shape 1 in the Shape 2.
Standard_EXPORT void Add (TopoDS_Shape& aShape1, const TopoDS_Shape& aShape2) const;
protected:
private:
BRep_Builder myBuilder;
};
#include <BRepSweep_Builder.lxx>
#endif // _BRepSweep_Builder_HeaderFile

View File

@@ -1,75 +0,0 @@
-- Created on: 1993-06-08
-- Created by: Laurent BOURESCHE
-- 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 Iterator from BRepSweep
---Purpose: This class provides iteration services required by
-- the Generating Line (TopoDS Shape) of a BRepSweep.
-- This tool is used to iterate on the direct
-- sub-shapes of a Shape.
--
uses
Iterator from TopoDS,
Shape from TopoDS,
Orientation from TopAbs
raises
NoMoreObject from Standard,
NoSuchObject from Standard
is
Create;
Init(me : in out; aShape: Shape from TopoDS)
---Purpose: Resest the Iterator on sub-shapes of <aShape>.
is static;
More(me) returns Boolean
---Purpose: Returns True if there is a current sub-shape.
--
---C++: inline
is static;
Next(me : in out)
---Purpose: Moves to the next sub-shape.
raises
NoMoreObject from Standard
is static;
Value(me) returns Shape from TopoDS
---Purpose: Returns the current sub-shape.
raises
NoSuchObject from Standard
---C++: return const &
---C++: inline
is static;
Orientation(me) returns Orientation from TopAbs
---Purpose: Returns the orientation of the current sub-shape.
raises
NoSuchObject from Standard
---C++: inline
is static;
fields
myIterator : Iterator from TopoDS;
end Iterator from BRepSweep;

View File

@@ -14,13 +14,16 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepSweep_Iterator.ixx>
#include <BRepSweep_Iterator.hxx>
#include <Standard_NoMoreObject.hxx>
#include <Standard_NoSuchObject.hxx>
#include <TopoDS_Shape.hxx>
//=======================================================================
//function : BRepSweep_Iterator
//purpose :
//=======================================================================
BRepSweep_Iterator::BRepSweep_Iterator()
{
}

View File

@@ -0,0 +1,85 @@
// Created on: 1993-06-08
// Created by: Laurent BOURESCHE
// 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 _BRepSweep_Iterator_HeaderFile
#define _BRepSweep_Iterator_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <TopoDS_Iterator.hxx>
#include <Standard_Boolean.hxx>
#include <TopAbs_Orientation.hxx>
class Standard_NoMoreObject;
class Standard_NoSuchObject;
class TopoDS_Shape;
//! This class provides iteration services required by
//! the Generating Line (TopoDS Shape) of a BRepSweep.
//! This tool is used to iterate on the direct
//! sub-shapes of a Shape.
class BRepSweep_Iterator
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepSweep_Iterator();
//! Resest the Iterator on sub-shapes of <aShape>.
Standard_EXPORT void Init (const TopoDS_Shape& aShape);
//! Returns True if there is a current sub-shape.
Standard_Boolean More() const;
//! Moves to the next sub-shape.
Standard_EXPORT void Next();
//! Returns the current sub-shape.
const TopoDS_Shape& Value() const;
//! Returns the orientation of the current sub-shape.
TopAbs_Orientation Orientation() const;
protected:
private:
TopoDS_Iterator myIterator;
};
#include <BRepSweep_Iterator.lxx>
#endif // _BRepSweep_Iterator_HeaderFile

View File

@@ -1,351 +0,0 @@
-- Created on: 1993-01-27
-- Created by: Philippe DAUTRY
-- 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.
deferred class NumLinearRegularSweep from BRepSweep
---Purpose: This a generic class is used to build Sweept
-- primitives with a generating "shape" and a
-- directing "line".
--
-- The indexation and type analysis services required
-- for the generatrix are given by <Tool from BRepSweep>.
--
-- The indexation and type analysis services required
-- for the directrix are given by <NumShapeTool from Sweep>.
--
-- The iteration services required for the generatrix
-- are given by <Iterator from BRepSweep>.
--
-- The iteration services required for the directrix
-- are given by <NumShapeIterator from Sweep>.
--
-- The topology is like a grid of shapes. Each shape
-- of the grid must be addressable without confusion
-- by one or two objects from the generating or
-- directing shapes. Here are exemples of correct
-- associations to address:
--
-- - a vertex : GenVertex - DirVertex
-- - an edge : GenVertex - DirEdge
-- - : GenEdge - DirVertex
-- - a face : GenEdge - DirEdge
-- GenFace - DirVertex
-- ...
--
-- "GenObject" is used to identify an object from the
-- Generating Shape, and "DirObject" from the
-- Directing Shape. So may they be from different
-- types.
--
-- The method Has... is given because in some special
-- cases, a vertex, an edge or a face may be
-- geometricaly nonexistant or not usefull.
uses
Orientation from TopAbs,
Array2OfBoolean from TColStd,
Shape from TopoDS,
NumShape from Sweep,
Builder from BRepSweep,
Tool from BRepSweep,
NumShapeTool from Sweep,
Iterator from BRepSweep,
NumShapeIterator from Sweep,
Array2OfShape from TopTools,
SequenceOfShape from TopTools
raises
NoMoreObject from Standard,
NoSuchObject from Standard,
RangeError from Standard,
DomainError from Standard
is
-- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Initialize(aBuilder : Builder from BRepSweep;
aGenShape : Shape from TopoDS;
aDirWire : NumShape from Sweep);
---Purpose: Creates a NumLinearRegularSweep. <aBuilder> gives
-- basic topological services.
-- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-- Deferred Methods supporting the creation of the geometric part.
-- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
MakeEmptyVertex(me : in out; aGenV: Shape from TopoDS; aDirV: NumShape from Sweep)
returns Shape from TopoDS is deferred;
---Purpose: Builds the vertex addressed by [aGenV,aDirV], with its
-- geometric part, but without subcomponents.
---C++ : alias " Standard_EXPORT virtual ~BRepSweep_NumLinearRegularSweep();"
MakeEmptyDirectingEdge(me: in out; aGenV: Shape from TopoDS; aDirE: NumShape from Sweep)
returns Shape from TopoDS
---Purpose: Builds the edge addressed by [aGenV,aDirE], with its
-- geometric part, but without subcomponents.
is deferred;
MakeEmptyGeneratingEdge(me: in out; aGenE: Shape from TopoDS; aDirV: NumShape from Sweep)
returns Shape from TopoDS
---Purpose: Builds the edge addressed by [aGenE,aDirV], with its
-- geometric part, but without subcomponents.
is deferred;
SetParameters(me : in out;
aNewFace : Shape from TopoDS;
aNewVertex : in out Shape from TopoDS;
aGenF : Shape from TopoDS;
aGenV : Shape from TopoDS;
aDirV : NumShape from Sweep)
---Purpose: Sets the parameters of the new vertex on the new
-- face. The new face and new vertex where generated
-- from aGenF, aGenV and aDirV .
is deferred;
SetDirectingParameter(me : in out;
aNewEdge : Shape from TopoDS;
aNewVertex : in out Shape from TopoDS;
aGenV : Shape from TopoDS;
aDirE : NumShape from Sweep;
aDirV : NumShape from Sweep)
---Purpose: Sets the parameter of the new vertex on the new
-- edge. The new edge and new vertex where generated
-- from aGenV aDirE, and aDirV.
is deferred;
SetGeneratingParameter(me : in out;
aNewEdge : Shape from TopoDS;
aNewVertex : in out Shape from TopoDS;
aGenE : Shape from TopoDS;
aGenV : Shape from TopoDS;
aDirV : NumShape from Sweep)
---Purpose: Sets the parameter of the new vertex on the new
-- edge. The new edge and new vertex where generated
-- from aGenE, aGenV and aDirV .
is deferred;
MakeEmptyFace(me : in out;
aGenS : Shape from TopoDS;
aDirS : NumShape from Sweep)
returns Shape from TopoDS
---Purpose: Builds the face addressed by [aGenS,aDirS], with
-- its geometric part, but without subcomponents. The
-- couple aGenS, aDirS can be a "generating face and
-- a directing vertex" or "a generating edge and a
-- directing edge".
is deferred;
SetPCurve(me : in out;
aNewFace : Shape from TopoDS;
aNewEdge : in out Shape from TopoDS;
aGenF : Shape from TopoDS;
aGenE : Shape from TopoDS;
aDirV : NumShape from Sweep;
orien : Orientation from TopAbs)
---Purpose: Sets the PCurve for a new edge on a new face. The
-- new edge and the new face were generated using
-- aGenF, aGenE and aDirV.
is deferred;
SetGeneratingPCurve(me : in out;
aNewFace : Shape from TopoDS;
aNewEdge : in out Shape from TopoDS;
aGenE : Shape from TopoDS;
aDirE : NumShape from Sweep;
aDirV : NumShape from Sweep;
orien : Orientation from TopAbs)
---Purpose: Sets the PCurve for a new edge on a new face. The
-- new edge and the new face were generated using
-- aGenE, aDirE and aDirV.
is deferred;
SetDirectingPCurve(me : in out;
aNewFace : Shape from TopoDS;
aNewEdge : in out Shape from TopoDS;
aGenE : Shape from TopoDS;
aGenV : Shape from TopoDS;
aDirE : NumShape from Sweep;
orien : Orientation from TopAbs)
---Purpose: Sets the PCurve for a new edge on a new face. The
-- new edge and the new face were generated using
-- aGenE, aDirE and aGenV.
is deferred;
DirectSolid(me : in out;
aGenS : Shape from TopoDS;
aDirS : NumShape from Sweep)
returns Orientation from TopAbs
---Purpose: Returns the Orientation of the shell in the solid
-- generated by the face aGenS with the edge aDirS.
-- It is REVERSED if the surface is swept in the
-- direction of the normal.
is deferred;
GGDShapeIsToAdd (me;
aNewShape : Shape from TopoDS;
aNewSubShape : Shape from TopoDS;
aGenS : Shape from TopoDS;
aSubGenS : Shape from TopoDS;
aDirS : NumShape from Sweep)
returns Boolean from Standard
---Purpose: Returns true if aNewSubShape (addressed by
-- aSubGenS and aDirS) must be added in aNewShape
-- (addressed by aGenS and aDirS).
is deferred;
GDDShapeIsToAdd (me;
aNewShape : Shape from TopoDS;
aNewSubShape : Shape from TopoDS;
aGenS : Shape from TopoDS;
aDirS : NumShape from Sweep;
aSubDirS : NumShape from Sweep)
returns Boolean from Standard
---Purpose: Returns true if aNewSubShape (addressed by
-- aGenS and aSubDirS) must be added in aNewShape
-- (addressed by aGenS and aDirS).
is deferred;
SeparatedWires (me;
aNewShape : Shape from TopoDS;
aNewSubShape : Shape from TopoDS;
aGenS : Shape from TopoDS;
aSubGenS : Shape from TopoDS;
aDirS : NumShape from Sweep)
returns Boolean from Standard
---Purpose: In some particular cases the topology of a
-- generated face must be composed of independant
-- closed wires, in this case this function returns
-- true.
is deferred;
SplitShell (me; aNewShape : Shape from TopoDS)
returns Shape from TopoDS
---Purpose: In some particular cases the topology of a
-- generated Shell must be composed of independant
-- closed Shells, in this case this function returns
-- a Compound of independant Shells.
is virtual;
-- """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-- Method coding the continuities on the edges between 2 faces
-- """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
SetContinuity(me : in out; aGenS : Shape from TopoDS; aDirS : NumShape from Sweep)
---Purpose: Called to propagate the continuity of every vertex
-- between two edges of the generating wire aGenS on
-- the generated edge and faces.
is deferred;
-- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-- User end methods.
--
-- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-- Shapes
-- """"""
HasShape(me; aGenS : Shape from TopoDS; aDirS : NumShape from Sweep)
returns Boolean from Standard
---Purpose: Returns true if aDirS and aGenS addresses a
-- resulting Shape. In some specific cases the shape
-- can be geometrically inexsistant, then this
-- function returns false.
is deferred;
Shape(me: in out; aGenS : Shape from TopoDS; aDirS : NumShape from Sweep)
returns Shape from TopoDS
---Purpose: Returns the resulting Shape indexed by aDirS and
-- aGenS.
is static;
Shape(me: in out; aGenS : Shape from TopoDS)
returns Shape from TopoDS
---Purpose: Returns the resulting Shape indexed by myDirWire
-- and aGenS.
is static;
Shape(me: in out)
returns Shape from TopoDS
---Purpose: Returns the resulting Shape indexed by myDirWire
-- and myGenShape.
is static;
FirstShape(me: in out)
returns Shape from TopoDS
---Purpose: Returns the resulting Shape indexed by the first
-- Vertex of myDirWire and myGenShape.
is static;
LastShape(me: in out)
returns Shape from TopoDS
---Purpose: Returns the resulting Shape indexed by the last
-- Vertex of myDirWire and myGenShape.
is static;
FirstShape(me: in out; aGenS : Shape from TopoDS)
returns Shape from TopoDS
---Purpose: Returns the resulting Shape indexed by the first
-- Vertex of myDirWire and aGenS.
is static;
LastShape(me: in out; aGenS : Shape from TopoDS)
returns Shape from TopoDS
---Purpose: Returns the resulting Shape indexed by the last
-- Vertex of myDirWire and aGenS.
is static;
Closed(me) returns Boolean from Standard is static;
fields
-- Topology builder.
myBuilder : Builder from BRepSweep is protected;
-- Generating shape
myGenShape : Shape from TopoDS is protected;
-- Directing line
myDirWire : NumShape from Sweep is protected;
-- shape tools.
myGenShapeTool : Tool from BRepSweep is protected;
myDirShapeTool : NumShapeTool from Sweep is protected;
-- Array of built objects (NbGShapes,NbDShapes).
myShapes : Array2OfShape from TopTools is protected;
-- Array of built objects flags (NbGShapes,NbDShapes).
myBuiltShapes : Array2OfBoolean from TColStd is protected;
end NumLinearRegularSweep;

View File

@@ -14,30 +14,27 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepSweep_NumLinearRegularSweep.ixx>
#include <Standard_RangeError.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_NoMoreObject.hxx>
#include <Standard_DomainError.hxx>
#include <TopoDS_Shape.hxx>
#include <Sweep_NumShape.hxx>
#include <BRepSweep_Builder.hxx>
#include <BRepSweep_Tool.hxx>
#include <Sweep_NumShapeTool.hxx>
#include <BRepSweep_Iterator.hxx>
#include <BRepSweep_NumLinearRegularSweep.hxx>
#include <BRepSweep_Tool.hxx>
#include <Standard_DomainError.hxx>
#include <Standard_NoMoreObject.hxx>
#include <Standard_NoSuchObject.hxx>
#include <Standard_RangeError.hxx>
#include <Sweep_NumShape.hxx>
#include <Sweep_NumShapeIterator.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <TopAbs_Orientation.hxx>
#include <Sweep_NumShapeTool.hxx>
#include <TopAbs.hxx>
#include <TopAbs_Orientation.hxx>
#include <TopoDS_Shape.hxx>
#include <TopTools_SequenceOfShape.hxx>
//=======================================================================
//function : BRepSweep_NumLinearRegularSweep
//purpose : Create a Regular Sweep.
//=======================================================================
BRepSweep_NumLinearRegularSweep::BRepSweep_NumLinearRegularSweep
(const BRepSweep_Builder& aBuilder,
const TopoDS_Shape& aGenShape,

View File

@@ -0,0 +1,239 @@
// Created on: 1993-01-27
// Created by: Philippe DAUTRY
// 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 _BRepSweep_NumLinearRegularSweep_HeaderFile
#define _BRepSweep_NumLinearRegularSweep_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <BRepSweep_Builder.hxx>
#include <TopoDS_Shape.hxx>
#include <Sweep_NumShape.hxx>
#include <BRepSweep_Tool.hxx>
#include <Sweep_NumShapeTool.hxx>
#include <TopTools_Array2OfShape.hxx>
#include <TColStd_Array2OfBoolean.hxx>
#include <TopAbs_Orientation.hxx>
#include <Standard_Boolean.hxx>
class Standard_NoMoreObject;
class Standard_NoSuchObject;
class Standard_RangeError;
class Standard_DomainError;
class BRepSweep_Builder;
class TopoDS_Shape;
class Sweep_NumShape;
//! This a generic class is used to build Sweept
//! primitives with a generating "shape" and a
//! directing "line".
//!
//! The indexation and type analysis services required
//! for the generatrix are given by <Tool from BRepSweep>.
//!
//! The indexation and type analysis services required
//! for the directrix are given by <NumShapeTool from Sweep>.
//!
//! The iteration services required for the generatrix
//! are given by <Iterator from BRepSweep>.
//!
//! The iteration services required for the directrix
//! are given by <NumShapeIterator from Sweep>.
//!
//! The topology is like a grid of shapes. Each shape
//! of the grid must be addressable without confusion
//! by one or two objects from the generating or
//! directing shapes. Here are exemples of correct
//! associations to address:
//!
//! - a vertex : GenVertex - DirVertex
//! - an edge : GenVertex - DirEdge
//! - : GenEdge - DirVertex
//! - a face : GenEdge - DirEdge
//! GenFace - DirVertex
//! ...
//!
//! "GenObject" is used to identify an object from the
//! Generating Shape, and "DirObject" from the
//! Directing Shape. So may they be from different
//! types.
//!
//! The method Has... is given because in some special
//! cases, a vertex, an edge or a face may be
//! geometricaly nonexistant or not usefull.
class BRepSweep_NumLinearRegularSweep
{
public:
DEFINE_STANDARD_ALLOC
//! Builds the vertex addressed by [aGenV,aDirV], with its
//! geometric part, but without subcomponents.
Standard_EXPORT virtual TopoDS_Shape MakeEmptyVertex (const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirV) = 0;
Standard_EXPORT virtual ~BRepSweep_NumLinearRegularSweep();
//! Builds the edge addressed by [aGenV,aDirE], with its
//! geometric part, but without subcomponents.
Standard_EXPORT virtual TopoDS_Shape MakeEmptyDirectingEdge (const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirE) = 0;
//! Builds the edge addressed by [aGenE,aDirV], with its
//! geometric part, but without subcomponents.
Standard_EXPORT virtual TopoDS_Shape MakeEmptyGeneratingEdge (const TopoDS_Shape& aGenE, const Sweep_NumShape& aDirV) = 0;
//! Sets the parameters of the new vertex on the new
//! face. The new face and new vertex where generated
//! from aGenF, aGenV and aDirV .
Standard_EXPORT virtual void SetParameters (const TopoDS_Shape& aNewFace, TopoDS_Shape& aNewVertex, const TopoDS_Shape& aGenF, const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirV) = 0;
//! Sets the parameter of the new vertex on the new
//! edge. The new edge and new vertex where generated
//! from aGenV aDirE, and aDirV.
Standard_EXPORT virtual void SetDirectingParameter (const TopoDS_Shape& aNewEdge, TopoDS_Shape& aNewVertex, const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirE, const Sweep_NumShape& aDirV) = 0;
//! Sets the parameter of the new vertex on the new
//! edge. The new edge and new vertex where generated
//! from aGenE, aGenV and aDirV .
Standard_EXPORT virtual void SetGeneratingParameter (const TopoDS_Shape& aNewEdge, TopoDS_Shape& aNewVertex, const TopoDS_Shape& aGenE, const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirV) = 0;
//! Builds the face addressed by [aGenS,aDirS], with
//! its geometric part, but without subcomponents. The
//! couple aGenS, aDirS can be a "generating face and
//! a directing vertex" or "a generating edge and a
//! directing edge".
Standard_EXPORT virtual TopoDS_Shape MakeEmptyFace (const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS) = 0;
//! Sets the PCurve for a new edge on a new face. The
//! new edge and the new face were generated using
//! aGenF, aGenE and aDirV.
Standard_EXPORT virtual void SetPCurve (const TopoDS_Shape& aNewFace, TopoDS_Shape& aNewEdge, const TopoDS_Shape& aGenF, const TopoDS_Shape& aGenE, const Sweep_NumShape& aDirV, const TopAbs_Orientation orien) = 0;
//! Sets the PCurve for a new edge on a new face. The
//! new edge and the new face were generated using
//! aGenE, aDirE and aDirV.
Standard_EXPORT virtual void SetGeneratingPCurve (const TopoDS_Shape& aNewFace, TopoDS_Shape& aNewEdge, const TopoDS_Shape& aGenE, const Sweep_NumShape& aDirE, const Sweep_NumShape& aDirV, const TopAbs_Orientation orien) = 0;
//! Sets the PCurve for a new edge on a new face. The
//! new edge and the new face were generated using
//! aGenE, aDirE and aGenV.
Standard_EXPORT virtual void SetDirectingPCurve (const TopoDS_Shape& aNewFace, TopoDS_Shape& aNewEdge, const TopoDS_Shape& aGenE, const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirE, const TopAbs_Orientation orien) = 0;
//! Returns the Orientation of the shell in the solid
//! generated by the face aGenS with the edge aDirS.
//! It is REVERSED if the surface is swept in the
//! direction of the normal.
Standard_EXPORT virtual TopAbs_Orientation DirectSolid (const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS) = 0;
//! Returns true if aNewSubShape (addressed by
//! aSubGenS and aDirS) must be added in aNewShape
//! (addressed by aGenS and aDirS).
Standard_EXPORT virtual Standard_Boolean GGDShapeIsToAdd (const TopoDS_Shape& aNewShape, const TopoDS_Shape& aNewSubShape, const TopoDS_Shape& aGenS, const TopoDS_Shape& aSubGenS, const Sweep_NumShape& aDirS) const = 0;
//! Returns true if aNewSubShape (addressed by
//! aGenS and aSubDirS) must be added in aNewShape
//! (addressed by aGenS and aDirS).
Standard_EXPORT virtual Standard_Boolean GDDShapeIsToAdd (const TopoDS_Shape& aNewShape, const TopoDS_Shape& aNewSubShape, const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS, const Sweep_NumShape& aSubDirS) const = 0;
//! In some particular cases the topology of a
//! generated face must be composed of independant
//! closed wires, in this case this function returns
//! true.
Standard_EXPORT virtual Standard_Boolean SeparatedWires (const TopoDS_Shape& aNewShape, const TopoDS_Shape& aNewSubShape, const TopoDS_Shape& aGenS, const TopoDS_Shape& aSubGenS, const Sweep_NumShape& aDirS) const = 0;
//! In some particular cases the topology of a
//! generated Shell must be composed of independant
//! closed Shells, in this case this function returns
//! a Compound of independant Shells.
Standard_EXPORT virtual TopoDS_Shape SplitShell (const TopoDS_Shape& aNewShape) const;
//! Called to propagate the continuity of every vertex
//! between two edges of the generating wire aGenS on
//! the generated edge and faces.
Standard_EXPORT virtual void SetContinuity (const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS) = 0;
//! Returns true if aDirS and aGenS addresses a
//! resulting Shape. In some specific cases the shape
//! can be geometrically inexsistant, then this
//! function returns false.
Standard_EXPORT virtual Standard_Boolean HasShape (const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS) const = 0;
//! Returns the resulting Shape indexed by aDirS and
//! aGenS.
Standard_EXPORT TopoDS_Shape Shape (const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS);
//! Returns the resulting Shape indexed by myDirWire
//! and aGenS.
Standard_EXPORT TopoDS_Shape Shape (const TopoDS_Shape& aGenS);
//! Returns the resulting Shape indexed by myDirWire
//! and myGenShape.
Standard_EXPORT TopoDS_Shape Shape();
//! Returns the resulting Shape indexed by the first
//! Vertex of myDirWire and myGenShape.
Standard_EXPORT TopoDS_Shape FirstShape();
//! Returns the resulting Shape indexed by the last
//! Vertex of myDirWire and myGenShape.
Standard_EXPORT TopoDS_Shape LastShape();
//! Returns the resulting Shape indexed by the first
//! Vertex of myDirWire and aGenS.
Standard_EXPORT TopoDS_Shape FirstShape (const TopoDS_Shape& aGenS);
//! Returns the resulting Shape indexed by the last
//! Vertex of myDirWire and aGenS.
Standard_EXPORT TopoDS_Shape LastShape (const TopoDS_Shape& aGenS);
Standard_EXPORT Standard_Boolean Closed() const;
protected:
//! Creates a NumLinearRegularSweep. <aBuilder> gives
//! basic topological services.
Standard_EXPORT BRepSweep_NumLinearRegularSweep(const BRepSweep_Builder& aBuilder, const TopoDS_Shape& aGenShape, const Sweep_NumShape& aDirWire);
BRepSweep_Builder myBuilder;
TopoDS_Shape myGenShape;
Sweep_NumShape myDirWire;
BRepSweep_Tool myGenShapeTool;
Sweep_NumShapeTool myDirShapeTool;
TopTools_Array2OfShape myShapes;
TColStd_Array2OfBoolean myBuiltShapes;
private:
};
#endif // _BRepSweep_NumLinearRegularSweep_HeaderFile

View File

@@ -1,115 +0,0 @@
-- Created on: 1993-06-22
-- Created by: Laurent BOURESCHE
-- 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 Prism from BRepSweep
---Purpose: Provides natural constructors to build BRepSweep
-- translated swept Primitives.
uses
Location from TopLoc,
NumShape from Sweep,
Translation from BRepSweep,
Shape from TopoDS,
Vec from gp,
Dir from gp
raises
ConstructionError from Standard
is
Create (S : Shape from TopoDS;
V : Vec from gp;
Copy : Boolean from Standard = Standard_False;
Canonize: Boolean from Standard = Standard_True)
---Purpose: Builds the prism of base S and vector V. If C is true,
-- S is copied. If Canonize is true then generated surfaces
-- are attempted to be canonized in simple types
returns Prism from BRepSweep;
Create (S : Shape from TopoDS;
D : Dir from gp;
Inf : Boolean from Standard = Standard_True;
Copy : Boolean from Standard = Standard_False;
Canonize : Boolean from Standard = Standard_True)
---Purpose: Builds a semi-infinite or an infinite prism of base S.
-- If Copy is true S is copied. If Inf is true the prism
-- is infinite, if Inf is false the prism is infinite in
-- the direction D. If Canonize is true then generated surfaces
-- are attempted to be canonized in simple types
returns Prism from BRepSweep;
Shape (me : in out)
---Purpose: Returns the TopoDS Shape attached to the prism.
returns Shape from TopoDS
is static;
Shape (me : in out; aGenS : Shape from TopoDS)
---Purpose: Returns the TopoDS Shape generated with aGenS
-- (subShape of the generating shape).
returns Shape from TopoDS
is static;
FirstShape (me : in out)
---Purpose: Returns the TopoDS Shape of the bottom of the prism.
returns Shape from TopoDS
is static;
FirstShape (me : in out; aGenS : Shape from TopoDS)
---Purpose: Returns the TopoDS Shape of the bottom of the prism.
-- generated with aGenS (subShape of the generating
-- shape).
returns Shape from TopoDS
is static;
LastShape (me : in out)
---Purpose: Returns the TopoDS Shape of the top of the prism.
returns Shape from TopoDS
is static;
LastShape (me : in out; aGenS : Shape from TopoDS)
---Purpose: Returns the TopoDS Shape of the top of the prism.
-- generated with aGenS (subShape of the generating
-- shape).
returns Shape from TopoDS
is static;
Vec(me)
---Purpose: Returns the Vector of the Prism, if it is an infinite
-- prism the Vec is unitar.
returns Vec from gp
is static;
NumShape (me)
returns NumShape from Sweep
---Purpose: used to build the NumShape of a limited prism.
is static private;
NumShape (me; Inf : Boolean from Standard)
returns NumShape from Sweep
---Purpose: used to build the NumShape of an infinite prism.
is static private;
Location(me; V : Vec from gp)
returns Location from TopLoc
---Purpose: used to build the Location.
is static private;
fields
myTranslation : Translation from BRepSweep;
end Prism from BRepSweep;

View File

@@ -14,17 +14,22 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepSweep_Prism.ixx>
#include <BRepSweep_Translation.hxx>
#include <Sweep_NumShape.hxx>
#include <BRepSweep_Prism.hxx>
#include <BRepSweep_Translation.hxx>
#include <gp_Dir.hxx>
#include <gp_Trsf.hxx>
#include <gp_Vec.hxx>
#include <Precision.hxx>
#include <Standard_ConstructionError.hxx>
#include <Sweep_NumShape.hxx>
#include <TopLoc_Location.hxx>
#include <TopoDS_Shape.hxx>
//=======================================================================
//function : BRepSweep_Prism
//purpose :
//=======================================================================
BRepSweep_Prism::BRepSweep_Prism
(const TopoDS_Shape& S,
const gp_Vec& V,

View File

@@ -0,0 +1,115 @@
// Created on: 1993-06-22
// Created by: Laurent BOURESCHE
// 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 _BRepSweep_Prism_HeaderFile
#define _BRepSweep_Prism_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <BRepSweep_Translation.hxx>
#include <Standard_Boolean.hxx>
class Standard_ConstructionError;
class TopoDS_Shape;
class gp_Vec;
class gp_Dir;
class Sweep_NumShape;
class TopLoc_Location;
//! Provides natural constructors to build BRepSweep
//! translated swept Primitives.
class BRepSweep_Prism
{
public:
DEFINE_STANDARD_ALLOC
//! Builds the prism of base S and vector V. If C is true,
//! S is copied. If Canonize is true then generated surfaces
//! are attempted to be canonized in simple types
Standard_EXPORT BRepSweep_Prism(const TopoDS_Shape& S, const gp_Vec& V, const Standard_Boolean Copy = Standard_False, const Standard_Boolean Canonize = Standard_True);
//! Builds a semi-infinite or an infinite prism of base S.
//! If Copy is true S is copied. If Inf is true the prism
//! is infinite, if Inf is false the prism is infinite in
//! the direction D. If Canonize is true then generated surfaces
//! are attempted to be canonized in simple types
Standard_EXPORT BRepSweep_Prism(const TopoDS_Shape& S, const gp_Dir& D, const Standard_Boolean Inf = Standard_True, const Standard_Boolean Copy = Standard_False, const Standard_Boolean Canonize = Standard_True);
//! Returns the TopoDS Shape attached to the prism.
Standard_EXPORT TopoDS_Shape Shape();
//! Returns the TopoDS Shape generated with aGenS
//! (subShape of the generating shape).
Standard_EXPORT TopoDS_Shape Shape (const TopoDS_Shape& aGenS);
//! Returns the TopoDS Shape of the bottom of the prism.
Standard_EXPORT TopoDS_Shape FirstShape();
//! Returns the TopoDS Shape of the bottom of the prism.
//! generated with aGenS (subShape of the generating
//! shape).
Standard_EXPORT TopoDS_Shape FirstShape (const TopoDS_Shape& aGenS);
//! Returns the TopoDS Shape of the top of the prism.
Standard_EXPORT TopoDS_Shape LastShape();
//! Returns the TopoDS Shape of the top of the prism.
//! generated with aGenS (subShape of the generating
//! shape).
Standard_EXPORT TopoDS_Shape LastShape (const TopoDS_Shape& aGenS);
//! Returns the Vector of the Prism, if it is an infinite
//! prism the Vec is unitar.
Standard_EXPORT gp_Vec Vec() const;
protected:
private:
//! used to build the NumShape of a limited prism.
Standard_EXPORT Sweep_NumShape NumShape() const;
//! used to build the NumShape of an infinite prism.
Standard_EXPORT Sweep_NumShape NumShape (const Standard_Boolean Inf) const;
//! used to build the Location.
Standard_EXPORT TopLoc_Location Location (const gp_Vec& V) const;
BRepSweep_Translation myTranslation;
};
#endif // _BRepSweep_Prism_HeaderFile

View File

@@ -1,121 +0,0 @@
-- Created on: 1993-06-22
-- Created by: Laurent BOURESCHE
-- 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 Revol from BRepSweep
---Purpose: Provides natural constructors to build BRepSweep
-- rotated swept Primitives.
uses
PlaneAngle from Quantity,
NumShape from Sweep,
Rotation from BRepSweep,
Location from TopLoc,
Shape from TopoDS,
Ax1 from gp
raises
ConstructionError from Standard
is
Create (S : Shape from TopoDS;
A : Ax1 from gp;
D : PlaneAngle from Quantity;
C : Boolean from Standard = Standard_False)
---Purpose: Builds the Revol of meridian S axis A and angle D. If
-- C is true S is copied.
returns Revol from BRepSweep;
Create (S : Shape from TopoDS;
A : Ax1 from gp;
C : Boolean from Standard = Standard_False)
---Purpose: Builds the Revol of meridian S axis A and angle 2*Pi.
-- If C is true S is copied.
returns Revol from BRepSweep;
Shape (me :in out)
---Purpose: Returns the TopoDS Shape attached to the Revol.
returns Shape from TopoDS
is static;
Shape (me : in out; aGenS : Shape from TopoDS)
---Purpose: Returns the TopoDS Shape generated with aGenS
-- (subShape of the generating shape).
returns Shape from TopoDS
is static;
FirstShape (me : in out)
---Purpose: Returns the first shape of the revol (coinciding with
-- the generating shape).
returns Shape from TopoDS
is static;
FirstShape (me : in out; aGenS : Shape from TopoDS)
---Purpose: Returns the first shape of the revol (coinciding with
-- the generating shape).
returns Shape from TopoDS
is static;
LastShape (me : in out)
---Purpose: Returns the TopoDS Shape of the top of the prism.
returns Shape from TopoDS
is static;
LastShape (me : in out; aGenS : Shape from TopoDS)
---Purpose: Returns the TopoDS Shape of the top of the prism.
-- generated with aGenS (subShape of the generating
-- shape).
returns Shape from TopoDS
is static;
Axe(me)
returns Ax1 from gp
---Purpose: returns the axis
is static;
Angle(me)
returns PlaneAngle from Quantity
---Purpose: returns the angle.
is static;
NumShape(me; D : Real from Standard)
returns NumShape from Sweep
---Purpose: builds the NumShape.
is static private;
Location(me; Ax : Ax1 from gp; D : Real from Standard)
returns Location from TopLoc
---Purpose: Builds the Location
is static private;
Axe(me; Ax : Ax1 from gp; D : Real from Standard)
returns Ax1 from gp
---Purpose: Builds the axis
is static private;
Angle(me; D : Real from Standard)
returns Real from Standard
---Purpose: computes the angle.
is static private;
fields
myRotation : Rotation from BRepSweep;
end Revol from BRepSweep;

View File

@@ -14,17 +14,21 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepSweep_Revol.ixx>
#include <BRepSweep_Rotation.hxx>
#include <Sweep_NumShape.hxx>
#include <BRepSweep_Revol.hxx>
#include <BRepSweep_Rotation.hxx>
#include <gp_Ax1.hxx>
#include <gp_Trsf.hxx>
#include <Precision.hxx>
#include <Standard_ConstructionError.hxx>
#include <Sweep_NumShape.hxx>
#include <TopLoc_Location.hxx>
#include <TopoDS_Shape.hxx>
//=======================================================================
//function : BRepSweep_Revol
//purpose :
//=======================================================================
BRepSweep_Revol::BRepSweep_Revol
(const TopoDS_Shape& S,
const gp_Ax1& Ax,

View File

@@ -0,0 +1,117 @@
// Created on: 1993-06-22
// Created by: Laurent BOURESCHE
// 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 _BRepSweep_Revol_HeaderFile
#define _BRepSweep_Revol_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <BRepSweep_Rotation.hxx>
#include <Quantity_PlaneAngle.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Real.hxx>
class Standard_ConstructionError;
class TopoDS_Shape;
class gp_Ax1;
class Sweep_NumShape;
class TopLoc_Location;
//! Provides natural constructors to build BRepSweep
//! rotated swept Primitives.
class BRepSweep_Revol
{
public:
DEFINE_STANDARD_ALLOC
//! Builds the Revol of meridian S axis A and angle D. If
//! C is true S is copied.
Standard_EXPORT BRepSweep_Revol(const TopoDS_Shape& S, const gp_Ax1& A, const Quantity_PlaneAngle D, const Standard_Boolean C = Standard_False);
//! Builds the Revol of meridian S axis A and angle 2*Pi.
//! If C is true S is copied.
Standard_EXPORT BRepSweep_Revol(const TopoDS_Shape& S, const gp_Ax1& A, const Standard_Boolean C = Standard_False);
//! Returns the TopoDS Shape attached to the Revol.
Standard_EXPORT TopoDS_Shape Shape();
//! Returns the TopoDS Shape generated with aGenS
//! (subShape of the generating shape).
Standard_EXPORT TopoDS_Shape Shape (const TopoDS_Shape& aGenS);
//! Returns the first shape of the revol (coinciding with
//! the generating shape).
Standard_EXPORT TopoDS_Shape FirstShape();
//! Returns the first shape of the revol (coinciding with
//! the generating shape).
Standard_EXPORT TopoDS_Shape FirstShape (const TopoDS_Shape& aGenS);
//! Returns the TopoDS Shape of the top of the prism.
Standard_EXPORT TopoDS_Shape LastShape();
//! Returns the TopoDS Shape of the top of the prism.
//! generated with aGenS (subShape of the generating
//! shape).
Standard_EXPORT TopoDS_Shape LastShape (const TopoDS_Shape& aGenS);
//! returns the axis
Standard_EXPORT gp_Ax1 Axe() const;
//! returns the angle.
Standard_EXPORT Quantity_PlaneAngle Angle() const;
protected:
private:
//! builds the NumShape.
Standard_EXPORT Sweep_NumShape NumShape (const Standard_Real D) const;
//! Builds the Location
Standard_EXPORT TopLoc_Location Location (const gp_Ax1& Ax, const Standard_Real D) const;
//! Builds the axis
Standard_EXPORT gp_Ax1 Axe (const gp_Ax1& Ax, const Standard_Real D) const;
//! computes the angle.
Standard_EXPORT Standard_Real Angle (const Standard_Real D) const;
BRepSweep_Rotation myRotation;
};
#endif // _BRepSweep_Revol_HeaderFile

View File

@@ -1,224 +0,0 @@
-- Created on: 1993-02-15
-- Created by: Laurent BOURESCHE
-- 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 Rotation from BRepSweep inherits Trsf from BRepSweep
---Purpose: Provides an algorithm to build object by
-- Rotation sweep.
uses
PlaneAngle from Quantity,
Ax1 from gp,
Location from TopLoc,
Shape from TopoDS,
NumShape from Sweep,
Orientation from TopAbs
raises
ConstructionError from Standard
is
Create (S : Shape from TopoDS;
N : NumShape from Sweep;
L : Location from TopLoc;
A : Ax1 from gp;
D : PlaneAngle from Quantity;
C : Boolean from Standard)
returns Rotation from BRepSweep
---Purpose: Creates a topology by rotating <S> around A with the
-- angle D.
raises
ConstructionError from Standard; -- if <D> is null
-- """"""""""""""""""""""""""""""""""""""""""""""""""""""
-- Methods supporting the creation of the geometric part.
-- """"""""""""""""""""""""""""""""""""""""""""""""""""""
MakeEmptyVertex(me : in out;
aGenV : Shape from TopoDS;
aDirV : NumShape from Sweep)
---Purpose: Builds the vertex addressed by [aGenV,aDirV], with its
-- geometric part, but without subcomponents.
returns Shape from TopoDS;
MakeEmptyDirectingEdge(me : in out;
aGenV : Shape from TopoDS;
aDirE : NumShape from Sweep)
---Purpose: Builds the edge addressed by [aGenV,aDirE], with its
-- geometric part, but without subcomponents.
returns Shape from TopoDS;
MakeEmptyGeneratingEdge(me : in out;
aGenE : Shape from TopoDS;
aDirV : NumShape from Sweep)
---Purpose: Builds the edge addressed by [aGenE,aDirV], with its
-- geometric part, but without subcomponents.
returns Shape from TopoDS;
SetParameters(me : in out;
aNewFace : Shape from TopoDS;
aNewVertex : in out Shape from TopoDS;
aGenF : Shape from TopoDS;
aGenV : Shape from TopoDS;
aDirV : NumShape from Sweep);
---Purpose: Sets the parameters of the new vertex on the new
-- face. The new face and new vertex where generated
-- from aGenF, aGenV and aDirV .
SetDirectingParameter(me : in out;
aNewEdge : Shape from TopoDS;
aNewVertex : in out Shape from TopoDS;
aGenV : Shape from TopoDS;
aDirE : NumShape from Sweep;
aDirV : NumShape from Sweep);
---Purpose: Sets the parameter of the new vertex on the new
-- edge. The new edge and new vertex where generated
-- from aGenV aDirE, and aDirV.
SetGeneratingParameter(me : in out;
aNewEdge : Shape from TopoDS;
aNewVertex : in out Shape from TopoDS;
aGenE : Shape from TopoDS;
aGenV : Shape from TopoDS;
aDirV : NumShape from Sweep);
---Purpose: Sets the parameter of the new vertex on the new
-- edge. The new edge and new vertex where generated
-- from aGenE, aGenV and aDirV .
MakeEmptyFace(me : in out;
aGenS : Shape from TopoDS;
aDirS : NumShape from Sweep)
---Purpose: Builds the face addressed by [aGenS,aDirS], with
-- its geometric part, but without subcomponents. The
-- couple aGenS, aDirS can be a "generating face and
-- a directing vertex" or "a generating edge and a
-- directing edge".
returns Shape from TopoDS;
SetPCurve(me : in out;
aNewFace : Shape from TopoDS;
aNewEdge : in out Shape from TopoDS;
aGenF : Shape from TopoDS;
aGenE : Shape from TopoDS;
aDirV : NumShape from Sweep;
orien : Orientation from TopAbs);
---Purpose: Sets the PCurve for a new edge on a new face. The
-- new edge and the new face were generated using
-- aGenF, aGenE and aDirV.
SetGeneratingPCurve(me : in out;
aNewFace : Shape from TopoDS;
aNewEdge : in out Shape from TopoDS;
aGenE : Shape from TopoDS;
aDirE : NumShape from Sweep;
aDirV : NumShape from Sweep;
orien : Orientation from TopAbs);
---Purpose: Sets the PCurve for a new edge on a new face. The
-- new edge and the new face were generated using
-- aGenE, aDirE and aDirV.
SetDirectingPCurve(me : in out;
aNewFace : Shape from TopoDS;
aNewEdge : in out Shape from TopoDS;
aGenE : Shape from TopoDS;
aGenV : Shape from TopoDS;
aDirE : NumShape from Sweep;
orien : Orientation from TopAbs);
---Purpose: Sets the PCurve for a new edge on a new face. The
-- new edge and the new face were generated using
-- aGenE, aDirE and aGenV.
DirectSolid(me : in out;
aGenS : Shape from TopoDS;
aDirS : NumShape from Sweep)
returns Orientation from TopAbs;
---Purpose: Returns the Orientation of the shell in the solid
-- generated by the face aGenS with the edge aDirS.
-- It is REVERSED if the surface is swept in the
-- direction of the normal.
GGDShapeIsToAdd (me;
aNewShape : Shape from TopoDS;
aNewSubShape : Shape from TopoDS;
aGenS : Shape from TopoDS;
aSubGenS : Shape from TopoDS;
aDirS : NumShape from Sweep)
---Purpose: Returns true if aNewSubShape (addressed by
-- aSubGenS and aDirS) must be added in aNewShape
-- (addressed by aGenS and aDirS).
returns Boolean from Standard;
GDDShapeIsToAdd (me;
aNewShape : Shape from TopoDS;
aNewSubShape : Shape from TopoDS;
aGenS : Shape from TopoDS;
aDirS : NumShape from Sweep;
aSubDirS : NumShape from Sweep)
---Purpose: Returns true if aNewSubShape (addressed by
-- aGenS and aSubDirS) must be added in aNewShape
-- (addressed by aGenS and aDirS).
returns Boolean from Standard;
SeparatedWires (me;
aNewShape : Shape from TopoDS;
aNewSubShape : Shape from TopoDS;
aGenS : Shape from TopoDS;
aSubGenS : Shape from TopoDS;
aDirS : NumShape from Sweep)
---Purpose: In some particular cases the topology of a
-- generated face must be composed of independant
-- closed wires, in this case this function returns
-- true. The only case in whitch the function may
-- return true is a planar face in a closed revol.
returns Boolean from Standard;
SplitShell (me; aNewShape : Shape from TopoDS)
returns Shape from TopoDS
---Purpose: In some particular cases the topology of a
-- generated Shell must be composed of independant
-- closed Shells, in this case this function returns
-- a Compound of independant Shells.
is redefined;
HasShape(me; aGenS : Shape from TopoDS; aDirS : NumShape from Sweep)
---Purpose: Returns true if aDirS and aGenS addresses a
-- resulting Shape. In some specific cases the shape
-- can be geometrically inexsistant, then this
-- function returns false.
returns Boolean from Standard;
IsInvariant (me; aGenS : Shape from TopoDS)
---Purpose: Returns true when the geometry of aGenS is not
-- modified by the rotation.
returns Boolean from Standard;
Axe(me)
returns Ax1 from gp
---Purpose: returns the axis
is static;
Angle(me)
returns PlaneAngle from Quantity
---Purpose: returns the angle.
is static;
fields
myAng : Real from Standard;
myAxe : Ax1 from gp;
end Rotation;

View File

@@ -14,54 +14,57 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepSweep_Rotation.ixx>
#include <BRepTools_Quilt.hxx>
#include <Adaptor3d_SurfaceOfRevolution.hxx>
#include <BRep_Tool.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <BRep_Tool.hxx>
#include <BRepSweep_Rotation.hxx>
#include <BRepTools.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopExp.hxx>
#include <ElSLib.hxx>
#include <BRepTools_Quilt.hxx>
#include <ElCLib.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <GeomAdaptor_Surface.hxx>
#include <Adaptor3d_SurfaceOfRevolution.hxx>
#include <Geom_SurfaceOfRevolution.hxx>
#include <Geom_CylindricalSurface.hxx>
#include <Geom_ConicalSurface.hxx>
#include <Geom_SphericalSurface.hxx>
#include <Geom_ToroidalSurface.hxx>
#include <Geom_Plane.hxx>
#include <Geom_Circle.hxx>
#include <Geom_Line.hxx>
#include <ElSLib.hxx>
#include <Geom2d_Circle.hxx>
#include <Geom2d_Line.hxx>
#include <Geom_Circle.hxx>
#include <Geom_ConicalSurface.hxx>
#include <Geom_Curve.hxx>
#include <Geom_CylindricalSurface.hxx>
#include <Geom_Line.hxx>
#include <Geom_Plane.hxx>
#include <Geom_SphericalSurface.hxx>
#include <Geom_Surface.hxx>
#include <Geom_SurfaceOfRevolution.hxx>
#include <Geom_ToroidalSurface.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <GeomAdaptor_HCurve.hxx>
#include <GeomAdaptor_Surface.hxx>
#include <gp.hxx>
#include <gp_Trsf.hxx>
#include <gp_Ax1.hxx>
#include <gp_Ax3.hxx>
#include <gp_Ax22d.hxx>
#include <gp_Circ2d.hxx>
#include <gp_Cone.hxx>
#include <gp_Cylinder.hxx>
#include <gp_Dir.hxx>
#include <gp_Dir2d.hxx>
#include <gp_Lin.hxx>
#include <gp_Lin2d.hxx>
#include <gp_Pln.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Ax22d.hxx>
#include <gp_Cylinder.hxx>
#include <gp_Pln.hxx>
#include <gp_Cone.hxx>
#include <gp_Sphere.hxx>
#include <gp_Torus.hxx>
#include <gp_Ax3.hxx>
#include <gp_Trsf.hxx>
#include <Precision.hxx>
#include <Standard_ConstructionError.hxx>
#include <GeomAdaptor_HCurve.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Surface.hxx>
#include <Sweep_NumShape.hxx>
#include <TopExp.hxx>
#include <TopLoc_Location.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
static Standard_Real ComputeTolerance(TopoDS_Edge& E,
const TopoDS_Face& F,

View File

@@ -0,0 +1,169 @@
// Created on: 1993-02-15
// Created by: Laurent BOURESCHE
// 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 _BRepSweep_Rotation_HeaderFile
#define _BRepSweep_Rotation_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Real.hxx>
#include <gp_Ax1.hxx>
#include <BRepSweep_Trsf.hxx>
#include <Quantity_PlaneAngle.hxx>
#include <Standard_Boolean.hxx>
#include <TopAbs_Orientation.hxx>
class Standard_ConstructionError;
class TopoDS_Shape;
class Sweep_NumShape;
class TopLoc_Location;
class gp_Ax1;
//! Provides an algorithm to build object by
//! Rotation sweep.
class BRepSweep_Rotation : public BRepSweep_Trsf
{
public:
DEFINE_STANDARD_ALLOC
//! Creates a topology by rotating <S> around A with the
//! angle D.
Standard_EXPORT BRepSweep_Rotation(const TopoDS_Shape& S, const Sweep_NumShape& N, const TopLoc_Location& L, const gp_Ax1& A, const Quantity_PlaneAngle D, const Standard_Boolean C);
//! Builds the vertex addressed by [aGenV,aDirV], with its
//! geometric part, but without subcomponents.
Standard_EXPORT TopoDS_Shape MakeEmptyVertex (const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirV);
//! Builds the edge addressed by [aGenV,aDirE], with its
//! geometric part, but without subcomponents.
Standard_EXPORT TopoDS_Shape MakeEmptyDirectingEdge (const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirE);
//! Builds the edge addressed by [aGenE,aDirV], with its
//! geometric part, but without subcomponents.
Standard_EXPORT TopoDS_Shape MakeEmptyGeneratingEdge (const TopoDS_Shape& aGenE, const Sweep_NumShape& aDirV);
//! Sets the parameters of the new vertex on the new
//! face. The new face and new vertex where generated
//! from aGenF, aGenV and aDirV .
Standard_EXPORT void SetParameters (const TopoDS_Shape& aNewFace, TopoDS_Shape& aNewVertex, const TopoDS_Shape& aGenF, const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirV);
//! Sets the parameter of the new vertex on the new
//! edge. The new edge and new vertex where generated
//! from aGenV aDirE, and aDirV.
Standard_EXPORT void SetDirectingParameter (const TopoDS_Shape& aNewEdge, TopoDS_Shape& aNewVertex, const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirE, const Sweep_NumShape& aDirV);
//! Sets the parameter of the new vertex on the new
//! edge. The new edge and new vertex where generated
//! from aGenE, aGenV and aDirV .
Standard_EXPORT void SetGeneratingParameter (const TopoDS_Shape& aNewEdge, TopoDS_Shape& aNewVertex, const TopoDS_Shape& aGenE, const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirV);
//! Builds the face addressed by [aGenS,aDirS], with
//! its geometric part, but without subcomponents. The
//! couple aGenS, aDirS can be a "generating face and
//! a directing vertex" or "a generating edge and a
//! directing edge".
Standard_EXPORT TopoDS_Shape MakeEmptyFace (const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS);
//! Sets the PCurve for a new edge on a new face. The
//! new edge and the new face were generated using
//! aGenF, aGenE and aDirV.
Standard_EXPORT void SetPCurve (const TopoDS_Shape& aNewFace, TopoDS_Shape& aNewEdge, const TopoDS_Shape& aGenF, const TopoDS_Shape& aGenE, const Sweep_NumShape& aDirV, const TopAbs_Orientation orien);
//! Sets the PCurve for a new edge on a new face. The
//! new edge and the new face were generated using
//! aGenE, aDirE and aDirV.
Standard_EXPORT void SetGeneratingPCurve (const TopoDS_Shape& aNewFace, TopoDS_Shape& aNewEdge, const TopoDS_Shape& aGenE, const Sweep_NumShape& aDirE, const Sweep_NumShape& aDirV, const TopAbs_Orientation orien);
//! Sets the PCurve for a new edge on a new face. The
//! new edge and the new face were generated using
//! aGenE, aDirE and aGenV.
Standard_EXPORT void SetDirectingPCurve (const TopoDS_Shape& aNewFace, TopoDS_Shape& aNewEdge, const TopoDS_Shape& aGenE, const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirE, const TopAbs_Orientation orien);
//! Returns the Orientation of the shell in the solid
//! generated by the face aGenS with the edge aDirS.
//! It is REVERSED if the surface is swept in the
//! direction of the normal.
Standard_EXPORT TopAbs_Orientation DirectSolid (const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS);
//! Returns true if aNewSubShape (addressed by
//! aSubGenS and aDirS) must be added in aNewShape
//! (addressed by aGenS and aDirS).
Standard_EXPORT Standard_Boolean GGDShapeIsToAdd (const TopoDS_Shape& aNewShape, const TopoDS_Shape& aNewSubShape, const TopoDS_Shape& aGenS, const TopoDS_Shape& aSubGenS, const Sweep_NumShape& aDirS) const;
//! Returns true if aNewSubShape (addressed by
//! aGenS and aSubDirS) must be added in aNewShape
//! (addressed by aGenS and aDirS).
Standard_EXPORT Standard_Boolean GDDShapeIsToAdd (const TopoDS_Shape& aNewShape, const TopoDS_Shape& aNewSubShape, const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS, const Sweep_NumShape& aSubDirS) const;
//! In some particular cases the topology of a
//! generated face must be composed of independant
//! closed wires, in this case this function returns
//! true. The only case in whitch the function may
//! return true is a planar face in a closed revol.
Standard_EXPORT Standard_Boolean SeparatedWires (const TopoDS_Shape& aNewShape, const TopoDS_Shape& aNewSubShape, const TopoDS_Shape& aGenS, const TopoDS_Shape& aSubGenS, const Sweep_NumShape& aDirS) const;
//! In some particular cases the topology of a
//! generated Shell must be composed of independant
//! closed Shells, in this case this function returns
//! a Compound of independant Shells.
Standard_EXPORT virtual TopoDS_Shape SplitShell (const TopoDS_Shape& aNewShape) const Standard_OVERRIDE;
//! Returns true if aDirS and aGenS addresses a
//! resulting Shape. In some specific cases the shape
//! can be geometrically inexsistant, then this
//! function returns false.
Standard_EXPORT Standard_Boolean HasShape (const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS) const;
//! Returns true when the geometry of aGenS is not
//! modified by the rotation.
Standard_EXPORT Standard_Boolean IsInvariant (const TopoDS_Shape& aGenS) const;
//! returns the axis
Standard_EXPORT gp_Ax1 Axe() const;
//! returns the angle.
Standard_EXPORT Quantity_PlaneAngle Angle() const;
protected:
private:
Standard_Real myAng;
gp_Ax1 myAxe;
};
#endif // _BRepSweep_Rotation_HeaderFile

View File

@@ -1,75 +0,0 @@
-- Created on: 1993-06-08
-- Created by: Laurent BOURESCHE
-- 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 Tool from BRepSweep -- as Tool from Sweep
---Purpose: Provides the indexation and type analysis services
-- required by the TopoDS generating Shape of BRepSweep.
--
uses
Shape from TopoDS,
IndexedMapOfShape from TopTools,
ShapeEnum from TopAbs,
Orientation from TopAbs
raises
OutOfRange from Standard
is
Create(aShape: Shape from TopoDS);
---Purpose: Initialize the tool with <aShape>. The IndexTool
-- must prepare an indexation for all the subshapes
-- of this shape.
NbShapes(me) returns Integer
---Purpose: Returns the number of subshapes in the shape.
is static;
Index(me; aShape : Shape from TopoDS) returns Integer
---Purpose: Returns the index of <aShape>.
is static;
Shape(me; anIndex : Integer from Standard) returns Shape from TopoDS
---Purpose: Returns the Shape at Index anIdex.
is static;
Type(me; aShape : Shape from TopoDS) returns ShapeEnum from TopAbs
---Purpose: Returns the type of <aShape>.
is static;
Orientation (me; aShape : Shape from TopoDS)
returns Orientation from TopAbs
---Purpose: Returns the Orientation of <aShape>.
is static;
SetOrientation (me;
aShape : in out Shape from TopoDS;
Or : Orientation from TopAbs)
---Purpose: Set the Orientation of <aShape> with Or.
is static;
fields
myMap : IndexedMapOfShape from TopTools;
end Tool from BRepSweep;

View File

@@ -14,14 +14,16 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepSweep_Tool.ixx>
#include <BRepSweep_Tool.hxx>
#include <Standard_OutOfRange.hxx>
#include <TopExp.hxx>
#include <TopoDS_Shape.hxx>
//=======================================================================
//function : BRepSweep_Tool
//purpose :
//=======================================================================
BRepSweep_Tool::BRepSweep_Tool(const TopoDS_Shape& aShape)
{
TopExp::MapShapes(aShape,myMap);

View File

@@ -0,0 +1,88 @@
// Created on: 1993-06-08
// Created by: Laurent BOURESCHE
// 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 _BRepSweep_Tool_HeaderFile
#define _BRepSweep_Tool_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <Standard_Integer.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <TopAbs_Orientation.hxx>
class Standard_OutOfRange;
class TopoDS_Shape;
//! Provides the indexation and type analysis services
//! required by the TopoDS generating Shape of BRepSweep.
class BRepSweep_Tool
{
public:
DEFINE_STANDARD_ALLOC
//! Initialize the tool with <aShape>. The IndexTool
//! must prepare an indexation for all the subshapes
//! of this shape.
Standard_EXPORT BRepSweep_Tool(const TopoDS_Shape& aShape);
//! Returns the number of subshapes in the shape.
Standard_EXPORT Standard_Integer NbShapes() const;
//! Returns the index of <aShape>.
Standard_EXPORT Standard_Integer Index (const TopoDS_Shape& aShape) const;
//! Returns the Shape at Index anIdex.
Standard_EXPORT TopoDS_Shape Shape (const Standard_Integer anIndex) const;
//! Returns the type of <aShape>.
Standard_EXPORT TopAbs_ShapeEnum Type (const TopoDS_Shape& aShape) const;
//! Returns the Orientation of <aShape>.
Standard_EXPORT TopAbs_Orientation Orientation (const TopoDS_Shape& aShape) const;
//! Set the Orientation of <aShape> with Or.
Standard_EXPORT void SetOrientation (TopoDS_Shape& aShape, const TopAbs_Orientation Or) const;
protected:
private:
TopTools_IndexedMapOfShape myMap;
};
#endif // _BRepSweep_Tool_HeaderFile

View File

@@ -1,215 +0,0 @@
-- Created on: 1993-02-03
-- Created by: Laurent BOURESCHE
-- 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 Translation from BRepSweep inherits Trsf from BRepSweep
---Purpose: Provides an algorithm to build object by
-- translation sweep.
uses
Vec from gp,
Location from TopLoc,
Shape from TopoDS,
NumShape from Sweep,
Orientation from TopAbs
raises
ConstructionError from Standard
is
Create (S : Shape from TopoDS;
N : NumShape from Sweep;
L : Location from TopLoc;
V : Vec from gp;
C : Boolean from Standard;
Canonize: Boolean from Standard = Standard_True)
returns Translation from BRepSweep
---Purpose: Creates a topology by translating <S> with the
-- vector <V>. If C is true S Sucomponents are
-- copied. If Canonize is true then generated surfaces
-- are attempted to be canonized in simple types
raises
ConstructionError from Standard; -- if <V> is null
-- """"""""""""""""""""""""""""""""""""""""""""""""""""""
-- Methods supporting the creation of the geometric part.
-- """"""""""""""""""""""""""""""""""""""""""""""""""""""
MakeEmptyVertex(me : in out;
aGenV : Shape from TopoDS;
aDirV : NumShape from Sweep)
---Purpose: Builds the vertex addressed by [aGenV,aDirV], with its
-- geometric part, but without subcomponents.
returns Shape from TopoDS;
MakeEmptyDirectingEdge(me : in out;
aGenV : Shape from TopoDS;
aDirE : NumShape from Sweep)
---Purpose: Builds the edge addressed by [aGenV,aDirE], with its
-- geometric part, but without subcomponents.
returns Shape from TopoDS;
MakeEmptyGeneratingEdge(me : in out;
aGenE : Shape from TopoDS;
aDirV : NumShape from Sweep)
---Purpose: Builds the edge addressed by [aGenE,aDirV], with its
-- geometric part, but without subcomponents.
returns Shape from TopoDS;
SetParameters(me : in out;
aNewFace : Shape from TopoDS;
aNewVertex : in out Shape from TopoDS;
aGenF : Shape from TopoDS;
aGenV : Shape from TopoDS;
aDirV : NumShape from Sweep);
---Purpose: Sets the parameters of the new vertex on the new
-- face. The new face and new vertex where generated
-- from aGenF, aGenV and aDirV .
SetDirectingParameter(me : in out;
aNewEdge : Shape from TopoDS;
aNewVertex : in out Shape from TopoDS;
aGenV : Shape from TopoDS;
aDirE : NumShape from Sweep;
aDirV : NumShape from Sweep);
---Purpose: Sets the parameter of the new vertex on the new
-- edge. The new edge and new vertex where generated
-- from aGenV aDirE, and aDirV.
SetGeneratingParameter(me : in out;
aNewEdge : Shape from TopoDS;
aNewVertex : in out Shape from TopoDS;
aGenE : Shape from TopoDS;
aGenV : Shape from TopoDS;
aDirV : NumShape from Sweep);
---Purpose: Sets the parameter of the new vertex on the new
-- edge. The new edge and new vertex where generated
-- from aGenE, aGenV and aDirV .
MakeEmptyFace(me : in out;
aGenS : Shape from TopoDS;
aDirS : NumShape from Sweep)
---Purpose: Builds the face addressed by [aGenS,aDirS], with
-- its geometric part, but without subcomponents. The
-- couple aGenS, aDirS can be a "generating face and
-- a directing vertex" or "a generating edge and a
-- directing edge".
returns Shape from TopoDS;
SetPCurve(me : in out;
aNewFace : Shape from TopoDS;
aNewEdge : in out Shape from TopoDS;
aGenF : Shape from TopoDS;
aGenE : Shape from TopoDS;
aDirV : NumShape from Sweep;
orien : Orientation from TopAbs);
---Purpose: Sets the PCurve for a new edge on a new face. The
-- new edge and the new face were generated using
-- aGenF, aGenE and aDirV.
SetGeneratingPCurve(me : in out;
aNewFace : Shape from TopoDS;
aNewEdge : in out Shape from TopoDS;
aGenE : Shape from TopoDS;
aDirE : NumShape from Sweep;
aDirV : NumShape from Sweep;
orien : Orientation from TopAbs);
---Purpose: Sets the PCurve for a new edge on a new face. The
-- new edge and the new face were generated using
-- aGenE, aDirE and aDirV.
SetDirectingPCurve(me : in out;
aNewFace : Shape from TopoDS;
aNewEdge : in out Shape from TopoDS;
aGenE : Shape from TopoDS;
aGenV : Shape from TopoDS;
aDirE : NumShape from Sweep;
orien : Orientation from TopAbs);
---Purpose: Sets the PCurve for a new edge on a new face. The
-- new edge and the new face were generated using
-- aGenE, aDirE and aGenV.
DirectSolid(me : in out;
aGenS : Shape from TopoDS;
aDirS : NumShape from Sweep)
returns Orientation from TopAbs;
---Purpose: Returns the Orientation of the shell in the solid
-- generated by the face aGenS with the edge aDirS.
-- It is REVERSED if the surface is swept in the
-- direction of the normal.
GGDShapeIsToAdd (me;
aNewShape : Shape from TopoDS;
aNewSubShape : Shape from TopoDS;
aGenS : Shape from TopoDS;
aSubGenS : Shape from TopoDS;
aDirS : NumShape from Sweep)
---Purpose: Returns true if aNewSubShape (addressed by
-- aSubGenS and aDirS) must be added in aNewShape
-- (addressed by aGenS and aDirS).
returns Boolean from Standard;
GDDShapeIsToAdd (me;
aNewShape : Shape from TopoDS;
aNewSubShape : Shape from TopoDS;
aGenS : Shape from TopoDS;
aDirS : NumShape from Sweep;
aSubDirS : NumShape from Sweep)
---Purpose: Returns true if aNewSubShape (addressed by
-- aGenS and aSubDirS) must be added in aNewShape
-- (addressed by aGenS and aDirS).
returns Boolean from Standard;
SeparatedWires (me;
aNewShape : Shape from TopoDS;
aNewSubShape : Shape from TopoDS;
aGenS : Shape from TopoDS;
aSubGenS : Shape from TopoDS;
aDirS : NumShape from Sweep)
---Purpose: In some particular cases the topology of a
-- generated face must be composed of independant
-- closed wires, in this case this function returns
-- true.
-- Here it always returns false.
returns Boolean from Standard;
HasShape(me; aGenS : Shape from TopoDS; aDirS : NumShape from Sweep)
---Purpose: Returns true if aDirS and aGenS addresses a
-- resulting Shape. In some specific cases the shape
-- can be geometrically inexsistant, then this
-- function returns false.
returns Boolean from Standard;
IsInvariant (me; aGenS : Shape from TopoDS)
---Purpose: Returns always false because here the
-- transformation is a translation.
returns Boolean from Standard;
Vec(me)
---Purpose: Returns the Vector of the Prism, if it is an infinite
-- prism the Vec is unitar.
returns Vec from gp
is static;
fields
myVec : Vec from gp;
myCanonize : Boolean from Standard;
end Translation;

View File

@@ -14,42 +14,45 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepSweep_Translation.ixx>
#include <Adaptor3d_SurfaceOfLinearExtrusion.hxx>
#include <BRep_CurveRepresentation.hxx>
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
#include <BRep_TEdge.hxx>
#include <BRep_Tool.hxx>
#include <BRepTools.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Vertex.hxx>
#include <BRepSweep_Translation.hxx>
#include <BRepTools.hxx>
#include <ElSLib.hxx>
#include <GeomAbs_SurfaceType.hxx>
#include <GeomAdaptor_Surface.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <Geom_SurfaceOfLinearExtrusion.hxx>
#include <Geom_Plane.hxx>
#include <Geom2d_Line.hxx>
#include <Geom_Curve.hxx>
#include <Geom_CylindricalSurface.hxx>
#include <Geom_Line.hxx>
#include <Geom2d_Line.hxx>
#include <Geom_Plane.hxx>
#include <Geom_Surface.hxx>
#include <Geom_SurfaceOfLinearExtrusion.hxx>
#include <GeomAbs_SurfaceType.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <GeomAdaptor_HCurve.hxx>
#include <GeomAdaptor_Surface.hxx>
#include <gp.hxx>
#include <gp_Trsf.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Lin.hxx>
#include <gp_Lin2d.hxx>
#include <gp_Dir.hxx>
#include <gp_Dir2d.hxx>
#include <gp_Lin.hxx>
#include <gp_Lin2d.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Trsf.hxx>
#include <gp_Vec.hxx>
#include <Precision.hxx>
#include <Standard_ConstructionError.hxx>
#include <GeomAdaptor_HCurve.hxx>
#include <Adaptor3d_SurfaceOfLinearExtrusion.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRep_TEdge.hxx>
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
#include <BRep_CurveRepresentation.hxx>
#include <Sweep_NumShape.hxx>
#include <TopExp_Explorer.hxx>
#include <Geom_Curve.hxx>
#include <Geom_Surface.hxx>
#include <TopLoc_Location.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
static void SetThePCurve(const BRep_Builder& B,
TopoDS_Edge& E,

View File

@@ -0,0 +1,161 @@
// Created on: 1993-02-03
// Created by: Laurent BOURESCHE
// 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 _BRepSweep_Translation_HeaderFile
#define _BRepSweep_Translation_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <gp_Vec.hxx>
#include <Standard_Boolean.hxx>
#include <BRepSweep_Trsf.hxx>
#include <TopAbs_Orientation.hxx>
class Standard_ConstructionError;
class TopoDS_Shape;
class Sweep_NumShape;
class TopLoc_Location;
class gp_Vec;
//! Provides an algorithm to build object by
//! translation sweep.
class BRepSweep_Translation : public BRepSweep_Trsf
{
public:
DEFINE_STANDARD_ALLOC
//! Creates a topology by translating <S> with the
//! vector <V>. If C is true S Sucomponents are
//! copied. If Canonize is true then generated surfaces
//! are attempted to be canonized in simple types
Standard_EXPORT BRepSweep_Translation(const TopoDS_Shape& S, const Sweep_NumShape& N, const TopLoc_Location& L, const gp_Vec& V, const Standard_Boolean C, const Standard_Boolean Canonize = Standard_True);
//! Builds the vertex addressed by [aGenV,aDirV], with its
//! geometric part, but without subcomponents.
Standard_EXPORT TopoDS_Shape MakeEmptyVertex (const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirV);
//! Builds the edge addressed by [aGenV,aDirE], with its
//! geometric part, but without subcomponents.
Standard_EXPORT TopoDS_Shape MakeEmptyDirectingEdge (const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirE);
//! Builds the edge addressed by [aGenE,aDirV], with its
//! geometric part, but without subcomponents.
Standard_EXPORT TopoDS_Shape MakeEmptyGeneratingEdge (const TopoDS_Shape& aGenE, const Sweep_NumShape& aDirV);
//! Sets the parameters of the new vertex on the new
//! face. The new face and new vertex where generated
//! from aGenF, aGenV and aDirV .
Standard_EXPORT void SetParameters (const TopoDS_Shape& aNewFace, TopoDS_Shape& aNewVertex, const TopoDS_Shape& aGenF, const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirV);
//! Sets the parameter of the new vertex on the new
//! edge. The new edge and new vertex where generated
//! from aGenV aDirE, and aDirV.
Standard_EXPORT void SetDirectingParameter (const TopoDS_Shape& aNewEdge, TopoDS_Shape& aNewVertex, const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirE, const Sweep_NumShape& aDirV);
//! Sets the parameter of the new vertex on the new
//! edge. The new edge and new vertex where generated
//! from aGenE, aGenV and aDirV .
Standard_EXPORT void SetGeneratingParameter (const TopoDS_Shape& aNewEdge, TopoDS_Shape& aNewVertex, const TopoDS_Shape& aGenE, const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirV);
//! Builds the face addressed by [aGenS,aDirS], with
//! its geometric part, but without subcomponents. The
//! couple aGenS, aDirS can be a "generating face and
//! a directing vertex" or "a generating edge and a
//! directing edge".
Standard_EXPORT TopoDS_Shape MakeEmptyFace (const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS);
//! Sets the PCurve for a new edge on a new face. The
//! new edge and the new face were generated using
//! aGenF, aGenE and aDirV.
Standard_EXPORT void SetPCurve (const TopoDS_Shape& aNewFace, TopoDS_Shape& aNewEdge, const TopoDS_Shape& aGenF, const TopoDS_Shape& aGenE, const Sweep_NumShape& aDirV, const TopAbs_Orientation orien);
//! Sets the PCurve for a new edge on a new face. The
//! new edge and the new face were generated using
//! aGenE, aDirE and aDirV.
Standard_EXPORT void SetGeneratingPCurve (const TopoDS_Shape& aNewFace, TopoDS_Shape& aNewEdge, const TopoDS_Shape& aGenE, const Sweep_NumShape& aDirE, const Sweep_NumShape& aDirV, const TopAbs_Orientation orien);
//! Sets the PCurve for a new edge on a new face. The
//! new edge and the new face were generated using
//! aGenE, aDirE and aGenV.
Standard_EXPORT void SetDirectingPCurve (const TopoDS_Shape& aNewFace, TopoDS_Shape& aNewEdge, const TopoDS_Shape& aGenE, const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirE, const TopAbs_Orientation orien);
//! Returns the Orientation of the shell in the solid
//! generated by the face aGenS with the edge aDirS.
//! It is REVERSED if the surface is swept in the
//! direction of the normal.
Standard_EXPORT TopAbs_Orientation DirectSolid (const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS);
//! Returns true if aNewSubShape (addressed by
//! aSubGenS and aDirS) must be added in aNewShape
//! (addressed by aGenS and aDirS).
Standard_EXPORT Standard_Boolean GGDShapeIsToAdd (const TopoDS_Shape& aNewShape, const TopoDS_Shape& aNewSubShape, const TopoDS_Shape& aGenS, const TopoDS_Shape& aSubGenS, const Sweep_NumShape& aDirS) const;
//! Returns true if aNewSubShape (addressed by
//! aGenS and aSubDirS) must be added in aNewShape
//! (addressed by aGenS and aDirS).
Standard_EXPORT Standard_Boolean GDDShapeIsToAdd (const TopoDS_Shape& aNewShape, const TopoDS_Shape& aNewSubShape, const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS, const Sweep_NumShape& aSubDirS) const;
//! In some particular cases the topology of a
//! generated face must be composed of independant
//! closed wires, in this case this function returns
//! true.
//! Here it always returns false.
Standard_EXPORT Standard_Boolean SeparatedWires (const TopoDS_Shape& aNewShape, const TopoDS_Shape& aNewSubShape, const TopoDS_Shape& aGenS, const TopoDS_Shape& aSubGenS, const Sweep_NumShape& aDirS) const;
//! Returns true if aDirS and aGenS addresses a
//! resulting Shape. In some specific cases the shape
//! can be geometrically inexsistant, then this
//! function returns false.
Standard_EXPORT Standard_Boolean HasShape (const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS) const;
//! Returns always false because here the
//! transformation is a translation.
Standard_EXPORT Standard_Boolean IsInvariant (const TopoDS_Shape& aGenS) const;
//! Returns the Vector of the Prism, if it is an infinite
//! prism the Vec is unitar.
Standard_EXPORT gp_Vec Vec() const;
protected:
private:
gp_Vec myVec;
Standard_Boolean myCanonize;
};
#endif // _BRepSweep_Translation_HeaderFile

View File

@@ -1,246 +0,0 @@
-- Created on: 1993-06-08
-- Created by: Laurent BOURESCHE
-- 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.
deferred class Trsf from BRepSweep inherits NumLinearRegularSweep
from BRepSweep
---Purpose: This class is inherited from NumLinearRegularSweep
-- to implement the simple swept primitives built
-- moving a Shape with a Trsf. It often is possible
-- to build the constructed subshapes by a simple
-- move of the generating subshapes (shared topology
-- and geometry). So two ways of construction are
-- proposed :
--
--
-- - sharing basis elements (the generatrice can be
-- modified , for exemples PCurves can be added on
-- faces);
--
-- - copying everything.
uses
Builder from BRep,
Shape from TopoDS,
NumShape from Sweep,
Location from TopLoc,
Orientation from TopAbs
is
Initialize(aBuilder : Builder from BRep;
aGenShape : Shape from TopoDS;
aDirWire : NumShape from Sweep;
aLocation : Location from TopLoc;
aCopy : Boolean from Standard);
---Purpose: Initialize the Trsf BrepSweep, if aCopy is true
-- the basis elements are shared as often as
-- possible, else everything is copied.
--
Init(me : in out)
---Purpose: ends the construction of the swept primitive
-- calling the virtual geometric functions that can't
-- be called in the initialize.
is static;
Process (me : in out;
aGenS : Shape from TopoDS;
aDirV : NumShape from Sweep)
returns Boolean from Standard
---Purpose: function called to analize the way of construction
-- of the shapes generated by aGenS and aDirV.
is static;
-- """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-- Deferred Methods supporting the creation of the geometric part.
-- """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
MakeEmptyVertex(me : in out;
aGenV : Shape from TopoDS;
aDirV : NumShape from Sweep)
returns Shape from TopoDS
---Purpose: Builds the vertex addressed by [aGenV,aDirV], with its
-- geometric part, but without subcomponents.
is deferred;
MakeEmptyDirectingEdge(me : in out;
aGenV : Shape from TopoDS;
aDirE : NumShape from Sweep)
returns Shape from TopoDS
---Purpose: Builds the edge addressed by [aGenV,aDirE], with its
-- geometric part, but without subcomponents.
is deferred;
MakeEmptyGeneratingEdge(me : in out;
aGenE : Shape from TopoDS;
aDirV : NumShape from Sweep)
returns Shape from TopoDS
---Purpose: Builds the edge addressed by [aGenE,aDirV], with its
-- geometric part, but without subcomponents.
is deferred;
SetParameters(me : in out;
aNewFace : Shape from TopoDS;
aNewVertex : in out Shape from TopoDS;
aGenF : Shape from TopoDS;
aGenV : Shape from TopoDS;
aDirV : NumShape from Sweep)
---Purpose: Sets the parameters of the new vertex on the new
-- face. The new face and new vertex where generated
-- from aGenF, aGenV and aDirV .
is deferred;
SetDirectingParameter(me : in out;
aNewEdge : Shape from TopoDS;
aNewVertex : in out Shape from TopoDS;
aGenV : Shape from TopoDS;
aDirE : NumShape from Sweep;
aDirV : NumShape from Sweep)
---Purpose: Sets the parameter of the new vertex on the new
-- edge. The new edge and new vertex where generated
-- from aGenV aDirE, and aDirV.
is deferred;
SetGeneratingParameter(me : in out;
aNewEdge : Shape from TopoDS;
aNewVertex : in out Shape from TopoDS;
aGenE : Shape from TopoDS;
aGenV : Shape from TopoDS;
aDirV : NumShape from Sweep)
---Purpose: Sets the parameter of the new vertex on the new
-- edge. The new edge and new vertex where generated
-- from aGenE, aGenV and aDirV .
is deferred;
MakeEmptyFace(me : in out;
aGenS : Shape from TopoDS;
aDirS : NumShape from Sweep)
returns Shape from TopoDS
---Purpose: Builds the face addressed by [aGenS,aDirS], with
-- its geometric part, but without subcomponents. The
-- couple aGenS, aDirS can be a "generating face and
-- a directing vertex" or "a generating edge and a
-- directing edge".
is deferred;
SetPCurve(me : in out;
aNewFace : Shape from TopoDS;
aNewEdge : in out Shape from TopoDS;
aGenF : Shape from TopoDS;
aGenE : Shape from TopoDS;
aDirV : NumShape from Sweep;
orien : Orientation from TopAbs)
---Purpose: Sets the PCurve for a new edge on a new face. The
-- new edge and the new face were generated using
-- aGenF, aGenE and aDirV.
is deferred;
SetGeneratingPCurve(me : in out;
aNewFace : Shape from TopoDS;
aNewEdge : in out Shape from TopoDS;
aGenE : Shape from TopoDS;
aDirE : NumShape from Sweep;
aDirV : NumShape from Sweep;
orien : Orientation from TopAbs)
---Purpose: Sets the PCurve for a new edge on a new face. The
-- new edge and the new face were generated using
-- aGenE, aDirE and aDirV.
is deferred;
SetDirectingPCurve(me : in out;
aNewFace : Shape from TopoDS;
aNewEdge : in out Shape from TopoDS;
aGenE : Shape from TopoDS;
aGenV : Shape from TopoDS;
aDirE : NumShape from Sweep;
orien : Orientation from TopAbs)
---Purpose: Sets the PCurve for a new edge on a new face. The
-- new edge and the new face were generated using
-- aGenE, aDirE and aGenV.
is deferred;
GGDShapeIsToAdd (me;
aNewShape : Shape from TopoDS;
aNewSubShape : Shape from TopoDS;
aGenS : Shape from TopoDS;
aSubGenS : Shape from TopoDS;
aDirS : NumShape from Sweep)
returns Boolean from Standard
---Purpose: Returns true if aNewSubShape (addressed by
-- aSubGenS and aDirS) must be added in aNewShape
-- (addressed by aGenS and aDirS).
is deferred;
GDDShapeIsToAdd (me;
aNewShape : Shape from TopoDS;
aNewSubShape : Shape from TopoDS;
aGenS : Shape from TopoDS;
aDirS : NumShape from Sweep;
aSubDirS : NumShape from Sweep)
returns Boolean from Standard
---Purpose: Returns true if aNewSubShape (addressed by
-- aGenS and aSubDirS) must be added in aNewShape
-- (addressed by aGenS and aDirS).
is deferred;
SeparatedWires (me;
aNewShape : Shape from TopoDS;
aNewSubShape : Shape from TopoDS;
aGenS : Shape from TopoDS;
aSubGenS : Shape from TopoDS;
aDirS : NumShape from Sweep)
returns Boolean from Standard
---Purpose: In some particular cases the topology of a
-- generated face must be composed of independant
-- closed wires, in this case this function returns
-- true.
is deferred;
HasShape(me; aGenS : Shape from TopoDS; aDirS : NumShape from Sweep)
returns Boolean from Standard
---Purpose: Returns true if aDirS and aGenS addresses a
-- resulting Shape. In some specific cases the shape
-- can be geometrically inexsistant, then this
-- function returns false.
is deferred;
IsInvariant (me; aGenS : Shape from TopoDS)
returns Boolean from Standard
---Purpose: Returns true if the geometry of aGenS is not
-- modified by the trsf of the BRepSweep Trsf.
is deferred;
-- """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-- Method coding the continuities on the edges between 2 faces
-- """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
SetContinuity(me : in out;
aGenS : Shape from TopoDS;
aDirS : NumShape from Sweep);
---Purpose: Called to propagate the continuity of every vertex
-- between two edges of the generating wire aGenS on
-- the generated edge and faces.
fields
myLocation : Location from TopLoc is protected;
myCopy : Boolean from Standard is protected;
end Trsf from BRepSweep;

View File

@@ -14,20 +14,25 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepSweep_Trsf.ixx>
#include <Sweep_NumShapeIterator.hxx>
#include <BRepSweep_Iterator.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepLProp.hxx>
#include <BRepSweep_Iterator.hxx>
#include <BRepSweep_Trsf.hxx>
#include <GeomAbs_Shape.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopoDS_Face.hxx>
#include <Precision.hxx>
#include <Sweep_NumShape.hxx>
#include <Sweep_NumShapeIterator.hxx>
#include <TopExp.hxx>
#include <TopLoc_Location.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Vertex.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <Precision.hxx>
BRepSweep_Trsf::BRepSweep_Trsf(const BRep_Builder& aBuilder,
const TopoDS_Shape& aGenShape,

View File

@@ -0,0 +1,173 @@
// Created on: 1993-06-08
// Created by: Laurent BOURESCHE
// 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 _BRepSweep_Trsf_HeaderFile
#define _BRepSweep_Trsf_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <TopLoc_Location.hxx>
#include <Standard_Boolean.hxx>
#include <BRepSweep_NumLinearRegularSweep.hxx>
#include <TopAbs_Orientation.hxx>
class BRep_Builder;
class TopoDS_Shape;
class Sweep_NumShape;
class TopLoc_Location;
//! This class is inherited from NumLinearRegularSweep
//! to implement the simple swept primitives built
//! moving a Shape with a Trsf. It often is possible
//! to build the constructed subshapes by a simple
//! move of the generating subshapes (shared topology
//! and geometry). So two ways of construction are
//! proposed :
//!
//! - sharing basis elements (the generatrice can be
//! modified , for exemples PCurves can be added on
//! faces);
//!
//! - copying everything.
class BRepSweep_Trsf : public BRepSweep_NumLinearRegularSweep
{
public:
DEFINE_STANDARD_ALLOC
//! ends the construction of the swept primitive
//! calling the virtual geometric functions that can't
//! be called in the initialize.
Standard_EXPORT void Init();
//! function called to analize the way of construction
//! of the shapes generated by aGenS and aDirV.
Standard_EXPORT Standard_Boolean Process (const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirV);
//! Builds the vertex addressed by [aGenV,aDirV], with its
//! geometric part, but without subcomponents.
Standard_EXPORT virtual TopoDS_Shape MakeEmptyVertex (const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirV) = 0;
//! Builds the edge addressed by [aGenV,aDirE], with its
//! geometric part, but without subcomponents.
Standard_EXPORT virtual TopoDS_Shape MakeEmptyDirectingEdge (const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirE) = 0;
//! Builds the edge addressed by [aGenE,aDirV], with its
//! geometric part, but without subcomponents.
Standard_EXPORT virtual TopoDS_Shape MakeEmptyGeneratingEdge (const TopoDS_Shape& aGenE, const Sweep_NumShape& aDirV) = 0;
//! Sets the parameters of the new vertex on the new
//! face. The new face and new vertex where generated
//! from aGenF, aGenV and aDirV .
Standard_EXPORT virtual void SetParameters (const TopoDS_Shape& aNewFace, TopoDS_Shape& aNewVertex, const TopoDS_Shape& aGenF, const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirV) = 0;
//! Sets the parameter of the new vertex on the new
//! edge. The new edge and new vertex where generated
//! from aGenV aDirE, and aDirV.
Standard_EXPORT virtual void SetDirectingParameter (const TopoDS_Shape& aNewEdge, TopoDS_Shape& aNewVertex, const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirE, const Sweep_NumShape& aDirV) = 0;
//! Sets the parameter of the new vertex on the new
//! edge. The new edge and new vertex where generated
//! from aGenE, aGenV and aDirV .
Standard_EXPORT virtual void SetGeneratingParameter (const TopoDS_Shape& aNewEdge, TopoDS_Shape& aNewVertex, const TopoDS_Shape& aGenE, const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirV) = 0;
//! Builds the face addressed by [aGenS,aDirS], with
//! its geometric part, but without subcomponents. The
//! couple aGenS, aDirS can be a "generating face and
//! a directing vertex" or "a generating edge and a
//! directing edge".
Standard_EXPORT virtual TopoDS_Shape MakeEmptyFace (const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS) = 0;
//! Sets the PCurve for a new edge on a new face. The
//! new edge and the new face were generated using
//! aGenF, aGenE and aDirV.
Standard_EXPORT virtual void SetPCurve (const TopoDS_Shape& aNewFace, TopoDS_Shape& aNewEdge, const TopoDS_Shape& aGenF, const TopoDS_Shape& aGenE, const Sweep_NumShape& aDirV, const TopAbs_Orientation orien) = 0;
//! Sets the PCurve for a new edge on a new face. The
//! new edge and the new face were generated using
//! aGenE, aDirE and aDirV.
Standard_EXPORT virtual void SetGeneratingPCurve (const TopoDS_Shape& aNewFace, TopoDS_Shape& aNewEdge, const TopoDS_Shape& aGenE, const Sweep_NumShape& aDirE, const Sweep_NumShape& aDirV, const TopAbs_Orientation orien) = 0;
//! Sets the PCurve for a new edge on a new face. The
//! new edge and the new face were generated using
//! aGenE, aDirE and aGenV.
Standard_EXPORT virtual void SetDirectingPCurve (const TopoDS_Shape& aNewFace, TopoDS_Shape& aNewEdge, const TopoDS_Shape& aGenE, const TopoDS_Shape& aGenV, const Sweep_NumShape& aDirE, const TopAbs_Orientation orien) = 0;
//! Returns true if aNewSubShape (addressed by
//! aSubGenS and aDirS) must be added in aNewShape
//! (addressed by aGenS and aDirS).
Standard_EXPORT virtual Standard_Boolean GGDShapeIsToAdd (const TopoDS_Shape& aNewShape, const TopoDS_Shape& aNewSubShape, const TopoDS_Shape& aGenS, const TopoDS_Shape& aSubGenS, const Sweep_NumShape& aDirS) const = 0;
//! Returns true if aNewSubShape (addressed by
//! aGenS and aSubDirS) must be added in aNewShape
//! (addressed by aGenS and aDirS).
Standard_EXPORT virtual Standard_Boolean GDDShapeIsToAdd (const TopoDS_Shape& aNewShape, const TopoDS_Shape& aNewSubShape, const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS, const Sweep_NumShape& aSubDirS) const = 0;
//! In some particular cases the topology of a
//! generated face must be composed of independant
//! closed wires, in this case this function returns
//! true.
Standard_EXPORT virtual Standard_Boolean SeparatedWires (const TopoDS_Shape& aNewShape, const TopoDS_Shape& aNewSubShape, const TopoDS_Shape& aGenS, const TopoDS_Shape& aSubGenS, const Sweep_NumShape& aDirS) const = 0;
//! Returns true if aDirS and aGenS addresses a
//! resulting Shape. In some specific cases the shape
//! can be geometrically inexsistant, then this
//! function returns false.
Standard_EXPORT virtual Standard_Boolean HasShape (const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS) const = 0;
//! Returns true if the geometry of aGenS is not
//! modified by the trsf of the BRepSweep Trsf.
Standard_EXPORT virtual Standard_Boolean IsInvariant (const TopoDS_Shape& aGenS) const = 0;
//! Called to propagate the continuity of every vertex
//! between two edges of the generating wire aGenS on
//! the generated edge and faces.
Standard_EXPORT void SetContinuity (const TopoDS_Shape& aGenS, const Sweep_NumShape& aDirS);
protected:
//! Initialize the Trsf BrepSweep, if aCopy is true
//! the basis elements are shared as often as
//! possible, else everything is copied.
Standard_EXPORT BRepSweep_Trsf(const BRep_Builder& aBuilder, const TopoDS_Shape& aGenShape, const Sweep_NumShape& aDirWire, const TopLoc_Location& aLocation, const Standard_Boolean aCopy);
TopLoc_Location myLocation;
Standard_Boolean myCopy;
private:
};
#endif // _BRepSweep_Trsf_HeaderFile

20
src/BRepSweep/FILES Normal file
View File

@@ -0,0 +1,20 @@
BRepSweep_Builder.cxx
BRepSweep_Builder.hxx
BRepSweep_Builder.lxx
BRepSweep_Iterator.cxx
BRepSweep_Iterator.hxx
BRepSweep_Iterator.lxx
BRepSweep_NumLinearRegularSweep.cxx
BRepSweep_NumLinearRegularSweep.hxx
BRepSweep_Prism.cxx
BRepSweep_Prism.hxx
BRepSweep_Revol.cxx
BRepSweep_Revol.hxx
BRepSweep_Rotation.cxx
BRepSweep_Rotation.hxx
BRepSweep_Tool.cxx
BRepSweep_Tool.hxx
BRepSweep_Translation.cxx
BRepSweep_Translation.hxx
BRepSweep_Trsf.cxx
BRepSweep_Trsf.hxx