1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-24 13:50:49 +03:00

0024002: Overall code and build procedure refactoring -- automatic

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

View File

@@ -1,232 +0,0 @@
-- Created on: 1992-12-04
-- Created by: Isabelle GRIGNON
-- 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.
package BRepGProp
---Purpose: Provides global functions to compute a shape's global
-- properties for lines, surfaces or volumes, and bring
-- them together with the global properties already
-- computed for a geometric system.
-- The global properties computed for a system are :
-- - its mass,
-- - its center of mass,
-- - its matrix of inertia,
-- - its moment about an axis,
-- - its radius of gyration about an axis,
-- - and its principal properties of inertia such as
-- principal axis, principal moments, principal radius of gyration.
uses GProp,
BRepAdaptor,
BRepTools,
BRep,
TopExp,
TopoDS,
Geom2dAdaptor,
gp,
GeomAbs,
TColStd
is
class EdgeTool;
class Face;
class Domain;
class Cinert;
class Sinert;
class Vinert;
class VinertGK;
class UFunction;
class TFunction;
--
-- Package methods to compute global properties.
--
LinearProperties(S : Shape from TopoDS; LProps : in out GProps from GProp);
---Purpose: Computes the linear global properties of the shape S,
-- i.e. the global properties induced by each edge of the
-- shape S, and brings them together with the global
-- properties still retained by the framework LProps. If
-- the current system of LProps was empty, its global
-- properties become equal to the linear global
-- properties of S.
-- For this computation no linear density is attached to
-- the edges. So, for example, the added mass
-- corresponds to the sum of the lengths of the edges of
-- S. The density of the composed systems, i.e. that of
-- each component of the current system of LProps, and
-- that of S which is considered to be equal to 1, must be coherent.
-- Note that this coherence cannot be checked. You are
-- advised to use a separate framework for each
-- density, and then to bring these frameworks together
-- into a global one.
-- The point relative to which the inertia of the system is
-- computed is the reference point of the framework LProps.
-- Note: if your programming ensures that the framework
-- LProps retains only linear global properties (brought
-- together for example, by the function
-- LinearProperties) for objects the density of which is
-- equal to 1 (or is not defined), the function Mass will
-- return the total length of edges of the system analysed by LProps.
-- Warning
-- No check is performed to verify that the shape S
-- retains truly linear properties. If S is simply a vertex, it
-- is not considered to present any additional global properties.
SurfaceProperties(S : Shape from TopoDS; SProps : in out GProps from GProp);
---Purpose: Computes the surface global properties of the
-- shape S, i.e. the global properties induced by each
-- face of the shape S, and brings them together with
-- the global properties still retained by the framework
-- SProps. If the current system of SProps was empty,
-- its global properties become equal to the surface
-- global properties of S.
-- For this computation, no surface density is attached
-- to the faces. Consequently, the added mass
-- corresponds to the sum of the areas of the faces of
-- S. The density of the component systems, i.e. that
-- of each component of the current system of
-- SProps, and that of S which is considered to be
-- equal to 1, must be coherent.
-- Note that this coherence cannot be checked. You
-- are advised to use a framework for each different
-- value of density, and then to bring these
-- frameworks together into a global one.
-- The point relative to which the inertia of the system
-- is computed is the reference point of the framework SProps.
-- Note : if your programming ensures that the
-- framework SProps retains only surface global
-- properties, brought together, for example, by the
-- function SurfaceProperties, for objects the density
-- of which is equal to 1 (or is not defined), the
-- function Mass will return the total area of faces of
-- the system analysed by SProps.
-- Warning
-- No check is performed to verify that the shape S
-- retains truly surface properties. If S is simply a
-- vertex, an edge or a wire, it is not considered to
-- present any additional global properties.
SurfaceProperties(S : Shape from TopoDS; SProps : in out GProps from GProp;
Eps: Real) returns Real;
---Purpose: Updates <SProps> with the shape <S>, that contains its pricipal properties.
-- The surface properties of all the faces in <S> are computed.
-- Adaptive 2D Gauss integration is used.
-- Parameter Eps sets maximal relative error of computed mass (area) for each face.
-- Error is calculated as Abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values
-- for two successive steps of adaptive integration.
-- Method returns estimation of relative error reached for whole shape.
-- WARNING: if Eps > 0.001 algorithm performs non-adaptive integration.
------------------------
-- VolumeProperties --
------------------------
---Purpose:
-- Computes the global volume properties of the solid
-- S, and brings them together with the global
-- properties still retained by the framework VProps. If
-- the current system of VProps was empty, its global
-- properties become equal to the global properties of S for volume.
-- For this computation, no volume density is attached
-- to the solid. Consequently, the added mass
-- corresponds to the volume of S. The density of the
-- component systems, i.e. that of each component of
-- the current system of VProps, and that of S which
-- is considered to be equal to 1, must be coherent to each other.
-- Note that this coherence cannot be checked. You
-- are advised to use a separate framework for each
-- density, and then to bring these frameworks
-- together into a global one.
-- The point relative to which the inertia of the system
-- is computed is the reference point of the framework VProps.
-- Note: if your programming ensures that the
-- framework VProps retains only global properties of
-- volume (brought together for example, by the
-- function VolumeProperties) for objects the density
-- of which is equal to 1 (or is not defined), the
-- function Mass will return the total volume of the
-- solids of the system analysed by VProps.
-- Warning
-- The shape S must represent an object whose
-- global volume properties can be computed. It may
-- be a finite solid, or a series of finite solids all
-- oriented in a coherent way. Nonetheless, S must be
-- exempt of any free boundary. Note that these
-- conditions of coherence are not checked by this
-- algorithm, and results will be false if they are not respected.
VolumeProperties(S : Shape from TopoDS; VProps : in out GProps from GProp;
OnlyClosed: Boolean = Standard_False);
VolumeProperties(S : Shape from TopoDS; VProps : in out GProps from GProp;
Eps: Real; OnlyClosed: Boolean = Standard_False) returns Real;
---Purpose: Updates <VProps> with the shape <S>, that contains its pricipal properties.
-- The volume properties of all the FORWARD and REVERSED faces in <S> are computed.
-- If OnlyClosed is True then computed faces must belong to closed Shells.
-- Adaptive 2D Gauss integration is used.
-- Parameter Eps sets maximal relative error of computed mass (volume) for each face.
-- Error is calculated as Abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values
-- for two successive steps of adaptive integration.
-- Method returns estimation of relative error reached for whole shape.
-- WARNING: if Eps > 0.001 algorithm performs non-adaptive integration.
-- ----------------------------------------------------------------------------------------
VolumePropertiesGK(S : Shape from TopoDS;
VProps : in out GProps from GProp;
Eps : Real from Standard = 0.001;
OnlyClosed: Boolean from Standard = Standard_False;
IsUseSpan : Boolean from Standard = Standard_False;
CGFlag : Boolean from Standard = Standard_False;
IFlag : Boolean from Standard = Standard_False)
returns Real;
---Purpose: Updates <VProps> with the shape <S>, that contains its pricipal properties.
-- The volume properties of all the FORWARD and REVERSED faces in <S> are computed.
-- If OnlyClosed is True then computed faces must belong to closed Shells.
-- Adaptive 2D Gauss integration is used.
-- Parameter IsUseSpan says if it is necessary to define spans on a face.
-- This option has an effect only for BSpline faces.
-- Parameter Eps sets maximal relative error of computed property for each face.
-- Error is delivered by the adaptive Gauss-Kronrod method of integral computation
-- that is used for properties computation.
-- Method returns estimation of relative error reached for whole shape.
-- Returns negative value if the computation is failed.
VolumePropertiesGK(S : Shape from TopoDS;
VProps : in out GProps from GProp;
thePln: Pln from gp;
Eps : Real from Standard = 0.001;
OnlyClosed: Boolean from Standard = Standard_False;
IsUseSpan : Boolean from Standard = Standard_False;
CGFlag : Boolean from Standard = Standard_False;
IFlag : Boolean from Standard = Standard_False)
returns Real;
end BRepGProp;

227
src/BRepGProp/BRepGProp.hxx Normal file
View File

@@ -0,0 +1,227 @@
// Created on: 1992-12-04
// Created by: Isabelle GRIGNON
// 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 _BRepGProp_HeaderFile
#define _BRepGProp_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Real.hxx>
#include <Standard_Boolean.hxx>
class TopoDS_Shape;
class GProp_GProps;
class gp_Pln;
class BRepGProp_EdgeTool;
class BRepGProp_Face;
class BRepGProp_Domain;
class BRepGProp_Cinert;
class BRepGProp_Sinert;
class BRepGProp_Vinert;
class BRepGProp_VinertGK;
class BRepGProp_UFunction;
class BRepGProp_TFunction;
//! Provides global functions to compute a shape's global
//! properties for lines, surfaces or volumes, and bring
//! them together with the global properties already
//! computed for a geometric system.
//! The global properties computed for a system are :
//! - its mass,
//! - its center of mass,
//! - its matrix of inertia,
//! - its moment about an axis,
//! - its radius of gyration about an axis,
//! - and its principal properties of inertia such as
//! principal axis, principal moments, principal radius of gyration.
class BRepGProp
{
public:
DEFINE_STANDARD_ALLOC
//! Computes the linear global properties of the shape S,
//! i.e. the global properties induced by each edge of the
//! shape S, and brings them together with the global
//! properties still retained by the framework LProps. If
//! the current system of LProps was empty, its global
//! properties become equal to the linear global
//! properties of S.
//! For this computation no linear density is attached to
//! the edges. So, for example, the added mass
//! corresponds to the sum of the lengths of the edges of
//! S. The density of the composed systems, i.e. that of
//! each component of the current system of LProps, and
//! that of S which is considered to be equal to 1, must be coherent.
//! Note that this coherence cannot be checked. You are
//! advised to use a separate framework for each
//! density, and then to bring these frameworks together
//! into a global one.
//! The point relative to which the inertia of the system is
//! computed is the reference point of the framework LProps.
//! Note: if your programming ensures that the framework
//! LProps retains only linear global properties (brought
//! together for example, by the function
//! LinearProperties) for objects the density of which is
//! equal to 1 (or is not defined), the function Mass will
//! return the total length of edges of the system analysed by LProps.
//! Warning
//! No check is performed to verify that the shape S
//! retains truly linear properties. If S is simply a vertex, it
//! is not considered to present any additional global properties.
Standard_EXPORT static void LinearProperties (const TopoDS_Shape& S, GProp_GProps& LProps);
//! Computes the surface global properties of the
//! shape S, i.e. the global properties induced by each
//! face of the shape S, and brings them together with
//! the global properties still retained by the framework
//! SProps. If the current system of SProps was empty,
//! its global properties become equal to the surface
//! global properties of S.
//! For this computation, no surface density is attached
//! to the faces. Consequently, the added mass
//! corresponds to the sum of the areas of the faces of
//! S. The density of the component systems, i.e. that
//! of each component of the current system of
//! SProps, and that of S which is considered to be
//! equal to 1, must be coherent.
//! Note that this coherence cannot be checked. You
//! are advised to use a framework for each different
//! value of density, and then to bring these
//! frameworks together into a global one.
//! The point relative to which the inertia of the system
//! is computed is the reference point of the framework SProps.
//! Note : if your programming ensures that the
//! framework SProps retains only surface global
//! properties, brought together, for example, by the
//! function SurfaceProperties, for objects the density
//! of which is equal to 1 (or is not defined), the
//! function Mass will return the total area of faces of
//! the system analysed by SProps.
//! Warning
//! No check is performed to verify that the shape S
//! retains truly surface properties. If S is simply a
//! vertex, an edge or a wire, it is not considered to
//! present any additional global properties.
Standard_EXPORT static void SurfaceProperties (const TopoDS_Shape& S, GProp_GProps& SProps);
//! Updates <SProps> with the shape <S>, that contains its pricipal properties.
//! The surface properties of all the faces in <S> are computed.
//! Adaptive 2D Gauss integration is used.
//! Parameter Eps sets maximal relative error of computed mass (area) for each face.
//! Error is calculated as Abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values
//! for two successive steps of adaptive integration.
//! Method returns estimation of relative error reached for whole shape.
//! WARNING: if Eps > 0.001 algorithm performs non-adaptive integration.
//!
//! Computes the global volume properties of the solid
//! S, and brings them together with the global
//! properties still retained by the framework VProps. If
//! the current system of VProps was empty, its global
//! properties become equal to the global properties of S for volume.
//! For this computation, no volume density is attached
//! to the solid. Consequently, the added mass
//! corresponds to the volume of S. The density of the
//! component systems, i.e. that of each component of
//! the current system of VProps, and that of S which
//! is considered to be equal to 1, must be coherent to each other.
//! Note that this coherence cannot be checked. You
//! are advised to use a separate framework for each
//! density, and then to bring these frameworks
//! together into a global one.
//! The point relative to which the inertia of the system
//! is computed is the reference point of the framework VProps.
//! Note: if your programming ensures that the
//! framework VProps retains only global properties of
//! volume (brought together for example, by the
//! function VolumeProperties) for objects the density
//! of which is equal to 1 (or is not defined), the
//! function Mass will return the total volume of the
//! solids of the system analysed by VProps.
//! Warning
//! The shape S must represent an object whose
//! global volume properties can be computed. It may
//! be a finite solid, or a series of finite solids all
//! oriented in a coherent way. Nonetheless, S must be
//! exempt of any free boundary. Note that these
//! conditions of coherence are not checked by this
//! algorithm, and results will be false if they are not respected.
Standard_EXPORT static Standard_Real SurfaceProperties (const TopoDS_Shape& S, GProp_GProps& SProps, const Standard_Real Eps);
Standard_EXPORT static void VolumeProperties (const TopoDS_Shape& S, GProp_GProps& VProps, const Standard_Boolean OnlyClosed = Standard_False);
//! Updates <VProps> with the shape <S>, that contains its pricipal properties.
//! The volume properties of all the FORWARD and REVERSED faces in <S> are computed.
//! If OnlyClosed is True then computed faces must belong to closed Shells.
//! Adaptive 2D Gauss integration is used.
//! Parameter Eps sets maximal relative error of computed mass (volume) for each face.
//! Error is calculated as Abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values
//! for two successive steps of adaptive integration.
//! Method returns estimation of relative error reached for whole shape.
//! WARNING: if Eps > 0.001 algorithm performs non-adaptive integration.
Standard_EXPORT static Standard_Real VolumeProperties (const TopoDS_Shape& S, GProp_GProps& VProps, const Standard_Real Eps, const Standard_Boolean OnlyClosed = Standard_False);
//! Updates <VProps> with the shape <S>, that contains its pricipal properties.
//! The volume properties of all the FORWARD and REVERSED faces in <S> are computed.
//! If OnlyClosed is True then computed faces must belong to closed Shells.
//! Adaptive 2D Gauss integration is used.
//! Parameter IsUseSpan says if it is necessary to define spans on a face.
//! This option has an effect only for BSpline faces.
//! Parameter Eps sets maximal relative error of computed property for each face.
//! Error is delivered by the adaptive Gauss-Kronrod method of integral computation
//! that is used for properties computation.
//! Method returns estimation of relative error reached for whole shape.
//! Returns negative value if the computation is failed.
Standard_EXPORT static Standard_Real VolumePropertiesGK (const TopoDS_Shape& S, GProp_GProps& VProps, const Standard_Real Eps = 0.001, const Standard_Boolean OnlyClosed = Standard_False, const Standard_Boolean IsUseSpan = Standard_False, const Standard_Boolean CGFlag = Standard_False, const Standard_Boolean IFlag = Standard_False);
Standard_EXPORT static Standard_Real VolumePropertiesGK (const TopoDS_Shape& S, GProp_GProps& VProps, const gp_Pln& thePln, const Standard_Real Eps = 0.001, const Standard_Boolean OnlyClosed = Standard_False, const Standard_Boolean IsUseSpan = Standard_False, const Standard_Boolean CGFlag = Standard_False, const Standard_Boolean IFlag = Standard_False);
protected:
private:
friend class BRepGProp_EdgeTool;
friend class BRepGProp_Face;
friend class BRepGProp_Domain;
friend class BRepGProp_Cinert;
friend class BRepGProp_Sinert;
friend class BRepGProp_Vinert;
friend class BRepGProp_VinertGK;
friend class BRepGProp_UFunction;
friend class BRepGProp_TFunction;
};
#endif // _BRepGProp_HeaderFile

View File

@@ -1,46 +0,0 @@
-- Created on: 1991-04-11
-- Created by: Michel CHAUVAT
-- 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.
-- Jean-Claude Vauthier January 1992, September 1992
class Cinert from BRepGProp inherits GProps from GProp
--- Purpose :
-- Computes the global properties of bounded curves
-- in 3D space. The curve must have at least a continuity C1.
-- It can be a curve as defined in the template CurveTool from
-- package GProp. This template gives the minimum of methods
-- required to evaluate the global properties of a curve 3D with
-- the algorithmes of GProp.
uses Pnt from gp,
Curve from BRepAdaptor,
EdgeTool from BRepGProp
is
Create returns Cinert;
Create (C : Curve from BRepAdaptor; CLocation : Pnt) returns Cinert;
SetLocation(me : in out;CLocation : Pnt) ;
Perform(me : in out; C : Curve from BRepAdaptor);
end Cinert;

View File

@@ -12,11 +12,13 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepGProp_Cinert.ixx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepGProp_Cinert.hxx>
#include <BRepGProp_EdgeTool.hxx>
#include <gp_Pnt.hxx>
#include <math.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <BRepGProp_EdgeTool.hxx>
BRepGProp_Cinert::BRepGProp_Cinert(){}

View File

@@ -0,0 +1,74 @@
// Created on: 1991-04-11
// Created by: Michel CHAUVAT
// 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 _BRepGProp_Cinert_HeaderFile
#define _BRepGProp_Cinert_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <GProp_GProps.hxx>
class BRepAdaptor_Curve;
class gp_Pnt;
//! Computes the global properties of bounded curves
//! in 3D space. The curve must have at least a continuity C1.
//! It can be a curve as defined in the template CurveTool from
//! package GProp. This template gives the minimum of methods
//! required to evaluate the global properties of a curve 3D with
//! the algorithmes of GProp.
class BRepGProp_Cinert : public GProp_GProps
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepGProp_Cinert();
Standard_EXPORT BRepGProp_Cinert(const BRepAdaptor_Curve& C, const gp_Pnt& CLocation);
Standard_EXPORT void SetLocation (const gp_Pnt& CLocation);
Standard_EXPORT void Perform (const BRepAdaptor_Curve& C);
protected:
private:
};
#endif // _BRepGProp_Cinert_HeaderFile

View File

@@ -1,70 +0,0 @@
-- Created on: 1992-11-27
-- Created by: Isabelle GRIGNON
-- 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 Domain from BRepGProp
---Purpose: Arc iterator. Returns only Forward and Reversed edges from
-- the face in an undigested order.
uses Face from TopoDS,
Edge from TopoDS,
Explorer from TopExp
is
Create returns Domain;
--- Purpose : Empty constructor.
---C++: inline
Create (F : Face from TopoDS) returns Domain;
--- Purpose : Constructor. Initializes the domain with the face.
---C++: inline
Init(me : in out;F : Face from TopoDS);
--- Purpose : Initializes the domain with the face.
---C++: inline
More(me : in out) returns Boolean from Standard
--- Purpose :
-- Returns True if there is another arc of curve in the list.
---C++: inline
is static;
Init(me : in out)
--- Purpose : Initializes the exploration with the face already set.
---C++: inline
is static;
Value(me : in out) returns Edge from TopoDS
---Purpose: Returns the current edge.
---C++: return const &
---C++: inline
is static;
Next(me : in out)
--- Purpose :
-- Sets the index of the arc iterator to the next arc of
-- curve.
is static;
fields
myExplorer : Explorer from TopExp;
end Domain;

View File

@@ -14,13 +14,15 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepGProp_Domain.ixx>
#include <BRepGProp_Domain.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
//=======================================================================
//function : Next
//purpose : Sets the index of the arc iterator to the next arc of curve.
//=======================================================================
void BRepGProp_Domain::Next () {
// skip INTERNAL and EXTERNAL edges

View File

@@ -0,0 +1,88 @@
// Created on: 1992-11-27
// Created by: Isabelle GRIGNON
// 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 _BRepGProp_Domain_HeaderFile
#define _BRepGProp_Domain_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <TopExp_Explorer.hxx>
#include <Standard_Boolean.hxx>
class TopoDS_Face;
class TopoDS_Edge;
//! Arc iterator. Returns only Forward and Reversed edges from
//! the face in an undigested order.
class BRepGProp_Domain
{
public:
DEFINE_STANDARD_ALLOC
//! Empty constructor.
BRepGProp_Domain();
//! Constructor. Initializes the domain with the face.
BRepGProp_Domain(const TopoDS_Face& F);
//! Initializes the domain with the face.
void Init (const TopoDS_Face& F);
//! Returns True if there is another arc of curve in the list.
Standard_Boolean More();
//! Initializes the exploration with the face already set.
void Init();
//! Returns the current edge.
const TopoDS_Edge& Value();
//! Sets the index of the arc iterator to the next arc of
//! curve.
Standard_EXPORT void Next();
protected:
private:
TopExp_Explorer myExplorer;
};
#include <BRepGProp_Domain.lxx>
#endif // _BRepGProp_Domain_HeaderFile

View File

@@ -1,81 +0,0 @@
-- Created on: 1993-12-07
-- Created by: Modelistation
-- 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 EdgeTool from BRepGProp
--- Purpose : Provides the required methods to instantiate
-- CGProps from GProp with a Curve from BRepAdaptor.
uses Pnt from gp,
Vec from gp,
Curve from BRepAdaptor,
Shape from GeomAbs,
Array1OfReal from TColStd
raises
OutOfRange from Standard
is
FirstParameter (myclass; C : Curve from BRepAdaptor) returns Real;
--- Purpose :
-- Returns the parametric value of the start point of
-- the curve. The curve is oriented from the start point
-- to the end point.
LastParameter (myclass; C : Curve from BRepAdaptor) returns Real;
--- Purpose :
-- Returns the parametric value of the end point of
-- the curve. The curve is oriented from the start point
-- to the end point.
IntegrationOrder (myclass; C : Curve from BRepAdaptor) returns Integer;
--- Purpose :
-- Returns the number of Gauss points required to do
-- the integration with a good accuracy using the
-- Gauss method. For a polynomial curve of degree n
-- the maxima of accuracy is obtained with an order
-- of integration equal to 2*n-1.
Value (myclass; C : Curve from BRepAdaptor; U : Real) returns Pnt;
--- Purpose : Returns the point of parameter U on the loaded curve.
D1 (myclass; C : Curve from BRepAdaptor; U: Real; P: out Pnt; V1: out Vec);
--- Purpose :
-- Returns the point of parameter U and the first derivative
-- at this point.
NbIntervals(myclass; C : Curve from BRepAdaptor; S : Shape from GeomAbs)
---Purpose: Returns the number of intervals for continuity
-- <S>. May be one if Continuity(me) >= <S>
returns Integer;
Intervals(myclass; C : Curve from BRepAdaptor;
T : in out Array1OfReal from TColStd;
S : Shape from GeomAbs)
---Purpose: Stores in <T> the parameters bounding the intervals
-- of continuity <S>.
--
-- The array must provide enough room to accomodate
-- for the parameters. i.e. T.Length() > NbIntervals()
raises
OutOfRange from Standard;
end EdgeTool;

View File

@@ -12,11 +12,16 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepGProp_EdgeTool.ixx>
#include <GeomAdaptor_Curve.hxx>
#include <Geom_Curve.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepGProp_EdgeTool.hxx>
#include <Geom_BezierCurve.hxx>
#include <Geom_BSplineCurve.hxx>
#include <Geom_Curve.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <Standard_OutOfRange.hxx>
Standard_Real BRepGProp_EdgeTool::FirstParameter(const BRepAdaptor_Curve& C)
{

View File

@@ -0,0 +1,105 @@
// Created on: 1993-12-07
// Created by: Modelistation
// 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 _BRepGProp_EdgeTool_HeaderFile
#define _BRepGProp_EdgeTool_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Real.hxx>
#include <Standard_Integer.hxx>
#include <GeomAbs_Shape.hxx>
#include <TColStd_Array1OfReal.hxx>
class Standard_OutOfRange;
class BRepAdaptor_Curve;
class gp_Pnt;
class gp_Vec;
//! Provides the required methods to instantiate
//! CGProps from GProp with a Curve from BRepAdaptor.
class BRepGProp_EdgeTool
{
public:
DEFINE_STANDARD_ALLOC
//! Returns the parametric value of the start point of
//! the curve. The curve is oriented from the start point
//! to the end point.
Standard_EXPORT static Standard_Real FirstParameter (const BRepAdaptor_Curve& C);
//! Returns the parametric value of the end point of
//! the curve. The curve is oriented from the start point
//! to the end point.
Standard_EXPORT static Standard_Real LastParameter (const BRepAdaptor_Curve& C);
//! Returns the number of Gauss points required to do
//! the integration with a good accuracy using the
//! Gauss method. For a polynomial curve of degree n
//! the maxima of accuracy is obtained with an order
//! of integration equal to 2*n-1.
Standard_EXPORT static Standard_Integer IntegrationOrder (const BRepAdaptor_Curve& C);
//! Returns the point of parameter U on the loaded curve.
Standard_EXPORT static gp_Pnt Value (const BRepAdaptor_Curve& C, const Standard_Real U);
//! Returns the point of parameter U and the first derivative
//! at this point.
Standard_EXPORT static void D1 (const BRepAdaptor_Curve& C, const Standard_Real U, gp_Pnt& P, gp_Vec& V1);
//! Returns the number of intervals for continuity
//! <S>. May be one if Continuity(me) >= <S>
Standard_EXPORT static Standard_Integer NbIntervals (const BRepAdaptor_Curve& C, const GeomAbs_Shape S);
//! Stores in <T> the parameters bounding the intervals
//! of continuity <S>.
//!
//! The array must provide enough room to accomodate
//! for the parameters. i.e. T.Length() > NbIntervals()
Standard_EXPORT static void Intervals (const BRepAdaptor_Curve& C, TColStd_Array1OfReal& T, const GeomAbs_Shape S);
protected:
private:
};
#endif // _BRepGProp_EdgeTool_HeaderFile

View File

@@ -1,176 +0,0 @@
-- Created on: 1993-04-14
-- Created by: Isabelle GRIGNON
-- 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 Face from BRepGProp
uses Pnt2d from gp,
Vec2d from gp,
Pnt from gp,
Vec from gp,
Edge from TopoDS,
Face from TopoDS,
Surface from BRepAdaptor,
Curve from Geom2dAdaptor,
Array1OfReal from TColStd,
HArray1OfReal from TColStd,
IsoType from GeomAbs
is
Create (IsUseSpan: Boolean from Standard = Standard_False)
---Purpose: Constructor. Initializes the object with a flag IsUseSpan
-- that says if it is necessary to define spans on a face.
-- This option has an effect only for BSpline faces. Spans
-- are returned by the methods GetUKnots and GetTKnots.
---C++: inline
returns Face from BRepGProp;
Create(F : Face from TopoDS;
IsUseSpan: Boolean from Standard = Standard_False)
---Purpose: Constructor. Initializes the object with the face and the
-- flag IsUseSpan that says if it is necessary to define
-- spans on a face. This option has an effect only for
-- BSpline faces. Spans are returned by the methods GetUKnots
-- and GetTKnots.
---C++: inline
returns Face from BRepGProp;
Load(me : in out; F : Face from TopoDS)
is static;
VIntegrationOrder (me) returns Integer
is static;
NaturalRestriction(me) returns Boolean
---Purpose: Returns Standard_True if the face is not trimmed.
---C++: inline
is static;
Value2d (me; U :Real) returns Pnt2d from gp
---Purpose: Returns the value of the boundary curve of the face.
---C++: inline
is static;
SIntOrder (me; Eps :Real) returns Integer
is static;
SVIntSubs (me) returns Integer
is static;
SUIntSubs (me) returns Integer
is static;
UKnots(me; Knots : out Array1OfReal from TColStd)
is static;
VKnots(me; Knots : out Array1OfReal from TColStd)
is static;
LIntOrder (me; Eps :Real) returns Integer
is static;
LIntSubs (me) returns Integer
is static;
LKnots(me; Knots : out Array1OfReal from TColStd)
is static;
--
-- Methods required by GProp
--
UIntegrationOrder (me) returns Integer
---Purpose: Returns the number of points required to do the
-- integration in the U parametric direction with
-- a good accuracy.
is static;
Bounds(me; U1,U2,V1,V2 : out Real)
---Purpose: Returns the parametric bounds of the Face.
is static;
Normal (me; U, V : Real; P : out Pnt; VNor: out Vec)
---Purpose: Computes the point of parameter U, V on the Face <S> and
-- the normal to the face at this point.
is static;
Load(me : in out; E : Edge from TopoDS)
---Purpose: Loading the boundary arc.
is static;
FirstParameter (me) returns Real
---Purpose: Returns the parametric value of the start point of
-- the current arc of curve.
---C++: inline
is static;
LastParameter (me) returns Real
---Purpose: Returns the parametric value of the end point of
-- the current arc of curve.
---C++: inline
is static;
IntegrationOrder (me) returns Integer
---Purpose: Returns the number of points required to do the
-- integration along the parameter of curve.
is static;
D12d (me; U : Real ;P : out Pnt2d from gp ;
V1 : out Vec2d from gp)
---Purpose: Returns the point of parameter U and the first derivative
-- at this point of a boundary curve.
---C++: inline
is static;
-- Modified by skv - Fri Dec 9 16:44:00 2005 Begin
Load(me : in out; IsFirstParam: Boolean from Standard;
theIsoType : IsoType from GeomAbs);
---Purpose: Loading the boundary arc. This arc is either a top, bottom,
-- left or right bound of a UV rectangle in which the
-- parameters of surface are defined.
-- If IsFirstParam is equal to Standard_True, the face is
-- initialized by either left of bottom bound. Otherwise it is
-- initialized by the top or right one.
-- If theIsoType is equal to GeomAbs_IsoU, the face is
-- initialized with either left or right bound. Otherwise -
-- with either top or bottom one.
GetUKnots(me; theUMin : Real from Standard;
theUMax : Real from Standard;
theUKnots: in out HArray1OfReal from TColStd);
---Purpose: Returns an array of U knots of the face. The first and last
-- elements of the array will be theUMin and theUMax. The
-- middle elements will be the U Knots of the face greater
-- then theUMin and lower then theUMax in increasing order.
-- If the face is not a BSpline, the array initialized with
-- theUMin and theUMax only.
GetTKnots(me; theTMin : Real from Standard;
theTMax : Real from Standard;
theTKnots: in out HArray1OfReal from TColStd);
---Purpose: Returns an array of combination of T knots of the arc and
-- V knots of the face. The first and last elements of the
-- array will be theTMin and theTMax. The middle elements will
-- be the Knots of the arc and the values of parameters of
-- arc on which the value points have V coordinates close to V
-- knots of face. All the parameter will be greater then
-- theTMin and lower then theTMax in increasing order.
-- If the face is not a BSpline, the array initialized with
-- theTMin and theTMax only.
-- Modified by skv - Fri Dec 9 16:44:00 2005 End
fields
mySurface : Surface from BRepAdaptor;
myCurve : Curve from Geom2dAdaptor;
mySReverse : Boolean from Standard;
myIsUseSpan: Boolean from Standard;
end Face;

View File

@@ -12,31 +12,32 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepGProp_Face.ixx>
#include <TopoDS.hxx>
#include <Geom2d_Line.hxx>
#include <Geom2d_BezierCurve.hxx>
#include <Geom2d_BSplineCurve.hxx>
#include <Geom_BSplineCurve.hxx>
#include <Geom_BezierSurface.hxx>
#include <Geom_BSplineSurface.hxx>
#include <Geom_SurfaceOfLinearExtrusion.hxx>
#include <math.hxx>
#include <Bnd_Box2d.hxx>
#include <BndLib_Add2dCurve.hxx>
#include <BRepGProp_Face.hxx>
#include <Geom2d_BezierCurve.hxx>
#include <Geom2d_BSplineCurve.hxx>
#include <Geom2d_Line.hxx>
#include <Geom_BezierSurface.hxx>
#include <Geom_BSplineCurve.hxx>
#include <Geom_BSplineSurface.hxx>
#include <Geom_SurfaceOfLinearExtrusion.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <gp_Pnt.hxx>
#include <gp_Pnt2d.hxx>
#include <gp_Vec.hxx>
#include <gp_Vec2d.hxx>
#include <math.hxx>
#include <Precision.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Face.hxx>
//=======================================================================
//function : UIntegrationOrder
//purpose :
//=======================================================================
Standard_Integer BRepGProp_Face::UIntegrationOrder() const {
Standard_Integer Nu;

View File

@@ -0,0 +1,177 @@
// Created on: 1993-04-14
// Created by: Isabelle GRIGNON
// 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 _BRepGProp_Face_HeaderFile
#define _BRepGProp_Face_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <Geom2dAdaptor_Curve.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
#include <gp_Pnt2d.hxx>
#include <Standard_Real.hxx>
#include <TColStd_Array1OfReal.hxx>
#include <GeomAbs_IsoType.hxx>
#include <TColStd_HArray1OfReal.hxx>
class TopoDS_Face;
class gp_Pnt;
class gp_Vec;
class TopoDS_Edge;
class gp_Pnt2d;
class gp_Vec2d;
class BRepGProp_Face
{
public:
DEFINE_STANDARD_ALLOC
//! Constructor. Initializes the object with a flag IsUseSpan
//! that says if it is necessary to define spans on a face.
//! This option has an effect only for BSpline faces. Spans
//! are returned by the methods GetUKnots and GetTKnots.
BRepGProp_Face(const Standard_Boolean IsUseSpan = Standard_False);
//! Constructor. Initializes the object with the face and the
//! flag IsUseSpan that says if it is necessary to define
//! spans on a face. This option has an effect only for
//! BSpline faces. Spans are returned by the methods GetUKnots
//! and GetTKnots.
BRepGProp_Face(const TopoDS_Face& F, const Standard_Boolean IsUseSpan = Standard_False);
Standard_EXPORT void Load (const TopoDS_Face& F);
Standard_EXPORT Standard_Integer VIntegrationOrder() const;
//! Returns Standard_True if the face is not trimmed.
Standard_Boolean NaturalRestriction() const;
//! Returns the value of the boundary curve of the face.
gp_Pnt2d Value2d (const Standard_Real U) const;
Standard_EXPORT Standard_Integer SIntOrder (const Standard_Real Eps) const;
Standard_EXPORT Standard_Integer SVIntSubs() const;
Standard_EXPORT Standard_Integer SUIntSubs() const;
Standard_EXPORT void UKnots (TColStd_Array1OfReal& Knots) const;
Standard_EXPORT void VKnots (TColStd_Array1OfReal& Knots) const;
Standard_EXPORT Standard_Integer LIntOrder (const Standard_Real Eps) const;
Standard_EXPORT Standard_Integer LIntSubs() const;
Standard_EXPORT void LKnots (TColStd_Array1OfReal& Knots) const;
//! Returns the number of points required to do the
//! integration in the U parametric direction with
//! a good accuracy.
Standard_EXPORT Standard_Integer UIntegrationOrder() const;
//! Returns the parametric bounds of the Face.
Standard_EXPORT void Bounds (Standard_Real& U1, Standard_Real& U2, Standard_Real& V1, Standard_Real& V2) const;
//! Computes the point of parameter U, V on the Face <S> and
//! the normal to the face at this point.
Standard_EXPORT void Normal (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& VNor) const;
//! Loading the boundary arc.
Standard_EXPORT void Load (const TopoDS_Edge& E);
//! Returns the parametric value of the start point of
//! the current arc of curve.
Standard_Real FirstParameter() const;
//! Returns the parametric value of the end point of
//! the current arc of curve.
Standard_Real LastParameter() const;
//! Returns the number of points required to do the
//! integration along the parameter of curve.
Standard_EXPORT Standard_Integer IntegrationOrder() const;
//! Returns the point of parameter U and the first derivative
//! at this point of a boundary curve.
void D12d (const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1) const;
//! Loading the boundary arc. This arc is either a top, bottom,
//! left or right bound of a UV rectangle in which the
//! parameters of surface are defined.
//! If IsFirstParam is equal to Standard_True, the face is
//! initialized by either left of bottom bound. Otherwise it is
//! initialized by the top or right one.
//! If theIsoType is equal to GeomAbs_IsoU, the face is
//! initialized with either left or right bound. Otherwise -
//! with either top or bottom one.
Standard_EXPORT void Load (const Standard_Boolean IsFirstParam, const GeomAbs_IsoType theIsoType);
//! Returns an array of U knots of the face. The first and last
//! elements of the array will be theUMin and theUMax. The
//! middle elements will be the U Knots of the face greater
//! then theUMin and lower then theUMax in increasing order.
//! If the face is not a BSpline, the array initialized with
//! theUMin and theUMax only.
Standard_EXPORT void GetUKnots (const Standard_Real theUMin, const Standard_Real theUMax, Handle(TColStd_HArray1OfReal)& theUKnots) const;
//! Returns an array of combination of T knots of the arc and
//! V knots of the face. The first and last elements of the
//! array will be theTMin and theTMax. The middle elements will
//! be the Knots of the arc and the values of parameters of
//! arc on which the value points have V coordinates close to V
//! knots of face. All the parameter will be greater then
//! theTMin and lower then theTMax in increasing order.
//! If the face is not a BSpline, the array initialized with
//! theTMin and theTMax only.
Standard_EXPORT void GetTKnots (const Standard_Real theTMin, const Standard_Real theTMax, Handle(TColStd_HArray1OfReal)& theTKnots) const;
protected:
private:
BRepAdaptor_Surface mySurface;
Geom2dAdaptor_Curve myCurve;
Standard_Boolean mySReverse;
Standard_Boolean myIsUseSpan;
};
#include <BRepGProp_Face.lxx>
#endif // _BRepGProp_Face_HeaderFile

View File

@@ -1,62 +0,0 @@
-- Created on: 1991-04-12
-- Created by: Michel CHAUVAT
-- 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.
-- Jean-Claude VAUTHIER January 1992
class Sinert from BRepGProp inherits GProps
--- Purpose :
-- Computes the global properties of a face in 3D space.
-- The face 's requirements to evaluate the global properties
-- are defined in the template FaceTool from package GProp.
uses Pnt from gp,
Edge from TopoDS,
Face from BRepGProp,
Domain from BRepGProp
is
Create returns Sinert;
Create (S: Face; SLocation: Pnt) returns Sinert;
Create (S : in out Face; D : in out Domain; SLocation : Pnt) returns Sinert;
--- Purpose :
-- Builds a Sinert to evaluate the global properties of
-- the face <S>. If isNaturalRestriction is true the domain of S is defined
-- with the natural bounds, else it defined with an iterator
-- of Edge from TopoDS (see DomainTool from GProp)
Create (S: in out Face; SLocation: Pnt; Eps: Real) returns Sinert;
Create (S: in out Face; D : in out Domain; SLocation: Pnt; Eps: Real) returns Sinert;
-- --"--
-- Parameter Eps sets maximal relative error of computed area.
SetLocation(me: in out; SLocation: Pnt);
Perform(me: in out; S: Face);
Perform(me : in out; S : in out Face ; D : in out Domain);
Perform(me: in out; S: in out Face; Eps: Real) returns Real;
Perform(me: in out; S: in out Face; D : in out Domain; Eps: Real) returns Real;
GetEpsilon(me: out) returns Real;
--- Purpose :
-- If previously used method contained Eps parameter
-- get actual relative error of the computation, else return 1.0.
fields
myEpsilon: Real from Standard;
end Sinert;

View File

@@ -12,8 +12,12 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include<BRepGProp_Sinert.ixx>
#include<BRepGProp_Gauss.hxx>
#include <BRepGProp_Domain.hxx>
#include <BRepGProp_Face.hxx>
#include <BRepGProp_Gauss.hxx>
#include <BRepGProp_Sinert.hxx>
#include <gp_Pnt.hxx>
//=======================================================================
//function : BRepGProp_Sinert

View File

@@ -0,0 +1,96 @@
// Created on: 1991-04-12
// Created by: Michel CHAUVAT
// 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 _BRepGProp_Sinert_HeaderFile
#define _BRepGProp_Sinert_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Real.hxx>
#include <GProp_GProps.hxx>
class BRepGProp_Face;
class gp_Pnt;
class BRepGProp_Domain;
//! Computes the global properties of a face in 3D space.
//! The face 's requirements to evaluate the global properties
//! are defined in the template FaceTool from package GProp.
class BRepGProp_Sinert : public GProp_GProps
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepGProp_Sinert();
Standard_EXPORT BRepGProp_Sinert(const BRepGProp_Face& S, const gp_Pnt& SLocation);
//! Builds a Sinert to evaluate the global properties of
//! the face <S>. If isNaturalRestriction is true the domain of S is defined
//! with the natural bounds, else it defined with an iterator
//! of Edge from TopoDS (see DomainTool from GProp)
Standard_EXPORT BRepGProp_Sinert(BRepGProp_Face& S, BRepGProp_Domain& D, const gp_Pnt& SLocation);
Standard_EXPORT BRepGProp_Sinert(BRepGProp_Face& S, const gp_Pnt& SLocation, const Standard_Real Eps);
Standard_EXPORT BRepGProp_Sinert(BRepGProp_Face& S, BRepGProp_Domain& D, const gp_Pnt& SLocation, const Standard_Real Eps);
Standard_EXPORT void SetLocation (const gp_Pnt& SLocation);
Standard_EXPORT void Perform (const BRepGProp_Face& S);
Standard_EXPORT void Perform (BRepGProp_Face& S, BRepGProp_Domain& D);
Standard_EXPORT Standard_Real Perform (BRepGProp_Face& S, const Standard_Real Eps);
Standard_EXPORT Standard_Real Perform (BRepGProp_Face& S, BRepGProp_Domain& D, const Standard_Real Eps);
//! If previously used method contained Eps parameter
//! get actual relative error of the computation, else return 1.0.
Standard_EXPORT Standard_Real GetEpsilon();
protected:
private:
Standard_Real myEpsilon;
};
#endif // _BRepGProp_Sinert_HeaderFile

View File

@@ -1,126 +0,0 @@
-- Created on: 2005-12-21
-- Created by: Sergey KHROMOV
-- Copyright (c) 2005-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 TFunction from BRepGProp inherits Function from math
---Purpose: This class represents the integrand function for the outer
-- integral computation. The returned value represents the
-- integral of UFunction. It depends on the value type and the
-- flag IsByPoint.
uses
Pnt from gp,
Address from Standard,
Boolean from Standard,
Integer from Standard,
Real from Standard,
ValueType from GProp,
UFunction from BRepGProp,
Face from BRepGProp
is
Create(theSurface : Face from BRepGProp;
theVertex : Pnt from gp;
IsByPoint : Boolean from Standard;
theCoeffs : Address from Standard;
theUMin : Real from Standard;
theTolerance: Real from Standard)
---Purpose: Constructor. Initializes the function with the face, the
-- location point, the flag IsByPoint, the coefficients
-- theCoeff that have different meaning depending on the value
-- of IsByPoint. The last two parameters are theUMin - the
-- lower bound of the inner integral. This value is fixed for
-- any integral. And the value of tolerance of inner integral
-- computation.
-- If IsByPoint is equal to Standard_True, the number of the
-- coefficients is equal to 3 and they represent X, Y and Z
-- coordinates (theCoeff[0], theCoeff[1] and theCoeff[2]
-- correspondingly) of the shift if the inertia is computed
-- with respect to the point different then the location.
-- If IsByPoint is equal to Standard_False, the number of the
-- coefficients is 4 and they represent the compbination of
-- plane parameters and shift values.
returns TFunction from BRepGProp;
Init(me: in out);
SetNbKronrodPoints(me: in out; theNbPoints: Integer from Standard);
---Purpose: Setting the expected number of Kronrod points for the outer
-- integral computation. This number is required for
-- computation of a value of tolerance for inner integral
-- computation. After GetStateNumber method call, this number
-- is recomputed by the same law as in
-- math_KronrodSingleIntegration, i.e. next number of points
-- is equal to the current number plus a square root of the
-- current number. If the law in math_KronrodSingleIntegration
-- is changed, the modification algo should be modified
-- accordingly.
---C++: inline
SetValueType(me: in out; aType: ValueType from GProp);
---Purpose: Setting the type of the value to be returned. This
-- parameter is directly passed to the UFunction.
---C++: inline
SetTolerance(me: in out; aTol: Real from Standard);
---Purpose: Setting the tolerance for inner integration
---C++: inline
ErrorReached(me)
---Purpose: Returns the relative reached error of all values computation since
-- the last call of GetStateNumber method.
---C++: inline
returns Real from Standard;
AbsolutError(me)
---Purpose: Returns the absolut reached error of all values computation since
-- the last call of GetStateNumber method.
---C++: inline
returns Real from Standard;
Value(me: in out; X: Real from Standard;
F: out Real from Standard)
---Purpose: Returns a value of the function. The value represents an
-- integral of UFunction. It is computed with the predefined
-- tolerance using the adaptive Gauss-Kronrod method.
returns Boolean from Standard
is redefined;
GetStateNumber(me: in out)
---Purpose: Redefined method. Remembers the error reached during
-- computation of integral values since the object creation
-- or the last call of GetStateNumber. It is invoked in each
-- algorithm from the package math. Particularly in the
-- algorithm math_KronrodSingleIntegration that is used to
-- compute the integral of TFunction.
returns Integer
is redefined;
fields
mySurface : Face from BRepGProp;
myUFunction : UFunction from BRepGProp;
myUMin : Real from Standard;
myTolerance : Real from Standard;
myTolReached: Real from Standard;
myErrReached: Real from Standard;
myAbsError : Real from Standard;
myValueType : ValueType from GProp;
myIsByPoint : Boolean from Standard;
myNbPntOuter: Integer from Standard;
end TFunction;

View File

@@ -13,17 +13,18 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepGProp_TFunction.ixx>
#include <TColStd_HArray1OfReal.hxx>
#include <BRepGProp_Face.hxx>
#include <BRepGProp_TFunction.hxx>
#include <gp_Pnt.hxx>
#include <math_KronrodSingleIntegration.hxx>
#include <Precision.hxx>
#include <TColStd_HArray1OfReal.hxx>
//=======================================================================
//function : Constructor.
//purpose :
//=======================================================================
BRepGProp_TFunction::BRepGProp_TFunction(const BRepGProp_Face &theSurface,
const gp_Pnt &theVertex,
const Standard_Boolean IsByPoint,

View File

@@ -0,0 +1,139 @@
// Created on: 2005-12-21
// Created by: Sergey KHROMOV
// Copyright (c) 2005-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 _BRepGProp_TFunction_HeaderFile
#define _BRepGProp_TFunction_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <BRepGProp_Face.hxx>
#include <BRepGProp_UFunction.hxx>
#include <Standard_Real.hxx>
#include <GProp_ValueType.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Integer.hxx>
#include <math_Function.hxx>
#include <Standard_Address.hxx>
class BRepGProp_Face;
class gp_Pnt;
//! This class represents the integrand function for the outer
//! integral computation. The returned value represents the
//! integral of UFunction. It depends on the value type and the
//! flag IsByPoint.
class BRepGProp_TFunction : public math_Function
{
public:
DEFINE_STANDARD_ALLOC
//! Constructor. Initializes the function with the face, the
//! location point, the flag IsByPoint, the coefficients
//! theCoeff that have different meaning depending on the value
//! of IsByPoint. The last two parameters are theUMin - the
//! lower bound of the inner integral. This value is fixed for
//! any integral. And the value of tolerance of inner integral
//! computation.
//! If IsByPoint is equal to Standard_True, the number of the
//! coefficients is equal to 3 and they represent X, Y and Z
//! coordinates (theCoeff[0], theCoeff[1] and theCoeff[2]
//! correspondingly) of the shift if the inertia is computed
//! with respect to the point different then the location.
//! If IsByPoint is equal to Standard_False, the number of the
//! coefficients is 4 and they represent the compbination of
//! plane parameters and shift values.
Standard_EXPORT BRepGProp_TFunction(const BRepGProp_Face& theSurface, const gp_Pnt& theVertex, const Standard_Boolean IsByPoint, const Standard_Address theCoeffs, const Standard_Real theUMin, const Standard_Real theTolerance);
Standard_EXPORT void Init();
//! Setting the expected number of Kronrod points for the outer
//! integral computation. This number is required for
//! computation of a value of tolerance for inner integral
//! computation. After GetStateNumber method call, this number
//! is recomputed by the same law as in
//! math_KronrodSingleIntegration, i.e. next number of points
//! is equal to the current number plus a square root of the
//! current number. If the law in math_KronrodSingleIntegration
//! is changed, the modification algo should be modified
//! accordingly.
void SetNbKronrodPoints (const Standard_Integer theNbPoints);
//! Setting the type of the value to be returned. This
//! parameter is directly passed to the UFunction.
void SetValueType (const GProp_ValueType aType);
//! Setting the tolerance for inner integration
void SetTolerance (const Standard_Real aTol);
//! Returns the relative reached error of all values computation since
//! the last call of GetStateNumber method.
Standard_Real ErrorReached() const;
//! Returns the absolut reached error of all values computation since
//! the last call of GetStateNumber method.
Standard_Real AbsolutError() const;
//! Returns a value of the function. The value represents an
//! integral of UFunction. It is computed with the predefined
//! tolerance using the adaptive Gauss-Kronrod method.
Standard_EXPORT virtual Standard_Boolean Value (const Standard_Real X, Standard_Real& F) Standard_OVERRIDE;
//! Redefined method. Remembers the error reached during
//! computation of integral values since the object creation
//! or the last call of GetStateNumber. It is invoked in each
//! algorithm from the package math. Particularly in the
//! algorithm math_KronrodSingleIntegration that is used to
//! compute the integral of TFunction.
Standard_EXPORT virtual Standard_Integer GetStateNumber() Standard_OVERRIDE;
protected:
private:
BRepGProp_Face mySurface;
BRepGProp_UFunction myUFunction;
Standard_Real myUMin;
Standard_Real myTolerance;
Standard_Real myTolReached;
Standard_Real myErrReached;
Standard_Real myAbsError;
GProp_ValueType myValueType;
Standard_Boolean myIsByPoint;
Standard_Integer myNbPntOuter;
};
#include <BRepGProp_TFunction.lxx>
#endif // _BRepGProp_TFunction_HeaderFile

View File

@@ -1,129 +0,0 @@
-- Created on: 2005-12-21
-- Created by: Sergey KHROMOV
-- Copyright (c) 2005-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 UFunction from BRepGProp inherits Function from math
---Purpose: This class represents the integrand function for
-- computation of an inner integral. The returned value
-- depends on the value type and the flag IsByPoint.
--
-- The type of returned value is the one of the following
-- values:
-- - GProp_Mass - volume computation.
-- - GProp_CenterMassX, GProp_CenterMassY,
-- GProp_CenterMassZ - X, Y and Z coordinates of center
-- of mass computation.
-- - GProp_InertiaXX, GProp_InertiaYY, GProp_InertiaZZ,
-- GProp_InertiaXY, GProp_InertiaXZ, GProp_InertiaYZ
-- - moments of inertia computation.
--
-- If the flag IsByPoint is set to Standard_True, the value is
-- returned for the region of space that is delimited by a
-- surface and a point. Otherwise all computations are
-- performed for the region of space delimited by a surface
-- and a plane.
uses
Pnt from gp,
XYZ from gp,
Address from Standard,
Boolean from Standard,
Real from Standard,
ValueType from GProp,
Face from BRepGProp
is
Create(theSurface: Face from BRepGProp;
theVertex : Pnt from gp;
IsByPoint : Boolean from Standard;
theCoeffs : Address from Standard)
---Purpose: Constructor. Initializes the function with the face, the
-- location point, the flag IsByPoint and the coefficients
-- theCoeff that have different meaning depending on the value
-- of IsByPoint.
-- If IsByPoint is equal to Standard_True, the number of the
-- coefficients is equal to 3 and they represent X, Y and Z
-- coordinates (theCoeff[0], theCoeff[1] and theCoeff[2]
-- correspondingly) of the shift, if the inertia is computed
-- with respect to the point different then the location.
-- If IsByPoint is equal to Standard_False, the number of the
-- coefficients is 4 and they represent the combination of
-- plane parameters and shift values.
returns UFunction from BRepGProp;
SetValueType(me: in out; theType: ValueType from GProp);
---Purpose: Setting the type of the value to be returned.
---C++: inline
SetVParam(me: in out; theVParam: Real from Standard);
---Purpose: Setting the V parameter that is constant during the
-- integral computation.
---C++: inline
Value(me: in out; X: Real from Standard;
F: out Real from Standard)
---Purpose: Returns a value of the function.
returns Boolean from Standard
is redefined;
-----------------------
-- Private methods --
-----------------------
VolumeValue(me: in out; X : Real from Standard;
thePMP0: out XYZ from gp;
theS : out Real from Standard;
theD1 : out Real from Standard)
---Purpose: Private method. Returns the value for volume computation.
-- Other returned values are:
-- - thePMP0 - PSurf(X,Y) minus Location.
-- - theS and theD1 coeffitients that are computed and used
-- for computation of center of mass and inertia values
-- by plane.
returns Real from Standard
is private;
CenterMassValue(me: in out; X: Real from Standard;
F: out Real from Standard)
---Purpose: Private method. Returns a value for the center of mass
-- computation. If the value type other then GProp_CenterMassX,
-- GProp_CenterMassY or GProp_CenterMassZ this method returns
-- Standard_False. Returns Standard_True in case of successful
-- computation of a value.
returns Boolean from Standard
is private;
InertiaValue(me: in out; X: Real from Standard;
F: out Real from Standard)
---Purpose: Private method. Computes the value of intertia. The type of
-- a value returned is defined by the value type. If it is
-- other then GProp_InertiaXX, GProp_InertiaYY,
-- GProp_InertiaZZ, GProp_InertiaXY, GProp_InertiaXZ or
-- GProp_InertiaYZ, the method returns Standard_False. Returns
-- Standard_True in case of successful computation of a value
returns Boolean from Standard
is private;
fields
mySurface : Face from BRepGProp;
myVertex : Pnt from gp;
myCoeffs : Address from Standard;
myVParam : Real from Standard;
myValueType: ValueType from GProp;
myIsByPoint: Boolean from Standard;
end UFunction;

View File

@@ -13,13 +13,16 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepGProp_UFunction.ixx>
#include <BRepGProp_Face.hxx>
#include <BRepGProp_UFunction.hxx>
#include <gp_Pnt.hxx>
#include <gp_XYZ.hxx>
//=======================================================================
//function : Constructor.
//purpose :
//=======================================================================
BRepGProp_UFunction::BRepGProp_UFunction(const BRepGProp_Face &theSurface,
const gp_Pnt &theVertex,
const Standard_Boolean IsByPoint,

View File

@@ -0,0 +1,138 @@
// Created on: 2005-12-21
// Created by: Sergey KHROMOV
// Copyright (c) 2005-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 _BRepGProp_UFunction_HeaderFile
#define _BRepGProp_UFunction_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <BRepGProp_Face.hxx>
#include <gp_Pnt.hxx>
#include <Standard_Address.hxx>
#include <Standard_Real.hxx>
#include <GProp_ValueType.hxx>
#include <Standard_Boolean.hxx>
#include <math_Function.hxx>
class BRepGProp_Face;
class gp_Pnt;
class gp_XYZ;
//! This class represents the integrand function for
//! computation of an inner integral. The returned value
//! depends on the value type and the flag IsByPoint.
//!
//! The type of returned value is the one of the following
//! values:
//! - GProp_Mass - volume computation.
//! - GProp_CenterMassX, GProp_CenterMassY,
//! GProp_CenterMassZ - X, Y and Z coordinates of center
//! of mass computation.
//! - GProp_InertiaXX, GProp_InertiaYY, GProp_InertiaZZ,
//! GProp_InertiaXY, GProp_InertiaXZ, GProp_InertiaYZ
//! - moments of inertia computation.
//!
//! If the flag IsByPoint is set to Standard_True, the value is
//! returned for the region of space that is delimited by a
//! surface and a point. Otherwise all computations are
//! performed for the region of space delimited by a surface
//! and a plane.
class BRepGProp_UFunction : public math_Function
{
public:
DEFINE_STANDARD_ALLOC
//! Constructor. Initializes the function with the face, the
//! location point, the flag IsByPoint and the coefficients
//! theCoeff that have different meaning depending on the value
//! of IsByPoint.
//! If IsByPoint is equal to Standard_True, the number of the
//! coefficients is equal to 3 and they represent X, Y and Z
//! coordinates (theCoeff[0], theCoeff[1] and theCoeff[2]
//! correspondingly) of the shift, if the inertia is computed
//! with respect to the point different then the location.
//! If IsByPoint is equal to Standard_False, the number of the
//! coefficients is 4 and they represent the combination of
//! plane parameters and shift values.
Standard_EXPORT BRepGProp_UFunction(const BRepGProp_Face& theSurface, const gp_Pnt& theVertex, const Standard_Boolean IsByPoint, const Standard_Address theCoeffs);
//! Setting the type of the value to be returned.
void SetValueType (const GProp_ValueType theType);
//! Setting the V parameter that is constant during the
//! integral computation.
void SetVParam (const Standard_Real theVParam);
//! Returns a value of the function.
Standard_EXPORT virtual Standard_Boolean Value (const Standard_Real X, Standard_Real& F) Standard_OVERRIDE;
protected:
private:
//! Private method. Returns the value for volume computation.
//! Other returned values are:
//! - thePMP0 - PSurf(X,Y) minus Location.
//! - theS and theD1 coeffitients that are computed and used
//! for computation of center of mass and inertia values
//! by plane.
Standard_EXPORT Standard_Real VolumeValue (const Standard_Real X, gp_XYZ& thePMP0, Standard_Real& theS, Standard_Real& theD1);
//! Private method. Returns a value for the center of mass
//! computation. If the value type other then GProp_CenterMassX,
//! GProp_CenterMassY or GProp_CenterMassZ this method returns
//! Standard_False. Returns Standard_True in case of successful
//! computation of a value.
Standard_EXPORT Standard_Boolean CenterMassValue (const Standard_Real X, Standard_Real& F);
//! Private method. Computes the value of intertia. The type of
//! a value returned is defined by the value type. If it is
//! other then GProp_InertiaXX, GProp_InertiaYY,
//! GProp_InertiaZZ, GProp_InertiaXY, GProp_InertiaXZ or
//! GProp_InertiaYZ, the method returns Standard_False. Returns
//! Standard_True in case of successful computation of a value
Standard_EXPORT Standard_Boolean InertiaValue (const Standard_Real X, Standard_Real& F);
BRepGProp_Face mySurface;
gp_Pnt myVertex;
Standard_Address myCoeffs;
Standard_Real myVParam;
GProp_ValueType myValueType;
Standard_Boolean myIsByPoint;
};
#include <BRepGProp_UFunction.lxx>
#endif // _BRepGProp_UFunction_HeaderFile

View File

@@ -1,195 +0,0 @@
-- Created on: 1991-04-12
-- Created by: Michel CHAUVAT
-- 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.
-- Jean-Claude VAUTHIER January 1992
class Vinert from BRepGProp inherits GProps from GProp
--- Purpose :
-- Computes the global properties of a geometric solid
-- (3D closed region of space) delimited with :
-- . a surface
-- . a point and a surface
-- . a plane and a surface
--
-- The surface can be :
-- . a surface limited with its parametric values U-V,
-- . a surface limited in U-V space with its curves of restriction,
--
-- The surface 's requirements to evaluate the global properties
-- are defined in the template SurfaceTool from package GProp.
uses Pnt from gp,
Pln from gp,
Edge from TopoDS,
Face from BRepGProp,
Domain from BRepGProp
is
Create returns Vinert;
Create (S: Face from BRepGProp; VLocation: Pnt from gp) returns Vinert;
--- Purpose :
-- Computes the global properties of a region of 3D space
-- delimited with the surface <S> and the point VLocation. S can be closed
-- The method is quick and its precision is enough for many cases of analytical
-- surfaces.
-- Non-adaptive 2D Gauss integration with predefined numbers of Gauss points
-- is used. Numbers of points depend on types of surfaces and curves.
-- Errror of the computation is not calculated.
Create (S: in out Face from BRepGProp; VLocation: Pnt from gp; Eps: Real) returns Vinert;
--- Purpose :
-- Computes the global properties of a region of 3D space
-- delimited with the surface <S> and the point VLocation. S can be closed
-- Adaptive 2D Gauss integration is used.
-- Parameter Eps sets maximal relative error of computed mass (volume) for face.
-- Error is calculated as Abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values
-- for two successive steps of adaptive integration.
Create (S: Face from BRepGProp; O: Pnt from gp; VLocation: Pnt from gp) returns Vinert;
--- Purpose :
-- Computes the global properties of the region of 3D space
-- delimited with the surface <S> and the point VLocation.
-- The method is quick and its precision is enough for many cases of analytical
-- surfaces.
-- Non-adaptive 2D Gauss integration with predefined numbers of Gauss points
-- is used. Numbers of points depend on types of surfaces and curves.
-- Error of the computation is not calculated.
Create (S: in out Face from BRepGProp; O: Pnt from gp; VLocation: Pnt from gp; Eps: Real) returns Vinert;
--- Purpose :
-- Computes the global properties of the region of 3D space
-- delimited with the surface <S> and the point VLocation.
-- Adaptive 2D Gauss integration is used.
-- Parameter Eps sets maximal relative error of computed mass (volume) for face.
-- Error is calculated as Abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values
-- for two successive steps of adaptive integration.
-- WARNING: if Eps > 0.001 algorithm performs non-adaptive integration.
Create (S: Face from BRepGProp; Pl: Pln from gp; VLocation: Pnt from gp) returns Vinert;
--- Purpose :
-- Computes the global properties of the region of 3D space
-- delimited with the surface <S> and the plane Pln.
-- The method is quick and its precision is enough for many cases of analytical
-- surfaces.
-- Non-adaptive 2D Gauss integration with predefined numbers of Gauss points
-- is used. Numbers of points depend on types of surfaces and curves.
-- Error of the computation is not calculated.
Create (S: in out Face from BRepGProp; Pl: Pln from gp; VLocation: Pnt from gp; Eps: Real) returns Vinert;
--- Purpose :
-- Computes the global properties of the region of 3D space
-- delimited with the surface <S> and the plane Pln.
-- Adaptive 2D Gauss integration is used.
-- Parameter Eps sets maximal relative error of computed mass (volume) for face.
-- Error is calculated as Abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values
-- for two successive steps of adaptive integration.
-- WARNING: if Eps > 0.001 algorithm performs non-adaptive integration.
-- With Domain from BRepGProp --
Create (S: in out Face from BRepGProp; D : in out Domain from BRepGProp; VLocation: Pnt from gp) returns Vinert;
--- Purpose :
-- Computes the global properties of a region of 3D space
-- delimited with the surface <S> and the point VLocation. S can be closed
-- The method is quick and its precision is enough for many cases of analytical
-- surfaces.
-- Non-adaptive 2D Gauss integration with predefined numbers of Gauss points
-- is used. Numbers of points depend on types of surfaces and curves.
-- Errror of the computation is not calculated.
Create (S: in out Face from BRepGProp; D : in out Domain from BRepGProp; VLocation: Pnt from gp; Eps: Real) returns Vinert;
--- Purpose :
-- Computes the global properties of a region of 3D space
-- delimited with the surface <S> and the point VLocation. S can be closed
-- Adaptive 2D Gauss integration is used.
-- Parameter Eps sets maximal relative error of computed mass (volume) for face.
-- Error is calculated as Abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values
-- for two successive steps of adaptive integration.
Create (S: in out Face from BRepGProp; D : in out Domain from BRepGProp; O: Pnt from gp; VLocation: Pnt from gp) returns Vinert;
--- Purpose :
-- Computes the global properties of the region of 3D space
-- delimited with the surface <S> and the point VLocation.
-- The method is quick and its precision is enough for many cases of analytical
-- surfaces.
-- Non-adaptive 2D Gauss integration with predefined numbers of Gauss points
-- is used. Numbers of points depend on types of surfaces and curves.
-- Error of the computation is not calculated.
Create (S: in out Face from BRepGProp; D : in out Domain from BRepGProp; O: Pnt from gp; VLocation: Pnt from gp; Eps: Real) returns Vinert;
--- Purpose :
-- Computes the global properties of the region of 3D space
-- delimited with the surface <S> and the point VLocation.
-- Adaptive 2D Gauss integration is used.
-- Parameter Eps sets maximal relative error of computed mass (volume) for face.
-- Error is calculated as Abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values
-- for two successive steps of adaptive integration.
-- WARNING: if Eps > 0.001 algorithm performs non-adaptive integration.
Create (S: in out Face from BRepGProp; D : in out Domain from BRepGProp; Pl: Pln from gp; VLocation: Pnt from gp) returns Vinert;
--- Purpose :
-- Computes the global properties of the region of 3D space
-- delimited with the surface <S> and the plane Pln.
-- The method is quick and its precision is enough for many cases of analytical
-- surfaces.
-- Non-adaptive 2D Gauss integration with predefined numbers of Gauss points
-- is used. Numbers of points depend on types of surfaces and curves.
-- Error of the computation is not calculated.
Create (S: in out Face from BRepGProp; D : in out Domain from BRepGProp; Pl: Pln from gp; VLocation: Pnt from gp; Eps: Real) returns Vinert;
--- Purpose :
-- Computes the global properties of the region of 3D space
-- delimited with the surface <S> and the plane Pln.
-- Adaptive 2D Gauss integration is used.
-- Parameter Eps sets maximal relative error of computed mass (volume) for face.
-- Error is calculated as Abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values
-- for two successive steps of adaptive integration.
-- WARNING: if Eps > 0.001 algorithm performs non-adaptive integration.
SetLocation(me: in out; VLocation: Pnt from gp);
Perform(me: in out; S: Face from BRepGProp);
Perform(me: in out; S: in out Face from BRepGProp; Eps: Real) returns Real;
Perform(me: in out; S: Face from BRepGProp; O : Pnt from gp);
Perform(me: in out; S: in out Face from BRepGProp; O : Pnt from gp; Eps: Real) returns Real;
Perform(me: in out; S: Face from BRepGProp; Pl : Pln from gp);
Perform(me: in out; S: in out Face from BRepGProp; Pl : Pln from gp; Eps: Real) returns Real;
Perform(me: in out; S: in out Face from BRepGProp; D : in out Domain from BRepGProp);
Perform(me: in out; S: in out Face from BRepGProp; D : in out Domain from BRepGProp; Eps: Real) returns Real;
Perform(me: in out; S: in out Face from BRepGProp; D : in out Domain from BRepGProp; O : Pnt from gp);
Perform(me: in out; S: in out Face from BRepGProp; D : in out Domain from BRepGProp; O : Pnt from gp; Eps: Real) returns Real;
Perform(me: in out; S: in out Face from BRepGProp; D : in out Domain from BRepGProp; Pl : Pln from gp);
Perform(me: in out; S: in out Face from BRepGProp; D : in out Domain from BRepGProp; Pl : Pln from gp; Eps: Real) returns Real;
GetEpsilon(me: out) returns Real;
--- Purpose :
-- If previously used methods containe Eps parameter
-- gets actual relative error of the computation, else returns 1.0.
fields
myEpsilon: Real from Standard;
end Vinert;

View File

@@ -12,8 +12,13 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepGProp_Vinert.ixx>
#include <BRepGProp_Domain.hxx>
#include <BRepGProp_Face.hxx>
#include <BRepGProp_Gauss.hxx>
#include <BRepGProp_Vinert.hxx>
#include <gp_Pln.hxx>
#include <gp_Pnt.hxx>
//=======================================================================
//function : BRepGProp_Vinert

View File

@@ -0,0 +1,227 @@
// Created on: 1991-04-12
// Created by: Michel CHAUVAT
// 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 _BRepGProp_Vinert_HeaderFile
#define _BRepGProp_Vinert_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Real.hxx>
#include <GProp_GProps.hxx>
class BRepGProp_Face;
class gp_Pnt;
class gp_Pln;
class BRepGProp_Domain;
//! Computes the global properties of a geometric solid
//! (3D closed region of space) delimited with :
//! . a surface
//! . a point and a surface
//! . a plane and a surface
//!
//! The surface can be :
//! . a surface limited with its parametric values U-V,
//! . a surface limited in U-V space with its curves of restriction,
//!
//! The surface 's requirements to evaluate the global properties
//! are defined in the template SurfaceTool from package GProp.
class BRepGProp_Vinert : public GProp_GProps
{
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT BRepGProp_Vinert();
//! Computes the global properties of a region of 3D space
//! delimited with the surface <S> and the point VLocation. S can be closed
//! The method is quick and its precision is enough for many cases of analytical
//! surfaces.
//! Non-adaptive 2D Gauss integration with predefined numbers of Gauss points
//! is used. Numbers of points depend on types of surfaces and curves.
//! Errror of the computation is not calculated.
Standard_EXPORT BRepGProp_Vinert(const BRepGProp_Face& S, const gp_Pnt& VLocation);
//! Computes the global properties of a region of 3D space
//! delimited with the surface <S> and the point VLocation. S can be closed
//! Adaptive 2D Gauss integration is used.
//! Parameter Eps sets maximal relative error of computed mass (volume) for face.
//! Error is calculated as Abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values
//! for two successive steps of adaptive integration.
Standard_EXPORT BRepGProp_Vinert(BRepGProp_Face& S, const gp_Pnt& VLocation, const Standard_Real Eps);
//! Computes the global properties of the region of 3D space
//! delimited with the surface <S> and the point VLocation.
//! The method is quick and its precision is enough for many cases of analytical
//! surfaces.
//! Non-adaptive 2D Gauss integration with predefined numbers of Gauss points
//! is used. Numbers of points depend on types of surfaces and curves.
//! Error of the computation is not calculated.
Standard_EXPORT BRepGProp_Vinert(const BRepGProp_Face& S, const gp_Pnt& O, const gp_Pnt& VLocation);
//! Computes the global properties of the region of 3D space
//! delimited with the surface <S> and the point VLocation.
//! Adaptive 2D Gauss integration is used.
//! Parameter Eps sets maximal relative error of computed mass (volume) for face.
//! Error is calculated as Abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values
//! for two successive steps of adaptive integration.
//! WARNING: if Eps > 0.001 algorithm performs non-adaptive integration.
Standard_EXPORT BRepGProp_Vinert(BRepGProp_Face& S, const gp_Pnt& O, const gp_Pnt& VLocation, const Standard_Real Eps);
//! Computes the global properties of the region of 3D space
//! delimited with the surface <S> and the plane Pln.
//! The method is quick and its precision is enough for many cases of analytical
//! surfaces.
//! Non-adaptive 2D Gauss integration with predefined numbers of Gauss points
//! is used. Numbers of points depend on types of surfaces and curves.
//! Error of the computation is not calculated.
Standard_EXPORT BRepGProp_Vinert(const BRepGProp_Face& S, const gp_Pln& Pl, const gp_Pnt& VLocation);
//! Computes the global properties of the region of 3D space
//! delimited with the surface <S> and the plane Pln.
//! Adaptive 2D Gauss integration is used.
//! Parameter Eps sets maximal relative error of computed mass (volume) for face.
//! Error is calculated as Abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values
//! for two successive steps of adaptive integration.
//! WARNING: if Eps > 0.001 algorithm performs non-adaptive integration.
Standard_EXPORT BRepGProp_Vinert(BRepGProp_Face& S, const gp_Pln& Pl, const gp_Pnt& VLocation, const Standard_Real Eps);
//! Computes the global properties of a region of 3D space
//! delimited with the surface <S> and the point VLocation. S can be closed
//! The method is quick and its precision is enough for many cases of analytical
//! surfaces.
//! Non-adaptive 2D Gauss integration with predefined numbers of Gauss points
//! is used. Numbers of points depend on types of surfaces and curves.
//! Errror of the computation is not calculated.
Standard_EXPORT BRepGProp_Vinert(BRepGProp_Face& S, BRepGProp_Domain& D, const gp_Pnt& VLocation);
//! Computes the global properties of a region of 3D space
//! delimited with the surface <S> and the point VLocation. S can be closed
//! Adaptive 2D Gauss integration is used.
//! Parameter Eps sets maximal relative error of computed mass (volume) for face.
//! Error is calculated as Abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values
//! for two successive steps of adaptive integration.
Standard_EXPORT BRepGProp_Vinert(BRepGProp_Face& S, BRepGProp_Domain& D, const gp_Pnt& VLocation, const Standard_Real Eps);
//! Computes the global properties of the region of 3D space
//! delimited with the surface <S> and the point VLocation.
//! The method is quick and its precision is enough for many cases of analytical
//! surfaces.
//! Non-adaptive 2D Gauss integration with predefined numbers of Gauss points
//! is used. Numbers of points depend on types of surfaces and curves.
//! Error of the computation is not calculated.
Standard_EXPORT BRepGProp_Vinert(BRepGProp_Face& S, BRepGProp_Domain& D, const gp_Pnt& O, const gp_Pnt& VLocation);
//! Computes the global properties of the region of 3D space
//! delimited with the surface <S> and the point VLocation.
//! Adaptive 2D Gauss integration is used.
//! Parameter Eps sets maximal relative error of computed mass (volume) for face.
//! Error is calculated as Abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values
//! for two successive steps of adaptive integration.
//! WARNING: if Eps > 0.001 algorithm performs non-adaptive integration.
Standard_EXPORT BRepGProp_Vinert(BRepGProp_Face& S, BRepGProp_Domain& D, const gp_Pnt& O, const gp_Pnt& VLocation, const Standard_Real Eps);
//! Computes the global properties of the region of 3D space
//! delimited with the surface <S> and the plane Pln.
//! The method is quick and its precision is enough for many cases of analytical
//! surfaces.
//! Non-adaptive 2D Gauss integration with predefined numbers of Gauss points
//! is used. Numbers of points depend on types of surfaces and curves.
//! Error of the computation is not calculated.
Standard_EXPORT BRepGProp_Vinert(BRepGProp_Face& S, BRepGProp_Domain& D, const gp_Pln& Pl, const gp_Pnt& VLocation);
//! Computes the global properties of the region of 3D space
//! delimited with the surface <S> and the plane Pln.
//! Adaptive 2D Gauss integration is used.
//! Parameter Eps sets maximal relative error of computed mass (volume) for face.
//! Error is calculated as Abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values
//! for two successive steps of adaptive integration.
//! WARNING: if Eps > 0.001 algorithm performs non-adaptive integration.
Standard_EXPORT BRepGProp_Vinert(BRepGProp_Face& S, BRepGProp_Domain& D, const gp_Pln& Pl, const gp_Pnt& VLocation, const Standard_Real Eps);
Standard_EXPORT void SetLocation (const gp_Pnt& VLocation);
Standard_EXPORT void Perform (const BRepGProp_Face& S);
Standard_EXPORT Standard_Real Perform (BRepGProp_Face& S, const Standard_Real Eps);
Standard_EXPORT void Perform (const BRepGProp_Face& S, const gp_Pnt& O);
Standard_EXPORT Standard_Real Perform (BRepGProp_Face& S, const gp_Pnt& O, const Standard_Real Eps);
Standard_EXPORT void Perform (const BRepGProp_Face& S, const gp_Pln& Pl);
Standard_EXPORT Standard_Real Perform (BRepGProp_Face& S, const gp_Pln& Pl, const Standard_Real Eps);
Standard_EXPORT void Perform (BRepGProp_Face& S, BRepGProp_Domain& D);
Standard_EXPORT Standard_Real Perform (BRepGProp_Face& S, BRepGProp_Domain& D, const Standard_Real Eps);
Standard_EXPORT void Perform (BRepGProp_Face& S, BRepGProp_Domain& D, const gp_Pnt& O);
Standard_EXPORT Standard_Real Perform (BRepGProp_Face& S, BRepGProp_Domain& D, const gp_Pnt& O, const Standard_Real Eps);
Standard_EXPORT void Perform (BRepGProp_Face& S, BRepGProp_Domain& D, const gp_Pln& Pl);
Standard_EXPORT Standard_Real Perform (BRepGProp_Face& S, BRepGProp_Domain& D, const gp_Pln& Pl, const Standard_Real Eps);
//! If previously used methods containe Eps parameter
//! gets actual relative error of the computation, else returns 1.0.
Standard_EXPORT Standard_Real GetEpsilon();
protected:
private:
Standard_Real myEpsilon;
};
#endif // _BRepGProp_Vinert_HeaderFile

View File

@@ -1,244 +0,0 @@
-- Created on: 2005-12-21
-- Created by: Sergey KHROMOV
-- Copyright (c) 2005-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 VinertGK from BRepGProp inherits GProps from GProp
---Purpose: Computes the global properties of a geometric solid
-- (3D closed region of space) delimited with :
-- - a point and a surface
-- - a plane and a surface
--
-- The surface can be :
-- - a surface limited with its parametric values U-V,
-- (naturally restricted)
-- - a surface limited in U-V space with its boundary
-- curves.
--
-- The surface's requirements to evaluate the global
-- properties are defined in the template FaceTool class from
-- the package GProp.
--
-- The adaptive 2D algorithm of Gauss-Kronrod integration of
-- double integral is used.
--
-- The inner integral is computed along U parameter of
-- surface. The integrand function is encapsulated in the
-- support class UFunction that is defined below.
--
-- The outer integral is computed along T parameter of a
-- bounding curve. The integrand function is encapsulated in
-- the support class TFunction that is defined below.
uses
Pnt from gp,
XYZ from gp,
Pln from gp,
Address from Standard,
Boolean from Standard,
Real from Standard,
Edge from TopoDS,
Face from BRepGProp,
Domain from BRepGProp
-- Template class functions. Used for integration. Begin
is
Create
---Purpose: Empty constructor.
---C++: inline
returns VinertGK;
Create(theSurface : in out Face from BRepGProp;
theLocation : Pnt from gp;
theTolerance: Real from Standard = 0.001;
theCGFlag: Boolean from Standard = Standard_False;
theIFlag: Boolean from Standard = Standard_False)
---Purpose: Constructor. Computes the global properties of a region of
-- 3D space delimited with the naturally restricted surface
-- and the point VLocation.
returns VinertGK;
Create(theSurface : in out Face from BRepGProp;
thePoint : Pnt from gp;
theLocation : Pnt from gp;
theTolerance: Real from Standard = 0.001;
theCGFlag: Boolean from Standard = Standard_False;
theIFlag: Boolean from Standard = Standard_False)
---Purpose: Constructor. Computes the global properties of a region of
-- 3D space delimited with the naturally restricted surface
-- and the point VLocation. The inertia is computed with
-- respect to thePoint.
returns VinertGK;
Create(theSurface : in out Face from BRepGProp;
theDomain : in out Domain from BRepGProp;
theLocation : Pnt from gp;
theTolerance: Real from Standard = 0.001;
theCGFlag: Boolean from Standard = Standard_False;
theIFlag: Boolean from Standard = Standard_False)
---Purpose: Constructor. Computes the global properties of a region of
-- 3D space delimited with the surface bounded by the domain
-- and the point VLocation.
returns VinertGK;
Create(theSurface : in out Face from BRepGProp;
theDomain : in out Domain from BRepGProp;
thePoint : Pnt from gp;
theLocation : Pnt from gp;
theTolerance: Real from Standard = 0.001;
theCGFlag: Boolean from Standard = Standard_False;
theIFlag: Boolean from Standard = Standard_False)
---Purpose: Constructor. Computes the global properties of a region of
-- 3D space delimited with the surface bounded by the domain
-- and the point VLocation. The inertia is computed with
-- respect to thePoint.
returns VinertGK;
Create(theSurface : in out Face from BRepGProp;
thePlane : Pln from gp;
theLocation : Pnt from gp;
theTolerance: Real from Standard = 0.001;
theCGFlag: Boolean from Standard = Standard_False;
theIFlag: Boolean from Standard = Standard_False)
---Purpose: Constructor. Computes the global properties of a region of
-- 3D space delimited with the naturally restricted surface
-- and the plane.
returns VinertGK;
Create(theSurface : in out Face from BRepGProp;
theDomain : in out Domain from BRepGProp;
thePlane : Pln from gp;
theLocation : Pnt from gp;
theTolerance: Real from Standard = 0.001;
theCGFlag: Boolean from Standard = Standard_False;
theIFlag: Boolean from Standard = Standard_False)
---Purpose: Constructor. Computes the global properties of a region of
-- 3D space delimited with the surface bounded by the domain
-- and the plane.
returns VinertGK;
SetLocation(me: in out; theLocation: Pnt from gp);
---Purpose: Sets the vertex that delimit 3D closed region of space.
---C++: inline
Perform(me: in out; theSurface : in out Face from BRepGProp;
theTolerance: Real from Standard = 0.001;
theCGFlag: Boolean from Standard = Standard_False;
theIFlag: Boolean from Standard = Standard_False)
---Purpose: Computes the global properties of a region of 3D space
-- delimited with the naturally restricted surface and the
-- point VLocation.
returns Real from Standard;
Perform(me: in out; theSurface : in out Face from BRepGProp;
thePoint : Pnt from gp;
theTolerance: Real from Standard = 0.001;
theCGFlag: Boolean from Standard = Standard_False;
theIFlag: Boolean from Standard = Standard_False)
---Purpose: Computes the global properties of a region of 3D space
-- delimited with the naturally restricted surface and the
-- point VLocation. The inertia is computed with respect to
-- thePoint.
returns Real from Standard;
Perform(me: in out; theSurface : in out Face from BRepGProp;
theDomain : in out Domain from BRepGProp;
theTolerance: Real from Standard = 0.001;
theCGFlag: Boolean from Standard = Standard_False;
theIFlag: Boolean from Standard = Standard_False)
---Purpose: Computes the global properties of a region of 3D space
-- delimited with the surface bounded by the domain and the
-- point VLocation.
returns Real from Standard;
Perform(me: in out; theSurface : in out Face from BRepGProp;
theDomain : in out Domain from BRepGProp;
thePoint : Pnt from gp;
theTolerance: Real from Standard = 0.001;
theCGFlag: Boolean from Standard = Standard_False;
theIFlag: Boolean from Standard = Standard_False)
---Purpose: Computes the global properties of a region of 3D space
-- delimited with the surface bounded by the domain and the
-- point VLocation. The inertia is computed with respect to
-- thePoint.
returns Real from Standard;
Perform(me: in out; theSurface : in out Face from BRepGProp;
thePlane : Pln from gp;
theTolerance: Real from Standard = 0.001;
theCGFlag: Boolean from Standard = Standard_False;
theIFlag: Boolean from Standard = Standard_False)
---Purpose: Computes the global properties of a region of 3D space
-- delimited with the naturally restricted surface and the
-- plane.
returns Real from Standard;
Perform(me: in out; theSurface : in out Face from BRepGProp;
theDomain : in out Domain from BRepGProp;
thePlane : Pln from gp;
theTolerance: Real from Standard = 0.001;
theCGFlag: Boolean from Standard = Standard_False;
theIFlag: Boolean from Standard = Standard_False)
---Purpose: Computes the global properties of a region of 3D space
-- delimited with the surface bounded by the domain and the
-- plane.
returns Real from Standard;
GetErrorReached(me)
---Purpose: Returns the relative reached computation error.
---C++: inline
returns Real from Standard;
GetAbsolutError(me)
---Purpose: Returns the absolut reached computation error.
---C++: inline
returns Real from Standard;
-----------------------
-- Private methods --
-----------------------
PrivatePerform(me: in out;
theSurface : in out Face from BRepGProp;
thePtrDomain: Address from Standard; -- pointer to Domain from BRepGProp.
IsByPoint : Boolean from Standard;
theCoeffs : Address from Standard;
theTolerance: Real from Standard;
theCGFlag : Boolean from Standard;
theIFlag : Boolean from Standard)
---Purpose: Main method for computation of the global properties that
-- is invoked by each Perform method.
returns Real from Standard
is private;
fields
myErrorReached: Real from Standard;
myAbsolutError: Real from Standard;
end VinertGK;

View File

@@ -13,18 +13,20 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <BRepGProp_VinertGK.ixx>
#include <TColStd_HArray1OfReal.hxx>
#include <TColStd_Array1OfBoolean.hxx>
#include <math_KronrodSingleIntegration.hxx>
#include <BRepGProp_Domain.hxx>
#include <BRepGProp_Face.hxx>
#include <BRepGProp_TFunction.hxx>
#include <BRepGProp_VinertGK.hxx>
#include <gp_Pln.hxx>
#include <gp_Pnt.hxx>
#include <math_KronrodSingleIntegration.hxx>
#include <TColStd_Array1OfBoolean.hxx>
#include <TColStd_HArray1OfReal.hxx>
//==========================================================================
//function : Constructor
//==========================================================================
BRepGProp_VinertGK::BRepGProp_VinertGK(BRepGProp_Face &theSurface,
const gp_Pnt &theLocation,
const Standard_Real theTolerance,

View File

@@ -0,0 +1,171 @@
// Created on: 2005-12-21
// Created by: Sergey KHROMOV
// Copyright (c) 2005-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 _BRepGProp_VinertGK_HeaderFile
#define _BRepGProp_VinertGK_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Real.hxx>
#include <GProp_GProps.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Address.hxx>
class BRepGProp_Face;
class gp_Pnt;
class BRepGProp_Domain;
class gp_Pln;
//! Computes the global properties of a geometric solid
//! (3D closed region of space) delimited with :
//! - a point and a surface
//! - a plane and a surface
//!
//! The surface can be :
//! - a surface limited with its parametric values U-V,
//! (naturally restricted)
//! - a surface limited in U-V space with its boundary
//! curves.
//!
//! The surface's requirements to evaluate the global
//! properties are defined in the template FaceTool class from
//! the package GProp.
//!
//! The adaptive 2D algorithm of Gauss-Kronrod integration of
//! double integral is used.
//!
//! The inner integral is computed along U parameter of
//! surface. The integrand function is encapsulated in the
//! support class UFunction that is defined below.
//!
//! The outer integral is computed along T parameter of a
//! bounding curve. The integrand function is encapsulated in
//! the support class TFunction that is defined below.
class BRepGProp_VinertGK : public GProp_GProps
{
public:
DEFINE_STANDARD_ALLOC
//! Empty constructor.
Standard_EXPORT BRepGProp_VinertGK();
//! Constructor. Computes the global properties of a region of
//! 3D space delimited with the naturally restricted surface
//! and the point VLocation.
Standard_EXPORT BRepGProp_VinertGK(BRepGProp_Face& theSurface, const gp_Pnt& theLocation, const Standard_Real theTolerance = 0.001, const Standard_Boolean theCGFlag = Standard_False, const Standard_Boolean theIFlag = Standard_False);
//! Constructor. Computes the global properties of a region of
//! 3D space delimited with the naturally restricted surface
//! and the point VLocation. The inertia is computed with
//! respect to thePoint.
Standard_EXPORT BRepGProp_VinertGK(BRepGProp_Face& theSurface, const gp_Pnt& thePoint, const gp_Pnt& theLocation, const Standard_Real theTolerance = 0.001, const Standard_Boolean theCGFlag = Standard_False, const Standard_Boolean theIFlag = Standard_False);
//! Constructor. Computes the global properties of a region of
//! 3D space delimited with the surface bounded by the domain
//! and the point VLocation.
Standard_EXPORT BRepGProp_VinertGK(BRepGProp_Face& theSurface, BRepGProp_Domain& theDomain, const gp_Pnt& theLocation, const Standard_Real theTolerance = 0.001, const Standard_Boolean theCGFlag = Standard_False, const Standard_Boolean theIFlag = Standard_False);
//! Constructor. Computes the global properties of a region of
//! 3D space delimited with the surface bounded by the domain
//! and the point VLocation. The inertia is computed with
//! respect to thePoint.
Standard_EXPORT BRepGProp_VinertGK(BRepGProp_Face& theSurface, BRepGProp_Domain& theDomain, const gp_Pnt& thePoint, const gp_Pnt& theLocation, const Standard_Real theTolerance = 0.001, const Standard_Boolean theCGFlag = Standard_False, const Standard_Boolean theIFlag = Standard_False);
//! Constructor. Computes the global properties of a region of
//! 3D space delimited with the naturally restricted surface
//! and the plane.
Standard_EXPORT BRepGProp_VinertGK(BRepGProp_Face& theSurface, const gp_Pln& thePlane, const gp_Pnt& theLocation, const Standard_Real theTolerance = 0.001, const Standard_Boolean theCGFlag = Standard_False, const Standard_Boolean theIFlag = Standard_False);
//! Constructor. Computes the global properties of a region of
//! 3D space delimited with the surface bounded by the domain
//! and the plane.
Standard_EXPORT BRepGProp_VinertGK(BRepGProp_Face& theSurface, BRepGProp_Domain& theDomain, const gp_Pln& thePlane, const gp_Pnt& theLocation, const Standard_Real theTolerance = 0.001, const Standard_Boolean theCGFlag = Standard_False, const Standard_Boolean theIFlag = Standard_False);
//! Sets the vertex that delimit 3D closed region of space.
void SetLocation (const gp_Pnt& theLocation);
//! Computes the global properties of a region of 3D space
//! delimited with the naturally restricted surface and the
//! point VLocation.
Standard_EXPORT Standard_Real Perform (BRepGProp_Face& theSurface, const Standard_Real theTolerance = 0.001, const Standard_Boolean theCGFlag = Standard_False, const Standard_Boolean theIFlag = Standard_False);
//! Computes the global properties of a region of 3D space
//! delimited with the naturally restricted surface and the
//! point VLocation. The inertia is computed with respect to
//! thePoint.
Standard_EXPORT Standard_Real Perform (BRepGProp_Face& theSurface, const gp_Pnt& thePoint, const Standard_Real theTolerance = 0.001, const Standard_Boolean theCGFlag = Standard_False, const Standard_Boolean theIFlag = Standard_False);
//! Computes the global properties of a region of 3D space
//! delimited with the surface bounded by the domain and the
//! point VLocation.
Standard_EXPORT Standard_Real Perform (BRepGProp_Face& theSurface, BRepGProp_Domain& theDomain, const Standard_Real theTolerance = 0.001, const Standard_Boolean theCGFlag = Standard_False, const Standard_Boolean theIFlag = Standard_False);
//! Computes the global properties of a region of 3D space
//! delimited with the surface bounded by the domain and the
//! point VLocation. The inertia is computed with respect to
//! thePoint.
Standard_EXPORT Standard_Real Perform (BRepGProp_Face& theSurface, BRepGProp_Domain& theDomain, const gp_Pnt& thePoint, const Standard_Real theTolerance = 0.001, const Standard_Boolean theCGFlag = Standard_False, const Standard_Boolean theIFlag = Standard_False);
//! Computes the global properties of a region of 3D space
//! delimited with the naturally restricted surface and the
//! plane.
Standard_EXPORT Standard_Real Perform (BRepGProp_Face& theSurface, const gp_Pln& thePlane, const Standard_Real theTolerance = 0.001, const Standard_Boolean theCGFlag = Standard_False, const Standard_Boolean theIFlag = Standard_False);
//! Computes the global properties of a region of 3D space
//! delimited with the surface bounded by the domain and the
//! plane.
Standard_EXPORT Standard_Real Perform (BRepGProp_Face& theSurface, BRepGProp_Domain& theDomain, const gp_Pln& thePlane, const Standard_Real theTolerance = 0.001, const Standard_Boolean theCGFlag = Standard_False, const Standard_Boolean theIFlag = Standard_False);
//! Returns the relative reached computation error.
Standard_Real GetErrorReached() const;
//! Returns the absolut reached computation error.
Standard_Real GetAbsolutError() const;
protected:
private:
//! Main method for computation of the global properties that
//! is invoked by each Perform method.
Standard_EXPORT Standard_Real PrivatePerform (BRepGProp_Face& theSurface, const Standard_Address thePtrDomain, const Standard_Boolean IsByPoint, const Standard_Address theCoeffs, const Standard_Real theTolerance, const Standard_Boolean theCGFlag, const Standard_Boolean theIFlag);
Standard_Real myErrorReached;
Standard_Real myAbsolutError;
};
#include <BRepGProp_VinertGK.lxx>
#endif // _BRepGProp_VinertGK_HeaderFile

View File

@@ -1,2 +1,27 @@
BRepGProp.cxx
BRepGProp.hxx
BRepGProp_Cinert.cxx
BRepGProp_Cinert.hxx
BRepGProp_Domain.cxx
BRepGProp_Domain.hxx
BRepGProp_Domain.lxx
BRepGProp_EdgeTool.cxx
BRepGProp_EdgeTool.hxx
BRepGProp_Face.cxx
BRepGProp_Face.hxx
BRepGProp_Face.lxx
BRepGProp_Gauss.cxx
BRepGProp_Gauss.hxx
BRepGProp_Gauss.cxx
BRepGProp_Sinert.cxx
BRepGProp_Sinert.hxx
BRepGProp_TFunction.cxx
BRepGProp_TFunction.hxx
BRepGProp_TFunction.lxx
BRepGProp_UFunction.cxx
BRepGProp_UFunction.hxx
BRepGProp_UFunction.lxx
BRepGProp_Vinert.cxx
BRepGProp_Vinert.hxx
BRepGProp_VinertGK.cxx
BRepGProp_VinertGK.hxx
BRepGProp_VinertGK.lxx