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:
@@ -1,73 +0,0 @@
|
||||
-- Created on: 1991-07-24
|
||||
-- Created by: Christophe MARION
|
||||
-- Copyright (c) 1991-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 BRepPrim
|
||||
|
||||
---Purpose: this package implements the primitives of the
|
||||
-- Primitives package with the BRep Topology
|
||||
--
|
||||
-- Contains :
|
||||
-- a Builder implementing the Template from Primitives
|
||||
--
|
||||
-- The instantiations of the algorithms :
|
||||
-- OneAxis
|
||||
-- Wedge
|
||||
--
|
||||
-- The rotational primitives inherited from OneAxis
|
||||
--
|
||||
-- Revolution
|
||||
-- Cylinder
|
||||
-- Cone
|
||||
-- Sphere
|
||||
-- Torus
|
||||
--
|
||||
-- The class FaceBuilder is a tool to build a face
|
||||
-- from a Geom surface.
|
||||
|
||||
uses
|
||||
gp,
|
||||
Geom2d,
|
||||
Geom,
|
||||
TopoDS,
|
||||
BRep
|
||||
|
||||
is
|
||||
enumeration Direction is
|
||||
---Purpose:
|
||||
XMin, XMax, YMin, YMax, ZMin, ZMax
|
||||
end Direction;
|
||||
|
||||
class Builder;
|
||||
|
||||
deferred class OneAxis;
|
||||
|
||||
class Revolution;
|
||||
|
||||
class Cylinder;
|
||||
|
||||
class Cone;
|
||||
|
||||
class Sphere;
|
||||
|
||||
class Torus;
|
||||
|
||||
class GWedge;
|
||||
|
||||
class Wedge;
|
||||
|
||||
class FaceBuilder;
|
||||
|
||||
end BRepPrim;
|
@@ -1,175 +0,0 @@
|
||||
-- Created on: 1992-03-12
|
||||
-- Created by: Philippe DAUTRY
|
||||
-- Copyright (c) 1992-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 BRepPrim
|
||||
|
||||
---Purpose: implements the abstract Builder with the BRep Builder
|
||||
|
||||
uses
|
||||
Builder from BRep,
|
||||
|
||||
Shell from TopoDS,
|
||||
Face from TopoDS,
|
||||
Wire from TopoDS,
|
||||
Edge from TopoDS,
|
||||
Vertex from TopoDS,
|
||||
|
||||
Pnt from gp,
|
||||
Lin from gp,
|
||||
Circ from gp,
|
||||
Pln from gp,
|
||||
|
||||
Lin2d from gp,
|
||||
Circ2d from gp
|
||||
|
||||
is
|
||||
Create returns Builder from BRepPrim;
|
||||
---Purpose: Creates an empty, useless Builder. Necesseray for
|
||||
-- compilation.
|
||||
|
||||
Create(B : Builder from BRep) returns Builder from BRepPrim;
|
||||
---Purpose: Creates from a Builder.
|
||||
|
||||
Builder(me) returns Builder from BRep
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
is static;
|
||||
|
||||
-- implements the Builder methods
|
||||
|
||||
|
||||
MakeShell (me; S : out Shell from TopoDS)
|
||||
---Purpose: Make a empty Shell.
|
||||
is static;
|
||||
|
||||
MakeFace (me; F : out Face from TopoDS; P : Pln from gp)
|
||||
---Purpose: Returns in <F> a Face built with the plane
|
||||
-- equation <P>. Used by all primitives.
|
||||
is static;
|
||||
|
||||
MakeWire (me; W : out Wire from TopoDS)
|
||||
---Purpose: Returns in <W> an empty Wire.
|
||||
is static;
|
||||
|
||||
MakeDegeneratedEdge(me; E : out Edge from TopoDS)
|
||||
---Purpose: Returns in <E> a degenerated edge.
|
||||
is static;
|
||||
|
||||
MakeEdge (me; E : out Edge from TopoDS; L : Lin from gp)
|
||||
---Purpose: Returns in <E> an Edge built with the line
|
||||
-- equation <L>.
|
||||
is static;
|
||||
|
||||
MakeEdge (me; E : out Edge from TopoDS; C : Circ from gp)
|
||||
---Purpose: Returns in <E> an Edge built with the circle
|
||||
-- equation <C>.
|
||||
is static;
|
||||
|
||||
SetPCurve(me; E : in out Edge from TopoDS; F : in Face from TopoDS;
|
||||
L : Lin2d from gp)
|
||||
---Purpose: Sets the line <L> to be the curve representing the
|
||||
-- edge <E> in the parametric space of the surface of
|
||||
-- <F>.
|
||||
is static;
|
||||
|
||||
SetPCurve(me; E : in out Edge from TopoDS; F : in Face from TopoDS;
|
||||
L1,L2 : Lin2d from gp)
|
||||
---Purpose: Sets the lines <L1,L2> to be the curves
|
||||
-- representing the edge <E> in the parametric space
|
||||
-- of the closed surface of <F>.
|
||||
is static;
|
||||
|
||||
SetPCurve(me; E : in out Edge from TopoDS; F : in Face from TopoDS;
|
||||
C : Circ2d from gp)
|
||||
---Purpose: Sets the circle <C> to be the curve representing
|
||||
-- the edge <E> in the parametric space of the
|
||||
-- surface of <F>.
|
||||
is static;
|
||||
|
||||
MakeVertex (me; V : out Vertex from TopoDS; P : Pnt from gp)
|
||||
---Purpose: Returns in <V> a Vertex built with the point <P>.
|
||||
is static;
|
||||
|
||||
ReverseFace(me; F : in out Face from TopoDS)
|
||||
---Purpose: Reverses the Face <F>.
|
||||
is static;
|
||||
|
||||
AddEdgeVertex(me; E : in out Edge from TopoDS;
|
||||
V : in Vertex from TopoDS;
|
||||
P : in Real;
|
||||
direct : Boolean)
|
||||
---Purpose: Adds the Vertex <V> in the Edge <E>. <P> is the
|
||||
-- parameter of the vertex on the edge. If direct
|
||||
-- is False the Vertex is reversed.
|
||||
is static;
|
||||
|
||||
AddEdgeVertex(me; E : in out Edge from TopoDS;
|
||||
V : in Vertex from TopoDS;
|
||||
P1,P2 : in Real)
|
||||
---Purpose: Adds the Vertex <V> in the Edge <E>. <P1,P2>
|
||||
-- are the parameters of the vertex on the closed
|
||||
-- edge.
|
||||
is static;
|
||||
|
||||
SetParameters(me;
|
||||
E : in out Edge from TopoDS;
|
||||
V : in Vertex from TopoDS;
|
||||
P1,P2 : in Real)
|
||||
---Purpose: <P1,P2> are the parameters of the vertex on the
|
||||
-- edge. The edge is a closed curve.
|
||||
is static;
|
||||
|
||||
AddWireEdge(me; W : in out Wire from TopoDS;
|
||||
E : in Edge from TopoDS;
|
||||
direct : Boolean)
|
||||
---Purpose: Adds the Edge <E> in the Wire <W>, if direct is
|
||||
-- False the Edge is reversed.
|
||||
is static;
|
||||
|
||||
AddFaceWire(me; F : in out Face from TopoDS;
|
||||
W : in Wire from TopoDS)
|
||||
---Purpose: Adds the Wire <W> in the Face <F>.
|
||||
is static;
|
||||
|
||||
AddShellFace(me; Sh : in out Shell from TopoDS;
|
||||
F : in Face from TopoDS)
|
||||
---Purpose: Adds the Face <F> in the Shell <Sh>.
|
||||
is static;
|
||||
|
||||
CompleteEdge(me; E : in out Edge from TopoDS)
|
||||
---Purpose: This is called once an edge is completed. It gives
|
||||
-- the opportunity to perform any post treatment.
|
||||
is static;
|
||||
|
||||
CompleteWire(me; W : in out Wire from TopoDS)
|
||||
---Purpose: This is called once a wire is completed. It gives
|
||||
-- the opportunity to perform any post treatment.
|
||||
is static;
|
||||
|
||||
CompleteFace(me; F : in out Face from TopoDS)
|
||||
---Purpose: This is called once a face is completed. It gives
|
||||
-- the opportunity to perform any post treatment.
|
||||
is static;
|
||||
|
||||
CompleteShell(me; S : in out Shell from TopoDS)
|
||||
---Purpose: This is called once a shell is completed. It gives
|
||||
-- the opportunity to perform any post treatment.
|
||||
is static;
|
||||
|
||||
fields
|
||||
myBuilder : Builder from BRep;
|
||||
|
||||
end Builder;
|
@@ -14,25 +14,33 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BRepPrim_Builder.ixx>
|
||||
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRepPrim_Builder.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
#include <Geom2d_Circle.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
#include <Geom_Circle.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <gp_Circ.hxx>
|
||||
#include <gp_Circ2d.hxx>
|
||||
#include <gp_Lin.hxx>
|
||||
#include <gp_Lin2d.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <TopoDS.hxx>
|
||||
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_Circle.hxx>
|
||||
|
||||
#include <Geom2d_Line.hxx>
|
||||
#include <Geom2d_Circle.hxx>
|
||||
|
||||
#include <BRepTools.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Shell.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : BRepPrim_Builder
|
||||
//purpose : constructor
|
||||
//=======================================================================
|
||||
|
||||
BRepPrim_Builder::BRepPrim_Builder ()
|
||||
{
|
||||
}
|
||||
|
165
src/BRepPrim/BRepPrim_Builder.hxx
Normal file
165
src/BRepPrim/BRepPrim_Builder.hxx
Normal file
@@ -0,0 +1,165 @@
|
||||
// Created on: 1992-03-12
|
||||
// Created by: Philippe DAUTRY
|
||||
// Copyright (c) 1992-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 _BRepPrim_Builder_HeaderFile
|
||||
#define _BRepPrim_Builder_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class BRep_Builder;
|
||||
class TopoDS_Shell;
|
||||
class TopoDS_Face;
|
||||
class gp_Pln;
|
||||
class TopoDS_Wire;
|
||||
class TopoDS_Edge;
|
||||
class gp_Lin;
|
||||
class gp_Circ;
|
||||
class gp_Lin2d;
|
||||
class gp_Circ2d;
|
||||
class TopoDS_Vertex;
|
||||
class gp_Pnt;
|
||||
|
||||
|
||||
//! implements the abstract Builder with the BRep Builder
|
||||
class BRepPrim_Builder
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Creates an empty, useless Builder. Necesseray for
|
||||
//! compilation.
|
||||
Standard_EXPORT BRepPrim_Builder();
|
||||
|
||||
//! Creates from a Builder.
|
||||
Standard_EXPORT BRepPrim_Builder(const BRep_Builder& B);
|
||||
|
||||
const BRep_Builder& Builder() const;
|
||||
|
||||
//! Make a empty Shell.
|
||||
Standard_EXPORT void MakeShell (TopoDS_Shell& S) const;
|
||||
|
||||
//! Returns in <F> a Face built with the plane
|
||||
//! equation <P>. Used by all primitives.
|
||||
Standard_EXPORT void MakeFace (TopoDS_Face& F, const gp_Pln& P) const;
|
||||
|
||||
//! Returns in <W> an empty Wire.
|
||||
Standard_EXPORT void MakeWire (TopoDS_Wire& W) const;
|
||||
|
||||
//! Returns in <E> a degenerated edge.
|
||||
Standard_EXPORT void MakeDegeneratedEdge (TopoDS_Edge& E) const;
|
||||
|
||||
//! Returns in <E> an Edge built with the line
|
||||
//! equation <L>.
|
||||
Standard_EXPORT void MakeEdge (TopoDS_Edge& E, const gp_Lin& L) const;
|
||||
|
||||
//! Returns in <E> an Edge built with the circle
|
||||
//! equation <C>.
|
||||
Standard_EXPORT void MakeEdge (TopoDS_Edge& E, const gp_Circ& C) const;
|
||||
|
||||
//! Sets the line <L> to be the curve representing the
|
||||
//! edge <E> in the parametric space of the surface of
|
||||
//! <F>.
|
||||
Standard_EXPORT void SetPCurve (TopoDS_Edge& E, const TopoDS_Face& F, const gp_Lin2d& L) const;
|
||||
|
||||
//! Sets the lines <L1,L2> to be the curves
|
||||
//! representing the edge <E> in the parametric space
|
||||
//! of the closed surface of <F>.
|
||||
Standard_EXPORT void SetPCurve (TopoDS_Edge& E, const TopoDS_Face& F, const gp_Lin2d& L1, const gp_Lin2d& L2) const;
|
||||
|
||||
//! Sets the circle <C> to be the curve representing
|
||||
//! the edge <E> in the parametric space of the
|
||||
//! surface of <F>.
|
||||
Standard_EXPORT void SetPCurve (TopoDS_Edge& E, const TopoDS_Face& F, const gp_Circ2d& C) const;
|
||||
|
||||
//! Returns in <V> a Vertex built with the point <P>.
|
||||
Standard_EXPORT void MakeVertex (TopoDS_Vertex& V, const gp_Pnt& P) const;
|
||||
|
||||
//! Reverses the Face <F>.
|
||||
Standard_EXPORT void ReverseFace (TopoDS_Face& F) const;
|
||||
|
||||
//! Adds the Vertex <V> in the Edge <E>. <P> is the
|
||||
//! parameter of the vertex on the edge. If direct
|
||||
//! is False the Vertex is reversed.
|
||||
Standard_EXPORT void AddEdgeVertex (TopoDS_Edge& E, const TopoDS_Vertex& V, const Standard_Real P, const Standard_Boolean direct) const;
|
||||
|
||||
//! Adds the Vertex <V> in the Edge <E>. <P1,P2>
|
||||
//! are the parameters of the vertex on the closed
|
||||
//! edge.
|
||||
Standard_EXPORT void AddEdgeVertex (TopoDS_Edge& E, const TopoDS_Vertex& V, const Standard_Real P1, const Standard_Real P2) const;
|
||||
|
||||
//! <P1,P2> are the parameters of the vertex on the
|
||||
//! edge. The edge is a closed curve.
|
||||
Standard_EXPORT void SetParameters (TopoDS_Edge& E, const TopoDS_Vertex& V, const Standard_Real P1, const Standard_Real P2) const;
|
||||
|
||||
//! Adds the Edge <E> in the Wire <W>, if direct is
|
||||
//! False the Edge is reversed.
|
||||
Standard_EXPORT void AddWireEdge (TopoDS_Wire& W, const TopoDS_Edge& E, const Standard_Boolean direct) const;
|
||||
|
||||
//! Adds the Wire <W> in the Face <F>.
|
||||
Standard_EXPORT void AddFaceWire (TopoDS_Face& F, const TopoDS_Wire& W) const;
|
||||
|
||||
//! Adds the Face <F> in the Shell <Sh>.
|
||||
Standard_EXPORT void AddShellFace (TopoDS_Shell& Sh, const TopoDS_Face& F) const;
|
||||
|
||||
//! This is called once an edge is completed. It gives
|
||||
//! the opportunity to perform any post treatment.
|
||||
Standard_EXPORT void CompleteEdge (TopoDS_Edge& E) const;
|
||||
|
||||
//! This is called once a wire is completed. It gives
|
||||
//! the opportunity to perform any post treatment.
|
||||
Standard_EXPORT void CompleteWire (TopoDS_Wire& W) const;
|
||||
|
||||
//! This is called once a face is completed. It gives
|
||||
//! the opportunity to perform any post treatment.
|
||||
Standard_EXPORT void CompleteFace (TopoDS_Face& F) const;
|
||||
|
||||
//! This is called once a shell is completed. It gives
|
||||
//! the opportunity to perform any post treatment.
|
||||
Standard_EXPORT void CompleteShell (TopoDS_Shell& S) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
BRep_Builder myBuilder;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <BRepPrim_Builder.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepPrim_Builder_HeaderFile
|
@@ -1,102 +0,0 @@
|
||||
-- Created on: 1992-11-05
|
||||
-- Created by: Remi LEQUETTE
|
||||
-- Copyright (c) 1992-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 Cone from BRepPrim inherits Revolution from BRepPrim
|
||||
|
||||
---Purpose: Implement the cone primitive.
|
||||
|
||||
uses
|
||||
Face from TopoDS,
|
||||
|
||||
Pnt from gp,
|
||||
Ax2 from gp
|
||||
|
||||
raises
|
||||
DomainError
|
||||
|
||||
is
|
||||
|
||||
Create(Angle : Real; Position : Ax2 from gp; Height : Real;
|
||||
Radius : Real = 0)
|
||||
returns Cone from BRepPrim
|
||||
---Purpose: the STEP definition
|
||||
-- Angle = semi-angle of the cone
|
||||
-- Position : the coordinate system
|
||||
-- Height : height of the cone.
|
||||
-- Radius : radius of truncated face at z = 0
|
||||
--
|
||||
-- The apex is on z < 0
|
||||
--
|
||||
-- Errors : Height < Resolution
|
||||
-- Angle < Resolution / Height
|
||||
-- Angle > PI/2 - Resolution / Height
|
||||
raises DomainError;
|
||||
|
||||
Create(Angle : Real)
|
||||
returns Cone from BRepPrim
|
||||
---Purpose: infinite cone at origin on Z negative
|
||||
raises DomainError;
|
||||
|
||||
Create(Angle : Real; Apex : Pnt from gp)
|
||||
returns Cone from BRepPrim
|
||||
---Purpose: infinite cone at Apex on Z negative
|
||||
raises DomainError;
|
||||
|
||||
Create(Angle : Real; Axes : Ax2 from gp)
|
||||
returns Cone from BRepPrim
|
||||
---Purpose: infinite cone with Axes
|
||||
raises DomainError;
|
||||
|
||||
Create(R1,R2,H : Real)
|
||||
returns Cone from BRepPrim
|
||||
---Purpose: create a Cone at origin on Z axis, of height H,
|
||||
-- radius R1 at Z = 0, R2 at Z = H, X is the origin
|
||||
-- of angles. If R1 or R2 is 0 there is an apex.
|
||||
-- Otherwise, it is a truncated cone.
|
||||
--
|
||||
-- Error : R1 and R2 < Resolution
|
||||
-- R1 or R2 negative
|
||||
-- Abs(R1-R2) < Resolution
|
||||
-- H < Resolution
|
||||
-- H negative
|
||||
raises DomainError;
|
||||
|
||||
Create(Center : Pnt from gp; R1,R2,H : Real)
|
||||
returns Cone from BRepPrim
|
||||
---Purpose: same as above but at a given point
|
||||
raises DomainError;
|
||||
|
||||
Create(Axes : Ax2 from gp; R1,R2,H : Real)
|
||||
returns Cone from BRepPrim
|
||||
---Purpose: same as above with given axes system.
|
||||
raises DomainError;
|
||||
|
||||
MakeEmptyLateralFace(me) returns Face from TopoDS
|
||||
---Purpose: The surface normal should be directed towards the
|
||||
-- outside.
|
||||
is redefined;
|
||||
|
||||
SetMeridian(me : in out)
|
||||
is static private;
|
||||
|
||||
SetParameters(me : in out; R1, R2, H : Real)
|
||||
is static private;
|
||||
|
||||
fields
|
||||
myHalfAngle : Real;
|
||||
myRadius : Real;
|
||||
|
||||
end Cone;
|
@@ -14,20 +14,23 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BRepPrim_Cone.ixx>
|
||||
#include <gp.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <Precision.hxx>
|
||||
|
||||
#include <BRepPrim_Cone.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
#include <Geom_ConicalSurface.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
#include <gp.hxx>
|
||||
#include <gp_Ax2.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : BRepPrim_Cone
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
BRepPrim_Cone::BRepPrim_Cone(const Standard_Real Angle,
|
||||
const gp_Ax2& Position,
|
||||
const Standard_Real Height,
|
||||
|
113
src/BRepPrim/BRepPrim_Cone.hxx
Normal file
113
src/BRepPrim/BRepPrim_Cone.hxx
Normal file
@@ -0,0 +1,113 @@
|
||||
// Created on: 1992-11-05
|
||||
// Created by: Remi LEQUETTE
|
||||
// Copyright (c) 1992-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 _BRepPrim_Cone_HeaderFile
|
||||
#define _BRepPrim_Cone_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
#include <BRepPrim_Revolution.hxx>
|
||||
class Standard_DomainError;
|
||||
class gp_Ax2;
|
||||
class gp_Pnt;
|
||||
class TopoDS_Face;
|
||||
|
||||
|
||||
//! Implement the cone primitive.
|
||||
class BRepPrim_Cone : public BRepPrim_Revolution
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! the STEP definition
|
||||
//! Angle = semi-angle of the cone
|
||||
//! Position : the coordinate system
|
||||
//! Height : height of the cone.
|
||||
//! Radius : radius of truncated face at z = 0
|
||||
//!
|
||||
//! The apex is on z < 0
|
||||
//!
|
||||
//! Errors : Height < Resolution
|
||||
//! Angle < Resolution / Height
|
||||
//! Angle > PI/2 - Resolution / Height
|
||||
Standard_EXPORT BRepPrim_Cone(const Standard_Real Angle, const gp_Ax2& Position, const Standard_Real Height, const Standard_Real Radius = 0);
|
||||
|
||||
//! infinite cone at origin on Z negative
|
||||
Standard_EXPORT BRepPrim_Cone(const Standard_Real Angle);
|
||||
|
||||
//! infinite cone at Apex on Z negative
|
||||
Standard_EXPORT BRepPrim_Cone(const Standard_Real Angle, const gp_Pnt& Apex);
|
||||
|
||||
//! infinite cone with Axes
|
||||
Standard_EXPORT BRepPrim_Cone(const Standard_Real Angle, const gp_Ax2& Axes);
|
||||
|
||||
//! create a Cone at origin on Z axis, of height H,
|
||||
//! radius R1 at Z = 0, R2 at Z = H, X is the origin
|
||||
//! of angles. If R1 or R2 is 0 there is an apex.
|
||||
//! Otherwise, it is a truncated cone.
|
||||
//!
|
||||
//! Error : R1 and R2 < Resolution
|
||||
//! R1 or R2 negative
|
||||
//! Abs(R1-R2) < Resolution
|
||||
//! H < Resolution
|
||||
//! H negative
|
||||
Standard_EXPORT BRepPrim_Cone(const Standard_Real R1, const Standard_Real R2, const Standard_Real H);
|
||||
|
||||
//! same as above but at a given point
|
||||
Standard_EXPORT BRepPrim_Cone(const gp_Pnt& Center, const Standard_Real R1, const Standard_Real R2, const Standard_Real H);
|
||||
|
||||
//! same as above with given axes system.
|
||||
Standard_EXPORT BRepPrim_Cone(const gp_Ax2& Axes, const Standard_Real R1, const Standard_Real R2, const Standard_Real H);
|
||||
|
||||
//! The surface normal should be directed towards the
|
||||
//! outside.
|
||||
Standard_EXPORT virtual TopoDS_Face MakeEmptyLateralFace() const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void SetMeridian();
|
||||
|
||||
Standard_EXPORT void SetParameters (const Standard_Real R1, const Standard_Real R2, const Standard_Real H);
|
||||
|
||||
|
||||
Standard_Real myHalfAngle;
|
||||
Standard_Real myRadius;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepPrim_Cone_HeaderFile
|
@@ -1,85 +0,0 @@
|
||||
-- Created on: 1992-11-05
|
||||
-- Created by: Remi LEQUETTE
|
||||
-- Copyright (c) 1992-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 Cylinder from BRepPrim inherits Revolution from BRepPrim
|
||||
|
||||
---Purpose: Cylinder primitive.
|
||||
|
||||
uses
|
||||
Face from TopoDS,
|
||||
|
||||
Pnt from gp,
|
||||
Ax2 from gp
|
||||
|
||||
raises
|
||||
DomainError
|
||||
|
||||
is
|
||||
|
||||
Create(Position : Ax2 from gp; Radius : Real; Height : Real)
|
||||
returns Cylinder from BRepPrim
|
||||
---Purpose: the STEP definition
|
||||
-- Position : center of a Face and Axis
|
||||
-- Radius : radius of cylinder
|
||||
-- Height : distance between faces
|
||||
-- on positive side
|
||||
--
|
||||
-- Errors : Height < Resolution
|
||||
-- Radius < Resolution
|
||||
raises DomainError;
|
||||
|
||||
Create(Radius : Real)
|
||||
returns Cylinder from BRepPrim
|
||||
---Purpose: infinite Cylinder at origin on Z negative
|
||||
raises DomainError;
|
||||
|
||||
Create(Center : Pnt from gp; Radius : Real)
|
||||
returns Cylinder from BRepPrim
|
||||
---Purpose: infinite Cylinder at Center on Z negative
|
||||
raises DomainError;
|
||||
|
||||
Create(Axes : Ax2 from gp; Radius : Real)
|
||||
returns Cylinder from BRepPrim
|
||||
---Purpose: infinite Cylinder at Axes on Z negative
|
||||
raises DomainError;
|
||||
|
||||
Create(R,H : Real)
|
||||
returns Cylinder from BRepPrim
|
||||
---Purpose: create a Cylinder at origin on Z axis, of
|
||||
-- height H and radius R
|
||||
-- Error : Radius < Resolution
|
||||
-- H < Resolution
|
||||
-- H negative
|
||||
raises DomainError;
|
||||
|
||||
Create(Center : Pnt from gp; R,H : Real)
|
||||
returns Cylinder from BRepPrim
|
||||
---Purpose: same as above but at a given point
|
||||
raises DomainError;
|
||||
|
||||
MakeEmptyLateralFace(me) returns Face from TopoDS
|
||||
---Purpose: The surface normal should be directed towards the
|
||||
-- outside.
|
||||
is redefined;
|
||||
|
||||
SetMeridian(me : in out)
|
||||
is static private;
|
||||
|
||||
fields
|
||||
myRadius : Real;
|
||||
|
||||
end Cylinder;
|
||||
|
@@ -14,20 +14,23 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BRepPrim_Cylinder.ixx>
|
||||
|
||||
#include <gp.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <BRepPrim_Cylinder.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
#include <Geom_CylindricalSurface.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
#include <gp.hxx>
|
||||
#include <gp_Ax2.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : BRepPrim_Cylinder
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
BRepPrim_Cylinder::BRepPrim_Cylinder(const gp_Ax2& Position,
|
||||
const Standard_Real Radius,
|
||||
const Standard_Real Height) :
|
||||
|
99
src/BRepPrim/BRepPrim_Cylinder.hxx
Normal file
99
src/BRepPrim/BRepPrim_Cylinder.hxx
Normal file
@@ -0,0 +1,99 @@
|
||||
// Created on: 1992-11-05
|
||||
// Created by: Remi LEQUETTE
|
||||
// Copyright (c) 1992-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 _BRepPrim_Cylinder_HeaderFile
|
||||
#define _BRepPrim_Cylinder_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
#include <BRepPrim_Revolution.hxx>
|
||||
class Standard_DomainError;
|
||||
class gp_Ax2;
|
||||
class gp_Pnt;
|
||||
class TopoDS_Face;
|
||||
|
||||
|
||||
//! Cylinder primitive.
|
||||
class BRepPrim_Cylinder : public BRepPrim_Revolution
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! the STEP definition
|
||||
//! Position : center of a Face and Axis
|
||||
//! Radius : radius of cylinder
|
||||
//! Height : distance between faces
|
||||
//! on positive side
|
||||
//!
|
||||
//! Errors : Height < Resolution
|
||||
//! Radius < Resolution
|
||||
Standard_EXPORT BRepPrim_Cylinder(const gp_Ax2& Position, const Standard_Real Radius, const Standard_Real Height);
|
||||
|
||||
//! infinite Cylinder at origin on Z negative
|
||||
Standard_EXPORT BRepPrim_Cylinder(const Standard_Real Radius);
|
||||
|
||||
//! infinite Cylinder at Center on Z negative
|
||||
Standard_EXPORT BRepPrim_Cylinder(const gp_Pnt& Center, const Standard_Real Radius);
|
||||
|
||||
//! infinite Cylinder at Axes on Z negative
|
||||
Standard_EXPORT BRepPrim_Cylinder(const gp_Ax2& Axes, const Standard_Real Radius);
|
||||
|
||||
//! create a Cylinder at origin on Z axis, of
|
||||
//! height H and radius R
|
||||
//! Error : Radius < Resolution
|
||||
//! H < Resolution
|
||||
//! H negative
|
||||
Standard_EXPORT BRepPrim_Cylinder(const Standard_Real R, const Standard_Real H);
|
||||
|
||||
//! same as above but at a given point
|
||||
Standard_EXPORT BRepPrim_Cylinder(const gp_Pnt& Center, const Standard_Real R, const Standard_Real H);
|
||||
|
||||
//! The surface normal should be directed towards the
|
||||
//! outside.
|
||||
Standard_EXPORT virtual TopoDS_Face MakeEmptyLateralFace() const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void SetMeridian();
|
||||
|
||||
|
||||
Standard_Real myRadius;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepPrim_Cylinder_HeaderFile
|
31
src/BRepPrim/BRepPrim_Direction.hxx
Normal file
31
src/BRepPrim/BRepPrim_Direction.hxx
Normal file
@@ -0,0 +1,31 @@
|
||||
// Created on: 1991-07-24
|
||||
// Created by: Christophe MARION
|
||||
// Copyright (c) 1991-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 _BRepPrim_Direction_HeaderFile
|
||||
#define _BRepPrim_Direction_HeaderFile
|
||||
|
||||
|
||||
enum BRepPrim_Direction
|
||||
{
|
||||
BRepPrim_XMin,
|
||||
BRepPrim_XMax,
|
||||
BRepPrim_YMin,
|
||||
BRepPrim_YMax,
|
||||
BRepPrim_ZMin,
|
||||
BRepPrim_ZMax
|
||||
};
|
||||
|
||||
#endif // _BRepPrim_Direction_HeaderFile
|
@@ -1,93 +0,0 @@
|
||||
-- Created on: 1993-06-23
|
||||
-- Created by: Remi LEQUETTE
|
||||
-- Copyright (c) 1993-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class FaceBuilder from BRepPrim
|
||||
|
||||
---Purpose: The FaceBuilder is an algorithm to build a BRep
|
||||
-- Face from a Geom Surface.
|
||||
--
|
||||
-- The face covers the whole surface or the area
|
||||
-- delimited by UMin, UMax, VMin, VMax
|
||||
|
||||
uses
|
||||
Surface from Geom,
|
||||
Face from TopoDS,
|
||||
Edge from TopoDS,
|
||||
Vertex from TopoDS,
|
||||
Builder from BRep
|
||||
|
||||
raises
|
||||
ConstructionError from Standard,
|
||||
OutOfRange from Standard
|
||||
|
||||
is
|
||||
Create returns FaceBuilder from BRepPrim;
|
||||
|
||||
Create(B : Builder from BRep;
|
||||
S : Surface from Geom) returns FaceBuilder from BRepPrim;
|
||||
|
||||
Create(B : Builder from BRep;
|
||||
S : Surface from Geom;
|
||||
UMin, UMax, VMin, VMax : Real) returns FaceBuilder from BRepPrim
|
||||
raises ConstructionError from Standard; -- if UV are outside the surface
|
||||
|
||||
Init(me : in out;
|
||||
B : Builder from BRep;
|
||||
S : Surface from Geom)
|
||||
is static;
|
||||
|
||||
Init(me : in out;
|
||||
B : Builder from BRep;
|
||||
S : Surface from Geom;
|
||||
UMin, UMax, VMin, VMax : Real)
|
||||
raises ConstructionError from Standard -- if UV are outside the surface
|
||||
is static;
|
||||
|
||||
Face(me) returns Face from TopoDS
|
||||
---C++: return const &
|
||||
--
|
||||
---C++: alias "Standard_EXPORT operator TopoDS_Face();"
|
||||
is static;
|
||||
|
||||
Edge(me; I : Integer) returns Edge from TopoDS
|
||||
---Purpose: Returns the edge of index <I>
|
||||
-- 1 - Edge VMin
|
||||
-- 2 - Edge UMax
|
||||
-- 3 - Edge VMax
|
||||
-- 4 - Edge UMin
|
||||
--
|
||||
---C++: return const &
|
||||
raises OutOfRange from Standard -- if I < 1 or I > 4
|
||||
is static;
|
||||
|
||||
Vertex(me; I : Integer) returns Vertex from TopoDS
|
||||
---Purpose: Returns the vertex of index <I>
|
||||
-- 1 - Vertex UMin,VMin
|
||||
-- 2 - Vertex UMax,VMin
|
||||
-- 3 - Vertex UMax,VMax
|
||||
-- 4 - Vertex UMin,VMax
|
||||
--
|
||||
---C++: return const &
|
||||
raises OutOfRange from Standard -- if I < 1 or I > 4
|
||||
is static;
|
||||
|
||||
|
||||
fields
|
||||
myVertex : Vertex from TopoDS [4];
|
||||
myEdges : Edge from TopoDS [4];
|
||||
myFace : Face from TopoDS;
|
||||
|
||||
end FaceBuilder;
|
@@ -14,19 +14,24 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BRepPrim_FaceBuilder.ixx>
|
||||
#include <Precision.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRepPrim_FaceBuilder.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_ConstructionError.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : BRepPrim_FaceBuilder
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
BRepPrim_FaceBuilder::BRepPrim_FaceBuilder()
|
||||
{
|
||||
}
|
||||
|
103
src/BRepPrim/BRepPrim_FaceBuilder.hxx
Normal file
103
src/BRepPrim/BRepPrim_FaceBuilder.hxx
Normal file
@@ -0,0 +1,103 @@
|
||||
// Created on: 1993-06-23
|
||||
// Created by: Remi LEQUETTE
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _BRepPrim_FaceBuilder_HeaderFile
|
||||
#define _BRepPrim_FaceBuilder_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
class Standard_ConstructionError;
|
||||
class Standard_OutOfRange;
|
||||
class BRep_Builder;
|
||||
class Geom_Surface;
|
||||
class TopoDS_Face;
|
||||
class TopoDS_Edge;
|
||||
class TopoDS_Vertex;
|
||||
|
||||
|
||||
//! The FaceBuilder is an algorithm to build a BRep
|
||||
//! Face from a Geom Surface.
|
||||
//!
|
||||
//! The face covers the whole surface or the area
|
||||
//! delimited by UMin, UMax, VMin, VMax
|
||||
class BRepPrim_FaceBuilder
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT BRepPrim_FaceBuilder();
|
||||
|
||||
Standard_EXPORT BRepPrim_FaceBuilder(const BRep_Builder& B, const Handle(Geom_Surface)& S);
|
||||
|
||||
Standard_EXPORT BRepPrim_FaceBuilder(const BRep_Builder& B, const Handle(Geom_Surface)& S, const Standard_Real UMin, const Standard_Real UMax, const Standard_Real VMin, const Standard_Real VMax);
|
||||
|
||||
Standard_EXPORT void Init (const BRep_Builder& B, const Handle(Geom_Surface)& S);
|
||||
|
||||
Standard_EXPORT void Init (const BRep_Builder& B, const Handle(Geom_Surface)& S, const Standard_Real UMin, const Standard_Real UMax, const Standard_Real VMin, const Standard_Real VMax);
|
||||
|
||||
Standard_EXPORT const TopoDS_Face& Face() const;
|
||||
Standard_EXPORT operator TopoDS_Face();
|
||||
|
||||
//! Returns the edge of index <I>
|
||||
//! 1 - Edge VMin
|
||||
//! 2 - Edge UMax
|
||||
//! 3 - Edge VMax
|
||||
//! 4 - Edge UMin
|
||||
Standard_EXPORT const TopoDS_Edge& Edge (const Standard_Integer I) const;
|
||||
|
||||
//! Returns the vertex of index <I>
|
||||
//! 1 - Vertex UMin,VMin
|
||||
//! 2 - Vertex UMax,VMin
|
||||
//! 3 - Vertex UMax,VMax
|
||||
//! 4 - Vertex UMin,VMax
|
||||
Standard_EXPORT const TopoDS_Vertex& Vertex (const Standard_Integer I) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
TopoDS_Vertex myVertex[4];
|
||||
TopoDS_Edge myEdges[4];
|
||||
TopoDS_Face myFace;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepPrim_FaceBuilder_HeaderFile
|
@@ -1,307 +0,0 @@
|
||||
-- Created on: 1991-09-18
|
||||
-- Created by: Christophe MARION
|
||||
-- Copyright (c) 1991-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 GWedge from BRepPrim
|
||||
|
||||
|
||||
---Purpose: A wedge is defined by :
|
||||
--
|
||||
-- Axes : an Axis2 (coordinate system)
|
||||
--
|
||||
-- YMin, YMax the coordinates of the ymin and ymax
|
||||
-- rectangular faces parallel to the ZX plane (of the
|
||||
-- coordinate systems)
|
||||
--
|
||||
-- ZMin,ZMax,XMin,XMax the rectangular
|
||||
-- left (YMin) face parallel to the Z and X axes.
|
||||
--
|
||||
-- Z2Min,Z2Max,X2Min,X2Max the rectangular
|
||||
-- right (YMax) face parallel to the Z and X axes.
|
||||
--
|
||||
-- For a box Z2Min = ZMin, Z2Max = ZMax,
|
||||
-- X2Min = XMin, X2Max = XMax
|
||||
--
|
||||
-- The wedge can be open in the corresponding direction
|
||||
-- of its Boolean myInfinite
|
||||
|
||||
|
||||
uses
|
||||
|
||||
Direction from BRepPrim,
|
||||
|
||||
Ax2 from gp,
|
||||
Pln from gp,
|
||||
Lin from gp,
|
||||
Pnt from gp,
|
||||
Shell from TopoDS,
|
||||
Face from TopoDS,
|
||||
Wire from TopoDS,
|
||||
Edge from TopoDS,
|
||||
Vertex from TopoDS,
|
||||
Builder from BRepPrim
|
||||
|
||||
raises
|
||||
DomainError,
|
||||
OutOfRange
|
||||
|
||||
is
|
||||
Create(B : Builder from BRepPrim; Axes : Ax2 from gp; dx, dy, dz : Real)
|
||||
returns GWedge from BRepPrim
|
||||
---Purpose: Creates a GWedge algorithm. <Axes> is the axis
|
||||
-- system for the primitive.
|
||||
--
|
||||
-- XMin, YMin, ZMin are set to 0
|
||||
-- XMax, YMax, ZMax are set to dx, dy, dz
|
||||
-- Z2Min = ZMin
|
||||
-- Z2Max = ZMax
|
||||
-- X2Min = XMin
|
||||
-- X2Max = XMax
|
||||
-- The result is a box
|
||||
-- dx,dy,dz should be positive
|
||||
raises DomainError;
|
||||
|
||||
Create(B : Builder from BRepPrim; Axes : Ax2 from gp; dx, dy, dz, ltx : Real)
|
||||
returns GWedge from BRepPrim
|
||||
---Purpose: Creates a GWedge primitive. <Axes> is the axis
|
||||
-- system for the primitive.
|
||||
--
|
||||
-- XMin, YMin, ZMin are set to 0
|
||||
-- XMax, YMax, ZMax are set to dx, dy, dz
|
||||
-- Z2Min = ZMin
|
||||
-- Z2Max = ZMax
|
||||
-- X2Min = ltx
|
||||
-- X2Max = ltx
|
||||
-- The result is a STEP right angular wedge
|
||||
-- dx,dy,dz should be positive
|
||||
-- ltx should not be negative
|
||||
raises DomainError;
|
||||
|
||||
Create(B : Builder from BRepPrim; Axes : Ax2 from gp; xmin, ymin, zmin, z2min, x2min,
|
||||
xmax, ymax, zmax, z2max, x2max : Real)
|
||||
returns GWedge from BRepPrim
|
||||
---Purpose: Create a GWedge primitive. <Axes> is the axis
|
||||
-- system for the primitive.
|
||||
--
|
||||
-- all the fields are set to the corresponding value
|
||||
-- XYZMax - XYZMin should be positive
|
||||
-- ZX2Max - ZX2Min should not be negative
|
||||
raises DomainError;
|
||||
|
||||
Axes(me) returns Ax2 from gp
|
||||
---Purpose: Returns the coordinates system from <me>.
|
||||
is static;
|
||||
|
||||
GetXMin(me) returns Real
|
||||
---Purpose: Returns Xmin value from <me>.
|
||||
is static;
|
||||
|
||||
GetYMin(me) returns Real
|
||||
---Purpose: Returns YMin value from <me>.
|
||||
is static;
|
||||
|
||||
GetZMin(me) returns Real
|
||||
---Purpose: Returns ZMin value from <me>.
|
||||
is static;
|
||||
|
||||
GetZ2Min(me) returns Real
|
||||
---Purpose: Returns Z2Min value from <me>.
|
||||
is static;
|
||||
|
||||
GetX2Min(me) returns Real
|
||||
---Purpose: Returns X2Min value from <me>.
|
||||
is static;
|
||||
|
||||
GetXMax(me) returns Real
|
||||
---Purpose: Returns XMax value from <me>.
|
||||
is static;
|
||||
|
||||
GetYMax(me) returns Real
|
||||
---Purpose: Returns YMax value from <me>.
|
||||
is static;
|
||||
|
||||
GetZMax(me) returns Real
|
||||
---Purpose: Returns ZMax value from <me>.
|
||||
is static;
|
||||
|
||||
GetZ2Max(me) returns Real
|
||||
---Purpose: Returns Z2Max value from <me>.
|
||||
is static;
|
||||
|
||||
GetX2Max(me) returns Real
|
||||
---Purpose: Returns X2Max value from <me>.
|
||||
is static;
|
||||
|
||||
Open(me : in out; d1 : Direction from BRepPrim)
|
||||
---Purpose: Opens <me> in <d1> direction. A face and its edges
|
||||
-- or vertices are said nonexistant.
|
||||
raises DomainError
|
||||
is static;
|
||||
|
||||
Close(me : in out; d1 : Direction from BRepPrim)
|
||||
---Purpose: Closes <me> in <d1> direction. A face and its
|
||||
-- edges or vertices are said existant.
|
||||
raises DomainError
|
||||
is static;
|
||||
|
||||
IsInfinite(me; d1 : Direction from BRepPrim)
|
||||
---Purpose: Returns True if <me> is open in <d1> direction.
|
||||
returns Boolean;
|
||||
|
||||
Shell(me : in out) returns Shell from TopoDS
|
||||
---Purpose: Returns the Shell containing the Faces of <me>.
|
||||
--
|
||||
---C++: return const &
|
||||
is static;
|
||||
|
||||
HasFace(me; d1 : Direction from BRepPrim)
|
||||
---Purpose: Returns True if <me> has a Face in <d1> direction.
|
||||
returns Boolean;
|
||||
|
||||
Face(me : in out; d1 : Direction from BRepPrim) returns Face from TopoDS
|
||||
---Purpose: Returns the Face of <me> located in <d1> direction.
|
||||
--
|
||||
---C++: return const &
|
||||
raises DomainError
|
||||
is static;
|
||||
|
||||
Plane(me : in out; d1 : Direction from BRepPrim) returns Pln from gp
|
||||
---Purpose: Returns the plane of the Face of <me> located in
|
||||
-- <d1> direction.
|
||||
raises DomainError
|
||||
is static;
|
||||
|
||||
HasWire(me; d1 : Direction from BRepPrim)
|
||||
---Purpose: Returns True if <me> has a Wire in <d1> direction.
|
||||
returns Boolean;
|
||||
|
||||
Wire(me : in out; d1 : Direction from BRepPrim) returns Wire from TopoDS
|
||||
---Purpose: Returns the Wire of <me> located in <d1> direction.
|
||||
--
|
||||
---C++: return const &
|
||||
raises DomainError
|
||||
is static;
|
||||
|
||||
HasEdge(me; d1, d2 : Direction from BRepPrim)
|
||||
---Purpose: Returns True if <me> has an Edge in <d1><d2> direction.
|
||||
returns Boolean;
|
||||
|
||||
Edge(me : in out; d1, d2 : Direction from BRepPrim) returns Edge from TopoDS
|
||||
---Purpose: Returns the Edge of <me> located in <d1><d2> direction.
|
||||
--
|
||||
---C++: return const &
|
||||
raises DomainError
|
||||
is static;
|
||||
|
||||
Line(me : in out; d1, d2 : Direction from BRepPrim) returns Lin from gp
|
||||
---Purpose: Returns the line of the Edge of <me> located in
|
||||
-- <d1><d2> direction.
|
||||
raises DomainError
|
||||
is static;
|
||||
|
||||
HasVertex(me; d1, d2, d3 : Direction from BRepPrim)
|
||||
---Purpose: Returns True if <me> has a Vertex in <d1><d2><d3>
|
||||
-- direction.
|
||||
returns Boolean;
|
||||
|
||||
Vertex(me : in out; d1, d2, d3 : Direction from BRepPrim)
|
||||
returns Vertex from TopoDS
|
||||
---Purpose: Returns the Vertex of <me> located in <d1><d2><d3>
|
||||
-- direction.
|
||||
--
|
||||
---C++: return const &
|
||||
raises DomainError
|
||||
is static;
|
||||
|
||||
Point(me : in out; d1, d2, d3 : Direction from BRepPrim)
|
||||
returns Pnt from gp
|
||||
---Purpose: Returns the point of the Vertex of <me> located in
|
||||
-- <d1><d2><d3> direction.
|
||||
raises DomainError
|
||||
is static;
|
||||
|
||||
fields
|
||||
myBuilder : Builder from BRepPrim;
|
||||
|
||||
myAxes : Ax2 from gp;
|
||||
XMin : Real;
|
||||
XMax : Real;
|
||||
YMin : Real;
|
||||
YMax : Real;
|
||||
ZMin : Real;
|
||||
ZMax : Real;
|
||||
Z2Min : Real;
|
||||
Z2Max : Real;
|
||||
X2Min : Real;
|
||||
X2Max : Real;
|
||||
|
||||
-- the Topology
|
||||
|
||||
myShell : Shell from TopoDS;
|
||||
ShellBuilt : Boolean;
|
||||
|
||||
myVertices : Vertex from TopoDS [8];
|
||||
-- 0 : xmin ymin zmin
|
||||
-- 1 : xmax ymin zmin
|
||||
-- 2 : xmin ymax zmin
|
||||
-- 3 : xmax ymax zmin
|
||||
-- 4 : xmin ymin zmax
|
||||
-- 5 : xmax ymin zmax
|
||||
-- 6 : xmin ymax zmax
|
||||
-- 7 : xmax ymax zmax
|
||||
VerticesBuilt : Boolean [8];
|
||||
|
||||
myEdges : Edge from TopoDS [12];
|
||||
-- 0 : xmin ymin
|
||||
-- 1 : xmax ymin
|
||||
-- 2 : xmin ymax
|
||||
-- 3 : xmax ymax
|
||||
-- 4 : ymin zmin
|
||||
-- 5 : ymax zmin
|
||||
-- 6 : ymin zmax
|
||||
-- 7 : ymax zmax
|
||||
-- 8 : zmin xmin
|
||||
-- 9 : zmax xmin
|
||||
-- 10 : zmin xmax
|
||||
-- 11 : zmax xmax
|
||||
EdgesBuilt : Boolean [12];
|
||||
|
||||
myWires : Wire from TopoDS [6];
|
||||
-- 0 : xmin
|
||||
-- 1 : xmax
|
||||
-- 2 : ymin
|
||||
-- 3 : ymax
|
||||
-- 4 : zmin
|
||||
-- 5 : zmax
|
||||
WiresBuilt : Boolean [6];
|
||||
|
||||
myFaces : Face from TopoDS [6];
|
||||
-- 0 : xmin
|
||||
-- 1 : xmax
|
||||
-- 2 : ymin
|
||||
-- 3 : ymax
|
||||
-- 4 : zmin
|
||||
-- 5 : zmax
|
||||
FacesBuilt : Boolean [6];
|
||||
|
||||
myInfinite : Boolean[6];
|
||||
-- 0 : xmin
|
||||
-- 1 : xmax
|
||||
-- 2 : ymin
|
||||
-- 3 : ymax
|
||||
-- 4 : zmin
|
||||
-- 5 : zmax
|
||||
|
||||
end GWedge;
|
@@ -14,25 +14,25 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BRepPrim_GWedge.ixx>
|
||||
|
||||
#include <Precision.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Lin.hxx>
|
||||
#include <ElSLib.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
|
||||
#include <TopoDS_Shell.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <BRepPrim_Builder.hxx>
|
||||
#include <BRepPrim_Direction.hxx>
|
||||
|
||||
#include <BRepPrim_GWedge.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <ElSLib.hxx>
|
||||
#include <gp_Ax2.hxx>
|
||||
#include <gp_Lin.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Shell.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
|
||||
#undef Standard_True
|
||||
#undef Standard_False
|
||||
|
240
src/BRepPrim/BRepPrim_GWedge.hxx
Normal file
240
src/BRepPrim/BRepPrim_GWedge.hxx
Normal file
@@ -0,0 +1,240 @@
|
||||
// Created on: 1991-09-18
|
||||
// Created by: Christophe MARION
|
||||
// Copyright (c) 1991-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 _BRepPrim_GWedge_HeaderFile
|
||||
#define _BRepPrim_GWedge_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <BRepPrim_Builder.hxx>
|
||||
#include <gp_Ax2.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <TopoDS_Shell.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <BRepPrim_Direction.hxx>
|
||||
class Standard_DomainError;
|
||||
class Standard_OutOfRange;
|
||||
class BRepPrim_Builder;
|
||||
class gp_Ax2;
|
||||
class TopoDS_Shell;
|
||||
class TopoDS_Face;
|
||||
class gp_Pln;
|
||||
class TopoDS_Wire;
|
||||
class TopoDS_Edge;
|
||||
class gp_Lin;
|
||||
class TopoDS_Vertex;
|
||||
class gp_Pnt;
|
||||
|
||||
|
||||
//! A wedge is defined by :
|
||||
//!
|
||||
//! Axes : an Axis2 (coordinate system)
|
||||
//!
|
||||
//! YMin, YMax the coordinates of the ymin and ymax
|
||||
//! rectangular faces parallel to the ZX plane (of the
|
||||
//! coordinate systems)
|
||||
//!
|
||||
//! ZMin,ZMax,XMin,XMax the rectangular
|
||||
//! left (YMin) face parallel to the Z and X axes.
|
||||
//!
|
||||
//! Z2Min,Z2Max,X2Min,X2Max the rectangular
|
||||
//! right (YMax) face parallel to the Z and X axes.
|
||||
//!
|
||||
//! For a box Z2Min = ZMin, Z2Max = ZMax,
|
||||
//! X2Min = XMin, X2Max = XMax
|
||||
//!
|
||||
//! The wedge can be open in the corresponding direction
|
||||
//! of its Boolean myInfinite
|
||||
class BRepPrim_GWedge
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Creates a GWedge algorithm. <Axes> is the axis
|
||||
//! system for the primitive.
|
||||
//!
|
||||
//! XMin, YMin, ZMin are set to 0
|
||||
//! XMax, YMax, ZMax are set to dx, dy, dz
|
||||
//! Z2Min = ZMin
|
||||
//! Z2Max = ZMax
|
||||
//! X2Min = XMin
|
||||
//! X2Max = XMax
|
||||
//! The result is a box
|
||||
//! dx,dy,dz should be positive
|
||||
Standard_EXPORT BRepPrim_GWedge(const BRepPrim_Builder& B, const gp_Ax2& Axes, const Standard_Real dx, const Standard_Real dy, const Standard_Real dz);
|
||||
|
||||
//! Creates a GWedge primitive. <Axes> is the axis
|
||||
//! system for the primitive.
|
||||
//!
|
||||
//! XMin, YMin, ZMin are set to 0
|
||||
//! XMax, YMax, ZMax are set to dx, dy, dz
|
||||
//! Z2Min = ZMin
|
||||
//! Z2Max = ZMax
|
||||
//! X2Min = ltx
|
||||
//! X2Max = ltx
|
||||
//! The result is a STEP right angular wedge
|
||||
//! dx,dy,dz should be positive
|
||||
//! ltx should not be negative
|
||||
Standard_EXPORT BRepPrim_GWedge(const BRepPrim_Builder& B, const gp_Ax2& Axes, const Standard_Real dx, const Standard_Real dy, const Standard_Real dz, const Standard_Real ltx);
|
||||
|
||||
//! Create a GWedge primitive. <Axes> is the axis
|
||||
//! system for the primitive.
|
||||
//!
|
||||
//! all the fields are set to the corresponding value
|
||||
//! XYZMax - XYZMin should be positive
|
||||
//! ZX2Max - ZX2Min should not be negative
|
||||
Standard_EXPORT BRepPrim_GWedge(const BRepPrim_Builder& B, const gp_Ax2& Axes, const Standard_Real xmin, const Standard_Real ymin, const Standard_Real zmin, const Standard_Real z2min, const Standard_Real x2min, const Standard_Real xmax, const Standard_Real ymax, const Standard_Real zmax, const Standard_Real z2max, const Standard_Real x2max);
|
||||
|
||||
//! Returns the coordinates system from <me>.
|
||||
Standard_EXPORT gp_Ax2 Axes() const;
|
||||
|
||||
//! Returns Xmin value from <me>.
|
||||
Standard_EXPORT Standard_Real GetXMin() const;
|
||||
|
||||
//! Returns YMin value from <me>.
|
||||
Standard_EXPORT Standard_Real GetYMin() const;
|
||||
|
||||
//! Returns ZMin value from <me>.
|
||||
Standard_EXPORT Standard_Real GetZMin() const;
|
||||
|
||||
//! Returns Z2Min value from <me>.
|
||||
Standard_EXPORT Standard_Real GetZ2Min() const;
|
||||
|
||||
//! Returns X2Min value from <me>.
|
||||
Standard_EXPORT Standard_Real GetX2Min() const;
|
||||
|
||||
//! Returns XMax value from <me>.
|
||||
Standard_EXPORT Standard_Real GetXMax() const;
|
||||
|
||||
//! Returns YMax value from <me>.
|
||||
Standard_EXPORT Standard_Real GetYMax() const;
|
||||
|
||||
//! Returns ZMax value from <me>.
|
||||
Standard_EXPORT Standard_Real GetZMax() const;
|
||||
|
||||
//! Returns Z2Max value from <me>.
|
||||
Standard_EXPORT Standard_Real GetZ2Max() const;
|
||||
|
||||
//! Returns X2Max value from <me>.
|
||||
Standard_EXPORT Standard_Real GetX2Max() const;
|
||||
|
||||
//! Opens <me> in <d1> direction. A face and its edges
|
||||
//! or vertices are said nonexistant.
|
||||
Standard_EXPORT void Open (const BRepPrim_Direction d1);
|
||||
|
||||
//! Closes <me> in <d1> direction. A face and its
|
||||
//! edges or vertices are said existant.
|
||||
Standard_EXPORT void Close (const BRepPrim_Direction d1);
|
||||
|
||||
//! Returns True if <me> is open in <d1> direction.
|
||||
Standard_EXPORT Standard_Boolean IsInfinite (const BRepPrim_Direction d1) const;
|
||||
|
||||
//! Returns the Shell containing the Faces of <me>.
|
||||
Standard_EXPORT const TopoDS_Shell& Shell();
|
||||
|
||||
//! Returns True if <me> has a Face in <d1> direction.
|
||||
Standard_EXPORT Standard_Boolean HasFace (const BRepPrim_Direction d1) const;
|
||||
|
||||
//! Returns the Face of <me> located in <d1> direction.
|
||||
Standard_EXPORT const TopoDS_Face& Face (const BRepPrim_Direction d1);
|
||||
|
||||
//! Returns the plane of the Face of <me> located in
|
||||
//! <d1> direction.
|
||||
Standard_EXPORT gp_Pln Plane (const BRepPrim_Direction d1);
|
||||
|
||||
//! Returns True if <me> has a Wire in <d1> direction.
|
||||
Standard_EXPORT Standard_Boolean HasWire (const BRepPrim_Direction d1) const;
|
||||
|
||||
//! Returns the Wire of <me> located in <d1> direction.
|
||||
Standard_EXPORT const TopoDS_Wire& Wire (const BRepPrim_Direction d1);
|
||||
|
||||
//! Returns True if <me> has an Edge in <d1><d2> direction.
|
||||
Standard_EXPORT Standard_Boolean HasEdge (const BRepPrim_Direction d1, const BRepPrim_Direction d2) const;
|
||||
|
||||
//! Returns the Edge of <me> located in <d1><d2> direction.
|
||||
Standard_EXPORT const TopoDS_Edge& Edge (const BRepPrim_Direction d1, const BRepPrim_Direction d2);
|
||||
|
||||
//! Returns the line of the Edge of <me> located in
|
||||
//! <d1><d2> direction.
|
||||
Standard_EXPORT gp_Lin Line (const BRepPrim_Direction d1, const BRepPrim_Direction d2);
|
||||
|
||||
//! Returns True if <me> has a Vertex in <d1><d2><d3>
|
||||
//! direction.
|
||||
Standard_EXPORT Standard_Boolean HasVertex (const BRepPrim_Direction d1, const BRepPrim_Direction d2, const BRepPrim_Direction d3) const;
|
||||
|
||||
//! Returns the Vertex of <me> located in <d1><d2><d3>
|
||||
//! direction.
|
||||
Standard_EXPORT const TopoDS_Vertex& Vertex (const BRepPrim_Direction d1, const BRepPrim_Direction d2, const BRepPrim_Direction d3);
|
||||
|
||||
//! Returns the point of the Vertex of <me> located in
|
||||
//! <d1><d2><d3> direction.
|
||||
Standard_EXPORT gp_Pnt Point (const BRepPrim_Direction d1, const BRepPrim_Direction d2, const BRepPrim_Direction d3);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
BRepPrim_Builder myBuilder;
|
||||
gp_Ax2 myAxes;
|
||||
Standard_Real XMin;
|
||||
Standard_Real XMax;
|
||||
Standard_Real YMin;
|
||||
Standard_Real YMax;
|
||||
Standard_Real ZMin;
|
||||
Standard_Real ZMax;
|
||||
Standard_Real Z2Min;
|
||||
Standard_Real Z2Max;
|
||||
Standard_Real X2Min;
|
||||
Standard_Real X2Max;
|
||||
TopoDS_Shell myShell;
|
||||
Standard_Boolean ShellBuilt;
|
||||
TopoDS_Vertex myVertices[8];
|
||||
Standard_Boolean VerticesBuilt[8];
|
||||
TopoDS_Edge myEdges[12];
|
||||
Standard_Boolean EdgesBuilt[12];
|
||||
TopoDS_Wire myWires[6];
|
||||
Standard_Boolean WiresBuilt[6];
|
||||
TopoDS_Face myFaces[6];
|
||||
Standard_Boolean FacesBuilt[6];
|
||||
Standard_Boolean myInfinite[6];
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepPrim_GWedge_HeaderFile
|
@@ -1,491 +0,0 @@
|
||||
-- Created on: 1991-07-23
|
||||
-- Created by: Christophe MARION
|
||||
-- Copyright (c) 1991-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 OneAxis from BRepPrim
|
||||
|
||||
---Purpose: Algorithm to build primitives with one axis of
|
||||
-- revolution.
|
||||
--
|
||||
-- The revolution body is described by :
|
||||
--
|
||||
-- A coordinate system (Ax2 from gp). The Z axis is
|
||||
-- the rotational axis.
|
||||
--
|
||||
-- An Angle around the Axis, When the Angle is 2*PI
|
||||
-- the primitive is not limited by planar faces. The
|
||||
-- U parameter range from 0 to Angle.
|
||||
--
|
||||
-- A parameter range VMin, VMax on the meridian.
|
||||
--
|
||||
-- A meridian : The meridian is a curve described by
|
||||
-- a set of deferred methods.
|
||||
--
|
||||
--
|
||||
-- The topology consists of A shell, Faces, Wires,
|
||||
-- Edges and Vertices. Methods are provided to build
|
||||
-- all the elements. Building an element implies the
|
||||
-- automatic building of all its sub-elements.
|
||||
--
|
||||
-- So building the shell builds everything.
|
||||
--
|
||||
-- There are at most 5 faces :
|
||||
--
|
||||
-- - The LateralFace.
|
||||
--
|
||||
-- - The TopFace and the BottomFace.
|
||||
--
|
||||
-- - The StartFace and the EndFace.
|
||||
--
|
||||
|
||||
|
||||
|
||||
uses
|
||||
Ax2 from gp,
|
||||
Pnt2d from gp,
|
||||
Shell from TopoDS,
|
||||
Face from TopoDS,
|
||||
Wire from TopoDS,
|
||||
Edge from TopoDS,
|
||||
Vertex from TopoDS,
|
||||
Builder from BRepPrim
|
||||
|
||||
raises
|
||||
DomainError,
|
||||
OutOfRange
|
||||
|
||||
is
|
||||
Initialize(B : Builder from BRepPrim;
|
||||
A : Ax2 from gp;
|
||||
VMin, VMax : Real from Standard);
|
||||
---Purpose: Creates a OneAxis algorithm. <B> is used to build
|
||||
-- the Topology. The angle defaults to 2*PI.
|
||||
|
||||
|
||||
SetMeridianOffset(me: in out;MeridianOffset : Real from Standard = 0)
|
||||
---Purpose: The MeridianOffset is added to the parameters on
|
||||
-- the meridian curve and to the V values of the
|
||||
-- pcurves. This is used for the sphere for example,
|
||||
-- to give a range on the meridian edge which is not
|
||||
-- VMin, VMax.
|
||||
is static;
|
||||
|
||||
Axes(me) returns Ax2 from gp
|
||||
---Purpose: Returns the Ax2 from <me>.
|
||||
---C++: return const &
|
||||
is static;
|
||||
|
||||
Axes(me : in out; A : Ax2 from gp)
|
||||
raises DomainError -- when some topology has been built or A > 2*PI
|
||||
is static;
|
||||
|
||||
Angle(me) returns Real
|
||||
is static;
|
||||
|
||||
Angle(me : in out; A : Real)
|
||||
raises DomainError -- when some topology has been built or A > 2*PI
|
||||
is static;
|
||||
|
||||
VMin(me) returns Real
|
||||
is static;
|
||||
|
||||
VMin(me : in out; V : Real)
|
||||
raises DomainError -- when some topology has been built
|
||||
is static;
|
||||
|
||||
VMax(me) returns Real
|
||||
is static;
|
||||
|
||||
VMax(me : in out; V : Real)
|
||||
raises DomainError -- when some topology has been built
|
||||
is static;
|
||||
|
||||
--
|
||||
-- Methods to describe the meridian
|
||||
-- They should be redefined in inherited classes
|
||||
--
|
||||
|
||||
MakeEmptyLateralFace(me) returns Face from TopoDS
|
||||
---Purpose: Returns a face with no edges. The surface is the
|
||||
-- lateral surface with normals pointing outward. The
|
||||
-- U parameter is the angle with the origin on the X
|
||||
-- axis. The V parameter is the parameter of the
|
||||
-- meridian.
|
||||
is deferred;
|
||||
|
||||
MakeEmptyMeridianEdge(me; Ang : Real) returns Edge from TopoDS
|
||||
---Purpose: Returns an edge with a 3D curve made from the
|
||||
-- meridian in the XZ plane rotated by <Ang> around
|
||||
-- the Z-axis. Ang may be 0 or myAngle.
|
||||
is deferred;
|
||||
|
||||
SetMeridianPCurve(me; E : in out Edge from TopoDS; F : Face from TopoDS)
|
||||
---Purpose: Sets the parametric curve of the edge <E> in the
|
||||
-- face <F> to be the 2d representation of the
|
||||
-- meridian.
|
||||
is deferred;
|
||||
|
||||
MeridianValue(me; V : Real) returns Pnt2d from gp
|
||||
---Purpose: Returns the meridian point at parameter <V> in the
|
||||
-- plane XZ.
|
||||
is deferred;
|
||||
|
||||
MeridianOnAxis(me; V : Real) returns Boolean
|
||||
---Purpose: Returns True if the point of parameter <V> on the
|
||||
-- meridian is on the Axis. Default implementation is
|
||||
-- Abs(MeridianValue(V).X()) < Precision::Confusion()
|
||||
is virtual;
|
||||
|
||||
MeridianClosed(me) returns Boolean
|
||||
---Purpose: Returns True if the meridian is closed. Default
|
||||
-- implementation is
|
||||
-- MeridianValue(VMin).IsEqual(MeridianValue(VMax),
|
||||
-- Precision::Confusion())
|
||||
is virtual;
|
||||
|
||||
VMaxInfinite(me) returns Boolean
|
||||
---Purpose: Returns True if VMax is infinite. Default
|
||||
-- Precision::IsPositiveInfinite(VMax);
|
||||
is virtual;
|
||||
|
||||
VMinInfinite(me) returns Boolean
|
||||
---Purpose: Returns True if VMin is infinite. Default
|
||||
-- Precision::IsNegativeInfinite(VMax);
|
||||
is virtual;
|
||||
|
||||
|
||||
-- Usefull booleans
|
||||
|
||||
HasTop(me) returns Boolean
|
||||
---Purpose: Returns True if there is a top face.
|
||||
--
|
||||
-- That is neither : VMaxInfinite()
|
||||
-- MeridianClosed()
|
||||
-- MeridianOnAxis(VMax)
|
||||
is virtual;
|
||||
|
||||
HasBottom(me) returns Boolean
|
||||
---Purpose: Returns True if there is a bottom face.
|
||||
--
|
||||
-- That is neither : VMinInfinite()
|
||||
-- MeridianClosed()
|
||||
-- MeridianOnAxis(VMin)
|
||||
is virtual;
|
||||
|
||||
HasSides(me) returns Boolean
|
||||
---Purpose: Returns True if there are Start and End faces.
|
||||
--
|
||||
-- That is : 2*PI - Angle > Precision::Angular()
|
||||
is virtual;
|
||||
|
||||
|
||||
--
|
||||
-- Methods to get the Topology of:
|
||||
--
|
||||
|
||||
-- the shell
|
||||
Shell(me : in out) returns Shell from TopoDS
|
||||
---Purpose: Returns the Shell containing all the Faces of the
|
||||
-- primitive.
|
||||
--
|
||||
---C++: return const &
|
||||
is static;
|
||||
|
||||
-- the Faces
|
||||
|
||||
LateralFace(me : in out) returns Face from TopoDS
|
||||
---Purpose: Returns the lateral Face. It is oriented toward
|
||||
-- the outside of the primitive.
|
||||
--
|
||||
---C++: return const &
|
||||
is static;
|
||||
|
||||
TopFace(me : in out) returns Face from TopoDS
|
||||
---Purpose: Returns the top planar Face. It is Oriented
|
||||
-- toward the +Z axis (outside).
|
||||
--
|
||||
---C++: return const &
|
||||
raises DomainError -- if !HasTop()
|
||||
is static;
|
||||
|
||||
BottomFace(me : in out) returns Face from TopoDS
|
||||
---Purpose: Returns the Bottom planar Face. It is Oriented
|
||||
-- toward the -Z axis (outside).
|
||||
--
|
||||
---C++: return const &
|
||||
raises DomainError -- if !HasBottom()
|
||||
is static;
|
||||
|
||||
StartFace(me : in out) returns Face from TopoDS
|
||||
---Purpose: Returns the Face starting the slice, it is
|
||||
-- oriented toward the exterior of the primitive.
|
||||
--
|
||||
---C++: return const &
|
||||
raises DomainError -- if !HasSides()
|
||||
is static;
|
||||
|
||||
EndFace(me : in out) returns Face from TopoDS
|
||||
---Purpose: Returns the Face ending the slice, it is oriented
|
||||
-- toward the exterior of the primitive.
|
||||
--
|
||||
---C++: return const &
|
||||
raises DomainError -- if !HasSides()
|
||||
is static;
|
||||
|
||||
-- Wires
|
||||
|
||||
LateralWire(me : in out) returns Wire from TopoDS
|
||||
---Purpose: Returns the wire in the lateral face.
|
||||
--
|
||||
---C++: return const &
|
||||
raises DomainError -- if VMinInfinite() && VMaxInfinite()
|
||||
is static;
|
||||
|
||||
LateralStartWire(me : in out) returns Wire from TopoDS
|
||||
---Purpose: Returns the wire in the lateral face with the
|
||||
-- start edge.
|
||||
--
|
||||
---C++: return const &
|
||||
raises DomainError -- if ! (VMinInfinite() && VMaxInfinite())
|
||||
is static;
|
||||
|
||||
LateralEndWire(me : in out) returns Wire from TopoDS
|
||||
---Purpose: Returns the wire with in lateral face with the end
|
||||
-- edge.
|
||||
--
|
||||
---C++: return const &
|
||||
raises DomainError -- if ! (VMinInfinite() && VMaxInfinite())
|
||||
is static;
|
||||
|
||||
TopWire(me : in out) returns Wire from TopoDS
|
||||
---Purpose: Returns the wire in the top face.
|
||||
--
|
||||
---C++: return const &
|
||||
raises DomainError -- if !HasTop()
|
||||
is static;
|
||||
|
||||
BottomWire(me : in out) returns Wire from TopoDS
|
||||
---Purpose: Returns the wire in the bottom face.
|
||||
--
|
||||
---C++: return const &
|
||||
raises DomainError -- if !HasBottom()
|
||||
is static;
|
||||
|
||||
StartWire(me : in out) returns Wire from TopoDS
|
||||
---Purpose: Returns the wire in the start face.
|
||||
--
|
||||
---C++: return const &
|
||||
raises DomainError -- if !HasSides()
|
||||
is static;
|
||||
|
||||
AxisStartWire(me : in out) returns Wire from TopoDS
|
||||
---Purpose: Returns the wire in the start face with the
|
||||
-- AxisEdge.
|
||||
--
|
||||
---C++: return const &
|
||||
raises DomainError -- if !HasSides() ! (VMinInfinite() && VMaxInfinite())
|
||||
is static;
|
||||
|
||||
EndWire(me : in out) returns Wire from TopoDS
|
||||
---Purpose: Returns the Wire in the end face.
|
||||
--
|
||||
---C++: return const &
|
||||
raises DomainError -- if !HasSides()
|
||||
is static;
|
||||
|
||||
AxisEndWire(me : in out) returns Wire from TopoDS
|
||||
---Purpose: Returns the Wire in the end face with the
|
||||
-- AxisEdge.
|
||||
--
|
||||
---C++: return const &
|
||||
raises DomainError -- if !HasSides() ! (VMinInfinite() && VMaxInfinite())
|
||||
is static;
|
||||
|
||||
|
||||
-- Edges
|
||||
|
||||
AxisEdge(me : in out) returns Edge from TopoDS
|
||||
---Purpose: Returns the Edge built along the Axis and oriented
|
||||
-- on +Z of the Axis.
|
||||
--
|
||||
---C++: return const &
|
||||
raises DomainError -- if ! (MeridianOnAxis(VMin) || MeridianOnAxis(VMax))
|
||||
is static;
|
||||
|
||||
StartEdge(me : in out) returns Edge from TopoDS
|
||||
---Purpose: Returns the Edge at angle 0.
|
||||
--
|
||||
---C++: return const &
|
||||
is static;
|
||||
|
||||
EndEdge(me : in out) returns Edge from TopoDS
|
||||
---Purpose: Returns the Edge at angle Angle. If !HasSides()
|
||||
-- the StartEdge and the EndEdge are the same edge.
|
||||
--
|
||||
---C++: return const &
|
||||
is static;
|
||||
|
||||
StartTopEdge(me : in out) returns Edge from TopoDS
|
||||
---Purpose: Returns the linear Edge between start Face and top
|
||||
-- Face.
|
||||
--
|
||||
---C++: return const &
|
||||
raises DomainError -- if ! (HasTop() && HasSides())
|
||||
is static;
|
||||
|
||||
StartBottomEdge(me : in out) returns Edge from TopoDS
|
||||
---Purpose: Returns the linear Edge between start Face and
|
||||
-- bottom Face.
|
||||
--
|
||||
---C++: return const &
|
||||
raises DomainError -- if ! (HasBottom() && HasSides())
|
||||
is static;
|
||||
|
||||
EndTopEdge(me : in out) returns Edge from TopoDS
|
||||
---Purpose: Returns the linear Edge between end Face and top
|
||||
-- Face.
|
||||
--
|
||||
---C++: return const &
|
||||
raises DomainError -- if ! (HasTop() && HasSides())
|
||||
is static;
|
||||
|
||||
EndBottomEdge(me : in out) returns Edge from TopoDS
|
||||
---Purpose: Returns the linear Edge between end Face and
|
||||
-- bottom Face.
|
||||
--
|
||||
---C++: return const &
|
||||
raises DomainError -- if ! (HasBottom() && HasSides())
|
||||
is static;
|
||||
|
||||
TopEdge(me : in out) returns Edge from TopoDS
|
||||
---Purpose: Returns the edge at VMax. If MeridianClosed() the
|
||||
-- TopEdge and the BottomEdge are the same edge.
|
||||
--
|
||||
---C++: return const &
|
||||
raises DomainError -- if VMaxInfinite()
|
||||
is static;
|
||||
|
||||
BottomEdge(me : in out) returns Edge from TopoDS
|
||||
---Purpose: Returns the edge at VMin. If MeridianClosed() the
|
||||
-- TopEdge and the BottomEdge are the same edge.
|
||||
--
|
||||
---C++: return const &
|
||||
raises DomainError -- if VMinInfinite()
|
||||
is static;
|
||||
|
||||
-- Vertices
|
||||
|
||||
AxisTopVertex(me : in out) returns Vertex from TopoDS
|
||||
---Purpose: Returns the Vertex at the Top altitude on the axis.
|
||||
--
|
||||
---C++: return const &
|
||||
raises DomainError -- if !MeridianOnAxis(VMax)
|
||||
is static;
|
||||
|
||||
AxisBottomVertex(me : in out) returns Vertex from TopoDS
|
||||
---Purpose: Returns the Vertex at the Bottom altitude on the
|
||||
-- axis.
|
||||
--
|
||||
---C++: return const &
|
||||
raises DomainError -- if !MeridianOnAxis(VMin)
|
||||
is static;
|
||||
|
||||
TopStartVertex(me : in out) returns Vertex from TopoDS
|
||||
---Purpose: Returns the vertex (0,VMax)
|
||||
--
|
||||
---C++: return const &
|
||||
raises DomainError -- if VMaxInfinite()
|
||||
is static;
|
||||
|
||||
TopEndVertex(me : in out) returns Vertex from TopoDS
|
||||
---Purpose: Returns the vertex (angle,VMax)
|
||||
--
|
||||
---C++: return const &
|
||||
raises DomainError -- if VMaxInfinite()
|
||||
is static;
|
||||
|
||||
BottomStartVertex(me : in out) returns Vertex from TopoDS
|
||||
---Purpose: Returns the vertex (0,VMin)
|
||||
--
|
||||
---C++: return const &
|
||||
raises DomainError -- if VMinInfinite()
|
||||
is static;
|
||||
|
||||
BottomEndVertex(me : in out) returns Vertex from TopoDS
|
||||
---Purpose: Returns the vertex (angle,VMax)
|
||||
--
|
||||
---C++: return const &
|
||||
raises DomainError -- if VMinInfinite()
|
||||
is static;
|
||||
|
||||
---C++ : alias " Standard_EXPORT virtual ~BRepPrim_OneAxis();"
|
||||
|
||||
fields
|
||||
myBuilder : Builder from BRepPrim is protected;
|
||||
myAxes : Ax2 from gp;
|
||||
|
||||
myAngle : Real from Standard;
|
||||
myVMin : Real from Standard;
|
||||
myVMax : Real from Standard;
|
||||
myMeridianOffset : Real from Standard;
|
||||
|
||||
-- the Topology
|
||||
|
||||
myShell : Shell from TopoDS;
|
||||
ShellBuilt : Boolean;
|
||||
|
||||
myVertices : Vertex from TopoDS [6];
|
||||
-- 0 : Vertex on top of the axis
|
||||
-- 1 : on bottom of the axis
|
||||
-- 2 : top, start
|
||||
-- 3 : top, end
|
||||
-- 4 : bottom, start
|
||||
-- 5 : bottom, end
|
||||
VerticesBuilt : Boolean [6];
|
||||
|
||||
myEdges : Edge from TopoDS [9];
|
||||
-- 0 : Edge on the Axis
|
||||
-- 1 : Start Edge
|
||||
-- 2 : End Edge
|
||||
-- 3 : Start Top
|
||||
-- 4 : Start Bottom
|
||||
-- 5 : End Top
|
||||
-- 6 : End Bottom
|
||||
-- 7 : Top
|
||||
-- 8 : Bottom
|
||||
EdgesBuilt : Boolean [9];
|
||||
|
||||
myWires : Wire from TopoDS [9];
|
||||
-- 0 : wire Lateral
|
||||
-- 1 : Lateral Start
|
||||
-- 2 : Lateral End
|
||||
-- 3 : Top
|
||||
-- 4 : Bottom
|
||||
-- 5 : Start
|
||||
-- 6 : Axis Start
|
||||
-- 7 : End
|
||||
-- 8 : Axis End
|
||||
WiresBuilt : Boolean [9];
|
||||
|
||||
myFaces : Face from TopoDS [5];
|
||||
-- 0 : Lateral Face
|
||||
-- 1 : Top
|
||||
-- 2 : Bottom
|
||||
-- 3 : Start
|
||||
-- 4 : End
|
||||
FacesBuilt : Boolean [5];
|
||||
|
||||
|
||||
end OneAxis;
|
@@ -14,27 +14,26 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BRepPrim_OneAxis.ixx>
|
||||
|
||||
#include <Precision.hxx>
|
||||
|
||||
#include <TopoDS_Shell.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <BRepPrim_Builder.hxx>
|
||||
#include <BRepPrim_Direction.hxx>
|
||||
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Lin2d.hxx>
|
||||
#include <BRepPrim_OneAxis.hxx>
|
||||
#include <gp_Ax2.hxx>
|
||||
#include <gp_Circ.hxx>
|
||||
#include <gp_Circ2d.hxx>
|
||||
#include <gp_Lin.hxx>
|
||||
#include <gp_Circ.hxx>
|
||||
#include <gp_Lin2d.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Shell.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
|
||||
#undef Standard_True
|
||||
#undef Standard_False
|
||||
|
319
src/BRepPrim/BRepPrim_OneAxis.hxx
Normal file
319
src/BRepPrim/BRepPrim_OneAxis.hxx
Normal file
@@ -0,0 +1,319 @@
|
||||
// Created on: 1991-07-23
|
||||
// Created by: Christophe MARION
|
||||
// Copyright (c) 1991-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 _BRepPrim_OneAxis_HeaderFile
|
||||
#define _BRepPrim_OneAxis_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <BRepPrim_Builder.hxx>
|
||||
#include <gp_Ax2.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <TopoDS_Shell.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
class Standard_DomainError;
|
||||
class Standard_OutOfRange;
|
||||
class BRepPrim_Builder;
|
||||
class gp_Ax2;
|
||||
class TopoDS_Face;
|
||||
class TopoDS_Edge;
|
||||
class gp_Pnt2d;
|
||||
class TopoDS_Shell;
|
||||
class TopoDS_Wire;
|
||||
class TopoDS_Vertex;
|
||||
|
||||
|
||||
//! Algorithm to build primitives with one axis of
|
||||
//! revolution.
|
||||
//!
|
||||
//! The revolution body is described by :
|
||||
//!
|
||||
//! A coordinate system (Ax2 from gp). The Z axis is
|
||||
//! the rotational axis.
|
||||
//!
|
||||
//! An Angle around the Axis, When the Angle is 2*PI
|
||||
//! the primitive is not limited by planar faces. The
|
||||
//! U parameter range from 0 to Angle.
|
||||
//!
|
||||
//! A parameter range VMin, VMax on the meridian.
|
||||
//!
|
||||
//! A meridian : The meridian is a curve described by
|
||||
//! a set of deferred methods.
|
||||
//!
|
||||
//! The topology consists of A shell, Faces, Wires,
|
||||
//! Edges and Vertices. Methods are provided to build
|
||||
//! all the elements. Building an element implies the
|
||||
//! automatic building of all its sub-elements.
|
||||
//!
|
||||
//! So building the shell builds everything.
|
||||
//!
|
||||
//! There are at most 5 faces :
|
||||
//!
|
||||
//! - The LateralFace.
|
||||
//!
|
||||
//! - The TopFace and the BottomFace.
|
||||
//!
|
||||
//! - The StartFace and the EndFace.
|
||||
class BRepPrim_OneAxis
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! The MeridianOffset is added to the parameters on
|
||||
//! the meridian curve and to the V values of the
|
||||
//! pcurves. This is used for the sphere for example,
|
||||
//! to give a range on the meridian edge which is not
|
||||
//! VMin, VMax.
|
||||
Standard_EXPORT void SetMeridianOffset (const Standard_Real MeridianOffset = 0);
|
||||
|
||||
//! Returns the Ax2 from <me>.
|
||||
Standard_EXPORT const gp_Ax2& Axes() const;
|
||||
|
||||
Standard_EXPORT void Axes (const gp_Ax2& A);
|
||||
|
||||
Standard_EXPORT Standard_Real Angle() const;
|
||||
|
||||
Standard_EXPORT void Angle (const Standard_Real A);
|
||||
|
||||
Standard_EXPORT Standard_Real VMin() const;
|
||||
|
||||
Standard_EXPORT void VMin (const Standard_Real V);
|
||||
|
||||
Standard_EXPORT Standard_Real VMax() const;
|
||||
|
||||
Standard_EXPORT void VMax (const Standard_Real V);
|
||||
|
||||
//! Returns a face with no edges. The surface is the
|
||||
//! lateral surface with normals pointing outward. The
|
||||
//! U parameter is the angle with the origin on the X
|
||||
//! axis. The V parameter is the parameter of the
|
||||
//! meridian.
|
||||
Standard_EXPORT virtual TopoDS_Face MakeEmptyLateralFace() const = 0;
|
||||
|
||||
//! Returns an edge with a 3D curve made from the
|
||||
//! meridian in the XZ plane rotated by <Ang> around
|
||||
//! the Z-axis. Ang may be 0 or myAngle.
|
||||
Standard_EXPORT virtual TopoDS_Edge MakeEmptyMeridianEdge (const Standard_Real Ang) const = 0;
|
||||
|
||||
//! Sets the parametric curve of the edge <E> in the
|
||||
//! face <F> to be the 2d representation of the
|
||||
//! meridian.
|
||||
Standard_EXPORT virtual void SetMeridianPCurve (TopoDS_Edge& E, const TopoDS_Face& F) const = 0;
|
||||
|
||||
//! Returns the meridian point at parameter <V> in the
|
||||
//! plane XZ.
|
||||
Standard_EXPORT virtual gp_Pnt2d MeridianValue (const Standard_Real V) const = 0;
|
||||
|
||||
//! Returns True if the point of parameter <V> on the
|
||||
//! meridian is on the Axis. Default implementation is
|
||||
//! Abs(MeridianValue(V).X()) < Precision::Confusion()
|
||||
Standard_EXPORT virtual Standard_Boolean MeridianOnAxis (const Standard_Real V) const;
|
||||
|
||||
//! Returns True if the meridian is closed. Default
|
||||
//! implementation is
|
||||
//! MeridianValue(VMin).IsEqual(MeridianValue(VMax),
|
||||
//! Precision::Confusion())
|
||||
Standard_EXPORT virtual Standard_Boolean MeridianClosed() const;
|
||||
|
||||
//! Returns True if VMax is infinite. Default
|
||||
//! Precision::IsPositiveInfinite(VMax);
|
||||
Standard_EXPORT virtual Standard_Boolean VMaxInfinite() const;
|
||||
|
||||
//! Returns True if VMin is infinite. Default
|
||||
//! Precision::IsNegativeInfinite(VMax);
|
||||
Standard_EXPORT virtual Standard_Boolean VMinInfinite() const;
|
||||
|
||||
//! Returns True if there is a top face.
|
||||
//!
|
||||
//! That is neither : VMaxInfinite()
|
||||
//! MeridianClosed()
|
||||
//! MeridianOnAxis(VMax)
|
||||
Standard_EXPORT virtual Standard_Boolean HasTop() const;
|
||||
|
||||
//! Returns True if there is a bottom face.
|
||||
//!
|
||||
//! That is neither : VMinInfinite()
|
||||
//! MeridianClosed()
|
||||
//! MeridianOnAxis(VMin)
|
||||
Standard_EXPORT virtual Standard_Boolean HasBottom() const;
|
||||
|
||||
//! Returns True if there are Start and End faces.
|
||||
//!
|
||||
//! That is : 2*PI - Angle > Precision::Angular()
|
||||
Standard_EXPORT virtual Standard_Boolean HasSides() const;
|
||||
|
||||
//! Returns the Shell containing all the Faces of the
|
||||
//! primitive.
|
||||
Standard_EXPORT const TopoDS_Shell& Shell();
|
||||
|
||||
//! Returns the lateral Face. It is oriented toward
|
||||
//! the outside of the primitive.
|
||||
Standard_EXPORT const TopoDS_Face& LateralFace();
|
||||
|
||||
//! Returns the top planar Face. It is Oriented
|
||||
//! toward the +Z axis (outside).
|
||||
Standard_EXPORT const TopoDS_Face& TopFace();
|
||||
|
||||
//! Returns the Bottom planar Face. It is Oriented
|
||||
//! toward the -Z axis (outside).
|
||||
Standard_EXPORT const TopoDS_Face& BottomFace();
|
||||
|
||||
//! Returns the Face starting the slice, it is
|
||||
//! oriented toward the exterior of the primitive.
|
||||
Standard_EXPORT const TopoDS_Face& StartFace();
|
||||
|
||||
//! Returns the Face ending the slice, it is oriented
|
||||
//! toward the exterior of the primitive.
|
||||
Standard_EXPORT const TopoDS_Face& EndFace();
|
||||
|
||||
//! Returns the wire in the lateral face.
|
||||
Standard_EXPORT const TopoDS_Wire& LateralWire();
|
||||
|
||||
//! Returns the wire in the lateral face with the
|
||||
//! start edge.
|
||||
Standard_EXPORT const TopoDS_Wire& LateralStartWire();
|
||||
|
||||
//! Returns the wire with in lateral face with the end
|
||||
//! edge.
|
||||
Standard_EXPORT const TopoDS_Wire& LateralEndWire();
|
||||
|
||||
//! Returns the wire in the top face.
|
||||
Standard_EXPORT const TopoDS_Wire& TopWire();
|
||||
|
||||
//! Returns the wire in the bottom face.
|
||||
Standard_EXPORT const TopoDS_Wire& BottomWire();
|
||||
|
||||
//! Returns the wire in the start face.
|
||||
Standard_EXPORT const TopoDS_Wire& StartWire();
|
||||
|
||||
//! Returns the wire in the start face with the
|
||||
//! AxisEdge.
|
||||
Standard_EXPORT const TopoDS_Wire& AxisStartWire();
|
||||
|
||||
//! Returns the Wire in the end face.
|
||||
Standard_EXPORT const TopoDS_Wire& EndWire();
|
||||
|
||||
//! Returns the Wire in the end face with the
|
||||
//! AxisEdge.
|
||||
Standard_EXPORT const TopoDS_Wire& AxisEndWire();
|
||||
|
||||
//! Returns the Edge built along the Axis and oriented
|
||||
//! on +Z of the Axis.
|
||||
Standard_EXPORT const TopoDS_Edge& AxisEdge();
|
||||
|
||||
//! Returns the Edge at angle 0.
|
||||
Standard_EXPORT const TopoDS_Edge& StartEdge();
|
||||
|
||||
//! Returns the Edge at angle Angle. If !HasSides()
|
||||
//! the StartEdge and the EndEdge are the same edge.
|
||||
Standard_EXPORT const TopoDS_Edge& EndEdge();
|
||||
|
||||
//! Returns the linear Edge between start Face and top
|
||||
//! Face.
|
||||
Standard_EXPORT const TopoDS_Edge& StartTopEdge();
|
||||
|
||||
//! Returns the linear Edge between start Face and
|
||||
//! bottom Face.
|
||||
Standard_EXPORT const TopoDS_Edge& StartBottomEdge();
|
||||
|
||||
//! Returns the linear Edge between end Face and top
|
||||
//! Face.
|
||||
Standard_EXPORT const TopoDS_Edge& EndTopEdge();
|
||||
|
||||
//! Returns the linear Edge between end Face and
|
||||
//! bottom Face.
|
||||
Standard_EXPORT const TopoDS_Edge& EndBottomEdge();
|
||||
|
||||
//! Returns the edge at VMax. If MeridianClosed() the
|
||||
//! TopEdge and the BottomEdge are the same edge.
|
||||
Standard_EXPORT const TopoDS_Edge& TopEdge();
|
||||
|
||||
//! Returns the edge at VMin. If MeridianClosed() the
|
||||
//! TopEdge and the BottomEdge are the same edge.
|
||||
Standard_EXPORT const TopoDS_Edge& BottomEdge();
|
||||
|
||||
//! Returns the Vertex at the Top altitude on the axis.
|
||||
Standard_EXPORT const TopoDS_Vertex& AxisTopVertex();
|
||||
|
||||
//! Returns the Vertex at the Bottom altitude on the
|
||||
//! axis.
|
||||
Standard_EXPORT const TopoDS_Vertex& AxisBottomVertex();
|
||||
|
||||
//! Returns the vertex (0,VMax)
|
||||
Standard_EXPORT const TopoDS_Vertex& TopStartVertex();
|
||||
|
||||
//! Returns the vertex (angle,VMax)
|
||||
Standard_EXPORT const TopoDS_Vertex& TopEndVertex();
|
||||
|
||||
//! Returns the vertex (0,VMin)
|
||||
Standard_EXPORT const TopoDS_Vertex& BottomStartVertex();
|
||||
|
||||
//! Returns the vertex (angle,VMax)
|
||||
Standard_EXPORT const TopoDS_Vertex& BottomEndVertex();
|
||||
Standard_EXPORT virtual ~BRepPrim_OneAxis();
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
//! Creates a OneAxis algorithm. <B> is used to build
|
||||
//! the Topology. The angle defaults to 2*PI.
|
||||
Standard_EXPORT BRepPrim_OneAxis(const BRepPrim_Builder& B, const gp_Ax2& A, const Standard_Real VMin, const Standard_Real VMax);
|
||||
|
||||
|
||||
BRepPrim_Builder myBuilder;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
gp_Ax2 myAxes;
|
||||
Standard_Real myAngle;
|
||||
Standard_Real myVMin;
|
||||
Standard_Real myVMax;
|
||||
Standard_Real myMeridianOffset;
|
||||
TopoDS_Shell myShell;
|
||||
Standard_Boolean ShellBuilt;
|
||||
TopoDS_Vertex myVertices[6];
|
||||
Standard_Boolean VerticesBuilt[6];
|
||||
TopoDS_Edge myEdges[9];
|
||||
Standard_Boolean EdgesBuilt[9];
|
||||
TopoDS_Wire myWires[9];
|
||||
Standard_Boolean WiresBuilt[9];
|
||||
TopoDS_Face myFaces[5];
|
||||
Standard_Boolean FacesBuilt[5];
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepPrim_OneAxis_HeaderFile
|
@@ -1,76 +0,0 @@
|
||||
-- Created on: 1992-11-05
|
||||
-- Created by: Remi LEQUETTE
|
||||
-- Copyright (c) 1992-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 Revolution from BRepPrim inherits OneAxis from BRepPrim
|
||||
|
||||
---Purpose: Implement the OneAxis algoritm for a revolution
|
||||
-- surface.
|
||||
|
||||
uses
|
||||
Face from TopoDS,
|
||||
Edge from TopoDS,
|
||||
|
||||
Curve from Geom,
|
||||
Curve from Geom2d,
|
||||
|
||||
Ax2 from gp,
|
||||
Pnt2d from gp
|
||||
|
||||
is
|
||||
Create(A : Ax2 from gp;
|
||||
VMin, VMax : Real from Standard;
|
||||
M : Curve from Geom;
|
||||
PM : Curve from Geom2d) returns Revolution from BRepPrim;
|
||||
---Purpose: Create a revolution body <M> is the meridian nd
|
||||
-- must be in the XZ plane of <A>. <PM> is the
|
||||
-- meridian in the XZ plane.
|
||||
|
||||
Create(A : Ax2 from gp;
|
||||
VMin, VMax : Real from Standard) returns Revolution from BRepPrim
|
||||
---Purpose: Create a revolution body. The meridian is set
|
||||
-- later. Reserved for derivated classes.
|
||||
is protected;
|
||||
|
||||
Meridian(me : in out; M : Curve from Geom; PM : Curve from Geom2d)
|
||||
is protected;
|
||||
|
||||
MakeEmptyLateralFace(me) returns Face from TopoDS
|
||||
---Purpose: The surface normal should be directed towards the
|
||||
-- outside.
|
||||
is virtual;
|
||||
|
||||
MakeEmptyMeridianEdge(me; Ang : Real) returns Edge from TopoDS
|
||||
---Purpose: Returns an edge with a 3D curve made from the
|
||||
-- meridian in the XZ plane rotated by <Ang> around
|
||||
-- the Z-axis. Ang may be 0 or myAngle.
|
||||
is virtual;
|
||||
|
||||
MeridianValue(me; V : Real) returns Pnt2d from gp
|
||||
---Purpose: Returns the meridian point at parameter <V> in the
|
||||
-- plane XZ.
|
||||
is virtual;
|
||||
|
||||
SetMeridianPCurve(me; E : in out Edge from TopoDS; F : Face from TopoDS)
|
||||
---Purpose: Sets the parametric urve of the edge <E> in the
|
||||
-- face <F> to be the 2d representation of the
|
||||
-- meridian.
|
||||
is virtual;
|
||||
|
||||
fields
|
||||
myMeridian : Curve from Geom;
|
||||
myPMeridian : Curve from Geom2d;
|
||||
|
||||
end Revolution;
|
@@ -14,17 +14,21 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BRepPrim_Revolution.ixx>
|
||||
|
||||
#include <Precision.hxx>
|
||||
#include <Geom_SurfaceOfRevolution.hxx>
|
||||
#include <BRepPrim_Revolution.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_SurfaceOfRevolution.hxx>
|
||||
#include <gp_Ax2.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : BRepPrim_Revolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
BRepPrim_Revolution::BRepPrim_Revolution(const gp_Ax2& A,
|
||||
const Standard_Real VMin,
|
||||
const Standard_Real VMax,
|
||||
|
97
src/BRepPrim/BRepPrim_Revolution.hxx
Normal file
97
src/BRepPrim/BRepPrim_Revolution.hxx
Normal file
@@ -0,0 +1,97 @@
|
||||
// Created on: 1992-11-05
|
||||
// Created by: Remi LEQUETTE
|
||||
// Copyright (c) 1992-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 _BRepPrim_Revolution_HeaderFile
|
||||
#define _BRepPrim_Revolution_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <BRepPrim_OneAxis.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
class Geom_Curve;
|
||||
class Geom2d_Curve;
|
||||
class gp_Ax2;
|
||||
class TopoDS_Face;
|
||||
class TopoDS_Edge;
|
||||
class gp_Pnt2d;
|
||||
|
||||
|
||||
//! Implement the OneAxis algoritm for a revolution
|
||||
//! surface.
|
||||
class BRepPrim_Revolution : public BRepPrim_OneAxis
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Create a revolution body <M> is the meridian nd
|
||||
//! must be in the XZ plane of <A>. <PM> is the
|
||||
//! meridian in the XZ plane.
|
||||
Standard_EXPORT BRepPrim_Revolution(const gp_Ax2& A, const Standard_Real VMin, const Standard_Real VMax, const Handle(Geom_Curve)& M, const Handle(Geom2d_Curve)& PM);
|
||||
|
||||
//! The surface normal should be directed towards the
|
||||
//! outside.
|
||||
Standard_EXPORT virtual TopoDS_Face MakeEmptyLateralFace() const;
|
||||
|
||||
//! Returns an edge with a 3D curve made from the
|
||||
//! meridian in the XZ plane rotated by <Ang> around
|
||||
//! the Z-axis. Ang may be 0 or myAngle.
|
||||
Standard_EXPORT virtual TopoDS_Edge MakeEmptyMeridianEdge (const Standard_Real Ang) const;
|
||||
|
||||
//! Returns the meridian point at parameter <V> in the
|
||||
//! plane XZ.
|
||||
Standard_EXPORT virtual gp_Pnt2d MeridianValue (const Standard_Real V) const;
|
||||
|
||||
//! Sets the parametric urve of the edge <E> in the
|
||||
//! face <F> to be the 2d representation of the
|
||||
//! meridian.
|
||||
Standard_EXPORT virtual void SetMeridianPCurve (TopoDS_Edge& E, const TopoDS_Face& F) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
//! Create a revolution body. The meridian is set
|
||||
//! later. Reserved for derivated classes.
|
||||
Standard_EXPORT BRepPrim_Revolution(const gp_Ax2& A, const Standard_Real VMin, const Standard_Real VMax);
|
||||
|
||||
Standard_EXPORT void Meridian (const Handle(Geom_Curve)& M, const Handle(Geom2d_Curve)& PM);
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Handle(Geom_Curve) myMeridian;
|
||||
Handle(Geom2d_Curve) myPMeridian;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepPrim_Revolution_HeaderFile
|
@@ -1,62 +0,0 @@
|
||||
-- Created on: 1992-11-05
|
||||
-- Created by: Remi LEQUETTE
|
||||
-- Copyright (c) 1992-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 Sphere from BRepPrim inherits Revolution from BRepPrim
|
||||
|
||||
---Purpose: Implements the sphere primitive
|
||||
|
||||
uses
|
||||
Face from TopoDS,
|
||||
|
||||
Pnt from gp,
|
||||
Ax2 from gp
|
||||
|
||||
raises
|
||||
DomainError
|
||||
|
||||
is
|
||||
|
||||
Create(Radius : Real)
|
||||
returns Sphere from BRepPrim
|
||||
---Purpose: Creates a Sphere at origin with Radius. The axes
|
||||
-- of the sphere are the reference axes. An error is
|
||||
-- raised if the radius is < Resolution.
|
||||
raises DomainError;
|
||||
|
||||
Create(Center : Pnt from gp; Radius : Real)
|
||||
returns Sphere from BRepPrim
|
||||
---Purpose: Creates a Sphere with Center and Radius. Axes are
|
||||
-- the referrence axes. This is the STEP
|
||||
-- constructor.
|
||||
raises DomainError;
|
||||
|
||||
Create(Axes : Ax2 from gp; Radius : Real)
|
||||
returns Sphere from BRepPrim
|
||||
---Purpose: Creates a sphere with given axes system.
|
||||
raises DomainError;
|
||||
|
||||
MakeEmptyLateralFace(me) returns Face from TopoDS
|
||||
---Purpose: The surface normal should be directed towards the
|
||||
-- outside.
|
||||
is redefined;
|
||||
|
||||
SetMeridian(me : in out)
|
||||
is static private;
|
||||
|
||||
fields
|
||||
myRadius : Real;
|
||||
|
||||
end Sphere;
|
@@ -14,18 +14,20 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BRepPrim_Sphere.ixx>
|
||||
|
||||
#include <gp.hxx>
|
||||
#include <gp_Ax2d.hxx>
|
||||
#include <Precision.hxx>
|
||||
|
||||
#include <Geom_SphericalSurface.hxx>
|
||||
#include <Geom_Circle.hxx>
|
||||
#include <BRepPrim_Sphere.hxx>
|
||||
#include <Geom2d_Circle.hxx>
|
||||
#include <Geom_Circle.hxx>
|
||||
#include <Geom_SphericalSurface.hxx>
|
||||
#include <gp.hxx>
|
||||
#include <gp_Ax2.hxx>
|
||||
#include <gp_Ax2d.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
|
||||
// parameters on the meridian
|
||||
|
||||
#define PMIN (-0.5*M_PI)
|
||||
#define PMAX (0.5*M_PI)
|
||||
|
||||
|
83
src/BRepPrim/BRepPrim_Sphere.hxx
Normal file
83
src/BRepPrim/BRepPrim_Sphere.hxx
Normal file
@@ -0,0 +1,83 @@
|
||||
// Created on: 1992-11-05
|
||||
// Created by: Remi LEQUETTE
|
||||
// Copyright (c) 1992-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 _BRepPrim_Sphere_HeaderFile
|
||||
#define _BRepPrim_Sphere_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
#include <BRepPrim_Revolution.hxx>
|
||||
class Standard_DomainError;
|
||||
class gp_Pnt;
|
||||
class gp_Ax2;
|
||||
class TopoDS_Face;
|
||||
|
||||
|
||||
//! Implements the sphere primitive
|
||||
class BRepPrim_Sphere : public BRepPrim_Revolution
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Creates a Sphere at origin with Radius. The axes
|
||||
//! of the sphere are the reference axes. An error is
|
||||
//! raised if the radius is < Resolution.
|
||||
Standard_EXPORT BRepPrim_Sphere(const Standard_Real Radius);
|
||||
|
||||
//! Creates a Sphere with Center and Radius. Axes are
|
||||
//! the referrence axes. This is the STEP
|
||||
//! constructor.
|
||||
Standard_EXPORT BRepPrim_Sphere(const gp_Pnt& Center, const Standard_Real Radius);
|
||||
|
||||
//! Creates a sphere with given axes system.
|
||||
Standard_EXPORT BRepPrim_Sphere(const gp_Ax2& Axes, const Standard_Real Radius);
|
||||
|
||||
//! The surface normal should be directed towards the
|
||||
//! outside.
|
||||
Standard_EXPORT virtual TopoDS_Face MakeEmptyLateralFace() const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void SetMeridian();
|
||||
|
||||
|
||||
Standard_Real myRadius;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepPrim_Sphere_HeaderFile
|
@@ -1,63 +0,0 @@
|
||||
-- Created on: 1992-11-05
|
||||
-- Created by: Remi LEQUETTE
|
||||
-- Copyright (c) 1992-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 Torus from BRepPrim inherits Revolution from BRepPrim
|
||||
|
||||
---Purpose: Implements the torus primitive
|
||||
|
||||
uses
|
||||
Face from TopoDS,
|
||||
|
||||
Pnt from gp,
|
||||
Ax2 from gp
|
||||
|
||||
raises
|
||||
DomainError
|
||||
|
||||
is
|
||||
Create(Position : Ax2 from gp; Major : Real; Minor : Real)
|
||||
returns Torus from BRepPrim
|
||||
---Purpose: the STEP definition
|
||||
-- Position : center and axes
|
||||
-- Major, Minor : Radii
|
||||
--
|
||||
-- Errors : Major < Resolution
|
||||
-- Minor < Resolution
|
||||
raises DomainError;
|
||||
|
||||
Create(Major,Minor : Real)
|
||||
returns Torus from BRepPrim
|
||||
---Purpose: Torus centered at origin
|
||||
raises DomainError;
|
||||
|
||||
Create(Center : Pnt from gp; Major, Minor : Real)
|
||||
returns Torus from BRepPrim
|
||||
---Purpose: Torus at Center
|
||||
raises DomainError;
|
||||
|
||||
MakeEmptyLateralFace(me) returns Face from TopoDS
|
||||
---Purpose: The surface normal should be directed towards the
|
||||
-- outside.
|
||||
is redefined;
|
||||
|
||||
SetMeridian(me : in out)
|
||||
is static private;
|
||||
|
||||
fields
|
||||
myMajor : Real;
|
||||
myMinor : Real;
|
||||
|
||||
end Torus;
|
@@ -14,22 +14,24 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BRepPrim_Torus.ixx>
|
||||
|
||||
#include <gp.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp_Ax2d.hxx>
|
||||
#include <Precision.hxx>
|
||||
|
||||
#include <Geom_ToroidalSurface.hxx>
|
||||
#include <Geom_Circle.hxx>
|
||||
#include <BRepPrim_Torus.hxx>
|
||||
#include <Geom2d_Circle.hxx>
|
||||
#include <Geom_Circle.hxx>
|
||||
#include <Geom_ToroidalSurface.hxx>
|
||||
#include <gp.hxx>
|
||||
#include <gp_Ax2.hxx>
|
||||
#include <gp_Ax2d.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : BRepPrim_Torus
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
BRepPrim_Torus::BRepPrim_Torus(const gp_Ax2& Position,
|
||||
const Standard_Real Major,
|
||||
const Standard_Real Minor) :
|
||||
|
85
src/BRepPrim/BRepPrim_Torus.hxx
Normal file
85
src/BRepPrim/BRepPrim_Torus.hxx
Normal file
@@ -0,0 +1,85 @@
|
||||
// Created on: 1992-11-05
|
||||
// Created by: Remi LEQUETTE
|
||||
// Copyright (c) 1992-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 _BRepPrim_Torus_HeaderFile
|
||||
#define _BRepPrim_Torus_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
#include <BRepPrim_Revolution.hxx>
|
||||
class Standard_DomainError;
|
||||
class gp_Ax2;
|
||||
class gp_Pnt;
|
||||
class TopoDS_Face;
|
||||
|
||||
|
||||
//! Implements the torus primitive
|
||||
class BRepPrim_Torus : public BRepPrim_Revolution
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! the STEP definition
|
||||
//! Position : center and axes
|
||||
//! Major, Minor : Radii
|
||||
//!
|
||||
//! Errors : Major < Resolution
|
||||
//! Minor < Resolution
|
||||
Standard_EXPORT BRepPrim_Torus(const gp_Ax2& Position, const Standard_Real Major, const Standard_Real Minor);
|
||||
|
||||
//! Torus centered at origin
|
||||
Standard_EXPORT BRepPrim_Torus(const Standard_Real Major, const Standard_Real Minor);
|
||||
|
||||
//! Torus at Center
|
||||
Standard_EXPORT BRepPrim_Torus(const gp_Pnt& Center, const Standard_Real Major, const Standard_Real Minor);
|
||||
|
||||
//! The surface normal should be directed towards the
|
||||
//! outside.
|
||||
Standard_EXPORT virtual TopoDS_Face MakeEmptyLateralFace() const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void SetMeridian();
|
||||
|
||||
|
||||
Standard_Real myMajor;
|
||||
Standard_Real myMinor;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepPrim_Torus_HeaderFile
|
@@ -1,72 +0,0 @@
|
||||
-- Created on: 1995-01-09
|
||||
-- Created by: Modelistation
|
||||
-- Copyright (c) 1995-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class Wedge from BRepPrim inherits GWedge from BRepPrim
|
||||
|
||||
---Purpose: Provides constructors without Builders.
|
||||
|
||||
uses
|
||||
Ax2 from gp,
|
||||
Pnt from gp
|
||||
|
||||
raises
|
||||
DomainError
|
||||
|
||||
is
|
||||
|
||||
Create(Axes : Ax2 from gp; dx, dy, dz : Real)
|
||||
returns Wedge from BRepPrim
|
||||
---Purpose: Creates a Wedge algorithm. <Axes> is the axis
|
||||
-- system for the primitive.
|
||||
--
|
||||
-- XMin, YMin, ZMin are set to 0
|
||||
-- XMax, YMax, ZMax are set to dx, dy, dz
|
||||
-- Z2Min = ZMin
|
||||
-- Z2Max = ZMax
|
||||
-- X2Min = XMin
|
||||
-- X2Max = XMax
|
||||
-- The result is a box
|
||||
-- dx,dy,dz should be positive
|
||||
raises DomainError;
|
||||
|
||||
Create(Axes : Ax2 from gp; dx, dy, dz, ltx : Real)
|
||||
returns Wedge from BRepPrim
|
||||
---Purpose: Creates a Wedge primitive. <Axes> is the axis
|
||||
-- system for the primitive.
|
||||
--
|
||||
-- XMin, YMin, ZMin are set to 0
|
||||
-- XMax, YMax, ZMax are set to dx, dy, dz
|
||||
-- Z2Min = ZMin
|
||||
-- Z2Max = ZMax
|
||||
-- X2Min = ltx
|
||||
-- X2Max = ltx
|
||||
-- The result is a STEP right angular wedge
|
||||
-- dx,dy,dz should be positive
|
||||
-- ltx should not be negative
|
||||
raises DomainError;
|
||||
|
||||
Create(Axes : Ax2 from gp; xmin, ymin, zmin, z2min, x2min,
|
||||
xmax, ymax, zmax, z2max, x2max : Real)
|
||||
returns Wedge from BRepPrim
|
||||
---Purpose: Create a Wedge primitive. <Axes> is the axis
|
||||
-- system for the primitive.
|
||||
--
|
||||
-- all the fields are set to the corresponding value
|
||||
-- XYZMax - XYZMin should be positive
|
||||
-- ZX2Max - ZX2Min should not be negative
|
||||
raises DomainError;
|
||||
|
||||
end Wedge;
|
@@ -14,15 +14,15 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BRepPrim_Wedge.ixx>
|
||||
|
||||
|
||||
#include <BRepPrim_Wedge.hxx>
|
||||
#include <gp_Ax2.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : BRepPrim_Wedge
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
BRepPrim_Wedge::BRepPrim_Wedge(const gp_Ax2& Axes, const Standard_Real dx, const Standard_Real dy, const Standard_Real dz) :
|
||||
BRepPrim_GWedge(BRepPrim_Builder(),Axes,dx,dy,dz)
|
||||
{
|
||||
|
96
src/BRepPrim/BRepPrim_Wedge.hxx
Normal file
96
src/BRepPrim/BRepPrim_Wedge.hxx
Normal file
@@ -0,0 +1,96 @@
|
||||
// Created on: 1995-01-09
|
||||
// Created by: Modelistation
|
||||
// Copyright (c) 1995-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _BRepPrim_Wedge_HeaderFile
|
||||
#define _BRepPrim_Wedge_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <BRepPrim_GWedge.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
class Standard_DomainError;
|
||||
class gp_Ax2;
|
||||
|
||||
|
||||
//! Provides constructors without Builders.
|
||||
class BRepPrim_Wedge : public BRepPrim_GWedge
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Creates a Wedge algorithm. <Axes> is the axis
|
||||
//! system for the primitive.
|
||||
//!
|
||||
//! XMin, YMin, ZMin are set to 0
|
||||
//! XMax, YMax, ZMax are set to dx, dy, dz
|
||||
//! Z2Min = ZMin
|
||||
//! Z2Max = ZMax
|
||||
//! X2Min = XMin
|
||||
//! X2Max = XMax
|
||||
//! The result is a box
|
||||
//! dx,dy,dz should be positive
|
||||
Standard_EXPORT BRepPrim_Wedge(const gp_Ax2& Axes, const Standard_Real dx, const Standard_Real dy, const Standard_Real dz);
|
||||
|
||||
//! Creates a Wedge primitive. <Axes> is the axis
|
||||
//! system for the primitive.
|
||||
//!
|
||||
//! XMin, YMin, ZMin are set to 0
|
||||
//! XMax, YMax, ZMax are set to dx, dy, dz
|
||||
//! Z2Min = ZMin
|
||||
//! Z2Max = ZMax
|
||||
//! X2Min = ltx
|
||||
//! X2Max = ltx
|
||||
//! The result is a STEP right angular wedge
|
||||
//! dx,dy,dz should be positive
|
||||
//! ltx should not be negative
|
||||
Standard_EXPORT BRepPrim_Wedge(const gp_Ax2& Axes, const Standard_Real dx, const Standard_Real dy, const Standard_Real dz, const Standard_Real ltx);
|
||||
|
||||
//! Create a Wedge primitive. <Axes> is the axis
|
||||
//! system for the primitive.
|
||||
//!
|
||||
//! all the fields are set to the corresponding value
|
||||
//! XYZMax - XYZMin should be positive
|
||||
//! ZX2Max - ZX2Min should not be negative
|
||||
Standard_EXPORT BRepPrim_Wedge(const gp_Ax2& Axes, const Standard_Real xmin, const Standard_Real ymin, const Standard_Real zmin, const Standard_Real z2min, const Standard_Real x2min, const Standard_Real xmax, const Standard_Real ymax, const Standard_Real zmax, const Standard_Real z2max, const Standard_Real x2max);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepPrim_Wedge_HeaderFile
|
22
src/BRepPrim/FILES
Normal file
22
src/BRepPrim/FILES
Normal file
@@ -0,0 +1,22 @@
|
||||
BRepPrim_Builder.cxx
|
||||
BRepPrim_Builder.hxx
|
||||
BRepPrim_Builder.lxx
|
||||
BRepPrim_Cone.cxx
|
||||
BRepPrim_Cone.hxx
|
||||
BRepPrim_Cylinder.cxx
|
||||
BRepPrim_Cylinder.hxx
|
||||
BRepPrim_Direction.hxx
|
||||
BRepPrim_FaceBuilder.cxx
|
||||
BRepPrim_FaceBuilder.hxx
|
||||
BRepPrim_GWedge.cxx
|
||||
BRepPrim_GWedge.hxx
|
||||
BRepPrim_OneAxis.cxx
|
||||
BRepPrim_OneAxis.hxx
|
||||
BRepPrim_Revolution.cxx
|
||||
BRepPrim_Revolution.hxx
|
||||
BRepPrim_Sphere.cxx
|
||||
BRepPrim_Sphere.hxx
|
||||
BRepPrim_Torus.cxx
|
||||
BRepPrim_Torus.hxx
|
||||
BRepPrim_Wedge.cxx
|
||||
BRepPrim_Wedge.hxx
|
Reference in New Issue
Block a user