mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-18 14:27:39 +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:
19
src/GProp/FILES
Normal file
19
src/GProp/FILES
Normal file
@@ -0,0 +1,19 @@
|
||||
GProp.cxx
|
||||
GProp.hxx
|
||||
GProp_CelGProps.cxx
|
||||
GProp_CelGProps.hxx
|
||||
GProp_EquaType.hxx
|
||||
GProp_GProps.cxx
|
||||
GProp_GProps.hxx
|
||||
GProp_PEquation.cxx
|
||||
GProp_PEquation.hxx
|
||||
GProp_PGProps.cxx
|
||||
GProp_PGProps.hxx
|
||||
GProp_PrincipalProps.cxx
|
||||
GProp_PrincipalProps.hxx
|
||||
GProp_SelGProps.cxx
|
||||
GProp_SelGProps.hxx
|
||||
GProp_UndefinedAxis.hxx
|
||||
GProp_ValueType.hxx
|
||||
GProp_VelGProps.cxx
|
||||
GProp_VelGProps.hxx
|
@@ -1,114 +0,0 @@
|
||||
-- Created on: 1991-03-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.
|
||||
|
||||
-- JCV - January 1992
|
||||
|
||||
|
||||
|
||||
package GProp
|
||||
|
||||
--- Purpose:
|
||||
-- This package defines algorithmes to compute the global properties
|
||||
-- of a set of points, a curve, a surface, a solid (non infinite
|
||||
-- region of space delimited with geometric entities), a compound
|
||||
-- geometric system (heterogeneous composition of the previous
|
||||
-- entities).
|
||||
--
|
||||
-- Global properties are :
|
||||
-- . length, area, volume,
|
||||
-- . centre of mass,
|
||||
-- . axis of inertia,
|
||||
-- . moments of inertia,
|
||||
-- . radius of gyration.
|
||||
--
|
||||
-- It provides also a class to compile the average point or
|
||||
-- line of a set of points.
|
||||
|
||||
uses
|
||||
Standard,
|
||||
TColStd,
|
||||
TColgp,
|
||||
gp,
|
||||
math,
|
||||
GeomAbs
|
||||
|
||||
is
|
||||
|
||||
exception UndefinedAxis inherits DomainError;
|
||||
--- Purpose :
|
||||
-- This exception is raised when a method makes reference to
|
||||
-- an undefined inertia axis of symmetry.
|
||||
|
||||
|
||||
enumeration EquaType
|
||||
is Plane, Line, Point, Space, None end;
|
||||
|
||||
enumeration ValueType
|
||||
is Mass,
|
||||
CenterMassX, CenterMassY, CenterMassZ,
|
||||
InertiaXX, InertiaYY, InertiaZZ,
|
||||
InertiaXY, InertiaXZ, InertiaYZ,
|
||||
Unknown
|
||||
end;
|
||||
|
||||
|
||||
|
||||
--- Purpose : Algorithmes :
|
||||
|
||||
|
||||
class GProps;
|
||||
|
||||
class PGProps;
|
||||
|
||||
class CelGProps;
|
||||
|
||||
class SelGProps;
|
||||
|
||||
class VelGProps;
|
||||
|
||||
class PrincipalProps;
|
||||
|
||||
|
||||
-- The following abstract classes define templates
|
||||
-- with the minimum of methods required to implement
|
||||
-- the computation of the global properties for a curve
|
||||
-- or a surface.
|
||||
|
||||
|
||||
--
|
||||
-- Class to compute the average plane or line of a set of points.
|
||||
--
|
||||
|
||||
class PEquation;
|
||||
|
||||
--- Purpose : methods of package
|
||||
|
||||
HOperator (G, Q : Pnt from gp; Mass : Real; Operator : out Mat from gp);
|
||||
--- Purpose : Computes the matrix Operator, referred to as the
|
||||
-- "Huyghens Operator" of a geometric system at the
|
||||
-- point Q of the space, using the following data :
|
||||
-- - Mass, i.e. the mass of the system,
|
||||
-- - G, the center of mass of the system.
|
||||
-- The "Huyghens Operator" is used to compute
|
||||
-- Inertia/Q, the matrix of inertia of the system at
|
||||
-- the point Q using Huyghens' theorem :
|
||||
-- Inertia/Q = Inertia/G + HOperator (Q, G, Mass)
|
||||
-- where Inertia/G is the matrix of inertia of the
|
||||
-- system relative to its center of mass as returned by
|
||||
-- the function MatrixOfInertia on any GProp_GProps object.
|
||||
|
||||
|
||||
end GProp;
|
@@ -12,13 +12,13 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <GProp.ixx>
|
||||
|
||||
#include <Standard_DimensionError.hxx>
|
||||
|
||||
#include <gp.hxx>
|
||||
#include <gp_Mat.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_XYZ.hxx>
|
||||
|
||||
#include <GProp.hxx>
|
||||
#include <Standard_DimensionError.hxx>
|
||||
|
||||
void GProp::HOperator (
|
||||
|
||||
|
104
src/GProp/GProp.hxx
Normal file
104
src/GProp/GProp.hxx
Normal file
@@ -0,0 +1,104 @@
|
||||
// Created on: 1991-03-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 _GProp_HeaderFile
|
||||
#define _GProp_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
class gp_Pnt;
|
||||
class gp_Mat;
|
||||
class GProp_GProps;
|
||||
class GProp_PGProps;
|
||||
class GProp_CelGProps;
|
||||
class GProp_SelGProps;
|
||||
class GProp_VelGProps;
|
||||
class GProp_PrincipalProps;
|
||||
class GProp_PEquation;
|
||||
|
||||
|
||||
|
||||
//! This package defines algorithmes to compute the global properties
|
||||
//! of a set of points, a curve, a surface, a solid (non infinite
|
||||
//! region of space delimited with geometric entities), a compound
|
||||
//! geometric system (heterogeneous composition of the previous
|
||||
//! entities).
|
||||
//!
|
||||
//! Global properties are :
|
||||
//! . length, area, volume,
|
||||
//! . centre of mass,
|
||||
//! . axis of inertia,
|
||||
//! . moments of inertia,
|
||||
//! . radius of gyration.
|
||||
//!
|
||||
//! It provides also a class to compile the average point or
|
||||
//! line of a set of points.
|
||||
class GProp
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! methods of package
|
||||
//! Computes the matrix Operator, referred to as the
|
||||
//! "Huyghens Operator" of a geometric system at the
|
||||
//! point Q of the space, using the following data :
|
||||
//! - Mass, i.e. the mass of the system,
|
||||
//! - G, the center of mass of the system.
|
||||
//! The "Huyghens Operator" is used to compute
|
||||
//! Inertia/Q, the matrix of inertia of the system at
|
||||
//! the point Q using Huyghens' theorem :
|
||||
//! Inertia/Q = Inertia/G + HOperator (Q, G, Mass)
|
||||
//! where Inertia/G is the matrix of inertia of the
|
||||
//! system relative to its center of mass as returned by
|
||||
//! the function MatrixOfInertia on any GProp_GProps object.
|
||||
Standard_EXPORT static void HOperator (const gp_Pnt& G, const gp_Pnt& Q, const Standard_Real Mass, gp_Mat& Operator);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
friend class GProp_GProps;
|
||||
friend class GProp_PGProps;
|
||||
friend class GProp_CelGProps;
|
||||
friend class GProp_SelGProps;
|
||||
friend class GProp_VelGProps;
|
||||
friend class GProp_PrincipalProps;
|
||||
friend class GProp_PEquation;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _GProp_HeaderFile
|
@@ -1,48 +0,0 @@
|
||||
-- Created on: 1992-12-02
|
||||
-- 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 CelGProps from GProp inherits GProps from GProp
|
||||
|
||||
--- Purpose :
|
||||
-- Computes the global properties of bounded curves
|
||||
-- in 3D space.
|
||||
-- It can be an elementary curve from package gp such as
|
||||
-- Lin, Circ, Elips, Parab .
|
||||
|
||||
uses Circ from gp,
|
||||
Lin from gp,
|
||||
Parab from gp,
|
||||
Pnt from gp
|
||||
|
||||
is
|
||||
|
||||
Create returns CelGProps;
|
||||
|
||||
Create (C : Circ from gp; CLocation : Pnt) returns CelGProps;
|
||||
|
||||
Create (C : Circ from gp; U1, U2 : Real; CLocation : Pnt)returns CelGProps;
|
||||
|
||||
Create (C : Lin from gp; U1, U2 : Real; CLocation : Pnt) returns CelGProps;
|
||||
|
||||
SetLocation(me : in out;CLocation : Pnt) ;
|
||||
|
||||
Perform(me : in out; C :Circ; U1,U2 : Real);
|
||||
|
||||
Perform(me : in out; C : Lin ; U1,U2 : Real);
|
||||
|
||||
end CelGProps;
|
||||
|
||||
|
@@ -12,16 +12,19 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <GProp_CelGProps.ixx>
|
||||
#include <GProp.hxx>
|
||||
#include <gp.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp.hxx>
|
||||
|
||||
#include <ElCLib.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <gp.hxx>
|
||||
#include <gp_Circ.hxx>
|
||||
#include <gp_Lin.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <GProp.hxx>
|
||||
#include <GProp_CelGProps.hxx>
|
||||
#include <math_Jacobi.hxx>
|
||||
#include <math_Matrix.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
#include <math_Jacobi.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
|
||||
GProp_CelGProps::GProp_CelGProps(){}
|
||||
|
||||
|
80
src/GProp/GProp_CelGProps.hxx
Normal file
80
src/GProp/GProp_CelGProps.hxx
Normal file
@@ -0,0 +1,80 @@
|
||||
// Created on: 1992-12-02
|
||||
// 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 _GProp_CelGProps_HeaderFile
|
||||
#define _GProp_CelGProps_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <GProp_GProps.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
class gp_Circ;
|
||||
class gp_Pnt;
|
||||
class gp_Lin;
|
||||
|
||||
|
||||
|
||||
//! Computes the global properties of bounded curves
|
||||
//! in 3D space.
|
||||
//! It can be an elementary curve from package gp such as
|
||||
//! Lin, Circ, Elips, Parab .
|
||||
class GProp_CelGProps : public GProp_GProps
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT GProp_CelGProps();
|
||||
|
||||
Standard_EXPORT GProp_CelGProps(const gp_Circ& C, const gp_Pnt& CLocation);
|
||||
|
||||
Standard_EXPORT GProp_CelGProps(const gp_Circ& C, const Standard_Real U1, const Standard_Real U2, const gp_Pnt& CLocation);
|
||||
|
||||
Standard_EXPORT GProp_CelGProps(const gp_Lin& C, const Standard_Real U1, const Standard_Real U2, const gp_Pnt& CLocation);
|
||||
|
||||
Standard_EXPORT void SetLocation (const gp_Pnt& CLocation);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Circ& C, const Standard_Real U1, const Standard_Real U2);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Lin& C, const Standard_Real U1, const Standard_Real U2);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _GProp_CelGProps_HeaderFile
|
30
src/GProp/GProp_EquaType.hxx
Normal file
30
src/GProp/GProp_EquaType.hxx
Normal file
@@ -0,0 +1,30 @@
|
||||
// Created on: 1991-03-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 _GProp_EquaType_HeaderFile
|
||||
#define _GProp_EquaType_HeaderFile
|
||||
|
||||
|
||||
enum GProp_EquaType
|
||||
{
|
||||
GProp_Plane,
|
||||
GProp_Line,
|
||||
GProp_Point,
|
||||
GProp_Space,
|
||||
GProp_None
|
||||
};
|
||||
|
||||
#endif // _GProp_EquaType_HeaderFile
|
@@ -1,283 +0,0 @@
|
||||
-- Created on: 1992-08-24
|
||||
-- Created by: Michel CHAUVAT
|
||||
-- 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.
|
||||
|
||||
-- JCV January 1992
|
||||
|
||||
|
||||
class GProps from GProp
|
||||
|
||||
--- Purpose :
|
||||
-- Implements a general mechanism to compute the global properties of
|
||||
-- a "compound geometric system" in 3d space by composition of the
|
||||
-- global properties of "elementary geometric entities" such as
|
||||
-- (curve, surface, solid, set of points). It is possible to compose
|
||||
-- the properties of several "compound geometric systems" too.
|
||||
--
|
||||
-- To computes the global properties of a compound geometric
|
||||
-- system you should :
|
||||
-- . declare the GProps using a constructor which initializes the
|
||||
-- GProps and defines the location point used to compute the inertia
|
||||
-- . compose the global properties of your geometric components with
|
||||
-- the properties of your system using the method Add.
|
||||
--
|
||||
-- To compute the global properties of the geometric components of
|
||||
-- the system you should use the services of the following classes :
|
||||
-- - class PGProps for a set of points,
|
||||
-- - class CGProps for a curve,
|
||||
-- - class SGProps for a surface,
|
||||
-- - class VGProps for a "solid".
|
||||
-- The classes CGProps, SGProps, VGProps are generic classes and
|
||||
-- must be instantiated for your application.
|
||||
--
|
||||
--
|
||||
-- The global properties computed are :
|
||||
-- - the dimension (length, area or volume)
|
||||
-- - the mass,
|
||||
-- - the centre of mass,
|
||||
-- - the moments of inertia (static moments and quadratic moments),
|
||||
-- - the moment about an axis,
|
||||
-- - the radius of gyration about an axis,
|
||||
-- - the principal properties of inertia :
|
||||
-- (sea also class PrincipalProps)
|
||||
-- . the principal moments,
|
||||
-- . the principal axis of inertia,
|
||||
-- . the principal radius of gyration,
|
||||
--
|
||||
--
|
||||
--
|
||||
-- Example of utilisation in a simplified C++ implementation :
|
||||
--
|
||||
-- //declares the GProps, the point (0.0, 0.0, 0.0) of the
|
||||
-- //absolute cartesian coordinate system is used as
|
||||
-- //default reference point to compute the centre of mass
|
||||
-- GProp_GProps System ();
|
||||
--
|
||||
-- //computes the inertia of a 3d curve
|
||||
-- Your_CGProps Component1 (curve, ....);
|
||||
--
|
||||
-- //computes the inertia of surfaces
|
||||
-- Your_SGprops Component2 (surface1, ....);
|
||||
-- Your_SGprops Component3 (surface2,....);
|
||||
--
|
||||
-- //composes the global properties of components 1, 2, 3
|
||||
-- //a density can be associated with the components, the
|
||||
-- //density can be defaulted to 1.
|
||||
-- Real Density1 = 2.0;
|
||||
-- Real Density2 = 3.0;
|
||||
-- System.Add (Component1, Density1);
|
||||
-- System.Add (Component2, Density2);
|
||||
-- System.Add (Component3);
|
||||
--
|
||||
-- //returns the centre of mass of the system in the
|
||||
-- //absolute cartesian coordinate system
|
||||
-- gp_Pnt G = System.CentreOfMass ();
|
||||
--
|
||||
-- //computes the principales inertia of the system
|
||||
-- GProp_PrincipalProps Pp = System.PrincipalProperties();
|
||||
--
|
||||
-- //returns the principal moments and radius of gyration
|
||||
-- Real Ixx, Iyy, Izz, Rxx, Ryy, Rzz;
|
||||
-- Pp.Moments (Ixx, Iyy, Izz);
|
||||
-- Pp.RadiusOfGyration (Ixx, Iyy, Izz);
|
||||
--
|
||||
--
|
||||
|
||||
uses Ax1 from gp,
|
||||
Mat from gp,
|
||||
Pnt from gp,
|
||||
PrincipalProps from GProp
|
||||
|
||||
raises DomainError from Standard
|
||||
|
||||
is
|
||||
|
||||
Create returns GProps;
|
||||
--- Purpose :
|
||||
-- The origin (0, 0, 0) of the absolute cartesian coordinate system
|
||||
-- is used to compute the global properties.
|
||||
|
||||
|
||||
Create (SystemLocation : Pnt) returns GProps;
|
||||
--- Purpose :
|
||||
-- The point SystemLocation is used to compute the gobal properties
|
||||
-- of the system. For more accuracy it is better to define this
|
||||
-- point closed to the location of the system. For example it could
|
||||
-- be a point around the centre of mass of the system.
|
||||
-- This point is referred to as the reference point for
|
||||
-- this framework. For greater accuracy it is better for
|
||||
-- the reference point to be close to the location of the
|
||||
-- system. It can, for example, be a point near the
|
||||
-- center of mass of the system.
|
||||
-- At initialization, the framework is empty; i.e. it
|
||||
-- retains no dimensional information such as mass, or
|
||||
-- inertia. However, it is now able to bring together
|
||||
-- global properties of various other systems, whose
|
||||
-- global properties have already been computed
|
||||
-- using another framework. To do this, use the
|
||||
-- function Add to define the components of the
|
||||
-- system. Use it once per component of the system,
|
||||
-- and then use the interrogation functions available to
|
||||
-- access the computed values.
|
||||
|
||||
|
||||
Add (me : in out; Item : GProps; Density : Real =1.0)
|
||||
--- Purpose : Either
|
||||
-- - initializes the global properties retained by this
|
||||
-- framework from those retained by the framework Item, or
|
||||
-- - brings together the global properties still retained by
|
||||
-- this framework with those retained by the framework Item.
|
||||
-- The value Density, which is 1.0 by default, is used as
|
||||
-- the density of the system analysed by Item.
|
||||
-- Sometimes the density will have already been given at
|
||||
-- the time of construction of the framework Item. This
|
||||
-- may be the case for example, if Item is a
|
||||
-- GProp_PGProps framework built to compute the
|
||||
-- global properties of a set of points ; or another
|
||||
-- GProp_GProps object which already retains
|
||||
-- composite global properties. In these cases the real
|
||||
-- density was perhaps already taken into account at the
|
||||
-- time of construction of Item. Note that this is not
|
||||
-- checked: if the density of parts of the system is taken
|
||||
-- into account two or more times, results of the
|
||||
-- computation will be false.
|
||||
-- Notes :
|
||||
-- - The point relative to which the inertia of Item is
|
||||
-- computed (i.e. the reference point of Item) may be
|
||||
-- different from the reference point in this
|
||||
-- framework. Huygens' theorem is applied
|
||||
-- automatically to transfer inertia values to the
|
||||
-- reference point in this framework.
|
||||
-- - The function Add is used once per component of
|
||||
-- the system. After that, you use the interrogation
|
||||
-- functions available to access values computed for the system.
|
||||
-- - The system whose global properties are already
|
||||
-- brought together by this framework is referred to
|
||||
-- as the current system. However, the current system
|
||||
-- is not retained by this framework, which maintains
|
||||
-- only its global properties.
|
||||
-- Exceptions
|
||||
-- Standard_DomainError if Density is less than or
|
||||
-- equal to gp::Resolution().
|
||||
raises DomainError
|
||||
is static;
|
||||
|
||||
|
||||
|
||||
Mass (me) returns Real is static;
|
||||
--- Purpose: Returns the mass of the current system.
|
||||
-- If no density is attached to the components of the
|
||||
-- current system the returned value corresponds to :
|
||||
-- - the total length of the edges of the current
|
||||
-- system if this framework retains only linear
|
||||
-- properties, as is the case for example, when
|
||||
-- using only the LinearProperties function to
|
||||
-- combine properties of lines from shapes, or
|
||||
-- - the total area of the faces of the current system if
|
||||
-- this framework retains only surface properties,
|
||||
-- as is the case for example, when using only the
|
||||
-- SurfaceProperties function to combine
|
||||
-- properties of surfaces from shapes, or
|
||||
-- - the total volume of the solids of the current
|
||||
-- system if this framework retains only volume
|
||||
-- properties, as is the case for example, when
|
||||
-- using only the VolumeProperties function to
|
||||
-- combine properties of volumes from solids.
|
||||
-- Warning
|
||||
-- A length, an area, or a volume is computed in the
|
||||
-- current data unit system. The mass of a single
|
||||
-- object is obtained by multiplying its length, its area
|
||||
-- or its volume by the given density. You must be
|
||||
-- consistent with respect to the units used.
|
||||
|
||||
|
||||
CentreOfMass (me) returns Pnt is static;
|
||||
--- Purpose :
|
||||
-- Returns the center of mass of the current system. If
|
||||
-- the gravitational field is uniform, it is the center of gravity.
|
||||
-- The coordinates returned for the center of mass are
|
||||
-- expressed in the absolute Cartesian coordinate system.
|
||||
|
||||
MatrixOfInertia (me) returns Mat is static;
|
||||
--- Purpose:
|
||||
-- returns the matrix of inertia. It is a symmetrical matrix.
|
||||
-- The coefficients of the matrix are the quadratic moments of
|
||||
-- inertia.
|
||||
--
|
||||
-- | Ixx Ixy Ixz |
|
||||
-- matrix = | Ixy Iyy Iyz |
|
||||
-- | Ixz Iyz Izz |
|
||||
--
|
||||
-- The moments of inertia are denoted by Ixx, Iyy, Izz.
|
||||
-- The products of inertia are denoted by Ixy, Ixz, Iyz.
|
||||
-- The matrix of inertia is returned in the central coordinate
|
||||
-- system (G, Gx, Gy, Gz) where G is the centre of mass of the
|
||||
-- system and Gx, Gy, Gz the directions parallel to the X(1,0,0)
|
||||
-- Y(0,1,0) Z(0,0,1) directions of the absolute cartesian
|
||||
-- coordinate system. It is possible to compute the matrix of
|
||||
-- inertia at another location point using the Huyghens theorem
|
||||
-- (you can use the method of package GProp : HOperator).
|
||||
|
||||
|
||||
StaticMoments (me; Ix, Iy, Iz : out Real) is static;
|
||||
--- Purpose : Returns Ix, Iy, Iz, the static moments of inertia of the
|
||||
-- current system; i.e. the moments of inertia about the
|
||||
-- three axes of the Cartesian coordinate system.
|
||||
|
||||
|
||||
|
||||
MomentOfInertia (me; A : Ax1) returns Real is static;
|
||||
--- Purpose :
|
||||
-- computes the moment of inertia of the material system about the
|
||||
-- axis A.
|
||||
|
||||
|
||||
PrincipalProperties (me) returns PrincipalProps is static;
|
||||
--- Purpose : Computes the principal properties of inertia of the current system.
|
||||
-- There is always a set of axes for which the products
|
||||
-- of inertia of a geometric system are equal to 0; i.e. the
|
||||
-- matrix of inertia of the system is diagonal. These axes
|
||||
-- are the principal axes of inertia. Their origin is
|
||||
-- coincident with the center of mass of the system. The
|
||||
-- associated moments are called the principal moments of inertia.
|
||||
-- This function computes the eigen values and the
|
||||
-- eigen vectors of the matrix of inertia of the system.
|
||||
-- Results are stored by using a presentation framework
|
||||
-- of principal properties of inertia
|
||||
-- (GProp_PrincipalProps object) which may be
|
||||
-- queried to access the value sought.
|
||||
|
||||
|
||||
|
||||
RadiusOfGyration (me; A : Ax1) returns Real is static;
|
||||
--- Purpose : Returns the radius of gyration of the current system about the axis A.
|
||||
|
||||
|
||||
|
||||
|
||||
fields
|
||||
|
||||
g : Pnt is protected;
|
||||
--- Purpose : centre of mass
|
||||
loc : Pnt is protected;
|
||||
--- Purpose : location point used to compute the inertia
|
||||
dim : Real is protected;
|
||||
--- Purpose : mass or length or area or volume of the GProps
|
||||
inertia : Mat is protected;
|
||||
--- Purpose : matrix of inertia
|
||||
|
||||
end GProps;
|
||||
|
||||
|
@@ -12,14 +12,18 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <GProp_GProps.ixx>
|
||||
#include <GProp.hxx>
|
||||
#include <math_Jacobi.hxx>
|
||||
#include <gp.hxx>
|
||||
#include <gp.hxx>
|
||||
#include <gp_XYZ.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
|
||||
#include <gp.hxx>
|
||||
#include <gp_Ax1.hxx>
|
||||
#include <gp_Mat.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp_XYZ.hxx>
|
||||
#include <GProp.hxx>
|
||||
#include <GProp_GProps.hxx>
|
||||
#include <GProp_PrincipalProps.hxx>
|
||||
#include <math_Jacobi.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
|
||||
GProp_GProps::GProp_GProps () : g (gp::Origin()) , loc (gp::Origin()), dim (0.0)
|
||||
{
|
||||
|
285
src/GProp/GProp_GProps.hxx
Normal file
285
src/GProp/GProp_GProps.hxx
Normal file
@@ -0,0 +1,285 @@
|
||||
// Created on: 1992-08-24
|
||||
// Created by: Michel CHAUVAT
|
||||
// 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 _GProp_GProps_HeaderFile
|
||||
#define _GProp_GProps_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <gp_Mat.hxx>
|
||||
class Standard_DomainError;
|
||||
class gp_Pnt;
|
||||
class gp_Mat;
|
||||
class gp_Ax1;
|
||||
class GProp_PrincipalProps;
|
||||
|
||||
|
||||
|
||||
//! Implements a general mechanism to compute the global properties of
|
||||
//! a "compound geometric system" in 3d space by composition of the
|
||||
//! global properties of "elementary geometric entities" such as
|
||||
//! (curve, surface, solid, set of points). It is possible to compose
|
||||
//! the properties of several "compound geometric systems" too.
|
||||
//!
|
||||
//! To computes the global properties of a compound geometric
|
||||
//! system you should :
|
||||
//! . declare the GProps using a constructor which initializes the
|
||||
//! GProps and defines the location point used to compute the inertia
|
||||
//! . compose the global properties of your geometric components with
|
||||
//! the properties of your system using the method Add.
|
||||
//!
|
||||
//! To compute the global properties of the geometric components of
|
||||
//! the system you should use the services of the following classes :
|
||||
//! - class PGProps for a set of points,
|
||||
//! - class CGProps for a curve,
|
||||
//! - class SGProps for a surface,
|
||||
//! - class VGProps for a "solid".
|
||||
//! The classes CGProps, SGProps, VGProps are generic classes and
|
||||
//! must be instantiated for your application.
|
||||
//!
|
||||
//! The global properties computed are :
|
||||
//! - the dimension (length, area or volume)
|
||||
//! - the mass,
|
||||
//! - the centre of mass,
|
||||
//! - the moments of inertia (static moments and quadratic moments),
|
||||
//! - the moment about an axis,
|
||||
//! - the radius of gyration about an axis,
|
||||
//! - the principal properties of inertia :
|
||||
//! (sea also class PrincipalProps)
|
||||
//! . the principal moments,
|
||||
//! . the principal axis of inertia,
|
||||
//! . the principal radius of gyration,
|
||||
//!
|
||||
//! Example of utilisation in a simplified C++ implementation :
|
||||
//!
|
||||
//! //declares the GProps, the point (0.0, 0.0, 0.0) of the
|
||||
//! //absolute cartesian coordinate system is used as
|
||||
//! //default reference point to compute the centre of mass
|
||||
//! GProp_GProps System ();
|
||||
//!
|
||||
//! //computes the inertia of a 3d curve
|
||||
//! Your_CGProps Component1 (curve, ....);
|
||||
//!
|
||||
//! //computes the inertia of surfaces
|
||||
//! Your_SGprops Component2 (surface1, ....);
|
||||
//! Your_SGprops Component3 (surface2,....);
|
||||
//!
|
||||
//! //composes the global properties of components 1, 2, 3
|
||||
//! //a density can be associated with the components, the
|
||||
//! //density can be defaulted to 1.
|
||||
//! Real Density1 = 2.0;
|
||||
//! Real Density2 = 3.0;
|
||||
//! System.Add (Component1, Density1);
|
||||
//! System.Add (Component2, Density2);
|
||||
//! System.Add (Component3);
|
||||
//!
|
||||
//! //returns the centre of mass of the system in the
|
||||
//! //absolute cartesian coordinate system
|
||||
//! gp_Pnt G = System.CentreOfMass ();
|
||||
//!
|
||||
//! //computes the principales inertia of the system
|
||||
//! GProp_PrincipalProps Pp = System.PrincipalProperties();
|
||||
//!
|
||||
//! //returns the principal moments and radius of gyration
|
||||
//! Real Ixx, Iyy, Izz, Rxx, Ryy, Rzz;
|
||||
//! Pp.Moments (Ixx, Iyy, Izz);
|
||||
//! Pp.RadiusOfGyration (Ixx, Iyy, Izz);
|
||||
class GProp_GProps
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
|
||||
//! The origin (0, 0, 0) of the absolute cartesian coordinate system
|
||||
//! is used to compute the global properties.
|
||||
Standard_EXPORT GProp_GProps();
|
||||
|
||||
|
||||
//! The point SystemLocation is used to compute the gobal properties
|
||||
//! of the system. For more accuracy it is better to define this
|
||||
//! point closed to the location of the system. For example it could
|
||||
//! be a point around the centre of mass of the system.
|
||||
//! This point is referred to as the reference point for
|
||||
//! this framework. For greater accuracy it is better for
|
||||
//! the reference point to be close to the location of the
|
||||
//! system. It can, for example, be a point near the
|
||||
//! center of mass of the system.
|
||||
//! At initialization, the framework is empty; i.e. it
|
||||
//! retains no dimensional information such as mass, or
|
||||
//! inertia. However, it is now able to bring together
|
||||
//! global properties of various other systems, whose
|
||||
//! global properties have already been computed
|
||||
//! using another framework. To do this, use the
|
||||
//! function Add to define the components of the
|
||||
//! system. Use it once per component of the system,
|
||||
//! and then use the interrogation functions available to
|
||||
//! access the computed values.
|
||||
Standard_EXPORT GProp_GProps(const gp_Pnt& SystemLocation);
|
||||
|
||||
//! Either
|
||||
//! - initializes the global properties retained by this
|
||||
//! framework from those retained by the framework Item, or
|
||||
//! - brings together the global properties still retained by
|
||||
//! this framework with those retained by the framework Item.
|
||||
//! The value Density, which is 1.0 by default, is used as
|
||||
//! the density of the system analysed by Item.
|
||||
//! Sometimes the density will have already been given at
|
||||
//! the time of construction of the framework Item. This
|
||||
//! may be the case for example, if Item is a
|
||||
//! GProp_PGProps framework built to compute the
|
||||
//! global properties of a set of points ; or another
|
||||
//! GProp_GProps object which already retains
|
||||
//! composite global properties. In these cases the real
|
||||
//! density was perhaps already taken into account at the
|
||||
//! time of construction of Item. Note that this is not
|
||||
//! checked: if the density of parts of the system is taken
|
||||
//! into account two or more times, results of the
|
||||
//! computation will be false.
|
||||
//! Notes :
|
||||
//! - The point relative to which the inertia of Item is
|
||||
//! computed (i.e. the reference point of Item) may be
|
||||
//! different from the reference point in this
|
||||
//! framework. Huygens' theorem is applied
|
||||
//! automatically to transfer inertia values to the
|
||||
//! reference point in this framework.
|
||||
//! - The function Add is used once per component of
|
||||
//! the system. After that, you use the interrogation
|
||||
//! functions available to access values computed for the system.
|
||||
//! - The system whose global properties are already
|
||||
//! brought together by this framework is referred to
|
||||
//! as the current system. However, the current system
|
||||
//! is not retained by this framework, which maintains
|
||||
//! only its global properties.
|
||||
//! Exceptions
|
||||
//! Standard_DomainError if Density is less than or
|
||||
//! equal to gp::Resolution().
|
||||
Standard_EXPORT void Add (const GProp_GProps& Item, const Standard_Real Density = 1.0);
|
||||
|
||||
//! Returns the mass of the current system.
|
||||
//! If no density is attached to the components of the
|
||||
//! current system the returned value corresponds to :
|
||||
//! - the total length of the edges of the current
|
||||
//! system if this framework retains only linear
|
||||
//! properties, as is the case for example, when
|
||||
//! using only the LinearProperties function to
|
||||
//! combine properties of lines from shapes, or
|
||||
//! - the total area of the faces of the current system if
|
||||
//! this framework retains only surface properties,
|
||||
//! as is the case for example, when using only the
|
||||
//! SurfaceProperties function to combine
|
||||
//! properties of surfaces from shapes, or
|
||||
//! - the total volume of the solids of the current
|
||||
//! system if this framework retains only volume
|
||||
//! properties, as is the case for example, when
|
||||
//! using only the VolumeProperties function to
|
||||
//! combine properties of volumes from solids.
|
||||
//! Warning
|
||||
//! A length, an area, or a volume is computed in the
|
||||
//! current data unit system. The mass of a single
|
||||
//! object is obtained by multiplying its length, its area
|
||||
//! or its volume by the given density. You must be
|
||||
//! consistent with respect to the units used.
|
||||
Standard_EXPORT Standard_Real Mass() const;
|
||||
|
||||
|
||||
//! Returns the center of mass of the current system. If
|
||||
//! the gravitational field is uniform, it is the center of gravity.
|
||||
//! The coordinates returned for the center of mass are
|
||||
//! expressed in the absolute Cartesian coordinate system.
|
||||
Standard_EXPORT gp_Pnt CentreOfMass() const;
|
||||
|
||||
|
||||
//! returns the matrix of inertia. It is a symmetrical matrix.
|
||||
//! The coefficients of the matrix are the quadratic moments of
|
||||
//! inertia.
|
||||
//!
|
||||
//! | Ixx Ixy Ixz |
|
||||
//! matrix = | Ixy Iyy Iyz |
|
||||
//! | Ixz Iyz Izz |
|
||||
//!
|
||||
//! The moments of inertia are denoted by Ixx, Iyy, Izz.
|
||||
//! The products of inertia are denoted by Ixy, Ixz, Iyz.
|
||||
//! The matrix of inertia is returned in the central coordinate
|
||||
//! system (G, Gx, Gy, Gz) where G is the centre of mass of the
|
||||
//! system and Gx, Gy, Gz the directions parallel to the X(1,0,0)
|
||||
//! Y(0,1,0) Z(0,0,1) directions of the absolute cartesian
|
||||
//! coordinate system. It is possible to compute the matrix of
|
||||
//! inertia at another location point using the Huyghens theorem
|
||||
//! (you can use the method of package GProp : HOperator).
|
||||
Standard_EXPORT gp_Mat MatrixOfInertia() const;
|
||||
|
||||
//! Returns Ix, Iy, Iz, the static moments of inertia of the
|
||||
//! current system; i.e. the moments of inertia about the
|
||||
//! three axes of the Cartesian coordinate system.
|
||||
Standard_EXPORT void StaticMoments (Standard_Real& Ix, Standard_Real& Iy, Standard_Real& Iz) const;
|
||||
|
||||
|
||||
//! computes the moment of inertia of the material system about the
|
||||
//! axis A.
|
||||
Standard_EXPORT Standard_Real MomentOfInertia (const gp_Ax1& A) const;
|
||||
|
||||
//! Computes the principal properties of inertia of the current system.
|
||||
//! There is always a set of axes for which the products
|
||||
//! of inertia of a geometric system are equal to 0; i.e. the
|
||||
//! matrix of inertia of the system is diagonal. These axes
|
||||
//! are the principal axes of inertia. Their origin is
|
||||
//! coincident with the center of mass of the system. The
|
||||
//! associated moments are called the principal moments of inertia.
|
||||
//! This function computes the eigen values and the
|
||||
//! eigen vectors of the matrix of inertia of the system.
|
||||
//! Results are stored by using a presentation framework
|
||||
//! of principal properties of inertia
|
||||
//! (GProp_PrincipalProps object) which may be
|
||||
//! queried to access the value sought.
|
||||
Standard_EXPORT GProp_PrincipalProps PrincipalProperties() const;
|
||||
|
||||
//! Returns the radius of gyration of the current system about the axis A.
|
||||
Standard_EXPORT Standard_Real RadiusOfGyration (const gp_Ax1& A) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
gp_Pnt g;
|
||||
gp_Pnt loc;
|
||||
Standard_Real dim;
|
||||
gp_Mat inertia;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _GProp_GProps_HeaderFile
|
@@ -1,145 +0,0 @@
|
||||
-- Created on: 1993-06-16
|
||||
-- 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 PEquation from GProp
|
||||
|
||||
---Purpose: A framework to analyze a collection - or cloud
|
||||
-- - of points and to verify if they are coincident,
|
||||
-- collinear or coplanar within a given precision. If
|
||||
-- so, it also computes the mean point, the mean
|
||||
-- line or the mean plane of the points. If not, it
|
||||
-- computes the minimal box which includes all the points.
|
||||
|
||||
|
||||
uses Pnt from gp,
|
||||
Pln from gp,
|
||||
Lin from gp,
|
||||
Vec from gp,
|
||||
EquaType from GProp,
|
||||
Array1OfPnt from TColgp
|
||||
|
||||
|
||||
raises NoSuchObject from Standard
|
||||
|
||||
is
|
||||
|
||||
Create(Pnts: Array1OfPnt;Tol : Real from Standard)
|
||||
returns PEquation from GProp;
|
||||
---Purpose: Constructs a framework to analyze the
|
||||
-- collection of points Pnts and computes:
|
||||
-- - the mean point if the points in question are
|
||||
-- considered to be coincident within the precision Tol, or
|
||||
-- - the mean line if they are considered to be
|
||||
-- collinear within the precision Tol, or
|
||||
-- - the mean plane if they are considered to be
|
||||
-- coplanar within the precision Tol, or
|
||||
-- - the minimal box which contains all the points. Use :
|
||||
-- - the functions IsPoint, IsLinear, IsPlanar
|
||||
-- and IsSpace to find the result of the analysis, and
|
||||
-- - the function Point, Line, Plane or Box to
|
||||
-- access the computed result.
|
||||
|
||||
IsPlanar(me) returns Boolean
|
||||
---Purpose: Returns true if, according to the given
|
||||
-- tolerance, the points analyzed by this framework are coplanar.
|
||||
-- Use the function Plane to access the computed result.
|
||||
is static;
|
||||
|
||||
IsLinear(me) returns Boolean
|
||||
---Purpose: Returns true if, according to the given
|
||||
-- tolerance, the points analyzed by this framework are colinear.
|
||||
-- Use the function Line to access the computed result.
|
||||
is static;
|
||||
|
||||
IsPoint(me) returns Boolean
|
||||
---Purpose: Returns true if, according to the given
|
||||
-- tolerance, the points analyzed by this framework are coincident.
|
||||
-- Use the function Point to access the computed result.
|
||||
is static;
|
||||
|
||||
IsSpace(me) returns Boolean
|
||||
---Purpose: Returns true if, according to the given
|
||||
-- tolerance value, the points analyzed by this
|
||||
-- framework are neither coincident, nor collinear, nor coplanar.
|
||||
-- Use the function Box to query the smallest box
|
||||
-- that includes the collection of points.
|
||||
is static;
|
||||
|
||||
Plane(me) returns Pln from gp
|
||||
raises NoSuchObject
|
||||
---Purpose: Returns the mean plane passing near all the
|
||||
-- points analyzed by this framework if, according
|
||||
-- to the given precision, the points are considered to be coplanar.
|
||||
-- Exceptions
|
||||
-- Standard_NoSuchObject if, according to the
|
||||
-- given precision value, the points analyzed by
|
||||
-- this framework are considered to be:
|
||||
-- - coincident, or
|
||||
-- - collinear, or
|
||||
-- - not coplanar.
|
||||
is static;
|
||||
|
||||
Line(me) returns Lin from gp
|
||||
raises NoSuchObject
|
||||
---Purpose: Returns the mean line passing near all the
|
||||
-- points analyzed by this framework if, according
|
||||
-- to the given precision value, the points are considered to be collinear.
|
||||
-- Exceptions
|
||||
-- Standard_NoSuchObject if, according to the
|
||||
-- given precision, the points analyzed by this
|
||||
-- framework are considered to be:
|
||||
-- - coincident, or
|
||||
-- - not collinear.
|
||||
is static;
|
||||
|
||||
Point(me) returns Pnt from gp
|
||||
raises NoSuchObject
|
||||
---Purpose: Returns the mean point of all the points
|
||||
-- analyzed by this framework if, according to the
|
||||
-- given precision, the points are considered to be coincident.
|
||||
-- Exceptions
|
||||
-- Standard_NoSuchObject if, according to the
|
||||
-- given precision, the points analyzed by this
|
||||
-- framework are not considered to be coincident.
|
||||
is static;
|
||||
|
||||
Box(me; P : out Pnt from gp; V1,V2,V3 : out Vec from gp)
|
||||
---Purpose: Returns the definition of the smallest box which
|
||||
-- contains all the points analyzed by this
|
||||
-- framework if, according to the given precision
|
||||
-- value, the points are considered to be neither
|
||||
-- coincident, nor collinear and nor coplanar.
|
||||
-- This box is centered on the barycenter P of the
|
||||
-- collection of points. Its sides are parallel to the
|
||||
-- three vectors V1, V2 and V3, the length of
|
||||
-- which is the length of the box in the corresponding direction.
|
||||
-- Note: Vectors V1, V2 and V3 are parallel to
|
||||
-- the three axes of principal inertia of the system
|
||||
-- composed of the collection of points where each point is of equal mass.
|
||||
-- Exceptions
|
||||
-- Standard_NoSuchObject if, according to the given precision,
|
||||
-- the points analyzed by this framework are considered to be coincident, collinear or coplanar.
|
||||
is static;
|
||||
|
||||
fields
|
||||
|
||||
type : EquaType from GProp;
|
||||
g : Pnt from gp;
|
||||
v1 : Vec from gp;
|
||||
v2 : Vec from gp;
|
||||
v3 : Vec from gp;
|
||||
end PEquation;
|
||||
|
@@ -12,9 +12,15 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <GProp_PEquation.ixx>
|
||||
#include <GProp_PrincipalProps.hxx>
|
||||
|
||||
#include <gp_Lin.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <GProp_PEquation.hxx>
|
||||
#include <GProp_PGProps.hxx>
|
||||
#include <GProp_PrincipalProps.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
|
||||
GProp_PEquation::GProp_PEquation(const TColgp_Array1OfPnt& Pnts,
|
||||
const Standard_Real Tol)
|
||||
|
164
src/GProp/GProp_PEquation.hxx
Normal file
164
src/GProp/GProp_PEquation.hxx
Normal file
@@ -0,0 +1,164 @@
|
||||
// Created on: 1993-06-16
|
||||
// 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 _GProp_PEquation_HeaderFile
|
||||
#define _GProp_PEquation_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <GProp_EquaType.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Standard_NoSuchObject;
|
||||
class gp_Pln;
|
||||
class gp_Lin;
|
||||
class gp_Pnt;
|
||||
class gp_Vec;
|
||||
|
||||
|
||||
//! A framework to analyze a collection - or cloud
|
||||
//! - of points and to verify if they are coincident,
|
||||
//! collinear or coplanar within a given precision. If
|
||||
//! so, it also computes the mean point, the mean
|
||||
//! line or the mean plane of the points. If not, it
|
||||
//! computes the minimal box which includes all the points.
|
||||
class GProp_PEquation
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Constructs a framework to analyze the
|
||||
//! collection of points Pnts and computes:
|
||||
//! - the mean point if the points in question are
|
||||
//! considered to be coincident within the precision Tol, or
|
||||
//! - the mean line if they are considered to be
|
||||
//! collinear within the precision Tol, or
|
||||
//! - the mean plane if they are considered to be
|
||||
//! coplanar within the precision Tol, or
|
||||
//! - the minimal box which contains all the points. Use :
|
||||
//! - the functions IsPoint, IsLinear, IsPlanar
|
||||
//! and IsSpace to find the result of the analysis, and
|
||||
//! - the function Point, Line, Plane or Box to
|
||||
//! access the computed result.
|
||||
Standard_EXPORT GProp_PEquation(const TColgp_Array1OfPnt& Pnts, const Standard_Real Tol);
|
||||
|
||||
//! Returns true if, according to the given
|
||||
//! tolerance, the points analyzed by this framework are coplanar.
|
||||
//! Use the function Plane to access the computed result.
|
||||
Standard_EXPORT Standard_Boolean IsPlanar() const;
|
||||
|
||||
//! Returns true if, according to the given
|
||||
//! tolerance, the points analyzed by this framework are colinear.
|
||||
//! Use the function Line to access the computed result.
|
||||
Standard_EXPORT Standard_Boolean IsLinear() const;
|
||||
|
||||
//! Returns true if, according to the given
|
||||
//! tolerance, the points analyzed by this framework are coincident.
|
||||
//! Use the function Point to access the computed result.
|
||||
Standard_EXPORT Standard_Boolean IsPoint() const;
|
||||
|
||||
//! Returns true if, according to the given
|
||||
//! tolerance value, the points analyzed by this
|
||||
//! framework are neither coincident, nor collinear, nor coplanar.
|
||||
//! Use the function Box to query the smallest box
|
||||
//! that includes the collection of points.
|
||||
Standard_EXPORT Standard_Boolean IsSpace() const;
|
||||
|
||||
//! Returns the mean plane passing near all the
|
||||
//! points analyzed by this framework if, according
|
||||
//! to the given precision, the points are considered to be coplanar.
|
||||
//! Exceptions
|
||||
//! Standard_NoSuchObject if, according to the
|
||||
//! given precision value, the points analyzed by
|
||||
//! this framework are considered to be:
|
||||
//! - coincident, or
|
||||
//! - collinear, or
|
||||
//! - not coplanar.
|
||||
Standard_EXPORT gp_Pln Plane() const;
|
||||
|
||||
//! Returns the mean line passing near all the
|
||||
//! points analyzed by this framework if, according
|
||||
//! to the given precision value, the points are considered to be collinear.
|
||||
//! Exceptions
|
||||
//! Standard_NoSuchObject if, according to the
|
||||
//! given precision, the points analyzed by this
|
||||
//! framework are considered to be:
|
||||
//! - coincident, or
|
||||
//! - not collinear.
|
||||
Standard_EXPORT gp_Lin Line() const;
|
||||
|
||||
//! Returns the mean point of all the points
|
||||
//! analyzed by this framework if, according to the
|
||||
//! given precision, the points are considered to be coincident.
|
||||
//! Exceptions
|
||||
//! Standard_NoSuchObject if, according to the
|
||||
//! given precision, the points analyzed by this
|
||||
//! framework are not considered to be coincident.
|
||||
Standard_EXPORT gp_Pnt Point() const;
|
||||
|
||||
//! Returns the definition of the smallest box which
|
||||
//! contains all the points analyzed by this
|
||||
//! framework if, according to the given precision
|
||||
//! value, the points are considered to be neither
|
||||
//! coincident, nor collinear and nor coplanar.
|
||||
//! This box is centered on the barycenter P of the
|
||||
//! collection of points. Its sides are parallel to the
|
||||
//! three vectors V1, V2 and V3, the length of
|
||||
//! which is the length of the box in the corresponding direction.
|
||||
//! Note: Vectors V1, V2 and V3 are parallel to
|
||||
//! the three axes of principal inertia of the system
|
||||
//! composed of the collection of points where each point is of equal mass.
|
||||
//! Exceptions
|
||||
//! Standard_NoSuchObject if, according to the given precision,
|
||||
//! the points analyzed by this framework are considered to be coincident, collinear or coplanar.
|
||||
Standard_EXPORT void Box (gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
GProp_EquaType type;
|
||||
gp_Pnt g;
|
||||
gp_Vec v1;
|
||||
gp_Vec v2;
|
||||
gp_Vec v3;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _GProp_PEquation_HeaderFile
|
@@ -1,182 +0,0 @@
|
||||
-- Created on: 1992-02-14
|
||||
-- Created by: Jean Claude VAUTHIER
|
||||
-- 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 PGProps
|
||||
|
||||
from GProp
|
||||
|
||||
inherits GProps
|
||||
---Purpose: A framework for computing the global properties of a
|
||||
-- set of points.
|
||||
-- A point mass is attached to each point. The global
|
||||
-- mass of the system is the sum of each individual
|
||||
-- mass. By default, the point mass is equal to 1 and the
|
||||
-- mass of a system composed of N points is equal to N.
|
||||
-- Warning
|
||||
-- A framework of this sort provides functions to handle
|
||||
-- sets of points easily. But, like any GProp_GProps
|
||||
-- object, by using the Add function, it can theoretically
|
||||
-- bring together the computed global properties and
|
||||
-- those of a system more complex than a set of points .
|
||||
-- The mass of each point and the density of each
|
||||
-- component of the composed system must be
|
||||
-- coherent. Note that this coherence cannot be checked.
|
||||
-- Nonetheless, you are advised to restrict your use of a
|
||||
-- GProp_PGProps object to a set of points and to
|
||||
-- create a GProp_GProps object in order to bring
|
||||
-- together global properties of different systems.
|
||||
|
||||
uses Pnt from gp,
|
||||
Array1OfPnt from TColgp,
|
||||
Array2OfPnt from TColgp,
|
||||
Array1OfReal from TColStd,
|
||||
Array2OfReal from TColStd
|
||||
|
||||
|
||||
raises DimensionError from Standard,
|
||||
DomainError from Standard
|
||||
|
||||
is
|
||||
|
||||
Create returns PGProps;
|
||||
--- Purpose : Initializes a framework to compute global properties
|
||||
-- on a set of points.
|
||||
-- The point relative to which the inertia of the system is
|
||||
-- computed will be the origin (0, 0, 0) of the
|
||||
-- absolute Cartesian coordinate system.
|
||||
-- At initialization, the framework is empty, i.e. it retains
|
||||
-- no dimensional information such as mass and inertia.
|
||||
-- It is, however, now able to keep global properties of a
|
||||
-- set of points while new points are added using the
|
||||
-- AddPoint function.
|
||||
-- The set of points whose global properties are brought
|
||||
-- together by this framework will then be referred to as
|
||||
-- the current system. The current system is, however,
|
||||
-- not kept by this framework, which only keeps that
|
||||
-- system's global properties. Note that the current
|
||||
-- system may be more complex than a set of points.
|
||||
|
||||
|
||||
AddPoint (me : in out; P : Pnt)
|
||||
--- Purpose : Brings together the global properties already
|
||||
-- retained by this framework with those induced by
|
||||
-- the point Pnt. Pnt may be the first point of the current system.
|
||||
-- A point mass is attached to the point Pnt, it is either
|
||||
-- equal to 1. or to Density.
|
||||
is static;
|
||||
|
||||
|
||||
AddPoint (me : in out; P : Pnt; Density : Real)
|
||||
--- Purpose :
|
||||
-- Adds a new point P with its density in the system of points
|
||||
-- Exceptions
|
||||
-- Standard_DomainError if the mass value Density
|
||||
-- is less than gp::Resolution().
|
||||
raises DomainError
|
||||
is static;
|
||||
|
||||
|
||||
Create (Pnts : Array1OfPnt) returns PGProps;
|
||||
--- Purpose :
|
||||
-- computes the global properties of the system of points Pnts.
|
||||
-- The density of the points are defaulted to all being 1
|
||||
|
||||
|
||||
Create (Pnts : Array2OfPnt) returns PGProps;
|
||||
--- Purpose :
|
||||
-- computes the global properties of the system of points Pnts.
|
||||
-- The density of the points are defaulted to all being 1
|
||||
|
||||
|
||||
Create (Pnts : Array1OfPnt; Density : Array1OfReal) returns PGProps
|
||||
--- Purpose :
|
||||
-- computes the global properties of the system of points Pnts.
|
||||
-- A density is associated with each point.
|
||||
raises DomainError,
|
||||
--- Purpose :
|
||||
-- raises if a density is lower or equal to Resolution from package
|
||||
-- gp.
|
||||
DimensionError;
|
||||
--- Purpose :
|
||||
-- raises if the length of Pnts and the length of Density
|
||||
-- is not the same.
|
||||
|
||||
|
||||
|
||||
Create (Pnts : Array2OfPnt; Density : Array2OfReal) returns PGProps
|
||||
--- Purpose :
|
||||
-- computes the global properties of the system of points Pnts.
|
||||
-- A density is associated with each point.
|
||||
raises DomainError,
|
||||
--- Purpose :
|
||||
-- Raised if a density is lower or equal to Resolution from package
|
||||
-- gp.
|
||||
DimensionError;
|
||||
--- Purpose :
|
||||
-- Raised if the length of Pnts and the length of Density
|
||||
-- is not the same.
|
||||
|
||||
|
||||
|
||||
|
||||
Barycentre (myclass; Pnts : Array1OfPnt from TColgp) returns Pnt;
|
||||
--- Purpose :
|
||||
-- Computes the barycentre of a set of points. The density of the
|
||||
-- points is defaulted to 1.
|
||||
|
||||
|
||||
Barycentre (myclass; Pnts : Array2OfPnt from TColgp) returns Pnt;
|
||||
--- Purpose :
|
||||
-- Computes the barycentre of a set of points. The density of the
|
||||
-- points is defaulted to 1.
|
||||
|
||||
|
||||
Barycentre (myclass; Pnts : Array1OfPnt from TColgp;
|
||||
Density : Array1OfReal from TColStd;
|
||||
Mass : out Real; G : out Pnt)
|
||||
--- Purpose :
|
||||
-- Computes the barycentre of a set of points. A density is associated
|
||||
-- with each point.
|
||||
raises DomainError,
|
||||
--- Purpose :
|
||||
-- raises if a density is lower or equal to Resolution from package
|
||||
-- gp.
|
||||
DimensionError;
|
||||
--- Purpose :
|
||||
-- Raised if the length of Pnts and the length of Density
|
||||
-- is not the same.
|
||||
|
||||
|
||||
Barycentre (myclass; Pnts : Array2OfPnt from TColgp;
|
||||
Density : Array2OfReal from TColStd;
|
||||
Mass : out Real; G : out Pnt)
|
||||
--- Purpose :
|
||||
-- Computes the barycentre of a set of points. A density is associated
|
||||
-- with each point.
|
||||
raises DomainError,
|
||||
--- Purpose :
|
||||
-- Raised if a density is lower or equal to Resolution from package
|
||||
-- gp.
|
||||
DimensionError;
|
||||
--- Purpose :
|
||||
-- Raised if the length of Pnts and the length of Density
|
||||
-- is not the same.
|
||||
|
||||
|
||||
end PGProps;
|
||||
|
||||
|
||||
|
@@ -12,14 +12,15 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <GProp_PGProps.ixx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
#include <Standard_DimensionError.hxx>
|
||||
|
||||
#include <gp.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_XYZ.hxx>
|
||||
//#include <gp.hxx>
|
||||
#include <GProp_PGProps.hxx>
|
||||
#include <Standard_DimensionError.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
|
||||
//#include <gp.hxx>
|
||||
typedef gp_Pnt Pnt;
|
||||
typedef gp_Mat Mat;
|
||||
typedef gp_XYZ XYZ;
|
||||
|
180
src/GProp/GProp_PGProps.hxx
Normal file
180
src/GProp/GProp_PGProps.hxx
Normal file
@@ -0,0 +1,180 @@
|
||||
// Created on: 1992-02-14
|
||||
// Created by: Jean Claude VAUTHIER
|
||||
// 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 _GProp_PGProps_HeaderFile
|
||||
#define _GProp_PGProps_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <GProp_GProps.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <TColgp_Array1OfPnt.hxx>
|
||||
#include <TColgp_Array2OfPnt.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <TColStd_Array2OfReal.hxx>
|
||||
class Standard_DimensionError;
|
||||
class Standard_DomainError;
|
||||
class gp_Pnt;
|
||||
|
||||
|
||||
//! A framework for computing the global properties of a
|
||||
//! set of points.
|
||||
//! A point mass is attached to each point. The global
|
||||
//! mass of the system is the sum of each individual
|
||||
//! mass. By default, the point mass is equal to 1 and the
|
||||
//! mass of a system composed of N points is equal to N.
|
||||
//! Warning
|
||||
//! A framework of this sort provides functions to handle
|
||||
//! sets of points easily. But, like any GProp_GProps
|
||||
//! object, by using the Add function, it can theoretically
|
||||
//! bring together the computed global properties and
|
||||
//! those of a system more complex than a set of points .
|
||||
//! The mass of each point and the density of each
|
||||
//! component of the composed system must be
|
||||
//! coherent. Note that this coherence cannot be checked.
|
||||
//! Nonetheless, you are advised to restrict your use of a
|
||||
//! GProp_PGProps object to a set of points and to
|
||||
//! create a GProp_GProps object in order to bring
|
||||
//! together global properties of different systems.
|
||||
class GProp_PGProps : public GProp_GProps
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Initializes a framework to compute global properties
|
||||
//! on a set of points.
|
||||
//! The point relative to which the inertia of the system is
|
||||
//! computed will be the origin (0, 0, 0) of the
|
||||
//! absolute Cartesian coordinate system.
|
||||
//! At initialization, the framework is empty, i.e. it retains
|
||||
//! no dimensional information such as mass and inertia.
|
||||
//! It is, however, now able to keep global properties of a
|
||||
//! set of points while new points are added using the
|
||||
//! AddPoint function.
|
||||
//! The set of points whose global properties are brought
|
||||
//! together by this framework will then be referred to as
|
||||
//! the current system. The current system is, however,
|
||||
//! not kept by this framework, which only keeps that
|
||||
//! system's global properties. Note that the current
|
||||
//! system may be more complex than a set of points.
|
||||
Standard_EXPORT GProp_PGProps();
|
||||
|
||||
//! Brings together the global properties already
|
||||
//! retained by this framework with those induced by
|
||||
//! the point Pnt. Pnt may be the first point of the current system.
|
||||
//! A point mass is attached to the point Pnt, it is either
|
||||
//! equal to 1. or to Density.
|
||||
Standard_EXPORT void AddPoint (const gp_Pnt& P);
|
||||
|
||||
|
||||
//! Adds a new point P with its density in the system of points
|
||||
//! Exceptions
|
||||
//! Standard_DomainError if the mass value Density
|
||||
//! is less than gp::Resolution().
|
||||
Standard_EXPORT void AddPoint (const gp_Pnt& P, const Standard_Real Density);
|
||||
|
||||
|
||||
//! computes the global properties of the system of points Pnts.
|
||||
//! The density of the points are defaulted to all being 1
|
||||
Standard_EXPORT GProp_PGProps(const TColgp_Array1OfPnt& Pnts);
|
||||
|
||||
|
||||
//! computes the global properties of the system of points Pnts.
|
||||
//! The density of the points are defaulted to all being 1
|
||||
Standard_EXPORT GProp_PGProps(const TColgp_Array2OfPnt& Pnts);
|
||||
|
||||
|
||||
//! computes the global properties of the system of points Pnts.
|
||||
//! A density is associated with each point.
|
||||
//!
|
||||
//! raises if a density is lower or equal to Resolution from package
|
||||
//! gp.
|
||||
//!
|
||||
//! raises if the length of Pnts and the length of Density
|
||||
//! is not the same.
|
||||
Standard_EXPORT GProp_PGProps(const TColgp_Array1OfPnt& Pnts, const TColStd_Array1OfReal& Density);
|
||||
|
||||
|
||||
//! computes the global properties of the system of points Pnts.
|
||||
//! A density is associated with each point.
|
||||
//!
|
||||
//! Raised if a density is lower or equal to Resolution from package
|
||||
//! gp.
|
||||
//!
|
||||
//! Raised if the length of Pnts and the length of Density
|
||||
//! is not the same.
|
||||
Standard_EXPORT GProp_PGProps(const TColgp_Array2OfPnt& Pnts, const TColStd_Array2OfReal& Density);
|
||||
|
||||
|
||||
//! Computes the barycentre of a set of points. The density of the
|
||||
//! points is defaulted to 1.
|
||||
Standard_EXPORT static gp_Pnt Barycentre (const TColgp_Array1OfPnt& Pnts);
|
||||
|
||||
|
||||
//! Computes the barycentre of a set of points. The density of the
|
||||
//! points is defaulted to 1.
|
||||
Standard_EXPORT static gp_Pnt Barycentre (const TColgp_Array2OfPnt& Pnts);
|
||||
|
||||
|
||||
//! Computes the barycentre of a set of points. A density is associated
|
||||
//! with each point.
|
||||
//!
|
||||
//! raises if a density is lower or equal to Resolution from package
|
||||
//! gp.
|
||||
//!
|
||||
//! Raised if the length of Pnts and the length of Density
|
||||
//! is not the same.
|
||||
Standard_EXPORT static void Barycentre (const TColgp_Array1OfPnt& Pnts, const TColStd_Array1OfReal& Density, Standard_Real& Mass, gp_Pnt& G);
|
||||
|
||||
|
||||
//! Computes the barycentre of a set of points. A density is associated
|
||||
//! with each point.
|
||||
//!
|
||||
//! Raised if a density is lower or equal to Resolution from package
|
||||
//! gp.
|
||||
//!
|
||||
//! Raised if the length of Pnts and the length of Density
|
||||
//! is not the same.
|
||||
Standard_EXPORT static void Barycentre (const TColgp_Array2OfPnt& Pnts, const TColStd_Array2OfReal& Density, Standard_Real& Mass, gp_Pnt& G);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _GProp_PGProps_HeaderFile
|
@@ -1,183 +0,0 @@
|
||||
-- Created on: 1992-02-17
|
||||
-- Created by: Jean Claude VAUTHIER
|
||||
-- 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 PrincipalProps
|
||||
|
||||
|
||||
from GProp
|
||||
|
||||
---Purpose:
|
||||
-- A framework to present the principal properties of
|
||||
-- inertia of a system of which global properties are
|
||||
-- computed by a GProp_GProps object.
|
||||
-- There is always a set of axes for which the
|
||||
-- products of inertia of a geometric system are equal
|
||||
-- to 0; i.e. the matrix of inertia of the system is
|
||||
-- diagonal. These axes are the principal axes of
|
||||
-- inertia. Their origin is coincident with the center of
|
||||
-- mass of the system. The associated moments are
|
||||
-- called the principal moments of inertia.
|
||||
-- This sort of presentation object is created, filled and
|
||||
-- returned by the function PrincipalProperties for
|
||||
-- any GProp_GProps object, and can be queried to access the result.
|
||||
-- Note: The system whose principal properties of
|
||||
-- inertia are returned by this framework is referred to
|
||||
-- as the current system. The current system,
|
||||
-- however, is retained neither by this presentation
|
||||
-- framework nor by the GProp_GProps object which activates it.
|
||||
uses Vec from gp,
|
||||
Pnt from gp
|
||||
|
||||
raises UndefinedAxis from GProp
|
||||
|
||||
is
|
||||
|
||||
|
||||
|
||||
|
||||
Create returns PrincipalProps;
|
||||
--- Purpose : creates an undefined PrincipalProps.
|
||||
|
||||
|
||||
HasSymmetryAxis (me) returns Boolean is static;
|
||||
--- Purpose :
|
||||
-- returns true if the geometric system has an axis of symmetry.
|
||||
-- For comparing moments relative tolerance 1.e-10 is used.
|
||||
-- Usually it is enough for objects, restricted by faces with
|
||||
-- analitycal geometry.
|
||||
|
||||
HasSymmetryAxis (me; aTol : Real) returns Boolean is static;
|
||||
--- Purpose :
|
||||
-- returns true if the geometric system has an axis of symmetry.
|
||||
-- aTol is relative tolerance for cheking equality of moments
|
||||
-- If aTol == 0, relative tolerance is ~ 1.e-16 (Epsilon(I))
|
||||
|
||||
|
||||
HasSymmetryPoint (me) returns Boolean is static;
|
||||
--- Purpose :
|
||||
-- returns true if the geometric system has a point of symmetry.
|
||||
-- For comparing moments relative tolerance 1.e-10 is used.
|
||||
-- Usually it is enough for objects, restricted by faces with
|
||||
-- analitycal geometry.
|
||||
|
||||
HasSymmetryPoint (me; aTol : Real) returns Boolean is static;
|
||||
--- Purpose :
|
||||
-- returns true if the geometric system has a point of symmetry.
|
||||
-- aTol is relative tolerance for cheking equality of moments
|
||||
-- If aTol == 0, relative tolerance is ~ 1.e-16 (Epsilon(I))
|
||||
|
||||
|
||||
Moments (me; Ixx, Iyy, Izz: out Real) is static;
|
||||
--- Purpose : Ixx, Iyy and Izz return the principal moments of inertia
|
||||
-- in the current system.
|
||||
-- Notes :
|
||||
-- - If the current system has an axis of symmetry, two
|
||||
-- of the three values Ixx, Iyy and Izz are equal. They
|
||||
-- indicate which eigen vectors define an infinity of
|
||||
-- axes of principal inertia.
|
||||
-- - If the current system has a center of symmetry, Ixx,
|
||||
-- Iyy and Izz are equal.
|
||||
|
||||
|
||||
FirstAxisOfInertia (me) returns Vec
|
||||
--- Purpose : returns the first axis of inertia.
|
||||
raises UndefinedAxis
|
||||
--- Purpose :
|
||||
-- if the system has a point of symmetry there is an infinity of
|
||||
-- solutions. It is not possible to defines the three axis of
|
||||
-- inertia.
|
||||
---C++: return const&
|
||||
is static;
|
||||
|
||||
SecondAxisOfInertia (me) returns Vec
|
||||
--- Purpose : returns the second axis of inertia.
|
||||
raises UndefinedAxis
|
||||
--- Purpose :
|
||||
-- if the system has a point of symmetry or an axis of symmetry the
|
||||
-- second and the third axis of symmetry are undefined.
|
||||
---C++: return const&
|
||||
is static;
|
||||
|
||||
|
||||
ThirdAxisOfInertia (me) returns Vec
|
||||
--- Purpose : returns the third axis of inertia.
|
||||
-- This and the above functions return the first, second or third eigen vector of the
|
||||
-- matrix of inertia of the current system.
|
||||
-- The first, second and third principal axis of inertia
|
||||
-- pass through the center of mass of the current
|
||||
-- system. They are respectively parallel to these three eigen vectors.
|
||||
-- Note that:
|
||||
-- - If the current system has an axis of symmetry, any
|
||||
-- axis is an axis of principal inertia if it passes
|
||||
-- through the center of mass of the system, and runs
|
||||
-- parallel to a linear combination of the two eigen
|
||||
-- vectors of the matrix of inertia, corresponding to the
|
||||
-- two eigen values which are equal. If the current
|
||||
-- system has a center of symmetry, any axis passing
|
||||
-- through the center of mass of the system is an axis
|
||||
-- of principal inertia. Use the functions
|
||||
-- HasSymmetryAxis and HasSymmetryPoint to
|
||||
-- check these particular cases, where the returned
|
||||
-- eigen vectors define an infinity of principal axis of inertia.
|
||||
-- - The Moments function can be used to know which
|
||||
-- of the three eigen vectors corresponds to the two
|
||||
-- eigen values which are equal.
|
||||
raises UndefinedAxis
|
||||
--- Purpose :
|
||||
-- if the system has a point of symmetry or an axis of symmetry the
|
||||
-- second and the third axis of symmetry are undefined.
|
||||
---C++: return const&
|
||||
is static;
|
||||
|
||||
|
||||
RadiusOfGyration (me; Rxx, Ryy, Rzz : out Real) is static;
|
||||
--- Purpose : Returns the principal radii of gyration Rxx, Ryy
|
||||
-- and Rzz are the radii of gyration of the current
|
||||
-- system about its three principal axes of inertia.
|
||||
-- Note that:
|
||||
-- - If the current system has an axis of symmetry,
|
||||
-- two of the three values Rxx, Ryy and Rzz are equal.
|
||||
-- - If the current system has a center of symmetry,
|
||||
-- Rxx, Ryy and Rzz are equal.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Create (Ixx, Iyy, Izz, Rxx, Ryy, Rzz : Real; Vxx, Vyy, Vzz : Vec; G : Pnt)
|
||||
returns PrincipalProps
|
||||
is private;
|
||||
|
||||
|
||||
|
||||
fields
|
||||
|
||||
i1 : Real;
|
||||
i2 : Real;
|
||||
i3 : Real;
|
||||
r1 : Real;
|
||||
r2 : Real;
|
||||
r3 : Real;
|
||||
v1 : Vec;
|
||||
v2 : Vec;
|
||||
v3 : Vec;
|
||||
g : Pnt;
|
||||
|
||||
friends
|
||||
|
||||
PrincipalProperties from GProps (me)
|
||||
|
||||
end PrincipalProps;
|
@@ -12,8 +12,11 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <GProp_PrincipalProps.ixx>
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <GProp_PrincipalProps.hxx>
|
||||
#include <GProp_UndefinedAxis.hxx>
|
||||
|
||||
typedef gp_Vec Vec;
|
||||
typedef gp_Pnt Pnt;
|
||||
|
200
src/GProp/GProp_PrincipalProps.hxx
Normal file
200
src/GProp/GProp_PrincipalProps.hxx
Normal file
@@ -0,0 +1,200 @@
|
||||
// Created on: 1992-02-17
|
||||
// Created by: Jean Claude VAUTHIER
|
||||
// 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 _GProp_PrincipalProps_HeaderFile
|
||||
#define _GProp_PrincipalProps_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <GProp_GProps.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class GProp_UndefinedAxis;
|
||||
class gp_Vec;
|
||||
class gp_Pnt;
|
||||
|
||||
|
||||
|
||||
//! A framework to present the principal properties of
|
||||
//! inertia of a system of which global properties are
|
||||
//! computed by a GProp_GProps object.
|
||||
//! There is always a set of axes for which the
|
||||
//! products of inertia of a geometric system are equal
|
||||
//! to 0; i.e. the matrix of inertia of the system is
|
||||
//! diagonal. These axes are the principal axes of
|
||||
//! inertia. Their origin is coincident with the center of
|
||||
//! mass of the system. The associated moments are
|
||||
//! called the principal moments of inertia.
|
||||
//! This sort of presentation object is created, filled and
|
||||
//! returned by the function PrincipalProperties for
|
||||
//! any GProp_GProps object, and can be queried to access the result.
|
||||
//! Note: The system whose principal properties of
|
||||
//! inertia are returned by this framework is referred to
|
||||
//! as the current system. The current system,
|
||||
//! however, is retained neither by this presentation
|
||||
//! framework nor by the GProp_GProps object which activates it.
|
||||
class GProp_PrincipalProps
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! creates an undefined PrincipalProps.
|
||||
Standard_EXPORT GProp_PrincipalProps();
|
||||
|
||||
|
||||
//! returns true if the geometric system has an axis of symmetry.
|
||||
//! For comparing moments relative tolerance 1.e-10 is used.
|
||||
//! Usually it is enough for objects, restricted by faces with
|
||||
//! analitycal geometry.
|
||||
Standard_EXPORT Standard_Boolean HasSymmetryAxis() const;
|
||||
|
||||
|
||||
//! returns true if the geometric system has an axis of symmetry.
|
||||
//! aTol is relative tolerance for cheking equality of moments
|
||||
//! If aTol == 0, relative tolerance is ~ 1.e-16 (Epsilon(I))
|
||||
Standard_EXPORT Standard_Boolean HasSymmetryAxis (const Standard_Real aTol) const;
|
||||
|
||||
|
||||
//! returns true if the geometric system has a point of symmetry.
|
||||
//! For comparing moments relative tolerance 1.e-10 is used.
|
||||
//! Usually it is enough for objects, restricted by faces with
|
||||
//! analitycal geometry.
|
||||
Standard_EXPORT Standard_Boolean HasSymmetryPoint() const;
|
||||
|
||||
|
||||
//! returns true if the geometric system has a point of symmetry.
|
||||
//! aTol is relative tolerance for cheking equality of moments
|
||||
//! If aTol == 0, relative tolerance is ~ 1.e-16 (Epsilon(I))
|
||||
Standard_EXPORT Standard_Boolean HasSymmetryPoint (const Standard_Real aTol) const;
|
||||
|
||||
//! Ixx, Iyy and Izz return the principal moments of inertia
|
||||
//! in the current system.
|
||||
//! Notes :
|
||||
//! - If the current system has an axis of symmetry, two
|
||||
//! of the three values Ixx, Iyy and Izz are equal. They
|
||||
//! indicate which eigen vectors define an infinity of
|
||||
//! axes of principal inertia.
|
||||
//! - If the current system has a center of symmetry, Ixx,
|
||||
//! Iyy and Izz are equal.
|
||||
Standard_EXPORT void Moments (Standard_Real& Ixx, Standard_Real& Iyy, Standard_Real& Izz) const;
|
||||
|
||||
//! returns the first axis of inertia.
|
||||
//!
|
||||
//! if the system has a point of symmetry there is an infinity of
|
||||
//! solutions. It is not possible to defines the three axis of
|
||||
//! inertia.
|
||||
Standard_EXPORT const gp_Vec& FirstAxisOfInertia() const;
|
||||
|
||||
//! returns the second axis of inertia.
|
||||
//!
|
||||
//! if the system has a point of symmetry or an axis of symmetry the
|
||||
//! second and the third axis of symmetry are undefined.
|
||||
Standard_EXPORT const gp_Vec& SecondAxisOfInertia() const;
|
||||
|
||||
//! returns the third axis of inertia.
|
||||
//! This and the above functions return the first, second or third eigen vector of the
|
||||
//! matrix of inertia of the current system.
|
||||
//! The first, second and third principal axis of inertia
|
||||
//! pass through the center of mass of the current
|
||||
//! system. They are respectively parallel to these three eigen vectors.
|
||||
//! Note that:
|
||||
//! - If the current system has an axis of symmetry, any
|
||||
//! axis is an axis of principal inertia if it passes
|
||||
//! through the center of mass of the system, and runs
|
||||
//! parallel to a linear combination of the two eigen
|
||||
//! vectors of the matrix of inertia, corresponding to the
|
||||
//! two eigen values which are equal. If the current
|
||||
//! system has a center of symmetry, any axis passing
|
||||
//! through the center of mass of the system is an axis
|
||||
//! of principal inertia. Use the functions
|
||||
//! HasSymmetryAxis and HasSymmetryPoint to
|
||||
//! check these particular cases, where the returned
|
||||
//! eigen vectors define an infinity of principal axis of inertia.
|
||||
//! - The Moments function can be used to know which
|
||||
//! of the three eigen vectors corresponds to the two
|
||||
//! eigen values which are equal.
|
||||
//!
|
||||
//! if the system has a point of symmetry or an axis of symmetry the
|
||||
//! second and the third axis of symmetry are undefined.
|
||||
Standard_EXPORT const gp_Vec& ThirdAxisOfInertia() const;
|
||||
|
||||
//! Returns the principal radii of gyration Rxx, Ryy
|
||||
//! and Rzz are the radii of gyration of the current
|
||||
//! system about its three principal axes of inertia.
|
||||
//! Note that:
|
||||
//! - If the current system has an axis of symmetry,
|
||||
//! two of the three values Rxx, Ryy and Rzz are equal.
|
||||
//! - If the current system has a center of symmetry,
|
||||
//! Rxx, Ryy and Rzz are equal.
|
||||
Standard_EXPORT void RadiusOfGyration (Standard_Real& Rxx, Standard_Real& Ryy, Standard_Real& Rzz) const;
|
||||
|
||||
|
||||
friend
|
||||
//! Computes the principal properties of inertia of the current system.
|
||||
//! There is always a set of axes for which the products
|
||||
//! of inertia of a geometric system are equal to 0; i.e. the
|
||||
//! matrix of inertia of the system is diagonal. These axes
|
||||
//! are the principal axes of inertia. Their origin is
|
||||
//! coincident with the center of mass of the system. The
|
||||
//! associated moments are called the principal moments of inertia.
|
||||
//! This function computes the eigen values and the
|
||||
//! eigen vectors of the matrix of inertia of the system.
|
||||
//! Results are stored by using a presentation framework
|
||||
//! of principal properties of inertia
|
||||
//! (GProp_PrincipalProps object) which may be
|
||||
//! queried to access the value sought.
|
||||
Standard_EXPORT GProp_PrincipalProps GProp_GProps::PrincipalProperties() const;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT GProp_PrincipalProps(const Standard_Real Ixx, const Standard_Real Iyy, const Standard_Real Izz, const Standard_Real Rxx, const Standard_Real Ryy, const Standard_Real Rzz, const gp_Vec& Vxx, const gp_Vec& Vyy, const gp_Vec& Vzz, const gp_Pnt& G);
|
||||
|
||||
|
||||
Standard_Real i1;
|
||||
Standard_Real i2;
|
||||
Standard_Real i3;
|
||||
Standard_Real r1;
|
||||
Standard_Real r2;
|
||||
Standard_Real r3;
|
||||
gp_Vec v1;
|
||||
gp_Vec v2;
|
||||
gp_Vec v3;
|
||||
gp_Pnt g;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _GProp_PrincipalProps_HeaderFile
|
@@ -1,60 +0,0 @@
|
||||
-- Created on: 1992-12-02
|
||||
-- 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 SelGProps from GProp inherits GProps
|
||||
|
||||
---Purpose:
|
||||
-- Computes the global properties of a bounded
|
||||
-- elementary surface in 3d (surface of the gp package)
|
||||
|
||||
uses Cylinder from gp,
|
||||
Cone from gp,
|
||||
Pnt from gp,
|
||||
Sphere from gp,
|
||||
Torus from gp
|
||||
|
||||
is
|
||||
|
||||
Create returns SelGProps;
|
||||
|
||||
Create (S : Cylinder; Alpha1, Alpha2, Z1, Z2 : Real; SLocation : Pnt)
|
||||
returns SelGProps;
|
||||
|
||||
|
||||
Create (S : Cone; Alpha1, Alpha2, Z1, Z2 : Real; SLocation : Pnt)
|
||||
returns SelGProps;
|
||||
|
||||
|
||||
Create (S : Sphere from gp; Teta1, Teta2, Alpha1, Alpha2 : Real;
|
||||
SLocation : Pnt)
|
||||
returns SelGProps;
|
||||
|
||||
|
||||
Create (S : Torus from gp; Teta1, Teta2, Alpha1, Alpha2 : Real;
|
||||
SLocation : Pnt)
|
||||
returns SelGProps;
|
||||
|
||||
SetLocation(me : in out ;SLocation :Pnt);
|
||||
|
||||
Perform(me : in out;S : Cylinder; Alpha1, Alpha2, Z1, Z2 : Real);
|
||||
|
||||
Perform(me : in out;S : Cone; Alpha1, Alpha2, Z1, Z2 : Real);
|
||||
|
||||
Perform(me : in out;S : Sphere; Teta1, Teta2, Alpha1, Alpha2 : Real);
|
||||
|
||||
Perform(me : in out;S : Torus; Teta1, Teta2, Alpha1, Alpha2 : Real);
|
||||
|
||||
end SelGProps;
|
@@ -12,12 +12,18 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <GProp_SelGProps.ixx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
|
||||
#include <gp_Cone.hxx>
|
||||
#include <gp_Cylinder.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Sphere.hxx>
|
||||
#include <gp_Torus.hxx>
|
||||
#include <GProp.hxx>
|
||||
#include <GProp_SelGProps.hxx>
|
||||
#include <math_Jacobi.hxx>
|
||||
#include <math_Matrix.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
#include <math_Jacobi.hxx>
|
||||
#include <GProp.hxx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
|
||||
GProp_SelGProps::GProp_SelGProps(){};
|
||||
|
||||
|
86
src/GProp/GProp_SelGProps.hxx
Normal file
86
src/GProp/GProp_SelGProps.hxx
Normal file
@@ -0,0 +1,86 @@
|
||||
// Created on: 1992-12-02
|
||||
// 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 _GProp_SelGProps_HeaderFile
|
||||
#define _GProp_SelGProps_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <GProp_GProps.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
class gp_Cylinder;
|
||||
class gp_Pnt;
|
||||
class gp_Cone;
|
||||
class gp_Sphere;
|
||||
class gp_Torus;
|
||||
|
||||
|
||||
|
||||
//! Computes the global properties of a bounded
|
||||
//! elementary surface in 3d (surface of the gp package)
|
||||
class GProp_SelGProps : public GProp_GProps
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT GProp_SelGProps();
|
||||
|
||||
Standard_EXPORT GProp_SelGProps(const gp_Cylinder& S, const Standard_Real Alpha1, const Standard_Real Alpha2, const Standard_Real Z1, const Standard_Real Z2, const gp_Pnt& SLocation);
|
||||
|
||||
Standard_EXPORT GProp_SelGProps(const gp_Cone& S, const Standard_Real Alpha1, const Standard_Real Alpha2, const Standard_Real Z1, const Standard_Real Z2, const gp_Pnt& SLocation);
|
||||
|
||||
Standard_EXPORT GProp_SelGProps(const gp_Sphere& S, const Standard_Real Teta1, const Standard_Real Teta2, const Standard_Real Alpha1, const Standard_Real Alpha2, const gp_Pnt& SLocation);
|
||||
|
||||
Standard_EXPORT GProp_SelGProps(const gp_Torus& S, const Standard_Real Teta1, const Standard_Real Teta2, const Standard_Real Alpha1, const Standard_Real Alpha2, const gp_Pnt& SLocation);
|
||||
|
||||
Standard_EXPORT void SetLocation (const gp_Pnt& SLocation);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Cylinder& S, const Standard_Real Alpha1, const Standard_Real Alpha2, const Standard_Real Z1, const Standard_Real Z2);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Cone& S, const Standard_Real Alpha1, const Standard_Real Alpha2, const Standard_Real Z1, const Standard_Real Z2);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Sphere& S, const Standard_Real Teta1, const Standard_Real Teta2, const Standard_Real Alpha1, const Standard_Real Alpha2);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Torus& S, const Standard_Real Teta1, const Standard_Real Teta2, const Standard_Real Alpha1, const Standard_Real Alpha2);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _GProp_SelGProps_HeaderFile
|
37
src/GProp/GProp_UndefinedAxis.hxx
Normal file
37
src/GProp/GProp_UndefinedAxis.hxx
Normal file
@@ -0,0 +1,37 @@
|
||||
// Created on: 1991-03-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 _GProp_UndefinedAxis_HeaderFile
|
||||
#define _GProp_UndefinedAxis_HeaderFile
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Standard_DefineException.hxx>
|
||||
#include <Standard_SStream.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
|
||||
class GProp_UndefinedAxis;
|
||||
DEFINE_STANDARD_HANDLE(GProp_UndefinedAxis, Standard_DomainError)
|
||||
|
||||
#if !defined No_Exception && !defined No_GProp_UndefinedAxis
|
||||
#define GProp_UndefinedAxis_Raise_if(CONDITION, MESSAGE) \
|
||||
if (CONDITION) GProp_UndefinedAxis::Raise(MESSAGE);
|
||||
#else
|
||||
#define GProp_UndefinedAxis_Raise_if(CONDITION, MESSAGE)
|
||||
#endif
|
||||
|
||||
DEFINE_STANDARD_EXCEPTION(GProp_UndefinedAxis, Standard_DomainError)
|
||||
|
||||
#endif // _GProp_UndefinedAxis_HeaderFile
|
36
src/GProp/GProp_ValueType.hxx
Normal file
36
src/GProp/GProp_ValueType.hxx
Normal file
@@ -0,0 +1,36 @@
|
||||
// Created on: 1991-03-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 _GProp_ValueType_HeaderFile
|
||||
#define _GProp_ValueType_HeaderFile
|
||||
|
||||
//! Algorithmes :
|
||||
enum GProp_ValueType
|
||||
{
|
||||
GProp_Mass,
|
||||
GProp_CenterMassX,
|
||||
GProp_CenterMassY,
|
||||
GProp_CenterMassZ,
|
||||
GProp_InertiaXX,
|
||||
GProp_InertiaYY,
|
||||
GProp_InertiaZZ,
|
||||
GProp_InertiaXY,
|
||||
GProp_InertiaXZ,
|
||||
GProp_InertiaYZ,
|
||||
GProp_Unknown
|
||||
};
|
||||
|
||||
#endif // _GProp_ValueType_HeaderFile
|
@@ -1,65 +0,0 @@
|
||||
-- Created on: 1992-12-02
|
||||
-- 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 VelGProps from GProp inherits GProps
|
||||
|
||||
--- Purpose :
|
||||
-- Computes the global properties and the volume of a geometric solid
|
||||
-- (3D closed region of space)
|
||||
-- The solid can be elementary(definition in the gp package)
|
||||
|
||||
|
||||
uses Cone from gp,
|
||||
Cylinder from gp,
|
||||
Pnt from gp,
|
||||
Sphere from gp,
|
||||
Torus from gp
|
||||
|
||||
|
||||
is
|
||||
|
||||
|
||||
Create returns VelGProps;
|
||||
|
||||
|
||||
Create (S : Cylinder; Alpha1, Alpha2, Z1, Z2 : Real; VLocation : Pnt)
|
||||
returns VelGProps;
|
||||
|
||||
|
||||
Create (S : Cone; Alpha1, Alpha2, Z1, Z2 : Real; VLocation : Pnt)
|
||||
returns VelGProps;
|
||||
|
||||
|
||||
Create (S : Sphere; Teta1, Teta2, Alpha1, Alpha2 : Real; VLocation : Pnt)
|
||||
returns VelGProps;
|
||||
|
||||
|
||||
Create (S : Torus; Teta1, Teta2, Alpha1, Alpha2 : Real; VLocation : Pnt)
|
||||
returns VelGProps;
|
||||
|
||||
|
||||
SetLocation(me : in out ;VLocation :Pnt);
|
||||
|
||||
Perform(me : in out;S : Cylinder; Alpha1, Alpha2, Z1, Z2 : Real);
|
||||
|
||||
Perform(me : in out;S : Cone; Alpha1, Alpha2, Z1, Z2 : Real);
|
||||
|
||||
Perform(me : in out;S : Sphere; Teta1, Teta2, Alpha1, Alpha2 : Real);
|
||||
|
||||
Perform(me : in out;S : Torus; Teta1, Teta2, Alpha1, Alpha2 : Real);
|
||||
|
||||
end VelGProps;
|
||||
|
@@ -12,14 +12,19 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <GProp_VelGProps.ixx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
|
||||
#include <gp.hxx>
|
||||
#include <gp_Cone.hxx>
|
||||
#include <gp_Cylinder.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Sphere.hxx>
|
||||
#include <gp_Torus.hxx>
|
||||
#include <GProp.hxx>
|
||||
#include <GProp_VelGProps.hxx>
|
||||
#include <math_Jacobi.hxx>
|
||||
#include <math_Matrix.hxx>
|
||||
#include <math_Vector.hxx>
|
||||
#include <math_Jacobi.hxx>
|
||||
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
|
||||
GProp_VelGProps::GProp_VelGProps(){}
|
||||
|
||||
|
87
src/GProp/GProp_VelGProps.hxx
Normal file
87
src/GProp/GProp_VelGProps.hxx
Normal file
@@ -0,0 +1,87 @@
|
||||
// Created on: 1992-12-02
|
||||
// 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 _GProp_VelGProps_HeaderFile
|
||||
#define _GProp_VelGProps_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <GProp_GProps.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
class gp_Cylinder;
|
||||
class gp_Pnt;
|
||||
class gp_Cone;
|
||||
class gp_Sphere;
|
||||
class gp_Torus;
|
||||
|
||||
|
||||
|
||||
//! Computes the global properties and the volume of a geometric solid
|
||||
//! (3D closed region of space)
|
||||
//! The solid can be elementary(definition in the gp package)
|
||||
class GProp_VelGProps : public GProp_GProps
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT GProp_VelGProps();
|
||||
|
||||
Standard_EXPORT GProp_VelGProps(const gp_Cylinder& S, const Standard_Real Alpha1, const Standard_Real Alpha2, const Standard_Real Z1, const Standard_Real Z2, const gp_Pnt& VLocation);
|
||||
|
||||
Standard_EXPORT GProp_VelGProps(const gp_Cone& S, const Standard_Real Alpha1, const Standard_Real Alpha2, const Standard_Real Z1, const Standard_Real Z2, const gp_Pnt& VLocation);
|
||||
|
||||
Standard_EXPORT GProp_VelGProps(const gp_Sphere& S, const Standard_Real Teta1, const Standard_Real Teta2, const Standard_Real Alpha1, const Standard_Real Alpha2, const gp_Pnt& VLocation);
|
||||
|
||||
Standard_EXPORT GProp_VelGProps(const gp_Torus& S, const Standard_Real Teta1, const Standard_Real Teta2, const Standard_Real Alpha1, const Standard_Real Alpha2, const gp_Pnt& VLocation);
|
||||
|
||||
Standard_EXPORT void SetLocation (const gp_Pnt& VLocation);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Cylinder& S, const Standard_Real Alpha1, const Standard_Real Alpha2, const Standard_Real Z1, const Standard_Real Z2);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Cone& S, const Standard_Real Alpha1, const Standard_Real Alpha2, const Standard_Real Z1, const Standard_Real Z2);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Sphere& S, const Standard_Real Teta1, const Standard_Real Teta2, const Standard_Real Alpha1, const Standard_Real Alpha2);
|
||||
|
||||
Standard_EXPORT void Perform (const gp_Torus& S, const Standard_Real Teta1, const Standard_Real Teta2, const Standard_Real Alpha1, const Standard_Real Alpha2);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _GProp_VelGProps_HeaderFile
|
Reference in New Issue
Block a user